@incodetech/welcome 1.85.0-20251216190848.0 → 1.85.0-20251216195123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,7 +63,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[St]+=1);const breakpoints$3={
63
63
  justify-content: center;
64
64
  align-items: center;
65
65
  flex-direction: column;
66
- `;typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let Be,Le;return{promise:new Promise((tt,nt)=>{Be=tt,Le=nt}),resolve:Be,reject:Le}});class InterruptionHandler{constructor(){this.boundVisibilityChange=this.handleVisibilityChange.bind(this),this.boundOnline=this.handleOnline.bind(this),this.boundOffline=this.handleOffline.bind(this),this.boundUnhandledRejection=this.handleUnhandledRejection.bind(this),this.boundError=this.handleError.bind(this),this.initialized=!1}registerEventListeners(){this.initialized||(document.addEventListener("visibilitychange",this.boundVisibilityChange),window.addEventListener("online",this.boundOnline),window.addEventListener("offline",this.boundOffline),window.addEventListener("unhandledrejection",this.boundUnhandledRejection),window.addEventListener("error",this.boundError),this.initialized=!0)}removeEventListeners(){this.initialized&&(this.initialized=!1,document.removeEventListener("visibilitychange",this.boundVisibilityChange),window.removeEventListener("online",this.boundOnline),window.removeEventListener("offline",this.boundOffline),window.removeEventListener("unhandledrejection",this.boundUnhandledRejection),window.removeEventListener("error",this.boundError))}handleVisibilityChange(){document.hidden?this.onAppHidden():this.onAppVisible()}onAppHidden(){}onAppVisible(){}handleOnline(){}handleOffline(){}handleUnhandledRejection(Le){}handleError(Le){}}const regex$1={CURP_PATTERN:/^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,EMAIL_PATTERN:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};function webgl(){let Be,Le,Ye=256,tt=128;Be=document.body.appendChild(document.createElement("canvas")),Be.width=Ye,Be.height=tt;try{Le=Be.getContext("webgl2")||Be.getContext("experimental-webgl2")||Be.getContext("webgl")||Be.getContext("experimental-webgl")||Be.getContext("moz-webgl");const nt="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",ft="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",ht=Le.createBuffer();Le.bindBuffer(Le.ARRAY_BUFFER,ht);const gt=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0]);Le.bufferData(Le.ARRAY_BUFFER,gt,Le.STATIC_DRAW),ht.itemSize=3,ht.numItems=3;const At=Le.createProgram(),xt=Le.createShader(Le.VERTEX_SHADER);Le.shaderSource(xt,nt),Le.compileShader(xt);const Et=Le.createShader(Le.FRAGMENT_SHADER);Le.shaderSource(Et,ft),Le.compileShader(Et),Le.attachShader(At,xt),Le.attachShader(At,Et),Le.linkProgram(At),Le.useProgram(At),At.vertexPosAttrib=Le.getAttribLocation(At,"attrVertex"),At.offsetUniform=Le.getUniformLocation(At,"uniformOffset"),Le.enableVertexAttribArray(At.vertexPosAttrib),Le.vertexAttribPointer(At.vertexPosAttrib,ht.itemSize,Le.FLOAT,!1,0,0),Le.uniform2f(At.offsetUniform,1,1),Le.drawArrays(Le.TRIANGLE_STRIP,0,ht.numItems);let yt="";const Ct=new Uint8Array(Ye*tt*4);return Le.readPixels(0,0,Ye,tt,Le.RGBA,Le.UNSIGNED_BYTE,Ct),yt=JSON.stringify(Ct).replace(/,?"[0-9]+":/g,""),document.body.removeChild(Be),sha256(yt)}catch{return""}}const sha256=(()=>{let Be=1,Le,Ye=[],tt=[];for(;++Be<18;)for(Le=Be*Be;Le<312;Le+=Be)Ye[Le]=1;function nt(gt,At){return Math.pow(gt,1/At)%1*4294967296|0}for(Be=1,Le=0;Be<313;)Ye[++Be]||(tt[Le]=nt(Be,2),Ye[Le++]=nt(Be,3));function ft(gt,At){return gt>>>At|gt<<32-At}function ht(gt){let At=tt.slice(Be=0),xt=unescape(encodeURI(gt)),Et=[],yt=xt.length,Ct=[],kt,vt,bt;for(;Be<yt;)Ct[Be>>2]|=(xt.charCodeAt(Be)&255)<<8*(3-Be++%4);for(yt*=8,Ct[yt>>5]|=128<<24-yt%32,Ct[bt=yt+64>>5|15]=yt,Be=0;Be<bt;Be+=16){for(kt=At.slice(Le=0,8);Le<64;kt[4]+=vt)Le<16?Et[Le]=Ct[Le+Be]:Et[Le]=(ft(vt=Et[Le-2],17)^ft(vt,19)^vt>>>10)+(Et[Le-7]|0)+(ft(vt=Et[Le-15],7)^ft(vt,18)^vt>>>3)+(Et[Le-16]|0),kt.unshift((vt=(kt.pop()+(ft(gt=kt[4],6)^ft(gt,11)^ft(gt,25))+((gt&kt[5]^~gt&kt[6])+Ye[Le])|0)+(Et[Le++]|0))+(ft(yt=kt[0],2)^ft(yt,13)^ft(yt,22))+(yt&kt[1]^kt[1]&kt[2]^kt[2]&yt));for(Le=8;Le--;)At[Le]=kt[Le]+At[Le]}for(xt="";Le<63;)xt+=(At[++Le>>3]>>4*(7-Le%8)&15).toString(16);return xt}return ht})();var store;function getGlobalConfig$1(Be){return{lang:store==null?void 0:store.lang,message:Be==null?void 0:Be.message,abortEarly:store==null?void 0:store.abortEarly,abortPipeEarly:store==null?void 0:store.abortPipeEarly}}var store2;function getGlobalMessage$1(Be){return store2==null?void 0:store2.get(Be)}var store3;function getSchemaMessage$1(Be){return store3==null?void 0:store3.get(Be)}var store4;function getSpecificMessage$1(Be,Le){var Ye;return(Ye=store4==null?void 0:store4.get(Be))==null?void 0:Ye.get(Le)}function _stringify$4(Be){var Ye,tt;const Le=typeof Be;return Le==="string"?`"${Be}"`:Le==="number"||Le==="bigint"||Le==="boolean"?`${Be}`:Le==="object"||Le==="function"?(Be&&((tt=(Ye=Object.getPrototypeOf(Be))==null?void 0:Ye.constructor)==null?void 0:tt.name))??"null":Le}function _addIssue$1(Be,Le,Ye,tt,nt){const ft=nt&&"input"in nt?nt.input:Ye.value,ht=(nt==null?void 0:nt.expected)??Be.expects??null,gt=(nt==null?void 0:nt.received)??_stringify$4(ft),At={kind:Be.kind,type:Be.type,input:ft,expected:ht,received:gt,message:`Invalid ${Le}: ${ht?`Expected ${ht} but r`:"R"}eceived ${gt}`,requirement:Be.requirement,path:nt==null?void 0:nt.path,issues:nt==null?void 0:nt.issues,lang:tt.lang,abortEarly:tt.abortEarly,abortPipeEarly:tt.abortPipeEarly},xt=Be.kind==="schema",Et=(nt==null?void 0:nt.message)??Be.message??getSpecificMessage$1(Be.reference,At.lang)??(xt?getSchemaMessage$1(At.lang):null)??tt.message??getGlobalMessage$1(At.lang);Et!==void 0&&(At.message=typeof Et=="function"?Et(At):Et),xt&&(Ye.typed=!1),Ye.issues?Ye.issues.push(At):Ye.issues=[At]}function _getStandardProps$1(Be){return{version:1,vendor:"valibot",validate(Le){return Be["~run"]({value:Le},getGlobalConfig$1())}}}function _joinExpects(Be,Le){const Ye=[...new Set(Be)];return Ye.length>1?`(${Ye.join(` ${Le} `)})`:Ye[0]??"never"}function isValiError(Be){return Be instanceof ValiError}var ValiError=class extends Error{constructor(Be){super(Be[0].message),this.name="ValiError",this.issues=Be}};function getFallback$1(Be,Le,Ye){return typeof Be.fallback=="function"?Be.fallback(Le,Ye):Be.fallback}function getDefault$1(Be,Le,Ye){return typeof Be.default=="function"?Be.default(Le,Ye):Be.default}function boolean$2(Be){return{kind:"schema",type:"boolean",reference:boolean$2,expects:"boolean",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="boolean"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function custom(Be,Le){return{kind:"schema",type:"custom",reference:custom,expects:"unknown",async:!1,check:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return this.check(Ye.value)?Ye.typed=!0:_addIssue$1(this,"type",Ye,tt),Ye}}}function function_(Be){return{kind:"schema",type:"function",reference:function_,expects:"Function",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="function"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function literal(Be,Le){return{kind:"schema",type:"literal",reference:literal,expects:_stringify$4(Be),async:!1,literal:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return Ye.value===this.literal?Ye.typed=!0:_addIssue$1(this,"type",Ye,tt),Ye}}}function null_(Be){return{kind:"schema",type:"null",reference:null_,expects:"null",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return Le.value===null?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function number$3(Be){return{kind:"schema",type:"number",reference:number$3,expects:"number",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="number"&&!isNaN(Le.value)?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function object$1(Be,Le){return{kind:"schema",type:"object",reference:object$1,expects:"Object",async:!1,entries:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){var ft;const nt=Ye.value;if(nt&&typeof nt=="object"){Ye.typed=!0,Ye.value={};for(const ht in this.entries){const gt=this.entries[ht];if(ht in nt||(gt.type==="exact_optional"||gt.type==="optional"||gt.type==="nullish")&&gt.default!==void 0){const At=ht in nt?nt[ht]:getDefault$1(gt),xt=gt["~run"]({value:At},tt);if(xt.issues){const Et={type:"object",origin:"value",input:nt,key:ht,value:At};for(const yt of xt.issues)yt.path?yt.path.unshift(Et):yt.path=[Et],(ft=Ye.issues)==null||ft.push(yt);if(Ye.issues||(Ye.issues=xt.issues),tt.abortEarly){Ye.typed=!1;break}}xt.typed||(Ye.typed=!1),Ye.value[ht]=xt.value}else if(gt.fallback!==void 0)Ye.value[ht]=getFallback$1(gt);else if(gt.type!=="exact_optional"&&gt.type!=="optional"&&gt.type!=="nullish"&&(_addIssue$1(this,"key",Ye,tt,{input:void 0,expected:`"${ht}"`,path:[{type:"object",origin:"key",input:nt,key:ht,value:nt[ht]}]}),tt.abortEarly))break}}else _addIssue$1(this,"type",Ye,tt);return Ye}}}function optional$1(Be,Le){return{kind:"schema",type:"optional",reference:optional$1,expects:`(${Be.expects} | undefined)`,async:!1,wrapped:Be,default:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return Ye.value===void 0&&(this.default!==void 0&&(Ye.value=getDefault$1(this,Ye,tt)),Ye.value===void 0)?(Ye.typed=!0,Ye):this.wrapped["~run"](Ye,tt)}}}function string$3(Be){return{kind:"schema",type:"string",reference:string$3,expects:"string",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="string"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function _subIssues(Be){let Le;if(Be)for(const Ye of Be)Le?Le.push(...Ye.issues):Le=Ye.issues;return Le}function union(Be,Le){return{kind:"schema",type:"union",reference:union,expects:_joinExpects(Be.map(Ye=>Ye.expects),"|"),async:!1,options:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){let nt,ft,ht;for(const gt of this.options){const At=gt["~run"]({value:Ye.value},tt);if(At.typed)if(At.issues)ft?ft.push(At):ft=[At];else{nt=At;break}else ht?ht.push(At):ht=[At]}if(nt)return nt;if(ft){if(ft.length===1)return ft[0];_addIssue$1(this,"type",Ye,tt,{issues:_subIssues(ft)}),Ye.typed=!0}else{if((ht==null?void 0:ht.length)===1)return ht[0];_addIssue$1(this,"type",Ye,tt,{issues:_subIssues(ht)})}return Ye}}}function parse$8(Be,Le,Ye){const tt=Be["~run"]({value:Le},getGlobalConfig$1(Ye));if(tt.issues)throw new ValiError(tt.issues);return tt.value}function validate$2(...Be){try{Be.forEach(({schema:Le,value:Ye})=>parse$8(Le,Ye))}catch(Le){if(isValiError(Le)){const Ye=Le.issues.map(tt=>{var ft;return`${((ft=tt.path)==null?void 0:ft.map(ht=>ht.key).join("."))||"root"}: ${tt.message}`}).join(", ");throw new Error(`Validation failed: ${Ye}`)}throw Le}}exports.api=void 0;function setApi(Be){exports.api=Be}function setToken(Be){exports.api.defaults.headers["X-Incode-Hardware-Id"]=Be}const eventsQueue=[];function addEvent(Be){const{token:Le,code:Ye,module:tt,screen:nt,clientTimestamp:ft,payload:ht={}}=Be;if(!Le){eventsQueue.push(Be);return}return exports.api.post("/omni/interview-events",[{code:Ye,module:tt,screen:nt,clientTimestamp:ft??new Date().getTime(),payload:ht}],{headers:{"X-Incode-Hardware-Id":Le}}).catch(()=>{})}function emptyQueue(Be){eventsQueue.forEach(Le=>{addEvent({...Le,token:Be})})}const state={token:null};var PipelineProfileName=(Be=>(Be[Be.IdCapture_2_01=0]="IdCapture_2_01",Be[Be.IdCapture_2_02=1]="IdCapture_2_02",Be[Be.IdCapture_3_02=2]="IdCapture_3_02",Be[Be.IdVideoSelfie_2_01=3]="IdVideoSelfie_2_01",Be[Be.SelfieWithAggregationMetrics=4]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=5]="SelfieWithQualityMetrics",Be[Be.SelfieVideoSelfie=6]="SelfieVideoSelfie",Be))(PipelineProfileName||{});class PipelineProfile{constructor(Le,Ye,tt,nt,ft,ht=null,gt=""){this.pipelineType=Le,this.name=Ye,this.detectionType=tt,this.modelNames=nt,this.parameters=ft,this.paramsConfigurator=ht,this.description=gt}reconfigureParams(Le,Ye){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,Le,Ye)}}var DetectionType=(Be=>(Be[Be.IDCapture=0]="IDCapture",Be[Be.Selfie=1]="Selfie",Be[Be.SelfieVideoSelfie=2]="SelfieVideoSelfie",Be[Be.IdVideoSelfie=3]="IdVideoSelfie",Be))(DetectionType||{}),WasmPipelineType=(Be=>(Be[Be.IdBlurGlarePipeline=0]="IdBlurGlarePipeline",Be[Be.IdBarcodeAndTextQualityPipeline=1]="IdBarcodeAndTextQualityPipeline",Be[Be.IdVideoSelfiePipeline=2]="IdVideoSelfiePipeline",Be[Be.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",Be[Be.IdFaceDetectionPipeline=5]="IdFaceDetectionPipeline",Be))(WasmPipelineType||{}),IdCaptureModelType=(Be=>(Be[Be.IdCaptureV1x=0]="IdCaptureV1x",Be[Be.IdCaptureV2x=1]="IdCaptureV2x",Be[Be.IdCaptureV3x=2]="IdCaptureV3x",Be))(IdCaptureModelType||{}),src$2={},src$1={},$_StatsigGlobal={},Log={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Log=Be.LogLevel=void 0;const Le=" DEBUG ",Ye=" INFO ",tt=" WARN ",nt=" ERROR ";function ft(gt){return gt.unshift("[Statsig]"),gt}Be.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class ht{static info(...At){ht.level>=Be.LogLevel.Info&&console.info(Ye,...ft(At))}static debug(...At){ht.level>=Be.LogLevel.Debug&&console.debug(Le,...ft(At))}static warn(...At){ht.level>=Be.LogLevel.Warn&&console.warn(tt,...ft(At))}static error(...At){ht.level>=Be.LogLevel.Error&&console.error(nt,...ft(At))}}Be.Log=ht,ht.level=Be.LogLevel.Warn})(Log),function(Be){var Le,Ye,tt;Object.defineProperty(Be,"__esModule",{value:!0}),Be._getInstance=Be._getStatsigGlobalFlag=Be._getStatsigGlobal=void 0;const nt=Log,ft=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:Ct}catch{return Ct}};Be._getStatsigGlobal=ft;const ht=kt=>(0,Be._getStatsigGlobal)()[kt];Be._getStatsigGlobalFlag=ht;const gt=kt=>{const vt=(0,Be._getStatsigGlobal)();return kt?vt.instances&&vt.instances[kt]:(vt.instances&&Object.keys(vt.instances).length>1&&nt.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),vt.firstInstance)};Be._getInstance=gt;const At="__STATSIG__",xt=typeof window<"u"?window:{},Et=typeof commonjsGlobal<"u"?commonjsGlobal:{},yt=typeof globalThis<"u"?globalThis:{},Ct=(tt=(Ye=(Le=xt[At])!==null&&Le!==void 0?Le:Et[At])!==null&&Ye!==void 0?Ye:yt[At])!==null&&tt!==void 0?tt:{instance:Be._getInstance};xt[At]=Ct,Et[At]=Ct,yt[At]=Ct}($_StatsigGlobal);var Diagnostics={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Diagnostics=void 0;const Le=new Map,Ye="start",tt="end",nt="statsig::diagnostics";Be.Diagnostics={_getMarkers:xt=>Le.get(xt),_markInitOverallStart:xt=>{gt(xt,ft({},Ye,"overall"))},_markInitOverallEnd:(xt,Et,yt)=>{gt(xt,ft({success:Et,error:Et?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:yt},tt,"overall"))},_markInitNetworkReqStart:(xt,Et)=>{gt(xt,ft(Et,Ye,"initialize","network_request"))},_markInitNetworkReqEnd:(xt,Et)=>{gt(xt,ft(Et,tt,"initialize","network_request"))},_markInitProcessStart:xt=>{gt(xt,ft({},Ye,"initialize","process"))},_markInitProcessEnd:(xt,Et)=>{gt(xt,ft(Et,tt,"initialize","process"))},_clearMarkers:xt=>{Le.delete(xt)},_formatError(xt){if(xt&&typeof xt=="object")return{code:At(xt,"code"),name:At(xt,"name"),message:At(xt,"message")}},_getDiagnosticsData(xt,Et,yt,Ct){var kt;return{success:(xt==null?void 0:xt.ok)===!0,statusCode:xt==null?void 0:xt.status,sdkRegion:(kt=xt==null?void 0:xt.headers)===null||kt===void 0?void 0:kt.get("x-statsig-region"),isDelta:yt.includes('"is_delta":true')===!0?!0:void 0,attempt:Et,error:Be.Diagnostics._formatError(Ct)}},_enqueueDiagnosticsEvent(xt,Et,yt,Ct){const kt=Be.Diagnostics._getMarkers(yt);if(kt==null||kt.length<=0)return-1;const vt=kt[kt.length-1].timestamp-kt[0].timestamp;Be.Diagnostics._clearMarkers(yt);const bt=ht(xt,{context:"initialize",markers:kt.slice(),statsigOptions:Ct});return Et.enqueue(bt),vt}};function ft(xt,Et,yt,Ct){return Object.assign({key:yt,action:Et,step:Ct,timestamp:Date.now()},xt)}function ht(xt,Et){return{eventName:nt,user:xt,value:null,metadata:Et,time:Date.now()}}function gt(xt,Et){var yt;const Ct=(yt=Le.get(xt))!==null&&yt!==void 0?yt:[];Ct.push(Et),Le.set(xt,Ct)}function At(xt,Et){if(Et in xt)return xt[Et]}})(Diagnostics);var EventLogger$1={},CacheKey={},Hashing={},TypingUtils={};Object.defineProperty(TypingUtils,"__esModule",{value:!0}),TypingUtils._isTypeMatch=TypingUtils._typeOf=void 0;function _typeOf(Be){return Array.isArray(Be)?"array":typeof Be}TypingUtils._typeOf=_typeOf;function _isTypeMatch(Be,Le){const Ye=tt=>Array.isArray(tt)?"array":tt===null?"null":typeof tt;return Ye(Be)===Ye(Le)}TypingUtils._isTypeMatch=_isTypeMatch,function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getSortedObject=Be._DJB2Object=Be._DJB2=void 0;const Le=TypingUtils,Ye=ft=>{let ht=0;for(let gt=0;gt<ft.length;gt++){const At=ft.charCodeAt(gt);ht=(ht<<5)-ht+At,ht=ht&ht}return String(ht>>>0)};Be._DJB2=Ye;const tt=(ft,ht)=>(0,Be._DJB2)(JSON.stringify((0,Be._getSortedObject)(ft,ht)));Be._DJB2Object=tt;const nt=(ft,ht)=>{if(ft==null)return null;const gt=Object.keys(ft).sort(),At={};return gt.forEach(xt=>{const Et=ft[xt];if(ht===0||(0,Le._typeOf)(Et)!=="object"){At[xt]=Et;return}At[xt]=(0,Be._getSortedObject)(Et,ht!=null?ht-1:ht)}),At};Be._getSortedObject=nt}(Hashing),Object.defineProperty(CacheKey,"__esModule",{value:!0}),CacheKey._getStorageKey=CacheKey._getUserStorageKey=void 0;const Hashing_1$4=Hashing;function _getUserStorageKey(Be,Le,Ye){var tt;if(Ye)return Ye(Be,Le);const nt=Le&&Le.customIDs?Le.customIDs:{},ft=[`uid:${(tt=Le==null?void 0:Le.userID)!==null&&tt!==void 0?tt:""}`,`cids:${Object.keys(nt).sort((ht,gt)=>ht.localeCompare(gt)).map(ht=>`${ht}-${nt[ht]}`).join(",")}`,`k:${Be}`];return(0,Hashing_1$4._DJB2)(ft.join("|"))}CacheKey._getUserStorageKey=_getUserStorageKey;function _getStorageKey(Be,Le,Ye){return Le?_getUserStorageKey(Be,Le,Ye):(0,Hashing_1$4._DJB2)(`k:${Be}`)}CacheKey._getStorageKey=_getStorageKey;var NetworkConfig={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.NetworkParam=Be.NetworkDefault=Be.Endpoint=void 0,Be.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},Be.NetworkDefault={[Be.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[Be.Endpoint._initialize]:"https://featureassets.org/v1",[Be.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},Be.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}})(NetworkConfig);var SafeJs={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getUnloadEvent=Be._getCurrentPageUrlSafe=Be._addDocumentEventListenerSafe=Be._addWindowEventListenerSafe=Be._isServerEnv=Be._getDocumentSafe=Be._getWindowSafe=void 0;const Le=()=>typeof window<"u"?window:null;Be._getWindowSafe=Le;const Ye=()=>{var At;const xt=(0,Be._getWindowSafe)();return(At=xt==null?void 0:xt.document)!==null&&At!==void 0?At:null};Be._getDocumentSafe=Ye;const tt=()=>{if((0,Be._getDocumentSafe)()!==null)return!1;const At=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||At};Be._isServerEnv=tt;const nt=(At,xt)=>{const Et=(0,Be._getWindowSafe)();typeof(Et==null?void 0:Et.addEventListener)=="function"&&Et.addEventListener(At,xt)};Be._addWindowEventListenerSafe=nt;const ft=(At,xt)=>{const Et=(0,Be._getDocumentSafe)();typeof(Et==null?void 0:Et.addEventListener)=="function"&&Et.addEventListener(At,xt)};Be._addDocumentEventListenerSafe=ft;const ht=()=>{var At;try{return(At=(0,Be._getWindowSafe)())===null||At===void 0?void 0:At.location.href.split(/[?#]/)[0]}catch{return}};Be._getCurrentPageUrlSafe=ht;const gt=()=>{const At=(0,Be._getWindowSafe)();return At&&"onpagehide"in At?"pagehide":"beforeunload"};Be._getUnloadEvent=gt})(SafeJs);var StatsigEvent={};Object.defineProperty(StatsigEvent,"__esModule",{value:!0}),StatsigEvent._createLayerParameterExposure=StatsigEvent._createConfigExposure=StatsigEvent._mapExposures=StatsigEvent._createGateExposure=StatsigEvent._isExposureEvent=void 0;const CONFIG_EXPOSURE_NAME="statsig::config_exposure",GATE_EXPOSURE_NAME="statsig::gate_exposure",LAYER_EXPOSURE_NAME="statsig::layer_exposure",_createExposure=(Be,Le,Ye,tt,nt)=>(Ye.bootstrapMetadata&&(tt.bootstrapMetadata=Ye.bootstrapMetadata),{eventName:Be,user:Le,value:null,metadata:_addEvaluationDetailsToMetadata(Ye,tt),secondaryExposures:nt,time:Date.now()}),_isExposureEvent=({eventName:Be})=>Be===GATE_EXPOSURE_NAME||Be===CONFIG_EXPOSURE_NAME||Be===LAYER_EXPOSURE_NAME;StatsigEvent._isExposureEvent=_isExposureEvent;const _createGateExposure=(Be,Le,Ye)=>{var tt,nt,ft;const ht={gate:Le.name,gateValue:String(Le.value),ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(ht.configVersion=Le.__evaluation.version),_createExposure(GATE_EXPOSURE_NAME,Be,Le.details,ht,_mapExposures((ft=(nt=Le.__evaluation)===null||nt===void 0?void 0:nt.secondary_exposures)!==null&&ft!==void 0?ft:[],Ye))};StatsigEvent._createGateExposure=_createGateExposure;function _mapExposures(Be,Le){return Be.map(Ye=>typeof Ye=="string"?(Le??{})[Ye]:Ye).filter(Ye=>Ye!=null)}StatsigEvent._mapExposures=_mapExposures;const _createConfigExposure=(Be,Le,Ye)=>{var tt,nt,ft,ht;const gt={config:Le.name,ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(gt.configVersion=Le.__evaluation.version),((nt=Le.__evaluation)===null||nt===void 0?void 0:nt.passed)!=null&&(gt.rulePassed=String(Le.__evaluation.passed)),_createExposure(CONFIG_EXPOSURE_NAME,Be,Le.details,gt,_mapExposures((ht=(ft=Le.__evaluation)===null||ft===void 0?void 0:ft.secondary_exposures)!==null&&ht!==void 0?ht:[],Ye))};StatsigEvent._createConfigExposure=_createConfigExposure;const _createLayerParameterExposure=(Be,Le,Ye,tt)=>{var nt,ft,ht,gt,At,xt,Et;const yt=Le.__evaluation,Ct=((nt=yt==null?void 0:yt.explicit_parameters)===null||nt===void 0?void 0:nt.includes(Ye))===!0;let kt="",vt=(ft=yt==null?void 0:yt.undelegated_secondary_exposures)!==null&&ft!==void 0?ft:[];Ct&&(kt=(ht=yt.allocated_experiment_name)!==null&&ht!==void 0?ht:"",vt=(gt=yt.secondary_exposures)!==null&&gt!==void 0?gt:[]);const bt=(At=Le.__evaluation)===null||At===void 0?void 0:At.parameter_rule_ids,It={config:Le.name,parameterName:Ye,ruleID:(xt=bt==null?void 0:bt[Ye])!==null&&xt!==void 0?xt:Le.ruleID,allocatedExperiment:kt,isExplicitParameter:String(Ct)};return((Et=Le.__evaluation)===null||Et===void 0?void 0:Et.version)!=null&&(It.configVersion=Le.__evaluation.version),_createExposure(LAYER_EXPOSURE_NAME,Be,Le.details,It,_mapExposures(vt,tt))};StatsigEvent._createLayerParameterExposure=_createLayerParameterExposure;const _addEvaluationDetailsToMetadata=(Be,Le)=>(Le.reason=Be.reason,Be.lcut&&(Le.lcut=String(Be.lcut)),Be.receivedAt&&(Le.receivedAt=String(Be.receivedAt)),Le);var StatsigOptionsCommon={};Object.defineProperty(StatsigOptionsCommon,"__esModule",{value:!0}),StatsigOptionsCommon.LoggingEnabledOption=StatsigOptionsCommon.LogEventCompressionMode=void 0,StatsigOptionsCommon.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},StatsigOptionsCommon.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"};var StorageProvider={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._setObjectInStorage=Be._getObjectFromStorage=Be.Storage=void 0;const Le=Log,Ye=SafeJs,tt={},nt={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:yt=>tt[yt]?tt[yt]:null,setItem:(yt,Ct)=>{tt[yt]=Ct},removeItem:yt=>{delete tt[yt]},getAllKeys:()=>Object.keys(tt)};let ft=null;try{const yt=(0,Ye._getWindowSafe)();yt&&yt.localStorage&&typeof yt.localStorage.getItem=="function"&&(ft={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:Ct=>yt.localStorage.getItem(Ct),setItem:(Ct,kt)=>yt.localStorage.setItem(Ct,kt),removeItem:Ct=>yt.localStorage.removeItem(Ct),getAllKeys:()=>Object.keys(yt.localStorage)})}catch{Le.Log.warn("Failed to setup localStorageProvider.")}let ht=ft??nt,gt=ht;function At(yt){try{return yt()}catch(Ct){if(Ct instanceof Error&&Ct.name==="SecurityError")return Be.Storage._setProvider(nt),null;throw Ct}}Be.Storage={isReady:()=>gt.isReady(),isReadyResolver:()=>gt.isReadyResolver(),getProviderName:()=>gt.getProviderName(),getItem:yt=>At(()=>gt.getItem(yt)),setItem:(yt,Ct)=>At(()=>gt.setItem(yt,Ct)),removeItem:yt=>gt.removeItem(yt),getAllKeys:()=>gt.getAllKeys(),_setProvider:yt=>{ht=yt,gt=yt},_setDisabled:yt=>{yt?gt=nt:gt=ht}};function xt(yt){const Ct=Be.Storage.getItem(yt);return JSON.parse(Ct??"null")}Be._getObjectFromStorage=xt;function Et(yt,Ct){Be.Storage.setItem(yt,JSON.stringify(Ct))}Be._setObjectInStorage=Et})(StorageProvider);var UrlConfiguration$1={};Object.defineProperty(UrlConfiguration$1,"__esModule",{value:!0}),UrlConfiguration$1.UrlConfiguration=void 0;const Hashing_1$3=Hashing,NetworkConfig_1$2=NetworkConfig,ENDPOINT_DNS_KEY_MAP={[NetworkConfig_1$2.Endpoint._initialize]:"i",[NetworkConfig_1$2.Endpoint._rgstr]:"e",[NetworkConfig_1$2.Endpoint._download_config_specs]:"d"};class UrlConfiguration{constructor(Le,Ye,tt,nt){this.customUrl=null,this.fallbackUrls=null,this.endpoint=Le,this.endpointDnsKey=ENDPOINT_DNS_KEY_MAP[Le],Ye&&(this.customUrl=Ye),!Ye&&tt&&(this.customUrl=tt.endsWith("/")?`${tt}${Le}`:`${tt}/${Le}`),nt&&(this.fallbackUrls=nt);const ft=NetworkConfig_1$2.NetworkDefault[Le];this.defaultUrl=`${ft}/${Le}`}getUrl(){var Le;return(Le=this.customUrl)!==null&&Le!==void 0?Le:this.defaultUrl}getChecksum(){var Le;const Ye=((Le=this.fallbackUrls)!==null&&Le!==void 0?Le:[]).sort().join(",");return(0,Hashing_1$3._DJB2)(this.customUrl+Ye)}}UrlConfiguration$1.UrlConfiguration=UrlConfiguration;var VisibilityObserving={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._notifyVisibilityChanged=Be._subscribeToVisiblityChanged=Be._isUnloading=Be._isCurrentlyVisible=void 0;const Le=SafeJs,Ye="foreground",tt="background",nt=[];let ft=Ye,ht=!1;const gt=()=>ft===Ye;Be._isCurrentlyVisible=gt;const At=()=>ht;Be._isUnloading=At;const xt=yt=>{nt.unshift(yt)};Be._subscribeToVisiblityChanged=xt;const Et=yt=>{yt!==ft&&(ft=yt,nt.forEach(Ct=>Ct(yt)))};Be._notifyVisibilityChanged=Et,(0,Le._addWindowEventListenerSafe)("focus",()=>{ht=!1,(0,Be._notifyVisibilityChanged)(Ye)}),(0,Le._addWindowEventListenerSafe)("blur",()=>(0,Be._notifyVisibilityChanged)(tt)),(0,Le._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,Be._notifyVisibilityChanged)(document.visibilityState==="visible"?Ye:tt)}),(0,Le._addWindowEventListenerSafe)((0,Le._getUnloadEvent)(),()=>{ht=!0,(0,Be._notifyVisibilityChanged)(tt)})})(VisibilityObserving);var __awaiter$f=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(EventLogger$1,"__esModule",{value:!0}),EventLogger$1.EventLogger=void 0;const CacheKey_1$1=CacheKey,Hashing_1$2=Hashing,Log_1$8=Log,NetworkConfig_1$1=NetworkConfig,SafeJs_1$3=SafeJs,StatsigEvent_1=StatsigEvent,StatsigOptionsCommon_1$2=StatsigOptionsCommon,StorageProvider_1$4=StorageProvider,UrlConfiguration_1=UrlConfiguration$1,VisibilityObserving_1$1=VisibilityObserving,DEFAULT_QUEUE_SIZE=100,DEFAULT_FLUSH_INTERVAL_MS=1e4,MAX_DEDUPER_KEYS=1e3,DEDUPER_WINDOW_DURATION_MS=6e5,MAX_FAILED_LOGS=500,QUICK_FLUSH_WINDOW_MS=200,EVENT_LOGGER_MAP={},RetryFailedLogsTrigger={Startup:"startup",GainedFocus:"gained_focus"};class EventLogger{static _safeFlushAndForget(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye.flush().catch(()=>{})}static _safeRetryFailedLogs(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus)}constructor(Le,Ye,tt,nt){var ft,ht;this._sdkKey=Le,this._emitter=Ye,this._network=tt,this._options=nt,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=(ft=nt==null?void 0:nt.loggingEnabled)!==null&&ft!==void 0?ft:(nt==null?void 0:nt.disableLogging)===!0?StatsigOptionsCommon_1$2.LoggingEnabledOption.disabled:StatsigOptionsCommon_1$2.LoggingEnabledOption.browserOnly,nt!=null&&nt.loggingEnabled&&nt.disableLogging!==void 0&&Log_1$8.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=(ht=nt==null?void 0:nt.loggingBufferMaxSize)!==null&&ht!==void 0?ht:DEFAULT_QUEUE_SIZE;const gt=nt==null?void 0:nt.networkConfig;this._logEventUrlConfig=new UrlConfiguration_1.UrlConfiguration(NetworkConfig_1$1.Endpoint._rgstr,gt==null?void 0:gt.logEventUrl,gt==null?void 0:gt.api,gt==null?void 0:gt.logEventFallbackUrls)}setLogEventCompressionMode(Le){this._network.setLogEventCompressionMode(Le)}setLoggingEnabled(Le){if(this._loggingEnabled==="disabled"&&Le!=="disabled"){const Ye=this._getStorageKey(),tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);tt&&this._queue.push(...tt),StorageProvider_1$4.Storage.removeItem(Ye)}this._loggingEnabled=Le}enqueue(Le){this._shouldLogEvent(Le)&&(this._normalizeAndAppendEvent(Le),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&EventLogger._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(Le){var Ye;const tt=(Ye=this._nonExposedChecks[Le])!==null&&Ye!==void 0?Ye:0;this._nonExposedChecks[Le]=tt+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var Le;const Ye=(0,SafeJs_1$3._isServerEnv)();Ye&&((Le=this._options)===null||Le===void 0?void 0:Le.loggingEnabled)!=="always"||(EVENT_LOGGER_MAP[this._sdkKey]=this,Ye||(0,VisibilityObserving_1$1._subscribeToVisiblityChanged)(tt=>{tt==="background"?EventLogger._safeFlushAndForget(this._sdkKey):tt==="foreground"&&EventLogger._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(RetryFailedLogsTrigger.Startup),this._startBackgroundFlushInterval())}stop(){return __awaiter$f(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete EVENT_LOGGER_MAP[this._sdkKey],yield this.flush()})}flush(){return __awaiter$f(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;const Le=this._queue;this._queue=[],yield this._sendEvents(Le)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>QUICK_FLUSH_WINDOW_MS)&&setTimeout(()=>EventLogger._safeFlushAndForget(this._sdkKey),QUICK_FLUSH_WINDOW_MS))}_shouldLogEvent(Le){var Ye;if(((Ye=this._options)===null||Ye===void 0?void 0:Ye.loggingEnabled)!=="always"&&(0,SafeJs_1$3._isServerEnv)())return!1;if(!(0,StatsigEvent_1._isExposureEvent)(Le))return!0;const tt=Le.user?Le.user:{statsigEnvironment:void 0},nt=(0,CacheKey_1$1._getUserStorageKey)(this._sdkKey,tt),ft=Le.metadata?Le.metadata:{},ht=[Le.eventName,nt,ft.gate,ft.config,ft.ruleID,ft.allocatedExperiment,ft.parameterName,String(ft.isExplicitParameter),ft.reason].join("|"),gt=this._lastExposureTimeMap[ht],At=Date.now();return gt&&At-gt<DEDUPER_WINDOW_DURATION_MS?!1:(Object.keys(this._lastExposureTimeMap).length>MAX_DEDUPER_KEYS&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[ht]=At,!0)}_sendEvents(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye,tt;if(this._loggingEnabled==="disabled")return this._saveFailedLogsToStorage(Le),!1;try{const ft=(0,VisibilityObserving_1$1._isUnloading)()&&this._network.isBeaconSupported()&&((tt=(Ye=this._options)===null||Ye===void 0?void 0:Ye.networkConfig)===null||tt===void 0?void 0:tt.networkOverrideFunc)==null;return this._emitter({name:"pre_logs_flushed",events:Le}),(ft?this._sendEventsViaBeacon(Le):yield this._sendEventsViaPost(Le)).success?(this._emitter({name:"logs_flushed",events:Le}),!0):(Log_1$8.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(Le),!1)}catch{return Log_1$8.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye;const tt=yield this._network.post(this._getRequestData(Le)),nt=(Ye=tt==null?void 0:tt.code)!==null&&Ye!==void 0?Ye:-1;return{success:nt>=200&&nt<300}})}_sendEventsViaBeacon(Le){return{success:this._network.beacon(this._getRequestData(Le))}}_getRequestData(Le){return{sdkKey:this._sdkKey,data:{events:Le},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[NetworkConfig_1$1.NetworkParam.EventCount]:String(Le.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(Le){for(;Le.length>MAX_FAILED_LOGS;)Le.shift();const Ye=this._getStorageKey();try{const tt=this._getFailedLogsFromStorage(Ye);(0,StorageProvider_1$4._setObjectInStorage)(Ye,[...tt,...Le])}catch{Log_1$8.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(Le){let Ye=[];try{const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Le);return Array.isArray(tt)&&(Ye=tt),Ye}catch{return[]}}_retryFailedLogs(Le){const Ye=this._getStorageKey();__awaiter$f(this,void 0,void 0,function*(){StorageProvider_1$4.Storage.isReady()||(yield StorageProvider_1$4.Storage.isReadyResolver());const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);if(!tt)return;Le===RetryFailedLogsTrigger.Startup&&StorageProvider_1$4.Storage.removeItem(Ye),(yield this._sendEvents(tt))&&Le===RetryFailedLogsTrigger.GainedFocus&&StorageProvider_1$4.Storage.removeItem(Ye)}).catch(()=>{Log_1$8.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,Hashing_1$2._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(Le){Le.user&&(Le.user=Object.assign({},Le.user),delete Le.user.privateAttributes);const Ye={},tt=this._getCurrentPageUrl();tt&&(Ye.statsigMetadata={currentPage:tt});const nt=Object.assign(Object.assign({},Le),Ye);Log_1$8.Log.debug("Enqueued Event:",nt),this._queue.push(nt)}_appendAndResetNonExposedChecks(){Object.keys(this._nonExposedChecks).length!==0&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var Le;if(((Le=this._options)===null||Le===void 0?void 0:Le.includeCurrentPageUrlWithEvents)!==!1)return(0,SafeJs_1$3._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var Le,Ye;const tt=(Ye=(Le=this._options)===null||Le===void 0?void 0:Le.loggingIntervalMs)!==null&&Ye!==void 0?Ye:DEFAULT_FLUSH_INTERVAL_MS,nt=setInterval(()=>{const ft=EVENT_LOGGER_MAP[this._sdkKey];!ft||ft._flushIntervalId!==nt?clearInterval(nt):EventLogger._safeFlushAndForget(this._sdkKey)},tt);this._flushIntervalId=nt}}EventLogger$1.EventLogger=EventLogger;var StatsigMetadata={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigMetadataProvider=Be.SDK_VERSION=void 0,Be.SDK_VERSION="3.28.1";let Le={sdkVersion:Be.SDK_VERSION,sdkType:"js-mono"};Be.StatsigMetadataProvider={get:()=>Le,add:Ye=>{Le=Object.assign(Object.assign({},Le),Ye)}}})(StatsigMetadata);var ClientInterfaces={};Object.defineProperty(ClientInterfaces,"__esModule",{value:!0});var DataAdapterCore$1={},StableID={},UUID={};Object.defineProperty(UUID,"__esModule",{value:!0}),UUID.getUUID=void 0;function getUUID(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let Be=new Date().getTime(),Le=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,tt=>{let nt=Math.random()*16;return Be>0?(nt=(Be+nt)%16|0,Be=Math.floor(Be/16)):(nt=(Le+nt)%16|0,Le=Math.floor(Le/16)),(tt==="x"?nt:nt&7|8).toString(16)})}UUID.getUUID=getUUID,Object.defineProperty(StableID,"__esModule",{value:!0}),StableID.getCookieName=StableID.StableID=void 0;const CacheKey_1=CacheKey,Log_1$7=Log,SafeJs_1$2=SafeJs,StorageProvider_1$3=StorageProvider,UUID_1=UUID,PROMISE_MAP={},COOKIE_ENABLED_MAP={},DISABLED_MAP={};StableID.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:Be=>{if(DISABLED_MAP[Be])return null;if(PROMISE_MAP[Be]!=null)return PROMISE_MAP[Be];let Le=null;return Le=_loadFromCookie(Be),Le!=null?(PROMISE_MAP[Be]=Le,_persistToStorage(Le,Be),Le):(Le=_loadFromStorage(Be),Le==null&&(Le=(0,UUID_1.getUUID)()),_persistToStorage(Le,Be),_persistToCookie(Le,Be),PROMISE_MAP[Be]=Le,Le)},setOverride:(Be,Le)=>{PROMISE_MAP[Le]=Be,_persistToStorage(Be,Le),_persistToCookie(Be,Le)},_setCookiesEnabled:(Be,Le)=>{COOKIE_ENABLED_MAP[Be]=Le},_setDisabled:(Be,Le)=>{DISABLED_MAP[Be]=Le}};function _getStableIDStorageKey(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}function _persistToStorage(Be,Le){const Ye=_getStableIDStorageKey(Le);try{(0,StorageProvider_1$3._setObjectInStorage)(Ye,Be)}catch{Log_1$7.Log.warn("Failed to save StableID to storage")}}function _loadFromStorage(Be){const Le=_getStableIDStorageKey(Be);return(0,StorageProvider_1$3._getObjectFromStorage)(Le)}function _loadFromCookie(Be){if(!COOKIE_ENABLED_MAP[Be]||(0,SafeJs_1$2._getDocumentSafe)()==null)return null;const Le=document.cookie.split(";");for(const Ye of Le){const[tt,nt]=Ye.trim().split("=");if(tt===getCookieName(Be))return decodeURIComponent(nt)}return null}function _persistToCookie(Be,Le){if(!COOKIE_ENABLED_MAP[Le]||(0,SafeJs_1$2._getDocumentSafe)()==null)return;const Ye=new Date;Ye.setFullYear(Ye.getFullYear()+1),document.cookie=`${getCookieName(Le)}=${encodeURIComponent(Be)}; expires=${Ye.toUTCString()}; path=/`}function getCookieName(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}StableID.getCookieName=getCookieName;var StatsigUser={};Object.defineProperty(StatsigUser,"__esModule",{value:!0}),StatsigUser._getFullUserHash=StatsigUser._normalizeUser=void 0;const Hashing_1$1=Hashing,Log_1$6=Log;function _normalizeUser(Be,Le,Ye){try{const tt=JSON.parse(JSON.stringify(Be));return Le!=null&&Le.environment!=null?tt.statsigEnvironment=Le.environment:Ye!=null&&(tt.statsigEnvironment={tier:Ye}),tt}catch{return Log_1$6.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}}StatsigUser._normalizeUser=_normalizeUser;function _getFullUserHash(Be){return Be?(0,Hashing_1$1._DJB2Object)(Be):null}StatsigUser._getFullUserHash=_getFullUserHash;var TypedJsonParse={};Object.defineProperty(TypedJsonParse,"__esModule",{value:!0}),TypedJsonParse._typedJsonParse=void 0;const Log_1$5=Log;function _typedJsonParse(Be,Le,Ye){try{const tt=JSON.parse(Be);if(tt&&typeof tt=="object"&&Le in tt)return tt}catch{}return Log_1$5.Log.error(`Failed to parse ${Ye}`),null}TypedJsonParse._typedJsonParse=_typedJsonParse;var __awaiter$e=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DataAdapterCore$1,"__esModule",{value:!0}),DataAdapterCore$1._makeDataAdapterResult=DataAdapterCore$1.DataAdapterCore=void 0;const Log_1$4=Log,StableID_1$2=StableID,StatsigUser_1=StatsigUser,StorageProvider_1$2=StorageProvider,TypedJsonParse_1=TypedJsonParse,CACHE_LIMIT=10,MAX_CACHE_WRITE_ATTEMPTS=8;class DataAdapterCore{constructor(Le,Ye){this._adapterName=Le,this._cacheSuffix=Ye,this._options=null,this._sdkKey=null,this._cacheLimit=CACHE_LIMIT,this._lastModifiedStoreKey=`statsig.last_modified_time.${Ye}`,this._inMemoryCache=new InMemoryCache}attach(Le,Ye,tt){this._sdkKey=Le,this._options=Ye}getDataSync(Le){const Ye=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),tt=this._getCacheKey(Ye),nt=this._inMemoryCache.get(tt,Ye);if(nt&&this._getIsCacheValueValid(nt))return nt;const ft=this._loadFromCache(tt);return ft&&this._getIsCacheValueValid(ft)?(this._inMemoryCache.add(tt,ft,this._cacheLimit),this._inMemoryCache.get(tt,Ye)):null}setData(Le,Ye){const tt=Ye&&(0,StatsigUser_1._normalizeUser)(Ye,this._options),nt=this._getCacheKey(tt);this._inMemoryCache.add(nt,_makeDataAdapterResult("Bootstrap",Le,null,tt),this._cacheLimit)}_getIsCacheValueValid(Le){return Le.stableID==null||Le.stableID===StableID_1$2.StableID.get(this._getSdkKey())}_getDataAsyncImpl(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){StorageProvider_1$2.Storage.isReady()||(yield StorageProvider_1$2.Storage.isReadyResolver());const nt=Le??this.getDataSync(Ye),ft=[this._fetchAndPrepFromNetwork(nt,Ye,tt)];return tt!=null&&tt.timeoutMs&&ft.push(new Promise(ht=>setTimeout(ht,tt.timeoutMs)).then(()=>(Log_1$4.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(ft)})}_prefetchDataImpl(Le,Ye){return __awaiter$e(this,void 0,void 0,function*(){const tt=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),nt=this._getCacheKey(tt),ft=yield this._getDataAsyncImpl(null,tt,Ye);ft&&this._inMemoryCache.add(nt,Object.assign(Object.assign({},ft),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){var nt;const ft=(nt=Le==null?void 0:Le.data)!==null&&nt!==void 0?nt:null,ht=Le!=null&&this._isCachedResultValidFor204(Le,Ye),gt=yield this._fetchFromNetwork(ft,Ye,tt,ht);if(!gt)return Log_1$4.Log.debug("No response returned for latest value"),null;const At=(0,TypedJsonParse_1._typedJsonParse)(gt,"has_updates","Response"),xt=this._getSdkKey(),Et=StableID_1$2.StableID.get(xt);let yt=null;if((At==null?void 0:At.has_updates)===!0)yt=_makeDataAdapterResult("Network",gt,Et,Ye);else if(ft&&(At==null?void 0:At.has_updates)===!1)yt=_makeDataAdapterResult("NetworkNotModified",ft,Et,Ye);else return null;const Ct=this._getCacheKey(Ye);return this._inMemoryCache.add(Ct,yt,this._cacheLimit),this._writeToCache(Ct,yt),yt})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(Log_1$4.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(Le){var Ye;const tt=(Ye=StorageProvider_1$2.Storage.getItem)===null||Ye===void 0?void 0:Ye.call(StorageProvider_1$2.Storage,Le);if(tt==null)return null;const nt=(0,TypedJsonParse_1._typedJsonParse)(tt,"source","Cached Result");return nt?Object.assign(Object.assign({},nt),{source:"Cache"}):null}_writeToCache(Le,Ye){const tt=JSON.stringify(Ye);for(let nt=0;nt<MAX_CACHE_WRITE_ATTEMPTS;nt++)try{StorageProvider_1$2.Storage.setItem(Le,tt);break}catch(ft){if(!(ft instanceof Error)||!(ft.toString().includes("QuotaExceededError")||ft.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw ft;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(Le,this._cacheLimit-1)}this._runLocalStorageCacheEviction(Le)}_runLocalStorageCacheEviction(Le,Ye=this._cacheLimit){var tt;const nt=(tt=(0,StorageProvider_1$2._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&tt!==void 0?tt:{};nt[Le]=Date.now();const ft=_getEvictableKeys(nt,Ye);for(const ht of ft)delete nt[ht],StorageProvider_1$2.Storage.removeItem(ht);(0,StorageProvider_1$2._setObjectInStorage)(this._lastModifiedStoreKey,nt)}}DataAdapterCore$1.DataAdapterCore=DataAdapterCore;function _makeDataAdapterResult(Be,Le,Ye,tt){return{source:Be,data:Le,receivedAt:Date.now(),stableID:Ye,fullUserHash:(0,StatsigUser_1._getFullUserHash)(tt)}}DataAdapterCore$1._makeDataAdapterResult=_makeDataAdapterResult;class InMemoryCache{constructor(){this._data={}}get(Le,Ye){var tt;const nt=this._data[Le],ft=nt==null?void 0:nt.stableID,ht=(tt=Ye==null?void 0:Ye.customIDs)===null||tt===void 0?void 0:tt.stableID;return ht&&ft&&ht!==ft?(Log_1$4.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):nt}add(Le,Ye,tt){const nt=_getEvictableKeys(this._data,tt-1);for(const ft of nt)delete this._data[ft];this._data[Le]=Ye}merge(Le){this._data=Object.assign(Object.assign({},this._data),Le)}}function _getEvictableKeys(Be,Le){const Ye=Object.keys(Be);return Ye.length<=Le?[]:Le===0?Ye:Ye.sort((tt,nt)=>{const ft=Be[tt],ht=Be[nt];return typeof ft=="object"&&typeof ht=="object"?ft.receivedAt-ht.receivedAt:ft-ht}).slice(0,Ye.length-Le)}var DownloadConfigSpecsResponse={};Object.defineProperty(DownloadConfigSpecsResponse,"__esModule",{value:!0});var ErrorBoundary={},SDKType={};Object.defineProperty(SDKType,"__esModule",{value:!0}),SDKType.SDKType=void 0;const SDK_CLIENT={};let suffix;SDKType.SDKType={_get:Be=>{var Le;return((Le=SDK_CLIENT[Be])!==null&&Le!==void 0?Le:"js-mono")+(suffix??"")},_setClientType(Be,Le){SDK_CLIENT[Be]=Le},_setBindingType(Be){(!suffix||suffix==="-react")&&(suffix="-"+Be)}},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__awaiter||function(yt,Ct,kt,vt){function bt(It){return It instanceof kt?It:new kt(function(wt){wt(It)})}return new(kt||(kt=Promise))(function(It,wt){function Rt(Dt){try{Bt(vt.next(Dt))}catch(Pt){wt(Pt)}}function Tt(Dt){try{Bt(vt.throw(Dt))}catch(Pt){wt(Pt)}}function Bt(Dt){Dt.done?It(Dt.value):bt(Dt.value).then(Rt,Tt)}Bt((vt=vt.apply(yt,Ct||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.ErrorBoundary=Be.EXCEPTION_ENDPOINT=void 0;const Ye=Log,tt=SDKType,nt=StatsigMetadata;Be.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const ft="[Statsig] UnknownError";class ht{constructor(Ct,kt,vt,bt){this._sdkKey=Ct,this._options=kt,this._emitter=vt,this._lastSeenError=bt,this._seen=new Set}wrap(Ct,kt){try{const vt=Ct;xt(vt).forEach(bt=>{const It=vt[bt];"$EB"in It||(vt[bt]=(...wt)=>this._capture(kt?`${kt}:${bt}`:bt,()=>It.apply(Ct,wt)),vt[bt].$EB=!0)})}catch(vt){this._onError("eb:wrap",vt)}}logError(Ct,kt){this._onError(Ct,kt)}getLastSeenErrorAndReset(){const Ct=this._lastSeenError;return this._lastSeenError=void 0,Ct??null}attachErrorIfNoneExists(Ct){this._lastSeenError||(this._lastSeenError=gt(Ct))}_capture(Ct,kt){try{const vt=kt();return vt&&vt instanceof Promise?vt.catch(bt=>this._onError(Ct,bt)):vt}catch(vt){return this._onError(Ct,vt),null}}_onError(Ct,kt){try{Ye.Log.warn(`Caught error in ${Ct}`,{error:kt}),Le(this,void 0,void 0,function*(){var bt,It,wt,Rt,Tt,Bt,Dt;const Pt=kt||Error(ft),Nt=Pt instanceof Error,Lt=Nt?Pt.name:"No Name",Wt=gt(Pt);if(this._lastSeenError=Wt,this._seen.has(Lt))return;if(this._seen.add(Lt),!((It=(bt=this._options)===null||bt===void 0?void 0:bt.networkConfig)===null||It===void 0)&&It.preventAllNetworkTraffic){(wt=this._emitter)===null||wt===void 0||wt.call(this,{name:"error",error:kt,tag:Ct});return}const $t=tt.SDKType._get(this._sdkKey),Kt=nt.StatsigMetadataProvider.get(),Vt=Nt?Pt.stack:At(Pt),Ut=Object.assign({tag:Ct,exception:Lt,info:Vt,statsigOptions:Et(this._options)},Object.assign(Object.assign({},Kt),{sdkType:$t}));yield((Bt=(Tt=(Rt=this._options)===null||Rt===void 0?void 0:Rt.networkConfig)===null||Tt===void 0?void 0:Tt.networkOverrideFunc)!==null&&Bt!==void 0?Bt:fetch)(Be.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String($t),"STATSIG-SDK-VERSION":String(Kt.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(Ut)}),(Dt=this._emitter)===null||Dt===void 0||Dt.call(this,{name:"error",error:kt,tag:Ct})}).then(()=>{}).catch(()=>{})}catch{}}}Be.ErrorBoundary=ht;function gt(yt){return yt instanceof Error?yt:typeof yt=="string"?new Error(yt):new Error("An unknown error occurred.")}function At(yt){try{return JSON.stringify(yt)}catch{return ft}}function xt(yt){const Ct=new Set;let kt=Object.getPrototypeOf(yt);for(;kt&&kt!==Object.prototype;)Object.getOwnPropertyNames(kt).filter(vt=>typeof(kt==null?void 0:kt[vt])=="function").forEach(vt=>Ct.add(vt)),kt=Object.getPrototypeOf(kt);return Array.from(Ct)}function Et(yt){if(!yt)return{};const Ct={};return Object.keys(yt).forEach(kt=>{const vt=kt,bt=yt[vt];switch(typeof bt){case"number":case"bigint":case"boolean":Ct[String(vt)]=bt;break;case"string":bt.length<50?Ct[String(vt)]=bt:Ct[String(vt)]="set";break;case"object":vt==="environment"?Ct.environment=bt:vt==="networkConfig"?Ct.networkConfig=bt:Ct[String(vt)]=bt!=null?"set":"unset";break}}),Ct}}(ErrorBoundary);var EvaluationOptions={};Object.defineProperty(EvaluationOptions,"__esModule",{value:!0});var EvaluationTypes={};Object.defineProperty(EvaluationTypes,"__esModule",{value:!0});var InitializeResponse={};Object.defineProperty(InitializeResponse,"__esModule",{value:!0});var MemoKey={};Object.defineProperty(MemoKey,"__esModule",{value:!0}),MemoKey.createMemoKey=MemoKey.MemoPrefix=void 0,MemoKey.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const EXIST_KEYS=new Set([]),DO_NOT_MEMO_KEYS=new Set(["userPersistedValues"]);function createMemoKey(Be,Le,Ye){let tt=`${Be}|${Le}`;if(!Ye)return tt;for(const nt of Object.keys(Ye)){if(DO_NOT_MEMO_KEYS.has(nt))return;EXIST_KEYS.has(nt)?tt+=`|${nt}=true`:tt+=`|${nt}=${Ye[nt]}`}return tt}MemoKey.createMemoKey=createMemoKey;var NetworkCore$1={},NetworkFallbackResolver$1={},DnsTxtQuery={},__awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DnsTxtQuery,"__esModule",{value:!0}),DnsTxtQuery._fetchTxtRecords=void 0;const FEATURE_ASSETS_DNS_QUERY=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),DNS_QUERY_ENDPOINT="https://cloudflare-dns.com/dns-query",DOMAIN_CHARS=["i","e","d"],MAX_START_LOOKUP=200;function _fetchTxtRecords(Be){return __awaiter$d(this,void 0,void 0,function*(){const Le=yield Be(DNS_QUERY_ENDPOINT,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:FEATURE_ASSETS_DNS_QUERY});if(!Le.ok){const nt=new Error("Failed to fetch TXT records from DNS");throw nt.name="DnsTxtFetchError",nt}const Ye=yield Le.arrayBuffer(),tt=new Uint8Array(Ye);return _parseDnsResponse(tt)})}DnsTxtQuery._fetchTxtRecords=_fetchTxtRecords;function _parseDnsResponse(Be){const Le=Be.findIndex((tt,nt)=>nt<MAX_START_LOOKUP&&String.fromCharCode(tt)==="="&&DOMAIN_CHARS.includes(String.fromCharCode(Be[nt-1])));if(Le===-1){const tt=new Error("Failed to parse TXT records from DNS");throw tt.name="DnsTxtParseError",tt}let Ye="";for(let tt=Le-1;tt<Be.length;tt++)Ye+=String.fromCharCode(Be[tt]);return Ye.split(",")}var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkFallbackResolver$1,"__esModule",{value:!0}),NetworkFallbackResolver$1._isDomainFailure=NetworkFallbackResolver$1.NetworkFallbackResolver=void 0;const DnsTxtQuery_1=DnsTxtQuery,Hashing_1=Hashing,Log_1$3=Log,StorageProvider_1$1=StorageProvider,DEFAULT_TTL_MS=7*24*60*60*1e3,COOLDOWN_TIME_MS=4*60*60*1e3;class NetworkFallbackResolver{constructor(Le){var Ye;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(Ye=Le.networkConfig)===null||Ye===void 0?void 0:Ye.networkOverrideFunc}setErrorBoundary(Le){this._errorBoundary=Le}tryBumpExpiryTime(Le,Ye){var tt;const nt=(tt=this._fallbackInfo)===null||tt===void 0?void 0:tt[Ye.endpoint];nt&&(nt.expiryTime=Date.now()+DEFAULT_TTL_MS,_tryWriteFallbackInfoToCache(Le,Object.assign(Object.assign({},this._fallbackInfo),{[Ye.endpoint]:nt})))}getActiveFallbackUrl(Le,Ye){var tt,nt;if(Ye.customUrl!=null&&Ye.fallbackUrls!=null)return null;let ft=this._fallbackInfo;ft==null&&(ft=(tt=_readFallbackInfoFromCache(Le))!==null&&tt!==void 0?tt:{},this._fallbackInfo=ft);const ht=ft[Ye.endpoint];return!ht||Date.now()>((nt=ht.expiryTime)!==null&&nt!==void 0?nt:0)||Ye.getChecksum()!==ht.urlConfigChecksum?(delete ft[Ye.endpoint],this._fallbackInfo=ft,_tryWriteFallbackInfoToCache(Le,this._fallbackInfo),null):ht.url?ht.url:null}tryFetchUpdatedFallbackInfo(Le,Ye,tt,nt){return __awaiter$c(this,void 0,void 0,function*(){var ft,ht;try{if(!_isDomainFailure(tt,nt))return!1;const At=Ye.customUrl==null&&Ye.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(Ye):Ye.fallbackUrls,xt=this._pickNewFallbackUrl((ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[Ye.endpoint],At);return xt?(this._updateFallbackInfoWithNewUrl(Le,Ye,xt),!0):!1}catch(gt){return(ht=this._errorBoundary)===null||ht===void 0||ht.logError("tryFetchUpdatedFallbackInfo",gt),!1}})}_updateFallbackInfoWithNewUrl(Le,Ye,tt){var nt,ft,ht;const gt={urlConfigChecksum:Ye.getChecksum(),url:tt,expiryTime:Date.now()+DEFAULT_TTL_MS,previous:[]},At=Ye.endpoint,xt=(nt=this._fallbackInfo)===null||nt===void 0?void 0:nt[At];xt&&gt.previous.push(...xt.previous),gt.previous.length>10&&(gt.previous=[]);const Et=(ht=(ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[At])===null||ht===void 0?void 0:ht.url;Et!=null&&gt.previous.push(Et),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[At]:gt}),_tryWriteFallbackInfoToCache(Le,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(Le){return __awaiter$c(this,void 0,void 0,function*(){var Ye;const tt=this._dnsQueryCooldowns[Le.endpoint];if(tt&&Date.now()<tt)return null;this._dnsQueryCooldowns[Le.endpoint]=Date.now()+COOLDOWN_TIME_MS;const nt=[],ft=yield(0,DnsTxtQuery_1._fetchTxtRecords)((Ye=this._networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch),ht=_extractPathFromUrl(Le.defaultUrl);for(const gt of ft){if(!gt.startsWith(Le.endpointDnsKey+"="))continue;const At=gt.split("=");if(At.length>1){let xt=At[1];xt.endsWith("/")&&(xt=xt.slice(0,-1)),nt.push(`https://${xt}${ht}`)}}return nt})}_pickNewFallbackUrl(Le,Ye){var tt;if(Ye==null)return null;const nt=new Set((tt=Le==null?void 0:Le.previous)!==null&&tt!==void 0?tt:[]),ft=Le==null?void 0:Le.url;let ht=null;for(const gt of Ye){const At=gt.endsWith("/")?gt.slice(0,-1):gt;if(!nt.has(gt)&&At!==ft){ht=At;break}}return ht}}NetworkFallbackResolver$1.NetworkFallbackResolver=NetworkFallbackResolver;function _isDomainFailure(Be,Le){var Ye;const tt=(Ye=Be==null?void 0:Be.toLowerCase())!==null&&Ye!==void 0?Ye:"";return Le||tt.includes("uncaught exception")||tt.includes("failed to fetch")||tt.includes("networkerror when attempting to fetch resource")}NetworkFallbackResolver$1._isDomainFailure=_isDomainFailure;function _getFallbackInfoStorageKey(Be){return`statsig.network_fallback.${(0,Hashing_1._DJB2)(Be)}`}function _tryWriteFallbackInfoToCache(Be,Le){const Ye=_getFallbackInfoStorageKey(Be);if(!Le||Object.keys(Le).length===0){StorageProvider_1$1.Storage.removeItem(Ye);return}StorageProvider_1$1.Storage.setItem(Ye,JSON.stringify(Le))}function _readFallbackInfoFromCache(Be){const Le=_getFallbackInfoStorageKey(Be),Ye=StorageProvider_1$1.Storage.getItem(Le);if(!Ye)return null;try{return JSON.parse(Ye)}catch{return Log_1$3.Log.error("Failed to parse FallbackInfo"),null}}function _extractPathFromUrl(Be){try{return new URL(Be).pathname}catch{return null}}var SDKFlags={};Object.defineProperty(SDKFlags,"__esModule",{value:!0}),SDKFlags.SDKFlags=void 0;const FLAGMAP={};SDKFlags.SDKFlags={setFlags:(Be,Le)=>{FLAGMAP[Be]=Le},get:(Be,Le)=>{var Ye,tt;return(tt=(Ye=FLAGMAP[Be])===null||Ye===void 0?void 0:Ye[Le])!==null&&tt!==void 0?tt:!1}};var SessionID={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigSession=Be.SessionID=void 0;const Le=$_StatsigGlobal,Ye=CacheKey,tt=Log,nt=StorageProvider,ft=UUID,ht=30*60*1e3,gt=4*60*60*1e3,At={};Be.SessionID={get:Rt=>Be.StatsigSession.get(Rt).data.sessionID},Be.StatsigSession={get:Rt=>{At[Rt]==null&&(At[Rt]=xt(Rt));const Tt=At[Rt];return yt(Tt)},overrideInitialSessionID:(Rt,Tt)=>{At[Tt]=Et(Rt,Tt)}};function xt(Rt){let Tt=wt(Rt);const Bt=Date.now();return Tt||(Tt={sessionID:(0,ft.getUUID)(),startTime:Bt,lastUpdate:Bt}),{data:Tt,sdkKey:Rt}}function Et(Rt,Tt){const Bt=Date.now();return{data:{sessionID:Rt,startTime:Bt,lastUpdate:Bt},sdkKey:Tt}}function yt(Rt){const Tt=Date.now(),Bt=Rt.data,Dt=Rt.sdkKey;if(kt(Bt)||vt(Bt)){Bt.sessionID=(0,ft.getUUID)(),Bt.startTime=Tt;const Nt=__STATSIG__==null?void 0:__STATSIG__.instance(Dt);Nt&&Nt.$emt({name:"session_expired"})}Bt.lastUpdate=Tt,It(Bt,Rt.sdkKey),clearTimeout(Rt.idleTimeoutID),clearTimeout(Rt.ageTimeoutID);const Pt=Tt-Bt.startTime;return Rt.idleTimeoutID=Ct(Dt,ht),Rt.ageTimeoutID=Ct(Dt,gt-Pt),Rt}function Ct(Rt,Tt){return setTimeout(()=>{var Bt;const Dt=(Bt=(0,Le._getStatsigGlobal)())===null||Bt===void 0?void 0:Bt.instance(Rt);Dt&&Dt.$emt({name:"session_expired"})},Tt)}function kt({lastUpdate:Rt}){return Date.now()-Rt>ht}function vt({startTime:Rt}){return Date.now()-Rt>gt}function bt(Rt){return`statsig.session_id.${(0,Ye._getStorageKey)(Rt)}`}function It(Rt,Tt){const Bt=bt(Tt);try{(0,nt._setObjectInStorage)(Bt,Rt)}catch{tt.Log.warn("Failed to save SessionID")}}function wt(Rt){const Tt=bt(Rt);return(0,nt._getObjectFromStorage)(Tt)}})(SessionID);var StatsigClientEventEmitter={};Object.defineProperty(StatsigClientEventEmitter,"__esModule",{value:!0}),StatsigClientEventEmitter.ErrorTag=void 0,StatsigClientEventEmitter.ErrorTag={NetworkError:"NetworkError"};var __awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkCore$1,"__esModule",{value:!0}),NetworkCore$1.NetworkCore=void 0;const __StatsigGlobal_1$1=$_StatsigGlobal,Diagnostics_1=Diagnostics,Log_1$2=Log,NetworkConfig_1=NetworkConfig,NetworkFallbackResolver_1=NetworkFallbackResolver$1,SDKFlags_1=SDKFlags,SDKType_1=SDKType,SafeJs_1$1=SafeJs,SessionID_1$1=SessionID,StableID_1$1=StableID,StatsigClientEventEmitter_1=StatsigClientEventEmitter,StatsigMetadata_1=StatsigMetadata,StatsigOptionsCommon_1$1=StatsigOptionsCommon,VisibilityObserving_1=VisibilityObserving,DEFAULT_TIMEOUT_MS=1e4,BACKOFF_BASE_MS=500,BACKOFF_MAX_MS=3e4,RATE_LIMIT_WINDOW_MS=1e3,RATE_LIMIT_MAX_REQ_COUNT=50,LEAK_RATE=RATE_LIMIT_MAX_REQ_COUNT/RATE_LIMIT_WINDOW_MS,RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class NetworkCore{constructor(Le,Ye){this._emitter=Ye,this._errorBoundary=null,this._timeout=DEFAULT_TIMEOUT_MS,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,Le&&(this._options=Le),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new NetworkFallbackResolver_1.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(Le))}setLogEventCompressionMode(Le){this._options.logEventCompressionMode=Le}setErrorBoundary(Le){this._errorBoundary=Le,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(Le)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const Le=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,Le}beacon(Le){if(!_ensureValidSdkKey(Le))return!1;const Ye=this._getInternalRequestArgs("POST",Le),tt=this._getPopulatedURL(Ye),nt=navigator;return nt.sendBeacon.bind(nt)(tt,Ye.body)}post(Le){return __awaiter$b(this,void 0,void 0,function*(){const Ye=this._getInternalRequestArgs("POST",Le);return this._tryEncodeBody(Ye),yield this._tryToCompressBody(Ye),this._sendRequest(Ye)})}get(Le){const Ye=this._getInternalRequestArgs("GET",Le);return this._sendRequest(Ye)}_sendRequest(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye,tt,nt,ft;if(!_ensureValidSdkKey(Le)||this._netConfig.preventAllNetworkTraffic)return null;const{method:ht,body:gt,retries:At,attempt:xt}=Le,Et=Le.urlConfig.endpoint;if(this._isRateLimited(Et))return Log_1$2.Log.warn(`Request to ${Et} was blocked because you are making requests too frequently.`),null;const yt=xt??1;let Ct=!1;const kt=this._getPopulatedURL(Le);let vt=null;const bt=(0,VisibilityObserving_1._isUnloading)();try{const It={method:ht,body:gt,headers:Object.assign({},Le.headers),priority:Le.priority,keepalive:bt};_tryMarkInitStart(Le,yt);const wt=this._leakyBucket[Et];wt&&(wt.lastRequestTime=Date.now(),this._leakyBucket[Et]=wt);const Rt=(Ye=this._netConfig.networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch;let Tt;if(vt=yield Promise.race([Rt(kt,It).finally(()=>clearTimeout(Tt)),new Promise((Dt,Pt)=>{Tt=setTimeout(()=>{Ct=!0,Pt(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!vt.ok){const Dt=yield vt.text().catch(()=>"No Text"),Pt=new Error(`NetworkError: ${kt} ${Dt}`);throw Pt.name="NetworkError",Pt}const Bt=yield vt.text();return _tryMarkInitEnd(Le,vt,yt,Bt),this._fallbackResolver.tryBumpExpiryTime(Le.sdkKey,Le.urlConfig),{body:Bt,code:vt.status}}catch(It){const wt=_getErrorMessage(It),Rt=_didTimeout(wt??"",Ct);if(_tryMarkInitEnd(Le,vt,yt,"",It),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(Le.sdkKey,Le.urlConfig,wt,Rt))&&(Le.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(Le.sdkKey,Le.urlConfig)),!At||yt>At||!RETRYABLE_CODES.has((tt=vt==null?void 0:vt.status)!==null&&tt!==void 0?tt:500)){(nt=this._emitter)===null||nt===void 0||nt.call(this,{name:"error",error:It,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:Le});const Bt=`A networking error occurred during ${ht} request to ${kt}.`;return Log_1$2.Log.error(Bt,wt,It),(ft=this._errorBoundary)===null||ft===void 0||ft.attachErrorIfNoneExists(Bt),null}return yield _exponentialBackoff(yt),this._sendRequest(Object.assign(Object.assign({},Le),{retries:At,attempt:yt+1}))}})}_getLogEventCompressionMode(Le){let Ye=Le==null?void 0:Le.logEventCompressionMode;return!Ye&&(Le==null?void 0:Le.disableCompression)===!0&&(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled),Ye||(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled),Ye}_isRateLimited(Le){var Ye;const tt=Date.now(),nt=(Ye=this._leakyBucket[Le])!==null&&Ye!==void 0?Ye:{count:0,lastRequestTime:tt},ft=tt-nt.lastRequestTime,ht=Math.floor(ft*LEAK_RATE);return nt.count=Math.max(0,nt.count-ht),nt.count>=RATE_LIMIT_MAX_REQ_COUNT?!0:(nt.count+=1,nt.lastRequestTime=tt,this._leakyBucket[Le]=nt,!1)}_getPopulatedURL(Le){var Ye;const tt=(Ye=Le.fallbackUrl)!==null&&Ye!==void 0?Ye:Le.urlConfig.getUrl();(Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize||Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=tt);const nt=Object.assign({[NetworkConfig_1.NetworkParam.SdkKey]:Le.sdkKey,[NetworkConfig_1.NetworkParam.SdkType]:SDKType_1.SDKType._get(Le.sdkKey),[NetworkConfig_1.NetworkParam.SdkVersion]:StatsigMetadata_1.SDK_VERSION,[NetworkConfig_1.NetworkParam.Time]:String(Date.now()),[NetworkConfig_1.NetworkParam.SessionID]:SessionID_1$1.SessionID.get(Le.sdkKey)},Le.params),ft=Object.keys(nt).map(ht=>`${encodeURIComponent(ht)}=${encodeURIComponent(nt[ht])}`).join("&");return`${tt}${ft?`?${ft}`:""}`}_tryEncodeBody(Le){var Ye;const tt=(0,SafeJs_1$1._getWindowSafe)(),nt=Le.body;if(!(!Le.isStatsigEncodable||this._options.disableStatsigEncoding||typeof nt!="string"||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-encode")!=null||!(tt!=null&&tt.btoa)))try{Le.body=tt.btoa(nt).split("").reverse().join(""),Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.StatsigEncoded]:"1"})}catch(ft){Log_1$2.Log.warn(`Request encoding failed for ${Le.urlConfig.getUrl()}`,ft)}}_tryToCompressBody(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye;const tt=Le.body;if(!(typeof tt!="string"||!_allowCompression(Le,this._options)))try{const nt=new TextEncoder().encode(tt),ft=new CompressionStream("gzip"),ht=ft.writable.getWriter();ht.write(nt).catch(Log_1$2.Log.error),ht.close().catch(Log_1$2.Log.error);const gt=ft.readable.getReader(),At=[];let xt;for(;!(xt=yield gt.read()).done;)At.push(xt.value);const Et=At.reduce((kt,vt)=>kt+vt.length,0),yt=new Uint8Array(Et);let Ct=0;for(const kt of At)yt.set(kt,Ct),Ct+=kt.length;Le.body=yt,Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.IsGzipped]:"1"})}catch(nt){Log_1$2.Log.warn(`Request compression failed for ${Le.urlConfig.getUrl()}`,nt)}})}_getInternalRequestArgs(Le,Ye){const tt=this._fallbackResolver.getActiveFallbackUrl(Ye.sdkKey,Ye.urlConfig),nt=Object.assign(Object.assign({},Ye),{method:Le,fallbackUrl:tt});return"data"in Ye&&_populateRequestBody(nt,Ye.data),nt}}NetworkCore$1.NetworkCore=NetworkCore;const _ensureValidSdkKey=Be=>Be.sdkKey?!0:(Log_1$2.Log.warn("Unable to make request without an SDK key"),!1),_populateRequestBody=(Be,Le)=>{const{sdkKey:Ye,fallbackUrl:tt}=Be,nt=StableID_1$1.StableID.get(Ye),ft=SessionID_1$1.SessionID.get(Ye),ht=SDKType_1.SDKType._get(Ye);Be.body=JSON.stringify(Object.assign(Object.assign({},Le),{statsigMetadata:Object.assign(Object.assign({},StatsigMetadata_1.StatsigMetadataProvider.get()),{stableID:nt,sessionID:ft,sdkType:ht,fallbackUrl:tt})}))};function _allowCompression(Be,Le){if(!Be.isCompressable||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const Ye=Be.urlConfig.customUrl!=null||Be.urlConfig.fallbackUrls!=null,tt=SDKFlags_1.SDKFlags.get(Be.sdkKey,"enable_log_event_compression")===!0;switch(Le.logEventCompressionMode){case StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled:return!1;case StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled:return!(Ye&&!tt);case StatsigOptionsCommon_1$1.LogEventCompressionMode.Forced:return!0;default:return!1}}function _getErrorMessage(Be){return typeof Be=="string"?Be:Be instanceof Error?`${Be.name}: ${Be.message}`:"Unknown Error"}function _didTimeout(Be,Le){return Be.includes("Timeout")||Le}function _tryMarkInitStart(Be,Le){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqStart(Be.sdkKey,{attempt:Le})}function _tryMarkInitEnd(Be,Le,Ye,tt,nt){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(Be.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(Le,Ye,tt,nt))}function _exponentialBackoff(Be){return __awaiter$b(this,void 0,void 0,function*(){yield new Promise(Le=>setTimeout(Le,Math.min(BACKOFF_BASE_MS*(Be*Be),BACKOFF_MAX_MS)))})}var OverrideAdapter={};Object.defineProperty(OverrideAdapter,"__esModule",{value:!0});var ParamStoreTypes={};Object.defineProperty(ParamStoreTypes,"__esModule",{value:!0});var SizeOf={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._fastApproxSizeOf=void 0;const Le=2,Ye=1,tt=(nt,ft)=>{let ht=0;const gt=Object.keys(nt);for(let At=0;At<gt.length;At++){const xt=gt[At],Et=nt[xt];if(ht+=xt.length,typeof Et=="object"&&Et!==null?ht+=(0,Be._fastApproxSizeOf)(Et,ft)+Le:ht+=String(Et).length+Ye,ht>=ft)return ht}return ht};Be._fastApproxSizeOf=tt})(SizeOf);var StatsigClientBase$1={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigClientBase$1,"__esModule",{value:!0}),StatsigClientBase$1.StatsigClientBase=void 0;const __StatsigGlobal_1=$_StatsigGlobal,ErrorBoundary_1=ErrorBoundary,EventLogger_1=EventLogger$1,Log_1$1=Log,MemoKey_1=MemoKey,SafeJs_1=SafeJs,SessionID_1=SessionID,StableID_1=StableID,StatsigOptionsCommon_1=StatsigOptionsCommon,StorageProvider_1=StorageProvider,MAX_MEMO_CACHE_SIZE=3e3;class StatsigClientBase{constructor(Le,Ye,tt,nt){var ft,ht,gt,At;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const xt=this.$emt.bind(this);(nt==null?void 0:nt.logLevel)!=null&&(Log_1$1.Log.level=nt.logLevel),nt!=null&&nt.disableStorage&&StorageProvider_1.Storage._setDisabled(!0),nt!=null&&nt.initialSessionID&&SessionID_1.StatsigSession.overrideInitialSessionID(nt.initialSessionID,Le),nt!=null&&nt.storageProvider&&StorageProvider_1.Storage._setProvider(nt.storageProvider),nt!=null&&nt.enableCookies&&StableID_1.StableID._setCookiesEnabled(Le,nt.enableCookies),nt!=null&&nt.disableStableID&&StableID_1.StableID._setDisabled(Le,!0),this._sdkKey=Le,this._options=nt??{},this._memoCache={},this.overrideAdapter=(ft=nt==null?void 0:nt.overrideAdapter)!==null&&ft!==void 0?ft:null,this._logger=new EventLogger_1.EventLogger(Le,xt,tt,nt),this._errorBoundary=new ErrorBoundary_1.ErrorBoundary(Le,nt,xt),this._errorBoundary.wrap(this),this._errorBoundary.wrap(Ye),this._errorBoundary.wrap(this._logger),tt.setErrorBoundary(this._errorBoundary),this.dataAdapter=Ye,this.dataAdapter.attach(Le,nt,tt),this.storageProvider=StorageProvider_1.Storage,(At=(gt=(ht=this.overrideAdapter)===null||ht===void 0?void 0:ht.loadFromStorage)===null||gt===void 0?void 0:gt.call(ht))===null||At===void 0||At.catch(Et=>this._errorBoundary.logError("OA::loadFromStorage",Et)),this._primeReadyRipcord(),_assignGlobalInstance(Le,this)}updateRuntimeOptions(Le){Le.loggingEnabled?(this._options.loggingEnabled=Le.loggingEnabled,this._logger.setLoggingEnabled(Le.loggingEnabled)):Le.disableLogging!=null&&(this._options.disableLogging=Le.disableLogging,this._logger.setLoggingEnabled(Le.disableLogging?"disabled":"browser-only")),Le.disableStorage!=null&&(this._options.disableStorage=Le.disableStorage,StorageProvider_1.Storage._setDisabled(Le.disableStorage)),Le.enableCookies!=null&&(this._options.enableCookies=Le.enableCookies,StableID_1.StableID._setCookiesEnabled(this._sdkKey,Le.enableCookies)),Le.logEventCompressionMode?this._logger.setLogEventCompressionMode(Le.logEventCompressionMode):Le.disableCompression&&this._logger.setLogEventCompressionMode(StatsigOptionsCommon_1.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return __awaiter$a(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(Le,Ye){this._listeners[Le]||(this._listeners[Le]=[]),this._listeners[Le].push(Ye)}off(Le,Ye){if(this._listeners[Le]){const tt=this._listeners[Le].indexOf(Ye);tt!==-1&&this._listeners[Le].splice(tt,1)}}$on(Le,Ye){Ye.__isInternal=!0,this.on(Le,Ye)}$emt(Le){var Ye;const tt=nt=>{try{nt(Le)}catch(ft){if(nt.__isInternal===!0){this._errorBoundary.logError(`__emit:${Le.name}`,ft);return}Log_1$1.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",Le)}};this._listeners[Le.name]&&this._listeners[Le.name].forEach(nt=>tt(nt)),(Ye=this._listeners["*"])===null||Ye===void 0||Ye.forEach(tt)}_setStatus(Le,Ye){this.loadingStatus=Le,this._memoCache={},this.$emt({name:"values_updated",status:Le,values:Ye})}_enqueueExposure(Le,Ye,tt){if((tt==null?void 0:tt.disableExposureLog)===!0){this._logger.incrementNonExposureCount(Le);return}this._logger.enqueue(Ye)}_memoize(Le,Ye){return(tt,nt)=>{if(this._options.disableEvaluationMemoization)return Ye(tt,nt);const ft=(0,MemoKey_1.createMemoKey)(Le,tt,nt);return ft?(ft in this._memoCache||(Object.keys(this._memoCache).length>=MAX_MEMO_CACHE_SIZE&&(this._memoCache={}),this._memoCache[ft]=Ye(tt,nt)),this._memoCache[ft]):Ye(tt,nt)}}}StatsigClientBase$1.StatsigClientBase=StatsigClientBase;function _assignGlobalInstance(Be,Le){var Ye;if((0,SafeJs_1._isServerEnv)())return;const tt=(0,__StatsigGlobal_1._getStatsigGlobal)(),nt=(Ye=tt.instances)!==null&&Ye!==void 0?Ye:{},ft=Le;nt[Be]!=null&&Log_1$1.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),nt[Be]=ft,tt.firstInstance||(tt.firstInstance=ft),tt.instances=nt,__STATSIG__=tt}var StatsigDataAdapter={};Object.defineProperty(StatsigDataAdapter,"__esModule",{value:!0}),StatsigDataAdapter.DataAdapterCachePrefix=void 0,StatsigDataAdapter.DataAdapterCachePrefix="statsig.cached";var StatsigPlugin={};Object.defineProperty(StatsigPlugin,"__esModule",{value:!0});var StatsigTypeFactories={};Object.defineProperty(StatsigTypeFactories,"__esModule",{value:!0}),StatsigTypeFactories._makeTypedGet=StatsigTypeFactories._mergeOverride=StatsigTypeFactories._makeLayer=StatsigTypeFactories._makeExperiment=StatsigTypeFactories._makeDynamicConfig=StatsigTypeFactories._makeFeatureGate=void 0;const Log_1=Log,TypingUtils_1=TypingUtils;function _makeEvaluation(Be,Le,Ye,tt){var nt;return{name:Be,details:Le,ruleID:(nt=Ye==null?void 0:Ye.rule_id)!==null&&nt!==void 0?nt:"",__evaluation:Ye,value:tt}}function _makeFeatureGate(Be,Le,Ye){var tt;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,(Ye==null?void 0:Ye.value)===!0)),{idType:(tt=Ye==null?void 0:Ye.id_type)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeFeatureGate=_makeFeatureGate;function _makeDynamicConfig(Be,Le,Ye){var tt,nt;const ft=(tt=Ye==null?void 0:Ye.value)!==null&&tt!==void 0?tt:{};return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,ft)),{idType:(nt=Ye==null?void 0:Ye.id_type)!==null&&nt!==void 0?nt:null,get:_makeTypedGet(Be,Ye==null?void 0:Ye.value)})}StatsigTypeFactories._makeDynamicConfig=_makeDynamicConfig;function _makeExperiment(Be,Le,Ye){var tt;const nt=_makeDynamicConfig(Be,Le,Ye);return Object.assign(Object.assign({},nt),{groupName:(tt=Ye==null?void 0:Ye.group_name)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeExperiment=_makeExperiment;function _makeLayer(Be,Le,Ye,tt){var nt,ft;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,void 0)),{get:_makeTypedGet(Be,Ye==null?void 0:Ye.value,tt),groupName:(nt=Ye==null?void 0:Ye.group_name)!==null&&nt!==void 0?nt:null,__value:(ft=Ye==null?void 0:Ye.value)!==null&&ft!==void 0?ft:{}})}StatsigTypeFactories._makeLayer=_makeLayer;function _mergeOverride(Be,Le,Ye,tt){return Object.assign(Object.assign(Object.assign({},Be),Le),{get:_makeTypedGet(Be.name,Ye,tt)})}StatsigTypeFactories._mergeOverride=_mergeOverride;function _makeTypedGet(Be,Le,Ye){return(tt,nt)=>{var ft;const ht=(ft=Le==null?void 0:Le[tt])!==null&&ft!==void 0?ft:null;return ht==null?nt??null:nt!=null&&!(0,TypingUtils_1._isTypeMatch)(ht,nt)?(Log_1.Log.warn(`Parameter type mismatch. '${Be}.${tt}' was found to be type '${typeof ht}' but fallback/return type is '${typeof nt}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),nt??null):(Ye==null||Ye(tt),ht)}}StatsigTypeFactories._makeTypedGet=_makeTypedGet;var StatsigTypes={};Object.defineProperty(StatsigTypes,"__esModule",{value:!0});var StatsigUpdateDetails={};Object.defineProperty(StatsigUpdateDetails,"__esModule",{value:!0}),StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES=StatsigUpdateDetails.createUpdateDetails=void 0;const createUpdateDetails=(Be,Le,Ye,tt,nt,ft)=>({duration:Ye,source:Le,success:Be,error:tt,sourceUrl:nt,warnings:ft});StatsigUpdateDetails.createUpdateDetails=createUpdateDetails,StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(xt,Et,yt,Ct){Ct===void 0&&(Ct=yt);var kt=Object.getOwnPropertyDescriptor(Et,yt);(!kt||("get"in kt?!Et.__esModule:kt.writable||kt.configurable))&&(kt={enumerable:!0,get:function(){return Et[yt]}}),Object.defineProperty(xt,Ct,kt)}:function(xt,Et,yt,Ct){Ct===void 0&&(Ct=yt),xt[Ct]=Et[yt]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(xt,Et){for(var yt in xt)yt!=="default"&&!Object.prototype.hasOwnProperty.call(Et,yt)&&Le(Et,xt,yt)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.Storage=Be.Log=Be.EventLogger=Be.Diagnostics=void 0;const tt=$_StatsigGlobal,nt=Diagnostics;Object.defineProperty(Be,"Diagnostics",{enumerable:!0,get:function(){return nt.Diagnostics}});const ft=EventLogger$1;Object.defineProperty(Be,"EventLogger",{enumerable:!0,get:function(){return ft.EventLogger}});const ht=Log;Object.defineProperty(Be,"Log",{enumerable:!0,get:function(){return ht.Log}});const gt=StatsigMetadata,At=StorageProvider;Object.defineProperty(Be,"Storage",{enumerable:!0,get:function(){return At.Storage}}),Ye($_StatsigGlobal,Be),Ye(CacheKey,Be),Ye(ClientInterfaces,Be),Ye(DataAdapterCore$1,Be),Ye(Diagnostics,Be),Ye(DownloadConfigSpecsResponse,Be),Ye(ErrorBoundary,Be),Ye(EvaluationOptions,Be),Ye(EvaluationTypes,Be),Ye(Hashing,Be),Ye(InitializeResponse,Be),Ye(Log,Be),Ye(MemoKey,Be),Ye(NetworkConfig,Be),Ye(NetworkCore$1,Be),Ye(OverrideAdapter,Be),Ye(ParamStoreTypes,Be),Ye(SafeJs,Be),Ye(SDKType,Be),Ye(SessionID,Be),Ye(SizeOf,Be),Ye(StableID,Be),Ye(StatsigClientBase$1,Be),Ye(StatsigClientEventEmitter,Be),Ye(StatsigDataAdapter,Be),Ye(StatsigEvent,Be),Ye(StatsigMetadata,Be),Ye(StatsigOptionsCommon,Be),Ye(StatsigPlugin,Be),Ye(StatsigTypeFactories,Be),Ye(StatsigTypes,Be),Ye(StatsigUser,Be),Ye(StorageProvider,Be),Ye(TypedJsonParse,Be),Ye(TypingUtils,Be),Ye(UrlConfiguration$1,Be),Ye(UUID,Be),Ye(VisibilityObserving,Be),Ye(StatsigUpdateDetails,Be),Ye(SDKFlags,Be),Object.assign((0,tt._getStatsigGlobal)(),{Log:ht.Log,SDK_VERSION:gt.SDK_VERSION})}(src$1);var StatsigClient$1={},EvaluationStore$1={},V1InitializeContainer$1={};Object.defineProperty(V1InitializeContainer$1,"__esModule",{value:!0}),V1InitializeContainer$1.V1InitializeContainer=void 0;const client_core_1$7=src$1;class V1InitializeContainer{constructor(Le){this._values=Le}getGate(Le){return this._getResultFromLookup(this._values.feature_gates,Le)}getConfig(Le){return this._getResultFromLookup(this._values.dynamic_configs,Le)}getLayer(Le){return this._getResultFromLookup(this._values.layer_configs,Le)}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$7._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V1InitializeContainer$1.V1InitializeContainer=V1InitializeContainer;var V2InitializeContainer$1={};Object.defineProperty(V2InitializeContainer$1,"__esModule",{value:!0}),V2InitializeContainer$1.V2InitializeContainer=void 0;const client_core_1$6=src$1;class V2InitializeContainer{constructor(Le){this._values=Le}getGate(Le){var Ye,tt,nt;const ft=this._getResultFromLookup(this._values.feature_gates,Le);return ft?{name:Le,value:ft.v===!0,rule_id:(Ye=ft.r)!==null&&Ye!==void 0?Ye:"default",secondary_exposures:(tt=ft.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ft.i)!==null&&nt!==void 0?nt:""}:null}getConfig(Le){var Ye,tt,nt,ft;const ht=this._getResultFromLookup(this._values.dynamic_configs,Le);return ht?{name:Le,value:(Ye=this._values.values[ht.v])!==null&&Ye!==void 0?Ye:{},rule_id:ht.r,secondary_exposures:(tt=ht.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ht.i)!==null&&nt!==void 0?nt:"",is_user_in_experiment:ht.ue===!0,passed:ht.p===!0,group_name:(ft=ht.gn)!==null&&ft!==void 0?ft:void 0,is_experiment_active:ht.ea===!0,group:ht.r,is_device_based:ht.i==="stableID"}:null}getLayer(Le){var Ye,tt,nt,ft,ht,gt;const At=this._getResultFromLookup(this._values.layer_configs,Le);return At?{name:Le,value:(Ye=this._values.values[At.v])!==null&&Ye!==void 0?Ye:{},rule_id:At.r,secondary_exposures:(tt=At.s)!==null&&tt!==void 0?tt:[],is_user_in_experiment:At.ue===!0,group_name:(nt=At.gn)!==null&&nt!==void 0?nt:void 0,is_experiment_active:At.ea===!0,group:At.r,is_device_based:At.i==="stableID",allocated_experiment_name:(ft=At.ae)!==null&&ft!==void 0?ft:"",explicit_parameters:(ht=At.ep)!==null&&ht!==void 0?ht:[],undelegated_secondary_exposures:(gt=At.us)!==null&&gt!==void 0?gt:[],parameter_rule_ids:At.pr}:null}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$6._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V2InitializeContainer$1.V2InitializeContainer=V2InitializeContainer,Object.defineProperty(EvaluationStore$1,"__esModule",{value:!0});const client_core_1$5=src$1,V1InitializeContainer_1=V1InitializeContainer$1,V2InitializeContainer_1=V2InitializeContainer$1;class EvaluationStore{constructor(Le){this._sdkKey=Le,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,client_core_1$5._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(Le,Ye){var tt,nt;if(!Le)return!1;const ft=(0,client_core_1$5._typedJsonParse)(Le.data,"has_updates","EvaluationResponse");return ft==null?!1:(this._source=Le.source,(ft==null?void 0:ft.has_updates)!==!0||((tt=ft.time)!==null&&tt!==void 0?tt:0)<this._lcut||(this._rawValues=Le.data,this._lcut=ft.time,this._receivedAt=Le.receivedAt,ft.response_format==="init-v2"?this._values=new V2InitializeContainer_1.V2InitializeContainer(ft):this._values=new V1InitializeContainer_1.V1InitializeContainer(ft),this._bootstrapMetadata=this._extractBootstrapMetadata(Le.source,ft),Le.source&&ft.user&&this._setWarningState(Ye,ft),client_core_1$5.SDKFlags.setFlags(this._sdkKey,(nt=ft.sdk_flags)!==null&&nt!==void 0?nt:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(Le){const Ye=this._values?this._values.getGate(Le):null;return this._getDetailedStoreResult(Ye)}getConfig(Le){const Ye=this._values?this._values.getConfig(Le):null;return this._getDetailedStoreResult(Ye)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(Le){const Ye=this._values?this._values.getLayer(Le):null;return this._getDetailedStoreResult(Ye)}getParamStore(Le){const Ye=this._values?this._values.getParamStore(Le):null;return this._getDetailedStoreResult(Ye)}getSource(){return this._source}getExposureMapping(){var Le;return(Le=this._values)===null||Le===void 0?void 0:Le.getExposureMapping()}_extractBootstrapMetadata(Le,Ye){if(Le!=="Bootstrap")return null;const tt={};return Ye.user&&(tt.user=Ye.user),Ye.sdkInfo&&(tt.generatorSDKInfo=Ye.sdkInfo),tt.lcut=Ye.time,tt}_getDetailedStoreResult(Le){return{result:Le,details:this._getDetails(Le==null)}}_setWarningState(Le,Ye){var tt,nt;const ft=client_core_1$5.StableID.get(this._sdkKey);if(((tt=Le.customIDs)===null||tt===void 0?void 0:tt.stableID)!==ft&&(!((nt=Le.customIDs)===null||nt===void 0)&&nt.stableID||ft)){this._warnings.add("StableIDMismatch");return}if("user"in Ye){const ht=Ye.user,gt=Object.assign(Object.assign({},Le),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,client_core_1$5._getFullUserHash)(gt)!==(0,client_core_1$5._getFullUserHash)(ht)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const Le={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(Le.warnings=Array.from(this._warnings)),Le}_getDetails(Le){var Ye,tt;const nt=this.getCurrentSourceDetails();let ft=nt.reason;const ht=(Ye=nt.warnings)!==null&&Ye!==void 0?Ye:[];this._source==="Bootstrap"&&ht.length>0&&(ft=ft+ht[0]),ft!=="Uninitialized"&&ft!=="NoValues"&&(ft=`${ft}:${Le?"Unrecognized":"Recognized"}`);const gt=this._source==="Bootstrap"&&(tt=this._bootstrapMetadata)!==null&&tt!==void 0?tt:void 0;return gt&&(nt.bootstrapMetadata=gt),Object.assign(Object.assign({},nt),{reason:ft})}}EvaluationStore$1.default=EvaluationStore;var Network={},EvaluationResponseDeltas={};Object.defineProperty(EvaluationResponseDeltas,"__esModule",{value:!0}),EvaluationResponseDeltas._resolveDeltasResponse=void 0;const client_core_1$4=src$1,MAX_DELTAS_SORT_DEPTH=2;function _resolveDeltasResponse(Be,Le){const Ye=(0,client_core_1$4._typedJsonParse)(Le,"checksum","DeltasEvaluationResponse");if(!Ye)return{hadBadDeltaChecksum:!0};const tt=_mergeDeltasIntoCache(Be,Ye),nt=_handleDeletedEntries(tt),ft=(0,client_core_1$4._DJB2Object)({feature_gates:nt.feature_gates,dynamic_configs:nt.dynamic_configs,layer_configs:nt.layer_configs},MAX_DELTAS_SORT_DEPTH);return ft===Ye.checksumV2?JSON.stringify(nt):{hadBadDeltaChecksum:!0,badChecksum:ft,badMergedConfigs:nt,badFullResponse:Ye.deltas_full_response}}EvaluationResponseDeltas._resolveDeltasResponse=_resolveDeltasResponse;function _mergeDeltasIntoCache(Be,Le){return Object.assign(Object.assign(Object.assign({},Be),Le),{feature_gates:Object.assign(Object.assign({},Be.feature_gates),Le.feature_gates),layer_configs:Object.assign(Object.assign({},Be.layer_configs),Le.layer_configs),dynamic_configs:Object.assign(Object.assign({},Be.dynamic_configs),Le.dynamic_configs)})}function _handleDeletedEntries(Be){const Le=Be;return _deleteEntriesInRecord(Be.deleted_gates,Le.feature_gates),delete Le.deleted_gates,_deleteEntriesInRecord(Be.deleted_configs,Le.dynamic_configs),delete Le.deleted_configs,_deleteEntriesInRecord(Be.deleted_layers,Le.layer_configs),delete Le.deleted_layers,Le}function _deleteEntriesInRecord(Be,Le){Be==null||Be.forEach(Ye=>{delete Le[Ye]})}var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(Network,"__esModule",{value:!0});const client_core_1$3=src$1,EvaluationResponseDeltas_1=EvaluationResponseDeltas;class StatsigNetwork extends client_core_1$3.NetworkCore{constructor(Le,Ye){super(Le,Ye);const tt=Le==null?void 0:Le.networkConfig;this._option=Le,this._initializeUrlConfig=new client_core_1$3.UrlConfiguration(client_core_1$3.Endpoint._initialize,tt==null?void 0:tt.initializeUrl,tt==null?void 0:tt.api,tt==null?void 0:tt.initializeFallbackUrls)}fetchEvaluations(Le,Ye,tt,nt,ft){return __awaiter$9(this,void 0,void 0,function*(){var ht,gt,At,xt,Et,yt;const Ct=Ye?(0,client_core_1$3._typedJsonParse)(Ye,"has_updates","InitializeResponse"):null;let kt={user:nt,hash:(At=(gt=(ht=this._option)===null||ht===void 0?void 0:ht.networkConfig)===null||gt===void 0?void 0:gt.initializeHashAlgorithm)!==null&&At!==void 0?At:"djb2",deltasResponseRequested:!1,full_checksum:null};if(Ct!=null&&Ct.has_updates){const vt=(Ct==null?void 0:Ct.hash_used)!==((yt=(Et=(xt=this._option)===null||xt===void 0?void 0:xt.networkConfig)===null||Et===void 0?void 0:Et.initializeHashAlgorithm)!==null&&yt!==void 0?yt:"djb2");kt=Object.assign(Object.assign({},kt),{sinceTime:ft&&!vt?Ct.time:0,previousDerivedFields:"derived_fields"in Ct&&ft?Ct.derived_fields:{},deltasResponseRequested:!0,full_checksum:Ct.full_checksum,partialUserMatchSinceTime:vt?0:Ct.time})}return this._fetchEvaluations(Le,Ct,kt,tt)})}_fetchEvaluations(Le,Ye,tt,nt){return __awaiter$9(this,void 0,void 0,function*(){var ft,ht;const gt=yield this.post({sdkKey:Le,urlConfig:this._initializeUrlConfig,data:tt,retries:2,isStatsigEncodable:!0,priority:nt});if((gt==null?void 0:gt.code)===204)return'{"has_updates": false}';if((gt==null?void 0:gt.code)!==200)return(ft=gt==null?void 0:gt.body)!==null&&ft!==void 0?ft:null;if((Ye==null?void 0:Ye.has_updates)!==!0||((ht=gt.body)===null||ht===void 0?void 0:ht.includes('"is_delta":true'))!==!0||tt.deltasResponseRequested!==!0)return gt.body;const At=(0,EvaluationResponseDeltas_1._resolveDeltasResponse)(Ye,gt.body);return typeof At=="string"?At:this._fetchEvaluations(Le,Ye,Object.assign(Object.assign(Object.assign({},tt),At),{deltasResponseRequested:!1}),nt)})}}Network.default=StatsigNetwork;var ParamStoreGetterFactory={};Object.defineProperty(ParamStoreGetterFactory,"__esModule",{value:!0}),ParamStoreGetterFactory._makeParamStoreGetter=void 0;const client_core_1$2=src$1,NO_EXPOSURE_OPT={disableExposureLog:!0};function _shouldLogExposure(Be){return Be==null||Be.disableExposureLog===!1}function _shouldReturnFallback(Be,Le){return Le!=null&&!(0,client_core_1$2._isTypeMatch)(Be,Le)}function _getMappedStaticValue(Be,Le){return Be.value}function _getMappedGateValue(Be,Le,Ye){return Be.getFeatureGate(Le.gate_name,_shouldLogExposure(Ye)?void 0:NO_EXPOSURE_OPT).value?Le.pass_value:Le.fail_value}function _getMappedDynamicConfigValue(Be,Le,Ye,tt){const ft=Be.getDynamicConfig(Le.config_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedExperimentValue(Be,Le,Ye,tt){const ft=Be.getExperiment(Le.experiment_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedLayerValue(Be,Le,Ye,tt){const ft=Be.getLayer(Le.layer_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _makeParamStoreGetter(Be,Le,Ye){return(tt,nt)=>{if(Le==null)return nt;const ft=Le[tt];if(ft==null||nt!=null&&(0,client_core_1$2._typeOf)(nt)!==ft.param_type)return nt;switch(ft.ref_type){case"static":return _getMappedStaticValue(ft);case"gate":return _getMappedGateValue(Be,ft,Ye);case"dynamic_config":return _getMappedDynamicConfigValue(Be,ft,nt,Ye);case"experiment":return _getMappedExperimentValue(Be,ft,nt,Ye);case"layer":return _getMappedLayerValue(Be,ft,nt,Ye);default:return nt}}}ParamStoreGetterFactory._makeParamStoreGetter=_makeParamStoreGetter;var StatsigEvaluationsDataAdapter$1={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigEvaluationsDataAdapter$1,"__esModule",{value:!0}),StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=void 0;const client_core_1$1=src$1,Network_1$1=Network;class StatsigEvaluationsDataAdapter extends client_core_1$1.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(Le,Ye,tt){super.attach(Le,Ye,tt),tt!==null&&tt instanceof Network_1$1.default?this._network=tt:this._network=new Network_1$1.default(Ye??{})}getDataAsync(Le,Ye,tt){return this._getDataAsyncImpl(Le,(0,client_core_1$1._normalizeUser)(Ye,this._options),tt)}prefetchData(Le,Ye){return this._prefetchDataImpl(Le,Ye)}setData(Le){const Ye=(0,client_core_1$1._typedJsonParse)(Le,"has_updates","data");Ye&&"user"in Ye?super.setData(Le,Ye.user):client_core_1$1.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(Le,Ye){super.setData(Le,Ye)}_fetchFromNetwork(Le,Ye,tt,nt){return __awaiter$8(this,void 0,void 0,function*(){var ft;const ht=yield(ft=this._network)===null||ft===void 0?void 0:ft.fetchEvaluations(this._getSdkKey(),Le,tt==null?void 0:tt.priority,Ye,nt);return ht??null})}_getCacheKey(Le){var Ye;const tt=(0,client_core_1$1._getStorageKey)(this._getSdkKey(),Le,(Ye=this._options)===null||Ye===void 0?void 0:Ye.customUserCacheKeyFunc);return`${client_core_1$1.DataAdapterCachePrefix}.${this._cacheSuffix}.${tt}`}_isCachedResultValidFor204(Le,Ye){return Le.fullUserHash!=null&&Le.fullUserHash===(0,client_core_1$1._getFullUserHash)(Ye)}}StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=StatsigEvaluationsDataAdapter;var __awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigClient$1,"__esModule",{value:!0});const client_core_1=src$1,EvaluationStore_1=EvaluationStore$1,Network_1=Network,ParamStoreGetterFactory_1=ParamStoreGetterFactory,StatsigEvaluationsDataAdapter_1=StatsigEvaluationsDataAdapter$1;class StatsigClient extends client_core_1.StatsigClientBase{static instance(Le){const Ye=(0,client_core_1._getStatsigGlobal)().instance(Le);return Ye instanceof StatsigClient?Ye:(client_core_1.Log.warn((0,client_core_1._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new StatsigClient(Le??"",{}))}constructor(Le,Ye,tt=null){var nt,ft;client_core_1.SDKType._setClientType(Le,"javascript-client");const ht=new Network_1.default(tt,At=>{this.$emt(At)});super(Le,(nt=tt==null?void 0:tt.dataAdapter)!==null&&nt!==void 0?nt:new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter,ht,tt),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(client_core_1.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(client_core_1.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(client_core_1.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(client_core_1.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(client_core_1.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(client_core_1.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new EvaluationStore_1.default(Le),this._network=ht,this._user=this._configureUser(Ye,tt),this._sdkInstanceID=(0,client_core_1.getUUID)();const gt=(ft=tt==null?void 0:tt.plugins)!==null&&ft!==void 0?ft:[];for(const At of gt)At.bind(this)}initializeSync(Le){var Ye;return this.loadingStatus!=="Uninitialized"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(Ye=this._store.getWarnings())!==null&&Ye!==void 0?Ye:[]]):(this._logger.start(),this.updateUserSync(this._user,Le))}initializeAsync(Le){return __awaiter$7(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(Le),this._initializePromise)})}updateUserSync(Le,Ye){const tt=performance.now();try{return this._updateUserSyncImpl(Le,Ye,tt)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}}_updateUserSyncImpl(Le,Ye,tt){var nt;const ft=[...(nt=this._store.getWarnings())!==null&&nt!==void 0?nt:[]];this._resetForUser(Le);const ht=this.dataAdapter.getDataSync(this._user);ht==null&&ft.push("NoCachedValues"),this._store.setValues(ht,this._user),this._finalizeUpdate(ht);const gt=Ye==null?void 0:Ye.disableBackgroundCacheRefresh;return gt===!0||gt==null&&(ht==null?void 0:ht.source)==="Bootstrap"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft):(this._runPostUpdate(ht??null,this._user),(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft))}updateUserAsync(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){const tt=performance.now();try{return yield this._updateUserAsyncImpl(Le,Ye)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}})}_updateUserAsyncImpl(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){this._resetForUser(Le);const tt=this._user;client_core_1.Diagnostics._markInitOverallStart(this._sdkKey);let nt=this.dataAdapter.getDataSync(tt);if(this._store.setValues(nt,this._user),this._setStatus("Loading",nt),nt=yield this.dataAdapter.getDataAsync(nt,tt,Ye),tt!==this._user)return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let ft=!1;nt!=null&&(client_core_1.Diagnostics._markInitProcessStart(this._sdkKey),ft=this._store.setValues(nt,this._user),client_core_1.Diagnostics._markInitProcessEnd(this._sdkKey,{success:ft})),this._finalizeUpdate(nt),ft||(this._errorBoundary.attachErrorIfNoneExists(client_core_1.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),client_core_1.Diagnostics._markInitOverallEnd(this._sdkKey,ft,this._store.getCurrentSourceDetails());const ht=client_core_1.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,client_core_1.createUpdateDetails)(ft,this._store.getSource(),ht,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:client_core_1.StatsigSession.get(this._sdkKey),stableID:client_core_1.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(Le,Ye){return this.getFeatureGate(Le,Ye).value}logEvent(Le,Ye,tt){const nt=typeof Le=="string"?{eventName:Le,value:Ye,metadata:tt}:Le;this.$emt({name:"log_event_called",event:nt}),this._logger.enqueue(Object.assign(Object.assign({},nt),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(Le){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:Le}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(Le){return __awaiter$7(this,void 0,void 0,function*(){return client_core_1.Storage.isReady()||(yield client_core_1.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,Le)})}_createErrorUpdateDetails(Le,Ye){var tt;return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),performance.now()-Ye,Le,null,[...(tt=this._store.getWarnings())!==null&&tt!==void 0?tt:[]])}_finalizeUpdate(Le){this._store.finalize(),this._setStatus("Ready",Le)}_runPostUpdate(Le,Ye){this.dataAdapter.getDataAsync(Le,Ye,{priority:"low"}).catch(tt=>{client_core_1.Log.error("An error occurred after update.",tt)})}_resetForUser(Le){this._logger.reset(),this._store.reset(),this._user=this._configureUser(Le,this._options)}_configureUser(Le,Ye){var tt,nt,ft;const ht=(0,client_core_1._normalizeUser)(Le,Ye),gt=(tt=ht.customIDs)===null||tt===void 0?void 0:tt.stableID;if(gt){const At=(ft=(nt=this.storageProvider).isReadyResolver)===null||ft===void 0?void 0:ft.call(nt);At?At.then(()=>client_core_1.StableID.setOverride(gt,this._sdkKey),()=>client_core_1.StableID.setOverride(gt,this._sdkKey)):client_core_1.StableID.setOverride(gt,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(ht.analyticsOnlyMetadata=Object.assign(Object.assign({},ht.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),ht}_getFeatureGateImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getGate(Le),gt=(0,client_core_1._makeFeatureGate)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getGateOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createGateExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"gate_evaluation",gate:xt}),xt}_getDynamicConfigImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getConfig(Le),gt=(0,client_core_1._makeDynamicConfig)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getDynamicConfigOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:xt}),xt}_getExperimentImpl(Le,Ye){var tt,nt,ft,ht;const{result:gt,details:At}=this._store.getConfig(Le),xt=(0,client_core_1._makeExperiment)(Le,At,gt);xt.__evaluation!=null&&(xt.__evaluation.secondary_exposures=(0,client_core_1._mapExposures)((nt=(tt=xt.__evaluation)===null||tt===void 0?void 0:tt.secondary_exposures)!==null&&nt!==void 0?nt:[],this._store.getExposureMapping()));const Et=(ht=(ft=this.overrideAdapter)===null||ft===void 0?void 0:ft.getExperimentOverride)===null||ht===void 0?void 0:ht.call(ft,xt,this._user,Ye),yt=Et??xt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,yt,this._store.getExposureMapping()),Ye),this.$emt({name:"experiment_evaluation",experiment:yt}),yt}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(Le,Ye){var tt,nt,ft;const{result:ht,details:gt}=this._store.getLayer(Le),At=(0,client_core_1._makeLayer)(Le,gt,ht),xt=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getLayerOverride)===null||nt===void 0?void 0:nt.call(tt,At,this._user,Ye);Ye!=null&&Ye.disableExposureLog&&this._logger.incrementNonExposureCount(Le);const Et=(0,client_core_1._mergeOverride)(At,xt,(ft=xt==null?void 0:xt.__value)!==null&&ft!==void 0?ft:At.__value,yt=>{Ye!=null&&Ye.disableExposureLog||this._enqueueExposure(Le,(0,client_core_1._createLayerParameterExposure)(this._user,Et,yt,this._store.getExposureMapping()),Ye)});return this.$emt({name:"layer_evaluation",layer:Et}),Et}_getParameterStoreImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getParamStore(Le);this._logger.incrementNonExposureCount(Le);const gt={name:Le,details:ht,__configuration:ft,get:(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,ft,Ye)},At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getParamStoreOverride)===null||nt===void 0?void 0:nt.call(tt,gt,Ye);return At!=null&&(gt.__configuration=At.config,gt.details=At.details,gt.get=(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,At.config,Ye)),gt}}StatsigClient$1.default=StatsigClient,function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ht,gt,At,xt){xt===void 0&&(xt=At);var Et=Object.getOwnPropertyDescriptor(gt,At);(!Et||("get"in Et?!gt.__esModule:Et.writable||Et.configurable))&&(Et={enumerable:!0,get:function(){return gt[At]}}),Object.defineProperty(ht,xt,Et)}:function(ht,gt,At,xt){xt===void 0&&(xt=At),ht[xt]=gt[At]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(ht,gt){for(var At in ht)At!=="default"&&!Object.prototype.hasOwnProperty.call(gt,At)&&Le(gt,ht,At)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigClient=void 0;const tt=src$1,nt=StatsigClient$1;Be.StatsigClient=nt.default,Ye(src$1,Be);const ft=Object.assign((0,tt._getStatsigGlobal)(),{StatsigClient:nt.default});Be.default=ft}(src$2);const FEATURE_FLAGS=["id_text_barcode_readability","selfie_local_lenses_check_web","id_model_hebrew_back_id","id_face_readability","new_id_capture_ux_least_risky_clients","id_test_aa","id_iou_check","iad_checks","iad_c_checks","new_fingerprint","mp_test_hashed_id"],GLOBAL_FLAGS=["new_fingerprint"],ID_MODULE_FLAGS=["id_face_readability","id_test_aa","iad_c_checks","mp_test_hashed_id","id_model_hebrew_back_id","id_iou_check","iad_checks","new_id_capture_ux_least_risky_clients","id_text_barcode_readability"],SELFIE_MODULE_FLAGS=["selfie_local_lenses_check_web"];function getStatsigEnvironment(Be){return isStageK8sEnv(Be)?{tier:"development"}:isStageEnv(Be)||isDemoEnv(Be)?{tier:"staging"}:isSaasEnv(Be)?{tier:"production"}:{tier:"development"}}const clientApiKey="client-GBTzsiJ99rvyZQdNXDFkftx3ZoMF1TED2rsB3m3IUqc",featureFlagsValues={id_text_barcode_readability:!1,selfie_local_lenses_check_web:!1,id_model_hebrew_back_id:!1,id_face_readability:!1,new_id_capture_ux_least_risky_clients:!1,id_test_aa:!1,iad_checks:!1,iad_c_checks:!1,id_iou_check:!0,new_fingerprint:!1,mp_test_hashed_id:!1},clientExperimentIds={new_id_capture_ux_least_risky_clients:"experimentV2"};let initPromise=null;const initialize=async({flowId:Be,apiKey:Le,sessionIdentifier:Ye,apiURL:tt,clientExperimentId:nt})=>{if(initPromise)return initPromise;initPromise=(async()=>{var gt;const ft={customIDs:{client_api_key:Le,hashed_onboarding_id:Ye,flow_id:Be},custom:{landing_page:(gt=window==null?void 0:window.location)==null?void 0:gt.href}},ht=new src$2.StatsigClient(clientApiKey,ft,{environment:getStatsigEnvironment(tt)});await ht.initializeAsync(),FEATURE_FLAGS.forEach(At=>{if(nt&&clientExperimentIds[At]===nt){featureFlagsValues[At]=!0;return}featureFlagsValues[At]=ht.checkGate(At)})})(),await initPromise},getFeatureFlag=Be=>featureFlagsValues[Be]??!1,getModuleFeatureFlags=async Be=>{const Le={};GLOBAL_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]});const Ye=Be.toLowerCase();return Ye.includes("id")||Ye==="government-validation"?ID_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}):(Ye.includes("selfie")||Ye==="face")&&SELFIE_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}),Le};function IdCaptureParamsConfigurator(Be,Le,Ye,tt){Object.assign(Be,{areaDown:25e3,areaUp:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:160,widthIOSDown:85,widthDown:tt?110:135,widthUp:205,framesAggregationInterval:tt?3e3:2e3,minFaceIdQualityScore:.62})}function getSelfieFaceDetectionPipelineParams(){return{frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.86,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.85,minFaceQualityScore:.63,isOcclusionCheckEnabled:!1,faceOcclusionThreshold:.3}}const getProfiles=()=>[new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Current Prod - Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_02,DetectionType.IDCapture,["id_capture_2_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"https://www.notion.so/ML-Update-ID-processing-model-to-accept-more-back-ID-types-18c4c3caef49801e95b4fd6bf9b92883?pvs=4"),new PipelineProfile(WasmPipelineType.IdBarcodeAndTextQualityPipeline,PipelineProfileName.IdCapture_3_02,DetectionType.IDCapture,["id_capture_3_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV3x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Pipeline with text and barcode quality: https://www.notion.so/Web-Use-Text-Barcode-model-2nd-iteration-1bc4c3caef49805aa9e6d308db9fc6dd?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:!0},IdCaptureParamsConfigurator,"Current Prod - Id Videoselfie profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieWithAggregationMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Current Prod - Selfie face detection profile with quality metrics"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieVideoSelfie,DetectionType.SelfieVideoSelfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"VideoSelfie face detection profile")];function getProfile(Be){const Le=getProfiles().find(Ye=>Ye.name===Be);if(!Le)throw new Error(`Profile not found for type: ${Be}`);return Le}const wasmVersion="v2.12.44";function generateBundle(){const Be=getFeatureFlag("id_text_barcode_readability")?PipelineProfileName.IdCapture_3_02:getFeatureFlag("id_model_hebrew_back_id")?PipelineProfileName.IdCapture_2_02:PipelineProfileName.IdCapture_2_01,Le=PipelineProfileName.SelfieWithQualityMetrics,Ye=PipelineProfileName.SelfieVideoSelfie,tt=PipelineProfileName.IdVideoSelfie_2_01;return[Be,tt,Le,Ye]}function getInitializationParams(){const Le=generateBundle(),Ye="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",tt=`${Ye}/${wasmVersion}/webLib.wasm`,nt=`${Ye}/${wasmVersion}/webLibSimd.wasm`,ft=`${Ye}/${wasmVersion}/webLib.js`,ht=`${Ye}/${wasmVersion}/versions.json`;let gt=new Map,At=new Map;for(const xt of Le){const Et=getProfile(xt);if(!Et)throw new Error(`Profile not found: ${xt}`);const yt=Et.modelNames;let Ct=[];for(const kt of yt)Ct.push(`${Ye}/${wasmVersion}/models/${kt}`);gt.set(Et.pipelineType,Ct),At.set(Et.detectionType,Et)}return{wasmModulePath:tt,wasmSimdModulePath:nt,glueCodePath:ft,versionsFilePath:ht,pipelineModels:gt,enableSIMD:!0,profiles:At,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.pipelineApiUtilities=null,this.utilityApi=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.inspectorOpened_=!1,this.wasmCallMutex=new Mutex,this.Module=null,this.loadModule=async Le=>{this.Module=(await import(Le)).Module}}async initialize(Le,Ye,tt,nt,ft,ht){await this.freeResources(),this.pipelines_=ht,this.versionsFile=ft,await this.loadModule(tt);const gt=await this.loadWasm(nt,Le,Ye);return this.pipelineApiUtilities=new this.wasmModule.PipelineApiUtilities,this.utilityApi=new this.wasmModule.UtilityApi,this.idCaptureWasmApi=new this.wasmModule.IdCaptureApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionApi,this.isInitialized_=!0,gt}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.pipelineApiUtilities!=null&&this.utilityApi!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(Le,Ye){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(Le&&Ye&&Le==this.imageWidth_&&Ye==this.imageHeight_&&this.inputImageBuffer&&Le*Ye*4===this.inputImageBuffer.length)&&(this.imageWidth_=Le,this.imageHeight_=Ye,this.inputImageBuffer=this.pipelineApiUtilities.allocateInputImageBuffer(Le,Ye,4))}async handleDetectionCallAndUpdateState(Le){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.handleDetectionCallAndUpdateState(this.pipelineTypeToWasmEnum(Le))}encryptImage(Le){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.utilityApi.encryptImage(Le)}isVirtualCamera(Le){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),Le)return this.utilityApi.isVirtualCamera(Le)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.utilityApi.estimatePerformance()}async analyzeFrame(Le){this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(Le.width,Le.height),this.inputImageBuffer.set(Le.data),this.utilityApi.analyzeFrame()}async freeResources(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,window.wasmArrayBuffer=null,this.pipelineApiUtilities&&typeof this.pipelineApiUtilities.delete=="function"&&(this.pipelineApiUtilities.delete(),this.pipelineApiUtilities=null),this.utilityApi&&typeof this.utilityApi.delete=="function"&&(this.utilityApi.delete(),this.utilityApi=null),this.idCaptureWasmApi&&typeof this.idCaptureWasmApi.delete=="function"&&(this.idCaptureWasmApi.delete(),this.idCaptureWasmApi=null),this.faceDetectionWasmApi&&typeof this.faceDetectionWasmApi.delete=="function"&&(this.faceDetectionWasmApi.delete(),this.faceDetectionWasmApi=null),this.wasmModule=null,this.isInitialized_=!1}resetPipeline(Le){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.pipelineApiUtilities.resetPipeline(this.pipelineTypeToWasmEnum(Le))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[Le,Ye]of this.pipelines_)this.resetPipeline(Le)}resetOther(){this.checkWasmInitialization("Unable to reset other states, cpp API hasn't been initialized"),this.utilityApi.resetOther()}reset(){this.resetAllPipelines(),this.resetOther()}async process(Le,Ye){if(this.checkWasmInitialization("Unable to process the image, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");switch(this.inputImageBuffer.set(Le.data),Ye){case WasmPipelineType.IdBlurGlarePipeline:case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.idCaptureWasmApi.runIdCapturePipeline(this.pipelineTypeToWasmEnum(Ye));case WasmPipelineType.IdFaceDetectionPipeline:return this.faceDetectionWasmApi.runIdFaceDetectionPipeline();case WasmPipelineType.IdVideoSelfiePipeline:return this.idCaptureWasmApi.runIdVideoSelfiePipeline();case WasmPipelineType.SelfieWithAggregationMetrics:case WasmPipelineType.SelfieWithQualityMetrics:return this.faceDetectionWasmApi.runSelfieFaceDetectionPipeline(this.pipelineTypeToWasmEnum(Ye));default:throw new Error("Unknown pipeline type")}}async runIdCapture(Le){if(this.checkWasmInitialization("Unable to run Id Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(Le.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(Le){if(this.checkWasmInitialization("Unable to run Selfie Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(Le.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceDetectionThresholds(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}async setFaceAttributesThresholds(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceChecksEnabled(Le,Ye,tt,nt,ft,ht){this.checkWasmInitialization("Unable to set face checks enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceChecksEnabled(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht)}async setFaceDetectionMode(Le,Ye){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.pipelineTypeToWasmEnum(Le),Ye)}async setFaceDetectionCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt,bt,It,wt,Rt,Tt){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt,bt,It,wt,Rt,Tt)}async setIdCaptureThresholds(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt)}async setIdCaptureCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt)}async setIdCaptureGeometryParams(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt)}async setIdCaptureConfigParams(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}setIdCaptureModelType(Le,Ye){this.checkWasmInitialization("Unable to set model type, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureModelType(this.pipelineTypeToWasmEnum(Le),this.IdCaptureModelTypeToWasmEnum(Ye))}IdPerspectiveTransform(Le,Ye){return this.checkWasmInitialization("Unable to perform perspective transform, cpp API hasn't been initialized"),this.idCaptureWasmApi.IdPerspectiveTransform(Le,Ye)}async getVersions(){const Ye=await(await fetch(this.versionsFile)).text();return JSON.parse(Ye)}async loadWasm(Le,Ye,tt){const nt=Le?tt:Ye;try{window.wasmArrayBuffer=await fetch(nt).then(ft=>ft.arrayBuffer()).then(ft=>new Uint8Array(ft)),this.wasmModule=await this.Module()}catch(ft){if(console.log(ft,Le,"useSmd"),Le)return await this.loadWasm(!1,Ye,tt);throw ft}return Le}async loadModels(){var nt;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let Le=new this.wasmModule.PipelineTypeToIntMap,Ye=new Map,tt=new Map;for(let[ft,ht]of this.pipelines_){let gt=this.pipelineTypeToWasmEnum(ft),At=[],xt=new this.wasmModule.VectorInt;for(let Et of ht){if(!tt.has(Et)){let Ct=await fetch(Et).then(kt=>kt.arrayBuffer()).then(kt=>new Uint8Array(kt));tt.set(Et,Ct)}let yt=tt.get(Et);xt.push_back(yt.byteLength),At.push(yt)}Le.set(gt,xt),Ye.set(gt,At)}this.modelsBuffers=this.pipelineApiUtilities.allocateModelsBuffers(Le);for(let[ft,ht]of Ye){let gt=(nt=this.modelsBuffers)==null?void 0:nt.get(ft);for(let At=0;At<gt.size();At++){let xt=gt==null?void 0:gt.get(At);if(xt)xt.set(ht[At]);else throw new Error("Unable to get model buffer from shared memory!")}}}async initializePipelines(){this.checkWasmInitialization("Unable to initialize pipelines, cpp API hasn't been initialized"),this.modelsBuffers||await this.loadModels(),this.pipelineApiUtilities.initializePipelines()}async setProductionMode(Le){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.utilityApi.setProductionMode(Le)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.pipelineTypeFromWasmEnum(this.pipelineApiUtilities.getCurrentPipeline())}setSdkVersion(Le){this.checkWasmInitialization("Unable to set sdk version, cpp API hasn't been initialized"),this.utilityApi.setSdkVersion(Le)}setSdkPlatform(Le){this.checkWasmInitialization("Unable to set device type, cpp API hasn't been initialized"),this.utilityApi.setSdkPlatform(Le)}setDeviceInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set device info, cpp API hasn't been initialized"),this.utilityApi.setDeviceInfo(Le,Ye)}setBrowserInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set browser info, cpp API hasn't been initialized"),this.utilityApi.setBrowserInfo(Le,Ye)}setCameraInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set camera info, cpp API hasn't been initialized"),this.utilityApi.setCameraInfo(Le,Ye)}setZc(Le){this.checkWasmInitialization("Unable to set zc, cpp API hasn't been initialized"),this.utilityApi.setZc(Le)}setMotionStatus(Le){this.checkWasmInitialization("Unable to set motion status, cpp API hasn't been initialized"),this.utilityApi.setMotionStatus(Le)}setMetadataField(Le,Ye){this.checkWasmInitialization("Unable to set metadata field, cpp API hasn't been initialized"),this.utilityApi.setMetadataField(Le,Ye)}setInspectorOpened(Le){this.inspectorOpened_=Le}setBackgroundMode(Le){this.checkWasmInitialization("Unable to set background mode, cpp API hasn't been initialized"),this.utilityApi.setBackgroundMode(Le)}getCheck(){return this.checkWasmInitialization("Unable to get check, cpp API hasn't been initialized"),this.utilityApi.getCheck()}getMetadata(){return this.checkWasmInitialization("Unable to get metadata, cpp API hasn't been initialized"),this.utilityApi.setInspectorOpened(this.inspectorOpened_),this.utilityApi.getMetadata()}async prc(){return this.checkWasmInitialization("Unable to prc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.prc.bind(this.utilityApi),[])}async poc(Le){this.checkWasmInitialization("Unable to poc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.poc.bind(this.utilityApi),[Le])}pipelineTypeToWasmEnum(Le){switch(Le){case WasmPipelineType.IdBlurGlarePipeline:return this.wasmModule.PipelineType.IdBlurGlarePipeline;case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.wasmModule.PipelineType.IdBarcodeAndTextQualityPipeline;case WasmPipelineType.IdFaceDetectionPipeline:return this.wasmModule.PipelineType.IdFaceDetectionPipeline;case WasmPipelineType.IdVideoSelfiePipeline:return this.wasmModule.PipelineType.IdVideoSelfiePipeline;case WasmPipelineType.SelfieWithAggregationMetrics:return this.wasmModule.PipelineType.SelfieWithAggregationMetrics;case WasmPipelineType.SelfieWithQualityMetrics:return this.wasmModule.PipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}pipelineTypeFromWasmEnum(Le){switch(Le){case this.wasmModule.PipelineType.IdBlurGlarePipeline:return WasmPipelineType.IdBlurGlarePipeline;case this.wasmModule.IdBarcodeAndTextQualityPipeline:return WasmPipelineType.IdBarcodeAndTextQualityPipeline;case this.wasmModule.PipelineType.IdFaceDetectionPipeline:return WasmPipelineType.IdFaceDetectionPipeline;case this.wasmModule.PipelineType.IdVideoSelfiePipeline:return WasmPipelineType.IdVideoSelfiePipeline;case this.wasmModule.PipelineType.SelfieWithAggregationMetrics:return WasmPipelineType.SelfieWithAggregationMetrics;case this.wasmModule.PipelineType.SelfieWithQualityMetrics:return WasmPipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}IdCaptureModelTypeToWasmEnum(Le){switch(Le){case IdCaptureModelType.IdCaptureV1x:return this.wasmModule.IdCaptureModelType.IdCaptureV1x;case IdCaptureModelType.IdCaptureV2x:return this.wasmModule.IdCaptureModelType.IdCaptureV2x;case IdCaptureModelType.IdCaptureV3x:return this.wasmModule.IdCaptureModelType.IdCaptureV3x;default:throw new Error("Unknown Id Capture model type")}}checkWasmInitialization(Le){if(!this.isInitialized())throw new Error(Le)}async wasmCallWrapper(Le,Ye=[]){return await this.wasmCallMutex.withLock(async(...tt)=>{let nt=!1;try{for(;;){if(nt=Le(...tt),nt)return;await new Promise(ft=>setTimeout(ft,0))}}catch(ft){console.log("Error in wasmCallWrapper:",ft)}},...Ye)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance(),version$4="1.85.0-20251216190848.0";function e$2(Be,Le){return function(Ye,tt){return Object.prototype.hasOwnProperty.call(Ye,tt)}(Be,Le)?Be[Le]:void 0}function t$2(Be,Le,Ye,tt){const nt=document,ft="securitypolicyviolation";let ht;const gt=xt=>{const Et=new URL(Be,location.href),{blockedURI:yt}=xt;yt!==Et.href&&yt!==Et.protocol.slice(0,-1)&&yt!==Et.origin||(ht=xt,At())};nt.addEventListener(ft,gt);const At=()=>nt.removeEventListener(ft,gt);return Promise.resolve().then(Le).then(xt=>(At(),xt),xt=>new Promise(Et=>{const yt=new MessageChannel;yt.port1.onmessage=()=>Et(),yt.port2.postMessage(null)}).then(()=>{if(At(),ht)return Ye(ht);throw xt}))}function n$2(Be){let Le="";for(let Ye=0;Ye<Be.length;++Ye)if(Ye>0){const tt=Be[Ye].toLowerCase();tt!==Be[Ye]?Le+=` ${tt}`:Le+=Be[Ye]}else Le+=Be[Ye].toUpperCase();return Le}const r$4={default:"endpoint"},o$1={default:"tlsEndpoint"},i$5="Client timeout",R$2="Network connection error",s$3="Network request aborted",a$3="Response cannot be parsed",c$3="Blocked by CSP",E$1="The endpoint parameter is not a valid URL",l$1="Handle on demand agent data error",u$1=n$2("WrongRegion"),d$1=n$2("SubscriptionNotActive"),_$2=n$2("UnsupportedVersion"),O$1=n$2("InstallationMethodRestricted"),p$1=n$2("HostnameRestricted"),I$1=n$2("IntegrationFailed"),f$2=n$2("NetworkRestricted"),N$1=n$2("InvalidProxyIntegrationSecret"),T$1=n$2("InvalidProxyIntegrationHeaders"),h$e=n$2("ProxyIntegrationSecretEnvironmentMismatch"),v$d="API key required",m$2="API key not found",A$1="API key expired",w$e="Request cannot be parsed",P$1="Request failed",D$1="Request failed to process",S$1="Too many requests, rate limit exceeded",y="Not available for this origin",g$1="Not available with restricted header",L$1=v$d,C$1=m$2,U$1=A$1;var b$2="3.12.3";const M$1="Failed to load the JS script of the agent",K="9319";function V(Be,Le){const Ye=[],[tt,nt]=function(gt){const At=function(yt){const Ct=[...yt];return{current:()=>Ct[0],postpone(){const kt=Ct.shift();kt!==void 0&&Ct.push(kt)},exclude(){Ct.shift()}}}(gt),xt=function(yt,Ct){let kt=0;return()=>Math.random()*Math.min(Ct,yt*Math.pow(2,kt++))}(100,3e3),Et=new Set;return[At.current(),(yt,Ct)=>{let kt;const vt=Ct instanceof Error?Ct.message:"";if(vt===c$3||vt===E$1)At.exclude(),kt=0;else if(vt===K)At.exclude();else if(vt===M$1){const It=Date.now()-yt.getTime()<50,wt=At.current();wt&&It&&!Et.has(wt)&&(Et.add(wt),kt=0),At.postpone()}else At.postpone();const bt=At.current();return bt===void 0?void 0:[bt,kt??yt.getTime()+xt()-Date.now()]}]}(Be);let ft;if(tt===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));const ht=gt=>{const At=new Date,xt=yt=>Ye.push({url:gt,startedAt:At,finishedAt:new Date,error:yt}),Et=Le(gt);return Et.then(()=>xt(),xt),Et.catch(yt=>{if(ft!=null||(ft=yt),Ye.length>=5)throw ft;const Ct=nt(At,yt);if(!Ct)throw ft;const[kt,vt]=Ct;return(bt=vt,new Promise(It=>setTimeout(It,bt))).then(()=>ht(kt));var bt})};return ht(tt).then(gt=>[gt,Ye])}const k$1="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",G=k$1;function B$1(Be){var Le,Ye;const{picked:tt,rest:nt}=function(Et,yt){const Ct={},kt={};for(const[vt,bt]of Object.entries(Et))yt.includes(vt)?Ct[vt]=bt:kt[vt]=bt;return{picked:Ct,rest:kt}}(Be,["scriptUrlPattern","token","apiKey"]),ft=tt.token,ht=(Le=tt.apiKey)!==null&&Le!==void 0?Le:ft,gt=(Ye=e$2(Be,"scriptUrlPattern"))!==null&&Ye!==void 0?Ye:k$1,[At,xt]=function(){const Et=[],yt=()=>{Et.push({time:new Date,state:document.visibilityState})},Ct=function(kt,vt,bt,It){return kt.addEventListener(vt,bt,It),()=>kt.removeEventListener(vt,bt,It)}(document,"visibilitychange",yt);return yt(),[Et,Ct]}();return Promise.resolve().then(()=>{if(!ht||typeof ht!="string")throw new Error(v$d);const Et=function(yt,Ct){return(Array.isArray(yt)?yt:[yt]).map(kt=>function(vt,bt){const It=encodeURIComponent;return vt.replace(/<[^<>]+>/g,wt=>wt==="<version>"?"3":wt==="<apiKey>"?It(bt):wt==="<loaderVersion>"?It(b$2):wt)}(String(kt),Ct))}(gt,ht);return V(Et,F$1)}).catch(Et=>{throw xt(),function(yt){return yt instanceof Error&&yt.message===K?new Error(M$1):yt}(Et)}).then(([Et,yt])=>(xt(),Et.load({...nt,ldi:{attempts:yt,visibilityStates:At}})))}function F$1(Be){return t$2(Be,()=>function(Le){return new Promise((Ye,tt)=>{if(function(gt){if(URL.prototype)try{return new URL(gt,location.href),!1}catch(At){if(At instanceof Error&&At.name==="TypeError")return!0;throw At}}(Le))throw new Error(E$1);const nt=document.createElement("script"),ft=()=>{var gt;return(gt=nt.parentNode)===null||gt===void 0?void 0:gt.removeChild(nt)},ht=document.head||document.getElementsByTagName("head")[0];nt.onload=()=>{ft(),Ye()},nt.onerror=()=>{ft(),tt(new Error(M$1))},nt.async=!0,nt.src=Le,ht.appendChild(nt)})}(Be),()=>{throw new Error(c$3)}).then(x$1)}function x$1(){const Be=window,Le="__fpjs_p_l_b",Ye=Be[Le];if(function(tt,nt){var ft;const ht=(ft=Object.getOwnPropertyDescriptor)===null||ft===void 0?void 0:ft.call(Object,tt,nt);ht!=null&&ht.configurable?delete tt[nt]:ht&&!ht.writable||(tt[nt]=void 0)}(Be,Le),typeof(Ye==null?void 0:Ye.load)!="function")throw new Error(K);return Ye}var H={load:B$1,defaultScriptUrlPattern:G,ERROR_SCRIPT_LOAD_FAIL:M$1,ERROR_API_KEY_EXPIRED:A$1,ERROR_API_KEY_INVALID:m$2,ERROR_API_KEY_MISSING:v$d,ERROR_BAD_REQUEST_FORMAT:w$e,ERROR_BAD_RESPONSE_FORMAT:a$3,ERROR_CLIENT_TIMEOUT:i$5,ERROR_CSP_BLOCK:c$3,ERROR_FORBIDDEN_ENDPOINT:p$1,ERROR_FORBIDDEN_HEADER:g$1,ERROR_FORBIDDEN_ORIGIN:y,ERROR_GENERAL_SERVER_FAILURE:P$1,ERROR_HANDLE_AGENT_DATA:l$1,ERROR_INSTALLATION_METHOD_RESTRICTED:O$1,ERROR_INTEGRATION_FAILURE:I$1,ERROR_INVALID_ENDPOINT:E$1,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:T$1,ERROR_INVALID_PROXY_INTEGRATION_SECRET:N$1,ERROR_NETWORK_ABORT:s$3,ERROR_NETWORK_CONNECTION:R$2,ERROR_NETWORK_RESTRICTED:f$2,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:h$e,ERROR_RATE_LIMIT:S$1,ERROR_SERVER_TIMEOUT:D$1,ERROR_SUBSCRIPTION_NOT_ACTIVE:d$1,ERROR_TOKEN_EXPIRED:U$1,ERROR_TOKEN_INVALID:C$1,ERROR_TOKEN_MISSING:L$1,ERROR_UNSUPPORTED_VERSION:_$2,ERROR_WRONG_REGION:u$1,defaultEndpoint:r$4,defaultTlsEndpoint:o$1};function e$1(Be,Le,Ye,tt){return new(Ye||(Ye=Promise))(function(nt,ft){function ht(xt){try{At(tt.next(xt))}catch(Et){ft(Et)}}function gt(xt){try{At(tt.throw(xt))}catch(Et){ft(Et)}}function At(xt){var Et;xt.done?nt(xt.value):(Et=xt.value,Et instanceof Ye?Et:new Ye(function(yt){yt(Et)})).then(ht,gt)}At((tt=tt.apply(Be,[])).next())})}function n$1(Be,Le){var Ye,tt,nt,ft,ht={label:0,sent:function(){if(1&nt[0])throw nt[1];return nt[1]},trys:[],ops:[]};return ft={next:gt(0),throw:gt(1),return:gt(2)},typeof Symbol=="function"&&(ft[Symbol.iterator]=function(){return this}),ft;function gt(At){return function(xt){return function(Et){if(Ye)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,Et[0]&&(ht=0)),ht;)try{if(Ye=1,tt&&(nt=2&Et[0]?tt.return:Et[0]?tt.throw||((nt=tt.return)&&nt.call(tt),0):tt.next)&&!(nt=nt.call(tt,Et[1])).done)return nt;switch(tt=0,nt&&(Et=[2&Et[0],nt.value]),Et[0]){case 0:case 1:nt=Et;break;case 4:return ht.label++,{value:Et[1],done:!1};case 5:ht.label++,tt=Et[1],Et=[0];continue;case 7:Et=ht.ops.pop(),ht.trys.pop();continue;default:if(nt=ht.trys,!((nt=nt.length>0&&nt[nt.length-1])||Et[0]!==6&&Et[0]!==2)){ht=0;continue}if(Et[0]===3&&(!nt||Et[1]>nt[0]&&Et[1]<nt[3])){ht.label=Et[1];break}if(Et[0]===6&&ht.label<nt[1]){ht.label=nt[1],nt=Et;break}if(nt&&ht.label<nt[2]){ht.label=nt[2],ht.ops.push(Et);break}nt[2]&&ht.ops.pop(),ht.trys.pop();continue}Et=Le.call(Be,ht)}catch(yt){Et=[6,yt],tt=0}finally{Ye=nt=0}if(5&Et[0])throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}([At,xt])}}}typeof SuppressedError=="function"&&SuppressedError;var r$3={exclude:[],include:[],logging:!0,timeout:1e3},o={},a$2={timeout:"true"},i$4=function(Be,Le){typeof window<"u"&&(o[Be]=Le)},u=function(){return Object.fromEntries(Object.entries(o).filter(function(Be){var Le,Ye=Be[0];return!(!((Le=r$3==null?void 0:r$3.exclude)===null||Le===void 0)&&Le.includes(Ye))}).filter(function(Be){var Le,Ye,tt,nt,ft=Be[0];return!((Le=r$3==null?void 0:r$3.include)===null||Le===void 0)&&Le.some(function(ht){return ht.includes(".")})?(Ye=r$3==null?void 0:r$3.include)===null||Ye===void 0?void 0:Ye.some(function(ht){return ht.startsWith(ft)}):((tt=r$3==null?void 0:r$3.include)===null||tt===void 0?void 0:tt.length)===0||((nt=r$3==null?void 0:r$3.include)===null||nt===void 0?void 0:nt.includes(ft))}).map(function(Be){return[Be[0],(0,Be[1])()]}))};function c$2(Be){return Be^=Be>>>16,Be=Math.imul(Be,2246822507),Be^=Be>>>13,Be=Math.imul(Be,3266489909),(Be^=Be>>>16)>>>0}var s$2=new Uint32Array([597399067,2869860233,951274213,2716044179]);function l(Be,Le){return Be<<Le|Be>>>32-Le}function d(Be,Le){var Ye;if(Le===void 0&&(Le=0),Le=Le?0|Le:0,typeof Be=="string"&&(Ye=Be,Be=new TextEncoder().encode(Ye).buffer),!(Be instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");var tt=new Uint32Array([Le,Le,Le,Le]);(function(ft,ht){for(var gt=ft.byteLength/16|0,At=new Uint32Array(ft,0,4*gt),xt=0;xt<gt;xt++){var Et=At.subarray(4*xt,4*(xt+1));Et[0]=Math.imul(Et[0],s$2[0]),Et[0]=l(Et[0],15),Et[0]=Math.imul(Et[0],s$2[1]),ht[0]=ht[0]^Et[0],ht[0]=l(ht[0],19),ht[0]=ht[0]+ht[1],ht[0]=Math.imul(ht[0],5)+1444728091,Et[1]=Math.imul(Et[1],s$2[1]),Et[1]=l(Et[1],16),Et[1]=Math.imul(Et[1],s$2[2]),ht[1]=ht[1]^Et[1],ht[1]=l(ht[1],17),ht[1]=ht[1]+ht[2],ht[1]=Math.imul(ht[1],5)+197830471,Et[2]=Math.imul(Et[2],s$2[2]),Et[2]=l(Et[2],17),Et[2]=Math.imul(Et[2],s$2[3]),ht[2]=ht[2]^Et[2],ht[2]=l(ht[2],15),ht[2]=ht[2]+ht[3],ht[2]=Math.imul(ht[2],5)+2530024501,Et[3]=Math.imul(Et[3],s$2[3]),Et[3]=l(Et[3],18),Et[3]=Math.imul(Et[3],s$2[0]),ht[3]=ht[3]^Et[3],ht[3]=l(ht[3],13),ht[3]=ht[3]+ht[0],ht[3]=Math.imul(ht[3],5)+850148119}})(Be,tt),function(ft,ht){var gt=ft.byteLength/16|0,At=ft.byteLength%16,xt=new Uint32Array(4),Et=new Uint8Array(ft,16*gt,At);switch(At){case 15:xt[3]=xt[3]^Et[14]<<16;case 14:xt[3]=xt[3]^Et[13]<<8;case 13:xt[3]=xt[3]^Et[12],xt[3]=Math.imul(xt[3],s$2[3]),xt[3]=l(xt[3],18),xt[3]=Math.imul(xt[3],s$2[0]),ht[3]=ht[3]^xt[3];case 12:xt[2]=xt[2]^Et[11]<<24;case 11:xt[2]=xt[2]^Et[10]<<16;case 10:xt[2]=xt[2]^Et[9]<<8;case 9:xt[2]=xt[2]^Et[8],xt[2]=Math.imul(xt[2],s$2[2]),xt[2]=l(xt[2],17),xt[2]=Math.imul(xt[2],s$2[3]),ht[2]=ht[2]^xt[2];case 8:xt[1]=xt[1]^Et[7]<<24;case 7:xt[1]=xt[1]^Et[6]<<16;case 6:xt[1]=xt[1]^Et[5]<<8;case 5:xt[1]=xt[1]^Et[4],xt[1]=Math.imul(xt[1],s$2[1]),xt[1]=l(xt[1],16),xt[1]=Math.imul(xt[1],s$2[2]),ht[1]=ht[1]^xt[1];case 4:xt[0]=xt[0]^Et[3]<<24;case 3:xt[0]=xt[0]^Et[2]<<16;case 2:xt[0]=xt[0]^Et[1]<<8;case 1:xt[0]=xt[0]^Et[0],xt[0]=Math.imul(xt[0],s$2[0]),xt[0]=l(xt[0],15),xt[0]=Math.imul(xt[0],s$2[1]),ht[0]=ht[0]^xt[0]}}(Be,tt),function(ft,ht){ht[0]=ht[0]^ft.byteLength,ht[1]=ht[1]^ft.byteLength,ht[2]=ht[2]^ft.byteLength,ht[3]=ht[3]^ft.byteLength,ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0,ht[0]=c$2(ht[0]),ht[1]=c$2(ht[1]),ht[2]=c$2(ht[2]),ht[3]=c$2(ht[3]),ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0}(Be,tt);var nt=new Uint8Array(tt.buffer);return Array.from(nt).map(function(ft){return ft.toString(16).padStart(2,"0")}).join("")}function f$1(Be,Le){return new Promise(function(Ye){setTimeout(function(){return Ye(Le)},Be)})}function m$1(Be,Le,Ye){return Promise.all(Be.map(function(tt){return Promise.race([tt,f$1(Le,Ye)])}))}function g(){return e$1(this,void 0,void 0,function(){var Be,Le,Ye,tt,nt;return n$1(this,function(ft){switch(ft.label){case 0:return ft.trys.push([0,2,,3]),Be=u(),Le=Object.keys(Be),[4,m$1(Object.values(Be),(r$3==null?void 0:r$3.timeout)||1e3,a$2)];case 1:return Ye=ft.sent(),tt=Ye.filter(function(ht){return ht!==void 0}),nt={},tt.forEach(function(ht,gt){nt[Le[gt]]=ht}),[2,p(nt,r$3.exclude||[],r$3.include||[],"")];case 2:throw ft.sent();case 3:return[2]}})})}function p(Be,Le,Ye,tt){tt===void 0&&(tt="");for(var nt={},ft=function(xt,Et){var yt=tt+xt+".";if(typeof Et!="object"||Array.isArray(Et)){var Ct=Le.some(function(bt){return yt.startsWith(bt)}),kt=Ye.some(function(bt){return yt.startsWith(bt)});Ct&&!kt||(nt[xt]=Et)}else{var vt=p(Et,Le,Ye,yt);Object.keys(vt).length>0&&(nt[xt]=vt)}},ht=0,gt=Object.entries(Be);ht<gt.length;ht++){var At=gt[ht];ft(At[0],At[1])}return nt}function w$d(Be){return e$1(this,void 0,void 0,function(){var Le,Ye;return n$1(this,function(tt){switch(tt.label){case 0:return tt.trys.push([0,2,,3]),[4,g()];case 1:return Le=tt.sent(),Ye=d(JSON.stringify(Le)),Math.random()<1e-5&&r$3.logging&&function(nt,ft){e$1(this,void 0,void 0,function(){var ht,gt;return n$1(this,function(At){switch(At.label){case 0:if(ht="https://logging.thumbmarkjs.com/v1/log",gt={thumbmark:nt,components:ft,version:"0.20.6"},sessionStorage.getItem("_tmjs_l"))return[3,4];sessionStorage.setItem("_tmjs_l","1"),At.label=1;case 1:return At.trys.push([1,3,,4]),[4,fetch(ht,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)})];case 2:case 3:return At.sent(),[3,4];case 4:return[2]}})})}(Ye,Le),[2,Ye.toString()];case 2:throw tt.sent();case 3:return[2]}})})}function b$1(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};for(var Be=navigator.userAgent,Le={edg:"Edge",opr:"Opera",samsung:"SamsungBrowser"},Ye=0,tt=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/,/(?<name>samsung).*Version\/(?<version>\d+(?:\.\d+)?)/i,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/];Ye<tt.length;Ye++){var nt=tt[Ye],ft=Be.match(nt);if(ft&&ft.groups)return{name:Le[ft.groups.name.toLowerCase()]||ft.groups.name,version:ft.groups.version}}return{name:"unknown",version:"unknown"}}function S(Be){for(var Le=0,Ye=0;Ye<Be.length;++Ye)Le+=Math.abs(Be[Ye]);return Le}var M=b$1();function E(Be,Le,Ye){for(var tt=[],nt=0;nt<Be[0].data.length;nt++){for(var ft=[],ht=0;ht<Be.length;ht++)ft.push(Be[ht].data[nt]);tt.push(P(ft))}var gt=new Uint8ClampedArray(tt);return new ImageData(gt,Le,Ye)}function P(Be){if(Be.length===0)return 0;for(var Le={},Ye=0,tt=Be;Ye<tt.length;Ye++)Le[ft=tt[Ye]]=(Le[ft]||0)+1;var nt=Be[0];for(var ft in Le)Le[ft]>Le[nt]&&(nt=parseInt(ft,10));return nt}["SamsungBrowser","Safari"].includes(M.name)||i$4("audio",function(){return e$1(this,void 0,void 0,function(){return n$1(this,function(Be){return[2,new Promise(function(Le,Ye){try{var tt=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),nt=tt.createBufferSource(),ft=tt.createOscillator();ft.frequency.value=1e3;var ht,gt=tt.createDynamicsCompressor();gt.threshold.value=-50,gt.knee.value=40,gt.ratio.value=12,gt.attack.value=0,gt.release.value=.2,ft.connect(gt),gt.connect(tt.destination),ft.start(),tt.oncomplete=function(At){ht=At.renderedBuffer.getChannelData(0),Le({sampleHash:S(ht),oscillator:ft.type,maxChannels:tt.destination.maxChannelCount,channelCountMode:nt.channelCountMode})},tt.startRendering()}catch(At){console.error("Error creating audio fingerprint:",At),Ye(At)}})]})})});var A=b$1(),C=A.name.toLowerCase(),x=A.version.split(".")[0]||"0",T=parseInt(x,10);C==="firefox"||C==="safari"&&T===17||i$4("canvas",function(){return document.createElement("canvas").getContext("2d"),new Promise(function(Be){var Le=Array.from({length:3},function(){return function(){var Ye=document.createElement("canvas"),tt=Ye.getContext("2d");if(!tt)return new ImageData(1,1);Ye.width=280,Ye.height=20;var nt=tt.createLinearGradient(0,0,Ye.width,Ye.height);nt.addColorStop(0,"red"),nt.addColorStop(.16666666666666666,"orange"),nt.addColorStop(.3333333333333333,"yellow"),nt.addColorStop(.5,"green"),nt.addColorStop(.6666666666666666,"blue"),nt.addColorStop(.8333333333333334,"indigo"),nt.addColorStop(1,"violet"),tt.fillStyle=nt,tt.fillRect(0,0,Ye.width,Ye.height);var ft="Random Text WMwmil10Oo";return tt.font="23.123px Arial",tt.fillStyle="black",tt.fillText(ft,-5,15),tt.fillStyle="rgba(0, 0, 255, 0.5)",tt.fillText(ft,-3.3,17.7),tt.beginPath(),tt.moveTo(0,0),tt.lineTo(2*Ye.width/7,Ye.height),tt.strokeStyle="white",tt.lineWidth=2,tt.stroke(),tt.getImageData(0,0,Ye.width,Ye.height)}()});Be({commonImageDataHash:d(E(Le,280,20).data.toString()).toString()})})});var k,I=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],R$1=["monospace","sans-serif","serif"];function L(Be,Le){if(!Be)throw new Error("Canvas context not supported");return Be.font,Be.font="72px ".concat(Le),Be.measureText("WwMmLli0Oo").width}function _$1(){var Be,Le=document.createElement("canvas"),Ye=(Be=Le.getContext("webgl"))!==null&&Be!==void 0?Be:Le.getContext("experimental-webgl");if(Ye&&"getParameter"in Ye)try{var tt=(Ye.getParameter(Ye.VENDOR)||"").toString(),nt=(Ye.getParameter(Ye.RENDERER)||"").toString(),ft={vendor:tt,renderer:nt,version:(Ye.getParameter(Ye.VERSION)||"").toString(),shadingLanguageVersion:(Ye.getParameter(Ye.SHADING_LANGUAGE_VERSION)||"").toString()};if(!nt.length||!tt.length){var ht=Ye.getExtension("WEBGL_debug_renderer_info");if(ht){var gt=(Ye.getParameter(ht.UNMASKED_VENDOR_WEBGL)||"").toString(),At=(Ye.getParameter(ht.UNMASKED_RENDERER_WEBGL)||"").toString();gt&&(ft.vendorUnmasked=gt),At&&(ft.rendererUnmasked=At)}}return ft}catch{}return"undefined"}function O(){var Be=new Float32Array(1),Le=new Uint8Array(Be.buffer);return Be[0]=1/0,Be[0]=Be[0]-Be[0],Le[3]}function B(Be,Le){var Ye={};return Le.forEach(function(tt){var nt=function(ft){if(ft.length===0)return null;var ht={};ft.forEach(function(xt){var Et=String(xt);ht[Et]=(ht[Et]||0)+1});var gt=ft[0],At=1;return Object.keys(ht).forEach(function(xt){ht[xt]>At&&(gt=xt,At=ht[xt])}),gt}(Be.map(function(ft){return tt in ft?ft[tt]:void 0}).filter(function(ft){return ft!==void 0}));nt&&(Ye[tt]=nt)}),Ye}function D(){var Be=[],Le={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(Le).forEach(function(Ye){Le[Ye].forEach(function(tt){matchMedia("(".concat(Ye,": ").concat(tt,")")).matches&&Be.push("".concat(Ye,": ").concat(tt))})}),Be}b$1().name!="Firefox"&&i$4("fonts",function(){var Be=this;return new Promise(function(Le,Ye){try{(function(tt){var nt;e$1(this,void 0,void 0,function(){var ft,ht,gt;return n$1(this,function(At){switch(At.label){case 0:return document.body?[3,2]:[4,(xt=50,new Promise(function(yt){return setTimeout(yt,xt,Et)}))];case 1:return At.sent(),[3,0];case 2:if((ft=document.createElement("iframe")).setAttribute("frameBorder","0"),(ht=ft.style).setProperty("position","fixed"),ht.setProperty("display","block","important"),ht.setProperty("visibility","visible"),ht.setProperty("border","0"),ht.setProperty("opacity","0"),ft.src="about:blank",document.body.appendChild(ft),!(gt=ft.contentDocument||((nt=ft.contentWindow)===null||nt===void 0?void 0:nt.document)))throw new Error("Iframe document is not accessible");return tt({iframe:gt}),setTimeout(function(){document.body.removeChild(ft)},0),[2]}var xt,Et})})})(function(tt){var nt=tt.iframe;return e$1(Be,void 0,void 0,function(){var ft,ht,gt,At;return n$1(this,function(xt){return ft=nt.createElement("canvas"),ht=ft.getContext("2d"),gt=R$1.map(function(Et){return L(ht,Et)}),At={},I.forEach(function(Et){var yt=L(ht,Et);gt.includes(yt)||(At[Et]=yt)}),Le(At),[2]})})})}catch{Ye({error:"unsupported"})}})}),i$4("hardware",function(){return new Promise(function(Be,Le){var Ye=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,tt=window.performance&&window.performance.memory?window.performance.memory:0;Be({videocard:_$1(),architecture:O(),deviceMemory:Ye.toString()||"undefined",jsHeapSizeLimit:tt.jsHeapSizeLimit||0})})}),i$4("locales",function(){return new Promise(function(Be){Be({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}),i$4("permissions",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){return k=(r$3==null?void 0:r$3.permissions_to_check)||["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],b$1().name.toLowerCase()==="safari"&&(k=k.filter(function(Ye){return!["camera","geolocation","microphone"].includes(Ye)})),Be=Array.from({length:(r$3==null?void 0:r$3.retries)||3},function(){return function(){return e$1(this,void 0,void 0,function(){var Ye,tt,nt,ft,ht;return n$1(this,function(gt){switch(gt.label){case 0:Ye={},tt=0,nt=k,gt.label=1;case 1:if(!(tt<nt.length))return[3,6];ft=nt[tt],gt.label=2;case 2:return gt.trys.push([2,4,,5]),[4,navigator.permissions.query({name:ft})];case 3:return ht=gt.sent(),Ye[ft]=ht.state.toString(),[3,5];case 4:return gt.sent(),[3,5];case 5:return tt++,[3,1];case 6:return[2,Ye]}})})}()}),[2,Promise.all(Be).then(function(Ye){return B(Ye,k)})]})})}),i$4("plugins",function(){var Be=[];if(navigator.plugins)for(var Le=0;Le<navigator.plugins.length;Le++){var Ye=navigator.plugins[Le];Be.push([Ye.name,Ye.filename,Ye.description].join("|"))}return new Promise(function(tt){tt({plugins:Be})})}),i$4("screen",function(){return new Promise(function(Be){Be({is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:D()})})}),i$4("system",function(){return new Promise(function(Be){var Le=b$1(),Ye={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:Le.name,version:Le.version}};Le.name.toLowerCase()!=="safari"&&(Ye.applePayVersion=function(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{for(var tt=window.ApplePaySession.supportsVersion,nt=15;nt>0;nt--)if(tt(nt))return nt}catch{return 0}return 0}(),Ye.cookieEnabled=window.navigator.cookieEnabled),Be(Ye)})});var U,N=b$1().name!=="SamsungBrowser"?1:3,F=null;i$4("webgl",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){typeof document<"u"&&((U=document.createElement("canvas")).width=200,U.height=100,F=U.getContext("webgl"));try{if(!F)throw new Error("WebGL not supported");return Be=Array.from({length:N},function(){return function(){try{if(!F)throw new Error("WebGL not supported");var Ye=`
66
+ `;typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let Be,Le;return{promise:new Promise((tt,nt)=>{Be=tt,Le=nt}),resolve:Be,reject:Le}});class InterruptionHandler{constructor(){this.boundVisibilityChange=this.handleVisibilityChange.bind(this),this.boundOnline=this.handleOnline.bind(this),this.boundOffline=this.handleOffline.bind(this),this.boundUnhandledRejection=this.handleUnhandledRejection.bind(this),this.boundError=this.handleError.bind(this),this.initialized=!1}registerEventListeners(){this.initialized||(document.addEventListener("visibilitychange",this.boundVisibilityChange),window.addEventListener("online",this.boundOnline),window.addEventListener("offline",this.boundOffline),window.addEventListener("unhandledrejection",this.boundUnhandledRejection),window.addEventListener("error",this.boundError),this.initialized=!0)}removeEventListeners(){this.initialized&&(this.initialized=!1,document.removeEventListener("visibilitychange",this.boundVisibilityChange),window.removeEventListener("online",this.boundOnline),window.removeEventListener("offline",this.boundOffline),window.removeEventListener("unhandledrejection",this.boundUnhandledRejection),window.removeEventListener("error",this.boundError))}handleVisibilityChange(){document.hidden?this.onAppHidden():this.onAppVisible()}onAppHidden(){}onAppVisible(){}handleOnline(){}handleOffline(){}handleUnhandledRejection(Le){}handleError(Le){}}const regex$1={CURP_PATTERN:/^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,EMAIL_PATTERN:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};function webgl(){let Be,Le,Ye=256,tt=128;Be=document.body.appendChild(document.createElement("canvas")),Be.width=Ye,Be.height=tt;try{Le=Be.getContext("webgl2")||Be.getContext("experimental-webgl2")||Be.getContext("webgl")||Be.getContext("experimental-webgl")||Be.getContext("moz-webgl");const nt="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",ft="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",ht=Le.createBuffer();Le.bindBuffer(Le.ARRAY_BUFFER,ht);const gt=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0]);Le.bufferData(Le.ARRAY_BUFFER,gt,Le.STATIC_DRAW),ht.itemSize=3,ht.numItems=3;const At=Le.createProgram(),xt=Le.createShader(Le.VERTEX_SHADER);Le.shaderSource(xt,nt),Le.compileShader(xt);const Et=Le.createShader(Le.FRAGMENT_SHADER);Le.shaderSource(Et,ft),Le.compileShader(Et),Le.attachShader(At,xt),Le.attachShader(At,Et),Le.linkProgram(At),Le.useProgram(At),At.vertexPosAttrib=Le.getAttribLocation(At,"attrVertex"),At.offsetUniform=Le.getUniformLocation(At,"uniformOffset"),Le.enableVertexAttribArray(At.vertexPosAttrib),Le.vertexAttribPointer(At.vertexPosAttrib,ht.itemSize,Le.FLOAT,!1,0,0),Le.uniform2f(At.offsetUniform,1,1),Le.drawArrays(Le.TRIANGLE_STRIP,0,ht.numItems);let yt="";const Ct=new Uint8Array(Ye*tt*4);return Le.readPixels(0,0,Ye,tt,Le.RGBA,Le.UNSIGNED_BYTE,Ct),yt=JSON.stringify(Ct).replace(/,?"[0-9]+":/g,""),document.body.removeChild(Be),sha256(yt)}catch{return""}}const sha256=(()=>{let Be=1,Le,Ye=[],tt=[];for(;++Be<18;)for(Le=Be*Be;Le<312;Le+=Be)Ye[Le]=1;function nt(gt,At){return Math.pow(gt,1/At)%1*4294967296|0}for(Be=1,Le=0;Be<313;)Ye[++Be]||(tt[Le]=nt(Be,2),Ye[Le++]=nt(Be,3));function ft(gt,At){return gt>>>At|gt<<32-At}function ht(gt){let At=tt.slice(Be=0),xt=unescape(encodeURI(gt)),Et=[],yt=xt.length,Ct=[],kt,vt,bt;for(;Be<yt;)Ct[Be>>2]|=(xt.charCodeAt(Be)&255)<<8*(3-Be++%4);for(yt*=8,Ct[yt>>5]|=128<<24-yt%32,Ct[bt=yt+64>>5|15]=yt,Be=0;Be<bt;Be+=16){for(kt=At.slice(Le=0,8);Le<64;kt[4]+=vt)Le<16?Et[Le]=Ct[Le+Be]:Et[Le]=(ft(vt=Et[Le-2],17)^ft(vt,19)^vt>>>10)+(Et[Le-7]|0)+(ft(vt=Et[Le-15],7)^ft(vt,18)^vt>>>3)+(Et[Le-16]|0),kt.unshift((vt=(kt.pop()+(ft(gt=kt[4],6)^ft(gt,11)^ft(gt,25))+((gt&kt[5]^~gt&kt[6])+Ye[Le])|0)+(Et[Le++]|0))+(ft(yt=kt[0],2)^ft(yt,13)^ft(yt,22))+(yt&kt[1]^kt[1]&kt[2]^kt[2]&yt));for(Le=8;Le--;)At[Le]=kt[Le]+At[Le]}for(xt="";Le<63;)xt+=(At[++Le>>3]>>4*(7-Le%8)&15).toString(16);return xt}return ht})();var store;function getGlobalConfig$1(Be){return{lang:store==null?void 0:store.lang,message:Be==null?void 0:Be.message,abortEarly:store==null?void 0:store.abortEarly,abortPipeEarly:store==null?void 0:store.abortPipeEarly}}var store2;function getGlobalMessage$1(Be){return store2==null?void 0:store2.get(Be)}var store3;function getSchemaMessage$1(Be){return store3==null?void 0:store3.get(Be)}var store4;function getSpecificMessage$1(Be,Le){var Ye;return(Ye=store4==null?void 0:store4.get(Be))==null?void 0:Ye.get(Le)}function _stringify$4(Be){var Ye,tt;const Le=typeof Be;return Le==="string"?`"${Be}"`:Le==="number"||Le==="bigint"||Le==="boolean"?`${Be}`:Le==="object"||Le==="function"?(Be&&((tt=(Ye=Object.getPrototypeOf(Be))==null?void 0:Ye.constructor)==null?void 0:tt.name))??"null":Le}function _addIssue$1(Be,Le,Ye,tt,nt){const ft=nt&&"input"in nt?nt.input:Ye.value,ht=(nt==null?void 0:nt.expected)??Be.expects??null,gt=(nt==null?void 0:nt.received)??_stringify$4(ft),At={kind:Be.kind,type:Be.type,input:ft,expected:ht,received:gt,message:`Invalid ${Le}: ${ht?`Expected ${ht} but r`:"R"}eceived ${gt}`,requirement:Be.requirement,path:nt==null?void 0:nt.path,issues:nt==null?void 0:nt.issues,lang:tt.lang,abortEarly:tt.abortEarly,abortPipeEarly:tt.abortPipeEarly},xt=Be.kind==="schema",Et=(nt==null?void 0:nt.message)??Be.message??getSpecificMessage$1(Be.reference,At.lang)??(xt?getSchemaMessage$1(At.lang):null)??tt.message??getGlobalMessage$1(At.lang);Et!==void 0&&(At.message=typeof Et=="function"?Et(At):Et),xt&&(Ye.typed=!1),Ye.issues?Ye.issues.push(At):Ye.issues=[At]}function _getStandardProps$1(Be){return{version:1,vendor:"valibot",validate(Le){return Be["~run"]({value:Le},getGlobalConfig$1())}}}function _joinExpects(Be,Le){const Ye=[...new Set(Be)];return Ye.length>1?`(${Ye.join(` ${Le} `)})`:Ye[0]??"never"}function isValiError(Be){return Be instanceof ValiError}var ValiError=class extends Error{constructor(Be){super(Be[0].message),this.name="ValiError",this.issues=Be}};function getFallback$1(Be,Le,Ye){return typeof Be.fallback=="function"?Be.fallback(Le,Ye):Be.fallback}function getDefault$1(Be,Le,Ye){return typeof Be.default=="function"?Be.default(Le,Ye):Be.default}function boolean$2(Be){return{kind:"schema",type:"boolean",reference:boolean$2,expects:"boolean",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="boolean"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function custom(Be,Le){return{kind:"schema",type:"custom",reference:custom,expects:"unknown",async:!1,check:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return this.check(Ye.value)?Ye.typed=!0:_addIssue$1(this,"type",Ye,tt),Ye}}}function function_(Be){return{kind:"schema",type:"function",reference:function_,expects:"Function",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="function"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function literal(Be,Le){return{kind:"schema",type:"literal",reference:literal,expects:_stringify$4(Be),async:!1,literal:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return Ye.value===this.literal?Ye.typed=!0:_addIssue$1(this,"type",Ye,tt),Ye}}}function null_(Be){return{kind:"schema",type:"null",reference:null_,expects:"null",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return Le.value===null?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function number$3(Be){return{kind:"schema",type:"number",reference:number$3,expects:"number",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="number"&&!isNaN(Le.value)?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function object$1(Be,Le){return{kind:"schema",type:"object",reference:object$1,expects:"Object",async:!1,entries:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){var ft;const nt=Ye.value;if(nt&&typeof nt=="object"){Ye.typed=!0,Ye.value={};for(const ht in this.entries){const gt=this.entries[ht];if(ht in nt||(gt.type==="exact_optional"||gt.type==="optional"||gt.type==="nullish")&&gt.default!==void 0){const At=ht in nt?nt[ht]:getDefault$1(gt),xt=gt["~run"]({value:At},tt);if(xt.issues){const Et={type:"object",origin:"value",input:nt,key:ht,value:At};for(const yt of xt.issues)yt.path?yt.path.unshift(Et):yt.path=[Et],(ft=Ye.issues)==null||ft.push(yt);if(Ye.issues||(Ye.issues=xt.issues),tt.abortEarly){Ye.typed=!1;break}}xt.typed||(Ye.typed=!1),Ye.value[ht]=xt.value}else if(gt.fallback!==void 0)Ye.value[ht]=getFallback$1(gt);else if(gt.type!=="exact_optional"&&gt.type!=="optional"&&gt.type!=="nullish"&&(_addIssue$1(this,"key",Ye,tt,{input:void 0,expected:`"${ht}"`,path:[{type:"object",origin:"key",input:nt,key:ht,value:nt[ht]}]}),tt.abortEarly))break}}else _addIssue$1(this,"type",Ye,tt);return Ye}}}function optional$1(Be,Le){return{kind:"schema",type:"optional",reference:optional$1,expects:`(${Be.expects} | undefined)`,async:!1,wrapped:Be,default:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return Ye.value===void 0&&(this.default!==void 0&&(Ye.value=getDefault$1(this,Ye,tt)),Ye.value===void 0)?(Ye.typed=!0,Ye):this.wrapped["~run"](Ye,tt)}}}function string$3(Be){return{kind:"schema",type:"string",reference:string$3,expects:"string",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="string"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function _subIssues(Be){let Le;if(Be)for(const Ye of Be)Le?Le.push(...Ye.issues):Le=Ye.issues;return Le}function union(Be,Le){return{kind:"schema",type:"union",reference:union,expects:_joinExpects(Be.map(Ye=>Ye.expects),"|"),async:!1,options:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){let nt,ft,ht;for(const gt of this.options){const At=gt["~run"]({value:Ye.value},tt);if(At.typed)if(At.issues)ft?ft.push(At):ft=[At];else{nt=At;break}else ht?ht.push(At):ht=[At]}if(nt)return nt;if(ft){if(ft.length===1)return ft[0];_addIssue$1(this,"type",Ye,tt,{issues:_subIssues(ft)}),Ye.typed=!0}else{if((ht==null?void 0:ht.length)===1)return ht[0];_addIssue$1(this,"type",Ye,tt,{issues:_subIssues(ht)})}return Ye}}}function parse$8(Be,Le,Ye){const tt=Be["~run"]({value:Le},getGlobalConfig$1(Ye));if(tt.issues)throw new ValiError(tt.issues);return tt.value}function validate$2(...Be){try{Be.forEach(({schema:Le,value:Ye})=>parse$8(Le,Ye))}catch(Le){if(isValiError(Le)){const Ye=Le.issues.map(tt=>{var ft;return`${((ft=tt.path)==null?void 0:ft.map(ht=>ht.key).join("."))||"root"}: ${tt.message}`}).join(", ");throw new Error(`Validation failed: ${Ye}`)}throw Le}}exports.api=void 0;function setApi(Be){exports.api=Be}function setToken(Be){exports.api.defaults.headers["X-Incode-Hardware-Id"]=Be}const eventsQueue=[];function addEvent(Be){const{token:Le,code:Ye,module:tt,screen:nt,clientTimestamp:ft,payload:ht={}}=Be;if(!Le){eventsQueue.push(Be);return}return exports.api.post("/omni/interview-events",[{code:Ye,module:tt,screen:nt,clientTimestamp:ft??new Date().getTime(),payload:ht}],{headers:{"X-Incode-Hardware-Id":Le}}).catch(()=>{})}function emptyQueue(Be){eventsQueue.forEach(Le=>{addEvent({...Le,token:Be})})}const state={token:null};var PipelineProfileName=(Be=>(Be[Be.IdCapture_2_01=0]="IdCapture_2_01",Be[Be.IdCapture_2_02=1]="IdCapture_2_02",Be[Be.IdCapture_3_02=2]="IdCapture_3_02",Be[Be.IdVideoSelfie_2_01=3]="IdVideoSelfie_2_01",Be[Be.SelfieWithAggregationMetrics=4]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=5]="SelfieWithQualityMetrics",Be[Be.SelfieVideoSelfie=6]="SelfieVideoSelfie",Be))(PipelineProfileName||{});class PipelineProfile{constructor(Le,Ye,tt,nt,ft,ht=null,gt=""){this.pipelineType=Le,this.name=Ye,this.detectionType=tt,this.modelNames=nt,this.parameters=ft,this.paramsConfigurator=ht,this.description=gt}reconfigureParams(Le,Ye){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,Le,Ye)}}var DetectionType=(Be=>(Be[Be.IDCapture=0]="IDCapture",Be[Be.Selfie=1]="Selfie",Be[Be.SelfieVideoSelfie=2]="SelfieVideoSelfie",Be[Be.IdVideoSelfie=3]="IdVideoSelfie",Be))(DetectionType||{}),WasmPipelineType=(Be=>(Be[Be.IdBlurGlarePipeline=0]="IdBlurGlarePipeline",Be[Be.IdBarcodeAndTextQualityPipeline=1]="IdBarcodeAndTextQualityPipeline",Be[Be.IdVideoSelfiePipeline=2]="IdVideoSelfiePipeline",Be[Be.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",Be[Be.IdFaceDetectionPipeline=5]="IdFaceDetectionPipeline",Be))(WasmPipelineType||{}),IdCaptureModelType=(Be=>(Be[Be.IdCaptureV1x=0]="IdCaptureV1x",Be[Be.IdCaptureV2x=1]="IdCaptureV2x",Be[Be.IdCaptureV3x=2]="IdCaptureV3x",Be))(IdCaptureModelType||{}),src$2={},src$1={},$_StatsigGlobal={},Log={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Log=Be.LogLevel=void 0;const Le=" DEBUG ",Ye=" INFO ",tt=" WARN ",nt=" ERROR ";function ft(gt){return gt.unshift("[Statsig]"),gt}Be.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class ht{static info(...At){ht.level>=Be.LogLevel.Info&&console.info(Ye,...ft(At))}static debug(...At){ht.level>=Be.LogLevel.Debug&&console.debug(Le,...ft(At))}static warn(...At){ht.level>=Be.LogLevel.Warn&&console.warn(tt,...ft(At))}static error(...At){ht.level>=Be.LogLevel.Error&&console.error(nt,...ft(At))}}Be.Log=ht,ht.level=Be.LogLevel.Warn})(Log),function(Be){var Le,Ye,tt;Object.defineProperty(Be,"__esModule",{value:!0}),Be._getInstance=Be._getStatsigGlobalFlag=Be._getStatsigGlobal=void 0;const nt=Log,ft=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:Ct}catch{return Ct}};Be._getStatsigGlobal=ft;const ht=kt=>(0,Be._getStatsigGlobal)()[kt];Be._getStatsigGlobalFlag=ht;const gt=kt=>{const vt=(0,Be._getStatsigGlobal)();return kt?vt.instances&&vt.instances[kt]:(vt.instances&&Object.keys(vt.instances).length>1&&nt.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),vt.firstInstance)};Be._getInstance=gt;const At="__STATSIG__",xt=typeof window<"u"?window:{},Et=typeof commonjsGlobal<"u"?commonjsGlobal:{},yt=typeof globalThis<"u"?globalThis:{},Ct=(tt=(Ye=(Le=xt[At])!==null&&Le!==void 0?Le:Et[At])!==null&&Ye!==void 0?Ye:yt[At])!==null&&tt!==void 0?tt:{instance:Be._getInstance};xt[At]=Ct,Et[At]=Ct,yt[At]=Ct}($_StatsigGlobal);var Diagnostics={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Diagnostics=void 0;const Le=new Map,Ye="start",tt="end",nt="statsig::diagnostics";Be.Diagnostics={_getMarkers:xt=>Le.get(xt),_markInitOverallStart:xt=>{gt(xt,ft({},Ye,"overall"))},_markInitOverallEnd:(xt,Et,yt)=>{gt(xt,ft({success:Et,error:Et?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:yt},tt,"overall"))},_markInitNetworkReqStart:(xt,Et)=>{gt(xt,ft(Et,Ye,"initialize","network_request"))},_markInitNetworkReqEnd:(xt,Et)=>{gt(xt,ft(Et,tt,"initialize","network_request"))},_markInitProcessStart:xt=>{gt(xt,ft({},Ye,"initialize","process"))},_markInitProcessEnd:(xt,Et)=>{gt(xt,ft(Et,tt,"initialize","process"))},_clearMarkers:xt=>{Le.delete(xt)},_formatError(xt){if(xt&&typeof xt=="object")return{code:At(xt,"code"),name:At(xt,"name"),message:At(xt,"message")}},_getDiagnosticsData(xt,Et,yt,Ct){var kt;return{success:(xt==null?void 0:xt.ok)===!0,statusCode:xt==null?void 0:xt.status,sdkRegion:(kt=xt==null?void 0:xt.headers)===null||kt===void 0?void 0:kt.get("x-statsig-region"),isDelta:yt.includes('"is_delta":true')===!0?!0:void 0,attempt:Et,error:Be.Diagnostics._formatError(Ct)}},_enqueueDiagnosticsEvent(xt,Et,yt,Ct){const kt=Be.Diagnostics._getMarkers(yt);if(kt==null||kt.length<=0)return-1;const vt=kt[kt.length-1].timestamp-kt[0].timestamp;Be.Diagnostics._clearMarkers(yt);const bt=ht(xt,{context:"initialize",markers:kt.slice(),statsigOptions:Ct});return Et.enqueue(bt),vt}};function ft(xt,Et,yt,Ct){return Object.assign({key:yt,action:Et,step:Ct,timestamp:Date.now()},xt)}function ht(xt,Et){return{eventName:nt,user:xt,value:null,metadata:Et,time:Date.now()}}function gt(xt,Et){var yt;const Ct=(yt=Le.get(xt))!==null&&yt!==void 0?yt:[];Ct.push(Et),Le.set(xt,Ct)}function At(xt,Et){if(Et in xt)return xt[Et]}})(Diagnostics);var EventLogger$1={},CacheKey={},Hashing={},TypingUtils={};Object.defineProperty(TypingUtils,"__esModule",{value:!0}),TypingUtils._isTypeMatch=TypingUtils._typeOf=void 0;function _typeOf(Be){return Array.isArray(Be)?"array":typeof Be}TypingUtils._typeOf=_typeOf;function _isTypeMatch(Be,Le){const Ye=tt=>Array.isArray(tt)?"array":tt===null?"null":typeof tt;return Ye(Be)===Ye(Le)}TypingUtils._isTypeMatch=_isTypeMatch,function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getSortedObject=Be._DJB2Object=Be._DJB2=void 0;const Le=TypingUtils,Ye=ft=>{let ht=0;for(let gt=0;gt<ft.length;gt++){const At=ft.charCodeAt(gt);ht=(ht<<5)-ht+At,ht=ht&ht}return String(ht>>>0)};Be._DJB2=Ye;const tt=(ft,ht)=>(0,Be._DJB2)(JSON.stringify((0,Be._getSortedObject)(ft,ht)));Be._DJB2Object=tt;const nt=(ft,ht)=>{if(ft==null)return null;const gt=Object.keys(ft).sort(),At={};return gt.forEach(xt=>{const Et=ft[xt];if(ht===0||(0,Le._typeOf)(Et)!=="object"){At[xt]=Et;return}At[xt]=(0,Be._getSortedObject)(Et,ht!=null?ht-1:ht)}),At};Be._getSortedObject=nt}(Hashing),Object.defineProperty(CacheKey,"__esModule",{value:!0}),CacheKey._getStorageKey=CacheKey._getUserStorageKey=void 0;const Hashing_1$4=Hashing;function _getUserStorageKey(Be,Le,Ye){var tt;if(Ye)return Ye(Be,Le);const nt=Le&&Le.customIDs?Le.customIDs:{},ft=[`uid:${(tt=Le==null?void 0:Le.userID)!==null&&tt!==void 0?tt:""}`,`cids:${Object.keys(nt).sort((ht,gt)=>ht.localeCompare(gt)).map(ht=>`${ht}-${nt[ht]}`).join(",")}`,`k:${Be}`];return(0,Hashing_1$4._DJB2)(ft.join("|"))}CacheKey._getUserStorageKey=_getUserStorageKey;function _getStorageKey(Be,Le,Ye){return Le?_getUserStorageKey(Be,Le,Ye):(0,Hashing_1$4._DJB2)(`k:${Be}`)}CacheKey._getStorageKey=_getStorageKey;var NetworkConfig={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.NetworkParam=Be.NetworkDefault=Be.Endpoint=void 0,Be.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},Be.NetworkDefault={[Be.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[Be.Endpoint._initialize]:"https://featureassets.org/v1",[Be.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},Be.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}})(NetworkConfig);var SafeJs={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getUnloadEvent=Be._getCurrentPageUrlSafe=Be._addDocumentEventListenerSafe=Be._addWindowEventListenerSafe=Be._isServerEnv=Be._getDocumentSafe=Be._getWindowSafe=void 0;const Le=()=>typeof window<"u"?window:null;Be._getWindowSafe=Le;const Ye=()=>{var At;const xt=(0,Be._getWindowSafe)();return(At=xt==null?void 0:xt.document)!==null&&At!==void 0?At:null};Be._getDocumentSafe=Ye;const tt=()=>{if((0,Be._getDocumentSafe)()!==null)return!1;const At=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||At};Be._isServerEnv=tt;const nt=(At,xt)=>{const Et=(0,Be._getWindowSafe)();typeof(Et==null?void 0:Et.addEventListener)=="function"&&Et.addEventListener(At,xt)};Be._addWindowEventListenerSafe=nt;const ft=(At,xt)=>{const Et=(0,Be._getDocumentSafe)();typeof(Et==null?void 0:Et.addEventListener)=="function"&&Et.addEventListener(At,xt)};Be._addDocumentEventListenerSafe=ft;const ht=()=>{var At;try{return(At=(0,Be._getWindowSafe)())===null||At===void 0?void 0:At.location.href.split(/[?#]/)[0]}catch{return}};Be._getCurrentPageUrlSafe=ht;const gt=()=>{const At=(0,Be._getWindowSafe)();return At&&"onpagehide"in At?"pagehide":"beforeunload"};Be._getUnloadEvent=gt})(SafeJs);var StatsigEvent={};Object.defineProperty(StatsigEvent,"__esModule",{value:!0}),StatsigEvent._createLayerParameterExposure=StatsigEvent._createConfigExposure=StatsigEvent._mapExposures=StatsigEvent._createGateExposure=StatsigEvent._isExposureEvent=void 0;const CONFIG_EXPOSURE_NAME="statsig::config_exposure",GATE_EXPOSURE_NAME="statsig::gate_exposure",LAYER_EXPOSURE_NAME="statsig::layer_exposure",_createExposure=(Be,Le,Ye,tt,nt)=>(Ye.bootstrapMetadata&&(tt.bootstrapMetadata=Ye.bootstrapMetadata),{eventName:Be,user:Le,value:null,metadata:_addEvaluationDetailsToMetadata(Ye,tt),secondaryExposures:nt,time:Date.now()}),_isExposureEvent=({eventName:Be})=>Be===GATE_EXPOSURE_NAME||Be===CONFIG_EXPOSURE_NAME||Be===LAYER_EXPOSURE_NAME;StatsigEvent._isExposureEvent=_isExposureEvent;const _createGateExposure=(Be,Le,Ye)=>{var tt,nt,ft;const ht={gate:Le.name,gateValue:String(Le.value),ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(ht.configVersion=Le.__evaluation.version),_createExposure(GATE_EXPOSURE_NAME,Be,Le.details,ht,_mapExposures((ft=(nt=Le.__evaluation)===null||nt===void 0?void 0:nt.secondary_exposures)!==null&&ft!==void 0?ft:[],Ye))};StatsigEvent._createGateExposure=_createGateExposure;function _mapExposures(Be,Le){return Be.map(Ye=>typeof Ye=="string"?(Le??{})[Ye]:Ye).filter(Ye=>Ye!=null)}StatsigEvent._mapExposures=_mapExposures;const _createConfigExposure=(Be,Le,Ye)=>{var tt,nt,ft,ht;const gt={config:Le.name,ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(gt.configVersion=Le.__evaluation.version),((nt=Le.__evaluation)===null||nt===void 0?void 0:nt.passed)!=null&&(gt.rulePassed=String(Le.__evaluation.passed)),_createExposure(CONFIG_EXPOSURE_NAME,Be,Le.details,gt,_mapExposures((ht=(ft=Le.__evaluation)===null||ft===void 0?void 0:ft.secondary_exposures)!==null&&ht!==void 0?ht:[],Ye))};StatsigEvent._createConfigExposure=_createConfigExposure;const _createLayerParameterExposure=(Be,Le,Ye,tt)=>{var nt,ft,ht,gt,At,xt,Et;const yt=Le.__evaluation,Ct=((nt=yt==null?void 0:yt.explicit_parameters)===null||nt===void 0?void 0:nt.includes(Ye))===!0;let kt="",vt=(ft=yt==null?void 0:yt.undelegated_secondary_exposures)!==null&&ft!==void 0?ft:[];Ct&&(kt=(ht=yt.allocated_experiment_name)!==null&&ht!==void 0?ht:"",vt=(gt=yt.secondary_exposures)!==null&&gt!==void 0?gt:[]);const bt=(At=Le.__evaluation)===null||At===void 0?void 0:At.parameter_rule_ids,It={config:Le.name,parameterName:Ye,ruleID:(xt=bt==null?void 0:bt[Ye])!==null&&xt!==void 0?xt:Le.ruleID,allocatedExperiment:kt,isExplicitParameter:String(Ct)};return((Et=Le.__evaluation)===null||Et===void 0?void 0:Et.version)!=null&&(It.configVersion=Le.__evaluation.version),_createExposure(LAYER_EXPOSURE_NAME,Be,Le.details,It,_mapExposures(vt,tt))};StatsigEvent._createLayerParameterExposure=_createLayerParameterExposure;const _addEvaluationDetailsToMetadata=(Be,Le)=>(Le.reason=Be.reason,Be.lcut&&(Le.lcut=String(Be.lcut)),Be.receivedAt&&(Le.receivedAt=String(Be.receivedAt)),Le);var StatsigOptionsCommon={};Object.defineProperty(StatsigOptionsCommon,"__esModule",{value:!0}),StatsigOptionsCommon.LoggingEnabledOption=StatsigOptionsCommon.LogEventCompressionMode=void 0,StatsigOptionsCommon.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},StatsigOptionsCommon.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"};var StorageProvider={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._setObjectInStorage=Be._getObjectFromStorage=Be.Storage=void 0;const Le=Log,Ye=SafeJs,tt={},nt={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:yt=>tt[yt]?tt[yt]:null,setItem:(yt,Ct)=>{tt[yt]=Ct},removeItem:yt=>{delete tt[yt]},getAllKeys:()=>Object.keys(tt)};let ft=null;try{const yt=(0,Ye._getWindowSafe)();yt&&yt.localStorage&&typeof yt.localStorage.getItem=="function"&&(ft={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:Ct=>yt.localStorage.getItem(Ct),setItem:(Ct,kt)=>yt.localStorage.setItem(Ct,kt),removeItem:Ct=>yt.localStorage.removeItem(Ct),getAllKeys:()=>Object.keys(yt.localStorage)})}catch{Le.Log.warn("Failed to setup localStorageProvider.")}let ht=ft??nt,gt=ht;function At(yt){try{return yt()}catch(Ct){if(Ct instanceof Error&&Ct.name==="SecurityError")return Be.Storage._setProvider(nt),null;throw Ct}}Be.Storage={isReady:()=>gt.isReady(),isReadyResolver:()=>gt.isReadyResolver(),getProviderName:()=>gt.getProviderName(),getItem:yt=>At(()=>gt.getItem(yt)),setItem:(yt,Ct)=>At(()=>gt.setItem(yt,Ct)),removeItem:yt=>gt.removeItem(yt),getAllKeys:()=>gt.getAllKeys(),_setProvider:yt=>{ht=yt,gt=yt},_setDisabled:yt=>{yt?gt=nt:gt=ht}};function xt(yt){const Ct=Be.Storage.getItem(yt);return JSON.parse(Ct??"null")}Be._getObjectFromStorage=xt;function Et(yt,Ct){Be.Storage.setItem(yt,JSON.stringify(Ct))}Be._setObjectInStorage=Et})(StorageProvider);var UrlConfiguration$1={};Object.defineProperty(UrlConfiguration$1,"__esModule",{value:!0}),UrlConfiguration$1.UrlConfiguration=void 0;const Hashing_1$3=Hashing,NetworkConfig_1$2=NetworkConfig,ENDPOINT_DNS_KEY_MAP={[NetworkConfig_1$2.Endpoint._initialize]:"i",[NetworkConfig_1$2.Endpoint._rgstr]:"e",[NetworkConfig_1$2.Endpoint._download_config_specs]:"d"};class UrlConfiguration{constructor(Le,Ye,tt,nt){this.customUrl=null,this.fallbackUrls=null,this.endpoint=Le,this.endpointDnsKey=ENDPOINT_DNS_KEY_MAP[Le],Ye&&(this.customUrl=Ye),!Ye&&tt&&(this.customUrl=tt.endsWith("/")?`${tt}${Le}`:`${tt}/${Le}`),nt&&(this.fallbackUrls=nt);const ft=NetworkConfig_1$2.NetworkDefault[Le];this.defaultUrl=`${ft}/${Le}`}getUrl(){var Le;return(Le=this.customUrl)!==null&&Le!==void 0?Le:this.defaultUrl}getChecksum(){var Le;const Ye=((Le=this.fallbackUrls)!==null&&Le!==void 0?Le:[]).sort().join(",");return(0,Hashing_1$3._DJB2)(this.customUrl+Ye)}}UrlConfiguration$1.UrlConfiguration=UrlConfiguration;var VisibilityObserving={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._notifyVisibilityChanged=Be._subscribeToVisiblityChanged=Be._isUnloading=Be._isCurrentlyVisible=void 0;const Le=SafeJs,Ye="foreground",tt="background",nt=[];let ft=Ye,ht=!1;const gt=()=>ft===Ye;Be._isCurrentlyVisible=gt;const At=()=>ht;Be._isUnloading=At;const xt=yt=>{nt.unshift(yt)};Be._subscribeToVisiblityChanged=xt;const Et=yt=>{yt!==ft&&(ft=yt,nt.forEach(Ct=>Ct(yt)))};Be._notifyVisibilityChanged=Et,(0,Le._addWindowEventListenerSafe)("focus",()=>{ht=!1,(0,Be._notifyVisibilityChanged)(Ye)}),(0,Le._addWindowEventListenerSafe)("blur",()=>(0,Be._notifyVisibilityChanged)(tt)),(0,Le._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,Be._notifyVisibilityChanged)(document.visibilityState==="visible"?Ye:tt)}),(0,Le._addWindowEventListenerSafe)((0,Le._getUnloadEvent)(),()=>{ht=!0,(0,Be._notifyVisibilityChanged)(tt)})})(VisibilityObserving);var __awaiter$f=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(EventLogger$1,"__esModule",{value:!0}),EventLogger$1.EventLogger=void 0;const CacheKey_1$1=CacheKey,Hashing_1$2=Hashing,Log_1$8=Log,NetworkConfig_1$1=NetworkConfig,SafeJs_1$3=SafeJs,StatsigEvent_1=StatsigEvent,StatsigOptionsCommon_1$2=StatsigOptionsCommon,StorageProvider_1$4=StorageProvider,UrlConfiguration_1=UrlConfiguration$1,VisibilityObserving_1$1=VisibilityObserving,DEFAULT_QUEUE_SIZE=100,DEFAULT_FLUSH_INTERVAL_MS=1e4,MAX_DEDUPER_KEYS=1e3,DEDUPER_WINDOW_DURATION_MS=6e5,MAX_FAILED_LOGS=500,QUICK_FLUSH_WINDOW_MS=200,EVENT_LOGGER_MAP={},RetryFailedLogsTrigger={Startup:"startup",GainedFocus:"gained_focus"};class EventLogger{static _safeFlushAndForget(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye.flush().catch(()=>{})}static _safeRetryFailedLogs(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus)}constructor(Le,Ye,tt,nt){var ft,ht;this._sdkKey=Le,this._emitter=Ye,this._network=tt,this._options=nt,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=(ft=nt==null?void 0:nt.loggingEnabled)!==null&&ft!==void 0?ft:(nt==null?void 0:nt.disableLogging)===!0?StatsigOptionsCommon_1$2.LoggingEnabledOption.disabled:StatsigOptionsCommon_1$2.LoggingEnabledOption.browserOnly,nt!=null&&nt.loggingEnabled&&nt.disableLogging!==void 0&&Log_1$8.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=(ht=nt==null?void 0:nt.loggingBufferMaxSize)!==null&&ht!==void 0?ht:DEFAULT_QUEUE_SIZE;const gt=nt==null?void 0:nt.networkConfig;this._logEventUrlConfig=new UrlConfiguration_1.UrlConfiguration(NetworkConfig_1$1.Endpoint._rgstr,gt==null?void 0:gt.logEventUrl,gt==null?void 0:gt.api,gt==null?void 0:gt.logEventFallbackUrls)}setLogEventCompressionMode(Le){this._network.setLogEventCompressionMode(Le)}setLoggingEnabled(Le){if(this._loggingEnabled==="disabled"&&Le!=="disabled"){const Ye=this._getStorageKey(),tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);tt&&this._queue.push(...tt),StorageProvider_1$4.Storage.removeItem(Ye)}this._loggingEnabled=Le}enqueue(Le){this._shouldLogEvent(Le)&&(this._normalizeAndAppendEvent(Le),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&EventLogger._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(Le){var Ye;const tt=(Ye=this._nonExposedChecks[Le])!==null&&Ye!==void 0?Ye:0;this._nonExposedChecks[Le]=tt+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var Le;const Ye=(0,SafeJs_1$3._isServerEnv)();Ye&&((Le=this._options)===null||Le===void 0?void 0:Le.loggingEnabled)!=="always"||(EVENT_LOGGER_MAP[this._sdkKey]=this,Ye||(0,VisibilityObserving_1$1._subscribeToVisiblityChanged)(tt=>{tt==="background"?EventLogger._safeFlushAndForget(this._sdkKey):tt==="foreground"&&EventLogger._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(RetryFailedLogsTrigger.Startup),this._startBackgroundFlushInterval())}stop(){return __awaiter$f(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete EVENT_LOGGER_MAP[this._sdkKey],yield this.flush()})}flush(){return __awaiter$f(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;const Le=this._queue;this._queue=[],yield this._sendEvents(Le)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>QUICK_FLUSH_WINDOW_MS)&&setTimeout(()=>EventLogger._safeFlushAndForget(this._sdkKey),QUICK_FLUSH_WINDOW_MS))}_shouldLogEvent(Le){var Ye;if(((Ye=this._options)===null||Ye===void 0?void 0:Ye.loggingEnabled)!=="always"&&(0,SafeJs_1$3._isServerEnv)())return!1;if(!(0,StatsigEvent_1._isExposureEvent)(Le))return!0;const tt=Le.user?Le.user:{statsigEnvironment:void 0},nt=(0,CacheKey_1$1._getUserStorageKey)(this._sdkKey,tt),ft=Le.metadata?Le.metadata:{},ht=[Le.eventName,nt,ft.gate,ft.config,ft.ruleID,ft.allocatedExperiment,ft.parameterName,String(ft.isExplicitParameter),ft.reason].join("|"),gt=this._lastExposureTimeMap[ht],At=Date.now();return gt&&At-gt<DEDUPER_WINDOW_DURATION_MS?!1:(Object.keys(this._lastExposureTimeMap).length>MAX_DEDUPER_KEYS&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[ht]=At,!0)}_sendEvents(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye,tt;if(this._loggingEnabled==="disabled")return this._saveFailedLogsToStorage(Le),!1;try{const ft=(0,VisibilityObserving_1$1._isUnloading)()&&this._network.isBeaconSupported()&&((tt=(Ye=this._options)===null||Ye===void 0?void 0:Ye.networkConfig)===null||tt===void 0?void 0:tt.networkOverrideFunc)==null;return this._emitter({name:"pre_logs_flushed",events:Le}),(ft?this._sendEventsViaBeacon(Le):yield this._sendEventsViaPost(Le)).success?(this._emitter({name:"logs_flushed",events:Le}),!0):(Log_1$8.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(Le),!1)}catch{return Log_1$8.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye;const tt=yield this._network.post(this._getRequestData(Le)),nt=(Ye=tt==null?void 0:tt.code)!==null&&Ye!==void 0?Ye:-1;return{success:nt>=200&&nt<300}})}_sendEventsViaBeacon(Le){return{success:this._network.beacon(this._getRequestData(Le))}}_getRequestData(Le){return{sdkKey:this._sdkKey,data:{events:Le},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[NetworkConfig_1$1.NetworkParam.EventCount]:String(Le.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(Le){for(;Le.length>MAX_FAILED_LOGS;)Le.shift();const Ye=this._getStorageKey();try{const tt=this._getFailedLogsFromStorage(Ye);(0,StorageProvider_1$4._setObjectInStorage)(Ye,[...tt,...Le])}catch{Log_1$8.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(Le){let Ye=[];try{const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Le);return Array.isArray(tt)&&(Ye=tt),Ye}catch{return[]}}_retryFailedLogs(Le){const Ye=this._getStorageKey();__awaiter$f(this,void 0,void 0,function*(){StorageProvider_1$4.Storage.isReady()||(yield StorageProvider_1$4.Storage.isReadyResolver());const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);if(!tt)return;Le===RetryFailedLogsTrigger.Startup&&StorageProvider_1$4.Storage.removeItem(Ye),(yield this._sendEvents(tt))&&Le===RetryFailedLogsTrigger.GainedFocus&&StorageProvider_1$4.Storage.removeItem(Ye)}).catch(()=>{Log_1$8.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,Hashing_1$2._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(Le){Le.user&&(Le.user=Object.assign({},Le.user),delete Le.user.privateAttributes);const Ye={},tt=this._getCurrentPageUrl();tt&&(Ye.statsigMetadata={currentPage:tt});const nt=Object.assign(Object.assign({},Le),Ye);Log_1$8.Log.debug("Enqueued Event:",nt),this._queue.push(nt)}_appendAndResetNonExposedChecks(){Object.keys(this._nonExposedChecks).length!==0&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var Le;if(((Le=this._options)===null||Le===void 0?void 0:Le.includeCurrentPageUrlWithEvents)!==!1)return(0,SafeJs_1$3._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var Le,Ye;const tt=(Ye=(Le=this._options)===null||Le===void 0?void 0:Le.loggingIntervalMs)!==null&&Ye!==void 0?Ye:DEFAULT_FLUSH_INTERVAL_MS,nt=setInterval(()=>{const ft=EVENT_LOGGER_MAP[this._sdkKey];!ft||ft._flushIntervalId!==nt?clearInterval(nt):EventLogger._safeFlushAndForget(this._sdkKey)},tt);this._flushIntervalId=nt}}EventLogger$1.EventLogger=EventLogger;var StatsigMetadata={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigMetadataProvider=Be.SDK_VERSION=void 0,Be.SDK_VERSION="3.28.1";let Le={sdkVersion:Be.SDK_VERSION,sdkType:"js-mono"};Be.StatsigMetadataProvider={get:()=>Le,add:Ye=>{Le=Object.assign(Object.assign({},Le),Ye)}}})(StatsigMetadata);var ClientInterfaces={};Object.defineProperty(ClientInterfaces,"__esModule",{value:!0});var DataAdapterCore$1={},StableID={},UUID={};Object.defineProperty(UUID,"__esModule",{value:!0}),UUID.getUUID=void 0;function getUUID(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let Be=new Date().getTime(),Le=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,tt=>{let nt=Math.random()*16;return Be>0?(nt=(Be+nt)%16|0,Be=Math.floor(Be/16)):(nt=(Le+nt)%16|0,Le=Math.floor(Le/16)),(tt==="x"?nt:nt&7|8).toString(16)})}UUID.getUUID=getUUID,Object.defineProperty(StableID,"__esModule",{value:!0}),StableID.getCookieName=StableID.StableID=void 0;const CacheKey_1=CacheKey,Log_1$7=Log,SafeJs_1$2=SafeJs,StorageProvider_1$3=StorageProvider,UUID_1=UUID,PROMISE_MAP={},COOKIE_ENABLED_MAP={},DISABLED_MAP={};StableID.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:Be=>{if(DISABLED_MAP[Be])return null;if(PROMISE_MAP[Be]!=null)return PROMISE_MAP[Be];let Le=null;return Le=_loadFromCookie(Be),Le!=null?(PROMISE_MAP[Be]=Le,_persistToStorage(Le,Be),Le):(Le=_loadFromStorage(Be),Le==null&&(Le=(0,UUID_1.getUUID)()),_persistToStorage(Le,Be),_persistToCookie(Le,Be),PROMISE_MAP[Be]=Le,Le)},setOverride:(Be,Le)=>{PROMISE_MAP[Le]=Be,_persistToStorage(Be,Le),_persistToCookie(Be,Le)},_setCookiesEnabled:(Be,Le)=>{COOKIE_ENABLED_MAP[Be]=Le},_setDisabled:(Be,Le)=>{DISABLED_MAP[Be]=Le}};function _getStableIDStorageKey(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}function _persistToStorage(Be,Le){const Ye=_getStableIDStorageKey(Le);try{(0,StorageProvider_1$3._setObjectInStorage)(Ye,Be)}catch{Log_1$7.Log.warn("Failed to save StableID to storage")}}function _loadFromStorage(Be){const Le=_getStableIDStorageKey(Be);return(0,StorageProvider_1$3._getObjectFromStorage)(Le)}function _loadFromCookie(Be){if(!COOKIE_ENABLED_MAP[Be]||(0,SafeJs_1$2._getDocumentSafe)()==null)return null;const Le=document.cookie.split(";");for(const Ye of Le){const[tt,nt]=Ye.trim().split("=");if(tt===getCookieName(Be))return decodeURIComponent(nt)}return null}function _persistToCookie(Be,Le){if(!COOKIE_ENABLED_MAP[Le]||(0,SafeJs_1$2._getDocumentSafe)()==null)return;const Ye=new Date;Ye.setFullYear(Ye.getFullYear()+1),document.cookie=`${getCookieName(Le)}=${encodeURIComponent(Be)}; expires=${Ye.toUTCString()}; path=/`}function getCookieName(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}StableID.getCookieName=getCookieName;var StatsigUser={};Object.defineProperty(StatsigUser,"__esModule",{value:!0}),StatsigUser._getFullUserHash=StatsigUser._normalizeUser=void 0;const Hashing_1$1=Hashing,Log_1$6=Log;function _normalizeUser(Be,Le,Ye){try{const tt=JSON.parse(JSON.stringify(Be));return Le!=null&&Le.environment!=null?tt.statsigEnvironment=Le.environment:Ye!=null&&(tt.statsigEnvironment={tier:Ye}),tt}catch{return Log_1$6.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}}StatsigUser._normalizeUser=_normalizeUser;function _getFullUserHash(Be){return Be?(0,Hashing_1$1._DJB2Object)(Be):null}StatsigUser._getFullUserHash=_getFullUserHash;var TypedJsonParse={};Object.defineProperty(TypedJsonParse,"__esModule",{value:!0}),TypedJsonParse._typedJsonParse=void 0;const Log_1$5=Log;function _typedJsonParse(Be,Le,Ye){try{const tt=JSON.parse(Be);if(tt&&typeof tt=="object"&&Le in tt)return tt}catch{}return Log_1$5.Log.error(`Failed to parse ${Ye}`),null}TypedJsonParse._typedJsonParse=_typedJsonParse;var __awaiter$e=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DataAdapterCore$1,"__esModule",{value:!0}),DataAdapterCore$1._makeDataAdapterResult=DataAdapterCore$1.DataAdapterCore=void 0;const Log_1$4=Log,StableID_1$2=StableID,StatsigUser_1=StatsigUser,StorageProvider_1$2=StorageProvider,TypedJsonParse_1=TypedJsonParse,CACHE_LIMIT=10,MAX_CACHE_WRITE_ATTEMPTS=8;class DataAdapterCore{constructor(Le,Ye){this._adapterName=Le,this._cacheSuffix=Ye,this._options=null,this._sdkKey=null,this._cacheLimit=CACHE_LIMIT,this._lastModifiedStoreKey=`statsig.last_modified_time.${Ye}`,this._inMemoryCache=new InMemoryCache}attach(Le,Ye,tt){this._sdkKey=Le,this._options=Ye}getDataSync(Le){const Ye=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),tt=this._getCacheKey(Ye),nt=this._inMemoryCache.get(tt,Ye);if(nt&&this._getIsCacheValueValid(nt))return nt;const ft=this._loadFromCache(tt);return ft&&this._getIsCacheValueValid(ft)?(this._inMemoryCache.add(tt,ft,this._cacheLimit),this._inMemoryCache.get(tt,Ye)):null}setData(Le,Ye){const tt=Ye&&(0,StatsigUser_1._normalizeUser)(Ye,this._options),nt=this._getCacheKey(tt);this._inMemoryCache.add(nt,_makeDataAdapterResult("Bootstrap",Le,null,tt),this._cacheLimit)}_getIsCacheValueValid(Le){return Le.stableID==null||Le.stableID===StableID_1$2.StableID.get(this._getSdkKey())}_getDataAsyncImpl(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){StorageProvider_1$2.Storage.isReady()||(yield StorageProvider_1$2.Storage.isReadyResolver());const nt=Le??this.getDataSync(Ye),ft=[this._fetchAndPrepFromNetwork(nt,Ye,tt)];return tt!=null&&tt.timeoutMs&&ft.push(new Promise(ht=>setTimeout(ht,tt.timeoutMs)).then(()=>(Log_1$4.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(ft)})}_prefetchDataImpl(Le,Ye){return __awaiter$e(this,void 0,void 0,function*(){const tt=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),nt=this._getCacheKey(tt),ft=yield this._getDataAsyncImpl(null,tt,Ye);ft&&this._inMemoryCache.add(nt,Object.assign(Object.assign({},ft),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){var nt;const ft=(nt=Le==null?void 0:Le.data)!==null&&nt!==void 0?nt:null,ht=Le!=null&&this._isCachedResultValidFor204(Le,Ye),gt=yield this._fetchFromNetwork(ft,Ye,tt,ht);if(!gt)return Log_1$4.Log.debug("No response returned for latest value"),null;const At=(0,TypedJsonParse_1._typedJsonParse)(gt,"has_updates","Response"),xt=this._getSdkKey(),Et=StableID_1$2.StableID.get(xt);let yt=null;if((At==null?void 0:At.has_updates)===!0)yt=_makeDataAdapterResult("Network",gt,Et,Ye);else if(ft&&(At==null?void 0:At.has_updates)===!1)yt=_makeDataAdapterResult("NetworkNotModified",ft,Et,Ye);else return null;const Ct=this._getCacheKey(Ye);return this._inMemoryCache.add(Ct,yt,this._cacheLimit),this._writeToCache(Ct,yt),yt})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(Log_1$4.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(Le){var Ye;const tt=(Ye=StorageProvider_1$2.Storage.getItem)===null||Ye===void 0?void 0:Ye.call(StorageProvider_1$2.Storage,Le);if(tt==null)return null;const nt=(0,TypedJsonParse_1._typedJsonParse)(tt,"source","Cached Result");return nt?Object.assign(Object.assign({},nt),{source:"Cache"}):null}_writeToCache(Le,Ye){const tt=JSON.stringify(Ye);for(let nt=0;nt<MAX_CACHE_WRITE_ATTEMPTS;nt++)try{StorageProvider_1$2.Storage.setItem(Le,tt);break}catch(ft){if(!(ft instanceof Error)||!(ft.toString().includes("QuotaExceededError")||ft.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw ft;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(Le,this._cacheLimit-1)}this._runLocalStorageCacheEviction(Le)}_runLocalStorageCacheEviction(Le,Ye=this._cacheLimit){var tt;const nt=(tt=(0,StorageProvider_1$2._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&tt!==void 0?tt:{};nt[Le]=Date.now();const ft=_getEvictableKeys(nt,Ye);for(const ht of ft)delete nt[ht],StorageProvider_1$2.Storage.removeItem(ht);(0,StorageProvider_1$2._setObjectInStorage)(this._lastModifiedStoreKey,nt)}}DataAdapterCore$1.DataAdapterCore=DataAdapterCore;function _makeDataAdapterResult(Be,Le,Ye,tt){return{source:Be,data:Le,receivedAt:Date.now(),stableID:Ye,fullUserHash:(0,StatsigUser_1._getFullUserHash)(tt)}}DataAdapterCore$1._makeDataAdapterResult=_makeDataAdapterResult;class InMemoryCache{constructor(){this._data={}}get(Le,Ye){var tt;const nt=this._data[Le],ft=nt==null?void 0:nt.stableID,ht=(tt=Ye==null?void 0:Ye.customIDs)===null||tt===void 0?void 0:tt.stableID;return ht&&ft&&ht!==ft?(Log_1$4.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):nt}add(Le,Ye,tt){const nt=_getEvictableKeys(this._data,tt-1);for(const ft of nt)delete this._data[ft];this._data[Le]=Ye}merge(Le){this._data=Object.assign(Object.assign({},this._data),Le)}}function _getEvictableKeys(Be,Le){const Ye=Object.keys(Be);return Ye.length<=Le?[]:Le===0?Ye:Ye.sort((tt,nt)=>{const ft=Be[tt],ht=Be[nt];return typeof ft=="object"&&typeof ht=="object"?ft.receivedAt-ht.receivedAt:ft-ht}).slice(0,Ye.length-Le)}var DownloadConfigSpecsResponse={};Object.defineProperty(DownloadConfigSpecsResponse,"__esModule",{value:!0});var ErrorBoundary={},SDKType={};Object.defineProperty(SDKType,"__esModule",{value:!0}),SDKType.SDKType=void 0;const SDK_CLIENT={};let suffix;SDKType.SDKType={_get:Be=>{var Le;return((Le=SDK_CLIENT[Be])!==null&&Le!==void 0?Le:"js-mono")+(suffix??"")},_setClientType(Be,Le){SDK_CLIENT[Be]=Le},_setBindingType(Be){(!suffix||suffix==="-react")&&(suffix="-"+Be)}},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__awaiter||function(yt,Ct,kt,vt){function bt(It){return It instanceof kt?It:new kt(function(wt){wt(It)})}return new(kt||(kt=Promise))(function(It,wt){function Rt(Dt){try{Bt(vt.next(Dt))}catch(Pt){wt(Pt)}}function Tt(Dt){try{Bt(vt.throw(Dt))}catch(Pt){wt(Pt)}}function Bt(Dt){Dt.done?It(Dt.value):bt(Dt.value).then(Rt,Tt)}Bt((vt=vt.apply(yt,Ct||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.ErrorBoundary=Be.EXCEPTION_ENDPOINT=void 0;const Ye=Log,tt=SDKType,nt=StatsigMetadata;Be.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const ft="[Statsig] UnknownError";class ht{constructor(Ct,kt,vt,bt){this._sdkKey=Ct,this._options=kt,this._emitter=vt,this._lastSeenError=bt,this._seen=new Set}wrap(Ct,kt){try{const vt=Ct;xt(vt).forEach(bt=>{const It=vt[bt];"$EB"in It||(vt[bt]=(...wt)=>this._capture(kt?`${kt}:${bt}`:bt,()=>It.apply(Ct,wt)),vt[bt].$EB=!0)})}catch(vt){this._onError("eb:wrap",vt)}}logError(Ct,kt){this._onError(Ct,kt)}getLastSeenErrorAndReset(){const Ct=this._lastSeenError;return this._lastSeenError=void 0,Ct??null}attachErrorIfNoneExists(Ct){this._lastSeenError||(this._lastSeenError=gt(Ct))}_capture(Ct,kt){try{const vt=kt();return vt&&vt instanceof Promise?vt.catch(bt=>this._onError(Ct,bt)):vt}catch(vt){return this._onError(Ct,vt),null}}_onError(Ct,kt){try{Ye.Log.warn(`Caught error in ${Ct}`,{error:kt}),Le(this,void 0,void 0,function*(){var bt,It,wt,Rt,Tt,Bt,Dt;const Pt=kt||Error(ft),Nt=Pt instanceof Error,Lt=Nt?Pt.name:"No Name",Wt=gt(Pt);if(this._lastSeenError=Wt,this._seen.has(Lt))return;if(this._seen.add(Lt),!((It=(bt=this._options)===null||bt===void 0?void 0:bt.networkConfig)===null||It===void 0)&&It.preventAllNetworkTraffic){(wt=this._emitter)===null||wt===void 0||wt.call(this,{name:"error",error:kt,tag:Ct});return}const $t=tt.SDKType._get(this._sdkKey),Kt=nt.StatsigMetadataProvider.get(),Vt=Nt?Pt.stack:At(Pt),Ut=Object.assign({tag:Ct,exception:Lt,info:Vt,statsigOptions:Et(this._options)},Object.assign(Object.assign({},Kt),{sdkType:$t}));yield((Bt=(Tt=(Rt=this._options)===null||Rt===void 0?void 0:Rt.networkConfig)===null||Tt===void 0?void 0:Tt.networkOverrideFunc)!==null&&Bt!==void 0?Bt:fetch)(Be.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String($t),"STATSIG-SDK-VERSION":String(Kt.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(Ut)}),(Dt=this._emitter)===null||Dt===void 0||Dt.call(this,{name:"error",error:kt,tag:Ct})}).then(()=>{}).catch(()=>{})}catch{}}}Be.ErrorBoundary=ht;function gt(yt){return yt instanceof Error?yt:typeof yt=="string"?new Error(yt):new Error("An unknown error occurred.")}function At(yt){try{return JSON.stringify(yt)}catch{return ft}}function xt(yt){const Ct=new Set;let kt=Object.getPrototypeOf(yt);for(;kt&&kt!==Object.prototype;)Object.getOwnPropertyNames(kt).filter(vt=>typeof(kt==null?void 0:kt[vt])=="function").forEach(vt=>Ct.add(vt)),kt=Object.getPrototypeOf(kt);return Array.from(Ct)}function Et(yt){if(!yt)return{};const Ct={};return Object.keys(yt).forEach(kt=>{const vt=kt,bt=yt[vt];switch(typeof bt){case"number":case"bigint":case"boolean":Ct[String(vt)]=bt;break;case"string":bt.length<50?Ct[String(vt)]=bt:Ct[String(vt)]="set";break;case"object":vt==="environment"?Ct.environment=bt:vt==="networkConfig"?Ct.networkConfig=bt:Ct[String(vt)]=bt!=null?"set":"unset";break}}),Ct}}(ErrorBoundary);var EvaluationOptions={};Object.defineProperty(EvaluationOptions,"__esModule",{value:!0});var EvaluationTypes={};Object.defineProperty(EvaluationTypes,"__esModule",{value:!0});var InitializeResponse={};Object.defineProperty(InitializeResponse,"__esModule",{value:!0});var MemoKey={};Object.defineProperty(MemoKey,"__esModule",{value:!0}),MemoKey.createMemoKey=MemoKey.MemoPrefix=void 0,MemoKey.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const EXIST_KEYS=new Set([]),DO_NOT_MEMO_KEYS=new Set(["userPersistedValues"]);function createMemoKey(Be,Le,Ye){let tt=`${Be}|${Le}`;if(!Ye)return tt;for(const nt of Object.keys(Ye)){if(DO_NOT_MEMO_KEYS.has(nt))return;EXIST_KEYS.has(nt)?tt+=`|${nt}=true`:tt+=`|${nt}=${Ye[nt]}`}return tt}MemoKey.createMemoKey=createMemoKey;var NetworkCore$1={},NetworkFallbackResolver$1={},DnsTxtQuery={},__awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DnsTxtQuery,"__esModule",{value:!0}),DnsTxtQuery._fetchTxtRecords=void 0;const FEATURE_ASSETS_DNS_QUERY=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),DNS_QUERY_ENDPOINT="https://cloudflare-dns.com/dns-query",DOMAIN_CHARS=["i","e","d"],MAX_START_LOOKUP=200;function _fetchTxtRecords(Be){return __awaiter$d(this,void 0,void 0,function*(){const Le=yield Be(DNS_QUERY_ENDPOINT,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:FEATURE_ASSETS_DNS_QUERY});if(!Le.ok){const nt=new Error("Failed to fetch TXT records from DNS");throw nt.name="DnsTxtFetchError",nt}const Ye=yield Le.arrayBuffer(),tt=new Uint8Array(Ye);return _parseDnsResponse(tt)})}DnsTxtQuery._fetchTxtRecords=_fetchTxtRecords;function _parseDnsResponse(Be){const Le=Be.findIndex((tt,nt)=>nt<MAX_START_LOOKUP&&String.fromCharCode(tt)==="="&&DOMAIN_CHARS.includes(String.fromCharCode(Be[nt-1])));if(Le===-1){const tt=new Error("Failed to parse TXT records from DNS");throw tt.name="DnsTxtParseError",tt}let Ye="";for(let tt=Le-1;tt<Be.length;tt++)Ye+=String.fromCharCode(Be[tt]);return Ye.split(",")}var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkFallbackResolver$1,"__esModule",{value:!0}),NetworkFallbackResolver$1._isDomainFailure=NetworkFallbackResolver$1.NetworkFallbackResolver=void 0;const DnsTxtQuery_1=DnsTxtQuery,Hashing_1=Hashing,Log_1$3=Log,StorageProvider_1$1=StorageProvider,DEFAULT_TTL_MS=7*24*60*60*1e3,COOLDOWN_TIME_MS=4*60*60*1e3;class NetworkFallbackResolver{constructor(Le){var Ye;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(Ye=Le.networkConfig)===null||Ye===void 0?void 0:Ye.networkOverrideFunc}setErrorBoundary(Le){this._errorBoundary=Le}tryBumpExpiryTime(Le,Ye){var tt;const nt=(tt=this._fallbackInfo)===null||tt===void 0?void 0:tt[Ye.endpoint];nt&&(nt.expiryTime=Date.now()+DEFAULT_TTL_MS,_tryWriteFallbackInfoToCache(Le,Object.assign(Object.assign({},this._fallbackInfo),{[Ye.endpoint]:nt})))}getActiveFallbackUrl(Le,Ye){var tt,nt;if(Ye.customUrl!=null&&Ye.fallbackUrls!=null)return null;let ft=this._fallbackInfo;ft==null&&(ft=(tt=_readFallbackInfoFromCache(Le))!==null&&tt!==void 0?tt:{},this._fallbackInfo=ft);const ht=ft[Ye.endpoint];return!ht||Date.now()>((nt=ht.expiryTime)!==null&&nt!==void 0?nt:0)||Ye.getChecksum()!==ht.urlConfigChecksum?(delete ft[Ye.endpoint],this._fallbackInfo=ft,_tryWriteFallbackInfoToCache(Le,this._fallbackInfo),null):ht.url?ht.url:null}tryFetchUpdatedFallbackInfo(Le,Ye,tt,nt){return __awaiter$c(this,void 0,void 0,function*(){var ft,ht;try{if(!_isDomainFailure(tt,nt))return!1;const At=Ye.customUrl==null&&Ye.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(Ye):Ye.fallbackUrls,xt=this._pickNewFallbackUrl((ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[Ye.endpoint],At);return xt?(this._updateFallbackInfoWithNewUrl(Le,Ye,xt),!0):!1}catch(gt){return(ht=this._errorBoundary)===null||ht===void 0||ht.logError("tryFetchUpdatedFallbackInfo",gt),!1}})}_updateFallbackInfoWithNewUrl(Le,Ye,tt){var nt,ft,ht;const gt={urlConfigChecksum:Ye.getChecksum(),url:tt,expiryTime:Date.now()+DEFAULT_TTL_MS,previous:[]},At=Ye.endpoint,xt=(nt=this._fallbackInfo)===null||nt===void 0?void 0:nt[At];xt&&gt.previous.push(...xt.previous),gt.previous.length>10&&(gt.previous=[]);const Et=(ht=(ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[At])===null||ht===void 0?void 0:ht.url;Et!=null&&gt.previous.push(Et),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[At]:gt}),_tryWriteFallbackInfoToCache(Le,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(Le){return __awaiter$c(this,void 0,void 0,function*(){var Ye;const tt=this._dnsQueryCooldowns[Le.endpoint];if(tt&&Date.now()<tt)return null;this._dnsQueryCooldowns[Le.endpoint]=Date.now()+COOLDOWN_TIME_MS;const nt=[],ft=yield(0,DnsTxtQuery_1._fetchTxtRecords)((Ye=this._networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch),ht=_extractPathFromUrl(Le.defaultUrl);for(const gt of ft){if(!gt.startsWith(Le.endpointDnsKey+"="))continue;const At=gt.split("=");if(At.length>1){let xt=At[1];xt.endsWith("/")&&(xt=xt.slice(0,-1)),nt.push(`https://${xt}${ht}`)}}return nt})}_pickNewFallbackUrl(Le,Ye){var tt;if(Ye==null)return null;const nt=new Set((tt=Le==null?void 0:Le.previous)!==null&&tt!==void 0?tt:[]),ft=Le==null?void 0:Le.url;let ht=null;for(const gt of Ye){const At=gt.endsWith("/")?gt.slice(0,-1):gt;if(!nt.has(gt)&&At!==ft){ht=At;break}}return ht}}NetworkFallbackResolver$1.NetworkFallbackResolver=NetworkFallbackResolver;function _isDomainFailure(Be,Le){var Ye;const tt=(Ye=Be==null?void 0:Be.toLowerCase())!==null&&Ye!==void 0?Ye:"";return Le||tt.includes("uncaught exception")||tt.includes("failed to fetch")||tt.includes("networkerror when attempting to fetch resource")}NetworkFallbackResolver$1._isDomainFailure=_isDomainFailure;function _getFallbackInfoStorageKey(Be){return`statsig.network_fallback.${(0,Hashing_1._DJB2)(Be)}`}function _tryWriteFallbackInfoToCache(Be,Le){const Ye=_getFallbackInfoStorageKey(Be);if(!Le||Object.keys(Le).length===0){StorageProvider_1$1.Storage.removeItem(Ye);return}StorageProvider_1$1.Storage.setItem(Ye,JSON.stringify(Le))}function _readFallbackInfoFromCache(Be){const Le=_getFallbackInfoStorageKey(Be),Ye=StorageProvider_1$1.Storage.getItem(Le);if(!Ye)return null;try{return JSON.parse(Ye)}catch{return Log_1$3.Log.error("Failed to parse FallbackInfo"),null}}function _extractPathFromUrl(Be){try{return new URL(Be).pathname}catch{return null}}var SDKFlags={};Object.defineProperty(SDKFlags,"__esModule",{value:!0}),SDKFlags.SDKFlags=void 0;const FLAGMAP={};SDKFlags.SDKFlags={setFlags:(Be,Le)=>{FLAGMAP[Be]=Le},get:(Be,Le)=>{var Ye,tt;return(tt=(Ye=FLAGMAP[Be])===null||Ye===void 0?void 0:Ye[Le])!==null&&tt!==void 0?tt:!1}};var SessionID={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigSession=Be.SessionID=void 0;const Le=$_StatsigGlobal,Ye=CacheKey,tt=Log,nt=StorageProvider,ft=UUID,ht=30*60*1e3,gt=4*60*60*1e3,At={};Be.SessionID={get:Rt=>Be.StatsigSession.get(Rt).data.sessionID},Be.StatsigSession={get:Rt=>{At[Rt]==null&&(At[Rt]=xt(Rt));const Tt=At[Rt];return yt(Tt)},overrideInitialSessionID:(Rt,Tt)=>{At[Tt]=Et(Rt,Tt)}};function xt(Rt){let Tt=wt(Rt);const Bt=Date.now();return Tt||(Tt={sessionID:(0,ft.getUUID)(),startTime:Bt,lastUpdate:Bt}),{data:Tt,sdkKey:Rt}}function Et(Rt,Tt){const Bt=Date.now();return{data:{sessionID:Rt,startTime:Bt,lastUpdate:Bt},sdkKey:Tt}}function yt(Rt){const Tt=Date.now(),Bt=Rt.data,Dt=Rt.sdkKey;if(kt(Bt)||vt(Bt)){Bt.sessionID=(0,ft.getUUID)(),Bt.startTime=Tt;const Nt=__STATSIG__==null?void 0:__STATSIG__.instance(Dt);Nt&&Nt.$emt({name:"session_expired"})}Bt.lastUpdate=Tt,It(Bt,Rt.sdkKey),clearTimeout(Rt.idleTimeoutID),clearTimeout(Rt.ageTimeoutID);const Pt=Tt-Bt.startTime;return Rt.idleTimeoutID=Ct(Dt,ht),Rt.ageTimeoutID=Ct(Dt,gt-Pt),Rt}function Ct(Rt,Tt){return setTimeout(()=>{var Bt;const Dt=(Bt=(0,Le._getStatsigGlobal)())===null||Bt===void 0?void 0:Bt.instance(Rt);Dt&&Dt.$emt({name:"session_expired"})},Tt)}function kt({lastUpdate:Rt}){return Date.now()-Rt>ht}function vt({startTime:Rt}){return Date.now()-Rt>gt}function bt(Rt){return`statsig.session_id.${(0,Ye._getStorageKey)(Rt)}`}function It(Rt,Tt){const Bt=bt(Tt);try{(0,nt._setObjectInStorage)(Bt,Rt)}catch{tt.Log.warn("Failed to save SessionID")}}function wt(Rt){const Tt=bt(Rt);return(0,nt._getObjectFromStorage)(Tt)}})(SessionID);var StatsigClientEventEmitter={};Object.defineProperty(StatsigClientEventEmitter,"__esModule",{value:!0}),StatsigClientEventEmitter.ErrorTag=void 0,StatsigClientEventEmitter.ErrorTag={NetworkError:"NetworkError"};var __awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkCore$1,"__esModule",{value:!0}),NetworkCore$1.NetworkCore=void 0;const __StatsigGlobal_1$1=$_StatsigGlobal,Diagnostics_1=Diagnostics,Log_1$2=Log,NetworkConfig_1=NetworkConfig,NetworkFallbackResolver_1=NetworkFallbackResolver$1,SDKFlags_1=SDKFlags,SDKType_1=SDKType,SafeJs_1$1=SafeJs,SessionID_1$1=SessionID,StableID_1$1=StableID,StatsigClientEventEmitter_1=StatsigClientEventEmitter,StatsigMetadata_1=StatsigMetadata,StatsigOptionsCommon_1$1=StatsigOptionsCommon,VisibilityObserving_1=VisibilityObserving,DEFAULT_TIMEOUT_MS=1e4,BACKOFF_BASE_MS=500,BACKOFF_MAX_MS=3e4,RATE_LIMIT_WINDOW_MS=1e3,RATE_LIMIT_MAX_REQ_COUNT=50,LEAK_RATE=RATE_LIMIT_MAX_REQ_COUNT/RATE_LIMIT_WINDOW_MS,RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class NetworkCore{constructor(Le,Ye){this._emitter=Ye,this._errorBoundary=null,this._timeout=DEFAULT_TIMEOUT_MS,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,Le&&(this._options=Le),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new NetworkFallbackResolver_1.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(Le))}setLogEventCompressionMode(Le){this._options.logEventCompressionMode=Le}setErrorBoundary(Le){this._errorBoundary=Le,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(Le)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const Le=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,Le}beacon(Le){if(!_ensureValidSdkKey(Le))return!1;const Ye=this._getInternalRequestArgs("POST",Le),tt=this._getPopulatedURL(Ye),nt=navigator;return nt.sendBeacon.bind(nt)(tt,Ye.body)}post(Le){return __awaiter$b(this,void 0,void 0,function*(){const Ye=this._getInternalRequestArgs("POST",Le);return this._tryEncodeBody(Ye),yield this._tryToCompressBody(Ye),this._sendRequest(Ye)})}get(Le){const Ye=this._getInternalRequestArgs("GET",Le);return this._sendRequest(Ye)}_sendRequest(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye,tt,nt,ft;if(!_ensureValidSdkKey(Le)||this._netConfig.preventAllNetworkTraffic)return null;const{method:ht,body:gt,retries:At,attempt:xt}=Le,Et=Le.urlConfig.endpoint;if(this._isRateLimited(Et))return Log_1$2.Log.warn(`Request to ${Et} was blocked because you are making requests too frequently.`),null;const yt=xt??1;let Ct=!1;const kt=this._getPopulatedURL(Le);let vt=null;const bt=(0,VisibilityObserving_1._isUnloading)();try{const It={method:ht,body:gt,headers:Object.assign({},Le.headers),priority:Le.priority,keepalive:bt};_tryMarkInitStart(Le,yt);const wt=this._leakyBucket[Et];wt&&(wt.lastRequestTime=Date.now(),this._leakyBucket[Et]=wt);const Rt=(Ye=this._netConfig.networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch;let Tt;if(vt=yield Promise.race([Rt(kt,It).finally(()=>clearTimeout(Tt)),new Promise((Dt,Pt)=>{Tt=setTimeout(()=>{Ct=!0,Pt(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!vt.ok){const Dt=yield vt.text().catch(()=>"No Text"),Pt=new Error(`NetworkError: ${kt} ${Dt}`);throw Pt.name="NetworkError",Pt}const Bt=yield vt.text();return _tryMarkInitEnd(Le,vt,yt,Bt),this._fallbackResolver.tryBumpExpiryTime(Le.sdkKey,Le.urlConfig),{body:Bt,code:vt.status}}catch(It){const wt=_getErrorMessage(It),Rt=_didTimeout(wt??"",Ct);if(_tryMarkInitEnd(Le,vt,yt,"",It),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(Le.sdkKey,Le.urlConfig,wt,Rt))&&(Le.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(Le.sdkKey,Le.urlConfig)),!At||yt>At||!RETRYABLE_CODES.has((tt=vt==null?void 0:vt.status)!==null&&tt!==void 0?tt:500)){(nt=this._emitter)===null||nt===void 0||nt.call(this,{name:"error",error:It,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:Le});const Bt=`A networking error occurred during ${ht} request to ${kt}.`;return Log_1$2.Log.error(Bt,wt,It),(ft=this._errorBoundary)===null||ft===void 0||ft.attachErrorIfNoneExists(Bt),null}return yield _exponentialBackoff(yt),this._sendRequest(Object.assign(Object.assign({},Le),{retries:At,attempt:yt+1}))}})}_getLogEventCompressionMode(Le){let Ye=Le==null?void 0:Le.logEventCompressionMode;return!Ye&&(Le==null?void 0:Le.disableCompression)===!0&&(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled),Ye||(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled),Ye}_isRateLimited(Le){var Ye;const tt=Date.now(),nt=(Ye=this._leakyBucket[Le])!==null&&Ye!==void 0?Ye:{count:0,lastRequestTime:tt},ft=tt-nt.lastRequestTime,ht=Math.floor(ft*LEAK_RATE);return nt.count=Math.max(0,nt.count-ht),nt.count>=RATE_LIMIT_MAX_REQ_COUNT?!0:(nt.count+=1,nt.lastRequestTime=tt,this._leakyBucket[Le]=nt,!1)}_getPopulatedURL(Le){var Ye;const tt=(Ye=Le.fallbackUrl)!==null&&Ye!==void 0?Ye:Le.urlConfig.getUrl();(Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize||Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=tt);const nt=Object.assign({[NetworkConfig_1.NetworkParam.SdkKey]:Le.sdkKey,[NetworkConfig_1.NetworkParam.SdkType]:SDKType_1.SDKType._get(Le.sdkKey),[NetworkConfig_1.NetworkParam.SdkVersion]:StatsigMetadata_1.SDK_VERSION,[NetworkConfig_1.NetworkParam.Time]:String(Date.now()),[NetworkConfig_1.NetworkParam.SessionID]:SessionID_1$1.SessionID.get(Le.sdkKey)},Le.params),ft=Object.keys(nt).map(ht=>`${encodeURIComponent(ht)}=${encodeURIComponent(nt[ht])}`).join("&");return`${tt}${ft?`?${ft}`:""}`}_tryEncodeBody(Le){var Ye;const tt=(0,SafeJs_1$1._getWindowSafe)(),nt=Le.body;if(!(!Le.isStatsigEncodable||this._options.disableStatsigEncoding||typeof nt!="string"||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-encode")!=null||!(tt!=null&&tt.btoa)))try{Le.body=tt.btoa(nt).split("").reverse().join(""),Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.StatsigEncoded]:"1"})}catch(ft){Log_1$2.Log.warn(`Request encoding failed for ${Le.urlConfig.getUrl()}`,ft)}}_tryToCompressBody(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye;const tt=Le.body;if(!(typeof tt!="string"||!_allowCompression(Le,this._options)))try{const nt=new TextEncoder().encode(tt),ft=new CompressionStream("gzip"),ht=ft.writable.getWriter();ht.write(nt).catch(Log_1$2.Log.error),ht.close().catch(Log_1$2.Log.error);const gt=ft.readable.getReader(),At=[];let xt;for(;!(xt=yield gt.read()).done;)At.push(xt.value);const Et=At.reduce((kt,vt)=>kt+vt.length,0),yt=new Uint8Array(Et);let Ct=0;for(const kt of At)yt.set(kt,Ct),Ct+=kt.length;Le.body=yt,Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.IsGzipped]:"1"})}catch(nt){Log_1$2.Log.warn(`Request compression failed for ${Le.urlConfig.getUrl()}`,nt)}})}_getInternalRequestArgs(Le,Ye){const tt=this._fallbackResolver.getActiveFallbackUrl(Ye.sdkKey,Ye.urlConfig),nt=Object.assign(Object.assign({},Ye),{method:Le,fallbackUrl:tt});return"data"in Ye&&_populateRequestBody(nt,Ye.data),nt}}NetworkCore$1.NetworkCore=NetworkCore;const _ensureValidSdkKey=Be=>Be.sdkKey?!0:(Log_1$2.Log.warn("Unable to make request without an SDK key"),!1),_populateRequestBody=(Be,Le)=>{const{sdkKey:Ye,fallbackUrl:tt}=Be,nt=StableID_1$1.StableID.get(Ye),ft=SessionID_1$1.SessionID.get(Ye),ht=SDKType_1.SDKType._get(Ye);Be.body=JSON.stringify(Object.assign(Object.assign({},Le),{statsigMetadata:Object.assign(Object.assign({},StatsigMetadata_1.StatsigMetadataProvider.get()),{stableID:nt,sessionID:ft,sdkType:ht,fallbackUrl:tt})}))};function _allowCompression(Be,Le){if(!Be.isCompressable||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const Ye=Be.urlConfig.customUrl!=null||Be.urlConfig.fallbackUrls!=null,tt=SDKFlags_1.SDKFlags.get(Be.sdkKey,"enable_log_event_compression")===!0;switch(Le.logEventCompressionMode){case StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled:return!1;case StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled:return!(Ye&&!tt);case StatsigOptionsCommon_1$1.LogEventCompressionMode.Forced:return!0;default:return!1}}function _getErrorMessage(Be){return typeof Be=="string"?Be:Be instanceof Error?`${Be.name}: ${Be.message}`:"Unknown Error"}function _didTimeout(Be,Le){return Be.includes("Timeout")||Le}function _tryMarkInitStart(Be,Le){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqStart(Be.sdkKey,{attempt:Le})}function _tryMarkInitEnd(Be,Le,Ye,tt,nt){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(Be.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(Le,Ye,tt,nt))}function _exponentialBackoff(Be){return __awaiter$b(this,void 0,void 0,function*(){yield new Promise(Le=>setTimeout(Le,Math.min(BACKOFF_BASE_MS*(Be*Be),BACKOFF_MAX_MS)))})}var OverrideAdapter={};Object.defineProperty(OverrideAdapter,"__esModule",{value:!0});var ParamStoreTypes={};Object.defineProperty(ParamStoreTypes,"__esModule",{value:!0});var SizeOf={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._fastApproxSizeOf=void 0;const Le=2,Ye=1,tt=(nt,ft)=>{let ht=0;const gt=Object.keys(nt);for(let At=0;At<gt.length;At++){const xt=gt[At],Et=nt[xt];if(ht+=xt.length,typeof Et=="object"&&Et!==null?ht+=(0,Be._fastApproxSizeOf)(Et,ft)+Le:ht+=String(Et).length+Ye,ht>=ft)return ht}return ht};Be._fastApproxSizeOf=tt})(SizeOf);var StatsigClientBase$1={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigClientBase$1,"__esModule",{value:!0}),StatsigClientBase$1.StatsigClientBase=void 0;const __StatsigGlobal_1=$_StatsigGlobal,ErrorBoundary_1=ErrorBoundary,EventLogger_1=EventLogger$1,Log_1$1=Log,MemoKey_1=MemoKey,SafeJs_1=SafeJs,SessionID_1=SessionID,StableID_1=StableID,StatsigOptionsCommon_1=StatsigOptionsCommon,StorageProvider_1=StorageProvider,MAX_MEMO_CACHE_SIZE=3e3;class StatsigClientBase{constructor(Le,Ye,tt,nt){var ft,ht,gt,At;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const xt=this.$emt.bind(this);(nt==null?void 0:nt.logLevel)!=null&&(Log_1$1.Log.level=nt.logLevel),nt!=null&&nt.disableStorage&&StorageProvider_1.Storage._setDisabled(!0),nt!=null&&nt.initialSessionID&&SessionID_1.StatsigSession.overrideInitialSessionID(nt.initialSessionID,Le),nt!=null&&nt.storageProvider&&StorageProvider_1.Storage._setProvider(nt.storageProvider),nt!=null&&nt.enableCookies&&StableID_1.StableID._setCookiesEnabled(Le,nt.enableCookies),nt!=null&&nt.disableStableID&&StableID_1.StableID._setDisabled(Le,!0),this._sdkKey=Le,this._options=nt??{},this._memoCache={},this.overrideAdapter=(ft=nt==null?void 0:nt.overrideAdapter)!==null&&ft!==void 0?ft:null,this._logger=new EventLogger_1.EventLogger(Le,xt,tt,nt),this._errorBoundary=new ErrorBoundary_1.ErrorBoundary(Le,nt,xt),this._errorBoundary.wrap(this),this._errorBoundary.wrap(Ye),this._errorBoundary.wrap(this._logger),tt.setErrorBoundary(this._errorBoundary),this.dataAdapter=Ye,this.dataAdapter.attach(Le,nt,tt),this.storageProvider=StorageProvider_1.Storage,(At=(gt=(ht=this.overrideAdapter)===null||ht===void 0?void 0:ht.loadFromStorage)===null||gt===void 0?void 0:gt.call(ht))===null||At===void 0||At.catch(Et=>this._errorBoundary.logError("OA::loadFromStorage",Et)),this._primeReadyRipcord(),_assignGlobalInstance(Le,this)}updateRuntimeOptions(Le){Le.loggingEnabled?(this._options.loggingEnabled=Le.loggingEnabled,this._logger.setLoggingEnabled(Le.loggingEnabled)):Le.disableLogging!=null&&(this._options.disableLogging=Le.disableLogging,this._logger.setLoggingEnabled(Le.disableLogging?"disabled":"browser-only")),Le.disableStorage!=null&&(this._options.disableStorage=Le.disableStorage,StorageProvider_1.Storage._setDisabled(Le.disableStorage)),Le.enableCookies!=null&&(this._options.enableCookies=Le.enableCookies,StableID_1.StableID._setCookiesEnabled(this._sdkKey,Le.enableCookies)),Le.logEventCompressionMode?this._logger.setLogEventCompressionMode(Le.logEventCompressionMode):Le.disableCompression&&this._logger.setLogEventCompressionMode(StatsigOptionsCommon_1.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return __awaiter$a(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(Le,Ye){this._listeners[Le]||(this._listeners[Le]=[]),this._listeners[Le].push(Ye)}off(Le,Ye){if(this._listeners[Le]){const tt=this._listeners[Le].indexOf(Ye);tt!==-1&&this._listeners[Le].splice(tt,1)}}$on(Le,Ye){Ye.__isInternal=!0,this.on(Le,Ye)}$emt(Le){var Ye;const tt=nt=>{try{nt(Le)}catch(ft){if(nt.__isInternal===!0){this._errorBoundary.logError(`__emit:${Le.name}`,ft);return}Log_1$1.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",Le)}};this._listeners[Le.name]&&this._listeners[Le.name].forEach(nt=>tt(nt)),(Ye=this._listeners["*"])===null||Ye===void 0||Ye.forEach(tt)}_setStatus(Le,Ye){this.loadingStatus=Le,this._memoCache={},this.$emt({name:"values_updated",status:Le,values:Ye})}_enqueueExposure(Le,Ye,tt){if((tt==null?void 0:tt.disableExposureLog)===!0){this._logger.incrementNonExposureCount(Le);return}this._logger.enqueue(Ye)}_memoize(Le,Ye){return(tt,nt)=>{if(this._options.disableEvaluationMemoization)return Ye(tt,nt);const ft=(0,MemoKey_1.createMemoKey)(Le,tt,nt);return ft?(ft in this._memoCache||(Object.keys(this._memoCache).length>=MAX_MEMO_CACHE_SIZE&&(this._memoCache={}),this._memoCache[ft]=Ye(tt,nt)),this._memoCache[ft]):Ye(tt,nt)}}}StatsigClientBase$1.StatsigClientBase=StatsigClientBase;function _assignGlobalInstance(Be,Le){var Ye;if((0,SafeJs_1._isServerEnv)())return;const tt=(0,__StatsigGlobal_1._getStatsigGlobal)(),nt=(Ye=tt.instances)!==null&&Ye!==void 0?Ye:{},ft=Le;nt[Be]!=null&&Log_1$1.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),nt[Be]=ft,tt.firstInstance||(tt.firstInstance=ft),tt.instances=nt,__STATSIG__=tt}var StatsigDataAdapter={};Object.defineProperty(StatsigDataAdapter,"__esModule",{value:!0}),StatsigDataAdapter.DataAdapterCachePrefix=void 0,StatsigDataAdapter.DataAdapterCachePrefix="statsig.cached";var StatsigPlugin={};Object.defineProperty(StatsigPlugin,"__esModule",{value:!0});var StatsigTypeFactories={};Object.defineProperty(StatsigTypeFactories,"__esModule",{value:!0}),StatsigTypeFactories._makeTypedGet=StatsigTypeFactories._mergeOverride=StatsigTypeFactories._makeLayer=StatsigTypeFactories._makeExperiment=StatsigTypeFactories._makeDynamicConfig=StatsigTypeFactories._makeFeatureGate=void 0;const Log_1=Log,TypingUtils_1=TypingUtils;function _makeEvaluation(Be,Le,Ye,tt){var nt;return{name:Be,details:Le,ruleID:(nt=Ye==null?void 0:Ye.rule_id)!==null&&nt!==void 0?nt:"",__evaluation:Ye,value:tt}}function _makeFeatureGate(Be,Le,Ye){var tt;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,(Ye==null?void 0:Ye.value)===!0)),{idType:(tt=Ye==null?void 0:Ye.id_type)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeFeatureGate=_makeFeatureGate;function _makeDynamicConfig(Be,Le,Ye){var tt,nt;const ft=(tt=Ye==null?void 0:Ye.value)!==null&&tt!==void 0?tt:{};return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,ft)),{idType:(nt=Ye==null?void 0:Ye.id_type)!==null&&nt!==void 0?nt:null,get:_makeTypedGet(Be,Ye==null?void 0:Ye.value)})}StatsigTypeFactories._makeDynamicConfig=_makeDynamicConfig;function _makeExperiment(Be,Le,Ye){var tt;const nt=_makeDynamicConfig(Be,Le,Ye);return Object.assign(Object.assign({},nt),{groupName:(tt=Ye==null?void 0:Ye.group_name)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeExperiment=_makeExperiment;function _makeLayer(Be,Le,Ye,tt){var nt,ft;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,void 0)),{get:_makeTypedGet(Be,Ye==null?void 0:Ye.value,tt),groupName:(nt=Ye==null?void 0:Ye.group_name)!==null&&nt!==void 0?nt:null,__value:(ft=Ye==null?void 0:Ye.value)!==null&&ft!==void 0?ft:{}})}StatsigTypeFactories._makeLayer=_makeLayer;function _mergeOverride(Be,Le,Ye,tt){return Object.assign(Object.assign(Object.assign({},Be),Le),{get:_makeTypedGet(Be.name,Ye,tt)})}StatsigTypeFactories._mergeOverride=_mergeOverride;function _makeTypedGet(Be,Le,Ye){return(tt,nt)=>{var ft;const ht=(ft=Le==null?void 0:Le[tt])!==null&&ft!==void 0?ft:null;return ht==null?nt??null:nt!=null&&!(0,TypingUtils_1._isTypeMatch)(ht,nt)?(Log_1.Log.warn(`Parameter type mismatch. '${Be}.${tt}' was found to be type '${typeof ht}' but fallback/return type is '${typeof nt}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),nt??null):(Ye==null||Ye(tt),ht)}}StatsigTypeFactories._makeTypedGet=_makeTypedGet;var StatsigTypes={};Object.defineProperty(StatsigTypes,"__esModule",{value:!0});var StatsigUpdateDetails={};Object.defineProperty(StatsigUpdateDetails,"__esModule",{value:!0}),StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES=StatsigUpdateDetails.createUpdateDetails=void 0;const createUpdateDetails=(Be,Le,Ye,tt,nt,ft)=>({duration:Ye,source:Le,success:Be,error:tt,sourceUrl:nt,warnings:ft});StatsigUpdateDetails.createUpdateDetails=createUpdateDetails,StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(xt,Et,yt,Ct){Ct===void 0&&(Ct=yt);var kt=Object.getOwnPropertyDescriptor(Et,yt);(!kt||("get"in kt?!Et.__esModule:kt.writable||kt.configurable))&&(kt={enumerable:!0,get:function(){return Et[yt]}}),Object.defineProperty(xt,Ct,kt)}:function(xt,Et,yt,Ct){Ct===void 0&&(Ct=yt),xt[Ct]=Et[yt]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(xt,Et){for(var yt in xt)yt!=="default"&&!Object.prototype.hasOwnProperty.call(Et,yt)&&Le(Et,xt,yt)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.Storage=Be.Log=Be.EventLogger=Be.Diagnostics=void 0;const tt=$_StatsigGlobal,nt=Diagnostics;Object.defineProperty(Be,"Diagnostics",{enumerable:!0,get:function(){return nt.Diagnostics}});const ft=EventLogger$1;Object.defineProperty(Be,"EventLogger",{enumerable:!0,get:function(){return ft.EventLogger}});const ht=Log;Object.defineProperty(Be,"Log",{enumerable:!0,get:function(){return ht.Log}});const gt=StatsigMetadata,At=StorageProvider;Object.defineProperty(Be,"Storage",{enumerable:!0,get:function(){return At.Storage}}),Ye($_StatsigGlobal,Be),Ye(CacheKey,Be),Ye(ClientInterfaces,Be),Ye(DataAdapterCore$1,Be),Ye(Diagnostics,Be),Ye(DownloadConfigSpecsResponse,Be),Ye(ErrorBoundary,Be),Ye(EvaluationOptions,Be),Ye(EvaluationTypes,Be),Ye(Hashing,Be),Ye(InitializeResponse,Be),Ye(Log,Be),Ye(MemoKey,Be),Ye(NetworkConfig,Be),Ye(NetworkCore$1,Be),Ye(OverrideAdapter,Be),Ye(ParamStoreTypes,Be),Ye(SafeJs,Be),Ye(SDKType,Be),Ye(SessionID,Be),Ye(SizeOf,Be),Ye(StableID,Be),Ye(StatsigClientBase$1,Be),Ye(StatsigClientEventEmitter,Be),Ye(StatsigDataAdapter,Be),Ye(StatsigEvent,Be),Ye(StatsigMetadata,Be),Ye(StatsigOptionsCommon,Be),Ye(StatsigPlugin,Be),Ye(StatsigTypeFactories,Be),Ye(StatsigTypes,Be),Ye(StatsigUser,Be),Ye(StorageProvider,Be),Ye(TypedJsonParse,Be),Ye(TypingUtils,Be),Ye(UrlConfiguration$1,Be),Ye(UUID,Be),Ye(VisibilityObserving,Be),Ye(StatsigUpdateDetails,Be),Ye(SDKFlags,Be),Object.assign((0,tt._getStatsigGlobal)(),{Log:ht.Log,SDK_VERSION:gt.SDK_VERSION})}(src$1);var StatsigClient$1={},EvaluationStore$1={},V1InitializeContainer$1={};Object.defineProperty(V1InitializeContainer$1,"__esModule",{value:!0}),V1InitializeContainer$1.V1InitializeContainer=void 0;const client_core_1$7=src$1;class V1InitializeContainer{constructor(Le){this._values=Le}getGate(Le){return this._getResultFromLookup(this._values.feature_gates,Le)}getConfig(Le){return this._getResultFromLookup(this._values.dynamic_configs,Le)}getLayer(Le){return this._getResultFromLookup(this._values.layer_configs,Le)}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$7._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V1InitializeContainer$1.V1InitializeContainer=V1InitializeContainer;var V2InitializeContainer$1={};Object.defineProperty(V2InitializeContainer$1,"__esModule",{value:!0}),V2InitializeContainer$1.V2InitializeContainer=void 0;const client_core_1$6=src$1;class V2InitializeContainer{constructor(Le){this._values=Le}getGate(Le){var Ye,tt,nt;const ft=this._getResultFromLookup(this._values.feature_gates,Le);return ft?{name:Le,value:ft.v===!0,rule_id:(Ye=ft.r)!==null&&Ye!==void 0?Ye:"default",secondary_exposures:(tt=ft.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ft.i)!==null&&nt!==void 0?nt:""}:null}getConfig(Le){var Ye,tt,nt,ft;const ht=this._getResultFromLookup(this._values.dynamic_configs,Le);return ht?{name:Le,value:(Ye=this._values.values[ht.v])!==null&&Ye!==void 0?Ye:{},rule_id:ht.r,secondary_exposures:(tt=ht.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ht.i)!==null&&nt!==void 0?nt:"",is_user_in_experiment:ht.ue===!0,passed:ht.p===!0,group_name:(ft=ht.gn)!==null&&ft!==void 0?ft:void 0,is_experiment_active:ht.ea===!0,group:ht.r,is_device_based:ht.i==="stableID"}:null}getLayer(Le){var Ye,tt,nt,ft,ht,gt;const At=this._getResultFromLookup(this._values.layer_configs,Le);return At?{name:Le,value:(Ye=this._values.values[At.v])!==null&&Ye!==void 0?Ye:{},rule_id:At.r,secondary_exposures:(tt=At.s)!==null&&tt!==void 0?tt:[],is_user_in_experiment:At.ue===!0,group_name:(nt=At.gn)!==null&&nt!==void 0?nt:void 0,is_experiment_active:At.ea===!0,group:At.r,is_device_based:At.i==="stableID",allocated_experiment_name:(ft=At.ae)!==null&&ft!==void 0?ft:"",explicit_parameters:(ht=At.ep)!==null&&ht!==void 0?ht:[],undelegated_secondary_exposures:(gt=At.us)!==null&&gt!==void 0?gt:[],parameter_rule_ids:At.pr}:null}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$6._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V2InitializeContainer$1.V2InitializeContainer=V2InitializeContainer,Object.defineProperty(EvaluationStore$1,"__esModule",{value:!0});const client_core_1$5=src$1,V1InitializeContainer_1=V1InitializeContainer$1,V2InitializeContainer_1=V2InitializeContainer$1;class EvaluationStore{constructor(Le){this._sdkKey=Le,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,client_core_1$5._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(Le,Ye){var tt,nt;if(!Le)return!1;const ft=(0,client_core_1$5._typedJsonParse)(Le.data,"has_updates","EvaluationResponse");return ft==null?!1:(this._source=Le.source,(ft==null?void 0:ft.has_updates)!==!0||((tt=ft.time)!==null&&tt!==void 0?tt:0)<this._lcut||(this._rawValues=Le.data,this._lcut=ft.time,this._receivedAt=Le.receivedAt,ft.response_format==="init-v2"?this._values=new V2InitializeContainer_1.V2InitializeContainer(ft):this._values=new V1InitializeContainer_1.V1InitializeContainer(ft),this._bootstrapMetadata=this._extractBootstrapMetadata(Le.source,ft),Le.source&&ft.user&&this._setWarningState(Ye,ft),client_core_1$5.SDKFlags.setFlags(this._sdkKey,(nt=ft.sdk_flags)!==null&&nt!==void 0?nt:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(Le){const Ye=this._values?this._values.getGate(Le):null;return this._getDetailedStoreResult(Ye)}getConfig(Le){const Ye=this._values?this._values.getConfig(Le):null;return this._getDetailedStoreResult(Ye)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(Le){const Ye=this._values?this._values.getLayer(Le):null;return this._getDetailedStoreResult(Ye)}getParamStore(Le){const Ye=this._values?this._values.getParamStore(Le):null;return this._getDetailedStoreResult(Ye)}getSource(){return this._source}getExposureMapping(){var Le;return(Le=this._values)===null||Le===void 0?void 0:Le.getExposureMapping()}_extractBootstrapMetadata(Le,Ye){if(Le!=="Bootstrap")return null;const tt={};return Ye.user&&(tt.user=Ye.user),Ye.sdkInfo&&(tt.generatorSDKInfo=Ye.sdkInfo),tt.lcut=Ye.time,tt}_getDetailedStoreResult(Le){return{result:Le,details:this._getDetails(Le==null)}}_setWarningState(Le,Ye){var tt,nt;const ft=client_core_1$5.StableID.get(this._sdkKey);if(((tt=Le.customIDs)===null||tt===void 0?void 0:tt.stableID)!==ft&&(!((nt=Le.customIDs)===null||nt===void 0)&&nt.stableID||ft)){this._warnings.add("StableIDMismatch");return}if("user"in Ye){const ht=Ye.user,gt=Object.assign(Object.assign({},Le),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,client_core_1$5._getFullUserHash)(gt)!==(0,client_core_1$5._getFullUserHash)(ht)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const Le={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(Le.warnings=Array.from(this._warnings)),Le}_getDetails(Le){var Ye,tt;const nt=this.getCurrentSourceDetails();let ft=nt.reason;const ht=(Ye=nt.warnings)!==null&&Ye!==void 0?Ye:[];this._source==="Bootstrap"&&ht.length>0&&(ft=ft+ht[0]),ft!=="Uninitialized"&&ft!=="NoValues"&&(ft=`${ft}:${Le?"Unrecognized":"Recognized"}`);const gt=this._source==="Bootstrap"&&(tt=this._bootstrapMetadata)!==null&&tt!==void 0?tt:void 0;return gt&&(nt.bootstrapMetadata=gt),Object.assign(Object.assign({},nt),{reason:ft})}}EvaluationStore$1.default=EvaluationStore;var Network={},EvaluationResponseDeltas={};Object.defineProperty(EvaluationResponseDeltas,"__esModule",{value:!0}),EvaluationResponseDeltas._resolveDeltasResponse=void 0;const client_core_1$4=src$1,MAX_DELTAS_SORT_DEPTH=2;function _resolveDeltasResponse(Be,Le){const Ye=(0,client_core_1$4._typedJsonParse)(Le,"checksum","DeltasEvaluationResponse");if(!Ye)return{hadBadDeltaChecksum:!0};const tt=_mergeDeltasIntoCache(Be,Ye),nt=_handleDeletedEntries(tt),ft=(0,client_core_1$4._DJB2Object)({feature_gates:nt.feature_gates,dynamic_configs:nt.dynamic_configs,layer_configs:nt.layer_configs},MAX_DELTAS_SORT_DEPTH);return ft===Ye.checksumV2?JSON.stringify(nt):{hadBadDeltaChecksum:!0,badChecksum:ft,badMergedConfigs:nt,badFullResponse:Ye.deltas_full_response}}EvaluationResponseDeltas._resolveDeltasResponse=_resolveDeltasResponse;function _mergeDeltasIntoCache(Be,Le){return Object.assign(Object.assign(Object.assign({},Be),Le),{feature_gates:Object.assign(Object.assign({},Be.feature_gates),Le.feature_gates),layer_configs:Object.assign(Object.assign({},Be.layer_configs),Le.layer_configs),dynamic_configs:Object.assign(Object.assign({},Be.dynamic_configs),Le.dynamic_configs)})}function _handleDeletedEntries(Be){const Le=Be;return _deleteEntriesInRecord(Be.deleted_gates,Le.feature_gates),delete Le.deleted_gates,_deleteEntriesInRecord(Be.deleted_configs,Le.dynamic_configs),delete Le.deleted_configs,_deleteEntriesInRecord(Be.deleted_layers,Le.layer_configs),delete Le.deleted_layers,Le}function _deleteEntriesInRecord(Be,Le){Be==null||Be.forEach(Ye=>{delete Le[Ye]})}var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(Network,"__esModule",{value:!0});const client_core_1$3=src$1,EvaluationResponseDeltas_1=EvaluationResponseDeltas;class StatsigNetwork extends client_core_1$3.NetworkCore{constructor(Le,Ye){super(Le,Ye);const tt=Le==null?void 0:Le.networkConfig;this._option=Le,this._initializeUrlConfig=new client_core_1$3.UrlConfiguration(client_core_1$3.Endpoint._initialize,tt==null?void 0:tt.initializeUrl,tt==null?void 0:tt.api,tt==null?void 0:tt.initializeFallbackUrls)}fetchEvaluations(Le,Ye,tt,nt,ft){return __awaiter$9(this,void 0,void 0,function*(){var ht,gt,At,xt,Et,yt;const Ct=Ye?(0,client_core_1$3._typedJsonParse)(Ye,"has_updates","InitializeResponse"):null;let kt={user:nt,hash:(At=(gt=(ht=this._option)===null||ht===void 0?void 0:ht.networkConfig)===null||gt===void 0?void 0:gt.initializeHashAlgorithm)!==null&&At!==void 0?At:"djb2",deltasResponseRequested:!1,full_checksum:null};if(Ct!=null&&Ct.has_updates){const vt=(Ct==null?void 0:Ct.hash_used)!==((yt=(Et=(xt=this._option)===null||xt===void 0?void 0:xt.networkConfig)===null||Et===void 0?void 0:Et.initializeHashAlgorithm)!==null&&yt!==void 0?yt:"djb2");kt=Object.assign(Object.assign({},kt),{sinceTime:ft&&!vt?Ct.time:0,previousDerivedFields:"derived_fields"in Ct&&ft?Ct.derived_fields:{},deltasResponseRequested:!0,full_checksum:Ct.full_checksum,partialUserMatchSinceTime:vt?0:Ct.time})}return this._fetchEvaluations(Le,Ct,kt,tt)})}_fetchEvaluations(Le,Ye,tt,nt){return __awaiter$9(this,void 0,void 0,function*(){var ft,ht;const gt=yield this.post({sdkKey:Le,urlConfig:this._initializeUrlConfig,data:tt,retries:2,isStatsigEncodable:!0,priority:nt});if((gt==null?void 0:gt.code)===204)return'{"has_updates": false}';if((gt==null?void 0:gt.code)!==200)return(ft=gt==null?void 0:gt.body)!==null&&ft!==void 0?ft:null;if((Ye==null?void 0:Ye.has_updates)!==!0||((ht=gt.body)===null||ht===void 0?void 0:ht.includes('"is_delta":true'))!==!0||tt.deltasResponseRequested!==!0)return gt.body;const At=(0,EvaluationResponseDeltas_1._resolveDeltasResponse)(Ye,gt.body);return typeof At=="string"?At:this._fetchEvaluations(Le,Ye,Object.assign(Object.assign(Object.assign({},tt),At),{deltasResponseRequested:!1}),nt)})}}Network.default=StatsigNetwork;var ParamStoreGetterFactory={};Object.defineProperty(ParamStoreGetterFactory,"__esModule",{value:!0}),ParamStoreGetterFactory._makeParamStoreGetter=void 0;const client_core_1$2=src$1,NO_EXPOSURE_OPT={disableExposureLog:!0};function _shouldLogExposure(Be){return Be==null||Be.disableExposureLog===!1}function _shouldReturnFallback(Be,Le){return Le!=null&&!(0,client_core_1$2._isTypeMatch)(Be,Le)}function _getMappedStaticValue(Be,Le){return Be.value}function _getMappedGateValue(Be,Le,Ye){return Be.getFeatureGate(Le.gate_name,_shouldLogExposure(Ye)?void 0:NO_EXPOSURE_OPT).value?Le.pass_value:Le.fail_value}function _getMappedDynamicConfigValue(Be,Le,Ye,tt){const ft=Be.getDynamicConfig(Le.config_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedExperimentValue(Be,Le,Ye,tt){const ft=Be.getExperiment(Le.experiment_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedLayerValue(Be,Le,Ye,tt){const ft=Be.getLayer(Le.layer_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _makeParamStoreGetter(Be,Le,Ye){return(tt,nt)=>{if(Le==null)return nt;const ft=Le[tt];if(ft==null||nt!=null&&(0,client_core_1$2._typeOf)(nt)!==ft.param_type)return nt;switch(ft.ref_type){case"static":return _getMappedStaticValue(ft);case"gate":return _getMappedGateValue(Be,ft,Ye);case"dynamic_config":return _getMappedDynamicConfigValue(Be,ft,nt,Ye);case"experiment":return _getMappedExperimentValue(Be,ft,nt,Ye);case"layer":return _getMappedLayerValue(Be,ft,nt,Ye);default:return nt}}}ParamStoreGetterFactory._makeParamStoreGetter=_makeParamStoreGetter;var StatsigEvaluationsDataAdapter$1={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigEvaluationsDataAdapter$1,"__esModule",{value:!0}),StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=void 0;const client_core_1$1=src$1,Network_1$1=Network;class StatsigEvaluationsDataAdapter extends client_core_1$1.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(Le,Ye,tt){super.attach(Le,Ye,tt),tt!==null&&tt instanceof Network_1$1.default?this._network=tt:this._network=new Network_1$1.default(Ye??{})}getDataAsync(Le,Ye,tt){return this._getDataAsyncImpl(Le,(0,client_core_1$1._normalizeUser)(Ye,this._options),tt)}prefetchData(Le,Ye){return this._prefetchDataImpl(Le,Ye)}setData(Le){const Ye=(0,client_core_1$1._typedJsonParse)(Le,"has_updates","data");Ye&&"user"in Ye?super.setData(Le,Ye.user):client_core_1$1.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(Le,Ye){super.setData(Le,Ye)}_fetchFromNetwork(Le,Ye,tt,nt){return __awaiter$8(this,void 0,void 0,function*(){var ft;const ht=yield(ft=this._network)===null||ft===void 0?void 0:ft.fetchEvaluations(this._getSdkKey(),Le,tt==null?void 0:tt.priority,Ye,nt);return ht??null})}_getCacheKey(Le){var Ye;const tt=(0,client_core_1$1._getStorageKey)(this._getSdkKey(),Le,(Ye=this._options)===null||Ye===void 0?void 0:Ye.customUserCacheKeyFunc);return`${client_core_1$1.DataAdapterCachePrefix}.${this._cacheSuffix}.${tt}`}_isCachedResultValidFor204(Le,Ye){return Le.fullUserHash!=null&&Le.fullUserHash===(0,client_core_1$1._getFullUserHash)(Ye)}}StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=StatsigEvaluationsDataAdapter;var __awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigClient$1,"__esModule",{value:!0});const client_core_1=src$1,EvaluationStore_1=EvaluationStore$1,Network_1=Network,ParamStoreGetterFactory_1=ParamStoreGetterFactory,StatsigEvaluationsDataAdapter_1=StatsigEvaluationsDataAdapter$1;class StatsigClient extends client_core_1.StatsigClientBase{static instance(Le){const Ye=(0,client_core_1._getStatsigGlobal)().instance(Le);return Ye instanceof StatsigClient?Ye:(client_core_1.Log.warn((0,client_core_1._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new StatsigClient(Le??"",{}))}constructor(Le,Ye,tt=null){var nt,ft;client_core_1.SDKType._setClientType(Le,"javascript-client");const ht=new Network_1.default(tt,At=>{this.$emt(At)});super(Le,(nt=tt==null?void 0:tt.dataAdapter)!==null&&nt!==void 0?nt:new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter,ht,tt),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(client_core_1.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(client_core_1.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(client_core_1.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(client_core_1.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(client_core_1.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(client_core_1.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new EvaluationStore_1.default(Le),this._network=ht,this._user=this._configureUser(Ye,tt),this._sdkInstanceID=(0,client_core_1.getUUID)();const gt=(ft=tt==null?void 0:tt.plugins)!==null&&ft!==void 0?ft:[];for(const At of gt)At.bind(this)}initializeSync(Le){var Ye;return this.loadingStatus!=="Uninitialized"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(Ye=this._store.getWarnings())!==null&&Ye!==void 0?Ye:[]]):(this._logger.start(),this.updateUserSync(this._user,Le))}initializeAsync(Le){return __awaiter$7(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(Le),this._initializePromise)})}updateUserSync(Le,Ye){const tt=performance.now();try{return this._updateUserSyncImpl(Le,Ye,tt)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}}_updateUserSyncImpl(Le,Ye,tt){var nt;const ft=[...(nt=this._store.getWarnings())!==null&&nt!==void 0?nt:[]];this._resetForUser(Le);const ht=this.dataAdapter.getDataSync(this._user);ht==null&&ft.push("NoCachedValues"),this._store.setValues(ht,this._user),this._finalizeUpdate(ht);const gt=Ye==null?void 0:Ye.disableBackgroundCacheRefresh;return gt===!0||gt==null&&(ht==null?void 0:ht.source)==="Bootstrap"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft):(this._runPostUpdate(ht??null,this._user),(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft))}updateUserAsync(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){const tt=performance.now();try{return yield this._updateUserAsyncImpl(Le,Ye)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}})}_updateUserAsyncImpl(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){this._resetForUser(Le);const tt=this._user;client_core_1.Diagnostics._markInitOverallStart(this._sdkKey);let nt=this.dataAdapter.getDataSync(tt);if(this._store.setValues(nt,this._user),this._setStatus("Loading",nt),nt=yield this.dataAdapter.getDataAsync(nt,tt,Ye),tt!==this._user)return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let ft=!1;nt!=null&&(client_core_1.Diagnostics._markInitProcessStart(this._sdkKey),ft=this._store.setValues(nt,this._user),client_core_1.Diagnostics._markInitProcessEnd(this._sdkKey,{success:ft})),this._finalizeUpdate(nt),ft||(this._errorBoundary.attachErrorIfNoneExists(client_core_1.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),client_core_1.Diagnostics._markInitOverallEnd(this._sdkKey,ft,this._store.getCurrentSourceDetails());const ht=client_core_1.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,client_core_1.createUpdateDetails)(ft,this._store.getSource(),ht,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:client_core_1.StatsigSession.get(this._sdkKey),stableID:client_core_1.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(Le,Ye){return this.getFeatureGate(Le,Ye).value}logEvent(Le,Ye,tt){const nt=typeof Le=="string"?{eventName:Le,value:Ye,metadata:tt}:Le;this.$emt({name:"log_event_called",event:nt}),this._logger.enqueue(Object.assign(Object.assign({},nt),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(Le){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:Le}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(Le){return __awaiter$7(this,void 0,void 0,function*(){return client_core_1.Storage.isReady()||(yield client_core_1.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,Le)})}_createErrorUpdateDetails(Le,Ye){var tt;return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),performance.now()-Ye,Le,null,[...(tt=this._store.getWarnings())!==null&&tt!==void 0?tt:[]])}_finalizeUpdate(Le){this._store.finalize(),this._setStatus("Ready",Le)}_runPostUpdate(Le,Ye){this.dataAdapter.getDataAsync(Le,Ye,{priority:"low"}).catch(tt=>{client_core_1.Log.error("An error occurred after update.",tt)})}_resetForUser(Le){this._logger.reset(),this._store.reset(),this._user=this._configureUser(Le,this._options)}_configureUser(Le,Ye){var tt,nt,ft;const ht=(0,client_core_1._normalizeUser)(Le,Ye),gt=(tt=ht.customIDs)===null||tt===void 0?void 0:tt.stableID;if(gt){const At=(ft=(nt=this.storageProvider).isReadyResolver)===null||ft===void 0?void 0:ft.call(nt);At?At.then(()=>client_core_1.StableID.setOverride(gt,this._sdkKey),()=>client_core_1.StableID.setOverride(gt,this._sdkKey)):client_core_1.StableID.setOverride(gt,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(ht.analyticsOnlyMetadata=Object.assign(Object.assign({},ht.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),ht}_getFeatureGateImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getGate(Le),gt=(0,client_core_1._makeFeatureGate)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getGateOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createGateExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"gate_evaluation",gate:xt}),xt}_getDynamicConfigImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getConfig(Le),gt=(0,client_core_1._makeDynamicConfig)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getDynamicConfigOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:xt}),xt}_getExperimentImpl(Le,Ye){var tt,nt,ft,ht;const{result:gt,details:At}=this._store.getConfig(Le),xt=(0,client_core_1._makeExperiment)(Le,At,gt);xt.__evaluation!=null&&(xt.__evaluation.secondary_exposures=(0,client_core_1._mapExposures)((nt=(tt=xt.__evaluation)===null||tt===void 0?void 0:tt.secondary_exposures)!==null&&nt!==void 0?nt:[],this._store.getExposureMapping()));const Et=(ht=(ft=this.overrideAdapter)===null||ft===void 0?void 0:ft.getExperimentOverride)===null||ht===void 0?void 0:ht.call(ft,xt,this._user,Ye),yt=Et??xt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,yt,this._store.getExposureMapping()),Ye),this.$emt({name:"experiment_evaluation",experiment:yt}),yt}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(Le,Ye){var tt,nt,ft;const{result:ht,details:gt}=this._store.getLayer(Le),At=(0,client_core_1._makeLayer)(Le,gt,ht),xt=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getLayerOverride)===null||nt===void 0?void 0:nt.call(tt,At,this._user,Ye);Ye!=null&&Ye.disableExposureLog&&this._logger.incrementNonExposureCount(Le);const Et=(0,client_core_1._mergeOverride)(At,xt,(ft=xt==null?void 0:xt.__value)!==null&&ft!==void 0?ft:At.__value,yt=>{Ye!=null&&Ye.disableExposureLog||this._enqueueExposure(Le,(0,client_core_1._createLayerParameterExposure)(this._user,Et,yt,this._store.getExposureMapping()),Ye)});return this.$emt({name:"layer_evaluation",layer:Et}),Et}_getParameterStoreImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getParamStore(Le);this._logger.incrementNonExposureCount(Le);const gt={name:Le,details:ht,__configuration:ft,get:(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,ft,Ye)},At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getParamStoreOverride)===null||nt===void 0?void 0:nt.call(tt,gt,Ye);return At!=null&&(gt.__configuration=At.config,gt.details=At.details,gt.get=(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,At.config,Ye)),gt}}StatsigClient$1.default=StatsigClient,function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ht,gt,At,xt){xt===void 0&&(xt=At);var Et=Object.getOwnPropertyDescriptor(gt,At);(!Et||("get"in Et?!gt.__esModule:Et.writable||Et.configurable))&&(Et={enumerable:!0,get:function(){return gt[At]}}),Object.defineProperty(ht,xt,Et)}:function(ht,gt,At,xt){xt===void 0&&(xt=At),ht[xt]=gt[At]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(ht,gt){for(var At in ht)At!=="default"&&!Object.prototype.hasOwnProperty.call(gt,At)&&Le(gt,ht,At)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigClient=void 0;const tt=src$1,nt=StatsigClient$1;Be.StatsigClient=nt.default,Ye(src$1,Be);const ft=Object.assign((0,tt._getStatsigGlobal)(),{StatsigClient:nt.default});Be.default=ft}(src$2);const FEATURE_FLAGS=["id_text_barcode_readability","selfie_local_lenses_check_web","id_model_hebrew_back_id","id_face_readability","new_id_capture_ux_least_risky_clients","id_test_aa","id_iou_check","iad_checks","iad_c_checks","new_fingerprint","mp_test_hashed_id"],GLOBAL_FLAGS=["new_fingerprint"],ID_MODULE_FLAGS=["id_face_readability","id_test_aa","iad_c_checks","mp_test_hashed_id","id_model_hebrew_back_id","id_iou_check","iad_checks","new_id_capture_ux_least_risky_clients","id_text_barcode_readability"],SELFIE_MODULE_FLAGS=["selfie_local_lenses_check_web"];function getStatsigEnvironment(Be){return isStageK8sEnv(Be)?{tier:"development"}:isStageEnv(Be)||isDemoEnv(Be)?{tier:"staging"}:isSaasEnv(Be)?{tier:"production"}:{tier:"development"}}const clientApiKey="client-GBTzsiJ99rvyZQdNXDFkftx3ZoMF1TED2rsB3m3IUqc",featureFlagsValues={id_text_barcode_readability:!1,selfie_local_lenses_check_web:!1,id_model_hebrew_back_id:!1,id_face_readability:!1,new_id_capture_ux_least_risky_clients:!1,id_test_aa:!1,iad_checks:!1,iad_c_checks:!1,id_iou_check:!0,new_fingerprint:!1,mp_test_hashed_id:!1},clientExperimentIds={new_id_capture_ux_least_risky_clients:"experimentV2"};let initPromise=null;const initialize=async({flowId:Be,apiKey:Le,sessionIdentifier:Ye,apiURL:tt,clientExperimentId:nt})=>{if(initPromise)return initPromise;initPromise=(async()=>{var gt;const ft={customIDs:{client_api_key:Le,hashed_onboarding_id:Ye,flow_id:Be},custom:{landing_page:(gt=window==null?void 0:window.location)==null?void 0:gt.href}},ht=new src$2.StatsigClient(clientApiKey,ft,{environment:getStatsigEnvironment(tt)});await ht.initializeAsync(),FEATURE_FLAGS.forEach(At=>{if(nt&&clientExperimentIds[At]===nt){featureFlagsValues[At]=!0;return}featureFlagsValues[At]=ht.checkGate(At)})})(),await initPromise},getFeatureFlag=Be=>featureFlagsValues[Be]??!1,getModuleFeatureFlags=async Be=>{const Le={};GLOBAL_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]});const Ye=Be.toLowerCase();return Ye.includes("id")||Ye==="government-validation"?ID_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}):(Ye.includes("selfie")||Ye==="face")&&SELFIE_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}),Le};function IdCaptureParamsConfigurator(Be,Le,Ye,tt){Object.assign(Be,{areaDown:25e3,areaUp:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:160,widthIOSDown:85,widthDown:tt?110:135,widthUp:205,framesAggregationInterval:tt?3e3:2e3,minFaceIdQualityScore:.62})}function getSelfieFaceDetectionPipelineParams(){return{frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.86,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.85,minFaceQualityScore:.63,isOcclusionCheckEnabled:!1,faceOcclusionThreshold:.3}}const getProfiles=()=>[new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Current Prod - Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_02,DetectionType.IDCapture,["id_capture_2_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"https://www.notion.so/ML-Update-ID-processing-model-to-accept-more-back-ID-types-18c4c3caef49801e95b4fd6bf9b92883?pvs=4"),new PipelineProfile(WasmPipelineType.IdBarcodeAndTextQualityPipeline,PipelineProfileName.IdCapture_3_02,DetectionType.IDCapture,["id_capture_3_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV3x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Pipeline with text and barcode quality: https://www.notion.so/Web-Use-Text-Barcode-model-2nd-iteration-1bc4c3caef49805aa9e6d308db9fc6dd?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:!0},IdCaptureParamsConfigurator,"Current Prod - Id Videoselfie profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieWithAggregationMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Current Prod - Selfie face detection profile with quality metrics"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieVideoSelfie,DetectionType.SelfieVideoSelfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"VideoSelfie face detection profile")];function getProfile(Be){const Le=getProfiles().find(Ye=>Ye.name===Be);if(!Le)throw new Error(`Profile not found for type: ${Be}`);return Le}const wasmVersion="v2.12.44";function generateBundle(){const Be=getFeatureFlag("id_text_barcode_readability")?PipelineProfileName.IdCapture_3_02:getFeatureFlag("id_model_hebrew_back_id")?PipelineProfileName.IdCapture_2_02:PipelineProfileName.IdCapture_2_01,Le=PipelineProfileName.SelfieWithQualityMetrics,Ye=PipelineProfileName.SelfieVideoSelfie,tt=PipelineProfileName.IdVideoSelfie_2_01;return[Be,tt,Le,Ye]}function getInitializationParams(){const Le=generateBundle(),Ye="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",tt=`${Ye}/${wasmVersion}/webLib.wasm`,nt=`${Ye}/${wasmVersion}/webLibSimd.wasm`,ft=`${Ye}/${wasmVersion}/webLib.js`,ht=`${Ye}/${wasmVersion}/versions.json`;let gt=new Map,At=new Map;for(const xt of Le){const Et=getProfile(xt);if(!Et)throw new Error(`Profile not found: ${xt}`);const yt=Et.modelNames;let Ct=[];for(const kt of yt)Ct.push(`${Ye}/${wasmVersion}/models/${kt}`);gt.set(Et.pipelineType,Ct),At.set(Et.detectionType,Et)}return{wasmModulePath:tt,wasmSimdModulePath:nt,glueCodePath:ft,versionsFilePath:ht,pipelineModels:gt,enableSIMD:!0,profiles:At,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.pipelineApiUtilities=null,this.utilityApi=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.inspectorOpened_=!1,this.wasmCallMutex=new Mutex,this.Module=null,this.loadModule=async Le=>{this.Module=(await import(Le)).Module}}async initialize(Le,Ye,tt,nt,ft,ht){await this.freeResources(),this.pipelines_=ht,this.versionsFile=ft,await this.loadModule(tt);const gt=await this.loadWasm(nt,Le,Ye);return this.pipelineApiUtilities=new this.wasmModule.PipelineApiUtilities,this.utilityApi=new this.wasmModule.UtilityApi,this.idCaptureWasmApi=new this.wasmModule.IdCaptureApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionApi,this.isInitialized_=!0,gt}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.pipelineApiUtilities!=null&&this.utilityApi!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(Le,Ye){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(Le&&Ye&&Le==this.imageWidth_&&Ye==this.imageHeight_&&this.inputImageBuffer&&Le*Ye*4===this.inputImageBuffer.length)&&(this.imageWidth_=Le,this.imageHeight_=Ye,this.inputImageBuffer=this.pipelineApiUtilities.allocateInputImageBuffer(Le,Ye,4))}async handleDetectionCallAndUpdateState(Le){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.handleDetectionCallAndUpdateState(this.pipelineTypeToWasmEnum(Le))}encryptImage(Le){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.utilityApi.encryptImage(Le)}isVirtualCamera(Le){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),Le)return this.utilityApi.isVirtualCamera(Le)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.utilityApi.estimatePerformance()}async analyzeFrame(Le){this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(Le.width,Le.height),this.inputImageBuffer.set(Le.data),this.utilityApi.analyzeFrame()}async freeResources(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,window.wasmArrayBuffer=null,this.pipelineApiUtilities&&typeof this.pipelineApiUtilities.delete=="function"&&(this.pipelineApiUtilities.delete(),this.pipelineApiUtilities=null),this.utilityApi&&typeof this.utilityApi.delete=="function"&&(this.utilityApi.delete(),this.utilityApi=null),this.idCaptureWasmApi&&typeof this.idCaptureWasmApi.delete=="function"&&(this.idCaptureWasmApi.delete(),this.idCaptureWasmApi=null),this.faceDetectionWasmApi&&typeof this.faceDetectionWasmApi.delete=="function"&&(this.faceDetectionWasmApi.delete(),this.faceDetectionWasmApi=null),this.wasmModule=null,this.isInitialized_=!1}resetPipeline(Le){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.pipelineApiUtilities.resetPipeline(this.pipelineTypeToWasmEnum(Le))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[Le,Ye]of this.pipelines_)this.resetPipeline(Le)}resetOther(){this.checkWasmInitialization("Unable to reset other states, cpp API hasn't been initialized"),this.utilityApi.resetOther()}reset(){this.resetAllPipelines(),this.resetOther()}async process(Le,Ye){if(this.checkWasmInitialization("Unable to process the image, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");switch(this.inputImageBuffer.set(Le.data),Ye){case WasmPipelineType.IdBlurGlarePipeline:case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.idCaptureWasmApi.runIdCapturePipeline(this.pipelineTypeToWasmEnum(Ye));case WasmPipelineType.IdFaceDetectionPipeline:return this.faceDetectionWasmApi.runIdFaceDetectionPipeline();case WasmPipelineType.IdVideoSelfiePipeline:return this.idCaptureWasmApi.runIdVideoSelfiePipeline();case WasmPipelineType.SelfieWithAggregationMetrics:case WasmPipelineType.SelfieWithQualityMetrics:return this.faceDetectionWasmApi.runSelfieFaceDetectionPipeline(this.pipelineTypeToWasmEnum(Ye));default:throw new Error("Unknown pipeline type")}}async runIdCapture(Le){if(this.checkWasmInitialization("Unable to run Id Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(Le.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(Le){if(this.checkWasmInitialization("Unable to run Selfie Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(Le.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceDetectionThresholds(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}async setFaceAttributesThresholds(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceChecksEnabled(Le,Ye,tt,nt,ft,ht){this.checkWasmInitialization("Unable to set face checks enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceChecksEnabled(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht)}async setFaceDetectionMode(Le,Ye){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.pipelineTypeToWasmEnum(Le),Ye)}async setFaceDetectionCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt,bt,It,wt,Rt,Tt){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt,bt,It,wt,Rt,Tt)}async setIdCaptureThresholds(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt)}async setIdCaptureCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt)}async setIdCaptureGeometryParams(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt)}async setIdCaptureConfigParams(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}setIdCaptureModelType(Le,Ye){this.checkWasmInitialization("Unable to set model type, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureModelType(this.pipelineTypeToWasmEnum(Le),this.IdCaptureModelTypeToWasmEnum(Ye))}IdPerspectiveTransform(Le,Ye){return this.checkWasmInitialization("Unable to perform perspective transform, cpp API hasn't been initialized"),this.idCaptureWasmApi.IdPerspectiveTransform(Le,Ye)}async getVersions(){const Ye=await(await fetch(this.versionsFile)).text();return JSON.parse(Ye)}async loadWasm(Le,Ye,tt){const nt=Le?tt:Ye;try{window.wasmArrayBuffer=await fetch(nt).then(ft=>ft.arrayBuffer()).then(ft=>new Uint8Array(ft)),this.wasmModule=await this.Module()}catch(ft){if(console.log(ft,Le,"useSmd"),Le)return await this.loadWasm(!1,Ye,tt);throw ft}return Le}async loadModels(){var nt;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let Le=new this.wasmModule.PipelineTypeToIntMap,Ye=new Map,tt=new Map;for(let[ft,ht]of this.pipelines_){let gt=this.pipelineTypeToWasmEnum(ft),At=[],xt=new this.wasmModule.VectorInt;for(let Et of ht){if(!tt.has(Et)){let Ct=await fetch(Et).then(kt=>kt.arrayBuffer()).then(kt=>new Uint8Array(kt));tt.set(Et,Ct)}let yt=tt.get(Et);xt.push_back(yt.byteLength),At.push(yt)}Le.set(gt,xt),Ye.set(gt,At)}this.modelsBuffers=this.pipelineApiUtilities.allocateModelsBuffers(Le);for(let[ft,ht]of Ye){let gt=(nt=this.modelsBuffers)==null?void 0:nt.get(ft);for(let At=0;At<gt.size();At++){let xt=gt==null?void 0:gt.get(At);if(xt)xt.set(ht[At]);else throw new Error("Unable to get model buffer from shared memory!")}}}async initializePipelines(){this.checkWasmInitialization("Unable to initialize pipelines, cpp API hasn't been initialized"),this.modelsBuffers||await this.loadModels(),this.pipelineApiUtilities.initializePipelines()}async setProductionMode(Le){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.utilityApi.setProductionMode(Le)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.pipelineTypeFromWasmEnum(this.pipelineApiUtilities.getCurrentPipeline())}setSdkVersion(Le){this.checkWasmInitialization("Unable to set sdk version, cpp API hasn't been initialized"),this.utilityApi.setSdkVersion(Le)}setSdkPlatform(Le){this.checkWasmInitialization("Unable to set device type, cpp API hasn't been initialized"),this.utilityApi.setSdkPlatform(Le)}setDeviceInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set device info, cpp API hasn't been initialized"),this.utilityApi.setDeviceInfo(Le,Ye)}setBrowserInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set browser info, cpp API hasn't been initialized"),this.utilityApi.setBrowserInfo(Le,Ye)}setCameraInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set camera info, cpp API hasn't been initialized"),this.utilityApi.setCameraInfo(Le,Ye)}setZc(Le){this.checkWasmInitialization("Unable to set zc, cpp API hasn't been initialized"),this.utilityApi.setZc(Le)}setMotionStatus(Le){this.checkWasmInitialization("Unable to set motion status, cpp API hasn't been initialized"),this.utilityApi.setMotionStatus(Le)}setMetadataField(Le,Ye){this.checkWasmInitialization("Unable to set metadata field, cpp API hasn't been initialized"),this.utilityApi.setMetadataField(Le,Ye)}setInspectorOpened(Le){this.inspectorOpened_=Le}setBackgroundMode(Le){this.checkWasmInitialization("Unable to set background mode, cpp API hasn't been initialized"),this.utilityApi.setBackgroundMode(Le)}getCheck(){return this.checkWasmInitialization("Unable to get check, cpp API hasn't been initialized"),this.utilityApi.getCheck()}getMetadata(){return this.checkWasmInitialization("Unable to get metadata, cpp API hasn't been initialized"),this.utilityApi.setInspectorOpened(this.inspectorOpened_),this.utilityApi.getMetadata()}async prc(){return this.checkWasmInitialization("Unable to prc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.prc.bind(this.utilityApi),[])}async poc(Le){this.checkWasmInitialization("Unable to poc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.poc.bind(this.utilityApi),[Le])}pipelineTypeToWasmEnum(Le){switch(Le){case WasmPipelineType.IdBlurGlarePipeline:return this.wasmModule.PipelineType.IdBlurGlarePipeline;case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.wasmModule.PipelineType.IdBarcodeAndTextQualityPipeline;case WasmPipelineType.IdFaceDetectionPipeline:return this.wasmModule.PipelineType.IdFaceDetectionPipeline;case WasmPipelineType.IdVideoSelfiePipeline:return this.wasmModule.PipelineType.IdVideoSelfiePipeline;case WasmPipelineType.SelfieWithAggregationMetrics:return this.wasmModule.PipelineType.SelfieWithAggregationMetrics;case WasmPipelineType.SelfieWithQualityMetrics:return this.wasmModule.PipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}pipelineTypeFromWasmEnum(Le){switch(Le){case this.wasmModule.PipelineType.IdBlurGlarePipeline:return WasmPipelineType.IdBlurGlarePipeline;case this.wasmModule.IdBarcodeAndTextQualityPipeline:return WasmPipelineType.IdBarcodeAndTextQualityPipeline;case this.wasmModule.PipelineType.IdFaceDetectionPipeline:return WasmPipelineType.IdFaceDetectionPipeline;case this.wasmModule.PipelineType.IdVideoSelfiePipeline:return WasmPipelineType.IdVideoSelfiePipeline;case this.wasmModule.PipelineType.SelfieWithAggregationMetrics:return WasmPipelineType.SelfieWithAggregationMetrics;case this.wasmModule.PipelineType.SelfieWithQualityMetrics:return WasmPipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}IdCaptureModelTypeToWasmEnum(Le){switch(Le){case IdCaptureModelType.IdCaptureV1x:return this.wasmModule.IdCaptureModelType.IdCaptureV1x;case IdCaptureModelType.IdCaptureV2x:return this.wasmModule.IdCaptureModelType.IdCaptureV2x;case IdCaptureModelType.IdCaptureV3x:return this.wasmModule.IdCaptureModelType.IdCaptureV3x;default:throw new Error("Unknown Id Capture model type")}}checkWasmInitialization(Le){if(!this.isInitialized())throw new Error(Le)}async wasmCallWrapper(Le,Ye=[]){return await this.wasmCallMutex.withLock(async(...tt)=>{let nt=!1;try{for(;;){if(nt=Le(...tt),nt)return;await new Promise(ft=>setTimeout(ft,0))}}catch(ft){console.log("Error in wasmCallWrapper:",ft)}},...Ye)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance(),version$4="1.85.0-20251216195123.0";function e$2(Be,Le){return function(Ye,tt){return Object.prototype.hasOwnProperty.call(Ye,tt)}(Be,Le)?Be[Le]:void 0}function t$2(Be,Le,Ye,tt){const nt=document,ft="securitypolicyviolation";let ht;const gt=xt=>{const Et=new URL(Be,location.href),{blockedURI:yt}=xt;yt!==Et.href&&yt!==Et.protocol.slice(0,-1)&&yt!==Et.origin||(ht=xt,At())};nt.addEventListener(ft,gt);const At=()=>nt.removeEventListener(ft,gt);return Promise.resolve().then(Le).then(xt=>(At(),xt),xt=>new Promise(Et=>{const yt=new MessageChannel;yt.port1.onmessage=()=>Et(),yt.port2.postMessage(null)}).then(()=>{if(At(),ht)return Ye(ht);throw xt}))}function n$2(Be){let Le="";for(let Ye=0;Ye<Be.length;++Ye)if(Ye>0){const tt=Be[Ye].toLowerCase();tt!==Be[Ye]?Le+=` ${tt}`:Le+=Be[Ye]}else Le+=Be[Ye].toUpperCase();return Le}const r$4={default:"endpoint"},o$1={default:"tlsEndpoint"},i$5="Client timeout",R$2="Network connection error",s$3="Network request aborted",a$3="Response cannot be parsed",c$3="Blocked by CSP",E$1="The endpoint parameter is not a valid URL",l$1="Handle on demand agent data error",u$1=n$2("WrongRegion"),d$1=n$2("SubscriptionNotActive"),_$2=n$2("UnsupportedVersion"),O$1=n$2("InstallationMethodRestricted"),p$1=n$2("HostnameRestricted"),I$1=n$2("IntegrationFailed"),f$2=n$2("NetworkRestricted"),N$1=n$2("InvalidProxyIntegrationSecret"),T$1=n$2("InvalidProxyIntegrationHeaders"),h$e=n$2("ProxyIntegrationSecretEnvironmentMismatch"),v$d="API key required",m$2="API key not found",A$1="API key expired",w$e="Request cannot be parsed",P$1="Request failed",D$1="Request failed to process",S$1="Too many requests, rate limit exceeded",y="Not available for this origin",g$1="Not available with restricted header",L$1=v$d,C$1=m$2,U$1=A$1;var b$2="3.12.3";const M$1="Failed to load the JS script of the agent",K="9319";function V(Be,Le){const Ye=[],[tt,nt]=function(gt){const At=function(yt){const Ct=[...yt];return{current:()=>Ct[0],postpone(){const kt=Ct.shift();kt!==void 0&&Ct.push(kt)},exclude(){Ct.shift()}}}(gt),xt=function(yt,Ct){let kt=0;return()=>Math.random()*Math.min(Ct,yt*Math.pow(2,kt++))}(100,3e3),Et=new Set;return[At.current(),(yt,Ct)=>{let kt;const vt=Ct instanceof Error?Ct.message:"";if(vt===c$3||vt===E$1)At.exclude(),kt=0;else if(vt===K)At.exclude();else if(vt===M$1){const It=Date.now()-yt.getTime()<50,wt=At.current();wt&&It&&!Et.has(wt)&&(Et.add(wt),kt=0),At.postpone()}else At.postpone();const bt=At.current();return bt===void 0?void 0:[bt,kt??yt.getTime()+xt()-Date.now()]}]}(Be);let ft;if(tt===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));const ht=gt=>{const At=new Date,xt=yt=>Ye.push({url:gt,startedAt:At,finishedAt:new Date,error:yt}),Et=Le(gt);return Et.then(()=>xt(),xt),Et.catch(yt=>{if(ft!=null||(ft=yt),Ye.length>=5)throw ft;const Ct=nt(At,yt);if(!Ct)throw ft;const[kt,vt]=Ct;return(bt=vt,new Promise(It=>setTimeout(It,bt))).then(()=>ht(kt));var bt})};return ht(tt).then(gt=>[gt,Ye])}const k$1="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",G=k$1;function B$1(Be){var Le,Ye;const{picked:tt,rest:nt}=function(Et,yt){const Ct={},kt={};for(const[vt,bt]of Object.entries(Et))yt.includes(vt)?Ct[vt]=bt:kt[vt]=bt;return{picked:Ct,rest:kt}}(Be,["scriptUrlPattern","token","apiKey"]),ft=tt.token,ht=(Le=tt.apiKey)!==null&&Le!==void 0?Le:ft,gt=(Ye=e$2(Be,"scriptUrlPattern"))!==null&&Ye!==void 0?Ye:k$1,[At,xt]=function(){const Et=[],yt=()=>{Et.push({time:new Date,state:document.visibilityState})},Ct=function(kt,vt,bt,It){return kt.addEventListener(vt,bt,It),()=>kt.removeEventListener(vt,bt,It)}(document,"visibilitychange",yt);return yt(),[Et,Ct]}();return Promise.resolve().then(()=>{if(!ht||typeof ht!="string")throw new Error(v$d);const Et=function(yt,Ct){return(Array.isArray(yt)?yt:[yt]).map(kt=>function(vt,bt){const It=encodeURIComponent;return vt.replace(/<[^<>]+>/g,wt=>wt==="<version>"?"3":wt==="<apiKey>"?It(bt):wt==="<loaderVersion>"?It(b$2):wt)}(String(kt),Ct))}(gt,ht);return V(Et,F$1)}).catch(Et=>{throw xt(),function(yt){return yt instanceof Error&&yt.message===K?new Error(M$1):yt}(Et)}).then(([Et,yt])=>(xt(),Et.load({...nt,ldi:{attempts:yt,visibilityStates:At}})))}function F$1(Be){return t$2(Be,()=>function(Le){return new Promise((Ye,tt)=>{if(function(gt){if(URL.prototype)try{return new URL(gt,location.href),!1}catch(At){if(At instanceof Error&&At.name==="TypeError")return!0;throw At}}(Le))throw new Error(E$1);const nt=document.createElement("script"),ft=()=>{var gt;return(gt=nt.parentNode)===null||gt===void 0?void 0:gt.removeChild(nt)},ht=document.head||document.getElementsByTagName("head")[0];nt.onload=()=>{ft(),Ye()},nt.onerror=()=>{ft(),tt(new Error(M$1))},nt.async=!0,nt.src=Le,ht.appendChild(nt)})}(Be),()=>{throw new Error(c$3)}).then(x$1)}function x$1(){const Be=window,Le="__fpjs_p_l_b",Ye=Be[Le];if(function(tt,nt){var ft;const ht=(ft=Object.getOwnPropertyDescriptor)===null||ft===void 0?void 0:ft.call(Object,tt,nt);ht!=null&&ht.configurable?delete tt[nt]:ht&&!ht.writable||(tt[nt]=void 0)}(Be,Le),typeof(Ye==null?void 0:Ye.load)!="function")throw new Error(K);return Ye}var H={load:B$1,defaultScriptUrlPattern:G,ERROR_SCRIPT_LOAD_FAIL:M$1,ERROR_API_KEY_EXPIRED:A$1,ERROR_API_KEY_INVALID:m$2,ERROR_API_KEY_MISSING:v$d,ERROR_BAD_REQUEST_FORMAT:w$e,ERROR_BAD_RESPONSE_FORMAT:a$3,ERROR_CLIENT_TIMEOUT:i$5,ERROR_CSP_BLOCK:c$3,ERROR_FORBIDDEN_ENDPOINT:p$1,ERROR_FORBIDDEN_HEADER:g$1,ERROR_FORBIDDEN_ORIGIN:y,ERROR_GENERAL_SERVER_FAILURE:P$1,ERROR_HANDLE_AGENT_DATA:l$1,ERROR_INSTALLATION_METHOD_RESTRICTED:O$1,ERROR_INTEGRATION_FAILURE:I$1,ERROR_INVALID_ENDPOINT:E$1,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:T$1,ERROR_INVALID_PROXY_INTEGRATION_SECRET:N$1,ERROR_NETWORK_ABORT:s$3,ERROR_NETWORK_CONNECTION:R$2,ERROR_NETWORK_RESTRICTED:f$2,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:h$e,ERROR_RATE_LIMIT:S$1,ERROR_SERVER_TIMEOUT:D$1,ERROR_SUBSCRIPTION_NOT_ACTIVE:d$1,ERROR_TOKEN_EXPIRED:U$1,ERROR_TOKEN_INVALID:C$1,ERROR_TOKEN_MISSING:L$1,ERROR_UNSUPPORTED_VERSION:_$2,ERROR_WRONG_REGION:u$1,defaultEndpoint:r$4,defaultTlsEndpoint:o$1};function e$1(Be,Le,Ye,tt){return new(Ye||(Ye=Promise))(function(nt,ft){function ht(xt){try{At(tt.next(xt))}catch(Et){ft(Et)}}function gt(xt){try{At(tt.throw(xt))}catch(Et){ft(Et)}}function At(xt){var Et;xt.done?nt(xt.value):(Et=xt.value,Et instanceof Ye?Et:new Ye(function(yt){yt(Et)})).then(ht,gt)}At((tt=tt.apply(Be,[])).next())})}function n$1(Be,Le){var Ye,tt,nt,ft,ht={label:0,sent:function(){if(1&nt[0])throw nt[1];return nt[1]},trys:[],ops:[]};return ft={next:gt(0),throw:gt(1),return:gt(2)},typeof Symbol=="function"&&(ft[Symbol.iterator]=function(){return this}),ft;function gt(At){return function(xt){return function(Et){if(Ye)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,Et[0]&&(ht=0)),ht;)try{if(Ye=1,tt&&(nt=2&Et[0]?tt.return:Et[0]?tt.throw||((nt=tt.return)&&nt.call(tt),0):tt.next)&&!(nt=nt.call(tt,Et[1])).done)return nt;switch(tt=0,nt&&(Et=[2&Et[0],nt.value]),Et[0]){case 0:case 1:nt=Et;break;case 4:return ht.label++,{value:Et[1],done:!1};case 5:ht.label++,tt=Et[1],Et=[0];continue;case 7:Et=ht.ops.pop(),ht.trys.pop();continue;default:if(nt=ht.trys,!((nt=nt.length>0&&nt[nt.length-1])||Et[0]!==6&&Et[0]!==2)){ht=0;continue}if(Et[0]===3&&(!nt||Et[1]>nt[0]&&Et[1]<nt[3])){ht.label=Et[1];break}if(Et[0]===6&&ht.label<nt[1]){ht.label=nt[1],nt=Et;break}if(nt&&ht.label<nt[2]){ht.label=nt[2],ht.ops.push(Et);break}nt[2]&&ht.ops.pop(),ht.trys.pop();continue}Et=Le.call(Be,ht)}catch(yt){Et=[6,yt],tt=0}finally{Ye=nt=0}if(5&Et[0])throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}([At,xt])}}}typeof SuppressedError=="function"&&SuppressedError;var r$3={exclude:[],include:[],logging:!0,timeout:1e3},o={},a$2={timeout:"true"},i$4=function(Be,Le){typeof window<"u"&&(o[Be]=Le)},u=function(){return Object.fromEntries(Object.entries(o).filter(function(Be){var Le,Ye=Be[0];return!(!((Le=r$3==null?void 0:r$3.exclude)===null||Le===void 0)&&Le.includes(Ye))}).filter(function(Be){var Le,Ye,tt,nt,ft=Be[0];return!((Le=r$3==null?void 0:r$3.include)===null||Le===void 0)&&Le.some(function(ht){return ht.includes(".")})?(Ye=r$3==null?void 0:r$3.include)===null||Ye===void 0?void 0:Ye.some(function(ht){return ht.startsWith(ft)}):((tt=r$3==null?void 0:r$3.include)===null||tt===void 0?void 0:tt.length)===0||((nt=r$3==null?void 0:r$3.include)===null||nt===void 0?void 0:nt.includes(ft))}).map(function(Be){return[Be[0],(0,Be[1])()]}))};function c$2(Be){return Be^=Be>>>16,Be=Math.imul(Be,2246822507),Be^=Be>>>13,Be=Math.imul(Be,3266489909),(Be^=Be>>>16)>>>0}var s$2=new Uint32Array([597399067,2869860233,951274213,2716044179]);function l(Be,Le){return Be<<Le|Be>>>32-Le}function d(Be,Le){var Ye;if(Le===void 0&&(Le=0),Le=Le?0|Le:0,typeof Be=="string"&&(Ye=Be,Be=new TextEncoder().encode(Ye).buffer),!(Be instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");var tt=new Uint32Array([Le,Le,Le,Le]);(function(ft,ht){for(var gt=ft.byteLength/16|0,At=new Uint32Array(ft,0,4*gt),xt=0;xt<gt;xt++){var Et=At.subarray(4*xt,4*(xt+1));Et[0]=Math.imul(Et[0],s$2[0]),Et[0]=l(Et[0],15),Et[0]=Math.imul(Et[0],s$2[1]),ht[0]=ht[0]^Et[0],ht[0]=l(ht[0],19),ht[0]=ht[0]+ht[1],ht[0]=Math.imul(ht[0],5)+1444728091,Et[1]=Math.imul(Et[1],s$2[1]),Et[1]=l(Et[1],16),Et[1]=Math.imul(Et[1],s$2[2]),ht[1]=ht[1]^Et[1],ht[1]=l(ht[1],17),ht[1]=ht[1]+ht[2],ht[1]=Math.imul(ht[1],5)+197830471,Et[2]=Math.imul(Et[2],s$2[2]),Et[2]=l(Et[2],17),Et[2]=Math.imul(Et[2],s$2[3]),ht[2]=ht[2]^Et[2],ht[2]=l(ht[2],15),ht[2]=ht[2]+ht[3],ht[2]=Math.imul(ht[2],5)+2530024501,Et[3]=Math.imul(Et[3],s$2[3]),Et[3]=l(Et[3],18),Et[3]=Math.imul(Et[3],s$2[0]),ht[3]=ht[3]^Et[3],ht[3]=l(ht[3],13),ht[3]=ht[3]+ht[0],ht[3]=Math.imul(ht[3],5)+850148119}})(Be,tt),function(ft,ht){var gt=ft.byteLength/16|0,At=ft.byteLength%16,xt=new Uint32Array(4),Et=new Uint8Array(ft,16*gt,At);switch(At){case 15:xt[3]=xt[3]^Et[14]<<16;case 14:xt[3]=xt[3]^Et[13]<<8;case 13:xt[3]=xt[3]^Et[12],xt[3]=Math.imul(xt[3],s$2[3]),xt[3]=l(xt[3],18),xt[3]=Math.imul(xt[3],s$2[0]),ht[3]=ht[3]^xt[3];case 12:xt[2]=xt[2]^Et[11]<<24;case 11:xt[2]=xt[2]^Et[10]<<16;case 10:xt[2]=xt[2]^Et[9]<<8;case 9:xt[2]=xt[2]^Et[8],xt[2]=Math.imul(xt[2],s$2[2]),xt[2]=l(xt[2],17),xt[2]=Math.imul(xt[2],s$2[3]),ht[2]=ht[2]^xt[2];case 8:xt[1]=xt[1]^Et[7]<<24;case 7:xt[1]=xt[1]^Et[6]<<16;case 6:xt[1]=xt[1]^Et[5]<<8;case 5:xt[1]=xt[1]^Et[4],xt[1]=Math.imul(xt[1],s$2[1]),xt[1]=l(xt[1],16),xt[1]=Math.imul(xt[1],s$2[2]),ht[1]=ht[1]^xt[1];case 4:xt[0]=xt[0]^Et[3]<<24;case 3:xt[0]=xt[0]^Et[2]<<16;case 2:xt[0]=xt[0]^Et[1]<<8;case 1:xt[0]=xt[0]^Et[0],xt[0]=Math.imul(xt[0],s$2[0]),xt[0]=l(xt[0],15),xt[0]=Math.imul(xt[0],s$2[1]),ht[0]=ht[0]^xt[0]}}(Be,tt),function(ft,ht){ht[0]=ht[0]^ft.byteLength,ht[1]=ht[1]^ft.byteLength,ht[2]=ht[2]^ft.byteLength,ht[3]=ht[3]^ft.byteLength,ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0,ht[0]=c$2(ht[0]),ht[1]=c$2(ht[1]),ht[2]=c$2(ht[2]),ht[3]=c$2(ht[3]),ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0}(Be,tt);var nt=new Uint8Array(tt.buffer);return Array.from(nt).map(function(ft){return ft.toString(16).padStart(2,"0")}).join("")}function f$1(Be,Le){return new Promise(function(Ye){setTimeout(function(){return Ye(Le)},Be)})}function m$1(Be,Le,Ye){return Promise.all(Be.map(function(tt){return Promise.race([tt,f$1(Le,Ye)])}))}function g(){return e$1(this,void 0,void 0,function(){var Be,Le,Ye,tt,nt;return n$1(this,function(ft){switch(ft.label){case 0:return ft.trys.push([0,2,,3]),Be=u(),Le=Object.keys(Be),[4,m$1(Object.values(Be),(r$3==null?void 0:r$3.timeout)||1e3,a$2)];case 1:return Ye=ft.sent(),tt=Ye.filter(function(ht){return ht!==void 0}),nt={},tt.forEach(function(ht,gt){nt[Le[gt]]=ht}),[2,p(nt,r$3.exclude||[],r$3.include||[],"")];case 2:throw ft.sent();case 3:return[2]}})})}function p(Be,Le,Ye,tt){tt===void 0&&(tt="");for(var nt={},ft=function(xt,Et){var yt=tt+xt+".";if(typeof Et!="object"||Array.isArray(Et)){var Ct=Le.some(function(bt){return yt.startsWith(bt)}),kt=Ye.some(function(bt){return yt.startsWith(bt)});Ct&&!kt||(nt[xt]=Et)}else{var vt=p(Et,Le,Ye,yt);Object.keys(vt).length>0&&(nt[xt]=vt)}},ht=0,gt=Object.entries(Be);ht<gt.length;ht++){var At=gt[ht];ft(At[0],At[1])}return nt}function w$d(Be){return e$1(this,void 0,void 0,function(){var Le,Ye;return n$1(this,function(tt){switch(tt.label){case 0:return tt.trys.push([0,2,,3]),[4,g()];case 1:return Le=tt.sent(),Ye=d(JSON.stringify(Le)),Math.random()<1e-5&&r$3.logging&&function(nt,ft){e$1(this,void 0,void 0,function(){var ht,gt;return n$1(this,function(At){switch(At.label){case 0:if(ht="https://logging.thumbmarkjs.com/v1/log",gt={thumbmark:nt,components:ft,version:"0.20.6"},sessionStorage.getItem("_tmjs_l"))return[3,4];sessionStorage.setItem("_tmjs_l","1"),At.label=1;case 1:return At.trys.push([1,3,,4]),[4,fetch(ht,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)})];case 2:case 3:return At.sent(),[3,4];case 4:return[2]}})})}(Ye,Le),[2,Ye.toString()];case 2:throw tt.sent();case 3:return[2]}})})}function b$1(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};for(var Be=navigator.userAgent,Le={edg:"Edge",opr:"Opera",samsung:"SamsungBrowser"},Ye=0,tt=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/,/(?<name>samsung).*Version\/(?<version>\d+(?:\.\d+)?)/i,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/];Ye<tt.length;Ye++){var nt=tt[Ye],ft=Be.match(nt);if(ft&&ft.groups)return{name:Le[ft.groups.name.toLowerCase()]||ft.groups.name,version:ft.groups.version}}return{name:"unknown",version:"unknown"}}function S(Be){for(var Le=0,Ye=0;Ye<Be.length;++Ye)Le+=Math.abs(Be[Ye]);return Le}var M=b$1();function E(Be,Le,Ye){for(var tt=[],nt=0;nt<Be[0].data.length;nt++){for(var ft=[],ht=0;ht<Be.length;ht++)ft.push(Be[ht].data[nt]);tt.push(P(ft))}var gt=new Uint8ClampedArray(tt);return new ImageData(gt,Le,Ye)}function P(Be){if(Be.length===0)return 0;for(var Le={},Ye=0,tt=Be;Ye<tt.length;Ye++)Le[ft=tt[Ye]]=(Le[ft]||0)+1;var nt=Be[0];for(var ft in Le)Le[ft]>Le[nt]&&(nt=parseInt(ft,10));return nt}["SamsungBrowser","Safari"].includes(M.name)||i$4("audio",function(){return e$1(this,void 0,void 0,function(){return n$1(this,function(Be){return[2,new Promise(function(Le,Ye){try{var tt=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),nt=tt.createBufferSource(),ft=tt.createOscillator();ft.frequency.value=1e3;var ht,gt=tt.createDynamicsCompressor();gt.threshold.value=-50,gt.knee.value=40,gt.ratio.value=12,gt.attack.value=0,gt.release.value=.2,ft.connect(gt),gt.connect(tt.destination),ft.start(),tt.oncomplete=function(At){ht=At.renderedBuffer.getChannelData(0),Le({sampleHash:S(ht),oscillator:ft.type,maxChannels:tt.destination.maxChannelCount,channelCountMode:nt.channelCountMode})},tt.startRendering()}catch(At){console.error("Error creating audio fingerprint:",At),Ye(At)}})]})})});var A=b$1(),C=A.name.toLowerCase(),x=A.version.split(".")[0]||"0",T=parseInt(x,10);C==="firefox"||C==="safari"&&T===17||i$4("canvas",function(){return document.createElement("canvas").getContext("2d"),new Promise(function(Be){var Le=Array.from({length:3},function(){return function(){var Ye=document.createElement("canvas"),tt=Ye.getContext("2d");if(!tt)return new ImageData(1,1);Ye.width=280,Ye.height=20;var nt=tt.createLinearGradient(0,0,Ye.width,Ye.height);nt.addColorStop(0,"red"),nt.addColorStop(.16666666666666666,"orange"),nt.addColorStop(.3333333333333333,"yellow"),nt.addColorStop(.5,"green"),nt.addColorStop(.6666666666666666,"blue"),nt.addColorStop(.8333333333333334,"indigo"),nt.addColorStop(1,"violet"),tt.fillStyle=nt,tt.fillRect(0,0,Ye.width,Ye.height);var ft="Random Text WMwmil10Oo";return tt.font="23.123px Arial",tt.fillStyle="black",tt.fillText(ft,-5,15),tt.fillStyle="rgba(0, 0, 255, 0.5)",tt.fillText(ft,-3.3,17.7),tt.beginPath(),tt.moveTo(0,0),tt.lineTo(2*Ye.width/7,Ye.height),tt.strokeStyle="white",tt.lineWidth=2,tt.stroke(),tt.getImageData(0,0,Ye.width,Ye.height)}()});Be({commonImageDataHash:d(E(Le,280,20).data.toString()).toString()})})});var k,I=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],R$1=["monospace","sans-serif","serif"];function L(Be,Le){if(!Be)throw new Error("Canvas context not supported");return Be.font,Be.font="72px ".concat(Le),Be.measureText("WwMmLli0Oo").width}function _$1(){var Be,Le=document.createElement("canvas"),Ye=(Be=Le.getContext("webgl"))!==null&&Be!==void 0?Be:Le.getContext("experimental-webgl");if(Ye&&"getParameter"in Ye)try{var tt=(Ye.getParameter(Ye.VENDOR)||"").toString(),nt=(Ye.getParameter(Ye.RENDERER)||"").toString(),ft={vendor:tt,renderer:nt,version:(Ye.getParameter(Ye.VERSION)||"").toString(),shadingLanguageVersion:(Ye.getParameter(Ye.SHADING_LANGUAGE_VERSION)||"").toString()};if(!nt.length||!tt.length){var ht=Ye.getExtension("WEBGL_debug_renderer_info");if(ht){var gt=(Ye.getParameter(ht.UNMASKED_VENDOR_WEBGL)||"").toString(),At=(Ye.getParameter(ht.UNMASKED_RENDERER_WEBGL)||"").toString();gt&&(ft.vendorUnmasked=gt),At&&(ft.rendererUnmasked=At)}}return ft}catch{}return"undefined"}function O(){var Be=new Float32Array(1),Le=new Uint8Array(Be.buffer);return Be[0]=1/0,Be[0]=Be[0]-Be[0],Le[3]}function B(Be,Le){var Ye={};return Le.forEach(function(tt){var nt=function(ft){if(ft.length===0)return null;var ht={};ft.forEach(function(xt){var Et=String(xt);ht[Et]=(ht[Et]||0)+1});var gt=ft[0],At=1;return Object.keys(ht).forEach(function(xt){ht[xt]>At&&(gt=xt,At=ht[xt])}),gt}(Be.map(function(ft){return tt in ft?ft[tt]:void 0}).filter(function(ft){return ft!==void 0}));nt&&(Ye[tt]=nt)}),Ye}function D(){var Be=[],Le={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(Le).forEach(function(Ye){Le[Ye].forEach(function(tt){matchMedia("(".concat(Ye,": ").concat(tt,")")).matches&&Be.push("".concat(Ye,": ").concat(tt))})}),Be}b$1().name!="Firefox"&&i$4("fonts",function(){var Be=this;return new Promise(function(Le,Ye){try{(function(tt){var nt;e$1(this,void 0,void 0,function(){var ft,ht,gt;return n$1(this,function(At){switch(At.label){case 0:return document.body?[3,2]:[4,(xt=50,new Promise(function(yt){return setTimeout(yt,xt,Et)}))];case 1:return At.sent(),[3,0];case 2:if((ft=document.createElement("iframe")).setAttribute("frameBorder","0"),(ht=ft.style).setProperty("position","fixed"),ht.setProperty("display","block","important"),ht.setProperty("visibility","visible"),ht.setProperty("border","0"),ht.setProperty("opacity","0"),ft.src="about:blank",document.body.appendChild(ft),!(gt=ft.contentDocument||((nt=ft.contentWindow)===null||nt===void 0?void 0:nt.document)))throw new Error("Iframe document is not accessible");return tt({iframe:gt}),setTimeout(function(){document.body.removeChild(ft)},0),[2]}var xt,Et})})})(function(tt){var nt=tt.iframe;return e$1(Be,void 0,void 0,function(){var ft,ht,gt,At;return n$1(this,function(xt){return ft=nt.createElement("canvas"),ht=ft.getContext("2d"),gt=R$1.map(function(Et){return L(ht,Et)}),At={},I.forEach(function(Et){var yt=L(ht,Et);gt.includes(yt)||(At[Et]=yt)}),Le(At),[2]})})})}catch{Ye({error:"unsupported"})}})}),i$4("hardware",function(){return new Promise(function(Be,Le){var Ye=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,tt=window.performance&&window.performance.memory?window.performance.memory:0;Be({videocard:_$1(),architecture:O(),deviceMemory:Ye.toString()||"undefined",jsHeapSizeLimit:tt.jsHeapSizeLimit||0})})}),i$4("locales",function(){return new Promise(function(Be){Be({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}),i$4("permissions",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){return k=(r$3==null?void 0:r$3.permissions_to_check)||["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],b$1().name.toLowerCase()==="safari"&&(k=k.filter(function(Ye){return!["camera","geolocation","microphone"].includes(Ye)})),Be=Array.from({length:(r$3==null?void 0:r$3.retries)||3},function(){return function(){return e$1(this,void 0,void 0,function(){var Ye,tt,nt,ft,ht;return n$1(this,function(gt){switch(gt.label){case 0:Ye={},tt=0,nt=k,gt.label=1;case 1:if(!(tt<nt.length))return[3,6];ft=nt[tt],gt.label=2;case 2:return gt.trys.push([2,4,,5]),[4,navigator.permissions.query({name:ft})];case 3:return ht=gt.sent(),Ye[ft]=ht.state.toString(),[3,5];case 4:return gt.sent(),[3,5];case 5:return tt++,[3,1];case 6:return[2,Ye]}})})}()}),[2,Promise.all(Be).then(function(Ye){return B(Ye,k)})]})})}),i$4("plugins",function(){var Be=[];if(navigator.plugins)for(var Le=0;Le<navigator.plugins.length;Le++){var Ye=navigator.plugins[Le];Be.push([Ye.name,Ye.filename,Ye.description].join("|"))}return new Promise(function(tt){tt({plugins:Be})})}),i$4("screen",function(){return new Promise(function(Be){Be({is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:D()})})}),i$4("system",function(){return new Promise(function(Be){var Le=b$1(),Ye={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:Le.name,version:Le.version}};Le.name.toLowerCase()!=="safari"&&(Ye.applePayVersion=function(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{for(var tt=window.ApplePaySession.supportsVersion,nt=15;nt>0;nt--)if(tt(nt))return nt}catch{return 0}return 0}(),Ye.cookieEnabled=window.navigator.cookieEnabled),Be(Ye)})});var U,N=b$1().name!=="SamsungBrowser"?1:3,F=null;i$4("webgl",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){typeof document<"u"&&((U=document.createElement("canvas")).width=200,U.height=100,F=U.getContext("webgl"));try{if(!F)throw new Error("WebGL not supported");return Be=Array.from({length:N},function(){return function(){try{if(!F)throw new Error("WebGL not supported");var Ye=`
67
67
  attribute vec2 position;
68
68
  void main() {
69
69
  gl_Position = vec4(position, 0.0, 1.0);
@@ -2945,7 +2945,7 @@ function print() { __p += __j.call(arguments, '') }
2945
2945
  * $script.js JS loader & dependency manager
2946
2946
  * https://github.com/ded/script.js
2947
2947
  * (c) Dustin Diaz 2014 | License MIT
2948
- */(function(Be){(function(Le,Ye){Be.exports?Be.exports=Ye():this[Le]=Ye()})("$script",function(){var Le=document,Ye=Le.getElementsByTagName("head")[0],tt=!1,nt="push",ft="readyState",ht="onreadystatechange",gt={},At={},xt={},Et,yt;function Ct(It,wt){for(var Rt=0,Tt=It.length;Rt<Tt;++Rt)if(!wt(It[Rt]))return tt;return 1}function kt(It,wt){Ct(It,function(Rt){return wt(Rt),1})}function vt(It,wt,Rt){It=It[nt]?It:[It];var Tt=wt&&wt.call,Bt=Tt?wt:Rt,Dt=Tt?It.join(""):wt,Pt=It.length;function Nt(Wt){return Wt.call?Wt():gt[Wt]}function Lt(){if(!--Pt){gt[Dt]=1,Bt&&Bt();for(var Wt in At)Ct(Wt.split("|"),Nt)&&!kt(At[Wt],Nt)&&(At[Wt]=[])}}return setTimeout(function(){kt(It,function Wt($t,Kt){if($t===null)return Lt();if(!Kt&&!/^https?:\/\//.test($t)&&Et&&($t=$t.indexOf(".js")===-1?Et+$t+".js":Et+$t),xt[$t])return xt[$t]==2?Lt():setTimeout(function(){Wt($t,!0)},0);xt[$t]=1,bt($t,Lt)})},0),vt}function bt(It,wt){var Rt=Le.createElement("script"),Tt;Rt.onload=Rt.onerror=Rt[ht]=function(){Rt[ft]&&!/^c|loade/.test(Rt[ft])||Tt||(Rt.onload=Rt[ht]=null,Tt=1,xt[It]=2,wt())},Rt.async=1,Rt.src=yt?It+(It.indexOf("?")===-1?"?":"&")+yt:It,Ye.insertBefore(Rt,Ye.lastChild)}return vt.get=bt,vt.order=function(It,wt,Rt){(function Tt(Bt){Bt=It.shift(),It.length?vt(Bt,Tt):vt(Bt,wt,Rt)})()},vt.path=function(It){Et=It},vt.urlArgs=function(It){yt=It},vt.ready=function(It,wt,Rt){It=It[nt]?It:[It];var Tt=[];return!kt(It,function(Bt){gt[Bt]||Tt[nt](Bt)})&&Ct(It,function(Bt){return gt[Bt]})?wt():function(Bt){At[Bt]=At[Bt]||[],At[Bt][nt](wt),Rt&&Rt(Tt)}(It.join("|")),vt},vt.done=function(It){vt([null],It)},vt})})(script);var scriptExports=script.exports;const scriptjs=getDefaultExportFromCjs(scriptExports),DEFAULT_SCRIPT_URL$2="https://static.opentok.com/v2/js/opentok.min.js";function preloadScript$6(Be){class Le extends React.Component{constructor(nt){super(nt);Nn(this,"onScriptLoad",()=>{this.isPresent&&this.setState({scriptLoaded:!0})});this.state={scriptLoaded:typeof OT<"u"},this.isPresent=!1}componentDidMount(){if(this.isPresent=!0,this.scriptLoading||this.state.scriptLoaded)return;this.scriptLoading=!0;const nt=this.props.opentokClientUrl;scriptjs(nt,this.onScriptLoad)}componentWillUnmount(){this.isPresent=!1}render(){const{opentokClientUrl:nt,loadingDelegate:ft,...ht}=this.props;return this.state.scriptLoaded?jsxRuntimeExports.jsx(Be,{...ht}):ft}}return Le.displayName=`preloadScript(${_default$e(Be)})`,Le.propTypes={opentokClientUrl:PropTypes.string,loadingDelegate:PropTypes.node},Le.defaultProps={opentokClientUrl:DEFAULT_SCRIPT_URL$2,loadingDelegate:jsxRuntimeExports.jsx("div",{})},Le}const eventModuleNames={selfie:"SELFIE",authFace:"AUTH_FACE",mlConsent:"ML_CONSENT",combinedConsent:"COMBINED_CONSENT",curpValidation:"CURP_VALIDATION",faceMatch:"FACE_MATCH",qr:"QR",videoSelfie:"VIDEO_ONBOARDING",passport:"ID",front:"ID",back:"ID",document:"DOCUMENT_CAPTURE",creditCard:"CREDIT_CARD_FRONT",creditCardBack:"CREDIT_CARD_BACK",conference:"CONFERENCE",otp:"OTP",signature:"SIGNATURE",ekyc:"EXTERNAL_VERIFICATION",globalWatchList:"GLOBAL_WATCHLIST",customWatchList:"CUSTOM_WATCHLIST",email:"EMAIL",phone:"PHONE",instantVerifyEmail:"INSTANT_VERIFY_EMAIL",instantVerifyConsent:"INSTANT_VERIFY_CONSENT",forms:"FORMS",customModule:"CUSTOM_MODULE"},eventScreenNames={faceMatch:"FACE_MATCH",faceCaptureTutorial:"SELFIE_CAPTURE_TUTORIAL",faceCaptureCamera:"SELFIE_CAMERA_CAPTURE",faceCaptureError:"SELFIE_ATTEMPT_FAILED",faceCaptureSuccess:"SELFIE_UPLOAD_SUCCEEDED",faceCaptureUpload:"SELFIE_UPLOAD_PROGRESS",mlConsent:"MACHINE_LEARNING_CONSENT",combinedConsent:"COMBINED_CONSENT",curpEnter:"ENTER_CURP",curpValidate:"VALIDATE_CURP",curpGenerate:"GENERATE_CURP",curpValidation:"CURP_VALIDATION_PROGRESS",curpValidationFailed:"CURP_VALIDATION_FAILED",curpValidationSuccess:"CURP_VALIDATION_SUCCEEDED",qrTutorial:"QR_TUTORIAL",qrScan:"QR_SCAN",smsOtp:"OTP",simpleOTP:"OTP",signatureInput:"SIGNATURE_INPUT",frontTutorial:"FRONT_ID_CAPTURE_TUTORIAL",frontCameraCapture:"FRONT_ID_CAMERA_CAPTURE",frontHelp:"FRONT_ID_HELP",frontReviewPhoto:"FRONT_ID_REVIEW_PHOTO",frontUploadProgress:"FRONT_ID_UPLOAD_PROGRESS",frontAttemptFailed:"FRONT_ID_ATTEMPT_FAILED",frontUploadSuccess:"FRONT_ID_UPLOAD_SUCCEEDED",backTutorial:"BACK_ID_CAPTURE_TUTORIAL",backCameraCapture:"BACK_ID_CAMERA_CAPTURE",backReviewPhoto:"BACK_ID_REVIEW_PHOTO",backUploadProgress:"BACK_ID_UPLOAD_PROGRESS",backAttemptFailed:"BACK_ID_ATTEMPT_FAILED",backUploadSuccess:"BACK_ID_UPLOAD_SUCCEEDED",backHelp:"BACK_ID_HELP",passportTutorial:"TUTORIAL_PASSPORT",documentTutorial:"DOCUMENT_CAPTURE_TUTORIAL",documentCameraCapture:"DOCUMENT_CAMERA_CAPTURE",documentHelp:"DOCUMENT_HELP",documentReviewPhoto:"DOCUMENT_REVIEW_PHOTO",documentUploadProgress:"DOCUMENT_UPLOAD_IN_PROGRESS",documentAttemptFailed:"DOCUMENT_ATTEMPT_FAILED",documentUploadSuccess:"DOCUMENT_UPLOAD_SUCCEEDED",conferenceWait:"CONFERENCE_WAIT",conferenceVideoChat:"CONFERENCE_VIDEO_CHAT",conferenceMessageChat:"CONFERENCE_MESSAGE_CHAT",videoSelfieTutorial:"VIDEO_SELFIE_TUTORIAL",videoSelfie:"VIDEO_SELFIE",videoSelfieFaceCapture:"VIDEO_SELFIE_FACE_CAPTURE",videoSelfieFaceUploadProgress:"VIDEO_SELFIE_FACE_UPLOAD_PROGRESS",videoSelfieFaceAttemptFailed:"VIDEO_SELFIE_FACE_ATTEMPT_FAILED",videoSelfieFaceUploadSucceeded:"VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED",videoSelfieFrontIdCapture:"VIDEO_SELFIE_FRONT_ID_CAPTURE",videoSelfieFrontIdUploadProgress:"VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS",videoSelfieFrontIdAttemptFailed:"VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED",videoSelfieFrontIdUploadSucceeded:"VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED",videoSelfieBackIdCapture:"VIDEO_SELFIE_BACK_ID_CAPTURE",videoSelfieBackIdUploadProgress:"VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS",videoSelfieBackIdAttemptFailed:"VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED",videoSelfieBackIdUploadSucceeded:"VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED",videoSelfieDocumentCapture:"VIDEO_SELFIE_DOCUMENT_CAPTURE",videoSelfieVoiceQuestion:"VIDEO_SELFIE_VOICE_QUESTION",videoSelfieVoiceFinalQuestion:"VIDEO_SELFIE_VOICE_FINAL_QUESTION",videoSelfieVideoUpload:"VIDEO SELFIE VIDEO UPLOAD",ekycInput:"EKYC_INPUT",ekycProgress:"EKYC_PROGRESS",ekycSucceeded:"EKYC_SUCCEEDED",ekycFailed:"EKYC_FAILED",forms:"FORMS",globalWatchListInput:"GLOBAL_WATCHLIST_INPUT",globalWatchListProgress:"GLOBAL_WATCHLIST_PROGRESS",globalWatchListSuccess:"GLOBAL_WATCHLIST_SUCCEEDED",globalWatchListFailed:"GLOBAL_WATCHLIST_FAILED",customWatchListInput:"CUSTOM_WATCHLIST_INPUT",customWatchListProgress:"CUSTOM_WATCHLIST_PROGRESS",customWatchListSuccess:"CUSTOM_WATCHLIST_SUCCEEDED",customWatchListFailed:"CUSTOM_WATCHLIST_FAILED",emailInput:"EMAIL_INPUT",phoneInput:"PHONE_INPUT",instantVerify:"INSTANT_VERIFY",authFace:"AUTH_FACE",authFaceError:"AUTH_FACE_ATTEMPT_FAILED",authFaceUpload:"AUTH_FACE_UPLOAD_PROGRESS",authFaceUploadSuccess:"AUTH_FACE_UPLOAD_SUCCEEDED",authFaceUploadFailed:"AUTH_FACE_UPLOAD_FAILED",customModuleCallback:"CUSTOM_MODULE_CALLBACK",customModuleProcessing:"CUSTOM_MODULE_PROCESSING",digitalIdFileSelection:"DIGITAL_ID_FILE_SELECTION",digitalIdFileReview:"DIGITAL_ID_FILE_REVIEW",digitalIdUploadProgress:"DIGITAL_ID_UPLOAD_PROGRESS",digitalIdUploadSuccess:"DIGITAL_ID_UPLOAD_SUCCEEDED",digitalIdUploadFailed:"DIGITAL_ID_UPLOAD_FAILED",digitalIdAnalysisProgress:"DIGITAL_ID_ANALYSIS_PROGRESS",digitalIdVerificationSuccess:"DIGITAL_ID_VERIFICATION_SUCCESS",digitalIdVerificationFailed:"DIGITAL_ID_VERIFICATION_FAILED"},streamingEvents={strSessionDidConnect:"strSessionDidConnect",strSessionDidDisconnect:"strSessionDidDisconnect",strSessionDidFailWithError:"strSessionDidFailWithError",strStreamVideoCaptureStart:"strStreamVideoCaptureStart",strStreamVideoCaptureStop:"strStreamVideoCaptureStop",strStreamPublisherCreated:"strStreamPublisherCreated",strStreamPublisherDestroyed:"strStreamPublisherDestroyed",strStreamPublisherDidFailWithError:"strStreamPublisherDidFailWithError"},videoSelfieEvents={imageTooBlurry:"imageTooBlurry",fillFrame:"fillFrame",checkCameraOrLighting:"checkCameraOrLighting",frontIdCaptureStarted:"frontIdCaptureStarted",lookAtCamera:"lookAtCamera",moveCloser:"moveCloser",lookingForFrontId:"lookingForFrontId",lookingForBackId:"lookingForBackId",cameraSwitchToBack:"cameraSwitchToBack",cameraSwitchToFront:"cameraSwitchToFront",audioStreamOpened:"audioStreamOpened",audioStreamClosed:"audioStreamClosed",videoSelfieVideoUploadInProgress:"videoSelfieVideoUploadInProgress",videoSelfieTosNotAccepted:"videoSelfieTosNotAccepted",videoSelfieTosAccepted:"videoSelfieTosAccepted",videoSelfieStreamCreated:"videoSelfieStreamCreated",videoSelfieStreamDestroyed:"videoSelfieStreamDestroyed",videoSelfieReconnecting:"videoSelfieReconnecting",videoSelfieReconnected:"videoSelfieReconnected"},tutorialScreenNamesMapper={passport:eventScreenNames.passportTutorial,front:eventScreenNames.frontTutorial,back:eventScreenNames.backTutorial,selfie:eventScreenNames.faceCaptureTutorial},cameraScreenNamesMapper={front:"front",back:"back",passport:"passport",creditCard:"front",creditCardBack:"back",document:"document"};function screenEvent({module:Be,payload:Le,token:Ye,screen:tt,code:nt}){try{addEvent({token:Ye,module:Be,code:nt,screen:tt,clientTimestamp:new Date().getTime(),payload:{...Le??{}}})}catch(ft){console.error(ft)}}function useScreenEvents({module:Be,screen:Le,payload:Ye={},token:tt}){React.useEffect(()=>(screenEvent({module:Be,payload:Ye,code:"screenOpened",token:tt,screen:Le}),()=>{screenEvent({module:Be,payload:Ye,code:"screenClosed",token:tt,screen:Le})}),[])}function useModuleEvents({module:Be,payload:Le={},token:Ye,screen:tt}){React.useLayoutEffect(()=>((async()=>{const ft=await getModuleFeatureFlags(Be);screenEvent({module:Be,screen:tt,payload:{...Le,...ft},code:"moduleOpened",token:Ye})})(),()=>{const ft=async()=>{const ht=await getModuleFeatureFlags(Be);screenEvent({module:Be,payload:{...Le,...ht},screen:tt,code:"moduleClosed",token:Ye})};setTimeout(()=>{ft()},0)}),[])}const addScreenEvent=({module:Be,token:Le,screen:Ye,payload:tt,shouldOpen:nt})=>{screenEvent({module:Be,payload:tt,token:Le,screen:Ye,code:nt?"screenOpened":"screenClosed"})};let options={darkMode:!1,hostingApp:"Web SDK",unsafeMode:!1,redirectFromUnsupportedBrowsers:!1,recorderProvider:"openVidu",useSha256:!1,maxContentWidth:800,maxContentHeight:840};const setOptions=Be=>(options={...options,...Be},options);var lib$1={},jsnlog={};(function(Be){var Le=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(nt,ft){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ht,gt){ht.__proto__=gt}||function(ht,gt){for(var At in gt)Object.prototype.hasOwnProperty.call(gt,At)&&(ht[At]=gt[At])},tt(nt,ft)};return function(nt,ft){tt(nt,ft);function ht(){this.constructor=nt}nt.prototype=ft===null?Object.create(ft):(ht.prototype=ft.prototype,new ht)}}();function Ye(tt){if(!tt)return Ye.__;Array.prototype.reduce||(Array.prototype.reduce=function(ht,gt){for(var At=gt,xt=0;xt<this.length;xt++)At=ht(At,this[xt],xt,this);return At});var nt="",ft=("."+tt).split(".").reduce(function(ht,gt,At,xt){nt?nt+="."+gt:nt=gt;var Et=ht["__"+nt];return Et===void 0&&(Ye.Logger.prototype=ht,Et=new Ye.Logger(nt),ht["__"+nt]=Et),Et},Ye.__);return ft}(function(tt){tt.requestId="",tt.entryId=0,tt._createXMLHttpRequest=function(){return new XMLHttpRequest},tt._getTime=function(){return new Date().getTime()},tt._console=console,tt._appenderNames=[];function nt(Qt,jt,Gt){if(jt[Qt]!==void 0){if(jt[Qt]===null){delete Gt[Qt];return}Gt[Qt]=jt[Qt]}}function ft(Qt){if(tt.enabled!=null&&!tt.enabled)return!1;try{if(Qt.userAgentRegex&&!new RegExp(Qt.userAgentRegex).test(navigator.userAgent))return!1}catch{}try{if(Qt.ipRegex&&tt.clientIP&&!new RegExp(Qt.ipRegex).test(tt.clientIP))return!1}catch{}return!0}function ht(Qt,jt){try{if(Qt.disallow&&new RegExp(Qt.disallow).test(jt))return!1}catch{}return!0}function gt(Qt){return typeof Qt=="function"?Qt instanceof RegExp?Qt.toString():Qt():Qt}var At=function(){function Qt(jt,Gt,qt){this.msg=jt,this.meta=Gt,this.finalString=qt}return Qt}();function xt(Qt){var jt=gt(Qt),Gt;switch(typeof jt){case"string":return new At(jt,null,jt);case"number":return Gt=jt.toString(),new At(Gt,null,Gt);case"boolean":return Gt=jt.toString(),new At(Gt,null,Gt);case"undefined":return new At("undefined",null,"undefined");case"object":return jt instanceof RegExp||jt instanceof String||jt instanceof Number||jt instanceof Boolean?(Gt=jt.toString(),new At(Gt,null,Gt)):(typeof tt.serialize=="function"?Gt=tt.serialize.call(this,jt):Gt=JSON.stringify(jt),new At("",jt,Gt));default:return new At("unknown",null,"unknown")}}function Et(Qt){return nt("enabled",Qt,this),nt("maxMessages",Qt,this),nt("defaultAjaxUrl",Qt,this),nt("clientIP",Qt,this),nt("requestId",Qt,this),nt("defaultBeforeSend",Qt,this),nt("serialize",Qt,this),this}tt.setOptions=Et;function yt(){return-2147483648}tt.getAllLevel=yt;function Ct(){return 1e3}tt.getTraceLevel=Ct;function kt(){return 2e3}tt.getDebugLevel=kt;function vt(){return 3e3}tt.getInfoLevel=vt;function bt(){return 4e3}tt.getWarnLevel=bt;function It(){return 5e3}tt.getErrorLevel=It;function wt(){return 6e3}tt.getFatalLevel=wt;function Rt(){return 2147483647}tt.getOffLevel=Rt;function Tt(Qt){return Qt<=1e3?"trace":Qt<=2e3?"debug":Qt<=3e3?"info":Qt<=4e3?"warn":Qt<=5e3?"error":"fatal"}var Bt=function(){function Qt(jt,Gt){this.inner=Gt,this.name="JL.Exception",this.message=xt(jt).finalString}return Qt}();tt.Exception=Bt,Bt.prototype=new Error;var Dt=function(){function Qt(jt,Gt,qt,zt,e0){this.l=jt,this.m=Gt,this.n=qt,this.t=zt,this.u=e0}return Qt}();tt.LogItem=Dt;function Pt(Qt,jt,Gt){return tt.entryId++,new Dt(Qt,jt,Gt,tt._getTime(),tt.entryId)}function Nt(Qt){Qt.id&&(clearTimeout(Qt.id),Qt.id=null)}function Lt(Qt,jt,Gt){var qt=this;Qt.id||(Qt.id=setTimeout(function(){Gt.call(qt)},jt))}var Wt=function(){function Qt(jt,Gt){this.appenderName=jt,this.sendLogItems=Gt,this.level=tt.getTraceLevel(),this.sendWithBufferLevel=2147483647,this.storeInBufferLevel=-2147483648,this.bufferSize=0,this.batchSize=1,this.maxBatchSize=20,this.batchTimeout=2147483647,this.sendTimeout=5e3,this.buffer=[],this.batchBuffer=[],this.batchTimeoutTimer={id:null},this.sendTimeoutTimer={id:null},this.nbrLogItemsSkipped=0,this.nbrLogItemsBeingSent=0;var qt="Trying to create an appender without a name or with an empty name";if(jt==null)throw qt;if(tt._appenderNames.indexOf(jt)!=-1)throw jt?"Multiple appenders use the same name "+jt:qt;tt._appenderNames.push(jt)}return Qt.prototype.addLogItemsToBuffer=function(jt){if(this.batchBuffer.length>=this.maxBatchSize){this.nbrLogItemsSkipped+=jt.length;return}if(tt.maxMessages!=null){if(tt.maxMessages<1)return;tt.maxMessages-=jt.length}this.batchBuffer=this.batchBuffer.concat(jt);var Gt=this;Lt(this.batchTimeoutTimer,this.batchTimeout,function(){Gt.sendBatch.call(Gt)})},Qt.prototype.batchBufferHasOverdueMessages=function(){for(var jt=0;jt<this.batchBuffer.length;jt++){var Gt=tt._getTime()-this.batchBuffer[jt].t;if(Gt>this.batchTimeout)return!0}return!1},Qt.prototype.batchBufferHasStrandedMessage=function(){return tt.maxMessages!=null&&tt.maxMessages<1&&this.batchBuffer.length>0},Qt.prototype.sendBatchIfComplete=function(){(this.batchBuffer.length>=this.batchSize||this.batchBufferHasOverdueMessages()||this.batchBufferHasStrandedMessage())&&this.sendBatch()},Qt.prototype.onSendingEnded=function(){Nt(this.sendTimeoutTimer),this.nbrLogItemsBeingSent=0,this.sendBatchIfComplete()},Qt.prototype.setOptions=function(jt){if(nt("level",jt,this),nt("ipRegex",jt,this),nt("userAgentRegex",jt,this),nt("disallow",jt,this),nt("sendWithBufferLevel",jt,this),nt("storeInBufferLevel",jt,this),nt("bufferSize",jt,this),nt("batchSize",jt,this),nt("maxBatchSize",jt,this),nt("batchTimeout",jt,this),nt("sendTimeout",jt,this),this.bufferSize<this.buffer.length&&(this.buffer.length=this.bufferSize),this.maxBatchSize<this.batchSize)throw new tt.Exception({message:"maxBatchSize cannot be smaller than batchSize",maxBatchSize:this.maxBatchSize,batchSize:this.batchSize});return this},Qt.prototype.log=function(jt,Gt,qt,zt,e0,s0,t0){var l0;if(ft(this)&&ht(this,s0)&&!(e0<this.storeInBufferLevel)){if(l0=Pt(e0,s0,t0),e0<this.level){this.bufferSize>0&&(this.buffer.push(l0),this.buffer.length>this.bufferSize&&this.buffer.shift());return}this.addLogItemsToBuffer([l0]),e0>=this.sendWithBufferLevel&&this.buffer.length&&(this.addLogItemsToBuffer(this.buffer),this.buffer.length=0),this.sendBatchIfComplete()}},Qt.prototype.sendBatch=function(){if(!(this.nbrLogItemsBeingSent>0)&&(Nt(this.batchTimeoutTimer),this.batchBuffer.length!=0)){this.nbrLogItemsBeingSent=this.batchBuffer.length;var jt=this;Lt(this.sendTimeoutTimer,this.sendTimeout,function(){jt.onSendingEnded.call(jt)}),this.sendLogItems(this.batchBuffer,function(){jt.batchBuffer.splice(0,jt.nbrLogItemsBeingSent),jt.nbrLogItemsSkipped>0&&(jt.batchBuffer.push(Pt(bt(),"Lost "+jt.nbrLogItemsSkipped+" messages. Either connection with the server was down or logging was disabled via the enabled option. Reduce lost messages by increasing the ajaxAppender option maxBatchSize.",jt.appenderName)),jt.nbrLogItemsSkipped=0),jt.onSendingEnded.call(jt)})}},Qt}();tt.Appender=Wt;var $t=function(Qt){Le(jt,Qt);function jt(Gt){return Qt.call(this,Gt,jt.prototype.sendLogItemsAjax)||this}return jt.prototype.setOptions=function(Gt){return nt("url",Gt,this),nt("beforeSend",Gt,this),Qt.prototype.setOptions.call(this,Gt),this},jt.prototype.sendLogItemsAjax=function(Gt,qt){try{if(!ft(this))return;this.xhr&&this.xhr.readyState!=0&&this.xhr.readyState!=4&&this.xhr.abort(),this.xhr=tt._createXMLHttpRequest();var zt="/jsnlog.logger";tt.defaultAjaxUrl!=null&&(zt=tt.defaultAjaxUrl),this.url&&(zt=this.url),this.xhr.open("POST",zt),this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("JSNLog-RequestId",tt.requestId);var e0=this;this.xhr.onreadystatechange=function(){e0.xhr.readyState==4&&e0.xhr.status>=200&&e0.xhr.status<300&&qt()};var s0={r:tt.requestId,lg:Gt};typeof this.beforeSend=="function"?this.beforeSend.call(this,this.xhr,s0):typeof tt.defaultBeforeSend=="function"&&tt.defaultBeforeSend.call(this,this.xhr,s0);var t0=JSON.stringify(s0);this.xhr.send(t0)}catch{}},jt}(Wt);tt.AjaxAppender=$t;var Kt=function(Qt){Le(jt,Qt);function jt(Gt){return Qt.call(this,Gt,jt.prototype.sendLogItemsConsole)||this}return jt.prototype.clog=function(Gt){tt._console.log(Gt)},jt.prototype.cerror=function(Gt){tt._console.error?tt._console.error(Gt):this.clog(Gt)},jt.prototype.cwarn=function(Gt){tt._console.warn?tt._console.warn(Gt):this.clog(Gt)},jt.prototype.cinfo=function(Gt){tt._console.info?tt._console.info(Gt):this.clog(Gt)},jt.prototype.cdebug=function(Gt){tt._console.debug?tt._console.debug(Gt):this.cinfo(Gt)},jt.prototype.sendLogItemsConsole=function(Gt,qt){try{if(!ft(this)||!tt._console)return;var zt;for(zt=0;zt<Gt.length;++zt){var e0=Gt[zt],s0=e0.n+": "+e0.m;typeof window>"u"&&(s0=new Date(e0.t)+" | "+s0),e0.l<=tt.getDebugLevel()?this.cdebug(s0):e0.l<=tt.getInfoLevel()?this.cinfo(s0):e0.l<=tt.getWarnLevel()?this.cwarn(s0):this.cerror(s0)}}catch{}qt()},jt}(Wt);tt.ConsoleAppender=Kt;var Vt=function(){function Qt(jt){this.loggerName=jt,this.seenRegexes=[]}return Qt.prototype.setOptions=function(jt){return nt("level",jt,this),nt("userAgentRegex",jt,this),nt("disallow",jt,this),nt("ipRegex",jt,this),nt("appenders",jt,this),nt("onceOnly",jt,this),this.seenRegexes=[],this},Qt.prototype.buildExceptionObject=function(jt){var Gt={};return jt.stack?Gt.stack=jt.stack:Gt.e=jt,jt.message&&(Gt.message=jt.message),jt.name&&(Gt.name=jt.name),jt.data&&(Gt.data=jt.data),jt.inner&&(Gt.inner=this.buildExceptionObject(jt.inner)),Gt},Qt.prototype.log=function(jt,Gt,qt){var zt=0,e0,s0;if(!this.appenders)return this;if(jt>=this.level&&ft(this)&&(qt?(s0=this.buildExceptionObject(qt),s0.logData=gt(Gt)):s0=Gt,e0=xt(s0),ht(this,e0.finalString))){if(this.onceOnly)for(zt=this.onceOnly.length-1;zt>=0;){if(new RegExp(this.onceOnly[zt]).test(e0.finalString)){if(this.seenRegexes[zt])return this;this.seenRegexes[zt]=!0}zt--}for(e0.meta=e0.meta||{},zt=this.appenders.length-1;zt>=0;)this.appenders[zt].log(Tt(jt),e0.msg,e0.meta,function(){},jt,e0.finalString,this.loggerName),zt--}return this},Qt.prototype.trace=function(jt){return this.log(Ct(),jt)},Qt.prototype.debug=function(jt){return this.log(kt(),jt)},Qt.prototype.info=function(jt){return this.log(vt(),jt)},Qt.prototype.warn=function(jt){return this.log(bt(),jt)},Qt.prototype.error=function(jt){return this.log(It(),jt)},Qt.prototype.fatal=function(jt){return this.log(wt(),jt)},Qt.prototype.fatalException=function(jt,Gt){return this.log(wt(),jt,Gt)},Qt}();tt.Logger=Vt;function Ut(Qt){return new $t(Qt)}tt.createAjaxAppender=Ut;function _t(Qt){return new Kt(Qt)}tt.createConsoleAppender=_t;var Xt;typeof window<"u"?Xt=new $t(""):Xt=new Kt(""),tt.__=new tt.Logger(""),tt.__.setOptions({level:tt.getDebugLevel(),appenders:[Xt]})})(Ye||(Ye={})),Be.__esModule=!0,Be.JL=Ye,typeof __jsnlog_configure=="function"&&__jsnlog_configure(Ye),typeof window<"u"&&!window.onerror&&(window.onerror=function(tt,nt,ft,ht,gt){return Ye("onerrorLogger").fatalException({msg:"Uncaught Exception",errorMsg:tt?tt.message||tt:"",url:nt,"line number":ft,column:ht},gt),!1}),typeof window<"u"&&!window.onunhandledrejection&&(window.onunhandledrejection=function(tt){Ye("onerrorLogger").fatalException({msg:"unhandledrejection",errorMsg:tt.reason?tt.reason.message:tt.message||null},tt.reason)})})(jsnlog);var OpenVidu$1={},LocalRecorder$1={},LocalRecorderState={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.LocalRecorderState=void 0,function(Le){Le.READY="READY",Le.RECORDING="RECORDING",Le.PAUSED="PAUSED",Le.FINISHED="FINISHED"}(Be.LocalRecorderState||(Be.LocalRecorderState={}))})(LocalRecorderState);var OpenViduLogger$1={},ConsoleLogger$1={};Object.defineProperty(ConsoleLogger$1,"__esModule",{value:!0}),ConsoleLogger$1.ConsoleLogger=void 0;var ConsoleLogger=function(){function Be(Le){this.logger=Le,this.log=Le.log,this.info=Le.info,this.debug=Le.debug,this.warn=Le.warn,this.error=Le.error}return Be}();ConsoleLogger$1.ConsoleLogger=ConsoleLogger;var OpenViduLoggerConfiguration={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.OpenViduLoggerConfiguration=void 0,function(Le){Le.disabled="disabled",Le.debug="debug",Le.debug_app="debug_app"}(Be.OpenViduLoggerConfiguration||(Be.OpenViduLoggerConfiguration={}))})(OpenViduLoggerConfiguration),Object.defineProperty(OpenViduLogger$1,"__esModule",{value:!0}),OpenViduLogger$1.OpenViduLogger=void 0;var jsnlog_1=jsnlog,ConsoleLogger_1=ConsoleLogger$1,OpenViduLoggerConfiguration_1$1=OpenViduLoggerConfiguration,OpenViduLogger=function(){function Be(){this.JSNLOG_URL="/openvidu/elk/openvidu-browser-logs",this.MAX_JSNLOG_BATCH_LOG_MESSAGES=100,this.MAX_MSECONDS_BATCH_MESSAGES=5e3,this.MAX_LENGTH_STRING_JSON=1e3,this.defaultConsoleLogger=new ConsoleLogger_1.ConsoleLogger(globalThis.console),this.isProdMode=!1,this.isJSNLogSetup=!1}return Be.configureJSNLog=function(Le,Ye){var tt=this;try{if(globalThis.LOG_JSNLOG_RESULTS||this.instance&&Le.isAtLeastPro&&this.instance.isOpenViduBrowserLogsDebugActive(Le)&&this.instance.canConfigureJSNLog(Le,this.instance)){Le.sendBrowserLogs===OpenViduLoggerConfiguration_1$1.OpenViduLoggerConfiguration.debug_app&&this.instance.replaceWindowConsole(),this.instance.isJSNLogSetup=!1,this.instance.info("Configuring JSNLogs.");var nt=Le.finalUserId,ft=Le.session.sessionId,ht=function(At){var xt=At.onreadystatechange;At.onreadystatechange=function(){tt.isInvalidResponse(At)&&(Object.defineProperty(At,"readyState",{value:4}),Object.defineProperty(At,"status",{value:200}),tt.instance.disableLogger()),xt()},At.setRequestHeader("Authorization","Basic "+btoa("".concat(nt,"%/%").concat(ft)+":"+Ye)),At.setRequestHeader("X-Requested-With","XMLHttpRequest"),At.setRequestHeader("OV-Final-User-Id",nt),At.setRequestHeader("OV-Session-Id",ft),At.setRequestHeader("OV-Token",Ye)};this.instance.currentAppender=jsnlog_1.JL.createAjaxAppender("appender-".concat(nt,"-").concat(ft)),this.instance.currentAppender.setOptions({beforeSend:ht,maxBatchSize:1e3,batchSize:this.instance.MAX_JSNLOG_BATCH_LOG_MESSAGES,batchTimeout:this.instance.MAX_MSECONDS_BATCH_MESSAGES});var gt=function(At){var xt=function(){var yt=new WeakSet;return function(Ct,kt){if(typeof kt=="object"&&kt!=null){if(yt.has(kt)||globalThis.HTMLElement&&kt instanceof HTMLElement)return;yt.add(kt)}return kt}},Et=JSON.stringify(At,xt());return Et.length>tt.instance.MAX_LENGTH_STRING_JSON&&(Et="".concat(Et.substring(0,tt.instance.MAX_LENGTH_STRING_JSON),"...")),globalThis.LOG_JSNLOG_RESULTS&&console.log(Et),Et};jsnlog_1.JL.setOptions({defaultAjaxUrl:Le.httpUri+this.instance.JSNLOG_URL,serialize:gt,enabled:!0}),(0,jsnlog_1.JL)().setOptions({appenders:[this.instance.currentAppender]}),this.instance.isJSNLogSetup=!0,this.instance.loggingSessionId=ft,this.instance.info("JSNLog configured.")}}catch(At){console.error("Error configuring JSNLog: "),console.error(At),this.instance.disableLogger()}},Be.getInstance=function(){return Be.instance||(Be.instance=new Be),Be.instance},Be.isInvalidResponse=function(Le){return Le.status==401||Le.status==403||Le.status==404||Le.status==0},Be.prototype.canConfigureJSNLog=function(Le,Ye){return Le.session.sessionId!=Ye.loggingSessionId},Be.prototype.isOpenViduBrowserLogsDebugActive=function(Le){return Le.sendBrowserLogs===OpenViduLoggerConfiguration_1$1.OpenViduLoggerConfiguration.debug||Le.sendBrowserLogs===OpenViduLoggerConfiguration_1$1.OpenViduLoggerConfiguration.debug_app},Be.prototype.getConsoleWithJSNLog=function(){return function(Le){return{log:function(){Le.defaultConsoleLogger.log.apply(Le.defaultConsoleLogger.logger,arguments),Le.isJSNLogSetup&&(0,jsnlog_1.JL)().info(arguments)},info:function(){Le.defaultConsoleLogger.info.apply(Le.defaultConsoleLogger.logger,arguments),Le.isJSNLogSetup&&(0,jsnlog_1.JL)().info(arguments)},debug:function(){Le.defaultConsoleLogger.debug.apply(Le.defaultConsoleLogger.logger,arguments)},warn:function(){Le.defaultConsoleLogger.warn.apply(Le.defaultConsoleLogger.logger,arguments),Le.isJSNLogSetup&&(0,jsnlog_1.JL)().warn(arguments)},error:function(){Le.defaultConsoleLogger.error.apply(Le.defaultConsoleLogger.logger,arguments),Le.isJSNLogSetup&&(0,jsnlog_1.JL)().error(arguments)}}}(this)},Be.prototype.replaceWindowConsole=function(){globalThis.console=this.defaultConsoleLogger.logger,globalThis.console.log=this.getConsoleWithJSNLog().log,globalThis.console.info=this.getConsoleWithJSNLog().info,globalThis.console.debug=this.getConsoleWithJSNLog().debug,globalThis.console.warn=this.getConsoleWithJSNLog().warn,globalThis.console.error=this.getConsoleWithJSNLog().error},Be.prototype.disableLogger=function(){jsnlog_1.JL.setOptions({enabled:!1}),this.isJSNLogSetup=!1,this.loggingSessionId=void 0,this.currentAppender=void 0,globalThis.console=this.defaultConsoleLogger.logger,globalThis.console.log=this.defaultConsoleLogger.log,globalThis.console.info=this.defaultConsoleLogger.info,globalThis.console.debug=this.defaultConsoleLogger.debug,globalThis.console.warn=this.defaultConsoleLogger.warn,globalThis.console.error=this.defaultConsoleLogger.error},Be.prototype.log=function(){this.isProdMode||this.defaultConsoleLogger.log.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,jsnlog_1.JL)().info(arguments)},Be.prototype.debug=function(){this.isProdMode||this.defaultConsoleLogger.debug.apply(this.defaultConsoleLogger.logger,arguments)},Be.prototype.info=function(){this.isProdMode||this.defaultConsoleLogger.info.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,jsnlog_1.JL)().info(arguments)},Be.prototype.warn=function(){this.defaultConsoleLogger.warn.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,jsnlog_1.JL)().warn(arguments)},Be.prototype.error=function(){this.defaultConsoleLogger.error.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,jsnlog_1.JL)().error(arguments)},Be.prototype.flush=function(){this.isJSNLogSetup&&this.currentAppender!=null&&this.currentAppender.sendBatch()},Be.prototype.enableProdMode=function(){this.isProdMode=!0},Be}();OpenViduLogger$1.OpenViduLogger=OpenViduLogger;var Platform={},platform$8={exports:{}};/*!
2948
+ */(function(Be){(function(Le,Ye){Be.exports?Be.exports=Ye():this[Le]=Ye()})("$script",function(){var Le=document,Ye=Le.getElementsByTagName("head")[0],tt=!1,nt="push",ft="readyState",ht="onreadystatechange",gt={},At={},xt={},Et,yt;function Ct(It,wt){for(var Rt=0,Tt=It.length;Rt<Tt;++Rt)if(!wt(It[Rt]))return tt;return 1}function kt(It,wt){Ct(It,function(Rt){return wt(Rt),1})}function vt(It,wt,Rt){It=It[nt]?It:[It];var Tt=wt&&wt.call,Bt=Tt?wt:Rt,Dt=Tt?It.join(""):wt,Pt=It.length;function Nt(Wt){return Wt.call?Wt():gt[Wt]}function Lt(){if(!--Pt){gt[Dt]=1,Bt&&Bt();for(var Wt in At)Ct(Wt.split("|"),Nt)&&!kt(At[Wt],Nt)&&(At[Wt]=[])}}return setTimeout(function(){kt(It,function Wt($t,Kt){if($t===null)return Lt();if(!Kt&&!/^https?:\/\//.test($t)&&Et&&($t=$t.indexOf(".js")===-1?Et+$t+".js":Et+$t),xt[$t])return xt[$t]==2?Lt():setTimeout(function(){Wt($t,!0)},0);xt[$t]=1,bt($t,Lt)})},0),vt}function bt(It,wt){var Rt=Le.createElement("script"),Tt;Rt.onload=Rt.onerror=Rt[ht]=function(){Rt[ft]&&!/^c|loade/.test(Rt[ft])||Tt||(Rt.onload=Rt[ht]=null,Tt=1,xt[It]=2,wt())},Rt.async=1,Rt.src=yt?It+(It.indexOf("?")===-1?"?":"&")+yt:It,Ye.insertBefore(Rt,Ye.lastChild)}return vt.get=bt,vt.order=function(It,wt,Rt){(function Tt(Bt){Bt=It.shift(),It.length?vt(Bt,Tt):vt(Bt,wt,Rt)})()},vt.path=function(It){Et=It},vt.urlArgs=function(It){yt=It},vt.ready=function(It,wt,Rt){It=It[nt]?It:[It];var Tt=[];return!kt(It,function(Bt){gt[Bt]||Tt[nt](Bt)})&&Ct(It,function(Bt){return gt[Bt]})?wt():function(Bt){At[Bt]=At[Bt]||[],At[Bt][nt](wt),Rt&&Rt(Tt)}(It.join("|")),vt},vt.done=function(It){vt([null],It)},vt})})(script);var scriptExports=script.exports;const scriptjs=getDefaultExportFromCjs(scriptExports),DEFAULT_SCRIPT_URL$2="https://static.opentok.com/v2/js/opentok.min.js";function preloadScript$6(Be){class Le extends React.Component{constructor(nt){super(nt);Nn(this,"onScriptLoad",()=>{this.isPresent&&this.setState({scriptLoaded:!0})});this.state={scriptLoaded:typeof OT<"u"},this.isPresent=!1}componentDidMount(){if(this.isPresent=!0,this.scriptLoading||this.state.scriptLoaded)return;this.scriptLoading=!0;const nt=this.props.opentokClientUrl;scriptjs(nt,this.onScriptLoad)}componentWillUnmount(){this.isPresent=!1}render(){const{opentokClientUrl:nt,loadingDelegate:ft,...ht}=this.props;return this.state.scriptLoaded?jsxRuntimeExports.jsx(Be,{...ht}):ft}}return Le.displayName=`preloadScript(${_default$e(Be)})`,Le.propTypes={opentokClientUrl:PropTypes.string,loadingDelegate:PropTypes.node},Le.defaultProps={opentokClientUrl:DEFAULT_SCRIPT_URL$2,loadingDelegate:jsxRuntimeExports.jsx("div",{})},Le}const getCustomFields=({token:Be})=>exports.api.get("/omni/get/custom-fields",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data)),getDeviceRiskModuleConfiguration=async Be=>exports.api.get("/omni/device-risk-client-id",{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(()=>({enabled:!1})),collectDeviceRiskResults=async Be=>exports.api.post("/omni/collect-device-risk-results",null,{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(()=>({})),shouldDoSardineContextFromSardine=Be=>Be===void 0?!1:typeof Be.SardineClientID=="string"&&typeof Be.SardineSessionKey=="string"&&typeof Be.SardineUserID=="string",loadSardineSDK=async Be=>{const Le=Be?"api.sandbox.sardine.ai":"api.sardine.ai",Ye=document.createElement("script");return Ye.type="text/javascript",Ye.async=!0,Ye.src=`https://${Le}/assets/loader.min.js`,new Promise(tt=>{Ye.onload=()=>tt();const nt=document.getElementsByTagName("script")[0];nt.parentNode.insertBefore(Ye,nt)})};let sardineContext=null;const getSardineContext=()=>sardineContext,createSardineContextFromSardine=({sardineClientId:Be,sardineSessionKey:Le,sardineUserId:Ye,isSandbox:tt,token:nt,interviewId:ft})=>window._Sardine.createContext({clientId:Be,sessionKey:ft,flow:`Landing page ${location.pathname}`,environment:tt?"sandbox":"production",parentElement:document.body,parentSessionKey:Le,userIdHash:Ye,onDeviceResponse(ht){addEvent({code:"externalRiskSDKInitialized",payload:{sardineData:{deviceId:ht.deviceId,uuid:ht.uuid},interviewId:ft,sardineClientId:Be,sardineSessionKey:Le,sardineUserId:Ye},token:nt})}}),createSardineContextIncode=({sardineClientId:Be,isSandbox:Le,token:Ye,interviewId:tt})=>window._Sardine.createContext({clientId:Be,sessionKey:tt,flow:`Landing page ${location.pathname}`,environment:"production",parentElement:document.body,userIdHash:tt,onDeviceResponse(nt){addEvent({code:"externalRiskSDKInitialized",payload:{sardineData:{deviceId:nt.deviceId,uuid:nt.uuid},interviewId:tt,sardineClientId:Be},token:Ye})}}),enableDeviceRiskModule=async({token:Be,isSandbox:Le=!0,interviewId:Ye})=>{const{customFields:tt}=await getCustomFields({token:Be}).catch(()=>({customFields:{SardineClientID:void 0,SardineSessionKey:void 0,SardineUserID:void 0}}));shouldDoSardineContextFromSardine(tt)&&(await loadSardineSDK(Le),sardineContext=createSardineContextFromSardine({sardineClientId:tt.SardineClientID,sardineSessionKey:tt.SardineSessionKey,sardineUserId:tt.SardineUserID,isSandbox:Le,token:Be,interviewId:Ye}));const nt=await getDeviceRiskModuleConfiguration(Be);return nt.enabled&&nt.riskClientId&&(await loadSardineSDK(!1),sardineContext=createSardineContextIncode({sardineClientId:nt.riskClientId,isSandbox:!1,token:Be,interviewId:Ye})),sardineContext},eventModuleNames={selfie:"SELFIE",authFace:"AUTH_FACE",mlConsent:"ML_CONSENT",combinedConsent:"COMBINED_CONSENT",curpValidation:"CURP_VALIDATION",faceMatch:"FACE_MATCH",qr:"QR",videoSelfie:"VIDEO_ONBOARDING",passport:"ID",front:"ID",back:"ID",document:"DOCUMENT_CAPTURE",creditCard:"CREDIT_CARD_FRONT",creditCardBack:"CREDIT_CARD_BACK",conference:"CONFERENCE",otp:"OTP",signature:"SIGNATURE",ekyc:"EXTERNAL_VERIFICATION",globalWatchList:"GLOBAL_WATCHLIST",customWatchList:"CUSTOM_WATCHLIST",email:"EMAIL",phone:"PHONE",instantVerifyEmail:"INSTANT_VERIFY_EMAIL",instantVerifyConsent:"INSTANT_VERIFY_CONSENT",forms:"FORMS",customModule:"CUSTOM_MODULE"},eventScreenNames={faceMatch:"FACE_MATCH",faceCaptureTutorial:"SELFIE_CAPTURE_TUTORIAL",faceCaptureCamera:"SELFIE_CAMERA_CAPTURE",faceCaptureError:"SELFIE_ATTEMPT_FAILED",faceCaptureSuccess:"SELFIE_UPLOAD_SUCCEEDED",faceCaptureUpload:"SELFIE_UPLOAD_PROGRESS",mlConsent:"MACHINE_LEARNING_CONSENT",combinedConsent:"COMBINED_CONSENT",curpEnter:"ENTER_CURP",curpValidate:"VALIDATE_CURP",curpGenerate:"GENERATE_CURP",curpValidation:"CURP_VALIDATION_PROGRESS",curpValidationFailed:"CURP_VALIDATION_FAILED",curpValidationSuccess:"CURP_VALIDATION_SUCCEEDED",qrTutorial:"QR_TUTORIAL",qrScan:"QR_SCAN",smsOtp:"OTP",simpleOTP:"OTP",signatureInput:"SIGNATURE_INPUT",frontTutorial:"FRONT_ID_CAPTURE_TUTORIAL",frontCameraCapture:"FRONT_ID_CAMERA_CAPTURE",frontHelp:"FRONT_ID_HELP",frontReviewPhoto:"FRONT_ID_REVIEW_PHOTO",frontUploadProgress:"FRONT_ID_UPLOAD_PROGRESS",frontAttemptFailed:"FRONT_ID_ATTEMPT_FAILED",frontUploadSuccess:"FRONT_ID_UPLOAD_SUCCEEDED",backTutorial:"BACK_ID_CAPTURE_TUTORIAL",backCameraCapture:"BACK_ID_CAMERA_CAPTURE",backReviewPhoto:"BACK_ID_REVIEW_PHOTO",backUploadProgress:"BACK_ID_UPLOAD_PROGRESS",backAttemptFailed:"BACK_ID_ATTEMPT_FAILED",backUploadSuccess:"BACK_ID_UPLOAD_SUCCEEDED",backHelp:"BACK_ID_HELP",passportTutorial:"TUTORIAL_PASSPORT",documentTutorial:"DOCUMENT_CAPTURE_TUTORIAL",documentCameraCapture:"DOCUMENT_CAMERA_CAPTURE",documentHelp:"DOCUMENT_HELP",documentReviewPhoto:"DOCUMENT_REVIEW_PHOTO",documentUploadProgress:"DOCUMENT_UPLOAD_IN_PROGRESS",documentAttemptFailed:"DOCUMENT_ATTEMPT_FAILED",documentUploadSuccess:"DOCUMENT_UPLOAD_SUCCEEDED",conferenceWait:"CONFERENCE_WAIT",conferenceVideoChat:"CONFERENCE_VIDEO_CHAT",conferenceMessageChat:"CONFERENCE_MESSAGE_CHAT",videoSelfieTutorial:"VIDEO_SELFIE_TUTORIAL",videoSelfie:"VIDEO_SELFIE",videoSelfieFaceCapture:"VIDEO_SELFIE_FACE_CAPTURE",videoSelfieFaceUploadProgress:"VIDEO_SELFIE_FACE_UPLOAD_PROGRESS",videoSelfieFaceAttemptFailed:"VIDEO_SELFIE_FACE_ATTEMPT_FAILED",videoSelfieFaceUploadSucceeded:"VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED",videoSelfieFrontIdCapture:"VIDEO_SELFIE_FRONT_ID_CAPTURE",videoSelfieFrontIdUploadProgress:"VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS",videoSelfieFrontIdAttemptFailed:"VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED",videoSelfieFrontIdUploadSucceeded:"VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED",videoSelfieBackIdCapture:"VIDEO_SELFIE_BACK_ID_CAPTURE",videoSelfieBackIdUploadProgress:"VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS",videoSelfieBackIdAttemptFailed:"VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED",videoSelfieBackIdUploadSucceeded:"VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED",videoSelfieDocumentCapture:"VIDEO_SELFIE_DOCUMENT_CAPTURE",videoSelfieVoiceQuestion:"VIDEO_SELFIE_VOICE_QUESTION",videoSelfieVoiceFinalQuestion:"VIDEO_SELFIE_VOICE_FINAL_QUESTION",videoSelfieVideoUpload:"VIDEO SELFIE VIDEO UPLOAD",ekycInput:"EKYC_INPUT",ekycProgress:"EKYC_PROGRESS",ekycSucceeded:"EKYC_SUCCEEDED",ekycFailed:"EKYC_FAILED",forms:"FORMS",globalWatchListInput:"GLOBAL_WATCHLIST_INPUT",globalWatchListProgress:"GLOBAL_WATCHLIST_PROGRESS",globalWatchListSuccess:"GLOBAL_WATCHLIST_SUCCEEDED",globalWatchListFailed:"GLOBAL_WATCHLIST_FAILED",customWatchListInput:"CUSTOM_WATCHLIST_INPUT",customWatchListProgress:"CUSTOM_WATCHLIST_PROGRESS",customWatchListSuccess:"CUSTOM_WATCHLIST_SUCCEEDED",customWatchListFailed:"CUSTOM_WATCHLIST_FAILED",emailInput:"EMAIL_INPUT",phoneInput:"PHONE_INPUT",instantVerify:"INSTANT_VERIFY",authFace:"AUTH_FACE",authFaceError:"AUTH_FACE_ATTEMPT_FAILED",authFaceUpload:"AUTH_FACE_UPLOAD_PROGRESS",authFaceUploadSuccess:"AUTH_FACE_UPLOAD_SUCCEEDED",authFaceUploadFailed:"AUTH_FACE_UPLOAD_FAILED",customModuleCallback:"CUSTOM_MODULE_CALLBACK",customModuleProcessing:"CUSTOM_MODULE_PROCESSING",digitalIdFileSelection:"DIGITAL_ID_FILE_SELECTION",digitalIdFileReview:"DIGITAL_ID_FILE_REVIEW",digitalIdUploadProgress:"DIGITAL_ID_UPLOAD_PROGRESS",digitalIdUploadSuccess:"DIGITAL_ID_UPLOAD_SUCCEEDED",digitalIdUploadFailed:"DIGITAL_ID_UPLOAD_FAILED",digitalIdAnalysisProgress:"DIGITAL_ID_ANALYSIS_PROGRESS",digitalIdVerificationSuccess:"DIGITAL_ID_VERIFICATION_SUCCESS",digitalIdVerificationFailed:"DIGITAL_ID_VERIFICATION_FAILED"},streamingEvents={strSessionDidConnect:"strSessionDidConnect",strSessionDidDisconnect:"strSessionDidDisconnect",strSessionDidFailWithError:"strSessionDidFailWithError",strStreamVideoCaptureStart:"strStreamVideoCaptureStart",strStreamVideoCaptureStop:"strStreamVideoCaptureStop",strStreamPublisherCreated:"strStreamPublisherCreated",strStreamPublisherDestroyed:"strStreamPublisherDestroyed",strStreamPublisherDidFailWithError:"strStreamPublisherDidFailWithError"},videoSelfieEvents={imageTooBlurry:"imageTooBlurry",fillFrame:"fillFrame",checkCameraOrLighting:"checkCameraOrLighting",frontIdCaptureStarted:"frontIdCaptureStarted",lookAtCamera:"lookAtCamera",moveCloser:"moveCloser",lookingForFrontId:"lookingForFrontId",lookingForBackId:"lookingForBackId",cameraSwitchToBack:"cameraSwitchToBack",cameraSwitchToFront:"cameraSwitchToFront",audioStreamOpened:"audioStreamOpened",audioStreamClosed:"audioStreamClosed",videoSelfieVideoUploadInProgress:"videoSelfieVideoUploadInProgress",videoSelfieTosNotAccepted:"videoSelfieTosNotAccepted",videoSelfieTosAccepted:"videoSelfieTosAccepted",videoSelfieStreamCreated:"videoSelfieStreamCreated",videoSelfieStreamDestroyed:"videoSelfieStreamDestroyed",videoSelfieReconnecting:"videoSelfieReconnecting",videoSelfieReconnected:"videoSelfieReconnected"},tutorialScreenNamesMapper={passport:eventScreenNames.passportTutorial,front:eventScreenNames.frontTutorial,back:eventScreenNames.backTutorial,selfie:eventScreenNames.faceCaptureTutorial},cameraScreenNamesMapper={front:"front",back:"back",passport:"passport",creditCard:"front",creditCardBack:"back",document:"document"};function screenEvent({module:Be,payload:Le,token:Ye,screen:tt,code:nt}){try{addEvent({token:Ye,module:Be,code:nt,screen:tt,clientTimestamp:new Date().getTime(),payload:{...Le??{}}})}catch(ft){console.error(ft)}}function useScreenEvents({module:Be,screen:Le,payload:Ye={},token:tt}){React.useEffect(()=>(screenEvent({module:Be,payload:Ye,code:"screenOpened",token:tt,screen:Le}),()=>{screenEvent({module:Be,payload:Ye,code:"screenClosed",token:tt,screen:Le})}),[])}function useModuleEvents({module:Be,payload:Le={},token:Ye,screen:tt}){React.useLayoutEffect(()=>{const nt=async()=>{const ht=await getModuleFeatureFlags(Be);screenEvent({module:Be,screen:tt,payload:{...Le,...ht},code:"moduleOpened",token:Ye})},ft=getSardineContext();return ft&&ft.updateConfig({flow:Be}),nt(),()=>{const ht=async()=>{const gt=await getModuleFeatureFlags(Be);screenEvent({module:Be,payload:{...Le,...gt},screen:tt,code:"moduleClosed",token:Ye})};setTimeout(()=>{ht()},0)}},[])}const addScreenEvent=({module:Be,token:Le,screen:Ye,payload:tt,shouldOpen:nt})=>{screenEvent({module:Be,payload:tt,token:Le,screen:Ye,code:nt?"screenOpened":"screenClosed"})};let options={darkMode:!1,hostingApp:"Web SDK",unsafeMode:!1,redirectFromUnsupportedBrowsers:!1,recorderProvider:"openVidu",useSha256:!1,maxContentWidth:800,maxContentHeight:840};const setOptions=Be=>(options={...options,...Be},options);var lib$1={},jsnlog={};(function(Be){var Le=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(nt,ft){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ht,gt){ht.__proto__=gt}||function(ht,gt){for(var At in gt)Object.prototype.hasOwnProperty.call(gt,At)&&(ht[At]=gt[At])},tt(nt,ft)};return function(nt,ft){tt(nt,ft);function ht(){this.constructor=nt}nt.prototype=ft===null?Object.create(ft):(ht.prototype=ft.prototype,new ht)}}();function Ye(tt){if(!tt)return Ye.__;Array.prototype.reduce||(Array.prototype.reduce=function(ht,gt){for(var At=gt,xt=0;xt<this.length;xt++)At=ht(At,this[xt],xt,this);return At});var nt="",ft=("."+tt).split(".").reduce(function(ht,gt,At,xt){nt?nt+="."+gt:nt=gt;var Et=ht["__"+nt];return Et===void 0&&(Ye.Logger.prototype=ht,Et=new Ye.Logger(nt),ht["__"+nt]=Et),Et},Ye.__);return ft}(function(tt){tt.requestId="",tt.entryId=0,tt._createXMLHttpRequest=function(){return new XMLHttpRequest},tt._getTime=function(){return new Date().getTime()},tt._console=console,tt._appenderNames=[];function nt(Qt,jt,Gt){if(jt[Qt]!==void 0){if(jt[Qt]===null){delete Gt[Qt];return}Gt[Qt]=jt[Qt]}}function ft(Qt){if(tt.enabled!=null&&!tt.enabled)return!1;try{if(Qt.userAgentRegex&&!new RegExp(Qt.userAgentRegex).test(navigator.userAgent))return!1}catch{}try{if(Qt.ipRegex&&tt.clientIP&&!new RegExp(Qt.ipRegex).test(tt.clientIP))return!1}catch{}return!0}function ht(Qt,jt){try{if(Qt.disallow&&new RegExp(Qt.disallow).test(jt))return!1}catch{}return!0}function gt(Qt){return typeof Qt=="function"?Qt instanceof RegExp?Qt.toString():Qt():Qt}var At=function(){function Qt(jt,Gt,qt){this.msg=jt,this.meta=Gt,this.finalString=qt}return Qt}();function xt(Qt){var jt=gt(Qt),Gt;switch(typeof jt){case"string":return new At(jt,null,jt);case"number":return Gt=jt.toString(),new At(Gt,null,Gt);case"boolean":return Gt=jt.toString(),new At(Gt,null,Gt);case"undefined":return new At("undefined",null,"undefined");case"object":return jt instanceof RegExp||jt instanceof String||jt instanceof Number||jt instanceof Boolean?(Gt=jt.toString(),new At(Gt,null,Gt)):(typeof tt.serialize=="function"?Gt=tt.serialize.call(this,jt):Gt=JSON.stringify(jt),new At("",jt,Gt));default:return new At("unknown",null,"unknown")}}function Et(Qt){return nt("enabled",Qt,this),nt("maxMessages",Qt,this),nt("defaultAjaxUrl",Qt,this),nt("clientIP",Qt,this),nt("requestId",Qt,this),nt("defaultBeforeSend",Qt,this),nt("serialize",Qt,this),this}tt.setOptions=Et;function yt(){return-2147483648}tt.getAllLevel=yt;function Ct(){return 1e3}tt.getTraceLevel=Ct;function kt(){return 2e3}tt.getDebugLevel=kt;function vt(){return 3e3}tt.getInfoLevel=vt;function bt(){return 4e3}tt.getWarnLevel=bt;function It(){return 5e3}tt.getErrorLevel=It;function wt(){return 6e3}tt.getFatalLevel=wt;function Rt(){return 2147483647}tt.getOffLevel=Rt;function Tt(Qt){return Qt<=1e3?"trace":Qt<=2e3?"debug":Qt<=3e3?"info":Qt<=4e3?"warn":Qt<=5e3?"error":"fatal"}var Bt=function(){function Qt(jt,Gt){this.inner=Gt,this.name="JL.Exception",this.message=xt(jt).finalString}return Qt}();tt.Exception=Bt,Bt.prototype=new Error;var Dt=function(){function Qt(jt,Gt,qt,zt,e0){this.l=jt,this.m=Gt,this.n=qt,this.t=zt,this.u=e0}return Qt}();tt.LogItem=Dt;function Pt(Qt,jt,Gt){return tt.entryId++,new Dt(Qt,jt,Gt,tt._getTime(),tt.entryId)}function Nt(Qt){Qt.id&&(clearTimeout(Qt.id),Qt.id=null)}function Lt(Qt,jt,Gt){var qt=this;Qt.id||(Qt.id=setTimeout(function(){Gt.call(qt)},jt))}var Wt=function(){function Qt(jt,Gt){this.appenderName=jt,this.sendLogItems=Gt,this.level=tt.getTraceLevel(),this.sendWithBufferLevel=2147483647,this.storeInBufferLevel=-2147483648,this.bufferSize=0,this.batchSize=1,this.maxBatchSize=20,this.batchTimeout=2147483647,this.sendTimeout=5e3,this.buffer=[],this.batchBuffer=[],this.batchTimeoutTimer={id:null},this.sendTimeoutTimer={id:null},this.nbrLogItemsSkipped=0,this.nbrLogItemsBeingSent=0;var qt="Trying to create an appender without a name or with an empty name";if(jt==null)throw qt;if(tt._appenderNames.indexOf(jt)!=-1)throw jt?"Multiple appenders use the same name "+jt:qt;tt._appenderNames.push(jt)}return Qt.prototype.addLogItemsToBuffer=function(jt){if(this.batchBuffer.length>=this.maxBatchSize){this.nbrLogItemsSkipped+=jt.length;return}if(tt.maxMessages!=null){if(tt.maxMessages<1)return;tt.maxMessages-=jt.length}this.batchBuffer=this.batchBuffer.concat(jt);var Gt=this;Lt(this.batchTimeoutTimer,this.batchTimeout,function(){Gt.sendBatch.call(Gt)})},Qt.prototype.batchBufferHasOverdueMessages=function(){for(var jt=0;jt<this.batchBuffer.length;jt++){var Gt=tt._getTime()-this.batchBuffer[jt].t;if(Gt>this.batchTimeout)return!0}return!1},Qt.prototype.batchBufferHasStrandedMessage=function(){return tt.maxMessages!=null&&tt.maxMessages<1&&this.batchBuffer.length>0},Qt.prototype.sendBatchIfComplete=function(){(this.batchBuffer.length>=this.batchSize||this.batchBufferHasOverdueMessages()||this.batchBufferHasStrandedMessage())&&this.sendBatch()},Qt.prototype.onSendingEnded=function(){Nt(this.sendTimeoutTimer),this.nbrLogItemsBeingSent=0,this.sendBatchIfComplete()},Qt.prototype.setOptions=function(jt){if(nt("level",jt,this),nt("ipRegex",jt,this),nt("userAgentRegex",jt,this),nt("disallow",jt,this),nt("sendWithBufferLevel",jt,this),nt("storeInBufferLevel",jt,this),nt("bufferSize",jt,this),nt("batchSize",jt,this),nt("maxBatchSize",jt,this),nt("batchTimeout",jt,this),nt("sendTimeout",jt,this),this.bufferSize<this.buffer.length&&(this.buffer.length=this.bufferSize),this.maxBatchSize<this.batchSize)throw new tt.Exception({message:"maxBatchSize cannot be smaller than batchSize",maxBatchSize:this.maxBatchSize,batchSize:this.batchSize});return this},Qt.prototype.log=function(jt,Gt,qt,zt,e0,s0,t0){var l0;if(ft(this)&&ht(this,s0)&&!(e0<this.storeInBufferLevel)){if(l0=Pt(e0,s0,t0),e0<this.level){this.bufferSize>0&&(this.buffer.push(l0),this.buffer.length>this.bufferSize&&this.buffer.shift());return}this.addLogItemsToBuffer([l0]),e0>=this.sendWithBufferLevel&&this.buffer.length&&(this.addLogItemsToBuffer(this.buffer),this.buffer.length=0),this.sendBatchIfComplete()}},Qt.prototype.sendBatch=function(){if(!(this.nbrLogItemsBeingSent>0)&&(Nt(this.batchTimeoutTimer),this.batchBuffer.length!=0)){this.nbrLogItemsBeingSent=this.batchBuffer.length;var jt=this;Lt(this.sendTimeoutTimer,this.sendTimeout,function(){jt.onSendingEnded.call(jt)}),this.sendLogItems(this.batchBuffer,function(){jt.batchBuffer.splice(0,jt.nbrLogItemsBeingSent),jt.nbrLogItemsSkipped>0&&(jt.batchBuffer.push(Pt(bt(),"Lost "+jt.nbrLogItemsSkipped+" messages. Either connection with the server was down or logging was disabled via the enabled option. Reduce lost messages by increasing the ajaxAppender option maxBatchSize.",jt.appenderName)),jt.nbrLogItemsSkipped=0),jt.onSendingEnded.call(jt)})}},Qt}();tt.Appender=Wt;var $t=function(Qt){Le(jt,Qt);function jt(Gt){return Qt.call(this,Gt,jt.prototype.sendLogItemsAjax)||this}return jt.prototype.setOptions=function(Gt){return nt("url",Gt,this),nt("beforeSend",Gt,this),Qt.prototype.setOptions.call(this,Gt),this},jt.prototype.sendLogItemsAjax=function(Gt,qt){try{if(!ft(this))return;this.xhr&&this.xhr.readyState!=0&&this.xhr.readyState!=4&&this.xhr.abort(),this.xhr=tt._createXMLHttpRequest();var zt="/jsnlog.logger";tt.defaultAjaxUrl!=null&&(zt=tt.defaultAjaxUrl),this.url&&(zt=this.url),this.xhr.open("POST",zt),this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("JSNLog-RequestId",tt.requestId);var e0=this;this.xhr.onreadystatechange=function(){e0.xhr.readyState==4&&e0.xhr.status>=200&&e0.xhr.status<300&&qt()};var s0={r:tt.requestId,lg:Gt};typeof this.beforeSend=="function"?this.beforeSend.call(this,this.xhr,s0):typeof tt.defaultBeforeSend=="function"&&tt.defaultBeforeSend.call(this,this.xhr,s0);var t0=JSON.stringify(s0);this.xhr.send(t0)}catch{}},jt}(Wt);tt.AjaxAppender=$t;var Kt=function(Qt){Le(jt,Qt);function jt(Gt){return Qt.call(this,Gt,jt.prototype.sendLogItemsConsole)||this}return jt.prototype.clog=function(Gt){tt._console.log(Gt)},jt.prototype.cerror=function(Gt){tt._console.error?tt._console.error(Gt):this.clog(Gt)},jt.prototype.cwarn=function(Gt){tt._console.warn?tt._console.warn(Gt):this.clog(Gt)},jt.prototype.cinfo=function(Gt){tt._console.info?tt._console.info(Gt):this.clog(Gt)},jt.prototype.cdebug=function(Gt){tt._console.debug?tt._console.debug(Gt):this.cinfo(Gt)},jt.prototype.sendLogItemsConsole=function(Gt,qt){try{if(!ft(this)||!tt._console)return;var zt;for(zt=0;zt<Gt.length;++zt){var e0=Gt[zt],s0=e0.n+": "+e0.m;typeof window>"u"&&(s0=new Date(e0.t)+" | "+s0),e0.l<=tt.getDebugLevel()?this.cdebug(s0):e0.l<=tt.getInfoLevel()?this.cinfo(s0):e0.l<=tt.getWarnLevel()?this.cwarn(s0):this.cerror(s0)}}catch{}qt()},jt}(Wt);tt.ConsoleAppender=Kt;var Vt=function(){function Qt(jt){this.loggerName=jt,this.seenRegexes=[]}return Qt.prototype.setOptions=function(jt){return nt("level",jt,this),nt("userAgentRegex",jt,this),nt("disallow",jt,this),nt("ipRegex",jt,this),nt("appenders",jt,this),nt("onceOnly",jt,this),this.seenRegexes=[],this},Qt.prototype.buildExceptionObject=function(jt){var Gt={};return jt.stack?Gt.stack=jt.stack:Gt.e=jt,jt.message&&(Gt.message=jt.message),jt.name&&(Gt.name=jt.name),jt.data&&(Gt.data=jt.data),jt.inner&&(Gt.inner=this.buildExceptionObject(jt.inner)),Gt},Qt.prototype.log=function(jt,Gt,qt){var zt=0,e0,s0;if(!this.appenders)return this;if(jt>=this.level&&ft(this)&&(qt?(s0=this.buildExceptionObject(qt),s0.logData=gt(Gt)):s0=Gt,e0=xt(s0),ht(this,e0.finalString))){if(this.onceOnly)for(zt=this.onceOnly.length-1;zt>=0;){if(new RegExp(this.onceOnly[zt]).test(e0.finalString)){if(this.seenRegexes[zt])return this;this.seenRegexes[zt]=!0}zt--}for(e0.meta=e0.meta||{},zt=this.appenders.length-1;zt>=0;)this.appenders[zt].log(Tt(jt),e0.msg,e0.meta,function(){},jt,e0.finalString,this.loggerName),zt--}return this},Qt.prototype.trace=function(jt){return this.log(Ct(),jt)},Qt.prototype.debug=function(jt){return this.log(kt(),jt)},Qt.prototype.info=function(jt){return this.log(vt(),jt)},Qt.prototype.warn=function(jt){return this.log(bt(),jt)},Qt.prototype.error=function(jt){return this.log(It(),jt)},Qt.prototype.fatal=function(jt){return this.log(wt(),jt)},Qt.prototype.fatalException=function(jt,Gt){return this.log(wt(),jt,Gt)},Qt}();tt.Logger=Vt;function Ut(Qt){return new $t(Qt)}tt.createAjaxAppender=Ut;function _t(Qt){return new Kt(Qt)}tt.createConsoleAppender=_t;var Xt;typeof window<"u"?Xt=new $t(""):Xt=new Kt(""),tt.__=new tt.Logger(""),tt.__.setOptions({level:tt.getDebugLevel(),appenders:[Xt]})})(Ye||(Ye={})),Be.__esModule=!0,Be.JL=Ye,typeof __jsnlog_configure=="function"&&__jsnlog_configure(Ye),typeof window<"u"&&!window.onerror&&(window.onerror=function(tt,nt,ft,ht,gt){return Ye("onerrorLogger").fatalException({msg:"Uncaught Exception",errorMsg:tt?tt.message||tt:"",url:nt,"line number":ft,column:ht},gt),!1}),typeof window<"u"&&!window.onunhandledrejection&&(window.onunhandledrejection=function(tt){Ye("onerrorLogger").fatalException({msg:"unhandledrejection",errorMsg:tt.reason?tt.reason.message:tt.message||null},tt.reason)})})(jsnlog);var OpenVidu$1={},LocalRecorder$1={},LocalRecorderState={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.LocalRecorderState=void 0,function(Le){Le.READY="READY",Le.RECORDING="RECORDING",Le.PAUSED="PAUSED",Le.FINISHED="FINISHED"}(Be.LocalRecorderState||(Be.LocalRecorderState={}))})(LocalRecorderState);var OpenViduLogger$1={},ConsoleLogger$1={};Object.defineProperty(ConsoleLogger$1,"__esModule",{value:!0}),ConsoleLogger$1.ConsoleLogger=void 0;var ConsoleLogger=function(){function Be(Le){this.logger=Le,this.log=Le.log,this.info=Le.info,this.debug=Le.debug,this.warn=Le.warn,this.error=Le.error}return Be}();ConsoleLogger$1.ConsoleLogger=ConsoleLogger;var OpenViduLoggerConfiguration={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.OpenViduLoggerConfiguration=void 0,function(Le){Le.disabled="disabled",Le.debug="debug",Le.debug_app="debug_app"}(Be.OpenViduLoggerConfiguration||(Be.OpenViduLoggerConfiguration={}))})(OpenViduLoggerConfiguration),Object.defineProperty(OpenViduLogger$1,"__esModule",{value:!0}),OpenViduLogger$1.OpenViduLogger=void 0;var jsnlog_1=jsnlog,ConsoleLogger_1=ConsoleLogger$1,OpenViduLoggerConfiguration_1$1=OpenViduLoggerConfiguration,OpenViduLogger=function(){function Be(){this.JSNLOG_URL="/openvidu/elk/openvidu-browser-logs",this.MAX_JSNLOG_BATCH_LOG_MESSAGES=100,this.MAX_MSECONDS_BATCH_MESSAGES=5e3,this.MAX_LENGTH_STRING_JSON=1e3,this.defaultConsoleLogger=new ConsoleLogger_1.ConsoleLogger(globalThis.console),this.isProdMode=!1,this.isJSNLogSetup=!1}return Be.configureJSNLog=function(Le,Ye){var tt=this;try{if(globalThis.LOG_JSNLOG_RESULTS||this.instance&&Le.isAtLeastPro&&this.instance.isOpenViduBrowserLogsDebugActive(Le)&&this.instance.canConfigureJSNLog(Le,this.instance)){Le.sendBrowserLogs===OpenViduLoggerConfiguration_1$1.OpenViduLoggerConfiguration.debug_app&&this.instance.replaceWindowConsole(),this.instance.isJSNLogSetup=!1,this.instance.info("Configuring JSNLogs.");var nt=Le.finalUserId,ft=Le.session.sessionId,ht=function(At){var xt=At.onreadystatechange;At.onreadystatechange=function(){tt.isInvalidResponse(At)&&(Object.defineProperty(At,"readyState",{value:4}),Object.defineProperty(At,"status",{value:200}),tt.instance.disableLogger()),xt()},At.setRequestHeader("Authorization","Basic "+btoa("".concat(nt,"%/%").concat(ft)+":"+Ye)),At.setRequestHeader("X-Requested-With","XMLHttpRequest"),At.setRequestHeader("OV-Final-User-Id",nt),At.setRequestHeader("OV-Session-Id",ft),At.setRequestHeader("OV-Token",Ye)};this.instance.currentAppender=jsnlog_1.JL.createAjaxAppender("appender-".concat(nt,"-").concat(ft)),this.instance.currentAppender.setOptions({beforeSend:ht,maxBatchSize:1e3,batchSize:this.instance.MAX_JSNLOG_BATCH_LOG_MESSAGES,batchTimeout:this.instance.MAX_MSECONDS_BATCH_MESSAGES});var gt=function(At){var xt=function(){var yt=new WeakSet;return function(Ct,kt){if(typeof kt=="object"&&kt!=null){if(yt.has(kt)||globalThis.HTMLElement&&kt instanceof HTMLElement)return;yt.add(kt)}return kt}},Et=JSON.stringify(At,xt());return Et.length>tt.instance.MAX_LENGTH_STRING_JSON&&(Et="".concat(Et.substring(0,tt.instance.MAX_LENGTH_STRING_JSON),"...")),globalThis.LOG_JSNLOG_RESULTS&&console.log(Et),Et};jsnlog_1.JL.setOptions({defaultAjaxUrl:Le.httpUri+this.instance.JSNLOG_URL,serialize:gt,enabled:!0}),(0,jsnlog_1.JL)().setOptions({appenders:[this.instance.currentAppender]}),this.instance.isJSNLogSetup=!0,this.instance.loggingSessionId=ft,this.instance.info("JSNLog configured.")}}catch(At){console.error("Error configuring JSNLog: "),console.error(At),this.instance.disableLogger()}},Be.getInstance=function(){return Be.instance||(Be.instance=new Be),Be.instance},Be.isInvalidResponse=function(Le){return Le.status==401||Le.status==403||Le.status==404||Le.status==0},Be.prototype.canConfigureJSNLog=function(Le,Ye){return Le.session.sessionId!=Ye.loggingSessionId},Be.prototype.isOpenViduBrowserLogsDebugActive=function(Le){return Le.sendBrowserLogs===OpenViduLoggerConfiguration_1$1.OpenViduLoggerConfiguration.debug||Le.sendBrowserLogs===OpenViduLoggerConfiguration_1$1.OpenViduLoggerConfiguration.debug_app},Be.prototype.getConsoleWithJSNLog=function(){return function(Le){return{log:function(){Le.defaultConsoleLogger.log.apply(Le.defaultConsoleLogger.logger,arguments),Le.isJSNLogSetup&&(0,jsnlog_1.JL)().info(arguments)},info:function(){Le.defaultConsoleLogger.info.apply(Le.defaultConsoleLogger.logger,arguments),Le.isJSNLogSetup&&(0,jsnlog_1.JL)().info(arguments)},debug:function(){Le.defaultConsoleLogger.debug.apply(Le.defaultConsoleLogger.logger,arguments)},warn:function(){Le.defaultConsoleLogger.warn.apply(Le.defaultConsoleLogger.logger,arguments),Le.isJSNLogSetup&&(0,jsnlog_1.JL)().warn(arguments)},error:function(){Le.defaultConsoleLogger.error.apply(Le.defaultConsoleLogger.logger,arguments),Le.isJSNLogSetup&&(0,jsnlog_1.JL)().error(arguments)}}}(this)},Be.prototype.replaceWindowConsole=function(){globalThis.console=this.defaultConsoleLogger.logger,globalThis.console.log=this.getConsoleWithJSNLog().log,globalThis.console.info=this.getConsoleWithJSNLog().info,globalThis.console.debug=this.getConsoleWithJSNLog().debug,globalThis.console.warn=this.getConsoleWithJSNLog().warn,globalThis.console.error=this.getConsoleWithJSNLog().error},Be.prototype.disableLogger=function(){jsnlog_1.JL.setOptions({enabled:!1}),this.isJSNLogSetup=!1,this.loggingSessionId=void 0,this.currentAppender=void 0,globalThis.console=this.defaultConsoleLogger.logger,globalThis.console.log=this.defaultConsoleLogger.log,globalThis.console.info=this.defaultConsoleLogger.info,globalThis.console.debug=this.defaultConsoleLogger.debug,globalThis.console.warn=this.defaultConsoleLogger.warn,globalThis.console.error=this.defaultConsoleLogger.error},Be.prototype.log=function(){this.isProdMode||this.defaultConsoleLogger.log.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,jsnlog_1.JL)().info(arguments)},Be.prototype.debug=function(){this.isProdMode||this.defaultConsoleLogger.debug.apply(this.defaultConsoleLogger.logger,arguments)},Be.prototype.info=function(){this.isProdMode||this.defaultConsoleLogger.info.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,jsnlog_1.JL)().info(arguments)},Be.prototype.warn=function(){this.defaultConsoleLogger.warn.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,jsnlog_1.JL)().warn(arguments)},Be.prototype.error=function(){this.defaultConsoleLogger.error.apply(this.defaultConsoleLogger.logger,arguments),this.isJSNLogSetup&&(0,jsnlog_1.JL)().error(arguments)},Be.prototype.flush=function(){this.isJSNLogSetup&&this.currentAppender!=null&&this.currentAppender.sendBatch()},Be.prototype.enableProdMode=function(){this.isProdMode=!0},Be}();OpenViduLogger$1.OpenViduLogger=OpenViduLogger;var Platform={},platform$8={exports:{}};/*!
2949
2949
  * Platform.js v1.3.6
2950
2950
  * Copyright 2014-2020 Benjamin Tan
2951
2951
  * Copyright 2011-2013 John-David Dalton
@@ -3716,7 +3716,7 @@ linearGradient:first-of-type {
3716
3716
  stop-color: ${({$color:Be})=>Be};
3717
3717
  }
3718
3718
  }
3719
- `,BaseTutorial=({title:Be,subtitle:Le,animationData:Ye,onContinue:tt,buttonText:nt,uiConfig:ft,disclaimerText:ht,onClose:gt,isLoading:At=!1})=>{var yt,Ct,kt,vt,bt,It,wt,Rt,Tt,Bt,Dt,Pt,Nt;const{t:xt}=useTranslation$1(),Et=useTokens();return jsxRuntimeExports.jsx(Page$1,{title:Be,subtitle:Le,closeButton:{show:(yt=ft==null?void 0:ft.closeButton)==null?void 0:yt.show,position:(Ct=ft==null?void 0:ft.closeButton)==null?void 0:Ct.position,offset:(kt=ft==null?void 0:ft.closeButton)==null?void 0:kt.offset,onClose:gt},hideHeaderBranding:(vt=ft==null?void 0:ft.branding)==null?void 0:vt.hideHeaderBranding,...(It=(bt=ft==null?void 0:ft.branding)==null?void 0:bt.logo)!=null&&It.src||(Rt=(wt=ft==null?void 0:ft.branding)==null?void 0:wt.logo)!=null&&Rt.height?{logo:{src:(Bt=(Tt=ft==null?void 0:ft.branding)==null?void 0:Tt.logo)==null?void 0:Bt.src,height:(Pt=(Dt=ft==null?void 0:ft.branding)==null?void 0:Dt.logo)==null?void 0:Pt.height}}:{},hideFooterBranding:(Nt=ft==null?void 0:ft.branding)==null?void 0:Nt.hideFooterBranding,"data-testid":"base-tutorial-container",children:jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",flex:1,children:[jsxRuntimeExports.jsx(LottieContainer,{hFull:!0,xsH:"250px",$color:Et.color.surface.primary[500],px:6,xsPx:0,maxW:"400px",m:"auto",children:jsxRuntimeExports.jsx(Lottie,{animationData:replaceLottieColor(Ye,Et.color.surface.primary[500]),loop:!0,autoplay:!0,style:{height:"100%"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text$7,{fontSize:Et.typography.fontSize.lg,textAlign:"center",color:Et.color.text.body.secondary,lineHeight:"114%",fontWeight:500,letterSpacing:"-0.5px",py:3,children:ht||xt("idv2.tutorial.autoCapture")}),jsxRuntimeExports.jsx(Box,{px:2,py:4,children:jsxRuntimeExports.jsx(Button$b,{onClick:tt,"data-testid":"tutorial-continue-button",isLoading:At,children:nt||xt("idv2.tutorial.startScan")})})]})]})})},fr$7=60,v$7="5.9.6",ip$7=0,op$7=239,w$7=296,h$8=296,nm$7="selfietuto",ddd$7=0,markers$7=[],assets$7=[{nm:"faceloop",fr:60,id:"m256ex281vb8hdk2ys3",layers:[{ty:3,ddd:0,ind:4,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:5,hd:!1,nm:"faceloop - Null",sr:1,parent:4,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:6,hd:!1,nm:"faceloop - Shape Mask",sr:1,parent:5,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[.01,0],[295.99,0],[296,.01],[296,295.99],[295.99,296],[.01,296],[0,295.99],[0,.01],[.01,0],[.01,0]],i:[[0,0],[0,0],[0,-.0055],[0,0],[.0055,0],[0,0],[0,.0055],[0,0],[-.0055,0],[0,0]],o:[[0,0],[.005519999999989977,0],[0,0],[0,.005519999999989977],[0,0],[-.00552,0],[0,0],[0,-.00552],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:[0,1,0,1]},nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]}]},{nm:"selfiescan2",fr:60,id:"m256ews56opa1de42ut",layers:[{ty:3,ddd:0,ind:7,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:8,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:7,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:9,hd:!1,nm:"selfietuto - Shape Mask",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[.01,0],[295.99,0],[296,.01],[296,295.99],[295.99,296],[.01,296],[0,295.99],[0,.01],[.01,0],[.01,0]],i:[[0,0],[0,0],[0,-.0055],[0,0],[.0055,0],[0,0],[0,.0055],[0,0],[-.0055,0],[0,0]],o:[[0,0],[.005519999999989977,0],[0,0],[0,.005519999999989977],[0,0],[-.00552,0],[0,0],[0,-.00552],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:[0,1,0,1]},nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]}]},{nm:"Group 39567",fr:60,id:"m256ewscxedd0m9wt7o",layers:[{ty:3,ddd:0,ind:10,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:11,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:10,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:12,hd:!1,nm:"Group 39567 - Null",sr:1,parent:11,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ddd:0,ind:13,ty:0,nm:"selfiescan2",td:1,refId:"m256ews56opa1de42ut",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0},{ty:4,ddd:0,ind:14,hd:!1,nm:"selfietuto - Shape Mask",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[.01,0],[295.99,0],[296,.01],[296,295.99],[295.99,296],[.01,296],[0,295.99],[0,.01],[.01,0],[.01,0]],i:[[0,0],[0,0],[0,-.0055],[0,0],[.0055,0],[0,0],[0,.0055],[0,0],[-.0055,0],[0,0]],o:[[0,0],[.005519999999989977,0],[0,0],[0,.005519999999989977],[0,0],[-.00552,0],[0,0],[0,-.00552],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:[0,1,0,1]},nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}],tt:1}]},{nm:"User 07a",fr:60,id:"m256ewtth2xv0t9qlhe",layers:[{ty:3,ddd:0,ind:15,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:16,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:15,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:17,hd:!1,nm:"Group 39567 - Null",sr:1,parent:16,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:18,hd:!1,nm:"User 07a - Null",sr:1,parent:17,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ddd:0,ind:19,ty:0,nm:"Group 39567",td:1,refId:"m256ewscxedd0m9wt7o",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0},{ty:4,ddd:0,ind:20,hd:!1,nm:"User 07a - Shape Mask",sr:1,parent:18,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[.01,0],[324.5782,0],[324.5882,.01],[324.5882,324.5782],[324.5782,324.5882],[.01,324.5882],[0,324.5782],[0,.01],[.01,0],[.01,0]],i:[[0,0],[0,0],[0,-.0055],[0,0],[.0055,0],[0,0],[0,.0055],[0,0],[-.0055,0],[0,0]],o:[[0,0],[.005519999999989977,0],[0,0],[0,.005519999999989977],[0,0],[-.00552,0],[0,0],[0,-.00552],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:[0,1,0,1]},nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}],tt:1}]},{nm:"faceloop",fr:60,id:"m6p6j2c0qs37vm69",layers:[{ty:3,ddd:0,ind:61,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:62,hd:!1,nm:"faceloop - Null",sr:1,parent:61,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:23,hd:!1,nm:"Ellipse 191 (Stroke) - Null",sr:1,parent:62,ks:{a:{a:0,k:[148,148]},o:{a:0,k:100},p:{a:0,k:[148,148]},r:{a:1,k:[{t:0,s:[0],o:{x:[0],y:[0]},i:{x:[1],y:[1]}},{t:120,s:[360],o:{x:[0],y:[0]},i:{x:[1],y:[1]}},{t:240,s:[720]}]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:24,hd:!1,nm:"Ellipse 191 (Stroke)",sr:1,parent:23,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:4,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[148,287],[287,148],[148,9],[9,148],[148,287],[148,287]],i:[[0,0],[0,76.7676],[76.7676,0],[0,-76.7676],[-76.7676,0],[0,0]],o:[[76.76758000000001,0],[0,-76.76758],[-76.76758,0],[0,76.76758000000001],[0,0],[0,0]]}}},{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[148,296],[296,148],[148,0],[0,148],[148,296],[148,296]],i:[[0,0],[0,81.7381],[81.7381,0],[0,-81.7381],[-81.7381,0],[0,0]],o:[[81.73813999999999,0],[0,-81.73814],[-81.73814,0],[0,81.73813999999999],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:2,k:{a:0,k:[0,0,.47843137254901963,1,1,0,.47843137254901963,1,0,1,1,0]}},s:{a:0,k:[24.51807347262285,30.75903457240274]},e:{a:0,k:[217.54216853549255,256.7710909118675]},t:1,nm:"Fill",hd:!1,r:2},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]}]},{nm:"User 07a",fr:60,id:"m6p6j2c85ejf13b5",layers:[{ty:3,ddd:0,ind:52,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:53,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:52,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:54,hd:!1,nm:"Group 39567 - Null",sr:1,parent:53,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:55,hd:!1,nm:"User 07a - Null",sr:1,parent:54,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:29,hd:!1,nm:"Ellipse 148 - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[108.8158,52.1611]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:30,hd:!1,nm:"Ellipse 148",sr:1,parent:29,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[107.2565,76.6782],[53.6282,152.0111],[-1e-4,76.6782],[53.6282,0],[107.2565,76.6782],[107.2565,76.6782]],i:[[0,0],[23.5084,0],[0,41.6052],[-50.6702,0],[0,-37.926],[0,0]],o:[[0,41.60524000000001],[-25.71208,0],[0,-37.06891],[50.67023,0],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:2,k:{a:0,k:[0,.8784313725490196,.8784313725490196,.8784313725490196,1,1,1,1]}},s:{a:0,k:[6.591940610097922,75.2952207378632]},e:{a:0,k:[82.34462772765323,75.58141690773564]},t:1,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:31,hd:!1,nm:"Vector 14 - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[224.0092,121.5657]},r:{a:0,k:174.0696},s:{a:0,k:[99.62,-100.33000000000001]},sk:{a:0,k:-1.81},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:32,hd:!1,nm:"Vector 14",sr:1,parent:31,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[3.8354,2.7538],[14.3511,5.0967],[14.3511,33.9922],[8.4362,37.8555],[.8778,19.154],[3.8354,2.7538],[3.8354,2.7538]],i:[[0,0],[-1.6431,-3.254],[0,0],[3.9434,0],[.6572,5.0763],[-5.5865,7.4191],[0,0]],o:[[4.46918,-5.9353],[0,0],[-.3285499999999999,2.4730399999999975],[-4.92925,0],[-.65723,-5.07625],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:3,k:{a:0,k:[.0417,.7098039215686275,.7098039215686275,.7098039215686275,.3625,.8862745098039215,.8862745098039215,.8862745098039215,1,1,1,1]}},s:{a:0,k:[12.895270234498375,18.505816655260606]},e:{a:0,k:[3.4748756395564944,19.465401775061935]},t:1,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:33,hd:!1,nm:"Vector 13 - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[98.7625,119.8784]},r:{a:0,k:-5.3845},s:{a:0,k:[99.65,100.29999999999998]},sk:{a:0,k:1.81},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:34,hd:!1,nm:"Vector 13",sr:1,parent:33,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[3.8354,2.7538],[14.3511,5.0967],[14.3511,33.9922],[8.4362,37.8555],[.8778,19.154],[3.8354,2.7538],[3.8354,2.7538]],i:[[0,0],[-1.6431,-3.254],[0,0],[3.9434,0],[.6572,5.0763],[-5.5865,7.4191],[0,0]],o:[[4.469190000000001,-5.9353],[0,0],[-.3285499999999999,2.4730399999999975],[-4.92925,0],[-.65723,-5.07625],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:3,k:{a:0,k:[.1719,.7411764705882353,.7411764705882353,.7411764705882353,.6406,.8823529411764706,.8823529411764706,.8823529411764706,1,.8666666666666667,.8666666666666667,.8666666666666667]}},s:{a:0,k:[12.895270234498375,18.505816655260606]},e:{a:0,k:[3.4748756395564944,19.465401775061935]},t:1,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:35,hd:!1,nm:"Intersect - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[73.3813,221.1284]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:36,hd:!1,nm:"Intersect",sr:1,parent:35,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[176.9562,14.2579],[88.3045,51.5579],[-1e-4,14.6114],[42.8361,.0076],[86.6769,22.2946],[134.9533,0],[176.9562,14.2579],[176.9562,14.2579]],i:[[0,0],[34.738,0],[22.4871,22.8082],[0,0],[-18.981,-.4651],[-6.5668,12.3875],[-21.0564,-8.5561],[0,0]],o:[[-22.511949999999985,23.015520000000002],[-34.55984,0],[21.33035,-8.74771],[6.316929999999999,11.41202],[20.596860000000007,.5046900000000001],[0,0],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:"replaceColorWithYours"},nm:"Fill",hd:!1,r:2},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:37,hd:!1,nm:"Combined Shape - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[102.6816,130.9973]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:38,hd:!1,nm:"Combined Shape",sr:1,parent:37,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[24.9287,73.4874],[24.9287,73.954],[0,96.2222],[59.6122,122.2049],[119.2244,96.2222],[94.2957,73.9204],[94.3261,29.8559],[94.3261,29.6156],[94.4854,16.542],[24.8205,30.9221],[24.9289,73.4874],[24.9287,73.4874]],i:[[0,0],[0,0],[16.4905,-4.9742],[-19.8704,0],[-19.8704,14.4345],[.2406,9.8879],[-.0173,3.7526],[1.0839,.301],[-.0737,16.8942],[-1.039,-46.389],[-.0661,-5.3568],[0,0]],o:[[0,0],[-.1286200000000015,9.871259999999992],[19.87036,14.434470000000005],[19.870360000000005,0],[-16.378529999999998,-4.980019999999996],[0,-3.7526299999999964],[1.1846599999999938,.16672000000000153],[.03252000000000521,-12.36235],[.07370000000000232,-16.89435],[.014089999999999492,4.729930000000003],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:2,k:{a:0,k:[0,.6941176470588235,.6941176470588235,.6941176470588235,1,1,1,1]}},s:{a:0,k:[54.32503300089149,33.74278237295727]},e:{a:0,k:[54.32503300089149,91.15401515450041]},t:1,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:39,hd:!1,nm:"Intersect - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[37.686,24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:40,hd:!1,nm:"Intersect",sr:1,parent:39,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[124,248],[248,124],[124,0],[0,124],[124,248],[124,248]],i:[[0,0],[0,68.4833],[68.4833,0],[0,-68.4833],[-68.4833,0],[0,0]],o:[[68.48331000000002,0],[0,-68.48331],[-68.48331,0],[0,68.48331000000002],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:7.000000000000001},c:{a:0,k:[0,.47843137254901963,1,1]},nm:"Fill",hd:!1,r:2},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]}]},{nm:"[FRAME] selfietuto - Null / selfiescan2 - Null / Ellipse 194 - Null / Ellipse 194 / selfietuto - Null / selfiescan2 - Null / Group 39567 - Null / selfietuto - Null / selfiescan2 - Null / Group 39567 - Null / User 07a - Null / selfietuto - Null / selfiescan2 - Null / Group 39567 - Null / User 07a - Null / User 07a / User 07a",fr:60,id:"m6p6j2c5c0l7uggl",layers:[{ty:3,ddd:0,ind:41,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:42,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:41,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:43,hd:!1,nm:"Ellipse 194 - Null",sr:1,parent:42,ks:{a:{a:0,k:[20,20]},o:{a:1,k:[{t:40.2,s:[0],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:57.599999999999994,s:[100],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:94.2,s:[0],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:110.4,s:[100],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:144.60000000000002,s:[0]}]},p:{a:1,k:[{t:40.2,s:[1,124],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]},ti:[0,0],to:[0,0]},{t:94.2,s:[244,124],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]},ti:[0,0],to:[0,0]},{t:144.60000000000002,s:[1,124]}]},r:{a:0,k:0},s:{a:1,k:[{t:40.2,s:[150,288],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:57.599999999999994,s:[150,622],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:94.2,s:[150,231.99999999999997],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:110.4,s:[150,666],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:144.60000000000002,s:[150,288]}]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:44,hd:!1,nm:"Ellipse 194",sr:1,parent:43,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:1,k:[{t:40.2,s:[0],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:57.599999999999994,s:[100],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:94.2,s:[0],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:110.4,s:[100],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:144.60000000000002,s:[0]}]}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[40,20],[20,40],[0,20],[20,0],[40,20],[40,20]],i:[[0,0],[11.046,0],[0,11.046],[-11.046,0],[0,-11.046],[0,0]],o:[[0,11.046],[-11.046,0],[0,-11.046],[11.046,0],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:6,k:{a:0,k:[0,1,1,1,.115,1,1,1,.2094,1,1,1,.7074,1,1,1,.8664,1,1,1,1,1,1,1,0,1,.115,1,.2094,.88,.7074,.23,.8664,.08,1,0]}},s:{a:0,k:[20.000004461093873,19.209036763697355]},e:{a:0,k:[20.000004461093873,.875419492625209]},t:2,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:45,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:46,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:45,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:47,hd:!1,nm:"Group 39567 - Null",sr:1,parent:46,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:48,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:49,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:48,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:50,hd:!1,nm:"Group 39567 - Null",sr:1,parent:49,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:51,hd:!1,nm:"User 07a - Null",sr:1,parent:50,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:52,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:53,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:52,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:54,hd:!1,nm:"Group 39567 - Null",sr:1,parent:53,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:55,hd:!1,nm:"User 07a - Null",sr:1,parent:54,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ddd:0,ind:56,ty:0,nm:"User 07a",td:1,refId:"m256ewtth2xv0t9qlhe",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0},{ddd:0,ind:57,ty:0,nm:"User 07a",refId:"m6p6j2c85ejf13b5",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0,tt:1}]},{nm:"[FRAME] selfietuto - Null / selfietuto - Null / faceloop - Null / selfietuto - Null / faceloop - Null / faceloop / faceloop / selfiescan2",fr:60,id:"m6p6j2bzg8qe07hm",layers:[{ty:3,ddd:0,ind:58,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:59,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:60,hd:!1,nm:"faceloop - Null",sr:1,parent:59,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:61,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:62,hd:!1,nm:"faceloop - Null",sr:1,parent:61,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ddd:0,ind:63,ty:0,nm:"faceloop",td:1,refId:"m256ex281vb8hdk2ys3",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0},{ddd:0,ind:64,ty:0,nm:"faceloop",refId:"m6p6j2c0qs37vm69",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0,tt:1},{ddd:0,ind:65,ty:0,nm:"selfiescan2",refId:"m6p6j2c5c0l7uggl",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0}]}],layers$7=[{ddd:0,ind:1,ty:0,nm:"selfietuto",refId:"m6p6j2bzg8qe07hm",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0}],meta$2={a:"",d:"",tc:"",g:"Aninix"},tutorialAnimationJson$2={fr:fr$7,v:v$7,ip:ip$7,op:op$7,w:w$7,h:h$8,nm:nm$7,ddd:ddd$7,markers:markers$7,assets:assets$7,layers:layers$7,meta:meta$2},defaultFlow$1={name:"",checkTutorials:!0,checkAuthorization:!0,redirectDesktopToMobile:!1,disableUnsupportedBrowserScreen:!1,qrPhishingResistance:!1,addContinueToDesktop:!1,redirectOriginOnly:!1,displayOnboardingResultOnDesktop:!1,enableMultipleOnboardings:!1,disableLaunchScreen:!1,disableSmsOption:!1,mergeSessionRecordings:!1,mandatoryConsentCheck:!0,enableSardineRisk:!1,flowModules:[{key:"PHONE",configuration:{otpVerification:!1,otpExpirationInMinutes:10,prefill:!1}},{key:"GEOLOCATION",configuration:{allowUserToSkipGeolocation:!1}},{key:"ID",configuration:{showTutorial:!0,enableId:!0,enablePassport:!0,onlyFront:!1,onlyBack:!1,barcodeCapture:!1,fetchAdditionalPage:!1,secondId:!1,thirdId:!1,autoCaptureTimeout:18,deviceIdleTimeout:60,captureAttempts:3,manualUploadIdCapture:!1,showDocumentChooserScreen:!0,enableIdRecording:!0,perCountryPerDocOverrides:{}}},{key:"ADDRESS",configuration:{disableSkipPoa:!1,title:"",text:""}},{key:"ID_OCR",configuration:{editableOcr:!1}},{key:"SELFIE",configuration:{showTutorial:!0,showPreview:!1,assistedOnboarding:!1,enableFaceRecording:!0,autoCaptureTimeout:20,captureAttempts:3,validateLenses:!0,validateFaceMask:!0,validateHeadCover:!0,validateClosedEyes:!0,validateBrightness:!0,deepsightLiveness:"SINGLE_FRAME"}},{key:"FACE_MATCH",configuration:{matchingType:"selfieVsId",disableFaceMatchAnimation:!1}},{key:"SIGNATURE",configuration:{title:"",subTitle:""}},{key:"VIDEO_ONBOARDING",configuration:{useAsSelfie:!1,showTutorials:!0,companyName:"",checkLiveness:!0,checkIdScan:!0,checkDocumentScan:!0,compareIdEnabled:!0,compareOcrEnabled:!1,compareBackIdEnabled:!1,compareBackOcrEnabled:!1,checkVoiceConsent:!0,voiceConsentQuestions:0,selfieQualityAffectsScore:!1,maxWaitingVideoSelfieFile:0,lastSecondsVideoQualityCheck:!1,lastSecondsVideoQualityCheckDuration:0}}]};function normalizeFlowModules(Be){const Le=Be.flatMap((ft,ht,gt)=>{if(ft.key==="TUTORIAL_ID"){const xt=ft.configuration,yt=[{key:"ID",configuration:xt}];return xt.secondId&&yt.push({key:"SECOND_ID",configuration:xt}),xt.thirdId&&yt.push({key:"THIRD_ID",configuration:xt}),yt}const At=gt[ht-1];return ft.key==="ID"&&(At==null?void 0:At.key)==="TUTORIAL_ID"?[]:[ft]}),Ye=ft=>ft,tt=ft=>ft.filter(ht=>ht.key!=="SELFIE");return(Le.some(ft=>ft.key==="VIDEO_ONBOARDING"&&ft.configuration.useAsSelfie===!0)?tt:Ye)(Le)}function handleResponse(Be){const Le=Be.data,Ye=normalizeFlowModules(Le.flowModules);return Le&&localStorage.setItem("ds",Le.ds?"1":"0"),{...Le,flowModules:Ye}}async function getFlow$1(Be){var Le;try{const Ye=await exports.api.get("/omni/onboarding/flow",{headers:{"X-Incode-Hardware-Id":Be}});return handleResponse(Ye)}catch(Ye){if(isAxiosError(Ye)&&((Le=Ye.response)==null?void 0:Le.status)===400)return defaultFlow$1;throw Ye}}const mergeUiConfig=(Be,Le)=>{var tt,nt;const Ye=getTokensFromDashboardTheme(Le);return{...Be,branding:{logo:Le.logo?{src:Le.logo,height:"100%"}:(tt=Be==null?void 0:Be.branding)==null?void 0:tt.logo,...Be==null?void 0:Be.branding},theming:{...Be==null?void 0:Be.theming,designTokens:{...Ye,...(nt=Be==null?void 0:Be.theming)==null?void 0:nt.designTokens}}}};var FlowType=(Be=>(Be.ID="ID",Be.FACE="Face",Be))(FlowType||{});class AbstractFlowManager{constructor(Le){this.subscribers=[],this.flow=null,this.sessionToken=null,this.captureConfig=null,this.captureConfiguration=null,this.parentSize={width:window.innerWidth,height:window.innerHeight},this.uiConfig=null;const Ye={currentStep:null,isLoading:!1,attempts:0,errorDetails:null,successData:null,flowOutcome:"pending",sessionToken:null,...Le};this.initialState=Object.freeze({...Ye}),this.state={...this.initialState}}async isPermissionsEnabled(){return navigator.permissions?(await navigator.permissions.query({name:"camera"})).state==="granted":!1}subscribe(Le){return this.subscribers.push(Le),Le(this.getState()),()=>{this.subscribers=this.subscribers.filter(Ye=>Ye!==Le)}}notifySubscribers(){const Le=this.getState();this.subscribers.forEach(Ye=>Ye(Le))}setState(Le){this.state={...this.state,...Le},this.notifySubscribers()}getState(){return{...this.state}}getToken(){return this.sessionToken}getParentSize(){return this.parentSize}incrementAttempts(){this.setState({attempts:this.state.attempts+1})}resetAttempts(){this.setState({attempts:0})}canRetry(){return this.state.attempts<this.getMaxAttempts()}getAttemptsLeft(){return Math.max(0,this.getMaxAttempts()-this.state.attempts)}async initialize(Le){var tt,nt;if(this.setState({isLoading:!0,errorDetails:null,flowOutcome:"pending",attempts:0,successData:null,sessionToken:Le.sessionToken}),this.parentSize=(tt=Le.parentSize)!=null&&tt.width&&((nt=Le.parentSize)!=null&&nt.height)?Le.parentSize:this.parentSize,this.sessionToken=Le.sessionToken,this.sessionToken&&Le.uiConfig){const ft=await getTheme(this.sessionToken);this.uiConfig=mergeUiConfig(Le.uiConfig,ft)}if(Le.captureConfig)this.captureConfig=Le.captureConfig;else try{this.flow=await this.fetchFlowConfiguration(this.sessionToken)}catch(ft){console.error("Failed to initialize FlowManager:",ft),this.setState({errorDetails:{message:"Failed to initialize FlowManager",error:ft,code:"FETCH_FLOW_ERROR"},isLoading:!1,flowOutcome:"error",currentStep:"error"});return}this.captureConfiguration=this.getCaptureConfiguration();const Ye=await this.determineInitialStep(this.captureConfiguration);this.setState({currentStep:Ye,isLoading:!1})}reset(){this.state={...this.initialState},this.flow=null,this.sessionToken=null,this.captureConfiguration=null,this.captureConfig=null,this.setState(this.state)}fetchFlowConfiguration(Le){return getFlow$1(Le)}getFlow(){return this.flow}onClose(Le){onboardingAnalytics.update(),MlWasmJSApi$1.reset(),this.completeWithError({code:"USER_CANCELLED",message:`User cancelled the ${Le} capture flow`,error:new Error("User cancelled")})}}class FaceFlowManager extends AbstractFlowManager{constructor(){super({currentStep:null}),this.deepsightVideoRecorder=null,this.mediaRecorder=null,this.authHint=null,this.isAuth=!1,this.shouldShowTutorialInCapture=!1,this.captureOnly=!1,this.onCapture=null}setRecorders(){this.getCaptureConfiguration().isDeepsightEnabled?this.deepsightVideoRecorder=new DeepsightVideoRecorder:this.getCaptureConfiguration().isRecordingEnabled&&(this.mediaRecorder=new MediaRecorder$3({token:this.sessionToken,type:"selfie",isAuthRecording:!1}))}async initialize(Le){this.authHint=Le.authHint,this.isAuth=Le.isAuth,this.captureOnly=Le.captureOnly??!1,this.onCapture=Le.onCapture??null,this.uiConfig=Le.uiConfig??null,await super.initialize(Le),this.setRecorders()}async determineInitialStep(Le){return await this.isPermissionsEnabled()?(this.shouldShowTutorialInCapture=Le.showTutorial,"capture"):Le.showTutorial?"tutorial":"permissions"}getMaxAttempts(){var Le;return((Le=this.captureConfiguration)==null?void 0:Le.selfieCaptureAttempts)||3}goToCapture(){this.setState({currentStep:"capture"})}goToPermissions(){this.setState({currentStep:"permissions"})}goToRetries(){this.setState({currentStep:"retries"})}async completeFlow(Le){this.setState({successData:Le,flowOutcome:"success",currentStep:"success"})}reset(){this.setState({currentStep:null,successData:null,errorDetails:null,flowOutcome:null})}completeWithError(Le){this.setState({flowOutcome:"error",currentStep:"error",errorDetails:Le})}setParentSize(Le){this.parentSize=Le}getCaptureConfiguration(){return this.isAuth?{...this.getAuthConfiguration(),isRecordingEnabled:!1,showPreview:!1,assistedOnboarding:!1,mergeSessionRecordings:!1,ageAssurance:!1,skipProcessFace:!0}:this.getFaceCaptureConfiguration()}getAuthConfiguration(){var tt;const Le=this.captureConfig;if(!this.flow&&!Le)return null;if(Le)return{showTutorial:Le.showTutorial,selfieCaptureAttempts:Le.captureAttempts??Le.numberOfAttempts??3,timeout:Le.autoCaptureTimeout*1e3,numberOfTries:Le.captureAttempts??Le.numberOfAttempts??3,maskCheckEnabled:Le.maskCheckEnabled??Le.validateFaceMask,lensesCheckEnabled:Le.lensesCheckEnabled??Le.validateLenses,hatCheckEnabled:Le.hatCheckEnabled??Le.validateHeadCover,eyesClosedCheckEnabled:Le.eyesClosedCheckEnabled??Le.validateClosedEyes,isDeepsightEnabled:Le.deepsightLiveness==="VIDEOLIVENESS"};const Ye=(tt=this.flow.flowModules.find(nt=>nt.key==="AUTHENTICATION"))==null?void 0:tt.configuration;return Ye?{showTutorial:Ye.showTutorial,selfieCaptureAttempts:Ye.numberOfAttempts,timeout:Ye.autoCaptureTimeout*1e3,numberOfTries:Ye.numberOfAttempts,maskCheckEnabled:Ye.validateFaceMask,lensesCheckEnabled:Ye.validateLenses,hatCheckEnabled:Ye.validateHeadCover,eyesClosedCheckEnabled:Ye.validateClosedEyes,isDeepsightEnabled:Ye.deepsightLiveness==="VIDEOLIVENESS"}:(this.completeWithError({code:"MODULE_NOT_FOUND",message:"Authentication module not found",error:new Error("Authentication module not found")}),null)}getFaceCaptureConfiguration(){var tt;const Le=this.captureConfig;if(!this.flow&&!Le)return null;if(Le)return{isRecordingEnabled:Le.isRecordingEnabled,showPreview:Le.showPreview,assistedOnboarding:Le.assistedOnboarding,showTutorial:Le.showTutorial,mergeSessionRecordings:!1,selfieCaptureAttempts:Le.captureAttempts??Le.numberOfAttempts??3,timeout:Le.autoCaptureTimeout*1e3,ageAssurance:Le.ageAssurance,numberOfTries:Le.captureAttempts??Le.numberOfAttempts??3,maskCheckEnabled:Le.maskCheckEnabled,lensesCheckEnabled:Le.lensesCheckEnabled,hatCheckEnabled:Le.hatCheckEnabled,eyesClosedCheckEnabled:Le.eyesClosedCheckEnabled,skipProcessFace:!0,isDeepsightEnabled:Le.deepsightLiveness==="VIDEOLIVENESS"};const Ye=(tt=this.flow.flowModules.find(nt=>nt.key==="SELFIE"))==null?void 0:tt.configuration;return Ye?{isRecordingEnabled:Ye.enableFaceRecording,showPreview:Ye.showPreview,assistedOnboarding:Ye.assistedOnboarding,showTutorial:Ye.showTutorial,mergeSessionRecordings:this.flow.mergeSessionRecordings,selfieCaptureAttempts:Ye.captureAttempts,timeout:Ye.autoCaptureTimeout*1e3,ageAssurance:this.flow.ageAssurance,isDeepsightEnabled:Ye.deepsightLiveness==="VIDEOLIVENESS",numberOfTries:Ye.captureAttempts,maskCheckEnabled:Ye.validateFaceMask,lensesCheckEnabled:Ye.validateLenses,hatCheckEnabled:Ye.validateHeadCover,eyesClosedCheckEnabled:Ye.validateClosedEyes,skipProcessFace:!0}:(this.completeWithError({code:"MODULE_NOT_FOUND",message:"Selfie module not found",error:new Error("Selfie module not found")}),null)}completeCaptureOnlyFlow(Le,Ye){var At;if(!this.captureOnly||!this.onCapture)return;const{blob:tt,url:nt}=Le.getBlobData(),ft=Le.getBase64Image();this.deepsightVideoRecorder||this.onCapture({image:{imageBase64:ft,blob:tt,url:nt},metadata:Ye});const ht=(At=this.deepsightVideoRecorder)==null?void 0:At.trimmedVideoBlob;if(!ht)throw new Error("Failed to get trimmed video");const gt=URL.createObjectURL(ht);this.onCapture({image:{imageBase64:ft,blob:tt,url:nt},metadata:Ye,trimmedVideo:{blob:ht,url:gt,mimeType:ht.type}})}onClose(){super.onClose(FlowType.FACE)}}const faceFlowManager=new FaceFlowManager,useFaceFlowState=()=>{const[Be,Le]=React.useState(faceFlowManager.getState());return React.useEffect(()=>{const Ye=faceFlowManager.subscribe(tt=>{Le(tt)});return()=>{Ye()}},[]),{...Be,goToCapture:faceFlowManager.goToCapture.bind(faceFlowManager),goToPermissions:faceFlowManager.goToPermissions.bind(faceFlowManager),completeFlow:faceFlowManager.completeFlow.bind(faceFlowManager),completeWithError:faceFlowManager.completeWithError.bind(faceFlowManager),reset:faceFlowManager.reset.bind(faceFlowManager),deepsightVideoRecorder:faceFlowManager.deepsightVideoRecorder,mediaRecorder:faceFlowManager.mediaRecorder,captureConfiguration:faceFlowManager.getCaptureConfiguration(),uiConfig:faceFlowManager.uiConfig,shouldShowTutorialInCapture:faceFlowManager.shouldShowTutorialInCapture,captureOnly:faceFlowManager.captureOnly,onCapture:faceFlowManager.onCapture,completeCaptureOnlyFlow:faceFlowManager.completeCaptureOnlyFlow.bind(faceFlowManager)}},Tutorial$2=({onContinue:Be,onClose:Le,isLoading:Ye})=>{const{t:tt}=useTranslation$1(),{uiConfig:nt,captureConfiguration:ft}=useFaceFlowState();return jsxRuntimeExports.jsx(BaseTutorial,{title:ft.ageAssurance?tt("face.tutorial.ageAssuranceTitle"):tt("face.tutorial.title"),subtitle:ft.ageAssurance?tt("face.tutorial.ageAssuranceSubtitle"):tt("face.tutorial.subtitle"),animationData:tutorialAnimationJson$2,onContinue:Be,buttonText:ft.ageAssurance?tt("face.tutorial.ageAssuranceStartCapture"):tt("face.tutorial.startCapture"),disclaimerText:tt("face.tutorial.autoCapture"),uiConfig:nt,onClose:Le,isLoading:Ye})},FACE_ERROR_CODES={LIVENESS:"LIVENESS_ERROR",BRIGHTNESS:"BRIGHTNESS_ERROR",LENSES:"LENSES_ERROR",MASK:"MASK_ERROR",CLOSED_EYES:"CLOSED_EYES_ERROR",HEAD_COVER:"HEAD_COVER_ERROR",SERVER:"SERVER_ERROR",FACE_NOT_FOUND:"FACE_NOT_FOUND",MULTIPLE_FACES:"MULTIPLE_FACES",TOO_BLURRY:"TOO_BLURRY_ERROR",TOO_DARK:"TOO_DARK_ERROR",USER_IS_NOT_RECOGNIZED:"USER_IS_NOT_RECOGNIZED",SPOOF_ATTEMPT_DETECTED:"SPOOF_ATTEMPT_DETECTED",FACE_TOO_DARK:"FACE_TOO_DARK",LENSES_DETECTED:"LENSES_DETECTED",FACE_MASK_DETECTED:"FACE_MASK_DETECTED",CLOSED_EYES_DETECTED:"CLOSED_EYES_DETECTED",HEAD_COVER_DETECTED:"HEAD_COVER_DETECTED",FACE_CROPPING_FAILED:"FACE_CROPPING_FAILED",FACE_TOO_SMALL:"FACE_TOO_SMALL",FACE_TOO_BLURRY:"FACE_TOO_BLURRY",BAD_PHOTO_QUALITY:"BAD_PHOTO_QUALITY",PROCESSING_ERROR:"PROCESSING_ERROR",BAD_REQUEST:"BAD_REQUEST",NONEXISTENT_CUSTOMER:"NONEXISTENT_CUSTOMER",HINT_NOT_PROVIDED:"HINT_NOT_PROVIDED",SELFIE_IMAGE_LOW_QUALITY:"SELFIE_IMAGE_LOW_QUALITY"},handleScreenEvent$1=(Be,Le,Ye)=>{addScreenEvent({module:eventModuleNames.selfie,screen:Le,token:Be,shouldOpen:Ye,payload:{moduleVersion:"2"}})},isKnownError=Be=>Object.values(FACE_ERROR_CODES).some(Le=>Le===Be.message),handleError$1=(Be,Le)=>{throw handleScreenEvent$1(Be,eventScreenNames.faceCaptureUpload,!1),handleScreenEvent$1(Be,eventScreenNames.faceCaptureError,!0),new Error(Le)},sendFaceImage=async({canvas:Be,faceCoordinates:Le,sessionToken:Ye,imageType:tt="selfie"})=>{var nt,ft,ht;try{faceFlowManager.incrementAttempts(),handleScreenEvent$1(Ye,eventScreenNames.faceCaptureUpload,!0);const gt=Be.getBase64Image();await onboardingAnalytics.analyzeFrame(gt),onboardingAnalytics.update(),MlWasmJSApi$1.reset();const At=await MlWasmJSApi$1.encryptImage(gt);addEvent({token:Ye,code:"captureAttemptFinished",module:eventModuleNames.selfie,payload:{logs:onboardingAnalytics.getPipelineLogs(),moduleVersion:"2"}}),addDeviceStats(Ye,{inspectorOpened:null,frontIdStatsAnalysisStatus:"",backIdStatsAnalysisStatus:"",selfieStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),motionStatus:onboardingAnalytics.getMotionStatus()});const xt=await capture({token:Ye,image:At,type:"selfie",imageType:tt,encrypted:!0,faceCoordinates:Le,recordingId:(nt=faceFlowManager.deepsightVideoRecorder)==null?void 0:nt.recordingId,metadata:onboardingAnalytics.getMetadata()});return xt.confidence!==0&&handleError$1(Ye,FACE_ERROR_CODES.LIVENESS),xt.isBright||handleError$1(Ye,FACE_ERROR_CODES.BRIGHTNESS),xt.hasLenses&&handleError$1(Ye,FACE_ERROR_CODES.LENSES),xt.hasFaceMask&&handleError$1(Ye,FACE_ERROR_CODES.MASK),xt.hasClosedEyes&&handleError$1(Ye,FACE_ERROR_CODES.CLOSED_EYES),xt.hasHeadCover&&handleError$1(Ye,FACE_ERROR_CODES.HEAD_COVER),xt.liveness=xt.confidence===0,xt.imageBase64=gt,handleScreenEvent$1(Ye,eventScreenNames.faceCaptureUpload,!1),handleScreenEvent$1(Ye,eventScreenNames.faceCaptureSuccess,!0),xt}catch(gt){const At=gt,{status:xt}=At;if(gt instanceof Error&&isKnownError(gt))throw gt;if(xt===400){const Et=(ht=(ft=At.response)==null?void 0:ft.data)==null?void 0:ht.status,yt={3004:FACE_ERROR_CODES.FACE_NOT_FOUND,3005:FACE_ERROR_CODES.FACE_NOT_FOUND,3006:FACE_ERROR_CODES.TOO_BLURRY,3007:FACE_ERROR_CODES.TOO_DARK,4010:FACE_ERROR_CODES.MULTIPLE_FACES,4019:FACE_ERROR_CODES.FACE_NOT_FOUND,4077:FACE_ERROR_CODES.BAD_PHOTO_QUALITY},Ct=Et?yt[Et]:null;throw Ct&&handleError$1(Ye,Ct),new Error(FACE_ERROR_CODES.SERVER)}throw new Error(FACE_ERROR_CODES.SERVER)}},handleScreenEvent=(Be,Le,Ye)=>{addScreenEvent({module:eventModuleNames.authFace,screen:Le,token:Be,shouldOpen:Ye})},handleError=(Be,Le)=>{throw handleScreenEvent(Be,eventScreenNames.authFaceUpload,!1),handleScreenEvent(Be,eventScreenNames.authFaceError,!0),new Error(Le)},sendAuthFaceImage=async({canvas:Be,faceCoordinates:Le,sessionToken:Ye})=>{var tt,nt;try{faceFlowManager.incrementAttempts(),handleScreenEvent(Ye,eventScreenNames.authFaceUpload,!0);const ft=Be.getBase64Image();await onboardingAnalytics.analyzeFrame(ft),onboardingAnalytics.update(),MlWasmJSApi$1.reset();const ht=await MlWasmJSApi$1.encryptImage(ft);addEvent({token:Ye,code:"captureAttemptFinished",module:eventModuleNames.authFace,payload:{logs:onboardingAnalytics.getPipelineLogs()}}),addDeviceStats(Ye,{inspectorOpened:null,frontIdStatsAnalysisStatus:"",backIdStatsAnalysisStatus:"",selfieStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),motionStatus:onboardingAnalytics.getMotionStatus()});const gt=await capture({type:"authFace",token:Ye,image:ht,authHint:faceFlowManager.authHint,encrypted:!0,faceCoordinates:Le,recordingId:(tt=faceFlowManager.deepsightVideoRecorder)==null?void 0:tt.recordingId,metadata:onboardingAnalytics.getMetadata()});if(gt.overallStatus!=="PASS"){if(faceFlowManager.getAttemptsLeft()===0){handleScreenEvent(Ye,eventScreenNames.authFaceUpload,!1),handleScreenEvent(Ye,eventScreenNames.authFaceError,!0),faceFlowManager.completeWithError({code:"NO_MORE_ATTEMPTS",message:"No more attempts",error:new Error("No more attempts")});return}throw gt.error.name==="SPOOF_ATTEMPT_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.SPOOF_ATTEMPT_DETECTED),gt.error.name==="FACE_TOO_DARK"&&handleError(Ye,FACE_ERROR_CODES.FACE_TOO_DARK),gt.error.name==="LENSES_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.LENSES_DETECTED),gt.error.name==="FACE_MASK_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.FACE_MASK_DETECTED),gt.error.name==="CLOSED_EYES_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.CLOSED_EYES_DETECTED),gt.error.name==="HEAD_COVER_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.HEAD_COVER_DETECTED),gt.error.name==="FACE_NOT_FOUND"&&handleError(Ye,FACE_ERROR_CODES.FACE_NOT_FOUND),gt.error.name==="FACE_CROPPING_FAILED"&&handleError(Ye,FACE_ERROR_CODES.FACE_CROPPING_FAILED),gt.error.name==="FACE_TOO_SMALL"&&handleError(Ye,FACE_ERROR_CODES.FACE_TOO_SMALL),gt.error.name==="FACE_TOO_BLURRY"&&handleError(Ye,FACE_ERROR_CODES.FACE_TOO_BLURRY),gt.error.name==="BAD_PHOTO_QUALITY"&&handleError(Ye,FACE_ERROR_CODES.BAD_PHOTO_QUALITY),gt.error.name==="PROCESSING_ERROR"&&handleError(Ye,FACE_ERROR_CODES.PROCESSING_ERROR),gt.error.name==="BAD_REQUEST"&&handleError(Ye,FACE_ERROR_CODES.BAD_REQUEST),gt.error.name==="SERVER"&&handleError(Ye,FACE_ERROR_CODES.SERVER),gt.error.name==="USER_IS_NOT_RECOGNIZED"&&handleError(Ye,FACE_ERROR_CODES.USER_IS_NOT_RECOGNIZED),gt.error.name==="NONEXISTENT_CUSTOMER"&&(handleScreenEvent(Ye,eventScreenNames.authFaceUpload,!1),handleScreenEvent(Ye,eventScreenNames.authFaceError,!0),faceFlowManager.completeWithError({code:"NONEXISTENT_CUSTOMER",message:"Non-existent customer",error:new Error("Non-existent customer")})),gt.error.name==="HINT_NOT_PROVIDED"&&(handleScreenEvent(Ye,eventScreenNames.authFaceUpload,!1),handleScreenEvent(Ye,eventScreenNames.authFaceError,!0),faceFlowManager.completeWithError({code:"HINT_NOT_PROVIDED",message:"Hint not provided",error:new Error("Hint not provided")})),new Error(gt.error.name)}return gt.imageBase64=ft,gt.selfieEncryptedBase64=ht,gt.metadata=onboardingAnalytics.getMetadata(),gt.videoFileURL=(nt=faceFlowManager.deepsightVideoRecorder)==null?void 0:nt.videoFileURL,gt}catch(ft){throw ft instanceof Error&&isKnownError(ft)?ft:new Error(FACE_ERROR_CODES.SERVER)}};class DetectionManager{constructor(){this.faceDetection=null,this.manualCaptureHasTriggered=!1,this.subscribers=[],this.config=null,this.getCanvas=null,this.processFrame=async()=>{if(!(this.state.isProcessingLocked||this.state.detectionState==="capturing"||!this.getCanvas)){if(!this.faceDetection)throw new Error("Face detection not initialized");this.setState({isProcessingLocked:!0});try{await MlWasmJSApi$1.handleDetectionCallAndUpdateState(detectionSetup.getProfile(DetectionType.Selfie).pipelineType);const Le=this.getCanvas();if(!Le)return;await this.faceDetection.detect(Le)}finally{await sleep(100),this.setState({isProcessingLocked:!1})}}},this.state={detectionState:"detecting",isProcessingLocked:!1,borderState:"idle",capturedImage:null},window.addEventListener("offline",()=>{this.setState({detectionState:"offline"}),this.stopDetection()}),window.addEventListener("online",()=>{this.setState({detectionState:"detecting"}),this.startDetection()}),this.startDetection()}setState(Le){this.state={...this.state,...Le},this.notifySubscribers()}notifySubscribers(){this.subscribers.forEach(Le=>Le(this.state))}getState(){return this.state}subscribe(Le){return this.subscribers.push(Le),Le(this.state),()=>{this.subscribers=this.subscribers.filter(Ye=>Ye!==Le)}}unsubscribe(Le){this.subscribers=this.subscribers.filter(Ye=>Ye!==Le)}setGetCanvas(Le){this.getCanvas=Le}switchToManualCapture(){addEvent({code:"switchToManualCaptureSelfie",token:faceFlowManager.getToken()}),this.stopDetection(),this.manualCaptureHasTriggered=!0,this.setState({detectionState:"manualCapture"})}async detectVirtualCamera(){const Le={canvas:null,itr:null,skipped:null};if(await MlWasmJSApi$1.poc(Le),(Le==null?void 0:Le.skipped)===!1){if(Le!=null&&Le.canvas){const tt=new IncodeCanvas(Le.canvas).getBase64Image();logFrame({token:faceFlowManager.getToken(),base64Image:tt,source:sources.selfie})}(Le==null?void 0:Le.itr)===!0?(addDeviceStats(faceFlowManager.getToken(),{virtualCameraDetected:!0}),MlWasmJSApi$1.setZc("FAIL")):MlWasmJSApi$1.setZc("PASS")}}async capture(Le,Ye){var tt,nt,ft,ht,gt,At;this.stopDetection(),this.setState({borderState:"capturing",detectionState:"capturing",capturedImage:Le.getBase64Image()}),await((tt=faceFlowManager.deepsightVideoRecorder)==null?void 0:tt.stopRecording(faceFlowManager.getToken(),faceFlowManager.captureOnly)),await this.detectVirtualCamera();try{const xt=await((nt=this.config)==null?void 0:nt.onCapture(Le,Ye));this.setState({borderState:"success",detectionState:"success"}),await sleep(3e3),(ht=(ft=this.config)==null?void 0:ft.onFinish)==null||ht.call(ft,xt)}catch(xt){this.setState({borderState:"error",detectionState:"error",capturedImage:null}),(At=(gt=this.config)==null?void 0:gt.onError)==null||At.call(gt,xt)}}async initialize(Le){this.config=Le,this.faceDetection=new FaceDetection;const Ye=faceFlowManager.getCaptureConfiguration();await this.faceDetection.initialize({onNoFace:emptyFunc,onCaptureFace:emptyFunc,onTooManyFaces:()=>this.setState({detectionState:"tooManyFaces"}),onTooClose:()=>this.setState({detectionState:"tooClose"}),onCenterFace:()=>this.setState({detectionState:"centerFace"}),onFarAway:()=>this.setState({detectionState:"tooFar"}),onGetReady:()=>this.setState({borderState:"loading",detectionState:"getReady"}),onGetReadyFinished:()=>this.setState({borderState:"idle",detectionState:"getReadyFinished"}),onBlur:()=>this.setState({detectionState:"blur"}),onDark:()=>this.setState({detectionState:"dark"}),onFaceAngle:()=>this.setState({detectionState:"faceAngle"}),onHeadWear:()=>this.setState({detectionState:"headWear"}),onLenses:()=>this.setState({detectionState:"lenses"}),onEyesClosed:()=>this.setState({detectionState:"eyesClosed"}),onFaceMask:()=>this.setState({detectionState:"faceMask"}),onSwitchToManualCapture:()=>this.switchToManualCapture(),onCapture:(tt,nt)=>this.capture(tt,nt),onFaceOccluded:()=>{},isLensesCheckEnabled:Ye.lensesCheckEnabled,isMaskCheckEnabled:Ye.maskCheckEnabled,isClosedEyesCheckEnabled:Ye.eyesClosedCheckEnabled,isHeadWearCheckEnabled:Ye.hatCheckEnabled,isVideoSelfie:!1,autocaptureTimeout:Ye.timeout,pipelineProfile:detectionSetup.getProfile(DetectionType.Selfie)})}startDetection(){if(this.manualCaptureHasTriggered){this.setState({detectionState:"manualCapture"});return}this.setState({detectionState:"detecting",isProcessingLocked:!1}),onFrameEmitter.on("newFrame",this.processFrame)}stopDetection(){onFrameEmitter.off("newFrame",this.processFrame)}}const useFaceDetection=({getCanvas:Be,onCapture:Le,onFinish:Ye,onError:tt})=>{const nt=React.useRef(null),[ft,ht]=React.useState(null),gt=React.useRef(Be),At=React.useRef(Le),xt=React.useRef(Ye),Et=React.useRef(tt);return React.useEffect(()=>{gt.current=Be,At.current=Le,xt.current=Ye,Et.current=tt},[Be,Le,Ye,tt]),React.useEffect(()=>{nt.current=new DetectionManager,ht(nt.current.getState());const yt=nt.current;yt.setGetCanvas(gt.current),yt.initialize({onCapture:(kt,vt)=>At.current(kt,vt),onFinish:kt=>{var vt;return(vt=xt.current)==null?void 0:vt.call(xt,kt)},onError:kt=>{var vt;return(vt=Et.current)==null?void 0:vt.call(Et,kt)}}),nt.current=yt;const Ct=kt=>{ht(kt)};return yt.subscribe(Ct),()=>{yt.stopDetection(),yt.unsubscribe(Ct)}},[]),{detectionState:ft==null?void 0:ft.detectionState,borderState:ft==null?void 0:ft.borderState,capturedImage:ft==null?void 0:ft.capturedImage,startDetection:()=>{var yt;return(yt=nt.current)==null?void 0:yt.startDetection()},stopDetection:()=>{var yt;return(yt=nt.current)==null?void 0:yt.stopDetection()},capture:yt=>{var Ct;return(Ct=nt.current)==null?void 0:Ct.capture(yt)}}};function useFaceCaptureAspectRatio(Be){var tt;const[Le,Ye]=React.useState();return React.useEffect(()=>{if(typeof window.CSS<"u"&&window.CSS.supports("aspect-ratio","1")){Ye(void 0);return}function ft(){var gt;const ht=((gt=Be.current)==null?void 0:gt.offsetWidth)??0;Ye(ht*1)}return ft(),window.addEventListener("resize",ft),()=>window.removeEventListener("resize",ft)},[Be,Be.current,(tt=Be.current)==null?void 0:tt.offsetWidth]),{height:Le}}const FaceFlowPage=Be=>{const{uiConfig:Le}=useFaceFlowState();return jsxRuntimeExports.jsx(FlowPage,{uiConfig:Le,onClose:()=>faceFlowManager.onClose(),onCloseCancel:Be.closeButtonOnCancel,...Be})},CaptureOverlay$1=({capturedImage:Be,detectionState:Le})=>Le!=="capturing"&&Le!=="success"?null:jsxRuntimeExports.jsx(Flex,{w:"100%",h:"100%",position:"absolute",top:0,left:0,bg:"#f5f5f6",zIndex:2,justify:"center",align:"center",children:jsxRuntimeExports.jsx(PreviewImage,{src:`data:image/jpeg;base64,${Be}`})}),defaultError={title:"Something went wrong",description:"Please try again later"},errorContent={MASK_ERROR:{title:"notifications.mask",description:"notifications.maskDescription"},BRIGHTNESS_ERROR:{title:"notifications.brightness",description:"notifications.brightnessDescription"},LIVENESS_ERROR:{title:"notifications.spoof",description:"notifications.spoofDescription"},CLOSED_EYES_ERROR:{title:"notifications.closedEyes",description:"notifications.closedEyesDescription"},HEAD_COVER_ERROR:{title:"notifications.removeHeadwear",description:"notifications.removeHeadwearDescription"},LENSES_ERROR:{title:"notifications.lenses",description:"notifications.lensesDescription"},FACE_NOT_FOUND:{title:"notifications.faceNotFound",description:"notifications.faceNotFoundDescription"},MULTIPLE_FACES:{title:"notifications.multiple",description:"notifications.multipleDescription"},TOO_BLURRY_ERROR:defaultError,TOO_DARK_ERROR:defaultError,SERVER_ERROR:defaultError,FACE_CROPPING_FAILED:defaultError,FACE_TOO_SMALL:defaultError,PROCESSING_ERROR:defaultError,BAD_REQUEST:defaultError,USER_IS_NOT_RECOGNIZED:{title:"notifications.accessDenied",description:"notifications.accessDeniedDescription"},SPOOF_ATTEMPT_DETECTED:{title:"notifications.spoof",description:"notifications.spoofDescription"},FACE_TOO_DARK:{title:"notifications.brightness",description:"notifications.brightnessDescription"},LENSES_DETECTED:{title:"notifications.lenses",description:"notifications.lensesDescription"},FACE_MASK_DETECTED:{title:"notifications.mask",description:"notifications.maskDescription"},CLOSED_EYES_DETECTED:{title:"notifications.closedEyes",description:"notifications.closedEyesDescription"},HEAD_COVER_DETECTED:{title:"notifications.removeHeadwear",description:"notifications.removeHeadwearDescription"},FACE_TOO_BLURRY:{title:"notifications.spoof",description:"notifications.spoofDescription"},BAD_PHOTO_QUALITY:{title:"notifications.lowQualityImage",description:"notifications.lowQualityImageDescription"},NONEXISTENT_CUSTOMER:{title:"notifications.nonexistentCustomer",description:"notifications.nonexistentCustomerDescription"},HINT_NOT_PROVIDED:{title:"notifications.hintNotProvided",description:"notifications.hintNotProvidedDescription"},SELFIE_IMAGE_LOW_QUALITY:{title:"notifications.selfieImageLowQuality",description:"notifications.selfieImageLowQualityDescription"}},ErrorModalContent=({title:Be,description:Le,attemptsText:Ye,buttonText:tt,icon:nt,onButtonClick:ft,onCloseCancel:ht})=>{const gt=useTokens();return jsxRuntimeExports.jsx(Modal$3,{open:!0,children:jsxRuntimeExports.jsx(FaceFlowPage,{"data-testid":"face-capture-error-modal",onCloseCancel:ht,children:jsxRuntimeExports.jsx(Flex,{align:"center",justify:"center",direction:"column",wFull:!0,hFull:!0,children:jsxRuntimeExports.jsxs(Flex,{wFull:!0,hFull:!0,bg:gt.color.surface.neutral.light,minW:"320px",direction:"column",justify:"space-between",px:2,children:[jsxRuntimeExports.jsx(Box,{}),jsxRuntimeExports.jsxs(Flex,{direction:"column",align:"center",children:[nt,jsxRuntimeExports.jsx(Spacer,{size:6}),jsxRuntimeExports.jsx(Text$7,{as:"h2",fontSize:gt.typography.fontSize["2xl"],fontWeight:700,textAlign:"center",lineHeight:"114%",letterSpacing:"-0.5px",children:Be}),jsxRuntimeExports.jsx(Spacer,{size:4}),jsxRuntimeExports.jsx(Text$7,{as:"p",fontSize:gt.typography.fontSize.base,textAlign:"center",color:gt.color.text.body.secondary,fontWeight:500,lineHeight:"114%",letterSpacing:"-0.5px",children:Le})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",align:"center",children:[jsxRuntimeExports.jsx(Text$7,{as:"p",fontSize:gt.typography.fontSize.lg,textAlign:"center",color:gt.color.text.body.secondary,fontWeight:500,lineHeight:"114%",letterSpacing:"-0.5px",children:Ye}),jsxRuntimeExports.jsx(Spacer,{size:6}),jsxRuntimeExports.jsx(Button$b,{onClick:ft,children:tt})]})]})})})})},NoMoreAttemptsModal=({title:Be,onContinue:Le,onCloseCancel:Ye})=>{const{t:tt}=useTranslation$1();return jsxRuntimeExports.jsx(ErrorModalContent,{title:Be,description:tt("notifications.selfieCaptureFailedDescription"),attemptsText:tt("notifications.noAttemptsRemaining"),buttonText:tt("common.continue"),icon:jsxRuntimeExports.jsx(ErrorIcon$1,{}),onButtonClick:Le,onCloseCancel:Ye})},RetryErrorModal=({title:Be,description:Le,attemptsRemaining:Ye,onTryAgain:tt,onCloseCancel:nt})=>{const{t:ft}=useTranslation$1();return jsxRuntimeExports.jsx(ErrorModalContent,{title:Be,description:ft(Le),attemptsText:ft("common.attemptsRemaining",{count:Ye}),buttonText:ft("common.tryAgain"),icon:jsxRuntimeExports.jsx(WarningIcon,{}),onButtonClick:tt,onCloseCancel:nt})},ErrorModal=({error:Be,onTryAgain:Le,onContinue:Ye,onCloseCancel:tt})=>{const{attempts:nt,captureConfiguration:ft}=useFaceFlowState(),{t:ht}=useTranslation$1();if(!Be)return null;const{title:gt,description:At}=errorContent[Be]??defaultError,xt=ft.selfieCaptureAttempts-nt;return xt<=0?jsxRuntimeExports.jsx(NoMoreAttemptsModal,{title:ht(gt),onContinue:Ye,onCloseCancel:tt}):jsxRuntimeExports.jsx(RetryErrorModal,{title:ht(gt),description:At,attemptsRemaining:xt,onTryAgain:Le,onCloseCancel:tt})},SvgOutline=Be=>React__namespace.createElement("svg",{width:292,height:272,viewBox:"0 0 292 272",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{opacity:.8,d:"M145.633 8.0625C115.606 8.06268 85.6206 26.5984 76.9712 54.293L76.771 54.9492C70.4539 76.1063 75.0139 100.802 76.8687 110.58L77.3628 113.188L75.1528 114.656C66.1187 120.66 63.5861 124.089 62.8472 126.92C62.4669 128.377 62.4644 130.035 62.8003 132.412C63.1635 134.983 63.7533 137.484 64.4233 141.347L64.5142 141.841C65.5056 146.956 68.1062 152.133 71.2749 156.618C74.5527 161.257 78.2056 164.826 80.7349 166.584L82.4517 167.777V169.869C82.4517 177.866 85.3476 186.144 89.6763 194.128C93.9906 202.085 99.5748 209.473 104.623 215.646L105.526 216.751V218.178C105.526 220.891 105.68 223.73 105.801 226.9C105.92 230.011 106.003 233.347 105.828 236.771C105.475 243.652 104.077 251.044 99.7446 258.227C91.1977 272.397 72.1081 284.401 31.8677 291.776L29.936 292.124C-41.1597 304.684 -61.4563 361.617 -63.2153 392.062H145.633V400.062H-71.3638L-71.3462 396.044C-71.2048 364.597 -50.9804 298.295 28.5444 284.246L30.4448 283.904C69.9919 276.654 86.1642 265.253 92.894 254.095C96.3216 248.412 97.5261 242.442 97.8374 236.362C97.9939 233.307 97.9241 230.262 97.8071 227.206C97.7111 224.697 97.5799 222.105 97.5396 219.615C92.5931 213.5 87.048 206.064 82.644 197.941C78.308 189.944 74.9442 181.04 74.5024 171.896C71.3932 169.387 67.8531 165.638 64.7417 161.234C61.1656 156.173 57.9337 149.942 56.6587 143.353L56.5415 142.714C55.9864 139.514 55.2491 136.155 54.8784 133.531C54.4806 130.715 54.3377 127.843 55.106 124.899C56.5344 119.427 60.7885 114.886 68.5259 109.489C66.4692 98.2995 62.7062 74.0938 69.106 52.6602L69.3345 51.9092C79.2266 20.2173 112.853 0.0626788 145.633 0.0625V8.0625ZM145.635 0.0625C178.415 0.0625 212.042 20.2172 221.934 51.9092L222.163 52.6602C228.562 74.0938 224.799 98.2996 222.743 109.489C230.48 114.886 234.734 119.427 236.163 124.899C236.931 127.843 236.788 130.715 236.39 133.531C236.019 136.155 235.282 139.514 234.727 142.714L234.61 143.353C233.335 149.942 230.103 156.173 226.527 161.234C223.415 165.638 219.875 169.387 216.766 171.896C216.324 181.04 212.961 189.944 208.625 197.941C204.221 206.064 198.676 213.5 193.729 219.615C193.689 222.105 193.557 224.697 193.461 227.206C193.344 230.262 193.275 233.307 193.431 236.362C193.742 242.442 194.947 248.412 198.375 254.095C205.104 265.253 221.277 276.654 260.824 283.904L262.724 284.246C342.249 298.294 362.473 364.597 362.615 396.044L362.632 400.062H145.635V392.062H354.484C352.725 361.616 332.429 304.683 261.333 292.124L259.401 291.776C219.161 284.401 200.071 272.397 191.524 258.227C187.192 251.044 185.793 243.652 185.441 236.771C185.266 233.347 185.348 230.011 185.467 226.9C185.589 223.73 185.743 220.891 185.743 218.178V216.751L186.646 215.646C191.694 209.473 197.278 202.085 201.592 194.128C205.921 186.144 208.817 177.866 208.817 169.869V167.777L210.534 166.584C213.063 164.826 216.716 161.257 219.994 156.618C223.162 152.133 225.763 146.956 226.754 141.841L226.845 141.347C227.515 137.484 228.105 134.983 228.468 132.412C228.804 130.034 228.802 128.377 228.421 126.92C227.682 124.089 225.15 120.66 216.116 114.656L213.906 113.188L214.4 110.58C216.255 100.802 220.815 76.1064 214.498 54.9492L214.297 54.293C205.648 26.5983 175.662 8.0625 145.635 8.0625V0.0625Z",fill:"white"})),FaceOutline=({height:Be="100%"})=>jsxRuntimeExports.jsx(Box,{position:"absolute",bottom:0,left:"50%",transform:"translateX(-50%)",zIndex:1,h:Be,children:jsxRuntimeExports.jsx(SvgOutline,{title:"Outline",height:"100%"})});function getFill(Be,Le){return Be==="loading"||Be==="capturing"?`url(#paint0_radial_2423_448_${Le.replace("#","")})`:Le}const StyledPath=dt.path`
3719
+ `,BaseTutorial=({title:Be,subtitle:Le,animationData:Ye,onContinue:tt,buttonText:nt,uiConfig:ft,disclaimerText:ht,onClose:gt,isLoading:At=!1})=>{var yt,Ct,kt,vt,bt,It,wt,Rt,Tt,Bt,Dt,Pt,Nt;const{t:xt}=useTranslation$1(),Et=useTokens();return jsxRuntimeExports.jsx(Page$1,{title:Be,subtitle:Le,closeButton:{show:(yt=ft==null?void 0:ft.closeButton)==null?void 0:yt.show,position:(Ct=ft==null?void 0:ft.closeButton)==null?void 0:Ct.position,offset:(kt=ft==null?void 0:ft.closeButton)==null?void 0:kt.offset,onClose:gt},hideHeaderBranding:(vt=ft==null?void 0:ft.branding)==null?void 0:vt.hideHeaderBranding,...(It=(bt=ft==null?void 0:ft.branding)==null?void 0:bt.logo)!=null&&It.src||(Rt=(wt=ft==null?void 0:ft.branding)==null?void 0:wt.logo)!=null&&Rt.height?{logo:{src:(Bt=(Tt=ft==null?void 0:ft.branding)==null?void 0:Tt.logo)==null?void 0:Bt.src,height:(Pt=(Dt=ft==null?void 0:ft.branding)==null?void 0:Dt.logo)==null?void 0:Pt.height}}:{},hideFooterBranding:(Nt=ft==null?void 0:ft.branding)==null?void 0:Nt.hideFooterBranding,"data-testid":"base-tutorial-container",children:jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",flex:1,children:[jsxRuntimeExports.jsx(LottieContainer,{hFull:!0,xsH:"250px",$color:Et.color.surface.primary[500],px:6,xsPx:0,maxW:"400px",m:"auto",children:jsxRuntimeExports.jsx(Lottie,{animationData:replaceLottieColor(Ye,Et.color.surface.primary[500]),loop:!0,autoplay:!0,style:{height:"100%"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text$7,{fontSize:Et.typography.fontSize.lg,textAlign:"center",color:Et.color.text.body.secondary,lineHeight:"114%",fontWeight:500,letterSpacing:"-0.5px",py:3,children:ht||xt("idv2.tutorial.autoCapture")}),jsxRuntimeExports.jsx(Box,{px:2,py:4,children:jsxRuntimeExports.jsx(Button$b,{onClick:tt,"data-testid":"tutorial-continue-button",isLoading:At,children:nt||xt("idv2.tutorial.startScan")})})]})]})})},fr$7=60,v$7="5.9.6",ip$7=0,op$7=239,w$7=296,h$8=296,nm$7="selfietuto",ddd$7=0,markers$7=[],assets$7=[{nm:"faceloop",fr:60,id:"m256ex281vb8hdk2ys3",layers:[{ty:3,ddd:0,ind:4,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:5,hd:!1,nm:"faceloop - Null",sr:1,parent:4,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:6,hd:!1,nm:"faceloop - Shape Mask",sr:1,parent:5,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[.01,0],[295.99,0],[296,.01],[296,295.99],[295.99,296],[.01,296],[0,295.99],[0,.01],[.01,0],[.01,0]],i:[[0,0],[0,0],[0,-.0055],[0,0],[.0055,0],[0,0],[0,.0055],[0,0],[-.0055,0],[0,0]],o:[[0,0],[.005519999999989977,0],[0,0],[0,.005519999999989977],[0,0],[-.00552,0],[0,0],[0,-.00552],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:[0,1,0,1]},nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]}]},{nm:"selfiescan2",fr:60,id:"m256ews56opa1de42ut",layers:[{ty:3,ddd:0,ind:7,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:8,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:7,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:9,hd:!1,nm:"selfietuto - Shape Mask",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[.01,0],[295.99,0],[296,.01],[296,295.99],[295.99,296],[.01,296],[0,295.99],[0,.01],[.01,0],[.01,0]],i:[[0,0],[0,0],[0,-.0055],[0,0],[.0055,0],[0,0],[0,.0055],[0,0],[-.0055,0],[0,0]],o:[[0,0],[.005519999999989977,0],[0,0],[0,.005519999999989977],[0,0],[-.00552,0],[0,0],[0,-.00552],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:[0,1,0,1]},nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]}]},{nm:"Group 39567",fr:60,id:"m256ewscxedd0m9wt7o",layers:[{ty:3,ddd:0,ind:10,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:11,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:10,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:12,hd:!1,nm:"Group 39567 - Null",sr:1,parent:11,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ddd:0,ind:13,ty:0,nm:"selfiescan2",td:1,refId:"m256ews56opa1de42ut",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0},{ty:4,ddd:0,ind:14,hd:!1,nm:"selfietuto - Shape Mask",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[.01,0],[295.99,0],[296,.01],[296,295.99],[295.99,296],[.01,296],[0,295.99],[0,.01],[.01,0],[.01,0]],i:[[0,0],[0,0],[0,-.0055],[0,0],[.0055,0],[0,0],[0,.0055],[0,0],[-.0055,0],[0,0]],o:[[0,0],[.005519999999989977,0],[0,0],[0,.005519999999989977],[0,0],[-.00552,0],[0,0],[0,-.00552],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:[0,1,0,1]},nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}],tt:1}]},{nm:"User 07a",fr:60,id:"m256ewtth2xv0t9qlhe",layers:[{ty:3,ddd:0,ind:15,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:16,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:15,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:17,hd:!1,nm:"Group 39567 - Null",sr:1,parent:16,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:18,hd:!1,nm:"User 07a - Null",sr:1,parent:17,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ddd:0,ind:19,ty:0,nm:"Group 39567",td:1,refId:"m256ewscxedd0m9wt7o",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0},{ty:4,ddd:0,ind:20,hd:!1,nm:"User 07a - Shape Mask",sr:1,parent:18,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[.01,0],[324.5782,0],[324.5882,.01],[324.5882,324.5782],[324.5782,324.5882],[.01,324.5882],[0,324.5782],[0,.01],[.01,0],[.01,0]],i:[[0,0],[0,0],[0,-.0055],[0,0],[.0055,0],[0,0],[0,.0055],[0,0],[-.0055,0],[0,0]],o:[[0,0],[.005519999999989977,0],[0,0],[0,.005519999999989977],[0,0],[-.00552,0],[0,0],[0,-.00552],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:[0,1,0,1]},nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}],tt:1}]},{nm:"faceloop",fr:60,id:"m6p6j2c0qs37vm69",layers:[{ty:3,ddd:0,ind:61,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:62,hd:!1,nm:"faceloop - Null",sr:1,parent:61,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:23,hd:!1,nm:"Ellipse 191 (Stroke) - Null",sr:1,parent:62,ks:{a:{a:0,k:[148,148]},o:{a:0,k:100},p:{a:0,k:[148,148]},r:{a:1,k:[{t:0,s:[0],o:{x:[0],y:[0]},i:{x:[1],y:[1]}},{t:120,s:[360],o:{x:[0],y:[0]},i:{x:[1],y:[1]}},{t:240,s:[720]}]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:24,hd:!1,nm:"Ellipse 191 (Stroke)",sr:1,parent:23,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:4,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[148,287],[287,148],[148,9],[9,148],[148,287],[148,287]],i:[[0,0],[0,76.7676],[76.7676,0],[0,-76.7676],[-76.7676,0],[0,0]],o:[[76.76758000000001,0],[0,-76.76758],[-76.76758,0],[0,76.76758000000001],[0,0],[0,0]]}}},{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[148,296],[296,148],[148,0],[0,148],[148,296],[148,296]],i:[[0,0],[0,81.7381],[81.7381,0],[0,-81.7381],[-81.7381,0],[0,0]],o:[[81.73813999999999,0],[0,-81.73814],[-81.73814,0],[0,81.73813999999999],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:2,k:{a:0,k:[0,0,.47843137254901963,1,1,0,.47843137254901963,1,0,1,1,0]}},s:{a:0,k:[24.51807347262285,30.75903457240274]},e:{a:0,k:[217.54216853549255,256.7710909118675]},t:1,nm:"Fill",hd:!1,r:2},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]}]},{nm:"User 07a",fr:60,id:"m6p6j2c85ejf13b5",layers:[{ty:3,ddd:0,ind:52,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:53,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:52,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:54,hd:!1,nm:"Group 39567 - Null",sr:1,parent:53,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:55,hd:!1,nm:"User 07a - Null",sr:1,parent:54,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:29,hd:!1,nm:"Ellipse 148 - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[108.8158,52.1611]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:30,hd:!1,nm:"Ellipse 148",sr:1,parent:29,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[107.2565,76.6782],[53.6282,152.0111],[-1e-4,76.6782],[53.6282,0],[107.2565,76.6782],[107.2565,76.6782]],i:[[0,0],[23.5084,0],[0,41.6052],[-50.6702,0],[0,-37.926],[0,0]],o:[[0,41.60524000000001],[-25.71208,0],[0,-37.06891],[50.67023,0],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:2,k:{a:0,k:[0,.8784313725490196,.8784313725490196,.8784313725490196,1,1,1,1]}},s:{a:0,k:[6.591940610097922,75.2952207378632]},e:{a:0,k:[82.34462772765323,75.58141690773564]},t:1,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:31,hd:!1,nm:"Vector 14 - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[224.0092,121.5657]},r:{a:0,k:174.0696},s:{a:0,k:[99.62,-100.33000000000001]},sk:{a:0,k:-1.81},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:32,hd:!1,nm:"Vector 14",sr:1,parent:31,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[3.8354,2.7538],[14.3511,5.0967],[14.3511,33.9922],[8.4362,37.8555],[.8778,19.154],[3.8354,2.7538],[3.8354,2.7538]],i:[[0,0],[-1.6431,-3.254],[0,0],[3.9434,0],[.6572,5.0763],[-5.5865,7.4191],[0,0]],o:[[4.46918,-5.9353],[0,0],[-.3285499999999999,2.4730399999999975],[-4.92925,0],[-.65723,-5.07625],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:3,k:{a:0,k:[.0417,.7098039215686275,.7098039215686275,.7098039215686275,.3625,.8862745098039215,.8862745098039215,.8862745098039215,1,1,1,1]}},s:{a:0,k:[12.895270234498375,18.505816655260606]},e:{a:0,k:[3.4748756395564944,19.465401775061935]},t:1,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:33,hd:!1,nm:"Vector 13 - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[98.7625,119.8784]},r:{a:0,k:-5.3845},s:{a:0,k:[99.65,100.29999999999998]},sk:{a:0,k:1.81},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:34,hd:!1,nm:"Vector 13",sr:1,parent:33,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[3.8354,2.7538],[14.3511,5.0967],[14.3511,33.9922],[8.4362,37.8555],[.8778,19.154],[3.8354,2.7538],[3.8354,2.7538]],i:[[0,0],[-1.6431,-3.254],[0,0],[3.9434,0],[.6572,5.0763],[-5.5865,7.4191],[0,0]],o:[[4.469190000000001,-5.9353],[0,0],[-.3285499999999999,2.4730399999999975],[-4.92925,0],[-.65723,-5.07625],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:3,k:{a:0,k:[.1719,.7411764705882353,.7411764705882353,.7411764705882353,.6406,.8823529411764706,.8823529411764706,.8823529411764706,1,.8666666666666667,.8666666666666667,.8666666666666667]}},s:{a:0,k:[12.895270234498375,18.505816655260606]},e:{a:0,k:[3.4748756395564944,19.465401775061935]},t:1,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:35,hd:!1,nm:"Intersect - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[73.3813,221.1284]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:36,hd:!1,nm:"Intersect",sr:1,parent:35,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[176.9562,14.2579],[88.3045,51.5579],[-1e-4,14.6114],[42.8361,.0076],[86.6769,22.2946],[134.9533,0],[176.9562,14.2579],[176.9562,14.2579]],i:[[0,0],[34.738,0],[22.4871,22.8082],[0,0],[-18.981,-.4651],[-6.5668,12.3875],[-21.0564,-8.5561],[0,0]],o:[[-22.511949999999985,23.015520000000002],[-34.55984,0],[21.33035,-8.74771],[6.316929999999999,11.41202],[20.596860000000007,.5046900000000001],[0,0],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:100},c:{a:0,k:"replaceColorWithYours"},nm:"Fill",hd:!1,r:2},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:37,hd:!1,nm:"Combined Shape - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[102.6816,130.9973]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:38,hd:!1,nm:"Combined Shape",sr:1,parent:37,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[24.9287,73.4874],[24.9287,73.954],[0,96.2222],[59.6122,122.2049],[119.2244,96.2222],[94.2957,73.9204],[94.3261,29.8559],[94.3261,29.6156],[94.4854,16.542],[24.8205,30.9221],[24.9289,73.4874],[24.9287,73.4874]],i:[[0,0],[0,0],[16.4905,-4.9742],[-19.8704,0],[-19.8704,14.4345],[.2406,9.8879],[-.0173,3.7526],[1.0839,.301],[-.0737,16.8942],[-1.039,-46.389],[-.0661,-5.3568],[0,0]],o:[[0,0],[-.1286200000000015,9.871259999999992],[19.87036,14.434470000000005],[19.870360000000005,0],[-16.378529999999998,-4.980019999999996],[0,-3.7526299999999964],[1.1846599999999938,.16672000000000153],[.03252000000000521,-12.36235],[.07370000000000232,-16.89435],[.014089999999999492,4.729930000000003],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:2,k:{a:0,k:[0,.6941176470588235,.6941176470588235,.6941176470588235,1,1,1,1]}},s:{a:0,k:[54.32503300089149,33.74278237295727]},e:{a:0,k:[54.32503300089149,91.15401515450041]},t:1,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:39,hd:!1,nm:"Intersect - Null",sr:1,parent:55,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[37.686,24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:40,hd:!1,nm:"Intersect",sr:1,parent:39,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[124,248],[248,124],[124,0],[0,124],[124,248],[124,248]],i:[[0,0],[0,68.4833],[68.4833,0],[0,-68.4833],[-68.4833,0],[0,0]],o:[[68.48331000000002,0],[0,-68.48331],[-68.48331,0],[0,68.48331000000002],[0,0],[0,0]]}}},{ty:"fl",o:{a:0,k:7.000000000000001},c:{a:0,k:[0,.47843137254901963,1,1]},nm:"Fill",hd:!1,r:2},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]}]},{nm:"[FRAME] selfietuto - Null / selfiescan2 - Null / Ellipse 194 - Null / Ellipse 194 / selfietuto - Null / selfiescan2 - Null / Group 39567 - Null / selfietuto - Null / selfiescan2 - Null / Group 39567 - Null / User 07a - Null / selfietuto - Null / selfiescan2 - Null / Group 39567 - Null / User 07a - Null / User 07a / User 07a",fr:60,id:"m6p6j2c5c0l7uggl",layers:[{ty:3,ddd:0,ind:41,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:42,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:41,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:43,hd:!1,nm:"Ellipse 194 - Null",sr:1,parent:42,ks:{a:{a:0,k:[20,20]},o:{a:1,k:[{t:40.2,s:[0],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:57.599999999999994,s:[100],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:94.2,s:[0],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:110.4,s:[100],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:144.60000000000002,s:[0]}]},p:{a:1,k:[{t:40.2,s:[1,124],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]},ti:[0,0],to:[0,0]},{t:94.2,s:[244,124],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]},ti:[0,0],to:[0,0]},{t:144.60000000000002,s:[1,124]}]},r:{a:0,k:0},s:{a:1,k:[{t:40.2,s:[150,288],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:57.599999999999994,s:[150,622],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:94.2,s:[150,231.99999999999997],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:110.4,s:[150,666],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:144.60000000000002,s:[150,288]}]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:4,ddd:0,ind:44,hd:!1,nm:"Ellipse 194",sr:1,parent:43,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:1,k:[{t:40.2,s:[0],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:57.599999999999994,s:[100],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:94.2,s:[0],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:110.4,s:[100],o:{x:[.5],y:[.35]},i:{x:[.15],y:[1]}},{t:144.60000000000002,s:[0]}]}},ao:0,ip:0,op:240,st:0,bm:0,shapes:[{ty:"gr",nm:"Group",hd:!1,np:3,it:[{ty:"sh",nm:"Path",hd:!1,ks:{a:0,k:{c:!0,v:[[40,20],[20,40],[0,20],[20,0],[40,20],[40,20]],i:[[0,0],[11.046,0],[0,11.046],[-11.046,0],[0,-11.046],[0,0]],o:[[0,11.046],[-11.046,0],[0,-11.046],[11.046,0],[0,0],[0,0]]}}},{ty:"gf",o:{a:0,k:100},g:{p:6,k:{a:0,k:[0,1,1,1,.115,1,1,1,.2094,1,1,1,.7074,1,1,1,.8664,1,1,1,1,1,1,1,0,1,.115,1,.2094,.88,.7074,.23,.8664,.08,1,0]}},s:{a:0,k:[20.000004461093873,19.209036763697355]},e:{a:0,k:[20.000004461093873,.875419492625209]},t:2,nm:"Fill",hd:!1,r:1},{ty:"tr",a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}}]}]},{ty:3,ddd:0,ind:45,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:46,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:45,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:47,hd:!1,nm:"Group 39567 - Null",sr:1,parent:46,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:48,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:49,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:48,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:50,hd:!1,nm:"Group 39567 - Null",sr:1,parent:49,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:51,hd:!1,nm:"User 07a - Null",sr:1,parent:50,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:52,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:53,hd:!1,nm:"selfiescan2 - Null",sr:1,parent:52,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[24,24]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:54,hd:!1,nm:"Group 39567 - Null",sr:1,parent:53,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[-37.686,-24.6863]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:55,hd:!1,nm:"User 07a - Null",sr:1,parent:54,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ddd:0,ind:56,ty:0,nm:"User 07a",td:1,refId:"m256ewtth2xv0t9qlhe",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0},{ddd:0,ind:57,ty:0,nm:"User 07a",refId:"m6p6j2c85ejf13b5",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0,tt:1}]},{nm:"[FRAME] selfietuto - Null / selfietuto - Null / faceloop - Null / selfietuto - Null / faceloop - Null / faceloop / faceloop / selfiescan2",fr:60,id:"m6p6j2bzg8qe07hm",layers:[{ty:3,ddd:0,ind:58,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:59,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:60,hd:!1,nm:"faceloop - Null",sr:1,parent:59,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:61,hd:!1,nm:"selfietuto - Null",sr:1,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ty:3,ddd:0,ind:62,hd:!1,nm:"faceloop - Null",sr:1,parent:61,ks:{a:{a:0,k:[0,0]},o:{a:0,k:100},p:{a:0,k:[0,0]},r:{a:0,k:0},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0}},ao:0,ip:0,op:240,st:0,bm:0},{ddd:0,ind:63,ty:0,nm:"faceloop",td:1,refId:"m256ex281vb8hdk2ys3",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0},{ddd:0,ind:64,ty:0,nm:"faceloop",refId:"m6p6j2c0qs37vm69",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0,tt:1},{ddd:0,ind:65,ty:0,nm:"selfiescan2",refId:"m6p6j2c5c0l7uggl",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0}]}],layers$7=[{ddd:0,ind:1,ty:0,nm:"selfietuto",refId:"m6p6j2bzg8qe07hm",sr:1,ks:{a:{a:0,k:[0,0]},p:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},sa:{a:0,k:0},r:{a:0,k:0},o:{a:0,k:100}},ao:0,w:296,h:296,ip:0,op:240,st:0,hd:!1,bm:0}],meta$2={a:"",d:"",tc:"",g:"Aninix"},tutorialAnimationJson$2={fr:fr$7,v:v$7,ip:ip$7,op:op$7,w:w$7,h:h$8,nm:nm$7,ddd:ddd$7,markers:markers$7,assets:assets$7,layers:layers$7,meta:meta$2},defaultFlow$1={name:"",checkTutorials:!0,checkAuthorization:!0,redirectDesktopToMobile:!1,disableUnsupportedBrowserScreen:!1,qrPhishingResistance:!1,addContinueToDesktop:!1,redirectOriginOnly:!1,displayOnboardingResultOnDesktop:!1,enableMultipleOnboardings:!1,disableLaunchScreen:!1,disableSmsOption:!1,mergeSessionRecordings:!1,mandatoryConsentCheck:!0,enableSardineRisk:!1,flowModules:[{key:"PHONE",configuration:{otpVerification:!1,otpExpirationInMinutes:10,prefill:!1}},{key:"GEOLOCATION",configuration:{allowUserToSkipGeolocation:!1}},{key:"ID",configuration:{showTutorial:!0,enableId:!0,enablePassport:!0,onlyFront:!1,onlyBack:!1,barcodeCapture:!1,fetchAdditionalPage:!1,secondId:!1,thirdId:!1,autoCaptureTimeout:18,deviceIdleTimeout:60,captureAttempts:3,manualUploadIdCapture:!1,showDocumentChooserScreen:!0,enableIdRecording:!0,perCountryPerDocOverrides:{}}},{key:"ADDRESS",configuration:{disableSkipPoa:!1,title:"",text:""}},{key:"ID_OCR",configuration:{editableOcr:!1}},{key:"SELFIE",configuration:{showTutorial:!0,showPreview:!1,assistedOnboarding:!1,enableFaceRecording:!0,autoCaptureTimeout:20,captureAttempts:3,validateLenses:!0,validateFaceMask:!0,validateHeadCover:!0,validateClosedEyes:!0,validateBrightness:!0,deepsightLiveness:"SINGLE_FRAME"}},{key:"FACE_MATCH",configuration:{matchingType:"selfieVsId",disableFaceMatchAnimation:!1}},{key:"SIGNATURE",configuration:{title:"",subTitle:""}},{key:"VIDEO_ONBOARDING",configuration:{useAsSelfie:!1,showTutorials:!0,companyName:"",checkLiveness:!0,checkIdScan:!0,checkDocumentScan:!0,compareIdEnabled:!0,compareOcrEnabled:!1,compareBackIdEnabled:!1,compareBackOcrEnabled:!1,checkVoiceConsent:!0,voiceConsentQuestions:0,selfieQualityAffectsScore:!1,maxWaitingVideoSelfieFile:0,lastSecondsVideoQualityCheck:!1,lastSecondsVideoQualityCheckDuration:0}}]};function normalizeFlowModules(Be){const Le=Be.flatMap((ft,ht,gt)=>{if(ft.key==="TUTORIAL_ID"){const xt=ft.configuration,yt=[{key:"ID",configuration:xt}];return xt.secondId&&yt.push({key:"SECOND_ID",configuration:xt}),xt.thirdId&&yt.push({key:"THIRD_ID",configuration:xt}),yt}const At=gt[ht-1];return ft.key==="ID"&&(At==null?void 0:At.key)==="TUTORIAL_ID"?[]:[ft]}),Ye=ft=>ft,tt=ft=>ft.filter(ht=>ht.key!=="SELFIE");return(Le.some(ft=>ft.key==="VIDEO_ONBOARDING"&&ft.configuration.useAsSelfie===!0)?tt:Ye)(Le)}function handleResponse(Be){const Le=Be.data,Ye=normalizeFlowModules(Le.flowModules);return Le&&localStorage.setItem("ds",Le.ds?"1":"0"),{...Le,flowModules:Ye}}async function getFlow$1(Be){var Le;try{const Ye=await exports.api.get("/omni/onboarding/flow",{headers:{"X-Incode-Hardware-Id":Be}});return handleResponse(Ye)}catch(Ye){if(isAxiosError(Ye)&&((Le=Ye.response)==null?void 0:Le.status)===400)return defaultFlow$1;throw Ye}}const mergeUiConfig=(Be,Le)=>{var tt,nt;const Ye=getTokensFromDashboardTheme(Le);return{...Be,branding:{logo:Le.logo?{src:Le.logo,height:"100%"}:(tt=Be==null?void 0:Be.branding)==null?void 0:tt.logo,...Be==null?void 0:Be.branding},theming:{...Be==null?void 0:Be.theming,designTokens:{...Ye,...(nt=Be==null?void 0:Be.theming)==null?void 0:nt.designTokens}}}};var FlowType=(Be=>(Be.ID="ID",Be.FACE="Face",Be))(FlowType||{});class AbstractFlowManager{constructor(Le){this.subscribers=[],this.flow=null,this.sessionToken=null,this.captureConfig=null,this.captureConfiguration=null,this.parentSize={width:window.innerWidth,height:window.innerHeight},this.uiConfig=null;const Ye={currentStep:null,isLoading:!1,attempts:0,errorDetails:null,successData:null,flowOutcome:"pending",sessionToken:null,...Le};this.initialState=Object.freeze({...Ye}),this.state={...this.initialState}}async isPermissionsEnabled(){return navigator.permissions?(await navigator.permissions.query({name:"camera"})).state==="granted":!1}subscribe(Le){return this.subscribers.push(Le),Le(this.getState()),()=>{this.subscribers=this.subscribers.filter(Ye=>Ye!==Le)}}notifySubscribers(){const Le=this.getState();this.subscribers.forEach(Ye=>Ye(Le))}setState(Le){this.state={...this.state,...Le},this.notifySubscribers()}getState(){return{...this.state}}getToken(){return this.sessionToken}getParentSize(){return this.parentSize}incrementAttempts(){this.setState({attempts:this.state.attempts+1})}resetAttempts(){this.setState({attempts:0})}canRetry(){return this.state.attempts<this.getMaxAttempts()}getAttemptsLeft(){return Math.max(0,this.getMaxAttempts()-this.state.attempts)}async initialize(Le){var tt,nt;if(this.setState({isLoading:!0,errorDetails:null,flowOutcome:"pending",attempts:0,successData:null,sessionToken:Le.sessionToken}),this.parentSize=(tt=Le.parentSize)!=null&&tt.width&&((nt=Le.parentSize)!=null&&nt.height)?Le.parentSize:this.parentSize,this.sessionToken=Le.sessionToken,this.sessionToken&&Le.uiConfig){const ft=await getTheme(this.sessionToken);this.uiConfig=mergeUiConfig(Le.uiConfig,ft)}if(Le.captureConfig)this.captureConfig=Le.captureConfig;else try{this.flow=await this.fetchFlowConfiguration(this.sessionToken)}catch(ft){console.error("Failed to initialize FlowManager:",ft),this.setState({errorDetails:{message:"Failed to initialize FlowManager",error:ft,code:"FETCH_FLOW_ERROR"},isLoading:!1,flowOutcome:"error",currentStep:"error"});return}this.captureConfiguration=this.getCaptureConfiguration();const Ye=await this.determineInitialStep(this.captureConfiguration);this.setState({currentStep:Ye,isLoading:!1})}reset(){this.state={...this.initialState},this.flow=null,this.sessionToken=null,this.captureConfiguration=null,this.captureConfig=null,this.setState(this.state)}fetchFlowConfiguration(Le){return getFlow$1(Le)}getFlow(){return this.flow}onClose(Le){onboardingAnalytics.update(),MlWasmJSApi$1.reset(),this.completeWithError({code:"USER_CANCELLED",message:`User cancelled the ${Le} capture flow`,error:new Error("User cancelled")})}}class FaceFlowManager extends AbstractFlowManager{constructor(){super({currentStep:null}),this.deepsightVideoRecorder=null,this.mediaRecorder=null,this.authHint=null,this.isAuth=!1,this.shouldShowTutorialInCapture=!1,this.captureOnly=!1,this.onCapture=null}setRecorders(){this.getCaptureConfiguration().isDeepsightEnabled?this.deepsightVideoRecorder=new DeepsightVideoRecorder:this.getCaptureConfiguration().isRecordingEnabled&&(this.mediaRecorder=new MediaRecorder$3({token:this.sessionToken,type:"selfie",isAuthRecording:!1}))}async initialize(Le){this.authHint=Le.authHint,this.isAuth=Le.isAuth,this.captureOnly=Le.captureOnly??!1,this.onCapture=Le.onCapture??null,this.uiConfig=Le.uiConfig??null,await super.initialize(Le),this.setRecorders()}async determineInitialStep(Le){return await this.isPermissionsEnabled()?(this.shouldShowTutorialInCapture=Le.showTutorial,"capture"):Le.showTutorial?"tutorial":"permissions"}getMaxAttempts(){var Le;return((Le=this.captureConfiguration)==null?void 0:Le.selfieCaptureAttempts)||3}goToCapture(){this.setState({currentStep:"capture"})}goToPermissions(){this.setState({currentStep:"permissions"})}goToRetries(){this.setState({currentStep:"retries"})}async completeFlow(Le){this.setState({successData:Le,flowOutcome:"success",currentStep:"success"})}reset(){this.setState({currentStep:null,successData:null,errorDetails:null,flowOutcome:null})}completeWithError(Le){this.setState({flowOutcome:"error",currentStep:"error",errorDetails:Le})}setParentSize(Le){this.parentSize=Le}getCaptureConfiguration(){return this.isAuth?{...this.getAuthConfiguration(),isRecordingEnabled:!1,showPreview:!1,assistedOnboarding:!1,mergeSessionRecordings:!1,ageAssurance:!1,skipProcessFace:!0}:this.getFaceCaptureConfiguration()}getAuthConfiguration(){var tt;const Le=this.captureConfig;if(!this.flow&&!Le)return null;if(Le)return{showTutorial:Le.showTutorial,selfieCaptureAttempts:Le.captureAttempts??Le.numberOfAttempts??3,timeout:Le.autoCaptureTimeout*1e3,numberOfTries:Le.captureAttempts??Le.numberOfAttempts??3,maskCheckEnabled:Le.maskCheckEnabled??Le.validateFaceMask,lensesCheckEnabled:Le.lensesCheckEnabled??Le.validateLenses,hatCheckEnabled:Le.hatCheckEnabled??Le.validateHeadCover,eyesClosedCheckEnabled:Le.eyesClosedCheckEnabled??Le.validateClosedEyes,isDeepsightEnabled:Le.deepsightLiveness==="VIDEOLIVENESS"};const Ye=(tt=this.flow.flowModules.find(nt=>nt.key==="AUTHENTICATION"))==null?void 0:tt.configuration;return Ye?{showTutorial:Ye.showTutorial,selfieCaptureAttempts:Ye.numberOfAttempts,timeout:Ye.autoCaptureTimeout*1e3,numberOfTries:Ye.numberOfAttempts,maskCheckEnabled:Ye.validateFaceMask,lensesCheckEnabled:Ye.validateLenses,hatCheckEnabled:Ye.validateHeadCover,eyesClosedCheckEnabled:Ye.validateClosedEyes,isDeepsightEnabled:Ye.deepsightLiveness==="VIDEOLIVENESS"}:(this.completeWithError({code:"MODULE_NOT_FOUND",message:"Authentication module not found",error:new Error("Authentication module not found")}),null)}getFaceCaptureConfiguration(){var tt;const Le=this.captureConfig;if(!this.flow&&!Le)return null;if(Le)return{isRecordingEnabled:Le.isRecordingEnabled,showPreview:Le.showPreview,assistedOnboarding:Le.assistedOnboarding,showTutorial:Le.showTutorial,mergeSessionRecordings:!1,selfieCaptureAttempts:Le.captureAttempts??Le.numberOfAttempts??3,timeout:Le.autoCaptureTimeout*1e3,ageAssurance:Le.ageAssurance,numberOfTries:Le.captureAttempts??Le.numberOfAttempts??3,maskCheckEnabled:Le.maskCheckEnabled,lensesCheckEnabled:Le.lensesCheckEnabled,hatCheckEnabled:Le.hatCheckEnabled,eyesClosedCheckEnabled:Le.eyesClosedCheckEnabled,skipProcessFace:!0,isDeepsightEnabled:Le.deepsightLiveness==="VIDEOLIVENESS"};const Ye=(tt=this.flow.flowModules.find(nt=>nt.key==="SELFIE"))==null?void 0:tt.configuration;return Ye?{isRecordingEnabled:Ye.enableFaceRecording,showPreview:Ye.showPreview,assistedOnboarding:Ye.assistedOnboarding,showTutorial:Ye.showTutorial,mergeSessionRecordings:this.flow.mergeSessionRecordings,selfieCaptureAttempts:Ye.captureAttempts,timeout:Ye.autoCaptureTimeout*1e3,ageAssurance:this.flow.ageAssurance,isDeepsightEnabled:Ye.deepsightLiveness==="VIDEOLIVENESS",numberOfTries:Ye.captureAttempts,maskCheckEnabled:Ye.validateFaceMask,lensesCheckEnabled:Ye.validateLenses,hatCheckEnabled:Ye.validateHeadCover,eyesClosedCheckEnabled:Ye.validateClosedEyes,skipProcessFace:!0}:(this.completeWithError({code:"MODULE_NOT_FOUND",message:"Selfie module not found",error:new Error("Selfie module not found")}),null)}completeCaptureOnlyFlow(Le,Ye){var At;if(!this.captureOnly||!this.onCapture)return;const{blob:tt,url:nt}=Le.getBlobData(),ft=Le.getBase64Image();this.deepsightVideoRecorder||this.onCapture({image:{imageBase64:ft,blob:tt,url:nt},metadata:Ye});const ht=(At=this.deepsightVideoRecorder)==null?void 0:At.trimmedVideoBlob;if(!ht)throw new Error("Failed to get trimmed video");const gt=URL.createObjectURL(ht);this.onCapture({image:{imageBase64:ft,blob:tt,url:nt},metadata:Ye,trimmedVideo:{blob:ht,url:gt,mimeType:ht.type}})}onClose(){super.onClose(FlowType.FACE)}}const faceFlowManager=new FaceFlowManager,useFaceFlowState=()=>{const[Be,Le]=React.useState(faceFlowManager.getState());return React.useEffect(()=>{const Ye=faceFlowManager.subscribe(tt=>{Le(tt)});return()=>{Ye()}},[]),{...Be,goToCapture:faceFlowManager.goToCapture.bind(faceFlowManager),goToPermissions:faceFlowManager.goToPermissions.bind(faceFlowManager),completeFlow:faceFlowManager.completeFlow.bind(faceFlowManager),completeWithError:faceFlowManager.completeWithError.bind(faceFlowManager),reset:faceFlowManager.reset.bind(faceFlowManager),deepsightVideoRecorder:faceFlowManager.deepsightVideoRecorder,mediaRecorder:faceFlowManager.mediaRecorder,captureConfiguration:faceFlowManager.getCaptureConfiguration(),uiConfig:faceFlowManager.uiConfig,shouldShowTutorialInCapture:faceFlowManager.shouldShowTutorialInCapture,captureOnly:faceFlowManager.captureOnly,onCapture:faceFlowManager.onCapture,completeCaptureOnlyFlow:faceFlowManager.completeCaptureOnlyFlow.bind(faceFlowManager)}},Tutorial$2=({onContinue:Be,onClose:Le,isLoading:Ye})=>{const{t:tt}=useTranslation$1(),{uiConfig:nt,captureConfiguration:ft}=useFaceFlowState();return jsxRuntimeExports.jsx(BaseTutorial,{title:ft.ageAssurance?tt("face.tutorial.ageAssuranceTitle"):tt("face.tutorial.title"),subtitle:ft.ageAssurance?tt("face.tutorial.ageAssuranceSubtitle"):tt("face.tutorial.subtitle"),animationData:tutorialAnimationJson$2,onContinue:Be,buttonText:ft.ageAssurance?tt("face.tutorial.ageAssuranceStartCapture"):tt("face.tutorial.startCapture"),disclaimerText:tt("face.tutorial.autoCapture"),uiConfig:nt,onClose:Le,isLoading:Ye})},FACE_ERROR_CODES={FACE_OCCLUDED:"FACE_OCCLUDED",LIVENESS:"LIVENESS_ERROR",BRIGHTNESS:"BRIGHTNESS_ERROR",LENSES:"LENSES_ERROR",MASK:"MASK_ERROR",CLOSED_EYES:"CLOSED_EYES_ERROR",HEAD_COVER:"HEAD_COVER_ERROR",SERVER:"SERVER_ERROR",FACE_NOT_FOUND:"FACE_NOT_FOUND",MULTIPLE_FACES:"MULTIPLE_FACES",TOO_BLURRY:"TOO_BLURRY_ERROR",TOO_DARK:"TOO_DARK_ERROR",USER_IS_NOT_RECOGNIZED:"USER_IS_NOT_RECOGNIZED",SPOOF_ATTEMPT_DETECTED:"SPOOF_ATTEMPT_DETECTED",FACE_TOO_DARK:"FACE_TOO_DARK",LENSES_DETECTED:"LENSES_DETECTED",FACE_MASK_DETECTED:"FACE_MASK_DETECTED",CLOSED_EYES_DETECTED:"CLOSED_EYES_DETECTED",HEAD_COVER_DETECTED:"HEAD_COVER_DETECTED",FACE_CROPPING_FAILED:"FACE_CROPPING_FAILED",FACE_TOO_SMALL:"FACE_TOO_SMALL",FACE_TOO_BLURRY:"FACE_TOO_BLURRY",BAD_PHOTO_QUALITY:"BAD_PHOTO_QUALITY",PROCESSING_ERROR:"PROCESSING_ERROR",BAD_REQUEST:"BAD_REQUEST",NONEXISTENT_CUSTOMER:"NONEXISTENT_CUSTOMER",HINT_NOT_PROVIDED:"HINT_NOT_PROVIDED",SELFIE_IMAGE_LOW_QUALITY:"SELFIE_IMAGE_LOW_QUALITY"},handleScreenEvent$1=(Be,Le,Ye)=>{addScreenEvent({module:eventModuleNames.selfie,screen:Le,token:Be,shouldOpen:Ye,payload:{moduleVersion:"2"}})},isKnownError=Be=>Object.values(FACE_ERROR_CODES).some(Le=>Le===Be.message),handleError$1=(Be,Le)=>{throw handleScreenEvent$1(Be,eventScreenNames.faceCaptureUpload,!1),handleScreenEvent$1(Be,eventScreenNames.faceCaptureError,!0),new Error(Le)},sendFaceImage=async({canvas:Be,faceCoordinates:Le,sessionToken:Ye,imageType:tt="selfie"})=>{var nt,ft,ht;try{faceFlowManager.incrementAttempts(),handleScreenEvent$1(Ye,eventScreenNames.faceCaptureUpload,!0);const gt=Be.getBase64Image();await onboardingAnalytics.analyzeFrame(gt),onboardingAnalytics.update(),MlWasmJSApi$1.reset();const At=await MlWasmJSApi$1.encryptImage(gt);addEvent({token:Ye,code:"captureAttemptFinished",module:eventModuleNames.selfie,payload:{logs:onboardingAnalytics.getPipelineLogs(),moduleVersion:"2"}}),addDeviceStats(Ye,{inspectorOpened:null,frontIdStatsAnalysisStatus:"",backIdStatsAnalysisStatus:"",selfieStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),motionStatus:onboardingAnalytics.getMotionStatus()});const xt=await capture({token:Ye,image:At,type:"selfie",imageType:tt,encrypted:!0,faceCoordinates:Le,recordingId:(nt=faceFlowManager.deepsightVideoRecorder)==null?void 0:nt.recordingId,metadata:onboardingAnalytics.getMetadata()});return xt.confidence!==0&&handleError$1(Ye,FACE_ERROR_CODES.LIVENESS),xt.isBright||handleError$1(Ye,FACE_ERROR_CODES.BRIGHTNESS),xt.hasLenses&&handleError$1(Ye,FACE_ERROR_CODES.LENSES),xt.hasFaceMask&&handleError$1(Ye,FACE_ERROR_CODES.MASK),xt.hasClosedEyes&&handleError$1(Ye,FACE_ERROR_CODES.CLOSED_EYES),xt.hasHeadCover&&handleError$1(Ye,FACE_ERROR_CODES.HEAD_COVER),xt.liveness=xt.confidence===0,xt.imageBase64=gt,handleScreenEvent$1(Ye,eventScreenNames.faceCaptureUpload,!1),handleScreenEvent$1(Ye,eventScreenNames.faceCaptureSuccess,!0),xt}catch(gt){const At=gt,{status:xt}=At;if(gt instanceof Error&&isKnownError(gt))throw gt;if(xt===400){const Et=(ht=(ft=At.response)==null?void 0:ft.data)==null?void 0:ht.status,yt={3004:FACE_ERROR_CODES.FACE_NOT_FOUND,3005:FACE_ERROR_CODES.FACE_NOT_FOUND,3006:FACE_ERROR_CODES.TOO_BLURRY,3007:FACE_ERROR_CODES.TOO_DARK,4010:FACE_ERROR_CODES.MULTIPLE_FACES,4019:FACE_ERROR_CODES.FACE_NOT_FOUND,4077:FACE_ERROR_CODES.BAD_PHOTO_QUALITY,4078:FACE_ERROR_CODES.FACE_OCCLUDED},Ct=Et?yt[Et]:null;throw Ct&&handleError$1(Ye,Ct),new Error(FACE_ERROR_CODES.SERVER)}throw new Error(FACE_ERROR_CODES.SERVER)}},handleScreenEvent=(Be,Le,Ye)=>{addScreenEvent({module:eventModuleNames.authFace,screen:Le,token:Be,shouldOpen:Ye})},handleError=(Be,Le)=>{throw handleScreenEvent(Be,eventScreenNames.authFaceUpload,!1),handleScreenEvent(Be,eventScreenNames.authFaceError,!0),new Error(Le)},sendAuthFaceImage=async({canvas:Be,faceCoordinates:Le,sessionToken:Ye})=>{var tt,nt;try{faceFlowManager.incrementAttempts(),handleScreenEvent(Ye,eventScreenNames.authFaceUpload,!0);const ft=Be.getBase64Image();await onboardingAnalytics.analyzeFrame(ft),onboardingAnalytics.update(),MlWasmJSApi$1.reset();const ht=await MlWasmJSApi$1.encryptImage(ft);addEvent({token:Ye,code:"captureAttemptFinished",module:eventModuleNames.authFace,payload:{logs:onboardingAnalytics.getPipelineLogs()}}),addDeviceStats(Ye,{inspectorOpened:null,frontIdStatsAnalysisStatus:"",backIdStatsAnalysisStatus:"",selfieStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),motionStatus:onboardingAnalytics.getMotionStatus()});const gt=await capture({type:"authFace",token:Ye,image:ht,authHint:faceFlowManager.authHint,encrypted:!0,faceCoordinates:Le,recordingId:(tt=faceFlowManager.deepsightVideoRecorder)==null?void 0:tt.recordingId,metadata:onboardingAnalytics.getMetadata()});if(gt.overallStatus!=="PASS"){if(faceFlowManager.getAttemptsLeft()===0){handleScreenEvent(Ye,eventScreenNames.authFaceUpload,!1),handleScreenEvent(Ye,eventScreenNames.authFaceError,!0),faceFlowManager.completeWithError({code:"NO_MORE_ATTEMPTS",message:"No more attempts",error:new Error("No more attempts")});return}throw gt.error.name==="SPOOF_ATTEMPT_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.SPOOF_ATTEMPT_DETECTED),gt.error.name==="FACE_TOO_DARK"&&handleError(Ye,FACE_ERROR_CODES.FACE_TOO_DARK),gt.error.name==="LENSES_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.LENSES_DETECTED),gt.error.name==="FACE_MASK_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.FACE_MASK_DETECTED),gt.error.name==="CLOSED_EYES_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.CLOSED_EYES_DETECTED),gt.error.name==="HEAD_COVER_DETECTED"&&handleError(Ye,FACE_ERROR_CODES.HEAD_COVER_DETECTED),gt.error.name==="FACE_NOT_FOUND"&&handleError(Ye,FACE_ERROR_CODES.FACE_NOT_FOUND),gt.error.name==="FACE_CROPPING_FAILED"&&handleError(Ye,FACE_ERROR_CODES.FACE_CROPPING_FAILED),gt.error.name==="FACE_TOO_SMALL"&&handleError(Ye,FACE_ERROR_CODES.FACE_TOO_SMALL),gt.error.name==="FACE_TOO_BLURRY"&&handleError(Ye,FACE_ERROR_CODES.FACE_TOO_BLURRY),gt.error.name==="BAD_PHOTO_QUALITY"&&handleError(Ye,FACE_ERROR_CODES.BAD_PHOTO_QUALITY),gt.error.name==="PROCESSING_ERROR"&&handleError(Ye,FACE_ERROR_CODES.PROCESSING_ERROR),gt.error.name==="BAD_REQUEST"&&handleError(Ye,FACE_ERROR_CODES.BAD_REQUEST),gt.error.name==="SERVER"&&handleError(Ye,FACE_ERROR_CODES.SERVER),gt.error.name==="USER_IS_NOT_RECOGNIZED"&&handleError(Ye,FACE_ERROR_CODES.USER_IS_NOT_RECOGNIZED),gt.error.name==="NONEXISTENT_CUSTOMER"&&(handleScreenEvent(Ye,eventScreenNames.authFaceUpload,!1),handleScreenEvent(Ye,eventScreenNames.authFaceError,!0),faceFlowManager.completeWithError({code:"NONEXISTENT_CUSTOMER",message:"Non-existent customer",error:new Error("Non-existent customer")})),gt.error.name==="HINT_NOT_PROVIDED"&&(handleScreenEvent(Ye,eventScreenNames.authFaceUpload,!1),handleScreenEvent(Ye,eventScreenNames.authFaceError,!0),faceFlowManager.completeWithError({code:"HINT_NOT_PROVIDED",message:"Hint not provided",error:new Error("Hint not provided")})),new Error(gt.error.name)}return gt.imageBase64=ft,gt.selfieEncryptedBase64=ht,gt.metadata=onboardingAnalytics.getMetadata(),gt.videoFileURL=(nt=faceFlowManager.deepsightVideoRecorder)==null?void 0:nt.videoFileURL,gt}catch(ft){throw ft instanceof Error&&isKnownError(ft)?ft:new Error(FACE_ERROR_CODES.SERVER)}};class DetectionManager{constructor(){this.faceDetection=null,this.manualCaptureHasTriggered=!1,this.subscribers=[],this.config=null,this.getCanvas=null,this.processFrame=async()=>{if(!(this.state.isProcessingLocked||this.state.detectionState==="capturing"||!this.getCanvas)){if(!this.faceDetection)throw new Error("Face detection not initialized");this.setState({isProcessingLocked:!0});try{await MlWasmJSApi$1.handleDetectionCallAndUpdateState(detectionSetup.getProfile(DetectionType.Selfie).pipelineType);const Le=this.getCanvas();if(!Le)return;await this.faceDetection.detect(Le)}finally{await sleep(100),this.setState({isProcessingLocked:!1})}}},this.state={detectionState:"detecting",isProcessingLocked:!1,borderState:"idle",capturedImage:null},window.addEventListener("offline",()=>{this.setState({detectionState:"offline"}),this.stopDetection()}),window.addEventListener("online",()=>{this.setState({detectionState:"detecting"}),this.startDetection()}),this.startDetection()}setState(Le){this.state={...this.state,...Le},this.notifySubscribers()}notifySubscribers(){this.subscribers.forEach(Le=>Le(this.state))}getState(){return this.state}subscribe(Le){return this.subscribers.push(Le),Le(this.state),()=>{this.subscribers=this.subscribers.filter(Ye=>Ye!==Le)}}unsubscribe(Le){this.subscribers=this.subscribers.filter(Ye=>Ye!==Le)}setGetCanvas(Le){this.getCanvas=Le}switchToManualCapture(){addEvent({code:"switchToManualCaptureSelfie",token:faceFlowManager.getToken()}),this.stopDetection(),this.manualCaptureHasTriggered=!0,this.setState({detectionState:"manualCapture"})}async detectVirtualCamera(){const Le={canvas:null,itr:null,skipped:null};if(await MlWasmJSApi$1.poc(Le),(Le==null?void 0:Le.skipped)===!1){if(Le!=null&&Le.canvas){const tt=new IncodeCanvas(Le.canvas).getBase64Image();logFrame({token:faceFlowManager.getToken(),base64Image:tt,source:sources.selfie})}(Le==null?void 0:Le.itr)===!0?(addDeviceStats(faceFlowManager.getToken(),{virtualCameraDetected:!0}),MlWasmJSApi$1.setZc("FAIL")):MlWasmJSApi$1.setZc("PASS")}}async capture(Le,Ye){var tt,nt,ft,ht,gt,At;this.stopDetection(),this.setState({borderState:"capturing",detectionState:"capturing",capturedImage:Le.getBase64Image()}),await((tt=faceFlowManager.deepsightVideoRecorder)==null?void 0:tt.stopRecording(faceFlowManager.getToken(),faceFlowManager.captureOnly)),await this.detectVirtualCamera();try{const xt=await((nt=this.config)==null?void 0:nt.onCapture(Le,Ye));this.setState({borderState:"success",detectionState:"success"}),await sleep(3e3),(ht=(ft=this.config)==null?void 0:ft.onFinish)==null||ht.call(ft,xt)}catch(xt){this.setState({borderState:"error",detectionState:"error",capturedImage:null}),(At=(gt=this.config)==null?void 0:gt.onError)==null||At.call(gt,xt)}}async initialize(Le){this.config=Le,this.faceDetection=new FaceDetection;const Ye=faceFlowManager.getCaptureConfiguration();await this.faceDetection.initialize({onNoFace:emptyFunc,onCaptureFace:emptyFunc,onTooManyFaces:()=>this.setState({detectionState:"tooManyFaces"}),onTooClose:()=>this.setState({detectionState:"tooClose"}),onCenterFace:()=>this.setState({detectionState:"centerFace"}),onFarAway:()=>this.setState({detectionState:"tooFar"}),onGetReady:()=>this.setState({borderState:"loading",detectionState:"getReady"}),onGetReadyFinished:()=>this.setState({borderState:"idle",detectionState:"getReadyFinished"}),onBlur:()=>this.setState({detectionState:"blur"}),onDark:()=>this.setState({detectionState:"dark"}),onFaceAngle:()=>this.setState({detectionState:"faceAngle"}),onHeadWear:()=>this.setState({detectionState:"headWear"}),onLenses:()=>this.setState({detectionState:"lenses"}),onEyesClosed:()=>this.setState({detectionState:"eyesClosed"}),onFaceMask:()=>this.setState({detectionState:"faceMask"}),onSwitchToManualCapture:()=>this.switchToManualCapture(),onCapture:(tt,nt)=>this.capture(tt,nt),onFaceOccluded:()=>{},isLensesCheckEnabled:Ye.lensesCheckEnabled,isMaskCheckEnabled:Ye.maskCheckEnabled,isClosedEyesCheckEnabled:Ye.eyesClosedCheckEnabled,isHeadWearCheckEnabled:Ye.hatCheckEnabled,isVideoSelfie:!1,autocaptureTimeout:Ye.timeout,pipelineProfile:detectionSetup.getProfile(DetectionType.Selfie)})}startDetection(){if(this.manualCaptureHasTriggered){this.setState({detectionState:"manualCapture"});return}this.setState({detectionState:"detecting",isProcessingLocked:!1}),onFrameEmitter.on("newFrame",this.processFrame)}stopDetection(){onFrameEmitter.off("newFrame",this.processFrame)}}const useFaceDetection=({getCanvas:Be,onCapture:Le,onFinish:Ye,onError:tt})=>{const nt=React.useRef(null),[ft,ht]=React.useState(null),gt=React.useRef(Be),At=React.useRef(Le),xt=React.useRef(Ye),Et=React.useRef(tt);return React.useEffect(()=>{gt.current=Be,At.current=Le,xt.current=Ye,Et.current=tt},[Be,Le,Ye,tt]),React.useEffect(()=>{nt.current=new DetectionManager,ht(nt.current.getState());const yt=nt.current;yt.setGetCanvas(gt.current),yt.initialize({onCapture:(kt,vt)=>At.current(kt,vt),onFinish:kt=>{var vt;return(vt=xt.current)==null?void 0:vt.call(xt,kt)},onError:kt=>{var vt;return(vt=Et.current)==null?void 0:vt.call(Et,kt)}}),nt.current=yt;const Ct=kt=>{ht(kt)};return yt.subscribe(Ct),()=>{yt.stopDetection(),yt.unsubscribe(Ct)}},[]),{detectionState:ft==null?void 0:ft.detectionState,borderState:ft==null?void 0:ft.borderState,capturedImage:ft==null?void 0:ft.capturedImage,startDetection:()=>{var yt;return(yt=nt.current)==null?void 0:yt.startDetection()},stopDetection:()=>{var yt;return(yt=nt.current)==null?void 0:yt.stopDetection()},capture:yt=>{var Ct;return(Ct=nt.current)==null?void 0:Ct.capture(yt)}}};function useFaceCaptureAspectRatio(Be){var tt;const[Le,Ye]=React.useState();return React.useEffect(()=>{if(typeof window.CSS<"u"&&window.CSS.supports("aspect-ratio","1")){Ye(void 0);return}function ft(){var gt;const ht=((gt=Be.current)==null?void 0:gt.offsetWidth)??0;Ye(ht*1)}return ft(),window.addEventListener("resize",ft),()=>window.removeEventListener("resize",ft)},[Be,Be.current,(tt=Be.current)==null?void 0:tt.offsetWidth]),{height:Le}}const FaceFlowPage=Be=>{const{uiConfig:Le}=useFaceFlowState();return jsxRuntimeExports.jsx(FlowPage,{uiConfig:Le,onClose:()=>faceFlowManager.onClose(),onCloseCancel:Be.closeButtonOnCancel,...Be})},CaptureOverlay$1=({capturedImage:Be,detectionState:Le})=>Le!=="capturing"&&Le!=="success"?null:jsxRuntimeExports.jsx(Flex,{w:"100%",h:"100%",position:"absolute",top:0,left:0,bg:"#f5f5f6",zIndex:2,justify:"center",align:"center",children:jsxRuntimeExports.jsx(PreviewImage,{src:`data:image/jpeg;base64,${Be}`})}),defaultError={title:"Something went wrong",description:"Please try again later"},errorContent={FACE_OCCLUDED:{title:"notifications.faceOccluded",description:"notifications.faceOccludedDescription"},MASK_ERROR:{title:"notifications.mask",description:"notifications.maskDescription"},BRIGHTNESS_ERROR:{title:"notifications.brightness",description:"notifications.brightnessDescription"},LIVENESS_ERROR:{title:"notifications.spoof",description:"notifications.spoofDescription"},CLOSED_EYES_ERROR:{title:"notifications.closedEyes",description:"notifications.closedEyesDescription"},HEAD_COVER_ERROR:{title:"notifications.removeHeadwear",description:"notifications.removeHeadwearDescription"},LENSES_ERROR:{title:"notifications.lenses",description:"notifications.lensesDescription"},FACE_NOT_FOUND:{title:"notifications.faceNotFound",description:"notifications.faceNotFoundDescription"},MULTIPLE_FACES:{title:"notifications.multiple",description:"notifications.multipleDescription"},TOO_BLURRY_ERROR:defaultError,TOO_DARK_ERROR:defaultError,SERVER_ERROR:defaultError,FACE_CROPPING_FAILED:defaultError,FACE_TOO_SMALL:defaultError,PROCESSING_ERROR:defaultError,BAD_REQUEST:defaultError,USER_IS_NOT_RECOGNIZED:{title:"notifications.accessDenied",description:"notifications.accessDeniedDescription"},SPOOF_ATTEMPT_DETECTED:{title:"notifications.spoof",description:"notifications.spoofDescription"},FACE_TOO_DARK:{title:"notifications.brightness",description:"notifications.brightnessDescription"},LENSES_DETECTED:{title:"notifications.lenses",description:"notifications.lensesDescription"},FACE_MASK_DETECTED:{title:"notifications.mask",description:"notifications.maskDescription"},CLOSED_EYES_DETECTED:{title:"notifications.closedEyes",description:"notifications.closedEyesDescription"},HEAD_COVER_DETECTED:{title:"notifications.removeHeadwear",description:"notifications.removeHeadwearDescription"},FACE_TOO_BLURRY:{title:"notifications.spoof",description:"notifications.spoofDescription"},BAD_PHOTO_QUALITY:{title:"notifications.lowQualityImage",description:"notifications.lowQualityImageDescription"},NONEXISTENT_CUSTOMER:{title:"notifications.nonexistentCustomer",description:"notifications.nonexistentCustomerDescription"},HINT_NOT_PROVIDED:{title:"notifications.hintNotProvided",description:"notifications.hintNotProvidedDescription"},SELFIE_IMAGE_LOW_QUALITY:{title:"notifications.selfieImageLowQuality",description:"notifications.selfieImageLowQualityDescription"}},ErrorModalContent=({title:Be,description:Le,attemptsText:Ye,buttonText:tt,icon:nt,onButtonClick:ft,onCloseCancel:ht})=>{const gt=useTokens();return jsxRuntimeExports.jsx(Modal$3,{open:!0,children:jsxRuntimeExports.jsx(FaceFlowPage,{"data-testid":"face-capture-error-modal",onCloseCancel:ht,children:jsxRuntimeExports.jsx(Flex,{align:"center",justify:"center",direction:"column",wFull:!0,hFull:!0,children:jsxRuntimeExports.jsxs(Flex,{wFull:!0,hFull:!0,bg:gt.color.surface.neutral.light,minW:"320px",direction:"column",justify:"space-between",px:2,children:[jsxRuntimeExports.jsx(Box,{}),jsxRuntimeExports.jsxs(Flex,{direction:"column",align:"center",children:[nt,jsxRuntimeExports.jsx(Spacer,{size:6}),jsxRuntimeExports.jsx(Text$7,{as:"h2",fontSize:gt.typography.fontSize["2xl"],fontWeight:700,textAlign:"center",lineHeight:"114%",letterSpacing:"-0.5px",children:Be}),jsxRuntimeExports.jsx(Spacer,{size:4}),jsxRuntimeExports.jsx(Text$7,{as:"p",fontSize:gt.typography.fontSize.base,textAlign:"center",color:gt.color.text.body.secondary,fontWeight:500,lineHeight:"114%",letterSpacing:"-0.5px",children:Le})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",align:"center",children:[jsxRuntimeExports.jsx(Text$7,{as:"p",fontSize:gt.typography.fontSize.lg,textAlign:"center",color:gt.color.text.body.secondary,fontWeight:500,lineHeight:"114%",letterSpacing:"-0.5px",children:Ye}),jsxRuntimeExports.jsx(Spacer,{size:6}),jsxRuntimeExports.jsx(Button$b,{onClick:ft,children:tt})]})]})})})})},NoMoreAttemptsModal=({title:Be,onContinue:Le,onCloseCancel:Ye})=>{const{t:tt}=useTranslation$1();return jsxRuntimeExports.jsx(ErrorModalContent,{title:Be,description:tt("notifications.selfieCaptureFailedDescription"),attemptsText:tt("notifications.noAttemptsRemaining"),buttonText:tt("common.continue"),icon:jsxRuntimeExports.jsx(ErrorIcon$1,{}),onButtonClick:Le,onCloseCancel:Ye})},RetryErrorModal=({title:Be,description:Le,attemptsRemaining:Ye,onTryAgain:tt,onCloseCancel:nt})=>{const{t:ft}=useTranslation$1();return jsxRuntimeExports.jsx(ErrorModalContent,{title:Be,description:ft(Le),attemptsText:ft("common.attemptsRemaining",{count:Ye}),buttonText:ft("common.tryAgain"),icon:jsxRuntimeExports.jsx(WarningIcon,{}),onButtonClick:tt,onCloseCancel:nt})},ErrorModal=({error:Be,onTryAgain:Le,onContinue:Ye,onCloseCancel:tt})=>{const{attempts:nt,captureConfiguration:ft}=useFaceFlowState(),{t:ht}=useTranslation$1();if(!Be)return null;const{title:gt,description:At}=errorContent[Be]??defaultError,xt=ft.selfieCaptureAttempts-nt;return xt<=0?jsxRuntimeExports.jsx(NoMoreAttemptsModal,{title:ht(gt),onContinue:Ye,onCloseCancel:tt}):jsxRuntimeExports.jsx(RetryErrorModal,{title:ht(gt),description:At,attemptsRemaining:xt,onTryAgain:Le,onCloseCancel:tt})},SvgOutline=Be=>React__namespace.createElement("svg",{width:292,height:272,viewBox:"0 0 292 272",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{opacity:.8,d:"M145.633 8.0625C115.606 8.06268 85.6206 26.5984 76.9712 54.293L76.771 54.9492C70.4539 76.1063 75.0139 100.802 76.8687 110.58L77.3628 113.188L75.1528 114.656C66.1187 120.66 63.5861 124.089 62.8472 126.92C62.4669 128.377 62.4644 130.035 62.8003 132.412C63.1635 134.983 63.7533 137.484 64.4233 141.347L64.5142 141.841C65.5056 146.956 68.1062 152.133 71.2749 156.618C74.5527 161.257 78.2056 164.826 80.7349 166.584L82.4517 167.777V169.869C82.4517 177.866 85.3476 186.144 89.6763 194.128C93.9906 202.085 99.5748 209.473 104.623 215.646L105.526 216.751V218.178C105.526 220.891 105.68 223.73 105.801 226.9C105.92 230.011 106.003 233.347 105.828 236.771C105.475 243.652 104.077 251.044 99.7446 258.227C91.1977 272.397 72.1081 284.401 31.8677 291.776L29.936 292.124C-41.1597 304.684 -61.4563 361.617 -63.2153 392.062H145.633V400.062H-71.3638L-71.3462 396.044C-71.2048 364.597 -50.9804 298.295 28.5444 284.246L30.4448 283.904C69.9919 276.654 86.1642 265.253 92.894 254.095C96.3216 248.412 97.5261 242.442 97.8374 236.362C97.9939 233.307 97.9241 230.262 97.8071 227.206C97.7111 224.697 97.5799 222.105 97.5396 219.615C92.5931 213.5 87.048 206.064 82.644 197.941C78.308 189.944 74.9442 181.04 74.5024 171.896C71.3932 169.387 67.8531 165.638 64.7417 161.234C61.1656 156.173 57.9337 149.942 56.6587 143.353L56.5415 142.714C55.9864 139.514 55.2491 136.155 54.8784 133.531C54.4806 130.715 54.3377 127.843 55.106 124.899C56.5344 119.427 60.7885 114.886 68.5259 109.489C66.4692 98.2995 62.7062 74.0938 69.106 52.6602L69.3345 51.9092C79.2266 20.2173 112.853 0.0626788 145.633 0.0625V8.0625ZM145.635 0.0625C178.415 0.0625 212.042 20.2172 221.934 51.9092L222.163 52.6602C228.562 74.0938 224.799 98.2996 222.743 109.489C230.48 114.886 234.734 119.427 236.163 124.899C236.931 127.843 236.788 130.715 236.39 133.531C236.019 136.155 235.282 139.514 234.727 142.714L234.61 143.353C233.335 149.942 230.103 156.173 226.527 161.234C223.415 165.638 219.875 169.387 216.766 171.896C216.324 181.04 212.961 189.944 208.625 197.941C204.221 206.064 198.676 213.5 193.729 219.615C193.689 222.105 193.557 224.697 193.461 227.206C193.344 230.262 193.275 233.307 193.431 236.362C193.742 242.442 194.947 248.412 198.375 254.095C205.104 265.253 221.277 276.654 260.824 283.904L262.724 284.246C342.249 298.294 362.473 364.597 362.615 396.044L362.632 400.062H145.635V392.062H354.484C352.725 361.616 332.429 304.683 261.333 292.124L259.401 291.776C219.161 284.401 200.071 272.397 191.524 258.227C187.192 251.044 185.793 243.652 185.441 236.771C185.266 233.347 185.348 230.011 185.467 226.9C185.589 223.73 185.743 220.891 185.743 218.178V216.751L186.646 215.646C191.694 209.473 197.278 202.085 201.592 194.128C205.921 186.144 208.817 177.866 208.817 169.869V167.777L210.534 166.584C213.063 164.826 216.716 161.257 219.994 156.618C223.162 152.133 225.763 146.956 226.754 141.841L226.845 141.347C227.515 137.484 228.105 134.983 228.468 132.412C228.804 130.034 228.802 128.377 228.421 126.92C227.682 124.089 225.15 120.66 216.116 114.656L213.906 113.188L214.4 110.58C216.255 100.802 220.815 76.1064 214.498 54.9492L214.297 54.293C205.648 26.5983 175.662 8.0625 145.635 8.0625V0.0625Z",fill:"white"})),FaceOutline=({height:Be="100%"})=>jsxRuntimeExports.jsx(Box,{position:"absolute",bottom:0,left:"50%",transform:"translateX(-50%)",zIndex:1,h:Be,children:jsxRuntimeExports.jsx(SvgOutline,{title:"Outline",height:"100%"})});function getFill(Be,Le){return Be==="loading"||Be==="capturing"?`url(#paint0_radial_2423_448_${Le.replace("#","")})`:Le}const StyledPath=dt.path`
3720
3720
  transition: all 1s ease-in-out;
3721
3721
  fill: ${({$borderState:Be,$color:Le})=>getFill(Be,Le)};
3722
3722
  `,getColor=(Be,Le)=>{var Ye,tt,nt,ft,ht,gt;return Be==="success"||Be==="capturing"?(tt=(Ye=Le.primitives)==null?void 0:Ye.color)==null?void 0:tt.positive[600]:Be==="loading"?(ft=(nt=Le==null?void 0:Le.color)==null?void 0:nt.brand)==null?void 0:ft.brand:(gt=(ht=Le==null?void 0:Le.primitives)==null?void 0:ht.color)==null?void 0:gt.gray[100]},LoadingBorder=({width:Be="100%",height:Le="100%",borderState:Ye})=>{const tt=useTokens(),nt=Ye==="loading"||Ye==="capturing",ft=getColor(Ye,tt),ht=React.useRef(null),{height:gt}=useFaceCaptureAspectRatio(ht);return jsxRuntimeExports.jsx(Box,{ref:ht,position:"absolute",w:"100%",xsW:"80%",maxW:"335px",aspectRatio:1,spin:nt,style:{height:gt?`${gt}px`:void 0},children:jsxRuntimeExports.jsxs("svg",{width:Be,height:Le,viewBox:"0 0 335 335",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("title",{children:"Loading Border"}),jsxRuntimeExports.jsx(StyledPath,{$color:ft,$borderState:Ye,fillRule:"evenodd",clipRule:"evenodd",d:"M335 167.5C335 260.008 260.008 335 167.5 335C74.9923 335 0 260.008 0 167.5C0 74.9923 74.9923 0 167.5 0C260.008 0 335 74.9923 335 167.5ZM167.5 325C254.485 325 325 254.485 325 167.5C325 80.5152 254.485 10 167.5 10C80.5152 10 10 80.5152 10 167.5C10 254.485 80.5152 325 167.5 325Z"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("radialGradient",{id:`paint0_radial_2423_448_${ft.replace("#","")}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(240.418 17.4369) rotate(115.674) scale(167.087)",children:[jsxRuntimeExports.jsx("stop",{stopColor:ft}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:ft,stopOpacity:"0"})]})})]})})},StyledSvg=dt.svg`
@@ -10165,7 +10165,7 @@ newPrivacyConsent.text4
10165
10165
  flex-direction: column;
10166
10166
  overflow: auto;
10167
10167
  gap: 10px;
10168
- `,viewStates$1={LOADING:"LOADING",SUCCESS:"SUCCESS"},CustomWatchList=({token:Be,onSuccess:Le})=>{const{t:Ye}=useTranslation$1(),[tt,nt]=React.useState(viewStates$1.LOADING);return React.useEffect(()=>{(async()=>{addScreenEvent({module:eventModuleNames.customWatchList,screen:eventScreenNames.customWatchListProgress,token:Be.token,shouldOpen:!0});const ht=await processWatchlist({token:Be.token});addEvent({token:Be.token,code:"processWatchlist",payload:ht}),addScreenEvent({module:eventModuleNames.customWatchList,screen:eventScreenNames.customWatchListProgress,token:Be.token,shouldOpen:!1}),nt(viewStates$1.SUCCESS),addScreenEvent({module:eventModuleNames.customWatchList,screen:eventScreenNames.customWatchListSuccess,token:Be.token,shouldOpen:!0}),sleep(3e3).then(()=>{addScreenEvent({module:eventModuleNames.customWatchList,screen:eventScreenNames.customWatchListSuccess,token:Be.token,shouldOpen:!1}),Le()})})()},[Be]),jsxRuntimeExports.jsxs(WatchListContainer,{children:[tt===viewStates$1.LOADING&&jsxRuntimeExports.jsx(Loader,{fullScreen:!0,message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h1",{children:Ye("watchList.uploading")}),jsxRuntimeExports.jsx("span",{children:Ye("watchList.thisMigthTake")}),jsxRuntimeExports.jsx("span",{children:Ye("watchList.browser")})]})}),tt===viewStates$1.SUCCESS&&jsxRuntimeExports.jsx(SuccessMessage,{})]})};function processGlobalWatchlist({token:Be}){return exports.api.post("/omni/process/global-watchlist",{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}const viewStates={LOADING:"LOADING",SUCCESS:"SUCCESS"},GlobalWatchList=({onSuccess:Be,token:Le})=>{const{t:Ye}=useTranslation$1(),[tt,nt]=React.useState(viewStates.LOADING);return React.useEffect(()=>{async function ft(){try{await processGlobalWatchlist({token:Le.token}),nt(viewStates.SUCCESS)}catch(ht){console.error(ht)}setTimeout(()=>Be(),3e3)}ft()},[Le]),jsxRuntimeExports.jsx(WatchListContainer,{children:tt===viewStates.SUCCESS?jsxRuntimeExports.jsx(SuccessMessage,{}):jsxRuntimeExports.jsx(Loader,{fullScreen:!0,message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h1",{children:Ye("watchList.processing")}),jsxRuntimeExports.jsx("span",{children:Ye("watchList.thisMigthTake")}),jsxRuntimeExports.jsx("span",{children:Ye("watchList.browser")})]})})})};function CustomWatchListModule({onSuccess:Be,token:Le}){return jsxRuntimeExports.jsx(CustomWatchList,{onSuccess:Be,token:{token:Le}})}function GlobalWatchListModule({onSuccess:Be,token:Le}){return jsxRuntimeExports.jsx(GlobalWatchList,{onSuccess:Be,token:{token:Le}})}const moduleComponents={ADDRESS:AddressModule,EMAIL:EmailModule,SELFIE:SelfieModule,ANTIFRAUD:AntifraudModule,PHONE:PhoneModule,COMBINED_CONSENT:CombinedConsentModule,USER_CONSENT:UserConsentModule,GEOLOCATION:GeolocationModule,AUTHENTICATION:AuthenticationModule,ID:IdModule,SECOND_ID:SecondIdModule,THIRD_ID:ThirdIdModule,FACE_MATCH:FaceMatchModule,GOVT_VALIDATION_PROVISIONING:GovernmentValidationModule,CURP_VALIDATION:CurpModule,INCODE_WATCHLIST:CustomWatchListModule,WATCHLIST:GlobalWatchListModule,TRUST_GRAPH:TrustGraphModule,SIGNATURE:SignatureModule,QE_SIGNATURE:QESignatureModule,AE_SIGNATURE:AESignatureModule,CERTIFICATE_ISSUANCE:CertificateIssuanceModule,DOCUMENT_CAPTURE:DocumentCaptureModule,DYNAMIC_FORMS:FormsModule,NFC_SCAN:NFCScanModule,EKYB:EkybModule,WATCHLIST_BUSINESS:SkipModule,EXTERNAL_VERIFICATION:EkycModule,FINISH_GPT:SkipModule,CONFERENCE:ConferenceModule,FISCAL_QR:FiscalQRModule,INSTANT_BAV:BAVModule,FACE_ONBOARDING:SkipModule,FIELD_COMPARISON:FieldComparisonModule,SHOW_RESULTS:ShowResultsModule,CHECKBOX_SIGNATURE:SkipModule,VIDEO_ONBOARDING:VideoSelfieModule,ID_OCR:IDOCRModule,CUSTOM_FIELDS:CustomFieldsModule,INE_VALIDATION:GovernmentValidationModule,TUTORIAL_ID:IdModule,ML_CONSENT:MLConsentModule,CROSS_DOCUMENT_DATA_MATCH:CrossDocumentDataMatchModule,DEVICE_FINGERPRINT:SkipModule,INSTANT_VERIFY:SkipModule,IP_ADDRESS:SkipModule,NAME_CAPTURE:NameCaptureModule,UNIVERSAL_IDENTITY:SkipModule};function ModuleRenderer({module:Be,onSuccess:Le,emit:Ye,token:tt,onError:nt,flow:ft,uiConfig:ht,finishWithError:gt,startConfig:At,authHint:xt}){const Et=moduleComponents[Be.key]||SkipModule;return jsxRuntimeExports.jsx(Et,{config:Be.configuration,onSuccess:Le,emit:Ye,token:tt,onError:nt,flow:ft,uiConfig:ht,finishWithError:gt,startConfig:At,authHint:xt},Be.key)}function FlowRenderer({token:Be,onError:Le,onSuccess:Ye,onEvent:tt=()=>{},flow:nt,uiConfig:ft,startConfig:ht,authHint:gt}){const{flow:At,loading:xt,error:Et}=useFlow(Be,nt),[yt,Ct]=React.useState(0),[kt,vt]=React.useState(!1),bt=React.useMemo(()=>new FlowLogger(tt),[tt]),{showRedirect:It,onSkip:wt}=useFlowRedirect({flow:At,forceSkipRedirect:ht==null?void 0:ht.forceSkipRedirect});if(React.useEffect(()=>{At&&(bt.flowStarted(At.flowModules.length),It?bt.flowRedirected():bt.stepStarted(At.flowModules[0].key,0,At.flowModules.length))},[At,bt,It]),xt)return null;if(Et){const Dt={type:"FLOW_LOAD_FAILED",message:Et};return Le(Dt),bt.flowError(Dt),null}if(!At)return null;const Rt=At.flowModules,Tt=Rt[yt],Bt=async()=>{const Dt=Rt.length;bt.stepCompleted(Tt.key,yt,Dt);const Pt=yt+1;if(Pt<Dt)bt.stepStarted(Rt[Pt].key,Pt,Dt),Ct(Pt);else{vt(!0);const{redirectionUrl:Nt}=await getFinishStatus(void 0,{token:Be});bt.flowCompleted(Dt),Ye({redirectionUrl:Nt})}};return kt?jsxRuntimeExports.jsx(Spinner$6,{}):It?jsxRuntimeExports.jsx(FlowRedirect,{flow:At,token:Be,onSuccess:Bt,onSkip:wt,mobileQrRedirectUrl:ht==null?void 0:ht.mobileQrRedirectUrl,authHint:gt}):jsxRuntimeExports.jsx(App$1,{token:Be,disableUnsupportedBrowserScreen:At==null?void 0:At.disableUnsupportedBrowserScreen,children:jsxRuntimeExports.jsx(FlowDataProvider,{token:Be,children:jsxRuntimeExports.jsx(ModuleRenderer,{module:Tt,onSuccess:Bt,emit:Dt=>bt.emit(Dt),token:Be,onError:Bt,flow:At,uiConfig:ft,finishWithError:Dt=>Le(Dt),startConfig:ht,authHint:gt})})})}const executeFlow=async({element:Be,token:Le,onSuccess:Ye,onError:tt,onEvent:nt,flow:ft,uiConfig:ht,config:gt,authHint:At})=>{const xt=createRoot$1(Be);customRender(jsxRuntimeExports.jsx(FlowRenderer,{token:Le,onSuccess:Ye,onError:tt,onEvent:nt,flow:ft,uiConfig:ht,startConfig:gt,authHint:At}),Be,xt)};function renderForms(Be,{onSuccess:Le,onError:Ye,token:tt,interviewId:nt,flowId:ft,screens:ht}){const gt=createRoot$1(Be),At={token:tt,interviewId:nt,onBoarding:this,flowId:ft,onSuccess:handleUnmountRoot(Le,gt,Be),onError:handleUnmountRoot(Ye,gt,Be),screens:ht};customRender(jsxRuntimeExports.jsx(App$1,{token:tt,children:jsxRuntimeExports.jsx(Forms$1,{...At})}),Be,gt)}function getConnectionDetails(Be){return exports.api.get(`/omni/queue/conference/connection-details?uuid=${Be}`).then(Le=>Le.data).catch(Le=>({error:`Error: ${Le}`}))}const getCustomFields=({token:Be})=>exports.api.get("/omni/get/custom-fields",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data));async function getInstantVerifyMissingModules({token:Be}){return exports.api.get("/omni/instant/missing-modules",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}function getMedicalOcrData({token:Be}){return exports.api.get("/omni/get/medical-ocr-data",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>({error:`Error: ${Le}`}))}function getSecondIdImagesV2({token:Be,body:Le}){return exports.api.post("/omni/get/images-second-id",Le,{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data)}async function instantVerifyShareIdentity({token:Be,consentGiven:Le}){return exports.api.post("/omni/instant/share-identity",{consentGiven:Le},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(Ye=>Promise.reject(Ye.response.data))}async function instantVerifyUpdate({token:Be}){return exports.api.post("/omni/instant/update-identity",{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}function lastNameMatch({token:Be}){return exports.api.get("/omni/last-name-match",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response))}function lastNameMatchByCustomer({token:Be}){return exports.api.get("/omni/customer/last-name-match ",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response))}function manualIdUpload(Be,{token:Le,onSuccess:Ye,type:tt,onlyFront:nt=!1}){const ft=createRoot$1(Be),ht={onSuccess:handleUnmountRoot(Ye,ft,Be),onBoarding:this,type:tt,token:Le,onlyFront:nt};customRender(jsxRuntimeExports.jsx(App$1,{token:Le.token,children:jsxRuntimeExports.jsx(CaptureManualId,{token:Le,...ht})}),Be,ft)}function mock({token:Be,interviewId:Le}){return exports.api.get(`/omni/mock?interviewId=${Le}`,{headers:{"X-Incode-Hardware-Id":Be}})}function processAddressStatement({token:Be}){return exports.api.post("/omni/process/address",null,{headers:{"X-Incode-Hardware-Id":Be}}).catch(Le=>Promise.reject(Le.response.data))}function processCreditCard({token:Be}){return exports.api.post("/omni/process/credit-card",{},{headers:{"X-Incode-Hardware-Id":Be}}).catch(Le=>Promise.reject(Le.response.data))}/*! For license information please see bundle.js.LICENSE.txt */(()=>{var Be={5766:(nt,ft)=>{ft.byteLength=function(vt){var bt=Ct(vt),It=bt[0],wt=bt[1];return 3*(It+wt)/4-wt},ft.toByteArray=function(vt){var bt,It,wt=Ct(vt),Rt=wt[0],Tt=wt[1],Bt=new At(function(Nt,Lt,Wt){return 3*(Lt+Wt)/4-Wt}(0,Rt,Tt)),Dt=0,Pt=Tt>0?Rt-4:Rt;for(It=0;It<Pt;It+=4)bt=gt[vt.charCodeAt(It)]<<18|gt[vt.charCodeAt(It+1)]<<12|gt[vt.charCodeAt(It+2)]<<6|gt[vt.charCodeAt(It+3)],Bt[Dt++]=bt>>16&255,Bt[Dt++]=bt>>8&255,Bt[Dt++]=255&bt;return Tt===2&&(bt=gt[vt.charCodeAt(It)]<<2|gt[vt.charCodeAt(It+1)]>>4,Bt[Dt++]=255&bt),Tt===1&&(bt=gt[vt.charCodeAt(It)]<<10|gt[vt.charCodeAt(It+1)]<<4|gt[vt.charCodeAt(It+2)]>>2,Bt[Dt++]=bt>>8&255,Bt[Dt++]=255&bt),Bt},ft.fromByteArray=function(vt){for(var bt,It=vt.length,wt=It%3,Rt=[],Tt=16383,Bt=0,Dt=It-wt;Bt<Dt;Bt+=Tt)Rt.push(kt(vt,Bt,Bt+Tt>Dt?Dt:Bt+Tt));return wt===1?(bt=vt[It-1],Rt.push(ht[bt>>2]+ht[bt<<4&63]+"==")):wt===2&&(bt=(vt[It-2]<<8)+vt[It-1],Rt.push(ht[bt>>10]+ht[bt>>4&63]+ht[bt<<2&63]+"=")),Rt.join("")};for(var ht=[],gt=[],At=typeof Uint8Array<"u"?Uint8Array:Array,xt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Et=0,yt=xt.length;Et<yt;++Et)ht[Et]=xt[Et],gt[xt.charCodeAt(Et)]=Et;function Ct(vt){var bt=vt.length;if(bt%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var It=vt.indexOf("=");return It===-1&&(It=bt),[It,It===bt?0:4-It%4]}function kt(vt,bt,It){for(var wt,Rt,Tt=[],Bt=bt;Bt<It;Bt+=3)wt=(vt[Bt]<<16&16711680)+(vt[Bt+1]<<8&65280)+(255&vt[Bt+2]),Tt.push(ht[(Rt=wt)>>18&63]+ht[Rt>>12&63]+ht[Rt>>6&63]+ht[63&Rt]);return Tt.join("")}gt[45]=62,gt[95]=63},8834:(nt,ft,ht)=>{var gt=ht(5766),At=ht(2333),xt=ht(7906);function Et(){return Ct.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function yt(Yt,Mt){if(Et()<Mt)throw new RangeError("Invalid typed array length");return Ct.TYPED_ARRAY_SUPPORT?(Yt=new Uint8Array(Mt)).__proto__=Ct.prototype:(Yt===null&&(Yt=new Ct(Mt)),Yt.length=Mt),Yt}function Ct(Yt,Mt,Jt){if(!(Ct.TYPED_ARRAY_SUPPORT||this instanceof Ct))return new Ct(Yt,Mt,Jt);if(typeof Yt=="number"){if(typeof Mt=="string")throw new Error("If encoding is specified then the first argument must be a string");return bt(this,Yt)}return kt(this,Yt,Mt,Jt)}function kt(Yt,Mt,Jt,a0){if(typeof Mt=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&Mt instanceof ArrayBuffer?function(i0,f0,u0,x0){if(f0.byteLength,u0<0||f0.byteLength<u0)throw new RangeError("'offset' is out of bounds");if(f0.byteLength<u0+(x0||0))throw new RangeError("'length' is out of bounds");return f0=u0===void 0&&x0===void 0?new Uint8Array(f0):x0===void 0?new Uint8Array(f0,u0):new Uint8Array(f0,u0,x0),Ct.TYPED_ARRAY_SUPPORT?(i0=f0).__proto__=Ct.prototype:i0=It(i0,f0),i0}(Yt,Mt,Jt,a0):typeof Mt=="string"?function(i0,f0,u0){if(typeof u0=="string"&&u0!==""||(u0="utf8"),!Ct.isEncoding(u0))throw new TypeError('"encoding" must be a valid string encoding');var x0=0|Rt(f0,u0),p0=(i0=yt(i0,x0)).write(f0,u0);return p0!==x0&&(i0=i0.slice(0,p0)),i0}(Yt,Mt,Jt):function(i0,f0){if(Ct.isBuffer(f0)){var u0=0|wt(f0.length);return(i0=yt(i0,u0)).length===0||f0.copy(i0,0,0,u0),i0}if(f0){if(typeof ArrayBuffer<"u"&&f0.buffer instanceof ArrayBuffer||"length"in f0)return typeof f0.length!="number"||(x0=f0.length)!=x0?yt(i0,0):It(i0,f0);if(f0.type==="Buffer"&&xt(f0.data))return It(i0,f0.data)}var x0;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(Yt,Mt)}function vt(Yt){if(typeof Yt!="number")throw new TypeError('"size" argument must be a number');if(Yt<0)throw new RangeError('"size" argument must not be negative')}function bt(Yt,Mt){if(vt(Mt),Yt=yt(Yt,Mt<0?0:0|wt(Mt)),!Ct.TYPED_ARRAY_SUPPORT)for(var Jt=0;Jt<Mt;++Jt)Yt[Jt]=0;return Yt}function It(Yt,Mt){var Jt=Mt.length<0?0:0|wt(Mt.length);Yt=yt(Yt,Jt);for(var a0=0;a0<Jt;a0+=1)Yt[a0]=255&Mt[a0];return Yt}function wt(Yt){if(Yt>=Et())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Et().toString(16)+" bytes");return 0|Yt}function Rt(Yt,Mt){if(Ct.isBuffer(Yt))return Yt.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(Yt)||Yt instanceof ArrayBuffer))return Yt.byteLength;typeof Yt!="string"&&(Yt=""+Yt);var Jt=Yt.length;if(Jt===0)return 0;for(var a0=!1;;)switch(Mt){case"ascii":case"latin1":case"binary":return Jt;case"utf8":case"utf-8":case void 0:return A0(Yt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*Jt;case"hex":return Jt>>>1;case"base64":return o0(Yt).length;default:if(a0)return A0(Yt).length;Mt=(""+Mt).toLowerCase(),a0=!0}}function Tt(Yt,Mt,Jt){var a0=!1;if((Mt===void 0||Mt<0)&&(Mt=0),Mt>this.length||((Jt===void 0||Jt>this.length)&&(Jt=this.length),Jt<=0)||(Jt>>>=0)<=(Mt>>>=0))return"";for(Yt||(Yt="utf8");;)switch(Yt){case"hex":return Gt(this,Mt,Jt);case"utf8":case"utf-8":return _t(this,Mt,Jt);case"ascii":return Qt(this,Mt,Jt);case"latin1":case"binary":return jt(this,Mt,Jt);case"base64":return Ut(this,Mt,Jt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qt(this,Mt,Jt);default:if(a0)throw new TypeError("Unknown encoding: "+Yt);Yt=(Yt+"").toLowerCase(),a0=!0}}function Bt(Yt,Mt,Jt){var a0=Yt[Mt];Yt[Mt]=Yt[Jt],Yt[Jt]=a0}function Dt(Yt,Mt,Jt,a0,i0){if(Yt.length===0)return-1;if(typeof Jt=="string"?(a0=Jt,Jt=0):Jt>2147483647?Jt=2147483647:Jt<-2147483648&&(Jt=-2147483648),Jt=+Jt,isNaN(Jt)&&(Jt=i0?0:Yt.length-1),Jt<0&&(Jt=Yt.length+Jt),Jt>=Yt.length){if(i0)return-1;Jt=Yt.length-1}else if(Jt<0){if(!i0)return-1;Jt=0}if(typeof Mt=="string"&&(Mt=Ct.from(Mt,a0)),Ct.isBuffer(Mt))return Mt.length===0?-1:Pt(Yt,Mt,Jt,a0,i0);if(typeof Mt=="number")return Mt&=255,Ct.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i0?Uint8Array.prototype.indexOf.call(Yt,Mt,Jt):Uint8Array.prototype.lastIndexOf.call(Yt,Mt,Jt):Pt(Yt,[Mt],Jt,a0,i0);throw new TypeError("val must be string, number or Buffer")}function Pt(Yt,Mt,Jt,a0,i0){var f0,u0=1,x0=Yt.length,p0=Mt.length;if(a0!==void 0&&((a0=String(a0).toLowerCase())==="ucs2"||a0==="ucs-2"||a0==="utf16le"||a0==="utf-16le")){if(Yt.length<2||Mt.length<2)return-1;u0=2,x0/=2,p0/=2,Jt/=2}function D0(Y0,X0){return u0===1?Y0[X0]:Y0.readUInt16BE(X0*u0)}if(i0){var P0=-1;for(f0=Jt;f0<x0;f0++)if(D0(Yt,f0)===D0(Mt,P0===-1?0:f0-P0)){if(P0===-1&&(P0=f0),f0-P0+1===p0)return P0*u0}else P0!==-1&&(f0-=f0-P0),P0=-1}else for(Jt+p0>x0&&(Jt=x0-p0),f0=Jt;f0>=0;f0--){for(var z0=!0,J0=0;J0<p0;J0++)if(D0(Yt,f0+J0)!==D0(Mt,J0)){z0=!1;break}if(z0)return f0}return-1}function Nt(Yt,Mt,Jt,a0){Jt=Number(Jt)||0;var i0=Yt.length-Jt;a0?(a0=Number(a0))>i0&&(a0=i0):a0=i0;var f0=Mt.length;if(f0%2!=0)throw new TypeError("Invalid hex string");a0>f0/2&&(a0=f0/2);for(var u0=0;u0<a0;++u0){var x0=parseInt(Mt.substr(2*u0,2),16);if(isNaN(x0))return u0;Yt[Jt+u0]=x0}return u0}function Lt(Yt,Mt,Jt,a0){return r0(A0(Mt,Yt.length-Jt),Yt,Jt,a0)}function Wt(Yt,Mt,Jt,a0){return r0(function(i0){for(var f0=[],u0=0;u0<i0.length;++u0)f0.push(255&i0.charCodeAt(u0));return f0}(Mt),Yt,Jt,a0)}function $t(Yt,Mt,Jt,a0){return Wt(Yt,Mt,Jt,a0)}function Kt(Yt,Mt,Jt,a0){return r0(o0(Mt),Yt,Jt,a0)}function Vt(Yt,Mt,Jt,a0){return r0(function(i0,f0){for(var u0,x0,p0,D0=[],P0=0;P0<i0.length&&!((f0-=2)<0);++P0)x0=(u0=i0.charCodeAt(P0))>>8,p0=u0%256,D0.push(p0),D0.push(x0);return D0}(Mt,Yt.length-Jt),Yt,Jt,a0)}function Ut(Yt,Mt,Jt){return Mt===0&&Jt===Yt.length?gt.fromByteArray(Yt):gt.fromByteArray(Yt.slice(Mt,Jt))}function _t(Yt,Mt,Jt){Jt=Math.min(Yt.length,Jt);for(var a0=[],i0=Mt;i0<Jt;){var f0,u0,x0,p0,D0=Yt[i0],P0=null,z0=D0>239?4:D0>223?3:D0>191?2:1;if(i0+z0<=Jt)switch(z0){case 1:D0<128&&(P0=D0);break;case 2:(192&(f0=Yt[i0+1]))==128&&(p0=(31&D0)<<6|63&f0)>127&&(P0=p0);break;case 3:f0=Yt[i0+1],u0=Yt[i0+2],(192&f0)==128&&(192&u0)==128&&(p0=(15&D0)<<12|(63&f0)<<6|63&u0)>2047&&(p0<55296||p0>57343)&&(P0=p0);break;case 4:f0=Yt[i0+1],u0=Yt[i0+2],x0=Yt[i0+3],(192&f0)==128&&(192&u0)==128&&(192&x0)==128&&(p0=(15&D0)<<18|(63&f0)<<12|(63&u0)<<6|63&x0)>65535&&p0<1114112&&(P0=p0)}P0===null?(P0=65533,z0=1):P0>65535&&(P0-=65536,a0.push(P0>>>10&1023|55296),P0=56320|1023&P0),a0.push(P0),i0+=z0}return function(J0){var Y0=J0.length;if(Y0<=Xt)return String.fromCharCode.apply(String,J0);for(var X0="",T0=0;T0<Y0;)X0+=String.fromCharCode.apply(String,J0.slice(T0,T0+=Xt));return X0}(a0)}ft.Buffer=Ct,ft.SlowBuffer=function(Yt){return+Yt!=Yt&&(Yt=0),Ct.alloc(+Yt)},ft.INSPECT_MAX_BYTES=50,Ct.TYPED_ARRAY_SUPPORT=ht.g.TYPED_ARRAY_SUPPORT!==void 0?ht.g.TYPED_ARRAY_SUPPORT:function(){try{var Yt=new Uint8Array(1);return Yt.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},Yt.foo()===42&&typeof Yt.subarray=="function"&&Yt.subarray(1,1).byteLength===0}catch{return!1}}(),ft.kMaxLength=Et(),Ct.poolSize=8192,Ct._augment=function(Yt){return Yt.__proto__=Ct.prototype,Yt},Ct.from=function(Yt,Mt,Jt){return kt(null,Yt,Mt,Jt)},Ct.TYPED_ARRAY_SUPPORT&&(Ct.prototype.__proto__=Uint8Array.prototype,Ct.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Ct[Symbol.species]===Ct&&Object.defineProperty(Ct,Symbol.species,{value:null,configurable:!0})),Ct.alloc=function(Yt,Mt,Jt){return function(a0,i0,f0,u0){return vt(i0),i0<=0?yt(a0,i0):f0!==void 0?typeof u0=="string"?yt(a0,i0).fill(f0,u0):yt(a0,i0).fill(f0):yt(a0,i0)}(null,Yt,Mt,Jt)},Ct.allocUnsafe=function(Yt){return bt(null,Yt)},Ct.allocUnsafeSlow=function(Yt){return bt(null,Yt)},Ct.isBuffer=function(Yt){return!(Yt==null||!Yt._isBuffer)},Ct.compare=function(Yt,Mt){if(!Ct.isBuffer(Yt)||!Ct.isBuffer(Mt))throw new TypeError("Arguments must be Buffers");if(Yt===Mt)return 0;for(var Jt=Yt.length,a0=Mt.length,i0=0,f0=Math.min(Jt,a0);i0<f0;++i0)if(Yt[i0]!==Mt[i0]){Jt=Yt[i0],a0=Mt[i0];break}return Jt<a0?-1:a0<Jt?1:0},Ct.isEncoding=function(Yt){switch(String(Yt).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}},Ct.concat=function(Yt,Mt){if(!xt(Yt))throw new TypeError('"list" argument must be an Array of Buffers');if(Yt.length===0)return Ct.alloc(0);var Jt;if(Mt===void 0)for(Mt=0,Jt=0;Jt<Yt.length;++Jt)Mt+=Yt[Jt].length;var a0=Ct.allocUnsafe(Mt),i0=0;for(Jt=0;Jt<Yt.length;++Jt){var f0=Yt[Jt];if(!Ct.isBuffer(f0))throw new TypeError('"list" argument must be an Array of Buffers');f0.copy(a0,i0),i0+=f0.length}return a0},Ct.byteLength=Rt,Ct.prototype._isBuffer=!0,Ct.prototype.swap16=function(){var Yt=this.length;if(Yt%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Mt=0;Mt<Yt;Mt+=2)Bt(this,Mt,Mt+1);return this},Ct.prototype.swap32=function(){var Yt=this.length;if(Yt%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var Mt=0;Mt<Yt;Mt+=4)Bt(this,Mt,Mt+3),Bt(this,Mt+1,Mt+2);return this},Ct.prototype.swap64=function(){var Yt=this.length;if(Yt%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var Mt=0;Mt<Yt;Mt+=8)Bt(this,Mt,Mt+7),Bt(this,Mt+1,Mt+6),Bt(this,Mt+2,Mt+5),Bt(this,Mt+3,Mt+4);return this},Ct.prototype.toString=function(){var Yt=0|this.length;return Yt===0?"":arguments.length===0?_t(this,0,Yt):Tt.apply(this,arguments)},Ct.prototype.equals=function(Yt){if(!Ct.isBuffer(Yt))throw new TypeError("Argument must be a Buffer");return this===Yt||Ct.compare(this,Yt)===0},Ct.prototype.inspect=function(){var Yt="",Mt=ft.INSPECT_MAX_BYTES;return this.length>0&&(Yt=this.toString("hex",0,Mt).match(/.{2}/g).join(" "),this.length>Mt&&(Yt+=" ... ")),"<Buffer "+Yt+">"},Ct.prototype.compare=function(Yt,Mt,Jt,a0,i0){if(!Ct.isBuffer(Yt))throw new TypeError("Argument must be a Buffer");if(Mt===void 0&&(Mt=0),Jt===void 0&&(Jt=Yt?Yt.length:0),a0===void 0&&(a0=0),i0===void 0&&(i0=this.length),Mt<0||Jt>Yt.length||a0<0||i0>this.length)throw new RangeError("out of range index");if(a0>=i0&&Mt>=Jt)return 0;if(a0>=i0)return-1;if(Mt>=Jt)return 1;if(this===Yt)return 0;for(var f0=(i0>>>=0)-(a0>>>=0),u0=(Jt>>>=0)-(Mt>>>=0),x0=Math.min(f0,u0),p0=this.slice(a0,i0),D0=Yt.slice(Mt,Jt),P0=0;P0<x0;++P0)if(p0[P0]!==D0[P0]){f0=p0[P0],u0=D0[P0];break}return f0<u0?-1:u0<f0?1:0},Ct.prototype.includes=function(Yt,Mt,Jt){return this.indexOf(Yt,Mt,Jt)!==-1},Ct.prototype.indexOf=function(Yt,Mt,Jt){return Dt(this,Yt,Mt,Jt,!0)},Ct.prototype.lastIndexOf=function(Yt,Mt,Jt){return Dt(this,Yt,Mt,Jt,!1)},Ct.prototype.write=function(Yt,Mt,Jt,a0){if(Mt===void 0)a0="utf8",Jt=this.length,Mt=0;else if(Jt===void 0&&typeof Mt=="string")a0=Mt,Jt=this.length,Mt=0;else{if(!isFinite(Mt))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");Mt|=0,isFinite(Jt)?(Jt|=0,a0===void 0&&(a0="utf8")):(a0=Jt,Jt=void 0)}var i0=this.length-Mt;if((Jt===void 0||Jt>i0)&&(Jt=i0),Yt.length>0&&(Jt<0||Mt<0)||Mt>this.length)throw new RangeError("Attempt to write outside buffer bounds");a0||(a0="utf8");for(var f0=!1;;)switch(a0){case"hex":return Nt(this,Yt,Mt,Jt);case"utf8":case"utf-8":return Lt(this,Yt,Mt,Jt);case"ascii":return Wt(this,Yt,Mt,Jt);case"latin1":case"binary":return $t(this,Yt,Mt,Jt);case"base64":return Kt(this,Yt,Mt,Jt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vt(this,Yt,Mt,Jt);default:if(f0)throw new TypeError("Unknown encoding: "+a0);a0=(""+a0).toLowerCase(),f0=!0}},Ct.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Xt=4096;function Qt(Yt,Mt,Jt){var a0="";Jt=Math.min(Yt.length,Jt);for(var i0=Mt;i0<Jt;++i0)a0+=String.fromCharCode(127&Yt[i0]);return a0}function jt(Yt,Mt,Jt){var a0="";Jt=Math.min(Yt.length,Jt);for(var i0=Mt;i0<Jt;++i0)a0+=String.fromCharCode(Yt[i0]);return a0}function Gt(Yt,Mt,Jt){var a0,i0=Yt.length;(!Mt||Mt<0)&&(Mt=0),(!Jt||Jt<0||Jt>i0)&&(Jt=i0);for(var f0="",u0=Mt;u0<Jt;++u0)f0+=(a0=Yt[u0])<16?"0"+a0.toString(16):a0.toString(16);return f0}function qt(Yt,Mt,Jt){for(var a0=Yt.slice(Mt,Jt),i0="",f0=0;f0<a0.length;f0+=2)i0+=String.fromCharCode(a0[f0]+256*a0[f0+1]);return i0}function zt(Yt,Mt,Jt){if(Yt%1!=0||Yt<0)throw new RangeError("offset is not uint");if(Yt+Mt>Jt)throw new RangeError("Trying to access beyond buffer length")}function e0(Yt,Mt,Jt,a0,i0,f0){if(!Ct.isBuffer(Yt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Mt>i0||Mt<f0)throw new RangeError('"value" argument is out of bounds');if(Jt+a0>Yt.length)throw new RangeError("Index out of range")}function s0(Yt,Mt,Jt,a0){Mt<0&&(Mt=65535+Mt+1);for(var i0=0,f0=Math.min(Yt.length-Jt,2);i0<f0;++i0)Yt[Jt+i0]=(Mt&255<<8*(a0?i0:1-i0))>>>8*(a0?i0:1-i0)}function t0(Yt,Mt,Jt,a0){Mt<0&&(Mt=4294967295+Mt+1);for(var i0=0,f0=Math.min(Yt.length-Jt,4);i0<f0;++i0)Yt[Jt+i0]=Mt>>>8*(a0?i0:3-i0)&255}function l0(Yt,Mt,Jt,a0,i0,f0){if(Jt+a0>Yt.length)throw new RangeError("Index out of range");if(Jt<0)throw new RangeError("Index out of range")}function d0(Yt,Mt,Jt,a0,i0){return i0||l0(Yt,0,Jt,4),At.write(Yt,Mt,Jt,a0,23,4),Jt+4}function n0(Yt,Mt,Jt,a0,i0){return i0||l0(Yt,0,Jt,8),At.write(Yt,Mt,Jt,a0,52,8),Jt+8}Ct.prototype.slice=function(Yt,Mt){var Jt,a0=this.length;if((Yt=~~Yt)<0?(Yt+=a0)<0&&(Yt=0):Yt>a0&&(Yt=a0),(Mt=Mt===void 0?a0:~~Mt)<0?(Mt+=a0)<0&&(Mt=0):Mt>a0&&(Mt=a0),Mt<Yt&&(Mt=Yt),Ct.TYPED_ARRAY_SUPPORT)(Jt=this.subarray(Yt,Mt)).__proto__=Ct.prototype;else{var i0=Mt-Yt;Jt=new Ct(i0,void 0);for(var f0=0;f0<i0;++f0)Jt[f0]=this[f0+Yt]}return Jt},Ct.prototype.readUIntLE=function(Yt,Mt,Jt){Yt|=0,Mt|=0,Jt||zt(Yt,Mt,this.length);for(var a0=this[Yt],i0=1,f0=0;++f0<Mt&&(i0*=256);)a0+=this[Yt+f0]*i0;return a0},Ct.prototype.readUIntBE=function(Yt,Mt,Jt){Yt|=0,Mt|=0,Jt||zt(Yt,Mt,this.length);for(var a0=this[Yt+--Mt],i0=1;Mt>0&&(i0*=256);)a0+=this[Yt+--Mt]*i0;return a0},Ct.prototype.readUInt8=function(Yt,Mt){return Mt||zt(Yt,1,this.length),this[Yt]},Ct.prototype.readUInt16LE=function(Yt,Mt){return Mt||zt(Yt,2,this.length),this[Yt]|this[Yt+1]<<8},Ct.prototype.readUInt16BE=function(Yt,Mt){return Mt||zt(Yt,2,this.length),this[Yt]<<8|this[Yt+1]},Ct.prototype.readUInt32LE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),(this[Yt]|this[Yt+1]<<8|this[Yt+2]<<16)+16777216*this[Yt+3]},Ct.prototype.readUInt32BE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),16777216*this[Yt]+(this[Yt+1]<<16|this[Yt+2]<<8|this[Yt+3])},Ct.prototype.readIntLE=function(Yt,Mt,Jt){Yt|=0,Mt|=0,Jt||zt(Yt,Mt,this.length);for(var a0=this[Yt],i0=1,f0=0;++f0<Mt&&(i0*=256);)a0+=this[Yt+f0]*i0;return a0>=(i0*=128)&&(a0-=Math.pow(2,8*Mt)),a0},Ct.prototype.readIntBE=function(Yt,Mt,Jt){Yt|=0,Mt|=0,Jt||zt(Yt,Mt,this.length);for(var a0=Mt,i0=1,f0=this[Yt+--a0];a0>0&&(i0*=256);)f0+=this[Yt+--a0]*i0;return f0>=(i0*=128)&&(f0-=Math.pow(2,8*Mt)),f0},Ct.prototype.readInt8=function(Yt,Mt){return Mt||zt(Yt,1,this.length),128&this[Yt]?-1*(255-this[Yt]+1):this[Yt]},Ct.prototype.readInt16LE=function(Yt,Mt){Mt||zt(Yt,2,this.length);var Jt=this[Yt]|this[Yt+1]<<8;return 32768&Jt?4294901760|Jt:Jt},Ct.prototype.readInt16BE=function(Yt,Mt){Mt||zt(Yt,2,this.length);var Jt=this[Yt+1]|this[Yt]<<8;return 32768&Jt?4294901760|Jt:Jt},Ct.prototype.readInt32LE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),this[Yt]|this[Yt+1]<<8|this[Yt+2]<<16|this[Yt+3]<<24},Ct.prototype.readInt32BE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),this[Yt]<<24|this[Yt+1]<<16|this[Yt+2]<<8|this[Yt+3]},Ct.prototype.readFloatLE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),At.read(this,Yt,!0,23,4)},Ct.prototype.readFloatBE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),At.read(this,Yt,!1,23,4)},Ct.prototype.readDoubleLE=function(Yt,Mt){return Mt||zt(Yt,8,this.length),At.read(this,Yt,!0,52,8)},Ct.prototype.readDoubleBE=function(Yt,Mt){return Mt||zt(Yt,8,this.length),At.read(this,Yt,!1,52,8)},Ct.prototype.writeUIntLE=function(Yt,Mt,Jt,a0){Yt=+Yt,Mt|=0,Jt|=0,a0||e0(this,Yt,Mt,Jt,Math.pow(2,8*Jt)-1,0);var i0=1,f0=0;for(this[Mt]=255&Yt;++f0<Jt&&(i0*=256);)this[Mt+f0]=Yt/i0&255;return Mt+Jt},Ct.prototype.writeUIntBE=function(Yt,Mt,Jt,a0){Yt=+Yt,Mt|=0,Jt|=0,a0||e0(this,Yt,Mt,Jt,Math.pow(2,8*Jt)-1,0);var i0=Jt-1,f0=1;for(this[Mt+i0]=255&Yt;--i0>=0&&(f0*=256);)this[Mt+i0]=Yt/f0&255;return Mt+Jt},Ct.prototype.writeUInt8=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,1,255,0),Ct.TYPED_ARRAY_SUPPORT||(Yt=Math.floor(Yt)),this[Mt]=255&Yt,Mt+1},Ct.prototype.writeUInt16LE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,2,65535,0),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=255&Yt,this[Mt+1]=Yt>>>8):s0(this,Yt,Mt,!0),Mt+2},Ct.prototype.writeUInt16BE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,2,65535,0),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=Yt>>>8,this[Mt+1]=255&Yt):s0(this,Yt,Mt,!1),Mt+2},Ct.prototype.writeUInt32LE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,4,4294967295,0),Ct.TYPED_ARRAY_SUPPORT?(this[Mt+3]=Yt>>>24,this[Mt+2]=Yt>>>16,this[Mt+1]=Yt>>>8,this[Mt]=255&Yt):t0(this,Yt,Mt,!0),Mt+4},Ct.prototype.writeUInt32BE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,4,4294967295,0),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=Yt>>>24,this[Mt+1]=Yt>>>16,this[Mt+2]=Yt>>>8,this[Mt+3]=255&Yt):t0(this,Yt,Mt,!1),Mt+4},Ct.prototype.writeIntLE=function(Yt,Mt,Jt,a0){if(Yt=+Yt,Mt|=0,!a0){var i0=Math.pow(2,8*Jt-1);e0(this,Yt,Mt,Jt,i0-1,-i0)}var f0=0,u0=1,x0=0;for(this[Mt]=255&Yt;++f0<Jt&&(u0*=256);)Yt<0&&x0===0&&this[Mt+f0-1]!==0&&(x0=1),this[Mt+f0]=(Yt/u0>>0)-x0&255;return Mt+Jt},Ct.prototype.writeIntBE=function(Yt,Mt,Jt,a0){if(Yt=+Yt,Mt|=0,!a0){var i0=Math.pow(2,8*Jt-1);e0(this,Yt,Mt,Jt,i0-1,-i0)}var f0=Jt-1,u0=1,x0=0;for(this[Mt+f0]=255&Yt;--f0>=0&&(u0*=256);)Yt<0&&x0===0&&this[Mt+f0+1]!==0&&(x0=1),this[Mt+f0]=(Yt/u0>>0)-x0&255;return Mt+Jt},Ct.prototype.writeInt8=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,1,127,-128),Ct.TYPED_ARRAY_SUPPORT||(Yt=Math.floor(Yt)),Yt<0&&(Yt=255+Yt+1),this[Mt]=255&Yt,Mt+1},Ct.prototype.writeInt16LE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,2,32767,-32768),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=255&Yt,this[Mt+1]=Yt>>>8):s0(this,Yt,Mt,!0),Mt+2},Ct.prototype.writeInt16BE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,2,32767,-32768),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=Yt>>>8,this[Mt+1]=255&Yt):s0(this,Yt,Mt,!1),Mt+2},Ct.prototype.writeInt32LE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,4,2147483647,-2147483648),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=255&Yt,this[Mt+1]=Yt>>>8,this[Mt+2]=Yt>>>16,this[Mt+3]=Yt>>>24):t0(this,Yt,Mt,!0),Mt+4},Ct.prototype.writeInt32BE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,4,2147483647,-2147483648),Yt<0&&(Yt=4294967295+Yt+1),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=Yt>>>24,this[Mt+1]=Yt>>>16,this[Mt+2]=Yt>>>8,this[Mt+3]=255&Yt):t0(this,Yt,Mt,!1),Mt+4},Ct.prototype.writeFloatLE=function(Yt,Mt,Jt){return d0(this,Yt,Mt,!0,Jt)},Ct.prototype.writeFloatBE=function(Yt,Mt,Jt){return d0(this,Yt,Mt,!1,Jt)},Ct.prototype.writeDoubleLE=function(Yt,Mt,Jt){return n0(this,Yt,Mt,!0,Jt)},Ct.prototype.writeDoubleBE=function(Yt,Mt,Jt){return n0(this,Yt,Mt,!1,Jt)},Ct.prototype.copy=function(Yt,Mt,Jt,a0){if(Jt||(Jt=0),a0||a0===0||(a0=this.length),Mt>=Yt.length&&(Mt=Yt.length),Mt||(Mt=0),a0>0&&a0<Jt&&(a0=Jt),a0===Jt||Yt.length===0||this.length===0)return 0;if(Mt<0)throw new RangeError("targetStart out of bounds");if(Jt<0||Jt>=this.length)throw new RangeError("sourceStart out of bounds");if(a0<0)throw new RangeError("sourceEnd out of bounds");a0>this.length&&(a0=this.length),Yt.length-Mt<a0-Jt&&(a0=Yt.length-Mt+Jt);var i0,f0=a0-Jt;if(this===Yt&&Jt<Mt&&Mt<a0)for(i0=f0-1;i0>=0;--i0)Yt[i0+Mt]=this[i0+Jt];else if(f0<1e3||!Ct.TYPED_ARRAY_SUPPORT)for(i0=0;i0<f0;++i0)Yt[i0+Mt]=this[i0+Jt];else Uint8Array.prototype.set.call(Yt,this.subarray(Jt,Jt+f0),Mt);return f0},Ct.prototype.fill=function(Yt,Mt,Jt,a0){if(typeof Yt=="string"){if(typeof Mt=="string"?(a0=Mt,Mt=0,Jt=this.length):typeof Jt=="string"&&(a0=Jt,Jt=this.length),Yt.length===1){var i0=Yt.charCodeAt(0);i0<256&&(Yt=i0)}if(a0!==void 0&&typeof a0!="string")throw new TypeError("encoding must be a string");if(typeof a0=="string"&&!Ct.isEncoding(a0))throw new TypeError("Unknown encoding: "+a0)}else typeof Yt=="number"&&(Yt&=255);if(Mt<0||this.length<Mt||this.length<Jt)throw new RangeError("Out of range index");if(Jt<=Mt)return this;var f0;if(Mt>>>=0,Jt=Jt===void 0?this.length:Jt>>>0,Yt||(Yt=0),typeof Yt=="number")for(f0=Mt;f0<Jt;++f0)this[f0]=Yt;else{var u0=Ct.isBuffer(Yt)?Yt:A0(new Ct(Yt,a0).toString()),x0=u0.length;for(f0=0;f0<Jt-Mt;++f0)this[f0+Mt]=u0[f0%x0]}return this};var g0=/[^+\/0-9A-Za-z-_]/g;function A0(Yt,Mt){var Jt;Mt=Mt||1/0;for(var a0=Yt.length,i0=null,f0=[],u0=0;u0<a0;++u0){if((Jt=Yt.charCodeAt(u0))>55295&&Jt<57344){if(!i0){if(Jt>56319){(Mt-=3)>-1&&f0.push(239,191,189);continue}if(u0+1===a0){(Mt-=3)>-1&&f0.push(239,191,189);continue}i0=Jt;continue}if(Jt<56320){(Mt-=3)>-1&&f0.push(239,191,189),i0=Jt;continue}Jt=65536+(i0-55296<<10|Jt-56320)}else i0&&(Mt-=3)>-1&&f0.push(239,191,189);if(i0=null,Jt<128){if((Mt-=1)<0)break;f0.push(Jt)}else if(Jt<2048){if((Mt-=2)<0)break;f0.push(Jt>>6|192,63&Jt|128)}else if(Jt<65536){if((Mt-=3)<0)break;f0.push(Jt>>12|224,Jt>>6&63|128,63&Jt|128)}else{if(!(Jt<1114112))throw new Error("Invalid code point");if((Mt-=4)<0)break;f0.push(Jt>>18|240,Jt>>12&63|128,Jt>>6&63|128,63&Jt|128)}}return f0}function o0(Yt){return gt.toByteArray(function(Mt){if((Mt=function(Jt){return Jt.trim?Jt.trim():Jt.replace(/^\s+|\s+$/g,"")}(Mt).replace(g0,"")).length<2)return"";for(;Mt.length%4!=0;)Mt+="=";return Mt}(Yt))}function r0(Yt,Mt,Jt,a0){for(var i0=0;i0<a0&&!(i0+Jt>=Mt.length||i0>=Yt.length);++i0)Mt[i0+Jt]=Yt[i0];return i0}},3973:(nt,ft,ht)=>{var gt=ht(7834).Buffer,At=ht(4851).Transform,xt=ht(214).s;function Et(yt){At.call(this),this.hashMode=typeof yt=="string",this.hashMode?this[yt]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}ht(1285)(Et,At),Et.prototype.update=function(yt,Ct,kt){typeof yt=="string"&&(yt=gt.from(yt,Ct));var vt=this._update(yt);return this.hashMode?this:(kt&&(vt=this._toString(vt,kt)),vt)},Et.prototype.setAutoPadding=function(){},Et.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},Et.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},Et.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},Et.prototype._transform=function(yt,Ct,kt){var vt;try{this.hashMode?this._update(yt):this.push(this._update(yt))}catch(bt){vt=bt}finally{kt(vt)}},Et.prototype._flush=function(yt){var Ct;try{this.push(this.__final())}catch(kt){Ct=kt}yt(Ct)},Et.prototype._finalOrDigest=function(yt){var Ct=this.__final()||gt.alloc(0);return yt&&(Ct=this._toString(Ct,yt,!0)),Ct},Et.prototype._toString=function(yt,Ct,kt){if(this._decoder||(this._decoder=new xt(Ct),this._encoding=Ct),this._encoding!==Ct)throw new Error("can't switch encodings");var vt=this._decoder.write(yt);return kt&&(vt+=this._decoder.end()),vt},nt.exports=Et},2511:(nt,ft,ht)=>{var gt=ht(7993);nt.exports=function(At){return new gt().update(At).digest()}},11:(nt,ft,ht)=>{var gt=ht(1285),At=ht(6456),xt=ht(3973),Et=ht(7834).Buffer,yt=ht(2511),Ct=ht(1445),kt=ht(9065),vt=Et.alloc(128);function bt(It,wt){xt.call(this,"digest"),typeof wt=="string"&&(wt=Et.from(wt));var Rt=It==="sha512"||It==="sha384"?128:64;this._alg=It,this._key=wt,wt.length>Rt?wt=(It==="rmd160"?new Ct:kt(It)).update(wt).digest():wt.length<Rt&&(wt=Et.concat([wt,vt],Rt));for(var Tt=this._ipad=Et.allocUnsafe(Rt),Bt=this._opad=Et.allocUnsafe(Rt),Dt=0;Dt<Rt;Dt++)Tt[Dt]=54^wt[Dt],Bt[Dt]=92^wt[Dt];this._hash=It==="rmd160"?new Ct:kt(It),this._hash.update(Tt)}gt(bt,xt),bt.prototype._update=function(It){this._hash.update(It)},bt.prototype._final=function(){var It=this._hash.digest();return(this._alg==="rmd160"?new Ct:kt(this._alg)).update(this._opad).update(It).digest()},nt.exports=function(It,wt){return(It=It.toLowerCase())==="rmd160"||It==="ripemd160"?new bt("rmd160",wt):It==="md5"?new At(yt,wt):new bt(It,wt)}},6456:(nt,ft,ht)=>{var gt=ht(1285),At=ht(7834).Buffer,xt=ht(3973),Et=At.alloc(128),yt=64;function Ct(kt,vt){xt.call(this,"digest"),typeof vt=="string"&&(vt=At.from(vt)),this._alg=kt,this._key=vt,vt.length>yt?vt=kt(vt):vt.length<yt&&(vt=At.concat([vt,Et],yt));for(var bt=this._ipad=At.allocUnsafe(yt),It=this._opad=At.allocUnsafe(yt),wt=0;wt<yt;wt++)bt[wt]=54^vt[wt],It[wt]=92^vt[wt];this._hash=[bt]}gt(Ct,xt),Ct.prototype._update=function(kt){this._hash.push(kt)},Ct.prototype._final=function(){var kt=this._alg(At.concat(this._hash));return this._alg(At.concat([this._opad,kt]))},nt.exports=Ct},2699:nt=>{var ft,ht=typeof Reflect=="object"?Reflect:null,gt=ht&&typeof ht.apply=="function"?ht.apply:function(Bt,Dt,Pt){return Function.prototype.apply.call(Bt,Dt,Pt)};ft=ht&&typeof ht.ownKeys=="function"?ht.ownKeys:Object.getOwnPropertySymbols?function(Bt){return Object.getOwnPropertyNames(Bt).concat(Object.getOwnPropertySymbols(Bt))}:function(Bt){return Object.getOwnPropertyNames(Bt)};var At=Number.isNaN||function(Bt){return Bt!=Bt};function xt(){xt.init.call(this)}nt.exports=xt,nt.exports.once=function(Bt,Dt){return new Promise(function(Pt,Nt){function Lt($t){Bt.removeListener(Dt,Wt),Nt($t)}function Wt(){typeof Bt.removeListener=="function"&&Bt.removeListener("error",Lt),Pt([].slice.call(arguments))}Tt(Bt,Dt,Wt,{once:!0}),Dt!=="error"&&function($t,Kt,Vt){typeof $t.on=="function"&&Tt($t,"error",Kt,{once:!0})}(Bt,Lt)})},xt.EventEmitter=xt,xt.prototype._events=void 0,xt.prototype._eventsCount=0,xt.prototype._maxListeners=void 0;var Et=10;function yt(Bt){if(typeof Bt!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof Bt)}function Ct(Bt){return Bt._maxListeners===void 0?xt.defaultMaxListeners:Bt._maxListeners}function kt(Bt,Dt,Pt,Nt){var Lt,Wt,$t,Kt;if(yt(Pt),(Wt=Bt._events)===void 0?(Wt=Bt._events=Object.create(null),Bt._eventsCount=0):(Wt.newListener!==void 0&&(Bt.emit("newListener",Dt,Pt.listener?Pt.listener:Pt),Wt=Bt._events),$t=Wt[Dt]),$t===void 0)$t=Wt[Dt]=Pt,++Bt._eventsCount;else if(typeof $t=="function"?$t=Wt[Dt]=Nt?[Pt,$t]:[$t,Pt]:Nt?$t.unshift(Pt):$t.push(Pt),(Lt=Ct(Bt))>0&&$t.length>Lt&&!$t.warned){$t.warned=!0;var Vt=new Error("Possible EventEmitter memory leak detected. "+$t.length+" "+String(Dt)+" listeners added. Use emitter.setMaxListeners() to increase limit");Vt.name="MaxListenersExceededWarning",Vt.emitter=Bt,Vt.type=Dt,Vt.count=$t.length,Kt=Vt,console&&console.warn&&console.warn(Kt)}return Bt}function vt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function bt(Bt,Dt,Pt){var Nt={fired:!1,wrapFn:void 0,target:Bt,type:Dt,listener:Pt},Lt=vt.bind(Nt);return Lt.listener=Pt,Nt.wrapFn=Lt,Lt}function It(Bt,Dt,Pt){var Nt=Bt._events;if(Nt===void 0)return[];var Lt=Nt[Dt];return Lt===void 0?[]:typeof Lt=="function"?Pt?[Lt.listener||Lt]:[Lt]:Pt?function(Wt){for(var $t=new Array(Wt.length),Kt=0;Kt<$t.length;++Kt)$t[Kt]=Wt[Kt].listener||Wt[Kt];return $t}(Lt):Rt(Lt,Lt.length)}function wt(Bt){var Dt=this._events;if(Dt!==void 0){var Pt=Dt[Bt];if(typeof Pt=="function")return 1;if(Pt!==void 0)return Pt.length}return 0}function Rt(Bt,Dt){for(var Pt=new Array(Dt),Nt=0;Nt<Dt;++Nt)Pt[Nt]=Bt[Nt];return Pt}function Tt(Bt,Dt,Pt,Nt){if(typeof Bt.on=="function")Nt.once?Bt.once(Dt,Pt):Bt.on(Dt,Pt);else{if(typeof Bt.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof Bt);Bt.addEventListener(Dt,function Lt(Wt){Nt.once&&Bt.removeEventListener(Dt,Lt),Pt(Wt)})}}Object.defineProperty(xt,"defaultMaxListeners",{enumerable:!0,get:function(){return Et},set:function(Bt){if(typeof Bt!="number"||Bt<0||At(Bt))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+Bt+".");Et=Bt}}),xt.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},xt.prototype.setMaxListeners=function(Bt){if(typeof Bt!="number"||Bt<0||At(Bt))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+Bt+".");return this._maxListeners=Bt,this},xt.prototype.getMaxListeners=function(){return Ct(this)},xt.prototype.emit=function(Bt){for(var Dt=[],Pt=1;Pt<arguments.length;Pt++)Dt.push(arguments[Pt]);var Nt=Bt==="error",Lt=this._events;if(Lt!==void 0)Nt=Nt&&Lt.error===void 0;else if(!Nt)return!1;if(Nt){var Wt;if(Dt.length>0&&(Wt=Dt[0]),Wt instanceof Error)throw Wt;var $t=new Error("Unhandled error."+(Wt?" ("+Wt.message+")":""));throw $t.context=Wt,$t}var Kt=Lt[Bt];if(Kt===void 0)return!1;if(typeof Kt=="function")gt(Kt,this,Dt);else{var Vt=Kt.length,Ut=Rt(Kt,Vt);for(Pt=0;Pt<Vt;++Pt)gt(Ut[Pt],this,Dt)}return!0},xt.prototype.addListener=function(Bt,Dt){return kt(this,Bt,Dt,!1)},xt.prototype.on=xt.prototype.addListener,xt.prototype.prependListener=function(Bt,Dt){return kt(this,Bt,Dt,!0)},xt.prototype.once=function(Bt,Dt){return yt(Dt),this.on(Bt,bt(this,Bt,Dt)),this},xt.prototype.prependOnceListener=function(Bt,Dt){return yt(Dt),this.prependListener(Bt,bt(this,Bt,Dt)),this},xt.prototype.removeListener=function(Bt,Dt){var Pt,Nt,Lt,Wt,$t;if(yt(Dt),(Nt=this._events)===void 0)return this;if((Pt=Nt[Bt])===void 0)return this;if(Pt===Dt||Pt.listener===Dt)--this._eventsCount==0?this._events=Object.create(null):(delete Nt[Bt],Nt.removeListener&&this.emit("removeListener",Bt,Pt.listener||Dt));else if(typeof Pt!="function"){for(Lt=-1,Wt=Pt.length-1;Wt>=0;Wt--)if(Pt[Wt]===Dt||Pt[Wt].listener===Dt){$t=Pt[Wt].listener,Lt=Wt;break}if(Lt<0)return this;Lt===0?Pt.shift():function(Kt,Vt){for(;Vt+1<Kt.length;Vt++)Kt[Vt]=Kt[Vt+1];Kt.pop()}(Pt,Lt),Pt.length===1&&(Nt[Bt]=Pt[0]),Nt.removeListener!==void 0&&this.emit("removeListener",Bt,$t||Dt)}return this},xt.prototype.off=xt.prototype.removeListener,xt.prototype.removeAllListeners=function(Bt){var Dt,Pt,Nt;if((Pt=this._events)===void 0)return this;if(Pt.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Pt[Bt]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete Pt[Bt]),this;if(arguments.length===0){var Lt,Wt=Object.keys(Pt);for(Nt=0;Nt<Wt.length;++Nt)(Lt=Wt[Nt])!=="removeListener"&&this.removeAllListeners(Lt);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(Dt=Pt[Bt])=="function")this.removeListener(Bt,Dt);else if(Dt!==void 0)for(Nt=Dt.length-1;Nt>=0;Nt--)this.removeListener(Bt,Dt[Nt]);return this},xt.prototype.listeners=function(Bt){return It(this,Bt,!0)},xt.prototype.rawListeners=function(Bt){return It(this,Bt,!1)},xt.listenerCount=function(Bt,Dt){return typeof Bt.listenerCount=="function"?Bt.listenerCount(Dt):wt.call(Bt,Dt)},xt.prototype.listenerCount=wt,xt.prototype.eventNames=function(){return this._eventsCount>0?ft(this._events):[]}},4485:(nt,ft,ht)=>{var gt=ht(7834).Buffer,At=ht(7525).Transform;function xt(Et){At.call(this),this._block=gt.allocUnsafe(Et),this._blockSize=Et,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}ht(1285)(xt,At),xt.prototype._transform=function(Et,yt,Ct){var kt=null;try{this.update(Et,yt)}catch(vt){kt=vt}Ct(kt)},xt.prototype._flush=function(Et){var yt=null;try{this.push(this.digest())}catch(Ct){yt=Ct}Et(yt)},xt.prototype.update=function(Et,yt){if(function(wt,Rt){if(!gt.isBuffer(wt)&&typeof wt!="string")throw new TypeError("Data must be a string or a buffer")}(Et),this._finalized)throw new Error("Digest already called");gt.isBuffer(Et)||(Et=gt.from(Et,yt));for(var Ct=this._block,kt=0;this._blockOffset+Et.length-kt>=this._blockSize;){for(var vt=this._blockOffset;vt<this._blockSize;)Ct[vt++]=Et[kt++];this._update(),this._blockOffset=0}for(;kt<Et.length;)Ct[this._blockOffset++]=Et[kt++];for(var bt=0,It=8*Et.length;It>0;++bt)this._length[bt]+=It,(It=this._length[bt]/4294967296|0)>0&&(this._length[bt]-=4294967296*It);return this},xt.prototype._update=function(){throw new Error("_update is not implemented")},xt.prototype.digest=function(Et){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var yt=this._digest();Et!==void 0&&(yt=yt.toString(Et)),this._block.fill(0),this._blockOffset=0;for(var Ct=0;Ct<4;++Ct)this._length[Ct]=0;return yt},xt.prototype._digest=function(){throw new Error("_digest is not implemented")},nt.exports=xt},2333:(nt,ft)=>{ft.read=function(ht,gt,At,xt,Et){var yt,Ct,kt=8*Et-xt-1,vt=(1<<kt)-1,bt=vt>>1,It=-7,wt=At?Et-1:0,Rt=At?-1:1,Tt=ht[gt+wt];for(wt+=Rt,yt=Tt&(1<<-It)-1,Tt>>=-It,It+=kt;It>0;yt=256*yt+ht[gt+wt],wt+=Rt,It-=8);for(Ct=yt&(1<<-It)-1,yt>>=-It,It+=xt;It>0;Ct=256*Ct+ht[gt+wt],wt+=Rt,It-=8);if(yt===0)yt=1-bt;else{if(yt===vt)return Ct?NaN:1/0*(Tt?-1:1);Ct+=Math.pow(2,xt),yt-=bt}return(Tt?-1:1)*Ct*Math.pow(2,yt-xt)},ft.write=function(ht,gt,At,xt,Et,yt){var Ct,kt,vt,bt=8*yt-Et-1,It=(1<<bt)-1,wt=It>>1,Rt=Et===23?Math.pow(2,-24)-Math.pow(2,-77):0,Tt=xt?0:yt-1,Bt=xt?1:-1,Dt=gt<0||gt===0&&1/gt<0?1:0;for(gt=Math.abs(gt),isNaN(gt)||gt===1/0?(kt=isNaN(gt)?1:0,Ct=It):(Ct=Math.floor(Math.log(gt)/Math.LN2),gt*(vt=Math.pow(2,-Ct))<1&&(Ct--,vt*=2),(gt+=Ct+wt>=1?Rt/vt:Rt*Math.pow(2,1-wt))*vt>=2&&(Ct++,vt/=2),Ct+wt>=It?(kt=0,Ct=It):Ct+wt>=1?(kt=(gt*vt-1)*Math.pow(2,Et),Ct+=wt):(kt=gt*Math.pow(2,wt-1)*Math.pow(2,Et),Ct=0));Et>=8;ht[At+Tt]=255&kt,Tt+=Bt,kt/=256,Et-=8);for(Ct=Ct<<Et|kt,bt+=Et;bt>0;ht[At+Tt]=255&Ct,Tt+=Bt,Ct/=256,bt-=8);ht[At+Tt-Bt]|=128*Dt}},1285:nt=>{typeof Object.create=="function"?nt.exports=function(ft,ht){ht&&(ft.super_=ht,ft.prototype=Object.create(ht.prototype,{constructor:{value:ft,enumerable:!1,writable:!0,configurable:!0}}))}:nt.exports=function(ft,ht){if(ht){ft.super_=ht;var gt=function(){};gt.prototype=ht.prototype,ft.prototype=new gt,ft.prototype.constructor=ft}}},7906:nt=>{var ft={}.toString;nt.exports=Array.isArray||function(ht){return ft.call(ht)=="[object Array]"}},7993:(nt,ft,ht)=>{var gt=ht(1285),At=ht(4485),xt=ht(7834).Buffer,Et=new Array(16);function yt(){At.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function Ct(wt,Rt){return wt<<Rt|wt>>>32-Rt}function kt(wt,Rt,Tt,Bt,Dt,Pt,Nt){return Ct(wt+(Rt&Tt|~Rt&Bt)+Dt+Pt|0,Nt)+Rt|0}function vt(wt,Rt,Tt,Bt,Dt,Pt,Nt){return Ct(wt+(Rt&Bt|Tt&~Bt)+Dt+Pt|0,Nt)+Rt|0}function bt(wt,Rt,Tt,Bt,Dt,Pt,Nt){return Ct(wt+(Rt^Tt^Bt)+Dt+Pt|0,Nt)+Rt|0}function It(wt,Rt,Tt,Bt,Dt,Pt,Nt){return Ct(wt+(Tt^(Rt|~Bt))+Dt+Pt|0,Nt)+Rt|0}gt(yt,At),yt.prototype._update=function(){for(var wt=Et,Rt=0;Rt<16;++Rt)wt[Rt]=this._block.readInt32LE(4*Rt);var Tt=this._a,Bt=this._b,Dt=this._c,Pt=this._d;Tt=kt(Tt,Bt,Dt,Pt,wt[0],3614090360,7),Pt=kt(Pt,Tt,Bt,Dt,wt[1],3905402710,12),Dt=kt(Dt,Pt,Tt,Bt,wt[2],606105819,17),Bt=kt(Bt,Dt,Pt,Tt,wt[3],3250441966,22),Tt=kt(Tt,Bt,Dt,Pt,wt[4],4118548399,7),Pt=kt(Pt,Tt,Bt,Dt,wt[5],1200080426,12),Dt=kt(Dt,Pt,Tt,Bt,wt[6],2821735955,17),Bt=kt(Bt,Dt,Pt,Tt,wt[7],4249261313,22),Tt=kt(Tt,Bt,Dt,Pt,wt[8],1770035416,7),Pt=kt(Pt,Tt,Bt,Dt,wt[9],2336552879,12),Dt=kt(Dt,Pt,Tt,Bt,wt[10],4294925233,17),Bt=kt(Bt,Dt,Pt,Tt,wt[11],2304563134,22),Tt=kt(Tt,Bt,Dt,Pt,wt[12],1804603682,7),Pt=kt(Pt,Tt,Bt,Dt,wt[13],4254626195,12),Dt=kt(Dt,Pt,Tt,Bt,wt[14],2792965006,17),Tt=vt(Tt,Bt=kt(Bt,Dt,Pt,Tt,wt[15],1236535329,22),Dt,Pt,wt[1],4129170786,5),Pt=vt(Pt,Tt,Bt,Dt,wt[6],3225465664,9),Dt=vt(Dt,Pt,Tt,Bt,wt[11],643717713,14),Bt=vt(Bt,Dt,Pt,Tt,wt[0],3921069994,20),Tt=vt(Tt,Bt,Dt,Pt,wt[5],3593408605,5),Pt=vt(Pt,Tt,Bt,Dt,wt[10],38016083,9),Dt=vt(Dt,Pt,Tt,Bt,wt[15],3634488961,14),Bt=vt(Bt,Dt,Pt,Tt,wt[4],3889429448,20),Tt=vt(Tt,Bt,Dt,Pt,wt[9],568446438,5),Pt=vt(Pt,Tt,Bt,Dt,wt[14],3275163606,9),Dt=vt(Dt,Pt,Tt,Bt,wt[3],4107603335,14),Bt=vt(Bt,Dt,Pt,Tt,wt[8],1163531501,20),Tt=vt(Tt,Bt,Dt,Pt,wt[13],2850285829,5),Pt=vt(Pt,Tt,Bt,Dt,wt[2],4243563512,9),Dt=vt(Dt,Pt,Tt,Bt,wt[7],1735328473,14),Tt=bt(Tt,Bt=vt(Bt,Dt,Pt,Tt,wt[12],2368359562,20),Dt,Pt,wt[5],4294588738,4),Pt=bt(Pt,Tt,Bt,Dt,wt[8],2272392833,11),Dt=bt(Dt,Pt,Tt,Bt,wt[11],1839030562,16),Bt=bt(Bt,Dt,Pt,Tt,wt[14],4259657740,23),Tt=bt(Tt,Bt,Dt,Pt,wt[1],2763975236,4),Pt=bt(Pt,Tt,Bt,Dt,wt[4],1272893353,11),Dt=bt(Dt,Pt,Tt,Bt,wt[7],4139469664,16),Bt=bt(Bt,Dt,Pt,Tt,wt[10],3200236656,23),Tt=bt(Tt,Bt,Dt,Pt,wt[13],681279174,4),Pt=bt(Pt,Tt,Bt,Dt,wt[0],3936430074,11),Dt=bt(Dt,Pt,Tt,Bt,wt[3],3572445317,16),Bt=bt(Bt,Dt,Pt,Tt,wt[6],76029189,23),Tt=bt(Tt,Bt,Dt,Pt,wt[9],3654602809,4),Pt=bt(Pt,Tt,Bt,Dt,wt[12],3873151461,11),Dt=bt(Dt,Pt,Tt,Bt,wt[15],530742520,16),Tt=It(Tt,Bt=bt(Bt,Dt,Pt,Tt,wt[2],3299628645,23),Dt,Pt,wt[0],4096336452,6),Pt=It(Pt,Tt,Bt,Dt,wt[7],1126891415,10),Dt=It(Dt,Pt,Tt,Bt,wt[14],2878612391,15),Bt=It(Bt,Dt,Pt,Tt,wt[5],4237533241,21),Tt=It(Tt,Bt,Dt,Pt,wt[12],1700485571,6),Pt=It(Pt,Tt,Bt,Dt,wt[3],2399980690,10),Dt=It(Dt,Pt,Tt,Bt,wt[10],4293915773,15),Bt=It(Bt,Dt,Pt,Tt,wt[1],2240044497,21),Tt=It(Tt,Bt,Dt,Pt,wt[8],1873313359,6),Pt=It(Pt,Tt,Bt,Dt,wt[15],4264355552,10),Dt=It(Dt,Pt,Tt,Bt,wt[6],2734768916,15),Bt=It(Bt,Dt,Pt,Tt,wt[13],1309151649,21),Tt=It(Tt,Bt,Dt,Pt,wt[4],4149444226,6),Pt=It(Pt,Tt,Bt,Dt,wt[11],3174756917,10),Dt=It(Dt,Pt,Tt,Bt,wt[2],718787259,15),Bt=It(Bt,Dt,Pt,Tt,wt[9],3951481745,21),this._a=this._a+Tt|0,this._b=this._b+Bt|0,this._c=this._c+Dt|0,this._d=this._d+Pt|0},yt.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var wt=xt.allocUnsafe(16);return wt.writeInt32LE(this._a,0),wt.writeInt32LE(this._b,4),wt.writeInt32LE(this._c,8),wt.writeInt32LE(this._d,12),wt},nt.exports=yt},1482:(nt,ft,ht)=>{var gt=ht(7768);function At(Tt,Bt){gt.cipher.registerAlgorithm(Tt,function(){return new gt.aes.Algorithm(Tt,Bt)})}ht(4609),ht(9554),ht(3103),nt.exports=gt.aes=gt.aes||{},gt.aes.startEncrypting=function(Tt,Bt,Dt,Pt){var Nt=Rt({key:Tt,output:Dt,decrypt:!1,mode:Pt});return Nt.start(Bt),Nt},gt.aes.createEncryptionCipher=function(Tt,Bt){return Rt({key:Tt,output:null,decrypt:!1,mode:Bt})},gt.aes.startDecrypting=function(Tt,Bt,Dt,Pt){var Nt=Rt({key:Tt,output:Dt,decrypt:!0,mode:Pt});return Nt.start(Bt),Nt},gt.aes.createDecryptionCipher=function(Tt,Bt){return Rt({key:Tt,output:null,decrypt:!0,mode:Bt})},gt.aes.Algorithm=function(Tt,Bt){vt||bt();var Dt=this;Dt.name=Tt,Dt.mode=new Bt({blockSize:16,cipher:{encrypt:function(Pt,Nt){return wt(Dt._w,Pt,Nt,!1)},decrypt:function(Pt,Nt){return wt(Dt._w,Pt,Nt,!0)}}}),Dt._init=!1},gt.aes.Algorithm.prototype.initialize=function(Tt){if(!this._init){var Bt,Dt=Tt.key;if(typeof Dt!="string"||Dt.length!==16&&Dt.length!==24&&Dt.length!==32){if(gt.util.isArray(Dt)&&(Dt.length===16||Dt.length===24||Dt.length===32)){Bt=Dt,Dt=gt.util.createBuffer();for(var Pt=0;Pt<Bt.length;++Pt)Dt.putByte(Bt[Pt])}}else Dt=gt.util.createBuffer(Dt);if(!gt.util.isArray(Dt)){Bt=Dt,Dt=[];var Nt=Bt.length();if(Nt===16||Nt===24||Nt===32)for(Nt>>>=2,Pt=0;Pt<Nt;++Pt)Dt.push(Bt.getInt32())}if(!gt.util.isArray(Dt)||Dt.length!==4&&Dt.length!==6&&Dt.length!==8)throw new Error("Invalid key parameter.");var Lt=this.mode.name,Wt=["CFB","OFB","CTR","GCM"].indexOf(Lt)!==-1;this._w=It(Dt,Tt.decrypt&&!Wt),this._init=!0}},gt.aes._expandKey=function(Tt,Bt){return vt||bt(),It(Tt,Bt)},gt.aes._updateBlock=wt,At("AES-ECB",gt.cipher.modes.ecb),At("AES-CBC",gt.cipher.modes.cbc),At("AES-CFB",gt.cipher.modes.cfb),At("AES-OFB",gt.cipher.modes.ofb),At("AES-CTR",gt.cipher.modes.ctr),At("AES-GCM",gt.cipher.modes.gcm);var xt,Et,yt,Ct,kt,vt=!1;function bt(){vt=!0,yt=[0,1,2,4,8,16,32,64,128,27,54];for(var Tt=new Array(256),Bt=0;Bt<128;++Bt)Tt[Bt]=Bt<<1,Tt[Bt+128]=Bt+128<<1^283;for(xt=new Array(256),Et=new Array(256),Ct=new Array(4),kt=new Array(4),Bt=0;Bt<4;++Bt)Ct[Bt]=new Array(256),kt[Bt]=new Array(256);var Dt,Pt,Nt,Lt,Wt,$t,Kt,Vt=0,Ut=0;for(Bt=0;Bt<256;++Bt){Lt=(Lt=Ut^Ut<<1^Ut<<2^Ut<<3^Ut<<4)>>8^255&Lt^99,xt[Vt]=Lt,Et[Lt]=Vt,$t=(Wt=Tt[Lt])<<24^Lt<<16^Lt<<8^Lt^Wt,Kt=((Dt=Tt[Vt])^(Pt=Tt[Dt])^(Nt=Tt[Pt]))<<24^(Vt^Nt)<<16^(Vt^Pt^Nt)<<8^Vt^Dt^Nt;for(var _t=0;_t<4;++_t)Ct[_t][Vt]=$t,kt[_t][Lt]=Kt,$t=$t<<24|$t>>>8,Kt=Kt<<24|Kt>>>8;Vt===0?Vt=Ut=1:(Vt=Dt^Tt[Tt[Tt[Dt^Nt]]],Ut^=Tt[Tt[Ut]])}}function It(Tt,Bt){for(var Dt,Pt=Tt.slice(0),Nt=1,Lt=Pt.length,Wt=4*(Lt+6+1),$t=Lt;$t<Wt;++$t)Dt=Pt[$t-1],$t%Lt==0?(Dt=xt[Dt>>>16&255]<<24^xt[Dt>>>8&255]<<16^xt[255&Dt]<<8^xt[Dt>>>24]^yt[Nt]<<24,Nt++):Lt>6&&$t%Lt==4&&(Dt=xt[Dt>>>24]<<24^xt[Dt>>>16&255]<<16^xt[Dt>>>8&255]<<8^xt[255&Dt]),Pt[$t]=Pt[$t-Lt]^Dt;if(Bt){for(var Kt,Vt=kt[0],Ut=kt[1],_t=kt[2],Xt=kt[3],Qt=Pt.slice(0),jt=($t=0,(Wt=Pt.length)-4);$t<Wt;$t+=4,jt-=4)if($t===0||$t===Wt-4)Qt[$t]=Pt[jt],Qt[$t+1]=Pt[jt+3],Qt[$t+2]=Pt[jt+2],Qt[$t+3]=Pt[jt+1];else for(var Gt=0;Gt<4;++Gt)Kt=Pt[jt+Gt],Qt[$t+(3&-Gt)]=Vt[xt[Kt>>>24]]^Ut[xt[Kt>>>16&255]]^_t[xt[Kt>>>8&255]]^Xt[xt[255&Kt]];Pt=Qt}return Pt}function wt(Tt,Bt,Dt,Pt){var Nt,Lt,Wt,$t,Kt,Vt,Ut,_t,Xt,Qt,jt,Gt,qt=Tt.length/4-1;Pt?(Nt=kt[0],Lt=kt[1],Wt=kt[2],$t=kt[3],Kt=Et):(Nt=Ct[0],Lt=Ct[1],Wt=Ct[2],$t=Ct[3],Kt=xt),Vt=Bt[0]^Tt[0],Ut=Bt[Pt?3:1]^Tt[1],_t=Bt[2]^Tt[2],Xt=Bt[Pt?1:3]^Tt[3];for(var zt=3,e0=1;e0<qt;++e0)Qt=Nt[Vt>>>24]^Lt[Ut>>>16&255]^Wt[_t>>>8&255]^$t[255&Xt]^Tt[++zt],jt=Nt[Ut>>>24]^Lt[_t>>>16&255]^Wt[Xt>>>8&255]^$t[255&Vt]^Tt[++zt],Gt=Nt[_t>>>24]^Lt[Xt>>>16&255]^Wt[Vt>>>8&255]^$t[255&Ut]^Tt[++zt],Xt=Nt[Xt>>>24]^Lt[Vt>>>16&255]^Wt[Ut>>>8&255]^$t[255&_t]^Tt[++zt],Vt=Qt,Ut=jt,_t=Gt;Dt[0]=Kt[Vt>>>24]<<24^Kt[Ut>>>16&255]<<16^Kt[_t>>>8&255]<<8^Kt[255&Xt]^Tt[++zt],Dt[Pt?3:1]=Kt[Ut>>>24]<<24^Kt[_t>>>16&255]<<16^Kt[Xt>>>8&255]<<8^Kt[255&Vt]^Tt[++zt],Dt[2]=Kt[_t>>>24]<<24^Kt[Xt>>>16&255]<<16^Kt[Vt>>>8&255]<<8^Kt[255&Ut]^Tt[++zt],Dt[Pt?1:3]=Kt[Xt>>>24]<<24^Kt[Vt>>>16&255]<<16^Kt[Ut>>>8&255]<<8^Kt[255&_t]^Tt[++zt]}function Rt(Tt){var Bt,Dt="AES-"+((Tt=Tt||{}).mode||"CBC").toUpperCase(),Pt=(Bt=Tt.decrypt?gt.cipher.createDecipher(Dt,Tt.key):gt.cipher.createCipher(Dt,Tt.key)).start;return Bt.start=function(Nt,Lt){var Wt=null;Lt instanceof gt.util.ByteBuffer&&(Wt=Lt,Lt={}),(Lt=Lt||{}).output=Wt,Lt.iv=Nt,Pt.call(Bt,Lt)},Bt}},6898:(nt,ft,ht)=>{var gt=ht(7768);ht(1482),ht(8472);var At=nt.exports=gt.tls;function xt(vt,bt,It){var wt=bt.entity===gt.tls.ConnectionEnd.client;vt.read.cipherState={init:!1,cipher:gt.cipher.createDecipher("AES-CBC",wt?It.keys.server_write_key:It.keys.client_write_key),iv:wt?It.keys.server_write_IV:It.keys.client_write_IV},vt.write.cipherState={init:!1,cipher:gt.cipher.createCipher("AES-CBC",wt?It.keys.client_write_key:It.keys.server_write_key),iv:wt?It.keys.client_write_IV:It.keys.server_write_IV},vt.read.cipherFunction=kt,vt.write.cipherFunction=Et,vt.read.macLength=vt.write.macLength=It.mac_length,vt.read.macFunction=vt.write.macFunction=At.hmac_sha1}function Et(vt,bt){var It,wt=!1,Rt=bt.macFunction(bt.macKey,bt.sequenceNumber,vt);vt.fragment.putBytes(Rt),bt.updateSequenceNumber(),It=vt.version.minor===At.Versions.TLS_1_0.minor?bt.cipherState.init?null:bt.cipherState.iv:gt.random.getBytesSync(16),bt.cipherState.init=!0;var Tt=bt.cipherState.cipher;return Tt.start({iv:It}),vt.version.minor>=At.Versions.TLS_1_1.minor&&Tt.output.putBytes(It),Tt.update(vt.fragment),Tt.finish(yt)&&(vt.fragment=Tt.output,vt.length=vt.fragment.length(),wt=!0),wt}function yt(vt,bt,It){if(!It){var wt=vt-bt.length()%vt;bt.fillWithByte(wt-1,wt)}return!0}function Ct(vt,bt,It){var wt=!0;if(It){for(var Rt=bt.length(),Tt=bt.last(),Bt=Rt-1-Tt;Bt<Rt-1;++Bt)wt=wt&&bt.at(Bt)==Tt;wt&&bt.truncate(Tt+1)}return wt}function kt(vt,bt){var It,wt=!1;It=vt.version.minor===At.Versions.TLS_1_0.minor?bt.cipherState.init?null:bt.cipherState.iv:vt.fragment.getBytes(16),bt.cipherState.init=!0;var Rt=bt.cipherState.cipher;Rt.start({iv:It}),Rt.update(vt.fragment),wt=Rt.finish(Ct);var Tt=bt.macLength,Bt=gt.random.getBytesSync(Tt),Dt=Rt.output.length();Dt>=Tt?(vt.fragment=Rt.output.getBytes(Dt-Tt),Bt=Rt.output.getBytes(Tt)):vt.fragment=Rt.output.getBytes(),vt.fragment=gt.util.createBuffer(vt.fragment),vt.length=vt.fragment.length();var Pt=bt.macFunction(bt.macKey,bt.sequenceNumber,vt);return bt.updateSequenceNumber(),wt=function(Nt,Lt,Wt){var $t=gt.hmac.create();return $t.start("SHA1",Nt),$t.update(Lt),Lt=$t.digest().getBytes(),$t.start(null,null),$t.update(Wt),Lt===(Wt=$t.digest().getBytes())}(bt.macKey,Bt,Pt)&&wt,wt}At.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(vt){vt.bulk_cipher_algorithm=At.BulkCipherAlgorithm.aes,vt.cipher_type=At.CipherType.block,vt.enc_key_length=16,vt.block_length=16,vt.fixed_iv_length=16,vt.record_iv_length=16,vt.mac_algorithm=At.MACAlgorithm.hmac_sha1,vt.mac_length=20,vt.mac_key_length=20},initConnectionState:xt},At.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(vt){vt.bulk_cipher_algorithm=At.BulkCipherAlgorithm.aes,vt.cipher_type=At.CipherType.block,vt.enc_key_length=32,vt.block_length=16,vt.fixed_iv_length=16,vt.record_iv_length=16,vt.mac_algorithm=At.MACAlgorithm.hmac_sha1,vt.mac_length=20,vt.mac_key_length=20},initConnectionState:xt}},5235:(nt,ft,ht)=>{var gt=ht(7768);ht(2624);var At=gt.asn1;ft.privateKeyValidator={name:"PrivateKeyInfo",tagClass:At.Class.UNIVERSAL,type:At.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:At.Class.UNIVERSAL,type:At.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:At.Class.UNIVERSAL,type:At.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:At.Class.UNIVERSAL,type:At.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:At.Class.UNIVERSAL,type:At.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},ft.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:At.Class.UNIVERSAL,type:At.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:At.Class.UNIVERSAL,type:At.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:At.Class.UNIVERSAL,type:At.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:At.Class.UNIVERSAL,type:At.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},2624:(nt,ft,ht)=>{var gt=ht(7768);ht(3103),ht(2884);var At=nt.exports=gt.asn1=gt.asn1||{};function xt(Ct,kt,vt){if(vt>kt){var bt=new Error("Too few bytes to parse DER.");throw bt.available=Ct.length(),bt.remaining=kt,bt.requested=vt,bt}}function Et(Ct,kt,vt,bt){var It;xt(Ct,kt,2);var wt=Ct.getByte();kt--;var Rt=192&wt,Tt=31&wt;It=Ct.length();var Bt,Dt,Pt=function(Qt,jt){var Gt=Qt.getByte();if(jt--,Gt!==128){var qt;if(128&Gt){var zt=127&Gt;xt(Qt,jt,zt),qt=Qt.getInt(zt<<3)}else qt=Gt;if(qt<0)throw new Error("Negative length: "+qt);return qt}}(Ct,kt);if(kt-=It-Ct.length(),Pt!==void 0&&Pt>kt){if(bt.strict){var Nt=new Error("Too few bytes to read ASN.1 value.");throw Nt.available=Ct.length(),Nt.remaining=kt,Nt.requested=Pt,Nt}Pt=kt}var Lt=(32&wt)==32;if(Lt)if(Bt=[],Pt===void 0)for(;;){if(xt(Ct,kt,2),Ct.bytes(2)==="\0\0"){Ct.getBytes(2),kt-=2;break}It=Ct.length(),Bt.push(Et(Ct,kt,vt+1,bt)),kt-=It-Ct.length()}else for(;Pt>0;)It=Ct.length(),Bt.push(Et(Ct,Pt,vt+1,bt)),kt-=It-Ct.length(),Pt-=It-Ct.length();if(Bt===void 0&&Rt===At.Class.UNIVERSAL&&Tt===At.Type.BITSTRING&&(Dt=Ct.bytes(Pt)),Bt===void 0&&bt.decodeBitStrings&&Rt===At.Class.UNIVERSAL&&Tt===At.Type.BITSTRING&&Pt>1){var Wt=Ct.read,$t=kt,Kt=0;if(Tt===At.Type.BITSTRING&&(xt(Ct,kt,1),Kt=Ct.getByte(),kt--),Kt===0)try{It=Ct.length();var Vt=Et(Ct,kt,vt+1,{strict:!0,decodeBitStrings:!0}),Ut=It-Ct.length();kt-=Ut,Tt==At.Type.BITSTRING&&Ut++;var _t=Vt.tagClass;Ut!==Pt||_t!==At.Class.UNIVERSAL&&_t!==At.Class.CONTEXT_SPECIFIC||(Bt=[Vt])}catch{}Bt===void 0&&(Ct.read=Wt,kt=$t)}if(Bt===void 0){if(Pt===void 0){if(bt.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");Pt=kt}if(Tt===At.Type.BMPSTRING)for(Bt="";Pt>0;Pt-=2)xt(Ct,kt,2),Bt+=String.fromCharCode(Ct.getInt16()),kt-=2;else Bt=Ct.getBytes(Pt),kt-=Pt}var Xt=Dt===void 0?null:{bitStringContents:Dt};return At.create(Rt,Tt,Lt,Bt,Xt)}At.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},At.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},At.create=function(Ct,kt,vt,bt,It){if(gt.util.isArray(bt)){for(var wt=[],Rt=0;Rt<bt.length;++Rt)bt[Rt]!==void 0&&wt.push(bt[Rt]);bt=wt}var Tt={tagClass:Ct,type:kt,constructed:vt,composed:vt||gt.util.isArray(bt),value:bt};return It&&"bitStringContents"in It&&(Tt.bitStringContents=It.bitStringContents,Tt.original=At.copy(Tt)),Tt},At.copy=function(Ct,kt){var vt;if(gt.util.isArray(Ct)){vt=[];for(var bt=0;bt<Ct.length;++bt)vt.push(At.copy(Ct[bt],kt));return vt}return typeof Ct=="string"?Ct:(vt={tagClass:Ct.tagClass,type:Ct.type,constructed:Ct.constructed,composed:Ct.composed,value:At.copy(Ct.value,kt)},kt&&!kt.excludeBitStringContents&&(vt.bitStringContents=Ct.bitStringContents),vt)},At.equals=function(Ct,kt,vt){if(gt.util.isArray(Ct)){if(!gt.util.isArray(kt)||Ct.length!==kt.length)return!1;for(var bt=0;bt<Ct.length;++bt)if(!At.equals(Ct[bt],kt[bt]))return!1;return!0}if(typeof Ct!=typeof kt)return!1;if(typeof Ct=="string")return Ct===kt;var It=Ct.tagClass===kt.tagClass&&Ct.type===kt.type&&Ct.constructed===kt.constructed&&Ct.composed===kt.composed&&At.equals(Ct.value,kt.value);return vt&&vt.includeBitStringContents&&(It=It&&Ct.bitStringContents===kt.bitStringContents),It},At.getBerValueLength=function(Ct){var kt=Ct.getByte();if(kt!==128)return 128&kt?Ct.getInt((127&kt)<<3):kt},At.fromDer=function(Ct,kt){kt===void 0&&(kt={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof kt=="boolean"&&(kt={strict:kt,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in kt||(kt.strict=!0),"parseAllBytes"in kt||(kt.parseAllBytes=!0),"decodeBitStrings"in kt||(kt.decodeBitStrings=!0),typeof Ct=="string"&&(Ct=gt.util.createBuffer(Ct));var vt=Ct.length(),bt=Et(Ct,Ct.length(),0,kt);if(kt.parseAllBytes&&Ct.length()!==0){var It=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw It.byteCount=vt,It.remaining=Ct.length(),It}return bt},At.toDer=function(Ct){var kt=gt.util.createBuffer(),vt=Ct.tagClass|Ct.type,bt=gt.util.createBuffer(),It=!1;if("bitStringContents"in Ct&&(It=!0,Ct.original&&(It=At.equals(Ct,Ct.original))),It)bt.putBytes(Ct.bitStringContents);else if(Ct.composed){Ct.constructed?vt|=32:bt.putByte(0);for(var wt=0;wt<Ct.value.length;++wt)Ct.value[wt]!==void 0&&bt.putBuffer(At.toDer(Ct.value[wt]))}else if(Ct.type===At.Type.BMPSTRING)for(wt=0;wt<Ct.value.length;++wt)bt.putInt16(Ct.value.charCodeAt(wt));else Ct.type===At.Type.INTEGER&&Ct.value.length>1&&(Ct.value.charCodeAt(0)===0&&!(128&Ct.value.charCodeAt(1))||Ct.value.charCodeAt(0)===255&&(128&Ct.value.charCodeAt(1))==128)?bt.putBytes(Ct.value.substr(1)):bt.putBytes(Ct.value);if(kt.putByte(vt),bt.length()<=127)kt.putByte(127&bt.length());else{var Rt=bt.length(),Tt="";do Tt+=String.fromCharCode(255&Rt),Rt>>>=8;while(Rt>0);for(kt.putByte(128|Tt.length),wt=Tt.length-1;wt>=0;--wt)kt.putByte(Tt.charCodeAt(wt))}return kt.putBuffer(bt),kt},At.oidToDer=function(Ct){var kt,vt,bt,It,wt=Ct.split("."),Rt=gt.util.createBuffer();Rt.putByte(40*parseInt(wt[0],10)+parseInt(wt[1],10));for(var Tt=2;Tt<wt.length;++Tt){kt=!0,vt=[],bt=parseInt(wt[Tt],10);do It=127&bt,bt>>>=7,kt||(It|=128),vt.push(It),kt=!1;while(bt>0);for(var Bt=vt.length-1;Bt>=0;--Bt)Rt.putByte(vt[Bt])}return Rt},At.derToOid=function(Ct){var kt;typeof Ct=="string"&&(Ct=gt.util.createBuffer(Ct));var vt=Ct.getByte();kt=Math.floor(vt/40)+"."+vt%40;for(var bt=0;Ct.length()>0;)bt<<=7,128&(vt=Ct.getByte())?bt+=127&vt:(kt+="."+(bt+vt),bt=0);return kt},At.utcTimeToDate=function(Ct){var kt=new Date,vt=parseInt(Ct.substr(0,2),10);vt=vt>=50?1900+vt:2e3+vt;var bt=parseInt(Ct.substr(2,2),10)-1,It=parseInt(Ct.substr(4,2),10),wt=parseInt(Ct.substr(6,2),10),Rt=parseInt(Ct.substr(8,2),10),Tt=0;if(Ct.length>11){var Bt=Ct.charAt(10),Dt=10;Bt!=="+"&&Bt!=="-"&&(Tt=parseInt(Ct.substr(10,2),10),Dt+=2)}if(kt.setUTCFullYear(vt,bt,It),kt.setUTCHours(wt,Rt,Tt,0),Dt&&((Bt=Ct.charAt(Dt))==="+"||Bt==="-")){var Pt=60*parseInt(Ct.substr(Dt+1,2),10)+parseInt(Ct.substr(Dt+4,2),10);Pt*=6e4,Bt==="+"?kt.setTime(+kt-Pt):kt.setTime(+kt+Pt)}return kt},At.generalizedTimeToDate=function(Ct){var kt=new Date,vt=parseInt(Ct.substr(0,4),10),bt=parseInt(Ct.substr(4,2),10)-1,It=parseInt(Ct.substr(6,2),10),wt=parseInt(Ct.substr(8,2),10),Rt=parseInt(Ct.substr(10,2),10),Tt=parseInt(Ct.substr(12,2),10),Bt=0,Dt=0,Pt=!1;Ct.charAt(Ct.length-1)==="Z"&&(Pt=!0);var Nt=Ct.length-5,Lt=Ct.charAt(Nt);return Lt!=="+"&&Lt!=="-"||(Dt=60*parseInt(Ct.substr(Nt+1,2),10)+parseInt(Ct.substr(Nt+4,2),10),Dt*=6e4,Lt==="+"&&(Dt*=-1),Pt=!0),Ct.charAt(14)==="."&&(Bt=1e3*parseFloat(Ct.substr(14),10)),Pt?(kt.setUTCFullYear(vt,bt,It),kt.setUTCHours(wt,Rt,Tt,Bt),kt.setTime(+kt+Dt)):(kt.setFullYear(vt,bt,It),kt.setHours(wt,Rt,Tt,Bt)),kt},At.dateToUtcTime=function(Ct){if(typeof Ct=="string")return Ct;var kt="",vt=[];vt.push((""+Ct.getUTCFullYear()).substr(2)),vt.push(""+(Ct.getUTCMonth()+1)),vt.push(""+Ct.getUTCDate()),vt.push(""+Ct.getUTCHours()),vt.push(""+Ct.getUTCMinutes()),vt.push(""+Ct.getUTCSeconds());for(var bt=0;bt<vt.length;++bt)vt[bt].length<2&&(kt+="0"),kt+=vt[bt];return kt+"Z"},At.dateToGeneralizedTime=function(Ct){if(typeof Ct=="string")return Ct;var kt="",vt=[];vt.push(""+Ct.getUTCFullYear()),vt.push(""+(Ct.getUTCMonth()+1)),vt.push(""+Ct.getUTCDate()),vt.push(""+Ct.getUTCHours()),vt.push(""+Ct.getUTCMinutes()),vt.push(""+Ct.getUTCSeconds());for(var bt=0;bt<vt.length;++bt)vt[bt].length<2&&(kt+="0"),kt+=vt[bt];return kt+"Z"},At.integerToDer=function(Ct){var kt=gt.util.createBuffer();if(Ct>=-128&&Ct<128)return kt.putSignedInt(Ct,8);if(Ct>=-32768&&Ct<32768)return kt.putSignedInt(Ct,16);if(Ct>=-8388608&&Ct<8388608)return kt.putSignedInt(Ct,24);if(Ct>=-2147483648&&Ct<2147483648)return kt.putSignedInt(Ct,32);var vt=new Error("Integer too large; max is 32-bits.");throw vt.integer=Ct,vt},At.derToInteger=function(Ct){typeof Ct=="string"&&(Ct=gt.util.createBuffer(Ct));var kt=8*Ct.length();if(kt>32)throw new Error("Integer too large; max is 32-bits.");return Ct.getSignedInt(kt)},At.validate=function(Ct,kt,vt,bt){var It=!1;if(Ct.tagClass!==kt.tagClass&&kt.tagClass!==void 0||Ct.type!==kt.type&&kt.type!==void 0)bt&&(Ct.tagClass!==kt.tagClass&&bt.push("["+kt.name+'] Expected tag class "'+kt.tagClass+'", got "'+Ct.tagClass+'"'),Ct.type!==kt.type&&bt.push("["+kt.name+'] Expected type "'+kt.type+'", got "'+Ct.type+'"'));else if(Ct.constructed===kt.constructed||kt.constructed===void 0){if(It=!0,kt.value&&gt.util.isArray(kt.value))for(var wt=0,Rt=0;It&&Rt<kt.value.length;++Rt)It=kt.value[Rt].optional||!1,Ct.value[wt]&&((It=At.validate(Ct.value[wt],kt.value[Rt],vt,bt))?++wt:kt.value[Rt].optional&&(It=!0)),!It&&bt&&bt.push("["+kt.name+'] Tag class "'+kt.tagClass+'", type "'+kt.type+'" expected value length "'+kt.value.length+'", got "'+Ct.value.length+'"');if(It&&vt&&(kt.capture&&(vt[kt.capture]=Ct.value),kt.captureAsn1&&(vt[kt.captureAsn1]=Ct),kt.captureBitStringContents&&"bitStringContents"in Ct&&(vt[kt.captureBitStringContents]=Ct.bitStringContents),kt.captureBitStringValue&&"bitStringContents"in Ct))if(Ct.bitStringContents.length<2)vt[kt.captureBitStringValue]="";else{if(Ct.bitStringContents.charCodeAt(0)!==0)throw new Error("captureBitStringValue only supported for zero unused bits");vt[kt.captureBitStringValue]=Ct.bitStringContents.slice(1)}}else bt&&bt.push("["+kt.name+'] Expected constructed "'+kt.constructed+'", got "'+Ct.constructed+'"');return It};var yt=/[^\\u0000-\\u00ff]/;At.prettyPrint=function(Ct,kt,vt){var bt="";vt=vt||2,(kt=kt||0)>0&&(bt+=`
10168
+ `,viewStates$1={LOADING:"LOADING",SUCCESS:"SUCCESS"},CustomWatchList=({token:Be,onSuccess:Le})=>{const{t:Ye}=useTranslation$1(),[tt,nt]=React.useState(viewStates$1.LOADING);return React.useEffect(()=>{(async()=>{addScreenEvent({module:eventModuleNames.customWatchList,screen:eventScreenNames.customWatchListProgress,token:Be.token,shouldOpen:!0});const ht=await processWatchlist({token:Be.token});addEvent({token:Be.token,code:"processWatchlist",payload:ht}),addScreenEvent({module:eventModuleNames.customWatchList,screen:eventScreenNames.customWatchListProgress,token:Be.token,shouldOpen:!1}),nt(viewStates$1.SUCCESS),addScreenEvent({module:eventModuleNames.customWatchList,screen:eventScreenNames.customWatchListSuccess,token:Be.token,shouldOpen:!0}),sleep(3e3).then(()=>{addScreenEvent({module:eventModuleNames.customWatchList,screen:eventScreenNames.customWatchListSuccess,token:Be.token,shouldOpen:!1}),Le()})})()},[Be]),jsxRuntimeExports.jsxs(WatchListContainer,{children:[tt===viewStates$1.LOADING&&jsxRuntimeExports.jsx(Loader,{fullScreen:!0,message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h1",{children:Ye("watchList.uploading")}),jsxRuntimeExports.jsx("span",{children:Ye("watchList.thisMigthTake")}),jsxRuntimeExports.jsx("span",{children:Ye("watchList.browser")})]})}),tt===viewStates$1.SUCCESS&&jsxRuntimeExports.jsx(SuccessMessage,{})]})};function processGlobalWatchlist({token:Be}){return exports.api.post("/omni/process/global-watchlist",{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}const viewStates={LOADING:"LOADING",SUCCESS:"SUCCESS"},GlobalWatchList=({onSuccess:Be,token:Le})=>{const{t:Ye}=useTranslation$1(),[tt,nt]=React.useState(viewStates.LOADING);return React.useEffect(()=>{async function ft(){try{await processGlobalWatchlist({token:Le.token}),nt(viewStates.SUCCESS)}catch(ht){console.error(ht)}setTimeout(()=>Be(),3e3)}ft()},[Le]),jsxRuntimeExports.jsx(WatchListContainer,{children:tt===viewStates.SUCCESS?jsxRuntimeExports.jsx(SuccessMessage,{}):jsxRuntimeExports.jsx(Loader,{fullScreen:!0,message:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h1",{children:Ye("watchList.processing")}),jsxRuntimeExports.jsx("span",{children:Ye("watchList.thisMigthTake")}),jsxRuntimeExports.jsx("span",{children:Ye("watchList.browser")})]})})})};function CustomWatchListModule({onSuccess:Be,token:Le}){return jsxRuntimeExports.jsx(CustomWatchList,{onSuccess:Be,token:{token:Le}})}function GlobalWatchListModule({onSuccess:Be,token:Le}){return jsxRuntimeExports.jsx(GlobalWatchList,{onSuccess:Be,token:{token:Le}})}const moduleComponents={ADDRESS:AddressModule,EMAIL:EmailModule,SELFIE:SelfieModule,ANTIFRAUD:AntifraudModule,PHONE:PhoneModule,COMBINED_CONSENT:CombinedConsentModule,USER_CONSENT:UserConsentModule,GEOLOCATION:GeolocationModule,AUTHENTICATION:AuthenticationModule,ID:IdModule,SECOND_ID:SecondIdModule,THIRD_ID:ThirdIdModule,FACE_MATCH:FaceMatchModule,GOVT_VALIDATION_PROVISIONING:GovernmentValidationModule,CURP_VALIDATION:CurpModule,INCODE_WATCHLIST:CustomWatchListModule,WATCHLIST:GlobalWatchListModule,TRUST_GRAPH:TrustGraphModule,SIGNATURE:SignatureModule,QE_SIGNATURE:QESignatureModule,AE_SIGNATURE:AESignatureModule,CERTIFICATE_ISSUANCE:CertificateIssuanceModule,DOCUMENT_CAPTURE:DocumentCaptureModule,DYNAMIC_FORMS:FormsModule,NFC_SCAN:NFCScanModule,EKYB:EkybModule,WATCHLIST_BUSINESS:SkipModule,EXTERNAL_VERIFICATION:EkycModule,FINISH_GPT:SkipModule,CONFERENCE:ConferenceModule,FISCAL_QR:FiscalQRModule,INSTANT_BAV:BAVModule,FACE_ONBOARDING:SkipModule,FIELD_COMPARISON:FieldComparisonModule,SHOW_RESULTS:ShowResultsModule,CHECKBOX_SIGNATURE:SkipModule,VIDEO_ONBOARDING:VideoSelfieModule,ID_OCR:IDOCRModule,CUSTOM_FIELDS:CustomFieldsModule,INE_VALIDATION:GovernmentValidationModule,TUTORIAL_ID:IdModule,ML_CONSENT:MLConsentModule,CROSS_DOCUMENT_DATA_MATCH:CrossDocumentDataMatchModule,DEVICE_FINGERPRINT:SkipModule,INSTANT_VERIFY:SkipModule,IP_ADDRESS:SkipModule,NAME_CAPTURE:NameCaptureModule,UNIVERSAL_IDENTITY:SkipModule};function ModuleRenderer({module:Be,onSuccess:Le,emit:Ye,token:tt,onError:nt,flow:ft,uiConfig:ht,finishWithError:gt,startConfig:At,authHint:xt}){const Et=moduleComponents[Be.key]||SkipModule;return jsxRuntimeExports.jsx(Et,{config:Be.configuration,onSuccess:Le,emit:Ye,token:tt,onError:nt,flow:ft,uiConfig:ht,finishWithError:gt,startConfig:At,authHint:xt},Be.key)}function FlowRenderer({token:Be,onError:Le,onSuccess:Ye,onEvent:tt=()=>{},flow:nt,uiConfig:ft,startConfig:ht,authHint:gt}){const{flow:At,loading:xt,error:Et}=useFlow(Be,nt),[yt,Ct]=React.useState(0),[kt,vt]=React.useState(!1),bt=React.useMemo(()=>new FlowLogger(tt),[tt]),{showRedirect:It,onSkip:wt}=useFlowRedirect({flow:At,forceSkipRedirect:ht==null?void 0:ht.forceSkipRedirect});if(React.useEffect(()=>{At&&(bt.flowStarted(At.flowModules.length),It?bt.flowRedirected():bt.stepStarted(At.flowModules[0].key,0,At.flowModules.length))},[At,bt,It]),xt)return null;if(Et){const Dt={type:"FLOW_LOAD_FAILED",message:Et};return Le(Dt),bt.flowError(Dt),null}if(!At)return null;const Rt=At.flowModules,Tt=Rt[yt],Bt=async()=>{const Dt=Rt.length;bt.stepCompleted(Tt.key,yt,Dt);const Pt=yt+1;if(Pt<Dt)bt.stepStarted(Rt[Pt].key,Pt,Dt),Ct(Pt);else{vt(!0);const{redirectionUrl:Nt}=await getFinishStatus(void 0,{token:Be});bt.flowCompleted(Dt),Ye({redirectionUrl:Nt})}};return kt?jsxRuntimeExports.jsx(Spinner$6,{}):It?jsxRuntimeExports.jsx(FlowRedirect,{flow:At,token:Be,onSuccess:Bt,onSkip:wt,mobileQrRedirectUrl:ht==null?void 0:ht.mobileQrRedirectUrl,authHint:gt}):jsxRuntimeExports.jsx(App$1,{token:Be,disableUnsupportedBrowserScreen:At==null?void 0:At.disableUnsupportedBrowserScreen,children:jsxRuntimeExports.jsx(FlowDataProvider,{token:Be,children:jsxRuntimeExports.jsx(ModuleRenderer,{module:Tt,onSuccess:Bt,emit:Dt=>bt.emit(Dt),token:Be,onError:Bt,flow:At,uiConfig:ft,finishWithError:Dt=>Le(Dt),startConfig:ht,authHint:gt})})})}const executeFlow=async({element:Be,token:Le,onSuccess:Ye,onError:tt,onEvent:nt,flow:ft,uiConfig:ht,config:gt,authHint:At})=>{const xt=createRoot$1(Be);customRender(jsxRuntimeExports.jsx(FlowRenderer,{token:Le,onSuccess:Ye,onError:tt,onEvent:nt,flow:ft,uiConfig:ht,startConfig:gt,authHint:At}),Be,xt)};function renderForms(Be,{onSuccess:Le,onError:Ye,token:tt,interviewId:nt,flowId:ft,screens:ht}){const gt=createRoot$1(Be),At={token:tt,interviewId:nt,onBoarding:this,flowId:ft,onSuccess:handleUnmountRoot(Le,gt,Be),onError:handleUnmountRoot(Ye,gt,Be),screens:ht};customRender(jsxRuntimeExports.jsx(App$1,{token:tt,children:jsxRuntimeExports.jsx(Forms$1,{...At})}),Be,gt)}function getConnectionDetails(Be){return exports.api.get(`/omni/queue/conference/connection-details?uuid=${Be}`).then(Le=>Le.data).catch(Le=>({error:`Error: ${Le}`}))}async function getInstantVerifyMissingModules({token:Be}){return exports.api.get("/omni/instant/missing-modules",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}function getMedicalOcrData({token:Be}){return exports.api.get("/omni/get/medical-ocr-data",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>({error:`Error: ${Le}`}))}function getSecondIdImagesV2({token:Be,body:Le}){return exports.api.post("/omni/get/images-second-id",Le,{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data)}async function instantVerifyShareIdentity({token:Be,consentGiven:Le}){return exports.api.post("/omni/instant/share-identity",{consentGiven:Le},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(Ye=>Promise.reject(Ye.response.data))}async function instantVerifyUpdate({token:Be}){return exports.api.post("/omni/instant/update-identity",{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}function lastNameMatch({token:Be}){return exports.api.get("/omni/last-name-match",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response))}function lastNameMatchByCustomer({token:Be}){return exports.api.get("/omni/customer/last-name-match ",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response))}function manualIdUpload(Be,{token:Le,onSuccess:Ye,type:tt,onlyFront:nt=!1}){const ft=createRoot$1(Be),ht={onSuccess:handleUnmountRoot(Ye,ft,Be),onBoarding:this,type:tt,token:Le,onlyFront:nt};customRender(jsxRuntimeExports.jsx(App$1,{token:Le.token,children:jsxRuntimeExports.jsx(CaptureManualId,{token:Le,...ht})}),Be,ft)}function mock({token:Be,interviewId:Le}){return exports.api.get(`/omni/mock?interviewId=${Le}`,{headers:{"X-Incode-Hardware-Id":Be}})}function processAddressStatement({token:Be}){return exports.api.post("/omni/process/address",null,{headers:{"X-Incode-Hardware-Id":Be}}).catch(Le=>Promise.reject(Le.response.data))}function processCreditCard({token:Be}){return exports.api.post("/omni/process/credit-card",{},{headers:{"X-Incode-Hardware-Id":Be}}).catch(Le=>Promise.reject(Le.response.data))}/*! For license information please see bundle.js.LICENSE.txt */(()=>{var Be={5766:(nt,ft)=>{ft.byteLength=function(vt){var bt=Ct(vt),It=bt[0],wt=bt[1];return 3*(It+wt)/4-wt},ft.toByteArray=function(vt){var bt,It,wt=Ct(vt),Rt=wt[0],Tt=wt[1],Bt=new At(function(Nt,Lt,Wt){return 3*(Lt+Wt)/4-Wt}(0,Rt,Tt)),Dt=0,Pt=Tt>0?Rt-4:Rt;for(It=0;It<Pt;It+=4)bt=gt[vt.charCodeAt(It)]<<18|gt[vt.charCodeAt(It+1)]<<12|gt[vt.charCodeAt(It+2)]<<6|gt[vt.charCodeAt(It+3)],Bt[Dt++]=bt>>16&255,Bt[Dt++]=bt>>8&255,Bt[Dt++]=255&bt;return Tt===2&&(bt=gt[vt.charCodeAt(It)]<<2|gt[vt.charCodeAt(It+1)]>>4,Bt[Dt++]=255&bt),Tt===1&&(bt=gt[vt.charCodeAt(It)]<<10|gt[vt.charCodeAt(It+1)]<<4|gt[vt.charCodeAt(It+2)]>>2,Bt[Dt++]=bt>>8&255,Bt[Dt++]=255&bt),Bt},ft.fromByteArray=function(vt){for(var bt,It=vt.length,wt=It%3,Rt=[],Tt=16383,Bt=0,Dt=It-wt;Bt<Dt;Bt+=Tt)Rt.push(kt(vt,Bt,Bt+Tt>Dt?Dt:Bt+Tt));return wt===1?(bt=vt[It-1],Rt.push(ht[bt>>2]+ht[bt<<4&63]+"==")):wt===2&&(bt=(vt[It-2]<<8)+vt[It-1],Rt.push(ht[bt>>10]+ht[bt>>4&63]+ht[bt<<2&63]+"=")),Rt.join("")};for(var ht=[],gt=[],At=typeof Uint8Array<"u"?Uint8Array:Array,xt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Et=0,yt=xt.length;Et<yt;++Et)ht[Et]=xt[Et],gt[xt.charCodeAt(Et)]=Et;function Ct(vt){var bt=vt.length;if(bt%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var It=vt.indexOf("=");return It===-1&&(It=bt),[It,It===bt?0:4-It%4]}function kt(vt,bt,It){for(var wt,Rt,Tt=[],Bt=bt;Bt<It;Bt+=3)wt=(vt[Bt]<<16&16711680)+(vt[Bt+1]<<8&65280)+(255&vt[Bt+2]),Tt.push(ht[(Rt=wt)>>18&63]+ht[Rt>>12&63]+ht[Rt>>6&63]+ht[63&Rt]);return Tt.join("")}gt[45]=62,gt[95]=63},8834:(nt,ft,ht)=>{var gt=ht(5766),At=ht(2333),xt=ht(7906);function Et(){return Ct.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function yt(Yt,Mt){if(Et()<Mt)throw new RangeError("Invalid typed array length");return Ct.TYPED_ARRAY_SUPPORT?(Yt=new Uint8Array(Mt)).__proto__=Ct.prototype:(Yt===null&&(Yt=new Ct(Mt)),Yt.length=Mt),Yt}function Ct(Yt,Mt,Jt){if(!(Ct.TYPED_ARRAY_SUPPORT||this instanceof Ct))return new Ct(Yt,Mt,Jt);if(typeof Yt=="number"){if(typeof Mt=="string")throw new Error("If encoding is specified then the first argument must be a string");return bt(this,Yt)}return kt(this,Yt,Mt,Jt)}function kt(Yt,Mt,Jt,a0){if(typeof Mt=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&Mt instanceof ArrayBuffer?function(i0,f0,u0,x0){if(f0.byteLength,u0<0||f0.byteLength<u0)throw new RangeError("'offset' is out of bounds");if(f0.byteLength<u0+(x0||0))throw new RangeError("'length' is out of bounds");return f0=u0===void 0&&x0===void 0?new Uint8Array(f0):x0===void 0?new Uint8Array(f0,u0):new Uint8Array(f0,u0,x0),Ct.TYPED_ARRAY_SUPPORT?(i0=f0).__proto__=Ct.prototype:i0=It(i0,f0),i0}(Yt,Mt,Jt,a0):typeof Mt=="string"?function(i0,f0,u0){if(typeof u0=="string"&&u0!==""||(u0="utf8"),!Ct.isEncoding(u0))throw new TypeError('"encoding" must be a valid string encoding');var x0=0|Rt(f0,u0),p0=(i0=yt(i0,x0)).write(f0,u0);return p0!==x0&&(i0=i0.slice(0,p0)),i0}(Yt,Mt,Jt):function(i0,f0){if(Ct.isBuffer(f0)){var u0=0|wt(f0.length);return(i0=yt(i0,u0)).length===0||f0.copy(i0,0,0,u0),i0}if(f0){if(typeof ArrayBuffer<"u"&&f0.buffer instanceof ArrayBuffer||"length"in f0)return typeof f0.length!="number"||(x0=f0.length)!=x0?yt(i0,0):It(i0,f0);if(f0.type==="Buffer"&&xt(f0.data))return It(i0,f0.data)}var x0;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(Yt,Mt)}function vt(Yt){if(typeof Yt!="number")throw new TypeError('"size" argument must be a number');if(Yt<0)throw new RangeError('"size" argument must not be negative')}function bt(Yt,Mt){if(vt(Mt),Yt=yt(Yt,Mt<0?0:0|wt(Mt)),!Ct.TYPED_ARRAY_SUPPORT)for(var Jt=0;Jt<Mt;++Jt)Yt[Jt]=0;return Yt}function It(Yt,Mt){var Jt=Mt.length<0?0:0|wt(Mt.length);Yt=yt(Yt,Jt);for(var a0=0;a0<Jt;a0+=1)Yt[a0]=255&Mt[a0];return Yt}function wt(Yt){if(Yt>=Et())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Et().toString(16)+" bytes");return 0|Yt}function Rt(Yt,Mt){if(Ct.isBuffer(Yt))return Yt.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(Yt)||Yt instanceof ArrayBuffer))return Yt.byteLength;typeof Yt!="string"&&(Yt=""+Yt);var Jt=Yt.length;if(Jt===0)return 0;for(var a0=!1;;)switch(Mt){case"ascii":case"latin1":case"binary":return Jt;case"utf8":case"utf-8":case void 0:return A0(Yt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*Jt;case"hex":return Jt>>>1;case"base64":return o0(Yt).length;default:if(a0)return A0(Yt).length;Mt=(""+Mt).toLowerCase(),a0=!0}}function Tt(Yt,Mt,Jt){var a0=!1;if((Mt===void 0||Mt<0)&&(Mt=0),Mt>this.length||((Jt===void 0||Jt>this.length)&&(Jt=this.length),Jt<=0)||(Jt>>>=0)<=(Mt>>>=0))return"";for(Yt||(Yt="utf8");;)switch(Yt){case"hex":return Gt(this,Mt,Jt);case"utf8":case"utf-8":return _t(this,Mt,Jt);case"ascii":return Qt(this,Mt,Jt);case"latin1":case"binary":return jt(this,Mt,Jt);case"base64":return Ut(this,Mt,Jt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qt(this,Mt,Jt);default:if(a0)throw new TypeError("Unknown encoding: "+Yt);Yt=(Yt+"").toLowerCase(),a0=!0}}function Bt(Yt,Mt,Jt){var a0=Yt[Mt];Yt[Mt]=Yt[Jt],Yt[Jt]=a0}function Dt(Yt,Mt,Jt,a0,i0){if(Yt.length===0)return-1;if(typeof Jt=="string"?(a0=Jt,Jt=0):Jt>2147483647?Jt=2147483647:Jt<-2147483648&&(Jt=-2147483648),Jt=+Jt,isNaN(Jt)&&(Jt=i0?0:Yt.length-1),Jt<0&&(Jt=Yt.length+Jt),Jt>=Yt.length){if(i0)return-1;Jt=Yt.length-1}else if(Jt<0){if(!i0)return-1;Jt=0}if(typeof Mt=="string"&&(Mt=Ct.from(Mt,a0)),Ct.isBuffer(Mt))return Mt.length===0?-1:Pt(Yt,Mt,Jt,a0,i0);if(typeof Mt=="number")return Mt&=255,Ct.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i0?Uint8Array.prototype.indexOf.call(Yt,Mt,Jt):Uint8Array.prototype.lastIndexOf.call(Yt,Mt,Jt):Pt(Yt,[Mt],Jt,a0,i0);throw new TypeError("val must be string, number or Buffer")}function Pt(Yt,Mt,Jt,a0,i0){var f0,u0=1,x0=Yt.length,p0=Mt.length;if(a0!==void 0&&((a0=String(a0).toLowerCase())==="ucs2"||a0==="ucs-2"||a0==="utf16le"||a0==="utf-16le")){if(Yt.length<2||Mt.length<2)return-1;u0=2,x0/=2,p0/=2,Jt/=2}function D0(Y0,X0){return u0===1?Y0[X0]:Y0.readUInt16BE(X0*u0)}if(i0){var P0=-1;for(f0=Jt;f0<x0;f0++)if(D0(Yt,f0)===D0(Mt,P0===-1?0:f0-P0)){if(P0===-1&&(P0=f0),f0-P0+1===p0)return P0*u0}else P0!==-1&&(f0-=f0-P0),P0=-1}else for(Jt+p0>x0&&(Jt=x0-p0),f0=Jt;f0>=0;f0--){for(var z0=!0,J0=0;J0<p0;J0++)if(D0(Yt,f0+J0)!==D0(Mt,J0)){z0=!1;break}if(z0)return f0}return-1}function Nt(Yt,Mt,Jt,a0){Jt=Number(Jt)||0;var i0=Yt.length-Jt;a0?(a0=Number(a0))>i0&&(a0=i0):a0=i0;var f0=Mt.length;if(f0%2!=0)throw new TypeError("Invalid hex string");a0>f0/2&&(a0=f0/2);for(var u0=0;u0<a0;++u0){var x0=parseInt(Mt.substr(2*u0,2),16);if(isNaN(x0))return u0;Yt[Jt+u0]=x0}return u0}function Lt(Yt,Mt,Jt,a0){return r0(A0(Mt,Yt.length-Jt),Yt,Jt,a0)}function Wt(Yt,Mt,Jt,a0){return r0(function(i0){for(var f0=[],u0=0;u0<i0.length;++u0)f0.push(255&i0.charCodeAt(u0));return f0}(Mt),Yt,Jt,a0)}function $t(Yt,Mt,Jt,a0){return Wt(Yt,Mt,Jt,a0)}function Kt(Yt,Mt,Jt,a0){return r0(o0(Mt),Yt,Jt,a0)}function Vt(Yt,Mt,Jt,a0){return r0(function(i0,f0){for(var u0,x0,p0,D0=[],P0=0;P0<i0.length&&!((f0-=2)<0);++P0)x0=(u0=i0.charCodeAt(P0))>>8,p0=u0%256,D0.push(p0),D0.push(x0);return D0}(Mt,Yt.length-Jt),Yt,Jt,a0)}function Ut(Yt,Mt,Jt){return Mt===0&&Jt===Yt.length?gt.fromByteArray(Yt):gt.fromByteArray(Yt.slice(Mt,Jt))}function _t(Yt,Mt,Jt){Jt=Math.min(Yt.length,Jt);for(var a0=[],i0=Mt;i0<Jt;){var f0,u0,x0,p0,D0=Yt[i0],P0=null,z0=D0>239?4:D0>223?3:D0>191?2:1;if(i0+z0<=Jt)switch(z0){case 1:D0<128&&(P0=D0);break;case 2:(192&(f0=Yt[i0+1]))==128&&(p0=(31&D0)<<6|63&f0)>127&&(P0=p0);break;case 3:f0=Yt[i0+1],u0=Yt[i0+2],(192&f0)==128&&(192&u0)==128&&(p0=(15&D0)<<12|(63&f0)<<6|63&u0)>2047&&(p0<55296||p0>57343)&&(P0=p0);break;case 4:f0=Yt[i0+1],u0=Yt[i0+2],x0=Yt[i0+3],(192&f0)==128&&(192&u0)==128&&(192&x0)==128&&(p0=(15&D0)<<18|(63&f0)<<12|(63&u0)<<6|63&x0)>65535&&p0<1114112&&(P0=p0)}P0===null?(P0=65533,z0=1):P0>65535&&(P0-=65536,a0.push(P0>>>10&1023|55296),P0=56320|1023&P0),a0.push(P0),i0+=z0}return function(J0){var Y0=J0.length;if(Y0<=Xt)return String.fromCharCode.apply(String,J0);for(var X0="",T0=0;T0<Y0;)X0+=String.fromCharCode.apply(String,J0.slice(T0,T0+=Xt));return X0}(a0)}ft.Buffer=Ct,ft.SlowBuffer=function(Yt){return+Yt!=Yt&&(Yt=0),Ct.alloc(+Yt)},ft.INSPECT_MAX_BYTES=50,Ct.TYPED_ARRAY_SUPPORT=ht.g.TYPED_ARRAY_SUPPORT!==void 0?ht.g.TYPED_ARRAY_SUPPORT:function(){try{var Yt=new Uint8Array(1);return Yt.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},Yt.foo()===42&&typeof Yt.subarray=="function"&&Yt.subarray(1,1).byteLength===0}catch{return!1}}(),ft.kMaxLength=Et(),Ct.poolSize=8192,Ct._augment=function(Yt){return Yt.__proto__=Ct.prototype,Yt},Ct.from=function(Yt,Mt,Jt){return kt(null,Yt,Mt,Jt)},Ct.TYPED_ARRAY_SUPPORT&&(Ct.prototype.__proto__=Uint8Array.prototype,Ct.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Ct[Symbol.species]===Ct&&Object.defineProperty(Ct,Symbol.species,{value:null,configurable:!0})),Ct.alloc=function(Yt,Mt,Jt){return function(a0,i0,f0,u0){return vt(i0),i0<=0?yt(a0,i0):f0!==void 0?typeof u0=="string"?yt(a0,i0).fill(f0,u0):yt(a0,i0).fill(f0):yt(a0,i0)}(null,Yt,Mt,Jt)},Ct.allocUnsafe=function(Yt){return bt(null,Yt)},Ct.allocUnsafeSlow=function(Yt){return bt(null,Yt)},Ct.isBuffer=function(Yt){return!(Yt==null||!Yt._isBuffer)},Ct.compare=function(Yt,Mt){if(!Ct.isBuffer(Yt)||!Ct.isBuffer(Mt))throw new TypeError("Arguments must be Buffers");if(Yt===Mt)return 0;for(var Jt=Yt.length,a0=Mt.length,i0=0,f0=Math.min(Jt,a0);i0<f0;++i0)if(Yt[i0]!==Mt[i0]){Jt=Yt[i0],a0=Mt[i0];break}return Jt<a0?-1:a0<Jt?1:0},Ct.isEncoding=function(Yt){switch(String(Yt).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}},Ct.concat=function(Yt,Mt){if(!xt(Yt))throw new TypeError('"list" argument must be an Array of Buffers');if(Yt.length===0)return Ct.alloc(0);var Jt;if(Mt===void 0)for(Mt=0,Jt=0;Jt<Yt.length;++Jt)Mt+=Yt[Jt].length;var a0=Ct.allocUnsafe(Mt),i0=0;for(Jt=0;Jt<Yt.length;++Jt){var f0=Yt[Jt];if(!Ct.isBuffer(f0))throw new TypeError('"list" argument must be an Array of Buffers');f0.copy(a0,i0),i0+=f0.length}return a0},Ct.byteLength=Rt,Ct.prototype._isBuffer=!0,Ct.prototype.swap16=function(){var Yt=this.length;if(Yt%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Mt=0;Mt<Yt;Mt+=2)Bt(this,Mt,Mt+1);return this},Ct.prototype.swap32=function(){var Yt=this.length;if(Yt%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var Mt=0;Mt<Yt;Mt+=4)Bt(this,Mt,Mt+3),Bt(this,Mt+1,Mt+2);return this},Ct.prototype.swap64=function(){var Yt=this.length;if(Yt%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var Mt=0;Mt<Yt;Mt+=8)Bt(this,Mt,Mt+7),Bt(this,Mt+1,Mt+6),Bt(this,Mt+2,Mt+5),Bt(this,Mt+3,Mt+4);return this},Ct.prototype.toString=function(){var Yt=0|this.length;return Yt===0?"":arguments.length===0?_t(this,0,Yt):Tt.apply(this,arguments)},Ct.prototype.equals=function(Yt){if(!Ct.isBuffer(Yt))throw new TypeError("Argument must be a Buffer");return this===Yt||Ct.compare(this,Yt)===0},Ct.prototype.inspect=function(){var Yt="",Mt=ft.INSPECT_MAX_BYTES;return this.length>0&&(Yt=this.toString("hex",0,Mt).match(/.{2}/g).join(" "),this.length>Mt&&(Yt+=" ... ")),"<Buffer "+Yt+">"},Ct.prototype.compare=function(Yt,Mt,Jt,a0,i0){if(!Ct.isBuffer(Yt))throw new TypeError("Argument must be a Buffer");if(Mt===void 0&&(Mt=0),Jt===void 0&&(Jt=Yt?Yt.length:0),a0===void 0&&(a0=0),i0===void 0&&(i0=this.length),Mt<0||Jt>Yt.length||a0<0||i0>this.length)throw new RangeError("out of range index");if(a0>=i0&&Mt>=Jt)return 0;if(a0>=i0)return-1;if(Mt>=Jt)return 1;if(this===Yt)return 0;for(var f0=(i0>>>=0)-(a0>>>=0),u0=(Jt>>>=0)-(Mt>>>=0),x0=Math.min(f0,u0),p0=this.slice(a0,i0),D0=Yt.slice(Mt,Jt),P0=0;P0<x0;++P0)if(p0[P0]!==D0[P0]){f0=p0[P0],u0=D0[P0];break}return f0<u0?-1:u0<f0?1:0},Ct.prototype.includes=function(Yt,Mt,Jt){return this.indexOf(Yt,Mt,Jt)!==-1},Ct.prototype.indexOf=function(Yt,Mt,Jt){return Dt(this,Yt,Mt,Jt,!0)},Ct.prototype.lastIndexOf=function(Yt,Mt,Jt){return Dt(this,Yt,Mt,Jt,!1)},Ct.prototype.write=function(Yt,Mt,Jt,a0){if(Mt===void 0)a0="utf8",Jt=this.length,Mt=0;else if(Jt===void 0&&typeof Mt=="string")a0=Mt,Jt=this.length,Mt=0;else{if(!isFinite(Mt))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");Mt|=0,isFinite(Jt)?(Jt|=0,a0===void 0&&(a0="utf8")):(a0=Jt,Jt=void 0)}var i0=this.length-Mt;if((Jt===void 0||Jt>i0)&&(Jt=i0),Yt.length>0&&(Jt<0||Mt<0)||Mt>this.length)throw new RangeError("Attempt to write outside buffer bounds");a0||(a0="utf8");for(var f0=!1;;)switch(a0){case"hex":return Nt(this,Yt,Mt,Jt);case"utf8":case"utf-8":return Lt(this,Yt,Mt,Jt);case"ascii":return Wt(this,Yt,Mt,Jt);case"latin1":case"binary":return $t(this,Yt,Mt,Jt);case"base64":return Kt(this,Yt,Mt,Jt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vt(this,Yt,Mt,Jt);default:if(f0)throw new TypeError("Unknown encoding: "+a0);a0=(""+a0).toLowerCase(),f0=!0}},Ct.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Xt=4096;function Qt(Yt,Mt,Jt){var a0="";Jt=Math.min(Yt.length,Jt);for(var i0=Mt;i0<Jt;++i0)a0+=String.fromCharCode(127&Yt[i0]);return a0}function jt(Yt,Mt,Jt){var a0="";Jt=Math.min(Yt.length,Jt);for(var i0=Mt;i0<Jt;++i0)a0+=String.fromCharCode(Yt[i0]);return a0}function Gt(Yt,Mt,Jt){var a0,i0=Yt.length;(!Mt||Mt<0)&&(Mt=0),(!Jt||Jt<0||Jt>i0)&&(Jt=i0);for(var f0="",u0=Mt;u0<Jt;++u0)f0+=(a0=Yt[u0])<16?"0"+a0.toString(16):a0.toString(16);return f0}function qt(Yt,Mt,Jt){for(var a0=Yt.slice(Mt,Jt),i0="",f0=0;f0<a0.length;f0+=2)i0+=String.fromCharCode(a0[f0]+256*a0[f0+1]);return i0}function zt(Yt,Mt,Jt){if(Yt%1!=0||Yt<0)throw new RangeError("offset is not uint");if(Yt+Mt>Jt)throw new RangeError("Trying to access beyond buffer length")}function e0(Yt,Mt,Jt,a0,i0,f0){if(!Ct.isBuffer(Yt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Mt>i0||Mt<f0)throw new RangeError('"value" argument is out of bounds');if(Jt+a0>Yt.length)throw new RangeError("Index out of range")}function s0(Yt,Mt,Jt,a0){Mt<0&&(Mt=65535+Mt+1);for(var i0=0,f0=Math.min(Yt.length-Jt,2);i0<f0;++i0)Yt[Jt+i0]=(Mt&255<<8*(a0?i0:1-i0))>>>8*(a0?i0:1-i0)}function t0(Yt,Mt,Jt,a0){Mt<0&&(Mt=4294967295+Mt+1);for(var i0=0,f0=Math.min(Yt.length-Jt,4);i0<f0;++i0)Yt[Jt+i0]=Mt>>>8*(a0?i0:3-i0)&255}function l0(Yt,Mt,Jt,a0,i0,f0){if(Jt+a0>Yt.length)throw new RangeError("Index out of range");if(Jt<0)throw new RangeError("Index out of range")}function d0(Yt,Mt,Jt,a0,i0){return i0||l0(Yt,0,Jt,4),At.write(Yt,Mt,Jt,a0,23,4),Jt+4}function n0(Yt,Mt,Jt,a0,i0){return i0||l0(Yt,0,Jt,8),At.write(Yt,Mt,Jt,a0,52,8),Jt+8}Ct.prototype.slice=function(Yt,Mt){var Jt,a0=this.length;if((Yt=~~Yt)<0?(Yt+=a0)<0&&(Yt=0):Yt>a0&&(Yt=a0),(Mt=Mt===void 0?a0:~~Mt)<0?(Mt+=a0)<0&&(Mt=0):Mt>a0&&(Mt=a0),Mt<Yt&&(Mt=Yt),Ct.TYPED_ARRAY_SUPPORT)(Jt=this.subarray(Yt,Mt)).__proto__=Ct.prototype;else{var i0=Mt-Yt;Jt=new Ct(i0,void 0);for(var f0=0;f0<i0;++f0)Jt[f0]=this[f0+Yt]}return Jt},Ct.prototype.readUIntLE=function(Yt,Mt,Jt){Yt|=0,Mt|=0,Jt||zt(Yt,Mt,this.length);for(var a0=this[Yt],i0=1,f0=0;++f0<Mt&&(i0*=256);)a0+=this[Yt+f0]*i0;return a0},Ct.prototype.readUIntBE=function(Yt,Mt,Jt){Yt|=0,Mt|=0,Jt||zt(Yt,Mt,this.length);for(var a0=this[Yt+--Mt],i0=1;Mt>0&&(i0*=256);)a0+=this[Yt+--Mt]*i0;return a0},Ct.prototype.readUInt8=function(Yt,Mt){return Mt||zt(Yt,1,this.length),this[Yt]},Ct.prototype.readUInt16LE=function(Yt,Mt){return Mt||zt(Yt,2,this.length),this[Yt]|this[Yt+1]<<8},Ct.prototype.readUInt16BE=function(Yt,Mt){return Mt||zt(Yt,2,this.length),this[Yt]<<8|this[Yt+1]},Ct.prototype.readUInt32LE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),(this[Yt]|this[Yt+1]<<8|this[Yt+2]<<16)+16777216*this[Yt+3]},Ct.prototype.readUInt32BE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),16777216*this[Yt]+(this[Yt+1]<<16|this[Yt+2]<<8|this[Yt+3])},Ct.prototype.readIntLE=function(Yt,Mt,Jt){Yt|=0,Mt|=0,Jt||zt(Yt,Mt,this.length);for(var a0=this[Yt],i0=1,f0=0;++f0<Mt&&(i0*=256);)a0+=this[Yt+f0]*i0;return a0>=(i0*=128)&&(a0-=Math.pow(2,8*Mt)),a0},Ct.prototype.readIntBE=function(Yt,Mt,Jt){Yt|=0,Mt|=0,Jt||zt(Yt,Mt,this.length);for(var a0=Mt,i0=1,f0=this[Yt+--a0];a0>0&&(i0*=256);)f0+=this[Yt+--a0]*i0;return f0>=(i0*=128)&&(f0-=Math.pow(2,8*Mt)),f0},Ct.prototype.readInt8=function(Yt,Mt){return Mt||zt(Yt,1,this.length),128&this[Yt]?-1*(255-this[Yt]+1):this[Yt]},Ct.prototype.readInt16LE=function(Yt,Mt){Mt||zt(Yt,2,this.length);var Jt=this[Yt]|this[Yt+1]<<8;return 32768&Jt?4294901760|Jt:Jt},Ct.prototype.readInt16BE=function(Yt,Mt){Mt||zt(Yt,2,this.length);var Jt=this[Yt+1]|this[Yt]<<8;return 32768&Jt?4294901760|Jt:Jt},Ct.prototype.readInt32LE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),this[Yt]|this[Yt+1]<<8|this[Yt+2]<<16|this[Yt+3]<<24},Ct.prototype.readInt32BE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),this[Yt]<<24|this[Yt+1]<<16|this[Yt+2]<<8|this[Yt+3]},Ct.prototype.readFloatLE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),At.read(this,Yt,!0,23,4)},Ct.prototype.readFloatBE=function(Yt,Mt){return Mt||zt(Yt,4,this.length),At.read(this,Yt,!1,23,4)},Ct.prototype.readDoubleLE=function(Yt,Mt){return Mt||zt(Yt,8,this.length),At.read(this,Yt,!0,52,8)},Ct.prototype.readDoubleBE=function(Yt,Mt){return Mt||zt(Yt,8,this.length),At.read(this,Yt,!1,52,8)},Ct.prototype.writeUIntLE=function(Yt,Mt,Jt,a0){Yt=+Yt,Mt|=0,Jt|=0,a0||e0(this,Yt,Mt,Jt,Math.pow(2,8*Jt)-1,0);var i0=1,f0=0;for(this[Mt]=255&Yt;++f0<Jt&&(i0*=256);)this[Mt+f0]=Yt/i0&255;return Mt+Jt},Ct.prototype.writeUIntBE=function(Yt,Mt,Jt,a0){Yt=+Yt,Mt|=0,Jt|=0,a0||e0(this,Yt,Mt,Jt,Math.pow(2,8*Jt)-1,0);var i0=Jt-1,f0=1;for(this[Mt+i0]=255&Yt;--i0>=0&&(f0*=256);)this[Mt+i0]=Yt/f0&255;return Mt+Jt},Ct.prototype.writeUInt8=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,1,255,0),Ct.TYPED_ARRAY_SUPPORT||(Yt=Math.floor(Yt)),this[Mt]=255&Yt,Mt+1},Ct.prototype.writeUInt16LE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,2,65535,0),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=255&Yt,this[Mt+1]=Yt>>>8):s0(this,Yt,Mt,!0),Mt+2},Ct.prototype.writeUInt16BE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,2,65535,0),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=Yt>>>8,this[Mt+1]=255&Yt):s0(this,Yt,Mt,!1),Mt+2},Ct.prototype.writeUInt32LE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,4,4294967295,0),Ct.TYPED_ARRAY_SUPPORT?(this[Mt+3]=Yt>>>24,this[Mt+2]=Yt>>>16,this[Mt+1]=Yt>>>8,this[Mt]=255&Yt):t0(this,Yt,Mt,!0),Mt+4},Ct.prototype.writeUInt32BE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,4,4294967295,0),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=Yt>>>24,this[Mt+1]=Yt>>>16,this[Mt+2]=Yt>>>8,this[Mt+3]=255&Yt):t0(this,Yt,Mt,!1),Mt+4},Ct.prototype.writeIntLE=function(Yt,Mt,Jt,a0){if(Yt=+Yt,Mt|=0,!a0){var i0=Math.pow(2,8*Jt-1);e0(this,Yt,Mt,Jt,i0-1,-i0)}var f0=0,u0=1,x0=0;for(this[Mt]=255&Yt;++f0<Jt&&(u0*=256);)Yt<0&&x0===0&&this[Mt+f0-1]!==0&&(x0=1),this[Mt+f0]=(Yt/u0>>0)-x0&255;return Mt+Jt},Ct.prototype.writeIntBE=function(Yt,Mt,Jt,a0){if(Yt=+Yt,Mt|=0,!a0){var i0=Math.pow(2,8*Jt-1);e0(this,Yt,Mt,Jt,i0-1,-i0)}var f0=Jt-1,u0=1,x0=0;for(this[Mt+f0]=255&Yt;--f0>=0&&(u0*=256);)Yt<0&&x0===0&&this[Mt+f0+1]!==0&&(x0=1),this[Mt+f0]=(Yt/u0>>0)-x0&255;return Mt+Jt},Ct.prototype.writeInt8=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,1,127,-128),Ct.TYPED_ARRAY_SUPPORT||(Yt=Math.floor(Yt)),Yt<0&&(Yt=255+Yt+1),this[Mt]=255&Yt,Mt+1},Ct.prototype.writeInt16LE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,2,32767,-32768),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=255&Yt,this[Mt+1]=Yt>>>8):s0(this,Yt,Mt,!0),Mt+2},Ct.prototype.writeInt16BE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,2,32767,-32768),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=Yt>>>8,this[Mt+1]=255&Yt):s0(this,Yt,Mt,!1),Mt+2},Ct.prototype.writeInt32LE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,4,2147483647,-2147483648),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=255&Yt,this[Mt+1]=Yt>>>8,this[Mt+2]=Yt>>>16,this[Mt+3]=Yt>>>24):t0(this,Yt,Mt,!0),Mt+4},Ct.prototype.writeInt32BE=function(Yt,Mt,Jt){return Yt=+Yt,Mt|=0,Jt||e0(this,Yt,Mt,4,2147483647,-2147483648),Yt<0&&(Yt=4294967295+Yt+1),Ct.TYPED_ARRAY_SUPPORT?(this[Mt]=Yt>>>24,this[Mt+1]=Yt>>>16,this[Mt+2]=Yt>>>8,this[Mt+3]=255&Yt):t0(this,Yt,Mt,!1),Mt+4},Ct.prototype.writeFloatLE=function(Yt,Mt,Jt){return d0(this,Yt,Mt,!0,Jt)},Ct.prototype.writeFloatBE=function(Yt,Mt,Jt){return d0(this,Yt,Mt,!1,Jt)},Ct.prototype.writeDoubleLE=function(Yt,Mt,Jt){return n0(this,Yt,Mt,!0,Jt)},Ct.prototype.writeDoubleBE=function(Yt,Mt,Jt){return n0(this,Yt,Mt,!1,Jt)},Ct.prototype.copy=function(Yt,Mt,Jt,a0){if(Jt||(Jt=0),a0||a0===0||(a0=this.length),Mt>=Yt.length&&(Mt=Yt.length),Mt||(Mt=0),a0>0&&a0<Jt&&(a0=Jt),a0===Jt||Yt.length===0||this.length===0)return 0;if(Mt<0)throw new RangeError("targetStart out of bounds");if(Jt<0||Jt>=this.length)throw new RangeError("sourceStart out of bounds");if(a0<0)throw new RangeError("sourceEnd out of bounds");a0>this.length&&(a0=this.length),Yt.length-Mt<a0-Jt&&(a0=Yt.length-Mt+Jt);var i0,f0=a0-Jt;if(this===Yt&&Jt<Mt&&Mt<a0)for(i0=f0-1;i0>=0;--i0)Yt[i0+Mt]=this[i0+Jt];else if(f0<1e3||!Ct.TYPED_ARRAY_SUPPORT)for(i0=0;i0<f0;++i0)Yt[i0+Mt]=this[i0+Jt];else Uint8Array.prototype.set.call(Yt,this.subarray(Jt,Jt+f0),Mt);return f0},Ct.prototype.fill=function(Yt,Mt,Jt,a0){if(typeof Yt=="string"){if(typeof Mt=="string"?(a0=Mt,Mt=0,Jt=this.length):typeof Jt=="string"&&(a0=Jt,Jt=this.length),Yt.length===1){var i0=Yt.charCodeAt(0);i0<256&&(Yt=i0)}if(a0!==void 0&&typeof a0!="string")throw new TypeError("encoding must be a string");if(typeof a0=="string"&&!Ct.isEncoding(a0))throw new TypeError("Unknown encoding: "+a0)}else typeof Yt=="number"&&(Yt&=255);if(Mt<0||this.length<Mt||this.length<Jt)throw new RangeError("Out of range index");if(Jt<=Mt)return this;var f0;if(Mt>>>=0,Jt=Jt===void 0?this.length:Jt>>>0,Yt||(Yt=0),typeof Yt=="number")for(f0=Mt;f0<Jt;++f0)this[f0]=Yt;else{var u0=Ct.isBuffer(Yt)?Yt:A0(new Ct(Yt,a0).toString()),x0=u0.length;for(f0=0;f0<Jt-Mt;++f0)this[f0+Mt]=u0[f0%x0]}return this};var g0=/[^+\/0-9A-Za-z-_]/g;function A0(Yt,Mt){var Jt;Mt=Mt||1/0;for(var a0=Yt.length,i0=null,f0=[],u0=0;u0<a0;++u0){if((Jt=Yt.charCodeAt(u0))>55295&&Jt<57344){if(!i0){if(Jt>56319){(Mt-=3)>-1&&f0.push(239,191,189);continue}if(u0+1===a0){(Mt-=3)>-1&&f0.push(239,191,189);continue}i0=Jt;continue}if(Jt<56320){(Mt-=3)>-1&&f0.push(239,191,189),i0=Jt;continue}Jt=65536+(i0-55296<<10|Jt-56320)}else i0&&(Mt-=3)>-1&&f0.push(239,191,189);if(i0=null,Jt<128){if((Mt-=1)<0)break;f0.push(Jt)}else if(Jt<2048){if((Mt-=2)<0)break;f0.push(Jt>>6|192,63&Jt|128)}else if(Jt<65536){if((Mt-=3)<0)break;f0.push(Jt>>12|224,Jt>>6&63|128,63&Jt|128)}else{if(!(Jt<1114112))throw new Error("Invalid code point");if((Mt-=4)<0)break;f0.push(Jt>>18|240,Jt>>12&63|128,Jt>>6&63|128,63&Jt|128)}}return f0}function o0(Yt){return gt.toByteArray(function(Mt){if((Mt=function(Jt){return Jt.trim?Jt.trim():Jt.replace(/^\s+|\s+$/g,"")}(Mt).replace(g0,"")).length<2)return"";for(;Mt.length%4!=0;)Mt+="=";return Mt}(Yt))}function r0(Yt,Mt,Jt,a0){for(var i0=0;i0<a0&&!(i0+Jt>=Mt.length||i0>=Yt.length);++i0)Mt[i0+Jt]=Yt[i0];return i0}},3973:(nt,ft,ht)=>{var gt=ht(7834).Buffer,At=ht(4851).Transform,xt=ht(214).s;function Et(yt){At.call(this),this.hashMode=typeof yt=="string",this.hashMode?this[yt]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}ht(1285)(Et,At),Et.prototype.update=function(yt,Ct,kt){typeof yt=="string"&&(yt=gt.from(yt,Ct));var vt=this._update(yt);return this.hashMode?this:(kt&&(vt=this._toString(vt,kt)),vt)},Et.prototype.setAutoPadding=function(){},Et.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},Et.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},Et.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},Et.prototype._transform=function(yt,Ct,kt){var vt;try{this.hashMode?this._update(yt):this.push(this._update(yt))}catch(bt){vt=bt}finally{kt(vt)}},Et.prototype._flush=function(yt){var Ct;try{this.push(this.__final())}catch(kt){Ct=kt}yt(Ct)},Et.prototype._finalOrDigest=function(yt){var Ct=this.__final()||gt.alloc(0);return yt&&(Ct=this._toString(Ct,yt,!0)),Ct},Et.prototype._toString=function(yt,Ct,kt){if(this._decoder||(this._decoder=new xt(Ct),this._encoding=Ct),this._encoding!==Ct)throw new Error("can't switch encodings");var vt=this._decoder.write(yt);return kt&&(vt+=this._decoder.end()),vt},nt.exports=Et},2511:(nt,ft,ht)=>{var gt=ht(7993);nt.exports=function(At){return new gt().update(At).digest()}},11:(nt,ft,ht)=>{var gt=ht(1285),At=ht(6456),xt=ht(3973),Et=ht(7834).Buffer,yt=ht(2511),Ct=ht(1445),kt=ht(9065),vt=Et.alloc(128);function bt(It,wt){xt.call(this,"digest"),typeof wt=="string"&&(wt=Et.from(wt));var Rt=It==="sha512"||It==="sha384"?128:64;this._alg=It,this._key=wt,wt.length>Rt?wt=(It==="rmd160"?new Ct:kt(It)).update(wt).digest():wt.length<Rt&&(wt=Et.concat([wt,vt],Rt));for(var Tt=this._ipad=Et.allocUnsafe(Rt),Bt=this._opad=Et.allocUnsafe(Rt),Dt=0;Dt<Rt;Dt++)Tt[Dt]=54^wt[Dt],Bt[Dt]=92^wt[Dt];this._hash=It==="rmd160"?new Ct:kt(It),this._hash.update(Tt)}gt(bt,xt),bt.prototype._update=function(It){this._hash.update(It)},bt.prototype._final=function(){var It=this._hash.digest();return(this._alg==="rmd160"?new Ct:kt(this._alg)).update(this._opad).update(It).digest()},nt.exports=function(It,wt){return(It=It.toLowerCase())==="rmd160"||It==="ripemd160"?new bt("rmd160",wt):It==="md5"?new At(yt,wt):new bt(It,wt)}},6456:(nt,ft,ht)=>{var gt=ht(1285),At=ht(7834).Buffer,xt=ht(3973),Et=At.alloc(128),yt=64;function Ct(kt,vt){xt.call(this,"digest"),typeof vt=="string"&&(vt=At.from(vt)),this._alg=kt,this._key=vt,vt.length>yt?vt=kt(vt):vt.length<yt&&(vt=At.concat([vt,Et],yt));for(var bt=this._ipad=At.allocUnsafe(yt),It=this._opad=At.allocUnsafe(yt),wt=0;wt<yt;wt++)bt[wt]=54^vt[wt],It[wt]=92^vt[wt];this._hash=[bt]}gt(Ct,xt),Ct.prototype._update=function(kt){this._hash.push(kt)},Ct.prototype._final=function(){var kt=this._alg(At.concat(this._hash));return this._alg(At.concat([this._opad,kt]))},nt.exports=Ct},2699:nt=>{var ft,ht=typeof Reflect=="object"?Reflect:null,gt=ht&&typeof ht.apply=="function"?ht.apply:function(Bt,Dt,Pt){return Function.prototype.apply.call(Bt,Dt,Pt)};ft=ht&&typeof ht.ownKeys=="function"?ht.ownKeys:Object.getOwnPropertySymbols?function(Bt){return Object.getOwnPropertyNames(Bt).concat(Object.getOwnPropertySymbols(Bt))}:function(Bt){return Object.getOwnPropertyNames(Bt)};var At=Number.isNaN||function(Bt){return Bt!=Bt};function xt(){xt.init.call(this)}nt.exports=xt,nt.exports.once=function(Bt,Dt){return new Promise(function(Pt,Nt){function Lt($t){Bt.removeListener(Dt,Wt),Nt($t)}function Wt(){typeof Bt.removeListener=="function"&&Bt.removeListener("error",Lt),Pt([].slice.call(arguments))}Tt(Bt,Dt,Wt,{once:!0}),Dt!=="error"&&function($t,Kt,Vt){typeof $t.on=="function"&&Tt($t,"error",Kt,{once:!0})}(Bt,Lt)})},xt.EventEmitter=xt,xt.prototype._events=void 0,xt.prototype._eventsCount=0,xt.prototype._maxListeners=void 0;var Et=10;function yt(Bt){if(typeof Bt!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof Bt)}function Ct(Bt){return Bt._maxListeners===void 0?xt.defaultMaxListeners:Bt._maxListeners}function kt(Bt,Dt,Pt,Nt){var Lt,Wt,$t,Kt;if(yt(Pt),(Wt=Bt._events)===void 0?(Wt=Bt._events=Object.create(null),Bt._eventsCount=0):(Wt.newListener!==void 0&&(Bt.emit("newListener",Dt,Pt.listener?Pt.listener:Pt),Wt=Bt._events),$t=Wt[Dt]),$t===void 0)$t=Wt[Dt]=Pt,++Bt._eventsCount;else if(typeof $t=="function"?$t=Wt[Dt]=Nt?[Pt,$t]:[$t,Pt]:Nt?$t.unshift(Pt):$t.push(Pt),(Lt=Ct(Bt))>0&&$t.length>Lt&&!$t.warned){$t.warned=!0;var Vt=new Error("Possible EventEmitter memory leak detected. "+$t.length+" "+String(Dt)+" listeners added. Use emitter.setMaxListeners() to increase limit");Vt.name="MaxListenersExceededWarning",Vt.emitter=Bt,Vt.type=Dt,Vt.count=$t.length,Kt=Vt,console&&console.warn&&console.warn(Kt)}return Bt}function vt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function bt(Bt,Dt,Pt){var Nt={fired:!1,wrapFn:void 0,target:Bt,type:Dt,listener:Pt},Lt=vt.bind(Nt);return Lt.listener=Pt,Nt.wrapFn=Lt,Lt}function It(Bt,Dt,Pt){var Nt=Bt._events;if(Nt===void 0)return[];var Lt=Nt[Dt];return Lt===void 0?[]:typeof Lt=="function"?Pt?[Lt.listener||Lt]:[Lt]:Pt?function(Wt){for(var $t=new Array(Wt.length),Kt=0;Kt<$t.length;++Kt)$t[Kt]=Wt[Kt].listener||Wt[Kt];return $t}(Lt):Rt(Lt,Lt.length)}function wt(Bt){var Dt=this._events;if(Dt!==void 0){var Pt=Dt[Bt];if(typeof Pt=="function")return 1;if(Pt!==void 0)return Pt.length}return 0}function Rt(Bt,Dt){for(var Pt=new Array(Dt),Nt=0;Nt<Dt;++Nt)Pt[Nt]=Bt[Nt];return Pt}function Tt(Bt,Dt,Pt,Nt){if(typeof Bt.on=="function")Nt.once?Bt.once(Dt,Pt):Bt.on(Dt,Pt);else{if(typeof Bt.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof Bt);Bt.addEventListener(Dt,function Lt(Wt){Nt.once&&Bt.removeEventListener(Dt,Lt),Pt(Wt)})}}Object.defineProperty(xt,"defaultMaxListeners",{enumerable:!0,get:function(){return Et},set:function(Bt){if(typeof Bt!="number"||Bt<0||At(Bt))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+Bt+".");Et=Bt}}),xt.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},xt.prototype.setMaxListeners=function(Bt){if(typeof Bt!="number"||Bt<0||At(Bt))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+Bt+".");return this._maxListeners=Bt,this},xt.prototype.getMaxListeners=function(){return Ct(this)},xt.prototype.emit=function(Bt){for(var Dt=[],Pt=1;Pt<arguments.length;Pt++)Dt.push(arguments[Pt]);var Nt=Bt==="error",Lt=this._events;if(Lt!==void 0)Nt=Nt&&Lt.error===void 0;else if(!Nt)return!1;if(Nt){var Wt;if(Dt.length>0&&(Wt=Dt[0]),Wt instanceof Error)throw Wt;var $t=new Error("Unhandled error."+(Wt?" ("+Wt.message+")":""));throw $t.context=Wt,$t}var Kt=Lt[Bt];if(Kt===void 0)return!1;if(typeof Kt=="function")gt(Kt,this,Dt);else{var Vt=Kt.length,Ut=Rt(Kt,Vt);for(Pt=0;Pt<Vt;++Pt)gt(Ut[Pt],this,Dt)}return!0},xt.prototype.addListener=function(Bt,Dt){return kt(this,Bt,Dt,!1)},xt.prototype.on=xt.prototype.addListener,xt.prototype.prependListener=function(Bt,Dt){return kt(this,Bt,Dt,!0)},xt.prototype.once=function(Bt,Dt){return yt(Dt),this.on(Bt,bt(this,Bt,Dt)),this},xt.prototype.prependOnceListener=function(Bt,Dt){return yt(Dt),this.prependListener(Bt,bt(this,Bt,Dt)),this},xt.prototype.removeListener=function(Bt,Dt){var Pt,Nt,Lt,Wt,$t;if(yt(Dt),(Nt=this._events)===void 0)return this;if((Pt=Nt[Bt])===void 0)return this;if(Pt===Dt||Pt.listener===Dt)--this._eventsCount==0?this._events=Object.create(null):(delete Nt[Bt],Nt.removeListener&&this.emit("removeListener",Bt,Pt.listener||Dt));else if(typeof Pt!="function"){for(Lt=-1,Wt=Pt.length-1;Wt>=0;Wt--)if(Pt[Wt]===Dt||Pt[Wt].listener===Dt){$t=Pt[Wt].listener,Lt=Wt;break}if(Lt<0)return this;Lt===0?Pt.shift():function(Kt,Vt){for(;Vt+1<Kt.length;Vt++)Kt[Vt]=Kt[Vt+1];Kt.pop()}(Pt,Lt),Pt.length===1&&(Nt[Bt]=Pt[0]),Nt.removeListener!==void 0&&this.emit("removeListener",Bt,$t||Dt)}return this},xt.prototype.off=xt.prototype.removeListener,xt.prototype.removeAllListeners=function(Bt){var Dt,Pt,Nt;if((Pt=this._events)===void 0)return this;if(Pt.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Pt[Bt]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete Pt[Bt]),this;if(arguments.length===0){var Lt,Wt=Object.keys(Pt);for(Nt=0;Nt<Wt.length;++Nt)(Lt=Wt[Nt])!=="removeListener"&&this.removeAllListeners(Lt);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(Dt=Pt[Bt])=="function")this.removeListener(Bt,Dt);else if(Dt!==void 0)for(Nt=Dt.length-1;Nt>=0;Nt--)this.removeListener(Bt,Dt[Nt]);return this},xt.prototype.listeners=function(Bt){return It(this,Bt,!0)},xt.prototype.rawListeners=function(Bt){return It(this,Bt,!1)},xt.listenerCount=function(Bt,Dt){return typeof Bt.listenerCount=="function"?Bt.listenerCount(Dt):wt.call(Bt,Dt)},xt.prototype.listenerCount=wt,xt.prototype.eventNames=function(){return this._eventsCount>0?ft(this._events):[]}},4485:(nt,ft,ht)=>{var gt=ht(7834).Buffer,At=ht(7525).Transform;function xt(Et){At.call(this),this._block=gt.allocUnsafe(Et),this._blockSize=Et,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}ht(1285)(xt,At),xt.prototype._transform=function(Et,yt,Ct){var kt=null;try{this.update(Et,yt)}catch(vt){kt=vt}Ct(kt)},xt.prototype._flush=function(Et){var yt=null;try{this.push(this.digest())}catch(Ct){yt=Ct}Et(yt)},xt.prototype.update=function(Et,yt){if(function(wt,Rt){if(!gt.isBuffer(wt)&&typeof wt!="string")throw new TypeError("Data must be a string or a buffer")}(Et),this._finalized)throw new Error("Digest already called");gt.isBuffer(Et)||(Et=gt.from(Et,yt));for(var Ct=this._block,kt=0;this._blockOffset+Et.length-kt>=this._blockSize;){for(var vt=this._blockOffset;vt<this._blockSize;)Ct[vt++]=Et[kt++];this._update(),this._blockOffset=0}for(;kt<Et.length;)Ct[this._blockOffset++]=Et[kt++];for(var bt=0,It=8*Et.length;It>0;++bt)this._length[bt]+=It,(It=this._length[bt]/4294967296|0)>0&&(this._length[bt]-=4294967296*It);return this},xt.prototype._update=function(){throw new Error("_update is not implemented")},xt.prototype.digest=function(Et){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var yt=this._digest();Et!==void 0&&(yt=yt.toString(Et)),this._block.fill(0),this._blockOffset=0;for(var Ct=0;Ct<4;++Ct)this._length[Ct]=0;return yt},xt.prototype._digest=function(){throw new Error("_digest is not implemented")},nt.exports=xt},2333:(nt,ft)=>{ft.read=function(ht,gt,At,xt,Et){var yt,Ct,kt=8*Et-xt-1,vt=(1<<kt)-1,bt=vt>>1,It=-7,wt=At?Et-1:0,Rt=At?-1:1,Tt=ht[gt+wt];for(wt+=Rt,yt=Tt&(1<<-It)-1,Tt>>=-It,It+=kt;It>0;yt=256*yt+ht[gt+wt],wt+=Rt,It-=8);for(Ct=yt&(1<<-It)-1,yt>>=-It,It+=xt;It>0;Ct=256*Ct+ht[gt+wt],wt+=Rt,It-=8);if(yt===0)yt=1-bt;else{if(yt===vt)return Ct?NaN:1/0*(Tt?-1:1);Ct+=Math.pow(2,xt),yt-=bt}return(Tt?-1:1)*Ct*Math.pow(2,yt-xt)},ft.write=function(ht,gt,At,xt,Et,yt){var Ct,kt,vt,bt=8*yt-Et-1,It=(1<<bt)-1,wt=It>>1,Rt=Et===23?Math.pow(2,-24)-Math.pow(2,-77):0,Tt=xt?0:yt-1,Bt=xt?1:-1,Dt=gt<0||gt===0&&1/gt<0?1:0;for(gt=Math.abs(gt),isNaN(gt)||gt===1/0?(kt=isNaN(gt)?1:0,Ct=It):(Ct=Math.floor(Math.log(gt)/Math.LN2),gt*(vt=Math.pow(2,-Ct))<1&&(Ct--,vt*=2),(gt+=Ct+wt>=1?Rt/vt:Rt*Math.pow(2,1-wt))*vt>=2&&(Ct++,vt/=2),Ct+wt>=It?(kt=0,Ct=It):Ct+wt>=1?(kt=(gt*vt-1)*Math.pow(2,Et),Ct+=wt):(kt=gt*Math.pow(2,wt-1)*Math.pow(2,Et),Ct=0));Et>=8;ht[At+Tt]=255&kt,Tt+=Bt,kt/=256,Et-=8);for(Ct=Ct<<Et|kt,bt+=Et;bt>0;ht[At+Tt]=255&Ct,Tt+=Bt,Ct/=256,bt-=8);ht[At+Tt-Bt]|=128*Dt}},1285:nt=>{typeof Object.create=="function"?nt.exports=function(ft,ht){ht&&(ft.super_=ht,ft.prototype=Object.create(ht.prototype,{constructor:{value:ft,enumerable:!1,writable:!0,configurable:!0}}))}:nt.exports=function(ft,ht){if(ht){ft.super_=ht;var gt=function(){};gt.prototype=ht.prototype,ft.prototype=new gt,ft.prototype.constructor=ft}}},7906:nt=>{var ft={}.toString;nt.exports=Array.isArray||function(ht){return ft.call(ht)=="[object Array]"}},7993:(nt,ft,ht)=>{var gt=ht(1285),At=ht(4485),xt=ht(7834).Buffer,Et=new Array(16);function yt(){At.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function Ct(wt,Rt){return wt<<Rt|wt>>>32-Rt}function kt(wt,Rt,Tt,Bt,Dt,Pt,Nt){return Ct(wt+(Rt&Tt|~Rt&Bt)+Dt+Pt|0,Nt)+Rt|0}function vt(wt,Rt,Tt,Bt,Dt,Pt,Nt){return Ct(wt+(Rt&Bt|Tt&~Bt)+Dt+Pt|0,Nt)+Rt|0}function bt(wt,Rt,Tt,Bt,Dt,Pt,Nt){return Ct(wt+(Rt^Tt^Bt)+Dt+Pt|0,Nt)+Rt|0}function It(wt,Rt,Tt,Bt,Dt,Pt,Nt){return Ct(wt+(Tt^(Rt|~Bt))+Dt+Pt|0,Nt)+Rt|0}gt(yt,At),yt.prototype._update=function(){for(var wt=Et,Rt=0;Rt<16;++Rt)wt[Rt]=this._block.readInt32LE(4*Rt);var Tt=this._a,Bt=this._b,Dt=this._c,Pt=this._d;Tt=kt(Tt,Bt,Dt,Pt,wt[0],3614090360,7),Pt=kt(Pt,Tt,Bt,Dt,wt[1],3905402710,12),Dt=kt(Dt,Pt,Tt,Bt,wt[2],606105819,17),Bt=kt(Bt,Dt,Pt,Tt,wt[3],3250441966,22),Tt=kt(Tt,Bt,Dt,Pt,wt[4],4118548399,7),Pt=kt(Pt,Tt,Bt,Dt,wt[5],1200080426,12),Dt=kt(Dt,Pt,Tt,Bt,wt[6],2821735955,17),Bt=kt(Bt,Dt,Pt,Tt,wt[7],4249261313,22),Tt=kt(Tt,Bt,Dt,Pt,wt[8],1770035416,7),Pt=kt(Pt,Tt,Bt,Dt,wt[9],2336552879,12),Dt=kt(Dt,Pt,Tt,Bt,wt[10],4294925233,17),Bt=kt(Bt,Dt,Pt,Tt,wt[11],2304563134,22),Tt=kt(Tt,Bt,Dt,Pt,wt[12],1804603682,7),Pt=kt(Pt,Tt,Bt,Dt,wt[13],4254626195,12),Dt=kt(Dt,Pt,Tt,Bt,wt[14],2792965006,17),Tt=vt(Tt,Bt=kt(Bt,Dt,Pt,Tt,wt[15],1236535329,22),Dt,Pt,wt[1],4129170786,5),Pt=vt(Pt,Tt,Bt,Dt,wt[6],3225465664,9),Dt=vt(Dt,Pt,Tt,Bt,wt[11],643717713,14),Bt=vt(Bt,Dt,Pt,Tt,wt[0],3921069994,20),Tt=vt(Tt,Bt,Dt,Pt,wt[5],3593408605,5),Pt=vt(Pt,Tt,Bt,Dt,wt[10],38016083,9),Dt=vt(Dt,Pt,Tt,Bt,wt[15],3634488961,14),Bt=vt(Bt,Dt,Pt,Tt,wt[4],3889429448,20),Tt=vt(Tt,Bt,Dt,Pt,wt[9],568446438,5),Pt=vt(Pt,Tt,Bt,Dt,wt[14],3275163606,9),Dt=vt(Dt,Pt,Tt,Bt,wt[3],4107603335,14),Bt=vt(Bt,Dt,Pt,Tt,wt[8],1163531501,20),Tt=vt(Tt,Bt,Dt,Pt,wt[13],2850285829,5),Pt=vt(Pt,Tt,Bt,Dt,wt[2],4243563512,9),Dt=vt(Dt,Pt,Tt,Bt,wt[7],1735328473,14),Tt=bt(Tt,Bt=vt(Bt,Dt,Pt,Tt,wt[12],2368359562,20),Dt,Pt,wt[5],4294588738,4),Pt=bt(Pt,Tt,Bt,Dt,wt[8],2272392833,11),Dt=bt(Dt,Pt,Tt,Bt,wt[11],1839030562,16),Bt=bt(Bt,Dt,Pt,Tt,wt[14],4259657740,23),Tt=bt(Tt,Bt,Dt,Pt,wt[1],2763975236,4),Pt=bt(Pt,Tt,Bt,Dt,wt[4],1272893353,11),Dt=bt(Dt,Pt,Tt,Bt,wt[7],4139469664,16),Bt=bt(Bt,Dt,Pt,Tt,wt[10],3200236656,23),Tt=bt(Tt,Bt,Dt,Pt,wt[13],681279174,4),Pt=bt(Pt,Tt,Bt,Dt,wt[0],3936430074,11),Dt=bt(Dt,Pt,Tt,Bt,wt[3],3572445317,16),Bt=bt(Bt,Dt,Pt,Tt,wt[6],76029189,23),Tt=bt(Tt,Bt,Dt,Pt,wt[9],3654602809,4),Pt=bt(Pt,Tt,Bt,Dt,wt[12],3873151461,11),Dt=bt(Dt,Pt,Tt,Bt,wt[15],530742520,16),Tt=It(Tt,Bt=bt(Bt,Dt,Pt,Tt,wt[2],3299628645,23),Dt,Pt,wt[0],4096336452,6),Pt=It(Pt,Tt,Bt,Dt,wt[7],1126891415,10),Dt=It(Dt,Pt,Tt,Bt,wt[14],2878612391,15),Bt=It(Bt,Dt,Pt,Tt,wt[5],4237533241,21),Tt=It(Tt,Bt,Dt,Pt,wt[12],1700485571,6),Pt=It(Pt,Tt,Bt,Dt,wt[3],2399980690,10),Dt=It(Dt,Pt,Tt,Bt,wt[10],4293915773,15),Bt=It(Bt,Dt,Pt,Tt,wt[1],2240044497,21),Tt=It(Tt,Bt,Dt,Pt,wt[8],1873313359,6),Pt=It(Pt,Tt,Bt,Dt,wt[15],4264355552,10),Dt=It(Dt,Pt,Tt,Bt,wt[6],2734768916,15),Bt=It(Bt,Dt,Pt,Tt,wt[13],1309151649,21),Tt=It(Tt,Bt,Dt,Pt,wt[4],4149444226,6),Pt=It(Pt,Tt,Bt,Dt,wt[11],3174756917,10),Dt=It(Dt,Pt,Tt,Bt,wt[2],718787259,15),Bt=It(Bt,Dt,Pt,Tt,wt[9],3951481745,21),this._a=this._a+Tt|0,this._b=this._b+Bt|0,this._c=this._c+Dt|0,this._d=this._d+Pt|0},yt.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var wt=xt.allocUnsafe(16);return wt.writeInt32LE(this._a,0),wt.writeInt32LE(this._b,4),wt.writeInt32LE(this._c,8),wt.writeInt32LE(this._d,12),wt},nt.exports=yt},1482:(nt,ft,ht)=>{var gt=ht(7768);function At(Tt,Bt){gt.cipher.registerAlgorithm(Tt,function(){return new gt.aes.Algorithm(Tt,Bt)})}ht(4609),ht(9554),ht(3103),nt.exports=gt.aes=gt.aes||{},gt.aes.startEncrypting=function(Tt,Bt,Dt,Pt){var Nt=Rt({key:Tt,output:Dt,decrypt:!1,mode:Pt});return Nt.start(Bt),Nt},gt.aes.createEncryptionCipher=function(Tt,Bt){return Rt({key:Tt,output:null,decrypt:!1,mode:Bt})},gt.aes.startDecrypting=function(Tt,Bt,Dt,Pt){var Nt=Rt({key:Tt,output:Dt,decrypt:!0,mode:Pt});return Nt.start(Bt),Nt},gt.aes.createDecryptionCipher=function(Tt,Bt){return Rt({key:Tt,output:null,decrypt:!0,mode:Bt})},gt.aes.Algorithm=function(Tt,Bt){vt||bt();var Dt=this;Dt.name=Tt,Dt.mode=new Bt({blockSize:16,cipher:{encrypt:function(Pt,Nt){return wt(Dt._w,Pt,Nt,!1)},decrypt:function(Pt,Nt){return wt(Dt._w,Pt,Nt,!0)}}}),Dt._init=!1},gt.aes.Algorithm.prototype.initialize=function(Tt){if(!this._init){var Bt,Dt=Tt.key;if(typeof Dt!="string"||Dt.length!==16&&Dt.length!==24&&Dt.length!==32){if(gt.util.isArray(Dt)&&(Dt.length===16||Dt.length===24||Dt.length===32)){Bt=Dt,Dt=gt.util.createBuffer();for(var Pt=0;Pt<Bt.length;++Pt)Dt.putByte(Bt[Pt])}}else Dt=gt.util.createBuffer(Dt);if(!gt.util.isArray(Dt)){Bt=Dt,Dt=[];var Nt=Bt.length();if(Nt===16||Nt===24||Nt===32)for(Nt>>>=2,Pt=0;Pt<Nt;++Pt)Dt.push(Bt.getInt32())}if(!gt.util.isArray(Dt)||Dt.length!==4&&Dt.length!==6&&Dt.length!==8)throw new Error("Invalid key parameter.");var Lt=this.mode.name,Wt=["CFB","OFB","CTR","GCM"].indexOf(Lt)!==-1;this._w=It(Dt,Tt.decrypt&&!Wt),this._init=!0}},gt.aes._expandKey=function(Tt,Bt){return vt||bt(),It(Tt,Bt)},gt.aes._updateBlock=wt,At("AES-ECB",gt.cipher.modes.ecb),At("AES-CBC",gt.cipher.modes.cbc),At("AES-CFB",gt.cipher.modes.cfb),At("AES-OFB",gt.cipher.modes.ofb),At("AES-CTR",gt.cipher.modes.ctr),At("AES-GCM",gt.cipher.modes.gcm);var xt,Et,yt,Ct,kt,vt=!1;function bt(){vt=!0,yt=[0,1,2,4,8,16,32,64,128,27,54];for(var Tt=new Array(256),Bt=0;Bt<128;++Bt)Tt[Bt]=Bt<<1,Tt[Bt+128]=Bt+128<<1^283;for(xt=new Array(256),Et=new Array(256),Ct=new Array(4),kt=new Array(4),Bt=0;Bt<4;++Bt)Ct[Bt]=new Array(256),kt[Bt]=new Array(256);var Dt,Pt,Nt,Lt,Wt,$t,Kt,Vt=0,Ut=0;for(Bt=0;Bt<256;++Bt){Lt=(Lt=Ut^Ut<<1^Ut<<2^Ut<<3^Ut<<4)>>8^255&Lt^99,xt[Vt]=Lt,Et[Lt]=Vt,$t=(Wt=Tt[Lt])<<24^Lt<<16^Lt<<8^Lt^Wt,Kt=((Dt=Tt[Vt])^(Pt=Tt[Dt])^(Nt=Tt[Pt]))<<24^(Vt^Nt)<<16^(Vt^Pt^Nt)<<8^Vt^Dt^Nt;for(var _t=0;_t<4;++_t)Ct[_t][Vt]=$t,kt[_t][Lt]=Kt,$t=$t<<24|$t>>>8,Kt=Kt<<24|Kt>>>8;Vt===0?Vt=Ut=1:(Vt=Dt^Tt[Tt[Tt[Dt^Nt]]],Ut^=Tt[Tt[Ut]])}}function It(Tt,Bt){for(var Dt,Pt=Tt.slice(0),Nt=1,Lt=Pt.length,Wt=4*(Lt+6+1),$t=Lt;$t<Wt;++$t)Dt=Pt[$t-1],$t%Lt==0?(Dt=xt[Dt>>>16&255]<<24^xt[Dt>>>8&255]<<16^xt[255&Dt]<<8^xt[Dt>>>24]^yt[Nt]<<24,Nt++):Lt>6&&$t%Lt==4&&(Dt=xt[Dt>>>24]<<24^xt[Dt>>>16&255]<<16^xt[Dt>>>8&255]<<8^xt[255&Dt]),Pt[$t]=Pt[$t-Lt]^Dt;if(Bt){for(var Kt,Vt=kt[0],Ut=kt[1],_t=kt[2],Xt=kt[3],Qt=Pt.slice(0),jt=($t=0,(Wt=Pt.length)-4);$t<Wt;$t+=4,jt-=4)if($t===0||$t===Wt-4)Qt[$t]=Pt[jt],Qt[$t+1]=Pt[jt+3],Qt[$t+2]=Pt[jt+2],Qt[$t+3]=Pt[jt+1];else for(var Gt=0;Gt<4;++Gt)Kt=Pt[jt+Gt],Qt[$t+(3&-Gt)]=Vt[xt[Kt>>>24]]^Ut[xt[Kt>>>16&255]]^_t[xt[Kt>>>8&255]]^Xt[xt[255&Kt]];Pt=Qt}return Pt}function wt(Tt,Bt,Dt,Pt){var Nt,Lt,Wt,$t,Kt,Vt,Ut,_t,Xt,Qt,jt,Gt,qt=Tt.length/4-1;Pt?(Nt=kt[0],Lt=kt[1],Wt=kt[2],$t=kt[3],Kt=Et):(Nt=Ct[0],Lt=Ct[1],Wt=Ct[2],$t=Ct[3],Kt=xt),Vt=Bt[0]^Tt[0],Ut=Bt[Pt?3:1]^Tt[1],_t=Bt[2]^Tt[2],Xt=Bt[Pt?1:3]^Tt[3];for(var zt=3,e0=1;e0<qt;++e0)Qt=Nt[Vt>>>24]^Lt[Ut>>>16&255]^Wt[_t>>>8&255]^$t[255&Xt]^Tt[++zt],jt=Nt[Ut>>>24]^Lt[_t>>>16&255]^Wt[Xt>>>8&255]^$t[255&Vt]^Tt[++zt],Gt=Nt[_t>>>24]^Lt[Xt>>>16&255]^Wt[Vt>>>8&255]^$t[255&Ut]^Tt[++zt],Xt=Nt[Xt>>>24]^Lt[Vt>>>16&255]^Wt[Ut>>>8&255]^$t[255&_t]^Tt[++zt],Vt=Qt,Ut=jt,_t=Gt;Dt[0]=Kt[Vt>>>24]<<24^Kt[Ut>>>16&255]<<16^Kt[_t>>>8&255]<<8^Kt[255&Xt]^Tt[++zt],Dt[Pt?3:1]=Kt[Ut>>>24]<<24^Kt[_t>>>16&255]<<16^Kt[Xt>>>8&255]<<8^Kt[255&Vt]^Tt[++zt],Dt[2]=Kt[_t>>>24]<<24^Kt[Xt>>>16&255]<<16^Kt[Vt>>>8&255]<<8^Kt[255&Ut]^Tt[++zt],Dt[Pt?1:3]=Kt[Xt>>>24]<<24^Kt[Vt>>>16&255]<<16^Kt[Ut>>>8&255]<<8^Kt[255&_t]^Tt[++zt]}function Rt(Tt){var Bt,Dt="AES-"+((Tt=Tt||{}).mode||"CBC").toUpperCase(),Pt=(Bt=Tt.decrypt?gt.cipher.createDecipher(Dt,Tt.key):gt.cipher.createCipher(Dt,Tt.key)).start;return Bt.start=function(Nt,Lt){var Wt=null;Lt instanceof gt.util.ByteBuffer&&(Wt=Lt,Lt={}),(Lt=Lt||{}).output=Wt,Lt.iv=Nt,Pt.call(Bt,Lt)},Bt}},6898:(nt,ft,ht)=>{var gt=ht(7768);ht(1482),ht(8472);var At=nt.exports=gt.tls;function xt(vt,bt,It){var wt=bt.entity===gt.tls.ConnectionEnd.client;vt.read.cipherState={init:!1,cipher:gt.cipher.createDecipher("AES-CBC",wt?It.keys.server_write_key:It.keys.client_write_key),iv:wt?It.keys.server_write_IV:It.keys.client_write_IV},vt.write.cipherState={init:!1,cipher:gt.cipher.createCipher("AES-CBC",wt?It.keys.client_write_key:It.keys.server_write_key),iv:wt?It.keys.client_write_IV:It.keys.server_write_IV},vt.read.cipherFunction=kt,vt.write.cipherFunction=Et,vt.read.macLength=vt.write.macLength=It.mac_length,vt.read.macFunction=vt.write.macFunction=At.hmac_sha1}function Et(vt,bt){var It,wt=!1,Rt=bt.macFunction(bt.macKey,bt.sequenceNumber,vt);vt.fragment.putBytes(Rt),bt.updateSequenceNumber(),It=vt.version.minor===At.Versions.TLS_1_0.minor?bt.cipherState.init?null:bt.cipherState.iv:gt.random.getBytesSync(16),bt.cipherState.init=!0;var Tt=bt.cipherState.cipher;return Tt.start({iv:It}),vt.version.minor>=At.Versions.TLS_1_1.minor&&Tt.output.putBytes(It),Tt.update(vt.fragment),Tt.finish(yt)&&(vt.fragment=Tt.output,vt.length=vt.fragment.length(),wt=!0),wt}function yt(vt,bt,It){if(!It){var wt=vt-bt.length()%vt;bt.fillWithByte(wt-1,wt)}return!0}function Ct(vt,bt,It){var wt=!0;if(It){for(var Rt=bt.length(),Tt=bt.last(),Bt=Rt-1-Tt;Bt<Rt-1;++Bt)wt=wt&&bt.at(Bt)==Tt;wt&&bt.truncate(Tt+1)}return wt}function kt(vt,bt){var It,wt=!1;It=vt.version.minor===At.Versions.TLS_1_0.minor?bt.cipherState.init?null:bt.cipherState.iv:vt.fragment.getBytes(16),bt.cipherState.init=!0;var Rt=bt.cipherState.cipher;Rt.start({iv:It}),Rt.update(vt.fragment),wt=Rt.finish(Ct);var Tt=bt.macLength,Bt=gt.random.getBytesSync(Tt),Dt=Rt.output.length();Dt>=Tt?(vt.fragment=Rt.output.getBytes(Dt-Tt),Bt=Rt.output.getBytes(Tt)):vt.fragment=Rt.output.getBytes(),vt.fragment=gt.util.createBuffer(vt.fragment),vt.length=vt.fragment.length();var Pt=bt.macFunction(bt.macKey,bt.sequenceNumber,vt);return bt.updateSequenceNumber(),wt=function(Nt,Lt,Wt){var $t=gt.hmac.create();return $t.start("SHA1",Nt),$t.update(Lt),Lt=$t.digest().getBytes(),$t.start(null,null),$t.update(Wt),Lt===(Wt=$t.digest().getBytes())}(bt.macKey,Bt,Pt)&&wt,wt}At.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(vt){vt.bulk_cipher_algorithm=At.BulkCipherAlgorithm.aes,vt.cipher_type=At.CipherType.block,vt.enc_key_length=16,vt.block_length=16,vt.fixed_iv_length=16,vt.record_iv_length=16,vt.mac_algorithm=At.MACAlgorithm.hmac_sha1,vt.mac_length=20,vt.mac_key_length=20},initConnectionState:xt},At.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(vt){vt.bulk_cipher_algorithm=At.BulkCipherAlgorithm.aes,vt.cipher_type=At.CipherType.block,vt.enc_key_length=32,vt.block_length=16,vt.fixed_iv_length=16,vt.record_iv_length=16,vt.mac_algorithm=At.MACAlgorithm.hmac_sha1,vt.mac_length=20,vt.mac_key_length=20},initConnectionState:xt}},5235:(nt,ft,ht)=>{var gt=ht(7768);ht(2624);var At=gt.asn1;ft.privateKeyValidator={name:"PrivateKeyInfo",tagClass:At.Class.UNIVERSAL,type:At.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:At.Class.UNIVERSAL,type:At.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:At.Class.UNIVERSAL,type:At.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:At.Class.UNIVERSAL,type:At.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:At.Class.UNIVERSAL,type:At.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},ft.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:At.Class.UNIVERSAL,type:At.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:At.Class.UNIVERSAL,type:At.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:At.Class.UNIVERSAL,type:At.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:At.Class.UNIVERSAL,type:At.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},2624:(nt,ft,ht)=>{var gt=ht(7768);ht(3103),ht(2884);var At=nt.exports=gt.asn1=gt.asn1||{};function xt(Ct,kt,vt){if(vt>kt){var bt=new Error("Too few bytes to parse DER.");throw bt.available=Ct.length(),bt.remaining=kt,bt.requested=vt,bt}}function Et(Ct,kt,vt,bt){var It;xt(Ct,kt,2);var wt=Ct.getByte();kt--;var Rt=192&wt,Tt=31&wt;It=Ct.length();var Bt,Dt,Pt=function(Qt,jt){var Gt=Qt.getByte();if(jt--,Gt!==128){var qt;if(128&Gt){var zt=127&Gt;xt(Qt,jt,zt),qt=Qt.getInt(zt<<3)}else qt=Gt;if(qt<0)throw new Error("Negative length: "+qt);return qt}}(Ct,kt);if(kt-=It-Ct.length(),Pt!==void 0&&Pt>kt){if(bt.strict){var Nt=new Error("Too few bytes to read ASN.1 value.");throw Nt.available=Ct.length(),Nt.remaining=kt,Nt.requested=Pt,Nt}Pt=kt}var Lt=(32&wt)==32;if(Lt)if(Bt=[],Pt===void 0)for(;;){if(xt(Ct,kt,2),Ct.bytes(2)==="\0\0"){Ct.getBytes(2),kt-=2;break}It=Ct.length(),Bt.push(Et(Ct,kt,vt+1,bt)),kt-=It-Ct.length()}else for(;Pt>0;)It=Ct.length(),Bt.push(Et(Ct,Pt,vt+1,bt)),kt-=It-Ct.length(),Pt-=It-Ct.length();if(Bt===void 0&&Rt===At.Class.UNIVERSAL&&Tt===At.Type.BITSTRING&&(Dt=Ct.bytes(Pt)),Bt===void 0&&bt.decodeBitStrings&&Rt===At.Class.UNIVERSAL&&Tt===At.Type.BITSTRING&&Pt>1){var Wt=Ct.read,$t=kt,Kt=0;if(Tt===At.Type.BITSTRING&&(xt(Ct,kt,1),Kt=Ct.getByte(),kt--),Kt===0)try{It=Ct.length();var Vt=Et(Ct,kt,vt+1,{strict:!0,decodeBitStrings:!0}),Ut=It-Ct.length();kt-=Ut,Tt==At.Type.BITSTRING&&Ut++;var _t=Vt.tagClass;Ut!==Pt||_t!==At.Class.UNIVERSAL&&_t!==At.Class.CONTEXT_SPECIFIC||(Bt=[Vt])}catch{}Bt===void 0&&(Ct.read=Wt,kt=$t)}if(Bt===void 0){if(Pt===void 0){if(bt.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");Pt=kt}if(Tt===At.Type.BMPSTRING)for(Bt="";Pt>0;Pt-=2)xt(Ct,kt,2),Bt+=String.fromCharCode(Ct.getInt16()),kt-=2;else Bt=Ct.getBytes(Pt),kt-=Pt}var Xt=Dt===void 0?null:{bitStringContents:Dt};return At.create(Rt,Tt,Lt,Bt,Xt)}At.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},At.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},At.create=function(Ct,kt,vt,bt,It){if(gt.util.isArray(bt)){for(var wt=[],Rt=0;Rt<bt.length;++Rt)bt[Rt]!==void 0&&wt.push(bt[Rt]);bt=wt}var Tt={tagClass:Ct,type:kt,constructed:vt,composed:vt||gt.util.isArray(bt),value:bt};return It&&"bitStringContents"in It&&(Tt.bitStringContents=It.bitStringContents,Tt.original=At.copy(Tt)),Tt},At.copy=function(Ct,kt){var vt;if(gt.util.isArray(Ct)){vt=[];for(var bt=0;bt<Ct.length;++bt)vt.push(At.copy(Ct[bt],kt));return vt}return typeof Ct=="string"?Ct:(vt={tagClass:Ct.tagClass,type:Ct.type,constructed:Ct.constructed,composed:Ct.composed,value:At.copy(Ct.value,kt)},kt&&!kt.excludeBitStringContents&&(vt.bitStringContents=Ct.bitStringContents),vt)},At.equals=function(Ct,kt,vt){if(gt.util.isArray(Ct)){if(!gt.util.isArray(kt)||Ct.length!==kt.length)return!1;for(var bt=0;bt<Ct.length;++bt)if(!At.equals(Ct[bt],kt[bt]))return!1;return!0}if(typeof Ct!=typeof kt)return!1;if(typeof Ct=="string")return Ct===kt;var It=Ct.tagClass===kt.tagClass&&Ct.type===kt.type&&Ct.constructed===kt.constructed&&Ct.composed===kt.composed&&At.equals(Ct.value,kt.value);return vt&&vt.includeBitStringContents&&(It=It&&Ct.bitStringContents===kt.bitStringContents),It},At.getBerValueLength=function(Ct){var kt=Ct.getByte();if(kt!==128)return 128&kt?Ct.getInt((127&kt)<<3):kt},At.fromDer=function(Ct,kt){kt===void 0&&(kt={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof kt=="boolean"&&(kt={strict:kt,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in kt||(kt.strict=!0),"parseAllBytes"in kt||(kt.parseAllBytes=!0),"decodeBitStrings"in kt||(kt.decodeBitStrings=!0),typeof Ct=="string"&&(Ct=gt.util.createBuffer(Ct));var vt=Ct.length(),bt=Et(Ct,Ct.length(),0,kt);if(kt.parseAllBytes&&Ct.length()!==0){var It=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw It.byteCount=vt,It.remaining=Ct.length(),It}return bt},At.toDer=function(Ct){var kt=gt.util.createBuffer(),vt=Ct.tagClass|Ct.type,bt=gt.util.createBuffer(),It=!1;if("bitStringContents"in Ct&&(It=!0,Ct.original&&(It=At.equals(Ct,Ct.original))),It)bt.putBytes(Ct.bitStringContents);else if(Ct.composed){Ct.constructed?vt|=32:bt.putByte(0);for(var wt=0;wt<Ct.value.length;++wt)Ct.value[wt]!==void 0&&bt.putBuffer(At.toDer(Ct.value[wt]))}else if(Ct.type===At.Type.BMPSTRING)for(wt=0;wt<Ct.value.length;++wt)bt.putInt16(Ct.value.charCodeAt(wt));else Ct.type===At.Type.INTEGER&&Ct.value.length>1&&(Ct.value.charCodeAt(0)===0&&!(128&Ct.value.charCodeAt(1))||Ct.value.charCodeAt(0)===255&&(128&Ct.value.charCodeAt(1))==128)?bt.putBytes(Ct.value.substr(1)):bt.putBytes(Ct.value);if(kt.putByte(vt),bt.length()<=127)kt.putByte(127&bt.length());else{var Rt=bt.length(),Tt="";do Tt+=String.fromCharCode(255&Rt),Rt>>>=8;while(Rt>0);for(kt.putByte(128|Tt.length),wt=Tt.length-1;wt>=0;--wt)kt.putByte(Tt.charCodeAt(wt))}return kt.putBuffer(bt),kt},At.oidToDer=function(Ct){var kt,vt,bt,It,wt=Ct.split("."),Rt=gt.util.createBuffer();Rt.putByte(40*parseInt(wt[0],10)+parseInt(wt[1],10));for(var Tt=2;Tt<wt.length;++Tt){kt=!0,vt=[],bt=parseInt(wt[Tt],10);do It=127&bt,bt>>>=7,kt||(It|=128),vt.push(It),kt=!1;while(bt>0);for(var Bt=vt.length-1;Bt>=0;--Bt)Rt.putByte(vt[Bt])}return Rt},At.derToOid=function(Ct){var kt;typeof Ct=="string"&&(Ct=gt.util.createBuffer(Ct));var vt=Ct.getByte();kt=Math.floor(vt/40)+"."+vt%40;for(var bt=0;Ct.length()>0;)bt<<=7,128&(vt=Ct.getByte())?bt+=127&vt:(kt+="."+(bt+vt),bt=0);return kt},At.utcTimeToDate=function(Ct){var kt=new Date,vt=parseInt(Ct.substr(0,2),10);vt=vt>=50?1900+vt:2e3+vt;var bt=parseInt(Ct.substr(2,2),10)-1,It=parseInt(Ct.substr(4,2),10),wt=parseInt(Ct.substr(6,2),10),Rt=parseInt(Ct.substr(8,2),10),Tt=0;if(Ct.length>11){var Bt=Ct.charAt(10),Dt=10;Bt!=="+"&&Bt!=="-"&&(Tt=parseInt(Ct.substr(10,2),10),Dt+=2)}if(kt.setUTCFullYear(vt,bt,It),kt.setUTCHours(wt,Rt,Tt,0),Dt&&((Bt=Ct.charAt(Dt))==="+"||Bt==="-")){var Pt=60*parseInt(Ct.substr(Dt+1,2),10)+parseInt(Ct.substr(Dt+4,2),10);Pt*=6e4,Bt==="+"?kt.setTime(+kt-Pt):kt.setTime(+kt+Pt)}return kt},At.generalizedTimeToDate=function(Ct){var kt=new Date,vt=parseInt(Ct.substr(0,4),10),bt=parseInt(Ct.substr(4,2),10)-1,It=parseInt(Ct.substr(6,2),10),wt=parseInt(Ct.substr(8,2),10),Rt=parseInt(Ct.substr(10,2),10),Tt=parseInt(Ct.substr(12,2),10),Bt=0,Dt=0,Pt=!1;Ct.charAt(Ct.length-1)==="Z"&&(Pt=!0);var Nt=Ct.length-5,Lt=Ct.charAt(Nt);return Lt!=="+"&&Lt!=="-"||(Dt=60*parseInt(Ct.substr(Nt+1,2),10)+parseInt(Ct.substr(Nt+4,2),10),Dt*=6e4,Lt==="+"&&(Dt*=-1),Pt=!0),Ct.charAt(14)==="."&&(Bt=1e3*parseFloat(Ct.substr(14),10)),Pt?(kt.setUTCFullYear(vt,bt,It),kt.setUTCHours(wt,Rt,Tt,Bt),kt.setTime(+kt+Dt)):(kt.setFullYear(vt,bt,It),kt.setHours(wt,Rt,Tt,Bt)),kt},At.dateToUtcTime=function(Ct){if(typeof Ct=="string")return Ct;var kt="",vt=[];vt.push((""+Ct.getUTCFullYear()).substr(2)),vt.push(""+(Ct.getUTCMonth()+1)),vt.push(""+Ct.getUTCDate()),vt.push(""+Ct.getUTCHours()),vt.push(""+Ct.getUTCMinutes()),vt.push(""+Ct.getUTCSeconds());for(var bt=0;bt<vt.length;++bt)vt[bt].length<2&&(kt+="0"),kt+=vt[bt];return kt+"Z"},At.dateToGeneralizedTime=function(Ct){if(typeof Ct=="string")return Ct;var kt="",vt=[];vt.push(""+Ct.getUTCFullYear()),vt.push(""+(Ct.getUTCMonth()+1)),vt.push(""+Ct.getUTCDate()),vt.push(""+Ct.getUTCHours()),vt.push(""+Ct.getUTCMinutes()),vt.push(""+Ct.getUTCSeconds());for(var bt=0;bt<vt.length;++bt)vt[bt].length<2&&(kt+="0"),kt+=vt[bt];return kt+"Z"},At.integerToDer=function(Ct){var kt=gt.util.createBuffer();if(Ct>=-128&&Ct<128)return kt.putSignedInt(Ct,8);if(Ct>=-32768&&Ct<32768)return kt.putSignedInt(Ct,16);if(Ct>=-8388608&&Ct<8388608)return kt.putSignedInt(Ct,24);if(Ct>=-2147483648&&Ct<2147483648)return kt.putSignedInt(Ct,32);var vt=new Error("Integer too large; max is 32-bits.");throw vt.integer=Ct,vt},At.derToInteger=function(Ct){typeof Ct=="string"&&(Ct=gt.util.createBuffer(Ct));var kt=8*Ct.length();if(kt>32)throw new Error("Integer too large; max is 32-bits.");return Ct.getSignedInt(kt)},At.validate=function(Ct,kt,vt,bt){var It=!1;if(Ct.tagClass!==kt.tagClass&&kt.tagClass!==void 0||Ct.type!==kt.type&&kt.type!==void 0)bt&&(Ct.tagClass!==kt.tagClass&&bt.push("["+kt.name+'] Expected tag class "'+kt.tagClass+'", got "'+Ct.tagClass+'"'),Ct.type!==kt.type&&bt.push("["+kt.name+'] Expected type "'+kt.type+'", got "'+Ct.type+'"'));else if(Ct.constructed===kt.constructed||kt.constructed===void 0){if(It=!0,kt.value&&gt.util.isArray(kt.value))for(var wt=0,Rt=0;It&&Rt<kt.value.length;++Rt)It=kt.value[Rt].optional||!1,Ct.value[wt]&&((It=At.validate(Ct.value[wt],kt.value[Rt],vt,bt))?++wt:kt.value[Rt].optional&&(It=!0)),!It&&bt&&bt.push("["+kt.name+'] Tag class "'+kt.tagClass+'", type "'+kt.type+'" expected value length "'+kt.value.length+'", got "'+Ct.value.length+'"');if(It&&vt&&(kt.capture&&(vt[kt.capture]=Ct.value),kt.captureAsn1&&(vt[kt.captureAsn1]=Ct),kt.captureBitStringContents&&"bitStringContents"in Ct&&(vt[kt.captureBitStringContents]=Ct.bitStringContents),kt.captureBitStringValue&&"bitStringContents"in Ct))if(Ct.bitStringContents.length<2)vt[kt.captureBitStringValue]="";else{if(Ct.bitStringContents.charCodeAt(0)!==0)throw new Error("captureBitStringValue only supported for zero unused bits");vt[kt.captureBitStringValue]=Ct.bitStringContents.slice(1)}}else bt&&bt.push("["+kt.name+'] Expected constructed "'+kt.constructed+'", got "'+Ct.constructed+'"');return It};var yt=/[^\\u0000-\\u00ff]/;At.prettyPrint=function(Ct,kt,vt){var bt="";vt=vt||2,(kt=kt||0)>0&&(bt+=`
10169
10169
  `);for(var It="",wt=0;wt<kt*vt;++wt)It+=" ";switch(bt+=It+"Tag: ",Ct.tagClass){case At.Class.UNIVERSAL:bt+="Universal:";break;case At.Class.APPLICATION:bt+="Application:";break;case At.Class.CONTEXT_SPECIFIC:bt+="Context-Specific:";break;case At.Class.PRIVATE:bt+="Private:"}if(Ct.tagClass===At.Class.UNIVERSAL)switch(bt+=Ct.type,Ct.type){case At.Type.NONE:bt+=" (None)";break;case At.Type.BOOLEAN:bt+=" (Boolean)";break;case At.Type.INTEGER:bt+=" (Integer)";break;case At.Type.BITSTRING:bt+=" (Bit string)";break;case At.Type.OCTETSTRING:bt+=" (Octet string)";break;case At.Type.NULL:bt+=" (Null)";break;case At.Type.OID:bt+=" (Object Identifier)";break;case At.Type.ODESC:bt+=" (Object Descriptor)";break;case At.Type.EXTERNAL:bt+=" (External or Instance of)";break;case At.Type.REAL:bt+=" (Real)";break;case At.Type.ENUMERATED:bt+=" (Enumerated)";break;case At.Type.EMBEDDED:bt+=" (Embedded PDV)";break;case At.Type.UTF8:bt+=" (UTF8)";break;case At.Type.ROID:bt+=" (Relative Object Identifier)";break;case At.Type.SEQUENCE:bt+=" (Sequence)";break;case At.Type.SET:bt+=" (Set)";break;case At.Type.PRINTABLESTRING:bt+=" (Printable String)";break;case At.Type.IA5String:bt+=" (IA5String (ASCII))";break;case At.Type.UTCTIME:bt+=" (UTC time)";break;case At.Type.GENERALIZEDTIME:bt+=" (Generalized time)";break;case At.Type.BMPSTRING:bt+=" (BMP String)"}else bt+=Ct.type;if(bt+=`
10170
10170
  `,bt+=It+"Constructed: "+Ct.constructed+`
10171
10171
  `,Ct.composed){var Rt=0,Tt="";for(wt=0;wt<Ct.value.length;++wt)Ct.value[wt]!==void 0&&(Rt+=1,Tt+=At.prettyPrint(Ct.value[wt],kt+1,vt),wt+1<Ct.value.length&&(Tt+=","));bt+=It+"Sub values: "+Rt+Tt}else{if(bt+=It+"Value: ",Ct.type===At.Type.OID){var Bt=At.derToOid(Ct.value);bt+=Bt,gt.pki&&gt.pki.oids&&Bt in gt.pki.oids&&(bt+=" ("+gt.pki.oids[Bt]+") ")}if(Ct.type===At.Type.INTEGER)try{bt+=At.derToInteger(Ct.value)}catch{bt+="0x"+gt.util.bytesToHex(Ct.value)}else if(Ct.type===At.Type.BITSTRING){if(Ct.value.length>1?bt+="0x"+gt.util.bytesToHex(Ct.value.slice(1)):bt+="(none)",Ct.value.length>0){var Dt=Ct.value.charCodeAt(0);Dt==1?bt+=" (1 unused bit shown)":Dt>1&&(bt+=" ("+Dt+" unused bits shown)")}}else if(Ct.type===At.Type.OCTETSTRING)yt.test(Ct.value)||(bt+="("+Ct.value+") "),bt+="0x"+gt.util.bytesToHex(Ct.value);else if(Ct.type===At.Type.UTF8)try{bt+=gt.util.decodeUtf8(Ct.value)}catch(Pt){if(Pt.message!=="URI malformed")throw Pt;bt+="0x"+gt.util.bytesToHex(Ct.value)+" (malformed UTF8)"}else Ct.type===At.Type.PRINTABLESTRING||Ct.type===At.Type.IA5String?bt+=Ct.value:yt.test(Ct.value)?bt+="0x"+gt.util.bytesToHex(Ct.value):Ct.value.length===0?bt+="[null]":bt+=Ct.value}return bt}},7858:(nt,ft,ht)=>{var gt=ht(7573).Buffer,At={};nt.exports=At;var xt={};At.encode=function(Et,yt,Ct){if(typeof yt!="string")throw new TypeError('"alphabet" must be a string.');if(Ct!==void 0&&typeof Ct!="number")throw new TypeError('"maxline" must be a number.');var kt="";if(Et instanceof Uint8Array){var vt=0,bt=yt.length,It=yt.charAt(0),wt=[0];for(vt=0;vt<Et.length;++vt){for(var Rt=0,Tt=Et[vt];Rt<wt.length;++Rt)Tt+=wt[Rt]<<8,wt[Rt]=Tt%bt,Tt=Tt/bt|0;for(;Tt>0;)wt.push(Tt%bt),Tt=Tt/bt|0}for(vt=0;Et[vt]===0&&vt<Et.length-1;++vt)kt+=It;for(vt=wt.length-1;vt>=0;--vt)kt+=yt[wt[vt]]}else kt=function(Dt,Pt){var Nt=0,Lt=Pt.length,Wt=Pt.charAt(0),$t=[0];for(Nt=0;Nt<Dt.length();++Nt){for(var Kt=0,Vt=Dt.at(Nt);Kt<$t.length;++Kt)Vt+=$t[Kt]<<8,$t[Kt]=Vt%Lt,Vt=Vt/Lt|0;for(;Vt>0;)$t.push(Vt%Lt),Vt=Vt/Lt|0}var Ut="";for(Nt=0;Dt.at(Nt)===0&&Nt<Dt.length()-1;++Nt)Ut+=Wt;for(Nt=$t.length-1;Nt>=0;--Nt)Ut+=Pt[$t[Nt]];return Ut}(Et,yt);if(Ct){var Bt=new RegExp(".{1,"+Ct+"}","g");kt=kt.match(Bt).join(`\r
@@ -10261,7 +10261,7 @@ ${tt.publicKey}
10261
10261
  }
10262
10262
  `,V5C_STEPS={firstPage:"firstPage",secondPage:"secondPage"};function CameraPaperStatement({onSuccess:Be,permission:Le,setPermission:Ye,permissionMessage:tt,permissionBackgroundColor:nt,onLog:ft,token:ht,onError:gt,numberOfTries:At,timeout:xt=1e3,hideRetake:Et,documentType:yt,tutorialText:Ct,showTutorial:kt=!0}){const vt=ht==null?void 0:ht.token,{t:bt}=useTranslation$1(),[It,wt]=React.useState(0),[Rt,Tt]=React.useState(!1),[Bt,Dt]=React.useState(null),[Pt,Nt]=React.useState(null),[Lt,Wt]=React.useState(null),[$t,Kt]=React.useState(!1),Vt=React.useRef(0),[Ut,_t]=React.useState(""),[Xt,Qt]=React.useState(!1),[jt,Gt]=React.useState(multiPageDocumentTypes.includes(yt)?V5C_STEPS.firstPage:null),qt=React.useRef(),zt=React.useRef(),{showNotification:e0,closeNotification:s0}=useNotifications();React.useEffect(()=>{multiPageDocumentTypes.includes(yt)&&Gt(V5C_STEPS.firstPage)},[yt]),React.useEffect(()=>{addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentCameraCapture,token:vt,shouldOpen:!0})},[]),React.useEffect(()=>{if($t&&!Rt)return zt.current=setInterval(()=>{ft(getLogObject("noCaptureInTime",{}))},xt),()=>clearInterval(zt.current)},[ft,xt,$t,Rt]),React.useEffect(()=>{sleep(1e3).then(()=>{const Yt=`${bt("notifications.showUtilityBill.one")}
10263
10263
  ${bt("notifications.showUtilityBill.two")}
10264
- ${bt("notifications.showUtilityBill.three")}`;return e0(jsxRuntimeExports.jsx("div",{style:{textAlign:"center"},children:Yt}),"plug"),sleep(2e3)}).then(()=>Kt(!0));const r0=qt.current;return()=>{var Yt;return(Yt=r0==null?void 0:r0.mediaStreamTrack)==null?void 0:Yt.stop()}},[]);const t0=async()=>{const r0=qt.current.getCanvas(),Mt=r0.getResizedCanvas(qt.current.video.clientWidth,qt.current.video.clientHeight).getBase64Image(),Jt=r0.getBase64Image(),{blob:a0}=r0.getBlobData(),i0=r0.getImageData();return{imageBase64:Mt,fullImage:a0,imageData:i0,fullImageBase64:Jt}},l0=async(r0=Lt)=>(s0(),Qt(!1),Tt(!0),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadProgress,token:vt,shouldOpen:!0}),addAddressStatement({token:vt,image:r0.fullImageBase64,onProgress:wt,docType:yt}).then(async Yt=>{const{success:Mt,status:Jt}=Yt;if(Mt||["ADD_NEXT_PAGE","SUCCESS"].includes(Jt))addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadProgress,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadSuccess,token:vt,shouldOpen:!0}),wt(100),Dt(!0),Nt(!0),await sleep(1500),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadSuccess,token:vt,shouldOpen:!1}),ft(getLogObject("successCapture",{message:"Document captured successfully"})),Jt==="ADD_NEXT_PAGE"?(d0(),Gt(V5C_STEPS.secondPage)):Be({images:r0});else{const a0=bt("notifications.badProofOfAddress");addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadProgress,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentAttemptFailed,token:vt,shouldOpen:!0}),Vt.current+=1,ft(getLogObject("attemptFailed",{response:{success:Mt},message:a0,attempt:Vt.current})),Dt(!1),_t(a0),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentAttemptFailed,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentCameraCapture,token:vt,shouldOpen:!0})}}).catch(async Yt=>{const Mt=bt("notifications.badProofOfAddress");addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadProgress,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentAttemptFailed,token:vt,shouldOpen:!0}),Vt.current+=1,ft(getLogObject("attemptFailed",{response:{error:Yt},message:Yt.message,attempt:Vt.current})),Dt(!1),_t(Mt),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentAttemptFailed,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentCameraCapture,token:vt,shouldOpen:!0})}));function d0(){Qt(!1),Tt(!1),wt(0),Nt(!1),Dt(null),_t("")}function n0(){d0()}function g0(){d0(),At!==-1&&Vt.current>=At?(ft(getLogObject("noAttemps",{response:{success:!1},message:"No attempt left"})),gt("skip")):(multiPageDocumentTypes.includes(yt)&&Gt(V5C_STEPS.firstPage),d0())}const A0=r0=>{r0?n0():g0()},o0=async()=>{s0(),clearTimeout(zt.current);const r0=await t0();if(Wt(r0),Et)return l0(r0);Qt(!0)};if(jt)if(!kt)Gt(null);else return jsxRuntimeExports.jsx(V5CDocumentTutorial,{onNext:()=>Gt(null),v5cStep:jt,tutorialText:Ct,documentType:yt});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Webcam,{ref:qt,className:"IncodeCaptureDocumentWebcam",videoSource:"environment",permission:Le,setPermission:Ye,permissionMessage:tt,permissionBackgroundColor:nt,onLog:ft,dataURLtoBlob:"image/jpeg",onError:gt,token:vt.token,interviewId:ht.interviewId,documentType:yt}),!Et&&Xt&&Lt&&jsxRuntimeExports.jsx(Retake,{imageBase64:toImage$1(Lt.fullImageBase64),onClose:d0,handleCapture:l0,token:vt,className:"IncodeCaptureDocumentRetake",type:"document"}),Rt&&Lt&&jsxRuntimeExports.jsx(CapturePreview,{open:!0,progress:It,message:Ut,finishCapture:Pt,captureSuccessful:Bt,onClose:A0,imageBase64:toImage$1(Lt.fullImageBase64),resumeAutocapture:()=>Nt(!0),isSelfie:!1,isPoa:!0,className:"IncodeCaptureDocumentPreview",numberOfTries:At+1,timesCaptureFailed:Vt.current}),$t&&jsxRuntimeExports.jsx(FakeButton,{className:cx("IncodeCaptureDocumentFakeButton",{hidden:Rt||Xt}),children:jsxRuntimeExports.jsx("img",{tabIndex:-1,alt:"capture button",src:CaptureButton,className:"step__video-catch-event",onClick:o0,onKeyUp:o0})}),jsxRuntimeExports.jsx("canvas",{id:"canvasFrame",hidden:!0}),jsxRuntimeExports.jsx(Notification$1,{className:"IncodeCaptureDocumentNotification",inline:!1,center:!0})]})}function App(Be){var gt;useModuleEvents({module:eventModuleNames[Be.type],token:(gt=Be.token)==null?void 0:gt.token,payload:{moduleVersion:"1"}});const{nextStep:Le,currentStep:Ye}=useSteps(0),[tt,nt]=React.useState(null),ft=At=>{if(At.type==="passport")return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{...At});if(At.type===frontType)return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{...At});if(At.type===backType)return jsxRuntimeExports.jsx(CaptureAndTutorial,{...At});if(At.type===selfieType)return mobile.any()||isSurfaceTablet()?jsxRuntimeExports.jsx(CaptureAndTutorial$2,{...At}):jsxRuntimeExports.jsx(CaptureDesktopSelfie,{...At});if(At.type==="document"){const xt=At.nativeCamera?NativeCamera:CameraPaperStatement;return jsxRuntimeExports.jsx(xt,{...At})}if(At.type==="secondId")return jsxRuntimeExports.jsx(AdditionalId,{...At});if(At.type==="thirdId")return jsxRuntimeExports.jsx(AdditionalId,{...At});if(At.type==="creditCard")return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{...At});if(At.type==="creditCardBack")return jsxRuntimeExports.jsx(CaptureAndTutorial,{...At})},ht=At=>{nt(At),Le()};return jsxRuntimeExports.jsxs(Steps,{currentStep:Ye,children:[ft({...Be,goNextCameraStep:ht}),jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.token,onSuccess:()=>Be.onSuccess(tt),onCancel:()=>Be.onError({message:"Consent not given"}),regulationType:tt==null?void 0:tt.regulationType})]})}function renderCamera(Be,Le,{onSuccess:Ye=emptyFunc,onError:tt=emptyFunc,numberOfTries:nt=3,onLog:ft=emptyFunc,permissionMessage:ht,permissionBackgroundColor:gt,token:At,timeout:xt=4e4,sendBase64:Et=!0,documentType:yt,showPreview:Ct=!1,stream:kt,nativeCamera:vt=!1,hideRetake:bt=!1,showTutorial:It,showPaperDLTutorial:wt=!1,onlyCapture:Rt=!1,scanPdf417:Tt=!1,videoTutorialSrc:Bt,showCustomCameraPermissionScreen:Dt=!1,isSecondId:Pt=!1,fullScreen:Nt=!0,assistedOnboarding:Lt=!1,isRecordingEnabled:Wt=!1,onRestartOnboarding:$t=reload,showDoublePermissionsRequest:Kt=!1,onlyAllowCapture:Vt=!1,disableFullScreen:Ut=!1,onStreamReady:_t=emptyFunc,showAutoCaptureIDOverlay:Xt=!1,showManualCaptureIDOverlay:Qt=!1,skipProcessFace:jt=!1,defaultHorizontalMask:Gt=!1,isFixedMask:qt=!1,blurrinessStrictMode:zt=!1,isKiosk:e0=!1,ageAssurance:s0=!1,publishAudio:t0=!1,zoomLevel:l0,idDetectedTimeout:d0=6e4,flipVerticallyImage:n0=!1,disableZoomCheck:g0=!1,hatCheckEnabled:A0=!1,lensesCheckEnabled:o0=!1,maskCheckEnabled:r0=!1,eyesClosedCheckEnabled:Yt=!1,isDeepsightEnabled:Mt=!1,tutorialText:Jt={},allowSkipDocumentCapture:a0=!1}){const i0=At??state.token,f0=createRoot$1(Le),u0=typeof It>"u"?Be==="document":It,x0={onSuccess:handleUnmountRoot(Ye,f0,Le),onError:handleUnmountRoot(tt,f0,Le),onBoarding:this,numberOfTries:nt,onLog:ft,permissionMessage:ht,permissionBackgroundColor:gt,type:Be,token:i0,timeout:xt,sendBase64:Et,documentType:yt,showPreview:Ct,stream:kt,nativeCamera:vt,hideRetake:bt,showTutorial:u0,showPaperDLTutorial:wt,onlyCapture:Rt,scanPdf417:Tt,videoSrc:Bt,showCustomCameraPermissionScreen:Dt,isSecondId:Pt,fullScreen:Nt,assistedOnboarding:Lt,isRecordingEnabled:Wt,onRestartOnboarding:$t,showDoublePermissionsRequest:Kt,onlyAllowCapture:Vt,disableFullScreen:Ut,onStreamReady:_t,showAutoCaptureIDOverlay:Xt,showManualCaptureIDOverlay:Qt,skipProcessFace:jt,defaultHorizontalMask:Gt,isFixedMask:qt,blurrinessStrictMode:zt,isKiosk:e0,ageAssurance:s0,publishAudio:t0,zoomLevel:l0,idDetectedTimeout:d0,flipVerticallyImage:n0,disableZoomCheck:g0,hatCheckEnabled:A0,lensesCheckEnabled:o0,maskCheckEnabled:r0,eyesClosedCheckEnabled:Yt,isDeepsightEnabled:Mt,tutorialText:Jt,allowSkipDocumentCapture:a0};return customRender(jsxRuntimeExports.jsx(App$1,{disableFullScreen:Ut,isKiosk:e0,token:At==null?void 0:At.token,children:jsxRuntimeExports.jsx(App,{...x0})}),Le,f0),{close:handleUnmountRoot(emptyFunc,f0,Le)}}function renderCapture(Be,Le,Ye){return renderCamera.call(this,Be,Le,{...Ye,onlyCapture:!0})}const DocumentSelectorSteps={DocumentSelector:0,FrontID:1,BackID:2};function Front(Be){const{onSuccess:Le,onError:Ye,token:tt,...nt}=Be,ft=React.useRef();return React.useEffect(()=>{renderCamera(Be.type,ft.current,{onSuccess:Le,onError:Ye,numberOfTries:-1,showTutorial:!0,disableFullScreen:!1,token:tt,...nt})},[]),jsxRuntimeExports.jsx("div",{ref:ft})}function Back(Be){const{onSuccess:Le,onError:Ye,token:tt,...nt}=Be,ft=React.useRef();return React.useEffect(()=>{renderCamera("back",ft.current,{onSuccess:Le,onError:Ye,numberOfTries:-1,showTutorial:!0,disableFullScreen:!1,token:tt,...nt})},[]),jsxRuntimeExports.jsx("div",{ref:ft})}const DocumentSelectorOrchestrator=Be=>{const{setStep:Le,currentStep:Ye}=useSteps(()=>DocumentSelectorSteps.DocumentSelector),[tt,nt]=React.useState("front");return jsxRuntimeExports.jsxs(Steps,{currentStep:Ye,children:[jsxRuntimeExports.jsx(DocumentSelector,{...Be,goNext:ft=>{nt(ft),Le(DocumentSelectorSteps.FrontID)},session:Be.token}),jsxRuntimeExports.jsx(Front,{...Be,onSuccess:()=>tt==="passport"?Be.onSuccess():Le(DocumentSelectorSteps.BackID),type:tt}),jsxRuntimeExports.jsx(Back,{...Be})]})};function renderDocumentSelector(Be,{onSuccess:Le=emptyFunc,onError:Ye=emptyFunc,numberOfTries:tt=3,onLog:nt=emptyFunc,permissionMessage:ft,permissionBackgroundColor:ht,token:gt,timeout:At=4e4,sendBase64:xt=!0,documentType:Et,showPreview:yt=!1,stream:Ct,nativeCamera:kt=!1,hideRetake:vt=!1,showTutorial:bt=!1,showPaperDLTutorial:It=!1,onlyCapture:wt=!1,scanPdf417:Rt=!1,videoTutorialSrc:Tt,showCustomCameraPermissionScreen:Bt=!1,isSecondId:Dt=!1,fullScreen:Pt=!0,assistedOnboarding:Nt=!1,isRecordingEnabled:Lt=!1,onRestartOnboarding:Wt=reload,showDoublePermissionsRequest:$t=!1,onlyAllowCapture:Kt=!1,disableFullScreen:Vt=!1,onStreamReady:Ut=emptyFunc,showAutoCaptureIDOverlay:_t=!1,showManualCaptureIDOverlay:Xt=!1,skipProcessFace:Qt=!1,defaultHorizontalMask:jt=!1,isFixedMask:Gt=!1,blurrinessStrictMode:qt=!1}){const zt=gt??state.token;console.log("session",zt);const e0=createRoot$1(Be),s0={onSuccess:handleUnmountRoot(Le,e0,Be),onError:handleUnmountRoot(Ye,e0,Be),onBoarding:this,numberOfTries:tt,onLog:nt,permissionMessage:ft,permissionBackgroundColor:ht,token:zt,timeout:At,sendBase64:xt,documentType:Et,showPreview:yt,stream:Ct,nativeCamera:kt,hideRetake:vt,showTutorial:bt,showPaperDLTutorial:It,onlyCapture:wt,scanPdf417:Rt,videoSrc:Tt,showCustomCameraPermissionScreen:Bt,isSecondId:Dt,fullScreen:Pt,assistedOnboarding:Nt,isRecordingEnabled:Lt,onRestartOnboarding:Wt,showDoublePermissionsRequest:$t,onlyAllowCapture:Kt,disableFullScreen:Vt,onStreamReady:Ut,showAutoCaptureIDOverlay:_t,showManualCaptureIDOverlay:Xt,skipProcessFace:Qt,defaultHorizontalMask:jt,isFixedMask:Gt,blurrinessStrictMode:qt};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(DocumentSelectorOrchestrator,{...s0})}),Be,e0)}function renderTutorialDocument(Be,{onSuccess:Le}){const Ye=createRoot$1(Be),tt={onSuccess:handleUnmountRoot(Le,Ye,Be),onBoarding:this};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(TutorialDocument,{...tt})}),Be,Ye)}function renderEmail$1(Be,{onSuccess:Le,onError:Ye,session:tt,optinEnabled:nt,optinCompanyName:ft,otpVerification:ht,onLog:gt=emptyFunc}){const At=createRoot(Be),xt={onLog:gt,token:tt.token,onSuccess:handleUnmountRoot(Le,At,Be),onError:handleUnmountRoot(Ye,At,Be),optinEnabled:nt,optinCompanyName:ft,otpVerification:ht};At.render(jsxRuntimeExports.jsx(App$1,{token:tt.token,children:jsxRuntimeExports.jsx(EmailOrchestrator,{...xt})}))}function renderFaceMatch(Be,{token:Le,onSuccess:Ye,liveness:tt,existingUser:nt,isSecondId:ft}){const ht=createRoot$1(Be),gt={onSuccess:handleUnmountRoot(Ye,ht,Be),token:Le.token,liveness:tt,existingUser:nt,onBoarding:this,isSecondId:ft};customRender(jsxRuntimeExports.jsx(App$1,{token:Le.token,children:jsxRuntimeExports.jsx(FaceMatch$1,{...gt})}),Be,ht)}const isWebRtcNotSupported$1=!isWebRtcSupported();function renderFrontTutorial(Be,{onSuccess:Le,noWait:Ye,token:tt={},videoSrc:nt}){isWebRtcNotSupported$1&&Le();const ft=createRoot$1(Be),ht={onSuccess:handleUnmountRoot(Le,ft,Be),onBoarding:this,noWait:Ye,token:tt,videoSrc:nt};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(TutorialFront$1,{...ht})}),Be,ft)}function renderEmail(Be,{shouldAllowSkipButton:Le,onSuccess:Ye,session:tt}){const nt=createRoot(Be),ft={shouldAllowSkipButton:Le,token:tt.token,goNext:handleUnmountRoot(Ye,nt,Be)};nt.render(jsxRuntimeExports.jsx(App$1,{token:tt.token,children:jsxRuntimeExports.jsx(Geolocation$1,{...ft})}))}function renderPassportTutorial(Be,{onSuccess:Le,token:Ye={}}){const tt=createRoot$1(Be),nt={onSuccess:handleUnmountRoot(Le,tt,Be),onBoarding:this,token:Ye};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(TutorialPassport,{...nt})}),Be,tt)}function Qr({session:Be,onSuccess:Le,url:Ye,primaryColor:tt,secondaryColor:nt,sizePx:ft}){const{redirectUrl:ht}=useQR({url:Ye,onSuccess:Le,session:Be});if(ht)return jsxRuntimeExports.jsx(_default,{value:ht,bgColor:tt,fgColor:nt,size:ft,className:"IncodeRedirectQRCode"})}function renderQr(Be,{onSuccess:Le,session:Ye,url:tt,primaryColor:nt,secondaryColor:ft,sizePx:ht}){const gt=createRoot$1(Be),At={onSuccess:handleUnmountRoot(Le,gt,Be),onBoarding:this,session:Ye,url:tt,primaryColor:nt,secondaryColor:ft,sizePx:ht};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye.token,children:jsxRuntimeExports.jsx(Qr,{...At})}),Be,gt)}function renderRedirectToMobile(Be,{onSuccess:Le,session:Ye,flowId:tt,logoSrc:nt,url:ft,showSms:ht=!0,allowReEnrollment:gt=!0,assets:At,expired:xt,smsText:Et,skipDesktopRedirect:yt,allowSkipRedirect:Ct,externalId:kt,authHint:vt,qrPhishingResistance:bt,uiConfig:It}){const wt=createRoot$1(Be),Rt={onSuccess:handleUnmountRoot(Le,wt,Be),onBoarding:this,session:Ye,flowId:tt,logoSrc:nt,url:ft,showSms:ht,allowReEnrollment:gt,assets:At,expired:xt,smsText:Et,skipDesktopRedirect:yt,allowSkipRedirect:Ct,externalId:kt,authHint:vt,qrPhishingResistance:bt,uiConfig:It};return customRender(jsxRuntimeExports.jsx(App$1,{token:Ye.token,children:jsxRuntimeExports.jsx(Redirect,{...Rt})}),Be,wt),{close:handleUnmountRoot(emptyFunc,wt,Be)}}const isWebRtcNotSupported=!isWebRtcSupported();function renderSelfieTutorial(Be,{onSuccess:Le,noWait:Ye,token:tt={},videoSrc:nt,onError:ft}){isWebRtcNotSupported&&Le();const ht=createRoot$1(Be),gt={onSuccess:handleUnmountRoot(Le,ht,Be),onError:handleUnmountRoot(ft,ht,Be),onBoarding:this,noWait:Ye,token:tt,videoSrc:nt};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(TutorialSelfie,{...gt})}),Be,ht)}function renderWatchList(Be,Le,{token:Ye,onSuccess:tt}){const nt=createRoot$1(Be),ft={onSuccess:handleUnmountRoot(tt,nt,Be),onBoarding:this,token:Ye};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye.token,children:Le==="custom"?jsxRuntimeExports.jsx(CustomWatchList,{...ft}):jsxRuntimeExports.jsx(GlobalWatchList,{...ft})}),Be,nt)}function renderRetrySteps(Be,{token:Le,numberOfTries:Ye,showPassport:tt,showTutorials:nt,idTimeout:ft=40},{onSuccess:ht,onError:gt}){const At=createRoot$1(Be),xt={onSuccess:handleUnmountRoot(ht,At,Be),onError:handleUnmountRoot(gt,At,Be)};customRender(jsxRuntimeExports.jsx(App$1,{token:Le.token,children:jsxRuntimeExports.jsx(RetrySteps,{token:Le,onSuccess:xt.onSuccess,numberOfTries:Ye,onError:xt.onError,showPassport:tt,showTutorials:nt,idTimeout:ft})}),Be,At)}const getDeviceRiskModuleConfiguration=async Be=>exports.api.get("/omni/device-risk-client-id",{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(()=>({enabled:!1})),collectDeviceRiskResults=async Be=>exports.api.post("/omni/collect-device-risk-results",null,{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(()=>({})),shouldDoSardineContextFromSardine=Be=>Be===void 0?!1:typeof Be.SardineClientID=="string"&&typeof Be.SardineSessionKey=="string"&&typeof Be.SardineUserID=="string",loadSardineSDK=async Be=>{const Le=Be?"api.sandbox.sardine.ai":"api.sardine.ai",Ye=document.createElement("script");return Ye.type="text/javascript",Ye.async=!0,Ye.src=`https://${Le}/assets/loader.min.js`,new Promise(tt=>{Ye.onload=()=>tt();const nt=document.getElementsByTagName("script")[0];nt.parentNode.insertBefore(Ye,nt)})},createSardineContextFromSardine=({sardineClientId:Be,sardineSessionKey:Le,sardineUserId:Ye,isSandbox:tt,token:nt,interviewId:ft})=>window._Sardine.createContext({clientId:Be,sessionKey:ft,flow:`Landing page ${location.pathname}`,environment:tt?"sandbox":"production",parentElement:document.body,parentSessionKey:Le,userIdHash:Ye,onDeviceResponse(ht){addEvent({code:"externalRiskSDKInitialized",payload:{sardineData:{deviceId:ht.deviceId,uuid:ht.uuid},interviewId:ft,sardineClientId:Be,sardineSessionKey:Le,sardineUserId:Ye},token:nt})}}),createSardineContextIncode=({sardineClientId:Be,isSandbox:Le,token:Ye,interviewId:tt})=>window._Sardine.createContext({clientId:Be,sessionKey:tt,flow:`Landing page ${location.pathname}`,environment:"production",parentElement:document.body,userIdHash:tt,onDeviceResponse(nt){addEvent({code:"externalRiskSDKInitialized",payload:{sardineData:{deviceId:nt.deviceId,uuid:nt.uuid},interviewId:tt,sardineClientId:Be},token:Ye})}}),enableDeviceRiskModule=async({token:Be,isSandbox:Le=!0,interviewId:Ye})=>{const{customFields:tt}=await getCustomFields({token:Be}).catch(()=>({customFields:{SardineClientID:void 0,SardineSessionKey:void 0,SardineUserID:void 0}}));if(shouldDoSardineContextFromSardine(tt))return await loadSardineSDK(Le),createSardineContextFromSardine({sardineClientId:tt.SardineClientID,sardineSessionKey:tt.SardineSessionKey,sardineUserId:tt.SardineUserID,isSandbox:Le,token:Be,interviewId:Ye});const nt=await getDeviceRiskModuleConfiguration(Be);return nt.enabled&&nt.riskClientId?(await loadSardineSDK(!1),createSardineContextIncode({sardineClientId:nt.riskClientId,isSandbox:!1,token:Be,interviewId:Ye})):null};function sendEmail({status:Be,token:Le}){return exports.api.post("/omni/fanid/send-email",{status:Be},{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data).catch(Ye=>Promise.reject(Ye.response.data))}function setSessionStatus({token:Be,action:Le}){return exports.api.post(`/omni/session/status/set?action=${Le}`,{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data)}const DEBUG_BUILD$2=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,GLOBAL_OBJ=globalThis,SDK_VERSION="10.25.0";function getMainCarrier(){return getSentryCarrier(GLOBAL_OBJ),GLOBAL_OBJ}function getSentryCarrier(Be){const Le=Be.__SENTRY__=Be.__SENTRY__||{};return Le.version=Le.version||SDK_VERSION,Le[SDK_VERSION]=Le[SDK_VERSION]||{}}function getGlobalSingleton(Be,Le,Ye=GLOBAL_OBJ){const tt=Ye.__SENTRY__=Ye.__SENTRY__||{},nt=tt[SDK_VERSION]=tt[SDK_VERSION]||{};return nt[Be]||(nt[Be]=Le())}const CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],PREFIX="Sentry Logger ",originalConsoleMethods={};function consoleSandbox(Be){if(!("console"in GLOBAL_OBJ))return Be();const Le=GLOBAL_OBJ.console,Ye={},tt=Object.keys(originalConsoleMethods);tt.forEach(nt=>{const ft=originalConsoleMethods[nt];Ye[nt]=Le[nt],Le[nt]=ft});try{return Be()}finally{tt.forEach(nt=>{Le[nt]=Ye[nt]})}}function enable(){_getLoggerSettings().enabled=!0}function disable(){_getLoggerSettings().enabled=!1}function isEnabled(){return _getLoggerSettings().enabled}function log(...Be){_maybeLog("log",...Be)}function warn(...Be){_maybeLog("warn",...Be)}function error(...Be){_maybeLog("error",...Be)}function _maybeLog(Be,...Le){DEBUG_BUILD$2&&isEnabled()&&consoleSandbox(()=>{GLOBAL_OBJ.console[Be](`${PREFIX}[${Be}]:`,...Le)})}function _getLoggerSettings(){return DEBUG_BUILD$2?getGlobalSingleton("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const debug={enable,disable,isEnabled,log,warn,error},STACKTRACE_FRAME_LIMIT=50,UNKNOWN_FUNCTION="?",WEBPACK_ERROR_REGEXP=/\(error: (.*)\)/,STRIP_FRAME_REGEXP=/captureMessage|captureException/;function createStackParser(...Be){const Le=Be.sort((Ye,tt)=>Ye[0]-tt[0]).map(Ye=>Ye[1]);return(Ye,tt=0,nt=0)=>{const ft=[],ht=Ye.split(`
10264
+ ${bt("notifications.showUtilityBill.three")}`;return e0(jsxRuntimeExports.jsx("div",{style:{textAlign:"center"},children:Yt}),"plug"),sleep(2e3)}).then(()=>Kt(!0));const r0=qt.current;return()=>{var Yt;return(Yt=r0==null?void 0:r0.mediaStreamTrack)==null?void 0:Yt.stop()}},[]);const t0=async()=>{const r0=qt.current.getCanvas(),Mt=r0.getResizedCanvas(qt.current.video.clientWidth,qt.current.video.clientHeight).getBase64Image(),Jt=r0.getBase64Image(),{blob:a0}=r0.getBlobData(),i0=r0.getImageData();return{imageBase64:Mt,fullImage:a0,imageData:i0,fullImageBase64:Jt}},l0=async(r0=Lt)=>(s0(),Qt(!1),Tt(!0),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadProgress,token:vt,shouldOpen:!0}),addAddressStatement({token:vt,image:r0.fullImageBase64,onProgress:wt,docType:yt}).then(async Yt=>{const{success:Mt,status:Jt}=Yt;if(Mt||["ADD_NEXT_PAGE","SUCCESS"].includes(Jt))addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadProgress,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadSuccess,token:vt,shouldOpen:!0}),wt(100),Dt(!0),Nt(!0),await sleep(1500),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadSuccess,token:vt,shouldOpen:!1}),ft(getLogObject("successCapture",{message:"Document captured successfully"})),Jt==="ADD_NEXT_PAGE"?(d0(),Gt(V5C_STEPS.secondPage)):Be({images:r0});else{const a0=bt("notifications.badProofOfAddress");addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadProgress,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentAttemptFailed,token:vt,shouldOpen:!0}),Vt.current+=1,ft(getLogObject("attemptFailed",{response:{success:Mt},message:a0,attempt:Vt.current})),Dt(!1),_t(a0),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentAttemptFailed,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentCameraCapture,token:vt,shouldOpen:!0})}}).catch(async Yt=>{const Mt=bt("notifications.badProofOfAddress");addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentUploadProgress,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentAttemptFailed,token:vt,shouldOpen:!0}),Vt.current+=1,ft(getLogObject("attemptFailed",{response:{error:Yt},message:Yt.message,attempt:Vt.current})),Dt(!1),_t(Mt),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentAttemptFailed,token:vt,shouldOpen:!1}),addScreenEvent({module:eventModuleNames.document,screen:eventScreenNames.documentCameraCapture,token:vt,shouldOpen:!0})}));function d0(){Qt(!1),Tt(!1),wt(0),Nt(!1),Dt(null),_t("")}function n0(){d0()}function g0(){d0(),At!==-1&&Vt.current>=At?(ft(getLogObject("noAttemps",{response:{success:!1},message:"No attempt left"})),gt("skip")):(multiPageDocumentTypes.includes(yt)&&Gt(V5C_STEPS.firstPage),d0())}const A0=r0=>{r0?n0():g0()},o0=async()=>{s0(),clearTimeout(zt.current);const r0=await t0();if(Wt(r0),Et)return l0(r0);Qt(!0)};if(jt)if(!kt)Gt(null);else return jsxRuntimeExports.jsx(V5CDocumentTutorial,{onNext:()=>Gt(null),v5cStep:jt,tutorialText:Ct,documentType:yt});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Webcam,{ref:qt,className:"IncodeCaptureDocumentWebcam",videoSource:"environment",permission:Le,setPermission:Ye,permissionMessage:tt,permissionBackgroundColor:nt,onLog:ft,dataURLtoBlob:"image/jpeg",onError:gt,token:vt.token,interviewId:ht.interviewId,documentType:yt}),!Et&&Xt&&Lt&&jsxRuntimeExports.jsx(Retake,{imageBase64:toImage$1(Lt.fullImageBase64),onClose:d0,handleCapture:l0,token:vt,className:"IncodeCaptureDocumentRetake",type:"document"}),Rt&&Lt&&jsxRuntimeExports.jsx(CapturePreview,{open:!0,progress:It,message:Ut,finishCapture:Pt,captureSuccessful:Bt,onClose:A0,imageBase64:toImage$1(Lt.fullImageBase64),resumeAutocapture:()=>Nt(!0),isSelfie:!1,isPoa:!0,className:"IncodeCaptureDocumentPreview",numberOfTries:At+1,timesCaptureFailed:Vt.current}),$t&&jsxRuntimeExports.jsx(FakeButton,{className:cx("IncodeCaptureDocumentFakeButton",{hidden:Rt||Xt}),children:jsxRuntimeExports.jsx("img",{tabIndex:-1,alt:"capture button",src:CaptureButton,className:"step__video-catch-event",onClick:o0,onKeyUp:o0})}),jsxRuntimeExports.jsx("canvas",{id:"canvasFrame",hidden:!0}),jsxRuntimeExports.jsx(Notification$1,{className:"IncodeCaptureDocumentNotification",inline:!1,center:!0})]})}function App(Be){var gt;useModuleEvents({module:eventModuleNames[Be.type],token:(gt=Be.token)==null?void 0:gt.token,payload:{moduleVersion:"1"}});const{nextStep:Le,currentStep:Ye}=useSteps(0),[tt,nt]=React.useState(null),ft=At=>{if(At.type==="passport")return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{...At});if(At.type===frontType)return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{...At});if(At.type===backType)return jsxRuntimeExports.jsx(CaptureAndTutorial,{...At});if(At.type===selfieType)return mobile.any()||isSurfaceTablet()?jsxRuntimeExports.jsx(CaptureAndTutorial$2,{...At}):jsxRuntimeExports.jsx(CaptureDesktopSelfie,{...At});if(At.type==="document"){const xt=At.nativeCamera?NativeCamera:CameraPaperStatement;return jsxRuntimeExports.jsx(xt,{...At})}if(At.type==="secondId")return jsxRuntimeExports.jsx(AdditionalId,{...At});if(At.type==="thirdId")return jsxRuntimeExports.jsx(AdditionalId,{...At});if(At.type==="creditCard")return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{...At});if(At.type==="creditCardBack")return jsxRuntimeExports.jsx(CaptureAndTutorial,{...At})},ht=At=>{nt(At),Le()};return jsxRuntimeExports.jsxs(Steps,{currentStep:Ye,children:[ft({...Be,goNextCameraStep:ht}),jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.token,onSuccess:()=>Be.onSuccess(tt),onCancel:()=>Be.onError({message:"Consent not given"}),regulationType:tt==null?void 0:tt.regulationType})]})}function renderCamera(Be,Le,{onSuccess:Ye=emptyFunc,onError:tt=emptyFunc,numberOfTries:nt=3,onLog:ft=emptyFunc,permissionMessage:ht,permissionBackgroundColor:gt,token:At,timeout:xt=4e4,sendBase64:Et=!0,documentType:yt,showPreview:Ct=!1,stream:kt,nativeCamera:vt=!1,hideRetake:bt=!1,showTutorial:It,showPaperDLTutorial:wt=!1,onlyCapture:Rt=!1,scanPdf417:Tt=!1,videoTutorialSrc:Bt,showCustomCameraPermissionScreen:Dt=!1,isSecondId:Pt=!1,fullScreen:Nt=!0,assistedOnboarding:Lt=!1,isRecordingEnabled:Wt=!1,onRestartOnboarding:$t=reload,showDoublePermissionsRequest:Kt=!1,onlyAllowCapture:Vt=!1,disableFullScreen:Ut=!1,onStreamReady:_t=emptyFunc,showAutoCaptureIDOverlay:Xt=!1,showManualCaptureIDOverlay:Qt=!1,skipProcessFace:jt=!1,defaultHorizontalMask:Gt=!1,isFixedMask:qt=!1,blurrinessStrictMode:zt=!1,isKiosk:e0=!1,ageAssurance:s0=!1,publishAudio:t0=!1,zoomLevel:l0,idDetectedTimeout:d0=6e4,flipVerticallyImage:n0=!1,disableZoomCheck:g0=!1,hatCheckEnabled:A0=!1,lensesCheckEnabled:o0=!1,maskCheckEnabled:r0=!1,eyesClosedCheckEnabled:Yt=!1,isDeepsightEnabled:Mt=!1,tutorialText:Jt={},allowSkipDocumentCapture:a0=!1}){const i0=At??state.token,f0=createRoot$1(Le),u0=typeof It>"u"?Be==="document":It,x0={onSuccess:handleUnmountRoot(Ye,f0,Le),onError:handleUnmountRoot(tt,f0,Le),onBoarding:this,numberOfTries:nt,onLog:ft,permissionMessage:ht,permissionBackgroundColor:gt,type:Be,token:i0,timeout:xt,sendBase64:Et,documentType:yt,showPreview:Ct,stream:kt,nativeCamera:vt,hideRetake:bt,showTutorial:u0,showPaperDLTutorial:wt,onlyCapture:Rt,scanPdf417:Tt,videoSrc:Bt,showCustomCameraPermissionScreen:Dt,isSecondId:Pt,fullScreen:Nt,assistedOnboarding:Lt,isRecordingEnabled:Wt,onRestartOnboarding:$t,showDoublePermissionsRequest:Kt,onlyAllowCapture:Vt,disableFullScreen:Ut,onStreamReady:_t,showAutoCaptureIDOverlay:Xt,showManualCaptureIDOverlay:Qt,skipProcessFace:jt,defaultHorizontalMask:Gt,isFixedMask:qt,blurrinessStrictMode:zt,isKiosk:e0,ageAssurance:s0,publishAudio:t0,zoomLevel:l0,idDetectedTimeout:d0,flipVerticallyImage:n0,disableZoomCheck:g0,hatCheckEnabled:A0,lensesCheckEnabled:o0,maskCheckEnabled:r0,eyesClosedCheckEnabled:Yt,isDeepsightEnabled:Mt,tutorialText:Jt,allowSkipDocumentCapture:a0};return customRender(jsxRuntimeExports.jsx(App$1,{disableFullScreen:Ut,isKiosk:e0,token:At==null?void 0:At.token,children:jsxRuntimeExports.jsx(App,{...x0})}),Le,f0),{close:handleUnmountRoot(emptyFunc,f0,Le)}}function renderCapture(Be,Le,Ye){return renderCamera.call(this,Be,Le,{...Ye,onlyCapture:!0})}const DocumentSelectorSteps={DocumentSelector:0,FrontID:1,BackID:2};function Front(Be){const{onSuccess:Le,onError:Ye,token:tt,...nt}=Be,ft=React.useRef();return React.useEffect(()=>{renderCamera(Be.type,ft.current,{onSuccess:Le,onError:Ye,numberOfTries:-1,showTutorial:!0,disableFullScreen:!1,token:tt,...nt})},[]),jsxRuntimeExports.jsx("div",{ref:ft})}function Back(Be){const{onSuccess:Le,onError:Ye,token:tt,...nt}=Be,ft=React.useRef();return React.useEffect(()=>{renderCamera("back",ft.current,{onSuccess:Le,onError:Ye,numberOfTries:-1,showTutorial:!0,disableFullScreen:!1,token:tt,...nt})},[]),jsxRuntimeExports.jsx("div",{ref:ft})}const DocumentSelectorOrchestrator=Be=>{const{setStep:Le,currentStep:Ye}=useSteps(()=>DocumentSelectorSteps.DocumentSelector),[tt,nt]=React.useState("front");return jsxRuntimeExports.jsxs(Steps,{currentStep:Ye,children:[jsxRuntimeExports.jsx(DocumentSelector,{...Be,goNext:ft=>{nt(ft),Le(DocumentSelectorSteps.FrontID)},session:Be.token}),jsxRuntimeExports.jsx(Front,{...Be,onSuccess:()=>tt==="passport"?Be.onSuccess():Le(DocumentSelectorSteps.BackID),type:tt}),jsxRuntimeExports.jsx(Back,{...Be})]})};function renderDocumentSelector(Be,{onSuccess:Le=emptyFunc,onError:Ye=emptyFunc,numberOfTries:tt=3,onLog:nt=emptyFunc,permissionMessage:ft,permissionBackgroundColor:ht,token:gt,timeout:At=4e4,sendBase64:xt=!0,documentType:Et,showPreview:yt=!1,stream:Ct,nativeCamera:kt=!1,hideRetake:vt=!1,showTutorial:bt=!1,showPaperDLTutorial:It=!1,onlyCapture:wt=!1,scanPdf417:Rt=!1,videoTutorialSrc:Tt,showCustomCameraPermissionScreen:Bt=!1,isSecondId:Dt=!1,fullScreen:Pt=!0,assistedOnboarding:Nt=!1,isRecordingEnabled:Lt=!1,onRestartOnboarding:Wt=reload,showDoublePermissionsRequest:$t=!1,onlyAllowCapture:Kt=!1,disableFullScreen:Vt=!1,onStreamReady:Ut=emptyFunc,showAutoCaptureIDOverlay:_t=!1,showManualCaptureIDOverlay:Xt=!1,skipProcessFace:Qt=!1,defaultHorizontalMask:jt=!1,isFixedMask:Gt=!1,blurrinessStrictMode:qt=!1}){const zt=gt??state.token;console.log("session",zt);const e0=createRoot$1(Be),s0={onSuccess:handleUnmountRoot(Le,e0,Be),onError:handleUnmountRoot(Ye,e0,Be),onBoarding:this,numberOfTries:tt,onLog:nt,permissionMessage:ft,permissionBackgroundColor:ht,token:zt,timeout:At,sendBase64:xt,documentType:Et,showPreview:yt,stream:Ct,nativeCamera:kt,hideRetake:vt,showTutorial:bt,showPaperDLTutorial:It,onlyCapture:wt,scanPdf417:Rt,videoSrc:Tt,showCustomCameraPermissionScreen:Bt,isSecondId:Dt,fullScreen:Pt,assistedOnboarding:Nt,isRecordingEnabled:Lt,onRestartOnboarding:Wt,showDoublePermissionsRequest:$t,onlyAllowCapture:Kt,disableFullScreen:Vt,onStreamReady:Ut,showAutoCaptureIDOverlay:_t,showManualCaptureIDOverlay:Xt,skipProcessFace:Qt,defaultHorizontalMask:jt,isFixedMask:Gt,blurrinessStrictMode:qt};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(DocumentSelectorOrchestrator,{...s0})}),Be,e0)}function renderTutorialDocument(Be,{onSuccess:Le}){const Ye=createRoot$1(Be),tt={onSuccess:handleUnmountRoot(Le,Ye,Be),onBoarding:this};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(TutorialDocument,{...tt})}),Be,Ye)}function renderEmail$1(Be,{onSuccess:Le,onError:Ye,session:tt,optinEnabled:nt,optinCompanyName:ft,otpVerification:ht,onLog:gt=emptyFunc}){const At=createRoot(Be),xt={onLog:gt,token:tt.token,onSuccess:handleUnmountRoot(Le,At,Be),onError:handleUnmountRoot(Ye,At,Be),optinEnabled:nt,optinCompanyName:ft,otpVerification:ht};At.render(jsxRuntimeExports.jsx(App$1,{token:tt.token,children:jsxRuntimeExports.jsx(EmailOrchestrator,{...xt})}))}function renderFaceMatch(Be,{token:Le,onSuccess:Ye,liveness:tt,existingUser:nt,isSecondId:ft}){const ht=createRoot$1(Be),gt={onSuccess:handleUnmountRoot(Ye,ht,Be),token:Le.token,liveness:tt,existingUser:nt,onBoarding:this,isSecondId:ft};customRender(jsxRuntimeExports.jsx(App$1,{token:Le.token,children:jsxRuntimeExports.jsx(FaceMatch$1,{...gt})}),Be,ht)}const isWebRtcNotSupported$1=!isWebRtcSupported();function renderFrontTutorial(Be,{onSuccess:Le,noWait:Ye,token:tt={},videoSrc:nt}){isWebRtcNotSupported$1&&Le();const ft=createRoot$1(Be),ht={onSuccess:handleUnmountRoot(Le,ft,Be),onBoarding:this,noWait:Ye,token:tt,videoSrc:nt};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(TutorialFront$1,{...ht})}),Be,ft)}function renderEmail(Be,{shouldAllowSkipButton:Le,onSuccess:Ye,session:tt}){const nt=createRoot(Be),ft={shouldAllowSkipButton:Le,token:tt.token,goNext:handleUnmountRoot(Ye,nt,Be)};nt.render(jsxRuntimeExports.jsx(App$1,{token:tt.token,children:jsxRuntimeExports.jsx(Geolocation$1,{...ft})}))}function renderPassportTutorial(Be,{onSuccess:Le,token:Ye={}}){const tt=createRoot$1(Be),nt={onSuccess:handleUnmountRoot(Le,tt,Be),onBoarding:this,token:Ye};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(TutorialPassport,{...nt})}),Be,tt)}function Qr({session:Be,onSuccess:Le,url:Ye,primaryColor:tt,secondaryColor:nt,sizePx:ft}){const{redirectUrl:ht}=useQR({url:Ye,onSuccess:Le,session:Be});if(ht)return jsxRuntimeExports.jsx(_default,{value:ht,bgColor:tt,fgColor:nt,size:ft,className:"IncodeRedirectQRCode"})}function renderQr(Be,{onSuccess:Le,session:Ye,url:tt,primaryColor:nt,secondaryColor:ft,sizePx:ht}){const gt=createRoot$1(Be),At={onSuccess:handleUnmountRoot(Le,gt,Be),onBoarding:this,session:Ye,url:tt,primaryColor:nt,secondaryColor:ft,sizePx:ht};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye.token,children:jsxRuntimeExports.jsx(Qr,{...At})}),Be,gt)}function renderRedirectToMobile(Be,{onSuccess:Le,session:Ye,flowId:tt,logoSrc:nt,url:ft,showSms:ht=!0,allowReEnrollment:gt=!0,assets:At,expired:xt,smsText:Et,skipDesktopRedirect:yt,allowSkipRedirect:Ct,externalId:kt,authHint:vt,qrPhishingResistance:bt,uiConfig:It}){const wt=createRoot$1(Be),Rt={onSuccess:handleUnmountRoot(Le,wt,Be),onBoarding:this,session:Ye,flowId:tt,logoSrc:nt,url:ft,showSms:ht,allowReEnrollment:gt,assets:At,expired:xt,smsText:Et,skipDesktopRedirect:yt,allowSkipRedirect:Ct,externalId:kt,authHint:vt,qrPhishingResistance:bt,uiConfig:It};return customRender(jsxRuntimeExports.jsx(App$1,{token:Ye.token,children:jsxRuntimeExports.jsx(Redirect,{...Rt})}),Be,wt),{close:handleUnmountRoot(emptyFunc,wt,Be)}}const isWebRtcNotSupported=!isWebRtcSupported();function renderSelfieTutorial(Be,{onSuccess:Le,noWait:Ye,token:tt={},videoSrc:nt,onError:ft}){isWebRtcNotSupported&&Le();const ht=createRoot$1(Be),gt={onSuccess:handleUnmountRoot(Le,ht,Be),onError:handleUnmountRoot(ft,ht,Be),onBoarding:this,noWait:Ye,token:tt,videoSrc:nt};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(TutorialSelfie,{...gt})}),Be,ht)}function renderWatchList(Be,Le,{token:Ye,onSuccess:tt}){const nt=createRoot$1(Be),ft={onSuccess:handleUnmountRoot(tt,nt,Be),onBoarding:this,token:Ye};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye.token,children:Le==="custom"?jsxRuntimeExports.jsx(CustomWatchList,{...ft}):jsxRuntimeExports.jsx(GlobalWatchList,{...ft})}),Be,nt)}function renderRetrySteps(Be,{token:Le,numberOfTries:Ye,showPassport:tt,showTutorials:nt,idTimeout:ft=40},{onSuccess:ht,onError:gt}){const At=createRoot$1(Be),xt={onSuccess:handleUnmountRoot(ht,At,Be),onError:handleUnmountRoot(gt,At,Be)};customRender(jsxRuntimeExports.jsx(App$1,{token:Le.token,children:jsxRuntimeExports.jsx(RetrySteps,{token:Le,onSuccess:xt.onSuccess,numberOfTries:Ye,onError:xt.onError,showPassport:tt,showTutorials:nt,idTimeout:ft})}),Be,At)}function sendEmail({status:Be,token:Le}){return exports.api.post("/omni/fanid/send-email",{status:Be},{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data).catch(Ye=>Promise.reject(Ye.response.data))}function setSessionStatus({token:Be,action:Le}){return exports.api.post(`/omni/session/status/set?action=${Le}`,{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data)}const DEBUG_BUILD$2=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,GLOBAL_OBJ=globalThis,SDK_VERSION="10.25.0";function getMainCarrier(){return getSentryCarrier(GLOBAL_OBJ),GLOBAL_OBJ}function getSentryCarrier(Be){const Le=Be.__SENTRY__=Be.__SENTRY__||{};return Le.version=Le.version||SDK_VERSION,Le[SDK_VERSION]=Le[SDK_VERSION]||{}}function getGlobalSingleton(Be,Le,Ye=GLOBAL_OBJ){const tt=Ye.__SENTRY__=Ye.__SENTRY__||{},nt=tt[SDK_VERSION]=tt[SDK_VERSION]||{};return nt[Be]||(nt[Be]=Le())}const CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],PREFIX="Sentry Logger ",originalConsoleMethods={};function consoleSandbox(Be){if(!("console"in GLOBAL_OBJ))return Be();const Le=GLOBAL_OBJ.console,Ye={},tt=Object.keys(originalConsoleMethods);tt.forEach(nt=>{const ft=originalConsoleMethods[nt];Ye[nt]=Le[nt],Le[nt]=ft});try{return Be()}finally{tt.forEach(nt=>{Le[nt]=Ye[nt]})}}function enable(){_getLoggerSettings().enabled=!0}function disable(){_getLoggerSettings().enabled=!1}function isEnabled(){return _getLoggerSettings().enabled}function log(...Be){_maybeLog("log",...Be)}function warn(...Be){_maybeLog("warn",...Be)}function error(...Be){_maybeLog("error",...Be)}function _maybeLog(Be,...Le){DEBUG_BUILD$2&&isEnabled()&&consoleSandbox(()=>{GLOBAL_OBJ.console[Be](`${PREFIX}[${Be}]:`,...Le)})}function _getLoggerSettings(){return DEBUG_BUILD$2?getGlobalSingleton("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const debug={enable,disable,isEnabled,log,warn,error},STACKTRACE_FRAME_LIMIT=50,UNKNOWN_FUNCTION="?",WEBPACK_ERROR_REGEXP=/\(error: (.*)\)/,STRIP_FRAME_REGEXP=/captureMessage|captureException/;function createStackParser(...Be){const Le=Be.sort((Ye,tt)=>Ye[0]-tt[0]).map(Ye=>Ye[1]);return(Ye,tt=0,nt=0)=>{const ft=[],ht=Ye.split(`
10265
10265
  `);for(let gt=tt;gt<ht.length;gt++){let At=ht[gt];At.length>1024&&(At=At.slice(0,1024));const xt=WEBPACK_ERROR_REGEXP.test(At)?At.replace(WEBPACK_ERROR_REGEXP,"$1"):At;if(!xt.match(/\S*Error: /)){for(const Et of Le){const yt=Et(xt);if(yt){ft.push(yt);break}}if(ft.length>=STACKTRACE_FRAME_LIMIT+nt)break}}return stripSentryFramesAndReverse(ft.slice(nt))}}function stackParserFromStackParserOptions(Be){return Array.isArray(Be)?createStackParser(...Be):Be}function stripSentryFramesAndReverse(Be){if(!Be.length)return[];const Le=Array.from(Be);return/sentryWrapped/.test(getLastStackFrame(Le).function||"")&&Le.pop(),Le.reverse(),STRIP_FRAME_REGEXP.test(getLastStackFrame(Le).function||"")&&(Le.pop(),STRIP_FRAME_REGEXP.test(getLastStackFrame(Le).function||"")&&Le.pop()),Le.slice(0,STACKTRACE_FRAME_LIMIT).map(Ye=>({...Ye,filename:Ye.filename||getLastStackFrame(Le).filename,function:Ye.function||UNKNOWN_FUNCTION}))}function getLastStackFrame(Be){return Be[Be.length-1]||{}}const defaultFunctionName="<anonymous>";function getFunctionName(Be){try{return!Be||typeof Be!="function"?defaultFunctionName:Be.name||defaultFunctionName}catch{return defaultFunctionName}}function getFramesFromEvent(Be){const Le=Be.exception;if(Le){const Ye=[];try{return Le.values.forEach(tt=>{tt.stacktrace.frames&&Ye.push(...tt.stacktrace.frames)}),Ye}catch{return}}}const handlers={},instrumented={};function addHandler(Be,Le){handlers[Be]=handlers[Be]||[],handlers[Be].push(Le)}function maybeInstrument(Be,Le){if(!instrumented[Be]){instrumented[Be]=!0;try{Le()}catch(Ye){DEBUG_BUILD$2&&debug.error(`Error while instrumenting ${Be}`,Ye)}}}function triggerHandlers(Be,Le){const Ye=Be&&handlers[Be];if(Ye)for(const tt of Ye)try{tt(Le)}catch(nt){DEBUG_BUILD$2&&debug.error(`Error while triggering instrumentation handler.
10266
10266
  Type: ${Be}
10267
10267
  Name: ${getFunctionName(tt)}