@incodetech/welcome 1.85.0-20251105124000.0 → 1.85.0-20251105220659.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 yt=Le.createShader(Le.FRAGMENT_SHADER);Le.shaderSource(yt,ft),Le.compileShader(yt),Le.attachShader(At,xt),Le.attachShader(At,yt),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 Ct="";const Et=new Uint8Array(Ye*tt*4);return Le.readPixels(0,0,Ye,tt,Le.RGBA,Le.UNSIGNED_BYTE,Et),Ct=JSON.stringify(Et).replace(/,?"[0-9]+":/g,""),document.body.removeChild(Be),sha256(Ct)}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)),yt=[],Ct=xt.length,Et=[],vt,kt,bt;for(;Be<Ct;)Et[Be>>2]|=(xt.charCodeAt(Be)&255)<<8*(3-Be++%4);for(Ct*=8,Et[Ct>>5]|=128<<24-Ct%32,Et[bt=Ct+64>>5|15]=Ct,Be=0;Be<bt;Be+=16){for(vt=At.slice(Le=0,8);Le<64;vt[4]+=kt)Le<16?yt[Le]=Et[Le+Be]:yt[Le]=(ft(kt=yt[Le-2],17)^ft(kt,19)^kt>>>10)+(yt[Le-7]|0)+(ft(kt=yt[Le-15],7)^ft(kt,18)^kt>>>3)+(yt[Le-16]|0),vt.unshift((kt=(vt.pop()+(ft(gt=vt[4],6)^ft(gt,11)^ft(gt,25))+((gt&vt[5]^~gt&vt[6])+Ye[Le])|0)+(yt[Le++]|0))+(ft(Ct=vt[0],2)^ft(Ct,13)^ft(Ct,22))+(Ct&vt[1]^vt[1]&vt[2]^vt[2]&Ct));for(Le=8;Le--;)At[Le]=vt[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(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(Be){return store2==null?void 0:store2.get(Be)}var store3;function getSchemaMessage(Be){return store3==null?void 0:store3.get(Be)}var store4;function getSpecificMessage(Be,Le){var Ye;return(Ye=store4==null?void 0:store4.get(Be))==null?void 0:Ye.get(Le)}function _stringify$3(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(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$3(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",yt=(nt==null?void 0:nt.message)??Be.message??getSpecificMessage(Be.reference,At.lang)??(xt?getSchemaMessage(At.lang):null)??tt.message??getGlobalMessage(At.lang);yt!==void 0&&(At.message=typeof yt=="function"?yt(At):yt),xt&&(Ye.typed=!1),Ye.issues?Ye.issues.push(At):Ye.issues=[At]}function _getStandardProps(Be){return{version:1,vendor:"valibot",validate(Le){return Be["~run"]({value:Le},getGlobalConfig())}}}function _isValidObjectKey(Be,Le){return Object.hasOwn(Be,Le)&&Le!=="__proto__"&&Le!=="prototype"&&Le!=="constructor"}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(Be,Le,Ye){return typeof Be.fallback=="function"?Be.fallback(Le,Ye):Be.fallback}function getDefault(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(this)},"~run"(Le,Ye){return typeof Le.value=="boolean"?Le.typed=!0:_addIssue(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(this)},"~run"(Ye,tt){return this.check(Ye.value)?Ye.typed=!0:_addIssue(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(this)},"~run"(Le,Ye){return typeof Le.value=="function"?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function literal(Be,Le){return{kind:"schema",type:"literal",reference:literal,expects:_stringify$3(Be),async:!1,literal:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return Ye.value===this.literal?Ye.typed=!0:_addIssue(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(this)},"~run"(Le,Ye){return Le.value===null?Le.typed=!0:_addIssue(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(this)},"~run"(Le,Ye){return typeof Le.value=="number"&&!isNaN(Le.value)?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function object(Be,Le){return{kind:"schema",type:"object",reference:object,expects:"Object",async:!1,entries:Be,message:Le,get"~standard"(){return _getStandardProps(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(gt),xt=gt["~run"]({value:At},tt);if(xt.issues){const yt={type:"object",origin:"value",input:nt,key:ht,value:At};for(const Ct of xt.issues)Ct.path?Ct.path.unshift(yt):Ct.path=[yt],(ft=Ye.issues)==null||ft.push(Ct);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(gt);else if(gt.type!=="exact_optional"&&gt.type!=="optional"&&gt.type!=="nullish"&&(_addIssue(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(this,"type",Ye,tt);return Ye}}}function optional(Be,Le){return{kind:"schema",type:"optional",reference:optional,expects:`(${Be.expects} | undefined)`,async:!1,wrapped:Be,default:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return Ye.value===void 0&&(this.default!==void 0&&(Ye.value=getDefault(this,Ye,tt)),Ye.value===void 0)?(Ye.typed=!0,Ye):this.wrapped["~run"](Ye,tt)}}}function record(Be,Le,Ye){return{kind:"schema",type:"record",reference:record,expects:"Object",async:!1,key:Be,value:Le,message:Ye,get"~standard"(){return _getStandardProps(this)},"~run"(tt,nt){var ht,gt;const ft=tt.value;if(ft&&typeof ft=="object"){tt.typed=!0,tt.value={};for(const At in ft)if(_isValidObjectKey(ft,At)){const xt=ft[At],yt=this.key["~run"]({value:At},nt);if(yt.issues){const Et={type:"object",origin:"key",input:ft,key:At,value:xt};for(const vt of yt.issues)vt.path=[Et],(ht=tt.issues)==null||ht.push(vt);if(tt.issues||(tt.issues=yt.issues),nt.abortEarly){tt.typed=!1;break}}const Ct=this.value["~run"]({value:xt},nt);if(Ct.issues){const Et={type:"object",origin:"value",input:ft,key:At,value:xt};for(const vt of Ct.issues)vt.path?vt.path.unshift(Et):vt.path=[Et],(gt=tt.issues)==null||gt.push(vt);if(tt.issues||(tt.issues=Ct.issues),nt.abortEarly){tt.typed=!1;break}}(!yt.typed||!Ct.typed)&&(tt.typed=!1),yt.typed&&(tt.value[yt.value]=Ct.value)}}else _addIssue(this,"type",tt,nt);return tt}}}function string$2(Be){return{kind:"schema",type:"string",reference:string$2,expects:"string",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="string"?Le.typed=!0:_addIssue(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(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(this,"type",Ye,tt,{issues:_subIssues(ft)}),Ye.typed=!0}else{if((ht==null?void 0:ht.length)===1)return ht[0];_addIssue(this,"type",Ye,tt,{issues:_subIssues(ht)})}return Ye}}}function parse$8(Be,Le,Ye){const tt=Be["~run"]({value:Le},getGlobalConfig(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__:Et}catch{return Et}};Be._getStatsigGlobal=ft;const ht=vt=>(0,Be._getStatsigGlobal)()[vt];Be._getStatsigGlobalFlag=ht;const gt=vt=>{const kt=(0,Be._getStatsigGlobal)();return vt?kt.instances&&kt.instances[vt]:(kt.instances&&Object.keys(kt.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."),kt.firstInstance)};Be._getInstance=gt;const At="__STATSIG__",xt=typeof window<"u"?window:{},yt=typeof commonjsGlobal<"u"?commonjsGlobal:{},Ct=typeof globalThis<"u"?globalThis:{},Et=(tt=(Ye=(Le=xt[At])!==null&&Le!==void 0?Le:yt[At])!==null&&Ye!==void 0?Ye:Ct[At])!==null&&tt!==void 0?tt:{instance:Be._getInstance};xt[At]=Et,yt[At]=Et,Ct[At]=Et}($_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,yt,Ct)=>{gt(xt,ft({success:yt,error:yt?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:Ct},tt,"overall"))},_markInitNetworkReqStart:(xt,yt)=>{gt(xt,ft(yt,Ye,"initialize","network_request"))},_markInitNetworkReqEnd:(xt,yt)=>{gt(xt,ft(yt,tt,"initialize","network_request"))},_markInitProcessStart:xt=>{gt(xt,ft({},Ye,"initialize","process"))},_markInitProcessEnd:(xt,yt)=>{gt(xt,ft(yt,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,yt,Ct,Et){var vt;return{success:(xt==null?void 0:xt.ok)===!0,statusCode:xt==null?void 0:xt.status,sdkRegion:(vt=xt==null?void 0:xt.headers)===null||vt===void 0?void 0:vt.get("x-statsig-region"),isDelta:Ct.includes('"is_delta":true')===!0?!0:void 0,attempt:yt,error:Be.Diagnostics._formatError(Et)}},_enqueueDiagnosticsEvent(xt,yt,Ct,Et){const vt=Be.Diagnostics._getMarkers(Ct);if(vt==null||vt.length<=0)return-1;const kt=vt[vt.length-1].timestamp-vt[0].timestamp;Be.Diagnostics._clearMarkers(Ct);const bt=ht(xt,{context:"initialize",markers:vt.slice(),statsigOptions:Et});return yt.enqueue(bt),kt}};function ft(xt,yt,Ct,Et){return Object.assign({key:Ct,action:yt,step:Et,timestamp:Date.now()},xt)}function ht(xt,yt){return{eventName:nt,user:xt,value:null,metadata:yt,time:Date.now()}}function gt(xt,yt){var Ct;const Et=(Ct=Le.get(xt))!==null&&Ct!==void 0?Ct:[];Et.push(yt),Le.set(xt,Et)}function At(xt,yt){if(yt in xt)return xt[yt]}})(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 yt=ft[xt];if(ht===0||(0,Le._typeOf)(yt)!=="object"){At[xt]=yt;return}At[xt]=(0,Be._getSortedObject)(yt,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 yt=(0,Be._getWindowSafe)();typeof(yt==null?void 0:yt.addEventListener)=="function"&&yt.addEventListener(At,xt)};Be._addWindowEventListenerSafe=nt;const ft=(At,xt)=>{const yt=(0,Be._getDocumentSafe)();typeof(yt==null?void 0:yt.addEventListener)=="function"&&yt.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,yt;const Ct=Le.__evaluation,Et=((nt=Ct==null?void 0:Ct.explicit_parameters)===null||nt===void 0?void 0:nt.includes(Ye))===!0;let vt="",kt=(ft=Ct==null?void 0:Ct.undelegated_secondary_exposures)!==null&&ft!==void 0?ft:[];Et&&(vt=(ht=Ct.allocated_experiment_name)!==null&&ht!==void 0?ht:"",kt=(gt=Ct.secondary_exposures)!==null&&gt!==void 0?gt:[]);const bt=(At=Le.__evaluation)===null||At===void 0?void 0:At.parameter_rule_ids,wt={config:Le.name,parameterName:Ye,ruleID:(xt=bt==null?void 0:bt[Ye])!==null&&xt!==void 0?xt:Le.ruleID,allocatedExperiment:vt,isExplicitParameter:String(Et)};return((yt=Le.__evaluation)===null||yt===void 0?void 0:yt.version)!=null&&(wt.configVersion=Le.__evaluation.version),_createExposure(LAYER_EXPOSURE_NAME,Be,Le.details,wt,_mapExposures(kt,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:Ct=>tt[Ct]?tt[Ct]:null,setItem:(Ct,Et)=>{tt[Ct]=Et},removeItem:Ct=>{delete tt[Ct]},getAllKeys:()=>Object.keys(tt)};let ft=null;try{const Ct=(0,Ye._getWindowSafe)();Ct&&Ct.localStorage&&typeof Ct.localStorage.getItem=="function"&&(ft={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:Et=>Ct.localStorage.getItem(Et),setItem:(Et,vt)=>Ct.localStorage.setItem(Et,vt),removeItem:Et=>Ct.localStorage.removeItem(Et),getAllKeys:()=>Object.keys(Ct.localStorage)})}catch{Le.Log.warn("Failed to setup localStorageProvider.")}let ht=ft??nt,gt=ht;function At(Ct){try{return Ct()}catch(Et){if(Et instanceof Error&&Et.name==="SecurityError")return Be.Storage._setProvider(nt),null;throw Et}}Be.Storage={isReady:()=>gt.isReady(),isReadyResolver:()=>gt.isReadyResolver(),getProviderName:()=>gt.getProviderName(),getItem:Ct=>At(()=>gt.getItem(Ct)),setItem:(Ct,Et)=>At(()=>gt.setItem(Ct,Et)),removeItem:Ct=>gt.removeItem(Ct),getAllKeys:()=>gt.getAllKeys(),_setProvider:Ct=>{ht=Ct,gt=Ct},_setDisabled:Ct=>{Ct?gt=nt:gt=ht}};function xt(Ct){const Et=Be.Storage.getItem(Ct);return JSON.parse(Et??"null")}Be._getObjectFromStorage=xt;function yt(Ct,Et){Be.Storage.setItem(Ct,JSON.stringify(Et))}Be._setObjectInStorage=yt})(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=Ct=>{nt.unshift(Ct)};Be._subscribeToVisiblityChanged=xt;const yt=Ct=>{Ct!==ft&&(ft=Ct,nt.forEach(Et=>Et(Ct)))};Be._notifyVisibilityChanged=yt,(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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(),yt=StableID_1$2.StableID.get(xt);let Ct=null;if((At==null?void 0:At.has_updates)===!0)Ct=_makeDataAdapterResult("Network",gt,yt,Ye);else if(ft&&(At==null?void 0:At.has_updates)===!1)Ct=_makeDataAdapterResult("NetworkNotModified",ft,yt,Ye);else return null;const Et=this._getCacheKey(Ye);return this._inMemoryCache.add(Et,Ct,this._cacheLimit),this._writeToCache(Et,Ct),Ct})}_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(Ct,Et,vt,kt){function bt(wt){return wt instanceof vt?wt:new vt(function(It){It(wt)})}return new(vt||(vt=Promise))(function(wt,It){function Rt(Pt){try{Bt(kt.next(Pt))}catch(Dt){It(Dt)}}function Tt(Pt){try{Bt(kt.throw(Pt))}catch(Dt){It(Dt)}}function Bt(Pt){Pt.done?wt(Pt.value):bt(Pt.value).then(Rt,Tt)}Bt((kt=kt.apply(Ct,Et||[])).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(Et,vt,kt,bt){this._sdkKey=Et,this._options=vt,this._emitter=kt,this._lastSeenError=bt,this._seen=new Set}wrap(Et,vt){try{const kt=Et;xt(kt).forEach(bt=>{const wt=kt[bt];"$EB"in wt||(kt[bt]=(...It)=>this._capture(vt?`${vt}:${bt}`:bt,()=>wt.apply(Et,It)),kt[bt].$EB=!0)})}catch(kt){this._onError("eb:wrap",kt)}}logError(Et,vt){this._onError(Et,vt)}getLastSeenErrorAndReset(){const Et=this._lastSeenError;return this._lastSeenError=void 0,Et??null}attachErrorIfNoneExists(Et){this._lastSeenError||(this._lastSeenError=gt(Et))}_capture(Et,vt){try{const kt=vt();return kt&&kt instanceof Promise?kt.catch(bt=>this._onError(Et,bt)):kt}catch(kt){return this._onError(Et,kt),null}}_onError(Et,vt){try{Ye.Log.warn(`Caught error in ${Et}`,{error:vt}),Le(this,void 0,void 0,function*(){var bt,wt,It,Rt,Tt,Bt,Pt;const Dt=vt||Error(ft),Ot=Dt instanceof Error,Lt=Ot?Dt.name:"No Name",Wt=gt(Dt);if(this._lastSeenError=Wt,this._seen.has(Lt))return;if(this._seen.add(Lt),!((wt=(bt=this._options)===null||bt===void 0?void 0:bt.networkConfig)===null||wt===void 0)&&wt.preventAllNetworkTraffic){(It=this._emitter)===null||It===void 0||It.call(this,{name:"error",error:vt,tag:Et});return}const $t=tt.SDKType._get(this._sdkKey),qt=nt.StatsigMetadataProvider.get(),Ht=Ot?Dt.stack:At(Dt),Ut=Object.assign({tag:Et,exception:Lt,info:Ht,statsigOptions:yt(this._options)},Object.assign(Object.assign({},qt),{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(qt.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(Ut)}),(Pt=this._emitter)===null||Pt===void 0||Pt.call(this,{name:"error",error:vt,tag:Et})}).then(()=>{}).catch(()=>{})}catch{}}}Be.ErrorBoundary=ht;function gt(Ct){return Ct instanceof Error?Ct:typeof Ct=="string"?new Error(Ct):new Error("An unknown error occurred.")}function At(Ct){try{return JSON.stringify(Ct)}catch{return ft}}function xt(Ct){const Et=new Set;let vt=Object.getPrototypeOf(Ct);for(;vt&&vt!==Object.prototype;)Object.getOwnPropertyNames(vt).filter(kt=>typeof(vt==null?void 0:vt[kt])=="function").forEach(kt=>Et.add(kt)),vt=Object.getPrototypeOf(vt);return Array.from(Et)}function yt(Ct){if(!Ct)return{};const Et={};return Object.keys(Ct).forEach(vt=>{const kt=vt,bt=Ct[kt];switch(typeof bt){case"number":case"bigint":case"boolean":Et[String(kt)]=bt;break;case"string":bt.length<50?Et[String(kt)]=bt:Et[String(kt)]="set";break;case"object":kt==="environment"?Et.environment=bt:kt==="networkConfig"?Et.networkConfig=bt:Et[String(kt)]=bt!=null?"set":"unset";break}}),Et}}(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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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 yt=(ht=(ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[At])===null||ht===void 0?void 0:ht.url;yt!=null&&gt.previous.push(yt),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 Ct(Tt)},overrideInitialSessionID:(Rt,Tt)=>{At[Tt]=yt(Rt,Tt)}};function xt(Rt){let Tt=It(Rt);const Bt=Date.now();return Tt||(Tt={sessionID:(0,ft.getUUID)(),startTime:Bt,lastUpdate:Bt}),{data:Tt,sdkKey:Rt}}function yt(Rt,Tt){const Bt=Date.now();return{data:{sessionID:Rt,startTime:Bt,lastUpdate:Bt},sdkKey:Tt}}function Ct(Rt){const Tt=Date.now(),Bt=Rt.data,Pt=Rt.sdkKey;if(vt(Bt)||kt(Bt)){Bt.sessionID=(0,ft.getUUID)(),Bt.startTime=Tt;const Ot=__STATSIG__==null?void 0:__STATSIG__.instance(Pt);Ot&&Ot.$emt({name:"session_expired"})}Bt.lastUpdate=Tt,wt(Bt,Rt.sdkKey),clearTimeout(Rt.idleTimeoutID),clearTimeout(Rt.ageTimeoutID);const Dt=Tt-Bt.startTime;return Rt.idleTimeoutID=Et(Pt,ht),Rt.ageTimeoutID=Et(Pt,gt-Dt),Rt}function Et(Rt,Tt){return setTimeout(()=>{var Bt;const Pt=(Bt=(0,Le._getStatsigGlobal)())===null||Bt===void 0?void 0:Bt.instance(Rt);Pt&&Pt.$emt({name:"session_expired"})},Tt)}function vt({lastUpdate:Rt}){return Date.now()-Rt>ht}function kt({startTime:Rt}){return Date.now()-Rt>gt}function bt(Rt){return`statsig.session_id.${(0,Ye._getStorageKey)(Rt)}`}function wt(Rt,Tt){const Bt=bt(Tt);try{(0,nt._setObjectInStorage)(Bt,Rt)}catch{tt.Log.warn("Failed to save SessionID")}}function It(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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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,yt=Le.urlConfig.endpoint;if(this._isRateLimited(yt))return Log_1$2.Log.warn(`Request to ${yt} was blocked because you are making requests too frequently.`),null;const Ct=xt??1;let Et=!1;const vt=this._getPopulatedURL(Le);let kt=null;const bt=(0,VisibilityObserving_1._isUnloading)();try{const wt={method:ht,body:gt,headers:Object.assign({},Le.headers),priority:Le.priority,keepalive:bt};_tryMarkInitStart(Le,Ct);const It=this._leakyBucket[yt];It&&(It.lastRequestTime=Date.now(),this._leakyBucket[yt]=It);const Rt=(Ye=this._netConfig.networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch;let Tt;if(kt=yield Promise.race([Rt(vt,wt).finally(()=>clearTimeout(Tt)),new Promise((Pt,Dt)=>{Tt=setTimeout(()=>{Et=!0,Dt(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!kt.ok){const Pt=yield kt.text().catch(()=>"No Text"),Dt=new Error(`NetworkError: ${vt} ${Pt}`);throw Dt.name="NetworkError",Dt}const Bt=yield kt.text();return _tryMarkInitEnd(Le,kt,Ct,Bt),this._fallbackResolver.tryBumpExpiryTime(Le.sdkKey,Le.urlConfig),{body:Bt,code:kt.status}}catch(wt){const It=_getErrorMessage(wt),Rt=_didTimeout(It??"",Et);if(_tryMarkInitEnd(Le,kt,Ct,"",wt),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(Le.sdkKey,Le.urlConfig,It,Rt))&&(Le.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(Le.sdkKey,Le.urlConfig)),!At||Ct>At||!RETRYABLE_CODES.has((tt=kt==null?void 0:kt.status)!==null&&tt!==void 0?tt:500)){(nt=this._emitter)===null||nt===void 0||nt.call(this,{name:"error",error:wt,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:Le});const Bt=`A networking error occurred during ${ht} request to ${vt}.`;return Log_1$2.Log.error(Bt,It,wt),(ft=this._errorBoundary)===null||ft===void 0||ft.attachErrorIfNoneExists(Bt),null}return yield _exponentialBackoff(Ct),this._sendRequest(Object.assign(Object.assign({},Le),{retries:At,attempt:Ct+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 yt=At.reduce((vt,kt)=>vt+kt.length,0),Ct=new Uint8Array(yt);let Et=0;for(const vt of At)Ct.set(vt,Et),Et+=vt.length;Le.body=Ct,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],yt=nt[xt];if(ht+=xt.length,typeof yt=="object"&&yt!==null?ht+=(0,Be._fastApproxSizeOf)(yt,ft)+Le:ht+=String(yt).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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(yt=>this._errorBoundary.logError("OA::loadFromStorage",yt)),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,yt,Ct,Et){Et===void 0&&(Et=Ct);var vt=Object.getOwnPropertyDescriptor(yt,Ct);(!vt||("get"in vt?!yt.__esModule:vt.writable||vt.configurable))&&(vt={enumerable:!0,get:function(){return yt[Ct]}}),Object.defineProperty(xt,Et,vt)}:function(xt,yt,Ct,Et){Et===void 0&&(Et=Ct),xt[Et]=yt[Ct]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(xt,yt){for(var Ct in xt)Ct!=="default"&&!Object.prototype.hasOwnProperty.call(yt,Ct)&&Le(yt,xt,Ct)};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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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,yt,Ct;const Et=Ye?(0,client_core_1$3._typedJsonParse)(Ye,"has_updates","InitializeResponse"):null;let vt={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(Et!=null&&Et.has_updates){const kt=(Et==null?void 0:Et.hash_used)!==((Ct=(yt=(xt=this._option)===null||xt===void 0?void 0:xt.networkConfig)===null||yt===void 0?void 0:yt.initializeHashAlgorithm)!==null&&Ct!==void 0?Ct:"djb2");vt=Object.assign(Object.assign({},vt),{sinceTime:ft&&!kt?Et.time:0,previousDerivedFields:"derived_fields"in Et&&ft?Et.derived_fields:{},deltasResponseRequested:!0,full_checksum:Et.full_checksum,partialUserMatchSinceTime:kt?0:Et.time})}return this._fetchEvaluations(Le,Et,vt,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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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 yt=(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),Ct=yt??xt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,Ct,this._store.getExposureMapping()),Ye),this.$emt({name:"experiment_evaluation",experiment:Ct}),Ct}_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 yt=(0,client_core_1._mergeOverride)(At,xt,(ft=xt==null?void 0:xt.__value)!==null&&ft!==void 0?ft:At.__value,Ct=>{Ye!=null&&Ye.disableExposureLog||this._enqueueExposure(Le,(0,client_core_1._createLayerParameterExposure)(this._user,yt,Ct,this._store.getExposureMapping()),Ye)});return this.$emt({name:"layer_evaluation",layer:yt}),yt}_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 yt=Object.getOwnPropertyDescriptor(gt,At);(!yt||("get"in yt?!gt.__esModule:yt.writable||yt.configurable))&&(yt={enumerable:!0,get:function(){return gt[At]}}),Object.defineProperty(ht,xt,yt)}: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","face_occlusion"],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","face_occlusion"];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,face_occlusion:!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:getFeatureFlag("face_occlusion"),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.26";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 yt=getProfile(xt);if(!yt)throw new Error(`Profile not found: ${xt}`);const Ct=yt.modelNames;let Et=[];for(const vt of Ct)Et.push(`${Ye}/${wasmVersion}/models/${vt}`);gt.set(yt.pipelineType,Et),At.set(yt.detectionType,yt)}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,yt,Ct,Et,vt,kt,bt,wt,It,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,yt,Ct,Et,vt,kt,bt,wt,It,Rt,Tt)}async setIdCaptureThresholds(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct){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,yt,Ct)}async setIdCaptureCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt){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,yt,Ct,Et,vt,kt)}async setIdCaptureGeometryParams(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt){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,yt,Ct,Et,vt)}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 yt of ht){if(!tt.has(yt)){let Et=await fetch(yt).then(vt=>vt.arrayBuffer()).then(vt=>new Uint8Array(vt));tt.set(yt,Et)}let Ct=tt.get(yt);xt.push_back(Ct.byteLength),At.push(Ct)}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(Le){return this.checkWasmInitialization("Unable to prc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.prc.bind(this.utilityApi),[Le])}async poc(Le){this.checkWasmInitialization("Unable to poc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.poc.bind(this.utilityApi),[Le])}async pc(Le){this.checkWasmInitialization("Unable to pc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.pc.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")}}IdCaptureModelTypeFromWasmEnum(Le){switch(Le){case this.wasmModule.IdCaptureModelType.IdCaptureV1x:return IdCaptureModelType.IdCaptureV1x;case this.wasmModule.IdCaptureModelType.IdCaptureV2x:return IdCaptureModelType.IdCaptureV2x;case this.wasmModule.IdCaptureModelType.IdCaptureV3x:return 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-20251105124000.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 yt=new URL(Be,location.href),{blockedURI:Ct}=xt;Ct!==yt.href&&Ct!==yt.protocol.slice(0,-1)&&Ct!==yt.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(yt=>{const Ct=new MessageChannel;Ct.port1.onmessage=()=>yt(),Ct.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(Ct){const Et=[...Ct];return{current:()=>Et[0],postpone(){const vt=Et.shift();vt!==void 0&&Et.push(vt)},exclude(){Et.shift()}}}(gt),xt=function(Ct,Et){let vt=0;return()=>Math.random()*Math.min(Et,Ct*Math.pow(2,vt++))}(100,3e3),yt=new Set;return[At.current(),(Ct,Et)=>{let vt;const kt=Et instanceof Error?Et.message:"";if(kt===c$3||kt===E$1)At.exclude(),vt=0;else if(kt===K)At.exclude();else if(kt===M$1){const wt=Date.now()-Ct.getTime()<50,It=At.current();It&&wt&&!yt.has(It)&&(yt.add(It),vt=0),At.postpone()}else At.postpone();const bt=At.current();return bt===void 0?void 0:[bt,vt??Ct.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=Ct=>Ye.push({url:gt,startedAt:At,finishedAt:new Date,error:Ct}),yt=Le(gt);return yt.then(()=>xt(),xt),yt.catch(Ct=>{if(ft!=null||(ft=Ct),Ye.length>=5)throw ft;const Et=nt(At,Ct);if(!Et)throw ft;const[vt,kt]=Et;return(bt=kt,new Promise(wt=>setTimeout(wt,bt))).then(()=>ht(vt));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(yt,Ct){const Et={},vt={};for(const[kt,bt]of Object.entries(yt))Ct.includes(kt)?Et[kt]=bt:vt[kt]=bt;return{picked:Et,rest:vt}}(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 yt=[],Ct=()=>{yt.push({time:new Date,state:document.visibilityState})},Et=function(vt,kt,bt,wt){return vt.addEventListener(kt,bt,wt),()=>vt.removeEventListener(kt,bt,wt)}(document,"visibilitychange",Ct);return Ct(),[yt,Et]}();return Promise.resolve().then(()=>{if(!ht||typeof ht!="string")throw new Error(v$d);const yt=function(Ct,Et){return(Array.isArray(Ct)?Ct:[Ct]).map(vt=>function(kt,bt){const wt=encodeURIComponent;return kt.replace(/<[^<>]+>/g,It=>It==="<version>"?"3":It==="<apiKey>"?wt(bt):It==="<loaderVersion>"?wt(b$2):It)}(String(vt),Et))}(gt,ht);return V(yt,F$1)}).catch(yt=>{throw xt(),function(Ct){return Ct instanceof Error&&Ct.message===K?new Error(M$1):Ct}(yt)}).then(([yt,Ct])=>(xt(),yt.load({...nt,ldi:{attempts:Ct,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(yt){ft(yt)}}function gt(xt){try{At(tt.throw(xt))}catch(yt){ft(yt)}}function At(xt){var yt;xt.done?nt(xt.value):(yt=xt.value,yt instanceof Ye?yt:new Ye(function(Ct){Ct(yt)})).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(yt){if(Ye)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,yt[0]&&(ht=0)),ht;)try{if(Ye=1,tt&&(nt=2&yt[0]?tt.return:yt[0]?tt.throw||((nt=tt.return)&&nt.call(tt),0):tt.next)&&!(nt=nt.call(tt,yt[1])).done)return nt;switch(tt=0,nt&&(yt=[2&yt[0],nt.value]),yt[0]){case 0:case 1:nt=yt;break;case 4:return ht.label++,{value:yt[1],done:!1};case 5:ht.label++,tt=yt[1],yt=[0];continue;case 7:yt=ht.ops.pop(),ht.trys.pop();continue;default:if(nt=ht.trys,!((nt=nt.length>0&&nt[nt.length-1])||yt[0]!==6&&yt[0]!==2)){ht=0;continue}if(yt[0]===3&&(!nt||yt[1]>nt[0]&&yt[1]<nt[3])){ht.label=yt[1];break}if(yt[0]===6&&ht.label<nt[1]){ht.label=nt[1],nt=yt;break}if(nt&&ht.label<nt[2]){ht.label=nt[2],ht.ops.push(yt);break}nt[2]&&ht.ops.pop(),ht.trys.pop();continue}yt=Le.call(Be,ht)}catch(Ct){yt=[6,Ct],tt=0}finally{Ye=nt=0}if(5&yt[0])throw yt[1];return{value:yt[0]?yt[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 yt=At.subarray(4*xt,4*(xt+1));yt[0]=Math.imul(yt[0],s$2[0]),yt[0]=l(yt[0],15),yt[0]=Math.imul(yt[0],s$2[1]),ht[0]=ht[0]^yt[0],ht[0]=l(ht[0],19),ht[0]=ht[0]+ht[1],ht[0]=Math.imul(ht[0],5)+1444728091,yt[1]=Math.imul(yt[1],s$2[1]),yt[1]=l(yt[1],16),yt[1]=Math.imul(yt[1],s$2[2]),ht[1]=ht[1]^yt[1],ht[1]=l(ht[1],17),ht[1]=ht[1]+ht[2],ht[1]=Math.imul(ht[1],5)+197830471,yt[2]=Math.imul(yt[2],s$2[2]),yt[2]=l(yt[2],17),yt[2]=Math.imul(yt[2],s$2[3]),ht[2]=ht[2]^yt[2],ht[2]=l(ht[2],15),ht[2]=ht[2]+ht[3],ht[2]=Math.imul(ht[2],5)+2530024501,yt[3]=Math.imul(yt[3],s$2[3]),yt[3]=l(yt[3],18),yt[3]=Math.imul(yt[3],s$2[0]),ht[3]=ht[3]^yt[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),yt=new Uint8Array(ft,16*gt,At);switch(At){case 15:xt[3]=xt[3]^yt[14]<<16;case 14:xt[3]=xt[3]^yt[13]<<8;case 13:xt[3]=xt[3]^yt[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]^yt[11]<<24;case 11:xt[2]=xt[2]^yt[10]<<16;case 10:xt[2]=xt[2]^yt[9]<<8;case 9:xt[2]=xt[2]^yt[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]^yt[7]<<24;case 7:xt[1]=xt[1]^yt[6]<<16;case 6:xt[1]=xt[1]^yt[5]<<8;case 5:xt[1]=xt[1]^yt[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]^yt[3]<<24;case 3:xt[0]=xt[0]^yt[2]<<16;case 2:xt[0]=xt[0]^yt[1]<<8;case 1:xt[0]=xt[0]^yt[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,yt){var Ct=tt+xt+".";if(typeof yt!="object"||Array.isArray(yt)){var Et=Le.some(function(bt){return Ct.startsWith(bt)}),vt=Ye.some(function(bt){return Ct.startsWith(bt)});Et&&!vt||(nt[xt]=yt)}else{var kt=p(yt,Le,Ye,Ct);Object.keys(kt).length>0&&(nt[xt]=kt)}},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 yt=String(xt);ht[yt]=(ht[yt]||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(Ct){return setTimeout(Ct,xt,yt)}))];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,yt})})})(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(yt){return L(ht,yt)}),At={},I.forEach(function(yt){var Ct=L(ht,yt);gt.includes(Ct)||(At[yt]=Ct)}),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 yt=Le.createShader(Le.FRAGMENT_SHADER);Le.shaderSource(yt,ft),Le.compileShader(yt),Le.attachShader(At,xt),Le.attachShader(At,yt),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 Ct="";const Et=new Uint8Array(Ye*tt*4);return Le.readPixels(0,0,Ye,tt,Le.RGBA,Le.UNSIGNED_BYTE,Et),Ct=JSON.stringify(Et).replace(/,?"[0-9]+":/g,""),document.body.removeChild(Be),sha256(Ct)}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)),yt=[],Ct=xt.length,Et=[],vt,kt,bt;for(;Be<Ct;)Et[Be>>2]|=(xt.charCodeAt(Be)&255)<<8*(3-Be++%4);for(Ct*=8,Et[Ct>>5]|=128<<24-Ct%32,Et[bt=Ct+64>>5|15]=Ct,Be=0;Be<bt;Be+=16){for(vt=At.slice(Le=0,8);Le<64;vt[4]+=kt)Le<16?yt[Le]=Et[Le+Be]:yt[Le]=(ft(kt=yt[Le-2],17)^ft(kt,19)^kt>>>10)+(yt[Le-7]|0)+(ft(kt=yt[Le-15],7)^ft(kt,18)^kt>>>3)+(yt[Le-16]|0),vt.unshift((kt=(vt.pop()+(ft(gt=vt[4],6)^ft(gt,11)^ft(gt,25))+((gt&vt[5]^~gt&vt[6])+Ye[Le])|0)+(yt[Le++]|0))+(ft(Ct=vt[0],2)^ft(Ct,13)^ft(Ct,22))+(Ct&vt[1]^vt[1]&vt[2]^vt[2]&Ct));for(Le=8;Le--;)At[Le]=vt[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(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(Be){return store2==null?void 0:store2.get(Be)}var store3;function getSchemaMessage(Be){return store3==null?void 0:store3.get(Be)}var store4;function getSpecificMessage(Be,Le){var Ye;return(Ye=store4==null?void 0:store4.get(Be))==null?void 0:Ye.get(Le)}function _stringify$3(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(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$3(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",yt=(nt==null?void 0:nt.message)??Be.message??getSpecificMessage(Be.reference,At.lang)??(xt?getSchemaMessage(At.lang):null)??tt.message??getGlobalMessage(At.lang);yt!==void 0&&(At.message=typeof yt=="function"?yt(At):yt),xt&&(Ye.typed=!1),Ye.issues?Ye.issues.push(At):Ye.issues=[At]}function _getStandardProps(Be){return{version:1,vendor:"valibot",validate(Le){return Be["~run"]({value:Le},getGlobalConfig())}}}function _isValidObjectKey(Be,Le){return Object.hasOwn(Be,Le)&&Le!=="__proto__"&&Le!=="prototype"&&Le!=="constructor"}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(Be,Le,Ye){return typeof Be.fallback=="function"?Be.fallback(Le,Ye):Be.fallback}function getDefault(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(this)},"~run"(Le,Ye){return typeof Le.value=="boolean"?Le.typed=!0:_addIssue(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(this)},"~run"(Ye,tt){return this.check(Ye.value)?Ye.typed=!0:_addIssue(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(this)},"~run"(Le,Ye){return typeof Le.value=="function"?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function literal(Be,Le){return{kind:"schema",type:"literal",reference:literal,expects:_stringify$3(Be),async:!1,literal:Be,message:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return Ye.value===this.literal?Ye.typed=!0:_addIssue(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(this)},"~run"(Le,Ye){return Le.value===null?Le.typed=!0:_addIssue(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(this)},"~run"(Le,Ye){return typeof Le.value=="number"&&!isNaN(Le.value)?Le.typed=!0:_addIssue(this,"type",Le,Ye),Le}}}function object(Be,Le){return{kind:"schema",type:"object",reference:object,expects:"Object",async:!1,entries:Be,message:Le,get"~standard"(){return _getStandardProps(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(gt),xt=gt["~run"]({value:At},tt);if(xt.issues){const yt={type:"object",origin:"value",input:nt,key:ht,value:At};for(const Ct of xt.issues)Ct.path?Ct.path.unshift(yt):Ct.path=[yt],(ft=Ye.issues)==null||ft.push(Ct);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(gt);else if(gt.type!=="exact_optional"&&gt.type!=="optional"&&gt.type!=="nullish"&&(_addIssue(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(this,"type",Ye,tt);return Ye}}}function optional(Be,Le){return{kind:"schema",type:"optional",reference:optional,expects:`(${Be.expects} | undefined)`,async:!1,wrapped:Be,default:Le,get"~standard"(){return _getStandardProps(this)},"~run"(Ye,tt){return Ye.value===void 0&&(this.default!==void 0&&(Ye.value=getDefault(this,Ye,tt)),Ye.value===void 0)?(Ye.typed=!0,Ye):this.wrapped["~run"](Ye,tt)}}}function record(Be,Le,Ye){return{kind:"schema",type:"record",reference:record,expects:"Object",async:!1,key:Be,value:Le,message:Ye,get"~standard"(){return _getStandardProps(this)},"~run"(tt,nt){var ht,gt;const ft=tt.value;if(ft&&typeof ft=="object"){tt.typed=!0,tt.value={};for(const At in ft)if(_isValidObjectKey(ft,At)){const xt=ft[At],yt=this.key["~run"]({value:At},nt);if(yt.issues){const Et={type:"object",origin:"key",input:ft,key:At,value:xt};for(const vt of yt.issues)vt.path=[Et],(ht=tt.issues)==null||ht.push(vt);if(tt.issues||(tt.issues=yt.issues),nt.abortEarly){tt.typed=!1;break}}const Ct=this.value["~run"]({value:xt},nt);if(Ct.issues){const Et={type:"object",origin:"value",input:ft,key:At,value:xt};for(const vt of Ct.issues)vt.path?vt.path.unshift(Et):vt.path=[Et],(gt=tt.issues)==null||gt.push(vt);if(tt.issues||(tt.issues=Ct.issues),nt.abortEarly){tt.typed=!1;break}}(!yt.typed||!Ct.typed)&&(tt.typed=!1),yt.typed&&(tt.value[yt.value]=Ct.value)}}else _addIssue(this,"type",tt,nt);return tt}}}function string$2(Be){return{kind:"schema",type:"string",reference:string$2,expects:"string",async:!1,message:Be,get"~standard"(){return _getStandardProps(this)},"~run"(Le,Ye){return typeof Le.value=="string"?Le.typed=!0:_addIssue(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(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(this,"type",Ye,tt,{issues:_subIssues(ft)}),Ye.typed=!0}else{if((ht==null?void 0:ht.length)===1)return ht[0];_addIssue(this,"type",Ye,tt,{issues:_subIssues(ht)})}return Ye}}}function parse$8(Be,Le,Ye){const tt=Be["~run"]({value:Le},getGlobalConfig(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__:Et}catch{return Et}};Be._getStatsigGlobal=ft;const ht=vt=>(0,Be._getStatsigGlobal)()[vt];Be._getStatsigGlobalFlag=ht;const gt=vt=>{const kt=(0,Be._getStatsigGlobal)();return vt?kt.instances&&kt.instances[vt]:(kt.instances&&Object.keys(kt.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."),kt.firstInstance)};Be._getInstance=gt;const At="__STATSIG__",xt=typeof window<"u"?window:{},yt=typeof commonjsGlobal<"u"?commonjsGlobal:{},Ct=typeof globalThis<"u"?globalThis:{},Et=(tt=(Ye=(Le=xt[At])!==null&&Le!==void 0?Le:yt[At])!==null&&Ye!==void 0?Ye:Ct[At])!==null&&tt!==void 0?tt:{instance:Be._getInstance};xt[At]=Et,yt[At]=Et,Ct[At]=Et}($_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,yt,Ct)=>{gt(xt,ft({success:yt,error:yt?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:Ct},tt,"overall"))},_markInitNetworkReqStart:(xt,yt)=>{gt(xt,ft(yt,Ye,"initialize","network_request"))},_markInitNetworkReqEnd:(xt,yt)=>{gt(xt,ft(yt,tt,"initialize","network_request"))},_markInitProcessStart:xt=>{gt(xt,ft({},Ye,"initialize","process"))},_markInitProcessEnd:(xt,yt)=>{gt(xt,ft(yt,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,yt,Ct,Et){var vt;return{success:(xt==null?void 0:xt.ok)===!0,statusCode:xt==null?void 0:xt.status,sdkRegion:(vt=xt==null?void 0:xt.headers)===null||vt===void 0?void 0:vt.get("x-statsig-region"),isDelta:Ct.includes('"is_delta":true')===!0?!0:void 0,attempt:yt,error:Be.Diagnostics._formatError(Et)}},_enqueueDiagnosticsEvent(xt,yt,Ct,Et){const vt=Be.Diagnostics._getMarkers(Ct);if(vt==null||vt.length<=0)return-1;const kt=vt[vt.length-1].timestamp-vt[0].timestamp;Be.Diagnostics._clearMarkers(Ct);const bt=ht(xt,{context:"initialize",markers:vt.slice(),statsigOptions:Et});return yt.enqueue(bt),kt}};function ft(xt,yt,Ct,Et){return Object.assign({key:Ct,action:yt,step:Et,timestamp:Date.now()},xt)}function ht(xt,yt){return{eventName:nt,user:xt,value:null,metadata:yt,time:Date.now()}}function gt(xt,yt){var Ct;const Et=(Ct=Le.get(xt))!==null&&Ct!==void 0?Ct:[];Et.push(yt),Le.set(xt,Et)}function At(xt,yt){if(yt in xt)return xt[yt]}})(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 yt=ft[xt];if(ht===0||(0,Le._typeOf)(yt)!=="object"){At[xt]=yt;return}At[xt]=(0,Be._getSortedObject)(yt,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 yt=(0,Be._getWindowSafe)();typeof(yt==null?void 0:yt.addEventListener)=="function"&&yt.addEventListener(At,xt)};Be._addWindowEventListenerSafe=nt;const ft=(At,xt)=>{const yt=(0,Be._getDocumentSafe)();typeof(yt==null?void 0:yt.addEventListener)=="function"&&yt.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,yt;const Ct=Le.__evaluation,Et=((nt=Ct==null?void 0:Ct.explicit_parameters)===null||nt===void 0?void 0:nt.includes(Ye))===!0;let vt="",kt=(ft=Ct==null?void 0:Ct.undelegated_secondary_exposures)!==null&&ft!==void 0?ft:[];Et&&(vt=(ht=Ct.allocated_experiment_name)!==null&&ht!==void 0?ht:"",kt=(gt=Ct.secondary_exposures)!==null&&gt!==void 0?gt:[]);const bt=(At=Le.__evaluation)===null||At===void 0?void 0:At.parameter_rule_ids,wt={config:Le.name,parameterName:Ye,ruleID:(xt=bt==null?void 0:bt[Ye])!==null&&xt!==void 0?xt:Le.ruleID,allocatedExperiment:vt,isExplicitParameter:String(Et)};return((yt=Le.__evaluation)===null||yt===void 0?void 0:yt.version)!=null&&(wt.configVersion=Le.__evaluation.version),_createExposure(LAYER_EXPOSURE_NAME,Be,Le.details,wt,_mapExposures(kt,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:Ct=>tt[Ct]?tt[Ct]:null,setItem:(Ct,Et)=>{tt[Ct]=Et},removeItem:Ct=>{delete tt[Ct]},getAllKeys:()=>Object.keys(tt)};let ft=null;try{const Ct=(0,Ye._getWindowSafe)();Ct&&Ct.localStorage&&typeof Ct.localStorage.getItem=="function"&&(ft={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:Et=>Ct.localStorage.getItem(Et),setItem:(Et,vt)=>Ct.localStorage.setItem(Et,vt),removeItem:Et=>Ct.localStorage.removeItem(Et),getAllKeys:()=>Object.keys(Ct.localStorage)})}catch{Le.Log.warn("Failed to setup localStorageProvider.")}let ht=ft??nt,gt=ht;function At(Ct){try{return Ct()}catch(Et){if(Et instanceof Error&&Et.name==="SecurityError")return Be.Storage._setProvider(nt),null;throw Et}}Be.Storage={isReady:()=>gt.isReady(),isReadyResolver:()=>gt.isReadyResolver(),getProviderName:()=>gt.getProviderName(),getItem:Ct=>At(()=>gt.getItem(Ct)),setItem:(Ct,Et)=>At(()=>gt.setItem(Ct,Et)),removeItem:Ct=>gt.removeItem(Ct),getAllKeys:()=>gt.getAllKeys(),_setProvider:Ct=>{ht=Ct,gt=Ct},_setDisabled:Ct=>{Ct?gt=nt:gt=ht}};function xt(Ct){const Et=Be.Storage.getItem(Ct);return JSON.parse(Et??"null")}Be._getObjectFromStorage=xt;function yt(Ct,Et){Be.Storage.setItem(Ct,JSON.stringify(Et))}Be._setObjectInStorage=yt})(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=Ct=>{nt.unshift(Ct)};Be._subscribeToVisiblityChanged=xt;const yt=Ct=>{Ct!==ft&&(ft=Ct,nt.forEach(Et=>Et(Ct)))};Be._notifyVisibilityChanged=yt,(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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(),yt=StableID_1$2.StableID.get(xt);let Ct=null;if((At==null?void 0:At.has_updates)===!0)Ct=_makeDataAdapterResult("Network",gt,yt,Ye);else if(ft&&(At==null?void 0:At.has_updates)===!1)Ct=_makeDataAdapterResult("NetworkNotModified",ft,yt,Ye);else return null;const Et=this._getCacheKey(Ye);return this._inMemoryCache.add(Et,Ct,this._cacheLimit),this._writeToCache(Et,Ct),Ct})}_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(Ct,Et,vt,kt){function bt(wt){return wt instanceof vt?wt:new vt(function(It){It(wt)})}return new(vt||(vt=Promise))(function(wt,It){function Rt(Pt){try{Bt(kt.next(Pt))}catch(Dt){It(Dt)}}function Tt(Pt){try{Bt(kt.throw(Pt))}catch(Dt){It(Dt)}}function Bt(Pt){Pt.done?wt(Pt.value):bt(Pt.value).then(Rt,Tt)}Bt((kt=kt.apply(Ct,Et||[])).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(Et,vt,kt,bt){this._sdkKey=Et,this._options=vt,this._emitter=kt,this._lastSeenError=bt,this._seen=new Set}wrap(Et,vt){try{const kt=Et;xt(kt).forEach(bt=>{const wt=kt[bt];"$EB"in wt||(kt[bt]=(...It)=>this._capture(vt?`${vt}:${bt}`:bt,()=>wt.apply(Et,It)),kt[bt].$EB=!0)})}catch(kt){this._onError("eb:wrap",kt)}}logError(Et,vt){this._onError(Et,vt)}getLastSeenErrorAndReset(){const Et=this._lastSeenError;return this._lastSeenError=void 0,Et??null}attachErrorIfNoneExists(Et){this._lastSeenError||(this._lastSeenError=gt(Et))}_capture(Et,vt){try{const kt=vt();return kt&&kt instanceof Promise?kt.catch(bt=>this._onError(Et,bt)):kt}catch(kt){return this._onError(Et,kt),null}}_onError(Et,vt){try{Ye.Log.warn(`Caught error in ${Et}`,{error:vt}),Le(this,void 0,void 0,function*(){var bt,wt,It,Rt,Tt,Bt,Pt;const Dt=vt||Error(ft),Ot=Dt instanceof Error,Lt=Ot?Dt.name:"No Name",Wt=gt(Dt);if(this._lastSeenError=Wt,this._seen.has(Lt))return;if(this._seen.add(Lt),!((wt=(bt=this._options)===null||bt===void 0?void 0:bt.networkConfig)===null||wt===void 0)&&wt.preventAllNetworkTraffic){(It=this._emitter)===null||It===void 0||It.call(this,{name:"error",error:vt,tag:Et});return}const $t=tt.SDKType._get(this._sdkKey),qt=nt.StatsigMetadataProvider.get(),Ht=Ot?Dt.stack:At(Dt),Ut=Object.assign({tag:Et,exception:Lt,info:Ht,statsigOptions:yt(this._options)},Object.assign(Object.assign({},qt),{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(qt.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(Ut)}),(Pt=this._emitter)===null||Pt===void 0||Pt.call(this,{name:"error",error:vt,tag:Et})}).then(()=>{}).catch(()=>{})}catch{}}}Be.ErrorBoundary=ht;function gt(Ct){return Ct instanceof Error?Ct:typeof Ct=="string"?new Error(Ct):new Error("An unknown error occurred.")}function At(Ct){try{return JSON.stringify(Ct)}catch{return ft}}function xt(Ct){const Et=new Set;let vt=Object.getPrototypeOf(Ct);for(;vt&&vt!==Object.prototype;)Object.getOwnPropertyNames(vt).filter(kt=>typeof(vt==null?void 0:vt[kt])=="function").forEach(kt=>Et.add(kt)),vt=Object.getPrototypeOf(vt);return Array.from(Et)}function yt(Ct){if(!Ct)return{};const Et={};return Object.keys(Ct).forEach(vt=>{const kt=vt,bt=Ct[kt];switch(typeof bt){case"number":case"bigint":case"boolean":Et[String(kt)]=bt;break;case"string":bt.length<50?Et[String(kt)]=bt:Et[String(kt)]="set";break;case"object":kt==="environment"?Et.environment=bt:kt==="networkConfig"?Et.networkConfig=bt:Et[String(kt)]=bt!=null?"set":"unset";break}}),Et}}(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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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 yt=(ht=(ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[At])===null||ht===void 0?void 0:ht.url;yt!=null&&gt.previous.push(yt),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 Ct(Tt)},overrideInitialSessionID:(Rt,Tt)=>{At[Tt]=yt(Rt,Tt)}};function xt(Rt){let Tt=It(Rt);const Bt=Date.now();return Tt||(Tt={sessionID:(0,ft.getUUID)(),startTime:Bt,lastUpdate:Bt}),{data:Tt,sdkKey:Rt}}function yt(Rt,Tt){const Bt=Date.now();return{data:{sessionID:Rt,startTime:Bt,lastUpdate:Bt},sdkKey:Tt}}function Ct(Rt){const Tt=Date.now(),Bt=Rt.data,Pt=Rt.sdkKey;if(vt(Bt)||kt(Bt)){Bt.sessionID=(0,ft.getUUID)(),Bt.startTime=Tt;const Ot=__STATSIG__==null?void 0:__STATSIG__.instance(Pt);Ot&&Ot.$emt({name:"session_expired"})}Bt.lastUpdate=Tt,wt(Bt,Rt.sdkKey),clearTimeout(Rt.idleTimeoutID),clearTimeout(Rt.ageTimeoutID);const Dt=Tt-Bt.startTime;return Rt.idleTimeoutID=Et(Pt,ht),Rt.ageTimeoutID=Et(Pt,gt-Dt),Rt}function Et(Rt,Tt){return setTimeout(()=>{var Bt;const Pt=(Bt=(0,Le._getStatsigGlobal)())===null||Bt===void 0?void 0:Bt.instance(Rt);Pt&&Pt.$emt({name:"session_expired"})},Tt)}function vt({lastUpdate:Rt}){return Date.now()-Rt>ht}function kt({startTime:Rt}){return Date.now()-Rt>gt}function bt(Rt){return`statsig.session_id.${(0,Ye._getStorageKey)(Rt)}`}function wt(Rt,Tt){const Bt=bt(Tt);try{(0,nt._setObjectInStorage)(Bt,Rt)}catch{tt.Log.warn("Failed to save SessionID")}}function It(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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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,yt=Le.urlConfig.endpoint;if(this._isRateLimited(yt))return Log_1$2.Log.warn(`Request to ${yt} was blocked because you are making requests too frequently.`),null;const Ct=xt??1;let Et=!1;const vt=this._getPopulatedURL(Le);let kt=null;const bt=(0,VisibilityObserving_1._isUnloading)();try{const wt={method:ht,body:gt,headers:Object.assign({},Le.headers),priority:Le.priority,keepalive:bt};_tryMarkInitStart(Le,Ct);const It=this._leakyBucket[yt];It&&(It.lastRequestTime=Date.now(),this._leakyBucket[yt]=It);const Rt=(Ye=this._netConfig.networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch;let Tt;if(kt=yield Promise.race([Rt(vt,wt).finally(()=>clearTimeout(Tt)),new Promise((Pt,Dt)=>{Tt=setTimeout(()=>{Et=!0,Dt(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!kt.ok){const Pt=yield kt.text().catch(()=>"No Text"),Dt=new Error(`NetworkError: ${vt} ${Pt}`);throw Dt.name="NetworkError",Dt}const Bt=yield kt.text();return _tryMarkInitEnd(Le,kt,Ct,Bt),this._fallbackResolver.tryBumpExpiryTime(Le.sdkKey,Le.urlConfig),{body:Bt,code:kt.status}}catch(wt){const It=_getErrorMessage(wt),Rt=_didTimeout(It??"",Et);if(_tryMarkInitEnd(Le,kt,Ct,"",wt),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(Le.sdkKey,Le.urlConfig,It,Rt))&&(Le.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(Le.sdkKey,Le.urlConfig)),!At||Ct>At||!RETRYABLE_CODES.has((tt=kt==null?void 0:kt.status)!==null&&tt!==void 0?tt:500)){(nt=this._emitter)===null||nt===void 0||nt.call(this,{name:"error",error:wt,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:Le});const Bt=`A networking error occurred during ${ht} request to ${vt}.`;return Log_1$2.Log.error(Bt,It,wt),(ft=this._errorBoundary)===null||ft===void 0||ft.attachErrorIfNoneExists(Bt),null}return yield _exponentialBackoff(Ct),this._sendRequest(Object.assign(Object.assign({},Le),{retries:At,attempt:Ct+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 yt=At.reduce((vt,kt)=>vt+kt.length,0),Ct=new Uint8Array(yt);let Et=0;for(const vt of At)Ct.set(vt,Et),Et+=vt.length;Le.body=Ct,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],yt=nt[xt];if(ht+=xt.length,typeof yt=="object"&&yt!==null?ht+=(0,Be._fastApproxSizeOf)(yt,ft)+Le:ht+=String(yt).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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(yt=>this._errorBoundary.logError("OA::loadFromStorage",yt)),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,yt,Ct,Et){Et===void 0&&(Et=Ct);var vt=Object.getOwnPropertyDescriptor(yt,Ct);(!vt||("get"in vt?!yt.__esModule:vt.writable||vt.configurable))&&(vt={enumerable:!0,get:function(){return yt[Ct]}}),Object.defineProperty(xt,Et,vt)}:function(xt,yt,Ct,Et){Et===void 0&&(Et=Ct),xt[Et]=yt[Ct]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(xt,yt){for(var Ct in xt)Ct!=="default"&&!Object.prototype.hasOwnProperty.call(yt,Ct)&&Le(yt,xt,Ct)};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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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,yt,Ct;const Et=Ye?(0,client_core_1$3._typedJsonParse)(Ye,"has_updates","InitializeResponse"):null;let vt={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(Et!=null&&Et.has_updates){const kt=(Et==null?void 0:Et.hash_used)!==((Ct=(yt=(xt=this._option)===null||xt===void 0?void 0:xt.networkConfig)===null||yt===void 0?void 0:yt.initializeHashAlgorithm)!==null&&Ct!==void 0?Ct:"djb2");vt=Object.assign(Object.assign({},vt),{sinceTime:ft&&!kt?Et.time:0,previousDerivedFields:"derived_fields"in Et&&ft?Et.derived_fields:{},deltasResponseRequested:!0,full_checksum:Et.full_checksum,partialUserMatchSinceTime:kt?0:Et.time})}return this._fetchEvaluations(Le,Et,vt,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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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(yt){try{xt(tt.next(yt))}catch(Ct){ht(Ct)}}function At(yt){try{xt(tt.throw(yt))}catch(Ct){ht(Ct)}}function xt(yt){yt.done?ft(yt.value):nt(yt.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 yt=(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),Ct=yt??xt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,Ct,this._store.getExposureMapping()),Ye),this.$emt({name:"experiment_evaluation",experiment:Ct}),Ct}_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 yt=(0,client_core_1._mergeOverride)(At,xt,(ft=xt==null?void 0:xt.__value)!==null&&ft!==void 0?ft:At.__value,Ct=>{Ye!=null&&Ye.disableExposureLog||this._enqueueExposure(Le,(0,client_core_1._createLayerParameterExposure)(this._user,yt,Ct,this._store.getExposureMapping()),Ye)});return this.$emt({name:"layer_evaluation",layer:yt}),yt}_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 yt=Object.getOwnPropertyDescriptor(gt,At);(!yt||("get"in yt?!gt.__esModule:yt.writable||yt.configurable))&&(yt={enumerable:!0,get:function(){return gt[At]}}),Object.defineProperty(ht,xt,yt)}: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","face_occlusion"],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","face_occlusion"];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,face_occlusion:!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:getFeatureFlag("face_occlusion"),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.26";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 yt=getProfile(xt);if(!yt)throw new Error(`Profile not found: ${xt}`);const Ct=yt.modelNames;let Et=[];for(const vt of Ct)Et.push(`${Ye}/${wasmVersion}/models/${vt}`);gt.set(yt.pipelineType,Et),At.set(yt.detectionType,yt)}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,yt,Ct,Et,vt,kt,bt,wt,It,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,yt,Ct,Et,vt,kt,bt,wt,It,Rt,Tt)}async setIdCaptureThresholds(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct){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,yt,Ct)}async setIdCaptureCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt){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,yt,Ct,Et,vt,kt)}async setIdCaptureGeometryParams(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt){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,yt,Ct,Et,vt)}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 yt of ht){if(!tt.has(yt)){let Et=await fetch(yt).then(vt=>vt.arrayBuffer()).then(vt=>new Uint8Array(vt));tt.set(yt,Et)}let Ct=tt.get(yt);xt.push_back(Ct.byteLength),At.push(Ct)}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(Le){return this.checkWasmInitialization("Unable to prc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.prc.bind(this.utilityApi),[Le])}async poc(Le){this.checkWasmInitialization("Unable to poc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.poc.bind(this.utilityApi),[Le])}async pc(Le){this.checkWasmInitialization("Unable to pc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.pc.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")}}IdCaptureModelTypeFromWasmEnum(Le){switch(Le){case this.wasmModule.IdCaptureModelType.IdCaptureV1x:return IdCaptureModelType.IdCaptureV1x;case this.wasmModule.IdCaptureModelType.IdCaptureV2x:return IdCaptureModelType.IdCaptureV2x;case this.wasmModule.IdCaptureModelType.IdCaptureV3x:return 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-20251105220659.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 yt=new URL(Be,location.href),{blockedURI:Ct}=xt;Ct!==yt.href&&Ct!==yt.protocol.slice(0,-1)&&Ct!==yt.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(yt=>{const Ct=new MessageChannel;Ct.port1.onmessage=()=>yt(),Ct.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(Ct){const Et=[...Ct];return{current:()=>Et[0],postpone(){const vt=Et.shift();vt!==void 0&&Et.push(vt)},exclude(){Et.shift()}}}(gt),xt=function(Ct,Et){let vt=0;return()=>Math.random()*Math.min(Et,Ct*Math.pow(2,vt++))}(100,3e3),yt=new Set;return[At.current(),(Ct,Et)=>{let vt;const kt=Et instanceof Error?Et.message:"";if(kt===c$3||kt===E$1)At.exclude(),vt=0;else if(kt===K)At.exclude();else if(kt===M$1){const wt=Date.now()-Ct.getTime()<50,It=At.current();It&&wt&&!yt.has(It)&&(yt.add(It),vt=0),At.postpone()}else At.postpone();const bt=At.current();return bt===void 0?void 0:[bt,vt??Ct.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=Ct=>Ye.push({url:gt,startedAt:At,finishedAt:new Date,error:Ct}),yt=Le(gt);return yt.then(()=>xt(),xt),yt.catch(Ct=>{if(ft!=null||(ft=Ct),Ye.length>=5)throw ft;const Et=nt(At,Ct);if(!Et)throw ft;const[vt,kt]=Et;return(bt=kt,new Promise(wt=>setTimeout(wt,bt))).then(()=>ht(vt));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(yt,Ct){const Et={},vt={};for(const[kt,bt]of Object.entries(yt))Ct.includes(kt)?Et[kt]=bt:vt[kt]=bt;return{picked:Et,rest:vt}}(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 yt=[],Ct=()=>{yt.push({time:new Date,state:document.visibilityState})},Et=function(vt,kt,bt,wt){return vt.addEventListener(kt,bt,wt),()=>vt.removeEventListener(kt,bt,wt)}(document,"visibilitychange",Ct);return Ct(),[yt,Et]}();return Promise.resolve().then(()=>{if(!ht||typeof ht!="string")throw new Error(v$d);const yt=function(Ct,Et){return(Array.isArray(Ct)?Ct:[Ct]).map(vt=>function(kt,bt){const wt=encodeURIComponent;return kt.replace(/<[^<>]+>/g,It=>It==="<version>"?"3":It==="<apiKey>"?wt(bt):It==="<loaderVersion>"?wt(b$2):It)}(String(vt),Et))}(gt,ht);return V(yt,F$1)}).catch(yt=>{throw xt(),function(Ct){return Ct instanceof Error&&Ct.message===K?new Error(M$1):Ct}(yt)}).then(([yt,Ct])=>(xt(),yt.load({...nt,ldi:{attempts:Ct,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(yt){ft(yt)}}function gt(xt){try{At(tt.throw(xt))}catch(yt){ft(yt)}}function At(xt){var yt;xt.done?nt(xt.value):(yt=xt.value,yt instanceof Ye?yt:new Ye(function(Ct){Ct(yt)})).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(yt){if(Ye)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,yt[0]&&(ht=0)),ht;)try{if(Ye=1,tt&&(nt=2&yt[0]?tt.return:yt[0]?tt.throw||((nt=tt.return)&&nt.call(tt),0):tt.next)&&!(nt=nt.call(tt,yt[1])).done)return nt;switch(tt=0,nt&&(yt=[2&yt[0],nt.value]),yt[0]){case 0:case 1:nt=yt;break;case 4:return ht.label++,{value:yt[1],done:!1};case 5:ht.label++,tt=yt[1],yt=[0];continue;case 7:yt=ht.ops.pop(),ht.trys.pop();continue;default:if(nt=ht.trys,!((nt=nt.length>0&&nt[nt.length-1])||yt[0]!==6&&yt[0]!==2)){ht=0;continue}if(yt[0]===3&&(!nt||yt[1]>nt[0]&&yt[1]<nt[3])){ht.label=yt[1];break}if(yt[0]===6&&ht.label<nt[1]){ht.label=nt[1],nt=yt;break}if(nt&&ht.label<nt[2]){ht.label=nt[2],ht.ops.push(yt);break}nt[2]&&ht.ops.pop(),ht.trys.pop();continue}yt=Le.call(Be,ht)}catch(Ct){yt=[6,Ct],tt=0}finally{Ye=nt=0}if(5&yt[0])throw yt[1];return{value:yt[0]?yt[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 yt=At.subarray(4*xt,4*(xt+1));yt[0]=Math.imul(yt[0],s$2[0]),yt[0]=l(yt[0],15),yt[0]=Math.imul(yt[0],s$2[1]),ht[0]=ht[0]^yt[0],ht[0]=l(ht[0],19),ht[0]=ht[0]+ht[1],ht[0]=Math.imul(ht[0],5)+1444728091,yt[1]=Math.imul(yt[1],s$2[1]),yt[1]=l(yt[1],16),yt[1]=Math.imul(yt[1],s$2[2]),ht[1]=ht[1]^yt[1],ht[1]=l(ht[1],17),ht[1]=ht[1]+ht[2],ht[1]=Math.imul(ht[1],5)+197830471,yt[2]=Math.imul(yt[2],s$2[2]),yt[2]=l(yt[2],17),yt[2]=Math.imul(yt[2],s$2[3]),ht[2]=ht[2]^yt[2],ht[2]=l(ht[2],15),ht[2]=ht[2]+ht[3],ht[2]=Math.imul(ht[2],5)+2530024501,yt[3]=Math.imul(yt[3],s$2[3]),yt[3]=l(yt[3],18),yt[3]=Math.imul(yt[3],s$2[0]),ht[3]=ht[3]^yt[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),yt=new Uint8Array(ft,16*gt,At);switch(At){case 15:xt[3]=xt[3]^yt[14]<<16;case 14:xt[3]=xt[3]^yt[13]<<8;case 13:xt[3]=xt[3]^yt[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]^yt[11]<<24;case 11:xt[2]=xt[2]^yt[10]<<16;case 10:xt[2]=xt[2]^yt[9]<<8;case 9:xt[2]=xt[2]^yt[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]^yt[7]<<24;case 7:xt[1]=xt[1]^yt[6]<<16;case 6:xt[1]=xt[1]^yt[5]<<8;case 5:xt[1]=xt[1]^yt[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]^yt[3]<<24;case 3:xt[0]=xt[0]^yt[2]<<16;case 2:xt[0]=xt[0]^yt[1]<<8;case 1:xt[0]=xt[0]^yt[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,yt){var Ct=tt+xt+".";if(typeof yt!="object"||Array.isArray(yt)){var Et=Le.some(function(bt){return Ct.startsWith(bt)}),vt=Ye.some(function(bt){return Ct.startsWith(bt)});Et&&!vt||(nt[xt]=yt)}else{var kt=p(yt,Le,Ye,Ct);Object.keys(kt).length>0&&(nt[xt]=kt)}},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 yt=String(xt);ht[yt]=(ht[yt]||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(Ct){return setTimeout(Ct,xt,yt)}))];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,yt})})})(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(yt){return L(ht,yt)}),At={},I.forEach(function(yt){var Ct=L(ht,yt);gt.includes(Ct)||(At[yt]=Ct)}),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);
@@ -73,7 +73,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[St]+=1);const breakpoints$3={
73
73
  void main() {
74
74
  gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
75
75
  }
76
- `,nt=F.createShader(F.VERTEX_SHADER),ft=F.createShader(F.FRAGMENT_SHADER);if(!nt||!ft)throw new Error("Failed to create shaders");if(F.shaderSource(nt,Ye),F.shaderSource(ft,tt),F.compileShader(nt),!F.getShaderParameter(nt,F.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+F.getShaderInfoLog(nt));if(F.compileShader(ft),!F.getShaderParameter(ft,F.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+F.getShaderInfoLog(ft));var ht=F.createProgram();if(!ht)throw new Error("Failed to create shader program");if(F.attachShader(ht,nt),F.attachShader(ht,ft),F.linkProgram(ht),!F.getProgramParameter(ht,F.LINK_STATUS))throw new Error("Shader program linking failed: "+F.getProgramInfoLog(ht));F.useProgram(ht);for(var gt=137,At=new Float32Array(4*gt),xt=2*Math.PI/gt,yt=0;yt<gt;yt++){var Ct=yt*xt;At[4*yt]=0,At[4*yt+1]=0,At[4*yt+2]=Math.cos(Ct)*(U.width/2),At[4*yt+3]=Math.sin(Ct)*(U.height/2)}var Et=F.createBuffer();F.bindBuffer(F.ARRAY_BUFFER,Et),F.bufferData(F.ARRAY_BUFFER,At,F.STATIC_DRAW);var vt=F.getAttribLocation(ht,"position");F.enableVertexAttribArray(vt),F.vertexAttribPointer(vt,2,F.FLOAT,!1,0,0),F.viewport(0,0,U.width,U.height),F.clearColor(0,0,0,1),F.clear(F.COLOR_BUFFER_BIT),F.drawArrays(F.LINES,0,2*gt);var kt=new Uint8ClampedArray(U.width*U.height*4);return F.readPixels(0,0,U.width,U.height,F.RGBA,F.UNSIGNED_BYTE,kt),new ImageData(kt,U.width,U.height)}catch{return new ImageData(1,1)}finally{F&&(F.bindBuffer(F.ARRAY_BUFFER,null),F.useProgram(null),F.viewport(0,0,F.drawingBufferWidth,F.drawingBufferHeight),F.clearColor(0,0,0,0))}}()}),[2,{commonImageHash:d(E(Be,U.width,U.height).data.toString()).toString()}]}catch{return[2,{webgl:"unsupported"}]}return[2]})})});var j=function(Be,Le,Ye,tt){for(var nt=(Ye-Le)/tt,ft=0,ht=0;ht<tt;ht++)ft+=Be(Le+(ht+.5)*nt);return ft*nt};i$4("math",function(){return e$1(void 0,void 0,void 0,function(){return n$1(this,function(Be){return[2,{acos:Math.acos(.5),asin:j(Math.asin,-1,1,97),atan:j(Math.atan,-1,1,97),cos:j(Math.cos,0,Math.PI,97),cosh:Math.cosh(9/7),e:Math.E,largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),log:Math.log(1e3),pi:Math.PI,sin:j(Math.sin,-Math.PI,Math.PI,97),sinh:j(Math.sinh,-9/7,7/9,97),sqrt:Math.sqrt(2),tan:j(Math.tan,0,2*Math.PI,97),tanh:j(Math.tanh,-9/7,7/9,97)}]})})});let fingerprintApiKey;function setFingerprintApiKey(Be){fingerprintApiKey=Be}let fingerPrintPromise=null;const FINGERPRINT_STORAGE_KEY="fingerprint_result";let ipPromise=null;async function getIp(){if(ipPromise)return ipPromise;if(AbortSignal.timeout)ipPromise=fetch("https://api.ipify.org?format=json",{signal:AbortSignal.timeout(3e3)}).then(Be=>Be.json()).then(Be=>Be.ip).catch(()=>"");else{const Be=new Promise((Le,Ye)=>{setTimeout(()=>Ye(new Error("Request timeout")),3e3)});ipPromise=Promise.race([fetch("https://api.ipify.org?format=json").then(Le=>Le.json()).then(Le=>Le.ip),Be]).catch(()=>"")}return ipPromise}function getCachedFingerprint(){try{const Be=localStorage.getItem(FINGERPRINT_STORAGE_KEY);return Be?JSON.parse(Be):null}catch{return null}}function setCachedFingerprint(Be){try{localStorage.setItem(FINGERPRINT_STORAGE_KEY,JSON.stringify({visitorId:Be.visitorId}))}catch{}}async function getFingerPrintFromFingerprint(Be){const Le=getCachedFingerprint();return Le?Promise.resolve({visitorId:Le.visitorId,ip:Be?void 0:await getIp()}):fingerPrintPromise||(fingerPrintPromise=H.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(Ye=>Ye.get({extendedResult:!0})).then(Ye=>(setCachedFingerprint(Ye),{visitorId:Ye.visitorId,ip:Ye.ip})),fingerPrintPromise)}let thumbprintPromise=null;async function getFingerprintFromThumbprint(Be){return thumbprintPromise||(thumbprintPromise=w$d().then(async Le=>({visitorId:Le,ip:Be?void 0:await getIp()})),thumbprintPromise)}async function getFingerprint(Be=!1){return getFeatureFlag("new_fingerprint")?getFingerprintFromThumbprint(Be):getFingerPrintFromFingerprint(Be)}class MetadataUtils{async initializeMetadata(Le,Ye=!1){MlWasmJSApi$1.setSdkPlatform("WEBAPP"),MlWasmJSApi$1.setSdkVersion(Le||version$4);const{os:tt,device:nt}=getUAParserResults(),ft=await getFingerprint(Ye).catch(At=>null),ht={kind:mobile.isDesktop()?"desktop":"mobile",model:`${nt.vendor||""} ${nt.model||""}`.trim(),os:tt.name,osVersion:tt.version,screenDimensions:{width:screen.width,height:screen.height},numTouchPoints:navigator.maxTouchPoints,fingerprintHash:ft.visitorId||"",ip:ft.ip||"",backgroundMode:!1};MlWasmJSApi$1.setDeviceInfo(ht);const gt={userAgent:navigator.userAgent,getUserMediaAvailability:{webkit:navigator.webkitGetUserMedia!==void 0,moz:navigator.mozGetUserMedia!==void 0,o:navigator.oGetUserMedia!==void 0,ms:navigator.msGetUserMedia!==void 0},webglFingerprint:webgl(),inspectorOpened:!1,isMockedBrowser:isBrowserSimulation()};MlWasmJSApi$1.setBrowserInfo(gt,!1)}updateCameraInfo(Le){const Ye=Le.getSettings(),tt=Le.getCapabilities?Le.getCapabilities():{},nt=Le.label?[Le.label]:[],ht={facingMode:Ye.facingMode==="user"?"frontal":Ye.facingMode==="environment"?"back":Ye.facingMode||"unknown",settings:Ye,capabilities:tt,labels:nt};MlWasmJSApi$1.setCameraInfo(ht)}}class MotionStatusCheck{constructor(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=3,this.maxFrequency_=60,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.deviceMotionListener=vt=>{if(vt.accelerationIncludingGravity){const kt={x:vt.accelerationIncludingGravity.x,y:vt.accelerationIncludingGravity.y,z:vt.accelerationIncludingGravity.z};this.checkFields(kt)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,kt))}if(vt.acceleration){const kt={x:vt.acceleration.x,y:vt.acceleration.y,z:vt.acceleration.z};this.checkFields(kt)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,kt))}if(vt.rotationRate){const kt={x:vt.rotationRate.alpha,y:vt.rotationRate.beta,z:vt.rotationRate.gamma};this.checkFields(kt)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,kt))}},this.deviceOrientationListener=vt=>{const kt={x:vt.alpha,y:vt.beta,z:vt.gamma};this.checkFields(kt)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,kt))},this.accThreshold_=Le,this.gyroThreshold_=Ye,this.accGrOldThreshold_=tt,this.accOldThreshold_=nt,this.gyroscopeOldThreshold_=ft,this.orientationOldThreshold_=ht,this.maeAccThreshold_=gt,this.maeGyroThreshold_=At,this.maeAccGrOldThreshold_=xt,this.maeAccOldThreshold_=yt,this.maeGyroscopeOldThreshold_=Ct,this.maeOrientationOldThreshold_=Et}async requestMotionPermission(){return DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"?(sessionStorage.setItem("motionSensorsPermissionsRequested",String(!0)),DeviceMotionEvent.requestPermission().then(Le=>(Le!=="granted"&&(this.permission_=!1),Le)).catch(console.error)):"granted"}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!(!this.isRunning_||!this.acl_)&&(this.paramsAcc_.ptsNum+=1,this.acl_)){const Le={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(Le)&&this.updateParams(this.paramsAcc_,Le)}}updateGyro(){if(!(!this.isRunning_||!this.gyro_)&&(this.paramsGyro_.ptsNum+=1,this.gyro_)){const Le={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(Le)&&this.updateParams(this.paramsGyro_,Le)}}check(){if(!this.permission_)return"UNCLEAR";const Le=this.checkStability();return Le===null?"UNCLEAR":Le?"FAIL":"PASS"}checkStability(){if(!this.isRunning_)return null;const Ye=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(gt=>gt!==null),tt=Ye.length>0?Ye.every(gt=>gt):null,ft=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(gt=>gt!==null),ht=ft.length>0?ft.every(gt=>gt):null;return tt===null?ht===null?null:ht:ht!==null?tt&&ht:tt}updateParams(Le,Ye){const tt=Ye.x-Le.meanX,nt=Ye.y-Le.meanY,ft=Ye.z-Le.meanZ;Le.meanX+=tt/Le.ptsNum,Le.meanY+=nt/Le.ptsNum,Le.meanZ+=ft/Le.ptsNum,Le.m2X+=tt*(Ye.x-Le.meanX),Le.m2Y+=nt*(Ye.y-Le.meanY),Le.m2Z+=ft*(Ye.z-Le.meanZ),Le.cumulativeAbsErrorX+=Math.abs(Ye.x-Le.meanX),Le.cumulativeAbsErrorY+=Math.abs(Ye.y-Le.meanY),Le.cumulativeAbsErrorZ+=Math.abs(Ye.z-Le.meanZ)}calculateStd(Le){const Ye={x:Le.m2X/Le.ptsNum,y:Le.m2Y/Le.ptsNum,z:Le.m2Z/Le.ptsNum};return{x:Math.sqrt(Ye.x),y:Math.sqrt(Ye.y),z:Math.sqrt(Ye.z)}}calculateMae(Le){return{x:Le.cumulativeAbsErrorX/Le.ptsNum,y:Le.cumulativeAbsErrorY/Le.ptsNum,z:Le.cumulativeAbsErrorZ/Le.ptsNum}}checkFields(Le){return Le.x!==null&&Le.y!==null&&Le.z!==null}isBelowStdThreshold(Le,Ye){if(Le.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateStd(Le);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}isBelowMaeThreshold(Le,Ye){if(Le.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateMae(Le);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}}class OnboardingAnalytics extends MetadataUtils{constructor(){super(),this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.backgroundModeDetected=!1,this.simdIsEnabled=null,this.wasmVersion=null,this.profiles=null,this.isVirtualCameraDetectedByLabel=!1,this.metadata="",this.motionStatusCheck=new MotionStatusCheck(.3,.3,.3,.3,10,10,.3,.3,.3,.3,10,10),document.addEventListener("visibilitychange",()=>{this.backgroundModeDetected=!0})}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setSimdIsEnabled(Le){this.simdIsEnabled=Le}setWasmVersion(Le){this.wasmVersion=Le}setProfiles(Le){this.profiles=Le}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getAnalysisStatus(){return this.analysisStatus}getMetadata(){return this.metadata}async analyzeFrame(Le){const Ye=await base64ToImageData(Le);await MlWasmJSApi$1.analyzeFrame(Ye)}async checkForVirtualCameraByLabel(Le=null){try{if(!MlWasmJSApi$1.isInitialized())return null;if(!Le){const tt=await getDeviceCapabilities();for(const nt of Object.keys(tt)){const ft=tt[nt];if(MlWasmJSApi$1.isVirtualCamera(ft==null?void 0:ft.label)){const ht={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,ht}}}const Ye=getChosenCameraInfo(Le);if(MlWasmJSApi$1.isVirtualCamera(Ye==null?void 0:Ye.label)){const tt={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,tt}return{isDetected:!1,hasPriorDetection:this.isVirtualCameraDetectedByLabel}}catch(Ye){console.log(`Exception: ${Ye}`)}return null}async startOnboardingCheck(){return this.motionStatusCheck.requestMotionPermission()}async startMotionSensors(){this.motionStatusCheck.start()}stopMotionSensors(){this.motionStatusCheck.stop()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}update(){if(MlWasmJSApi$1.isInitialized())try{const Le=MlWasmJSApi$1.getPipelineState();if(Le!==""){const Ye=JSON.parse(Le);Ye.profiles=Array.from(this.profiles.values()).map(tt=>PipelineProfileName[tt.name]),Ye.estimatedPerformance=this.estimatedPerformance,Ye.simdIsEnabled=this.simdIsEnabled,Ye.wasmVersion=this.wasmVersion,this.pipelineLogs=Ye,this.motionStatus===""&&(this.motionStatus=this.motionStatusCheck.check()),MlWasmJSApi$1.setMotionStatus(this.motionStatus),this.analysisStatus=MlWasmJSApi$1.getCheck()}MlWasmJSApi$1.setBackgroundMode(this.backgroundModeDetected),this.metadata=MlWasmJSApi$1.getMetadata(),this.backgroundModeDetected=!1}catch(Le){console.error(`Exception: ${Le}`)}}}const onboardingAnalytics=OnboardingAnalytics.getInstance();class DetectionSetup{constructor(){this.setupDetectPromise=null,this.isSetupDetect=!1,this.profiles=null}static getInstance(){return DetectionSetup.instance||(DetectionSetup.instance=new DetectionSetup),DetectionSetup.instance}setIsIPhone14OrHigher(){if(!mobile.iOS())return;if(new URLSearchParams(window.location.search).get("smallFrame")==="true"){localStorage.setItem("isIPhone14OrHigher","true");return}localStorage.setItem("isIPhone14OrHigher",String(window.outerHeight===852&&window.outerWidth===393||window.outerHeight===932&&window.outerWidth===430||window.innerHeight===631&&window.innerWidth===375))}async setupDetect(Le,Ye,tt){return this.setupDetectPromise?this.setupDetectPromise:(this.setupDetectPromise=this._runSetupDetect(Le,Ye,tt),this.setupDetectPromise)}getProfiles(){return this.profiles}getProfile(Le){var Ye;return((Ye=this.profiles)==null?void 0:Ye.get(Le))??null}async warmup(){for(;!MlWasmJSApi$1.isInitialized();)await new Promise(Le=>setTimeout(Le,100))}async _runSetupDetect(Le,Ye,tt){var gt,At;if(this.isSetupDetect)return;addEvent({token:(gt=state.token)==null?void 0:gt.token,code:"modelLoadStart"}),this.setIsIPhone14OrHigher();const nt=getInitializationParams();this.profiles=nt.profiles,onboardingAnalytics.setProfiles(this.profiles);const ft=await MlWasmJSApi$1.initialize(nt.wasmModulePath,nt.wasmSimdModulePath,nt.glueCodePath,nt.enableSIMD,nt.versionsFilePath,nt.pipelineModels);for(;!MlWasmJSApi$1.isInitialized();)await new Promise(xt=>setTimeout(xt,100));onboardingAnalytics.estimatePerformance(),onboardingAnalytics.setWasmVersion(nt.wasmVersion),onboardingAnalytics.setSimdIsEnabled(ft),await MlWasmJSApi$1.initializePipelines(),await onboardingAnalytics.initializeMetadata(Ye,tt);const ht=Le;try{await MlWasmJSApi$1.setProductionMode(ht)}catch(xt){console.error(`Exception: ${xt}`)}this.isSetupDetect=!0,addEvent({token:(At=state.token)==null?void 0:At.token,code:"modelLoadEnd",payload:{loadSuccessful:!0}})}}const detectionSetup=DetectionSetup.getInstance();function _typeof$k(Be){"@babel/helpers - typeof";return _typeof$k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$k(Be)}function _classCallCheck$m(Be,Le){if(!(Be instanceof Le))throw new TypeError("Cannot call a class as a function")}function toPrimitive(Be,Le){if(_typeof$k(Be)!="object"||!Be)return Be;var Ye=Be[Symbol.toPrimitive];if(Ye!==void 0){var tt=Ye.call(Be,Le);if(_typeof$k(tt)!="object")return tt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Le==="string"?String:Number)(Be)}function toPropertyKey(Be){var Le=toPrimitive(Be,"string");return _typeof$k(Le)=="symbol"?Le:Le+""}function _defineProperties$9(Be,Le){for(var Ye=0;Ye<Le.length;Ye++){var tt=Le[Ye];tt.enumerable=tt.enumerable||!1,tt.configurable=!0,"value"in tt&&(tt.writable=!0),Object.defineProperty(Be,toPropertyKey(tt.key),tt)}}function _createClass$l(Be,Le,Ye){return Le&&_defineProperties$9(Be.prototype,Le),Ye&&_defineProperties$9(Be,Ye),Object.defineProperty(Be,"prototype",{writable:!1}),Be}function _assertThisInitialized$1(Be){if(Be===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Be}function _setPrototypeOf$1(Be,Le){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ye,tt){return Ye.__proto__=tt,Ye},_setPrototypeOf$1(Be,Le)}function _inherits$c(Be,Le){if(typeof Le!="function"&&Le!==null)throw new TypeError("Super expression must either be null or a function");Be.prototype=Object.create(Le&&Le.prototype,{constructor:{value:Be,writable:!0,configurable:!0}}),Object.defineProperty(Be,"prototype",{writable:!1}),Le&&_setPrototypeOf$1(Be,Le)}function _possibleConstructorReturn$c(Be,Le){if(Le&&(_typeof$k(Le)=="object"||typeof Le=="function"))return Le;if(Le!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(Be)}function _getPrototypeOf$1(Be){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Le){return Le.__proto__||Object.getPrototypeOf(Le)},_getPrototypeOf$1(Be)}function _defineProperty$6(Be,Le,Ye){return(Le=toPropertyKey(Le))in Be?Object.defineProperty(Be,Le,{value:Ye,enumerable:!0,configurable:!0,writable:!0}):Be[Le]=Ye,Be}function _arrayWithHoles$4(Be){if(Array.isArray(Be))return Be}function _iterableToArray(Be){if(typeof Symbol<"u"&&Be[Symbol.iterator]!=null||Be["@@iterator"]!=null)return Array.from(Be)}function _arrayLikeToArray$b(Be,Le){(Le==null||Le>Be.length)&&(Le=Be.length);for(var Ye=0,tt=Array(Le);Ye<Le;Ye++)tt[Ye]=Be[Ye];return tt}function _unsupportedIterableToArray$b(Be,Le){if(Be){if(typeof Be=="string")return _arrayLikeToArray$b(Be,Le);var Ye={}.toString.call(Be).slice(8,-1);return Ye==="Object"&&Be.constructor&&(Ye=Be.constructor.name),Ye==="Map"||Ye==="Set"?Array.from(Be):Ye==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ye)?_arrayLikeToArray$b(Be,Le):void 0}}function _nonIterableRest$4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
76
+ `,nt=F.createShader(F.VERTEX_SHADER),ft=F.createShader(F.FRAGMENT_SHADER);if(!nt||!ft)throw new Error("Failed to create shaders");if(F.shaderSource(nt,Ye),F.shaderSource(ft,tt),F.compileShader(nt),!F.getShaderParameter(nt,F.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+F.getShaderInfoLog(nt));if(F.compileShader(ft),!F.getShaderParameter(ft,F.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+F.getShaderInfoLog(ft));var ht=F.createProgram();if(!ht)throw new Error("Failed to create shader program");if(F.attachShader(ht,nt),F.attachShader(ht,ft),F.linkProgram(ht),!F.getProgramParameter(ht,F.LINK_STATUS))throw new Error("Shader program linking failed: "+F.getProgramInfoLog(ht));F.useProgram(ht);for(var gt=137,At=new Float32Array(4*gt),xt=2*Math.PI/gt,yt=0;yt<gt;yt++){var Ct=yt*xt;At[4*yt]=0,At[4*yt+1]=0,At[4*yt+2]=Math.cos(Ct)*(U.width/2),At[4*yt+3]=Math.sin(Ct)*(U.height/2)}var Et=F.createBuffer();F.bindBuffer(F.ARRAY_BUFFER,Et),F.bufferData(F.ARRAY_BUFFER,At,F.STATIC_DRAW);var vt=F.getAttribLocation(ht,"position");F.enableVertexAttribArray(vt),F.vertexAttribPointer(vt,2,F.FLOAT,!1,0,0),F.viewport(0,0,U.width,U.height),F.clearColor(0,0,0,1),F.clear(F.COLOR_BUFFER_BIT),F.drawArrays(F.LINES,0,2*gt);var kt=new Uint8ClampedArray(U.width*U.height*4);return F.readPixels(0,0,U.width,U.height,F.RGBA,F.UNSIGNED_BYTE,kt),new ImageData(kt,U.width,U.height)}catch{return new ImageData(1,1)}finally{F&&(F.bindBuffer(F.ARRAY_BUFFER,null),F.useProgram(null),F.viewport(0,0,F.drawingBufferWidth,F.drawingBufferHeight),F.clearColor(0,0,0,0))}}()}),[2,{commonImageHash:d(E(Be,U.width,U.height).data.toString()).toString()}]}catch{return[2,{webgl:"unsupported"}]}return[2]})})});var j=function(Be,Le,Ye,tt){for(var nt=(Ye-Le)/tt,ft=0,ht=0;ht<tt;ht++)ft+=Be(Le+(ht+.5)*nt);return ft*nt};i$4("math",function(){return e$1(void 0,void 0,void 0,function(){return n$1(this,function(Be){return[2,{acos:Math.acos(.5),asin:j(Math.asin,-1,1,97),atan:j(Math.atan,-1,1,97),cos:j(Math.cos,0,Math.PI,97),cosh:Math.cosh(9/7),e:Math.E,largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),log:Math.log(1e3),pi:Math.PI,sin:j(Math.sin,-Math.PI,Math.PI,97),sinh:j(Math.sinh,-9/7,7/9,97),sqrt:Math.sqrt(2),tan:j(Math.tan,0,2*Math.PI,97),tanh:j(Math.tanh,-9/7,7/9,97)}]})})});let fingerprintApiKey;function setFingerprintApiKey(Be){fingerprintApiKey=Be}let fingerPrintPromise=null;const FINGERPRINT_STORAGE_KEY="fingerprint_result";let ipPromise=null;async function getIp(){if(ipPromise)return ipPromise;if(AbortSignal.timeout)ipPromise=fetch("https://api.ipify.org?format=json",{signal:AbortSignal.timeout(3e3)}).then(Be=>Be.json()).then(Be=>Be.ip).catch(()=>"");else{const Be=new Promise((Le,Ye)=>{setTimeout(()=>Ye(new Error("Request timeout")),3e3)});ipPromise=Promise.race([fetch("https://api.ipify.org?format=json").then(Le=>Le.json()).then(Le=>Le.ip),Be]).catch(()=>"")}return ipPromise}function getCachedFingerprint(){try{const Be=localStorage.getItem(FINGERPRINT_STORAGE_KEY);return Be?JSON.parse(Be):null}catch{return null}}function setCachedFingerprint(Be){try{localStorage.setItem(FINGERPRINT_STORAGE_KEY,JSON.stringify({visitorId:Be.visitorId}))}catch{}}async function getFingerPrintFromFingerprint(Be){const Le=getCachedFingerprint();return Le?Promise.resolve({visitorId:Le.visitorId,ip:Be?void 0:await getIp()}):fingerPrintPromise||(fingerPrintPromise=H.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(Ye=>Ye.get({extendedResult:!0})).then(Ye=>(setCachedFingerprint(Ye),{visitorId:Ye.visitorId,ip:Ye.ip})),fingerPrintPromise)}let thumbprintPromise=null;async function getFingerprintFromThumbprint(Be){return thumbprintPromise||(thumbprintPromise=w$d().then(async Le=>({visitorId:Le,ip:Be?void 0:await getIp()})),thumbprintPromise)}async function getFingerprint(Be=!1){return getFeatureFlag("new_fingerprint")?getFingerprintFromThumbprint(Be):getFingerPrintFromFingerprint(Be)}class MetadataUtils{async initializeMetadata(Le,Ye=!1){MlWasmJSApi$1.setSdkPlatform("WEBAPP"),MlWasmJSApi$1.setSdkVersion(Le||version$4);const{os:tt,device:nt}=getUAParserResults(),ft=await getFingerprint(Ye).catch(At=>({visitorId:"",ip:""})),ht={kind:mobile.isDesktop()?"desktop":"mobile",model:`${nt.vendor||""} ${nt.model||""}`.trim(),os:tt.name,osVersion:tt.version,screenDimensions:{width:screen.width,height:screen.height},numTouchPoints:navigator.maxTouchPoints,fingerprintHash:ft.visitorId||"",ip:ft.ip||"",backgroundMode:!1};MlWasmJSApi$1.setDeviceInfo(ht);const gt={userAgent:navigator.userAgent,getUserMediaAvailability:{webkit:navigator.webkitGetUserMedia!==void 0,moz:navigator.mozGetUserMedia!==void 0,o:navigator.oGetUserMedia!==void 0,ms:navigator.msGetUserMedia!==void 0},webglFingerprint:webgl(),inspectorOpened:!1,isMockedBrowser:isBrowserSimulation()};MlWasmJSApi$1.setBrowserInfo(gt,!1)}updateCameraInfo(Le){const Ye=Le.getSettings(),tt=Le.getCapabilities?Le.getCapabilities():{},nt=Le.label?[Le.label]:[],ht={facingMode:Ye.facingMode==="user"?"frontal":Ye.facingMode==="environment"?"back":Ye.facingMode||"unknown",settings:Ye,capabilities:tt,labels:nt};MlWasmJSApi$1.setCameraInfo(ht)}}class MotionStatusCheck{constructor(Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=3,this.maxFrequency_=60,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.deviceMotionListener=vt=>{if(vt.accelerationIncludingGravity){const kt={x:vt.accelerationIncludingGravity.x,y:vt.accelerationIncludingGravity.y,z:vt.accelerationIncludingGravity.z};this.checkFields(kt)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,kt))}if(vt.acceleration){const kt={x:vt.acceleration.x,y:vt.acceleration.y,z:vt.acceleration.z};this.checkFields(kt)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,kt))}if(vt.rotationRate){const kt={x:vt.rotationRate.alpha,y:vt.rotationRate.beta,z:vt.rotationRate.gamma};this.checkFields(kt)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,kt))}},this.deviceOrientationListener=vt=>{const kt={x:vt.alpha,y:vt.beta,z:vt.gamma};this.checkFields(kt)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,kt))},this.accThreshold_=Le,this.gyroThreshold_=Ye,this.accGrOldThreshold_=tt,this.accOldThreshold_=nt,this.gyroscopeOldThreshold_=ft,this.orientationOldThreshold_=ht,this.maeAccThreshold_=gt,this.maeGyroThreshold_=At,this.maeAccGrOldThreshold_=xt,this.maeAccOldThreshold_=yt,this.maeGyroscopeOldThreshold_=Ct,this.maeOrientationOldThreshold_=Et}async requestMotionPermission(){return DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"?(sessionStorage.setItem("motionSensorsPermissionsRequested",String(!0)),DeviceMotionEvent.requestPermission().then(Le=>(Le!=="granted"&&(this.permission_=!1),Le)).catch(console.error)):"granted"}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!(!this.isRunning_||!this.acl_)&&(this.paramsAcc_.ptsNum+=1,this.acl_)){const Le={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(Le)&&this.updateParams(this.paramsAcc_,Le)}}updateGyro(){if(!(!this.isRunning_||!this.gyro_)&&(this.paramsGyro_.ptsNum+=1,this.gyro_)){const Le={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(Le)&&this.updateParams(this.paramsGyro_,Le)}}check(){if(!this.permission_)return"UNCLEAR";const Le=this.checkStability();return Le===null?"UNCLEAR":Le?"FAIL":"PASS"}checkStability(){if(!this.isRunning_)return null;const Ye=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(gt=>gt!==null),tt=Ye.length>0?Ye.every(gt=>gt):null,ft=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(gt=>gt!==null),ht=ft.length>0?ft.every(gt=>gt):null;return tt===null?ht===null?null:ht:ht!==null?tt&&ht:tt}updateParams(Le,Ye){const tt=Ye.x-Le.meanX,nt=Ye.y-Le.meanY,ft=Ye.z-Le.meanZ;Le.meanX+=tt/Le.ptsNum,Le.meanY+=nt/Le.ptsNum,Le.meanZ+=ft/Le.ptsNum,Le.m2X+=tt*(Ye.x-Le.meanX),Le.m2Y+=nt*(Ye.y-Le.meanY),Le.m2Z+=ft*(Ye.z-Le.meanZ),Le.cumulativeAbsErrorX+=Math.abs(Ye.x-Le.meanX),Le.cumulativeAbsErrorY+=Math.abs(Ye.y-Le.meanY),Le.cumulativeAbsErrorZ+=Math.abs(Ye.z-Le.meanZ)}calculateStd(Le){const Ye={x:Le.m2X/Le.ptsNum,y:Le.m2Y/Le.ptsNum,z:Le.m2Z/Le.ptsNum};return{x:Math.sqrt(Ye.x),y:Math.sqrt(Ye.y),z:Math.sqrt(Ye.z)}}calculateMae(Le){return{x:Le.cumulativeAbsErrorX/Le.ptsNum,y:Le.cumulativeAbsErrorY/Le.ptsNum,z:Le.cumulativeAbsErrorZ/Le.ptsNum}}checkFields(Le){return Le.x!==null&&Le.y!==null&&Le.z!==null}isBelowStdThreshold(Le,Ye){if(Le.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateStd(Le);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}isBelowMaeThreshold(Le,Ye){if(Le.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateMae(Le);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}}class OnboardingAnalytics extends MetadataUtils{constructor(){super(),this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.backgroundModeDetected=!1,this.simdIsEnabled=null,this.wasmVersion=null,this.profiles=null,this.isVirtualCameraDetectedByLabel=!1,this.metadata="",this.motionStatusCheck=new MotionStatusCheck(.3,.3,.3,.3,10,10,.3,.3,.3,.3,10,10),document.addEventListener("visibilitychange",()=>{this.backgroundModeDetected=!0})}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setSimdIsEnabled(Le){this.simdIsEnabled=Le}setWasmVersion(Le){this.wasmVersion=Le}setProfiles(Le){this.profiles=Le}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getAnalysisStatus(){return this.analysisStatus}getMetadata(){return this.metadata}async analyzeFrame(Le){const Ye=await base64ToImageData(Le);await MlWasmJSApi$1.analyzeFrame(Ye)}async checkForVirtualCameraByLabel(Le=null){try{if(!MlWasmJSApi$1.isInitialized())return null;if(!Le){const tt=await getDeviceCapabilities();for(const nt of Object.keys(tt)){const ft=tt[nt];if(MlWasmJSApi$1.isVirtualCamera(ft==null?void 0:ft.label)){const ht={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,ht}}}const Ye=getChosenCameraInfo(Le);if(MlWasmJSApi$1.isVirtualCamera(Ye==null?void 0:Ye.label)){const tt={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,tt}return{isDetected:!1,hasPriorDetection:this.isVirtualCameraDetectedByLabel}}catch(Ye){console.log(`Exception: ${Ye}`)}return null}async startOnboardingCheck(){return this.motionStatusCheck.requestMotionPermission()}async startMotionSensors(){this.motionStatusCheck.start()}stopMotionSensors(){this.motionStatusCheck.stop()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}update(){if(MlWasmJSApi$1.isInitialized())try{const Le=MlWasmJSApi$1.getPipelineState();if(Le!==""){const Ye=JSON.parse(Le);Ye.profiles=Array.from(this.profiles.values()).map(tt=>PipelineProfileName[tt.name]),Ye.estimatedPerformance=this.estimatedPerformance,Ye.simdIsEnabled=this.simdIsEnabled,Ye.wasmVersion=this.wasmVersion,this.pipelineLogs=Ye,this.motionStatus===""&&(this.motionStatus=this.motionStatusCheck.check()),MlWasmJSApi$1.setMotionStatus(this.motionStatus),this.analysisStatus=MlWasmJSApi$1.getCheck()}MlWasmJSApi$1.setBackgroundMode(this.backgroundModeDetected),this.metadata=MlWasmJSApi$1.getMetadata(),this.backgroundModeDetected=!1}catch(Le){console.error(`Exception: ${Le}`)}}}const onboardingAnalytics=OnboardingAnalytics.getInstance();class DetectionSetup{constructor(){this.setupDetectPromise=null,this.isSetupDetect=!1,this.profiles=null}static getInstance(){return DetectionSetup.instance||(DetectionSetup.instance=new DetectionSetup),DetectionSetup.instance}setIsIPhone14OrHigher(){if(!mobile.iOS())return;if(new URLSearchParams(window.location.search).get("smallFrame")==="true"){localStorage.setItem("isIPhone14OrHigher","true");return}localStorage.setItem("isIPhone14OrHigher",String(window.outerHeight===852&&window.outerWidth===393||window.outerHeight===932&&window.outerWidth===430||window.innerHeight===631&&window.innerWidth===375))}async setupDetect(Le,Ye,tt){return this.setupDetectPromise?this.setupDetectPromise:(this.setupDetectPromise=this._runSetupDetect(Le,Ye,tt),this.setupDetectPromise)}getProfiles(){return this.profiles}getProfile(Le){var Ye;return((Ye=this.profiles)==null?void 0:Ye.get(Le))??null}async warmup(){for(;!MlWasmJSApi$1.isInitialized();)await new Promise(Le=>setTimeout(Le,100))}async _runSetupDetect(Le,Ye,tt){var gt,At;if(this.isSetupDetect)return;addEvent({token:(gt=state.token)==null?void 0:gt.token,code:"modelLoadStart"}),this.setIsIPhone14OrHigher();const nt=getInitializationParams();this.profiles=nt.profiles,onboardingAnalytics.setProfiles(this.profiles);const ft=await MlWasmJSApi$1.initialize(nt.wasmModulePath,nt.wasmSimdModulePath,nt.glueCodePath,nt.enableSIMD,nt.versionsFilePath,nt.pipelineModels);for(;!MlWasmJSApi$1.isInitialized();)await new Promise(xt=>setTimeout(xt,100));onboardingAnalytics.estimatePerformance(),onboardingAnalytics.setWasmVersion(nt.wasmVersion),onboardingAnalytics.setSimdIsEnabled(ft),await MlWasmJSApi$1.initializePipelines(),await onboardingAnalytics.initializeMetadata(Ye,tt);const ht=Le;try{await MlWasmJSApi$1.setProductionMode(ht)}catch(xt){console.error(`Exception: ${xt}`)}this.isSetupDetect=!0,addEvent({token:(At=state.token)==null?void 0:At.token,code:"modelLoadEnd",payload:{loadSuccessful:!0}})}}const detectionSetup=DetectionSetup.getInstance();function _typeof$k(Be){"@babel/helpers - typeof";return _typeof$k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$k(Be)}function _classCallCheck$m(Be,Le){if(!(Be instanceof Le))throw new TypeError("Cannot call a class as a function")}function toPrimitive(Be,Le){if(_typeof$k(Be)!="object"||!Be)return Be;var Ye=Be[Symbol.toPrimitive];if(Ye!==void 0){var tt=Ye.call(Be,Le);if(_typeof$k(tt)!="object")return tt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Le==="string"?String:Number)(Be)}function toPropertyKey(Be){var Le=toPrimitive(Be,"string");return _typeof$k(Le)=="symbol"?Le:Le+""}function _defineProperties$9(Be,Le){for(var Ye=0;Ye<Le.length;Ye++){var tt=Le[Ye];tt.enumerable=tt.enumerable||!1,tt.configurable=!0,"value"in tt&&(tt.writable=!0),Object.defineProperty(Be,toPropertyKey(tt.key),tt)}}function _createClass$l(Be,Le,Ye){return Le&&_defineProperties$9(Be.prototype,Le),Ye&&_defineProperties$9(Be,Ye),Object.defineProperty(Be,"prototype",{writable:!1}),Be}function _assertThisInitialized$1(Be){if(Be===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Be}function _setPrototypeOf$1(Be,Le){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ye,tt){return Ye.__proto__=tt,Ye},_setPrototypeOf$1(Be,Le)}function _inherits$c(Be,Le){if(typeof Le!="function"&&Le!==null)throw new TypeError("Super expression must either be null or a function");Be.prototype=Object.create(Le&&Le.prototype,{constructor:{value:Be,writable:!0,configurable:!0}}),Object.defineProperty(Be,"prototype",{writable:!1}),Le&&_setPrototypeOf$1(Be,Le)}function _possibleConstructorReturn$c(Be,Le){if(Le&&(_typeof$k(Le)=="object"||typeof Le=="function"))return Le;if(Le!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(Be)}function _getPrototypeOf$1(Be){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Le){return Le.__proto__||Object.getPrototypeOf(Le)},_getPrototypeOf$1(Be)}function _defineProperty$6(Be,Le,Ye){return(Le=toPropertyKey(Le))in Be?Object.defineProperty(Be,Le,{value:Ye,enumerable:!0,configurable:!0,writable:!0}):Be[Le]=Ye,Be}function _arrayWithHoles$4(Be){if(Array.isArray(Be))return Be}function _iterableToArray(Be){if(typeof Symbol<"u"&&Be[Symbol.iterator]!=null||Be["@@iterator"]!=null)return Array.from(Be)}function _arrayLikeToArray$b(Be,Le){(Le==null||Le>Be.length)&&(Le=Be.length);for(var Ye=0,tt=Array(Le);Ye<Le;Ye++)tt[Ye]=Be[Ye];return tt}function _unsupportedIterableToArray$b(Be,Le){if(Be){if(typeof Be=="string")return _arrayLikeToArray$b(Be,Le);var Ye={}.toString.call(Be).slice(8,-1);return Ye==="Object"&&Be.constructor&&(Ye=Be.constructor.name),Ye==="Map"||Ye==="Set"?Array.from(Be):Ye==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ye)?_arrayLikeToArray$b(Be,Le):void 0}}function _nonIterableRest$4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
77
77
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _toArray(Be){return _arrayWithHoles$4(Be)||_iterableToArray(Be)||_unsupportedIterableToArray$b(Be)||_nonIterableRest$4()}function ownKeys$8(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$7(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$8(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$8(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}var consoleLogger={type:"logger",log:function(Le){this.output("log",Le)},warn:function(Le){this.output("warn",Le)},error:function(Le){this.output("error",Le)},output:function(Le,Ye){console&&console[Le]&&console[Le].apply(console,Ye)}},Logger=function(){function Be(Le){var Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,Be),this.init(Le,Ye)}return _createClass$l(Be,[{key:"init",value:function(Ye){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=tt.prefix||"i18next:",this.logger=Ye||consoleLogger,this.options=tt,this.debug=tt.debug}},{key:"setDebug",value:function(Ye){this.debug=Ye}},{key:"log",value:function(){for(var Ye=arguments.length,tt=new Array(Ye),nt=0;nt<Ye;nt++)tt[nt]=arguments[nt];return this.forward(tt,"log","",!0)}},{key:"warn",value:function(){for(var Ye=arguments.length,tt=new Array(Ye),nt=0;nt<Ye;nt++)tt[nt]=arguments[nt];return this.forward(tt,"warn","",!0)}},{key:"error",value:function(){for(var Ye=arguments.length,tt=new Array(Ye),nt=0;nt<Ye;nt++)tt[nt]=arguments[nt];return this.forward(tt,"error","")}},{key:"deprecate",value:function(){for(var Ye=arguments.length,tt=new Array(Ye),nt=0;nt<Ye;nt++)tt[nt]=arguments[nt];return this.forward(tt,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(Ye,tt,nt,ft){return ft&&!this.debug?null:(typeof Ye[0]=="string"&&(Ye[0]="".concat(nt).concat(this.prefix," ").concat(Ye[0])),this.logger[tt](Ye))}},{key:"create",value:function(Ye){return new Be(this.logger,_objectSpread$7(_objectSpread$7({},{prefix:"".concat(this.prefix,":").concat(Ye,":")}),this.options))}},{key:"clone",value:function(Ye){return Ye=Ye||this.options,Ye.prefix=Ye.prefix||this.prefix,new Be(this.logger,Ye)}}]),Be}(),baseLogger=new Logger,EventEmitter$6=function(){function Be(){_classCallCheck$m(this,Be),this.observers={}}return _createClass$l(Be,[{key:"on",value:function(Ye,tt){var nt=this;return Ye.split(" ").forEach(function(ft){nt.observers[ft]=nt.observers[ft]||[],nt.observers[ft].push(tt)}),this}},{key:"off",value:function(Ye,tt){if(this.observers[Ye]){if(!tt){delete this.observers[Ye];return}this.observers[Ye]=this.observers[Ye].filter(function(nt){return nt!==tt})}}},{key:"emit",value:function(Ye){for(var tt=arguments.length,nt=new Array(tt>1?tt-1:0),ft=1;ft<tt;ft++)nt[ft-1]=arguments[ft];if(this.observers[Ye]){var ht=[].concat(this.observers[Ye]);ht.forEach(function(At){At.apply(void 0,nt)})}if(this.observers["*"]){var gt=[].concat(this.observers["*"]);gt.forEach(function(At){At.apply(At,[Ye].concat(nt))})}}}]),Be}();function defer(){var Be,Le,Ye=new Promise(function(tt,nt){Be=tt,Le=nt});return Ye.resolve=Be,Ye.reject=Le,Ye}function makeString(Be){return Be==null?"":""+Be}function copy$1(Be,Le,Ye){Be.forEach(function(tt){Le[tt]&&(Ye[tt]=Le[tt])})}function getLastOfPath(Be,Le,Ye){function tt(gt){return gt&&gt.indexOf("###")>-1?gt.replace(/###/g,"."):gt}function nt(){return!Be||typeof Be=="string"}for(var ft=typeof Le!="string"?[].concat(Le):Le.split(".");ft.length>1;){if(nt())return{};var ht=tt(ft.shift());!Be[ht]&&Ye&&(Be[ht]=new Ye),Object.prototype.hasOwnProperty.call(Be,ht)?Be=Be[ht]:Be={}}return nt()?{}:{obj:Be,k:tt(ft.shift())}}function setPath(Be,Le,Ye){var tt=getLastOfPath(Be,Le,Object),nt=tt.obj,ft=tt.k;nt[ft]=Ye}function pushPath(Be,Le,Ye,tt){var nt=getLastOfPath(Be,Le,Object),ft=nt.obj,ht=nt.k;ft[ht]=ft[ht]||[],ft[ht].push(Ye)}function getPath$1(Be,Le){var Ye=getLastOfPath(Be,Le),tt=Ye.obj,nt=Ye.k;if(tt)return tt[nt]}function getPathWithDefaults(Be,Le,Ye){var tt=getPath$1(Be,Ye);return tt!==void 0?tt:getPath$1(Le,Ye)}function deepExtend(Be,Le,Ye){for(var tt in Le)tt!=="__proto__"&&tt!=="constructor"&&(tt in Be?typeof Be[tt]=="string"||Be[tt]instanceof String||typeof Le[tt]=="string"||Le[tt]instanceof String?Ye&&(Be[tt]=Le[tt]):deepExtend(Be[tt],Le[tt],Ye):Be[tt]=Le[tt]);return Be}function regexEscape(Be){return Be.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function escape$1(Be){return typeof Be=="string"?Be.replace(/[&<>"'\/]/g,function(Le){return _entityMap[Le]}):Be}var isIE10=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,chars=[" ",",","?","!",";"];function looksLikeObjectPath(Be,Le,Ye){Le=Le||"",Ye=Ye||"";var tt=chars.filter(function(gt){return Le.indexOf(gt)<0&&Ye.indexOf(gt)<0});if(tt.length===0)return!0;var nt=new RegExp("(".concat(tt.map(function(gt){return gt==="?"?"\\?":gt}).join("|"),")")),ft=!nt.test(Be);if(!ft){var ht=Be.indexOf(Ye);ht>0&&!nt.test(Be.substring(0,ht))&&(ft=!0)}return ft}function ownKeys$1$1(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$1$1(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$1$1(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$1$1(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}function _createSuper(Be){var Le=_isNativeReflectConstruct$1();return function(){var tt=_getPrototypeOf$1(Be),nt;if(Le){var ft=_getPrototypeOf$1(this).constructor;nt=Reflect.construct(tt,arguments,ft)}else nt=tt.apply(this,arguments);return _possibleConstructorReturn$c(this,nt)}}function _isNativeReflectConstruct$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function deepFind(Be,Le){var Ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(Be){if(Be[Le])return Be[Le];for(var tt=Le.split(Ye),nt=Be,ft=0;ft<tt.length;++ft){if(!nt||typeof nt[tt[ft]]=="string"&&ft+1<tt.length)return;if(nt[tt[ft]]===void 0){for(var ht=2,gt=tt.slice(ft,ft+ht).join(Ye),At=nt[gt];At===void 0&&tt.length>ft+ht;)ht++,gt=tt.slice(ft,ft+ht).join(Ye),At=nt[gt];if(At===void 0)return;if(At===null)return null;if(Le.endsWith(gt)){if(typeof At=="string")return At;if(gt&&typeof At[gt]=="string")return At[gt]}var xt=tt.slice(ft+ht).join(Ye);return xt?deepFind(At,xt,Ye):void 0}nt=nt[tt[ft]]}return nt}}var ResourceStore=function(Be){_inherits$c(Ye,Be);var Le=_createSuper(Ye);function Ye(tt){var nt,ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck$m(this,Ye),nt=Le.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(nt)),nt.data=tt||{},nt.options=ft,nt.options.keySeparator===void 0&&(nt.options.keySeparator="."),nt.options.ignoreJSONStructure===void 0&&(nt.options.ignoreJSONStructure=!0),nt}return _createClass$l(Ye,[{key:"addNamespaces",value:function(nt){this.options.ns.indexOf(nt)<0&&this.options.ns.push(nt)}},{key:"removeNamespaces",value:function(nt){var ft=this.options.ns.indexOf(nt);ft>-1&&this.options.ns.splice(ft,1)}},{key:"getResource",value:function(nt,ft,ht){var gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},At=gt.keySeparator!==void 0?gt.keySeparator:this.options.keySeparator,xt=gt.ignoreJSONStructure!==void 0?gt.ignoreJSONStructure:this.options.ignoreJSONStructure,yt=[nt,ft];ht&&typeof ht!="string"&&(yt=yt.concat(ht)),ht&&typeof ht=="string"&&(yt=yt.concat(At?ht.split(At):ht)),nt.indexOf(".")>-1&&(yt=nt.split("."));var Ct=getPath$1(this.data,yt);return Ct||!xt||typeof ht!="string"?Ct:deepFind(this.data&&this.data[nt]&&this.data[nt][ft],ht,At)}},{key:"addResource",value:function(nt,ft,ht,gt){var At=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},xt=this.options.keySeparator;xt===void 0&&(xt=".");var yt=[nt,ft];ht&&(yt=yt.concat(xt?ht.split(xt):ht)),nt.indexOf(".")>-1&&(yt=nt.split("."),gt=ft,ft=yt[1]),this.addNamespaces(ft),setPath(this.data,yt,gt),At.silent||this.emit("added",nt,ft,ht,gt)}},{key:"addResources",value:function(nt,ft,ht){var gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var At in ht)(typeof ht[At]=="string"||Object.prototype.toString.apply(ht[At])==="[object Array]")&&this.addResource(nt,ft,At,ht[At],{silent:!0});gt.silent||this.emit("added",nt,ft,ht)}},{key:"addResourceBundle",value:function(nt,ft,ht,gt,At){var xt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},yt=[nt,ft];nt.indexOf(".")>-1&&(yt=nt.split("."),gt=ht,ht=ft,ft=yt[1]),this.addNamespaces(ft);var Ct=getPath$1(this.data,yt)||{};gt?deepExtend(Ct,ht,At):Ct=_objectSpread$1$1(_objectSpread$1$1({},Ct),ht),setPath(this.data,yt,Ct),xt.silent||this.emit("added",nt,ft,ht)}},{key:"removeResourceBundle",value:function(nt,ft){this.hasResourceBundle(nt,ft)&&delete this.data[nt][ft],this.removeNamespaces(ft),this.emit("removed",nt,ft)}},{key:"hasResourceBundle",value:function(nt,ft){return this.getResource(nt,ft)!==void 0}},{key:"getResourceBundle",value:function(nt,ft){return ft||(ft=this.options.defaultNS),this.options.compatibilityAPI==="v1"?_objectSpread$1$1(_objectSpread$1$1({},{}),this.getResource(nt,ft)):this.getResource(nt,ft)}},{key:"getDataByLanguage",value:function(nt){return this.data[nt]}},{key:"hasLanguageSomeTranslations",value:function(nt){var ft=this.getDataByLanguage(nt),ht=ft&&Object.keys(ft)||[];return!!ht.find(function(gt){return ft[gt]&&Object.keys(ft[gt]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),Ye}(EventEmitter$6),postProcessor={processors:{},addPostProcessor:function(Le){this.processors[Le.name]=Le},handle:function(Le,Ye,tt,nt,ft){var ht=this;return Le.forEach(function(gt){ht.processors[gt]&&(Ye=ht.processors[gt].process(Ye,tt,nt,ft))}),Ye}};function ownKeys$2$1(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$2$1(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$2$1(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$2$1(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}function _createSuper$1(Be){var Le=_isNativeReflectConstruct$1$1();return function(){var tt=_getPrototypeOf$1(Be),nt;if(Le){var ft=_getPrototypeOf$1(this).constructor;nt=Reflect.construct(tt,arguments,ft)}else nt=tt.apply(this,arguments);return _possibleConstructorReturn$c(this,nt)}}function _isNativeReflectConstruct$1$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var checkedLoadedFor={},Translator=function(Be){_inherits$c(Ye,Be);var Le=_createSuper$1(Ye);function Ye(tt){var nt,ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _classCallCheck$m(this,Ye),nt=Le.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(nt)),copy$1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],tt,_assertThisInitialized$1(nt)),nt.options=ft,nt.options.keySeparator===void 0&&(nt.options.keySeparator="."),nt.logger=baseLogger.create("translator"),nt}return _createClass$l(Ye,[{key:"changeLanguage",value:function(nt){nt&&(this.language=nt)}},{key:"exists",value:function(nt){var ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(nt==null)return!1;var ht=this.resolve(nt,ft);return ht&&ht.res!==void 0}},{key:"extractFromKey",value:function(nt,ft){var ht=ft.nsSeparator!==void 0?ft.nsSeparator:this.options.nsSeparator;ht===void 0&&(ht=":");var gt=ft.keySeparator!==void 0?ft.keySeparator:this.options.keySeparator,At=ft.ns||this.options.defaultNS||[],xt=ht&&nt.indexOf(ht)>-1,yt=!this.options.userDefinedKeySeparator&&!ft.keySeparator&&!this.options.userDefinedNsSeparator&&!ft.nsSeparator&&!looksLikeObjectPath(nt,ht,gt);if(xt&&!yt){var Ct=nt.match(this.interpolator.nestingRegexp);if(Ct&&Ct.length>0)return{key:nt,namespaces:At};var Et=nt.split(ht);(ht!==gt||ht===gt&&this.options.ns.indexOf(Et[0])>-1)&&(At=Et.shift()),nt=Et.join(gt)}return typeof At=="string"&&(At=[At]),{key:nt,namespaces:At}}},{key:"translate",value:function(nt,ft,ht){var gt=this;if(_typeof$k(ft)!=="object"&&this.options.overloadTranslationOptionHandler&&(ft=this.options.overloadTranslationOptionHandler(arguments)),ft||(ft={}),nt==null)return"";Array.isArray(nt)||(nt=[String(nt)]);var At=ft.returnDetails!==void 0?ft.returnDetails:this.options.returnDetails,xt=ft.keySeparator!==void 0?ft.keySeparator:this.options.keySeparator,yt=this.extractFromKey(nt[nt.length-1],ft),Ct=yt.key,Et=yt.namespaces,vt=Et[Et.length-1],kt=ft.lng||this.language,bt=ft.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(kt&&kt.toLowerCase()==="cimode"){if(bt){var wt=ft.nsSeparator||this.options.nsSeparator;return At?(It.res="".concat(vt).concat(wt).concat(Ct),It):"".concat(vt).concat(wt).concat(Ct)}return At?(It.res=Ct,It):Ct}var It=this.resolve(nt,ft),Rt=It&&It.res,Tt=It&&It.usedKey||Ct,Bt=It&&It.exactUsedKey||Ct,Pt=Object.prototype.toString.apply(Rt),Dt=["[object Number]","[object Function]","[object RegExp]"],Ot=ft.joinArrays!==void 0?ft.joinArrays:this.options.joinArrays,Lt=!this.i18nFormat||this.i18nFormat.handleAsObject,Wt=typeof Rt!="string"&&typeof Rt!="boolean"&&typeof Rt!="number";if(Lt&&Rt&&Wt&&Dt.indexOf(Pt)<0&&!(typeof Ot=="string"&&Pt==="[object Array]")){if(!ft.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var $t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(Tt,Rt,_objectSpread$2$1(_objectSpread$2$1({},ft),{},{ns:Et})):"key '".concat(Ct," (").concat(this.language,")' returned an object instead of string.");return At?(It.res=$t,It):$t}if(xt){var qt=Pt==="[object Array]",Ht=qt?[]:{},Ut=qt?Bt:Tt;for(var Ft in Rt)if(Object.prototype.hasOwnProperty.call(Rt,Ft)){var Xt="".concat(Ut).concat(xt).concat(Ft);Ht[Ft]=this.translate(Xt,_objectSpread$2$1(_objectSpread$2$1({},ft),{joinArrays:!1,ns:Et})),Ht[Ft]===Xt&&(Ht[Ft]=Rt[Ft])}Rt=Ht}}else if(Lt&&typeof Ot=="string"&&Pt==="[object Array]")Rt=Rt.join(Ot),Rt&&(Rt=this.extendTranslation(Rt,nt,ft,ht));else{var _t=!1,Mt=!1,jt=ft.count!==void 0&&typeof ft.count!="string",zt=Ye.hasDefaultValue(ft),Gt=jt?this.pluralResolver.getSuffix(kt,ft.count,ft):"",Yt=ft["defaultValue".concat(Gt)]||ft.defaultValue;!this.isValidLookup(Rt)&&zt&&(_t=!0,Rt=Yt),this.isValidLookup(Rt)||(Mt=!0,Rt=Ct);var ar=ft.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,tr=ar&&Mt?void 0:Rt,sr=zt&&Yt!==Rt&&this.options.updateMissing;if(Mt||_t||sr){if(this.logger.log(sr?"updateKey":"missingKey",kt,vt,Ct,sr?Yt:Rt),xt){var dr=this.resolve(Ct,_objectSpread$2$1(_objectSpread$2$1({},ft),{},{keySeparator:!1}));dr&&dr.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var rr=[],gr=this.languageUtils.getFallbackCodes(this.options.fallbackLng,ft.lng||this.language);if(this.options.saveMissingTo==="fallback"&&gr&&gr[0])for(var yr=0;yr<gr.length;yr++)rr.push(gr[yr]);else this.options.saveMissingTo==="all"?rr=this.languageUtils.toResolveHierarchy(ft.lng||this.language):rr.push(ft.lng||this.language);var or=function(Zt,Qt,er){var nr=zt&&er!==Rt?er:tr;gt.options.missingKeyHandler?gt.options.missingKeyHandler(Zt,vt,Qt,nr,sr,ft):gt.backendConnector&&gt.backendConnector.saveMissing&&gt.backendConnector.saveMissing(Zt,vt,Qt,nr,sr,ft),gt.emit("missingKey",Zt,vt,Qt,Rt)};this.options.saveMissing&&(this.options.saveMissingPlurals&&jt?rr.forEach(function(ir){gt.pluralResolver.getSuffixes(ir,ft).forEach(function(Zt){or([ir],Ct+Zt,ft["defaultValue".concat(Zt)]||Yt)})}):or(rr,Ct,Yt))}Rt=this.extendTranslation(Rt,nt,ft,It,ht),Mt&&Rt===Ct&&this.options.appendNamespaceToMissingKey&&(Rt="".concat(vt,":").concat(Ct)),(Mt||_t)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?Rt=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(vt,":").concat(Ct):Ct,_t?Rt:void 0):Rt=this.options.parseMissingKeyHandler(Rt))}return At?(It.res=Rt,It):Rt}},{key:"extendTranslation",value:function(nt,ft,ht,gt,At){var xt=this;if(this.i18nFormat&&this.i18nFormat.parse)nt=this.i18nFormat.parse(nt,_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation.defaultVariables),ht),gt.usedLng,gt.usedNS,gt.usedKey,{resolved:gt});else if(!ht.skipInterpolation){ht.interpolation&&this.interpolator.init(_objectSpread$2$1(_objectSpread$2$1({},ht),{interpolation:_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation),ht.interpolation)}));var yt=typeof nt=="string"&&(ht&&ht.interpolation&&ht.interpolation.skipOnVariables!==void 0?ht.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),Ct;if(yt){var Et=nt.match(this.interpolator.nestingRegexp);Ct=Et&&Et.length}var vt=ht.replace&&typeof ht.replace!="string"?ht.replace:ht;if(this.options.interpolation.defaultVariables&&(vt=_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation.defaultVariables),vt)),nt=this.interpolator.interpolate(nt,vt,ht.lng||this.language,ht),yt){var kt=nt.match(this.interpolator.nestingRegexp),bt=kt&&kt.length;Ct<bt&&(ht.nest=!1)}ht.nest!==!1&&(nt=this.interpolator.nest(nt,function(){for(var Rt=arguments.length,Tt=new Array(Rt),Bt=0;Bt<Rt;Bt++)Tt[Bt]=arguments[Bt];return At&&At[0]===Tt[0]&&!ht.context?(xt.logger.warn("It seems you are nesting recursively key: ".concat(Tt[0]," in key: ").concat(ft[0])),null):xt.translate.apply(xt,Tt.concat([ft]))},ht)),ht.interpolation&&this.interpolator.reset()}var wt=ht.postProcess||this.options.postProcess,It=typeof wt=="string"?[wt]:wt;return nt!=null&&It&&It.length&&ht.applyPostProcessor!==!1&&(nt=postProcessor.handle(It,nt,ft,this.options&&this.options.postProcessPassResolved?_objectSpread$2$1({i18nResolved:gt},ht):ht,this)),nt}},{key:"resolve",value:function(nt){var ft=this,ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},gt,At,xt,yt,Ct;return typeof nt=="string"&&(nt=[nt]),nt.forEach(function(Et){if(!ft.isValidLookup(gt)){var vt=ft.extractFromKey(Et,ht),kt=vt.key;At=kt;var bt=vt.namespaces;ft.options.fallbackNS&&(bt=bt.concat(ft.options.fallbackNS));var wt=ht.count!==void 0&&typeof ht.count!="string",It=wt&&!ht.ordinal&&ht.count===0&&ft.pluralResolver.shouldUseIntlApi(),Rt=ht.context!==void 0&&(typeof ht.context=="string"||typeof ht.context=="number")&&ht.context!=="",Tt=ht.lngs?ht.lngs:ft.languageUtils.toResolveHierarchy(ht.lng||ft.language,ht.fallbackLng);bt.forEach(function(Bt){ft.isValidLookup(gt)||(Ct=Bt,!checkedLoadedFor["".concat(Tt[0],"-").concat(Bt)]&&ft.utils&&ft.utils.hasLoadedNamespace&&!ft.utils.hasLoadedNamespace(Ct)&&(checkedLoadedFor["".concat(Tt[0],"-").concat(Bt)]=!0,ft.logger.warn('key "'.concat(At,'" for languages "').concat(Tt.join(", "),`" won't get resolved as namespace "`).concat(Ct,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),Tt.forEach(function(Pt){if(!ft.isValidLookup(gt)){yt=Pt;var Dt=[kt];if(ft.i18nFormat&&ft.i18nFormat.addLookupKeys)ft.i18nFormat.addLookupKeys(Dt,kt,Pt,Bt,ht);else{var Ot;wt&&(Ot=ft.pluralResolver.getSuffix(Pt,ht.count,ht));var Lt="".concat(ft.options.pluralSeparator,"zero");if(wt&&(Dt.push(kt+Ot),It&&Dt.push(kt+Lt)),Rt){var Wt="".concat(kt).concat(ft.options.contextSeparator).concat(ht.context);Dt.push(Wt),wt&&(Dt.push(Wt+Ot),It&&Dt.push(Wt+Lt))}}for(var $t;$t=Dt.pop();)ft.isValidLookup(gt)||(xt=$t,gt=ft.getResource(Pt,Bt,$t,ht))}}))})}}),{res:gt,usedKey:At,exactUsedKey:xt,usedLng:yt,usedNS:Ct}}},{key:"isValidLookup",value:function(nt){return nt!==void 0&&!(!this.options.returnNull&&nt===null)&&!(!this.options.returnEmptyString&&nt==="")}},{key:"getResource",value:function(nt,ft,ht){var gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(nt,ft,ht,gt):this.resourceStore.getResource(nt,ft,ht,gt)}}],[{key:"hasDefaultValue",value:function(nt){var ft="defaultValue";for(var ht in nt)if(Object.prototype.hasOwnProperty.call(nt,ht)&&ft===ht.substring(0,ft.length)&&nt[ht]!==void 0)return!0;return!1}}]),Ye}(EventEmitter$6);function capitalize$1(Be){return Be.charAt(0).toUpperCase()+Be.slice(1)}var LanguageUtil=function(){function Be(Le){_classCallCheck$m(this,Be),this.options=Le,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}return _createClass$l(Be,[{key:"getScriptPartFromCode",value:function(Ye){if(!Ye||Ye.indexOf("-")<0)return null;var tt=Ye.split("-");return tt.length===2||(tt.pop(),tt[tt.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(tt.join("-"))}},{key:"getLanguagePartFromCode",value:function(Ye){if(!Ye||Ye.indexOf("-")<0)return Ye;var tt=Ye.split("-");return this.formatLanguageCode(tt[0])}},{key:"formatLanguageCode",value:function(Ye){if(typeof Ye=="string"&&Ye.indexOf("-")>-1){var tt=["hans","hant","latn","cyrl","cans","mong","arab"],nt=Ye.split("-");return this.options.lowerCaseLng?nt=nt.map(function(ft){return ft.toLowerCase()}):nt.length===2?(nt[0]=nt[0].toLowerCase(),nt[1]=nt[1].toUpperCase(),tt.indexOf(nt[1].toLowerCase())>-1&&(nt[1]=capitalize$1(nt[1].toLowerCase()))):nt.length===3&&(nt[0]=nt[0].toLowerCase(),nt[1].length===2&&(nt[1]=nt[1].toUpperCase()),nt[0]!=="sgn"&&nt[2].length===2&&(nt[2]=nt[2].toUpperCase()),tt.indexOf(nt[1].toLowerCase())>-1&&(nt[1]=capitalize$1(nt[1].toLowerCase())),tt.indexOf(nt[2].toLowerCase())>-1&&(nt[2]=capitalize$1(nt[2].toLowerCase()))),nt.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?Ye.toLowerCase():Ye}},{key:"isSupportedCode",value:function(Ye){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(Ye=this.getLanguagePartFromCode(Ye)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(Ye)>-1}},{key:"getBestMatchFromCodes",value:function(Ye){var tt=this;if(!Ye)return null;var nt;return Ye.forEach(function(ft){if(!nt){var ht=tt.formatLanguageCode(ft);(!tt.options.supportedLngs||tt.isSupportedCode(ht))&&(nt=ht)}}),!nt&&this.options.supportedLngs&&Ye.forEach(function(ft){if(!nt){var ht=tt.getLanguagePartFromCode(ft);if(tt.isSupportedCode(ht))return nt=ht;nt=tt.options.supportedLngs.find(function(gt){if(gt.indexOf(ht)===0)return gt})}}),nt||(nt=this.getFallbackCodes(this.options.fallbackLng)[0]),nt}},{key:"getFallbackCodes",value:function(Ye,tt){if(!Ye)return[];if(typeof Ye=="function"&&(Ye=Ye(tt)),typeof Ye=="string"&&(Ye=[Ye]),Object.prototype.toString.apply(Ye)==="[object Array]")return Ye;if(!tt)return Ye.default||[];var nt=Ye[tt];return nt||(nt=Ye[this.getScriptPartFromCode(tt)]),nt||(nt=Ye[this.formatLanguageCode(tt)]),nt||(nt=Ye[this.getLanguagePartFromCode(tt)]),nt||(nt=Ye.default),nt||[]}},{key:"toResolveHierarchy",value:function(Ye,tt){var nt=this,ft=this.getFallbackCodes(tt||this.options.fallbackLng||[],Ye),ht=[],gt=function(xt){xt&&(nt.isSupportedCode(xt)?ht.push(xt):nt.logger.warn("rejecting language code not found in supportedLngs: ".concat(xt)))};return typeof Ye=="string"&&Ye.indexOf("-")>-1?(this.options.load!=="languageOnly"&&gt(this.formatLanguageCode(Ye)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&gt(this.getScriptPartFromCode(Ye)),this.options.load!=="currentOnly"&&gt(this.getLanguagePartFromCode(Ye))):typeof Ye=="string"&&gt(this.formatLanguageCode(Ye)),ft.forEach(function(At){ht.indexOf(At)<0&&gt(nt.formatLanguageCode(At))}),ht}}]),Be}(),sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(Le){return+(Le>1)},2:function(Le){return+(Le!=1)},3:function(Le){return 0},4:function(Le){return Le%10==1&&Le%100!=11?0:Le%10>=2&&Le%10<=4&&(Le%100<10||Le%100>=20)?1:2},5:function(Le){return Le==0?0:Le==1?1:Le==2?2:Le%100>=3&&Le%100<=10?3:Le%100>=11?4:5},6:function(Le){return Le==1?0:Le>=2&&Le<=4?1:2},7:function(Le){return Le==1?0:Le%10>=2&&Le%10<=4&&(Le%100<10||Le%100>=20)?1:2},8:function(Le){return Le==1?0:Le==2?1:Le!=8&&Le!=11?2:3},9:function(Le){return+(Le>=2)},10:function(Le){return Le==1?0:Le==2?1:Le<7?2:Le<11?3:4},11:function(Le){return Le==1||Le==11?0:Le==2||Le==12?1:Le>2&&Le<20?2:3},12:function(Le){return+(Le%10!=1||Le%100==11)},13:function(Le){return+(Le!==0)},14:function(Le){return Le==1?0:Le==2?1:Le==3?2:3},15:function(Le){return Le%10==1&&Le%100!=11?0:Le%10>=2&&(Le%100<10||Le%100>=20)?1:2},16:function(Le){return Le%10==1&&Le%100!=11?0:Le!==0?1:2},17:function(Le){return Le==1||Le%10==1&&Le%100!=11?0:1},18:function(Le){return Le==0?0:Le==1?1:2},19:function(Le){return Le==1?0:Le==0||Le%100>1&&Le%100<11?1:Le%100>10&&Le%100<20?2:3},20:function(Le){return Le==1?0:Le==0||Le%100>0&&Le%100<20?1:2},21:function(Le){return Le%100==1?1:Le%100==2?2:Le%100==3||Le%100==4?3:0},22:function(Le){return Le==1?0:Le==2?1:(Le<0||Le>10)&&Le%10==0?2:3}},deprecatedJsonVersions=["v1","v2","v3"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var Be={};return sets.forEach(function(Le){Le.lngs.forEach(function(Ye){Be[Ye]={numbers:Le.nr,plurals:_rulesPluralsTypes[Le.fc]}})}),Be}var PluralResolver=function(){function Be(Le){var Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,Be),this.languageUtils=Le,this.options=Ye,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}return _createClass$l(Be,[{key:"addRule",value:function(Ye,tt){this.rules[Ye]=tt}},{key:"getRule",value:function(Ye){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Ye,{type:tt.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[Ye]||this.rules[this.languageUtils.getLanguagePartFromCode(Ye)]}},{key:"needsPlural",value:function(Ye){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt=this.getRule(Ye,tt);return this.shouldUseIntlApi()?nt&&nt.resolvedOptions().pluralCategories.length>1:nt&&nt.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(Ye,tt){var nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(Ye,nt).map(function(ft){return"".concat(tt).concat(ft)})}},{key:"getSuffixes",value:function(Ye){var tt=this,nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ft=this.getRule(Ye,nt);return ft?this.shouldUseIntlApi()?ft.resolvedOptions().pluralCategories.sort(function(ht,gt){return suffixesOrder[ht]-suffixesOrder[gt]}).map(function(ht){return"".concat(tt.options.prepend).concat(ht)}):ft.numbers.map(function(ht){return tt.getSuffix(Ye,ht,nt)}):[]}},{key:"getSuffix",value:function(Ye,tt){var nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ft=this.getRule(Ye,nt);return ft?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(ft.select(tt)):this.getSuffixRetroCompatible(ft,tt):(this.logger.warn("no plural rule found for: ".concat(Ye)),"")}},{key:"getSuffixRetroCompatible",value:function(Ye,tt){var nt=this,ft=Ye.noAbs?Ye.plurals(tt):Ye.plurals(Math.abs(tt)),ht=Ye.numbers[ft];this.options.simplifyPluralSuffix&&Ye.numbers.length===2&&Ye.numbers[0]===1&&(ht===2?ht="plural":ht===1&&(ht=""));var gt=function(){return nt.options.prepend&&ht.toString()?nt.options.prepend+ht.toString():ht.toString()};return this.options.compatibilityJSON==="v1"?ht===1?"":typeof ht=="number"?"_plural_".concat(ht.toString()):gt():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&Ye.numbers.length===2&&Ye.numbers[0]===1?gt():this.options.prepend&&ft.toString()?this.options.prepend+ft.toString():ft.toString()}},{key:"shouldUseIntlApi",value:function(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]),Be}();function ownKeys$3$1(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$3$1(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$3$1(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$3$1(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}var Interpolator=function(){function Be(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$m(this,Be),this.logger=baseLogger.create("interpolator"),this.options=Le,this.format=Le.interpolation&&Le.interpolation.format||function(Ye){return Ye},this.init(Le)}return _createClass$l(Be,[{key:"init",value:function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ye.interpolation||(Ye.interpolation={escapeValue:!0});var tt=Ye.interpolation;this.escape=tt.escape!==void 0?tt.escape:escape$1,this.escapeValue=tt.escapeValue!==void 0?tt.escapeValue:!0,this.useRawValueToEscape=tt.useRawValueToEscape!==void 0?tt.useRawValueToEscape:!1,this.prefix=tt.prefix?regexEscape(tt.prefix):tt.prefixEscaped||"{{",this.suffix=tt.suffix?regexEscape(tt.suffix):tt.suffixEscaped||"}}",this.formatSeparator=tt.formatSeparator?tt.formatSeparator:tt.formatSeparator||",",this.unescapePrefix=tt.unescapeSuffix?"":tt.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":tt.unescapeSuffix||"",this.nestingPrefix=tt.nestingPrefix?regexEscape(tt.nestingPrefix):tt.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=tt.nestingSuffix?regexEscape(tt.nestingSuffix):tt.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=tt.nestingOptionsSeparator?tt.nestingOptionsSeparator:tt.nestingOptionsSeparator||",",this.maxReplaces=tt.maxReplaces?tt.maxReplaces:1e3,this.alwaysFormat=tt.alwaysFormat!==void 0?tt.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var Ye="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(Ye,"g");var tt="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(tt,"g");var nt="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(nt,"g")}},{key:"interpolate",value:function(Ye,tt,nt,ft){var ht=this,gt,At,xt,yt=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function Ct(wt){return wt.replace(/\$/g,"$$$$")}var Et=function(It){if(It.indexOf(ht.formatSeparator)<0){var Rt=getPathWithDefaults(tt,yt,It);return ht.alwaysFormat?ht.format(Rt,void 0,nt,_objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({},ft),tt),{},{interpolationkey:It})):Rt}var Tt=It.split(ht.formatSeparator),Bt=Tt.shift().trim(),Pt=Tt.join(ht.formatSeparator).trim();return ht.format(getPathWithDefaults(tt,yt,Bt),Pt,nt,_objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({},ft),tt),{},{interpolationkey:Bt}))};this.resetRegExp();var vt=ft&&ft.missingInterpolationHandler||this.options.missingInterpolationHandler,kt=ft&&ft.interpolation&&ft.interpolation.skipOnVariables!==void 0?ft.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,bt=[{regex:this.regexpUnescape,safeValue:function(It){return Ct(It)}},{regex:this.regexp,safeValue:function(It){return ht.escapeValue?Ct(ht.escape(It)):Ct(It)}}];return bt.forEach(function(wt){for(xt=0;gt=wt.regex.exec(Ye);){var It=gt[1].trim();if(At=Et(It),At===void 0)if(typeof vt=="function"){var Rt=vt(Ye,gt,ft);At=typeof Rt=="string"?Rt:""}else if(ft&&ft.hasOwnProperty(It))At="";else if(kt){At=gt[0];continue}else ht.logger.warn("missed to pass in variable ".concat(It," for interpolating ").concat(Ye)),At="";else typeof At!="string"&&!ht.useRawValueToEscape&&(At=makeString(At));var Tt=wt.safeValue(At);if(Ye=Ye.replace(gt[0],Tt),kt?(wt.regex.lastIndex+=At.length,wt.regex.lastIndex-=gt[0].length):wt.regex.lastIndex=0,xt++,xt>=ht.maxReplaces)break}}),Ye}},{key:"nest",value:function(Ye,tt){var nt=this,ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ht,gt,At=_objectSpread$3$1({},ft);At.applyPostProcessor=!1,delete At.defaultValue;function xt(vt,kt){var bt=this.nestingOptionsSeparator;if(vt.indexOf(bt)<0)return vt;var wt=vt.split(new RegExp("".concat(bt,"[ ]*{"))),It="{".concat(wt[1]);vt=wt[0],It=this.interpolate(It,At);var Rt=It.match(/'/g),Tt=It.match(/"/g);(Rt&&Rt.length%2===0&&!Tt||Tt.length%2!==0)&&(It=It.replace(/'/g,'"'));try{At=JSON.parse(It),kt&&(At=_objectSpread$3$1(_objectSpread$3$1({},kt),At))}catch(Bt){return this.logger.warn("failed parsing options string in nesting for key ".concat(vt),Bt),"".concat(vt).concat(bt).concat(It)}return delete At.defaultValue,vt}for(;ht=this.nestingRegexp.exec(Ye);){var yt=[],Ct=!1;if(ht[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(ht[1])){var Et=ht[1].split(this.formatSeparator).map(function(vt){return vt.trim()});ht[1]=Et.shift(),yt=Et,Ct=!0}if(gt=tt(xt.call(this,ht[1].trim(),At),At),gt&&ht[0]===Ye&&typeof gt!="string")return gt;typeof gt!="string"&&(gt=makeString(gt)),gt||(this.logger.warn("missed to resolve ".concat(ht[1]," for nesting ").concat(Ye)),gt=""),Ct&&(gt=yt.reduce(function(vt,kt){return nt.format(vt,kt,ft.lng,_objectSpread$3$1(_objectSpread$3$1({},ft),{},{interpolationkey:ht[1].trim()}))},gt.trim())),Ye=Ye.replace(ht[0],gt),this.regexp.lastIndex=0}return Ye}}]),Be}();function ownKeys$4$1(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$4$1(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$4$1(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$4$1(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}function parseFormatStr(Be){var Le=Be.toLowerCase().trim(),Ye={};if(Be.indexOf("(")>-1){var tt=Be.split("(");Le=tt[0].toLowerCase().trim();var nt=tt[1].substring(0,tt[1].length-1);if(Le==="currency"&&nt.indexOf(":")<0)Ye.currency||(Ye.currency=nt.trim());else if(Le==="relativetime"&&nt.indexOf(":")<0)Ye.range||(Ye.range=nt.trim());else{var ft=nt.split(";");ft.forEach(function(ht){if(ht){var gt=ht.split(":"),At=_toArray(gt),xt=At[0],yt=At.slice(1),Ct=yt.join(":").trim().replace(/^'+|'+$/g,"");Ye[xt.trim()]||(Ye[xt.trim()]=Ct),Ct==="false"&&(Ye[xt.trim()]=!1),Ct==="true"&&(Ye[xt.trim()]=!0),isNaN(Ct)||(Ye[xt.trim()]=parseInt(Ct,10))}})}}return{formatName:Le,formatOptions:Ye}}function createCachedFormatter(Be){var Le={};return function(tt,nt,ft){var ht=nt+JSON.stringify(ft),gt=Le[ht];return gt||(gt=Be(nt,ft),Le[ht]=gt),gt(tt)}}var Formatter$1=function(){function Be(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$m(this,Be),this.logger=baseLogger.create("formatter"),this.options=Le,this.formats={number:createCachedFormatter(function(Ye,tt){var nt=new Intl.NumberFormat(Ye,tt);return function(ft){return nt.format(ft)}}),currency:createCachedFormatter(function(Ye,tt){var nt=new Intl.NumberFormat(Ye,_objectSpread$4$1(_objectSpread$4$1({},tt),{},{style:"currency"}));return function(ft){return nt.format(ft)}}),datetime:createCachedFormatter(function(Ye,tt){var nt=new Intl.DateTimeFormat(Ye,_objectSpread$4$1({},tt));return function(ft){return nt.format(ft)}}),relativetime:createCachedFormatter(function(Ye,tt){var nt=new Intl.RelativeTimeFormat(Ye,_objectSpread$4$1({},tt));return function(ft){return nt.format(ft,tt.range||"day")}}),list:createCachedFormatter(function(Ye,tt){var nt=new Intl.ListFormat(Ye,_objectSpread$4$1({},tt));return function(ft){return nt.format(ft)}})},this.init(Le)}return _createClass$l(Be,[{key:"init",value:function(Ye){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},nt=tt.interpolation;this.formatSeparator=nt.formatSeparator?nt.formatSeparator:nt.formatSeparator||","}},{key:"add",value:function(Ye,tt){this.formats[Ye.toLowerCase().trim()]=tt}},{key:"addCached",value:function(Ye,tt){this.formats[Ye.toLowerCase().trim()]=createCachedFormatter(tt)}},{key:"format",value:function(Ye,tt,nt,ft){var ht=this,gt=tt.split(this.formatSeparator),At=gt.reduce(function(xt,yt){var Ct=parseFormatStr(yt),Et=Ct.formatName,vt=Ct.formatOptions;if(ht.formats[Et]){var kt=xt;try{var bt=ft&&ft.formatParams&&ft.formatParams[ft.interpolationkey]||{},wt=bt.locale||bt.lng||ft.locale||ft.lng||nt;kt=ht.formats[Et](xt,wt,_objectSpread$4$1(_objectSpread$4$1(_objectSpread$4$1({},vt),ft),bt))}catch(It){ht.logger.warn(It)}return kt}else ht.logger.warn("there was no format function for ".concat(Et));return xt},Ye);return At}}]),Be}();function ownKeys$5$1(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$5$1(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$5$1(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$5$1(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}function _createSuper$2(Be){var Le=_isNativeReflectConstruct$2();return function(){var tt=_getPrototypeOf$1(Be),nt;if(Le){var ft=_getPrototypeOf$1(this).constructor;nt=Reflect.construct(tt,arguments,ft)}else nt=tt.apply(this,arguments);return _possibleConstructorReturn$c(this,nt)}}function _isNativeReflectConstruct$2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function removePending(Be,Le){Be.pending[Le]!==void 0&&(delete Be.pending[Le],Be.pendingCount--)}var Connector=function(Be){_inherits$c(Ye,Be);var Le=_createSuper$2(Ye);function Ye(tt,nt,ft){var ht,gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return _classCallCheck$m(this,Ye),ht=Le.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(ht)),ht.backend=tt,ht.store=nt,ht.services=ft,ht.languageUtils=ft.languageUtils,ht.options=gt,ht.logger=baseLogger.create("backendConnector"),ht.waitingReads=[],ht.maxParallelReads=gt.maxParallelReads||10,ht.readingCalls=0,ht.maxRetries=gt.maxRetries>=0?gt.maxRetries:5,ht.retryTimeout=gt.retryTimeout>=1?gt.retryTimeout:350,ht.state={},ht.queue=[],ht.backend&&ht.backend.init&&ht.backend.init(ft,gt.backend,gt),ht}return _createClass$l(Ye,[{key:"queueLoad",value:function(nt,ft,ht,gt){var At=this,xt={},yt={},Ct={},Et={};return nt.forEach(function(vt){var kt=!0;ft.forEach(function(bt){var wt="".concat(vt,"|").concat(bt);!ht.reload&&At.store.hasResourceBundle(vt,bt)?At.state[wt]=2:At.state[wt]<0||(At.state[wt]===1?yt[wt]===void 0&&(yt[wt]=!0):(At.state[wt]=1,kt=!1,yt[wt]===void 0&&(yt[wt]=!0),xt[wt]===void 0&&(xt[wt]=!0),Et[bt]===void 0&&(Et[bt]=!0)))}),kt||(Ct[vt]=!0)}),(Object.keys(xt).length||Object.keys(yt).length)&&this.queue.push({pending:yt,pendingCount:Object.keys(yt).length,loaded:{},errors:[],callback:gt}),{toLoad:Object.keys(xt),pending:Object.keys(yt),toLoadLanguages:Object.keys(Ct),toLoadNamespaces:Object.keys(Et)}}},{key:"loaded",value:function(nt,ft,ht){var gt=nt.split("|"),At=gt[0],xt=gt[1];ft&&this.emit("failedLoading",At,xt,ft),ht&&this.store.addResourceBundle(At,xt,ht),this.state[nt]=ft?-1:2;var yt={};this.queue.forEach(function(Ct){pushPath(Ct.loaded,[At],xt),removePending(Ct,nt),ft&&Ct.errors.push(ft),Ct.pendingCount===0&&!Ct.done&&(Object.keys(Ct.loaded).forEach(function(Et){yt[Et]||(yt[Et]={});var vt=Ct.loaded[Et];vt.length&&vt.forEach(function(kt){yt[Et][kt]===void 0&&(yt[Et][kt]=!0)})}),Ct.done=!0,Ct.errors.length?Ct.callback(Ct.errors):Ct.callback())}),this.emit("loaded",yt),this.queue=this.queue.filter(function(Ct){return!Ct.done})}},{key:"read",value:function(nt,ft,ht){var gt=this,At=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,xt=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,yt=arguments.length>5?arguments[5]:void 0;if(!nt.length)return yt(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:nt,ns:ft,fcName:ht,tried:At,wait:xt,callback:yt});return}return this.readingCalls++,this.backend[ht](nt,ft,function(Ct,Et){if(gt.readingCalls--,gt.waitingReads.length>0){var vt=gt.waitingReads.shift();gt.read(vt.lng,vt.ns,vt.fcName,vt.tried,vt.wait,vt.callback)}if(Ct&&Et&&At<gt.maxRetries){setTimeout(function(){gt.read.call(gt,nt,ft,ht,At+1,xt*2,yt)},xt);return}yt(Ct,Et)})}},{key:"prepareLoading",value:function(nt,ft){var ht=this,gt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},At=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),At&&At();typeof nt=="string"&&(nt=this.languageUtils.toResolveHierarchy(nt)),typeof ft=="string"&&(ft=[ft]);var xt=this.queueLoad(nt,ft,gt,At);if(!xt.toLoad.length)return xt.pending.length||At(),null;xt.toLoad.forEach(function(yt){ht.loadOne(yt)})}},{key:"load",value:function(nt,ft,ht){this.prepareLoading(nt,ft,{},ht)}},{key:"reload",value:function(nt,ft,ht){this.prepareLoading(nt,ft,{reload:!0},ht)}},{key:"loadOne",value:function(nt){var ft=this,ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",gt=nt.split("|"),At=gt[0],xt=gt[1];this.read(At,xt,"read",void 0,void 0,function(yt,Ct){yt&&ft.logger.warn("".concat(ht,"loading namespace ").concat(xt," for language ").concat(At," failed"),yt),!yt&&Ct&&ft.logger.log("".concat(ht,"loaded namespace ").concat(xt," for language ").concat(At),Ct),ft.loaded(nt,yt,Ct)})}},{key:"saveMissing",value:function(nt,ft,ht,gt,At){var xt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(ft)){this.logger.warn('did not save key "'.concat(ht,'" as the namespace "').concat(ft,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}ht==null||ht===""||(this.backend&&this.backend.create&&this.backend.create(nt,ft,ht,gt,null,_objectSpread$5$1(_objectSpread$5$1({},xt),{},{isUpdate:At})),!(!nt||!nt[0])&&this.store.addResource(nt[0],ft,ht,gt))}}]),Ye}(EventEmitter$6);function get$1(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(Le){var Ye={};if(_typeof$k(Le[1])==="object"&&(Ye=Le[1]),typeof Le[1]=="string"&&(Ye.defaultValue=Le[1]),typeof Le[2]=="string"&&(Ye.tDescription=Le[2]),_typeof$k(Le[2])==="object"||_typeof$k(Le[3])==="object"){var tt=Le[3]||Le[2];Object.keys(tt).forEach(function(nt){Ye[nt]=tt[nt]})}return Ye},interpolation:{escapeValue:!0,format:function(Le,Ye,tt,nt){return Le},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(Be){return typeof Be.ns=="string"&&(Be.ns=[Be.ns]),typeof Be.fallbackLng=="string"&&(Be.fallbackLng=[Be.fallbackLng]),typeof Be.fallbackNS=="string"&&(Be.fallbackNS=[Be.fallbackNS]),Be.supportedLngs&&Be.supportedLngs.indexOf("cimode")<0&&(Be.supportedLngs=Be.supportedLngs.concat(["cimode"])),Be}function ownKeys$6$1(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$6$1(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$6$1(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$6$1(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}function _createSuper$3(Be){var Le=_isNativeReflectConstruct$3();return function(){var tt=_getPrototypeOf$1(Be),nt;if(Le){var ft=_getPrototypeOf$1(this).constructor;nt=Reflect.construct(tt,arguments,ft)}else nt=tt.apply(this,arguments);return _possibleConstructorReturn$c(this,nt)}}function _isNativeReflectConstruct$3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function noop$2(){}function bindMemberFunctions(Be){var Le=Object.getOwnPropertyNames(Object.getPrototypeOf(Be));Le.forEach(function(Ye){typeof Be[Ye]=="function"&&(Be[Ye]=Be[Ye].bind(Be))})}var I18n=function(Be){_inherits$c(Ye,Be);var Le=_createSuper$3(Ye);function Ye(){var tt,nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ft=arguments.length>1?arguments[1]:void 0;if(_classCallCheck$m(this,Ye),tt=Le.call(this),isIE10&&EventEmitter$6.call(_assertThisInitialized$1(tt)),tt.options=transformOptions(nt),tt.services={},tt.logger=baseLogger,tt.modules={external:[]},bindMemberFunctions(_assertThisInitialized$1(tt)),ft&&!tt.isInitialized&&!nt.isClone){if(!tt.options.initImmediate)return tt.init(nt,ft),_possibleConstructorReturn$c(tt,_assertThisInitialized$1(tt));setTimeout(function(){tt.init(nt,ft)},0)}return tt}return _createClass$l(Ye,[{key:"init",value:function(){var nt=this,ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ht=arguments.length>1?arguments[1]:void 0;typeof ft=="function"&&(ht=ft,ft={}),!ft.defaultNS&&ft.defaultNS!==!1&&ft.ns&&(typeof ft.ns=="string"?ft.defaultNS=ft.ns:ft.ns.indexOf("translation")<0&&(ft.defaultNS=ft.ns[0]));var gt=get$1();this.options=_objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({},gt),this.options),transformOptions(ft)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=_objectSpread$6$1(_objectSpread$6$1({},gt.interpolation),this.options.interpolation)),ft.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=ft.keySeparator),ft.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=ft.nsSeparator);function At(It){return It?typeof It=="function"?new It:It:null}if(!this.options.isClone){this.modules.logger?baseLogger.init(At(this.modules.logger),this.options):baseLogger.init(null,this.options);var xt;this.modules.formatter?xt=this.modules.formatter:typeof Intl<"u"&&(xt=Formatter$1);var yt=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var Ct=this.services;Ct.logger=baseLogger,Ct.resourceStore=this.store,Ct.languageUtils=yt,Ct.pluralResolver=new PluralResolver(yt,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),xt&&(!this.options.interpolation.format||this.options.interpolation.format===gt.interpolation.format)&&(Ct.formatter=At(xt),Ct.formatter.init(Ct,this.options),this.options.interpolation.format=Ct.formatter.format.bind(Ct.formatter)),Ct.interpolator=new Interpolator(this.options),Ct.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},Ct.backendConnector=new Connector(At(this.modules.backend),Ct.resourceStore,Ct,this.options),Ct.backendConnector.on("*",function(It){for(var Rt=arguments.length,Tt=new Array(Rt>1?Rt-1:0),Bt=1;Bt<Rt;Bt++)Tt[Bt-1]=arguments[Bt];nt.emit.apply(nt,[It].concat(Tt))}),this.modules.languageDetector&&(Ct.languageDetector=At(this.modules.languageDetector),Ct.languageDetector.init(Ct,this.options.detection,this.options)),this.modules.i18nFormat&&(Ct.i18nFormat=At(this.modules.i18nFormat),Ct.i18nFormat.init&&Ct.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(It){for(var Rt=arguments.length,Tt=new Array(Rt>1?Rt-1:0),Bt=1;Bt<Rt;Bt++)Tt[Bt-1]=arguments[Bt];nt.emit.apply(nt,[It].concat(Tt))}),this.modules.external.forEach(function(It){It.init&&It.init(nt)})}if(this.format=this.options.interpolation.format,ht||(ht=noop$2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var Et=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);Et.length>0&&Et[0]!=="dev"&&(this.options.lng=Et[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var vt=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];vt.forEach(function(It){nt[It]=function(){var Rt;return(Rt=nt.store)[It].apply(Rt,arguments)}});var kt=["addResource","addResources","addResourceBundle","removeResourceBundle"];kt.forEach(function(It){nt[It]=function(){var Rt;return(Rt=nt.store)[It].apply(Rt,arguments),nt}});var bt=defer(),wt=function(){var Rt=function(Bt,Pt){nt.isInitialized&&!nt.initializedStoreOnce&&nt.logger.warn("init: i18next is already initialized. You should call init just once!"),nt.isInitialized=!0,nt.options.isClone||nt.logger.log("initialized",nt.options),nt.emit("initialized",nt.options),bt.resolve(Pt),ht(Bt,Pt)};if(nt.languages&&nt.options.compatibilityAPI!=="v1"&&!nt.isInitialized)return Rt(null,nt.t.bind(nt));nt.changeLanguage(nt.options.lng,Rt)};return this.options.resources||!this.options.initImmediate?wt():setTimeout(wt,0),bt}},{key:"loadResources",value:function(nt){var ft=this,ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$2,gt=ht,At=typeof nt=="string"?nt:this.language;if(typeof nt=="function"&&(gt=nt),!this.options.resources||this.options.partialBundledLanguages){if(At&&At.toLowerCase()==="cimode")return gt();var xt=[],yt=function(vt){if(vt){var kt=ft.services.languageUtils.toResolveHierarchy(vt);kt.forEach(function(bt){xt.indexOf(bt)<0&&xt.push(bt)})}};if(At)yt(At);else{var Ct=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);Ct.forEach(function(Et){return yt(Et)})}this.options.preload&&this.options.preload.forEach(function(Et){return yt(Et)}),this.services.backendConnector.load(xt,this.options.ns,function(Et){!Et&&!ft.resolvedLanguage&&ft.language&&ft.setResolvedLanguage(ft.language),gt(Et)})}else gt(null)}},{key:"reloadResources",value:function(nt,ft,ht){var gt=defer();return nt||(nt=this.languages),ft||(ft=this.options.ns),ht||(ht=noop$2),this.services.backendConnector.reload(nt,ft,function(At){gt.resolve(),ht(At)}),gt}},{key:"use",value:function(nt){if(!nt)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!nt.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return nt.type==="backend"&&(this.modules.backend=nt),(nt.type==="logger"||nt.log&&nt.warn&&nt.error)&&(this.modules.logger=nt),nt.type==="languageDetector"&&(this.modules.languageDetector=nt),nt.type==="i18nFormat"&&(this.modules.i18nFormat=nt),nt.type==="postProcessor"&&postProcessor.addPostProcessor(nt),nt.type==="formatter"&&(this.modules.formatter=nt),nt.type==="3rdParty"&&this.modules.external.push(nt),this}},{key:"setResolvedLanguage",value:function(nt){if(!(!nt||!this.languages)&&!(["cimode","dev"].indexOf(nt)>-1))for(var ft=0;ft<this.languages.length;ft++){var ht=this.languages[ft];if(!(["cimode","dev"].indexOf(ht)>-1)&&this.store.hasLanguageSomeTranslations(ht)){this.resolvedLanguage=ht;break}}}},{key:"changeLanguage",value:function(nt,ft){var ht=this;this.isLanguageChangingTo=nt;var gt=defer();this.emit("languageChanging",nt);var At=function(Et){ht.language=Et,ht.languages=ht.services.languageUtils.toResolveHierarchy(Et),ht.resolvedLanguage=void 0,ht.setResolvedLanguage(Et)},xt=function(Et,vt){vt?(At(vt),ht.translator.changeLanguage(vt),ht.isLanguageChangingTo=void 0,ht.emit("languageChanged",vt),ht.logger.log("languageChanged",vt)):ht.isLanguageChangingTo=void 0,gt.resolve(function(){return ht.t.apply(ht,arguments)}),ft&&ft(Et,function(){return ht.t.apply(ht,arguments)})},yt=function(Et){!nt&&!Et&&ht.services.languageDetector&&(Et=[]);var vt=typeof Et=="string"?Et:ht.services.languageUtils.getBestMatchFromCodes(Et);vt&&(ht.language||At(vt),ht.translator.language||ht.translator.changeLanguage(vt),ht.services.languageDetector&&ht.services.languageDetector.cacheUserLanguage(vt)),ht.loadResources(vt,function(kt){xt(kt,vt)})};return!nt&&this.services.languageDetector&&!this.services.languageDetector.async?yt(this.services.languageDetector.detect()):!nt&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(yt):yt(nt),gt}},{key:"getFixedT",value:function(nt,ft,ht){var gt=this,At=function xt(yt,Ct){var Et;if(_typeof$k(Ct)!=="object"){for(var vt=arguments.length,kt=new Array(vt>2?vt-2:0),bt=2;bt<vt;bt++)kt[bt-2]=arguments[bt];Et=gt.options.overloadTranslationOptionHandler([yt,Ct].concat(kt))}else Et=_objectSpread$6$1({},Ct);Et.lng=Et.lng||xt.lng,Et.lngs=Et.lngs||xt.lngs,Et.ns=Et.ns||xt.ns,Et.keyPrefix=Et.keyPrefix||ht||xt.keyPrefix;var wt=gt.options.keySeparator||".",It=Et.keyPrefix?"".concat(Et.keyPrefix).concat(wt).concat(yt):yt;return gt.t(It,Et)};return typeof nt=="string"?At.lng=nt:At.lngs=nt,At.ns=ft,At.keyPrefix=ht,At}},{key:"t",value:function(){var nt;return this.translator&&(nt=this.translator).translate.apply(nt,arguments)}},{key:"exists",value:function(){var nt;return this.translator&&(nt=this.translator).exists.apply(nt,arguments)}},{key:"setDefaultNamespace",value:function(nt){this.options.defaultNS=nt}},{key:"hasLoadedNamespace",value:function(nt){var ft=this,ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var gt=this.resolvedLanguage||this.languages[0],At=this.options?this.options.fallbackLng:!1,xt=this.languages[this.languages.length-1];if(gt.toLowerCase()==="cimode")return!0;var yt=function(vt,kt){var bt=ft.services.backendConnector.state["".concat(vt,"|").concat(kt)];return bt===-1||bt===2};if(ht.precheck){var Ct=ht.precheck(this,yt);if(Ct!==void 0)return Ct}return!!(this.hasResourceBundle(gt,nt)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||yt(gt,nt)&&(!At||yt(xt,nt)))}},{key:"loadNamespaces",value:function(nt,ft){var ht=this,gt=defer();return this.options.ns?(typeof nt=="string"&&(nt=[nt]),nt.forEach(function(At){ht.options.ns.indexOf(At)<0&&ht.options.ns.push(At)}),this.loadResources(function(At){gt.resolve(),ft&&ft(At)}),gt):(ft&&ft(),Promise.resolve())}},{key:"loadLanguages",value:function(nt,ft){var ht=defer();typeof nt=="string"&&(nt=[nt]);var gt=this.options.preload||[],At=nt.filter(function(xt){return gt.indexOf(xt)<0});return At.length?(this.options.preload=gt.concat(At),this.loadResources(function(xt){ht.resolve(),ft&&ft(xt)}),ht):(ft&&ft(),Promise.resolve())}},{key:"dir",value:function(nt){if(nt||(nt=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!nt)return"rtl";var ft=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return ft.indexOf(this.services.languageUtils.getLanguagePartFromCode(nt))>-1||nt.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var nt=this,ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$2,gt=_objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({},this.options),ft),{isClone:!0}),At=new Ye(gt);(ft.debug!==void 0||ft.prefix!==void 0)&&(At.logger=At.logger.clone(ft));var xt=["store","services","language"];return xt.forEach(function(yt){At[yt]=nt[yt]}),At.services=_objectSpread$6$1({},this.services),At.services.utils={hasLoadedNamespace:At.hasLoadedNamespace.bind(At)},At.translator=new Translator(At.services,At.options),At.translator.on("*",function(yt){for(var Ct=arguments.length,Et=new Array(Ct>1?Ct-1:0),vt=1;vt<Ct;vt++)Et[vt-1]=arguments[vt];At.emit.apply(At,[yt].concat(Et))}),At.init(gt,ht),At.translator.options=At.options,At.translator.backendConnector.services.utils={hasLoadedNamespace:At.hasLoadedNamespace.bind(At)},At}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),Ye}(EventEmitter$6);_defineProperty$6(I18n,"createInstance",function(){var Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Le=arguments.length>1?arguments[1]:void 0;return new I18n(Be,Le)});var instance=I18n.createInstance();instance.createInstance=I18n.createInstance,instance.createInstance,instance.init,instance.loadResources,instance.reloadResources,instance.use,instance.changeLanguage,instance.getFixedT,instance.t,instance.exists,instance.setDefaultNamespace,instance.hasLoadedNamespace,instance.loadNamespaces,instance.loadLanguages;var arr$1=[],each$1=arr$1.forEach,slice$2=arr$1.slice;function defaults$3(Be){return each$1.call(slice$2.call(arguments,1),function(Le){if(Le)for(var Ye in Le)Be[Ye]===void 0&&(Be[Ye]=Le[Ye])}),Be}var fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,serializeCookie=function(Le,Ye,tt){var nt=tt||{};nt.path=nt.path||"/";var ft=encodeURIComponent(Ye),ht="".concat(Le,"=").concat(ft);if(nt.maxAge>0){var gt=nt.maxAge-0;if(Number.isNaN(gt))throw new Error("maxAge should be a Number");ht+="; Max-Age=".concat(Math.floor(gt))}if(nt.domain){if(!fieldContentRegExp.test(nt.domain))throw new TypeError("option domain is invalid");ht+="; Domain=".concat(nt.domain)}if(nt.path){if(!fieldContentRegExp.test(nt.path))throw new TypeError("option path is invalid");ht+="; Path=".concat(nt.path)}if(nt.expires){if(typeof nt.expires.toUTCString!="function")throw new TypeError("option expires is invalid");ht+="; Expires=".concat(nt.expires.toUTCString())}if(nt.httpOnly&&(ht+="; HttpOnly"),nt.secure&&(ht+="; Secure"),nt.sameSite){var At=typeof nt.sameSite=="string"?nt.sameSite.toLowerCase():nt.sameSite;switch(At){case!0:ht+="; SameSite=Strict";break;case"lax":ht+="; SameSite=Lax";break;case"strict":ht+="; SameSite=Strict";break;case"none":ht+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return ht},cookie={create:function(Le,Ye,tt,nt){var ft=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};tt&&(ft.expires=new Date,ft.expires.setTime(ft.expires.getTime()+tt*60*1e3)),nt&&(ft.domain=nt),document.cookie=serializeCookie(Le,encodeURIComponent(Ye),ft)},read:function(Le){for(var Ye="".concat(Le,"="),tt=document.cookie.split(";"),nt=0;nt<tt.length;nt++){for(var ft=tt[nt];ft.charAt(0)===" ";)ft=ft.substring(1,ft.length);if(ft.indexOf(Ye)===0)return ft.substring(Ye.length,ft.length)}return null},remove:function(Le){this.create(Le,"",-1)}},cookie$1={name:"cookie",lookup:function(Le){var Ye;if(Le.lookupCookie&&typeof document<"u"){var tt=cookie.read(Le.lookupCookie);tt&&(Ye=tt)}return Ye},cacheUserLanguage:function(Le,Ye){Ye.lookupCookie&&typeof document<"u"&&cookie.create(Ye.lookupCookie,Le,Ye.cookieMinutes,Ye.cookieDomain,Ye.cookieOptions)}},querystring={name:"querystring",lookup:function(Le){var Ye;if(typeof window<"u"){var tt=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(tt=window.location.hash.substring(window.location.hash.indexOf("?")));for(var nt=tt.substring(1),ft=nt.split("&"),ht=0;ht<ft.length;ht++){var gt=ft[ht].indexOf("=");if(gt>0){var At=ft[ht].substring(0,gt);At===Le.lookupQuerystring&&(Ye=ft[ht].substring(gt+1))}}}return Ye}},hasLocalStorageSupport=null,localStorageAvailable=function(){if(hasLocalStorageSupport!==null)return hasLocalStorageSupport;try{hasLocalStorageSupport=window!=="undefined"&&window.localStorage!==null;var Le="i18next.translate.boo";window.localStorage.setItem(Le,"foo"),window.localStorage.removeItem(Le)}catch{hasLocalStorageSupport=!1}return hasLocalStorageSupport},localStorage$1={name:"localStorage",lookup:function(Le){var Ye;if(Le.lookupLocalStorage&&localStorageAvailable()){var tt=window.localStorage.getItem(Le.lookupLocalStorage);tt&&(Ye=tt)}return Ye},cacheUserLanguage:function(Le,Ye){Ye.lookupLocalStorage&&localStorageAvailable()&&window.localStorage.setItem(Ye.lookupLocalStorage,Le)}},hasSessionStorageSupport=null,sessionStorageAvailable=function(){if(hasSessionStorageSupport!==null)return hasSessionStorageSupport;try{hasSessionStorageSupport=window!=="undefined"&&window.sessionStorage!==null;var Le="i18next.translate.boo";window.sessionStorage.setItem(Le,"foo"),window.sessionStorage.removeItem(Le)}catch{hasSessionStorageSupport=!1}return hasSessionStorageSupport},sessionStorage$1={name:"sessionStorage",lookup:function(Le){var Ye;if(Le.lookupSessionStorage&&sessionStorageAvailable()){var tt=window.sessionStorage.getItem(Le.lookupSessionStorage);tt&&(Ye=tt)}return Ye},cacheUserLanguage:function(Le,Ye){Ye.lookupSessionStorage&&sessionStorageAvailable()&&window.sessionStorage.setItem(Ye.lookupSessionStorage,Le)}},navigator$1={name:"navigator",lookup:function(Le){var Ye=[];if(typeof navigator<"u"){if(navigator.languages)for(var tt=0;tt<navigator.languages.length;tt++)Ye.push(navigator.languages[tt]);navigator.userLanguage&&Ye.push(navigator.userLanguage),navigator.language&&Ye.push(navigator.language)}return Ye.length>0?Ye:void 0}},htmlTag={name:"htmlTag",lookup:function(Le){var Ye,tt=Le.htmlTag||(typeof document<"u"?document.documentElement:null);return tt&&typeof tt.getAttribute=="function"&&(Ye=tt.getAttribute("lang")),Ye}},path={name:"path",lookup:function(Le){var Ye;if(typeof window<"u"){var tt=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(tt instanceof Array)if(typeof Le.lookupFromPathIndex=="number"){if(typeof tt[Le.lookupFromPathIndex]!="string")return;Ye=tt[Le.lookupFromPathIndex].replace("/","")}else Ye=tt[0].replace("/","")}return Ye}},subdomain={name:"subdomain",lookup:function(Le){var Ye=typeof Le.lookupFromSubdomainIndex=="number"?Le.lookupFromSubdomainIndex+1:1,tt=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(tt)return tt[Ye]}};function getDefaults$3(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Browser=function(){function Be(Le){var Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,Be),this.type="languageDetector",this.detectors={},this.init(Le,Ye)}return _createClass$l(Be,[{key:"init",value:function(Ye){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=Ye,this.options=defaults$3(tt,this.options||{},getDefaults$3()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=nt,this.addDetector(cookie$1),this.addDetector(querystring),this.addDetector(localStorage$1),this.addDetector(sessionStorage$1),this.addDetector(navigator$1),this.addDetector(htmlTag),this.addDetector(path),this.addDetector(subdomain)}},{key:"addDetector",value:function(Ye){this.detectors[Ye.name]=Ye}},{key:"detect",value:function(Ye){var tt=this;Ye||(Ye=this.options.order);var nt=[];return Ye.forEach(function(ft){if(tt.detectors[ft]){var ht=tt.detectors[ft].lookup(tt.options);ht&&typeof ht=="string"&&(ht=[ht]),ht&&(nt=nt.concat(ht))}}),this.services.languageUtils.getBestMatchFromCodes?nt:nt.length>0?nt[0]:null}},{key:"cacheUserLanguage",value:function(Ye,tt){var nt=this;tt||(tt=this.options.caches),tt&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(Ye)>-1||tt.forEach(function(ft){nt.detectors[ft]&&nt.detectors[ft].cacheUserLanguage(Ye,nt.options)}))}}]),Be}();Browser.type="languageDetector";function _typeof$j(Be){"@babel/helpers - typeof";return _typeof$j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$j(Be)}var arr=[],each=arr.forEach,slice$1=arr.slice;function defaults$2(Be){return each.call(slice$1.call(arguments,1),function(Le){if(Le)for(var Ye in Le)Be[Ye]===void 0&&(Be[Ye]=Le[Ye])}),Be}function hasXMLHttpRequest(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":_typeof$j(XMLHttpRequest))==="object"}function isPromise(Be){return!!Be&&typeof Be.then=="function"}function makePromise(Be){return isPromise(Be)?Be:Promise.resolve(Be)}function commonjsRequire(Be){throw new Error('Could not dynamically require "'+Be+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var getFetch$2={exports:{}},browserPonyfill={exports:{}},hasRequiredBrowserPonyfill;function requireBrowserPonyfill(){return hasRequiredBrowserPonyfill||(hasRequiredBrowserPonyfill=1,function(Be,Le){var Ye=typeof self<"u"?self:commonjsGlobal,tt=function(){function ft(){this.fetch=!1,this.DOMException=Ye.DOMException}return ft.prototype=Ye,new ft}();(function(ft){(function(ht){var gt={searchParams:"URLSearchParams"in ft,iterable:"Symbol"in ft&&"iterator"in Symbol,blob:"FileReader"in ft&&"Blob"in ft&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in ft,arrayBuffer:"ArrayBuffer"in ft};function At(Ft){return Ft&&DataView.prototype.isPrototypeOf(Ft)}if(gt.arrayBuffer)var xt=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],yt=ArrayBuffer.isView||function(Ft){return Ft&&xt.indexOf(Object.prototype.toString.call(Ft))>-1};function Ct(Ft){if(typeof Ft!="string"&&(Ft=String(Ft)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(Ft))throw new TypeError("Invalid character in header field name");return Ft.toLowerCase()}function Et(Ft){return typeof Ft!="string"&&(Ft=String(Ft)),Ft}function vt(Ft){var Xt={next:function(){var _t=Ft.shift();return{done:_t===void 0,value:_t}}};return gt.iterable&&(Xt[Symbol.iterator]=function(){return Xt}),Xt}function kt(Ft){this.map={},Ft instanceof kt?Ft.forEach(function(Xt,_t){this.append(_t,Xt)},this):Array.isArray(Ft)?Ft.forEach(function(Xt){this.append(Xt[0],Xt[1])},this):Ft&&Object.getOwnPropertyNames(Ft).forEach(function(Xt){this.append(Xt,Ft[Xt])},this)}kt.prototype.append=function(Ft,Xt){Ft=Ct(Ft),Xt=Et(Xt);var _t=this.map[Ft];this.map[Ft]=_t?_t+", "+Xt:Xt},kt.prototype.delete=function(Ft){delete this.map[Ct(Ft)]},kt.prototype.get=function(Ft){return Ft=Ct(Ft),this.has(Ft)?this.map[Ft]:null},kt.prototype.has=function(Ft){return this.map.hasOwnProperty(Ct(Ft))},kt.prototype.set=function(Ft,Xt){this.map[Ct(Ft)]=Et(Xt)},kt.prototype.forEach=function(Ft,Xt){for(var _t in this.map)this.map.hasOwnProperty(_t)&&Ft.call(Xt,this.map[_t],_t,this)},kt.prototype.keys=function(){var Ft=[];return this.forEach(function(Xt,_t){Ft.push(_t)}),vt(Ft)},kt.prototype.values=function(){var Ft=[];return this.forEach(function(Xt){Ft.push(Xt)}),vt(Ft)},kt.prototype.entries=function(){var Ft=[];return this.forEach(function(Xt,_t){Ft.push([_t,Xt])}),vt(Ft)},gt.iterable&&(kt.prototype[Symbol.iterator]=kt.prototype.entries);function bt(Ft){if(Ft.bodyUsed)return Promise.reject(new TypeError("Already read"));Ft.bodyUsed=!0}function wt(Ft){return new Promise(function(Xt,_t){Ft.onload=function(){Xt(Ft.result)},Ft.onerror=function(){_t(Ft.error)}})}function It(Ft){var Xt=new FileReader,_t=wt(Xt);return Xt.readAsArrayBuffer(Ft),_t}function Rt(Ft){var Xt=new FileReader,_t=wt(Xt);return Xt.readAsText(Ft),_t}function Tt(Ft){for(var Xt=new Uint8Array(Ft),_t=new Array(Xt.length),Mt=0;Mt<Xt.length;Mt++)_t[Mt]=String.fromCharCode(Xt[Mt]);return _t.join("")}function Bt(Ft){if(Ft.slice)return Ft.slice(0);var Xt=new Uint8Array(Ft.byteLength);return Xt.set(new Uint8Array(Ft)),Xt.buffer}function Pt(){return this.bodyUsed=!1,this._initBody=function(Ft){this._bodyInit=Ft,Ft?typeof Ft=="string"?this._bodyText=Ft:gt.blob&&Blob.prototype.isPrototypeOf(Ft)?this._bodyBlob=Ft:gt.formData&&FormData.prototype.isPrototypeOf(Ft)?this._bodyFormData=Ft:gt.searchParams&&URLSearchParams.prototype.isPrototypeOf(Ft)?this._bodyText=Ft.toString():gt.arrayBuffer&&gt.blob&&At(Ft)?(this._bodyArrayBuffer=Bt(Ft.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):gt.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Ft)||yt(Ft))?this._bodyArrayBuffer=Bt(Ft):this._bodyText=Ft=Object.prototype.toString.call(Ft):this._bodyText="",this.headers.get("content-type")||(typeof Ft=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):gt.searchParams&&URLSearchParams.prototype.isPrototypeOf(Ft)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},gt.blob&&(this.blob=function(){var Ft=bt(this);if(Ft)return Ft;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?bt(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(It)}),this.text=function(){var Ft=bt(this);if(Ft)return Ft;if(this._bodyBlob)return Rt(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Tt(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},gt.formData&&(this.formData=function(){return this.text().then(Wt)}),this.json=function(){return this.text().then(JSON.parse)},this}var Dt=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ot(Ft){var Xt=Ft.toUpperCase();return Dt.indexOf(Xt)>-1?Xt:Ft}function Lt(Ft,Xt){Xt=Xt||{};var _t=Xt.body;if(Ft instanceof Lt){if(Ft.bodyUsed)throw new TypeError("Already read");this.url=Ft.url,this.credentials=Ft.credentials,Xt.headers||(this.headers=new kt(Ft.headers)),this.method=Ft.method,this.mode=Ft.mode,this.signal=Ft.signal,!_t&&Ft._bodyInit!=null&&(_t=Ft._bodyInit,Ft.bodyUsed=!0)}else this.url=String(Ft);if(this.credentials=Xt.credentials||this.credentials||"same-origin",(Xt.headers||!this.headers)&&(this.headers=new kt(Xt.headers)),this.method=Ot(Xt.method||this.method||"GET"),this.mode=Xt.mode||this.mode||null,this.signal=Xt.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&_t)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(_t)}Lt.prototype.clone=function(){return new Lt(this,{body:this._bodyInit})};function Wt(Ft){var Xt=new FormData;return Ft.trim().split("&").forEach(function(_t){if(_t){var Mt=_t.split("="),jt=Mt.shift().replace(/\+/g," "),zt=Mt.join("=").replace(/\+/g," ");Xt.append(decodeURIComponent(jt),decodeURIComponent(zt))}}),Xt}function $t(Ft){var Xt=new kt,_t=Ft.replace(/\r?\n[\t ]+/g," ");return _t.split(/\r?\n/).forEach(function(Mt){var jt=Mt.split(":"),zt=jt.shift().trim();if(zt){var Gt=jt.join(":").trim();Xt.append(zt,Gt)}}),Xt}Pt.call(Lt.prototype);function qt(Ft,Xt){Xt||(Xt={}),this.type="default",this.status=Xt.status===void 0?200:Xt.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in Xt?Xt.statusText:"OK",this.headers=new kt(Xt.headers),this.url=Xt.url||"",this._initBody(Ft)}Pt.call(qt.prototype),qt.prototype.clone=function(){return new qt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new kt(this.headers),url:this.url})},qt.error=function(){var Ft=new qt(null,{status:0,statusText:""});return Ft.type="error",Ft};var Ht=[301,302,303,307,308];qt.redirect=function(Ft,Xt){if(Ht.indexOf(Xt)===-1)throw new RangeError("Invalid status code");return new qt(null,{status:Xt,headers:{location:Ft}})},ht.DOMException=ft.DOMException;try{new ht.DOMException}catch{ht.DOMException=function(Xt,_t){this.message=Xt,this.name=_t;var Mt=Error(Xt);this.stack=Mt.stack},ht.DOMException.prototype=Object.create(Error.prototype),ht.DOMException.prototype.constructor=ht.DOMException}function Ut(Ft,Xt){return new Promise(function(_t,Mt){var jt=new Lt(Ft,Xt);if(jt.signal&&jt.signal.aborted)return Mt(new ht.DOMException("Aborted","AbortError"));var zt=new XMLHttpRequest;function Gt(){zt.abort()}zt.onload=function(){var Yt={status:zt.status,statusText:zt.statusText,headers:$t(zt.getAllResponseHeaders()||"")};Yt.url="responseURL"in zt?zt.responseURL:Yt.headers.get("X-Request-URL");var ar="response"in zt?zt.response:zt.responseText;_t(new qt(ar,Yt))},zt.onerror=function(){Mt(new TypeError("Network request failed"))},zt.ontimeout=function(){Mt(new TypeError("Network request failed"))},zt.onabort=function(){Mt(new ht.DOMException("Aborted","AbortError"))},zt.open(jt.method,jt.url,!0),jt.credentials==="include"?zt.withCredentials=!0:jt.credentials==="omit"&&(zt.withCredentials=!1),"responseType"in zt&&gt.blob&&(zt.responseType="blob"),jt.headers.forEach(function(Yt,ar){zt.setRequestHeader(ar,Yt)}),jt.signal&&(jt.signal.addEventListener("abort",Gt),zt.onreadystatechange=function(){zt.readyState===4&&jt.signal.removeEventListener("abort",Gt)}),zt.send(typeof jt._bodyInit>"u"?null:jt._bodyInit)})}return Ut.polyfill=!0,ft.fetch||(ft.fetch=Ut,ft.Headers=kt,ft.Request=Lt,ft.Response=qt),ht.Headers=kt,ht.Request=Lt,ht.Response=qt,ht.fetch=Ut,Object.defineProperty(ht,"__esModule",{value:!0}),ht})({})})(tt),tt.fetch.ponyfill=!0,delete tt.fetch.polyfill;var nt=tt;Le=nt.fetch,Le.default=nt.fetch,Le.fetch=nt.fetch,Le.Headers=nt.Headers,Le.Request=nt.Request,Le.Response=nt.Response,Be.exports=Le}(browserPonyfill,browserPonyfill.exports)),browserPonyfill.exports}(function(Be,Le){var Ye;if(typeof fetch=="function"&&(typeof commonjsGlobal<"u"&&commonjsGlobal.fetch?Ye=commonjsGlobal.fetch:typeof window<"u"&&window.fetch?Ye=window.fetch:Ye=fetch),typeof commonjsRequire<"u"&&(typeof window>"u"||typeof window.document>"u")){var tt=Ye||requireBrowserPonyfill();tt.default&&(tt=tt.default),Le.default=tt,Be.exports=Le.default}})(getFetch$2,getFetch$2.exports);var getFetchExports=getFetch$2.exports;const getFetch$1=getDefaultExportFromCjs(getFetchExports),fetchNode=_mergeNamespaces({__proto__:null,default:getFetch$1},[getFetchExports]);function _typeof$i(Be){"@babel/helpers - typeof";return _typeof$i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Le){return typeof Le}:function(Le){return Le&&typeof Symbol=="function"&&Le.constructor===Symbol&&Le!==Symbol.prototype?"symbol":typeof Le},_typeof$i(Be)}var fetchApi;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?fetchApi=global.fetch:typeof window<"u"&&window.fetch?fetchApi=window.fetch:fetchApi=fetch);var XmlHttpRequestApi;hasXMLHttpRequest()&&(typeof global<"u"&&global.XMLHttpRequest?XmlHttpRequestApi=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(XmlHttpRequestApi=window.XMLHttpRequest));var ActiveXObjectApi;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ActiveXObjectApi=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ActiveXObjectApi=window.ActiveXObject)),!fetchApi&&fetchNode&&!XmlHttpRequestApi&&!ActiveXObjectApi&&(fetchApi=getFetch$1||fetchNode),typeof fetchApi!="function"&&(fetchApi=void 0);var addQueryString=function(Le,Ye){if(Ye&&_typeof$i(Ye)==="object"){var tt="";for(var nt in Ye)tt+="&"+encodeURIComponent(nt)+"="+encodeURIComponent(Ye[nt]);if(!tt)return Le;Le=Le+(Le.indexOf("?")!==-1?"&":"?")+tt.slice(1)}return Le},fetchIt=function(Le,Ye,tt){fetchApi(Le,Ye).then(function(nt){if(!nt.ok)return tt(nt.statusText||"Error",{status:nt.status});nt.text().then(function(ft){tt(null,{status:nt.status,data:ft})}).catch(tt)}).catch(tt)},omitFetchOptions=!1,requestWithFetch=function(Le,Ye,tt,nt){Le.queryStringParams&&(Ye=addQueryString(Ye,Le.queryStringParams));var ft=defaults$2({},typeof Le.customHeaders=="function"?Le.customHeaders():Le.customHeaders);tt&&(ft["Content-Type"]="application/json");var ht=typeof Le.requestOptions=="function"?Le.requestOptions(tt):Le.requestOptions,gt=defaults$2({method:tt?"POST":"GET",body:tt?Le.stringify(tt):void 0,headers:ft},omitFetchOptions?{}:ht);try{fetchIt(Ye,gt,nt)}catch(At){if(!ht||Object.keys(ht).length===0||!At.message||At.message.indexOf("not implemented")<0)return nt(At);try{Object.keys(ht).forEach(function(xt){delete gt[xt]}),fetchIt(Ye,gt,nt),omitFetchOptions=!0}catch(xt){nt(xt)}}},requestWithXmlHttpRequest=function(Le,Ye,tt,nt){tt&&_typeof$i(tt)==="object"&&(tt=addQueryString("",tt).slice(1)),Le.queryStringParams&&(Ye=addQueryString(Ye,Le.queryStringParams));try{var ft;XmlHttpRequestApi?ft=new XmlHttpRequestApi:ft=new ActiveXObjectApi("MSXML2.XMLHTTP.3.0"),ft.open(tt?"POST":"GET",Ye,1),Le.crossDomain||ft.setRequestHeader("X-Requested-With","XMLHttpRequest"),ft.withCredentials=!!Le.withCredentials,tt&&ft.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),ft.overrideMimeType&&ft.overrideMimeType("application/json");var ht=Le.customHeaders;if(ht=typeof ht=="function"?ht():ht,ht)for(var gt in ht)ft.setRequestHeader(gt,ht[gt]);ft.onreadystatechange=function(){ft.readyState>3&&nt(ft.status>=400?ft.statusText:null,{status:ft.status,data:ft.responseText})},ft.send(tt)}catch(At){console&&console.log(At)}},request=function(Le,Ye,tt,nt){if(typeof tt=="function"&&(nt=tt,tt=void 0),nt=nt||function(){},fetchApi)return requestWithFetch(Le,Ye,tt,nt);if(hasXMLHttpRequest()||typeof ActiveXObject=="function")return requestWithXmlHttpRequest(Le,Ye,tt,nt);nt(new Error("No fetch and no xhr implementation found!"))};function _classCallCheck$l(Be,Le){if(!(Be instanceof Le))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(Be,Le){for(var Ye=0;Ye<Le.length;Ye++){var tt=Le[Ye];tt.enumerable=tt.enumerable||!1,tt.configurable=!0,"value"in tt&&(tt.writable=!0),Object.defineProperty(Be,tt.key,tt)}}function _createClass$k(Be,Le,Ye){return Le&&_defineProperties$8(Be.prototype,Le),Object.defineProperty(Be,"prototype",{writable:!1}),Be}function _defineProperty$5(Be,Le,Ye){return Le in Be?Object.defineProperty(Be,Le,{value:Ye,enumerable:!0,configurable:!0,writable:!0}):Be[Le]=Ye,Be}var getDefaults$2=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(Ye){return JSON.parse(Ye)},stringify:JSON.stringify,parsePayload:function(Ye,tt,nt){return _defineProperty$5({},tt,nt||"")},request,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Backend=function(){function Be(Le){var Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck$l(this,Be),this.services=Le,this.options=Ye,this.allOptions=tt,this.type="backend",this.init(Le,Ye,tt)}return _createClass$k(Be,[{key:"init",value:function(Ye){var tt=this,nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=Ye,this.options=defaults$2(nt,this.options||{},getDefaults$2()),this.allOptions=ft,this.services&&this.options.reloadInterval&&setInterval(function(){return tt.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(Ye,tt,nt){this._readAny(Ye,Ye,tt,tt,nt)}},{key:"read",value:function(Ye,tt,nt){this._readAny([Ye],Ye,[tt],tt,nt)}},{key:"_readAny",value:function(Ye,tt,nt,ft,ht){var gt=this,At=this.options.loadPath;typeof this.options.loadPath=="function"&&(At=this.options.loadPath(Ye,nt)),At=makePromise(At),At.then(function(xt){if(!xt)return ht(null,{});var yt=gt.services.interpolator.interpolate(xt,{lng:Ye.join("+"),ns:nt.join("+")});gt.loadUrl(yt,ht,tt,ft)})}},{key:"loadUrl",value:function(Ye,tt,nt,ft){var ht=this;this.options.request(this.options,Ye,void 0,function(gt,At){if(At&&(At.status>=500&&At.status<600||!At.status))return tt("failed loading "+Ye+"; status code: "+At.status,!0);if(At&&At.status>=400&&At.status<500)return tt("failed loading "+Ye+"; status code: "+At.status,!1);if(!At&&gt&&gt.message&&gt.message.indexOf("Failed to fetch")>-1)return tt("failed loading "+Ye+": "+gt.message,!0);if(gt)return tt(gt,!1);var xt,yt;try{typeof At.data=="string"?xt=ht.options.parse(At.data,nt,ft):xt=At.data}catch{yt="failed parsing "+Ye+" to json"}if(yt)return tt(yt,!1);tt(null,xt)})}},{key:"create",value:function(Ye,tt,nt,ft,ht){var gt=this;if(this.options.addPath){typeof Ye=="string"&&(Ye=[Ye]);var At=this.options.parsePayload(tt,nt,ft),xt=0,yt=[],Ct=[];Ye.forEach(function(Et){var vt=gt.options.addPath;typeof gt.options.addPath=="function"&&(vt=gt.options.addPath(Et,tt));var kt=gt.services.interpolator.interpolate(vt,{lng:Et,ns:tt});gt.options.request(gt.options,kt,At,function(bt,wt){xt+=1,yt.push(bt),Ct.push(wt),xt===Ye.length&&ht&&ht(yt,Ct)})})}}},{key:"reload",value:function(){var Ye=this,tt=this.services,nt=tt.backendConnector,ft=tt.languageUtils,ht=tt.logger,gt=nt.language;if(!(gt&&gt.toLowerCase()==="cimode")){var At=[],xt=function(Ct){var Et=ft.toResolveHierarchy(Ct);Et.forEach(function(vt){At.indexOf(vt)<0&&At.push(vt)})};xt(gt),this.allOptions.preload&&this.allOptions.preload.forEach(function(yt){return xt(yt)}),At.forEach(function(yt){Ye.allOptions.ns.forEach(function(Ct){nt.read(yt,Ct,"read",null,null,function(Et,vt){Et&&ht.warn("loading namespace ".concat(Ct," for language ").concat(yt," failed"),Et),!Et&&vt&&ht.log("loaded namespace ".concat(Ct," for language ").concat(yt),vt),nt.loaded("".concat(yt,"|").concat(Ct),Et,vt)})})})}}}]),Be}();Backend.type="backend";function _objectWithoutPropertiesLoose$1(Be,Le){if(Be==null)return{};var Ye={};for(var tt in Be)if({}.hasOwnProperty.call(Be,tt)){if(Le.indexOf(tt)!==-1)continue;Ye[tt]=Be[tt]}return Ye}function _objectWithoutProperties$5(Be,Le){if(Be==null)return{};var Ye,tt,nt=_objectWithoutPropertiesLoose$1(Be,Le);if(Object.getOwnPropertySymbols){var ft=Object.getOwnPropertySymbols(Be);for(tt=0;tt<ft.length;tt++)Ye=ft[tt],Le.indexOf(Ye)===-1&&{}.propertyIsEnumerable.call(Be,Ye)&&(nt[Ye]=Be[Ye])}return nt}var voidElements={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const e=getDefaultExportFromCjs(voidElements);var t$1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(Be){var Le={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},Ye=Be.match(/<\/?([^\s]+?)[/\s>]/);if(Ye&&(Le.name=Ye[1],(e[Ye[1]]||Be.charAt(Be.length-2)==="/")&&(Le.voidElement=!0),Le.name.startsWith("!--"))){var tt=Be.indexOf("-->");return{type:"comment",comment:tt!==-1?Be.slice(4,tt):""}}for(var nt=new RegExp(t$1),ft=null;(ft=nt.exec(Be))!==null;)if(ft[0].trim())if(ft[1]){var ht=ft[1].trim(),gt=[ht,""];ht.indexOf("=")>-1&&(gt=ht.split("=")),Le.attrs[gt[0]]=gt[1],nt.lastIndex--}else ft[2]&&(Le.attrs[ft[2]]=ft[3].trim().substring(1,ft[3].length-1));return Le}var r$2=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i$3=/^\s*$/,s$1=Object.create(null);function a$1(Be,Le){switch(Le.type){case"text":return Be+Le.content;case"tag":return Be+="<"+Le.name+(Le.attrs?function(Ye){var tt=[];for(var nt in Ye)tt.push(nt+'="'+Ye[nt]+'"');return tt.length?" "+tt.join(" "):""}(Le.attrs):"")+(Le.voidElement?"/>":">"),Le.voidElement?Be:Be+Le.children.reduce(a$1,"")+"</"+Le.name+">";case"comment":return Be+"<!--"+Le.comment+"-->"}}var c$1={parse:function(Be,Le){Le||(Le={}),Le.components||(Le.components=s$1);var Ye,tt=[],nt=[],ft=-1,ht=!1;if(Be.indexOf("<")!==0){var gt=Be.indexOf("<");tt.push({type:"text",content:gt===-1?Be:Be.substring(0,gt)})}return Be.replace(r$2,function(At,xt){if(ht){if(At!=="</"+Ye.name+">")return;ht=!1}var yt,Ct=At.charAt(1)!=="/",Et=At.startsWith("<!--"),vt=xt+At.length,kt=Be.charAt(vt);if(Et){var bt=n(At);return ft<0?(tt.push(bt),tt):((yt=nt[ft]).children.push(bt),tt)}if(Ct&&(ft++,(Ye=n(At)).type==="tag"&&Le.components[Ye.name]&&(Ye.type="component",ht=!0),Ye.voidElement||ht||!kt||kt==="<"||Ye.children.push({type:"text",content:Be.slice(vt,Be.indexOf("<",vt))}),ft===0&&tt.push(Ye),(yt=nt[ft-1])&&yt.children.push(Ye),nt[ft]=Ye),(!Ct||Ye.voidElement)&&(ft>-1&&(Ye.voidElement||Ye.name===At.slice(2,-1))&&(ft--,Ye=ft===-1?tt:nt[ft]),!ht&&kt!=="<"&&kt)){yt=ft===-1?tt:nt[ft].children;var wt=Be.indexOf("<",vt),It=Be.slice(vt,wt===-1?void 0:wt);i$3.test(It)&&(It=" "),(wt>-1&&ft+yt.length>=0||It!==" ")&&yt.push({type:"text",content:It})}}),tt},stringify:function(Be){return Be.reduce(function(Le,Ye){return Le+a$1("",Ye)},"")}},matchHtmlEntity$1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities$1={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},unescapeHtmlEntity$1=function(Le){return htmlEntities$1[Le]},unescape$2=function(Le){return Le.replace(matchHtmlEntity$1,unescapeHtmlEntity$1)};function ownKeys$7(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$6(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$7(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$7(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}var defaultOptions$2={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$2},i18nInstance$1,I18nContext$1=React.createContext();function setDefaults(){var Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};defaultOptions$2=_objectSpread$6(_objectSpread$6({},defaultOptions$2),Be)}function getDefaults$1(){return defaultOptions$2}var ReportNamespaces$1=function(){function Be(){_classCallCheck$m(this,Be),this.usedNamespaces={}}return _createClass$l(Be,[{key:"addUsedNamespaces",value:function(Ye){var tt=this;Ye.forEach(function(nt){tt.usedNamespaces[nt]||(tt.usedNamespaces[nt]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),Be}();function setI18n(Be){i18nInstance$1=Be}function getI18n$1(){return i18nInstance$1}var initReactI18next={type:"3rdParty",init:function(Le){setDefaults(Le.options.react),setI18n(Le)}};function warn$2(){if(console&&console.warn){for(var Be,Le=arguments.length,Ye=new Array(Le),tt=0;tt<Le;tt++)Ye[tt]=arguments[tt];typeof Ye[0]=="string"&&(Ye[0]="react-i18next:: ".concat(Ye[0])),(Be=console).warn.apply(Be,Ye)}}var alreadyWarned$1={};function warnOnce$2(){for(var Be=arguments.length,Le=new Array(Be),Ye=0;Ye<Be;Ye++)Le[Ye]=arguments[Ye];typeof Le[0]=="string"&&alreadyWarned$1[Le[0]]||(typeof Le[0]=="string"&&(alreadyWarned$1[Le[0]]=new Date),warn$2.apply(void 0,Le))}function loadNamespaces$1(Be,Le,Ye){Be.loadNamespaces(Le,function(){if(Be.isInitialized)Ye();else{var tt=function nt(){setTimeout(function(){Be.off("initialized",nt)},0),Ye()};Be.on("initialized",tt)}})}function oldI18nextHasLoadedNamespace(Be,Le){var Ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},tt=Le.languages[0],nt=Le.options?Le.options.fallbackLng:!1,ft=Le.languages[Le.languages.length-1];if(tt.toLowerCase()==="cimode")return!0;var ht=function(At,xt){var yt=Le.services.backendConnector.state["".concat(At,"|").concat(xt)];return yt===-1||yt===2};return Ye.bindI18n&&Ye.bindI18n.indexOf("languageChanging")>-1&&Le.services.backendConnector.backend&&Le.isLanguageChangingTo&&!ht(Le.isLanguageChangingTo,Be)?!1:!!(Le.hasResourceBundle(tt,Be)||!Le.services.backendConnector.backend||Le.options.resources&&!Le.options.partialBundledLanguages||ht(tt,Be)&&(!nt||ht(ft,Be)))}function hasLoadedNamespace$1(Be,Le){var Ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!Le.languages||!Le.languages.length)return warnOnce$2("i18n.languages were undefined or empty",Le.languages),!0;var tt=Le.options.ignoreJSONStructure!==void 0;return tt?Le.hasLoadedNamespace(Be,{precheck:function(ft,ht){if(Ye.bindI18n&&Ye.bindI18n.indexOf("languageChanging")>-1&&ft.services.backendConnector.backend&&ft.isLanguageChangingTo&&!ht(ft.isLanguageChangingTo,Be))return!1}}):oldI18nextHasLoadedNamespace(Be,Le,Ye)}var _excluded$2=["format"],_excluded2=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function ownKeys$6(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$5(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$6(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$6(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}function hasChildren(Be,Le){if(!Be)return!1;var Ye=Be.props?Be.props.children:Be.children;return Le?Ye.length>0:!!Ye}function getChildren$1(Be){return Be?Be.props?Be.props.children:Be.children:[]}function hasValidReactChildren(Be){return Object.prototype.toString.call(Be)!=="[object Array]"?!1:Be.every(function(Le){return React.isValidElement(Le)})}function getAsArray(Be){return Array.isArray(Be)?Be:[Be]}function mergeProps(Be,Le){var Ye=_objectSpread$5({},Le);return Ye.props=Object.assign(Be.props,Le.props),Ye}function nodesToString(Be,Le){if(!Be)return"";var Ye="",tt=getAsArray(Be),nt=Le.transSupportBasicHtmlNodes&&Le.transKeepBasicHtmlNodesFor?Le.transKeepBasicHtmlNodesFor:[];return tt.forEach(function(ft,ht){if(typeof ft=="string")Ye+="".concat(ft);else if(React.isValidElement(ft)){var gt=Object.keys(ft.props).length,At=nt.indexOf(ft.type)>-1,xt=ft.props.children;if(!xt&&At&&gt===0)Ye+="<".concat(ft.type,"/>");else if(!xt&&(!At||gt!==0))Ye+="<".concat(ht,"></").concat(ht,">");else if(ft.props.i18nIsDynamicList)Ye+="<".concat(ht,"></").concat(ht,">");else if(At&&gt===1&&typeof xt=="string")Ye+="<".concat(ft.type,">").concat(xt,"</").concat(ft.type,">");else{var yt=nodesToString(xt,Le);Ye+="<".concat(ht,">").concat(yt,"</").concat(ht,">")}}else if(ft===null)warn$2("Trans: the passed in value is invalid - seems you passed in a null child.");else if(_typeof$k(ft)==="object"){var Ct=ft.format,Et=_objectWithoutProperties$5(ft,_excluded$2),vt=Object.keys(Et);if(vt.length===1){var kt=Ct?"".concat(vt[0],", ").concat(Ct):vt[0];Ye+="{{".concat(kt,"}}")}else warn$2("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",ft)}else warn$2("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",ft)}),Ye}function renderNodes(Be,Le,Ye,tt,nt,ft){if(Le==="")return[];var ht=tt.transKeepBasicHtmlNodesFor||[],gt=Le&&new RegExp(ht.join("|")).test(Le);if(!Be&&!gt)return[Le];var At={};function xt(wt){var It=getAsArray(wt);It.forEach(function(Rt){typeof Rt!="string"&&(hasChildren(Rt)?xt(getChildren$1(Rt)):_typeof$k(Rt)==="object"&&!React.isValidElement(Rt)&&Object.assign(At,Rt))})}xt(Be);var yt=c$1.parse("<0>".concat(Le,"</0>")),Ct=_objectSpread$5(_objectSpread$5({},At),nt);function Et(wt,It,Rt){var Tt=getChildren$1(wt),Bt=kt(Tt,It.children,Rt);return hasValidReactChildren(Tt)&&Bt.length===0?Tt:Bt}function vt(wt,It,Rt,Tt,Bt){wt.dummy&&(wt.children=It),Rt.push(React.cloneElement(wt,_objectSpread$5(_objectSpread$5({},wt.props),{},{key:Tt}),Bt?void 0:It))}function kt(wt,It,Rt){var Tt=getAsArray(wt),Bt=getAsArray(It);return Bt.reduce(function(Pt,Dt,Ot){var Lt=Dt.children&&Dt.children[0]&&Dt.children[0].content&&Ye.services.interpolator.interpolate(Dt.children[0].content,Ct,Ye.language);if(Dt.type==="tag"){var Wt=Tt[parseInt(Dt.name,10)];!Wt&&Rt.length===1&&Rt[0][Dt.name]&&(Wt=Rt[0][Dt.name]),Wt||(Wt={});var $t=Object.keys(Dt.attrs).length!==0?mergeProps({props:Dt.attrs},Wt):Wt,qt=React.isValidElement($t),Ht=qt&&hasChildren(Dt,!0)&&!Dt.voidElement,Ut=gt&&_typeof$k($t)==="object"&&$t.dummy&&!qt,Ft=_typeof$k(Be)==="object"&&Be!==null&&Object.hasOwnProperty.call(Be,Dt.name);if(typeof $t=="string"){var Xt=Ye.services.interpolator.interpolate($t,Ct,Ye.language);Pt.push(Xt)}else if(hasChildren($t)||Ht){var _t=Et($t,Dt,Rt);vt($t,_t,Pt,Ot)}else if(Ut){var Mt=kt(Tt,Dt.children,Rt);Pt.push(React.cloneElement($t,_objectSpread$5(_objectSpread$5({},$t.props),{},{key:Ot}),Mt))}else if(Number.isNaN(parseFloat(Dt.name)))if(Ft){var jt=Et($t,Dt,Rt);vt($t,jt,Pt,Ot,Dt.voidElement)}else if(tt.transSupportBasicHtmlNodes&&ht.indexOf(Dt.name)>-1)if(Dt.voidElement)Pt.push(React.createElement(Dt.name,{key:"".concat(Dt.name,"-").concat(Ot)}));else{var zt=kt(Tt,Dt.children,Rt);Pt.push(React.createElement(Dt.name,{key:"".concat(Dt.name,"-").concat(Ot)},zt))}else if(Dt.voidElement)Pt.push("<".concat(Dt.name," />"));else{var Gt=kt(Tt,Dt.children,Rt);Pt.push("<".concat(Dt.name,">").concat(Gt,"</").concat(Dt.name,">"))}else if(_typeof$k($t)==="object"&&!qt){var Yt=Dt.children[0]?Lt:null;Yt&&Pt.push(Yt)}else Dt.children.length===1&&Lt?Pt.push(React.cloneElement($t,_objectSpread$5(_objectSpread$5({},$t.props),{},{key:Ot}),Lt)):Pt.push(React.cloneElement($t,_objectSpread$5(_objectSpread$5({},$t.props),{},{key:Ot})))}else if(Dt.type==="text"){var ar=tt.transWrapTextNodes,tr=ft?tt.unescape(Ye.services.interpolator.interpolate(Dt.content,Ct,Ye.language)):Ye.services.interpolator.interpolate(Dt.content,Ct,Ye.language);ar?Pt.push(React.createElement(ar,{key:"".concat(Dt.name,"-").concat(Ot)},tr)):Pt.push(tr)}return Pt},[])}var bt=kt([{dummy:!0,children:Be||[]}],yt,getAsArray(Be||[]));return getChildren$1(bt[0])}function Trans(Be){var Le=Be.children,Ye=Be.count,tt=Be.parent,nt=Be.i18nKey,ft=Be.context,ht=Be.tOptions,gt=ht===void 0?{}:ht,At=Be.values,xt=Be.defaults,yt=Be.components,Ct=Be.ns,Et=Be.i18n,vt=Be.t,kt=Be.shouldUnescape,bt=_objectWithoutProperties$5(Be,_excluded2),wt=React.useContext(I18nContext$1)||{},It=wt.i18n,Rt=wt.defaultNS,Tt=Et||It||getI18n$1();if(!Tt)return warnOnce$2("You will need to pass in an i18next instance by using i18nextReactModule"),Le;var Bt=vt||Tt.t.bind(Tt)||function(Xt){return Xt};ft&&(gt.context=ft);var Pt=_objectSpread$5(_objectSpread$5({},getDefaults$1()),Tt.options&&Tt.options.react),Dt=Ct||Bt.ns||Rt||Tt.options&&Tt.options.defaultNS;Dt=typeof Dt=="string"?[Dt]:Dt||["translation"];var Ot=xt||nodesToString(Le,Pt)||Pt.transEmptyNodeValue||nt,Lt=Pt.hashTransKey,Wt=nt||(Lt?Lt(Ot):Ot),$t=At?gt.interpolation:{interpolation:_objectSpread$5(_objectSpread$5({},gt.interpolation),{},{prefix:"#$?",suffix:"?$#"})},qt=_objectSpread$5(_objectSpread$5(_objectSpread$5(_objectSpread$5({},gt),{},{count:Ye},At),$t),{},{defaultValue:Ot,ns:Dt}),Ht=Wt?Bt(Wt,qt):Ot,Ut=renderNodes(yt||Le,Ht,Tt,Pt,qt,kt),Ft=tt!==void 0?tt:Pt.defaultTransParent;return Ft?React.createElement(Ft,bt,Ut):Ut}function _iterableToArrayLimit$4(Be,Le){var Ye=Be==null?null:typeof Symbol<"u"&&Be[Symbol.iterator]||Be["@@iterator"];if(Ye!=null){var tt,nt,ft,ht,gt=[],At=!0,xt=!1;try{if(ft=(Ye=Ye.call(Be)).next,Le!==0)for(;!(At=(tt=ft.call(Ye)).done)&&(gt.push(tt.value),gt.length!==Le);At=!0);}catch(yt){xt=!0,nt=yt}finally{try{if(!At&&Ye.return!=null&&(ht=Ye.return(),Object(ht)!==ht))return}finally{if(xt)throw nt}}return gt}}function _slicedToArray$4(Be,Le){return _arrayWithHoles$4(Be)||_iterableToArrayLimit$4(Be,Le)||_unsupportedIterableToArray$b(Be,Le)||_nonIterableRest$4()}function ownKeys$5(Be,Le){var Ye=Object.keys(Be);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(Be);Le&&(tt=tt.filter(function(nt){return Object.getOwnPropertyDescriptor(Be,nt).enumerable})),Ye.push.apply(Ye,tt)}return Ye}function _objectSpread$4(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le]!=null?arguments[Le]:{};Le%2?ownKeys$5(Object(Ye),!0).forEach(function(tt){_defineProperty$6(Be,tt,Ye[tt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Be,Object.getOwnPropertyDescriptors(Ye)):ownKeys$5(Object(Ye)).forEach(function(tt){Object.defineProperty(Be,tt,Object.getOwnPropertyDescriptor(Ye,tt))})}return Be}var usePrevious$1=function(Le,Ye){var tt=React.useRef();return React.useEffect(function(){tt.current=Le},[Le,Ye]),tt.current};function useTranslation$1(Be){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=Le.i18n,tt=React.useContext(I18nContext$1)||{},nt=tt.i18n,ft=tt.defaultNS,ht=Ye||nt||getI18n$1();if(ht&&!ht.reportNamespaces&&(ht.reportNamespaces=new ReportNamespaces$1),!ht){warnOnce$2("You will need to pass in an i18next instance by using initReactI18next");var gt=function(Wt){return Array.isArray(Wt)?Wt[Wt.length-1]:Wt},At=[gt,{},!1];return At.t=gt,At.i18n={},At.ready=!1,At}ht.options.react&&ht.options.react.wait!==void 0&&warnOnce$2("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var xt=_objectSpread$4(_objectSpread$4(_objectSpread$4({},getDefaults$1()),ht.options.react),Le),yt=xt.useSuspense,Ct=xt.keyPrefix,Et=ft||ht.options&&ht.options.defaultNS;Et=typeof Et=="string"?[Et]:Et||["translation"],ht.reportNamespaces.addUsedNamespaces&&ht.reportNamespaces.addUsedNamespaces(Et);var vt=(ht.isInitialized||ht.initializedStoreOnce)&&Et.every(function(Lt){return hasLoadedNamespace$1(Lt,ht,xt)});function kt(){return ht.getFixedT(null,xt.nsMode==="fallback"?Et:Et[0],Ct)}var bt=React.useState(kt),wt=_slicedToArray$4(bt,2),It=wt[0],Rt=wt[1],Tt=Et.join(),Bt=usePrevious$1(Tt),Pt=React.useRef(!0);React.useEffect(function(){var Lt=xt.bindI18n,Wt=xt.bindI18nStore;Pt.current=!0,!vt&&!yt&&loadNamespaces$1(ht,Et,function(){Pt.current&&Rt(kt)}),vt&&Bt&&Bt!==Tt&&Pt.current&&Rt(kt);function $t(){Pt.current&&Rt(kt)}return Lt&&ht&&ht.on(Lt,$t),Wt&&ht&&ht.store.on(Wt,$t),function(){Pt.current=!1,Lt&&ht&&Lt.split(" ").forEach(function(qt){return ht.off(qt,$t)}),Wt&&ht&&Wt.split(" ").forEach(function(qt){return ht.store.off(qt,$t)})}},[ht,Tt]);var Dt=React.useRef(!0);React.useEffect(function(){Pt.current&&!Dt.current&&Rt(kt),Dt.current=!1},[ht,Ct]);var Ot=[It,ht,vt];if(Ot.t=It,Ot.i18n=ht,Ot.ready=vt,vt||!vt&&!yt)return Ot;throw new Promise(function(Lt){loadNamespaces$1(ht,Et,function(){Lt()})})}function I18nextProvider$1(Be){var Le=Be.i18n,Ye=Be.defaultNS,tt=Be.children,nt=React.useMemo(function(){return{i18n:Le,defaultNS:Ye}},[Le,Ye]);return React.createElement(I18nContext$1.Provider,{value:nt},tt)}const supportedLngs=["en","en-DG","es","es-ES","sr","sr-Latn","fr","pt-BR","pt","bn","zh","hi","id","ms","tr","vi","ht","it","de","nl","tl-PH","pl","hu","ro","hmn","so","ca","af-ZA","ar","ar-EG","ar-AE","zh-CN","zh-TW","zh-HANT","cs-CZ","da-DK","fi-FI","fr-CA","el-GR","he","ja","ja-JP","ko-KP","nb-NO","fa-IR","pt-PT","ru-RU","sr-YU","es-419","es-MX","sv-SE","th-TH","uk-UA","am","az","bs","my","ceb","cs","et","ka","el","ja","jv","kk","km","ko","ky","lo","lv","lt","mk","mn","ne","ru","sk","sl","sw","tl","th","uk","ur","uz","hr"],keyToStartCase=Be=>{const Le=Be.split("."),Ye=Le[Le.length-1];return camelToStartCase(Ye)},languageDetector=new Browser;languageDetector.addDetector({name:"navigatorOnlyLanguage",lookup(){if(typeof navigator>"u")return"en";const Be=navigator.language;return supportedLngs.includes(Be)?Be:Be.split("-")[0]}});const loadPath="https://api.i18nexus.com/project_resources/translations/{{lng}}/{{ns}}.json?api_key=cg41dUINoxdp8BaHDQLJhA";function createI18n({ns:Be=["default"],...Le}){const Ye=instance.createInstance();return Ye.use(initReactI18next).use(Backend).use(languageDetector).init({fallbackLng:"en",supportedLngs,ns:Be,detection:{order:["querystring","cookie","localStorage","sessionStorage","navigatorOnlyLanguage","htmlTag","path","subdomain"],lookupQuerystring:"lang"},defaultNS:Be[0],partialBundledLanguages:!0,keySeparator:".",interpolation:{escapeValue:!1},backend:{loadPath},react:{useSuspense:!1},initImmediate:!1,parseMissingKeyHandler:keyToStartCase,...Le}),Ye}const i18n=createI18n({ns:["default"]}),addCrashReport=async Be=>{const{message:Le,stack:Ye,version:tt}=Be;return exports.api.post("/api/crash-collector/crash-report",{message:Le,stack:Ye,version:tt,application:"onboarding"}).catch(()=>{})},addCustomFields=({token:Be,fields:Le})=>exports.api.post("/omni/add/custom-fields",{customFields:{...Le}},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(Ye=>Promise.reject(Ye.response.data));async function addContract({token:Be,image:Le}){const{url:Ye,contractId:tt}=await getContractURL({token:Be});return await fetch(Ye,{method:"PUT",body:Le,headers:{"x-ms-blob-type":"BlockBlob"}}),{url:Ye,contractId:tt}}function getContractURL({token:Be}){return exports.api.post("/omni/generateContractUploadUrl",null,{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data)}async function addDocument({token:Be,type:Le,image:Ye,onProgress:tt=emptyFunc}){if(Le==="contract"){const{url:nt,contractId:ft}=await addContract({token:Be,image:b64toBlob(Ye)});return{success:!0,sessionStatus:"Alive",additionalInformation:{contractId:ft,url:nt}}}return exports.api.post(`/omni/add/document/v2?type=${Le}`,{base64Image:Ye},{headers:{"X-Incode-Hardware-Id":Be},onUploadProgress:({loaded:nt,total:ft})=>tt(nt/ft*100)}).then(nt=>nt.data).catch(nt=>Promise.reject(nt.response.data))}function addName({token:Be,name:Le}){return exports.api.post("/omni/add/name",{name:Le},{headers:{"X-Incode-Hardware-Id":Be}}).catch(Ye=>Promise.reject(Ye.response.data))}const addQrUrl="/omni/qr";function addQr({token:Be}){return exports.api.get(addQrUrl,{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data)}function approve({token:Be}){return exports.api.post("/omni/process/approve",null,{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>{const{uuid:Ye,...tt}=Le.data;return{...tt,customerId:Ye}}).catch(Le=>{var Ye;return Promise.reject((Ye=Le.response)==null?void 0:Ye.data)})}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/**
78
78
  * @license React
79
79
  * react-jsx-runtime.production.min.js
@@ -864,7 +864,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
864
864
  border-bottom: 0;
865
865
  margin-top: -2.5px;
866
866
  }
867
- `,dt.ul`
867
+ `,dt.div`
868
868
  width: 100%;
869
869
  visibility: ${Be=>Be.isDropdownOpen?"visible":"hidden"};
870
870
  opacity: ${Be=>Be.isDropdownOpen?1:0};
@@ -875,10 +875,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
875
875
  top: 100%;
876
876
  border-top: ${Be=>Be.isDropdownOpen?"none":"1px solid #ccc"};
877
877
  border-radius: 0 0 4px 4px;
878
+ box-sizing: border-box;
879
+ background: #fff;
880
+ overflow: hidden;
881
+ `,dt.ul`
882
+ width: 100%;
878
883
  max-height: 150px;
879
884
  overflow-y: auto;
880
885
  overflow-x: hidden;
881
886
  box-sizing: border-box;
887
+ margin: 0;
888
+ padding: 0;
889
+ list-style: none;
890
+ `,dt.div`
891
+ position: absolute;
892
+ right: 2px;
893
+ width: 4px;
894
+ border-radius: 3px;
895
+ background: #aaa;
896
+ opacity: .85;
897
+ pointer-events: none;
882
898
  `;const StyledDropdownOption=dt.li`
883
899
  padding: 10px;
884
900
  background-color: ${Be=>Be.isSelected?"#DDD":"transparent"};
@@ -3475,7 +3491,7 @@ linearGradient:first-of-type {
3475
3491
  stop-color: ${({$color:Be})=>Be};
3476
3492
  }
3477
3493
  }
3478
- `,BaseTutorial=({title:Be,subtitle:Le,animationData:Ye,onContinue:tt,buttonText:nt,uiConfig:ft,disclaimerText:ht,onClose:gt,isLoading:At=!1})=>{var Ct,Et,vt,kt,bt,wt,It,Rt,Tt,Bt,Pt,Dt,Ot;const{t:xt}=useTranslation$1(),yt=useTokens();return jsxRuntimeExports.jsx(Page$1,{title:Be,subtitle:Le,closeButton:{show:(Ct=ft==null?void 0:ft.closeButton)==null?void 0:Ct.show,position:(Et=ft==null?void 0:ft.closeButton)==null?void 0:Et.position,offset:(vt=ft==null?void 0:ft.closeButton)==null?void 0:vt.offset,onClose:gt},hideHeaderBranding:(kt=ft==null?void 0:ft.branding)==null?void 0:kt.hideHeaderBranding,...(wt=(bt=ft==null?void 0:ft.branding)==null?void 0:bt.logo)!=null&&wt.src||(Rt=(It=ft==null?void 0:ft.branding)==null?void 0:It.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:(Dt=(Pt=ft==null?void 0:ft.branding)==null?void 0:Pt.logo)==null?void 0:Dt.height}}:{},hideFooterBranding:(Ot=ft==null?void 0:ft.branding)==null?void 0:Ot.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:yt.color.surface.primary[500],px:6,xsPx:0,maxW:"400px",m:"auto",children:jsxRuntimeExports.jsx(Lottie,{animationData:replaceLottieColor(Ye,yt.color.surface.primary[500]),loop:!0,autoplay:!0,style:{height:"100%"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text$8,{fontSize:yt.typography.fontSize.lg,textAlign:"center",color:yt.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,Ct=[{key:"ID",configuration:xt}];return xt.secondId&&Ct.push({key:"SECOND_ID",configuration:xt}),xt.thirdId&&Ct.push({key:"THIRD_ID",configuration:xt}),Ct}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,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})=>{var tt,nt,ft;try{faceFlowManager.incrementAttempts(),handleScreenEvent$1(Ye,eventScreenNames.faceCaptureUpload,!0);const ht=Be.getBase64Image();await onboardingAnalytics.analyzeFrame(ht),onboardingAnalytics.update(),MlWasmJSApi$1.reset();const gt=await MlWasmJSApi$1.encryptImage(ht);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 At=await capture({token:Ye,image:gt,type:"selfie",encrypted:!0,faceCoordinates:Le,recordingId:(tt=faceFlowManager.deepsightVideoRecorder)==null?void 0:tt.recordingId,metadata:onboardingAnalytics.getMetadata()});return At.confidence!==0&&handleError$1(Ye,FACE_ERROR_CODES.LIVENESS),At.isBright||handleError$1(Ye,FACE_ERROR_CODES.BRIGHTNESS),At.hasLenses&&handleError$1(Ye,FACE_ERROR_CODES.LENSES),At.hasFaceMask&&handleError$1(Ye,FACE_ERROR_CODES.MASK),At.hasClosedEyes&&handleError$1(Ye,FACE_ERROR_CODES.CLOSED_EYES),At.hasHeadCover&&handleError$1(Ye,FACE_ERROR_CODES.HEAD_COVER),At.liveness=At.confidence===0,At.imageBase64=ht,handleScreenEvent$1(Ye,eventScreenNames.faceCaptureUpload,!1),handleScreenEvent$1(Ye,eventScreenNames.faceCaptureSuccess,!0),At}catch(ht){const gt=ht,{status:At}=gt;if(ht instanceof Error&&isKnownError(ht))throw ht;if(At===400){const xt=(ft=(nt=gt.response)==null?void 0:nt.data)==null?void 0:ft.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=xt?yt[xt]: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 detectionManager=new DetectionManager,useFaceDetection=({getCanvas:Be,onCapture:Le,onFinish:Ye,onError:tt})=>{const[nt,ft]=React.useState(detectionManager.getState()),ht=React.useRef(Be),gt=React.useRef(Le),At=React.useRef(Ye),xt=React.useRef(tt);return React.useEffect(()=>{ht.current=Be,gt.current=Le,At.current=Ye,xt.current=tt},[Be,Le,Ye,tt]),React.useEffect(()=>{detectionManager.setGetCanvas(ht.current),detectionManager.initialize({onCapture:(Ct,Et)=>gt.current(Ct,Et),onFinish:Ct=>{var Et;return(Et=At.current)==null?void 0:Et.call(At,Ct)},onError:Ct=>{var Et;return(Et=xt.current)==null?void 0:Et.call(xt,Ct)}});const yt=Ct=>{ft(Ct)};return detectionManager.subscribe(yt),()=>{detectionManager.stopDetection(),detectionManager.unsubscribe(yt)}},[]),{detectionState:nt.detectionState,borderState:nt.borderState,capturedImage:nt.capturedImage,startDetection:()=>detectionManager.startDetection(),stopDetection:()=>detectionManager.stopDetection(),capture:yt=>detectionManager.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})},getText=(Be,Le,Ye,tt)=>Le(Be==="capturing"?tt?"idv2.capture.processing.verifying":Ye?"idv2.capture.processing.processing":"idv2.capture.processing.uploading":"idv2.capture.processing.success"),CaptureOverlay$1=({detectionState:Be,showPreview:Le,capturedImage:Ye,captureOnly:tt,ageAssurance:nt})=>{const ft=useTokens(),{t:ht}=useTranslation$1();return Be!=="capturing"&&Be!=="success"?null:jsxRuntimeExports.jsx(Flex,{w:"100%",h:"100%",position:"absolute",top:0,left:0,bg:"#f5f5f6",zIndex:2,justify:"center",align:"center",children:Le?jsxRuntimeExports.jsx(PreviewImage,{src:`data:image/jpeg;base64,${Ye}`}):jsxRuntimeExports.jsx(Text$8,{fontSize:ft.typography.fontSize["3xl"],fontWeight:"bold",color:ft.primitives.color.gray[800],children:getText(Be,ht,tt,nt)})})},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$8,{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$8,{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$8,{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})},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"}},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`
3494
+ `,BaseTutorial=({title:Be,subtitle:Le,animationData:Ye,onContinue:tt,buttonText:nt,uiConfig:ft,disclaimerText:ht,onClose:gt,isLoading:At=!1})=>{var Ct,Et,vt,kt,bt,wt,It,Rt,Tt,Bt,Pt,Dt,Ot;const{t:xt}=useTranslation$1(),yt=useTokens();return jsxRuntimeExports.jsx(Page$1,{title:Be,subtitle:Le,closeButton:{show:(Ct=ft==null?void 0:ft.closeButton)==null?void 0:Ct.show,position:(Et=ft==null?void 0:ft.closeButton)==null?void 0:Et.position,offset:(vt=ft==null?void 0:ft.closeButton)==null?void 0:vt.offset,onClose:gt},hideHeaderBranding:(kt=ft==null?void 0:ft.branding)==null?void 0:kt.hideHeaderBranding,...(wt=(bt=ft==null?void 0:ft.branding)==null?void 0:bt.logo)!=null&&wt.src||(Rt=(It=ft==null?void 0:ft.branding)==null?void 0:It.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:(Dt=(Pt=ft==null?void 0:ft.branding)==null?void 0:Pt.logo)==null?void 0:Dt.height}}:{},hideFooterBranding:(Ot=ft==null?void 0:ft.branding)==null?void 0:Ot.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:yt.color.surface.primary[500],px:6,xsPx:0,maxW:"400px",m:"auto",children:jsxRuntimeExports.jsx(Lottie,{animationData:replaceLottieColor(Ye,yt.color.surface.primary[500]),loop:!0,autoplay:!0,style:{height:"100%"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Text$8,{fontSize:yt.typography.fontSize.lg,textAlign:"center",color:yt.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,Ct=[{key:"ID",configuration:xt}];return xt.secondId&&Ct.push({key:"SECOND_ID",configuration:xt}),xt.thirdId&&Ct.push({key:"THIRD_ID",configuration:xt}),Ct}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})=>{var tt,nt,ft;try{faceFlowManager.incrementAttempts(),handleScreenEvent$1(Ye,eventScreenNames.faceCaptureUpload,!0);const ht=Be.getBase64Image();await onboardingAnalytics.analyzeFrame(ht),onboardingAnalytics.update(),MlWasmJSApi$1.reset();const gt=await MlWasmJSApi$1.encryptImage(ht);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 At=await capture({token:Ye,image:gt,type:"selfie",encrypted:!0,faceCoordinates:Le,recordingId:(tt=faceFlowManager.deepsightVideoRecorder)==null?void 0:tt.recordingId,metadata:onboardingAnalytics.getMetadata()});return At.confidence!==0&&handleError$1(Ye,FACE_ERROR_CODES.LIVENESS),At.isBright||handleError$1(Ye,FACE_ERROR_CODES.BRIGHTNESS),At.hasLenses&&handleError$1(Ye,FACE_ERROR_CODES.LENSES),At.hasFaceMask&&handleError$1(Ye,FACE_ERROR_CODES.MASK),At.hasClosedEyes&&handleError$1(Ye,FACE_ERROR_CODES.CLOSED_EYES),At.hasHeadCover&&handleError$1(Ye,FACE_ERROR_CODES.HEAD_COVER),At.liveness=At.confidence===0,At.imageBase64=ht,handleScreenEvent$1(Ye,eventScreenNames.faceCaptureUpload,!1),handleScreenEvent$1(Ye,eventScreenNames.faceCaptureSuccess,!0),At}catch(ht){const gt=ht,{status:At}=gt;if(ht instanceof Error&&isKnownError(ht))throw ht;if(At===400){const xt=(ft=(nt=gt.response)==null?void 0:nt.data)==null?void 0:ft.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=xt?yt[xt]: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 detectionManager=new DetectionManager,useFaceDetection=({getCanvas:Be,onCapture:Le,onFinish:Ye,onError:tt})=>{const[nt,ft]=React.useState(detectionManager.getState()),ht=React.useRef(Be),gt=React.useRef(Le),At=React.useRef(Ye),xt=React.useRef(tt);return React.useEffect(()=>{ht.current=Be,gt.current=Le,At.current=Ye,xt.current=tt},[Be,Le,Ye,tt]),React.useEffect(()=>{detectionManager.setGetCanvas(ht.current),detectionManager.initialize({onCapture:(Ct,Et)=>gt.current(Ct,Et),onFinish:Ct=>{var Et;return(Et=At.current)==null?void 0:Et.call(At,Ct)},onError:Ct=>{var Et;return(Et=xt.current)==null?void 0:Et.call(xt,Ct)}});const yt=Ct=>{ft(Ct)};return detectionManager.subscribe(yt),()=>{detectionManager.stopDetection(),detectionManager.unsubscribe(yt)}},[]),{detectionState:nt.detectionState,borderState:nt.borderState,capturedImage:nt.capturedImage,startDetection:()=>detectionManager.startDetection(),stopDetection:()=>detectionManager.stopDetection(),capture:yt=>detectionManager.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})},getText=(Be,Le,Ye,tt)=>Le(Be==="capturing"?tt?"idv2.capture.processing.verifying":Ye?"idv2.capture.processing.processing":"idv2.capture.processing.uploading":"idv2.capture.processing.success"),CaptureOverlay$1=({detectionState:Be,showPreview:Le,capturedImage:Ye,captureOnly:tt,ageAssurance:nt})=>{const ft=useTokens(),{t:ht}=useTranslation$1();return Be!=="capturing"&&Be!=="success"?null:jsxRuntimeExports.jsx(Flex,{w:"100%",h:"100%",position:"absolute",top:0,left:0,bg:"#f5f5f6",zIndex:2,justify:"center",align:"center",children:Le?jsxRuntimeExports.jsx(PreviewImage,{src:`data:image/jpeg;base64,${Ye}`}):jsxRuntimeExports.jsx(Text$8,{fontSize:ft.typography.fontSize["3xl"],fontWeight:"bold",color:ft.primitives.color.gray[800],children:getText(Be,ht,tt,nt)})})},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$8,{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$8,{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$8,{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})},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"}},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`
3479
3495
  transition: all 1s ease-in-out;
3480
3496
  fill: ${({$borderState:Be,$color:Le})=>getFill(Be,Le)};
3481
3497
  `,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`
@@ -5228,7 +5244,7 @@ linearGradient:first-of-type {
5228
5244
  font-size: ${Be=>Be.fontSize||"0.875rem"};
5229
5245
  margin: 0;
5230
5246
  }
5231
- `,ThemedCaptureManualId=Be=>{var Dt;const{onlyFront:Le}=Be,[Ye,tt]=React.useState("id"),[nt,ft]=React.useState({front:!1,back:!1,passport:!1}),[ht,gt]=React.useState(((Dt=Be.token)==null?void 0:Dt.idCaptureRetries)-3||3),[At,xt]=React.useState(null),[yt,Ct]=React.useState(!1),[Et,vt]=React.useState(null),kt=React.useRef(null),{t:bt}=useTranslation$1(),wt=useTokens(),It=React.useMemo(()=>Object.values(nt).some(Ot=>Ot===!0),[nt]),Rt=Ot=>{const Lt={WRONG_DOCUMENT_SIDE:bt("manualIdUpload.wrongSide"),WRONG_ONE_SIDED_DOCUMENT:bt("manualIdUpload.wrongSide"),UNKNOWN_DOCUMENT_TYPE:bt("manualIdUpload.pleaseUploadCorrectDocument")};return Lt[Ot.failReason]?(xt(Lt[Ot.failReason]),gt(ht-1),!0):Ot.failReason?(xt(bt("manualIdUpload.somethingWentWrong")),gt(ht-1),!0):Et==="passport"&&Ot.typeOfId!=="Passport"||["front","back"].includes(Et)&&Ot.typeOfId==="Passport"?(xt(bt("manualIdUpload.pleaseUploadCorrectDocument")),gt(ht-1),!0):!1},Tt=async Ot=>{const Lt=Ot.target.files[0],Wt=5*1024*1024;if(Lt.size>Wt){xt(bt("manualIdUpload.fileTooBig"));return}Ct(!0),xt(null),(async()=>{Ct(!0);try{const qt=await capture({token:Be.token.token,image:Lt,type:["front","passport"].includes(Et)?"front":"back",onProgress:()=>{},sendBase64:!1,onlyFront:!1,isRetry:!1,isSecondId:!1,encrypted:!1,faceCoordinates:void 0,imageType:Lt.type,shouldSkipGlareBack:!1,shouldSkipGlareFront:!1,captureType:"UPLOAD",metadata:MlWasmJSApi$1.getMetadata()}),Ht=(qt.skipBackIdCapture||Et==="front"&&Le)&&{back:!0};Rt(qt)||(ft(Ut=>({...Ut,[Et]:!0,...Ht})),Ot.target.value="")}catch(qt){console.error("Error uploading image:",qt)}finally{Ct(!1)}})()},Bt=Ot=>{vt(Ot),kt.current&&kt.current.click()},Pt=()=>Ye==="id"?!(nt.front&&nt.back):!nt.passport;return yt?jsxRuntimeExports.jsx(Spinner$4,{title:bt("manualIdUpload.holdOnASec"),subtitle:bt("idv2.manualUploadLoading.subtitle")}):ht===0?(setTimeout(()=>{Be.onSuccess()},5e3),jsxRuntimeExports.jsx(Page$1,{title:bt("manualIdUpload.tooManyTries"),maxW:"450px","data-testid":"manual-upload-error-page",children:jsxRuntimeExports.jsx(Flex,{direction:"column",align:"center",justify:"center",hFull:!0,children:jsxRuntimeExports.jsx(Text$8,{textAlign:"center",color:wt.color.text.body.secondary,fontSize:wt.typography.fontSize.base,children:bt("manualIdUpload.contactedByAdmin")})})})):jsxRuntimeExports.jsx(Page$1,{title:bt("manualIdUpload.title"),maxW:"450px","data-testid":"manual-upload-page",children:jsxRuntimeExports.jsx(Flex,{direction:"column",gap:4,hFull:!0,children:jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",gap:4,hFull:!0,mt:6,children:[jsxRuntimeExports.jsxs(ManualIdUploadTabs,{tokens:wt,children:[jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>tt("id"),className:Ye==="id"&&"selected",disabled:It,children:bt("manualIdUpload.id")}),jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>tt("passport"),className:Ye==="passport"&&"selected",disabled:It,children:bt("manualIdUpload.passport")})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,justify:"space-between",children:[jsxRuntimeExports.jsxs(UploadDocumentContainer,{className:"IncodeManualUploadSectionContainer",children:[jsxRuntimeExports.jsx("input",{type:"file",style:{display:"none"},ref:kt,onChange:Tt,accept:"image/*"}),Ye==="id"&&jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],borderColor:wt.color.border.primary,children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",gap:2,children:[jsxRuntimeExports.jsx(IdFrontIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,children:bt("manualIdUpload.frontId")})]}),nt.front?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("front"),disabled:nt.front,tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]}),Le?null:jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],borderColor:wt.color.border.primary,children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",gap:2,children:[jsxRuntimeExports.jsx(IdBackIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,children:bt("manualIdUpload.backId")})]}),nt.back?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("back"),disabled:!nt.front,tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]})]}),Ye==="passport"&&jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",children:[jsxRuntimeExports.jsx(UploadPassportIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,ml:"12px",children:bt("manualIdUpload.passport")})]}),nt.passport?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("passport"),tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]})}),At&&jsxRuntimeExports.jsxs(ErrorText$2,{fontSize:wt.typography.fontSize.sm,color:wt.color.surface.status.negative,children:[jsxRuntimeExports.jsx(ErrorIcon$1,{size:16}),jsxRuntimeExports.jsx("p",{children:"Please upload the correct document"})]})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",gap:5,children:[jsxRuntimeExports.jsxs(InstructionsList,{className:"IncodeManualUploadInstrucctions",textColor:wt.color.text.body.primary,bgColor:`${wt.color.surface.primary[50]}`,children:[jsxRuntimeExports.jsx("li",{children:bt(`manualIdUpload.${Ye}Text`)}),jsxRuntimeExports.jsx("li",{children:bt("manualIdUpload.glareFree")})]}),jsxRuntimeExports.jsx(CompleteUploadButton,{type:"button",onClick:()=>Be.onSuccess(),disabled:Pt(),tokens:wt,children:bt("manualIdUpload.continue")})]})]})]})})})})},CaptureManualId=Be=>jsxRuntimeExports.jsx(IncodeProvider,{token:Be.token.token,children:jsxRuntimeExports.jsx(ThemedCaptureManualId,{...Be})});class BaseCaptureCore{constructor(){this.session=null,this.attempts=0,this.eventListeners=new Map,this.flow=null,this.idCaptureResponse=null}updateSession(Le){this.session=Le,this.emit("sessionChange",this.session)}updateFlow(Le){this.flow=Le,this.emit("flowChange",this.flow)}updateIdCaptureResponse(Le){this.idCaptureResponse=Le,this.emit("responseChanged",this.idCaptureResponse)}getFlow(){return this.flow}getSession(){return this.session}getIdCaptureResponse(){return this.idCaptureResponse}getAttempts(){return this.attempts}getMaxAttempts(){var Le;return((Le=this.flow)==null?void 0:Le.idCaptureAttempts)||3}canRetry(){return this.attempts<this.getMaxAttempts()}incrementAttempts(){this.attempts++,this.emit("attemptsChange",this.attempts)}resetAttempts(){this.attempts=0,this.emit("attemptsChange",this.attempts)}reset(){this.session=null,this.resetAttempts(),this.emit("sessionChange",this.session)}on(Le,Ye){this.eventListeners.has(Le)||this.eventListeners.set(Le,new Set);const tt=this.eventListeners.get(Le);if(!tt)throw new Error(`No listeners for event: ${Le}`);return tt.add(Ye),()=>{tt.delete(Ye),tt.size===0&&this.eventListeners.delete(Le)}}off(Le,Ye){const tt=this.eventListeners.get(Le);tt&&(tt.delete(Ye),tt.size===0&&this.eventListeners.delete(Le))}emit(Le,Ye){const tt=this.eventListeners.get(Le);tt&&tt.forEach(nt=>{nt(Ye)})}emitError(Le){this.emit("error",Le)}}function isRecordingEnabled(Be){return Be.modules.some(Le=>Le==="ENABLE_ID_RECORDING"||Le==="Enable ID recording")}const idHorizontalFrame="644650346f9f47edf1ca6b31",idVerticalFixedFrame="6454d6700f14f9356f208730",idOverlay_AutoCapture="6424aad2fddf3911cd8eee9f",idOverlay_ManualOnly="6424ab02fddf3911cd8f27a8",idOverlay_AutoManual="6424aaecfddf3911cd8f1084",paperDLFlowId="64485fa0e2c5c4b55fe9f378",FrontOrPassport=({type:Be})=>{var ht,gt;const Le=CaptureIdCore.getInstance(),Ye=(ht=Le.getFlow())==null?void 0:ht.id,tt=Le.getSession(),nt=Le.kioskOptions,ft=Le.getIdConfiguration();return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{onSuccess:At=>{if(At.showMandatoryConsent){Le.updateIdCaptureResponse(At),Le.changeStep("mandatoryConsent");return}if(At.skipBackIdCapture){Le.emit("finish",At);return}Le.changeStep("back")},onError:At=>{if(At.type==="skip"){Le.emit("finish","multiple attempts reached");return}if(!At.skipBackIdCapture){Le.changeStep("back");return}Le.emit("error",At)},type:Be,isRecordingEnabled:ft.enableIdRecording,showTutorial:ft.showTutorial,timeout:ft.autoCaptureTimeout,idDetectedTimeout:ft.idDetectedTimeout,ageAssurance:ft.ageAssurance,token:Le.getSession(),permissionBackgroundColor:"#696969",sendBase64:!0,showCustomCameraPermissionScreen:!0,publishAudio:ft.mergeSessionRecordings,showDoublePermissionsRequest:!0,blurrinessStrictMode:(gt=tt.clientId)==null?void 0:gt.includes("payjoy"),showAutoCaptureIDOverlay:[idOverlay_AutoCapture,idOverlay_AutoManual].some(At=>At===Ye),showManualCaptureIDOverlay:[idOverlay_ManualOnly,idOverlay_AutoManual].some(At=>At===Ye),defaultHorizontalMask:Ye===idHorizontalFrame,isFixedMask:Ye===idVerticalFixedFrame,showPaperDLTutorial:paperDLFlowId===Ye,numberOfTries:ft.captureAttempts,onLog:emptyFunc,isKiosk:(nt==null?void 0:nt.enableKiosk)??!1,flipVerticallyImage:(nt==null?void 0:nt.flipVerticallyImage)??!1,zoomLevel:(nt==null?void 0:nt.zoomLevel)??1,isDeepsightEnabled:ft.isDeepsightEnabled,isSecondId:ft.isSecondId})},BackId=()=>{var nt;const Be=CaptureIdCore.getInstance(),Le=(nt=Be.getFlow())==null?void 0:nt.id,Ye=Be.kioskOptions,tt=Be.getIdConfiguration();return jsxRuntimeExports.jsx(CaptureAndTutorial,{onSuccess:ft=>{if(ft.showMandatoryConsent){Be.updateIdCaptureResponse(ft),Be.changeStep("mandatoryBackConsent");return}Be.emit("finish",ft)},onError:ft=>{if(ft.type==="skip"){Be.emit("finish","multiple attempts reached");return}Be.emit("error",ft)},type:"back",isRecordingEnabled:tt.enableIdRecording,showTutorial:tt.showTutorial,captureAttempts:tt.captureAttempts,autoCaptureTimeout:tt.autoCaptureTimeout,ageAssurance:tt.ageAssurance,token:Be.getSession(),onLog:emptyFunc,numberOfTries:tt.captureAttempts,sendBase64:!0,timeout:tt.autoCaptureTimeout,showCustomCameraPermissionScreen:!0,showDoublePermissionsRequest:!0,showPaperDLTutorial:paperDLFlowId===Le,defaultHorizontalMask:Le===idHorizontalFrame,isFixedMask:Le===idVerticalFixedFrame,publishAudio:tt.mergeSessionRecordings,idDetectedTimeout:tt.idDetectedTimeout,isKiosk:(Ye==null?void 0:Ye.enableKiosk)??!1,flipVerticallyImage:(Ye==null?void 0:Ye.flipVerticallyImage)??!1,zoomLevel:(Ye==null?void 0:Ye.zoomLevel)??1,isDeepsightEnabled:tt.isDeepsightEnabled,isSecondId:tt.isSecondId})},MandatoryConsent=()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdCaptureResponse(),Ye=Le==null?void 0:Le.skipBackIdCapture;return jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.getSession(),onSuccess:()=>{Ye?Be.emit("finish",Le):Be.changeStep("back")},onCancel:tt=>{Be.emit("error",tt)},regulationType:Le==null?void 0:Le.regulationType})},MandatoryBackConsent=()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdCaptureResponse();return jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.getSession(),onSuccess:()=>{Be.emit("finish",Le)},onCancel:Ye=>{Be.emit("error",Ye)},regulationType:Le==null?void 0:Le.regulationType})},steps$3={chooser:{component:()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdConfiguration();return jsxRuntimeExports.jsx(DocumentSelector,{showManualUpload:Le.manualUploadIdCapture,goNext:Ye=>{Be.changeStep(Ye)},session:Be.getSession()})},api:null},front:{component:()=>jsxRuntimeExports.jsx(FrontOrPassport,{type:"front"}),api:null},passport:{component:()=>jsxRuntimeExports.jsx(FrontOrPassport,{type:"passport"}),api:null},mandatoryConsent:{component:()=>jsxRuntimeExports.jsx(MandatoryConsent,{}),api:null},back:{component:()=>jsxRuntimeExports.jsx(BackId,{}),api:null},mandatoryBackConsent:{component:()=>jsxRuntimeExports.jsx(MandatoryBackConsent,{}),api:null},manualIdUpload:{component:()=>jsxRuntimeExports.jsx(CaptureManualId,{token:CaptureIdCore.getInstance().getSession(),onSuccess:()=>{CaptureIdCore.getInstance().emit("finish",null)}}),api:null},end:{component:()=>null,api:null}},m1=class m1 extends BaseCaptureCore{constructor(){super(),this.steps=steps$3,this.currentStep=null,this.flow=null,this.kioskOptions=null,this.captureConfig=null}static getInstance(){return m1.instance||(m1.instance=new m1),m1.instance}setup(Le,Ye,tt){if(!this.currentStep){if(this.session=Le,this.kioskOptions=Ye,tt){this.captureConfig=tt,this.handleFlowConfiguration();return}getFlow({token:Le.token}).then(nt=>{this.flow=nt,this.handleFlowConfiguration()})}}getFlow(){return this.flow}handleFlowConfiguration(){const Le=this.getIdConfiguration();if(Le.onlyBack){this.changeStep("back");return}Le.showDocumentChooser?this.changeStep("chooser"):Le.enableId?this.changeStep("front"):Le.enablePassport&&this.changeStep("passport")}changeStep(Le){this.currentStep=Le,this.emit("stepChange",{key:this.currentStep})}getStepComponent(){return!this.currentStep||!this.flow&&!this.captureConfig?null:this.steps[this.currentStep]}reset(){super.reset(),this.currentStep=null,this.flow=null,this.emit("stepChange",{key:this.currentStep})}getIdConfiguration(){var Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt;return this.captureConfig?{showTutorial:this.captureConfig.showTutorial,captureAttempts:this.captureConfig.captureAttempts??3,enableIdRecording:this.captureConfig.enableIdRecording,autoCaptureTimeout:this.captureConfig.autoCaptureTimeout*1e3,enablePassport:this.captureConfig.enablePassport,isSecondId:this.captureConfig.isSecondId,ageAssurance:this.captureConfig.ageAssurance,mergeSessionRecordings:this.captureConfig.mergeSessionRecordings,showDocumentChooser:this.captureConfig.showDocumentChooser,onlyBack:this.captureConfig.onlyBack,enableId:this.captureConfig.enableId,manualUploadIdCapture:this.captureConfig.manualUploadIdCapture,idDetectedTimeout:this.captureConfig.idDetectionTimeout*1e3,isDeepsightEnabled:this.captureConfig.isDeepsightEnabled}:{showTutorial:(Le=this.flow)==null?void 0:Le.modules.includes("ID capture tutorial"),enableIdRecording:isRecordingEnabled(this.flow),autoCaptureTimeout:((Ye=this.flow)==null?void 0:Ye.idCaptureTimeout)*1e3,isSecondId:!1,captureAttempts:(tt=this.flow)==null?void 0:tt.idCaptureAttempts,idDetectedTimeout:((nt=this.flow)==null?void 0:nt.deviceIdleTimeout)*1e3,ageAssurance:(ft=this.flow)==null?void 0:ft.ageAssurance,mergeSessionRecordings:(ht=this.flow)==null?void 0:ht.mergeSessionRecordings,showDocumentChooser:((gt=this.flow)==null?void 0:gt.modules.includes("Enable ID"))&&((At=this.flow)==null?void 0:At.modules.includes("Enable Passport"))&&((xt=this.flow)==null?void 0:xt.showDocumentChooserScreen),onlyBack:(yt=this.flow)==null?void 0:yt.onlyBack,enableId:(Ct=this.flow)==null?void 0:Ct.modules.includes("Enable ID"),enablePassport:(Et=this.flow)==null?void 0:Et.modules.includes("Enable Passport"),manualUploadIdCapture:(vt=this.flow)==null?void 0:vt.manualUploadIdCapture,isDeepsightEnabled:((kt=this.flow)==null?void 0:kt.deepsightLiveness)==="VIDEOLIVENESS"}}};m1.instance=null;let CaptureIdCore=m1;const CaptureId$2=({onSuccess:Be,onError:Le,session:Ye,kioskOptions:tt,captureConfig:nt})=>{var xt;const ft=CaptureIdCore.getInstance(),[ht,gt]=React.useState(null);useModuleEvents({module:eventModuleNames.front,token:Ye.token,payload:{moduleVersion:"1"}}),React.useEffect(()=>{const yt=CaptureIdCore.getInstance();return()=>{yt.reset()}},[]),React.useEffect(()=>{const yt=ft.on("stepChange",vt=>{gt(vt)}),Ct=ft.on("finish",vt=>{Be==null||Be(vt)}),Et=ft.on("error",vt=>{Le(vt)});return ft.setup(Ye,tt,nt),()=>{Ct(),Et(),yt()}},[Le,Be,Ye,tt,nt,ft]);const At=(xt=ft.getStepComponent())==null?void 0:xt.component;return At?jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(At,{})}):null};class IdFlowManager extends AbstractFlowManager{constructor(){super({currentStep:null}),this.kioskOptions=null,this.idFrameSize=null,this.onCapture=null,this.captureOnly=!1,this.capturedImages={},this.permissionsGranted=!1,this.captureMode="both",this.maxFrameSize={horizontal:{width:640,height:400},vertical:{width:400,height:640}}}async initialize(Le){var Ye,tt;Le.kioskOptions&&(this.kioskOptions=Le.kioskOptions),this.parentSize=(Ye=Le.parentSize)!=null&&Ye.width&&((tt=Le.parentSize)!=null&&tt.height)?Le.parentSize:this.parentSize,this.onCapture=Le.onCapture||null,this.captureOnly=Le.captureOnly||!1,this.capturedImages={},this.captureMode=Le.captureMode||"both",await super.initialize({sessionToken:Le.sessionToken,captureConfig:Le.captureConfig,parentSize:Le.parentSize,uiConfig:Le.uiConfig}),this.setFrameSize()}async determineInitialStep(Le){return this.setState({attempts:0}),this.permissionsGranted=await this.isPermissionsEnabled(),Le.onlyBack?"id":Le.showDocumentChooser?"chooser":Le.enableId?"id":Le.enablePassport?"passport":Le.manualUploadIdCapture?"manualIdUpload":Le.digitalIdsUpload?"digitalIdUpload":"error"}goToChooser(){this.setState({currentStep:"chooser"})}goToIdStep(){this.setState({currentStep:"id"})}goToPassportStep(){this.setState({currentStep:"passport"})}goToManualUploadStep(){this.setState({currentStep:"manualIdUpload"})}goToDigitalIdUploadStep(){this.setState({currentStep:"digitalIdUpload"})}storeCapturedImage(Le,Ye){this.capturedImages[Le]=Ye}completeCaptureOnlyFlow(){const{front:Le,back:Ye}=this.capturedImages;!this.captureOnly||!this.onCapture||this.onCapture({frontImage:Le,backImage:Ye})}goToPermissions(){this.setState({currentStep:"permissions"})}changeStep(Le){this.setState({currentStep:Le})}setParentSize(Le){this.parentSize=Le,this.setFrameSize()}setFrameSize(){this.parentSize&&(this.idFrameSize={horizontal:{width:this.parentSize?this.parentSize.width>options.maxContentWidth?this.maxFrameSize.horizontal.width:this.parentSize.width>600?this.parentSize.width*.65:this.parentSize.width*.9:window.innerWidth*.9,height:null},vertical:{width:null,height:this.parentSize.height-350>this.maxFrameSize.vertical.height?this.maxFrameSize.vertical.height:this.parentSize.height-350}})}getPermissionsGranted(){return this.permissionsGranted}getHorizontalFrameSize(){var Le;return((Le=this.idFrameSize)==null?void 0:Le.horizontal)||null}getVerticalFrameSize(){var Le;return((Le=this.idFrameSize)==null?void 0:Le.vertical)||null}getFrameSizeByOrientation(Le){var Ye;return((Ye=this.idFrameSize)==null?void 0:Ye[Le])||null}completeFlow(){this.setState({successData:this.state.successData,flowOutcome:"success",currentStep:"end"})}completeWithError(Le){this.setState({errorDetails:Le,flowOutcome:"error",currentStep:"error"})}saveCaptureResponse(Le){this.setState({successData:Le})}getCaptureConfiguration(){var nt,ft,ht;const Le=this.captureConfig;if(Le)return{showTutorial:Le.showTutorial,captureAttempts:Le.captureAttempts??3,isRecordingEnabled:Le.enableIdRecording,autoCaptureTimeout:Le.autoCaptureTimeout*1e3,enablePassport:Le.enablePassport,isSecondId:Le.isSecondId,ageAssurance:Le.ageAssurance,mergeSessionRecordings:Le.mergeSessionRecordings,showDocumentChooser:Le.showDocumentChooser,onlyBack:this.captureMode==="back_only"?!0:Le.onlyBack,enableId:Le.enableId,manualUploadIdCapture:Le.manualUploadIdCapture,digitalIdsUpload:Le.digitalIdsUpload,idDetectedTimeout:Le.idDetectionTimeout*1e3,isDeepsightEnabled:Le.isDeepsightEnabled,usSmartCapture:Le.usSmartCapture,onlyFront:this.captureMode==="front_only"};const Ye=(nt=this.flow.flowModules.find(gt=>gt.key==="ID"))==null?void 0:nt.configuration,tt=(ht=(ft=this.flow.flowModules.find(gt=>gt.key==="SELFIE"))==null?void 0:ft.configuration)==null?void 0:ht.deepsightLiveness;return{showTutorial:Ye.showTutorial,isRecordingEnabled:Ye.enableIdRecording,autoCaptureTimeout:Ye.autoCaptureTimeout*1e3,isSecondId:!1,captureAttempts:Ye.captureAttempts??3,idDetectedTimeout:Ye.deviceIdleTimeout*1e3,ageAssurance:this.flow.ageAssurance,mergeSessionRecordings:this.flow.mergeSessionRecordings,showDocumentChooser:Ye.showDocumentChooserScreen,onlyBack:Ye.onlyBack,onlyFront:!1,enableId:Ye.enableId,enablePassport:Ye.enablePassport,manualUploadIdCapture:Ye.manualUploadIdCapture,digitalIdsUpload:Ye.digitalIdsUpload||!1,isDeepsightEnabled:tt==="VIDEOLIVENESS",usSmartCapture:Ye.usSmartCapture}}getMaxAttempts(){var Le;return((Le=this.captureConfiguration)==null?void 0:Le.captureAttempts)||3}onClose(){super.onClose(FlowType.ID)}}const idFlowManager=new IdFlowManager,SHARPNESS_THRESHOLD=10,GLARE_THRESHOLD=10;class CaptureIdError extends Error{constructor(Le,Ye,tt){super(Ye),this.errorKey=Le,this.messageDescription=tt,this.name="CaptureIdError"}}const createCaptureIdApi=Be=>{if(!Be)throw new CaptureIdError("NO_TOKEN","Session token not found");const Le=async tt=>{const nt=tt.ageAssurance?[tt.type==="back"?"croppedBackID":"croppedFrontID"]:[];try{return await getImages$1({token:Be,body:{images:["croppedIDFace",...nt]}})}catch{return{croppedIDFace:"",croppedFrontID:"",croppedBackID:""}}},Ye=(tt,nt)=>tt.failReason==="ID_TYPE_UNACCEPTABLE"?{error:!0,message:"ID type is not acceptable",messageDescription:"Please use a valid ID type",errorKey:"ID_TYPE_UNACCEPTABLE"}:tt.failReason==="WRONG_DOCUMENT_SIDE"?{error:!0,message:"Wrong side of document",messageDescription:tt.side==="back"?"Please show the back side of your ID":"Please show the front side of your ID",errorKey:"WRONG_DOCUMENT_SIDE"}:tt.classification?tt.sharpness!==void 0&&tt.sharpness<SHARPNESS_THRESHOLD?{error:!0,message:"Image is not sharp enough",messageDescription:"Please ensure the image is clear and well-focused",errorKey:"LOW_SHARPNESS"}:tt.glare!==void 0&&tt.glare<GLARE_THRESHOLD&&!(nt!=null&&nt.skipGlareFront)?{error:!0,message:"Glare detected on ID",messageDescription:"Please avoid bright reflections on your ID",errorKey:"GLARE_DETECTED"}:{error:!1,message:null,errorKey:null}:{error:!0,message:"ID classification failed",errorKey:"CLASSIFICATION_FAILED"};return{async uploadId(tt){var nt,ft;try{idFlowManager.incrementAttempts(),(nt=tt.onProgress)==null||nt.call(tt,0),await onboardingAnalytics.analyzeFrame(tt.image),onboardingAnalytics.update(),MlWasmJSApi$1.reset(),tt.type==="front"&&addDeviceStats(Be,{frontIdStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),backIdStatsAnalysisStatus:"",selfieStatsAnalysisStatus:"",motionStatus:onboardingAnalytics.getMotionStatus()}),tt.type==="back"&&addDeviceStats(Be,{frontIdStatsAnalysisStatus:"",backIdStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),selfieStatsAnalysisStatus:"",motionStatus:onboardingAnalytics.getMotionStatus()}),addEvent({token:Be,code:"captureAttemptFinished",module:"ID",payload:{logs:onboardingAnalytics.getPipelineLogs()}});const ht=await capture({...tt,token:Be,type:tt.type==="front"?frontType:backType,encrypted:!1,faceCoordinates:void 0,imageType:void 0,onProgress:tt.onProgress,metadata:onboardingAnalytics.getMetadata()}),gt=await Le({type:tt.type,ageAssurance:tt.ageAssurance}),At={...ht,originalImage:tt.image,frontIdImage:tt.type==="front"?tt.image:void 0,backIdImage:gt.croppedBackID,...gt};idFlowManager.saveCaptureResponse(At);const xt=Ye({...At,side:tt.type},{skipGlareFront:ht.skipGlareFront,skipGlareBack:ht.skipGlareBack});if(xt.error)throw new CaptureIdError(xt.errorKey,xt.message,xt.messageDescription);return(ft=tt.onProgress)==null||ft.call(tt,100),idFlowManager.resetAttempts(),At}catch(ht){if(!idFlowManager.canRetry()){const gt=idFlowManager.getState().successData;throw tt.type!=="front"?new CaptureIdError("NO_MORE_TRIES","No more retry attempts available"):gt!=null&&gt.skipBackIdCapture?new CaptureIdError("RETRY_EXHAUSTED_SKIP_BACK","Front ID retries exhausted, skip back ID capture"):new CaptureIdError("RETRY_EXHAUSTED_CONTINUE_TO_BACK","Front ID retries exhausted, continue to back ID capture")}throw ht instanceof CaptureIdError?ht:new CaptureIdError("UNEXPECTED_ERROR","Unexpected capture error")}},reset(){idFlowManager.resetAttempts()}}},useCaptureIdState=()=>{const[Be,Le]=React.useState(idFlowManager.getState()),[Ye,tt]=React.useState(null);React.useEffect(()=>idFlowManager.subscribe(Le),[]);const nt=idFlowManager.getToken();React.useEffect(()=>{if(!nt){tt(null);return}try{const ht=createCaptureIdApi(nt);tt(ht)}catch(ht){console.error("Failed to create capture API:",ht),tt(null)}},[nt]);const ft=idFlowManager.getCaptureConfiguration();return{token:idFlowManager.getToken(),currentStep:Be.currentStep,flowOutcome:Be.flowOutcome,isLoading:Be.isLoading,errorDetails:Be.errorDetails,successData:Be.successData,attempts:Be.attempts,uploadId:Ye==null?void 0:Ye.uploadId.bind(Ye),completeWithError:ht=>idFlowManager.completeWithError(ht),reset:()=>idFlowManager.reset(),canRetry:()=>idFlowManager.canRetry(),getAttempts:()=>Be.attempts,completeFlow:()=>idFlowManager.completeFlow(),goToChooser:()=>idFlowManager.goToChooser(),goToIdStep:()=>idFlowManager.goToIdStep(),goToPassportStep:()=>idFlowManager.goToPassportStep(),goToManualUploadStep:()=>idFlowManager.goToManualUploadStep(),goToDigitalIdUploadStep:()=>idFlowManager.goToDigitalIdUploadStep(),goToPermissions:()=>idFlowManager.goToPermissions(),changeStep:ht=>idFlowManager.changeStep(ht),resetAttempts:()=>idFlowManager.resetAttempts(),kioskOptions:idFlowManager.kioskOptions,captureConfiguration:ft,attemptsLeft:idFlowManager.getAttemptsLeft(),uiConfig:idFlowManager.uiConfig,captureOnly:idFlowManager.captureOnly,onCapture:idFlowManager.onCapture,storeCapturedImage:(ht,gt)=>idFlowManager.storeCapturedImage(ht,gt),completeCaptureOnlyFlow:()=>idFlowManager.completeCaptureOnlyFlow(),isDeepsightEnabled:ft.isDeepsightEnabled}},IdFlowPage=({closeButtonColor:Be,closeButtonOnCancel:Le,...Ye})=>{const{uiConfig:tt}=useCaptureIdState(),nt=Be?{...tt,closeButton:{...tt==null?void 0:tt.closeButton,color:Be}}:tt;return jsxRuntimeExports.jsx(FlowPage,{uiConfig:nt,onClose:()=>idFlowManager.onClose(),onCloseCancel:Le,...Ye})},StyledArrowIcon$1=dt.svg`
5247
+ `,ThemedCaptureManualId=Be=>{var Dt;const{onlyFront:Le}=Be,[Ye,tt]=React.useState("id"),[nt,ft]=React.useState({front:!1,back:!1,passport:!1}),[ht,gt]=React.useState(((Dt=Be.token)==null?void 0:Dt.idCaptureRetries)-3||3),[At,xt]=React.useState(null),[yt,Ct]=React.useState(!1),[Et,vt]=React.useState(null),kt=React.useRef(null),{t:bt}=useTranslation$1(),wt=useTokens(),It=React.useMemo(()=>Object.values(nt).some(Ot=>Ot===!0),[nt]),Rt=Ot=>{const Lt={WRONG_DOCUMENT_SIDE:bt("manualIdUpload.wrongSide"),WRONG_ONE_SIDED_DOCUMENT:bt("manualIdUpload.wrongSide"),UNKNOWN_DOCUMENT_TYPE:bt("manualIdUpload.pleaseUploadCorrectDocument")};return Lt[Ot.failReason]?(xt(Lt[Ot.failReason]),gt(ht-1),!0):Ot.failReason?(xt(bt("manualIdUpload.somethingWentWrong")),gt(ht-1),!0):Et==="passport"&&Ot.typeOfId!=="Passport"||["front","back"].includes(Et)&&Ot.typeOfId==="Passport"?(xt(bt("manualIdUpload.pleaseUploadCorrectDocument")),gt(ht-1),!0):!1},Tt=async Ot=>{const Lt=Ot.target.files[0],Wt=5*1024*1024;if(Lt.size>Wt){xt(bt("manualIdUpload.fileTooBig"));return}Ct(!0),xt(null),(async()=>{Ct(!0);try{const qt=await capture({token:Be.token.token,image:Lt,type:["front","passport"].includes(Et)?"front":"back",onProgress:()=>{},sendBase64:!1,onlyFront:!1,isRetry:!1,isSecondId:!1,encrypted:!1,faceCoordinates:void 0,imageType:Lt.type,shouldSkipGlareBack:!1,shouldSkipGlareFront:!1,captureType:"UPLOAD",metadata:MlWasmJSApi$1.getMetadata()}),Ht=(qt.skipBackIdCapture||Et==="front"&&Le)&&{back:!0};Rt(qt)||(ft(Ut=>({...Ut,[Et]:!0,...Ht})),Ot.target.value="")}catch(qt){console.error("Error uploading image:",qt)}finally{Ct(!1)}})()},Bt=Ot=>{vt(Ot),kt.current&&kt.current.click()},Pt=()=>Ye==="id"?!(nt.front&&nt.back):!nt.passport;return yt?jsxRuntimeExports.jsx(Spinner$4,{title:bt("manualIdUpload.holdOnASec"),subtitle:bt("idv2.manualUploadLoading.subtitle")}):ht===0?(setTimeout(()=>{Be.onSuccess()},5e3),jsxRuntimeExports.jsx(Page$1,{title:bt("manualIdUpload.tooManyTries"),maxW:"450px","data-testid":"manual-upload-error-page",children:jsxRuntimeExports.jsx(Flex,{direction:"column",align:"center",justify:"center",hFull:!0,children:jsxRuntimeExports.jsx(Text$8,{textAlign:"center",color:wt.color.text.body.secondary,fontSize:wt.typography.fontSize.base,children:bt("manualIdUpload.contactedByAdmin")})})})):jsxRuntimeExports.jsx(Page$1,{title:bt("manualIdUpload.title"),maxW:"450px","data-testid":"manual-upload-page",children:jsxRuntimeExports.jsx(Flex,{direction:"column",gap:4,hFull:!0,children:jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",gap:4,hFull:!0,mt:6,children:[jsxRuntimeExports.jsxs(ManualIdUploadTabs,{tokens:wt,children:[jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>tt("id"),className:Ye==="id"&&"selected",disabled:It,children:bt("manualIdUpload.id")}),jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>tt("passport"),className:Ye==="passport"&&"selected",disabled:It,children:bt("manualIdUpload.passport")})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",hFull:!0,justify:"space-between",children:[jsxRuntimeExports.jsxs(UploadDocumentContainer,{className:"IncodeManualUploadSectionContainer",children:[jsxRuntimeExports.jsx("input",{type:"file",style:{display:"none"},ref:kt,onChange:Tt,accept:"image/*"}),Ye==="id"&&jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],borderColor:wt.color.border.primary,children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",gap:2,children:[jsxRuntimeExports.jsx(IdFrontIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,children:bt("manualIdUpload.frontId")})]}),nt.front?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("front"),disabled:nt.front,tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]}),Le?null:jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],borderColor:wt.color.border.primary,children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",gap:2,children:[jsxRuntimeExports.jsx(IdBackIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,children:bt("manualIdUpload.backId")})]}),nt.back?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("back"),disabled:!nt.front,tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]})]}),Ye==="passport"&&jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsxs(UploadDocButton,{bgColor:wt.color.surface.secondary[50],children:[jsxRuntimeExports.jsxs(Flex,{align:"center",justify:"space-between",children:[jsxRuntimeExports.jsx(UploadPassportIcon,{}),jsxRuntimeExports.jsx(Text$8,{fontWeight:wt.typography.fontWeight.medium,color:wt.color.text.body.primary,ml:"12px",children:bt("manualIdUpload.passport")})]}),nt.passport?jsxRuntimeExports.jsx(SuccessIcon,{}):jsxRuntimeExports.jsx(UploadLabel,{type:"button",onClick:()=>Bt("passport"),tokens:wt,bgColor:wt.color.surface.primary[500],children:bt("manualIdUpload.upload")})]})}),At&&jsxRuntimeExports.jsxs(ErrorText$2,{fontSize:wt.typography.fontSize.sm,color:wt.color.surface.status.negative,children:[jsxRuntimeExports.jsx(ErrorIcon$1,{size:16}),jsxRuntimeExports.jsx("p",{children:"Please upload the correct document"})]})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",justify:"space-between",gap:5,children:[jsxRuntimeExports.jsxs(InstructionsList,{className:"IncodeManualUploadInstrucctions",textColor:wt.color.text.body.primary,bgColor:`${wt.color.surface.primary[50]}`,children:[jsxRuntimeExports.jsx("li",{children:bt(`manualIdUpload.${Ye}Text`)}),jsxRuntimeExports.jsx("li",{children:bt("manualIdUpload.glareFree")})]}),jsxRuntimeExports.jsx(CompleteUploadButton,{type:"button",onClick:()=>Be.onSuccess(),disabled:Pt(),tokens:wt,children:bt("manualIdUpload.continue")})]})]})]})})})})},CaptureManualId=Be=>jsxRuntimeExports.jsx(IncodeProvider,{token:Be.token.token,children:jsxRuntimeExports.jsx(ThemedCaptureManualId,{...Be})});class BaseCaptureCore{constructor(){this.session=null,this.attempts=0,this.eventListeners=new Map,this.flow=null,this.idCaptureResponse=null}updateSession(Le){this.session=Le,this.emit("sessionChange",this.session)}updateFlow(Le){this.flow=Le,this.emit("flowChange",this.flow)}updateIdCaptureResponse(Le){this.idCaptureResponse=Le,this.emit("responseChanged",this.idCaptureResponse)}getFlow(){return this.flow}getSession(){return this.session}getIdCaptureResponse(){return this.idCaptureResponse}getAttempts(){return this.attempts}getMaxAttempts(){var Le;return((Le=this.flow)==null?void 0:Le.idCaptureAttempts)||3}canRetry(){return this.attempts<this.getMaxAttempts()}incrementAttempts(){this.attempts++,this.emit("attemptsChange",this.attempts)}resetAttempts(){this.attempts=0,this.emit("attemptsChange",this.attempts)}reset(){this.session=null,this.resetAttempts(),this.emit("sessionChange",this.session)}on(Le,Ye){this.eventListeners.has(Le)||this.eventListeners.set(Le,new Set);const tt=this.eventListeners.get(Le);if(!tt)throw new Error(`No listeners for event: ${Le}`);return tt.add(Ye),()=>{tt.delete(Ye),tt.size===0&&this.eventListeners.delete(Le)}}off(Le,Ye){const tt=this.eventListeners.get(Le);tt&&(tt.delete(Ye),tt.size===0&&this.eventListeners.delete(Le))}emit(Le,Ye){const tt=this.eventListeners.get(Le);tt&&tt.forEach(nt=>{nt(Ye)})}emitError(Le){this.emit("error",Le)}}function isRecordingEnabled(Be){return Be.modules.some(Le=>Le==="ENABLE_ID_RECORDING"||Le==="Enable ID recording")}const idHorizontalFrame="644650346f9f47edf1ca6b31",idVerticalFixedFrame="6454d6700f14f9356f208730",idOverlay_AutoCapture="6424aad2fddf3911cd8eee9f",idOverlay_ManualOnly="6424ab02fddf3911cd8f27a8",idOverlay_AutoManual="6424aaecfddf3911cd8f1084",paperDLFlowId="64485fa0e2c5c4b55fe9f378",FrontOrPassport=({type:Be})=>{var ht,gt;const Le=CaptureIdCore.getInstance(),Ye=(ht=Le.getFlow())==null?void 0:ht.id,tt=Le.getSession(),nt=Le.kioskOptions,ft=Le.getIdConfiguration();return jsxRuntimeExports.jsx(CaptureAndTutorial$1,{onSuccess:At=>{if(At.showMandatoryConsent){Le.updateIdCaptureResponse(At),Le.changeStep("mandatoryConsent");return}if(At.skipBackIdCapture){Le.emit("finish",At);return}Le.changeStep("back")},onError:At=>{if(At.type==="skip"){Le.emit("finish","multiple attempts reached");return}if(!At.skipBackIdCapture){Le.changeStep("back");return}Le.emit("error",At)},type:Be,isRecordingEnabled:ft.enableIdRecording,showTutorial:ft.showTutorial,timeout:ft.autoCaptureTimeout,idDetectedTimeout:ft.idDetectedTimeout,ageAssurance:ft.ageAssurance,token:Le.getSession(),permissionBackgroundColor:"#696969",sendBase64:!0,showCustomCameraPermissionScreen:!0,publishAudio:ft.mergeSessionRecordings,showDoublePermissionsRequest:!0,blurrinessStrictMode:(gt=tt.clientId)==null?void 0:gt.includes("payjoy"),showAutoCaptureIDOverlay:[idOverlay_AutoCapture,idOverlay_AutoManual].some(At=>At===Ye),showManualCaptureIDOverlay:[idOverlay_ManualOnly,idOverlay_AutoManual].some(At=>At===Ye),defaultHorizontalMask:Ye===idHorizontalFrame,isFixedMask:Ye===idVerticalFixedFrame,showPaperDLTutorial:paperDLFlowId===Ye,numberOfTries:ft.captureAttempts,onLog:emptyFunc,isKiosk:(nt==null?void 0:nt.enableKiosk)??!1,flipVerticallyImage:(nt==null?void 0:nt.flipVerticallyImage)??!1,zoomLevel:(nt==null?void 0:nt.zoomLevel)??1,isDeepsightEnabled:ft.isDeepsightEnabled,isSecondId:ft.isSecondId})},BackId=()=>{var nt;const Be=CaptureIdCore.getInstance(),Le=(nt=Be.getFlow())==null?void 0:nt.id,Ye=Be.kioskOptions,tt=Be.getIdConfiguration();return jsxRuntimeExports.jsx(CaptureAndTutorial,{onSuccess:ft=>{if(ft.showMandatoryConsent){Be.updateIdCaptureResponse(ft),Be.changeStep("mandatoryBackConsent");return}Be.emit("finish",ft)},onError:ft=>{if(ft.type==="skip"){Be.emit("finish","multiple attempts reached");return}Be.emit("error",ft)},type:"back",isRecordingEnabled:tt.enableIdRecording,showTutorial:tt.showTutorial,captureAttempts:tt.captureAttempts,autoCaptureTimeout:tt.autoCaptureTimeout,ageAssurance:tt.ageAssurance,token:Be.getSession(),onLog:emptyFunc,numberOfTries:tt.captureAttempts,sendBase64:!0,timeout:tt.autoCaptureTimeout,showCustomCameraPermissionScreen:!0,showDoublePermissionsRequest:!0,showPaperDLTutorial:paperDLFlowId===Le,defaultHorizontalMask:Le===idHorizontalFrame,isFixedMask:Le===idVerticalFixedFrame,publishAudio:tt.mergeSessionRecordings,idDetectedTimeout:tt.idDetectedTimeout,isKiosk:(Ye==null?void 0:Ye.enableKiosk)??!1,flipVerticallyImage:(Ye==null?void 0:Ye.flipVerticallyImage)??!1,zoomLevel:(Ye==null?void 0:Ye.zoomLevel)??1,isDeepsightEnabled:tt.isDeepsightEnabled,isSecondId:tt.isSecondId})},MandatoryConsent=()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdCaptureResponse(),Ye=Le==null?void 0:Le.skipBackIdCapture;return jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.getSession(),onSuccess:()=>{Ye?Be.emit("finish",Le):Be.changeStep("back")},onCancel:tt=>{Be.emit("error",tt)},regulationType:Le==null?void 0:Le.regulationType})},MandatoryBackConsent=()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdCaptureResponse();return jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be.getSession(),onSuccess:()=>{Be.emit("finish",Le)},onCancel:Ye=>{Be.emit("error",Ye)},regulationType:Le==null?void 0:Le.regulationType})},steps$3={chooser:{component:()=>{const Be=CaptureIdCore.getInstance(),Le=Be.getIdConfiguration();return jsxRuntimeExports.jsx(DocumentSelector,{showManualUpload:Le.manualUploadIdCapture,goNext:Ye=>{Be.changeStep(Ye)},session:Be.getSession()})},api:null},front:{component:()=>jsxRuntimeExports.jsx(FrontOrPassport,{type:"front"}),api:null},passport:{component:()=>jsxRuntimeExports.jsx(FrontOrPassport,{type:"passport"}),api:null},mandatoryConsent:{component:()=>jsxRuntimeExports.jsx(MandatoryConsent,{}),api:null},back:{component:()=>jsxRuntimeExports.jsx(BackId,{}),api:null},mandatoryBackConsent:{component:()=>jsxRuntimeExports.jsx(MandatoryBackConsent,{}),api:null},manualIdUpload:{component:()=>jsxRuntimeExports.jsx(CaptureManualId,{token:CaptureIdCore.getInstance().getSession(),onSuccess:()=>{CaptureIdCore.getInstance().emit("finish",null)}}),api:null},end:{component:()=>null,api:null}},m1=class m1 extends BaseCaptureCore{constructor(){super(),this.steps=steps$3,this.currentStep=null,this.flow=null,this.kioskOptions=null,this.captureConfig=null}static getInstance(){return m1.instance||(m1.instance=new m1),m1.instance}setup(Le,Ye,tt){if(!this.currentStep){if(this.session=Le,this.kioskOptions=Ye,tt){this.captureConfig=tt,this.handleFlowConfiguration();return}getFlow({token:Le.token}).then(nt=>{this.flow=nt,this.handleFlowConfiguration()})}}getFlow(){return this.flow}handleFlowConfiguration(){const Le=this.getIdConfiguration();if(Le.onlyBack){this.changeStep("back");return}Le.showDocumentChooser?this.changeStep("chooser"):Le.enableId?this.changeStep("front"):Le.enablePassport&&this.changeStep("passport")}changeStep(Le){this.currentStep=Le,this.emit("stepChange",{key:this.currentStep})}getStepComponent(){return!this.currentStep||!this.flow&&!this.captureConfig?null:this.steps[this.currentStep]}reset(){super.reset(),this.currentStep=null,this.flow=null,this.emit("stepChange",{key:this.currentStep})}getIdConfiguration(){var Le,Ye,tt,nt,ft,ht,gt,At,xt,yt,Ct,Et,vt,kt;return this.captureConfig?{showTutorial:this.captureConfig.showTutorial,captureAttempts:this.captureConfig.captureAttempts??3,enableIdRecording:this.captureConfig.enableIdRecording,autoCaptureTimeout:this.captureConfig.autoCaptureTimeout*1e3,enablePassport:this.captureConfig.enablePassport,isSecondId:this.captureConfig.isSecondId,ageAssurance:this.captureConfig.ageAssurance,mergeSessionRecordings:this.captureConfig.mergeSessionRecordings,showDocumentChooser:this.captureConfig.showDocumentChooser,onlyBack:this.captureConfig.onlyBack,enableId:this.captureConfig.enableId,manualUploadIdCapture:this.captureConfig.manualUploadIdCapture,idDetectedTimeout:this.captureConfig.idDetectionTimeout*1e3,isDeepsightEnabled:this.captureConfig.isDeepsightEnabled}:{showTutorial:(Le=this.flow)==null?void 0:Le.modules.includes("ID capture tutorial"),enableIdRecording:isRecordingEnabled(this.flow),autoCaptureTimeout:((Ye=this.flow)==null?void 0:Ye.idCaptureTimeout)*1e3,isSecondId:!1,captureAttempts:(tt=this.flow)==null?void 0:tt.idCaptureAttempts,idDetectedTimeout:((nt=this.flow)==null?void 0:nt.deviceIdleTimeout)*1e3,ageAssurance:(ft=this.flow)==null?void 0:ft.ageAssurance,mergeSessionRecordings:(ht=this.flow)==null?void 0:ht.mergeSessionRecordings,showDocumentChooser:((gt=this.flow)==null?void 0:gt.modules.includes("Enable ID"))&&((At=this.flow)==null?void 0:At.modules.includes("Enable Passport"))&&((xt=this.flow)==null?void 0:xt.showDocumentChooserScreen),onlyBack:(yt=this.flow)==null?void 0:yt.onlyBack,enableId:(Ct=this.flow)==null?void 0:Ct.modules.includes("Enable ID"),enablePassport:(Et=this.flow)==null?void 0:Et.modules.includes("Enable Passport"),manualUploadIdCapture:(vt=this.flow)==null?void 0:vt.manualUploadIdCapture,isDeepsightEnabled:((kt=this.flow)==null?void 0:kt.deepsightLiveness)==="VIDEOLIVENESS"}}};m1.instance=null;let CaptureIdCore=m1;const CaptureId$2=({onSuccess:Be,onError:Le,session:Ye,kioskOptions:tt,captureConfig:nt})=>{var xt;const ft=CaptureIdCore.getInstance(),[ht,gt]=React.useState(null);useModuleEvents({module:eventModuleNames.front,token:Ye.token,payload:{moduleVersion:"1"}}),React.useEffect(()=>{const yt=CaptureIdCore.getInstance();return()=>{yt.reset()}},[]),React.useEffect(()=>{const yt=ft.on("stepChange",vt=>{gt(vt)}),Ct=ft.on("finish",vt=>{Be==null||Be(vt)}),Et=ft.on("error",vt=>{Le(vt)});return ft.setup(Ye,tt,nt),()=>{Ct(),Et(),yt()}},[Le,Be,Ye,tt,nt,ft]);const At=(xt=ft.getStepComponent())==null?void 0:xt.component;return At?jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(At,{})}):null};class IdFlowManager extends AbstractFlowManager{constructor(){super({currentStep:null}),this.kioskOptions=null,this.idFrameSize=null,this.onCapture=null,this.captureOnly=!1,this.capturedImages={},this.permissionsGranted=!1,this.captureMode="both",this.maxFrameSize={horizontal:{width:640,height:400},vertical:{width:400,height:640}}}async initialize(Le){var Ye,tt;Le.kioskOptions&&(this.kioskOptions=Le.kioskOptions),this.parentSize=(Ye=Le.parentSize)!=null&&Ye.width&&((tt=Le.parentSize)!=null&&tt.height)?Le.parentSize:this.parentSize,this.onCapture=Le.onCapture||null,this.captureOnly=Le.captureOnly||!1,this.capturedImages={},this.captureMode=Le.captureMode||"both",this.uiConfig=Le.uiConfig||null,await super.initialize({sessionToken:Le.sessionToken,captureConfig:Le.captureConfig,parentSize:Le.parentSize,uiConfig:Le.uiConfig}),this.setFrameSize()}async determineInitialStep(Le){return this.setState({attempts:0}),this.permissionsGranted=await this.isPermissionsEnabled(),Le.onlyBack?"id":Le.showDocumentChooser?"chooser":Le.enableId?"id":Le.enablePassport?"passport":Le.manualUploadIdCapture?"manualIdUpload":Le.digitalIdsUpload?"digitalIdUpload":"error"}goToChooser(){this.setState({currentStep:"chooser"})}goToIdStep(){this.setState({currentStep:"id"})}goToPassportStep(){this.setState({currentStep:"passport"})}goToManualUploadStep(){this.setState({currentStep:"manualIdUpload"})}goToDigitalIdUploadStep(){this.setState({currentStep:"digitalIdUpload"})}storeCapturedImage(Le,Ye){this.capturedImages[Le]=Ye}completeCaptureOnlyFlow(){const{front:Le,back:Ye}=this.capturedImages;!this.captureOnly||!this.onCapture||this.onCapture({frontImage:Le,backImage:Ye})}goToPermissions(){this.setState({currentStep:"permissions"})}changeStep(Le){this.setState({currentStep:Le})}setParentSize(Le){this.parentSize=Le,this.setFrameSize()}setFrameSize(){this.parentSize&&(this.idFrameSize={horizontal:{width:this.parentSize?this.parentSize.width>options.maxContentWidth?this.maxFrameSize.horizontal.width:this.parentSize.width>600?this.parentSize.width*.65:this.parentSize.width*.9:window.innerWidth*.9,height:null},vertical:{width:null,height:this.parentSize.height-350>this.maxFrameSize.vertical.height?this.maxFrameSize.vertical.height:this.parentSize.height-350}})}getPermissionsGranted(){return this.permissionsGranted}getHorizontalFrameSize(){var Le;return((Le=this.idFrameSize)==null?void 0:Le.horizontal)||null}getVerticalFrameSize(){var Le;return((Le=this.idFrameSize)==null?void 0:Le.vertical)||null}getFrameSizeByOrientation(Le){var Ye;return((Ye=this.idFrameSize)==null?void 0:Ye[Le])||null}completeFlow(){this.setState({successData:this.state.successData,flowOutcome:"success",currentStep:"end"})}completeWithError(Le){this.setState({errorDetails:Le,flowOutcome:"error",currentStep:"error"})}saveCaptureResponse(Le){this.setState({successData:Le})}getCaptureConfiguration(){var nt,ft,ht;const Le=this.captureConfig;if(Le)return{showTutorial:Le.showTutorial,captureAttempts:Le.captureAttempts??3,isRecordingEnabled:Le.enableIdRecording,autoCaptureTimeout:Le.autoCaptureTimeout*1e3,enablePassport:Le.enablePassport,isSecondId:Le.isSecondId,ageAssurance:Le.ageAssurance,mergeSessionRecordings:Le.mergeSessionRecordings,showDocumentChooser:Le.showDocumentChooser,onlyBack:this.captureMode==="back_only"?!0:Le.onlyBack,enableId:Le.enableId,manualUploadIdCapture:Le.manualUploadIdCapture,digitalIdsUpload:Le.digitalIdsUpload,idDetectedTimeout:Le.idDetectionTimeout*1e3,isDeepsightEnabled:Le.isDeepsightEnabled,usSmartCapture:Le.usSmartCapture,onlyFront:this.captureMode==="front_only"};const Ye=(nt=this.flow.flowModules.find(gt=>gt.key==="ID"))==null?void 0:nt.configuration,tt=(ht=(ft=this.flow.flowModules.find(gt=>gt.key==="SELFIE"))==null?void 0:ft.configuration)==null?void 0:ht.deepsightLiveness;return{showTutorial:Ye.showTutorial,isRecordingEnabled:Ye.enableIdRecording,autoCaptureTimeout:Ye.autoCaptureTimeout*1e3,isSecondId:!1,captureAttempts:Ye.captureAttempts??3,idDetectedTimeout:Ye.deviceIdleTimeout*1e3,ageAssurance:this.flow.ageAssurance,mergeSessionRecordings:this.flow.mergeSessionRecordings,showDocumentChooser:Ye.showDocumentChooserScreen,onlyBack:Ye.onlyBack,onlyFront:!1,enableId:Ye.enableId,enablePassport:Ye.enablePassport,manualUploadIdCapture:Ye.manualUploadIdCapture,digitalIdsUpload:Ye.digitalIdsUpload||!1,isDeepsightEnabled:tt==="VIDEOLIVENESS",usSmartCapture:Ye.usSmartCapture}}getMaxAttempts(){var Le;return((Le=this.captureConfiguration)==null?void 0:Le.captureAttempts)||3}onClose(){super.onClose(FlowType.ID)}}const idFlowManager=new IdFlowManager,SHARPNESS_THRESHOLD=10,GLARE_THRESHOLD=10;class CaptureIdError extends Error{constructor(Le,Ye,tt){super(Ye),this.errorKey=Le,this.messageDescription=tt,this.name="CaptureIdError"}}const createCaptureIdApi=Be=>{if(!Be)throw new CaptureIdError("NO_TOKEN","Session token not found");const Le=async tt=>{const nt=tt.ageAssurance?[tt.type==="back"?"croppedBackID":"croppedFrontID"]:[];try{return await getImages$1({token:Be,body:{images:["croppedIDFace",...nt]}})}catch{return{croppedIDFace:"",croppedFrontID:"",croppedBackID:""}}},Ye=(tt,nt)=>tt.failReason==="ID_TYPE_UNACCEPTABLE"?{error:!0,message:"ID type is not acceptable",messageDescription:"Please use a valid ID type",errorKey:"ID_TYPE_UNACCEPTABLE"}:tt.failReason==="WRONG_DOCUMENT_SIDE"?{error:!0,message:"Wrong side of document",messageDescription:tt.side==="back"?"Please show the back side of your ID":"Please show the front side of your ID",errorKey:"WRONG_DOCUMENT_SIDE"}:tt.classification?tt.sharpness!==void 0&&tt.sharpness<SHARPNESS_THRESHOLD?{error:!0,message:"Image is not sharp enough",messageDescription:"Please ensure the image is clear and well-focused",errorKey:"LOW_SHARPNESS"}:tt.glare!==void 0&&tt.glare<GLARE_THRESHOLD&&!(nt!=null&&nt.skipGlareFront)?{error:!0,message:"Glare detected on ID",messageDescription:"Please avoid bright reflections on your ID",errorKey:"GLARE_DETECTED"}:{error:!1,message:null,errorKey:null}:{error:!0,message:"ID classification failed",errorKey:"CLASSIFICATION_FAILED"};return{async uploadId(tt){var nt,ft;try{idFlowManager.incrementAttempts(),(nt=tt.onProgress)==null||nt.call(tt,0),await onboardingAnalytics.analyzeFrame(tt.image),onboardingAnalytics.update(),MlWasmJSApi$1.reset(),tt.type==="front"&&addDeviceStats(Be,{frontIdStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),backIdStatsAnalysisStatus:"",selfieStatsAnalysisStatus:"",motionStatus:onboardingAnalytics.getMotionStatus()}),tt.type==="back"&&addDeviceStats(Be,{frontIdStatsAnalysisStatus:"",backIdStatsAnalysisStatus:onboardingAnalytics.getAnalysisStatus(),selfieStatsAnalysisStatus:"",motionStatus:onboardingAnalytics.getMotionStatus()}),addEvent({token:Be,code:"captureAttemptFinished",module:"ID",payload:{logs:onboardingAnalytics.getPipelineLogs()}});const ht=await capture({...tt,token:Be,type:tt.type==="front"?frontType:backType,encrypted:!1,faceCoordinates:void 0,imageType:void 0,onProgress:tt.onProgress,metadata:onboardingAnalytics.getMetadata()}),gt=await Le({type:tt.type,ageAssurance:tt.ageAssurance}),At={...ht,originalImage:tt.image,frontIdImage:tt.type==="front"?tt.image:void 0,backIdImage:gt.croppedBackID,...gt};idFlowManager.saveCaptureResponse(At);const xt=Ye({...At,side:tt.type},{skipGlareFront:ht.skipGlareFront,skipGlareBack:ht.skipGlareBack});if(xt.error)throw new CaptureIdError(xt.errorKey,xt.message,xt.messageDescription);return(ft=tt.onProgress)==null||ft.call(tt,100),idFlowManager.resetAttempts(),At}catch(ht){if(!idFlowManager.canRetry()){const gt=idFlowManager.getState().successData;throw tt.type!=="front"?new CaptureIdError("NO_MORE_TRIES","No more retry attempts available"):gt!=null&&gt.skipBackIdCapture?new CaptureIdError("RETRY_EXHAUSTED_SKIP_BACK","Front ID retries exhausted, skip back ID capture"):new CaptureIdError("RETRY_EXHAUSTED_CONTINUE_TO_BACK","Front ID retries exhausted, continue to back ID capture")}throw ht instanceof CaptureIdError?ht:new CaptureIdError("UNEXPECTED_ERROR","Unexpected capture error")}},reset(){idFlowManager.resetAttempts()}}},useCaptureIdState=()=>{const[Be,Le]=React.useState(idFlowManager.getState()),[Ye,tt]=React.useState(null);React.useEffect(()=>idFlowManager.subscribe(Le),[]);const nt=idFlowManager.getToken();React.useEffect(()=>{if(!nt){tt(null);return}try{const ht=createCaptureIdApi(nt);tt(ht)}catch(ht){console.error("Failed to create capture API:",ht),tt(null)}},[nt]);const ft=idFlowManager.getCaptureConfiguration();return{token:idFlowManager.getToken(),currentStep:Be.currentStep,flowOutcome:Be.flowOutcome,isLoading:Be.isLoading,errorDetails:Be.errorDetails,successData:Be.successData,attempts:Be.attempts,uploadId:Ye==null?void 0:Ye.uploadId.bind(Ye),completeWithError:ht=>idFlowManager.completeWithError(ht),reset:()=>idFlowManager.reset(),canRetry:()=>idFlowManager.canRetry(),getAttempts:()=>Be.attempts,completeFlow:()=>idFlowManager.completeFlow(),goToChooser:()=>idFlowManager.goToChooser(),goToIdStep:()=>idFlowManager.goToIdStep(),goToPassportStep:()=>idFlowManager.goToPassportStep(),goToManualUploadStep:()=>idFlowManager.goToManualUploadStep(),goToDigitalIdUploadStep:()=>idFlowManager.goToDigitalIdUploadStep(),goToPermissions:()=>idFlowManager.goToPermissions(),changeStep:ht=>idFlowManager.changeStep(ht),resetAttempts:()=>idFlowManager.resetAttempts(),kioskOptions:idFlowManager.kioskOptions,captureConfiguration:ft,attemptsLeft:idFlowManager.getAttemptsLeft(),uiConfig:idFlowManager.uiConfig,captureOnly:idFlowManager.captureOnly,onCapture:idFlowManager.onCapture,storeCapturedImage:(ht,gt)=>idFlowManager.storeCapturedImage(ht,gt),completeCaptureOnlyFlow:()=>idFlowManager.completeCaptureOnlyFlow(),isDeepsightEnabled:ft.isDeepsightEnabled}},IdFlowPage=({closeButtonColor:Be,closeButtonOnCancel:Le,...Ye})=>{const{uiConfig:tt}=useCaptureIdState(),nt=Be?{...tt,closeButton:{...tt==null?void 0:tt.closeButton,color:Be}}:tt;return jsxRuntimeExports.jsx(FlowPage,{uiConfig:nt,onClose:()=>idFlowManager.onClose(),onCloseCancel:Le,...Ye})},StyledArrowIcon$1=dt.svg`
5232
5248
  .arrow-rect {
5233
5249
  transition: filter 0.2s ease;
5234
5250
  }