@incodetech/welcome 1.85.0-20251105121333.0 → 1.85.0-20251105124000.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/incode-welcome/src/create.d.ts +4 -1
- package/dist/incode-welcome/src/redirect/PhishingResistanceScreen.d.ts +2 -0
- package/dist/incode-welcome/src/redirect/Redirect.d.ts +4 -1
- package/dist/incode-welcome/src/workflows/Workflow.d.ts +8 -1
- package/dist/incode-welcome/src/workflows/executeWorkflow.d.ts +8 -1
- package/dist/incode-welcome/src/workflows/modules/RedirectToMobile.d.ts +2 -1
- package/dist/onBoarding.mjs +235 -124
- package/dist/onBoarding.umd.js +7 -7
- package/dist/types/src/index.d.ts +10 -0
- package/package.json +1 -1
package/dist/onBoarding.umd.js
CHANGED
|
@@ -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")&>.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"&>.type!=="optional"&>.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&>!==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&>.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&>.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&>!==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-20251105121333.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")&>.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"&>.type!=="optional"&>.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&>!==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&>.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&>.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&>!==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=`
|
|
67
67
|
attribute vec2 position;
|
|
68
68
|
void main() {
|
|
69
69
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
@@ -2777,7 +2777,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof Be.getDerivedSta
|
|
|
2777
2777
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
2778
2778
|
*/lodash_min.exports,function(Be,Le){(function(){function Ye(Ur,a0,mr){switch(mr.length){case 0:return Ur.call(a0);case 1:return Ur.call(a0,mr[0]);case 2:return Ur.call(a0,mr[0],mr[1]);case 3:return Ur.call(a0,mr[0],mr[1],mr[2])}return Ur.apply(a0,mr)}function tt(Ur,a0,mr,S0){for(var Q0=-1,R0=Ur==null?0:Ur.length;++Q0<R0;){var qa=Ur[Q0];a0(S0,qa,mr(qa),Ur)}return S0}function nt(Ur,a0){for(var mr=-1,S0=Ur==null?0:Ur.length;++mr<S0&&a0(Ur[mr],mr,Ur)!==!1;);return Ur}function ft(Ur,a0){for(var mr=Ur==null?0:Ur.length;mr--&&a0(Ur[mr],mr,Ur)!==!1;);return Ur}function ht(Ur,a0){for(var mr=-1,S0=Ur==null?0:Ur.length;++mr<S0;)if(!a0(Ur[mr],mr,Ur))return!1;return!0}function gt(Ur,a0){for(var mr=-1,S0=Ur==null?0:Ur.length,Q0=0,R0=[];++mr<S0;){var qa=Ur[mr];a0(qa,mr,Ur)&&(R0[Q0++]=qa)}return R0}function At(Ur,a0){return!!(Ur!=null&&Ur.length)&&Tt(Ur,a0,0)>-1}function xt(Ur,a0,mr){for(var S0=-1,Q0=Ur==null?0:Ur.length;++S0<Q0;)if(mr(a0,Ur[S0]))return!0;return!1}function yt(Ur,a0){for(var mr=-1,S0=Ur==null?0:Ur.length,Q0=Array(S0);++mr<S0;)Q0[mr]=a0(Ur[mr],mr,Ur);return Q0}function Ct(Ur,a0){for(var mr=-1,S0=a0.length,Q0=Ur.length;++mr<S0;)Ur[Q0+mr]=a0[mr];return Ur}function Et(Ur,a0,mr,S0){var Q0=-1,R0=Ur==null?0:Ur.length;for(S0&&R0&&(mr=Ur[++Q0]);++Q0<R0;)mr=a0(mr,Ur[Q0],Q0,Ur);return mr}function vt(Ur,a0,mr,S0){var Q0=Ur==null?0:Ur.length;for(S0&&Q0&&(mr=Ur[--Q0]);Q0--;)mr=a0(mr,Ur[Q0],Q0,Ur);return mr}function kt(Ur,a0){for(var mr=-1,S0=Ur==null?0:Ur.length;++mr<S0;)if(a0(Ur[mr],mr,Ur))return!0;return!1}function bt(Ur){return Ur.split("")}function wt(Ur){return Ur.match(gn)||[]}function It(Ur,a0,mr){var S0;return mr(Ur,function(Q0,R0,qa){if(a0(Q0,R0,qa))return S0=R0,!1}),S0}function Rt(Ur,a0,mr,S0){for(var Q0=Ur.length,R0=mr+(S0?1:-1);S0?R0--:++R0<Q0;)if(a0(Ur[R0],R0,Ur))return R0;return-1}function Tt(Ur,a0,mr){return a0===a0?Zt(Ur,a0,mr):Rt(Ur,Pt,mr)}function Bt(Ur,a0,mr,S0){for(var Q0=mr-1,R0=Ur.length;++Q0<R0;)if(S0(Ur[Q0],a0))return Q0;return-1}function Pt(Ur){return Ur!==Ur}function Dt(Ur,a0){var mr=Ur==null?0:Ur.length;return mr?qt(Ur,a0)/mr:V0}function Ot(Ur){return function(a0){return a0==null?pr:a0[Ur]}}function Lt(Ur){return function(a0){return Ur==null?pr:Ur[a0]}}function Wt(Ur,a0,mr,S0,Q0){return Q0(Ur,function(R0,qa,j3){mr=S0?(S0=!1,R0):a0(mr,R0,qa,j3)}),mr}function $t(Ur,a0){var mr=Ur.length;for(Ur.sort(a0);mr--;)Ur[mr]=Ur[mr].value;return Ur}function qt(Ur,a0){for(var mr,S0=-1,Q0=Ur.length;++S0<Q0;){var R0=a0(Ur[S0]);R0!==pr&&(mr=mr===pr?R0:mr+R0)}return mr}function Ht(Ur,a0){for(var mr=-1,S0=Array(Ur);++mr<Ur;)S0[mr]=a0(mr);return S0}function Ut(Ur,a0){return yt(a0,function(mr){return[mr,Ur[mr]]})}function Ft(Ur){return Ur&&Ur.slice(0,lr(Ur)+1).replace(E0,"")}function Xt(Ur){return function(a0){return Ur(a0)}}function _t(Ur,a0){return yt(a0,function(mr){return Ur[mr]})}function Mt(Ur,a0){return Ur.has(a0)}function jt(Ur,a0){for(var mr=-1,S0=Ur.length;++mr<S0&&Tt(a0,Ur[mr],0)>-1;);return mr}function zt(Ur,a0){for(var mr=Ur.length;mr--&&Tt(a0,Ur[mr],0)>-1;);return mr}function Gt(Ur,a0){for(var mr=Ur.length,S0=0;mr--;)Ur[mr]===a0&&++S0;return S0}function Yt(Ur){return"\\"+G4[Ur]}function ar(Ur,a0){return Ur==null?pr:Ur[a0]}function tr(Ur){return _4.test(Ur)}function sr(Ur){return M4.test(Ur)}function dr(Ur){for(var a0,mr=[];!(a0=Ur.next()).done;)mr.push(a0.value);return mr}function rr(Ur){var a0=-1,mr=Array(Ur.size);return Ur.forEach(function(S0,Q0){mr[++a0]=[Q0,S0]}),mr}function gr(Ur,a0){return function(mr){return Ur(a0(mr))}}function yr(Ur,a0){for(var mr=-1,S0=Ur.length,Q0=0,R0=[];++mr<S0;){var qa=Ur[mr];qa!==a0&&qa!==Nr||(Ur[mr]=Nr,R0[Q0++]=mr)}return R0}function or(Ur){var a0=-1,mr=Array(Ur.size);return Ur.forEach(function(S0){mr[++a0]=S0}),mr}function ir(Ur){var a0=-1,mr=Array(Ur.size);return Ur.forEach(function(S0){mr[++a0]=[S0,S0]}),mr}function Zt(Ur,a0,mr){for(var S0=mr-1,Q0=Ur.length;++S0<Q0;)if(Ur[S0]===a0)return S0;return-1}function Qt(Ur,a0,mr){for(var S0=mr+1;S0--;)if(Ur[S0]===a0)return S0;return S0}function er(Ur){return tr(Ur)?hr(Ur):K4(Ur)}function nr(Ur){return tr(Ur)?ur(Ur):bt(Ur)}function lr(Ur){for(var a0=Ur.length;a0--&&K0.test(Ur.charAt(a0)););return a0}function hr(Ur){for(var a0=L3.lastIndex=0;L3.test(Ur);)++a0;return a0}function ur(Ur){return Ur.match(L3)||[]}function xr(Ur){return Ur.match(L4)||[]}var pr,Mr="4.17.21",_r=200,Zr="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",qr="Expected a function",$r="Invalid `variable` option passed into `_.template`",Pr="__lodash_hash_undefined__",Ir=500,Nr="__lodash_placeholder__",Or=1,Vr=2,Yr=4,e0=1,Rr=2,wr=1,Tr=2,n0=4,Wr=8,Jr=16,t0=32,h0=64,zr=128,m0=256,x0=512,N0=30,J0="...",X0=800,D0=16,rn=1,mn=2,$0=3,H0=1/0,u0=9007199254740991,w0=17976931348623157e292,V0=NaN,U0=4294967295,ln=U0-1,Cn=U0>>>1,Dr=[["ary",zr],["bind",wr],["bindKey",Tr],["curry",Wr],["curryRight",Jr],["flip",x0],["partial",t0],["partialRight",h0],["rearg",m0]],r0="[object Arguments]",c0="[object Array]",g0="[object AsyncFunction]",O0="[object Boolean]",W0="[object Date]",en="[object DOMException]",G0="[object Error]",Bn="[object Function]",In="[object GeneratorFunction]",fn="[object Map]",Nn="[object Number]",bi="[object Null]",Gn="[object Object]",zn="[object Promise]",Yi="[object Proxy]",pi="[object RegExp]",sa="[object Set]",bs="[object String]",L0="[object Symbol]",Dl="[object Undefined]",Ma="[object WeakMap]",Ii="[object WeakSet]",Zi="[object ArrayBuffer]",Ji="[object DataView]",Yo="[object Float32Array]",Is="[object Float64Array]",Zo="[object Int8Array]",Si="[object Int16Array]",va="[object Int32Array]",es="[object Uint8Array]",yn="[object Uint8ClampedArray]",Jo="[object Uint16Array]",uo="[object Uint32Array]",on=/\b__p \+= '';/g,g1=/\b(__p \+=) '' \+/g,Ln=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ar=/&(?:amp|lt|gt|quot|#39);/g,br=/[&<>"']/g,Br=RegExp(Ar.source),Lr=RegExp(br.source),Gr=/<%-([\s\S]+?)%>/g,Xr=/<%([\s\S]+?)%>/g,Hr=/<%=([\s\S]+?)%>/g,s0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,f0=/^\w*$/,o0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d0=/[\\^$.*+?()[\]{}|]/g,T0=RegExp(d0.source),E0=/^\s+/,K0=/\s/,b0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,v0=/\{\n\/\* \[wrapped with (.+)\] \*/,An=/,? & /,gn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Qn=/[()=,{}\[\]\/\s]/,Zn=/\\(\\)?/g,Au=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,e2=/\w*$/,Ss=/^[-+]0x[0-9a-f]+$/i,wi=/^0b[01]+$/i,t2=/^\[object .+?Constructor\]$/,ws=/^0o[0-7]+$/i,po=/^(?:0|[1-9]\d*)$/,r2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ka=/($^)/,fi=/['\n\r\u2028\u2029\\]/g,oa="\\ud800-\\udfff",n2="\\u0300-\\u036f",$a="\\ufe20-\\ufe2f",A0="\\u20d0-\\u20ff",_0=n2+$a+A0,_n="\\u2700-\\u27bf",ts="a-z\\xdf-\\xf6\\xf8-\\xff",Ri="\\xac\\xb1\\xd7\\xf7",On="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rs="\\u2000-\\u206f",ns=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",a2="A-Z\\xc0-\\xd6\\xd8-\\xde",Rs="\\ufe0e\\ufe0f",xu=Ri+On+rs+ns,A1="['’]",P3="["+oa+"]",fd="["+xu+"]",Nl="["+_0+"]",hd="\\d+",md="["+_n+"]",x1="["+ts+"]",y1="[^"+oa+xu+hd+_n+ts+a2+"]",O3="\\ud83c[\\udffb-\\udfff]",S4="(?:"+Nl+"|"+O3+")",j9="[^"+oa+"]",D3="(?:\\ud83c[\\udde6-\\uddff]){2}",N3="[\\ud800-\\udbff][\\udc00-\\udfff]",Ll="["+a2+"]",F9="\\u200d",Q9="(?:"+x1+"|"+y1+")",w4="(?:"+Ll+"|"+y1+")",V9="(?:"+A1+"(?:d|ll|m|re|s|t|ve))?",U9="(?:"+A1+"(?:D|LL|M|RE|S|T|VE))?",H9=S4+"?",G9="["+Rs+"]?",R4="(?:"+F9+"(?:"+[j9,D3,N3].join("|")+")"+G9+H9+")*",T4="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",B4="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",z9=G9+H9+R4,P4="(?:"+[md,D3,N3].join("|")+")"+z9,O4="(?:"+[j9+Nl+"?",Nl,D3,N3,P3].join("|")+")",D4=RegExp(A1,"g"),N4=RegExp(Nl,"g"),L3=RegExp(O3+"(?="+O3+")|"+O4+z9,"g"),L4=RegExp([Ll+"?"+x1+"+"+V9+"(?="+[fd,Ll,"$"].join("|")+")",w4+"+"+U9+"(?="+[fd,Ll+Q9,"$"].join("|")+")",Ll+"?"+Q9+"+"+V9,Ll+"+"+U9,B4,T4,hd,P4].join("|"),"g"),_4=RegExp("["+F9+oa+_0+Rs+"]"),M4=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,j4=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],F4=-1,Mn={};Mn[Yo]=Mn[Is]=Mn[Zo]=Mn[Si]=Mn[va]=Mn[es]=Mn[yn]=Mn[Jo]=Mn[uo]=!0,Mn[r0]=Mn[c0]=Mn[Zi]=Mn[O0]=Mn[Ji]=Mn[W0]=Mn[G0]=Mn[Bn]=Mn[fn]=Mn[Nn]=Mn[Gn]=Mn[pi]=Mn[sa]=Mn[bs]=Mn[Ma]=!1;var Dn={};Dn[r0]=Dn[c0]=Dn[Zi]=Dn[Ji]=Dn[O0]=Dn[W0]=Dn[Yo]=Dn[Is]=Dn[Zo]=Dn[Si]=Dn[va]=Dn[fn]=Dn[Nn]=Dn[Gn]=Dn[pi]=Dn[sa]=Dn[bs]=Dn[L0]=Dn[es]=Dn[yn]=Dn[Jo]=Dn[uo]=!0,Dn[G0]=Dn[Bn]=Dn[Ma]=!1;var Q4={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},U4={"&":"&","<":"<",">":">",'"':""","'":"'"},H4={"&":"&","<":"<",">":">",""":'"',"'":"'"},G4={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},z4=parseFloat,W4=parseInt,W9=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,X4=typeof self=="object"&&self&&self.Object===Object&&self,ka=W9||X4||Function("return this")(),_3=Le&&!Le.nodeType&&Le,E1=_3&&!0&&Be&&!Be.nodeType&&Be,X9=E1&&E1.exports===_3,M3=X9&&W9.process,Ti=function(){try{var Ur=E1&&E1.require&&E1.require("util").types;return Ur||M3&&M3.binding&&M3.binding("util")}catch{}}(),K9=Ti&&Ti.isArrayBuffer,$9=Ti&&Ti.isDate,q9=Ti&&Ti.isMap,Y9=Ti&&Ti.isRegExp,Z9=Ti&&Ti.isSet,J9=Ti&&Ti.isTypedArray,K4=Ot("length"),$4=Lt(Q4),q4=Lt(U4),Y4=Lt(H4),Z4=function Ur(a0){function mr(Nt){if($n(Nt)&&!Y0(Nt)&&!(Nt instanceof R0)){if(Nt instanceof Q0)return Nt;if(Sn.call(Nt,"__wrapped__"))return Kf(Nt)}return new Q0(Nt)}function S0(){}function Q0(Nt,Vt){this.__wrapped__=Nt,this.__actions__=[],this.__chain__=!!Vt,this.__index__=0,this.__values__=pr}function R0(Nt){this.__wrapped__=Nt,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=U0,this.__views__=[]}function qa(){var Nt=new R0(this.__wrapped__);return Nt.__actions__=Ya(this.__actions__),Nt.__dir__=this.__dir__,Nt.__filtered__=this.__filtered__,Nt.__iteratees__=Ya(this.__iteratees__),Nt.__takeCount__=this.__takeCount__,Nt.__views__=Ya(this.__views__),Nt}function j3(){if(this.__filtered__){var Nt=new R0(this);Nt.__dir__=-1,Nt.__filtered__=!0}else Nt=this.clone(),Nt.__dir__*=-1;return Nt}function J4(){var Nt=this.__wrapped__.value(),Vt=this.__dir__,Jt=Y0(Nt),cr=Vt<0,Er=Jt?Nt.length:0,Sr=cm(0,Er,this.__views__),jr=Sr.start,Fr=Sr.end,Kr=Fr-jr,l0=cr?Fr:jr-1,i0=this.__iteratees__,p0=i0.length,k0=0,B0=Ta(Kr,this.__takeCount__);if(!Jt||!cr&&Er==Kr&&B0==Kr)return Cf(Nt,this.__actions__);var M0=[];e:for(;Kr--&&k0<B0;){l0+=Vt;for(var tn=-1,F0=Nt[l0];++tn<p0;){var dn=i0[tn],pn=dn.iteratee,Pa=dn.type,ti=pn(F0);if(Pa==mn)F0=ti;else if(!ti){if(Pa==rn)continue e;break e}}M0[k0++]=F0}return M0}function C1(Nt){var Vt=-1,Jt=Nt==null?0:Nt.length;for(this.clear();++Vt<Jt;){var cr=Nt[Vt];this.set(cr[0],cr[1])}}function e6(){this.__data__=Bu?Bu(null):{},this.size=0}function t6(Nt){var Vt=this.has(Nt)&&delete this.__data__[Nt];return this.size-=Vt?1:0,Vt}function r6(Nt){var Vt=this.__data__;if(Bu){var Jt=Vt[Nt];return Jt===Pr?pr:Jt}return Sn.call(Vt,Nt)?Vt[Nt]:pr}function n6(Nt){var Vt=this.__data__;return Bu?Vt[Nt]!==pr:Sn.call(Vt,Nt)}function a6(Nt,Vt){var Jt=this.__data__;return this.size+=this.has(Nt)?0:1,Jt[Nt]=Bu&&Vt===pr?Pr:Vt,this}function fo(Nt){var Vt=-1,Jt=Nt==null?0:Nt.length;for(this.clear();++Vt<Jt;){var cr=Nt[Vt];this.set(cr[0],cr[1])}}function i6(){this.__data__=[],this.size=0}function s6(Nt){var Vt=this.__data__,Jt=gd(Vt,Nt);return!(Jt<0)&&(Jt==Vt.length-1?Vt.pop():Gd.call(Vt,Jt,1),--this.size,!0)}function o6(Nt){var Vt=this.__data__,Jt=gd(Vt,Nt);return Jt<0?pr:Vt[Jt][1]}function l6(Nt){return gd(this.__data__,Nt)>-1}function c6(Nt,Vt){var Jt=this.__data__,cr=gd(Jt,Nt);return cr<0?(++this.size,Jt.push([Nt,Vt])):Jt[cr][1]=Vt,this}function ho(Nt){var Vt=-1,Jt=Nt==null?0:Nt.length;for(this.clear();++Vt<Jt;){var cr=Nt[Vt];this.set(cr[0],cr[1])}}function u6(){this.size=0,this.__data__={hash:new C1,map:new(Ru||fo),string:new C1}}function d6(Nt){var Vt=Rd(this,Nt).delete(Nt);return this.size-=Vt?1:0,Vt}function p6(Nt){return Rd(this,Nt).get(Nt)}function f6(Nt){return Rd(this,Nt).has(Nt)}function h6(Nt,Vt){var Jt=Rd(this,Nt),cr=Jt.size;return Jt.set(Nt,Vt),this.size+=Jt.size==cr?0:1,this}function k1(Nt){var Vt=-1,Jt=Nt==null?0:Nt.length;for(this.__data__=new ho;++Vt<Jt;)this.add(Nt[Vt])}function m6(Nt){return this.__data__.set(Nt,Pr),this}function g6(Nt){return this.__data__.has(Nt)}function as(Nt){this.size=(this.__data__=new fo(Nt)).size}function A6(){this.__data__=new fo,this.size=0}function x6(Nt){var Vt=this.__data__,Jt=Vt.delete(Nt);return this.size=Vt.size,Jt}function y6(Nt){return this.__data__.get(Nt)}function E6(Nt){return this.__data__.has(Nt)}function C6(Nt,Vt){var Jt=this.__data__;if(Jt instanceof fo){var cr=Jt.__data__;if(!Ru||cr.length<_r-1)return cr.push([Nt,Vt]),this.size=++Jt.size,this;Jt=this.__data__=new ho(cr)}return Jt.set(Nt,Vt),this.size=Jt.size,this}function ef(Nt,Vt){var Jt=Y0(Nt),cr=!Jt&&T1(Nt),Er=!Jt&&!cr&&u2(Nt),Sr=!Jt&&!cr&&!Er&&Wl(Nt),jr=Jt||cr||Er||Sr,Fr=jr?Ht(Nt.length,x7):[],Kr=Fr.length;for(var l0 in Nt)!Vt&&!Sn.call(Nt,l0)||jr&&(l0=="length"||Er&&(l0=="offset"||l0=="parent")||Sr&&(l0=="buffer"||l0=="byteLength"||l0=="byteOffset")||xo(l0,Kr))||Fr.push(l0);return Fr}function tf(Nt){var Vt=Nt.length;return Vt?Nt[$3(0,Vt-1)]:pr}function v6(Nt,Vt){return Td(Ya(Nt),b1(Vt,0,Nt.length))}function k6(Nt){return Td(Ya(Nt))}function F3(Nt,Vt,Jt){(Jt===pr||is(Nt[Vt],Jt))&&(Jt!==pr||Vt in Nt)||mo(Nt,Vt,Jt)}function yu(Nt,Vt,Jt){var cr=Nt[Vt];Sn.call(Nt,Vt)&&is(cr,Jt)&&(Jt!==pr||Vt in Nt)||mo(Nt,Vt,Jt)}function gd(Nt,Vt){for(var Jt=Nt.length;Jt--;)if(is(Nt[Jt][0],Vt))return Jt;return-1}function b6(Nt,Vt,Jt,cr){return c2(Nt,function(Er,Sr,jr){Vt(cr,Er,Jt(Er),jr)}),cr}function rf(Nt,Vt){return Nt&&Bs(Vt,ga(Vt),Nt)}function I6(Nt,Vt){return Nt&&Bs(Vt,Ja(Vt),Nt)}function mo(Nt,Vt,Jt){Vt=="__proto__"&&zd?zd(Nt,Vt,{configurable:!0,enumerable:!0,value:Jt,writable:!0}):Nt[Vt]=Jt}function Q3(Nt,Vt){for(var Jt=-1,cr=Vt.length,Er=la(cr),Sr=Nt==null;++Jt<cr;)Er[Jt]=Sr?pr:Ap(Nt,Vt[Jt]);return Er}function b1(Nt,Vt,Jt){return Nt===Nt&&(Jt!==pr&&(Nt=Nt<=Jt?Nt:Jt),Vt!==pr&&(Nt=Nt>=Vt?Nt:Vt)),Nt}function Bi(Nt,Vt,Jt,cr,Er,Sr){var jr,Fr=Vt&Or,Kr=Vt&Vr,l0=Vt&Yr;if(Jt&&(jr=Er?Jt(Nt,cr,Er,Sr):Jt(Nt)),jr!==pr)return jr;if(!Wn(Nt))return Nt;var i0=Y0(Nt);if(i0){if(jr=dm(Nt),!Fr)return Ya(Nt,jr)}else{var p0=Ba(Nt),k0=p0==Bn||p0==In;if(u2(Nt))return kf(Nt,Fr);if(p0==Gn||p0==r0||k0&&!Er){if(jr=Kr||k0?{}:Vf(Nt),!Fr)return Kr?em(Nt,I6(jr,Nt)):J6(Nt,rf(jr,Nt))}else{if(!Dn[p0])return Er?Nt:{};jr=pm(Nt,p0,Fr)}}Sr||(Sr=new as);var B0=Sr.get(Nt);if(B0)return B0;Sr.set(Nt,jr),Fh(Nt)?Nt.forEach(function(F0){jr.add(Bi(F0,Vt,Jt,F0,Nt,Sr))}):jh(Nt)&&Nt.forEach(function(F0,dn){jr.set(dn,Bi(F0,Vt,Jt,dn,Nt,Sr))});var M0=l0?Kr?lp:sp:Kr?Ja:ga,tn=i0?pr:M0(Nt);return nt(tn||Nt,function(F0,dn){tn&&(dn=F0,F0=Nt[dn]),yu(jr,dn,Bi(F0,Vt,Jt,dn,Nt,Sr))}),jr}function S6(Nt){var Vt=ga(Nt);return function(Jt){return nf(Jt,Nt,Vt)}}function nf(Nt,Vt,Jt){var cr=Jt.length;if(Nt==null)return!cr;for(Nt=jn(Nt);cr--;){var Er=Jt[cr],Sr=Vt[Er],jr=Nt[Er];if(jr===pr&&!(Er in Nt)||!Sr(jr))return!1}return!0}function af(Nt,Vt,Jt){if(typeof Nt!="function")throw new Ni(qr);return Ou(function(){Nt.apply(pr,Jt)},Vt)}function Eu(Nt,Vt,Jt,cr){var Er=-1,Sr=At,jr=!0,Fr=Nt.length,Kr=[],l0=Vt.length;if(!Fr)return Kr;Jt&&(Vt=yt(Vt,Xt(Jt))),cr?(Sr=xt,jr=!1):Vt.length>=_r&&(Sr=Mt,jr=!1,Vt=new k1(Vt));e:for(;++Er<Fr;){var i0=Nt[Er],p0=Jt==null?i0:Jt(i0);if(i0=cr||i0!==0?i0:0,jr&&p0===p0){for(var k0=l0;k0--;)if(Vt[k0]===p0)continue e;Kr.push(i0)}else Sr(Vt,p0,cr)||Kr.push(i0)}return Kr}function w6(Nt,Vt){var Jt=!0;return c2(Nt,function(cr,Er,Sr){return Jt=!!Vt(cr,Er,Sr)}),Jt}function Ad(Nt,Vt,Jt){for(var cr=-1,Er=Nt.length;++cr<Er;){var Sr=Nt[cr],jr=Vt(Sr);if(jr!=null&&(Fr===pr?jr===jr&&!mi(jr):Jt(jr,Fr)))var Fr=jr,Kr=Sr}return Kr}function R6(Nt,Vt,Jt,cr){var Er=Nt.length;for(Jt=nn(Jt),Jt<0&&(Jt=-Jt>Er?0:Er+Jt),cr=cr===pr||cr>Er?Er:nn(cr),cr<0&&(cr+=Er),cr=Jt>cr?0:ph(cr);Jt<cr;)Nt[Jt++]=Vt;return Nt}function sf(Nt,Vt){var Jt=[];return c2(Nt,function(cr,Er,Sr){Vt(cr,Er,Sr)&&Jt.push(cr)}),Jt}function ba(Nt,Vt,Jt,cr,Er){var Sr=-1,jr=Nt.length;for(Jt||(Jt=hm),Er||(Er=[]);++Sr<jr;){var Fr=Nt[Sr];Vt>0&&Jt(Fr)?Vt>1?ba(Fr,Vt-1,Jt,cr,Er):Ct(Er,Fr):cr||(Er[Er.length]=Fr)}return Er}function Ts(Nt,Vt){return Nt&&Bp(Nt,Vt,ga)}function U3(Nt,Vt){return Nt&&Bh(Nt,Vt,ga)}function xd(Nt,Vt){return gt(Vt,function(Jt){return yo(Nt[Jt])})}function I1(Nt,Vt){Vt=s2(Vt,Nt);for(var Jt=0,cr=Vt.length;Nt!=null&&Jt<cr;)Nt=Nt[Ps(Vt[Jt++])];return Jt&&Jt==cr?Nt:pr}function of(Nt,Vt,Jt){var cr=Vt(Nt);return Y0(Nt)?cr:Ct(cr,Jt(Nt))}function ja(Nt){return Nt==null?Nt===pr?Dl:bi:R1&&R1 in jn(Nt)?lm(Nt):Em(Nt)}function H3(Nt,Vt){return Nt>Vt}function T6(Nt,Vt){return Nt!=null&&Sn.call(Nt,Vt)}function B6(Nt,Vt){return Nt!=null&&Vt in jn(Nt)}function P6(Nt,Vt,Jt){return Nt>=Ta(Vt,Jt)&&Nt<ua(Vt,Jt)}function G3(Nt,Vt,Jt){for(var cr=Jt?xt:At,Er=Nt[0].length,Sr=Nt.length,jr=Sr,Fr=la(Sr),Kr=1/0,l0=[];jr--;){var i0=Nt[jr];jr&&Vt&&(i0=yt(i0,Xt(Vt))),Kr=Ta(i0.length,Kr),Fr[jr]=!Jt&&(Vt||Er>=120&&i0.length>=120)?new k1(jr&&i0):pr}i0=Nt[0];var p0=-1,k0=Fr[0];e:for(;++p0<Er&&l0.length<Kr;){var B0=i0[p0],M0=Vt?Vt(B0):B0;if(B0=Jt||B0!==0?B0:0,!(k0?Mt(k0,M0):cr(l0,M0,Jt))){for(jr=Sr;--jr;){var tn=Fr[jr];if(!(tn?Mt(tn,M0):cr(Nt[jr],M0,Jt)))continue e}k0&&k0.push(M0),l0.push(B0)}}return l0}function O6(Nt,Vt,Jt,cr){return Ts(Nt,function(Er,Sr,jr){Vt(cr,Jt(Er),Sr,jr)}),cr}function Cu(Nt,Vt,Jt){Vt=s2(Vt,Nt),Nt=zf(Nt,Vt);var cr=Nt==null?Nt:Nt[Ps(Oi(Vt))];return cr==null?pr:Ye(cr,Nt,Jt)}function lf(Nt){return $n(Nt)&&ja(Nt)==r0}function D6(Nt){return $n(Nt)&&ja(Nt)==Zi}function N6(Nt){return $n(Nt)&&ja(Nt)==W0}function vu(Nt,Vt,Jt,cr,Er){return Nt===Vt||(Nt==null||Vt==null||!$n(Nt)&&!$n(Vt)?Nt!==Nt&&Vt!==Vt:L6(Nt,Vt,Jt,cr,vu,Er))}function L6(Nt,Vt,Jt,cr,Er,Sr){var jr=Y0(Nt),Fr=Y0(Vt),Kr=jr?c0:Ba(Nt),l0=Fr?c0:Ba(Vt);Kr=Kr==r0?Gn:Kr,l0=l0==r0?Gn:l0;var i0=Kr==Gn,p0=l0==Gn,k0=Kr==l0;if(k0&&u2(Nt)){if(!u2(Vt))return!1;jr=!0,i0=!1}if(k0&&!i0)return Sr||(Sr=new as),jr||Wl(Nt)?Ff(Nt,Vt,Jt,cr,Er,Sr):sm(Nt,Vt,Kr,Jt,cr,Er,Sr);if(!(Jt&e0)){var B0=i0&&Sn.call(Nt,"__wrapped__"),M0=p0&&Sn.call(Vt,"__wrapped__");if(B0||M0){var tn=B0?Nt.value():Nt,F0=M0?Vt.value():Vt;return Sr||(Sr=new as),Er(tn,F0,Jt,cr,Sr)}}return!!k0&&(Sr||(Sr=new as),om(Nt,Vt,Jt,cr,Er,Sr))}function _6(Nt){return $n(Nt)&&Ba(Nt)==fn}function z3(Nt,Vt,Jt,cr){var Er=Jt.length,Sr=Er,jr=!cr;if(Nt==null)return!Sr;for(Nt=jn(Nt);Er--;){var Fr=Jt[Er];if(jr&&Fr[2]?Fr[1]!==Nt[Fr[0]]:!(Fr[0]in Nt))return!1}for(;++Er<Sr;){Fr=Jt[Er];var Kr=Fr[0],l0=Nt[Kr],i0=Fr[1];if(jr&&Fr[2]){if(l0===pr&&!(Kr in Nt))return!1}else{var p0=new as;if(cr)var k0=cr(l0,i0,Kr,Nt,Vt,p0);if(!(k0===pr?vu(i0,l0,e0|Rr,cr,p0):k0))return!1}}return!0}function cf(Nt){return!(!Wn(Nt)||gm(Nt))&&(yo(Nt)?k7:t2).test(w1(Nt))}function M6(Nt){return $n(Nt)&&ja(Nt)==pi}function j6(Nt){return $n(Nt)&&Ba(Nt)==sa}function F6(Nt){return $n(Nt)&&Nd(Nt.length)&&!!Mn[ja(Nt)]}function uf(Nt){return typeof Nt=="function"?Nt:Nt==null?ei:typeof Nt=="object"?Y0(Nt)?ff(Nt[0],Nt[1]):pf(Nt):xh(Nt)}function W3(Nt){if(!Iu(Nt))return T7(Nt);var Vt=[];for(var Jt in jn(Nt))Sn.call(Nt,Jt)&&Jt!="constructor"&&Vt.push(Jt);return Vt}function Q6(Nt){if(!Wn(Nt))return ym(Nt);var Vt=Iu(Nt),Jt=[];for(var cr in Nt)(cr!="constructor"||!Vt&&Sn.call(Nt,cr))&&Jt.push(cr);return Jt}function X3(Nt,Vt){return Nt<Vt}function df(Nt,Vt){var Jt=-1,cr=Za(Nt)?la(Nt.length):[];return c2(Nt,function(Er,Sr,jr){cr[++Jt]=Vt(Er,Sr,jr)}),cr}function pf(Nt){var Vt=cp(Nt);return Vt.length==1&&Vt[0][2]?Hf(Vt[0][0],Vt[0][1]):function(Jt){return Jt===Nt||z3(Jt,Nt,Vt)}}function ff(Nt,Vt){return up(Nt)&&Uf(Vt)?Hf(Ps(Nt),Vt):function(Jt){var cr=Ap(Jt,Nt);return cr===pr&&cr===Vt?xp(Jt,Nt):vu(Vt,cr,e0|Rr)}}function yd(Nt,Vt,Jt,cr,Er){Nt!==Vt&&Bp(Vt,function(Sr,jr){if(Er||(Er=new as),Wn(Sr))V6(Nt,Vt,jr,Jt,yd,cr,Er);else{var Fr=cr?cr(pp(Nt,jr),Sr,jr+"",Nt,Vt,Er):pr;Fr===pr&&(Fr=Sr),F3(Nt,jr,Fr)}},Ja)}function V6(Nt,Vt,Jt,cr,Er,Sr,jr){var Fr=pp(Nt,Jt),Kr=pp(Vt,Jt),l0=jr.get(Kr);if(l0)return F3(Nt,Jt,l0),pr;var i0=Sr?Sr(Fr,Kr,Jt+"",Nt,Vt,jr):pr,p0=i0===pr;if(p0){var k0=Y0(Kr),B0=!k0&&u2(Kr),M0=!k0&&!B0&&Wl(Kr);i0=Kr,k0||B0||M0?Y0(Fr)?i0=Fr:Jn(Fr)?i0=Ya(Fr):B0?(p0=!1,i0=kf(Kr,!0)):M0?(p0=!1,i0=bf(Kr,!0)):i0=[]:Su(Kr)||T1(Kr)?(i0=Fr,T1(Fr)?i0=fh(Fr):Wn(Fr)&&!yo(Fr)||(i0=Vf(Kr))):p0=!1}p0&&(jr.set(Kr,i0),Er(i0,Kr,cr,Sr,jr),jr.delete(Kr)),F3(Nt,Jt,i0)}function hf(Nt,Vt){var Jt=Nt.length;if(Jt)return Vt+=Vt<0?Jt:0,xo(Vt,Jt)?Nt[Vt]:pr}function mf(Nt,Vt,Jt){Vt=Vt.length?yt(Vt,function(Er){return Y0(Er)?function(Sr){return I1(Sr,Er.length===1?Er[0]:Er)}:Er}):[ei];var cr=-1;return Vt=yt(Vt,Xt(z0())),$t(df(Nt,function(Er,Sr,jr){return{criteria:yt(Vt,function(Fr){return Fr(Er)}),index:++cr,value:Er}}),function(Er,Sr){return Z6(Er,Sr,Jt)})}function U6(Nt,Vt){return gf(Nt,Vt,function(Jt,cr){return xp(Nt,cr)})}function gf(Nt,Vt,Jt){for(var cr=-1,Er=Vt.length,Sr={};++cr<Er;){var jr=Vt[cr],Fr=I1(Nt,jr);Jt(Fr,jr)&&ku(Sr,s2(jr,Nt),Fr)}return Sr}function H6(Nt){return function(Vt){return I1(Vt,Nt)}}function K3(Nt,Vt,Jt,cr){var Er=cr?Bt:Tt,Sr=-1,jr=Vt.length,Fr=Nt;for(Nt===Vt&&(Vt=Ya(Vt)),Jt&&(Fr=yt(Nt,Xt(Jt)));++Sr<jr;)for(var Kr=0,l0=Vt[Sr],i0=Jt?Jt(l0):l0;(Kr=Er(Fr,i0,Kr,cr))>-1;)Fr!==Nt&&Gd.call(Fr,Kr,1),Gd.call(Nt,Kr,1);return Nt}function Af(Nt,Vt){for(var Jt=Nt?Vt.length:0,cr=Jt-1;Jt--;){var Er=Vt[Jt];if(Jt==cr||Er!==Sr){var Sr=Er;xo(Er)?Gd.call(Nt,Er,1):Z3(Nt,Er)}}return Nt}function $3(Nt,Vt){return Nt+Xd(wh()*(Vt-Nt+1))}function G6(Nt,Vt,Jt,cr){for(var Er=-1,Sr=ua(Wd((Vt-Nt)/(Jt||1)),0),jr=la(Sr);Sr--;)jr[cr?Sr:++Er]=Nt,Nt+=Jt;return jr}function q3(Nt,Vt){var Jt="";if(!Nt||Vt<1||Vt>u0)return Jt;do Vt%2&&(Jt+=Nt),Vt=Xd(Vt/2),Vt&&(Nt+=Nt);while(Vt);return Jt}function cn(Nt,Vt){return Dp(Gf(Nt,Vt,ei),Nt+"")}function z6(Nt){return tf(Ql(Nt))}function W6(Nt,Vt){var Jt=Ql(Nt);return Td(Jt,b1(Vt,0,Jt.length))}function ku(Nt,Vt,Jt,cr){if(!Wn(Nt))return Nt;Vt=s2(Vt,Nt);for(var Er=-1,Sr=Vt.length,jr=Sr-1,Fr=Nt;Fr!=null&&++Er<Sr;){var Kr=Ps(Vt[Er]),l0=Jt;if(Kr==="__proto__"||Kr==="constructor"||Kr==="prototype")return Nt;if(Er!=jr){var i0=Fr[Kr];l0=cr?cr(i0,Kr,Fr):pr,l0===pr&&(l0=Wn(i0)?i0:xo(Vt[Er+1])?[]:{})}yu(Fr,Kr,l0),Fr=Fr[Kr]}return Nt}function X6(Nt){return Td(Ql(Nt))}function Pi(Nt,Vt,Jt){var cr=-1,Er=Nt.length;Vt<0&&(Vt=-Vt>Er?0:Er+Vt),Jt=Jt>Er?Er:Jt,Jt<0&&(Jt+=Er),Er=Vt>Jt?0:Jt-Vt>>>0,Vt>>>=0;for(var Sr=la(Er);++cr<Er;)Sr[cr]=Nt[cr+Vt];return Sr}function K6(Nt,Vt){var Jt;return c2(Nt,function(cr,Er,Sr){return Jt=Vt(cr,Er,Sr),!Jt}),!!Jt}function Ed(Nt,Vt,Jt){var cr=0,Er=Nt==null?cr:Nt.length;if(typeof Vt=="number"&&Vt===Vt&&Er<=Cn){for(;cr<Er;){var Sr=cr+Er>>>1,jr=Nt[Sr];jr!==null&&!mi(jr)&&(Jt?jr<=Vt:jr<Vt)?cr=Sr+1:Er=Sr}return Er}return Y3(Nt,Vt,ei,Jt)}function Y3(Nt,Vt,Jt,cr){var Er=0,Sr=Nt==null?0:Nt.length;if(Sr===0)return 0;Vt=Jt(Vt);for(var jr=Vt!==Vt,Fr=Vt===null,Kr=mi(Vt),l0=Vt===pr;Er<Sr;){var i0=Xd((Er+Sr)/2),p0=Jt(Nt[i0]),k0=p0!==pr,B0=p0===null,M0=p0===p0,tn=mi(p0);if(jr)var F0=cr||M0;else F0=l0?M0&&(cr||k0):Fr?M0&&k0&&(cr||!B0):Kr?M0&&k0&&!B0&&(cr||!tn):!B0&&!tn&&(cr?p0<=Vt:p0<Vt);F0?Er=i0+1:Sr=i0}return Ta(Sr,ln)}function xf(Nt,Vt){for(var Jt=-1,cr=Nt.length,Er=0,Sr=[];++Jt<cr;){var jr=Nt[Jt],Fr=Vt?Vt(jr):jr;if(!Jt||!is(Fr,Kr)){var Kr=Fr;Sr[Er++]=jr===0?0:jr}}return Sr}function yf(Nt){return typeof Nt=="number"?Nt:mi(Nt)?V0:+Nt}function hi(Nt){if(typeof Nt=="string")return Nt;if(Y0(Nt))return yt(Nt,hi)+"";if(mi(Nt))return Rh?Rh.call(Nt):"";var Vt=Nt+"";return Vt=="0"&&1/Nt==-H0?"-0":Vt}function i2(Nt,Vt,Jt){var cr=-1,Er=At,Sr=Nt.length,jr=!0,Fr=[],Kr=Fr;if(Jt)jr=!1,Er=xt;else if(Sr>=_r){var l0=Vt?null:Q7(Nt);if(l0)return or(l0);jr=!1,Er=Mt,Kr=new k1}else Kr=Vt?[]:Fr;e:for(;++cr<Sr;){var i0=Nt[cr],p0=Vt?Vt(i0):i0;if(i0=Jt||i0!==0?i0:0,jr&&p0===p0){for(var k0=Kr.length;k0--;)if(Kr[k0]===p0)continue e;Vt&&Kr.push(p0),Fr.push(i0)}else Er(Kr,p0,Jt)||(Kr!==Fr&&Kr.push(p0),Fr.push(i0))}return Fr}function Z3(Nt,Vt){return Vt=s2(Vt,Nt),Nt=zf(Nt,Vt),Nt==null||delete Nt[Ps(Oi(Vt))]}function Ef(Nt,Vt,Jt,cr){return ku(Nt,Vt,Jt(I1(Nt,Vt)),cr)}function Cd(Nt,Vt,Jt,cr){for(var Er=Nt.length,Sr=cr?Er:-1;(cr?Sr--:++Sr<Er)&&Vt(Nt[Sr],Sr,Nt););return Jt?Pi(Nt,cr?0:Sr,cr?Sr+1:Er):Pi(Nt,cr?Sr+1:0,cr?Er:Sr)}function Cf(Nt,Vt){var Jt=Nt;return Jt instanceof R0&&(Jt=Jt.value()),Et(Vt,function(cr,Er){return Er.func.apply(Er.thisArg,Ct([cr],Er.args))},Jt)}function J3(Nt,Vt,Jt){var cr=Nt.length;if(cr<2)return cr?i2(Nt[0]):[];for(var Er=-1,Sr=la(cr);++Er<cr;)for(var jr=Nt[Er],Fr=-1;++Fr<cr;)Fr!=Er&&(Sr[Er]=Eu(Sr[Er]||jr,Nt[Fr],Vt,Jt));return i2(ba(Sr,1),Vt,Jt)}function vf(Nt,Vt,Jt){for(var cr=-1,Er=Nt.length,Sr=Vt.length,jr={};++cr<Er;)Jt(jr,Nt[cr],cr<Sr?Vt[cr]:pr);return jr}function ep(Nt){return Jn(Nt)?Nt:[]}function tp(Nt){return typeof Nt=="function"?Nt:ei}function s2(Nt,Vt){return Y0(Nt)?Nt:up(Nt,Vt)?[Nt]:Lh(vn(Nt))}function o2(Nt,Vt,Jt){var cr=Nt.length;return Jt=Jt===pr?cr:Jt,!Vt&&Jt>=cr?Nt:Pi(Nt,Vt,Jt)}function kf(Nt,Vt){if(Vt)return Nt.slice();var Jt=Nt.length,cr=Ch?Ch(Jt):new Nt.constructor(Jt);return Nt.copy(cr),cr}function rp(Nt){var Vt=new Nt.constructor(Nt.byteLength);return new Ud(Vt).set(new Ud(Nt)),Vt}function $6(Nt,Vt){return new Nt.constructor(Vt?rp(Nt.buffer):Nt.buffer,Nt.byteOffset,Nt.byteLength)}function q6(Nt){var Vt=new Nt.constructor(Nt.source,e2.exec(Nt));return Vt.lastIndex=Nt.lastIndex,Vt}function Y6(Nt){return Pu?jn(Pu.call(Nt)):{}}function bf(Nt,Vt){return new Nt.constructor(Vt?rp(Nt.buffer):Nt.buffer,Nt.byteOffset,Nt.length)}function If(Nt,Vt){if(Nt!==Vt){var Jt=Nt!==pr,cr=Nt===null,Er=Nt===Nt,Sr=mi(Nt),jr=Vt!==pr,Fr=Vt===null,Kr=Vt===Vt,l0=mi(Vt);if(!Fr&&!l0&&!Sr&&Nt>Vt||Sr&&jr&&Kr&&!Fr&&!l0||cr&&jr&&Kr||!Jt&&Kr||!Er)return 1;if(!cr&&!Sr&&!l0&&Nt<Vt||l0&&Jt&&Er&&!cr&&!Sr||Fr&&Jt&&Er||!jr&&Er||!Kr)return-1}return 0}function Z6(Nt,Vt,Jt){for(var cr=-1,Er=Nt.criteria,Sr=Vt.criteria,jr=Er.length,Fr=Jt.length;++cr<jr;){var Kr=If(Er[cr],Sr[cr]);if(Kr)return cr>=Fr?Kr:Kr*(Jt[cr]=="desc"?-1:1)}return Nt.index-Vt.index}function Sf(Nt,Vt,Jt,cr){for(var Er=-1,Sr=Nt.length,jr=Jt.length,Fr=-1,Kr=Vt.length,l0=ua(Sr-jr,0),i0=la(Kr+l0),p0=!cr;++Fr<Kr;)i0[Fr]=Vt[Fr];for(;++Er<jr;)(p0||Er<Sr)&&(i0[Jt[Er]]=Nt[Er]);for(;l0--;)i0[Fr++]=Nt[Er++];return i0}function wf(Nt,Vt,Jt,cr){for(var Er=-1,Sr=Nt.length,jr=-1,Fr=Jt.length,Kr=-1,l0=Vt.length,i0=ua(Sr-Fr,0),p0=la(i0+l0),k0=!cr;++Er<i0;)p0[Er]=Nt[Er];for(var B0=Er;++Kr<l0;)p0[B0+Kr]=Vt[Kr];for(;++jr<Fr;)(k0||Er<Sr)&&(p0[B0+Jt[jr]]=Nt[Er++]);return p0}function Ya(Nt,Vt){var Jt=-1,cr=Nt.length;for(Vt||(Vt=la(cr));++Jt<cr;)Vt[Jt]=Nt[Jt];return Vt}function Bs(Nt,Vt,Jt,cr){var Er=!Jt;Jt||(Jt={});for(var Sr=-1,jr=Vt.length;++Sr<jr;){var Fr=Vt[Sr],Kr=cr?cr(Jt[Fr],Nt[Fr],Fr,Jt,Nt):pr;Kr===pr&&(Kr=Nt[Fr]),Er?mo(Jt,Fr,Kr):yu(Jt,Fr,Kr)}return Jt}function J6(Nt,Vt){return Bs(Nt,Op(Nt),Vt)}function em(Nt,Vt){return Bs(Nt,Dh(Nt),Vt)}function vd(Nt,Vt){return function(Jt,cr){var Er=Y0(Jt)?tt:b6,Sr=Vt?Vt():{};return Er(Jt,Nt,z0(cr,2),Sr)}}function Ml(Nt){return cn(function(Vt,Jt){var cr=-1,Er=Jt.length,Sr=Er>1?Jt[Er-1]:pr,jr=Er>2?Jt[2]:pr;for(Sr=Nt.length>3&&typeof Sr=="function"?(Er--,Sr):pr,jr&&Fa(Jt[0],Jt[1],jr)&&(Sr=Er<3?pr:Sr,Er=1),Vt=jn(Vt);++cr<Er;){var Fr=Jt[cr];Fr&&Nt(Vt,Fr,cr,Sr)}return Vt})}function Rf(Nt,Vt){return function(Jt,cr){if(Jt==null)return Jt;if(!Za(Jt))return Nt(Jt,cr);for(var Er=Jt.length,Sr=Vt?Er:-1,jr=jn(Jt);(Vt?Sr--:++Sr<Er)&&cr(jr[Sr],Sr,jr)!==!1;);return Jt}}function Tf(Nt){return function(Vt,Jt,cr){for(var Er=-1,Sr=jn(Vt),jr=cr(Vt),Fr=jr.length;Fr--;){var Kr=jr[Nt?Fr:++Er];if(Jt(Sr[Kr],Kr,Sr)===!1)break}return Vt}}function tm(Nt,Vt,Jt){function cr(){return(this&&this!==ka&&this instanceof cr?Sr:Nt).apply(Er?Jt:this,arguments)}var Er=Vt&wr,Sr=bu(Nt);return cr}function Bf(Nt){return function(Vt){Vt=vn(Vt);var Jt=tr(Vt)?nr(Vt):pr,cr=Jt?Jt[0]:Vt.charAt(0),Er=Jt?o2(Jt,1).join(""):Vt.slice(1);return cr[Nt]()+Er}}function jl(Nt){return function(Vt){return Et(Ah(gh(Vt).replace(D4,"")),Nt,"")}}function bu(Nt){return function(){var Vt=arguments;switch(Vt.length){case 0:return new Nt;case 1:return new Nt(Vt[0]);case 2:return new Nt(Vt[0],Vt[1]);case 3:return new Nt(Vt[0],Vt[1],Vt[2]);case 4:return new Nt(Vt[0],Vt[1],Vt[2],Vt[3]);case 5:return new Nt(Vt[0],Vt[1],Vt[2],Vt[3],Vt[4]);case 6:return new Nt(Vt[0],Vt[1],Vt[2],Vt[3],Vt[4],Vt[5]);case 7:return new Nt(Vt[0],Vt[1],Vt[2],Vt[3],Vt[4],Vt[5],Vt[6])}var Jt=zl(Nt.prototype),cr=Nt.apply(Jt,Vt);return Wn(cr)?cr:Jt}}function rm(Nt,Vt,Jt){function cr(){for(var Sr=arguments.length,jr=la(Sr),Fr=Sr,Kr=Fl(cr);Fr--;)jr[Fr]=arguments[Fr];var l0=Sr<3&&jr[0]!==Kr&&jr[Sr-1]!==Kr?[]:yr(jr,Kr);return Sr-=l0.length,Sr<Jt?Lf(Nt,Vt,kd,cr.placeholder,pr,jr,l0,pr,pr,Jt-Sr):Ye(this&&this!==ka&&this instanceof cr?Er:Nt,this,jr)}var Er=bu(Nt);return cr}function Pf(Nt){return function(Vt,Jt,cr){var Er=jn(Vt);if(!Za(Vt)){var Sr=z0(Jt,3);Vt=ga(Vt),Jt=function(Fr){return Sr(Er[Fr],Fr,Er)}}var jr=Nt(Vt,Jt,cr);return jr>-1?Er[Sr?Vt[jr]:jr]:pr}}function Of(Nt){return Ao(function(Vt){var Jt=Vt.length,cr=Jt,Er=Q0.prototype.thru;for(Nt&&Vt.reverse();cr--;){var Sr=Vt[cr];if(typeof Sr!="function")throw new Ni(qr);if(Er&&!jr&&wd(Sr)=="wrapper")var jr=new Q0([],!0)}for(cr=jr?cr:Jt;++cr<Jt;){Sr=Vt[cr];var Fr=wd(Sr),Kr=Fr=="wrapper"?Pp(Sr):pr;jr=Kr&&dp(Kr[0])&&Kr[1]==(zr|Wr|t0|m0)&&!Kr[4].length&&Kr[9]==1?jr[wd(Kr[0])].apply(jr,Kr[3]):Sr.length==1&&dp(Sr)?jr[Fr]():jr.thru(Sr)}return function(){var l0=arguments,i0=l0[0];if(jr&&l0.length==1&&Y0(i0))return jr.plant(i0).value();for(var p0=0,k0=Jt?Vt[p0].apply(this,l0):i0;++p0<Jt;)k0=Vt[p0].call(this,k0);return k0}})}function kd(Nt,Vt,Jt,cr,Er,Sr,jr,Fr,Kr,l0){function i0(){for(var dn=arguments.length,pn=la(dn),Pa=dn;Pa--;)pn[Pa]=arguments[Pa];if(M0)var ti=Fl(i0),d2=Gt(pn,ti);if(cr&&(pn=Sf(pn,cr,Er,M0)),Sr&&(pn=wf(pn,Sr,jr,M0)),dn-=d2,M0&&dn<l0)return Lf(Nt,Vt,kd,i0.placeholder,Jt,pn,yr(pn,ti),Fr,Kr,l0-dn);var qn=k0?Jt:this,Li=B0?qn[Nt]:Nt;return dn=pn.length,Fr?pn=Cm(pn,Fr):tn&&dn>1&&pn.reverse(),p0&&Kr<dn&&(pn.length=Kr),this&&this!==ka&&this instanceof i0&&(Li=F0||bu(Li)),Li.apply(qn,pn)}var p0=Vt&zr,k0=Vt&wr,B0=Vt&Tr,M0=Vt&(Wr|Jr),tn=Vt&x0,F0=B0?pr:bu(Nt);return i0}function Df(Nt,Vt){return function(Jt,cr){return O6(Jt,Nt,Vt(cr),{})}}function bd(Nt,Vt){return function(Jt,cr){var Er;if(Jt===pr&&cr===pr)return Vt;if(Jt!==pr&&(Er=Jt),cr!==pr){if(Er===pr)return cr;typeof Jt=="string"||typeof cr=="string"?(Jt=hi(Jt),cr=hi(cr)):(Jt=yf(Jt),cr=yf(cr)),Er=Nt(Jt,cr)}return Er}}function np(Nt){return Ao(function(Vt){return Vt=yt(Vt,Xt(z0())),cn(function(Jt){var cr=this;return Nt(Vt,function(Er){return Ye(Er,cr,Jt)})})})}function Id(Nt,Vt){Vt=Vt===pr?" ":hi(Vt);var Jt=Vt.length;if(Jt<2)return Jt?q3(Vt,Nt):Vt;var cr=q3(Vt,Wd(Nt/er(Vt)));return tr(Vt)?o2(nr(cr),0,Nt).join(""):cr.slice(0,Nt)}function am(Nt,Vt,Jt,cr){function Er(){for(var Fr=-1,Kr=arguments.length,l0=-1,i0=cr.length,p0=la(i0+Kr),k0=this&&this!==ka&&this instanceof Er?jr:Nt;++l0<i0;)p0[l0]=cr[l0];for(;Kr--;)p0[l0++]=arguments[++Fr];return Ye(k0,Sr?Jt:this,p0)}var Sr=Vt&wr,jr=bu(Nt);return Er}function Nf(Nt){return function(Vt,Jt,cr){return cr&&typeof cr!="number"&&Fa(Vt,Jt,cr)&&(Jt=cr=pr),Vt=Eo(Vt),Jt===pr?(Jt=Vt,Vt=0):Jt=Eo(Jt),cr=cr===pr?Vt<Jt?1:-1:Eo(cr),G6(Vt,Jt,cr,Nt)}}function Sd(Nt){return function(Vt,Jt){return typeof Vt=="string"&&typeof Jt=="string"||(Vt=Di(Vt),Jt=Di(Jt)),Nt(Vt,Jt)}}function Lf(Nt,Vt,Jt,cr,Er,Sr,jr,Fr,Kr,l0){var i0=Vt&Wr,p0=i0?jr:pr,k0=i0?pr:jr,B0=i0?Sr:pr,M0=i0?pr:Sr;Vt|=i0?t0:h0,Vt&=~(i0?h0:t0),Vt&n0||(Vt&=-4);var tn=[Nt,Vt,Er,B0,p0,M0,k0,Fr,Kr,l0],F0=Jt.apply(pr,tn);return dp(Nt)&&Nh(F0,tn),F0.placeholder=cr,Wf(F0,Nt,Vt)}function ap(Nt){var Vt=Vl[Nt];return function(Jt,cr){if(Jt=Di(Jt),cr=cr==null?0:Ta(nn(cr),292),cr&&Sh(Jt)){var Er=(vn(Jt)+"e").split("e");return Er=(vn(Vt(Er[0]+"e"+(+Er[1]+cr)))+"e").split("e"),+(Er[0]+"e"+(+Er[1]-cr))}return Vt(Jt)}}function _f(Nt){return function(Vt){var Jt=Ba(Vt);return Jt==fn?rr(Vt):Jt==sa?ir(Vt):Ut(Vt,Nt(Vt))}}function go(Nt,Vt,Jt,cr,Er,Sr,jr,Fr){var Kr=Vt&Tr;if(!Kr&&typeof Nt!="function")throw new Ni(qr);var l0=cr?cr.length:0;if(l0||(Vt&=-97,cr=Er=pr),jr=jr===pr?jr:ua(nn(jr),0),Fr=Fr===pr?Fr:nn(Fr),l0-=Er?Er.length:0,Vt&h0){var i0=cr,p0=Er;cr=Er=pr}var k0=Kr?pr:Pp(Nt),B0=[Nt,Vt,Jt,cr,Er,i0,p0,Sr,jr,Fr];if(k0&&xm(B0,k0),Nt=B0[0],Vt=B0[1],Jt=B0[2],cr=B0[3],Er=B0[4],Fr=B0[9]=B0[9]===pr?Kr?0:Nt.length:ua(B0[9]-l0,0),!Fr&&Vt&(Wr|Jr)&&(Vt&=-25),Vt&&Vt!=wr)M0=Vt==Wr||Vt==Jr?rm(Nt,Vt,Fr):Vt!=t0&&Vt!=(wr|t0)||Er.length?kd.apply(pr,B0):am(Nt,Vt,Jt,cr);else var M0=tm(Nt,Vt,Jt);return Wf((k0?Ph:Nh)(M0,B0),Nt,Vt)}function Mf(Nt,Vt,Jt,cr){return Nt===pr||is(Nt,Ul[Jt])&&!Sn.call(cr,Jt)?Vt:Nt}function jf(Nt,Vt,Jt,cr,Er,Sr){return Wn(Nt)&&Wn(Vt)&&(Sr.set(Vt,Nt),yd(Nt,Vt,pr,jf,Sr),Sr.delete(Vt)),Nt}function im(Nt){return Su(Nt)?pr:Nt}function Ff(Nt,Vt,Jt,cr,Er,Sr){var jr=Jt&e0,Fr=Nt.length,Kr=Vt.length;if(Fr!=Kr&&!(jr&&Kr>Fr))return!1;var l0=Sr.get(Nt),i0=Sr.get(Vt);if(l0&&i0)return l0==Vt&&i0==Nt;var p0=-1,k0=!0,B0=Jt&Rr?new k1:pr;for(Sr.set(Nt,Vt),Sr.set(Vt,Nt);++p0<Fr;){var M0=Nt[p0],tn=Vt[p0];if(cr)var F0=jr?cr(tn,M0,p0,Vt,Nt,Sr):cr(M0,tn,p0,Nt,Vt,Sr);if(F0!==pr){if(F0)continue;k0=!1;break}if(B0){if(!kt(Vt,function(dn,pn){if(!Mt(B0,pn)&&(M0===dn||Er(M0,dn,Jt,cr,Sr)))return B0.push(pn)})){k0=!1;break}}else if(M0!==tn&&!Er(M0,tn,Jt,cr,Sr)){k0=!1;break}}return Sr.delete(Nt),Sr.delete(Vt),k0}function sm(Nt,Vt,Jt,cr,Er,Sr,jr){switch(Jt){case Ji:if(Nt.byteLength!=Vt.byteLength||Nt.byteOffset!=Vt.byteOffset)return!1;Nt=Nt.buffer,Vt=Vt.buffer;case Zi:return!(Nt.byteLength!=Vt.byteLength||!Sr(new Ud(Nt),new Ud(Vt)));case O0:case W0:case Nn:return is(+Nt,+Vt);case G0:return Nt.name==Vt.name&&Nt.message==Vt.message;case pi:case bs:return Nt==Vt+"";case fn:var Fr=rr;case sa:var Kr=cr&e0;if(Fr||(Fr=or),Nt.size!=Vt.size&&!Kr)return!1;var l0=jr.get(Nt);if(l0)return l0==Vt;cr|=Rr,jr.set(Nt,Vt);var i0=Ff(Fr(Nt),Fr(Vt),cr,Er,Sr,jr);return jr.delete(Nt),i0;case L0:if(Pu)return Pu.call(Nt)==Pu.call(Vt)}return!1}function om(Nt,Vt,Jt,cr,Er,Sr){var jr=Jt&e0,Fr=sp(Nt),Kr=Fr.length;if(Kr!=sp(Vt).length&&!jr)return!1;for(var l0=Kr;l0--;){var i0=Fr[l0];if(!(jr?i0 in Vt:Sn.call(Vt,i0)))return!1}var p0=Sr.get(Nt),k0=Sr.get(Vt);if(p0&&k0)return p0==Vt&&k0==Nt;var B0=!0;Sr.set(Nt,Vt),Sr.set(Vt,Nt);for(var M0=jr;++l0<Kr;){i0=Fr[l0];var tn=Nt[i0],F0=Vt[i0];if(cr)var dn=jr?cr(F0,tn,i0,Vt,Nt,Sr):cr(tn,F0,i0,Nt,Vt,Sr);if(!(dn===pr?tn===F0||Er(tn,F0,Jt,cr,Sr):dn)){B0=!1;break}M0||(M0=i0=="constructor")}if(B0&&!M0){var pn=Nt.constructor,Pa=Vt.constructor;pn!=Pa&&"constructor"in Nt&&"constructor"in Vt&&!(typeof pn=="function"&&pn instanceof pn&&typeof Pa=="function"&&Pa instanceof Pa)&&(B0=!1)}return Sr.delete(Nt),Sr.delete(Vt),B0}function Ao(Nt){return Dp(Gf(Nt,pr,Yf),Nt+"")}function sp(Nt){return of(Nt,ga,Op)}function lp(Nt){return of(Nt,Ja,Dh)}function wd(Nt){for(var Vt=Nt.name+"",Jt=Gl[Vt],cr=Sn.call(Gl,Vt)?Jt.length:0;cr--;){var Er=Jt[cr],Sr=Er.func;if(Sr==null||Sr==Nt)return Er.name}return Vt}function Fl(Nt){return(Sn.call(mr,"placeholder")?mr:Nt).placeholder}function z0(){var Nt=mr.iteratee||Ep;return Nt=Nt===Ep?uf:Nt,arguments.length?Nt(arguments[0],arguments[1]):Nt}function Rd(Nt,Vt){var Jt=Nt.__data__;return mm(Vt)?Jt[typeof Vt=="string"?"string":"hash"]:Jt.map}function cp(Nt){for(var Vt=ga(Nt),Jt=Vt.length;Jt--;){var cr=Vt[Jt],Er=Nt[cr];Vt[Jt]=[cr,Er,Uf(Er)]}return Vt}function S1(Nt,Vt){var Jt=ar(Nt,Vt);return cf(Jt)?Jt:pr}function lm(Nt){var Vt=Sn.call(Nt,R1),Jt=Nt[R1];try{Nt[R1]=pr;var cr=!0}catch{}var Er=Qd.call(Nt);return cr&&(Vt?Nt[R1]=Jt:delete Nt[R1]),Er}function cm(Nt,Vt,Jt){for(var cr=-1,Er=Jt.length;++cr<Er;){var Sr=Jt[cr],jr=Sr.size;switch(Sr.type){case"drop":Nt+=jr;break;case"dropRight":Vt-=jr;break;case"take":Vt=Ta(Vt,Nt+jr);break;case"takeRight":Nt=ua(Nt,Vt-jr)}}return{start:Nt,end:Vt}}function um(Nt){var Vt=Nt.match(v0);return Vt?Vt[1].split(An):[]}function Qf(Nt,Vt,Jt){Vt=s2(Vt,Nt);for(var cr=-1,Er=Vt.length,Sr=!1;++cr<Er;){var jr=Ps(Vt[cr]);if(!(Sr=Nt!=null&&Jt(Nt,jr)))break;Nt=Nt[jr]}return Sr||++cr!=Er?Sr:(Er=Nt==null?0:Nt.length,!!Er&&Nd(Er)&&xo(jr,Er)&&(Y0(Nt)||T1(Nt)))}function dm(Nt){var Vt=Nt.length,Jt=new Nt.constructor(Vt);return Vt&&typeof Nt[0]=="string"&&Sn.call(Nt,"index")&&(Jt.index=Nt.index,Jt.input=Nt.input),Jt}function Vf(Nt){return typeof Nt.constructor!="function"||Iu(Nt)?{}:zl(Hd(Nt))}function pm(Nt,Vt,Jt){var cr=Nt.constructor;switch(Vt){case Zi:return rp(Nt);case O0:case W0:return new cr(+Nt);case Ji:return $6(Nt,Jt);case Yo:case Is:case Zo:case Si:case va:case es:case yn:case Jo:case uo:return bf(Nt,Jt);case fn:return new cr;case Nn:case bs:return new cr(Nt);case pi:return q6(Nt);case sa:return new cr;case L0:return Y6(Nt)}}function fm(Nt,Vt){var Jt=Vt.length;if(!Jt)return Nt;var cr=Jt-1;return Vt[cr]=(Jt>1?"& ":"")+Vt[cr],Vt=Vt.join(Jt>2?", ":" "),Nt.replace(b0,`{
|
|
2779
2779
|
/* [wrapped with `+Vt+`] */
|
|
2780
|
-
`)}function hm(Nt){return Y0(Nt)||T1(Nt)||!!(Ih&&Nt&&Nt[Ih])}function xo(Nt,Vt){var Jt=typeof Nt;return Vt=Vt??u0,!!Vt&&(Jt=="number"||Jt!="symbol"&&po.test(Nt))&&Nt>-1&&Nt%1==0&&Nt<Vt}function Fa(Nt,Vt,Jt){if(!Wn(Jt))return!1;var cr=typeof Vt;return!!(cr=="number"?Za(Jt)&&xo(Vt,Jt.length):cr=="string"&&Vt in Jt)&&is(Jt[Vt],Nt)}function up(Nt,Vt){if(Y0(Nt))return!1;var Jt=typeof Nt;return!(Jt!="number"&&Jt!="symbol"&&Jt!="boolean"&&Nt!=null&&!mi(Nt))||f0.test(Nt)||!s0.test(Nt)||Vt!=null&&Nt in jn(Vt)}function mm(Nt){var Vt=typeof Nt;return Vt=="string"||Vt=="number"||Vt=="symbol"||Vt=="boolean"?Nt!=="__proto__":Nt===null}function dp(Nt){var Vt=wd(Nt),Jt=mr[Vt];if(typeof Jt!="function"||!(Vt in R0.prototype))return!1;if(Nt===Jt)return!0;var cr=Pp(Jt);return!!cr&&Nt===cr[0]}function gm(Nt){return!!Eh&&Eh in Nt}function Iu(Nt){var Vt=Nt&&Nt.constructor;return Nt===(typeof Vt=="function"&&Vt.prototype||Ul)}function Uf(Nt){return Nt===Nt&&!Wn(Nt)}function Hf(Nt,Vt){return function(Jt){return Jt!=null&&Jt[Nt]===Vt&&(Vt!==pr||Nt in jn(Jt))}}function Am(Nt){var Vt=Od(Nt,function(cr){return Jt.size===Ir&&Jt.clear(),cr}),Jt=Vt.cache;return Vt}function xm(Nt,Vt){var Jt=Nt[1],cr=Vt[1],Er=Jt|cr,Sr=Er<(wr|Tr|zr),jr=cr==zr&&Jt==Wr||cr==zr&&Jt==m0&&Nt[7].length<=Vt[8]||cr==(zr|m0)&&Vt[7].length<=Vt[8]&&Jt==Wr;if(!Sr&&!jr)return Nt;cr&wr&&(Nt[2]=Vt[2],Er|=Jt&wr?0:n0);var Fr=Vt[3];if(Fr){var Kr=Nt[3];Nt[3]=Kr?Sf(Kr,Fr,Vt[4]):Fr,Nt[4]=Kr?yr(Nt[3],Nr):Vt[4]}return Fr=Vt[5],Fr&&(Kr=Nt[5],Nt[5]=Kr?wf(Kr,Fr,Vt[6]):Fr,Nt[6]=Kr?yr(Nt[5],Nr):Vt[6]),Fr=Vt[7],Fr&&(Nt[7]=Fr),cr&zr&&(Nt[8]=Nt[8]==null?Vt[8]:Ta(Nt[8],Vt[8])),Nt[9]==null&&(Nt[9]=Vt[9]),Nt[0]=Vt[0],Nt[1]=Er,Nt}function ym(Nt){var Vt=[];if(Nt!=null)for(var Jt in jn(Nt))Vt.push(Jt);return Vt}function Em(Nt){return Qd.call(Nt)}function Gf(Nt,Vt,Jt){return Vt=ua(Vt===pr?Nt.length-1:Vt,0),function(){for(var cr=arguments,Er=-1,Sr=ua(cr.length-Vt,0),jr=la(Sr);++Er<Sr;)jr[Er]=cr[Vt+Er];Er=-1;for(var Fr=la(Vt+1);++Er<Vt;)Fr[Er]=cr[Er];return Fr[Vt]=Jt(jr),Ye(Nt,this,Fr)}}function zf(Nt,Vt){return Vt.length<2?Nt:I1(Nt,Pi(Vt,0,-1))}function Cm(Nt,Vt){for(var Jt=Nt.length,cr=Ta(Vt.length,Jt),Er=Ya(Nt);cr--;){var Sr=Vt[cr];Nt[cr]=xo(Sr,Jt)?Er[Sr]:pr}return Nt}function pp(Nt,Vt){if((Vt!=="constructor"||typeof Nt[Vt]!="function")&&Vt!="__proto__")return Nt[Vt]}function Wf(Nt,Vt,Jt){var cr=Vt+"";return Dp(Nt,fm(cr,vm(um(cr),Jt)))}function Xf(Nt){var Vt=0,Jt=0;return function(){var cr=B7(),Er=D0-(cr-Jt);if(Jt=cr,Er>0){if(++Vt>=X0)return arguments[0]}else Vt=0;return Nt.apply(pr,arguments)}}function Td(Nt,Vt){var Jt=-1,cr=Nt.length,Er=cr-1;for(Vt=Vt===pr?cr:Vt;++Jt<Vt;){var Sr=$3(Jt,Er),jr=Nt[Sr];Nt[Sr]=Nt[Jt],Nt[Jt]=jr}return Nt.length=Vt,Nt}function Ps(Nt){if(typeof Nt=="string"||mi(Nt))return Nt;var Vt=Nt+"";return Vt=="0"&&1/Nt==-H0?"-0":Vt}function w1(Nt){if(Nt!=null){try{return Fd.call(Nt)}catch{}try{return Nt+""}catch{}}return""}function vm(Nt,Vt){return nt(Dr,function(Jt){var cr="_."+Jt[0];Vt&Jt[1]&&!At(Nt,cr)&&Nt.push(cr)}),Nt.sort()}function Kf(Nt){if(Nt instanceof R0)return Nt.clone();var Vt=new Q0(Nt.__wrapped__,Nt.__chain__);return Vt.__actions__=Ya(Nt.__actions__),Vt.__index__=Nt.__index__,Vt.__values__=Nt.__values__,Vt}function km(Nt,Vt,Jt){Vt=(Jt?Fa(Nt,Vt,Jt):Vt===pr)?1:ua(nn(Vt),0);var cr=Nt==null?0:Nt.length;if(!cr||Vt<1)return[];for(var Er=0,Sr=0,jr=la(Wd(cr/Vt));Er<cr;)jr[Sr++]=Pi(Nt,Er,Er+=Vt);return jr}function bm(Nt){for(var Vt=-1,Jt=Nt==null?0:Nt.length,cr=0,Er=[];++Vt<Jt;){var Sr=Nt[Vt];Sr&&(Er[cr++]=Sr)}return Er}function Im(){var Nt=arguments.length;if(!Nt)return[];for(var Vt=la(Nt-1),Jt=arguments[0],cr=Nt;cr--;)Vt[cr-1]=arguments[cr];return Ct(Y0(Jt)?Ya(Jt):[Jt],ba(Vt,1))}function Sm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;return cr?(Vt=Jt||Vt===pr?1:nn(Vt),Pi(Nt,Vt<0?0:Vt,cr)):[]}function wm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;return cr?(Vt=Jt||Vt===pr?1:nn(Vt),Vt=cr-Vt,Pi(Nt,0,Vt<0?0:Vt)):[]}function Rm(Nt,Vt){return Nt&&Nt.length?Cd(Nt,z0(Vt,3),!0,!0):[]}function Tm(Nt,Vt){return Nt&&Nt.length?Cd(Nt,z0(Vt,3),!0):[]}function Bm(Nt,Vt,Jt,cr){var Er=Nt==null?0:Nt.length;return Er?(Jt&&typeof Jt!="number"&&Fa(Nt,Vt,Jt)&&(Jt=0,cr=Er),R6(Nt,Vt,Jt,cr)):[]}function $f(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;if(!cr)return-1;var Er=Jt==null?0:nn(Jt);return Er<0&&(Er=ua(cr+Er,0)),Rt(Nt,z0(Vt,3),Er)}function qf(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;if(!cr)return-1;var Er=cr-1;return Jt!==pr&&(Er=nn(Jt),Er=Jt<0?ua(cr+Er,0):Ta(Er,cr-1)),Rt(Nt,z0(Vt,3),Er,!0)}function Yf(Nt){return Nt!=null&&Nt.length?ba(Nt,1):[]}function Pm(Nt){return Nt!=null&&Nt.length?ba(Nt,H0):[]}function Om(Nt,Vt){return Nt!=null&&Nt.length?(Vt=Vt===pr?1:nn(Vt),ba(Nt,Vt)):[]}function Dm(Nt){for(var Vt=-1,Jt=Nt==null?0:Nt.length,cr={};++Vt<Jt;){var Er=Nt[Vt];cr[Er[0]]=Er[1]}return cr}function Zf(Nt){return Nt&&Nt.length?Nt[0]:pr}function Nm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;if(!cr)return-1;var Er=Jt==null?0:nn(Jt);return Er<0&&(Er=ua(cr+Er,0)),Tt(Nt,Vt,Er)}function Lm(Nt){return Nt!=null&&Nt.length?Pi(Nt,0,-1):[]}function _m(Nt,Vt){return Nt==null?"":R7.call(Nt,Vt)}function Oi(Nt){var Vt=Nt==null?0:Nt.length;return Vt?Nt[Vt-1]:pr}function Mm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;if(!cr)return-1;var Er=cr;return Jt!==pr&&(Er=nn(Jt),Er=Er<0?ua(cr+Er,0):Ta(Er,cr-1)),Vt===Vt?Qt(Nt,Vt,Er):Rt(Nt,Pt,Er,!0)}function jm(Nt,Vt){return Nt&&Nt.length?hf(Nt,nn(Vt)):pr}function Jf(Nt,Vt){return Nt&&Nt.length&&Vt&&Vt.length?K3(Nt,Vt):Nt}function Fm(Nt,Vt,Jt){return Nt&&Nt.length&&Vt&&Vt.length?K3(Nt,Vt,z0(Jt,2)):Nt}function Qm(Nt,Vt,Jt){return Nt&&Nt.length&&Vt&&Vt.length?K3(Nt,Vt,pr,Jt):Nt}function Vm(Nt,Vt){var Jt=[];if(!Nt||!Nt.length)return Jt;var cr=-1,Er=[],Sr=Nt.length;for(Vt=z0(Vt,3);++cr<Sr;){var jr=Nt[cr];Vt(jr,cr,Nt)&&(Jt.push(jr),Er.push(cr))}return Af(Nt,Er),Jt}function hp(Nt){return Nt==null?Nt:O7.call(Nt)}function Um(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;return cr?(Jt&&typeof Jt!="number"&&Fa(Nt,Vt,Jt)?(Vt=0,Jt=cr):(Vt=Vt==null?0:nn(Vt),Jt=Jt===pr?cr:nn(Jt)),Pi(Nt,Vt,Jt)):[]}function Hm(Nt,Vt){return Ed(Nt,Vt)}function Gm(Nt,Vt,Jt){return Y3(Nt,Vt,z0(Jt,2))}function zm(Nt,Vt){var Jt=Nt==null?0:Nt.length;if(Jt){var cr=Ed(Nt,Vt);if(cr<Jt&&is(Nt[cr],Vt))return cr}return-1}function Wm(Nt,Vt){return Ed(Nt,Vt,!0)}function Xm(Nt,Vt,Jt){return Y3(Nt,Vt,z0(Jt,2),!0)}function Km(Nt,Vt){if(Nt!=null&&Nt.length){var Jt=Ed(Nt,Vt,!0)-1;if(is(Nt[Jt],Vt))return Jt}return-1}function $m(Nt){return Nt&&Nt.length?xf(Nt):[]}function qm(Nt,Vt){return Nt&&Nt.length?xf(Nt,z0(Vt,2)):[]}function Ym(Nt){var Vt=Nt==null?0:Nt.length;return Vt?Pi(Nt,1,Vt):[]}function Zm(Nt,Vt,Jt){return Nt&&Nt.length?(Vt=Jt||Vt===pr?1:nn(Vt),Pi(Nt,0,Vt<0?0:Vt)):[]}function Jm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;return cr?(Vt=Jt||Vt===pr?1:nn(Vt),Vt=cr-Vt,Pi(Nt,Vt<0?0:Vt,cr)):[]}function eg(Nt,Vt){return Nt&&Nt.length?Cd(Nt,z0(Vt,3),!1,!0):[]}function tg(Nt,Vt){return Nt&&Nt.length?Cd(Nt,z0(Vt,3)):[]}function rg(Nt){return Nt&&Nt.length?i2(Nt):[]}function ng(Nt,Vt){return Nt&&Nt.length?i2(Nt,z0(Vt,2)):[]}function ag(Nt,Vt){return Vt=typeof Vt=="function"?Vt:pr,Nt&&Nt.length?i2(Nt,pr,Vt):[]}function mp(Nt){if(!Nt||!Nt.length)return[];var Vt=0;return Nt=gt(Nt,function(Jt){if(Jn(Jt))return Vt=ua(Jt.length,Vt),!0}),Ht(Vt,function(Jt){return yt(Nt,Ot(Jt))})}function eh(Nt,Vt){if(!Nt||!Nt.length)return[];var Jt=mp(Nt);return Vt==null?Jt:yt(Jt,function(cr){return Ye(Vt,pr,cr)})}function ig(Nt,Vt){return vf(Nt||[],Vt||[],yu)}function sg(Nt,Vt){return vf(Nt||[],Vt||[],ku)}function th(Nt){var Vt=mr(Nt);return Vt.__chain__=!0,Vt}function og(Nt,Vt){return Vt(Nt),Nt}function Bd(Nt,Vt){return Vt(Nt)}function lg(){return th(this)}function cg(){return new Q0(this.value(),this.__chain__)}function ug(){this.__values__===pr&&(this.__values__=dh(this.value()));var Nt=this.__index__>=this.__values__.length;return{done:Nt,value:Nt?pr:this.__values__[this.__index__++]}}function dg(){return this}function pg(Nt){for(var Vt,Jt=this;Jt instanceof S0;){var cr=Kf(Jt);cr.__index__=0,cr.__values__=pr,Vt?Er.__wrapped__=cr:Vt=cr;var Er=cr;Jt=Jt.__wrapped__}return Er.__wrapped__=Nt,Vt}function fg(){var Nt=this.__wrapped__;if(Nt instanceof R0){var Vt=Nt;return this.__actions__.length&&(Vt=new R0(this)),Vt=Vt.reverse(),Vt.__actions__.push({func:Bd,args:[hp],thisArg:pr}),new Q0(Vt,this.__chain__)}return this.thru(hp)}function hg(){return Cf(this.__wrapped__,this.__actions__)}function mg(Nt,Vt,Jt){var cr=Y0(Nt)?ht:w6;return Jt&&Fa(Nt,Vt,Jt)&&(Vt=pr),cr(Nt,z0(Vt,3))}function gg(Nt,Vt){return(Y0(Nt)?gt:sf)(Nt,z0(Vt,3))}function Ag(Nt,Vt){return ba(Pd(Nt,Vt),1)}function xg(Nt,Vt){return ba(Pd(Nt,Vt),H0)}function yg(Nt,Vt,Jt){return Jt=Jt===pr?1:nn(Jt),ba(Pd(Nt,Vt),Jt)}function rh(Nt,Vt){return(Y0(Nt)?nt:c2)(Nt,z0(Vt,3))}function nh(Nt,Vt){return(Y0(Nt)?ft:Th)(Nt,z0(Vt,3))}function Eg(Nt,Vt,Jt,cr){Nt=Za(Nt)?Nt:Ql(Nt),Jt=Jt&&!cr?nn(Jt):0;var Er=Nt.length;return Jt<0&&(Jt=ua(Er+Jt,0)),Ld(Nt)?Jt<=Er&&Nt.indexOf(Vt,Jt)>-1:!!Er&&Tt(Nt,Vt,Jt)>-1}function Pd(Nt,Vt){return(Y0(Nt)?yt:df)(Nt,z0(Vt,3))}function Cg(Nt,Vt,Jt,cr){return Nt==null?[]:(Y0(Vt)||(Vt=Vt==null?[]:[Vt]),Jt=cr?pr:Jt,Y0(Jt)||(Jt=Jt==null?[]:[Jt]),mf(Nt,Vt,Jt))}function vg(Nt,Vt,Jt){var cr=Y0(Nt)?Et:Wt,Er=arguments.length<3;return cr(Nt,z0(Vt,4),Jt,Er,c2)}function kg(Nt,Vt,Jt){var cr=Y0(Nt)?vt:Wt,Er=arguments.length<3;return cr(Nt,z0(Vt,4),Jt,Er,Th)}function bg(Nt,Vt){return(Y0(Nt)?gt:sf)(Nt,Dd(z0(Vt,3)))}function Ig(Nt){return(Y0(Nt)?tf:z6)(Nt)}function Sg(Nt,Vt,Jt){return Vt=(Jt?Fa(Nt,Vt,Jt):Vt===pr)?1:nn(Vt),(Y0(Nt)?v6:W6)(Nt,Vt)}function wg(Nt){return(Y0(Nt)?k6:X6)(Nt)}function Rg(Nt){if(Nt==null)return 0;if(Za(Nt))return Ld(Nt)?er(Nt):Nt.length;var Vt=Ba(Nt);return Vt==fn||Vt==sa?Nt.size:W3(Nt).length}function Tg(Nt,Vt,Jt){var cr=Y0(Nt)?kt:K6;return Jt&&Fa(Nt,Vt,Jt)&&(Vt=pr),cr(Nt,z0(Vt,3))}function Bg(Nt,Vt){if(typeof Vt!="function")throw new Ni(qr);return Nt=nn(Nt),function(){if(--Nt<1)return Vt.apply(this,arguments)}}function ah(Nt,Vt,Jt){return Vt=Jt?pr:Vt,Vt=Nt&&Vt==null?Nt.length:Vt,go(Nt,zr,pr,pr,pr,pr,Vt)}function ih(Nt,Vt){var Jt;if(typeof Vt!="function")throw new Ni(qr);return Nt=nn(Nt),function(){return--Nt>0&&(Jt=Vt.apply(this,arguments)),Nt<=1&&(Vt=pr),Jt}}function sh(Nt,Vt,Jt){Vt=Jt?pr:Vt;var cr=go(Nt,Wr,pr,pr,pr,pr,pr,Vt);return cr.placeholder=sh.placeholder,cr}function oh(Nt,Vt,Jt){Vt=Jt?pr:Vt;var cr=go(Nt,Jr,pr,pr,pr,pr,pr,Vt);return cr.placeholder=oh.placeholder,cr}function lh(Nt,Vt,Jt){function cr(qn){var Li=k0,Du=B0;return k0=B0=pr,pn=qn,tn=Nt.apply(Du,Li)}function Er(qn){return pn=qn,F0=Ou(Fr,Vt),Pa?cr(qn):tn}function Sr(qn){var Li=qn-dn,Du=qn-pn,zh=Vt-Li;return ti?Ta(zh,M0-Du):zh}function jr(qn){var Li=qn-dn,Du=qn-pn;return dn===pr||Li>=Vt||Li<0||ti&&Du>=M0}function Fr(){var qn=qd();return jr(qn)?Kr(qn):(F0=Ou(Fr,Sr(qn)),pr)}function Kr(qn){return F0=pr,d2&&k0?cr(qn):(k0=B0=pr,tn)}function l0(){F0!==pr&&Oh(F0),pn=0,k0=dn=B0=F0=pr}function i0(){return F0===pr?tn:Kr(qd())}function p0(){var qn=qd(),Li=jr(qn);if(k0=arguments,B0=this,dn=qn,Li){if(F0===pr)return Er(dn);if(ti)return Oh(F0),F0=Ou(Fr,Vt),cr(dn)}return F0===pr&&(F0=Ou(Fr,Vt)),tn}var k0,B0,M0,tn,F0,dn,pn=0,Pa=!1,ti=!1,d2=!0;if(typeof Nt!="function")throw new Ni(qr);return Vt=Di(Vt)||0,Wn(Jt)&&(Pa=!!Jt.leading,ti="maxWait"in Jt,M0=ti?ua(Di(Jt.maxWait)||0,Vt):M0,d2="trailing"in Jt?!!Jt.trailing:d2),p0.cancel=l0,p0.flush=i0,p0}function Pg(Nt){return go(Nt,x0)}function Od(Nt,Vt){if(typeof Nt!="function"||Vt!=null&&typeof Vt!="function")throw new Ni(qr);var Jt=function(){var cr=arguments,Er=Vt?Vt.apply(this,cr):cr[0],Sr=Jt.cache;if(Sr.has(Er))return Sr.get(Er);var jr=Nt.apply(this,cr);return Jt.cache=Sr.set(Er,jr)||Sr,jr};return Jt.cache=new(Od.Cache||ho),Jt}function Dd(Nt){if(typeof Nt!="function")throw new Ni(qr);return function(){var Vt=arguments;switch(Vt.length){case 0:return!Nt.call(this);case 1:return!Nt.call(this,Vt[0]);case 2:return!Nt.call(this,Vt[0],Vt[1]);case 3:return!Nt.call(this,Vt[0],Vt[1],Vt[2])}return!Nt.apply(this,Vt)}}function Og(Nt){return ih(2,Nt)}function Dg(Nt,Vt){if(typeof Nt!="function")throw new Ni(qr);return Vt=Vt===pr?Vt:nn(Vt),cn(Nt,Vt)}function Ng(Nt,Vt){if(typeof Nt!="function")throw new Ni(qr);return Vt=Vt==null?0:ua(nn(Vt),0),cn(function(Jt){var cr=Jt[Vt],Er=o2(Jt,0,Vt);return cr&&Ct(Er,cr),Ye(Nt,this,Er)})}function Lg(Nt,Vt,Jt){var cr=!0,Er=!0;if(typeof Nt!="function")throw new Ni(qr);return Wn(Jt)&&(cr="leading"in Jt?!!Jt.leading:cr,Er="trailing"in Jt?!!Jt.trailing:Er),lh(Nt,Vt,{leading:cr,maxWait:Vt,trailing:Er})}function _g(Nt){return ah(Nt,1)}function Mg(Nt,Vt){return Lp(tp(Vt),Nt)}function jg(){if(!arguments.length)return[];var Nt=arguments[0];return Y0(Nt)?Nt:[Nt]}function Fg(Nt){return Bi(Nt,Yr)}function Qg(Nt,Vt){return Vt=typeof Vt=="function"?Vt:pr,Bi(Nt,Yr,Vt)}function Vg(Nt){return Bi(Nt,Or|Yr)}function Ug(Nt,Vt){return Vt=typeof Vt=="function"?Vt:pr,Bi(Nt,Or|Yr,Vt)}function Hg(Nt,Vt){return Vt==null||nf(Nt,Vt,ga(Vt))}function is(Nt,Vt){return Nt===Vt||Nt!==Nt&&Vt!==Vt}function Za(Nt){return Nt!=null&&Nd(Nt.length)&&!yo(Nt)}function Jn(Nt){return $n(Nt)&&Za(Nt)}function Gg(Nt){return Nt===!0||Nt===!1||$n(Nt)&&ja(Nt)==O0}function zg(Nt){return $n(Nt)&&Nt.nodeType===1&&!Su(Nt)}function Wg(Nt){if(Nt==null)return!0;if(Za(Nt)&&(Y0(Nt)||typeof Nt=="string"||typeof Nt.splice=="function"||u2(Nt)||Wl(Nt)||T1(Nt)))return!Nt.length;var Vt=Ba(Nt);if(Vt==fn||Vt==sa)return!Nt.size;if(Iu(Nt))return!W3(Nt).length;for(var Jt in Nt)if(Sn.call(Nt,Jt))return!1;return!0}function Xg(Nt,Vt){return vu(Nt,Vt)}function Kg(Nt,Vt,Jt){Jt=typeof Jt=="function"?Jt:pr;var cr=Jt?Jt(Nt,Vt):pr;return cr===pr?vu(Nt,Vt,pr,Jt):!!cr}function gp(Nt){if(!$n(Nt))return!1;var Vt=ja(Nt);return Vt==G0||Vt==en||typeof Nt.message=="string"&&typeof Nt.name=="string"&&!Su(Nt)}function $g(Nt){return typeof Nt=="number"&&Sh(Nt)}function yo(Nt){if(!Wn(Nt))return!1;var Vt=ja(Nt);return Vt==Bn||Vt==In||Vt==g0||Vt==Yi}function ch(Nt){return typeof Nt=="number"&&Nt==nn(Nt)}function Nd(Nt){return typeof Nt=="number"&&Nt>-1&&Nt%1==0&&Nt<=u0}function Wn(Nt){var Vt=typeof Nt;return Nt!=null&&(Vt=="object"||Vt=="function")}function $n(Nt){return Nt!=null&&typeof Nt=="object"}function qg(Nt,Vt){return Nt===Vt||z3(Nt,Vt,cp(Vt))}function Yg(Nt,Vt,Jt){return Jt=typeof Jt=="function"?Jt:pr,z3(Nt,Vt,cp(Vt),Jt)}function Zg(Nt){return uh(Nt)&&Nt!=+Nt}function Jg(Nt){if(V7(Nt))throw new Ip(Zr);return cf(Nt)}function e8(Nt){return Nt===null}function t8(Nt){return Nt==null}function uh(Nt){return typeof Nt=="number"||$n(Nt)&&ja(Nt)==Nn}function Su(Nt){if(!$n(Nt)||ja(Nt)!=Gn)return!1;var Vt=Hd(Nt);if(Vt===null)return!0;var Jt=Sn.call(Vt,"constructor")&&Vt.constructor;return typeof Jt=="function"&&Jt instanceof Jt&&Fd.call(Jt)==C7}function r8(Nt){return ch(Nt)&&Nt>=-u0&&Nt<=u0}function Ld(Nt){return typeof Nt=="string"||!Y0(Nt)&&$n(Nt)&&ja(Nt)==bs}function mi(Nt){return typeof Nt=="symbol"||$n(Nt)&&ja(Nt)==L0}function n8(Nt){return Nt===pr}function a8(Nt){return $n(Nt)&&Ba(Nt)==Ma}function i8(Nt){return $n(Nt)&&ja(Nt)==Ii}function dh(Nt){if(!Nt)return[];if(Za(Nt))return Ld(Nt)?nr(Nt):Ya(Nt);if(wu&&Nt[wu])return dr(Nt[wu]());var Vt=Ba(Nt);return(Vt==fn?rr:Vt==sa?or:Ql)(Nt)}function Eo(Nt){return Nt?(Nt=Di(Nt),Nt===H0||Nt===-H0?(Nt<0?-1:1)*w0:Nt===Nt?Nt:0):Nt===0?Nt:0}function nn(Nt){var Vt=Eo(Nt),Jt=Vt%1;return Vt===Vt?Jt?Vt-Jt:Vt:0}function ph(Nt){return Nt?b1(nn(Nt),0,U0):0}function Di(Nt){if(typeof Nt=="number")return Nt;if(mi(Nt))return V0;if(Wn(Nt)){var Vt=typeof Nt.valueOf=="function"?Nt.valueOf():Nt;Nt=Wn(Vt)?Vt+"":Vt}if(typeof Nt!="string")return Nt===0?Nt:+Nt;Nt=Ft(Nt);var Jt=wi.test(Nt);return Jt||ws.test(Nt)?W4(Nt.slice(2),Jt?2:8):Ss.test(Nt)?V0:+Nt}function fh(Nt){return Bs(Nt,Ja(Nt))}function s8(Nt){return Nt?b1(nn(Nt),-u0,u0):Nt===0?Nt:0}function vn(Nt){return Nt==null?"":hi(Nt)}function o8(Nt,Vt){var Jt=zl(Nt);return Vt==null?Jt:rf(Jt,Vt)}function l8(Nt,Vt){return It(Nt,z0(Vt,3),Ts)}function c8(Nt,Vt){return It(Nt,z0(Vt,3),U3)}function u8(Nt,Vt){return Nt==null?Nt:Bp(Nt,z0(Vt,3),Ja)}function d8(Nt,Vt){return Nt==null?Nt:Bh(Nt,z0(Vt,3),Ja)}function p8(Nt,Vt){return Nt&&Ts(Nt,z0(Vt,3))}function f8(Nt,Vt){return Nt&&U3(Nt,z0(Vt,3))}function h8(Nt){return Nt==null?[]:xd(Nt,ga(Nt))}function m8(Nt){return Nt==null?[]:xd(Nt,Ja(Nt))}function Ap(Nt,Vt,Jt){var cr=Nt==null?pr:I1(Nt,Vt);return cr===pr?Jt:cr}function g8(Nt,Vt){return Nt!=null&&Qf(Nt,Vt,T6)}function xp(Nt,Vt){return Nt!=null&&Qf(Nt,Vt,B6)}function ga(Nt){return Za(Nt)?ef(Nt):W3(Nt)}function Ja(Nt){return Za(Nt)?ef(Nt,!0):Q6(Nt)}function A8(Nt,Vt){var Jt={};return Vt=z0(Vt,3),Ts(Nt,function(cr,Er,Sr){mo(Jt,Vt(cr,Er,Sr),cr)}),Jt}function x8(Nt,Vt){var Jt={};return Vt=z0(Vt,3),Ts(Nt,function(cr,Er,Sr){mo(Jt,Er,Vt(cr,Er,Sr))}),Jt}function y8(Nt,Vt){return hh(Nt,Dd(z0(Vt)))}function hh(Nt,Vt){if(Nt==null)return{};var Jt=yt(lp(Nt),function(cr){return[cr]});return Vt=z0(Vt),gf(Nt,Jt,function(cr,Er){return Vt(cr,Er[0])})}function E8(Nt,Vt,Jt){Vt=s2(Vt,Nt);var cr=-1,Er=Vt.length;for(Er||(Er=1,Nt=pr);++cr<Er;){var Sr=Nt==null?pr:Nt[Ps(Vt[cr])];Sr===pr&&(cr=Er,Sr=Jt),Nt=yo(Sr)?Sr.call(Nt):Sr}return Nt}function C8(Nt,Vt,Jt){return Nt==null?Nt:ku(Nt,Vt,Jt)}function v8(Nt,Vt,Jt,cr){return cr=typeof cr=="function"?cr:pr,Nt==null?Nt:ku(Nt,Vt,Jt,cr)}function k8(Nt,Vt,Jt){var cr=Y0(Nt),Er=cr||u2(Nt)||Wl(Nt);if(Vt=z0(Vt,4),Jt==null){var Sr=Nt&&Nt.constructor;Jt=Er?cr?new Sr:[]:Wn(Nt)&&yo(Sr)?zl(Hd(Nt)):{}}return(Er?nt:Ts)(Nt,function(jr,Fr,Kr){return Vt(Jt,jr,Fr,Kr)}),Jt}function b8(Nt,Vt){return Nt==null||Z3(Nt,Vt)}function I8(Nt,Vt,Jt){return Nt==null?Nt:Ef(Nt,Vt,tp(Jt))}function S8(Nt,Vt,Jt,cr){return cr=typeof cr=="function"?cr:pr,Nt==null?Nt:Ef(Nt,Vt,tp(Jt),cr)}function Ql(Nt){return Nt==null?[]:_t(Nt,ga(Nt))}function w8(Nt){return Nt==null?[]:_t(Nt,Ja(Nt))}function R8(Nt,Vt,Jt){return Jt===pr&&(Jt=Vt,Vt=pr),Jt!==pr&&(Jt=Di(Jt),Jt=Jt===Jt?Jt:0),Vt!==pr&&(Vt=Di(Vt),Vt=Vt===Vt?Vt:0),b1(Di(Nt),Vt,Jt)}function T8(Nt,Vt,Jt){return Vt=Eo(Vt),Jt===pr?(Jt=Vt,Vt=0):Jt=Eo(Jt),Nt=Di(Nt),P6(Nt,Vt,Jt)}function B8(Nt,Vt,Jt){if(Jt&&typeof Jt!="boolean"&&Fa(Nt,Vt,Jt)&&(Vt=Jt=pr),Jt===pr&&(typeof Vt=="boolean"?(Jt=Vt,Vt=pr):typeof Nt=="boolean"&&(Jt=Nt,Nt=pr)),Nt===pr&&Vt===pr?(Nt=0,Vt=1):(Nt=Eo(Nt),Vt===pr?(Vt=Nt,Nt=0):Vt=Eo(Vt)),Nt>Vt){var cr=Nt;Nt=Vt,Vt=cr}if(Jt||Nt%1||Vt%1){var Er=wh();return Ta(Nt+Er*(Vt-Nt+z4("1e-"+((Er+"").length-1))),Vt)}return $3(Nt,Vt)}function mh(Nt){return Mp(vn(Nt).toLowerCase())}function gh(Nt){return Nt=vn(Nt),Nt&&Nt.replace(r2,$4).replace(N4,"")}function P8(Nt,Vt,Jt){Nt=vn(Nt),Vt=hi(Vt);var cr=Nt.length;Jt=Jt===pr?cr:b1(nn(Jt),0,cr);var Er=Jt;return Jt-=Vt.length,Jt>=0&&Nt.slice(Jt,Er)==Vt}function O8(Nt){return Nt=vn(Nt),Nt&&Lr.test(Nt)?Nt.replace(br,q4):Nt}function D8(Nt){return Nt=vn(Nt),Nt&&T0.test(Nt)?Nt.replace(d0,"\\$&"):Nt}function N8(Nt,Vt,Jt){Nt=vn(Nt),Vt=nn(Vt);var cr=Vt?er(Nt):0;if(!Vt||cr>=Vt)return Nt;var Er=(Vt-cr)/2;return Id(Xd(Er),Jt)+Nt+Id(Wd(Er),Jt)}function L8(Nt,Vt,Jt){Nt=vn(Nt),Vt=nn(Vt);var cr=Vt?er(Nt):0;return Vt&&cr<Vt?Nt+Id(Vt-cr,Jt):Nt}function _8(Nt,Vt,Jt){Nt=vn(Nt),Vt=nn(Vt);var cr=Vt?er(Nt):0;return Vt&&cr<Vt?Id(Vt-cr,Jt)+Nt:Nt}function M8(Nt,Vt,Jt){return Jt||Vt==null?Vt=0:Vt&&(Vt=+Vt),P7(vn(Nt).replace(E0,""),Vt||0)}function j8(Nt,Vt,Jt){return Vt=(Jt?Fa(Nt,Vt,Jt):Vt===pr)?1:nn(Vt),q3(vn(Nt),Vt)}function F8(){var Nt=arguments,Vt=vn(Nt[0]);return Nt.length<3?Vt:Vt.replace(Nt[1],Nt[2])}function Q8(Nt,Vt,Jt){return Jt&&typeof Jt!="number"&&Fa(Nt,Vt,Jt)&&(Vt=Jt=pr),(Jt=Jt===pr?U0:Jt>>>0)?(Nt=vn(Nt),Nt&&(typeof Vt=="string"||Vt!=null&&!_p(Vt))&&(Vt=hi(Vt),!Vt&&tr(Nt))?o2(nr(Nt),0,Jt):Nt.split(Vt,Jt)):[]}function V8(Nt,Vt,Jt){return Nt=vn(Nt),Jt=Jt==null?0:b1(nn(Jt),0,Nt.length),Vt=hi(Vt),Nt.slice(Jt,Jt+Vt.length)==Vt}function U8(Nt,Vt,Jt){var cr=mr.templateSettings;Jt&&Fa(Nt,Vt,Jt)&&(Vt=pr),Nt=vn(Nt),Vt=Yd({},Vt,cr,Mf);var Er,Sr,jr=Yd({},Vt.imports,cr.imports,Mf),Fr=ga(jr),Kr=_t(jr,Fr),l0=0,i0=Vt.interpolate||Ka,p0="__p += '",k0=Sp((Vt.escape||Ka).source+"|"+i0.source+"|"+(i0===Hr?Au:Ka).source+"|"+(Vt.evaluate||Ka).source+"|$","g"),B0="//# sourceURL="+(Sn.call(Vt,"sourceURL")?(Vt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++F4+"]")+`
|
|
2780
|
+
`)}function hm(Nt){return Y0(Nt)||T1(Nt)||!!(Ih&&Nt&&Nt[Ih])}function xo(Nt,Vt){var Jt=typeof Nt;return Vt=Vt??u0,!!Vt&&(Jt=="number"||Jt!="symbol"&&po.test(Nt))&&Nt>-1&&Nt%1==0&&Nt<Vt}function Fa(Nt,Vt,Jt){if(!Wn(Jt))return!1;var cr=typeof Vt;return!!(cr=="number"?Za(Jt)&&xo(Vt,Jt.length):cr=="string"&&Vt in Jt)&&is(Jt[Vt],Nt)}function up(Nt,Vt){if(Y0(Nt))return!1;var Jt=typeof Nt;return!(Jt!="number"&&Jt!="symbol"&&Jt!="boolean"&&Nt!=null&&!mi(Nt))||f0.test(Nt)||!s0.test(Nt)||Vt!=null&&Nt in jn(Vt)}function mm(Nt){var Vt=typeof Nt;return Vt=="string"||Vt=="number"||Vt=="symbol"||Vt=="boolean"?Nt!=="__proto__":Nt===null}function dp(Nt){var Vt=wd(Nt),Jt=mr[Vt];if(typeof Jt!="function"||!(Vt in R0.prototype))return!1;if(Nt===Jt)return!0;var cr=Pp(Jt);return!!cr&&Nt===cr[0]}function gm(Nt){return!!Eh&&Eh in Nt}function Iu(Nt){var Vt=Nt&&Nt.constructor;return Nt===(typeof Vt=="function"&&Vt.prototype||Ul)}function Uf(Nt){return Nt===Nt&&!Wn(Nt)}function Hf(Nt,Vt){return function(Jt){return Jt!=null&&Jt[Nt]===Vt&&(Vt!==pr||Nt in jn(Jt))}}function Am(Nt){var Vt=Od(Nt,function(cr){return Jt.size===Ir&&Jt.clear(),cr}),Jt=Vt.cache;return Vt}function xm(Nt,Vt){var Jt=Nt[1],cr=Vt[1],Er=Jt|cr,Sr=Er<(wr|Tr|zr),jr=cr==zr&&Jt==Wr||cr==zr&&Jt==m0&&Nt[7].length<=Vt[8]||cr==(zr|m0)&&Vt[7].length<=Vt[8]&&Jt==Wr;if(!Sr&&!jr)return Nt;cr&wr&&(Nt[2]=Vt[2],Er|=Jt&wr?0:n0);var Fr=Vt[3];if(Fr){var Kr=Nt[3];Nt[3]=Kr?Sf(Kr,Fr,Vt[4]):Fr,Nt[4]=Kr?yr(Nt[3],Nr):Vt[4]}return Fr=Vt[5],Fr&&(Kr=Nt[5],Nt[5]=Kr?wf(Kr,Fr,Vt[6]):Fr,Nt[6]=Kr?yr(Nt[5],Nr):Vt[6]),Fr=Vt[7],Fr&&(Nt[7]=Fr),cr&zr&&(Nt[8]=Nt[8]==null?Vt[8]:Ta(Nt[8],Vt[8])),Nt[9]==null&&(Nt[9]=Vt[9]),Nt[0]=Vt[0],Nt[1]=Er,Nt}function ym(Nt){var Vt=[];if(Nt!=null)for(var Jt in jn(Nt))Vt.push(Jt);return Vt}function Em(Nt){return Qd.call(Nt)}function Gf(Nt,Vt,Jt){return Vt=ua(Vt===pr?Nt.length-1:Vt,0),function(){for(var cr=arguments,Er=-1,Sr=ua(cr.length-Vt,0),jr=la(Sr);++Er<Sr;)jr[Er]=cr[Vt+Er];Er=-1;for(var Fr=la(Vt+1);++Er<Vt;)Fr[Er]=cr[Er];return Fr[Vt]=Jt(jr),Ye(Nt,this,Fr)}}function zf(Nt,Vt){return Vt.length<2?Nt:I1(Nt,Pi(Vt,0,-1))}function Cm(Nt,Vt){for(var Jt=Nt.length,cr=Ta(Vt.length,Jt),Er=Ya(Nt);cr--;){var Sr=Vt[cr];Nt[cr]=xo(Sr,Jt)?Er[Sr]:pr}return Nt}function pp(Nt,Vt){if((Vt!=="constructor"||typeof Nt[Vt]!="function")&&Vt!="__proto__")return Nt[Vt]}function Wf(Nt,Vt,Jt){var cr=Vt+"";return Dp(Nt,fm(cr,vm(um(cr),Jt)))}function Xf(Nt){var Vt=0,Jt=0;return function(){var cr=B7(),Er=D0-(cr-Jt);if(Jt=cr,Er>0){if(++Vt>=X0)return arguments[0]}else Vt=0;return Nt.apply(pr,arguments)}}function Td(Nt,Vt){var Jt=-1,cr=Nt.length,Er=cr-1;for(Vt=Vt===pr?cr:Vt;++Jt<Vt;){var Sr=$3(Jt,Er),jr=Nt[Sr];Nt[Sr]=Nt[Jt],Nt[Jt]=jr}return Nt.length=Vt,Nt}function Ps(Nt){if(typeof Nt=="string"||mi(Nt))return Nt;var Vt=Nt+"";return Vt=="0"&&1/Nt==-H0?"-0":Vt}function w1(Nt){if(Nt!=null){try{return Fd.call(Nt)}catch{}try{return Nt+""}catch{}}return""}function vm(Nt,Vt){return nt(Dr,function(Jt){var cr="_."+Jt[0];Vt&Jt[1]&&!At(Nt,cr)&&Nt.push(cr)}),Nt.sort()}function Kf(Nt){if(Nt instanceof R0)return Nt.clone();var Vt=new Q0(Nt.__wrapped__,Nt.__chain__);return Vt.__actions__=Ya(Nt.__actions__),Vt.__index__=Nt.__index__,Vt.__values__=Nt.__values__,Vt}function km(Nt,Vt,Jt){Vt=(Jt?Fa(Nt,Vt,Jt):Vt===pr)?1:ua(nn(Vt),0);var cr=Nt==null?0:Nt.length;if(!cr||Vt<1)return[];for(var Er=0,Sr=0,jr=la(Wd(cr/Vt));Er<cr;)jr[Sr++]=Pi(Nt,Er,Er+=Vt);return jr}function bm(Nt){for(var Vt=-1,Jt=Nt==null?0:Nt.length,cr=0,Er=[];++Vt<Jt;){var Sr=Nt[Vt];Sr&&(Er[cr++]=Sr)}return Er}function Im(){var Nt=arguments.length;if(!Nt)return[];for(var Vt=la(Nt-1),Jt=arguments[0],cr=Nt;cr--;)Vt[cr-1]=arguments[cr];return Ct(Y0(Jt)?Ya(Jt):[Jt],ba(Vt,1))}function Sm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;return cr?(Vt=Jt||Vt===pr?1:nn(Vt),Pi(Nt,Vt<0?0:Vt,cr)):[]}function wm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;return cr?(Vt=Jt||Vt===pr?1:nn(Vt),Vt=cr-Vt,Pi(Nt,0,Vt<0?0:Vt)):[]}function Rm(Nt,Vt){return Nt&&Nt.length?Cd(Nt,z0(Vt,3),!0,!0):[]}function Tm(Nt,Vt){return Nt&&Nt.length?Cd(Nt,z0(Vt,3),!0):[]}function Bm(Nt,Vt,Jt,cr){var Er=Nt==null?0:Nt.length;return Er?(Jt&&typeof Jt!="number"&&Fa(Nt,Vt,Jt)&&(Jt=0,cr=Er),R6(Nt,Vt,Jt,cr)):[]}function $f(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;if(!cr)return-1;var Er=Jt==null?0:nn(Jt);return Er<0&&(Er=ua(cr+Er,0)),Rt(Nt,z0(Vt,3),Er)}function qf(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;if(!cr)return-1;var Er=cr-1;return Jt!==pr&&(Er=nn(Jt),Er=Jt<0?ua(cr+Er,0):Ta(Er,cr-1)),Rt(Nt,z0(Vt,3),Er,!0)}function Yf(Nt){return Nt!=null&&Nt.length?ba(Nt,1):[]}function Pm(Nt){return Nt!=null&&Nt.length?ba(Nt,H0):[]}function Om(Nt,Vt){return Nt!=null&&Nt.length?(Vt=Vt===pr?1:nn(Vt),ba(Nt,Vt)):[]}function Dm(Nt){for(var Vt=-1,Jt=Nt==null?0:Nt.length,cr={};++Vt<Jt;){var Er=Nt[Vt];cr[Er[0]]=Er[1]}return cr}function Zf(Nt){return Nt&&Nt.length?Nt[0]:pr}function Nm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;if(!cr)return-1;var Er=Jt==null?0:nn(Jt);return Er<0&&(Er=ua(cr+Er,0)),Tt(Nt,Vt,Er)}function Lm(Nt){return Nt!=null&&Nt.length?Pi(Nt,0,-1):[]}function _m(Nt,Vt){return Nt==null?"":R7.call(Nt,Vt)}function Oi(Nt){var Vt=Nt==null?0:Nt.length;return Vt?Nt[Vt-1]:pr}function Mm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;if(!cr)return-1;var Er=cr;return Jt!==pr&&(Er=nn(Jt),Er=Er<0?ua(cr+Er,0):Ta(Er,cr-1)),Vt===Vt?Qt(Nt,Vt,Er):Rt(Nt,Pt,Er,!0)}function jm(Nt,Vt){return Nt&&Nt.length?hf(Nt,nn(Vt)):pr}function Jf(Nt,Vt){return Nt&&Nt.length&&Vt&&Vt.length?K3(Nt,Vt):Nt}function Fm(Nt,Vt,Jt){return Nt&&Nt.length&&Vt&&Vt.length?K3(Nt,Vt,z0(Jt,2)):Nt}function Qm(Nt,Vt,Jt){return Nt&&Nt.length&&Vt&&Vt.length?K3(Nt,Vt,pr,Jt):Nt}function Vm(Nt,Vt){var Jt=[];if(!Nt||!Nt.length)return Jt;var cr=-1,Er=[],Sr=Nt.length;for(Vt=z0(Vt,3);++cr<Sr;){var jr=Nt[cr];Vt(jr,cr,Nt)&&(Jt.push(jr),Er.push(cr))}return Af(Nt,Er),Jt}function hp(Nt){return Nt==null?Nt:O7.call(Nt)}function Um(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;return cr?(Jt&&typeof Jt!="number"&&Fa(Nt,Vt,Jt)?(Vt=0,Jt=cr):(Vt=Vt==null?0:nn(Vt),Jt=Jt===pr?cr:nn(Jt)),Pi(Nt,Vt,Jt)):[]}function Hm(Nt,Vt){return Ed(Nt,Vt)}function Gm(Nt,Vt,Jt){return Y3(Nt,Vt,z0(Jt,2))}function zm(Nt,Vt){var Jt=Nt==null?0:Nt.length;if(Jt){var cr=Ed(Nt,Vt);if(cr<Jt&&is(Nt[cr],Vt))return cr}return-1}function Wm(Nt,Vt){return Ed(Nt,Vt,!0)}function Xm(Nt,Vt,Jt){return Y3(Nt,Vt,z0(Jt,2),!0)}function Km(Nt,Vt){if(Nt!=null&&Nt.length){var Jt=Ed(Nt,Vt,!0)-1;if(is(Nt[Jt],Vt))return Jt}return-1}function $m(Nt){return Nt&&Nt.length?xf(Nt):[]}function qm(Nt,Vt){return Nt&&Nt.length?xf(Nt,z0(Vt,2)):[]}function Ym(Nt){var Vt=Nt==null?0:Nt.length;return Vt?Pi(Nt,1,Vt):[]}function Zm(Nt,Vt,Jt){return Nt&&Nt.length?(Vt=Jt||Vt===pr?1:nn(Vt),Pi(Nt,0,Vt<0?0:Vt)):[]}function Jm(Nt,Vt,Jt){var cr=Nt==null?0:Nt.length;return cr?(Vt=Jt||Vt===pr?1:nn(Vt),Vt=cr-Vt,Pi(Nt,Vt<0?0:Vt,cr)):[]}function e8(Nt,Vt){return Nt&&Nt.length?Cd(Nt,z0(Vt,3),!1,!0):[]}function t8(Nt,Vt){return Nt&&Nt.length?Cd(Nt,z0(Vt,3)):[]}function r8(Nt){return Nt&&Nt.length?i2(Nt):[]}function n8(Nt,Vt){return Nt&&Nt.length?i2(Nt,z0(Vt,2)):[]}function a8(Nt,Vt){return Vt=typeof Vt=="function"?Vt:pr,Nt&&Nt.length?i2(Nt,pr,Vt):[]}function mp(Nt){if(!Nt||!Nt.length)return[];var Vt=0;return Nt=gt(Nt,function(Jt){if(Jn(Jt))return Vt=ua(Jt.length,Vt),!0}),Ht(Vt,function(Jt){return yt(Nt,Ot(Jt))})}function eh(Nt,Vt){if(!Nt||!Nt.length)return[];var Jt=mp(Nt);return Vt==null?Jt:yt(Jt,function(cr){return Ye(Vt,pr,cr)})}function i8(Nt,Vt){return vf(Nt||[],Vt||[],yu)}function s8(Nt,Vt){return vf(Nt||[],Vt||[],ku)}function th(Nt){var Vt=mr(Nt);return Vt.__chain__=!0,Vt}function o8(Nt,Vt){return Vt(Nt),Nt}function Bd(Nt,Vt){return Vt(Nt)}function l8(){return th(this)}function c8(){return new Q0(this.value(),this.__chain__)}function u8(){this.__values__===pr&&(this.__values__=dh(this.value()));var Nt=this.__index__>=this.__values__.length;return{done:Nt,value:Nt?pr:this.__values__[this.__index__++]}}function d8(){return this}function p8(Nt){for(var Vt,Jt=this;Jt instanceof S0;){var cr=Kf(Jt);cr.__index__=0,cr.__values__=pr,Vt?Er.__wrapped__=cr:Vt=cr;var Er=cr;Jt=Jt.__wrapped__}return Er.__wrapped__=Nt,Vt}function f8(){var Nt=this.__wrapped__;if(Nt instanceof R0){var Vt=Nt;return this.__actions__.length&&(Vt=new R0(this)),Vt=Vt.reverse(),Vt.__actions__.push({func:Bd,args:[hp],thisArg:pr}),new Q0(Vt,this.__chain__)}return this.thru(hp)}function h8(){return Cf(this.__wrapped__,this.__actions__)}function m8(Nt,Vt,Jt){var cr=Y0(Nt)?ht:w6;return Jt&&Fa(Nt,Vt,Jt)&&(Vt=pr),cr(Nt,z0(Vt,3))}function g8(Nt,Vt){return(Y0(Nt)?gt:sf)(Nt,z0(Vt,3))}function A8(Nt,Vt){return ba(Pd(Nt,Vt),1)}function x8(Nt,Vt){return ba(Pd(Nt,Vt),H0)}function y8(Nt,Vt,Jt){return Jt=Jt===pr?1:nn(Jt),ba(Pd(Nt,Vt),Jt)}function rh(Nt,Vt){return(Y0(Nt)?nt:c2)(Nt,z0(Vt,3))}function nh(Nt,Vt){return(Y0(Nt)?ft:Th)(Nt,z0(Vt,3))}function E8(Nt,Vt,Jt,cr){Nt=Za(Nt)?Nt:Ql(Nt),Jt=Jt&&!cr?nn(Jt):0;var Er=Nt.length;return Jt<0&&(Jt=ua(Er+Jt,0)),Ld(Nt)?Jt<=Er&&Nt.indexOf(Vt,Jt)>-1:!!Er&&Tt(Nt,Vt,Jt)>-1}function Pd(Nt,Vt){return(Y0(Nt)?yt:df)(Nt,z0(Vt,3))}function C8(Nt,Vt,Jt,cr){return Nt==null?[]:(Y0(Vt)||(Vt=Vt==null?[]:[Vt]),Jt=cr?pr:Jt,Y0(Jt)||(Jt=Jt==null?[]:[Jt]),mf(Nt,Vt,Jt))}function v8(Nt,Vt,Jt){var cr=Y0(Nt)?Et:Wt,Er=arguments.length<3;return cr(Nt,z0(Vt,4),Jt,Er,c2)}function k8(Nt,Vt,Jt){var cr=Y0(Nt)?vt:Wt,Er=arguments.length<3;return cr(Nt,z0(Vt,4),Jt,Er,Th)}function b8(Nt,Vt){return(Y0(Nt)?gt:sf)(Nt,Dd(z0(Vt,3)))}function I8(Nt){return(Y0(Nt)?tf:z6)(Nt)}function S8(Nt,Vt,Jt){return Vt=(Jt?Fa(Nt,Vt,Jt):Vt===pr)?1:nn(Vt),(Y0(Nt)?v6:W6)(Nt,Vt)}function w8(Nt){return(Y0(Nt)?k6:X6)(Nt)}function R8(Nt){if(Nt==null)return 0;if(Za(Nt))return Ld(Nt)?er(Nt):Nt.length;var Vt=Ba(Nt);return Vt==fn||Vt==sa?Nt.size:W3(Nt).length}function T8(Nt,Vt,Jt){var cr=Y0(Nt)?kt:K6;return Jt&&Fa(Nt,Vt,Jt)&&(Vt=pr),cr(Nt,z0(Vt,3))}function B8(Nt,Vt){if(typeof Vt!="function")throw new Ni(qr);return Nt=nn(Nt),function(){if(--Nt<1)return Vt.apply(this,arguments)}}function ah(Nt,Vt,Jt){return Vt=Jt?pr:Vt,Vt=Nt&&Vt==null?Nt.length:Vt,go(Nt,zr,pr,pr,pr,pr,Vt)}function ih(Nt,Vt){var Jt;if(typeof Vt!="function")throw new Ni(qr);return Nt=nn(Nt),function(){return--Nt>0&&(Jt=Vt.apply(this,arguments)),Nt<=1&&(Vt=pr),Jt}}function sh(Nt,Vt,Jt){Vt=Jt?pr:Vt;var cr=go(Nt,Wr,pr,pr,pr,pr,pr,Vt);return cr.placeholder=sh.placeholder,cr}function oh(Nt,Vt,Jt){Vt=Jt?pr:Vt;var cr=go(Nt,Jr,pr,pr,pr,pr,pr,Vt);return cr.placeholder=oh.placeholder,cr}function lh(Nt,Vt,Jt){function cr(qn){var Li=k0,Du=B0;return k0=B0=pr,pn=qn,tn=Nt.apply(Du,Li)}function Er(qn){return pn=qn,F0=Ou(Fr,Vt),Pa?cr(qn):tn}function Sr(qn){var Li=qn-dn,Du=qn-pn,zh=Vt-Li;return ti?Ta(zh,M0-Du):zh}function jr(qn){var Li=qn-dn,Du=qn-pn;return dn===pr||Li>=Vt||Li<0||ti&&Du>=M0}function Fr(){var qn=qd();return jr(qn)?Kr(qn):(F0=Ou(Fr,Sr(qn)),pr)}function Kr(qn){return F0=pr,d2&&k0?cr(qn):(k0=B0=pr,tn)}function l0(){F0!==pr&&Oh(F0),pn=0,k0=dn=B0=F0=pr}function i0(){return F0===pr?tn:Kr(qd())}function p0(){var qn=qd(),Li=jr(qn);if(k0=arguments,B0=this,dn=qn,Li){if(F0===pr)return Er(dn);if(ti)return Oh(F0),F0=Ou(Fr,Vt),cr(dn)}return F0===pr&&(F0=Ou(Fr,Vt)),tn}var k0,B0,M0,tn,F0,dn,pn=0,Pa=!1,ti=!1,d2=!0;if(typeof Nt!="function")throw new Ni(qr);return Vt=Di(Vt)||0,Wn(Jt)&&(Pa=!!Jt.leading,ti="maxWait"in Jt,M0=ti?ua(Di(Jt.maxWait)||0,Vt):M0,d2="trailing"in Jt?!!Jt.trailing:d2),p0.cancel=l0,p0.flush=i0,p0}function P8(Nt){return go(Nt,x0)}function Od(Nt,Vt){if(typeof Nt!="function"||Vt!=null&&typeof Vt!="function")throw new Ni(qr);var Jt=function(){var cr=arguments,Er=Vt?Vt.apply(this,cr):cr[0],Sr=Jt.cache;if(Sr.has(Er))return Sr.get(Er);var jr=Nt.apply(this,cr);return Jt.cache=Sr.set(Er,jr)||Sr,jr};return Jt.cache=new(Od.Cache||ho),Jt}function Dd(Nt){if(typeof Nt!="function")throw new Ni(qr);return function(){var Vt=arguments;switch(Vt.length){case 0:return!Nt.call(this);case 1:return!Nt.call(this,Vt[0]);case 2:return!Nt.call(this,Vt[0],Vt[1]);case 3:return!Nt.call(this,Vt[0],Vt[1],Vt[2])}return!Nt.apply(this,Vt)}}function O8(Nt){return ih(2,Nt)}function D8(Nt,Vt){if(typeof Nt!="function")throw new Ni(qr);return Vt=Vt===pr?Vt:nn(Vt),cn(Nt,Vt)}function N8(Nt,Vt){if(typeof Nt!="function")throw new Ni(qr);return Vt=Vt==null?0:ua(nn(Vt),0),cn(function(Jt){var cr=Jt[Vt],Er=o2(Jt,0,Vt);return cr&&Ct(Er,cr),Ye(Nt,this,Er)})}function L8(Nt,Vt,Jt){var cr=!0,Er=!0;if(typeof Nt!="function")throw new Ni(qr);return Wn(Jt)&&(cr="leading"in Jt?!!Jt.leading:cr,Er="trailing"in Jt?!!Jt.trailing:Er),lh(Nt,Vt,{leading:cr,maxWait:Vt,trailing:Er})}function _8(Nt){return ah(Nt,1)}function M8(Nt,Vt){return Lp(tp(Vt),Nt)}function j8(){if(!arguments.length)return[];var Nt=arguments[0];return Y0(Nt)?Nt:[Nt]}function F8(Nt){return Bi(Nt,Yr)}function Q8(Nt,Vt){return Vt=typeof Vt=="function"?Vt:pr,Bi(Nt,Yr,Vt)}function V8(Nt){return Bi(Nt,Or|Yr)}function U8(Nt,Vt){return Vt=typeof Vt=="function"?Vt:pr,Bi(Nt,Or|Yr,Vt)}function H8(Nt,Vt){return Vt==null||nf(Nt,Vt,ga(Vt))}function is(Nt,Vt){return Nt===Vt||Nt!==Nt&&Vt!==Vt}function Za(Nt){return Nt!=null&&Nd(Nt.length)&&!yo(Nt)}function Jn(Nt){return $n(Nt)&&Za(Nt)}function G8(Nt){return Nt===!0||Nt===!1||$n(Nt)&&ja(Nt)==O0}function z8(Nt){return $n(Nt)&&Nt.nodeType===1&&!Su(Nt)}function W8(Nt){if(Nt==null)return!0;if(Za(Nt)&&(Y0(Nt)||typeof Nt=="string"||typeof Nt.splice=="function"||u2(Nt)||Wl(Nt)||T1(Nt)))return!Nt.length;var Vt=Ba(Nt);if(Vt==fn||Vt==sa)return!Nt.size;if(Iu(Nt))return!W3(Nt).length;for(var Jt in Nt)if(Sn.call(Nt,Jt))return!1;return!0}function X8(Nt,Vt){return vu(Nt,Vt)}function K8(Nt,Vt,Jt){Jt=typeof Jt=="function"?Jt:pr;var cr=Jt?Jt(Nt,Vt):pr;return cr===pr?vu(Nt,Vt,pr,Jt):!!cr}function gp(Nt){if(!$n(Nt))return!1;var Vt=ja(Nt);return Vt==G0||Vt==en||typeof Nt.message=="string"&&typeof Nt.name=="string"&&!Su(Nt)}function $8(Nt){return typeof Nt=="number"&&Sh(Nt)}function yo(Nt){if(!Wn(Nt))return!1;var Vt=ja(Nt);return Vt==Bn||Vt==In||Vt==g0||Vt==Yi}function ch(Nt){return typeof Nt=="number"&&Nt==nn(Nt)}function Nd(Nt){return typeof Nt=="number"&&Nt>-1&&Nt%1==0&&Nt<=u0}function Wn(Nt){var Vt=typeof Nt;return Nt!=null&&(Vt=="object"||Vt=="function")}function $n(Nt){return Nt!=null&&typeof Nt=="object"}function q8(Nt,Vt){return Nt===Vt||z3(Nt,Vt,cp(Vt))}function Y8(Nt,Vt,Jt){return Jt=typeof Jt=="function"?Jt:pr,z3(Nt,Vt,cp(Vt),Jt)}function Z8(Nt){return uh(Nt)&&Nt!=+Nt}function J8(Nt){if(V7(Nt))throw new Ip(Zr);return cf(Nt)}function eg(Nt){return Nt===null}function tg(Nt){return Nt==null}function uh(Nt){return typeof Nt=="number"||$n(Nt)&&ja(Nt)==Nn}function Su(Nt){if(!$n(Nt)||ja(Nt)!=Gn)return!1;var Vt=Hd(Nt);if(Vt===null)return!0;var Jt=Sn.call(Vt,"constructor")&&Vt.constructor;return typeof Jt=="function"&&Jt instanceof Jt&&Fd.call(Jt)==C7}function rg(Nt){return ch(Nt)&&Nt>=-u0&&Nt<=u0}function Ld(Nt){return typeof Nt=="string"||!Y0(Nt)&&$n(Nt)&&ja(Nt)==bs}function mi(Nt){return typeof Nt=="symbol"||$n(Nt)&&ja(Nt)==L0}function ng(Nt){return Nt===pr}function ag(Nt){return $n(Nt)&&Ba(Nt)==Ma}function ig(Nt){return $n(Nt)&&ja(Nt)==Ii}function dh(Nt){if(!Nt)return[];if(Za(Nt))return Ld(Nt)?nr(Nt):Ya(Nt);if(wu&&Nt[wu])return dr(Nt[wu]());var Vt=Ba(Nt);return(Vt==fn?rr:Vt==sa?or:Ql)(Nt)}function Eo(Nt){return Nt?(Nt=Di(Nt),Nt===H0||Nt===-H0?(Nt<0?-1:1)*w0:Nt===Nt?Nt:0):Nt===0?Nt:0}function nn(Nt){var Vt=Eo(Nt),Jt=Vt%1;return Vt===Vt?Jt?Vt-Jt:Vt:0}function ph(Nt){return Nt?b1(nn(Nt),0,U0):0}function Di(Nt){if(typeof Nt=="number")return Nt;if(mi(Nt))return V0;if(Wn(Nt)){var Vt=typeof Nt.valueOf=="function"?Nt.valueOf():Nt;Nt=Wn(Vt)?Vt+"":Vt}if(typeof Nt!="string")return Nt===0?Nt:+Nt;Nt=Ft(Nt);var Jt=wi.test(Nt);return Jt||ws.test(Nt)?W4(Nt.slice(2),Jt?2:8):Ss.test(Nt)?V0:+Nt}function fh(Nt){return Bs(Nt,Ja(Nt))}function sg(Nt){return Nt?b1(nn(Nt),-u0,u0):Nt===0?Nt:0}function vn(Nt){return Nt==null?"":hi(Nt)}function og(Nt,Vt){var Jt=zl(Nt);return Vt==null?Jt:rf(Jt,Vt)}function lg(Nt,Vt){return It(Nt,z0(Vt,3),Ts)}function cg(Nt,Vt){return It(Nt,z0(Vt,3),U3)}function ug(Nt,Vt){return Nt==null?Nt:Bp(Nt,z0(Vt,3),Ja)}function dg(Nt,Vt){return Nt==null?Nt:Bh(Nt,z0(Vt,3),Ja)}function pg(Nt,Vt){return Nt&&Ts(Nt,z0(Vt,3))}function fg(Nt,Vt){return Nt&&U3(Nt,z0(Vt,3))}function hg(Nt){return Nt==null?[]:xd(Nt,ga(Nt))}function mg(Nt){return Nt==null?[]:xd(Nt,Ja(Nt))}function Ap(Nt,Vt,Jt){var cr=Nt==null?pr:I1(Nt,Vt);return cr===pr?Jt:cr}function gg(Nt,Vt){return Nt!=null&&Qf(Nt,Vt,T6)}function xp(Nt,Vt){return Nt!=null&&Qf(Nt,Vt,B6)}function ga(Nt){return Za(Nt)?ef(Nt):W3(Nt)}function Ja(Nt){return Za(Nt)?ef(Nt,!0):Q6(Nt)}function Ag(Nt,Vt){var Jt={};return Vt=z0(Vt,3),Ts(Nt,function(cr,Er,Sr){mo(Jt,Vt(cr,Er,Sr),cr)}),Jt}function xg(Nt,Vt){var Jt={};return Vt=z0(Vt,3),Ts(Nt,function(cr,Er,Sr){mo(Jt,Er,Vt(cr,Er,Sr))}),Jt}function yg(Nt,Vt){return hh(Nt,Dd(z0(Vt)))}function hh(Nt,Vt){if(Nt==null)return{};var Jt=yt(lp(Nt),function(cr){return[cr]});return Vt=z0(Vt),gf(Nt,Jt,function(cr,Er){return Vt(cr,Er[0])})}function Eg(Nt,Vt,Jt){Vt=s2(Vt,Nt);var cr=-1,Er=Vt.length;for(Er||(Er=1,Nt=pr);++cr<Er;){var Sr=Nt==null?pr:Nt[Ps(Vt[cr])];Sr===pr&&(cr=Er,Sr=Jt),Nt=yo(Sr)?Sr.call(Nt):Sr}return Nt}function Cg(Nt,Vt,Jt){return Nt==null?Nt:ku(Nt,Vt,Jt)}function vg(Nt,Vt,Jt,cr){return cr=typeof cr=="function"?cr:pr,Nt==null?Nt:ku(Nt,Vt,Jt,cr)}function kg(Nt,Vt,Jt){var cr=Y0(Nt),Er=cr||u2(Nt)||Wl(Nt);if(Vt=z0(Vt,4),Jt==null){var Sr=Nt&&Nt.constructor;Jt=Er?cr?new Sr:[]:Wn(Nt)&&yo(Sr)?zl(Hd(Nt)):{}}return(Er?nt:Ts)(Nt,function(jr,Fr,Kr){return Vt(Jt,jr,Fr,Kr)}),Jt}function bg(Nt,Vt){return Nt==null||Z3(Nt,Vt)}function Ig(Nt,Vt,Jt){return Nt==null?Nt:Ef(Nt,Vt,tp(Jt))}function Sg(Nt,Vt,Jt,cr){return cr=typeof cr=="function"?cr:pr,Nt==null?Nt:Ef(Nt,Vt,tp(Jt),cr)}function Ql(Nt){return Nt==null?[]:_t(Nt,ga(Nt))}function wg(Nt){return Nt==null?[]:_t(Nt,Ja(Nt))}function Rg(Nt,Vt,Jt){return Jt===pr&&(Jt=Vt,Vt=pr),Jt!==pr&&(Jt=Di(Jt),Jt=Jt===Jt?Jt:0),Vt!==pr&&(Vt=Di(Vt),Vt=Vt===Vt?Vt:0),b1(Di(Nt),Vt,Jt)}function Tg(Nt,Vt,Jt){return Vt=Eo(Vt),Jt===pr?(Jt=Vt,Vt=0):Jt=Eo(Jt),Nt=Di(Nt),P6(Nt,Vt,Jt)}function Bg(Nt,Vt,Jt){if(Jt&&typeof Jt!="boolean"&&Fa(Nt,Vt,Jt)&&(Vt=Jt=pr),Jt===pr&&(typeof Vt=="boolean"?(Jt=Vt,Vt=pr):typeof Nt=="boolean"&&(Jt=Nt,Nt=pr)),Nt===pr&&Vt===pr?(Nt=0,Vt=1):(Nt=Eo(Nt),Vt===pr?(Vt=Nt,Nt=0):Vt=Eo(Vt)),Nt>Vt){var cr=Nt;Nt=Vt,Vt=cr}if(Jt||Nt%1||Vt%1){var Er=wh();return Ta(Nt+Er*(Vt-Nt+z4("1e-"+((Er+"").length-1))),Vt)}return $3(Nt,Vt)}function mh(Nt){return Mp(vn(Nt).toLowerCase())}function gh(Nt){return Nt=vn(Nt),Nt&&Nt.replace(r2,$4).replace(N4,"")}function Pg(Nt,Vt,Jt){Nt=vn(Nt),Vt=hi(Vt);var cr=Nt.length;Jt=Jt===pr?cr:b1(nn(Jt),0,cr);var Er=Jt;return Jt-=Vt.length,Jt>=0&&Nt.slice(Jt,Er)==Vt}function Og(Nt){return Nt=vn(Nt),Nt&&Lr.test(Nt)?Nt.replace(br,q4):Nt}function Dg(Nt){return Nt=vn(Nt),Nt&&T0.test(Nt)?Nt.replace(d0,"\\$&"):Nt}function Ng(Nt,Vt,Jt){Nt=vn(Nt),Vt=nn(Vt);var cr=Vt?er(Nt):0;if(!Vt||cr>=Vt)return Nt;var Er=(Vt-cr)/2;return Id(Xd(Er),Jt)+Nt+Id(Wd(Er),Jt)}function Lg(Nt,Vt,Jt){Nt=vn(Nt),Vt=nn(Vt);var cr=Vt?er(Nt):0;return Vt&&cr<Vt?Nt+Id(Vt-cr,Jt):Nt}function _g(Nt,Vt,Jt){Nt=vn(Nt),Vt=nn(Vt);var cr=Vt?er(Nt):0;return Vt&&cr<Vt?Id(Vt-cr,Jt)+Nt:Nt}function Mg(Nt,Vt,Jt){return Jt||Vt==null?Vt=0:Vt&&(Vt=+Vt),P7(vn(Nt).replace(E0,""),Vt||0)}function jg(Nt,Vt,Jt){return Vt=(Jt?Fa(Nt,Vt,Jt):Vt===pr)?1:nn(Vt),q3(vn(Nt),Vt)}function Fg(){var Nt=arguments,Vt=vn(Nt[0]);return Nt.length<3?Vt:Vt.replace(Nt[1],Nt[2])}function Qg(Nt,Vt,Jt){return Jt&&typeof Jt!="number"&&Fa(Nt,Vt,Jt)&&(Vt=Jt=pr),(Jt=Jt===pr?U0:Jt>>>0)?(Nt=vn(Nt),Nt&&(typeof Vt=="string"||Vt!=null&&!_p(Vt))&&(Vt=hi(Vt),!Vt&&tr(Nt))?o2(nr(Nt),0,Jt):Nt.split(Vt,Jt)):[]}function Vg(Nt,Vt,Jt){return Nt=vn(Nt),Jt=Jt==null?0:b1(nn(Jt),0,Nt.length),Vt=hi(Vt),Nt.slice(Jt,Jt+Vt.length)==Vt}function Ug(Nt,Vt,Jt){var cr=mr.templateSettings;Jt&&Fa(Nt,Vt,Jt)&&(Vt=pr),Nt=vn(Nt),Vt=Yd({},Vt,cr,Mf);var Er,Sr,jr=Yd({},Vt.imports,cr.imports,Mf),Fr=ga(jr),Kr=_t(jr,Fr),l0=0,i0=Vt.interpolate||Ka,p0="__p += '",k0=Sp((Vt.escape||Ka).source+"|"+i0.source+"|"+(i0===Hr?Au:Ka).source+"|"+(Vt.evaluate||Ka).source+"|$","g"),B0="//# sourceURL="+(Sn.call(Vt,"sourceURL")?(Vt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++F4+"]")+`
|
|
2781
2781
|
`;Nt.replace(k0,function(F0,dn,pn,Pa,ti,d2){return pn||(pn=Pa),p0+=Nt.slice(l0,d2).replace(fi,Yt),dn&&(Er=!0,p0+=`' +
|
|
2782
2782
|
__e(`+dn+`) +
|
|
2783
2783
|
'`),ti&&(Sr=!0,p0+=`';
|
|
@@ -2794,7 +2794,7 @@ __p += '`),pn&&(p0+=`' +
|
|
|
2794
2794
|
function print() { __p += __j.call(arguments, '') }
|
|
2795
2795
|
`:`;
|
|
2796
2796
|
`)+p0+`return __p
|
|
2797
|
-
}`;var tn=Gh(function(){return yh(Fr,B0+"return "+p0).apply(pr,Kr)});if(tn.source=p0,gp(tn))throw tn;return tn}function H8(Nt){return vn(Nt).toLowerCase()}function G8(Nt){return vn(Nt).toUpperCase()}function z8(Nt,Vt,Jt){if(Nt=vn(Nt),Nt&&(Jt||Vt===pr))return Ft(Nt);if(!Nt||!(Vt=hi(Vt)))return Nt;var cr=nr(Nt),Er=nr(Vt);return o2(cr,jt(cr,Er),zt(cr,Er)+1).join("")}function W8(Nt,Vt,Jt){if(Nt=vn(Nt),Nt&&(Jt||Vt===pr))return Nt.slice(0,lr(Nt)+1);if(!Nt||!(Vt=hi(Vt)))return Nt;var cr=nr(Nt);return o2(cr,0,zt(cr,nr(Vt))+1).join("")}function X8(Nt,Vt,Jt){if(Nt=vn(Nt),Nt&&(Jt||Vt===pr))return Nt.replace(E0,"");if(!Nt||!(Vt=hi(Vt)))return Nt;var cr=nr(Nt);return o2(cr,jt(cr,nr(Vt))).join("")}function K8(Nt,Vt){var Jt=N0,cr=J0;if(Wn(Vt)){var Er="separator"in Vt?Vt.separator:Er;Jt="length"in Vt?nn(Vt.length):Jt,cr="omission"in Vt?hi(Vt.omission):cr}Nt=vn(Nt);var Sr=Nt.length;if(tr(Nt)){var jr=nr(Nt);Sr=jr.length}if(Jt>=Sr)return Nt;var Fr=Jt-er(cr);if(Fr<1)return cr;var Kr=jr?o2(jr,0,Fr).join(""):Nt.slice(0,Fr);if(Er===pr)return Kr+cr;if(jr&&(Fr+=Kr.length-Fr),_p(Er)){if(Nt.slice(Fr).search(Er)){var l0,i0=Kr;for(Er.global||(Er=Sp(Er.source,vn(e2.exec(Er))+"g")),Er.lastIndex=0;l0=Er.exec(i0);)var p0=l0.index;Kr=Kr.slice(0,p0===pr?Fr:p0)}}else if(Nt.indexOf(hi(Er),Fr)!=Fr){var k0=Kr.lastIndexOf(Er);k0>-1&&(Kr=Kr.slice(0,k0))}return Kr+cr}function $8(Nt){return Nt=vn(Nt),Nt&&Br.test(Nt)?Nt.replace(Ar,Y4):Nt}function Ah(Nt,Vt,Jt){return Nt=vn(Nt),Vt=Jt?pr:Vt,Vt===pr?sr(Nt)?xr(Nt):wt(Nt):Nt.match(Vt)||[]}function q8(Nt){var Vt=Nt==null?0:Nt.length,Jt=z0();return Nt=Vt?yt(Nt,function(cr){if(typeof cr[1]!="function")throw new Ni(qr);return[Jt(cr[0]),cr[1]]}):[],cn(function(cr){for(var Er=-1;++Er<Vt;){var Sr=Nt[Er];if(Ye(Sr[0],this,cr))return Ye(Sr[1],this,cr)}})}function Y8(Nt){return S6(Bi(Nt,Or))}function yp(Nt){return function(){return Nt}}function Z8(Nt,Vt){return Nt==null||Nt!==Nt?Vt:Nt}function ei(Nt){return Nt}function Ep(Nt){return uf(typeof Nt=="function"?Nt:Bi(Nt,Or))}function J8(Nt){return pf(Bi(Nt,Or))}function e7(Nt,Vt){return ff(Nt,Bi(Vt,Or))}function Cp(Nt,Vt,Jt){var cr=ga(Vt),Er=xd(Vt,cr);Jt!=null||Wn(Vt)&&(Er.length||!cr.length)||(Jt=Vt,Vt=Nt,Nt=this,Er=xd(Vt,ga(Vt)));var Sr=!(Wn(Jt)&&"chain"in Jt&&!Jt.chain),jr=yo(Nt);return nt(Er,function(Fr){var Kr=Vt[Fr];Nt[Fr]=Kr,jr&&(Nt.prototype[Fr]=function(){var l0=this.__chain__;if(Sr||l0){var i0=Nt(this.__wrapped__);return(i0.__actions__=Ya(this.__actions__)).push({func:Kr,args:arguments,thisArg:Nt}),i0.__chain__=l0,i0}return Kr.apply(Nt,Ct([this.value()],arguments))})}),Nt}function t7(){return ka._===this&&(ka._=v7),this}function vp(){}function r7(Nt){return Nt=nn(Nt),cn(function(Vt){return hf(Vt,Nt)})}function xh(Nt){return up(Nt)?Ot(Ps(Nt)):H6(Nt)}function n7(Nt){return function(Vt){return Nt==null?pr:I1(Nt,Vt)}}function kp(){return[]}function bp(){return!1}function a7(){return{}}function i7(){return""}function s7(){return!0}function o7(Nt,Vt){if(Nt=nn(Nt),Nt<1||Nt>u0)return[];var Jt=U0,cr=Ta(Nt,U0);Vt=z0(Vt),Nt-=U0;for(var Er=Ht(cr,Vt);++Jt<Nt;)Vt(Jt);return Er}function l7(Nt){return Y0(Nt)?yt(Nt,Ps):mi(Nt)?[Nt]:Ya(Lh(vn(Nt)))}function c7(Nt){var Vt=++E7;return vn(Nt)+Vt}function u7(Nt){return Nt&&Nt.length?Ad(Nt,ei,H3):pr}function d7(Nt,Vt){return Nt&&Nt.length?Ad(Nt,z0(Vt,2),H3):pr}function p7(Nt){return Dt(Nt,ei)}function f7(Nt,Vt){return Dt(Nt,z0(Vt,2))}function h7(Nt){return Nt&&Nt.length?Ad(Nt,ei,X3):pr}function m7(Nt,Vt){return Nt&&Nt.length?Ad(Nt,z0(Vt,2),X3):pr}function g7(Nt){return Nt&&Nt.length?qt(Nt,ei):0}function A7(Nt,Vt){return Nt&&Nt.length?qt(Nt,z0(Vt,2)):0}a0=a0==null?ka:_l.defaults(ka.Object(),a0,_l.pick(ka,j4));var la=a0.Array,_d=a0.Date,Ip=a0.Error,yh=a0.Function,Vl=a0.Math,jn=a0.Object,Sp=a0.RegExp,x7=a0.String,Ni=a0.TypeError,Md=la.prototype,y7=yh.prototype,Ul=jn.prototype,jd=a0["__core-js_shared__"],Fd=y7.toString,Sn=Ul.hasOwnProperty,E7=0,Eh=function(){var Nt=/[^.]+$/.exec(jd&&jd.keys&&jd.keys.IE_PROTO||"");return Nt?"Symbol(src)_1."+Nt:""}(),Qd=Ul.toString,C7=Fd.call(jn),v7=ka._,k7=Sp("^"+Fd.call(Sn).replace(d0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vd=X9?a0.Buffer:pr,l2=a0.Symbol,Ud=a0.Uint8Array,Ch=Vd?Vd.allocUnsafe:pr,Hd=gr(jn.getPrototypeOf,jn),kh=jn.create,bh=Ul.propertyIsEnumerable,Gd=Md.splice,Ih=l2?l2.isConcatSpreadable:pr,wu=l2?l2.iterator:pr,R1=l2?l2.toStringTag:pr,zd=function(){try{var Nt=S1(jn,"defineProperty");return Nt({},"",{}),Nt}catch{}}(),b7=a0.clearTimeout!==ka.clearTimeout&&a0.clearTimeout,I7=_d&&_d.now!==ka.Date.now&&_d.now,S7=a0.setTimeout!==ka.setTimeout&&a0.setTimeout,Wd=Vl.ceil,Xd=Vl.floor,wp=jn.getOwnPropertySymbols,w7=Vd?Vd.isBuffer:pr,Sh=a0.isFinite,R7=Md.join,T7=gr(jn.keys,jn),ua=Vl.max,Ta=Vl.min,B7=_d.now,P7=a0.parseInt,wh=Vl.random,O7=Md.reverse,Rp=S1(a0,"DataView"),Ru=S1(a0,"Map"),Tp=S1(a0,"Promise"),Hl=S1(a0,"Set"),Tu=S1(a0,"WeakMap"),Bu=S1(jn,"create"),Kd=Tu&&new Tu,Gl={},D7=w1(Rp),N7=w1(Ru),L7=w1(Tp),_7=w1(Hl),M7=w1(Tu),$d=l2?l2.prototype:pr,Pu=$d?$d.valueOf:pr,Rh=$d?$d.toString:pr,zl=function(){function Nt(){}return function(Vt){if(!Wn(Vt))return{};if(kh)return kh(Vt);Nt.prototype=Vt;var Jt=new Nt;return Nt.prototype=pr,Jt}}();mr.templateSettings={escape:Gr,evaluate:Xr,interpolate:Hr,variable:"",imports:{_:mr}},mr.prototype=S0.prototype,mr.prototype.constructor=mr,Q0.prototype=zl(S0.prototype),Q0.prototype.constructor=Q0,R0.prototype=zl(S0.prototype),R0.prototype.constructor=R0,C1.prototype.clear=e6,C1.prototype.delete=t6,C1.prototype.get=r6,C1.prototype.has=n6,C1.prototype.set=a6,fo.prototype.clear=i6,fo.prototype.delete=s6,fo.prototype.get=o6,fo.prototype.has=l6,fo.prototype.set=c6,ho.prototype.clear=u6,ho.prototype.delete=d6,ho.prototype.get=p6,ho.prototype.has=f6,ho.prototype.set=h6,k1.prototype.add=k1.prototype.push=m6,k1.prototype.has=g6,as.prototype.clear=A6,as.prototype.delete=x6,as.prototype.get=y6,as.prototype.has=E6,as.prototype.set=C6;var c2=Rf(Ts),Th=Rf(U3,!0),Bp=Tf(),Bh=Tf(!0),Ph=Kd?function(Nt,Vt){return Kd.set(Nt,Vt),Nt}:ei,j7=zd?function(Nt,Vt){return zd(Nt,"toString",{configurable:!0,enumerable:!1,value:yp(Vt),writable:!0})}:ei,F7=cn,Oh=b7||function(Nt){return ka.clearTimeout(Nt)},Q7=Hl&&1/or(new Hl([,-0]))[1]==H0?function(Nt){return new Hl(Nt)}:vp,Pp=Kd?function(Nt){return Kd.get(Nt)}:vp,Op=wp?function(Nt){return Nt==null?[]:(Nt=jn(Nt),gt(wp(Nt),function(Vt){return bh.call(Nt,Vt)}))}:kp,Dh=wp?function(Nt){for(var Vt=[];Nt;)Ct(Vt,Op(Nt)),Nt=Hd(Nt);return Vt}:kp,Ba=ja;(Rp&&Ba(new Rp(new ArrayBuffer(1)))!=Ji||Ru&&Ba(new Ru)!=fn||Tp&&Ba(Tp.resolve())!=zn||Hl&&Ba(new Hl)!=sa||Tu&&Ba(new Tu)!=Ma)&&(Ba=function(Nt){var Vt=ja(Nt),Jt=Vt==Gn?Nt.constructor:pr,cr=Jt?w1(Jt):"";if(cr)switch(cr){case D7:return Ji;case N7:return fn;case L7:return zn;case _7:return sa;case M7:return Ma}return Vt});var V7=jd?yo:bp,Nh=Xf(Ph),Ou=S7||function(Nt,Vt){return ka.setTimeout(Nt,Vt)},Dp=Xf(j7),Lh=Am(function(Nt){var Vt=[];return Nt.charCodeAt(0)===46&&Vt.push(""),Nt.replace(o0,function(Jt,cr,Er,Sr){Vt.push(Er?Sr.replace(Zn,"$1"):cr||Jt)}),Vt}),U7=cn(function(Nt,Vt){return Jn(Nt)?Eu(Nt,ba(Vt,1,Jn,!0)):[]}),H7=cn(function(Nt,Vt){var Jt=Oi(Vt);return Jn(Jt)&&(Jt=pr),Jn(Nt)?Eu(Nt,ba(Vt,1,Jn,!0),z0(Jt,2)):[]}),G7=cn(function(Nt,Vt){var Jt=Oi(Vt);return Jn(Jt)&&(Jt=pr),Jn(Nt)?Eu(Nt,ba(Vt,1,Jn,!0),pr,Jt):[]}),z7=cn(function(Nt){var Vt=yt(Nt,ep);return Vt.length&&Vt[0]===Nt[0]?G3(Vt):[]}),W7=cn(function(Nt){var Vt=Oi(Nt),Jt=yt(Nt,ep);return Vt===Oi(Jt)?Vt=pr:Jt.pop(),Jt.length&&Jt[0]===Nt[0]?G3(Jt,z0(Vt,2)):[]}),X7=cn(function(Nt){var Vt=Oi(Nt),Jt=yt(Nt,ep);return Vt=typeof Vt=="function"?Vt:pr,Vt&&Jt.pop(),Jt.length&&Jt[0]===Nt[0]?G3(Jt,pr,Vt):[]}),K7=cn(Jf),$7=Ao(function(Nt,Vt){var Jt=Nt==null?0:Nt.length,cr=Q3(Nt,Vt);return Af(Nt,yt(Vt,function(Er){return xo(Er,Jt)?+Er:Er}).sort(If)),cr}),q7=cn(function(Nt){return i2(ba(Nt,1,Jn,!0))}),Y7=cn(function(Nt){var Vt=Oi(Nt);return Jn(Vt)&&(Vt=pr),i2(ba(Nt,1,Jn,!0),z0(Vt,2))}),Z7=cn(function(Nt){var Vt=Oi(Nt);return Vt=typeof Vt=="function"?Vt:pr,i2(ba(Nt,1,Jn,!0),pr,Vt)}),J7=cn(function(Nt,Vt){return Jn(Nt)?Eu(Nt,Vt):[]}),eA=cn(function(Nt){return J3(gt(Nt,Jn))}),tA=cn(function(Nt){var Vt=Oi(Nt);return Jn(Vt)&&(Vt=pr),J3(gt(Nt,Jn),z0(Vt,2))}),rA=cn(function(Nt){var Vt=Oi(Nt);return Vt=typeof Vt=="function"?Vt:pr,J3(gt(Nt,Jn),pr,Vt)}),nA=cn(mp),aA=cn(function(Nt){var Vt=Nt.length,Jt=Vt>1?Nt[Vt-1]:pr;return Jt=typeof Jt=="function"?(Nt.pop(),Jt):pr,eh(Nt,Jt)}),iA=Ao(function(Nt){var Vt=Nt.length,Jt=Vt?Nt[0]:0,cr=this.__wrapped__,Er=function(Sr){return Q3(Sr,Nt)};return!(Vt>1||this.__actions__.length)&&cr instanceof R0&&xo(Jt)?(cr=cr.slice(Jt,+Jt+(Vt?1:0)),cr.__actions__.push({func:Bd,args:[Er],thisArg:pr}),new Q0(cr,this.__chain__).thru(function(Sr){return Vt&&!Sr.length&&Sr.push(pr),Sr})):this.thru(Er)}),sA=vd(function(Nt,Vt,Jt){Sn.call(Nt,Jt)?++Nt[Jt]:mo(Nt,Jt,1)}),oA=Pf($f),lA=Pf(qf),cA=vd(function(Nt,Vt,Jt){Sn.call(Nt,Jt)?Nt[Jt].push(Vt):mo(Nt,Jt,[Vt])}),uA=cn(function(Nt,Vt,Jt){var cr=-1,Er=typeof Vt=="function",Sr=Za(Nt)?la(Nt.length):[];return c2(Nt,function(jr){Sr[++cr]=Er?Ye(Vt,jr,Jt):Cu(jr,Vt,Jt)}),Sr}),dA=vd(function(Nt,Vt,Jt){mo(Nt,Jt,Vt)}),pA=vd(function(Nt,Vt,Jt){Nt[Jt?0:1].push(Vt)},function(){return[[],[]]}),fA=cn(function(Nt,Vt){if(Nt==null)return[];var Jt=Vt.length;return Jt>1&&Fa(Nt,Vt[0],Vt[1])?Vt=[]:Jt>2&&Fa(Vt[0],Vt[1],Vt[2])&&(Vt=[Vt[0]]),mf(Nt,ba(Vt,1),[])}),qd=I7||function(){return ka.Date.now()},Np=cn(function(Nt,Vt,Jt){var cr=wr;if(Jt.length){var Er=yr(Jt,Fl(Np));cr|=t0}return go(Nt,cr,Vt,Jt,Er)}),_h=cn(function(Nt,Vt,Jt){var cr=wr|Tr;if(Jt.length){var Er=yr(Jt,Fl(_h));cr|=t0}return go(Vt,cr,Nt,Jt,Er)}),hA=cn(function(Nt,Vt){return af(Nt,1,Vt)}),mA=cn(function(Nt,Vt,Jt){return af(Nt,Di(Vt)||0,Jt)});Od.Cache=ho;var gA=F7(function(Nt,Vt){Vt=Vt.length==1&&Y0(Vt[0])?yt(Vt[0],Xt(z0())):yt(ba(Vt,1),Xt(z0()));var Jt=Vt.length;return cn(function(cr){for(var Er=-1,Sr=Ta(cr.length,Jt);++Er<Sr;)cr[Er]=Vt[Er].call(this,cr[Er]);return Ye(Nt,this,cr)})}),Lp=cn(function(Nt,Vt){return go(Nt,t0,pr,Vt,yr(Vt,Fl(Lp)))}),Mh=cn(function(Nt,Vt){return go(Nt,h0,pr,Vt,yr(Vt,Fl(Mh)))}),AA=Ao(function(Nt,Vt){return go(Nt,m0,pr,pr,pr,Vt)}),xA=Sd(H3),yA=Sd(function(Nt,Vt){return Nt>=Vt}),T1=lf(function(){return arguments}())?lf:function(Nt){return $n(Nt)&&Sn.call(Nt,"callee")&&!bh.call(Nt,"callee")},Y0=la.isArray,EA=K9?Xt(K9):D6,u2=w7||bp,CA=$9?Xt($9):N6,jh=q9?Xt(q9):_6,_p=Y9?Xt(Y9):M6,Fh=Z9?Xt(Z9):j6,Wl=J9?Xt(J9):F6,vA=Sd(X3),kA=Sd(function(Nt,Vt){return Nt<=Vt}),bA=Ml(function(Nt,Vt){if(Iu(Vt)||Za(Vt))return Bs(Vt,ga(Vt),Nt),pr;for(var Jt in Vt)Sn.call(Vt,Jt)&&yu(Nt,Jt,Vt[Jt])}),Qh=Ml(function(Nt,Vt){Bs(Vt,Ja(Vt),Nt)}),Yd=Ml(function(Nt,Vt,Jt,cr){Bs(Vt,Ja(Vt),Nt,cr)}),IA=Ml(function(Nt,Vt,Jt,cr){Bs(Vt,ga(Vt),Nt,cr)}),SA=Ao(Q3),wA=cn(function(Nt,Vt){Nt=jn(Nt);var Jt=-1,cr=Vt.length,Er=cr>2?Vt[2]:pr;for(Er&&Fa(Vt[0],Vt[1],Er)&&(cr=1);++Jt<cr;)for(var Sr=Vt[Jt],jr=Ja(Sr),Fr=-1,Kr=jr.length;++Fr<Kr;){var l0=jr[Fr],i0=Nt[l0];(i0===pr||is(i0,Ul[l0])&&!Sn.call(Nt,l0))&&(Nt[l0]=Sr[l0])}return Nt}),RA=cn(function(Nt){return Nt.push(pr,jf),Ye(Vh,pr,Nt)}),TA=Df(function(Nt,Vt,Jt){Vt!=null&&typeof Vt.toString!="function"&&(Vt=Qd.call(Vt)),Nt[Vt]=Jt},yp(ei)),BA=Df(function(Nt,Vt,Jt){Vt!=null&&typeof Vt.toString!="function"&&(Vt=Qd.call(Vt)),Sn.call(Nt,Vt)?Nt[Vt].push(Jt):Nt[Vt]=[Jt]},z0),PA=cn(Cu),OA=Ml(function(Nt,Vt,Jt){yd(Nt,Vt,Jt)}),Vh=Ml(function(Nt,Vt,Jt,cr){yd(Nt,Vt,Jt,cr)}),DA=Ao(function(Nt,Vt){var Jt={};if(Nt==null)return Jt;var cr=!1;Vt=yt(Vt,function(Sr){return Sr=s2(Sr,Nt),cr||(cr=Sr.length>1),Sr}),Bs(Nt,lp(Nt),Jt),cr&&(Jt=Bi(Jt,Or|Vr|Yr,im));for(var Er=Vt.length;Er--;)Z3(Jt,Vt[Er]);return Jt}),NA=Ao(function(Nt,Vt){return Nt==null?{}:U6(Nt,Vt)}),Uh=_f(ga),Hh=_f(Ja),LA=jl(function(Nt,Vt,Jt){return Vt=Vt.toLowerCase(),Nt+(Jt?mh(Vt):Vt)}),_A=jl(function(Nt,Vt,Jt){return Nt+(Jt?"-":"")+Vt.toLowerCase()}),MA=jl(function(Nt,Vt,Jt){return Nt+(Jt?" ":"")+Vt.toLowerCase()}),jA=Bf("toLowerCase"),FA=jl(function(Nt,Vt,Jt){return Nt+(Jt?"_":"")+Vt.toLowerCase()}),QA=jl(function(Nt,Vt,Jt){return Nt+(Jt?" ":"")+Mp(Vt)}),VA=jl(function(Nt,Vt,Jt){return Nt+(Jt?" ":"")+Vt.toUpperCase()}),Mp=Bf("toUpperCase"),Gh=cn(function(Nt,Vt){try{return Ye(Nt,pr,Vt)}catch(Jt){return gp(Jt)?Jt:new Ip(Jt)}}),UA=Ao(function(Nt,Vt){return nt(Vt,function(Jt){Jt=Ps(Jt),mo(Nt,Jt,Np(Nt[Jt],Nt))}),Nt}),HA=Of(),GA=Of(!0),zA=cn(function(Nt,Vt){return function(Jt){return Cu(Jt,Nt,Vt)}}),WA=cn(function(Nt,Vt){return function(Jt){return Cu(Nt,Jt,Vt)}}),XA=np(yt),KA=np(ht),$A=np(kt),qA=Nf(),YA=Nf(!0),ZA=bd(function(Nt,Vt){return Nt+Vt},0),JA=ap("ceil"),ex=bd(function(Nt,Vt){return Nt/Vt},1),tx=ap("floor"),rx=bd(function(Nt,Vt){return Nt*Vt},1),nx=ap("round"),ax=bd(function(Nt,Vt){return Nt-Vt},0);return mr.after=Bg,mr.ary=ah,mr.assign=bA,mr.assignIn=Qh,mr.assignInWith=Yd,mr.assignWith=IA,mr.at=SA,mr.before=ih,mr.bind=Np,mr.bindAll=UA,mr.bindKey=_h,mr.castArray=jg,mr.chain=th,mr.chunk=km,mr.compact=bm,mr.concat=Im,mr.cond=q8,mr.conforms=Y8,mr.constant=yp,mr.countBy=sA,mr.create=o8,mr.curry=sh,mr.curryRight=oh,mr.debounce=lh,mr.defaults=wA,mr.defaultsDeep=RA,mr.defer=hA,mr.delay=mA,mr.difference=U7,mr.differenceBy=H7,mr.differenceWith=G7,mr.drop=Sm,mr.dropRight=wm,mr.dropRightWhile=Rm,mr.dropWhile=Tm,mr.fill=Bm,mr.filter=gg,mr.flatMap=Ag,mr.flatMapDeep=xg,mr.flatMapDepth=yg,mr.flatten=Yf,mr.flattenDeep=Pm,mr.flattenDepth=Om,mr.flip=Pg,mr.flow=HA,mr.flowRight=GA,mr.fromPairs=Dm,mr.functions=h8,mr.functionsIn=m8,mr.groupBy=cA,mr.initial=Lm,mr.intersection=z7,mr.intersectionBy=W7,mr.intersectionWith=X7,mr.invert=TA,mr.invertBy=BA,mr.invokeMap=uA,mr.iteratee=Ep,mr.keyBy=dA,mr.keys=ga,mr.keysIn=Ja,mr.map=Pd,mr.mapKeys=A8,mr.mapValues=x8,mr.matches=J8,mr.matchesProperty=e7,mr.memoize=Od,mr.merge=OA,mr.mergeWith=Vh,mr.method=zA,mr.methodOf=WA,mr.mixin=Cp,mr.negate=Dd,mr.nthArg=r7,mr.omit=DA,mr.omitBy=y8,mr.once=Og,mr.orderBy=Cg,mr.over=XA,mr.overArgs=gA,mr.overEvery=KA,mr.overSome=$A,mr.partial=Lp,mr.partialRight=Mh,mr.partition=pA,mr.pick=NA,mr.pickBy=hh,mr.property=xh,mr.propertyOf=n7,mr.pull=K7,mr.pullAll=Jf,mr.pullAllBy=Fm,mr.pullAllWith=Qm,mr.pullAt=$7,mr.range=qA,mr.rangeRight=YA,mr.rearg=AA,mr.reject=bg,mr.remove=Vm,mr.rest=Dg,mr.reverse=hp,mr.sampleSize=Sg,mr.set=C8,mr.setWith=v8,mr.shuffle=wg,mr.slice=Um,mr.sortBy=fA,mr.sortedUniq=$m,mr.sortedUniqBy=qm,mr.split=Q8,mr.spread=Ng,mr.tail=Ym,mr.take=Zm,mr.takeRight=Jm,mr.takeRightWhile=eg,mr.takeWhile=tg,mr.tap=og,mr.throttle=Lg,mr.thru=Bd,mr.toArray=dh,mr.toPairs=Uh,mr.toPairsIn=Hh,mr.toPath=l7,mr.toPlainObject=fh,mr.transform=k8,mr.unary=_g,mr.union=q7,mr.unionBy=Y7,mr.unionWith=Z7,mr.uniq=rg,mr.uniqBy=ng,mr.uniqWith=ag,mr.unset=b8,mr.unzip=mp,mr.unzipWith=eh,mr.update=I8,mr.updateWith=S8,mr.values=Ql,mr.valuesIn=w8,mr.without=J7,mr.words=Ah,mr.wrap=Mg,mr.xor=eA,mr.xorBy=tA,mr.xorWith=rA,mr.zip=nA,mr.zipObject=ig,mr.zipObjectDeep=sg,mr.zipWith=aA,mr.entries=Uh,mr.entriesIn=Hh,mr.extend=Qh,mr.extendWith=Yd,Cp(mr,mr),mr.add=ZA,mr.attempt=Gh,mr.camelCase=LA,mr.capitalize=mh,mr.ceil=JA,mr.clamp=R8,mr.clone=Fg,mr.cloneDeep=Vg,mr.cloneDeepWith=Ug,mr.cloneWith=Qg,mr.conformsTo=Hg,mr.deburr=gh,mr.defaultTo=Z8,mr.divide=ex,mr.endsWith=P8,mr.eq=is,mr.escape=O8,mr.escapeRegExp=D8,mr.every=mg,mr.find=oA,mr.findIndex=$f,mr.findKey=l8,mr.findLast=lA,mr.findLastIndex=qf,mr.findLastKey=c8,mr.floor=tx,mr.forEach=rh,mr.forEachRight=nh,mr.forIn=u8,mr.forInRight=d8,mr.forOwn=p8,mr.forOwnRight=f8,mr.get=Ap,mr.gt=xA,mr.gte=yA,mr.has=g8,mr.hasIn=xp,mr.head=Zf,mr.identity=ei,mr.includes=Eg,mr.indexOf=Nm,mr.inRange=T8,mr.invoke=PA,mr.isArguments=T1,mr.isArray=Y0,mr.isArrayBuffer=EA,mr.isArrayLike=Za,mr.isArrayLikeObject=Jn,mr.isBoolean=Gg,mr.isBuffer=u2,mr.isDate=CA,mr.isElement=zg,mr.isEmpty=Wg,mr.isEqual=Xg,mr.isEqualWith=Kg,mr.isError=gp,mr.isFinite=$g,mr.isFunction=yo,mr.isInteger=ch,mr.isLength=Nd,mr.isMap=jh,mr.isMatch=qg,mr.isMatchWith=Yg,mr.isNaN=Zg,mr.isNative=Jg,mr.isNil=t8,mr.isNull=e8,mr.isNumber=uh,mr.isObject=Wn,mr.isObjectLike=$n,mr.isPlainObject=Su,mr.isRegExp=_p,mr.isSafeInteger=r8,mr.isSet=Fh,mr.isString=Ld,mr.isSymbol=mi,mr.isTypedArray=Wl,mr.isUndefined=n8,mr.isWeakMap=a8,mr.isWeakSet=i8,mr.join=_m,mr.kebabCase=_A,mr.last=Oi,mr.lastIndexOf=Mm,mr.lowerCase=MA,mr.lowerFirst=jA,mr.lt=vA,mr.lte=kA,mr.max=u7,mr.maxBy=d7,mr.mean=p7,mr.meanBy=f7,mr.min=h7,mr.minBy=m7,mr.stubArray=kp,mr.stubFalse=bp,mr.stubObject=a7,mr.stubString=i7,mr.stubTrue=s7,mr.multiply=rx,mr.nth=jm,mr.noConflict=t7,mr.noop=vp,mr.now=qd,mr.pad=N8,mr.padEnd=L8,mr.padStart=_8,mr.parseInt=M8,mr.random=B8,mr.reduce=vg,mr.reduceRight=kg,mr.repeat=j8,mr.replace=F8,mr.result=E8,mr.round=nx,mr.runInContext=Ur,mr.sample=Ig,mr.size=Rg,mr.snakeCase=FA,mr.some=Tg,mr.sortedIndex=Hm,mr.sortedIndexBy=Gm,mr.sortedIndexOf=zm,mr.sortedLastIndex=Wm,mr.sortedLastIndexBy=Xm,mr.sortedLastIndexOf=Km,mr.startCase=QA,mr.startsWith=V8,mr.subtract=ax,mr.sum=g7,mr.sumBy=A7,mr.template=U8,mr.times=o7,mr.toFinite=Eo,mr.toInteger=nn,mr.toLength=ph,mr.toLower=H8,mr.toNumber=Di,mr.toSafeInteger=s8,mr.toString=vn,mr.toUpper=G8,mr.trim=z8,mr.trimEnd=W8,mr.trimStart=X8,mr.truncate=K8,mr.unescape=$8,mr.uniqueId=c7,mr.upperCase=VA,mr.upperFirst=Mp,mr.each=rh,mr.eachRight=nh,mr.first=Zf,Cp(mr,function(){var Nt={};return Ts(mr,function(Vt,Jt){Sn.call(mr.prototype,Jt)||(Nt[Jt]=Vt)}),Nt}(),{chain:!1}),mr.VERSION=Mr,nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(Nt){mr[Nt].placeholder=mr}),nt(["drop","take"],function(Nt,Vt){R0.prototype[Nt]=function(Jt){Jt=Jt===pr?1:ua(nn(Jt),0);var cr=this.__filtered__&&!Vt?new R0(this):this.clone();return cr.__filtered__?cr.__takeCount__=Ta(Jt,cr.__takeCount__):cr.__views__.push({size:Ta(Jt,U0),type:Nt+(cr.__dir__<0?"Right":"")}),cr},R0.prototype[Nt+"Right"]=function(Jt){return this.reverse()[Nt](Jt).reverse()}}),nt(["filter","map","takeWhile"],function(Nt,Vt){var Jt=Vt+1,cr=Jt==rn||Jt==$0;R0.prototype[Nt]=function(Er){var Sr=this.clone();return Sr.__iteratees__.push({iteratee:z0(Er,3),type:Jt}),Sr.__filtered__=Sr.__filtered__||cr,Sr}}),nt(["head","last"],function(Nt,Vt){var Jt="take"+(Vt?"Right":"");R0.prototype[Nt]=function(){return this[Jt](1).value()[0]}}),nt(["initial","tail"],function(Nt,Vt){var Jt="drop"+(Vt?"":"Right");R0.prototype[Nt]=function(){return this.__filtered__?new R0(this):this[Jt](1)}}),R0.prototype.compact=function(){return this.filter(ei)},R0.prototype.find=function(Nt){return this.filter(Nt).head()},R0.prototype.findLast=function(Nt){return this.reverse().find(Nt)},R0.prototype.invokeMap=cn(function(Nt,Vt){return typeof Nt=="function"?new R0(this):this.map(function(Jt){return Cu(Jt,Nt,Vt)})}),R0.prototype.reject=function(Nt){return this.filter(Dd(z0(Nt)))},R0.prototype.slice=function(Nt,Vt){Nt=nn(Nt);var Jt=this;return Jt.__filtered__&&(Nt>0||Vt<0)?new R0(Jt):(Nt<0?Jt=Jt.takeRight(-Nt):Nt&&(Jt=Jt.drop(Nt)),Vt!==pr&&(Vt=nn(Vt),Jt=Vt<0?Jt.dropRight(-Vt):Jt.take(Vt-Nt)),Jt)},R0.prototype.takeRightWhile=function(Nt){return this.reverse().takeWhile(Nt).reverse()},R0.prototype.toArray=function(){return this.take(U0)},Ts(R0.prototype,function(Nt,Vt){var Jt=/^(?:filter|find|map|reject)|While$/.test(Vt),cr=/^(?:head|last)$/.test(Vt),Er=mr[cr?"take"+(Vt=="last"?"Right":""):Vt],Sr=cr||/^find/.test(Vt);Er&&(mr.prototype[Vt]=function(){var jr=this.__wrapped__,Fr=cr?[1]:arguments,Kr=jr instanceof R0,l0=Fr[0],i0=Kr||Y0(jr),p0=function(dn){var pn=Er.apply(mr,Ct([dn],Fr));return cr&&k0?pn[0]:pn};i0&&Jt&&typeof l0=="function"&&l0.length!=1&&(Kr=i0=!1);var k0=this.__chain__,B0=!!this.__actions__.length,M0=Sr&&!k0,tn=Kr&&!B0;if(!Sr&&i0){jr=tn?jr:new R0(this);var F0=Nt.apply(jr,Fr);return F0.__actions__.push({func:Bd,args:[p0],thisArg:pr}),new Q0(F0,k0)}return M0&&tn?Nt.apply(this,Fr):(F0=this.thru(p0),M0?cr?F0.value()[0]:F0.value():F0)})}),nt(["pop","push","shift","sort","splice","unshift"],function(Nt){var Vt=Md[Nt],Jt=/^(?:push|sort|unshift)$/.test(Nt)?"tap":"thru",cr=/^(?:pop|shift)$/.test(Nt);mr.prototype[Nt]=function(){var Er=arguments;if(cr&&!this.__chain__){var Sr=this.value();return Vt.apply(Y0(Sr)?Sr:[],Er)}return this[Jt](function(jr){return Vt.apply(Y0(jr)?jr:[],Er)})}}),Ts(R0.prototype,function(Nt,Vt){var Jt=mr[Vt];if(Jt){var cr=Jt.name+"";Sn.call(Gl,cr)||(Gl[cr]=[]),Gl[cr].push({name:Vt,func:Jt})}}),Gl[kd(pr,Tr).name]=[{name:"wrapper",func:pr}],R0.prototype.clone=qa,R0.prototype.reverse=j3,R0.prototype.value=J4,mr.prototype.at=iA,mr.prototype.chain=lg,mr.prototype.commit=cg,mr.prototype.next=ug,mr.prototype.plant=pg,mr.prototype.reverse=fg,mr.prototype.toJSON=mr.prototype.valueOf=mr.prototype.value=hg,mr.prototype.first=mr.prototype.head,wu&&(mr.prototype[wu]=dg),mr},_l=Z4();E1?((E1.exports=_l)._=_l,_3._=_l):ka._=_l}).call(commonjsGlobal)}(lodash_min,lodash_min.exports);var lodash_minExports=lodash_min.exports,_mapping={};(function(Be){Be.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},Be.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},Be.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},Be.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},Be.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},Be.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},Be.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},Be.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},Be.realToAlias=function(){var Le=Object.prototype.hasOwnProperty,Ye=Be.aliasToReal,tt={};for(var nt in Ye){var ft=Ye[nt];Le.call(tt,ft)?tt[ft].push(nt):tt[ft]=[nt]}return tt}(),Be.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},Be.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},Be.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(_mapping);var placeholder$1={},mapping=_mapping,fallbackHolder=placeholder$1,push$1=Array.prototype.push;function baseArity(Be,Le){return Le==2?function(Ye,tt){return Be.apply(void 0,arguments)}:function(Ye){return Be.apply(void 0,arguments)}}function baseAry(Be,Le){return Le==2?function(Ye,tt){return Be(Ye,tt)}:function(Ye){return Be(Ye)}}function cloneArray(Be){for(var Le=Be?Be.length:0,Ye=Array(Le);Le--;)Ye[Le]=Be[Le];return Ye}function createCloner(Be){return function(Le){return Be({},Le)}}function flatSpread(Be,Le){return function(){for(var Ye=arguments.length,tt=Ye-1,nt=Array(Ye);Ye--;)nt[Ye]=arguments[Ye];var ft=nt[Le],ht=nt.slice(0,Le);return ft&&push$1.apply(ht,ft),Le!=tt&&push$1.apply(ht,nt.slice(Le+1)),Be.apply(this,ht)}}function wrapImmutable(Be,Le){return function(){var Ye=arguments.length;if(Ye){for(var tt=Array(Ye);Ye--;)tt[Ye]=arguments[Ye];var nt=tt[0]=Le.apply(void 0,tt);return Be.apply(void 0,tt),nt}}}function baseConvert(Be,Le,Ye,tt){var nt=typeof Le=="function",ft=Le===Object(Le);if(ft&&(tt=Ye,Ye=Le,Le=void 0),Ye==null)throw new TypeError;tt||(tt={});var ht={cap:"cap"in tt?tt.cap:!0,curry:"curry"in tt?tt.curry:!0,fixed:"fixed"in tt?tt.fixed:!0,immutable:"immutable"in tt?tt.immutable:!0,rearg:"rearg"in tt?tt.rearg:!0},gt=nt?Ye:fallbackHolder,At="curry"in tt&&tt.curry,xt="fixed"in tt&&tt.fixed,yt="rearg"in tt&&tt.rearg,Ct=nt?Ye.runInContext():void 0,Et=nt?Ye:{ary:Be.ary,assign:Be.assign,clone:Be.clone,curry:Be.curry,forEach:Be.forEach,isArray:Be.isArray,isError:Be.isError,isFunction:Be.isFunction,isWeakMap:Be.isWeakMap,iteratee:Be.iteratee,keys:Be.keys,rearg:Be.rearg,toInteger:Be.toInteger,toPath:Be.toPath},vt=Et.ary,kt=Et.assign,bt=Et.clone,wt=Et.curry,It=Et.forEach,Rt=Et.isArray,Tt=Et.isError,Bt=Et.isFunction,Pt=Et.isWeakMap,Dt=Et.keys,Ot=Et.rearg,Lt=Et.toInteger,Wt=Et.toPath,$t=Dt(mapping.aryMethod),qt={castArray:function(dr){return function(){var rr=arguments[0];return Rt(rr)?dr(cloneArray(rr)):dr.apply(void 0,arguments)}},iteratee:function(dr){return function(){var rr=arguments[0],gr=arguments[1],yr=dr(rr,gr),or=yr.length;return ht.cap&&typeof gr=="number"?(gr=gr>2?gr-2:1,or&&or<=gr?yr:baseAry(yr,gr)):yr}},mixin:function(dr){return function(rr){var gr=this;if(!Bt(gr))return dr(gr,Object(rr));var yr=[];return It(Dt(rr),function(or){Bt(rr[or])&&yr.push([or,gr.prototype[or]])}),dr(gr,Object(rr)),It(yr,function(or){var ir=or[1];Bt(ir)?gr.prototype[or[0]]=ir:delete gr.prototype[or[0]]}),gr}},nthArg:function(dr){return function(rr){var gr=rr<0?1:Lt(rr)+1;return wt(dr(rr),gr)}},rearg:function(dr){return function(rr,gr){var yr=gr?gr.length:0;return wt(dr(rr,gr),yr)}},runInContext:function(dr){return function(rr){return baseConvert(Be,dr(rr),tt)}}};function Ht(dr,rr){if(ht.cap){var gr=mapping.iterateeRearg[dr];if(gr)return Gt(rr,gr);var yr=!nt&&mapping.iterateeAry[dr];if(yr)return zt(rr,yr)}return rr}function Ut(dr,rr,gr){return At||ht.curry&&gr>1?wt(rr,gr):rr}function Ft(dr,rr,gr){if(ht.fixed&&(xt||!mapping.skipFixed[dr])){var yr=mapping.methodSpread[dr],or=yr&&yr.start;return or===void 0?vt(rr,gr):flatSpread(rr,or)}return rr}function Xt(dr,rr,gr){return ht.rearg&&gr>1&&(yt||!mapping.skipRearg[dr])?Ot(rr,mapping.methodRearg[dr]||mapping.aryRearg[gr]):rr}function _t(dr,rr){rr=Wt(rr);for(var gr=-1,yr=rr.length,or=yr-1,ir=bt(Object(dr)),Zt=ir;Zt!=null&&++gr<yr;){var Qt=rr[gr],er=Zt[Qt];er!=null&&!(Bt(er)||Tt(er)||Pt(er))&&(Zt[Qt]=bt(gr==or?er:Object(er))),Zt=Zt[Qt]}return ir}function Mt(dr){return tr.runInContext.convert(dr)(void 0)}function jt(dr,rr){var gr=mapping.aliasToReal[dr]||dr,yr=mapping.remap[gr]||gr,or=tt;return function(ir){var Zt=nt?Ct:Et,Qt=nt?Ct[yr]:rr,er=kt(kt({},or),ir);return baseConvert(Zt,gr,Qt,er)}}function zt(dr,rr){return Yt(dr,function(gr){return typeof gr=="function"?baseAry(gr,rr):gr})}function Gt(dr,rr){return Yt(dr,function(gr){var yr=rr.length;return baseArity(Ot(baseAry(gr,yr),rr),yr)})}function Yt(dr,rr){return function(){var gr=arguments.length;if(!gr)return dr();for(var yr=Array(gr);gr--;)yr[gr]=arguments[gr];var or=ht.rearg?0:gr-1;return yr[or]=rr(yr[or]),dr.apply(void 0,yr)}}function ar(dr,rr,gr){var yr,or=mapping.aliasToReal[dr]||dr,ir=rr,Zt=qt[or];return Zt?ir=Zt(rr):ht.immutable&&(mapping.mutate.array[or]?ir=wrapImmutable(rr,cloneArray):mapping.mutate.object[or]?ir=wrapImmutable(rr,createCloner(rr)):mapping.mutate.set[or]&&(ir=wrapImmutable(rr,_t))),It($t,function(Qt){return It(mapping.aryMethod[Qt],function(er){if(or==er){var nr=mapping.methodSpread[or],lr=nr&&nr.afterRearg;return yr=lr?Ft(or,Xt(or,ir,Qt),Qt):Xt(or,Ft(or,ir,Qt),Qt),yr=Ht(or,yr),yr=Ut(or,yr,Qt),!1}}),!yr}),yr||(yr=ir),yr==rr&&(yr=At?wt(yr,1):function(){return rr.apply(this,arguments)}),yr.convert=jt(or,rr),yr.placeholder=rr.placeholder=gr,yr}if(!ft)return ar(Le,Ye,gt);var tr=Ye,sr=[];return It($t,function(dr){It(mapping.aryMethod[dr],function(rr){var gr=tr[mapping.remap[rr]||rr];gr&&sr.push([rr,ar(rr,gr,tr)])})}),It(Dt(tr),function(dr){var rr=tr[dr];if(typeof rr=="function"){for(var gr=sr.length;gr--;)if(sr[gr][0]==dr)return;rr.convert=jt(dr,rr),sr.push([dr,rr])}}),It(sr,function(dr){tr[dr[0]]=dr[1]}),tr.convert=Mt,tr.placeholder=tr,It(Dt(tr),function(dr){It(mapping.realToAlias[dr]||[],function(rr){tr[rr]=tr[dr]})}),tr}var _baseConvert=baseConvert,_=lodash_minExports.runInContext(),fp=_baseConvert(_,_),rngBrowser={exports:{}},getRandomValues$1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues$1){var rnds8$1=new Uint8Array(16);rngBrowser.exports=function(){return getRandomValues$1(rnds8$1),rnds8$1}}else{var rnds=new Array(16);rngBrowser.exports=function(){for(var Le=0,Ye;Le<16;Le++)Le&3||(Ye=Math.random()*4294967296),rnds[Le]=Ye>>>((Le&3)<<3)&255;return rnds}}for(var rngBrowserExports=rngBrowser.exports,byteToHex$1=[],i$2=0;i$2<256;++i$2)byteToHex$1[i$2]=(i$2+256).toString(16).substr(1);function bytesToUuid$2(Be,Le){var Ye=Le||0,tt=byteToHex$1;return[tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],"-",tt[Be[Ye++]],tt[Be[Ye++]],"-",tt[Be[Ye++]],tt[Be[Ye++]],"-",tt[Be[Ye++]],tt[Be[Ye++]],"-",tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]]].join("")}var bytesToUuid_1=bytesToUuid$2,rng$3=rngBrowserExports,bytesToUuid$1=bytesToUuid_1,_nodeId$1,_clockseq$1,_lastMSecs$1=0,_lastNSecs$1=0;function v1$3(Be,Le,Ye){var tt=Le&&Ye||0,nt=Le||[];Be=Be||{};var ft=Be.node||_nodeId$1,ht=Be.clockseq!==void 0?Be.clockseq:_clockseq$1;if(ft==null||ht==null){var gt=rng$3();ft==null&&(ft=_nodeId$1=[gt[0]|1,gt[1],gt[2],gt[3],gt[4],gt[5]]),ht==null&&(ht=_clockseq$1=(gt[6]<<8|gt[7])&16383)}var At=Be.msecs!==void 0?Be.msecs:new Date().getTime(),xt=Be.nsecs!==void 0?Be.nsecs:_lastNSecs$1+1,yt=At-_lastMSecs$1+(xt-_lastNSecs$1)/1e4;if(yt<0&&Be.clockseq===void 0&&(ht=ht+1&16383),(yt<0||At>_lastMSecs$1)&&Be.nsecs===void 0&&(xt=0),xt>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs$1=At,_lastNSecs$1=xt,_clockseq$1=ht,At+=122192928e5;var Ct=((At&268435455)*1e4+xt)%4294967296;nt[tt++]=Ct>>>24&255,nt[tt++]=Ct>>>16&255,nt[tt++]=Ct>>>8&255,nt[tt++]=Ct&255;var Et=At/4294967296*1e4&268435455;nt[tt++]=Et>>>8&255,nt[tt++]=Et&255,nt[tt++]=Et>>>24&15|16,nt[tt++]=Et>>>16&255,nt[tt++]=ht>>>8|128,nt[tt++]=ht&255;for(var vt=0;vt<6;++vt)nt[tt+vt]=ft[vt];return Le||bytesToUuid$1(nt)}var v1_1=v1$3,rng$2=rngBrowserExports,bytesToUuid=bytesToUuid_1;function v4$3(Be,Le,Ye){var tt=Le&&Ye||0;typeof Be=="string"&&(Le=Be==="binary"?new Array(16):null,Be=null),Be=Be||{};var nt=Be.random||(Be.rng||rng$2)();if(nt[6]=nt[6]&15|64,nt[8]=nt[8]&63|128,Le)for(var ft=0;ft<16;++ft)Le[tt+ft]=nt[ft];return Le||bytesToUuid(nt)}var v4_1=v4$3,v1$2=v1_1,v4$2=v4_1,uuid=v4$2;uuid.v1=v1$2,uuid.v4=v4$2;var uuid_1$2=uuid;const uuid$1=getDefaultExportFromCjs(uuid_1$2);let OTPublisher$5=class extends React.Component{constructor(Ye,tt){super(Ye);P0(this,"sessionConnectedHandler",()=>{this.publishToSession(this.state.publisher)});P0(this,"streamCreatedHandler",Ye=>{this.setState({lastStreamId:Ye.stream.id})});this.state={publisher:null,lastStreamId:"",session:Ye.session||tt.session||null}}componentDidMount(){this.createPublisher()}componentDidUpdate(Ye,tt){const nt=(gt,At)=>gt===void 0?At:gt,ft=(gt,At)=>{const xt=nt(Ye.properties[gt],At),yt=nt(this.props.properties[gt],At);return xt!==yt},ht=(gt,At)=>{if(ft(gt,At)){const xt=nt(this.props.properties[gt],At);this.state.publisher[gt](xt)}};if(ft("videoSource",void 0)){this.destroyPublisher(),this.createPublisher();return}ht("publishAudio",!0),ht("publishVideo",!0),this.state.session!==tt.session&&(this.destroyPublisher(tt.session),this.createPublisher())}componentWillUnmount(){this.state.session&&this.state.session.off("sessionConnected",this.sessionConnectedHandler),this.destroyPublisher()}getPublisher(){return this.state.publisher}destroyPublisher(Ye=this.state.session){delete this.publisherId,this.state.publisher&&(this.state.publisher.off("streamCreated",this.streamCreatedHandler),this.props.eventHandlers&&typeof this.props.eventHandlers=="object"&&this.state.publisher.once("destroyed",()=>{this.state.publisher.off(this.props.eventHandlers)}),Ye&&Ye.unpublish(this.state.publisher),this.state.publisher.destroy())}publishToSession(Ye){const{publisherId:tt}=this;this.state.session.publish(Ye,nt=>{tt===this.publisherId&&(nt?this.errorHandler(nt):typeof this.props.onPublish=="function"&&this.props.onPublish())})}createPublisher(){if(!this.state.session){this.setState({publisher:null,lastStreamId:""});return}const Ye=this.props.properties||{};let tt;Ye.insertDefaultUI!==!1&&(tt=document.createElement("div"),tt.setAttribute("class","OTPublisherContainer"),this.node.appendChild(tt)),this.publisherId=uuid$1();const{publisherId:nt}=this;this.errorHandler=once$2(ht=>{nt===this.publisherId&&typeof this.props.onError=="function"&&this.props.onError(ht)});const ft=OT.initPublisher(tt,Ye,ht=>{nt===this.publisherId&&(ht?this.errorHandler(ht):typeof this.props.onInit=="function"&&this.props.onInit())});if(ft.on("streamCreated",this.streamCreatedHandler),ft.setStyle({buttonDisplayMode:"off"}),this.props.eventHandlers&&typeof this.props.eventHandlers=="object"){const ht=fp.omitBy(fp.isNil)(this.props.eventHandlers);ft.on(ht)}this.state.session.connection?this.publishToSession(ft):this.state.session.once("sessionConnected",this.sessionConnectedHandler),this.setState({publisher:ft,lastStreamId:""})}render(){const{className:Ye,style:tt}=this.props;return jsxRuntimeExports.jsx("div",{className:Ye,style:tt,ref:nt=>{this.node=nt}})}};OTPublisher$5.propTypes={session:PropTypes.shape({connection:PropTypes.shape({connectionId:PropTypes.string}),once:PropTypes.func,off:PropTypes.func,publish:PropTypes.func,unpublish:PropTypes.func}),className:PropTypes.string,style:PropTypes.object,properties:PropTypes.object,eventHandlers:PropTypes.objectOf(PropTypes.func),onInit:PropTypes.func,onPublish:PropTypes.func,onError:PropTypes.func},OTPublisher$5.defaultProps={session:null,className:"",style:{},properties:{},eventHandlers:null,onInit:null,onPublish:null,onError:null},OTPublisher$5.contextTypes={session:PropTypes.shape({connection:PropTypes.shape({connectionId:PropTypes.string}),once:PropTypes.func,off:PropTypes.func,publish:PropTypes.func,unpublish:PropTypes.func})};let OTSubscriberContext$4=class extends React.Component{getChildContext(){return{stream:this.props.stream}}render(){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:this.props.children})}};OTSubscriberContext$4.propTypes={children:PropTypes.element.isRequired,stream:PropTypes.shape({streamId:PropTypes.string}).isRequired},OTSubscriberContext$4.childContextTypes={stream:PropTypes.shape({streamId:PropTypes.string})};function OTStreams$4(Be,Le){const Ye=Be.session||Le.session||null,tt=Be.streams||Le.streams||null;if(!Ye)return jsxRuntimeExports.jsx("div",{});const nt=React.Children.only(Be.children);return Array.isArray(tt)?tt.map(ht=>nt&&jsxRuntimeExports.jsx(OTSubscriberContext$4,{stream:ht,children:React.cloneElement(nt)},ht.id)):null}OTStreams$4.propTypes={children:PropTypes.element.isRequired,session:PropTypes.shape({publish:PropTypes.func,subscribe:PropTypes.func}),streams:PropTypes.arrayOf(PropTypes.object)},OTStreams$4.defaultProps={session:null,streams:null},OTStreams$4.contextTypes={session:PropTypes.shape({publish:PropTypes.func,subscribe:PropTypes.func}),streams:PropTypes.arrayOf(PropTypes.object)};let OTSubscriber$4=class extends React.Component{constructor(Le,Ye){super(Le),this.state={subscriber:null,stream:Le.stream||Ye.stream||null,session:Le.session||Ye.session||null,currentRetryAttempt:0},this.maxRetryAttempts=Le.maxRetryAttempts||5,this.retryAttemptTimeout=Le.retryAttemptTimeout||1e3}componentDidMount(){this.createSubscriber()}componentDidUpdate(Le,Ye){const tt=(ft,ht,gt)=>ft===void 0?gt:ht(ft),nt=ft=>{const ht=tt(Le.properties[ft],Boolean,!0),gt=tt(this.props.properties[ft],Boolean,!0);ht!==gt&&this.state.subscriber[ft](gt)};nt("subscribeToAudio"),nt("subscribeToVideo"),(Ye.session!==this.state.session||Ye.stream!==this.state.stream)&&(this.destroySubscriber(Ye.session),this.createSubscriber())}componentWillUnmount(){this.destroySubscriber()}getSubscriber(){return this.state.subscriber}createSubscriber(){if(!this.state.session||!this.state.stream){this.setState({subscriber:null});return}const Le=this.props.properties||{};let Ye;Le.insertDefaultUI!==!1&&(Ye=document.createElement("div"),Ye.setAttribute("class","OTSubscriberContainer"),this.node.appendChild(Ye)),this.subscriberId=uuid$1();const{subscriberId:tt}=this,nt=this.state.session.subscribe(this.state.stream,Ye,this.props.properties,ft=>{tt===this.subscriberId&&(ft&&this.props.retry&&this.state.currentRetryAttempt<this.maxRetryAttempts-1&&this.handleRetrySubscriber(),ft&&typeof this.props.onError=="function"?this.props.onError(ft):!ft&&typeof this.props.onSubscribe=="function"&&this.props.onSubscribe())});this.props.eventHandlers&&typeof this.props.eventHandlers=="object"&&nt.on(this.props.eventHandlers),this.setState({subscriber:nt})}handleRetrySubscriber(){setTimeout(()=>{this.setState(Le=>({currentRetryAttempt:Le.currentRetryAttempt+1,subscriber:null})),this.createSubscriber()},this.retryAttemptTimeout)}destroySubscriber(Le=this.props.session){delete this.subscriberId,this.state.subscriber&&(this.props.eventHandlers&&typeof this.props.eventHandlers=="object"&&this.state.subscriber.once("destroyed",()=>{this.state.subscriber.off(this.props.eventHandlers)}),Le&&Le.unsubscribe(this.state.subscriber))}render(){const{className:Le,style:Ye}=this.props;return jsxRuntimeExports.jsx("div",{className:Le,style:Ye,ref:tt=>{this.node=tt}})}};OTSubscriber$4.propTypes={stream:PropTypes.shape({streamId:PropTypes.string}),session:PropTypes.shape({subscribe:PropTypes.func,unsubscribe:PropTypes.func}),className:PropTypes.string,style:PropTypes.object,properties:PropTypes.object,retry:PropTypes.bool,maxRetryAttempts:PropTypes.number,retryAttemptTimeout:PropTypes.number,eventHandlers:PropTypes.objectOf(PropTypes.func),onSubscribe:PropTypes.func,onError:PropTypes.func},OTSubscriber$4.defaultProps={stream:null,session:null,className:"",style:{},properties:{},retry:!1,maxRetryAttempts:5,retryAttemptTimeout:1e3,eventHandlers:null,onSubscribe:null,onError:null},OTSubscriber$4.contextTypes={stream:PropTypes.shape({streamId:PropTypes.string}),session:PropTypes.shape({subscribe:PropTypes.func,unsubscribe:PropTypes.func})};var getDisplayName$1={};Object.defineProperty(getDisplayName$1,"__esModule",{value:!0});var _default$e=getDisplayName$1.default=getDisplayName;function getDisplayName(Be){return Be.displayName||Be.name||(typeof Be=="string"&&Be.length>0?Be:"Unknown")}var script={exports:{}};/*!
|
|
2797
|
+
}`;var tn=Gh(function(){return yh(Fr,B0+"return "+p0).apply(pr,Kr)});if(tn.source=p0,gp(tn))throw tn;return tn}function Hg(Nt){return vn(Nt).toLowerCase()}function Gg(Nt){return vn(Nt).toUpperCase()}function zg(Nt,Vt,Jt){if(Nt=vn(Nt),Nt&&(Jt||Vt===pr))return Ft(Nt);if(!Nt||!(Vt=hi(Vt)))return Nt;var cr=nr(Nt),Er=nr(Vt);return o2(cr,jt(cr,Er),zt(cr,Er)+1).join("")}function Wg(Nt,Vt,Jt){if(Nt=vn(Nt),Nt&&(Jt||Vt===pr))return Nt.slice(0,lr(Nt)+1);if(!Nt||!(Vt=hi(Vt)))return Nt;var cr=nr(Nt);return o2(cr,0,zt(cr,nr(Vt))+1).join("")}function Xg(Nt,Vt,Jt){if(Nt=vn(Nt),Nt&&(Jt||Vt===pr))return Nt.replace(E0,"");if(!Nt||!(Vt=hi(Vt)))return Nt;var cr=nr(Nt);return o2(cr,jt(cr,nr(Vt))).join("")}function Kg(Nt,Vt){var Jt=N0,cr=J0;if(Wn(Vt)){var Er="separator"in Vt?Vt.separator:Er;Jt="length"in Vt?nn(Vt.length):Jt,cr="omission"in Vt?hi(Vt.omission):cr}Nt=vn(Nt);var Sr=Nt.length;if(tr(Nt)){var jr=nr(Nt);Sr=jr.length}if(Jt>=Sr)return Nt;var Fr=Jt-er(cr);if(Fr<1)return cr;var Kr=jr?o2(jr,0,Fr).join(""):Nt.slice(0,Fr);if(Er===pr)return Kr+cr;if(jr&&(Fr+=Kr.length-Fr),_p(Er)){if(Nt.slice(Fr).search(Er)){var l0,i0=Kr;for(Er.global||(Er=Sp(Er.source,vn(e2.exec(Er))+"g")),Er.lastIndex=0;l0=Er.exec(i0);)var p0=l0.index;Kr=Kr.slice(0,p0===pr?Fr:p0)}}else if(Nt.indexOf(hi(Er),Fr)!=Fr){var k0=Kr.lastIndexOf(Er);k0>-1&&(Kr=Kr.slice(0,k0))}return Kr+cr}function $g(Nt){return Nt=vn(Nt),Nt&&Br.test(Nt)?Nt.replace(Ar,Y4):Nt}function Ah(Nt,Vt,Jt){return Nt=vn(Nt),Vt=Jt?pr:Vt,Vt===pr?sr(Nt)?xr(Nt):wt(Nt):Nt.match(Vt)||[]}function qg(Nt){var Vt=Nt==null?0:Nt.length,Jt=z0();return Nt=Vt?yt(Nt,function(cr){if(typeof cr[1]!="function")throw new Ni(qr);return[Jt(cr[0]),cr[1]]}):[],cn(function(cr){for(var Er=-1;++Er<Vt;){var Sr=Nt[Er];if(Ye(Sr[0],this,cr))return Ye(Sr[1],this,cr)}})}function Yg(Nt){return S6(Bi(Nt,Or))}function yp(Nt){return function(){return Nt}}function Zg(Nt,Vt){return Nt==null||Nt!==Nt?Vt:Nt}function ei(Nt){return Nt}function Ep(Nt){return uf(typeof Nt=="function"?Nt:Bi(Nt,Or))}function Jg(Nt){return pf(Bi(Nt,Or))}function e7(Nt,Vt){return ff(Nt,Bi(Vt,Or))}function Cp(Nt,Vt,Jt){var cr=ga(Vt),Er=xd(Vt,cr);Jt!=null||Wn(Vt)&&(Er.length||!cr.length)||(Jt=Vt,Vt=Nt,Nt=this,Er=xd(Vt,ga(Vt)));var Sr=!(Wn(Jt)&&"chain"in Jt&&!Jt.chain),jr=yo(Nt);return nt(Er,function(Fr){var Kr=Vt[Fr];Nt[Fr]=Kr,jr&&(Nt.prototype[Fr]=function(){var l0=this.__chain__;if(Sr||l0){var i0=Nt(this.__wrapped__);return(i0.__actions__=Ya(this.__actions__)).push({func:Kr,args:arguments,thisArg:Nt}),i0.__chain__=l0,i0}return Kr.apply(Nt,Ct([this.value()],arguments))})}),Nt}function t7(){return ka._===this&&(ka._=v7),this}function vp(){}function r7(Nt){return Nt=nn(Nt),cn(function(Vt){return hf(Vt,Nt)})}function xh(Nt){return up(Nt)?Ot(Ps(Nt)):H6(Nt)}function n7(Nt){return function(Vt){return Nt==null?pr:I1(Nt,Vt)}}function kp(){return[]}function bp(){return!1}function a7(){return{}}function i7(){return""}function s7(){return!0}function o7(Nt,Vt){if(Nt=nn(Nt),Nt<1||Nt>u0)return[];var Jt=U0,cr=Ta(Nt,U0);Vt=z0(Vt),Nt-=U0;for(var Er=Ht(cr,Vt);++Jt<Nt;)Vt(Jt);return Er}function l7(Nt){return Y0(Nt)?yt(Nt,Ps):mi(Nt)?[Nt]:Ya(Lh(vn(Nt)))}function c7(Nt){var Vt=++E7;return vn(Nt)+Vt}function u7(Nt){return Nt&&Nt.length?Ad(Nt,ei,H3):pr}function d7(Nt,Vt){return Nt&&Nt.length?Ad(Nt,z0(Vt,2),H3):pr}function p7(Nt){return Dt(Nt,ei)}function f7(Nt,Vt){return Dt(Nt,z0(Vt,2))}function h7(Nt){return Nt&&Nt.length?Ad(Nt,ei,X3):pr}function m7(Nt,Vt){return Nt&&Nt.length?Ad(Nt,z0(Vt,2),X3):pr}function g7(Nt){return Nt&&Nt.length?qt(Nt,ei):0}function A7(Nt,Vt){return Nt&&Nt.length?qt(Nt,z0(Vt,2)):0}a0=a0==null?ka:_l.defaults(ka.Object(),a0,_l.pick(ka,j4));var la=a0.Array,_d=a0.Date,Ip=a0.Error,yh=a0.Function,Vl=a0.Math,jn=a0.Object,Sp=a0.RegExp,x7=a0.String,Ni=a0.TypeError,Md=la.prototype,y7=yh.prototype,Ul=jn.prototype,jd=a0["__core-js_shared__"],Fd=y7.toString,Sn=Ul.hasOwnProperty,E7=0,Eh=function(){var Nt=/[^.]+$/.exec(jd&&jd.keys&&jd.keys.IE_PROTO||"");return Nt?"Symbol(src)_1."+Nt:""}(),Qd=Ul.toString,C7=Fd.call(jn),v7=ka._,k7=Sp("^"+Fd.call(Sn).replace(d0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vd=X9?a0.Buffer:pr,l2=a0.Symbol,Ud=a0.Uint8Array,Ch=Vd?Vd.allocUnsafe:pr,Hd=gr(jn.getPrototypeOf,jn),kh=jn.create,bh=Ul.propertyIsEnumerable,Gd=Md.splice,Ih=l2?l2.isConcatSpreadable:pr,wu=l2?l2.iterator:pr,R1=l2?l2.toStringTag:pr,zd=function(){try{var Nt=S1(jn,"defineProperty");return Nt({},"",{}),Nt}catch{}}(),b7=a0.clearTimeout!==ka.clearTimeout&&a0.clearTimeout,I7=_d&&_d.now!==ka.Date.now&&_d.now,S7=a0.setTimeout!==ka.setTimeout&&a0.setTimeout,Wd=Vl.ceil,Xd=Vl.floor,wp=jn.getOwnPropertySymbols,w7=Vd?Vd.isBuffer:pr,Sh=a0.isFinite,R7=Md.join,T7=gr(jn.keys,jn),ua=Vl.max,Ta=Vl.min,B7=_d.now,P7=a0.parseInt,wh=Vl.random,O7=Md.reverse,Rp=S1(a0,"DataView"),Ru=S1(a0,"Map"),Tp=S1(a0,"Promise"),Hl=S1(a0,"Set"),Tu=S1(a0,"WeakMap"),Bu=S1(jn,"create"),Kd=Tu&&new Tu,Gl={},D7=w1(Rp),N7=w1(Ru),L7=w1(Tp),_7=w1(Hl),M7=w1(Tu),$d=l2?l2.prototype:pr,Pu=$d?$d.valueOf:pr,Rh=$d?$d.toString:pr,zl=function(){function Nt(){}return function(Vt){if(!Wn(Vt))return{};if(kh)return kh(Vt);Nt.prototype=Vt;var Jt=new Nt;return Nt.prototype=pr,Jt}}();mr.templateSettings={escape:Gr,evaluate:Xr,interpolate:Hr,variable:"",imports:{_:mr}},mr.prototype=S0.prototype,mr.prototype.constructor=mr,Q0.prototype=zl(S0.prototype),Q0.prototype.constructor=Q0,R0.prototype=zl(S0.prototype),R0.prototype.constructor=R0,C1.prototype.clear=e6,C1.prototype.delete=t6,C1.prototype.get=r6,C1.prototype.has=n6,C1.prototype.set=a6,fo.prototype.clear=i6,fo.prototype.delete=s6,fo.prototype.get=o6,fo.prototype.has=l6,fo.prototype.set=c6,ho.prototype.clear=u6,ho.prototype.delete=d6,ho.prototype.get=p6,ho.prototype.has=f6,ho.prototype.set=h6,k1.prototype.add=k1.prototype.push=m6,k1.prototype.has=g6,as.prototype.clear=A6,as.prototype.delete=x6,as.prototype.get=y6,as.prototype.has=E6,as.prototype.set=C6;var c2=Rf(Ts),Th=Rf(U3,!0),Bp=Tf(),Bh=Tf(!0),Ph=Kd?function(Nt,Vt){return Kd.set(Nt,Vt),Nt}:ei,j7=zd?function(Nt,Vt){return zd(Nt,"toString",{configurable:!0,enumerable:!1,value:yp(Vt),writable:!0})}:ei,F7=cn,Oh=b7||function(Nt){return ka.clearTimeout(Nt)},Q7=Hl&&1/or(new Hl([,-0]))[1]==H0?function(Nt){return new Hl(Nt)}:vp,Pp=Kd?function(Nt){return Kd.get(Nt)}:vp,Op=wp?function(Nt){return Nt==null?[]:(Nt=jn(Nt),gt(wp(Nt),function(Vt){return bh.call(Nt,Vt)}))}:kp,Dh=wp?function(Nt){for(var Vt=[];Nt;)Ct(Vt,Op(Nt)),Nt=Hd(Nt);return Vt}:kp,Ba=ja;(Rp&&Ba(new Rp(new ArrayBuffer(1)))!=Ji||Ru&&Ba(new Ru)!=fn||Tp&&Ba(Tp.resolve())!=zn||Hl&&Ba(new Hl)!=sa||Tu&&Ba(new Tu)!=Ma)&&(Ba=function(Nt){var Vt=ja(Nt),Jt=Vt==Gn?Nt.constructor:pr,cr=Jt?w1(Jt):"";if(cr)switch(cr){case D7:return Ji;case N7:return fn;case L7:return zn;case _7:return sa;case M7:return Ma}return Vt});var V7=jd?yo:bp,Nh=Xf(Ph),Ou=S7||function(Nt,Vt){return ka.setTimeout(Nt,Vt)},Dp=Xf(j7),Lh=Am(function(Nt){var Vt=[];return Nt.charCodeAt(0)===46&&Vt.push(""),Nt.replace(o0,function(Jt,cr,Er,Sr){Vt.push(Er?Sr.replace(Zn,"$1"):cr||Jt)}),Vt}),U7=cn(function(Nt,Vt){return Jn(Nt)?Eu(Nt,ba(Vt,1,Jn,!0)):[]}),H7=cn(function(Nt,Vt){var Jt=Oi(Vt);return Jn(Jt)&&(Jt=pr),Jn(Nt)?Eu(Nt,ba(Vt,1,Jn,!0),z0(Jt,2)):[]}),G7=cn(function(Nt,Vt){var Jt=Oi(Vt);return Jn(Jt)&&(Jt=pr),Jn(Nt)?Eu(Nt,ba(Vt,1,Jn,!0),pr,Jt):[]}),z7=cn(function(Nt){var Vt=yt(Nt,ep);return Vt.length&&Vt[0]===Nt[0]?G3(Vt):[]}),W7=cn(function(Nt){var Vt=Oi(Nt),Jt=yt(Nt,ep);return Vt===Oi(Jt)?Vt=pr:Jt.pop(),Jt.length&&Jt[0]===Nt[0]?G3(Jt,z0(Vt,2)):[]}),X7=cn(function(Nt){var Vt=Oi(Nt),Jt=yt(Nt,ep);return Vt=typeof Vt=="function"?Vt:pr,Vt&&Jt.pop(),Jt.length&&Jt[0]===Nt[0]?G3(Jt,pr,Vt):[]}),K7=cn(Jf),$7=Ao(function(Nt,Vt){var Jt=Nt==null?0:Nt.length,cr=Q3(Nt,Vt);return Af(Nt,yt(Vt,function(Er){return xo(Er,Jt)?+Er:Er}).sort(If)),cr}),q7=cn(function(Nt){return i2(ba(Nt,1,Jn,!0))}),Y7=cn(function(Nt){var Vt=Oi(Nt);return Jn(Vt)&&(Vt=pr),i2(ba(Nt,1,Jn,!0),z0(Vt,2))}),Z7=cn(function(Nt){var Vt=Oi(Nt);return Vt=typeof Vt=="function"?Vt:pr,i2(ba(Nt,1,Jn,!0),pr,Vt)}),J7=cn(function(Nt,Vt){return Jn(Nt)?Eu(Nt,Vt):[]}),eA=cn(function(Nt){return J3(gt(Nt,Jn))}),tA=cn(function(Nt){var Vt=Oi(Nt);return Jn(Vt)&&(Vt=pr),J3(gt(Nt,Jn),z0(Vt,2))}),rA=cn(function(Nt){var Vt=Oi(Nt);return Vt=typeof Vt=="function"?Vt:pr,J3(gt(Nt,Jn),pr,Vt)}),nA=cn(mp),aA=cn(function(Nt){var Vt=Nt.length,Jt=Vt>1?Nt[Vt-1]:pr;return Jt=typeof Jt=="function"?(Nt.pop(),Jt):pr,eh(Nt,Jt)}),iA=Ao(function(Nt){var Vt=Nt.length,Jt=Vt?Nt[0]:0,cr=this.__wrapped__,Er=function(Sr){return Q3(Sr,Nt)};return!(Vt>1||this.__actions__.length)&&cr instanceof R0&&xo(Jt)?(cr=cr.slice(Jt,+Jt+(Vt?1:0)),cr.__actions__.push({func:Bd,args:[Er],thisArg:pr}),new Q0(cr,this.__chain__).thru(function(Sr){return Vt&&!Sr.length&&Sr.push(pr),Sr})):this.thru(Er)}),sA=vd(function(Nt,Vt,Jt){Sn.call(Nt,Jt)?++Nt[Jt]:mo(Nt,Jt,1)}),oA=Pf($f),lA=Pf(qf),cA=vd(function(Nt,Vt,Jt){Sn.call(Nt,Jt)?Nt[Jt].push(Vt):mo(Nt,Jt,[Vt])}),uA=cn(function(Nt,Vt,Jt){var cr=-1,Er=typeof Vt=="function",Sr=Za(Nt)?la(Nt.length):[];return c2(Nt,function(jr){Sr[++cr]=Er?Ye(Vt,jr,Jt):Cu(jr,Vt,Jt)}),Sr}),dA=vd(function(Nt,Vt,Jt){mo(Nt,Jt,Vt)}),pA=vd(function(Nt,Vt,Jt){Nt[Jt?0:1].push(Vt)},function(){return[[],[]]}),fA=cn(function(Nt,Vt){if(Nt==null)return[];var Jt=Vt.length;return Jt>1&&Fa(Nt,Vt[0],Vt[1])?Vt=[]:Jt>2&&Fa(Vt[0],Vt[1],Vt[2])&&(Vt=[Vt[0]]),mf(Nt,ba(Vt,1),[])}),qd=I7||function(){return ka.Date.now()},Np=cn(function(Nt,Vt,Jt){var cr=wr;if(Jt.length){var Er=yr(Jt,Fl(Np));cr|=t0}return go(Nt,cr,Vt,Jt,Er)}),_h=cn(function(Nt,Vt,Jt){var cr=wr|Tr;if(Jt.length){var Er=yr(Jt,Fl(_h));cr|=t0}return go(Vt,cr,Nt,Jt,Er)}),hA=cn(function(Nt,Vt){return af(Nt,1,Vt)}),mA=cn(function(Nt,Vt,Jt){return af(Nt,Di(Vt)||0,Jt)});Od.Cache=ho;var gA=F7(function(Nt,Vt){Vt=Vt.length==1&&Y0(Vt[0])?yt(Vt[0],Xt(z0())):yt(ba(Vt,1),Xt(z0()));var Jt=Vt.length;return cn(function(cr){for(var Er=-1,Sr=Ta(cr.length,Jt);++Er<Sr;)cr[Er]=Vt[Er].call(this,cr[Er]);return Ye(Nt,this,cr)})}),Lp=cn(function(Nt,Vt){return go(Nt,t0,pr,Vt,yr(Vt,Fl(Lp)))}),Mh=cn(function(Nt,Vt){return go(Nt,h0,pr,Vt,yr(Vt,Fl(Mh)))}),AA=Ao(function(Nt,Vt){return go(Nt,m0,pr,pr,pr,Vt)}),xA=Sd(H3),yA=Sd(function(Nt,Vt){return Nt>=Vt}),T1=lf(function(){return arguments}())?lf:function(Nt){return $n(Nt)&&Sn.call(Nt,"callee")&&!bh.call(Nt,"callee")},Y0=la.isArray,EA=K9?Xt(K9):D6,u2=w7||bp,CA=$9?Xt($9):N6,jh=q9?Xt(q9):_6,_p=Y9?Xt(Y9):M6,Fh=Z9?Xt(Z9):j6,Wl=J9?Xt(J9):F6,vA=Sd(X3),kA=Sd(function(Nt,Vt){return Nt<=Vt}),bA=Ml(function(Nt,Vt){if(Iu(Vt)||Za(Vt))return Bs(Vt,ga(Vt),Nt),pr;for(var Jt in Vt)Sn.call(Vt,Jt)&&yu(Nt,Jt,Vt[Jt])}),Qh=Ml(function(Nt,Vt){Bs(Vt,Ja(Vt),Nt)}),Yd=Ml(function(Nt,Vt,Jt,cr){Bs(Vt,Ja(Vt),Nt,cr)}),IA=Ml(function(Nt,Vt,Jt,cr){Bs(Vt,ga(Vt),Nt,cr)}),SA=Ao(Q3),wA=cn(function(Nt,Vt){Nt=jn(Nt);var Jt=-1,cr=Vt.length,Er=cr>2?Vt[2]:pr;for(Er&&Fa(Vt[0],Vt[1],Er)&&(cr=1);++Jt<cr;)for(var Sr=Vt[Jt],jr=Ja(Sr),Fr=-1,Kr=jr.length;++Fr<Kr;){var l0=jr[Fr],i0=Nt[l0];(i0===pr||is(i0,Ul[l0])&&!Sn.call(Nt,l0))&&(Nt[l0]=Sr[l0])}return Nt}),RA=cn(function(Nt){return Nt.push(pr,jf),Ye(Vh,pr,Nt)}),TA=Df(function(Nt,Vt,Jt){Vt!=null&&typeof Vt.toString!="function"&&(Vt=Qd.call(Vt)),Nt[Vt]=Jt},yp(ei)),BA=Df(function(Nt,Vt,Jt){Vt!=null&&typeof Vt.toString!="function"&&(Vt=Qd.call(Vt)),Sn.call(Nt,Vt)?Nt[Vt].push(Jt):Nt[Vt]=[Jt]},z0),PA=cn(Cu),OA=Ml(function(Nt,Vt,Jt){yd(Nt,Vt,Jt)}),Vh=Ml(function(Nt,Vt,Jt,cr){yd(Nt,Vt,Jt,cr)}),DA=Ao(function(Nt,Vt){var Jt={};if(Nt==null)return Jt;var cr=!1;Vt=yt(Vt,function(Sr){return Sr=s2(Sr,Nt),cr||(cr=Sr.length>1),Sr}),Bs(Nt,lp(Nt),Jt),cr&&(Jt=Bi(Jt,Or|Vr|Yr,im));for(var Er=Vt.length;Er--;)Z3(Jt,Vt[Er]);return Jt}),NA=Ao(function(Nt,Vt){return Nt==null?{}:U6(Nt,Vt)}),Uh=_f(ga),Hh=_f(Ja),LA=jl(function(Nt,Vt,Jt){return Vt=Vt.toLowerCase(),Nt+(Jt?mh(Vt):Vt)}),_A=jl(function(Nt,Vt,Jt){return Nt+(Jt?"-":"")+Vt.toLowerCase()}),MA=jl(function(Nt,Vt,Jt){return Nt+(Jt?" ":"")+Vt.toLowerCase()}),jA=Bf("toLowerCase"),FA=jl(function(Nt,Vt,Jt){return Nt+(Jt?"_":"")+Vt.toLowerCase()}),QA=jl(function(Nt,Vt,Jt){return Nt+(Jt?" ":"")+Mp(Vt)}),VA=jl(function(Nt,Vt,Jt){return Nt+(Jt?" ":"")+Vt.toUpperCase()}),Mp=Bf("toUpperCase"),Gh=cn(function(Nt,Vt){try{return Ye(Nt,pr,Vt)}catch(Jt){return gp(Jt)?Jt:new Ip(Jt)}}),UA=Ao(function(Nt,Vt){return nt(Vt,function(Jt){Jt=Ps(Jt),mo(Nt,Jt,Np(Nt[Jt],Nt))}),Nt}),HA=Of(),GA=Of(!0),zA=cn(function(Nt,Vt){return function(Jt){return Cu(Jt,Nt,Vt)}}),WA=cn(function(Nt,Vt){return function(Jt){return Cu(Nt,Jt,Vt)}}),XA=np(yt),KA=np(ht),$A=np(kt),qA=Nf(),YA=Nf(!0),ZA=bd(function(Nt,Vt){return Nt+Vt},0),JA=ap("ceil"),ex=bd(function(Nt,Vt){return Nt/Vt},1),tx=ap("floor"),rx=bd(function(Nt,Vt){return Nt*Vt},1),nx=ap("round"),ax=bd(function(Nt,Vt){return Nt-Vt},0);return mr.after=B8,mr.ary=ah,mr.assign=bA,mr.assignIn=Qh,mr.assignInWith=Yd,mr.assignWith=IA,mr.at=SA,mr.before=ih,mr.bind=Np,mr.bindAll=UA,mr.bindKey=_h,mr.castArray=j8,mr.chain=th,mr.chunk=km,mr.compact=bm,mr.concat=Im,mr.cond=qg,mr.conforms=Yg,mr.constant=yp,mr.countBy=sA,mr.create=og,mr.curry=sh,mr.curryRight=oh,mr.debounce=lh,mr.defaults=wA,mr.defaultsDeep=RA,mr.defer=hA,mr.delay=mA,mr.difference=U7,mr.differenceBy=H7,mr.differenceWith=G7,mr.drop=Sm,mr.dropRight=wm,mr.dropRightWhile=Rm,mr.dropWhile=Tm,mr.fill=Bm,mr.filter=g8,mr.flatMap=A8,mr.flatMapDeep=x8,mr.flatMapDepth=y8,mr.flatten=Yf,mr.flattenDeep=Pm,mr.flattenDepth=Om,mr.flip=P8,mr.flow=HA,mr.flowRight=GA,mr.fromPairs=Dm,mr.functions=hg,mr.functionsIn=mg,mr.groupBy=cA,mr.initial=Lm,mr.intersection=z7,mr.intersectionBy=W7,mr.intersectionWith=X7,mr.invert=TA,mr.invertBy=BA,mr.invokeMap=uA,mr.iteratee=Ep,mr.keyBy=dA,mr.keys=ga,mr.keysIn=Ja,mr.map=Pd,mr.mapKeys=Ag,mr.mapValues=xg,mr.matches=Jg,mr.matchesProperty=e7,mr.memoize=Od,mr.merge=OA,mr.mergeWith=Vh,mr.method=zA,mr.methodOf=WA,mr.mixin=Cp,mr.negate=Dd,mr.nthArg=r7,mr.omit=DA,mr.omitBy=yg,mr.once=O8,mr.orderBy=C8,mr.over=XA,mr.overArgs=gA,mr.overEvery=KA,mr.overSome=$A,mr.partial=Lp,mr.partialRight=Mh,mr.partition=pA,mr.pick=NA,mr.pickBy=hh,mr.property=xh,mr.propertyOf=n7,mr.pull=K7,mr.pullAll=Jf,mr.pullAllBy=Fm,mr.pullAllWith=Qm,mr.pullAt=$7,mr.range=qA,mr.rangeRight=YA,mr.rearg=AA,mr.reject=b8,mr.remove=Vm,mr.rest=D8,mr.reverse=hp,mr.sampleSize=S8,mr.set=Cg,mr.setWith=vg,mr.shuffle=w8,mr.slice=Um,mr.sortBy=fA,mr.sortedUniq=$m,mr.sortedUniqBy=qm,mr.split=Qg,mr.spread=N8,mr.tail=Ym,mr.take=Zm,mr.takeRight=Jm,mr.takeRightWhile=e8,mr.takeWhile=t8,mr.tap=o8,mr.throttle=L8,mr.thru=Bd,mr.toArray=dh,mr.toPairs=Uh,mr.toPairsIn=Hh,mr.toPath=l7,mr.toPlainObject=fh,mr.transform=kg,mr.unary=_8,mr.union=q7,mr.unionBy=Y7,mr.unionWith=Z7,mr.uniq=r8,mr.uniqBy=n8,mr.uniqWith=a8,mr.unset=bg,mr.unzip=mp,mr.unzipWith=eh,mr.update=Ig,mr.updateWith=Sg,mr.values=Ql,mr.valuesIn=wg,mr.without=J7,mr.words=Ah,mr.wrap=M8,mr.xor=eA,mr.xorBy=tA,mr.xorWith=rA,mr.zip=nA,mr.zipObject=i8,mr.zipObjectDeep=s8,mr.zipWith=aA,mr.entries=Uh,mr.entriesIn=Hh,mr.extend=Qh,mr.extendWith=Yd,Cp(mr,mr),mr.add=ZA,mr.attempt=Gh,mr.camelCase=LA,mr.capitalize=mh,mr.ceil=JA,mr.clamp=Rg,mr.clone=F8,mr.cloneDeep=V8,mr.cloneDeepWith=U8,mr.cloneWith=Q8,mr.conformsTo=H8,mr.deburr=gh,mr.defaultTo=Zg,mr.divide=ex,mr.endsWith=Pg,mr.eq=is,mr.escape=Og,mr.escapeRegExp=Dg,mr.every=m8,mr.find=oA,mr.findIndex=$f,mr.findKey=lg,mr.findLast=lA,mr.findLastIndex=qf,mr.findLastKey=cg,mr.floor=tx,mr.forEach=rh,mr.forEachRight=nh,mr.forIn=ug,mr.forInRight=dg,mr.forOwn=pg,mr.forOwnRight=fg,mr.get=Ap,mr.gt=xA,mr.gte=yA,mr.has=gg,mr.hasIn=xp,mr.head=Zf,mr.identity=ei,mr.includes=E8,mr.indexOf=Nm,mr.inRange=Tg,mr.invoke=PA,mr.isArguments=T1,mr.isArray=Y0,mr.isArrayBuffer=EA,mr.isArrayLike=Za,mr.isArrayLikeObject=Jn,mr.isBoolean=G8,mr.isBuffer=u2,mr.isDate=CA,mr.isElement=z8,mr.isEmpty=W8,mr.isEqual=X8,mr.isEqualWith=K8,mr.isError=gp,mr.isFinite=$8,mr.isFunction=yo,mr.isInteger=ch,mr.isLength=Nd,mr.isMap=jh,mr.isMatch=q8,mr.isMatchWith=Y8,mr.isNaN=Z8,mr.isNative=J8,mr.isNil=tg,mr.isNull=eg,mr.isNumber=uh,mr.isObject=Wn,mr.isObjectLike=$n,mr.isPlainObject=Su,mr.isRegExp=_p,mr.isSafeInteger=rg,mr.isSet=Fh,mr.isString=Ld,mr.isSymbol=mi,mr.isTypedArray=Wl,mr.isUndefined=ng,mr.isWeakMap=ag,mr.isWeakSet=ig,mr.join=_m,mr.kebabCase=_A,mr.last=Oi,mr.lastIndexOf=Mm,mr.lowerCase=MA,mr.lowerFirst=jA,mr.lt=vA,mr.lte=kA,mr.max=u7,mr.maxBy=d7,mr.mean=p7,mr.meanBy=f7,mr.min=h7,mr.minBy=m7,mr.stubArray=kp,mr.stubFalse=bp,mr.stubObject=a7,mr.stubString=i7,mr.stubTrue=s7,mr.multiply=rx,mr.nth=jm,mr.noConflict=t7,mr.noop=vp,mr.now=qd,mr.pad=Ng,mr.padEnd=Lg,mr.padStart=_g,mr.parseInt=Mg,mr.random=Bg,mr.reduce=v8,mr.reduceRight=k8,mr.repeat=jg,mr.replace=Fg,mr.result=Eg,mr.round=nx,mr.runInContext=Ur,mr.sample=I8,mr.size=R8,mr.snakeCase=FA,mr.some=T8,mr.sortedIndex=Hm,mr.sortedIndexBy=Gm,mr.sortedIndexOf=zm,mr.sortedLastIndex=Wm,mr.sortedLastIndexBy=Xm,mr.sortedLastIndexOf=Km,mr.startCase=QA,mr.startsWith=Vg,mr.subtract=ax,mr.sum=g7,mr.sumBy=A7,mr.template=Ug,mr.times=o7,mr.toFinite=Eo,mr.toInteger=nn,mr.toLength=ph,mr.toLower=Hg,mr.toNumber=Di,mr.toSafeInteger=sg,mr.toString=vn,mr.toUpper=Gg,mr.trim=zg,mr.trimEnd=Wg,mr.trimStart=Xg,mr.truncate=Kg,mr.unescape=$g,mr.uniqueId=c7,mr.upperCase=VA,mr.upperFirst=Mp,mr.each=rh,mr.eachRight=nh,mr.first=Zf,Cp(mr,function(){var Nt={};return Ts(mr,function(Vt,Jt){Sn.call(mr.prototype,Jt)||(Nt[Jt]=Vt)}),Nt}(),{chain:!1}),mr.VERSION=Mr,nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(Nt){mr[Nt].placeholder=mr}),nt(["drop","take"],function(Nt,Vt){R0.prototype[Nt]=function(Jt){Jt=Jt===pr?1:ua(nn(Jt),0);var cr=this.__filtered__&&!Vt?new R0(this):this.clone();return cr.__filtered__?cr.__takeCount__=Ta(Jt,cr.__takeCount__):cr.__views__.push({size:Ta(Jt,U0),type:Nt+(cr.__dir__<0?"Right":"")}),cr},R0.prototype[Nt+"Right"]=function(Jt){return this.reverse()[Nt](Jt).reverse()}}),nt(["filter","map","takeWhile"],function(Nt,Vt){var Jt=Vt+1,cr=Jt==rn||Jt==$0;R0.prototype[Nt]=function(Er){var Sr=this.clone();return Sr.__iteratees__.push({iteratee:z0(Er,3),type:Jt}),Sr.__filtered__=Sr.__filtered__||cr,Sr}}),nt(["head","last"],function(Nt,Vt){var Jt="take"+(Vt?"Right":"");R0.prototype[Nt]=function(){return this[Jt](1).value()[0]}}),nt(["initial","tail"],function(Nt,Vt){var Jt="drop"+(Vt?"":"Right");R0.prototype[Nt]=function(){return this.__filtered__?new R0(this):this[Jt](1)}}),R0.prototype.compact=function(){return this.filter(ei)},R0.prototype.find=function(Nt){return this.filter(Nt).head()},R0.prototype.findLast=function(Nt){return this.reverse().find(Nt)},R0.prototype.invokeMap=cn(function(Nt,Vt){return typeof Nt=="function"?new R0(this):this.map(function(Jt){return Cu(Jt,Nt,Vt)})}),R0.prototype.reject=function(Nt){return this.filter(Dd(z0(Nt)))},R0.prototype.slice=function(Nt,Vt){Nt=nn(Nt);var Jt=this;return Jt.__filtered__&&(Nt>0||Vt<0)?new R0(Jt):(Nt<0?Jt=Jt.takeRight(-Nt):Nt&&(Jt=Jt.drop(Nt)),Vt!==pr&&(Vt=nn(Vt),Jt=Vt<0?Jt.dropRight(-Vt):Jt.take(Vt-Nt)),Jt)},R0.prototype.takeRightWhile=function(Nt){return this.reverse().takeWhile(Nt).reverse()},R0.prototype.toArray=function(){return this.take(U0)},Ts(R0.prototype,function(Nt,Vt){var Jt=/^(?:filter|find|map|reject)|While$/.test(Vt),cr=/^(?:head|last)$/.test(Vt),Er=mr[cr?"take"+(Vt=="last"?"Right":""):Vt],Sr=cr||/^find/.test(Vt);Er&&(mr.prototype[Vt]=function(){var jr=this.__wrapped__,Fr=cr?[1]:arguments,Kr=jr instanceof R0,l0=Fr[0],i0=Kr||Y0(jr),p0=function(dn){var pn=Er.apply(mr,Ct([dn],Fr));return cr&&k0?pn[0]:pn};i0&&Jt&&typeof l0=="function"&&l0.length!=1&&(Kr=i0=!1);var k0=this.__chain__,B0=!!this.__actions__.length,M0=Sr&&!k0,tn=Kr&&!B0;if(!Sr&&i0){jr=tn?jr:new R0(this);var F0=Nt.apply(jr,Fr);return F0.__actions__.push({func:Bd,args:[p0],thisArg:pr}),new Q0(F0,k0)}return M0&&tn?Nt.apply(this,Fr):(F0=this.thru(p0),M0?cr?F0.value()[0]:F0.value():F0)})}),nt(["pop","push","shift","sort","splice","unshift"],function(Nt){var Vt=Md[Nt],Jt=/^(?:push|sort|unshift)$/.test(Nt)?"tap":"thru",cr=/^(?:pop|shift)$/.test(Nt);mr.prototype[Nt]=function(){var Er=arguments;if(cr&&!this.__chain__){var Sr=this.value();return Vt.apply(Y0(Sr)?Sr:[],Er)}return this[Jt](function(jr){return Vt.apply(Y0(jr)?jr:[],Er)})}}),Ts(R0.prototype,function(Nt,Vt){var Jt=mr[Vt];if(Jt){var cr=Jt.name+"";Sn.call(Gl,cr)||(Gl[cr]=[]),Gl[cr].push({name:Vt,func:Jt})}}),Gl[kd(pr,Tr).name]=[{name:"wrapper",func:pr}],R0.prototype.clone=qa,R0.prototype.reverse=j3,R0.prototype.value=J4,mr.prototype.at=iA,mr.prototype.chain=l8,mr.prototype.commit=c8,mr.prototype.next=u8,mr.prototype.plant=p8,mr.prototype.reverse=f8,mr.prototype.toJSON=mr.prototype.valueOf=mr.prototype.value=h8,mr.prototype.first=mr.prototype.head,wu&&(mr.prototype[wu]=d8),mr},_l=Z4();E1?((E1.exports=_l)._=_l,_3._=_l):ka._=_l}).call(commonjsGlobal)}(lodash_min,lodash_min.exports);var lodash_minExports=lodash_min.exports,_mapping={};(function(Be){Be.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},Be.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},Be.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},Be.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},Be.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},Be.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},Be.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},Be.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},Be.realToAlias=function(){var Le=Object.prototype.hasOwnProperty,Ye=Be.aliasToReal,tt={};for(var nt in Ye){var ft=Ye[nt];Le.call(tt,ft)?tt[ft].push(nt):tt[ft]=[nt]}return tt}(),Be.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},Be.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},Be.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(_mapping);var placeholder$1={},mapping=_mapping,fallbackHolder=placeholder$1,push$1=Array.prototype.push;function baseArity(Be,Le){return Le==2?function(Ye,tt){return Be.apply(void 0,arguments)}:function(Ye){return Be.apply(void 0,arguments)}}function baseAry(Be,Le){return Le==2?function(Ye,tt){return Be(Ye,tt)}:function(Ye){return Be(Ye)}}function cloneArray(Be){for(var Le=Be?Be.length:0,Ye=Array(Le);Le--;)Ye[Le]=Be[Le];return Ye}function createCloner(Be){return function(Le){return Be({},Le)}}function flatSpread(Be,Le){return function(){for(var Ye=arguments.length,tt=Ye-1,nt=Array(Ye);Ye--;)nt[Ye]=arguments[Ye];var ft=nt[Le],ht=nt.slice(0,Le);return ft&&push$1.apply(ht,ft),Le!=tt&&push$1.apply(ht,nt.slice(Le+1)),Be.apply(this,ht)}}function wrapImmutable(Be,Le){return function(){var Ye=arguments.length;if(Ye){for(var tt=Array(Ye);Ye--;)tt[Ye]=arguments[Ye];var nt=tt[0]=Le.apply(void 0,tt);return Be.apply(void 0,tt),nt}}}function baseConvert(Be,Le,Ye,tt){var nt=typeof Le=="function",ft=Le===Object(Le);if(ft&&(tt=Ye,Ye=Le,Le=void 0),Ye==null)throw new TypeError;tt||(tt={});var ht={cap:"cap"in tt?tt.cap:!0,curry:"curry"in tt?tt.curry:!0,fixed:"fixed"in tt?tt.fixed:!0,immutable:"immutable"in tt?tt.immutable:!0,rearg:"rearg"in tt?tt.rearg:!0},gt=nt?Ye:fallbackHolder,At="curry"in tt&&tt.curry,xt="fixed"in tt&&tt.fixed,yt="rearg"in tt&&tt.rearg,Ct=nt?Ye.runInContext():void 0,Et=nt?Ye:{ary:Be.ary,assign:Be.assign,clone:Be.clone,curry:Be.curry,forEach:Be.forEach,isArray:Be.isArray,isError:Be.isError,isFunction:Be.isFunction,isWeakMap:Be.isWeakMap,iteratee:Be.iteratee,keys:Be.keys,rearg:Be.rearg,toInteger:Be.toInteger,toPath:Be.toPath},vt=Et.ary,kt=Et.assign,bt=Et.clone,wt=Et.curry,It=Et.forEach,Rt=Et.isArray,Tt=Et.isError,Bt=Et.isFunction,Pt=Et.isWeakMap,Dt=Et.keys,Ot=Et.rearg,Lt=Et.toInteger,Wt=Et.toPath,$t=Dt(mapping.aryMethod),qt={castArray:function(dr){return function(){var rr=arguments[0];return Rt(rr)?dr(cloneArray(rr)):dr.apply(void 0,arguments)}},iteratee:function(dr){return function(){var rr=arguments[0],gr=arguments[1],yr=dr(rr,gr),or=yr.length;return ht.cap&&typeof gr=="number"?(gr=gr>2?gr-2:1,or&&or<=gr?yr:baseAry(yr,gr)):yr}},mixin:function(dr){return function(rr){var gr=this;if(!Bt(gr))return dr(gr,Object(rr));var yr=[];return It(Dt(rr),function(or){Bt(rr[or])&&yr.push([or,gr.prototype[or]])}),dr(gr,Object(rr)),It(yr,function(or){var ir=or[1];Bt(ir)?gr.prototype[or[0]]=ir:delete gr.prototype[or[0]]}),gr}},nthArg:function(dr){return function(rr){var gr=rr<0?1:Lt(rr)+1;return wt(dr(rr),gr)}},rearg:function(dr){return function(rr,gr){var yr=gr?gr.length:0;return wt(dr(rr,gr),yr)}},runInContext:function(dr){return function(rr){return baseConvert(Be,dr(rr),tt)}}};function Ht(dr,rr){if(ht.cap){var gr=mapping.iterateeRearg[dr];if(gr)return Gt(rr,gr);var yr=!nt&&mapping.iterateeAry[dr];if(yr)return zt(rr,yr)}return rr}function Ut(dr,rr,gr){return At||ht.curry&&gr>1?wt(rr,gr):rr}function Ft(dr,rr,gr){if(ht.fixed&&(xt||!mapping.skipFixed[dr])){var yr=mapping.methodSpread[dr],or=yr&&yr.start;return or===void 0?vt(rr,gr):flatSpread(rr,or)}return rr}function Xt(dr,rr,gr){return ht.rearg&&gr>1&&(yt||!mapping.skipRearg[dr])?Ot(rr,mapping.methodRearg[dr]||mapping.aryRearg[gr]):rr}function _t(dr,rr){rr=Wt(rr);for(var gr=-1,yr=rr.length,or=yr-1,ir=bt(Object(dr)),Zt=ir;Zt!=null&&++gr<yr;){var Qt=rr[gr],er=Zt[Qt];er!=null&&!(Bt(er)||Tt(er)||Pt(er))&&(Zt[Qt]=bt(gr==or?er:Object(er))),Zt=Zt[Qt]}return ir}function Mt(dr){return tr.runInContext.convert(dr)(void 0)}function jt(dr,rr){var gr=mapping.aliasToReal[dr]||dr,yr=mapping.remap[gr]||gr,or=tt;return function(ir){var Zt=nt?Ct:Et,Qt=nt?Ct[yr]:rr,er=kt(kt({},or),ir);return baseConvert(Zt,gr,Qt,er)}}function zt(dr,rr){return Yt(dr,function(gr){return typeof gr=="function"?baseAry(gr,rr):gr})}function Gt(dr,rr){return Yt(dr,function(gr){var yr=rr.length;return baseArity(Ot(baseAry(gr,yr),rr),yr)})}function Yt(dr,rr){return function(){var gr=arguments.length;if(!gr)return dr();for(var yr=Array(gr);gr--;)yr[gr]=arguments[gr];var or=ht.rearg?0:gr-1;return yr[or]=rr(yr[or]),dr.apply(void 0,yr)}}function ar(dr,rr,gr){var yr,or=mapping.aliasToReal[dr]||dr,ir=rr,Zt=qt[or];return Zt?ir=Zt(rr):ht.immutable&&(mapping.mutate.array[or]?ir=wrapImmutable(rr,cloneArray):mapping.mutate.object[or]?ir=wrapImmutable(rr,createCloner(rr)):mapping.mutate.set[or]&&(ir=wrapImmutable(rr,_t))),It($t,function(Qt){return It(mapping.aryMethod[Qt],function(er){if(or==er){var nr=mapping.methodSpread[or],lr=nr&&nr.afterRearg;return yr=lr?Ft(or,Xt(or,ir,Qt),Qt):Xt(or,Ft(or,ir,Qt),Qt),yr=Ht(or,yr),yr=Ut(or,yr,Qt),!1}}),!yr}),yr||(yr=ir),yr==rr&&(yr=At?wt(yr,1):function(){return rr.apply(this,arguments)}),yr.convert=jt(or,rr),yr.placeholder=rr.placeholder=gr,yr}if(!ft)return ar(Le,Ye,gt);var tr=Ye,sr=[];return It($t,function(dr){It(mapping.aryMethod[dr],function(rr){var gr=tr[mapping.remap[rr]||rr];gr&&sr.push([rr,ar(rr,gr,tr)])})}),It(Dt(tr),function(dr){var rr=tr[dr];if(typeof rr=="function"){for(var gr=sr.length;gr--;)if(sr[gr][0]==dr)return;rr.convert=jt(dr,rr),sr.push([dr,rr])}}),It(sr,function(dr){tr[dr[0]]=dr[1]}),tr.convert=Mt,tr.placeholder=tr,It(Dt(tr),function(dr){It(mapping.realToAlias[dr]||[],function(rr){tr[rr]=tr[dr]})}),tr}var _baseConvert=baseConvert,_=lodash_minExports.runInContext(),fp=_baseConvert(_,_),rngBrowser={exports:{}},getRandomValues$1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues$1){var rnds8$1=new Uint8Array(16);rngBrowser.exports=function(){return getRandomValues$1(rnds8$1),rnds8$1}}else{var rnds=new Array(16);rngBrowser.exports=function(){for(var Le=0,Ye;Le<16;Le++)Le&3||(Ye=Math.random()*4294967296),rnds[Le]=Ye>>>((Le&3)<<3)&255;return rnds}}for(var rngBrowserExports=rngBrowser.exports,byteToHex$1=[],i$2=0;i$2<256;++i$2)byteToHex$1[i$2]=(i$2+256).toString(16).substr(1);function bytesToUuid$2(Be,Le){var Ye=Le||0,tt=byteToHex$1;return[tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],"-",tt[Be[Ye++]],tt[Be[Ye++]],"-",tt[Be[Ye++]],tt[Be[Ye++]],"-",tt[Be[Ye++]],tt[Be[Ye++]],"-",tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]],tt[Be[Ye++]]].join("")}var bytesToUuid_1=bytesToUuid$2,rng$3=rngBrowserExports,bytesToUuid$1=bytesToUuid_1,_nodeId$1,_clockseq$1,_lastMSecs$1=0,_lastNSecs$1=0;function v1$3(Be,Le,Ye){var tt=Le&&Ye||0,nt=Le||[];Be=Be||{};var ft=Be.node||_nodeId$1,ht=Be.clockseq!==void 0?Be.clockseq:_clockseq$1;if(ft==null||ht==null){var gt=rng$3();ft==null&&(ft=_nodeId$1=[gt[0]|1,gt[1],gt[2],gt[3],gt[4],gt[5]]),ht==null&&(ht=_clockseq$1=(gt[6]<<8|gt[7])&16383)}var At=Be.msecs!==void 0?Be.msecs:new Date().getTime(),xt=Be.nsecs!==void 0?Be.nsecs:_lastNSecs$1+1,yt=At-_lastMSecs$1+(xt-_lastNSecs$1)/1e4;if(yt<0&&Be.clockseq===void 0&&(ht=ht+1&16383),(yt<0||At>_lastMSecs$1)&&Be.nsecs===void 0&&(xt=0),xt>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs$1=At,_lastNSecs$1=xt,_clockseq$1=ht,At+=122192928e5;var Ct=((At&268435455)*1e4+xt)%4294967296;nt[tt++]=Ct>>>24&255,nt[tt++]=Ct>>>16&255,nt[tt++]=Ct>>>8&255,nt[tt++]=Ct&255;var Et=At/4294967296*1e4&268435455;nt[tt++]=Et>>>8&255,nt[tt++]=Et&255,nt[tt++]=Et>>>24&15|16,nt[tt++]=Et>>>16&255,nt[tt++]=ht>>>8|128,nt[tt++]=ht&255;for(var vt=0;vt<6;++vt)nt[tt+vt]=ft[vt];return Le||bytesToUuid$1(nt)}var v1_1=v1$3,rng$2=rngBrowserExports,bytesToUuid=bytesToUuid_1;function v4$3(Be,Le,Ye){var tt=Le&&Ye||0;typeof Be=="string"&&(Le=Be==="binary"?new Array(16):null,Be=null),Be=Be||{};var nt=Be.random||(Be.rng||rng$2)();if(nt[6]=nt[6]&15|64,nt[8]=nt[8]&63|128,Le)for(var ft=0;ft<16;++ft)Le[tt+ft]=nt[ft];return Le||bytesToUuid(nt)}var v4_1=v4$3,v1$2=v1_1,v4$2=v4_1,uuid=v4$2;uuid.v1=v1$2,uuid.v4=v4$2;var uuid_1$2=uuid;const uuid$1=getDefaultExportFromCjs(uuid_1$2);let OTPublisher$5=class extends React.Component{constructor(Ye,tt){super(Ye);P0(this,"sessionConnectedHandler",()=>{this.publishToSession(this.state.publisher)});P0(this,"streamCreatedHandler",Ye=>{this.setState({lastStreamId:Ye.stream.id})});this.state={publisher:null,lastStreamId:"",session:Ye.session||tt.session||null}}componentDidMount(){this.createPublisher()}componentDidUpdate(Ye,tt){const nt=(gt,At)=>gt===void 0?At:gt,ft=(gt,At)=>{const xt=nt(Ye.properties[gt],At),yt=nt(this.props.properties[gt],At);return xt!==yt},ht=(gt,At)=>{if(ft(gt,At)){const xt=nt(this.props.properties[gt],At);this.state.publisher[gt](xt)}};if(ft("videoSource",void 0)){this.destroyPublisher(),this.createPublisher();return}ht("publishAudio",!0),ht("publishVideo",!0),this.state.session!==tt.session&&(this.destroyPublisher(tt.session),this.createPublisher())}componentWillUnmount(){this.state.session&&this.state.session.off("sessionConnected",this.sessionConnectedHandler),this.destroyPublisher()}getPublisher(){return this.state.publisher}destroyPublisher(Ye=this.state.session){delete this.publisherId,this.state.publisher&&(this.state.publisher.off("streamCreated",this.streamCreatedHandler),this.props.eventHandlers&&typeof this.props.eventHandlers=="object"&&this.state.publisher.once("destroyed",()=>{this.state.publisher.off(this.props.eventHandlers)}),Ye&&Ye.unpublish(this.state.publisher),this.state.publisher.destroy())}publishToSession(Ye){const{publisherId:tt}=this;this.state.session.publish(Ye,nt=>{tt===this.publisherId&&(nt?this.errorHandler(nt):typeof this.props.onPublish=="function"&&this.props.onPublish())})}createPublisher(){if(!this.state.session){this.setState({publisher:null,lastStreamId:""});return}const Ye=this.props.properties||{};let tt;Ye.insertDefaultUI!==!1&&(tt=document.createElement("div"),tt.setAttribute("class","OTPublisherContainer"),this.node.appendChild(tt)),this.publisherId=uuid$1();const{publisherId:nt}=this;this.errorHandler=once$2(ht=>{nt===this.publisherId&&typeof this.props.onError=="function"&&this.props.onError(ht)});const ft=OT.initPublisher(tt,Ye,ht=>{nt===this.publisherId&&(ht?this.errorHandler(ht):typeof this.props.onInit=="function"&&this.props.onInit())});if(ft.on("streamCreated",this.streamCreatedHandler),ft.setStyle({buttonDisplayMode:"off"}),this.props.eventHandlers&&typeof this.props.eventHandlers=="object"){const ht=fp.omitBy(fp.isNil)(this.props.eventHandlers);ft.on(ht)}this.state.session.connection?this.publishToSession(ft):this.state.session.once("sessionConnected",this.sessionConnectedHandler),this.setState({publisher:ft,lastStreamId:""})}render(){const{className:Ye,style:tt}=this.props;return jsxRuntimeExports.jsx("div",{className:Ye,style:tt,ref:nt=>{this.node=nt}})}};OTPublisher$5.propTypes={session:PropTypes.shape({connection:PropTypes.shape({connectionId:PropTypes.string}),once:PropTypes.func,off:PropTypes.func,publish:PropTypes.func,unpublish:PropTypes.func}),className:PropTypes.string,style:PropTypes.object,properties:PropTypes.object,eventHandlers:PropTypes.objectOf(PropTypes.func),onInit:PropTypes.func,onPublish:PropTypes.func,onError:PropTypes.func},OTPublisher$5.defaultProps={session:null,className:"",style:{},properties:{},eventHandlers:null,onInit:null,onPublish:null,onError:null},OTPublisher$5.contextTypes={session:PropTypes.shape({connection:PropTypes.shape({connectionId:PropTypes.string}),once:PropTypes.func,off:PropTypes.func,publish:PropTypes.func,unpublish:PropTypes.func})};let OTSubscriberContext$4=class extends React.Component{getChildContext(){return{stream:this.props.stream}}render(){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:this.props.children})}};OTSubscriberContext$4.propTypes={children:PropTypes.element.isRequired,stream:PropTypes.shape({streamId:PropTypes.string}).isRequired},OTSubscriberContext$4.childContextTypes={stream:PropTypes.shape({streamId:PropTypes.string})};function OTStreams$4(Be,Le){const Ye=Be.session||Le.session||null,tt=Be.streams||Le.streams||null;if(!Ye)return jsxRuntimeExports.jsx("div",{});const nt=React.Children.only(Be.children);return Array.isArray(tt)?tt.map(ht=>nt&&jsxRuntimeExports.jsx(OTSubscriberContext$4,{stream:ht,children:React.cloneElement(nt)},ht.id)):null}OTStreams$4.propTypes={children:PropTypes.element.isRequired,session:PropTypes.shape({publish:PropTypes.func,subscribe:PropTypes.func}),streams:PropTypes.arrayOf(PropTypes.object)},OTStreams$4.defaultProps={session:null,streams:null},OTStreams$4.contextTypes={session:PropTypes.shape({publish:PropTypes.func,subscribe:PropTypes.func}),streams:PropTypes.arrayOf(PropTypes.object)};let OTSubscriber$4=class extends React.Component{constructor(Le,Ye){super(Le),this.state={subscriber:null,stream:Le.stream||Ye.stream||null,session:Le.session||Ye.session||null,currentRetryAttempt:0},this.maxRetryAttempts=Le.maxRetryAttempts||5,this.retryAttemptTimeout=Le.retryAttemptTimeout||1e3}componentDidMount(){this.createSubscriber()}componentDidUpdate(Le,Ye){const tt=(ft,ht,gt)=>ft===void 0?gt:ht(ft),nt=ft=>{const ht=tt(Le.properties[ft],Boolean,!0),gt=tt(this.props.properties[ft],Boolean,!0);ht!==gt&&this.state.subscriber[ft](gt)};nt("subscribeToAudio"),nt("subscribeToVideo"),(Ye.session!==this.state.session||Ye.stream!==this.state.stream)&&(this.destroySubscriber(Ye.session),this.createSubscriber())}componentWillUnmount(){this.destroySubscriber()}getSubscriber(){return this.state.subscriber}createSubscriber(){if(!this.state.session||!this.state.stream){this.setState({subscriber:null});return}const Le=this.props.properties||{};let Ye;Le.insertDefaultUI!==!1&&(Ye=document.createElement("div"),Ye.setAttribute("class","OTSubscriberContainer"),this.node.appendChild(Ye)),this.subscriberId=uuid$1();const{subscriberId:tt}=this,nt=this.state.session.subscribe(this.state.stream,Ye,this.props.properties,ft=>{tt===this.subscriberId&&(ft&&this.props.retry&&this.state.currentRetryAttempt<this.maxRetryAttempts-1&&this.handleRetrySubscriber(),ft&&typeof this.props.onError=="function"?this.props.onError(ft):!ft&&typeof this.props.onSubscribe=="function"&&this.props.onSubscribe())});this.props.eventHandlers&&typeof this.props.eventHandlers=="object"&&nt.on(this.props.eventHandlers),this.setState({subscriber:nt})}handleRetrySubscriber(){setTimeout(()=>{this.setState(Le=>({currentRetryAttempt:Le.currentRetryAttempt+1,subscriber:null})),this.createSubscriber()},this.retryAttemptTimeout)}destroySubscriber(Le=this.props.session){delete this.subscriberId,this.state.subscriber&&(this.props.eventHandlers&&typeof this.props.eventHandlers=="object"&&this.state.subscriber.once("destroyed",()=>{this.state.subscriber.off(this.props.eventHandlers)}),Le&&Le.unsubscribe(this.state.subscriber))}render(){const{className:Le,style:Ye}=this.props;return jsxRuntimeExports.jsx("div",{className:Le,style:Ye,ref:tt=>{this.node=tt}})}};OTSubscriber$4.propTypes={stream:PropTypes.shape({streamId:PropTypes.string}),session:PropTypes.shape({subscribe:PropTypes.func,unsubscribe:PropTypes.func}),className:PropTypes.string,style:PropTypes.object,properties:PropTypes.object,retry:PropTypes.bool,maxRetryAttempts:PropTypes.number,retryAttemptTimeout:PropTypes.number,eventHandlers:PropTypes.objectOf(PropTypes.func),onSubscribe:PropTypes.func,onError:PropTypes.func},OTSubscriber$4.defaultProps={stream:null,session:null,className:"",style:{},properties:{},retry:!1,maxRetryAttempts:5,retryAttemptTimeout:1e3,eventHandlers:null,onSubscribe:null,onError:null},OTSubscriber$4.contextTypes={stream:PropTypes.shape({streamId:PropTypes.string}),session:PropTypes.shape({subscribe:PropTypes.func,unsubscribe:PropTypes.func})};var getDisplayName$1={};Object.defineProperty(getDisplayName$1,"__esModule",{value:!0});var _default$e=getDisplayName$1.default=getDisplayName;function getDisplayName(Be){return Be.displayName||Be.name||(typeof Be=="string"&&Be.length>0?Be:"Unknown")}var script={exports:{}};/*!
|
|
2798
2798
|
* $script.js JS loader & dependency manager
|
|
2799
2799
|
* https://github.com/ded/script.js
|
|
2800
2800
|
* (c) Dustin Diaz 2014 | License MIT
|
|
@@ -6736,7 +6736,7 @@ newPrivacyConsent.text4
|
|
|
6736
6736
|
border: none;
|
|
6737
6737
|
font-weight: bold;
|
|
6738
6738
|
font-size: 16px;
|
|
6739
|
-
`,ScanTicket=({session:Be,nextStep:Le})=>{const[Ye,tt]=React.useState(""),[nt,ft]=React.useState(0),ht=React.useRef(null),{t:gt}=useTranslation$1(),At=React.useCallback(async()=>{const Ct=ht.current;if(!Ct)return;const Et=Ct.getCanvas(Ct.video.videoWidth,Ct.video.videoHeight);try{console.log("detect",Et.canvas,codeReader$1);const vt=await codeReader$1.decodeFromCanvas(Et.canvas);tt("capturing");try{(await postQrLink({session:Be,link:vt.getText()})).success&&(tt("success"),await sleep(3e3),Le())}catch{ft(bt=>bt+1),tt("error")}await sleep(3e3),At()}catch(vt){console.error(vt),await sleep(1e3),At()}},[Le,Be]);React.useEffect(()=>{nt===3&&Le()},[nt,Le]);const xt=React.useCallback(async()=>{await sleep(3e3),At()},[At]),yt=React.useCallback(()=>{console.log("error :p")},[]);return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(FaceMask$1,{mode:Ye}),jsxRuntimeExports.jsx(Webcam,{ref:ht,onPlay:xt,videoSource:"environment",onError:yt,token:Be.token,type:"fiscalQR",showCustomCameraPermissionScreen:!1}),Ye==="error"&&jsxRuntimeExports.jsx(ErrorText,{children:gt("fiscalQr.invalidQr")}),jsxRuntimeExports.jsx(SkipButton$5,{onClick:Le,children:gt("common.skip")})]})};function renderFiscalQr(Be,{onSuccess:Le,session:Ye}){const tt=createRoot$1(Be),nt={onSuccess:handleUnmountRoot(Le,tt,Be),onBoarding:this,session:Ye};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye.token,children:jsxRuntimeExports.jsx(FiscalQr,{...nt})}),Be,tt)}const getFinishStatus=(Be,{token:Le})=>exports.api.get(`/omni/finish-status${Be?`?flowId=${Be}`:""}`,{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data);var lib={},ErrorCorrectLevel={L:1,M:0,Q:3,H:2},mode$1={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},mode=mode$1;function QR8bitByte(Be){this.mode=mode.MODE_8BIT_BYTE,this.data=Be}QR8bitByte.prototype={getLength:function(Be){return this.data.length},write:function(Be){for(var Le=0;Le<this.data.length;Le++)Be.put(this.data.charCodeAt(Le),8)}};var _8BitByte=QR8bitByte,ECL=ErrorCorrectLevel;function QRRSBlock(Be,Le){this.totalCount=Be,this.dataCount=Le}QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],QRRSBlock.getRSBlocks=function(Be,Le){var Ye=QRRSBlock.getRsBlockTable(Be,Le);if(Ye==null)throw new Error("bad rs block @ typeNumber:"+Be+"/errorCorrectLevel:"+Le);for(var tt=Ye.length/3,nt=new Array,ft=0;ft<tt;ft++)for(var ht=Ye[ft*3+0],gt=Ye[ft*3+1],At=Ye[ft*3+2],xt=0;xt<ht;xt++)nt.push(new QRRSBlock(gt,At));return nt},QRRSBlock.getRsBlockTable=function(Be,Le){switch(Le){case ECL.L:return QRRSBlock.RS_BLOCK_TABLE[(Be-1)*4+0];case ECL.M:return QRRSBlock.RS_BLOCK_TABLE[(Be-1)*4+1];case ECL.Q:return QRRSBlock.RS_BLOCK_TABLE[(Be-1)*4+2];case ECL.H:return QRRSBlock.RS_BLOCK_TABLE[(Be-1)*4+3];default:return}};var RSBlock$1=QRRSBlock;function QRBitBuffer(){this.buffer=new Array,this.length=0}QRBitBuffer.prototype={get:function(Be){var Le=Math.floor(Be/8);return(this.buffer[Le]>>>7-Be%8&1)==1},put:function(Be,Le){for(var Ye=0;Ye<Le;Ye++)this.putBit((Be>>>Le-Ye-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(Be){var Le=Math.floor(this.length/8);this.buffer.length<=Le&&this.buffer.push(0),Be&&(this.buffer[Le]|=128>>>this.length%8),this.length++}};for(var BitBuffer$1=QRBitBuffer,QRMath={glog:function(Be){if(Be<1)throw new Error("glog("+Be+")");return QRMath.LOG_TABLE[Be]},gexp:function(Be){for(;Be<0;)Be+=255;for(;Be>=256;)Be-=255;return QRMath.EXP_TABLE[Be]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},i=0;i<8;i++)QRMath.EXP_TABLE[i]=1<<i;for(var i=8;i<256;i++)QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];for(var i=0;i<255;i++)QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;var math$2=QRMath,math$1=math$2;function QRPolynomial(Be,Le){if(Be.length==null)throw new Error(Be.length+"/"+Le);for(var Ye=0;Ye<Be.length&&Be[Ye]==0;)Ye++;this.num=new Array(Be.length-Ye+Le);for(var tt=0;tt<Be.length-Ye;tt++)this.num[tt]=Be[tt+Ye]}QRPolynomial.prototype={get:function(Be){return this.num[Be]},getLength:function(){return this.num.length},multiply:function(Be){for(var Le=new Array(this.getLength()+Be.getLength()-1),Ye=0;Ye<this.getLength();Ye++)for(var tt=0;tt<Be.getLength();tt++)Le[Ye+tt]^=math$1.gexp(math$1.glog(this.get(Ye))+math$1.glog(Be.get(tt)));return new QRPolynomial(Le,0)},mod:function(Be){if(this.getLength()-Be.getLength()<0)return this;for(var Le=math$1.glog(this.get(0))-math$1.glog(Be.get(0)),Ye=new Array(this.getLength()),tt=0;tt<this.getLength();tt++)Ye[tt]=this.get(tt);for(var tt=0;tt<Be.getLength();tt++)Ye[tt]^=math$1.gexp(math$1.glog(Be.get(tt))+Le);return new QRPolynomial(Ye,0).mod(Be)}};var Polynomial$2=QRPolynomial,Mode=mode$1,Polynomial$1=Polynomial$2,math=math$2,QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(Be){for(var Le=Be<<10;QRUtil.getBCHDigit(Le)-QRUtil.getBCHDigit(QRUtil.G15)>=0;)Le^=QRUtil.G15<<QRUtil.getBCHDigit(Le)-QRUtil.getBCHDigit(QRUtil.G15);return(Be<<10|Le)^QRUtil.G15_MASK},getBCHTypeNumber:function(Be){for(var Le=Be<<12;QRUtil.getBCHDigit(Le)-QRUtil.getBCHDigit(QRUtil.G18)>=0;)Le^=QRUtil.G18<<QRUtil.getBCHDigit(Le)-QRUtil.getBCHDigit(QRUtil.G18);return Be<<12|Le},getBCHDigit:function(Be){for(var Le=0;Be!=0;)Le++,Be>>>=1;return Le},getPatternPosition:function(Be){return QRUtil.PATTERN_POSITION_TABLE[Be-1]},getMask:function(Be,Le,Ye){switch(Be){case QRMaskPattern.PATTERN000:return(Le+Ye)%2==0;case QRMaskPattern.PATTERN001:return Le%2==0;case QRMaskPattern.PATTERN010:return Ye%3==0;case QRMaskPattern.PATTERN011:return(Le+Ye)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(Le/2)+Math.floor(Ye/3))%2==0;case QRMaskPattern.PATTERN101:return Le*Ye%2+Le*Ye%3==0;case QRMaskPattern.PATTERN110:return(Le*Ye%2+Le*Ye%3)%2==0;case QRMaskPattern.PATTERN111:return(Le*Ye%3+(Le+Ye)%2)%2==0;default:throw new Error("bad maskPattern:"+Be)}},getErrorCorrectPolynomial:function(Be){for(var Le=new Polynomial$1([1],0),Ye=0;Ye<Be;Ye++)Le=Le.multiply(new Polynomial$1([1,math.gexp(Ye)],0));return Le},getLengthInBits:function(Be,Le){if(1<=Le&&Le<10)switch(Be){case Mode.MODE_NUMBER:return 10;case Mode.MODE_ALPHA_NUM:return 9;case Mode.MODE_8BIT_BYTE:return 8;case Mode.MODE_KANJI:return 8;default:throw new Error("mode:"+Be)}else if(Le<27)switch(Be){case Mode.MODE_NUMBER:return 12;case Mode.MODE_ALPHA_NUM:return 11;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 10;default:throw new Error("mode:"+Be)}else if(Le<41)switch(Be){case Mode.MODE_NUMBER:return 14;case Mode.MODE_ALPHA_NUM:return 13;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 12;default:throw new Error("mode:"+Be)}else throw new Error("type:"+Le)},getLostPoint:function(Be){for(var Le=Be.getModuleCount(),Ye=0,tt=0;tt<Le;tt++)for(var nt=0;nt<Le;nt++){for(var ft=0,ht=Be.isDark(tt,nt),gt=-1;gt<=1;gt++)if(!(tt+gt<0||Le<=tt+gt))for(var At=-1;At<=1;At++)nt+At<0||Le<=nt+At||gt==0&&At==0||ht==Be.isDark(tt+gt,nt+At)&&ft++;ft>5&&(Ye+=3+ft-5)}for(var tt=0;tt<Le-1;tt++)for(var nt=0;nt<Le-1;nt++){var xt=0;Be.isDark(tt,nt)&&xt++,Be.isDark(tt+1,nt)&&xt++,Be.isDark(tt,nt+1)&&xt++,Be.isDark(tt+1,nt+1)&&xt++,(xt==0||xt==4)&&(Ye+=3)}for(var tt=0;tt<Le;tt++)for(var nt=0;nt<Le-6;nt++)Be.isDark(tt,nt)&&!Be.isDark(tt,nt+1)&&Be.isDark(tt,nt+2)&&Be.isDark(tt,nt+3)&&Be.isDark(tt,nt+4)&&!Be.isDark(tt,nt+5)&&Be.isDark(tt,nt+6)&&(Ye+=40);for(var nt=0;nt<Le;nt++)for(var tt=0;tt<Le-6;tt++)Be.isDark(tt,nt)&&!Be.isDark(tt+1,nt)&&Be.isDark(tt+2,nt)&&Be.isDark(tt+3,nt)&&Be.isDark(tt+4,nt)&&!Be.isDark(tt+5,nt)&&Be.isDark(tt+6,nt)&&(Ye+=40);for(var yt=0,nt=0;nt<Le;nt++)for(var tt=0;tt<Le;tt++)Be.isDark(tt,nt)&&yt++;var Ct=Math.abs(100*yt/Le/Le-50)/5;return Ye+=Ct*10,Ye}},util$1=QRUtil,BitByte=_8BitByte,RSBlock=RSBlock$1,BitBuffer=BitBuffer$1,util=util$1,Polynomial=Polynomial$2;function QRCode$1(Be,Le){this.typeNumber=Be,this.errorCorrectLevel=Le,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var proto=QRCode$1.prototype;proto.addData=function(Be){var Le=new BitByte(Be);this.dataList.push(Le),this.dataCache=null},proto.isDark=function(Be,Le){if(Be<0||this.moduleCount<=Be||Le<0||this.moduleCount<=Le)throw new Error(Be+","+Le);return this.modules[Be][Le]},proto.getModuleCount=function(){return this.moduleCount},proto.make=function(){if(this.typeNumber<1){var Be=1;for(Be=1;Be<40;Be++){for(var Le=RSBlock.getRSBlocks(Be,this.errorCorrectLevel),Ye=new BitBuffer,tt=0,nt=0;nt<Le.length;nt++)tt+=Le[nt].dataCount;for(var nt=0;nt<this.dataList.length;nt++){var ft=this.dataList[nt];Ye.put(ft.mode,4),Ye.put(ft.getLength(),util.getLengthInBits(ft.mode,Be)),ft.write(Ye)}if(Ye.getLengthInBits()<=tt*8)break}this.typeNumber=Be}this.makeImpl(!1,this.getBestMaskPattern())},proto.makeImpl=function(Be,Le){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var Ye=0;Ye<this.moduleCount;Ye++){this.modules[Ye]=new Array(this.moduleCount);for(var tt=0;tt<this.moduleCount;tt++)this.modules[Ye][tt]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(Be,Le),this.typeNumber>=7&&this.setupTypeNumber(Be),this.dataCache==null&&(this.dataCache=QRCode$1.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,Le)},proto.setupPositionProbePattern=function(Be,Le){for(var Ye=-1;Ye<=7;Ye++)if(!(Be+Ye<=-1||this.moduleCount<=Be+Ye))for(var tt=-1;tt<=7;tt++)Le+tt<=-1||this.moduleCount<=Le+tt||(0<=Ye&&Ye<=6&&(tt==0||tt==6)||0<=tt&&tt<=6&&(Ye==0||Ye==6)||2<=Ye&&Ye<=4&&2<=tt&&tt<=4?this.modules[Be+Ye][Le+tt]=!0:this.modules[Be+Ye][Le+tt]=!1)},proto.getBestMaskPattern=function(){for(var Be=0,Le=0,Ye=0;Ye<8;Ye++){this.makeImpl(!0,Ye);var tt=util.getLostPoint(this);(Ye==0||Be>tt)&&(Be=tt,Le=Ye)}return Le},proto.createMovieClip=function(Be,Le,Ye){var tt=Be.createEmptyMovieClip(Le,Ye),nt=1;this.make();for(var ft=0;ft<this.modules.length;ft++)for(var ht=ft*nt,gt=0;gt<this.modules[ft].length;gt++){var At=gt*nt,xt=this.modules[ft][gt];xt&&(tt.beginFill(0,100),tt.moveTo(At,ht),tt.lineTo(At+nt,ht),tt.lineTo(At+nt,ht+nt),tt.lineTo(At,ht+nt),tt.endFill())}return tt},proto.setupTimingPattern=function(){for(var Be=8;Be<this.moduleCount-8;Be++)this.modules[Be][6]==null&&(this.modules[Be][6]=Be%2==0);for(var Le=8;Le<this.moduleCount-8;Le++)this.modules[6][Le]==null&&(this.modules[6][Le]=Le%2==0)},proto.setupPositionAdjustPattern=function(){for(var Be=util.getPatternPosition(this.typeNumber),Le=0;Le<Be.length;Le++)for(var Ye=0;Ye<Be.length;Ye++){var tt=Be[Le],nt=Be[Ye];if(this.modules[tt][nt]==null)for(var ft=-2;ft<=2;ft++)for(var ht=-2;ht<=2;ht++)ft==-2||ft==2||ht==-2||ht==2||ft==0&&ht==0?this.modules[tt+ft][nt+ht]=!0:this.modules[tt+ft][nt+ht]=!1}},proto.setupTypeNumber=function(Be){for(var Le=util.getBCHTypeNumber(this.typeNumber),Ye=0;Ye<18;Ye++){var tt=!Be&&(Le>>Ye&1)==1;this.modules[Math.floor(Ye/3)][Ye%3+this.moduleCount-8-3]=tt}for(var Ye=0;Ye<18;Ye++){var tt=!Be&&(Le>>Ye&1)==1;this.modules[Ye%3+this.moduleCount-8-3][Math.floor(Ye/3)]=tt}},proto.setupTypeInfo=function(Be,Le){for(var Ye=this.errorCorrectLevel<<3|Le,tt=util.getBCHTypeInfo(Ye),nt=0;nt<15;nt++){var ft=!Be&&(tt>>nt&1)==1;nt<6?this.modules[nt][8]=ft:nt<8?this.modules[nt+1][8]=ft:this.modules[this.moduleCount-15+nt][8]=ft}for(var nt=0;nt<15;nt++){var ft=!Be&&(tt>>nt&1)==1;nt<8?this.modules[8][this.moduleCount-nt-1]=ft:nt<9?this.modules[8][15-nt-1+1]=ft:this.modules[8][15-nt-1]=ft}this.modules[this.moduleCount-8][8]=!Be},proto.mapData=function(Be,Le){for(var Ye=-1,tt=this.moduleCount-1,nt=7,ft=0,ht=this.moduleCount-1;ht>0;ht-=2)for(ht==6&&ht--;;){for(var gt=0;gt<2;gt++)if(this.modules[tt][ht-gt]==null){var At=!1;ft<Be.length&&(At=(Be[ft]>>>nt&1)==1);var xt=util.getMask(Le,tt,ht-gt);xt&&(At=!At),this.modules[tt][ht-gt]=At,nt--,nt==-1&&(ft++,nt=7)}if(tt+=Ye,tt<0||this.moduleCount<=tt){tt-=Ye,Ye=-Ye;break}}},QRCode$1.PAD0=236,QRCode$1.PAD1=17,QRCode$1.createData=function(Be,Le,Ye){for(var tt=RSBlock.getRSBlocks(Be,Le),nt=new BitBuffer,ft=0;ft<Ye.length;ft++){var ht=Ye[ft];nt.put(ht.mode,4),nt.put(ht.getLength(),util.getLengthInBits(ht.mode,Be)),ht.write(nt)}for(var gt=0,ft=0;ft<tt.length;ft++)gt+=tt[ft].dataCount;if(nt.getLengthInBits()>gt*8)throw new Error("code length overflow. ("+nt.getLengthInBits()+">"+gt*8+")");for(nt.getLengthInBits()+4<=gt*8&&nt.put(0,4);nt.getLengthInBits()%8!=0;)nt.putBit(!1);for(;!(nt.getLengthInBits()>=gt*8||(nt.put(QRCode$1.PAD0,8),nt.getLengthInBits()>=gt*8));)nt.put(QRCode$1.PAD1,8);return QRCode$1.createBytes(nt,tt)},QRCode$1.createBytes=function(Be,Le){for(var Ye=0,tt=0,nt=0,ft=new Array(Le.length),ht=new Array(Le.length),gt=0;gt<Le.length;gt++){var At=Le[gt].dataCount,xt=Le[gt].totalCount-At;tt=Math.max(tt,At),nt=Math.max(nt,xt),ft[gt]=new Array(At);for(var yt=0;yt<ft[gt].length;yt++)ft[gt][yt]=255&Be.buffer[yt+Ye];Ye+=At;var Ct=util.getErrorCorrectPolynomial(xt),Et=new Polynomial(ft[gt],Ct.getLength()-1),vt=Et.mod(Ct);ht[gt]=new Array(Ct.getLength()-1);for(var yt=0;yt<ht[gt].length;yt++){var kt=yt+vt.getLength()-ht[gt].length;ht[gt][yt]=kt>=0?vt.get(kt):0}}for(var bt=0,yt=0;yt<Le.length;yt++)bt+=Le[yt].totalCount;for(var wt=new Array(bt),It=0,yt=0;yt<tt;yt++)for(var gt=0;gt<Le.length;gt++)yt<ft[gt].length&&(wt[It++]=ft[gt][yt]);for(var yt=0;yt<nt;yt++)for(var gt=0;gt<Le.length;gt++)yt<ht[gt].length&&(wt[It++]=ht[gt][yt]);return wt};var QRCode_1=QRCode$1,QRCodeSvg$1={};Object.defineProperty(QRCodeSvg$1,"__esModule",{value:!0});var _extends$1=Object.assign||function(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le];for(var tt in Ye)Object.prototype.hasOwnProperty.call(Ye,tt)&&(Be[tt]=Ye[tt])}return Be},_propTypes$7=propTypesExports,_propTypes2$7=_interopRequireDefault$8(_propTypes$7),_react$7=React,_react2$7=_interopRequireDefault$8(_react$7);function _interopRequireDefault$8(Be){return Be&&Be.__esModule?Be:{default:Be}}function _objectWithoutProperties$2(Be,Le){var Ye={};for(var tt in Be)Le.indexOf(tt)>=0||Object.prototype.hasOwnProperty.call(Be,tt)&&(Ye[tt]=Be[tt]);return Ye}var propTypes$1={bgColor:_propTypes2$7.default.oneOfType([_propTypes2$7.default.object,_propTypes2$7.default.string]).isRequired,bgD:_propTypes2$7.default.string.isRequired,fgColor:_propTypes2$7.default.oneOfType([_propTypes2$7.default.object,_propTypes2$7.default.string]).isRequired,fgD:_propTypes2$7.default.string.isRequired,size:_propTypes2$7.default.number.isRequired,title:_propTypes2$7.default.string,viewBoxSize:_propTypes2$7.default.number.isRequired,xmlns:_propTypes2$7.default.string},QRCodeSvg=(0,_react$7.forwardRef)(function(Be,Le){var Ye=Be.bgColor,tt=Be.bgD,nt=Be.fgD,ft=Be.fgColor,ht=Be.size,gt=Be.title,At=Be.viewBoxSize,xt=Be.xmlns,yt=xt===void 0?"http://www.w3.org/2000/svg":xt,Ct=_objectWithoutProperties$2(Be,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return _react2$7.default.createElement("svg",_extends$1({},Ct,{height:ht,ref:Le,viewBox:"0 0 "+At+" "+At,width:ht,xmlns:yt}),gt?_react2$7.default.createElement("title",null,gt):null,_react2$7.default.createElement("path",{d:tt,fill:Ye}),_react2$7.default.createElement("path",{d:nt,fill:ft}))});QRCodeSvg.displayName="QRCodeSvg",QRCodeSvg.propTypes=propTypes$1,QRCodeSvg$1.default=QRCodeSvg,Object.defineProperty(lib,"__esModule",{value:!0}),lib.QRCode=void 0;var _extends=Object.assign||function(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le];for(var tt in Ye)Object.prototype.hasOwnProperty.call(Ye,tt)&&(Be[tt]=Ye[tt])}return Be},_propTypes$6=propTypesExports,_propTypes2$6=_interopRequireDefault$7(_propTypes$6),_ErrorCorrectLevel=ErrorCorrectLevel,_ErrorCorrectLevel2=_interopRequireDefault$7(_ErrorCorrectLevel),_QRCode=QRCode_1,_QRCode2=_interopRequireDefault$7(_QRCode),_react$6=React,_react2$6=_interopRequireDefault$7(_react$6),_QRCodeSvg=QRCodeSvg$1,_QRCodeSvg2=_interopRequireDefault$7(_QRCodeSvg);function _interopRequireDefault$7(Be){return Be&&Be.__esModule?Be:{default:Be}}function _objectWithoutProperties$1(Be,Le){var Ye={};for(var tt in Be)Le.indexOf(tt)>=0||Object.prototype.hasOwnProperty.call(Be,tt)&&(Ye[tt]=Be[tt]);return Ye}var propTypes={bgColor:_propTypes2$6.default.oneOfType([_propTypes2$6.default.object,_propTypes2$6.default.string]),fgColor:_propTypes2$6.default.oneOfType([_propTypes2$6.default.object,_propTypes2$6.default.string]),level:_propTypes2$6.default.string,size:_propTypes2$6.default.number,value:_propTypes2$6.default.string.isRequired},QRCode=(0,_react$6.forwardRef)(function(Be,Le){var Ye=Be.bgColor,tt=Ye===void 0?"#FFFFFF":Ye,nt=Be.fgColor,ft=nt===void 0?"#000000":nt,ht=Be.level,gt=ht===void 0?"L":ht,At=Be.size,xt=At===void 0?256:At,yt=Be.value,Ct=_objectWithoutProperties$1(Be,["bgColor","fgColor","level","size","value"]),Et=new _QRCode2.default(-1,_ErrorCorrectLevel2.default[gt]);Et.addData(yt),Et.make();var vt=Et.modules;return _react2$6.default.createElement(_QRCodeSvg2.default,_extends({},Ct,{bgColor:tt,bgD:vt.map(function(kt,bt){return kt.map(function(wt,It){return wt?"":"M "+It+" "+bt+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:ft,fgD:vt.map(function(kt,bt){return kt.map(function(wt,It){return wt?"M "+It+" "+bt+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:Le,size:xt,viewBoxSize:vt.length}))});lib.QRCode=QRCode,QRCode.displayName="QRCode",QRCode.propTypes=propTypes;var _default=lib.default=QRCode;const sendRedirectSMS=({token:Be,smsType:Le,params:Ye,uuid:tt})=>exports.api.post("/omni/notify/send-sms",{smsType:Le,params:Ye,uuid:tt},{headers:{"X-Incode-Hardware-Id":Be}}).then(nt=>nt.data).catch(nt=>Promise.reject(nt.response.data)),phone$1="data:image/svg+xml,%3csvg%20width='154'%20height='320'%20viewBox='0%200%20154%20320'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='151.927'%20height='317.921'%20rx='17.5841'%20fill='white'%20stroke='%2380868F'%20stroke-width='1.05505'/%3e%3crect%20x='58.676'%20y='16.474'%20width='37.6301'%20height='10.5505'%20rx='5.27524'%20fill='%23ECEFF2'/%3e%3crect%20x='60.4342'%20y='15.7706'%20width='33.0582'%20height='7.38534'%20rx='3.69267'%20fill='white'%20stroke='%2380868F'%20stroke-width='0.703366'/%3e%3crect%20x='64.6548'%20y='18.5842'%20width='24.6178'%20height='1.75841'%20rx='0.879207'%20fill='%23ECEFF2'/%3e%3ccircle%20cx='76.7877'%20cy='300.458'%20r='13.5398'%20fill='white'%20stroke='%2380868F'%20stroke-width='0.703366'/%3e%3ccircle%20cx='76.7875'%20cy='300.458'%20r='7.56118'%20fill='%23ECEFF2'/%3e%3crect%20x='11.5503'%20y='35.8166'%20width='136.453'%20height='242.309'%20rx='5.27524'%20fill='%23ECEFF2'/%3e%3crect%20x='5.57202'%20y='37.5751'%20width='140.673'%20height='245.475'%20rx='3.51683'%20fill='white'/%3e%3crect%20x='9.0885'%20y='38.9818'%20width='135.75'%20height='241.606'%20rx='4.92356'%20fill='%23ECEFF2'%20stroke='%2380868F'%20stroke-width='0.703366'/%3e%3c/svg%3e",onboardingStatusUrl="/omni/get/onboarding/status";function getOnboardingStatus(Be){return exports.api.get(onboardingStatusUrl,{headers:{"X-Incode-Hardware-Id":Be.token}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}const getRedirectUrl=(Be,{token:Le})=>exports.api.get(`omni/redirection-url${Be?`?flowId=${Be}`:""}`,{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data);async function qrRefreshUUID({token:Be,onboardingId:Le}){return exports.api.post("/omni/qr/refresh",{onboardingId:Le},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data)}const URL_ERROR="Url is not valid",useQR=({session:Be,onSuccess:Le,url:Ye,allowReEnrollment:tt=!1,expired:nt=!1,externalId:ft,canceled:ht=!1,lang:gt,authHint:At,qrPhishingResistance:xt})=>{const[yt,Ct]=React.useState(""),[Et,vt]=React.useState(!1),kt=React.useRef(null),bt=React.useRef(!1),wt=React.useRef(),[It,Rt]=React.useState(""),[Tt,Bt]=React.useState("");React.useEffect(()=>{getOnboardingStatus(Be).then(Dt=>{(Dt==null?void 0:Dt.onboardingStatus)==="ONBOARDING_FINISHED"&&tt&&!nt&&vt(!0)})},[]),React.useEffect(()=>{addEvent({token:Be.token,code:"qrCodeShown"})},[Be]),kt.current=useInterval(()=>{const Dt=async()=>{try{const{redirectionUrl:Ot=""}=await getRedirectUrl(null,Be);if(sleep(3e3),Ot){window.location.replace(Ot);return}}catch(Ot){console.error(Ot,"finish")}};getOnboardingStatus(Be).then(Ot=>{Et?(Ot==null?void 0:Ot.onboardingStatus)!=="ONBOARDING_FINISHED"&&vt(!1):(Ot==null?void 0:Ot.onboardingStatus)==="ONBOARDING_FINISHED"&&!bt.current&&(kt.current&&clearInterval(kt.current),wt.current&&clearInterval(wt.current),bt.current=!0,Le(Ot),Dt())}).catch(emptyFunc)},ht?null:5e3),React.useEffect(()=>{(async()=>{try{const Ot=Tt||await createRedirectUrl({session:Be});Bt(Ot);const Lt=new URL(Ot);if(Ye){const Wt=new URL(Ye),$t=Lt.searchParams.get("uuid"),qt=xt?It||await Pt($t):"";qt&&Wt.searchParams.append("qrUuid",qt),Wt.searchParams.append("uuid",$t),Wt.searchParams.append("isRedirect","true"),gt&&Wt.searchParams.append("lang",gt),ft&&Wt.searchParams.append("externalId",ft),At&&Wt.searchParams.append("auth_hint",At),Ct(Wt.href)}else{const Wt=new URL(Ot),$t=Wt.searchParams.get("uuid"),qt=xt?It||await Pt($t):"";qt&&Wt.searchParams.append("qrUuid",qt),Wt.searchParams.append("isRedirect","true"),gt&&Wt.searchParams.append("lang",gt),At&&Wt.searchParams.append("auth_hint",At),Ct(Wt.href)}}catch(Ot){console.error(URL_ERROR,Ot)}})()},[Ye,It]),React.useEffect(()=>()=>{wt.current&&clearInterval(wt.current)},[]);const Pt=async Dt=>{const{uuid:Ot}=await qrRefreshUUID({token:Be.token,onboardingId:Dt});return wt.current=setInterval(async()=>{const{uuid:Lt}=await qrRefreshUUID({token:Be.token,onboardingId:Dt});Lt&&Rt(Lt)},5e3),Rt(Ot),It};return{redirectUrl:yt}},asYouType=new AsYouType,RedirectContainer=dt.div`
|
|
6739
|
+
`,ScanTicket=({session:Be,nextStep:Le})=>{const[Ye,tt]=React.useState(""),[nt,ft]=React.useState(0),ht=React.useRef(null),{t:gt}=useTranslation$1(),At=React.useCallback(async()=>{const Ct=ht.current;if(!Ct)return;const Et=Ct.getCanvas(Ct.video.videoWidth,Ct.video.videoHeight);try{console.log("detect",Et.canvas,codeReader$1);const vt=await codeReader$1.decodeFromCanvas(Et.canvas);tt("capturing");try{(await postQrLink({session:Be,link:vt.getText()})).success&&(tt("success"),await sleep(3e3),Le())}catch{ft(bt=>bt+1),tt("error")}await sleep(3e3),At()}catch(vt){console.error(vt),await sleep(1e3),At()}},[Le,Be]);React.useEffect(()=>{nt===3&&Le()},[nt,Le]);const xt=React.useCallback(async()=>{await sleep(3e3),At()},[At]),yt=React.useCallback(()=>{console.log("error :p")},[]);return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(FaceMask$1,{mode:Ye}),jsxRuntimeExports.jsx(Webcam,{ref:ht,onPlay:xt,videoSource:"environment",onError:yt,token:Be.token,type:"fiscalQR",showCustomCameraPermissionScreen:!1}),Ye==="error"&&jsxRuntimeExports.jsx(ErrorText,{children:gt("fiscalQr.invalidQr")}),jsxRuntimeExports.jsx(SkipButton$5,{onClick:Le,children:gt("common.skip")})]})};function renderFiscalQr(Be,{onSuccess:Le,session:Ye}){const tt=createRoot$1(Be),nt={onSuccess:handleUnmountRoot(Le,tt,Be),onBoarding:this,session:Ye};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye.token,children:jsxRuntimeExports.jsx(FiscalQr,{...nt})}),Be,tt)}const getFinishStatus=(Be,{token:Le})=>exports.api.get(`/omni/finish-status${Be?`?flowId=${Be}`:""}`,{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data);var lib={},ErrorCorrectLevel={L:1,M:0,Q:3,H:2},mode$1={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},mode=mode$1;function QR8bitByte(Be){this.mode=mode.MODE_8BIT_BYTE,this.data=Be}QR8bitByte.prototype={getLength:function(Be){return this.data.length},write:function(Be){for(var Le=0;Le<this.data.length;Le++)Be.put(this.data.charCodeAt(Le),8)}};var _8BitByte=QR8bitByte,ECL=ErrorCorrectLevel;function QRRSBlock(Be,Le){this.totalCount=Be,this.dataCount=Le}QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],QRRSBlock.getRSBlocks=function(Be,Le){var Ye=QRRSBlock.getRsBlockTable(Be,Le);if(Ye==null)throw new Error("bad rs block @ typeNumber:"+Be+"/errorCorrectLevel:"+Le);for(var tt=Ye.length/3,nt=new Array,ft=0;ft<tt;ft++)for(var ht=Ye[ft*3+0],gt=Ye[ft*3+1],At=Ye[ft*3+2],xt=0;xt<ht;xt++)nt.push(new QRRSBlock(gt,At));return nt},QRRSBlock.getRsBlockTable=function(Be,Le){switch(Le){case ECL.L:return QRRSBlock.RS_BLOCK_TABLE[(Be-1)*4+0];case ECL.M:return QRRSBlock.RS_BLOCK_TABLE[(Be-1)*4+1];case ECL.Q:return QRRSBlock.RS_BLOCK_TABLE[(Be-1)*4+2];case ECL.H:return QRRSBlock.RS_BLOCK_TABLE[(Be-1)*4+3];default:return}};var RSBlock$1=QRRSBlock;function QRBitBuffer(){this.buffer=new Array,this.length=0}QRBitBuffer.prototype={get:function(Be){var Le=Math.floor(Be/8);return(this.buffer[Le]>>>7-Be%8&1)==1},put:function(Be,Le){for(var Ye=0;Ye<Le;Ye++)this.putBit((Be>>>Le-Ye-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(Be){var Le=Math.floor(this.length/8);this.buffer.length<=Le&&this.buffer.push(0),Be&&(this.buffer[Le]|=128>>>this.length%8),this.length++}};for(var BitBuffer$1=QRBitBuffer,QRMath={glog:function(Be){if(Be<1)throw new Error("glog("+Be+")");return QRMath.LOG_TABLE[Be]},gexp:function(Be){for(;Be<0;)Be+=255;for(;Be>=256;)Be-=255;return QRMath.EXP_TABLE[Be]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},i=0;i<8;i++)QRMath.EXP_TABLE[i]=1<<i;for(var i=8;i<256;i++)QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];for(var i=0;i<255;i++)QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;var math$2=QRMath,math$1=math$2;function QRPolynomial(Be,Le){if(Be.length==null)throw new Error(Be.length+"/"+Le);for(var Ye=0;Ye<Be.length&&Be[Ye]==0;)Ye++;this.num=new Array(Be.length-Ye+Le);for(var tt=0;tt<Be.length-Ye;tt++)this.num[tt]=Be[tt+Ye]}QRPolynomial.prototype={get:function(Be){return this.num[Be]},getLength:function(){return this.num.length},multiply:function(Be){for(var Le=new Array(this.getLength()+Be.getLength()-1),Ye=0;Ye<this.getLength();Ye++)for(var tt=0;tt<Be.getLength();tt++)Le[Ye+tt]^=math$1.gexp(math$1.glog(this.get(Ye))+math$1.glog(Be.get(tt)));return new QRPolynomial(Le,0)},mod:function(Be){if(this.getLength()-Be.getLength()<0)return this;for(var Le=math$1.glog(this.get(0))-math$1.glog(Be.get(0)),Ye=new Array(this.getLength()),tt=0;tt<this.getLength();tt++)Ye[tt]=this.get(tt);for(var tt=0;tt<Be.getLength();tt++)Ye[tt]^=math$1.gexp(math$1.glog(Be.get(tt))+Le);return new QRPolynomial(Ye,0).mod(Be)}};var Polynomial$2=QRPolynomial,Mode=mode$1,Polynomial$1=Polynomial$2,math=math$2,QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(Be){for(var Le=Be<<10;QRUtil.getBCHDigit(Le)-QRUtil.getBCHDigit(QRUtil.G15)>=0;)Le^=QRUtil.G15<<QRUtil.getBCHDigit(Le)-QRUtil.getBCHDigit(QRUtil.G15);return(Be<<10|Le)^QRUtil.G15_MASK},getBCHTypeNumber:function(Be){for(var Le=Be<<12;QRUtil.getBCHDigit(Le)-QRUtil.getBCHDigit(QRUtil.G18)>=0;)Le^=QRUtil.G18<<QRUtil.getBCHDigit(Le)-QRUtil.getBCHDigit(QRUtil.G18);return Be<<12|Le},getBCHDigit:function(Be){for(var Le=0;Be!=0;)Le++,Be>>>=1;return Le},getPatternPosition:function(Be){return QRUtil.PATTERN_POSITION_TABLE[Be-1]},getMask:function(Be,Le,Ye){switch(Be){case QRMaskPattern.PATTERN000:return(Le+Ye)%2==0;case QRMaskPattern.PATTERN001:return Le%2==0;case QRMaskPattern.PATTERN010:return Ye%3==0;case QRMaskPattern.PATTERN011:return(Le+Ye)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(Le/2)+Math.floor(Ye/3))%2==0;case QRMaskPattern.PATTERN101:return Le*Ye%2+Le*Ye%3==0;case QRMaskPattern.PATTERN110:return(Le*Ye%2+Le*Ye%3)%2==0;case QRMaskPattern.PATTERN111:return(Le*Ye%3+(Le+Ye)%2)%2==0;default:throw new Error("bad maskPattern:"+Be)}},getErrorCorrectPolynomial:function(Be){for(var Le=new Polynomial$1([1],0),Ye=0;Ye<Be;Ye++)Le=Le.multiply(new Polynomial$1([1,math.gexp(Ye)],0));return Le},getLengthInBits:function(Be,Le){if(1<=Le&&Le<10)switch(Be){case Mode.MODE_NUMBER:return 10;case Mode.MODE_ALPHA_NUM:return 9;case Mode.MODE_8BIT_BYTE:return 8;case Mode.MODE_KANJI:return 8;default:throw new Error("mode:"+Be)}else if(Le<27)switch(Be){case Mode.MODE_NUMBER:return 12;case Mode.MODE_ALPHA_NUM:return 11;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 10;default:throw new Error("mode:"+Be)}else if(Le<41)switch(Be){case Mode.MODE_NUMBER:return 14;case Mode.MODE_ALPHA_NUM:return 13;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 12;default:throw new Error("mode:"+Be)}else throw new Error("type:"+Le)},getLostPoint:function(Be){for(var Le=Be.getModuleCount(),Ye=0,tt=0;tt<Le;tt++)for(var nt=0;nt<Le;nt++){for(var ft=0,ht=Be.isDark(tt,nt),gt=-1;gt<=1;gt++)if(!(tt+gt<0||Le<=tt+gt))for(var At=-1;At<=1;At++)nt+At<0||Le<=nt+At||gt==0&&At==0||ht==Be.isDark(tt+gt,nt+At)&&ft++;ft>5&&(Ye+=3+ft-5)}for(var tt=0;tt<Le-1;tt++)for(var nt=0;nt<Le-1;nt++){var xt=0;Be.isDark(tt,nt)&&xt++,Be.isDark(tt+1,nt)&&xt++,Be.isDark(tt,nt+1)&&xt++,Be.isDark(tt+1,nt+1)&&xt++,(xt==0||xt==4)&&(Ye+=3)}for(var tt=0;tt<Le;tt++)for(var nt=0;nt<Le-6;nt++)Be.isDark(tt,nt)&&!Be.isDark(tt,nt+1)&&Be.isDark(tt,nt+2)&&Be.isDark(tt,nt+3)&&Be.isDark(tt,nt+4)&&!Be.isDark(tt,nt+5)&&Be.isDark(tt,nt+6)&&(Ye+=40);for(var nt=0;nt<Le;nt++)for(var tt=0;tt<Le-6;tt++)Be.isDark(tt,nt)&&!Be.isDark(tt+1,nt)&&Be.isDark(tt+2,nt)&&Be.isDark(tt+3,nt)&&Be.isDark(tt+4,nt)&&!Be.isDark(tt+5,nt)&&Be.isDark(tt+6,nt)&&(Ye+=40);for(var yt=0,nt=0;nt<Le;nt++)for(var tt=0;tt<Le;tt++)Be.isDark(tt,nt)&&yt++;var Ct=Math.abs(100*yt/Le/Le-50)/5;return Ye+=Ct*10,Ye}},util$1=QRUtil,BitByte=_8BitByte,RSBlock=RSBlock$1,BitBuffer=BitBuffer$1,util=util$1,Polynomial=Polynomial$2;function QRCode$1(Be,Le){this.typeNumber=Be,this.errorCorrectLevel=Le,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var proto=QRCode$1.prototype;proto.addData=function(Be){var Le=new BitByte(Be);this.dataList.push(Le),this.dataCache=null},proto.isDark=function(Be,Le){if(Be<0||this.moduleCount<=Be||Le<0||this.moduleCount<=Le)throw new Error(Be+","+Le);return this.modules[Be][Le]},proto.getModuleCount=function(){return this.moduleCount},proto.make=function(){if(this.typeNumber<1){var Be=1;for(Be=1;Be<40;Be++){for(var Le=RSBlock.getRSBlocks(Be,this.errorCorrectLevel),Ye=new BitBuffer,tt=0,nt=0;nt<Le.length;nt++)tt+=Le[nt].dataCount;for(var nt=0;nt<this.dataList.length;nt++){var ft=this.dataList[nt];Ye.put(ft.mode,4),Ye.put(ft.getLength(),util.getLengthInBits(ft.mode,Be)),ft.write(Ye)}if(Ye.getLengthInBits()<=tt*8)break}this.typeNumber=Be}this.makeImpl(!1,this.getBestMaskPattern())},proto.makeImpl=function(Be,Le){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var Ye=0;Ye<this.moduleCount;Ye++){this.modules[Ye]=new Array(this.moduleCount);for(var tt=0;tt<this.moduleCount;tt++)this.modules[Ye][tt]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(Be,Le),this.typeNumber>=7&&this.setupTypeNumber(Be),this.dataCache==null&&(this.dataCache=QRCode$1.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,Le)},proto.setupPositionProbePattern=function(Be,Le){for(var Ye=-1;Ye<=7;Ye++)if(!(Be+Ye<=-1||this.moduleCount<=Be+Ye))for(var tt=-1;tt<=7;tt++)Le+tt<=-1||this.moduleCount<=Le+tt||(0<=Ye&&Ye<=6&&(tt==0||tt==6)||0<=tt&&tt<=6&&(Ye==0||Ye==6)||2<=Ye&&Ye<=4&&2<=tt&&tt<=4?this.modules[Be+Ye][Le+tt]=!0:this.modules[Be+Ye][Le+tt]=!1)},proto.getBestMaskPattern=function(){for(var Be=0,Le=0,Ye=0;Ye<8;Ye++){this.makeImpl(!0,Ye);var tt=util.getLostPoint(this);(Ye==0||Be>tt)&&(Be=tt,Le=Ye)}return Le},proto.createMovieClip=function(Be,Le,Ye){var tt=Be.createEmptyMovieClip(Le,Ye),nt=1;this.make();for(var ft=0;ft<this.modules.length;ft++)for(var ht=ft*nt,gt=0;gt<this.modules[ft].length;gt++){var At=gt*nt,xt=this.modules[ft][gt];xt&&(tt.beginFill(0,100),tt.moveTo(At,ht),tt.lineTo(At+nt,ht),tt.lineTo(At+nt,ht+nt),tt.lineTo(At,ht+nt),tt.endFill())}return tt},proto.setupTimingPattern=function(){for(var Be=8;Be<this.moduleCount-8;Be++)this.modules[Be][6]==null&&(this.modules[Be][6]=Be%2==0);for(var Le=8;Le<this.moduleCount-8;Le++)this.modules[6][Le]==null&&(this.modules[6][Le]=Le%2==0)},proto.setupPositionAdjustPattern=function(){for(var Be=util.getPatternPosition(this.typeNumber),Le=0;Le<Be.length;Le++)for(var Ye=0;Ye<Be.length;Ye++){var tt=Be[Le],nt=Be[Ye];if(this.modules[tt][nt]==null)for(var ft=-2;ft<=2;ft++)for(var ht=-2;ht<=2;ht++)ft==-2||ft==2||ht==-2||ht==2||ft==0&&ht==0?this.modules[tt+ft][nt+ht]=!0:this.modules[tt+ft][nt+ht]=!1}},proto.setupTypeNumber=function(Be){for(var Le=util.getBCHTypeNumber(this.typeNumber),Ye=0;Ye<18;Ye++){var tt=!Be&&(Le>>Ye&1)==1;this.modules[Math.floor(Ye/3)][Ye%3+this.moduleCount-8-3]=tt}for(var Ye=0;Ye<18;Ye++){var tt=!Be&&(Le>>Ye&1)==1;this.modules[Ye%3+this.moduleCount-8-3][Math.floor(Ye/3)]=tt}},proto.setupTypeInfo=function(Be,Le){for(var Ye=this.errorCorrectLevel<<3|Le,tt=util.getBCHTypeInfo(Ye),nt=0;nt<15;nt++){var ft=!Be&&(tt>>nt&1)==1;nt<6?this.modules[nt][8]=ft:nt<8?this.modules[nt+1][8]=ft:this.modules[this.moduleCount-15+nt][8]=ft}for(var nt=0;nt<15;nt++){var ft=!Be&&(tt>>nt&1)==1;nt<8?this.modules[8][this.moduleCount-nt-1]=ft:nt<9?this.modules[8][15-nt-1+1]=ft:this.modules[8][15-nt-1]=ft}this.modules[this.moduleCount-8][8]=!Be},proto.mapData=function(Be,Le){for(var Ye=-1,tt=this.moduleCount-1,nt=7,ft=0,ht=this.moduleCount-1;ht>0;ht-=2)for(ht==6&&ht--;;){for(var gt=0;gt<2;gt++)if(this.modules[tt][ht-gt]==null){var At=!1;ft<Be.length&&(At=(Be[ft]>>>nt&1)==1);var xt=util.getMask(Le,tt,ht-gt);xt&&(At=!At),this.modules[tt][ht-gt]=At,nt--,nt==-1&&(ft++,nt=7)}if(tt+=Ye,tt<0||this.moduleCount<=tt){tt-=Ye,Ye=-Ye;break}}},QRCode$1.PAD0=236,QRCode$1.PAD1=17,QRCode$1.createData=function(Be,Le,Ye){for(var tt=RSBlock.getRSBlocks(Be,Le),nt=new BitBuffer,ft=0;ft<Ye.length;ft++){var ht=Ye[ft];nt.put(ht.mode,4),nt.put(ht.getLength(),util.getLengthInBits(ht.mode,Be)),ht.write(nt)}for(var gt=0,ft=0;ft<tt.length;ft++)gt+=tt[ft].dataCount;if(nt.getLengthInBits()>gt*8)throw new Error("code length overflow. ("+nt.getLengthInBits()+">"+gt*8+")");for(nt.getLengthInBits()+4<=gt*8&&nt.put(0,4);nt.getLengthInBits()%8!=0;)nt.putBit(!1);for(;!(nt.getLengthInBits()>=gt*8||(nt.put(QRCode$1.PAD0,8),nt.getLengthInBits()>=gt*8));)nt.put(QRCode$1.PAD1,8);return QRCode$1.createBytes(nt,tt)},QRCode$1.createBytes=function(Be,Le){for(var Ye=0,tt=0,nt=0,ft=new Array(Le.length),ht=new Array(Le.length),gt=0;gt<Le.length;gt++){var At=Le[gt].dataCount,xt=Le[gt].totalCount-At;tt=Math.max(tt,At),nt=Math.max(nt,xt),ft[gt]=new Array(At);for(var yt=0;yt<ft[gt].length;yt++)ft[gt][yt]=255&Be.buffer[yt+Ye];Ye+=At;var Ct=util.getErrorCorrectPolynomial(xt),Et=new Polynomial(ft[gt],Ct.getLength()-1),vt=Et.mod(Ct);ht[gt]=new Array(Ct.getLength()-1);for(var yt=0;yt<ht[gt].length;yt++){var kt=yt+vt.getLength()-ht[gt].length;ht[gt][yt]=kt>=0?vt.get(kt):0}}for(var bt=0,yt=0;yt<Le.length;yt++)bt+=Le[yt].totalCount;for(var wt=new Array(bt),It=0,yt=0;yt<tt;yt++)for(var gt=0;gt<Le.length;gt++)yt<ft[gt].length&&(wt[It++]=ft[gt][yt]);for(var yt=0;yt<nt;yt++)for(var gt=0;gt<Le.length;gt++)yt<ht[gt].length&&(wt[It++]=ht[gt][yt]);return wt};var QRCode_1=QRCode$1,QRCodeSvg$1={};Object.defineProperty(QRCodeSvg$1,"__esModule",{value:!0});var _extends$1=Object.assign||function(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le];for(var tt in Ye)Object.prototype.hasOwnProperty.call(Ye,tt)&&(Be[tt]=Ye[tt])}return Be},_propTypes$7=propTypesExports,_propTypes2$7=_interopRequireDefault$8(_propTypes$7),_react$7=React,_react2$7=_interopRequireDefault$8(_react$7);function _interopRequireDefault$8(Be){return Be&&Be.__esModule?Be:{default:Be}}function _objectWithoutProperties$2(Be,Le){var Ye={};for(var tt in Be)Le.indexOf(tt)>=0||Object.prototype.hasOwnProperty.call(Be,tt)&&(Ye[tt]=Be[tt]);return Ye}var propTypes$1={bgColor:_propTypes2$7.default.oneOfType([_propTypes2$7.default.object,_propTypes2$7.default.string]).isRequired,bgD:_propTypes2$7.default.string.isRequired,fgColor:_propTypes2$7.default.oneOfType([_propTypes2$7.default.object,_propTypes2$7.default.string]).isRequired,fgD:_propTypes2$7.default.string.isRequired,size:_propTypes2$7.default.number.isRequired,title:_propTypes2$7.default.string,viewBoxSize:_propTypes2$7.default.number.isRequired,xmlns:_propTypes2$7.default.string},QRCodeSvg=(0,_react$7.forwardRef)(function(Be,Le){var Ye=Be.bgColor,tt=Be.bgD,nt=Be.fgD,ft=Be.fgColor,ht=Be.size,gt=Be.title,At=Be.viewBoxSize,xt=Be.xmlns,yt=xt===void 0?"http://www.w3.org/2000/svg":xt,Ct=_objectWithoutProperties$2(Be,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return _react2$7.default.createElement("svg",_extends$1({},Ct,{height:ht,ref:Le,viewBox:"0 0 "+At+" "+At,width:ht,xmlns:yt}),gt?_react2$7.default.createElement("title",null,gt):null,_react2$7.default.createElement("path",{d:tt,fill:Ye}),_react2$7.default.createElement("path",{d:nt,fill:ft}))});QRCodeSvg.displayName="QRCodeSvg",QRCodeSvg.propTypes=propTypes$1,QRCodeSvg$1.default=QRCodeSvg,Object.defineProperty(lib,"__esModule",{value:!0}),lib.QRCode=void 0;var _extends=Object.assign||function(Be){for(var Le=1;Le<arguments.length;Le++){var Ye=arguments[Le];for(var tt in Ye)Object.prototype.hasOwnProperty.call(Ye,tt)&&(Be[tt]=Ye[tt])}return Be},_propTypes$6=propTypesExports,_propTypes2$6=_interopRequireDefault$7(_propTypes$6),_ErrorCorrectLevel=ErrorCorrectLevel,_ErrorCorrectLevel2=_interopRequireDefault$7(_ErrorCorrectLevel),_QRCode=QRCode_1,_QRCode2=_interopRequireDefault$7(_QRCode),_react$6=React,_react2$6=_interopRequireDefault$7(_react$6),_QRCodeSvg=QRCodeSvg$1,_QRCodeSvg2=_interopRequireDefault$7(_QRCodeSvg);function _interopRequireDefault$7(Be){return Be&&Be.__esModule?Be:{default:Be}}function _objectWithoutProperties$1(Be,Le){var Ye={};for(var tt in Be)Le.indexOf(tt)>=0||Object.prototype.hasOwnProperty.call(Be,tt)&&(Ye[tt]=Be[tt]);return Ye}var propTypes={bgColor:_propTypes2$6.default.oneOfType([_propTypes2$6.default.object,_propTypes2$6.default.string]),fgColor:_propTypes2$6.default.oneOfType([_propTypes2$6.default.object,_propTypes2$6.default.string]),level:_propTypes2$6.default.string,size:_propTypes2$6.default.number,value:_propTypes2$6.default.string.isRequired},QRCode=(0,_react$6.forwardRef)(function(Be,Le){var Ye=Be.bgColor,tt=Ye===void 0?"#FFFFFF":Ye,nt=Be.fgColor,ft=nt===void 0?"#000000":nt,ht=Be.level,gt=ht===void 0?"L":ht,At=Be.size,xt=At===void 0?256:At,yt=Be.value,Ct=_objectWithoutProperties$1(Be,["bgColor","fgColor","level","size","value"]),Et=new _QRCode2.default(-1,_ErrorCorrectLevel2.default[gt]);Et.addData(yt),Et.make();var vt=Et.modules;return _react2$6.default.createElement(_QRCodeSvg2.default,_extends({},Ct,{bgColor:tt,bgD:vt.map(function(kt,bt){return kt.map(function(wt,It){return wt?"":"M "+It+" "+bt+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:ft,fgD:vt.map(function(kt,bt){return kt.map(function(wt,It){return wt?"M "+It+" "+bt+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:Le,size:xt,viewBoxSize:vt.length}))});lib.QRCode=QRCode,QRCode.displayName="QRCode",QRCode.propTypes=propTypes;var _default=lib.default=QRCode;const sendRedirectSMS=({token:Be,smsType:Le,params:Ye,uuid:tt})=>exports.api.post("/omni/notify/send-sms",{smsType:Le,params:Ye,uuid:tt},{headers:{"X-Incode-Hardware-Id":Be}}).then(nt=>nt.data).catch(nt=>Promise.reject(nt.response.data)),phone$1="data:image/svg+xml,%3csvg%20width='154'%20height='320'%20viewBox='0%200%20154%20320'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='151.927'%20height='317.921'%20rx='17.5841'%20fill='white'%20stroke='%2380868F'%20stroke-width='1.05505'/%3e%3crect%20x='58.676'%20y='16.474'%20width='37.6301'%20height='10.5505'%20rx='5.27524'%20fill='%23ECEFF2'/%3e%3crect%20x='60.4342'%20y='15.7706'%20width='33.0582'%20height='7.38534'%20rx='3.69267'%20fill='white'%20stroke='%2380868F'%20stroke-width='0.703366'/%3e%3crect%20x='64.6548'%20y='18.5842'%20width='24.6178'%20height='1.75841'%20rx='0.879207'%20fill='%23ECEFF2'/%3e%3ccircle%20cx='76.7877'%20cy='300.458'%20r='13.5398'%20fill='white'%20stroke='%2380868F'%20stroke-width='0.703366'/%3e%3ccircle%20cx='76.7875'%20cy='300.458'%20r='7.56118'%20fill='%23ECEFF2'/%3e%3crect%20x='11.5503'%20y='35.8166'%20width='136.453'%20height='242.309'%20rx='5.27524'%20fill='%23ECEFF2'/%3e%3crect%20x='5.57202'%20y='37.5751'%20width='140.673'%20height='245.475'%20rx='3.51683'%20fill='white'/%3e%3crect%20x='9.0885'%20y='38.9818'%20width='135.75'%20height='241.606'%20rx='4.92356'%20fill='%23ECEFF2'%20stroke='%2380868F'%20stroke-width='0.703366'/%3e%3c/svg%3e",SvgIconInformationGray=Be=>React__namespace.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("g",{id:"info circle",opacity:.7},React__namespace.createElement("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M12.756 15.693C12.756 16.107 12.42 16.443 12.006 16.443C11.592 16.443 11.256 16.107 11.256 15.693V11.394C11.256 10.98 11.592 10.644 12.006 10.644C12.42 10.644 12.756 10.98 12.756 11.394V15.693ZM11.25 8.291C11.25 7.877 11.586 7.541 12 7.541C12.414 7.541 12.75 7.877 12.75 8.291C12.75 8.705 12.414 9.073 12 9.073C11.586 9.073 11.25 8.768 11.25 8.354V8.291ZM12 2.5C6.762 2.5 2.5 6.761 2.5 12C2.5 17.238 6.762 21.5 12 21.5C17.238 21.5 21.5 17.238 21.5 12C21.5 6.761 17.238 2.5 12 2.5Z",fill:"#2B2B2B"}))),SvgUserScan=Be=>React__namespace.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("g",{id:"User scan"},React__namespace.createElement("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M28.2007 19.7995C27.6674 19.7995 27.134 20.1995 27.134 20.8661V22.9995C27.134 25.2661 25.2674 27.2661 23.0007 27.2661H21.2674C20.734 27.2661 20.2007 27.6661 20.2007 28.3328C20.2007 28.9995 20.6007 29.3995 21.2674 29.3995H23.0007C26.4674 29.3995 29.134 26.5995 29.134 23.1328V20.9995C29.134 20.1995 28.734 19.7995 28.2007 19.7995Z",fill:"#007AFF"}),React__namespace.createElement("path",{id:"Vector_2",fillRule:"evenodd",clipRule:"evenodd",d:"M11.1338 27.1333H9.40046C7.13379 27.1333 5.26712 25.2667 5.26712 22.8667V20.7333C5.26712 20.2 4.86712 19.6667 4.20046 19.6667C3.53379 19.6667 3.13379 20.0667 3.13379 20.7333V22.8667C3.13379 26.3333 5.93379 29.1333 9.26712 29.1333H11.0005C11.5338 29.1333 12.0671 28.7333 12.0671 28.0667C12.0671 27.4 11.6671 27.1333 11.1338 27.1333Z",fill:"#007AFF"}),React__namespace.createElement("path",{id:"Vector_3",fillRule:"evenodd",clipRule:"evenodd",d:"M4.20064 12.199C4.73397 12.199 5.2673 11.799 5.2673 11.1323V8.99896C5.2673 6.73229 7.13397 4.73229 9.40064 4.73229H11.134C11.6673 4.73229 12.2006 4.33229 12.2006 3.66563C12.2006 2.99896 11.8006 2.59896 11.134 2.59896H9.40064C5.93397 2.59896 3.2673 5.39896 3.2673 8.86563V10.999C3.13397 11.799 3.6673 12.199 4.20064 12.199Z",fill:"#007AFF"}),React__namespace.createElement("path",{id:"Vector_4",fillRule:"evenodd",clipRule:"evenodd",d:"M16.0674 16.1995C18.2007 16.1995 19.934 14.4661 19.934 12.3328C19.934 10.0661 18.334 8.46615 16.0674 8.46615C13.934 8.46615 12.2007 10.1995 12.2007 12.3328C12.2007 14.4661 13.934 16.1995 16.0674 16.1995Z",fill:"#007AFF"}),React__namespace.createElement("path",{id:"Vector_5",fillRule:"evenodd",clipRule:"evenodd",d:"M21.8005 20.5989C21.8005 17.9323 17.6672 17.9323 16.2005 17.9323C14.7339 17.9323 10.6006 17.9323 10.6006 20.5989C10.6006 23.2656 14.7339 23.2656 16.2005 23.2656C17.6672 23.2656 21.8005 23.2656 21.8005 20.5989Z",fill:"#007AFF"}),React__namespace.createElement("path",{id:"Vector_6",fillRule:"evenodd",clipRule:"evenodd",d:"M23.0007 2.86459H21.2674C20.734 2.86459 20.2007 3.26459 20.2007 3.93125C20.2007 4.59792 20.6007 4.99792 21.2674 4.99792H23.0007C25.2674 4.99792 27.134 6.86459 27.134 9.26459V11.3979C27.134 11.9313 27.534 12.4646 28.2007 12.4646C28.8674 12.4646 29.2673 12.0646 29.2673 11.3979V9.26459C29.134 5.66459 26.4674 2.86459 23.0007 2.86459Z",fill:"#007AFF"}))),PhishingResistanceScreen=({token:Be,uiConfig:Le,redirectUrl:Ye,allowSkipRedirect:tt,onContinueOnDesktop:nt})=>{const{t:ft}=useTranslation$1(),ht=()=>{const gt=useTokens();return jsxRuntimeExports.jsx(Flex,{direction:"column",hFull:!0,wFull:!0,children:jsxRuntimeExports.jsx(Flex,{borderWidth:"1px",borderStyle:"solid",borderColor:gt.color.border.primary,borderRadius:"8px",m:"auto",minW:"700px",maxW:"700px",direction:"column",children:jsxRuntimeExports.jsxs(Flex,{direction:"column",pt:6,children:[jsxRuntimeExports.jsx(Text$8,{as:"p",color:gt.color.text.body.primary,mb:2,w:"full",textAlign:"center",fontSize:"28px",fontWeight:gt.typography.fontWeight.medium,children:ft("redirect.phishingResistance.titleClient")}),jsxRuntimeExports.jsxs(Flex,{mx:"auto",my:2,mb:5,maxW:"60%",color:gt.color.text.body.tertiary,align:"center",children:[jsxRuntimeExports.jsx(Flex,{mr:3,minH:"32px",w:"32px",align:"center",justify:"center",children:jsxRuntimeExports.jsx(SvgUserScan,{width:32,height:32})}),jsxRuntimeExports.jsx(Text$8,{fontSize:gt.typography.fontSize.sm,as:"div",children:ft("redirect.phishingResistance.explanation1")})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",w:"full",align:"center",children:[jsxRuntimeExports.jsx(Box,{backgroundColor:gt.color.border.primary,mb:6,h:"1px",wFull:!0}),jsxRuntimeExports.jsx(Box,{borderWidth:"1px",borderStyle:"solid",borderColor:gt.color.border.primary,borderRadius:"20px",p:3,children:jsxRuntimeExports.jsx(_default,{value:Ye,size:200,className:"IncodeRedirectQRCode"})})]}),tt&&jsxRuntimeExports.jsx(Flex,{mb:gt.spacing[6],wFull:!0,justify:"center",children:jsxRuntimeExports.jsx(Button$b,{h:"auto",variant:"link",onClick:nt,children:ft("redirect.continueOnDesktop")})}),jsxRuntimeExports.jsxs(Flex,{my:8,align:"center",justify:"center",children:[jsxRuntimeExports.jsx(SvgIconInformationGray,{className:"mr-2"}),jsxRuntimeExports.jsx(Text$8,{color:gt.color.text.body.secondary,fontSize:gt.typography.fontSize.sm,children:ft("redirect.phishingResistance.recommendedBrowser")})]})]})})})};return Ye?jsxRuntimeExports.jsx(IncodeProvider,{token:Be,uiConfig:Le,children:jsxRuntimeExports.jsx(Page$1,{children:jsxRuntimeExports.jsx(ht,{})})}):null},onboardingStatusUrl="/omni/get/onboarding/status";function getOnboardingStatus(Be){return exports.api.get(onboardingStatusUrl,{headers:{"X-Incode-Hardware-Id":Be.token}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}const getRedirectUrl=(Be,{token:Le})=>exports.api.get(`omni/redirection-url${Be?`?flowId=${Be}`:""}`,{headers:{"X-Incode-Hardware-Id":Le}}).then(Ye=>Ye.data);async function qrRefreshUUID({token:Be,onboardingId:Le}){return exports.api.post("/omni/qr/refresh",{onboardingId:Le},{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data)}const URL_ERROR="Url is not valid",useQR=({session:Be,onSuccess:Le,url:Ye,allowReEnrollment:tt=!1,expired:nt=!1,externalId:ft,canceled:ht=!1,lang:gt,authHint:At,qrPhishingResistance:xt})=>{const[yt,Ct]=React.useState(""),[Et,vt]=React.useState(!1),kt=React.useRef(null),bt=React.useRef(!1),wt=React.useRef(),[It,Rt]=React.useState(""),[Tt,Bt]=React.useState("");React.useEffect(()=>{getOnboardingStatus(Be).then(Dt=>{(Dt==null?void 0:Dt.onboardingStatus)==="ONBOARDING_FINISHED"&&tt&&!nt&&vt(!0)})},[]),React.useEffect(()=>{addEvent({token:Be.token,code:"qrCodeShown"})},[Be]),kt.current=useInterval(()=>{const Dt=async()=>{try{const{redirectionUrl:Ot=""}=await getRedirectUrl(null,Be);if(sleep(3e3),Ot){window.location.replace(Ot);return}}catch(Ot){console.error(Ot,"finish")}};getOnboardingStatus(Be).then(Ot=>{Et?(Ot==null?void 0:Ot.onboardingStatus)!=="ONBOARDING_FINISHED"&&vt(!1):(Ot==null?void 0:Ot.onboardingStatus)==="ONBOARDING_FINISHED"&&!bt.current&&(kt.current&&clearInterval(kt.current),wt.current&&clearInterval(wt.current),bt.current=!0,Le(Ot),Dt())}).catch(emptyFunc)},ht?null:5e3),React.useEffect(()=>{(async()=>{try{const Ot=Tt||await createRedirectUrl({session:Be});Bt(Ot);const Lt=new URL(Ot);if(Ye){const Wt=new URL(Ye),$t=Lt.searchParams.get("uuid"),qt=xt?It||await Pt($t):"";qt&&Wt.searchParams.append("qrUuid",qt),Wt.searchParams.append("uuid",$t),Wt.searchParams.append("isRedirect","true"),gt&&Wt.searchParams.append("lang",gt),ft&&Wt.searchParams.append("externalId",ft),At&&Wt.searchParams.append("auth_hint",At),Ct(Wt.href)}else{const Wt=new URL(Ot),$t=Wt.searchParams.get("uuid"),qt=xt?It||await Pt($t):"";qt&&Wt.searchParams.append("qrUuid",qt),Wt.searchParams.append("isRedirect","true"),gt&&Wt.searchParams.append("lang",gt),At&&Wt.searchParams.append("auth_hint",At),Ct(Wt.href)}}catch(Ot){console.error(URL_ERROR,Ot)}})()},[Ye,It]),React.useEffect(()=>()=>{wt.current&&clearInterval(wt.current)},[]);const Pt=async Dt=>{const{uuid:Ot}=await qrRefreshUUID({token:Be.token,onboardingId:Dt});return wt.current=setInterval(async()=>{const{uuid:Lt}=await qrRefreshUUID({token:Be.token,onboardingId:Dt});Lt&&Rt(Lt)},5e3),Rt(Ot),It};return{redirectUrl:yt}},asYouType=new AsYouType,RedirectContainer=dt.div`
|
|
6740
6740
|
display: flex;
|
|
6741
6741
|
align-items: center;
|
|
6742
6742
|
justify-content: center;
|
|
@@ -7064,7 +7064,7 @@ newPrivacyConsent.text4
|
|
|
7064
7064
|
width: 250px;
|
|
7065
7065
|
}
|
|
7066
7066
|
}
|
|
7067
|
-
`,convertMinutesToDHM=Be=>{const Le={days:0,hours:0,minutes:0};return Be<60?Le.minutes=Be:Be>=60&&Be<=4320?(Le.hours=Math.floor(Be/60),Le.minutes=Be%60):(Le.days=Math.floor(Be/1440),Le.hours=Math.floor(Be%1440/60),Le.minutes=Be%60),Le},getUuidFromUrl=Be=>{if(Be)try{return new URL(Be).searchParams.get("uuid")}catch(Le){return console.error("Invalid URL:",Le),null}};function Redirect({session:Be,onSuccess:Le,url:Ye,showSms:tt,assets:nt,smsText:ft,skipDesktopRedirect:ht,allowSkipRedirect:gt=!1,externalId:At,expired:xt,allowReEnrollment:yt,authHint:Ct,qrPhishingResistance:Et}){const{t:vt}=useTranslation$1(),[kt,bt]=React.useState(""),[wt,It]=React.useState(null),[Rt,Tt]=React.useState(),[Bt,Pt]=React.useState(tt),[Dt,Ot]=React.useState(!0),[Lt,Wt]=React.useState(!1),[$t,qt]=React.useState(),[Ht,Ut]=React.useState(!1),Ft=useQuery(),Xt=Ft.get("lang"),_t=convertMinutesToDHM(Be.onboardingLinkExpirationMinutes??15),Mt=dr=>{const{hours:rr,days:gr,minutes:yr}=dr;let or="";return gr>0&&(or+=` ${gr} ${vt("redirect.expDays")}`,rr>0&&(or+=yr>0?",":` ${vt("redirect.and")}`),rr===0&&yr>0&&(or+=` ${vt("redirect.and")}`)),rr>0&&(or+=` ${rr} ${vt("redirect.expHours")}`,yr>0&&(or+=` ${vt("redirect.and")}`)),yr>0&&(or+=` ${yr} ${vt("redirect.expMinutes")}`),or};React.useEffect(()=>{const dr=Ft.get("hideSms");(()=>{if(dr==null)return;const gr=dr.toLowerCase()==="true";Pt(gr)})()},[Ft]);const{redirectUrl:jt}=useQR({url:Ye,onSuccess:Le,session:Be,expired:xt,allowReEnrollment:yt,externalId:At,lang:Xt,canceled:Ht,authHint:Ct,qrPhishingResistance:Et});React.useEffect(()=>{getStartInfo(Be).then(dr=>{bt(dr.phonePrefix)})},[]),React.useEffect(()=>{if(!nt)return;const{logo:dr}=nt;if(!dr){qt(welcomeLogo);return}qt(dr)},[nt]);function zt({target:{value:dr}}){const rr=parsePhoneNumber(dr),gr=asYouType.input(dr);bt(gr),asYouType.reset(),rr!=null&&rr.isValid()?(Tt(dr),Ot(!1)):Ot(!0)}const Gt=()=>`${ft} ${jt}`,Yt=async()=>{It(!0),addEvent({token:Be.token,code:"userClickedSendSms"}),await addPhone({phone:Rt,token:Be.token,...ft&&{text:Gt()}});const dr=Xt?[`lang=${Xt}`]:[];ft||await sendRedirectSMS({smsType:"DESKTOP_ONBOARDING",token:Be.token,params:dr,uuid:getUuidFromUrl(jt)}),It(!1),Wt(!0)},ar=()=>{Ut(!0),ht()},[tr,sr]=React.useState(!1);return React.useLayoutEffect(()=>{window.innerWidth<=1281&&sr(!0)},[]),jt?jsxRuntimeExports.jsxs(RedirectContainer,{className:"IncodeRedirectContainer",children:[jsxRuntimeExports.jsxs(QrItemContainer,{className:"IncodeRedirectQrItemContainer",children:[jsxRuntimeExports.jsx(TitleMobile,{className:"IncodeRedirectTitleMobile",children:vt("redirect.scanQrTitle")}),jsxRuntimeExports.jsx(ListMobile,{className:"IncodeRedirectListMobile",children:jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectItem",children:vt("redirect.scanQrParagraph1")})}),jsxRuntimeExports.jsx(QrContainer,{className:"IncodeRedirectQrContainer",children:jsxRuntimeExports.jsx(_default,{value:jt,bgColor:"#eceff2",size:tr?100:150,className:"IncodeRedirectQRCode"})}),jsxRuntimeExports.jsxs(ContainerRecommendation,{className:"IncodeRedirectContainerRecommendation",children:[jsxRuntimeExports.jsx(Title$c,{className:"IncodeRedirectTitle",children:vt("redirect.scanQrTitle")}),jsxRuntimeExports.jsxs(List$1,{className:"IncodeRedirectList",children:[jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectParagraph1",children:vt("redirect.scanQrParagraph1")}),jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectParagraph2",children:vt("redirect.scanQrParagraph2")}),jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectParagraph3",children:vt("redirect.scanQrParagraph3")})]})]})]}),Bt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(SeparatorContainer,{className:"IncodeRedirectSeparatorContainer",children:[jsxRuntimeExports.jsx(VerticalLine,{className:"IncodeRedirectVerticalLine"}),jsxRuntimeExports.jsx(Paragraph$5,{children:vt("common.or")}),jsxRuntimeExports.jsx(VerticalLine,{})]}),jsxRuntimeExports.jsxs(QrItemContainer,{className:"IncodeRedirectQrItemContainer",children:[jsxRuntimeExports.jsxs(SendVerificationMobile,{className:"IncodeRedirectSendVerificationMobileContainer",children:[jsxRuntimeExports.jsxs(MessageContainer$1,{className:"IncodeRedirectSendVerificationMobileMessageContainer",children:[jsxRuntimeExports.jsx(Image$9,{className:"IncodeRedirectSendVerificationMobileImage",src:phone$1,alt:"mobile device"}),jsxRuntimeExports.jsx("h2",{className:"IncodeRedirectSendVerificationMobileText",children:vt("redirect.sendLinkToMyPhone")})]}),jsxRuntimeExports.jsx(ListMobile,{className:"IncodeRedirectSendVerificationMobileList",children:jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectSendVerificationMobileListItem",children:vt("redirect.linkParagraph")})})]}),jsxRuntimeExports.jsxs(SendVerificationDesktop,{className:"IncodeRedirectSendVerificationDesktopContainer",children:[jsxRuntimeExports.jsx(Image$9,{className:"IncodeRedirectSendVerificationDesktopImage",src:phone$1,alt:"mobile device"}),jsxRuntimeExports.jsx(Title$c,{className:"IncodeRedirectSendVerificationDesktopText",children:vt("redirect.sendLink")})]}),jsxRuntimeExports.jsxs(SendSmSContainer,{className:"IncodeRedirectSendSMSContainer",children:[jsxRuntimeExports.jsx("h2",{className:"IncodeRedirectSendSMSText",children:vt("redirect.sendLink")}),jsxRuntimeExports.jsx(List$1,{className:"mid-screen IncodeRedirectSendSMSList",children:jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectSendSMSListItem",children:vt("redirect.linkParagraph")})}),jsxRuntimeExports.jsxs(ContainerInputs,{className:"IncodeRedirectContainerInputs",children:[jsxRuntimeExports.jsx(Input$7,{autoComplete:"off",type:"tel",onChange:zt,value:kt,className:"IncodeRedirectInput"}),jsxRuntimeExports.jsx(List$1,{className:"big-screen",children:jsxRuntimeExports.jsx(Item,{children:vt("redirect.linkParagraph")})}),Lt?jsxRuntimeExports.jsx(SmsSentContainer,{className:"IncodeRedirectSmsSentContainer",children:jsxRuntimeExports.jsx(SmsSentParagraph,{className:"IncodeRedirectSmsSentParagraph",children:`${vt("redirect.expLink")}${Mt(_t)}`})}):jsxRuntimeExports.jsx(CustomButton,{disabled:Dt||wt,onClick:Yt,children:vt("common.send")})]})]}),Lt&&jsxRuntimeExports.jsx(ResendParagraph,{onClick:()=>{Wt(!1),Yt()},className:"IncodeRedirectResendParagraph",children:vt("redirect.linkNotReceived")})]})]}),jsxRuntimeExports.jsxs(FooterDesktop,{className:"IncodeRedirectFooterDesktop",children:[$t&&jsxRuntimeExports.jsx(Logo,{src:$t})," ",gt?jsxRuntimeExports.jsxs("p",{children:[vt("redirect.dontHavePhone")," ",jsxRuntimeExports.jsx("button",{onClick:ar,type:"button",children:vt("redirect.continueOnDesktop")})]}):null]})]}):null}const FlowRedirect=({flow:Be,token:Le,onSuccess:Ye,onSkip:tt,mobileQrRedirectUrl:nt})=>jsxRuntimeExports.jsx(Redirect,{session:{token:Le},onSuccess:Ye,showSms:!Be.disableSmsOption,flowId:Be.flowId,skipDesktopRedirect:tt,allowSkipRedirect:Be.addContinueToDesktop,expired:!1,url:nt,qrPhishingResistance:Be.qrPhishingResistance}),shouldShowFlowRedirect=Be=>Be?Be.redirectDesktopToMobile&&mobile.isDesktop():!1,useFlowRedirect=({flow:Be,onSkip:Le,forceSkipRedirect:Ye=!1})=>{const[tt,nt]=React.useState(Ye);return{showRedirect:shouldShowFlowRedirect(Be)&&!tt,onSkip:()=>{nt(!0),Le==null||Le()}}},FlowDataContext=React.createContext(void 0);function FlowDataProvider({token:Be,children:Le}){const[Ye,tt]=React.useState(null),[nt,ft]=React.useState(null);React.useEffect(()=>{Be&&tt(null)},[Be]);const ht=React.useMemo(()=>({existingUser:Ye,setExistingUser:tt,ageEstimated:nt,setAgeEstimated:ft}),[Ye,nt]);return jsxRuntimeExports.jsx(FlowDataContext.Provider,{value:ht,children:Le})}function useFlowData(){const Be=React.useContext(FlowDataContext);if(!Be)throw new Error("useFlowData must be used within FlowDataProvider");return Be}class FlowLogger{constructor(Le){this.onEvent=Le}flowStarted(Le){this.emit({type:"flow.started",ts:Date.now(),total:Le})}stepStarted(Le,Ye,tt){this.emit({type:"step.started",ts:Date.now(),key:Le,index:Ye,total:tt})}stepCompleted(Le,Ye,tt){this.emit({type:"step.completed",ts:Date.now(),key:Le,index:Ye,total:tt})}flowCompleted(Le){this.emit({type:"flow.completed",ts:Date.now(),total:Le})}flowError(Le){this.emit({type:"flow.error",ts:Date.now(),error:Le})}emit(Le){this.onEvent&&this.onEvent(Le)}flowRedirected(){this.emit({type:"flow.redirected",ts:Date.now()})}}function AESignatureModule({onSuccess:Be,onError:Le,token:Ye,config:tt}){return jsxRuntimeExports.jsx(AdvancedElectronicSignature$1,{onSuccess:Be,onError:()=>Le(),token:Ye,downloadDocument:tt.downloadDocument,uploadDocument:tt.uploadDocument})}const poaImage$1="data:image/svg+xml,%3csvg%20width='232'%20height='223'%20viewBox='0%200%20232%20223'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='232'%20height='223'%20rx='5'%20fill='%23E0E8EB'/%3e%3cg%20filter='url(%23filter0_d_1867_34445)'%3e%3cpath%20d='M52%2027C52%2024.7909%2053.7909%2023%2056%2023H175C177.209%2023%20179%2024.7909%20179%2027V197C179%20199.209%20177.209%20201%20175%20201H56C53.7909%20201%2052%20199.209%2052%20197V27Z'%20fill='white'/%3e%3c/g%3e%3crect%20x='60'%20y='82'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='61'%20width='61'%20height='8'%20rx='1'%20fill='%2320263D'/%3e%3crect%20x='60'%20y='96'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='89'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='101'%20width='39'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='111'%20width='39'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='129'%20width='93'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='150'%20width='93'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='143'%20width='104'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='136'%20width='100'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='157'%20width='100'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='94'%20width='39'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='106'%20width='12'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='31'%20width='12'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='160'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='160'%20y='187'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='143'%20y='187'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='92'%20y='187'%20width='36'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='187'%20width='15'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='146'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23DBB107'/%3e%3crect%20x='60'%20y='106'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='112'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='37'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='112'%20width='12'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M52.0017%2053H179V55H52L52.0017%2053Z'%20fill='%23E9E9EB'/%3e%3cdefs%3e%3cfilter%20id='filter0_d_1867_34445'%20x='43'%20y='19'%20width='145'%20height='196'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='5'/%3e%3cfeGaussianBlur%20stdDeviation='4.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.149145%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_1867_34445'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_1867_34445'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",specialCasesFlow$2="6374ad13eac341cb71ed30ea",FILE_SIZE_LIMIT$1=10*1024*1024,ProofOfAddressContainer$2=dt.div`
|
|
7067
|
+
`,convertMinutesToDHM=Be=>{const Le={days:0,hours:0,minutes:0};return Be<60?Le.minutes=Be:Be>=60&&Be<=4320?(Le.hours=Math.floor(Be/60),Le.minutes=Be%60):(Le.days=Math.floor(Be/1440),Le.hours=Math.floor(Be%1440/60),Le.minutes=Be%60),Le},getUuidFromUrl=Be=>{if(Be)try{return new URL(Be).searchParams.get("uuid")}catch(Le){return console.error("Invalid URL:",Le),null}};function Redirect({session:Be,onSuccess:Le,url:Ye,showSms:tt,assets:nt,smsText:ft,skipDesktopRedirect:ht,allowSkipRedirect:gt=!1,externalId:At,expired:xt,allowReEnrollment:yt,authHint:Ct,qrPhishingResistance:Et,uiConfig:vt}){const{t:kt}=useTranslation$1(),[bt,wt]=React.useState(""),[It,Rt]=React.useState(null),[Tt,Bt]=React.useState(),[Pt,Dt]=React.useState(tt),[Ot,Lt]=React.useState(!0),[Wt,$t]=React.useState(!1),[qt,Ht]=React.useState(),[Ut,Ft]=React.useState(!1),Xt=useQuery(),_t=Xt.get("lang"),Mt=convertMinutesToDHM(Be.onboardingLinkExpirationMinutes??15),jt=rr=>{const{hours:gr,days:yr,minutes:or}=rr;let ir="";return yr>0&&(ir+=` ${yr} ${kt("redirect.expDays")}`,gr>0&&(ir+=or>0?",":` ${kt("redirect.and")}`),gr===0&&or>0&&(ir+=` ${kt("redirect.and")}`)),gr>0&&(ir+=` ${gr} ${kt("redirect.expHours")}`,or>0&&(ir+=` ${kt("redirect.and")}`)),or>0&&(ir+=` ${or} ${kt("redirect.expMinutes")}`),ir};React.useEffect(()=>{const rr=Xt.get("hideSms");(()=>{if(rr==null)return;const yr=rr.toLowerCase()==="true";Dt(yr)})()},[Xt]);const{redirectUrl:zt}=useQR({url:Ye,onSuccess:Le,session:Be,expired:xt,allowReEnrollment:yt,externalId:At,lang:_t,canceled:Ut,authHint:Ct,qrPhishingResistance:Et});React.useEffect(()=>{getStartInfo(Be).then(rr=>{wt(rr.phonePrefix)})},[]),React.useEffect(()=>{if(!nt)return;const{logo:rr}=nt;if(!rr){Ht(welcomeLogo);return}Ht(rr)},[nt]);function Gt({target:{value:rr}}){const gr=parsePhoneNumber(rr),yr=asYouType.input(rr);wt(yr),asYouType.reset(),gr!=null&&gr.isValid()?(Bt(rr),Lt(!1)):Lt(!0)}const Yt=()=>`${ft} ${zt}`,ar=async()=>{Rt(!0),addEvent({token:Be.token,code:"userClickedSendSms"}),await addPhone({phone:Tt,token:Be.token,...ft&&{text:Yt()}});const rr=_t?[`lang=${_t}`]:[];ft||await sendRedirectSMS({smsType:"DESKTOP_ONBOARDING",token:Be.token,params:rr,uuid:getUuidFromUrl(zt)}),Rt(!1),$t(!0)},tr=()=>{Ft(!0),ht()},[sr,dr]=React.useState(!1);return React.useLayoutEffect(()=>{window.innerWidth<=1281&&dr(!0)},[]),zt?Et?jsxRuntimeExports.jsx(PhishingResistanceScreen,{token:Be.token,redirectUrl:zt,uiConfig:vt??{},allowSkipRedirect:gt,onContinueOnDesktop:tr}):jsxRuntimeExports.jsxs(RedirectContainer,{className:"IncodeRedirectContainer",children:[jsxRuntimeExports.jsxs(QrItemContainer,{className:"IncodeRedirectQrItemContainer",children:[jsxRuntimeExports.jsx(TitleMobile,{className:"IncodeRedirectTitleMobile",children:kt("redirect.scanQrTitle")}),jsxRuntimeExports.jsx(ListMobile,{className:"IncodeRedirectListMobile",children:jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectItem",children:kt("redirect.scanQrParagraph1")})}),jsxRuntimeExports.jsx(QrContainer,{className:"IncodeRedirectQrContainer",children:jsxRuntimeExports.jsx(_default,{value:zt,bgColor:"#eceff2",size:sr?100:150,className:"IncodeRedirectQRCode"})}),jsxRuntimeExports.jsxs(ContainerRecommendation,{className:"IncodeRedirectContainerRecommendation",children:[jsxRuntimeExports.jsx(Title$c,{className:"IncodeRedirectTitle",children:kt("redirect.scanQrTitle")}),jsxRuntimeExports.jsxs(List$1,{className:"IncodeRedirectList",children:[jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectParagraph1",children:kt("redirect.scanQrParagraph1")}),jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectParagraph2",children:kt("redirect.scanQrParagraph2")}),jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectParagraph3",children:kt("redirect.scanQrParagraph3")})]})]})]}),Pt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(SeparatorContainer,{className:"IncodeRedirectSeparatorContainer",children:[jsxRuntimeExports.jsx(VerticalLine,{className:"IncodeRedirectVerticalLine"}),jsxRuntimeExports.jsx(Paragraph$5,{children:kt("common.or")}),jsxRuntimeExports.jsx(VerticalLine,{})]}),jsxRuntimeExports.jsxs(QrItemContainer,{className:"IncodeRedirectQrItemContainer",children:[jsxRuntimeExports.jsxs(SendVerificationMobile,{className:"IncodeRedirectSendVerificationMobileContainer",children:[jsxRuntimeExports.jsxs(MessageContainer$1,{className:"IncodeRedirectSendVerificationMobileMessageContainer",children:[jsxRuntimeExports.jsx(Image$9,{className:"IncodeRedirectSendVerificationMobileImage",src:phone$1,alt:"mobile device"}),jsxRuntimeExports.jsx("h2",{className:"IncodeRedirectSendVerificationMobileText",children:kt("redirect.sendLinkToMyPhone")})]}),jsxRuntimeExports.jsx(ListMobile,{className:"IncodeRedirectSendVerificationMobileList",children:jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectSendVerificationMobileListItem",children:kt("redirect.linkParagraph")})})]}),jsxRuntimeExports.jsxs(SendVerificationDesktop,{className:"IncodeRedirectSendVerificationDesktopContainer",children:[jsxRuntimeExports.jsx(Image$9,{className:"IncodeRedirectSendVerificationDesktopImage",src:phone$1,alt:"mobile device"}),jsxRuntimeExports.jsx(Title$c,{className:"IncodeRedirectSendVerificationDesktopText",children:kt("redirect.sendLink")})]}),jsxRuntimeExports.jsxs(SendSmSContainer,{className:"IncodeRedirectSendSMSContainer",children:[jsxRuntimeExports.jsx("h2",{className:"IncodeRedirectSendSMSText",children:kt("redirect.sendLink")}),jsxRuntimeExports.jsx(List$1,{className:"mid-screen IncodeRedirectSendSMSList",children:jsxRuntimeExports.jsx(Item,{className:"IncodeRedirectSendSMSListItem",children:kt("redirect.linkParagraph")})}),jsxRuntimeExports.jsxs(ContainerInputs,{className:"IncodeRedirectContainerInputs",children:[jsxRuntimeExports.jsx(Input$7,{autoComplete:"off",type:"tel",onChange:Gt,value:bt,className:"IncodeRedirectInput"}),jsxRuntimeExports.jsx(List$1,{className:"big-screen",children:jsxRuntimeExports.jsx(Item,{children:kt("redirect.linkParagraph")})}),Wt?jsxRuntimeExports.jsx(SmsSentContainer,{className:"IncodeRedirectSmsSentContainer",children:jsxRuntimeExports.jsx(SmsSentParagraph,{className:"IncodeRedirectSmsSentParagraph",children:`${kt("redirect.expLink")}${jt(Mt)}`})}):jsxRuntimeExports.jsx(CustomButton,{disabled:Ot||It,onClick:ar,children:kt("common.send")})]})]}),Wt&&jsxRuntimeExports.jsx(ResendParagraph,{onClick:()=>{$t(!1),ar()},className:"IncodeRedirectResendParagraph",children:kt("redirect.linkNotReceived")})]})]}),jsxRuntimeExports.jsxs(FooterDesktop,{className:"IncodeRedirectFooterDesktop",children:[qt&&jsxRuntimeExports.jsx(Logo,{src:qt})," ",gt?jsxRuntimeExports.jsxs("p",{children:[kt("redirect.dontHavePhone")," ",jsxRuntimeExports.jsx("button",{onClick:tr,type:"button",children:kt("redirect.continueOnDesktop")})]}):null]})]}):null}const FlowRedirect=({flow:Be,token:Le,onSuccess:Ye,onSkip:tt,mobileQrRedirectUrl:nt})=>jsxRuntimeExports.jsx(Redirect,{session:{token:Le},onSuccess:Ye,showSms:!Be.disableSmsOption,flowId:Be.flowId,skipDesktopRedirect:tt,allowSkipRedirect:Be.addContinueToDesktop,expired:!1,url:nt,qrPhishingResistance:Be.qrPhishingResistance}),shouldShowFlowRedirect=Be=>Be?Be.redirectDesktopToMobile&&mobile.isDesktop():!1,useFlowRedirect=({flow:Be,onSkip:Le,forceSkipRedirect:Ye=!1})=>{const[tt,nt]=React.useState(Ye);return{showRedirect:shouldShowFlowRedirect(Be)&&!tt,onSkip:()=>{nt(!0),Le==null||Le()}}},FlowDataContext=React.createContext(void 0);function FlowDataProvider({token:Be,children:Le}){const[Ye,tt]=React.useState(null),[nt,ft]=React.useState(null);React.useEffect(()=>{Be&&tt(null)},[Be]);const ht=React.useMemo(()=>({existingUser:Ye,setExistingUser:tt,ageEstimated:nt,setAgeEstimated:ft}),[Ye,nt]);return jsxRuntimeExports.jsx(FlowDataContext.Provider,{value:ht,children:Le})}function useFlowData(){const Be=React.useContext(FlowDataContext);if(!Be)throw new Error("useFlowData must be used within FlowDataProvider");return Be}class FlowLogger{constructor(Le){this.onEvent=Le}flowStarted(Le){this.emit({type:"flow.started",ts:Date.now(),total:Le})}stepStarted(Le,Ye,tt){this.emit({type:"step.started",ts:Date.now(),key:Le,index:Ye,total:tt})}stepCompleted(Le,Ye,tt){this.emit({type:"step.completed",ts:Date.now(),key:Le,index:Ye,total:tt})}flowCompleted(Le){this.emit({type:"flow.completed",ts:Date.now(),total:Le})}flowError(Le){this.emit({type:"flow.error",ts:Date.now(),error:Le})}emit(Le){this.onEvent&&this.onEvent(Le)}flowRedirected(){this.emit({type:"flow.redirected",ts:Date.now()})}}function AESignatureModule({onSuccess:Be,onError:Le,token:Ye,config:tt}){return jsxRuntimeExports.jsx(AdvancedElectronicSignature$1,{onSuccess:Be,onError:()=>Le(),token:Ye,downloadDocument:tt.downloadDocument,uploadDocument:tt.uploadDocument})}const poaImage$1="data:image/svg+xml,%3csvg%20width='232'%20height='223'%20viewBox='0%200%20232%20223'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='232'%20height='223'%20rx='5'%20fill='%23E0E8EB'/%3e%3cg%20filter='url(%23filter0_d_1867_34445)'%3e%3cpath%20d='M52%2027C52%2024.7909%2053.7909%2023%2056%2023H175C177.209%2023%20179%2024.7909%20179%2027V197C179%20199.209%20177.209%20201%20175%20201H56C53.7909%20201%2052%20199.209%2052%20197V27Z'%20fill='white'/%3e%3c/g%3e%3crect%20x='60'%20y='82'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='61'%20width='61'%20height='8'%20rx='1'%20fill='%2320263D'/%3e%3crect%20x='60'%20y='96'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='89'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='101'%20width='39'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='111'%20width='39'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='129'%20width='93'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='150'%20width='93'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='143'%20width='104'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='136'%20width='100'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='157'%20width='100'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='94'%20width='39'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='106'%20width='12'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='31'%20width='12'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='160'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='160'%20y='187'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='143'%20y='187'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='92'%20y='187'%20width='36'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='187'%20width='15'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='146'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23DBB107'/%3e%3crect%20x='60'%20y='106'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='112'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='37'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='112'%20width='12'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M52.0017%2053H179V55H52L52.0017%2053Z'%20fill='%23E9E9EB'/%3e%3cdefs%3e%3cfilter%20id='filter0_d_1867_34445'%20x='43'%20y='19'%20width='145'%20height='196'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='5'/%3e%3cfeGaussianBlur%20stdDeviation='4.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.149145%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_1867_34445'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_1867_34445'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",specialCasesFlow$2="6374ad13eac341cb71ed30ea",FILE_SIZE_LIMIT$1=10*1024*1024,ProofOfAddressContainer$2=dt.div`
|
|
7068
7068
|
display: flex;
|
|
7069
7069
|
flex-direction: column;
|
|
7070
7070
|
align-items: center;
|
|
@@ -10441,7 +10441,7 @@ ${tt.publicKey}
|
|
|
10441
10441
|
onmessage = (ev) => { postMessage({isOpenBeat:true});
|
|
10442
10442
|
debugger; for (let i = 0; i < ev.data.moreDebugs; i++) { debugger; }
|
|
10443
10443
|
postMessage({isOpenBeat:false});
|
|
10444
|
-
};`],{type:"text/javascript"})));let Ye=!1,tt=!0,nt,ft=Number.NaN;const ht=xt=>{xt.data.isOpenBeat?new Promise(Ct=>{nt=Ct,setTimeout(()=>{nt(!0)},Be.maxMillisBeforeAckWhenClosed+1)}).then(Ct=>{if(Ct!==null){if(Ct!==Ye){Ye=Ct;const Et={true:Be.onDetectOpen,false:Be.onDetectClose}[`${Ct}`];Et&&Et()}ft=setTimeout(()=>{ft=Number.NaN,gt()},Be.pollingIntervalSeconds*1e3)}}):nt(!1)},gt=()=>{Le.postMessage({moreDebugs:Be.moreAnnoyingDebuggerStatements})},At={config:Be,get isOpen(){if(tt&&Be.onCheckOpennessWhilePaused==="throw")throw new Error('`onCheckOpennessWhilePaused` is set to `"throw"`.');return Ye},get paused(){return tt},set paused(xt){tt!==xt&&(tt=xt,xt?(Le.removeEventListener("message",ht),clearTimeout(ft),ft=Number.NaN,nt(null)):(Le.addEventListener("message",ht),gt()))}};switch(Object.freeze(At),globalThis.devtoolsDetector=At,Be.startup){case"manual":break;case"asap":At.paused=!1;break;case"domContentLoaded":{document.readyState!=="loading"?At.paused=!1:document.addEventListener("DOMContentLoaded",()=>{At.paused=!1},{once:!0});break}}}const i18nSetup=async(Be,Le,Ye)=>{Le&&await Be.changeLanguage(Le),Ye&&Be.addResourceBundle(Be.resolvedLanguage,"default",Ye,!0,!0)};function getRecorderProvider(Be){return isStageEnv(Be)||isDemoEnv(Be)||isSaasEnv(Be)||isStageK8sEnv(Be)?"openVidu":"openTok"}const initializeDetection=async({forceProductionMode:Be,disableIpify:Le=!1,sdkVersion:Ye}={})=>{await detectionSetup.setupDetect(Be,Ye,Le)},setupI18n=async(Be,Le)=>{i18n.isInitialized?await i18nSetup(i18n,Be,Le):await new Promise(Ye=>{i18n.on("initialized",async()=>{await i18nSetup(i18n,Be,Le),Ye()})})},setup=async({forceProductionMode:Be,theme:Le={},clientId:Ye,lang:tt,translations:nt={},apiKey:ft,apiURL:ht,tokboxApiKey:gt="46135862",options:At,customHeaders:xt,fingerprintApiKey:yt="5uYRiI0XM6p8k4124ELX",clientExperimentId:Ct,version:Et,flowId:vt,skipInitialization:kt=!1})=>{setTheme(Le),setOptions({...At,recorderProvider:getRecorderProvider(ht)}),Ye&&(ft=sha1(Ye));const bt=createApi({apiKey:ft,apiURL:ht,customHeaders:{...xt,...At.useSha256?{"X-RSA-Encryption-Scheme":"RSA/NONE/OAEPWITHSHA-256ANDMGF1PADDING"}:{}}});setApi(bt),setFingerprintApiKey(yt),kt||(initialize({apiKey:ft,apiURL:ht,clientExperimentId:Ct,flowId:vt}),await detectionSetup.setupDetect(Be,Et)),At.unsafeMode||setupFiles(),await setupI18n(tt,nt)};async function attachSignatureOnAnnotation({contractId:Be,signatureType:Le,token:Ye,signedContractId:tt,orientation:nt="ORIENTATION_NORMAL",signatureText:ft=""}){return exports.api.post("/omni/attach-signature-on-annotation",{contractId:Be,signatureType:Le,signedContractId:tt,orientation:nt,replacementText:ft},{headers:{"X-Incode-Hardware-Id":Ye}}).then(ht=>ht.data).catch(ht=>{var gt;return Promise.reject((gt=ht==null?void 0:ht.response)==null?void 0:gt.data)})}async function getSignedContractsLinks({token:Be}){return exports.api.get("/omni/get/signed-contracts-links",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>{var Ye;return Promise.reject((Ye=Le==null?void 0:Le.response)==null?void 0:Ye.data)})}function renderSignature(Be,{onSuccess:Le,token:Ye,type:tt,title:nt,subtitle:ft,initials:ht=!1,sendBase64:gt=!0,showSignatureInput:At=!1,canvasBackgroundColor:xt,canvasBorderColor:yt,penColor:Ct,onInputChange:Et}){const vt=createRoot$1(Be),kt={onSuccess:handleUnmountRoot(Le,vt,Be),onInputChange:Et,token:Ye,type:tt,title:nt,subtitle:ft,initials:ht,sendBase64:gt,canvasBackgroundColor:xt,canvasBorderColor:yt,penColor:Ct,showSignatureInput:At};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye,children:jsxRuntimeExports.jsx(Signature$1,{...kt})}),Be,vt)}function addWatchListResults({token:Be,firstName:Le=null,surName:Ye=null,birthYear:tt=null,countryCodes:nt=[]}){return exports.api.post("/omni/watchlist-result",{firstName:Le,surName:Ye,birthYear:tt,countryCodes:nt,subscribe:!0},{headers:{"X-Incode-Hardware-Id":Be}}).then(ft=>ft.data).catch(ft=>Promise.reject(ft.response.data))}function initWatchList({token:Be}){return exports.api.post("/omni/init-watchlist",{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}const
|
|
10444
|
+
};`],{type:"text/javascript"})));let Ye=!1,tt=!0,nt,ft=Number.NaN;const ht=xt=>{xt.data.isOpenBeat?new Promise(Ct=>{nt=Ct,setTimeout(()=>{nt(!0)},Be.maxMillisBeforeAckWhenClosed+1)}).then(Ct=>{if(Ct!==null){if(Ct!==Ye){Ye=Ct;const Et={true:Be.onDetectOpen,false:Be.onDetectClose}[`${Ct}`];Et&&Et()}ft=setTimeout(()=>{ft=Number.NaN,gt()},Be.pollingIntervalSeconds*1e3)}}):nt(!1)},gt=()=>{Le.postMessage({moreDebugs:Be.moreAnnoyingDebuggerStatements})},At={config:Be,get isOpen(){if(tt&&Be.onCheckOpennessWhilePaused==="throw")throw new Error('`onCheckOpennessWhilePaused` is set to `"throw"`.');return Ye},get paused(){return tt},set paused(xt){tt!==xt&&(tt=xt,xt?(Le.removeEventListener("message",ht),clearTimeout(ft),ft=Number.NaN,nt(null)):(Le.addEventListener("message",ht),gt()))}};switch(Object.freeze(At),globalThis.devtoolsDetector=At,Be.startup){case"manual":break;case"asap":At.paused=!1;break;case"domContentLoaded":{document.readyState!=="loading"?At.paused=!1:document.addEventListener("DOMContentLoaded",()=>{At.paused=!1},{once:!0});break}}}const i18nSetup=async(Be,Le,Ye)=>{Le&&await Be.changeLanguage(Le),Ye&&Be.addResourceBundle(Be.resolvedLanguage,"default",Ye,!0,!0)};function getRecorderProvider(Be){return isStageEnv(Be)||isDemoEnv(Be)||isSaasEnv(Be)||isStageK8sEnv(Be)?"openVidu":"openTok"}const initializeDetection=async({forceProductionMode:Be,disableIpify:Le=!1,sdkVersion:Ye}={})=>{await detectionSetup.setupDetect(Be,Ye,Le)},setupI18n=async(Be,Le)=>{i18n.isInitialized?await i18nSetup(i18n,Be,Le):await new Promise(Ye=>{i18n.on("initialized",async()=>{await i18nSetup(i18n,Be,Le),Ye()})})},setup=async({forceProductionMode:Be,theme:Le={},clientId:Ye,lang:tt,translations:nt={},apiKey:ft,apiURL:ht,tokboxApiKey:gt="46135862",options:At,customHeaders:xt,fingerprintApiKey:yt="5uYRiI0XM6p8k4124ELX",clientExperimentId:Ct,version:Et,flowId:vt,skipInitialization:kt=!1})=>{setTheme(Le),setOptions({...At,recorderProvider:getRecorderProvider(ht)}),Ye&&(ft=sha1(Ye));const bt=createApi({apiKey:ft,apiURL:ht,customHeaders:{...xt,...At.useSha256?{"X-RSA-Encryption-Scheme":"RSA/NONE/OAEPWITHSHA-256ANDMGF1PADDING"}:{}}});setApi(bt),setFingerprintApiKey(yt),kt||(initialize({apiKey:ft,apiURL:ht,clientExperimentId:Ct,flowId:vt}),await detectionSetup.setupDetect(Be,Et)),At.unsafeMode||setupFiles(),await setupI18n(tt,nt)};async function attachSignatureOnAnnotation({contractId:Be,signatureType:Le,token:Ye,signedContractId:tt,orientation:nt="ORIENTATION_NORMAL",signatureText:ft=""}){return exports.api.post("/omni/attach-signature-on-annotation",{contractId:Be,signatureType:Le,signedContractId:tt,orientation:nt,replacementText:ft},{headers:{"X-Incode-Hardware-Id":Ye}}).then(ht=>ht.data).catch(ht=>{var gt;return Promise.reject((gt=ht==null?void 0:ht.response)==null?void 0:gt.data)})}async function getSignedContractsLinks({token:Be}){return exports.api.get("/omni/get/signed-contracts-links",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>{var Ye;return Promise.reject((Ye=Le==null?void 0:Le.response)==null?void 0:Ye.data)})}function renderSignature(Be,{onSuccess:Le,token:Ye,type:tt,title:nt,subtitle:ft,initials:ht=!1,sendBase64:gt=!0,showSignatureInput:At=!1,canvasBackgroundColor:xt,canvasBorderColor:yt,penColor:Ct,onInputChange:Et}){const vt=createRoot$1(Be),kt={onSuccess:handleUnmountRoot(Le,vt,Be),onInputChange:Et,token:Ye,type:tt,title:nt,subtitle:ft,initials:ht,sendBase64:gt,canvasBackgroundColor:xt,canvasBorderColor:yt,penColor:Ct,showSignatureInput:At};customRender(jsxRuntimeExports.jsx(App$1,{token:Ye,children:jsxRuntimeExports.jsx(Signature$1,{...kt})}),Be,vt)}function addWatchListResults({token:Be,firstName:Le=null,surName:Ye=null,birthYear:tt=null,countryCodes:nt=[]}){return exports.api.post("/omni/watchlist-result",{firstName:Le,surName:Ye,birthYear:tt,countryCodes:nt,subscribe:!0},{headers:{"X-Incode-Hardware-Id":Be}}).then(ft=>ft.data).catch(ft=>Promise.reject(ft.response.data))}function initWatchList({token:Be}){return exports.api.post("/omni/init-watchlist",{},{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>Promise.reject(Le.response.data))}const getWorkflowConfig=async({token:Be})=>{const{data:Le}=await exports.api.get("/omni/workflow/info",{headers:{"X-Incode-Hardware-Id":Be}});return Le},getCurrentNode=async({token:Be})=>{const{data:Le}=await exports.api.get("/omni/workflow/current/node",{headers:{"X-Incode-Hardware-Id":Be}});return Le},processNode=async({token:Be})=>{const{data:Le}=await exports.api.post("/omni/workflow/process/node",{},{headers:{"X-Incode-Hardware-Id":Be}});return Le},wfSDKConfig={nativeCamera:!0,sendBase64:!0},Address=({token:Be,goNext:Le,config:Ye,workflowId:tt,onError:nt})=>(useModuleEvents({module:eventModuleNames.document,token:Be.token}),jsxRuntimeExports.jsx(ProofOfAddress$2,{token:Be.token,onSuccess:Le,title:Ye.title,subtitle:Ye.text,workflowId:tt,sendBase64:wfSDKConfig.sendBase64,disableSkipPoa:Ye.disableSkipPoa,onError:()=>nt()})),AdvancedElectronicSignature=({token:Be,goNext:Le,onError:Ye,config:tt})=>jsxRuntimeExports.jsx(AdvancedElectronicSignature$1,{onError:Ye,onSuccess:Le,token:Be.token,uploadDocument:tt.uploadDocument,downloadDocument:tt.downloadDocument}),BiometricConsent=({token:Be,regulationType:Le,goNext:Ye,onError:tt})=>jsxRuntimeExports.jsx(BiometricConsent$1,{token:Be,onSuccess:Ye,onCancel:tt,regulationType:Le}),CombinedConsent=({token:Be,config:Le,goNext:Ye})=>jsxRuntimeExports.jsx(CombinedConsent$1,{consentId:Le==null?void 0:Le.combinedConsents,token:Be,onSuccess:Ye}),Curp=({token:Be,goNext:Le})=>jsxRuntimeExports.jsx(EnterCurpManager,{token:Be.token,onSuccess:Le}),processCustomNode=async({token:Be,...Le})=>{const{data:Ye}=await exports.api.post("/omni/custom-module/execution",{...Le},{headers:{"X-Incode-Hardware-Id":Be}});return Ye},IdRank={SECOND_ID:"SECOND_ID"},CustomModuleStatuses={SUCCESS:"OK",FAIL:"FAIL",UNKNOWN:"UNKNOWN"},CustomModule=({token:Be,config:Le,goNext:Ye,customModuleCallback:tt,nodeId:nt})=>{const[ft,ht]=React.useState(!1);React.useEffect(()=>{(async()=>{if(!tt&&typeof tt!="function")return ht(!0),screenEvent({module:eventModuleNames.customModule,code:"screenOpened",token:Be.token,screen:eventScreenNames.customModuleProcessing}),await processCustomNode({token:Be.token,message:null,interviewId:Be.interviewId,nodeId:nt,callbackName:Le.callbackName,status:CustomModuleStatuses.UNKNOWN}),ht(!1),screenEvent({module:eventModuleNames.customModule,code:"screenClosed",token:Be.token,screen:eventScreenNames.customModuleProcessing}),Ye();screenEvent({module:eventModuleNames.customModule,code:"screenOpened",token:Be.token,screen:eventScreenNames.customModuleCallback}),tt({onSuccess:At,onError:xt,interviewId:Be.interviewId,nodeId:nt,name:Le.callbackName})})()},[tt,Be.interviewId,nt,Le.callbackName,Be.token,Ye]),useModuleEvents({module:eventModuleNames.customModule,token:Be.token});const gt=async(yt,Ct=null)=>{ht(!0),screenEvent({module:eventModuleNames.customModule,code:"screenClosed",token:Be.token,screen:eventScreenNames.customModuleCallback}),screenEvent({module:eventModuleNames.customModule,code:"screenOpened",token:Be.token,screen:eventScreenNames.customModuleProcessing}),await processCustomNode({token:Be.token,message:Ct,interviewId:Be.interviewId,nodeId:nt,callbackName:Le.callbackName,status:yt}),ht(!1),screenEvent({module:eventModuleNames.customModule,code:"screenClosed",token:Be.token,screen:eventScreenNames.customModuleProcessing}),Ye()},At=async yt=>{gt(CustomModuleStatuses.SUCCESS,yt)},xt=async yt=>{gt(CustomModuleStatuses.FAIL,yt)};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ft?jsxRuntimeExports.jsx(Spinner$6,{}):null})},specialCasesFlow$1="6374ad13eac341cb71ed30ea",ProofOfAddressContainer$1=dt.div`
|
|
10445
10445
|
display: flex;
|
|
10446
10446
|
flex-direction: column;
|
|
10447
10447
|
align-items: center;
|
|
@@ -10491,7 +10491,7 @@ onmessage = (ev) => { postMessage({isOpenBeat:true});
|
|
|
10491
10491
|
width: 48px;
|
|
10492
10492
|
height: 48px;
|
|
10493
10493
|
margin-bottom: 16px;
|
|
10494
|
-
`,scoreStatus={[approvedStatuses.OK]:"Ok",[approvedStatuses.FAIL]:"Fail",[approvedStatuses.UNKNOWN]:"Unknown"},getScoreStatus=Be=>{switch(Be){case approvedStatuses.OK:case approvedStatuses.MANUAL_OK:return scoreStatus.OK;case approvedStatuses.FAIL:case approvedStatuses.MANUAL_FAIL:return scoreStatus.FAIL;default:return scoreStatus.UNKNOWN}};function RedirectedCallFinished({title:Be,subtitle:Le,displayOnboardingResultOnDesktop:Ye,token:tt}){const{score:nt,isLoading:ft}=useScore(Ye,tt),{t:ht}=useTranslation$1(),gt=getScoreStatus(nt==null?void 0:nt.overall.status);return ft&&Ye?jsxRuntimeExports.jsx(RedirectedCallFinishedContainer,{className:"IncodeRedirectCallFinishedContainer",children:jsxRuntimeExports.jsx(Spinner$5,{})}):Ye?jsxRuntimeExports.jsxs(RedirectedCallFinishedContainer,{className:"IncodeRedirectCallFinishedContainer",children:[gt!==scoreStatus.UNKNOWN&&jsxRuntimeExports.jsx(ImageWrapper,{children:jsxRuntimeExports.jsx("img",{src:gt===scoreStatus.OK?success:denied,alt:"verification"})}),jsxRuntimeExports.jsx(Subtitle,{className:"IncodeRedirectCallFinishedSubtitle",children:ht(`verificationComplete.title${gt}`)})]}):jsxRuntimeExports.jsxs(RedirectedCallFinishedContainer,{className:"IncodeRedirectCallFinishedContainer",children:[jsxRuntimeExports.jsx(Title$1,{className:"IncodeRedirectCallFinishedTitle",children:Be}),jsxRuntimeExports.jsx(Subtitle,{className:"IncodeRedirectCallFinishedSubtitle",children:Le})]})}let cachedAssets;const useAssets=({startSuccess:Be,token:Le,skipAssets:Ye})=>{const[tt,nt]=React.useState(exports.theme),[ft,ht]=React.useState(),gt=useUrlTheme();return React.useEffect(()=>{if(Ye){ht({});return}async function At(){if(!Le)return;const xt=cachedAssets||await fetchAssets({token:Le==null?void 0:Le.token}),yt=await getLogo(xt);ht({...xt,logo:yt}),cachedAssets=xt,xt.theme&&fetch(xt.theme).then(Ct=>Ct.json()).then(Ct=>{let Et=nt(Ct);gt!=null&>.isUrlTheme&&(Et=nt(gt)),nt(Et)}),xt["customCSS.css"]&&fetch(xt["customCSS.css"]).then(Ct=>Ct.text()).then(Ct=>{const Et=document.createElement("style");Et.innerHTML=Ct,document.getElementsByTagName("head")[0].appendChild(Et)})}At()},[Be,Le,gt,Ye]),{theme:tt,assets:ft}};async function getLogo(Be){const Le=Object.keys(Be).find(tt=>tt.startsWith("logo"));if(!Le)return;const Ye=Be[Le];if(Le.includes(".svg")){const tt=await fetch(Ye).then(ft=>ft.text()),nt=new Blob([tt],{type:"image/svg+xml"});return URL.createObjectURL(nt)}return Ye}const RedirectToMobile=({session:Be,disableSmsOption:Le,skipDesktopRedirect:Ye,allowSkipRedirect:tt,expired:nt,allowReEnrollment:ft,displayOnboardingResultOnDesktop:ht,qrPhishingResistance:gt,url:At})=>{const{t:xt}=i18n,{nextStep:yt,currentStep:Ct}=useSteps(),{assets:Et}=useAssets({startSuccess:!0,token:Be});return Et?jsxRuntimeExports.jsxs(Steps,{currentStep:Ct,children:[jsxRuntimeExports.jsx(Redirect,{session:Be,onSuccess:yt,showSms:!Le,skipDesktopRedirect:Ye,allowSkipRedirect:tt,allowReEnrollment:ft,expired:nt,assets:Et,qrPhishingResistance:gt,url:At}),jsxRuntimeExports.jsx(RedirectedCallFinished,{title:Be.endScreenTitle||xt("support.thanks"),subtitle:Be.endScreenText||xt("support.successFinish"),displayOnboardingResultOnDesktop:ht,token:Be.token})]}):jsxRuntimeExports.jsx(Loader$3,{})},Selfie=({token:Be,config:Le,goNext:Ye,onError:tt,ageAssurance:nt,disableZoomCheck:ft,parentSize:ht})=>{useModuleEvents({module:eventModuleNames.selfie,token:Be.token,payload:{moduleVersion:"1"}});const gt=xt=>{if(xt.message==="Virtual camera is detected"){tt();return}switch(xt.type){case"timeout":case"permissionDenied":tt();break;case"skip":Ye();break;default:Ye()}},At={showPreview:Le.showPreview,assistedOnboarding:Le.assistedOnboarding,isSecondId:Le.secondId,captureAttempts:Le.captureAttempts,autoCaptureTimeout:Le.autoCaptureTimeout,isRecordingEnabled:Le.enableFaceRecording,showTutorial:Le.showTutorial,ageAssurance:nt,disableZoomCheck:ft,maskCheckEnabled:Le.validateFaceMask,lensesCheckEnabled:Le.validateLenses,hatCheckEnabled:Le.validateHeadCover,eyesClosedCheckEnabled:Le.validateClosedEyes,deepsightLiveness:Le.deepsightLiveness};return jsxRuntimeExports.jsx(CaptureFace,{onSuccess:Ye,onError:gt,session:Be,captureConfig:At,parentSize:ht})},Signature=({token:Be,config:Le,goNext:Ye})=>jsxRuntimeExports.jsx(Signature$1,{token:Be.token,onSuccess:Ye,title:Le.title,subtitle:Le.subtitle}),VideoSelfie=({token:Be,config:Le,goNext:Ye,onError:tt,wfConfig:nt})=>{const{showTutorials:ft,checkLiveness:ht,useAsSelfie:gt,compareOcrEnabled:At,compareIdEnabled:xt,checkIdScan:yt,checkDocumentScan:Ct,checkVoiceConsent:Et,voiceConsentQuestions:vt,showPassport:kt,numberOfTries:bt,compareBackOcrEnabled:wt,compareBackIdEnabled:It}=Le;return jsxRuntimeExports.jsx(Recorder,{token:Be,onSuccess:Ye,onError:tt,showTutorial:ft,modules:getVideoSelfieModules(nt,{checkIdScan:yt,checkDocumentScan:Ct,checkVoiceConsent:Et,questionsCount:vt,showPassport:kt}),speechToTextCheck:!0,onLog:()=>{},numberOfTries:bt??3,performLiveness:ht,videoSelfieAsSelfie:gt,compareOCREnabled:At,compareIDEnabled:xt,compareBackOCREnabled:wt,compareBackIDEnabled:It,questionsCount:vt,useOpenVidu:nt.useOpenVidu})},WatchList=({token:Be,goNext:Le})=>jsxRuntimeExports.jsx(GlobalWatchList,{token:Be,onSuccess:Le}),getModule=({currentNode:Be,token:Le,onNext:Ye,onError:tt,onSuccess:nt,wfConfig:ft,setState:ht,customModuleCallback:gt,authHint:At,showFinishScreen:xt})=>{if(Be){if(Be.nodeType==="FINISH")return jsxRuntimeExports.jsx(FinishScreen,{useDefaultText:!Le.endScreenTitle&&!Le.endScreenText,token:Le,workflowId:Be.workflowId,onSuccess:nt,redirectOriginOnly:ft.redirectOriginOnly,showFinishScreen:xt});switch(Be.moduleKey){case"ID_CAPTURE":return jsxRuntimeExports.jsx(IDCapture,{config:Be.moduleConfiguration,token:Le,onNext:Ye,onError:tt,mergeSessionRecordings:ft.mergeSessionRecordings,ageAssurance:ft.ageAssurance});case"ID_OCR":return jsxRuntimeExports.jsx(OcrData,{goNext:Ye,token:Le,config:Be.moduleConfiguration});case"ID":return jsxRuntimeExports.jsx(ProcessId,{goNext:Ye,token:Le,config:Be.moduleConfiguration});case"SELFIE":return jsxRuntimeExports.jsx(Selfie,{config:Be.moduleConfiguration,token:Le,goNext:async()=>{await processNode({token:Le.token}),Ye(!1)},onError:tt,ageAssurance:ft.ageAssurance,disableZoomCheck:Be.workflowId==="67dc72bfe0eef492939b43b1"});case"FACE_MATCH":return jsxRuntimeExports.jsx(FaceMatch,{token:Le,goNext:async()=>{ht("PROCESSING"),await processNode({token:Le.token}),await Ye(!1),ht("STEPS")},config:Be.moduleConfiguration});case"DOCUMENT_CAPTURE":return jsxRuntimeExports.jsx(DocumentCapture,{token:Le,goNext:Ye,config:Be.moduleConfiguration,workflowId:Be.workflowId,onError:Ye});case"SIGNATURE":return jsxRuntimeExports.jsx(Signature,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"AE_SIGNATURE":return jsxRuntimeExports.jsx(AdvancedElectronicSignature,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"QE_SIGNATURE":return jsxRuntimeExports.jsx(QualifiedElectronicSignature,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"CURP_VALIDATION":return jsxRuntimeExports.jsx(Curp,{goNext:Ye,token:Le});case"WATCHLIST":return jsxRuntimeExports.jsx(WatchList,{goNext:Ye,token:Le});case"PHONE":return jsxRuntimeExports.jsx(Phone,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"EMAIL":return jsxRuntimeExports.jsx(Email,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"DYNAMIC_FORMS":return jsxRuntimeExports.jsx(Forms,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"EKYB":return jsxRuntimeExports.jsx(Ekyb,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"EXTERNAL_VERIFICATION":return jsxRuntimeExports.jsx(Ekyc,{goNext:Ye,token:Le,config:Be.moduleConfiguration});case"COMBINED_CONSENT":return jsxRuntimeExports.jsx(CombinedConsent,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"VIDEO_ONBOARDING":return jsxRuntimeExports.jsx(VideoSelfie,{goNext:Ye,token:Le,config:Be.moduleConfiguration,onError:tt,wfConfig:ft});case"ADDRESS":return jsxRuntimeExports.jsx(Address,{token:Le,goNext:Ye,config:Be.moduleConfiguration,workflowId:Be.workflowId,onError:Ye});case"GEOLOCATION":return jsxRuntimeExports.jsx(Geolocation,{goNext:Ye,token:Le,config:Be.moduleConfiguration});case"GOVT_VALIDATION":case"GOVT_VALIDATION_PROVISIONING":return jsxRuntimeExports.jsx(GovernmentValidation,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"USER_CONSENT":return jsxRuntimeExports.jsx(PrivacyConsent,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"CUSTOM_MODULE":return jsxRuntimeExports.jsx(CustomModule,{goNext:Ye,config:Be.moduleConfiguration,token:Le,customModuleCallback:gt,nodeId:Be.id});case"AUTHENTICATION":return jsxRuntimeExports.jsx(FaceAuthentication,{goNext:Ye,config:Be.moduleConfiguration,token:Le,authHint:At});default:return jsxRuntimeExports.jsx(NotImplementedModule,{goNext:Ye})}}},NotImplementedModule=({goNext:Be})=>(React.useEffect(()=>{Be()},[Be]),null),useSession=({workflowId:Be,token:Le,wfConfig:Ye,qrUuid:tt,uuid:nt})=>{const[ft,ht]=React.useState(null),[gt,At]=React.useState(Le??null),[xt,yt]=React.useState(Ye??null),[Ct,Et]=React.useState(null),[vt,kt]=React.useState("LOADING");return React.useEffect(()=>{(async()=>{try{let wt="STEPS",It,Rt=Ye;gt||(It=await createNewSession({configurationId:Be,...tt&&{qrUuid:tt},...nt&&{uuid:nt}}),At(It)),Rt||(Rt=await getWorkflowConfig({token:(gt==null?void 0:gt.token)??(It==null?void 0:It.token)}),yt(Rt)),mobile.isDesktop()&&(wt=Rt.redirectDesktopToMobile?"REDIRECT":"STEPS"),gt!=null&>.showMandatoryConsent&&(wt="MANDATORY_CONSENT"),ht(await getNextStep((gt==null?void 0:gt.token)??(It==null?void 0:It.token))),kt(wt)}catch(wt){const It=wt;if(kt("ERROR"),It.status===4004)return Et({message:"invalidUUID"});if(It.status===4026)return Et({message:"expiredUUID"});if(It.status===4027)return Et({message:"invalidWorkflow"});if(It.status===4028)return Et({message:"WorkflowNotActive"});if(It.status===4081)return Et({message:"invalidQRuuid"});if(It.status===400){const Rt=It.message||"";return Rt.includes("Interview does not exist for id")?Et({message:"invalidSession"}):Et({message:Rt})}Et({message:"serverError"})}})()},[Be,gt,Ye]),{session:gt,error:Ct,state:vt,setState:kt,workflowConfig:xt,currentStep:ft,setCurrentStep:ht}},getNextStep=async Be=>await getCurrentNode({token:Be}),Workflow=({workflowId:Be,token:Le,onError:Ye,onSuccess:tt,wfConfig:nt,customModuleCallback:ft,authHint:ht,redirectUrl:gt,qrUuid:At,uuid:xt,showFinishScreen:yt})=>{const[Ct,Et]=React.useState(!1),{session:vt,setCurrentStep:kt,currentStep:bt,state:wt,workflowConfig:It,error:Rt,setState:Tt}=useSession({workflowId:Be,token:Le,wfConfig:nt,qrUuid:At,uuid:xt}),Bt=React.useMemo(()=>{let Pt=!1;return async(Dt=!0)=>{if(Pt)return;Pt=!0;let Ot;try{Dt?Ot=await processNode({token:vt==null?void 0:vt.token}):Ot=await getCurrentNode({token:vt==null?void 0:vt.token}),kt(Ot)}catch(Lt){Tt("ERROR"),console.error(Lt)}finally{Pt=!1}}},[vt==null?void 0:vt.token,Tt,kt]);return React.useEffect(()=>(document.body.style.overflow="hidden",document.body.scrollTop=0,document.documentElement.scrollTop=0,()=>{document.body.style.overflow="auto"}),[]),!(It!=null&&It.qrPhishingResistance)&&!bt||wt==="LOADING"||!(vt!=null&&vt.token)||!It?jsxRuntimeExports.jsx(Loader$3,{}):wt==="PROCESSING"?jsxRuntimeExports.jsx(Spinner$6,{}):wt==="ERROR"?Ye(Rt==null?void 0:Rt.message):wt==="MANDATORY_CONSENT"?jsxRuntimeExports.jsx(BiometricConsent,{token:vt,onError:()=>Tt("ERROR"),goNext:()=>Tt("STEPS"),regulationType:vt==null?void 0:vt.regulationType}):wt==="REDIRECT"&&!Ct?jsxRuntimeExports.jsx(RedirectToMobile,{allowSkipRedirect:(It==null?void 0:It.addContinueToDesktop)??!1,skipDesktopRedirect:()=>{Et(!0)},session:vt,expired:(Rt==null?void 0:Rt.message)==="expiredUUID",displayOnboardingResultOnDesktop:!1,disableSmsOption:(It==null?void 0:It.disableSmsOption)??!1,qrPhishingResistance:(It==null?void 0:It.qrPhishingResistance)??!1,url:gt}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:getModule({currentNode:bt,token:vt,onNext:Bt,onError:Ye,onSuccess:tt,wfConfig:It,setState:Tt,customModuleCallback:ft,authHint:ht,showFinishScreen:yt})})},executeWorkflow=async({element:Be,token:Le,workflowId:Ye,apiURL:tt,customModuleCallback:nt,onSuccess:ft,onError:ht,wfConfig:gt,authHint:At,qrUuid:xt,uuid:yt,redirectUrl:Ct,clientId:Et,showFinishScreen:vt})=>{const kt=createRoot$1(Be),bt=Le?`${tt}/0`:tt;setup({apiURL:bt,flowId:Ye,clientId:Et,skipInitialization:!0,options:{}});const wt=Workflow;customRender(jsxRuntimeExports.jsx(App$1,{disableUnsupportedBrowserScreen:gt==null?void 0:gt.disableUnsupportedBrowserScreen,children:jsxRuntimeExports.jsx(wt,{token:Le,workflowId:Ye,onSuccess:ft,onError:ht,wfConfig:gt,customModuleCallback:nt,authHint:At,redirectUrl:Ct,qrUuid:xt,uuid:yt,showFinishScreen:vt})}),Be,kt)};function create({apiKey:Be,apiURL:Le,lang:Ye,encrypt:tt=!1,translations:nt={},theme:ft={},clientId:ht,tokboxApiKey:gt="46135862",darkMode:At=!1,hostingApp:xt,unsafeMode:yt=!1,customHeaders:Ct,fingerprintApiKey:Et="5uYRiI0XM6p8k4124ELX",redirectFromUnsupportedBrowsers:vt=!1,useSha256:kt=!1,forceProductionMode:bt=!1,clientExperimentId:wt,version:It,skipInitialization:Rt=!1}){const Tt=setup({theme:ft,clientId:ht,lang:Ye,translations:nt,apiKey:Be,apiURL:Le,tokboxApiKey:gt,skipInitialization:Rt,options:{darkMode:At,hostingApp:xt,unsafeMode:yt,redirectFromUnsupportedBrowsers:vt,useSha256:kt},customHeaders:Ct,fingerprintApiKey:Et,forceProductionMode:bt,clientExperimentId:wt,version:It});async function Bt(){await Tt}return{createSession:createSession$3,createNewSession,updateSession,publishKeys,capture,frontType,backType,selfieType,ocrData,getScore,addToQueue:addToQueue$1,getQueueIndex,addDocument,state,processId,processFace,getInterviewerName,getOpenTokTest,addAddressStatement,processAddressStatement,processWatchlist,processGovernmentValidation,addPhone,addPhoneInstantVerify,postFingerPrint:postFingerprint,getImages:getImages$1,getConnectionDetails,fetchModules,fetchModels,update:update$1,renderCamera,renderConference,renderManualIdUpload:manualIdUpload,renderFrontTutorial,renderBackTutorial,renderSelfieTutorial,renderPassportTutorial,renderDocumentTutorial:renderTutorialDocument,encrypt:tt,sendFingerprint,getFingerPrint:getFingerprint,getDeviceFingerprintInfo,verifyOTP,generateOTP,connectToQueue,addConferenceEvent,removeFromQueue,approve,addGeolocation,warmup:detectionSetup.warmup,renderSignature,renderAdvancedElectronicSignature,addSignature,getMedicalOcrData,renderVideoSelfie,renderOTP,addEvent,getRandomQuestions,sendGeolocation,fetchProcessingStatus,theme:exports.theme,tokboxApiKey:gt,mock,setSessionStatus,renderCapture,addSpeech,fetchAssets,setTheme,sendOTPSMS,compareOTP,getFinishStatus,renderLogin,renderLoginIncodeID,renderLoginDesktop,identify,identifyInstantVerify,OneToOneIdentify:oneToOneIdentify,addCurp,addCurpv2,renderEnterCurp,addInitials,attachSignatureOnAnnotation,getSignedContractsLinks,renderRedirectToMobile,renderQr,getOnboardingStatus,addWatchListResults,initWatchList,addName,addEmail,addCustomFields,addBarcode,renderRetrySteps,isDesktop:mobile.isDesktop,addFrontSecondId,processSecondId,ocrDataSecondId,processFaceSecondId,getCustomFields,getImagesV2:getImages,renderFaceMatch,sendRedirectSMS,sendMfa,getInterviewData,lastNameMatch,lastNameMatchByCustomer,sendEmail,addCreditCardFront,addCreditCardBack,processCreditCard,i18n,compareOCR,compareID,compareBackID,compareBackOCR,getStartInfo,addMLConsent,renderMlConsent,sendEkyb,addQrCodeText,renderQrScanner,addContract,processCrossDocumentData,processAntiFraud,darkMode:At,getSecondIdImages,getSecondIdImagesV2,enableDeviceRiskModule,getDeviceRiskModuleConfiguration,collectDeviceRiskResults,addBankInfo,getBelvoWidgetToken,getWatchlist,useModuleEvents,useScreenEvents,eventModuleNames,eventScreenNames,addScreenEvent,updateSecondId:update,createRedirectUrl,compareGovValidationOTP,compareInstantVerifyOTP,getAdvancedElectronicSignatureUnsignedDocs,processAdvancedElectronicSignatureDocs,renderUniversalIdentity,renderInstantVerify,getInstantVerifyMissingModules,renderWatchList,renderEmail:renderEmail$1,renderGeolocation:renderEmail,renderPhone,instantVerifyShareIdentity,renderForms,submitAnswer,getForms,generateAESDocumentUploadUrl,getModuleConfig,instantVerifyUpdate,renderDocumentSelector,renderBiometricConsent:renderBiometricConsent$1,processImss,renderUserConsent,processGlobalWatchlist,getRedirectUrl,renderCombinedConsent:renderBiometricConsent,setUxType,getOtpStatus,getLocationSuggestions,initialize:Bt,renderFiscalQr,renderQualifiedElectronicSignature,renderCertificateIssuance,renderCaptureId,getPhone,renderCaptureFace,renderAuthFace,executeFlow,executeWorkflow}}const poaImage="data:image/svg+xml,%3csvg%20width='232'%20height='223'%20viewBox='0%200%20232%20223'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='232'%20height='223'%20rx='5'%20fill='%23E0E8EB'/%3e%3cg%20filter='url(%23filter0_d_1867_34445)'%3e%3cpath%20d='M52%2027C52%2024.7909%2053.7909%2023%2056%2023H175C177.209%2023%20179%2024.7909%20179%2027V197C179%20199.209%20177.209%20201%20175%20201H56C53.7909%20201%2052%20199.209%2052%20197V27Z'%20fill='white'/%3e%3c/g%3e%3crect%20x='60'%20y='82'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='61'%20width='61'%20height='8'%20rx='1'%20fill='%2320263D'/%3e%3crect%20x='60'%20y='96'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='89'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='101'%20width='39'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='111'%20width='39'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='129'%20width='93'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='150'%20width='93'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='143'%20width='104'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='136'%20width='100'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='157'%20width='100'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='94'%20width='39'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='106'%20width='12'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='31'%20width='12'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='160'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='160'%20y='187'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='143'%20y='187'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='92'%20y='187'%20width='36'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='187'%20width='15'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='146'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23DBB107'/%3e%3crect%20x='60'%20y='106'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='112'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='37'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='112'%20width='12'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M52.0017%2053H179V55H52L52.0017%2053Z'%20fill='%23E9E9EB'/%3e%3cdefs%3e%3cfilter%20id='filter0_d_1867_34445'%20x='43'%20y='19'%20width='145'%20height='196'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='5'/%3e%3cfeGaussianBlur%20stdDeviation='4.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.149145%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_1867_34445'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_1867_34445'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",specialCasesFlow="6374ad13eac341cb71ed30ea",ProofOfAddressContainer=dt.div`
|
|
10494
|
+
`,scoreStatus={[approvedStatuses.OK]:"Ok",[approvedStatuses.FAIL]:"Fail",[approvedStatuses.UNKNOWN]:"Unknown"},getScoreStatus=Be=>{switch(Be){case approvedStatuses.OK:case approvedStatuses.MANUAL_OK:return scoreStatus.OK;case approvedStatuses.FAIL:case approvedStatuses.MANUAL_FAIL:return scoreStatus.FAIL;default:return scoreStatus.UNKNOWN}};function RedirectedCallFinished({title:Be,subtitle:Le,displayOnboardingResultOnDesktop:Ye,token:tt}){const{score:nt,isLoading:ft}=useScore(Ye,tt),{t:ht}=useTranslation$1(),gt=getScoreStatus(nt==null?void 0:nt.overall.status);return ft&&Ye?jsxRuntimeExports.jsx(RedirectedCallFinishedContainer,{className:"IncodeRedirectCallFinishedContainer",children:jsxRuntimeExports.jsx(Spinner$5,{})}):Ye?jsxRuntimeExports.jsxs(RedirectedCallFinishedContainer,{className:"IncodeRedirectCallFinishedContainer",children:[gt!==scoreStatus.UNKNOWN&&jsxRuntimeExports.jsx(ImageWrapper,{children:jsxRuntimeExports.jsx("img",{src:gt===scoreStatus.OK?success:denied,alt:"verification"})}),jsxRuntimeExports.jsx(Subtitle,{className:"IncodeRedirectCallFinishedSubtitle",children:ht(`verificationComplete.title${gt}`)})]}):jsxRuntimeExports.jsxs(RedirectedCallFinishedContainer,{className:"IncodeRedirectCallFinishedContainer",children:[jsxRuntimeExports.jsx(Title$1,{className:"IncodeRedirectCallFinishedTitle",children:Be}),jsxRuntimeExports.jsx(Subtitle,{className:"IncodeRedirectCallFinishedSubtitle",children:Le})]})}let cachedAssets;const useAssets=({startSuccess:Be,token:Le,skipAssets:Ye})=>{const[tt,nt]=React.useState(exports.theme),[ft,ht]=React.useState(),gt=useUrlTheme();return React.useEffect(()=>{if(Ye){ht({});return}async function At(){if(!Le)return;const xt=cachedAssets||await fetchAssets({token:Le==null?void 0:Le.token}),yt=await getLogo(xt);ht({...xt,logo:yt}),cachedAssets=xt,xt.theme&&fetch(xt.theme).then(Ct=>Ct.json()).then(Ct=>{let Et=nt(Ct);gt!=null&>.isUrlTheme&&(Et=nt(gt)),nt(Et)}),xt["customCSS.css"]&&fetch(xt["customCSS.css"]).then(Ct=>Ct.text()).then(Ct=>{const Et=document.createElement("style");Et.innerHTML=Ct,document.getElementsByTagName("head")[0].appendChild(Et)})}At()},[Be,Le,gt,Ye]),{theme:tt,assets:ft}};async function getLogo(Be){const Le=Object.keys(Be).find(tt=>tt.startsWith("logo"));if(!Le)return;const Ye=Be[Le];if(Le.includes(".svg")){const tt=await fetch(Ye).then(ft=>ft.text()),nt=new Blob([tt],{type:"image/svg+xml"});return URL.createObjectURL(nt)}return Ye}const RedirectToMobile=({session:Be,disableSmsOption:Le,skipDesktopRedirect:Ye,allowSkipRedirect:tt,expired:nt,allowReEnrollment:ft,displayOnboardingResultOnDesktop:ht,qrPhishingResistance:gt,url:At,showFinishScreen:xt=!0})=>{const{t:yt}=i18n,{nextStep:Ct,currentStep:Et}=useSteps(),{assets:vt}=useAssets({startSuccess:!0,token:Be});return vt?jsxRuntimeExports.jsxs(Steps,{currentStep:Et,children:[jsxRuntimeExports.jsx(Redirect,{session:Be,onSuccess:xt?Ct:emptyFunc,showSms:!Le,skipDesktopRedirect:Ye,allowSkipRedirect:tt,allowReEnrollment:ft,expired:nt,assets:vt,qrPhishingResistance:gt,url:At}),xt&&jsxRuntimeExports.jsx(RedirectedCallFinished,{title:Be.endScreenTitle||yt("support.thanks"),subtitle:Be.endScreenText||yt("support.successFinish"),displayOnboardingResultOnDesktop:ht,token:Be.token})]}):jsxRuntimeExports.jsx(Loader$3,{})},Selfie=({token:Be,config:Le,goNext:Ye,onError:tt,ageAssurance:nt,disableZoomCheck:ft,parentSize:ht})=>{useModuleEvents({module:eventModuleNames.selfie,token:Be.token,payload:{moduleVersion:"1"}});const gt=xt=>{if(xt.message==="Virtual camera is detected"){tt();return}switch(xt.type){case"timeout":case"permissionDenied":tt();break;case"skip":Ye();break;default:Ye()}},At={showPreview:Le.showPreview,assistedOnboarding:Le.assistedOnboarding,isSecondId:Le.secondId,captureAttempts:Le.captureAttempts,autoCaptureTimeout:Le.autoCaptureTimeout,isRecordingEnabled:Le.enableFaceRecording,showTutorial:Le.showTutorial,ageAssurance:nt,disableZoomCheck:ft,maskCheckEnabled:Le.validateFaceMask,lensesCheckEnabled:Le.validateLenses,hatCheckEnabled:Le.validateHeadCover,eyesClosedCheckEnabled:Le.validateClosedEyes,deepsightLiveness:Le.deepsightLiveness};return jsxRuntimeExports.jsx(CaptureFace,{onSuccess:Ye,onError:gt,session:Be,captureConfig:At,parentSize:ht})},Signature=({token:Be,config:Le,goNext:Ye})=>jsxRuntimeExports.jsx(Signature$1,{token:Be.token,onSuccess:Ye,title:Le.title,subtitle:Le.subtitle}),VideoSelfie=({token:Be,config:Le,goNext:Ye,onError:tt,wfConfig:nt})=>{const{showTutorials:ft,checkLiveness:ht,useAsSelfie:gt,compareOcrEnabled:At,compareIdEnabled:xt,checkIdScan:yt,checkDocumentScan:Ct,checkVoiceConsent:Et,voiceConsentQuestions:vt,showPassport:kt,numberOfTries:bt,compareBackOcrEnabled:wt,compareBackIdEnabled:It}=Le;return jsxRuntimeExports.jsx(Recorder,{token:Be,onSuccess:Ye,onError:tt,showTutorial:ft,modules:getVideoSelfieModules(nt,{checkIdScan:yt,checkDocumentScan:Ct,checkVoiceConsent:Et,questionsCount:vt,showPassport:kt}),speechToTextCheck:!0,onLog:()=>{},numberOfTries:bt??3,performLiveness:ht,videoSelfieAsSelfie:gt,compareOCREnabled:At,compareIDEnabled:xt,compareBackOCREnabled:wt,compareBackIDEnabled:It,questionsCount:vt,useOpenVidu:nt.useOpenVidu})},WatchList=({token:Be,goNext:Le})=>jsxRuntimeExports.jsx(GlobalWatchList,{token:Be,onSuccess:Le}),getModule=({currentNode:Be,token:Le,onNext:Ye,onError:tt,onSuccess:nt,wfConfig:ft,setState:ht,customModuleCallback:gt,authHint:At,showFinishScreen:xt})=>{if(Be){if(Be.nodeType==="FINISH")return jsxRuntimeExports.jsx(FinishScreen,{useDefaultText:!Le.endScreenTitle&&!Le.endScreenText,token:Le,workflowId:Be.workflowId,onSuccess:nt,redirectOriginOnly:ft.redirectOriginOnly,showFinishScreen:xt});switch(Be.moduleKey){case"ID_CAPTURE":return jsxRuntimeExports.jsx(IDCapture,{config:Be.moduleConfiguration,token:Le,onNext:Ye,onError:tt,mergeSessionRecordings:ft.mergeSessionRecordings,ageAssurance:ft.ageAssurance});case"ID_OCR":return jsxRuntimeExports.jsx(OcrData,{goNext:Ye,token:Le,config:Be.moduleConfiguration});case"ID":return jsxRuntimeExports.jsx(ProcessId,{goNext:Ye,token:Le,config:Be.moduleConfiguration});case"SELFIE":return jsxRuntimeExports.jsx(Selfie,{config:Be.moduleConfiguration,token:Le,goNext:async()=>{await processNode({token:Le.token}),Ye(!1)},onError:tt,ageAssurance:ft.ageAssurance,disableZoomCheck:Be.workflowId==="67dc72bfe0eef492939b43b1"});case"FACE_MATCH":return jsxRuntimeExports.jsx(FaceMatch,{token:Le,goNext:async()=>{ht("PROCESSING"),await processNode({token:Le.token}),await Ye(!1),ht("STEPS")},config:Be.moduleConfiguration});case"DOCUMENT_CAPTURE":return jsxRuntimeExports.jsx(DocumentCapture,{token:Le,goNext:Ye,config:Be.moduleConfiguration,workflowId:Be.workflowId,onError:Ye});case"SIGNATURE":return jsxRuntimeExports.jsx(Signature,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"AE_SIGNATURE":return jsxRuntimeExports.jsx(AdvancedElectronicSignature,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"QE_SIGNATURE":return jsxRuntimeExports.jsx(QualifiedElectronicSignature,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"CURP_VALIDATION":return jsxRuntimeExports.jsx(Curp,{goNext:Ye,token:Le});case"WATCHLIST":return jsxRuntimeExports.jsx(WatchList,{goNext:Ye,token:Le});case"PHONE":return jsxRuntimeExports.jsx(Phone,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"EMAIL":return jsxRuntimeExports.jsx(Email,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"DYNAMIC_FORMS":return jsxRuntimeExports.jsx(Forms,{goNext:Ye,config:Be.moduleConfiguration,token:Le,onError:tt});case"EKYB":return jsxRuntimeExports.jsx(Ekyb,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"EXTERNAL_VERIFICATION":return jsxRuntimeExports.jsx(Ekyc,{goNext:Ye,token:Le,config:Be.moduleConfiguration});case"COMBINED_CONSENT":return jsxRuntimeExports.jsx(CombinedConsent,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"VIDEO_ONBOARDING":return jsxRuntimeExports.jsx(VideoSelfie,{goNext:Ye,token:Le,config:Be.moduleConfiguration,onError:tt,wfConfig:ft});case"ADDRESS":return jsxRuntimeExports.jsx(Address,{token:Le,goNext:Ye,config:Be.moduleConfiguration,workflowId:Be.workflowId,onError:Ye});case"GEOLOCATION":return jsxRuntimeExports.jsx(Geolocation,{goNext:Ye,token:Le,config:Be.moduleConfiguration});case"GOVT_VALIDATION":case"GOVT_VALIDATION_PROVISIONING":return jsxRuntimeExports.jsx(GovernmentValidation,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"USER_CONSENT":return jsxRuntimeExports.jsx(PrivacyConsent,{goNext:Ye,config:Be.moduleConfiguration,token:Le});case"CUSTOM_MODULE":return jsxRuntimeExports.jsx(CustomModule,{goNext:Ye,config:Be.moduleConfiguration,token:Le,customModuleCallback:gt,nodeId:Be.id});case"AUTHENTICATION":return jsxRuntimeExports.jsx(FaceAuthentication,{goNext:Ye,config:Be.moduleConfiguration,token:Le,authHint:At});default:return jsxRuntimeExports.jsx(NotImplementedModule,{goNext:Ye})}}},NotImplementedModule=({goNext:Be})=>(React.useEffect(()=>{Be()},[Be]),null),useSession=({workflowId:Be,token:Le,wfConfig:Ye,qrUuid:tt,uuid:nt})=>{const[ft,ht]=React.useState(null),[gt,At]=React.useState(Le??null),[xt,yt]=React.useState(Ye??null),[Ct,Et]=React.useState(null),[vt,kt]=React.useState("LOADING");return React.useEffect(()=>{(async()=>{try{let wt="STEPS",It,Rt=Ye;gt||(It=await createNewSession({configurationId:Be,...tt&&{qrUuid:tt},...nt&&{uuid:nt}}),At(It)),Rt||(Rt=await getWorkflowConfig({token:(gt==null?void 0:gt.token)??(It==null?void 0:It.token)}),yt(Rt)),mobile.isDesktop()&&(wt=Rt.redirectDesktopToMobile?"REDIRECT":"STEPS"),gt!=null&>.showMandatoryConsent&&(wt="MANDATORY_CONSENT"),ht(await getNextStep((gt==null?void 0:gt.token)??(It==null?void 0:It.token))),kt(wt)}catch(wt){const It=wt;if(kt("ERROR"),It.status===4004)return Et({message:"invalidUUID"});if(It.status===4026)return Et({message:"expiredUUID"});if(It.status===4027)return Et({message:"invalidWorkflow"});if(It.status===4028)return Et({message:"WorkflowNotActive"});if(It.status===4081)return Et({message:"invalidQRuuid"});if(It.status===400){const Rt=It.message||"";return Rt.includes("Interview does not exist for id")?Et({message:"invalidSession"}):Et({message:Rt})}Et({message:"serverError"})}})()},[Be,gt,Ye]),{session:gt,error:Ct,state:vt,setState:kt,workflowConfig:xt,currentStep:ft,setCurrentStep:ht}},getNextStep=async Be=>await getCurrentNode({token:Be}),Workflow=({workflowId:Be,token:Le,onError:Ye,onSuccess:tt,wfConfig:nt,customModuleCallback:ft,authHint:ht,redirectUrl:gt,qrUuid:At,uuid:xt,showFinishScreen:yt,skipDesktopRedirect:Ct=emptyFunc})=>{const[Et,vt]=React.useState(!1),{session:kt,setCurrentStep:bt,currentStep:wt,state:It,workflowConfig:Rt,error:Tt,setState:Bt}=useSession({workflowId:Be,token:Le,wfConfig:nt,qrUuid:At,uuid:xt}),Pt=React.useMemo(()=>{let Dt=!1;return async(Ot=!0)=>{if(Dt)return;Dt=!0;let Lt;try{Ot?Lt=await processNode({token:kt==null?void 0:kt.token}):Lt=await getCurrentNode({token:kt==null?void 0:kt.token}),bt(Lt)}catch(Wt){Bt("ERROR"),console.error(Wt)}finally{Dt=!1}}},[kt==null?void 0:kt.token,Bt,bt]);return React.useEffect(()=>(document.body.style.overflow="hidden",document.body.scrollTop=0,document.documentElement.scrollTop=0,()=>{document.body.style.overflow="auto"}),[]),!(Rt!=null&&Rt.qrPhishingResistance)&&!wt||It==="LOADING"||!(kt!=null&&kt.token)||!Rt?jsxRuntimeExports.jsx(Loader$3,{}):It==="PROCESSING"?jsxRuntimeExports.jsx(Spinner$6,{}):It==="ERROR"?Ye(Tt==null?void 0:Tt.message):It==="MANDATORY_CONSENT"?jsxRuntimeExports.jsx(BiometricConsent,{token:kt,onError:()=>Bt("ERROR"),goNext:()=>Bt("STEPS"),regulationType:kt==null?void 0:kt.regulationType}):It==="REDIRECT"&&!Et?jsxRuntimeExports.jsx(RedirectToMobile,{allowSkipRedirect:(Rt==null?void 0:Rt.addContinueToDesktop)??!1,skipDesktopRedirect:()=>{vt(!0),Ct()},session:kt,expired:(Tt==null?void 0:Tt.message)==="expiredUUID",displayOnboardingResultOnDesktop:!1,disableSmsOption:(Rt==null?void 0:Rt.disableSmsOption)??!1,qrPhishingResistance:(Rt==null?void 0:Rt.qrPhishingResistance)??!1,url:gt,showFinishScreen:yt}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:getModule({currentNode:wt,token:kt,onNext:Pt,onError:Ye,onSuccess:tt,wfConfig:Rt,setState:Bt,customModuleCallback:ft,authHint:ht,showFinishScreen:yt})})},executeWorkflow=async({element:Be,token:Le,workflowId:Ye,apiURL:tt,customModuleCallback:nt,onSuccess:ft,onError:ht,wfConfig:gt,authHint:At,qrUuid:xt,uuid:yt,redirectUrl:Ct,clientId:Et,showFinishScreen:vt,skipDesktopRedirect:kt})=>{const bt=createRoot$1(Be),wt=Le?`${tt}/0`:tt;setup({apiURL:wt,flowId:Ye,clientId:Et,skipInitialization:!0,options:{}});const It=Workflow;customRender(jsxRuntimeExports.jsx(App$1,{disableUnsupportedBrowserScreen:gt==null?void 0:gt.disableUnsupportedBrowserScreen,children:jsxRuntimeExports.jsx(It,{token:Le,workflowId:Ye,onSuccess:ft,onError:ht,wfConfig:gt,customModuleCallback:nt,authHint:At,redirectUrl:Ct,qrUuid:xt,uuid:yt,showFinishScreen:vt,skipDesktopRedirect:kt})}),Be,bt)};function create({apiKey:Be,apiURL:Le,lang:Ye,encrypt:tt=!1,translations:nt={},theme:ft={},clientId:ht,tokboxApiKey:gt="46135862",darkMode:At=!1,hostingApp:xt,unsafeMode:yt=!1,customHeaders:Ct,fingerprintApiKey:Et="5uYRiI0XM6p8k4124ELX",redirectFromUnsupportedBrowsers:vt=!1,useSha256:kt=!1,forceProductionMode:bt=!1,clientExperimentId:wt,version:It,skipInitialization:Rt=!1}){const Tt=setup({theme:ft,clientId:ht,lang:Ye,translations:nt,apiKey:Be,apiURL:Le,tokboxApiKey:gt,skipInitialization:Rt,options:{darkMode:At,hostingApp:xt,unsafeMode:yt,redirectFromUnsupportedBrowsers:vt,useSha256:kt},customHeaders:Ct,fingerprintApiKey:Et,forceProductionMode:bt,clientExperimentId:wt,version:It});async function Bt(){await Tt}return{createSession:createSession$3,createNewSession,updateSession,publishKeys,capture,frontType,backType,selfieType,ocrData,getScore,addToQueue:addToQueue$1,getQueueIndex,addDocument,state,processId,processFace,getInterviewerName,getOpenTokTest,addAddressStatement,processAddressStatement,processWatchlist,processGovernmentValidation,addPhone,addPhoneInstantVerify,postFingerPrint:postFingerprint,getImages:getImages$1,getConnectionDetails,fetchModules,fetchModels,update:update$1,renderCamera,renderConference,renderManualIdUpload:manualIdUpload,renderFrontTutorial,renderBackTutorial,renderSelfieTutorial,renderPassportTutorial,renderDocumentTutorial:renderTutorialDocument,encrypt:tt,sendFingerprint,getFingerPrint:getFingerprint,getDeviceFingerprintInfo,verifyOTP,generateOTP,connectToQueue,addConferenceEvent,removeFromQueue,approve,addGeolocation,warmup:detectionSetup.warmup,renderSignature,renderAdvancedElectronicSignature,addSignature,getMedicalOcrData,renderVideoSelfie,renderOTP,addEvent,getRandomQuestions,sendGeolocation,fetchProcessingStatus,theme:exports.theme,tokboxApiKey:gt,mock,setSessionStatus,renderCapture,addSpeech,fetchAssets,setTheme,sendOTPSMS,compareOTP,getFinishStatus,renderLogin,renderLoginIncodeID,renderLoginDesktop,identify,identifyInstantVerify,OneToOneIdentify:oneToOneIdentify,addCurp,addCurpv2,renderEnterCurp,addInitials,attachSignatureOnAnnotation,getSignedContractsLinks,renderRedirectToMobile,renderQr,getOnboardingStatus,addWatchListResults,initWatchList,addName,addEmail,addCustomFields,addBarcode,renderRetrySteps,isDesktop:mobile.isDesktop,addFrontSecondId,processSecondId,ocrDataSecondId,processFaceSecondId,getCustomFields,getImagesV2:getImages,renderFaceMatch,sendRedirectSMS,sendMfa,getInterviewData,lastNameMatch,lastNameMatchByCustomer,sendEmail,addCreditCardFront,addCreditCardBack,processCreditCard,i18n,compareOCR,compareID,compareBackID,compareBackOCR,getStartInfo,addMLConsent,renderMlConsent,sendEkyb,addQrCodeText,renderQrScanner,addContract,processCrossDocumentData,processAntiFraud,darkMode:At,getSecondIdImages,getSecondIdImagesV2,enableDeviceRiskModule,getDeviceRiskModuleConfiguration,collectDeviceRiskResults,addBankInfo,getBelvoWidgetToken,getWatchlist,useModuleEvents,useScreenEvents,eventModuleNames,eventScreenNames,addScreenEvent,updateSecondId:update,createRedirectUrl,compareGovValidationOTP,compareInstantVerifyOTP,getAdvancedElectronicSignatureUnsignedDocs,processAdvancedElectronicSignatureDocs,renderUniversalIdentity,renderInstantVerify,getInstantVerifyMissingModules,renderWatchList,renderEmail:renderEmail$1,renderGeolocation:renderEmail,renderPhone,instantVerifyShareIdentity,renderForms,submitAnswer,getForms,generateAESDocumentUploadUrl,getModuleConfig,instantVerifyUpdate,renderDocumentSelector,renderBiometricConsent:renderBiometricConsent$1,processImss,renderUserConsent,processGlobalWatchlist,getRedirectUrl,renderCombinedConsent:renderBiometricConsent,setUxType,getOtpStatus,getLocationSuggestions,initialize:Bt,renderFiscalQr,renderQualifiedElectronicSignature,renderCertificateIssuance,renderCaptureId,getPhone,renderCaptureFace,renderAuthFace,executeFlow,executeWorkflow,getWorkflowConfig}}const poaImage="data:image/svg+xml,%3csvg%20width='232'%20height='223'%20viewBox='0%200%20232%20223'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='232'%20height='223'%20rx='5'%20fill='%23E0E8EB'/%3e%3cg%20filter='url(%23filter0_d_1867_34445)'%3e%3cpath%20d='M52%2027C52%2024.7909%2053.7909%2023%2056%2023H175C177.209%2023%20179%2024.7909%20179%2027V197C179%20199.209%20177.209%20201%20175%20201H56C53.7909%20201%2052%20199.209%2052%20197V27Z'%20fill='white'/%3e%3c/g%3e%3crect%20x='60'%20y='82'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='61'%20width='61'%20height='8'%20rx='1'%20fill='%2320263D'/%3e%3crect%20x='60'%20y='96'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='89'%20width='31'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='101'%20width='39'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='111'%20width='39'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='129'%20width='93'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='150'%20width='93'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='143'%20width='104'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='136'%20width='100'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='157'%20width='100'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='132'%20y='94'%20width='39'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='106'%20width='12'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='31'%20width='12'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='160'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='160'%20y='187'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='143'%20y='187'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='92'%20y='187'%20width='36'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='187'%20width='15'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='146'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23DBB107'/%3e%3crect%20x='60'%20y='106'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='31'%20width='11'%20height='5'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='112'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='60'%20y='37'%20width='11'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3crect%20x='75'%20y='112'%20width='12'%20height='4'%20rx='1'%20fill='%23E9E9EB'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M52.0017%2053H179V55H52L52.0017%2053Z'%20fill='%23E9E9EB'/%3e%3cdefs%3e%3cfilter%20id='filter0_d_1867_34445'%20x='43'%20y='19'%20width='145'%20height='196'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='5'/%3e%3cfeGaussianBlur%20stdDeviation='4.5'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.149145%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_1867_34445'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_1867_34445'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",specialCasesFlow="6374ad13eac341cb71ed30ea",ProofOfAddressContainer=dt.div`
|
|
10495
10495
|
display: flex;
|
|
10496
10496
|
flex-direction: column;
|
|
10497
10497
|
align-items: center;
|