@incodetech/welcome 1.76.0-rc.20241030222225 → 1.76.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/onBoarding.mjs +10 -5
- package/dist/onBoarding.umd.js +10 -5
- package/package.json +2 -4
package/dist/onBoarding.mjs
CHANGED
|
@@ -4651,7 +4651,7 @@ class OnboardingAnalytics {
|
|
|
4651
4651
|
}
|
|
4652
4652
|
}
|
|
4653
4653
|
const OnboardingAnalytics$1 = OnboardingAnalytics.getInstance();
|
|
4654
|
-
var define_import_meta_env_default = { BASE_URL: "/", DEV: !1, MODE: "production", PACKAGE_VERSION: "1.76.0
|
|
4654
|
+
var define_import_meta_env_default = { BASE_URL: "/", DEV: !1, MODE: "production", PACKAGE_VERSION: "1.76.0", PROD: !0, SSR: !1 };
|
|
4655
4655
|
class DetectionSetup {
|
|
4656
4656
|
constructor() {
|
|
4657
4657
|
this.setupDetectPromise = null, this.isSetupDetect = !1, this.pipelinesBundle = null, this.profiles = null;
|
|
@@ -18306,6 +18306,9 @@ const initialState = {
|
|
|
18306
18306
|
}, Container$f = qe$1.div`
|
|
18307
18307
|
width: 100%;
|
|
18308
18308
|
height: 100%;
|
|
18309
|
+
&.IncodeTutorialContainerFront {
|
|
18310
|
+
height: 100vh;
|
|
18311
|
+
}
|
|
18309
18312
|
`, RootContainer = ({
|
|
18310
18313
|
cssSelector: oa,
|
|
18311
18314
|
children: aa
|
|
@@ -57968,7 +57971,7 @@ const ChooseCameraContainer = qe$1.div`
|
|
|
57968
57971
|
}
|
|
57969
57972
|
)
|
|
57970
57973
|
] });
|
|
57971
|
-
}, version$1 = "1.76.0
|
|
57974
|
+
}, version$1 = "1.76.0";
|
|
57972
57975
|
function r$1(oa) {
|
|
57973
57976
|
for (var aa = "", ba = 0; ba < oa.length; ++ba) if (ba > 0) {
|
|
57974
57977
|
var Ea = oa[ba].toLowerCase();
|
|
@@ -106686,13 +106689,14 @@ const StyledButton$4 = qe$1(Button$a)`
|
|
|
106686
106689
|
justify-content: center;
|
|
106687
106690
|
height: 100%;
|
|
106688
106691
|
|
|
106689
|
-
video
|
|
106692
|
+
video,
|
|
106693
|
+
img {
|
|
106690
106694
|
display: flex;
|
|
106691
|
-
height: calc(100vh * 0.5);
|
|
106695
|
+
height: calc(100vh * 0.5) !important;
|
|
106692
106696
|
}
|
|
106693
106697
|
`, TutorialContainer$1 = qe$1.div`
|
|
106694
106698
|
padding: 0 10px;
|
|
106695
|
-
height:
|
|
106699
|
+
height: 100dvh;
|
|
106696
106700
|
width: 100%;
|
|
106697
106701
|
display: flex;
|
|
106698
106702
|
flex-direction: column;
|
|
@@ -106837,6 +106841,7 @@ const SourceContainer = qe$1.div`
|
|
|
106837
106841
|
|
|
106838
106842
|
img {
|
|
106839
106843
|
width: 73px !important;
|
|
106844
|
+
height: unset !important;
|
|
106840
106845
|
}
|
|
106841
106846
|
`, AgeStep = qe$1.div`
|
|
106842
106847
|
display: flex;
|
package/dist/onBoarding.umd.js
CHANGED
|
@@ -77,7 +77,7 @@ See https://s-c.sh/2BAXzed for more info.`),window["__styled-components-init__"]
|
|
|
77
77
|
justify-content: center;
|
|
78
78
|
align-items: center;
|
|
79
79
|
flex-direction: column;
|
|
80
|
-
`,typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let oa,aa;return{promise:new Promise((Ea,Sa)=>{oa=Ea,aa=Sa}),resolve:oa,reject:aa}});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,E164_PHONE_NUMBER:/^\+?[1-9]\d{7,14}$/,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};exports.api=void 0;function setApi(oa){exports.api=oa}const deviceStatsQueue=[];let isReady=!1;function addDeviceStats(oa,aa){if(!isReady){deviceStatsQueue.push(aa);return}return exports.api.post("/omni/device/stats",aa,{headers:{"X-Incode-Hardware-Id":oa}}).catch(()=>{})}function emptyDeviceStatsQueue(oa){isReady=!0,deviceStatsQueue.forEach(aa=>{addDeviceStats(oa,aa)})}const eventsQueue=[];function addEvent(oa){const{token:aa,code:ba,module:Ea,screen:Sa,clientTimestamp:Ta,payload:Aa={}}=oa;if(!aa){eventsQueue.push(oa);return}return exports.api.post("/omni/interview-events",[{code:ba,module:Ea,screen:Sa,clientTimestamp:Ta??new Date().getTime(),payload:Aa}],{headers:{"X-Incode-Hardware-Id":aa}}).catch(()=>{})}function emptyQueue(oa){eventsQueue.forEach(aa=>{addEvent({...aa,token:oa})})}const state$1={token:null};let options={darkMode:!1,hostingApp:"Web SDK",unsafeMode:!1,redirectFromUnsupportedBrowsers:!1,recorderProvider:"openVidu"};const setOptions=oa=>(options={...options,...oa},options);var PipelineProfileName=(oa=>(oa[oa.IdCapture_2_01=0]="IdCapture_2_01",oa[oa.IdVideoSelfie_2_01=1]="IdVideoSelfie_2_01",oa[oa.SelfieWithAggregationMetrics=2]="SelfieWithAggregationMetrics",oa[oa.SelfieWithQualityMetrics=3]="SelfieWithQualityMetrics",oa))(PipelineProfileName||{});class PipelineProfile{constructor(aa,ba,Ea,Sa,Ta,Aa=null,xa=""){this.pipelineType=aa,this.name=ba,this.detectionType=Ea,this.modelNames=Sa,this.parameters=Ta,this.paramsConfigurator=Aa,this.description=xa}reconfigureParams(aa=null){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,aa)}}var DetectionType=(oa=>(oa[oa.IDCapture=0]="IDCapture",oa[oa.Selfie=1]="Selfie",oa[oa.IdVideoSelfie=2]="IdVideoSelfie",oa))(DetectionType||{}),WasmPipelineType=(oa=>(oa[oa.IdCapturePipeline=0]="IdCapturePipeline",oa[oa.IdVideoSelfiePipeline=1]="IdVideoSelfiePipeline",oa[oa.SelfieWithAggregationMetrics=2]="SelfieWithAggregationMetrics",oa[oa.SelfieWithQualityMetrics=3]="SelfieWithQualityMetrics",oa[oa.IdFaceDetectionPipeline=4]="IdFaceDetectionPipeline",oa))(WasmPipelineType||{});function IdCaptureParamsConfigurator(oa,aa,ba){Object.assign(oa,{areaDown:ba?55e3:25e3,areaUp:ba?75e3:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:aa==WasmPipelineType.IdCapturePipeline?125:180,widthIOSDown:aa==WasmPipelineType.IdCapturePipeline?85:150,widthDown:ba?185:135,widthUp:ba?255:205})}const SelfieFaceDetectionPipelineParams={frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.95,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.5,minFaceQualityScore:.65},pipelineProfiles=[new PipelineProfile(WasmPipelineType.IdCapturePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sharpnessThreshold:.2,sharpnessChangeThreshold:.2},IdCaptureParamsConfigurator,"Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.9,sharpnessThreshold:.2,sharpnessChangeThreshold:.2},IdCaptureParamsConfigurator,"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","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with quality metrics")];function getProfile(oa){const aa=pipelineProfiles.find(ba=>ba.name===oa);if(!aa)throw new Error(`Profile not found for type: ${oa}`);return aa}const probabilityThreshold=.9,wasmVersion="v1.9.4",pipelineBundles=new Map([["selfieAggregationMetrics",[PipelineProfileName.IdCapture_2_01,PipelineProfileName.IdVideoSelfie_2_01,PipelineProfileName.SelfieWithAggregationMetrics]],["selfieQualityMetrics",[PipelineProfileName.IdCapture_2_01,PipelineProfileName.IdVideoSelfie_2_01,PipelineProfileName.SelfieWithQualityMetrics]]]);function switchBundle(){return Math.random()<probabilityThreshold?"selfieAggregationMetrics":"selfieQualityMetrics"}function getInitializationParams(oa){const ba=oa?switchBundle():"selfieAggregationMetrics",Ea="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",Sa=`${Ea}/${wasmVersion}/webLib.wasm`,Ta=`${Ea}/${wasmVersion}/webLibSimd.wasm`,Aa=`${Ea}/${wasmVersion}/webLib.js`,xa=`${Ea}/${wasmVersion}/versions.json`;let wa=new Map,ka=new Map;for(const La of pipelineBundles.get(ba)){const tl=getProfile(La);if(!tl)throw new Error(`Profile not found: ${La}`);const el=tl.modelNames;let nl=[];for(const il of el)nl.push(`${Ea}/${wasmVersion}/models/${il}`);wa.set(tl.pipelineType,nl),ka.set(tl.detectionType,tl)}return{wasmModulePath:Sa,wasmSimdModulePath:Ta,glueCodePath:Aa,versionsFilePath:xa,pipelineModels:wa,enableSIMD:!0,bundle:ba,profiles:ka,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.wasmApiHelpers=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.Module=null,this.loadModule=async aa=>{this.Module=(await import(aa)).Module}}async initialize(aa,ba,Ea,Sa,Ta,Aa){await this.freeResources(),this.pipelines_=Aa,this.versionsFile=Ta,await this.loadModule(Ea);const xa=await this.loadWasm(Sa,aa,ba);return this.wasmApiHelpers=new this.wasmModule.MlWasmApiHelpers,this.idCaptureWasmApi=new this.wasmModule.IdCaptureWasmApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionWasmApi,this.isInitialized_=!0,xa}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.wasmApiHelpers!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(aa,ba){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(aa&&ba&&aa==this.imageWidth_&&ba==this.imageHeight_&&this.inputImageBuffer&&aa*ba*4===this.inputImageBuffer.length)&&(this.imageWidth_=aa,this.imageHeight_=ba,this.inputImageBuffer=this.wasmApiHelpers.allocateInputImageBuffer(aa,ba,4))}async handleDetectionCallAndUpdateState(aa){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.handleDetectionCallAndUpdateState(this.toWasmEnum(aa))}async encryptImage(aa){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.wasmApiHelpers.encryptImage(aa)}isVirtualCamera(aa){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),aa)return this.wasmApiHelpers.isVirtualCamera(aa)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.wasmApiHelpers.estimatePerformance()}async analyzeFrame(aa){return this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(aa.width,aa.height),this.inputImageBuffer.set(aa.data),this.wasmApiHelpers.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.wasmApiHelpers&&typeof this.wasmApiHelpers.delete=="function"&&(this.wasmApiHelpers.delete(),this.wasmApiHelpers=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(aa){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.wasmApiHelpers.resetPipeline(this.toWasmEnum(aa))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[aa,ba]of this.pipelines_)this.resetPipeline(aa)}async process(aa,ba){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(aa.data),ba){case WasmPipelineType.IdCapturePipeline:return this.idCaptureWasmApi.runIdCapturePipeline();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.toWasmEnum(ba));default:throw new Error("Unknown pipeline type")}}async runIdCapture(aa){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(aa.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(aa){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(aa.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(aa,ba,Ea,Sa,Ta){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.toWasmEnum(aa),ba,Ea,Sa,Ta)}async setFaceDetectionThresholds(aa,ba,Ea,Sa,Ta,Aa,xa){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa)}async setFaceAttributesThresholds(aa,ba,Ea,Sa,Ta){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.toWasmEnum(aa),ba,Ea,Sa,Ta)}async setFaceAttributesEnabled(aa,ba,Ea,Sa,Ta){this.checkWasmInitialization("Unable to set face attributes enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesEnabled(this.toWasmEnum(aa),ba,Ea,Sa,Ta)}async setFaceDetectionMode(aa,ba){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.toWasmEnum(aa),ba)}async setFaceDetectionCallbacks(aa,ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el,nl,il,sl,al,rl){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el,nl,il,sl,al,rl)}async setIdCaptureThresholds(aa,ba,Ea,Sa,Ta,Aa,xa){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa)}async setIdCaptureCallbacks(aa,ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl)}async setIdCaptureGeometryParams(aa,ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el,nl){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el,nl)}async setIdCaptureConfigParams(aa,ba,Ea,Sa,Ta,Aa){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa)}async getVersions(){const ba=await(await fetch(this.versionsFile)).text();return JSON.parse(ba)}async loadWasm(aa,ba,Ea){const Sa=aa?Ea:ba;try{window.wasmArrayBuffer=await fetch(Sa).then(Ta=>Ta.arrayBuffer()).then(Ta=>new Uint8Array(Ta)),this.wasmModule=await this.Module()}catch(Ta){if(console.log(Ta,aa,"useSmd"),aa)return await this.loadWasm(!1,ba,Ea);throw Ta}return aa}async loadModels(){var Sa;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let aa=new this.wasmModule.PipelineTypeToIntMap,ba=new Map,Ea=new Map;for(let[Ta,Aa]of this.pipelines_){let xa=this.toWasmEnum(Ta),wa=[],ka=new this.wasmModule.VectorInt;for(let La of Aa){if(!Ea.has(La)){let el=await fetch(La).then(nl=>nl.arrayBuffer()).then(nl=>new Uint8Array(nl));Ea.set(La,el)}let tl=Ea.get(La);ka.push_back(tl.byteLength),wa.push(tl)}aa.set(xa,ka),ba.set(xa,wa)}this.modelsBuffers=this.wasmApiHelpers.allocateModelsBuffers(aa);for(let[Ta,Aa]of ba){let xa=(Sa=this.modelsBuffers)==null?void 0:Sa.get(Ta);for(let wa=0;wa<xa.size();wa++){let ka=xa==null?void 0:xa.get(wa);if(ka)ka.set(Aa[wa]);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.wasmApiHelpers.initializePipelines()}async setProductionMode(aa){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.wasmApiHelpers.setProductionMode(aa)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.fromWasmEnum(this.wasmApiHelpers.getCurrentPipeline())}toWasmEnum(aa){switch(aa){case WasmPipelineType.IdCapturePipeline:return this.wasmModule.PipelineType.IdCapturePipeline;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")}}fromWasmEnum(aa){switch(aa){case this.wasmModule.PipelineType.IdCapturePipeline:return WasmPipelineType.IdCapturePipeline;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")}}checkWasmInitialization(aa){if(!this.isInitialized())throw new Error(aa)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance();class MotionStatusCheck{constructor(aa,ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=3,this.maxFrequency_=60,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.waitForClick=()=>new Promise(nl=>{document.addEventListener("click",async()=>{const il=await this.requestMotionPermission();nl(il)},{once:!0})}),this.deviceMotionListener=nl=>{if(nl.accelerationIncludingGravity){const il={x:nl.accelerationIncludingGravity.x,y:nl.accelerationIncludingGravity.y,z:nl.accelerationIncludingGravity.z};this.checkFields(il)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,il))}if(nl.acceleration){const il={x:nl.acceleration.x,y:nl.acceleration.y,z:nl.acceleration.z};this.checkFields(il)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,il))}if(nl.rotationRate){const il={x:nl.rotationRate.alpha,y:nl.rotationRate.beta,z:nl.rotationRate.gamma};this.checkFields(il)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,il))}},this.deviceOrientationListener=nl=>{const il={x:nl.alpha,y:nl.beta,z:nl.gamma};this.checkFields(il)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,il))},this.accThreshold_=aa,this.gyroThreshold_=ba,this.accGrOldThreshold_=Ea,this.accOldThreshold_=Sa,this.gyroscopeOldThreshold_=Ta,this.orientationOldThreshold_=Aa,this.maeAccThreshold_=xa,this.maeGyroThreshold_=wa,this.maeAccGrOldThreshold_=ka,this.maeAccOldThreshold_=La,this.maeGyroscopeOldThreshold_=tl,this.maeOrientationOldThreshold_=el}async requestMotionPermission(){DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"&&DeviceMotionEvent.requestPermission().then(aa=>{aa!=="granted"&&(this.permission_=!1)}).catch(console.error)}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!(!this.isRunning_||!this.acl_)&&(this.paramsAcc_.ptsNum+=1,this.acl_)){const aa={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(aa)&&this.updateParams(this.paramsAcc_,aa)}}updateGyro(){if(!(!this.isRunning_||!this.gyro_)&&(this.paramsGyro_.ptsNum+=1,this.gyro_)){const aa={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(aa)&&this.updateParams(this.paramsGyro_,aa)}}check(){if(!this.permission_)return"UNCLEAR";const aa=this.checkStability();return aa===null?"UNCLEAR":aa?"FAIL":"PASS"}checkStability(){if(!this.isRunning_)return null;const ba=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(xa=>xa!==null),Ea=ba.length>0?ba.every(xa=>xa):null,Ta=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(xa=>xa!==null),Aa=Ta.length>0?Ta.every(xa=>xa):null;return Ea===null?Aa===null?null:Aa:Aa!==null?Ea&&Aa:Ea}updateParams(aa,ba){const Ea=ba.x-aa.meanX,Sa=ba.y-aa.meanY,Ta=ba.z-aa.meanZ;aa.meanX+=Ea/aa.ptsNum,aa.meanY+=Sa/aa.ptsNum,aa.meanZ+=Ta/aa.ptsNum,aa.m2X+=Ea*(ba.x-aa.meanX),aa.m2Y+=Sa*(ba.y-aa.meanY),aa.m2Z+=Ta*(ba.z-aa.meanZ),aa.cumulativeAbsErrorX+=Math.abs(ba.x-aa.meanX),aa.cumulativeAbsErrorY+=Math.abs(ba.y-aa.meanY),aa.cumulativeAbsErrorZ+=Math.abs(ba.z-aa.meanZ)}calculateStd(aa){const ba={x:aa.m2X/aa.ptsNum,y:aa.m2Y/aa.ptsNum,z:aa.m2Z/aa.ptsNum};return{x:Math.sqrt(ba.x),y:Math.sqrt(ba.y),z:Math.sqrt(ba.z)}}calculateMae(aa){return{x:aa.cumulativeAbsErrorX/aa.ptsNum,y:aa.cumulativeAbsErrorY/aa.ptsNum,z:aa.cumulativeAbsErrorZ/aa.ptsNum}}checkFields(aa){return aa.x!==null&&aa.y!==null&&aa.z!==null}isBelowStdThreshold(aa,ba){if(aa.ptsNum<this.minNumberOfFrames_)return null;const Ea=this.calculateStd(aa);return Ea.x<ba&&Ea.y<ba&&Ea.z<ba}isBelowMaeThreshold(aa,ba){if(aa.ptsNum<this.minNumberOfFrames_)return null;const Ea=this.calculateMae(aa);return Ea.x<ba&&Ea.y<ba&&Ea.z<ba}}class OnboardingAnalytics{constructor(){this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.pipelinesBundle=null,this.simdIsEnabled=null,this.wasmVersion=null,this.isVirtualCameraDetectedByLabel=!1,this.motionStatusCheck=new MotionStatusCheck(.3,.3,.3,.3,10,10,.3,.3,.3,.3,10,10)}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setPipelinesBundle(aa){this.pipelinesBundle=aa}setSimdIsEnabled(aa){this.simdIsEnabled=aa}setWasmVersion(aa){this.wasmVersion=aa}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getAnalysisStatus(){return this.analysisStatus}async analyzeFrame(aa){const ba=await base64ToImageData(aa);await MlWasmJSApi$1.analyzeFrame(ba),this.updatePipelineStats()}async checkForVirtualCameraByLabel(aa=null){try{if(!MlWasmJSApi$1.isInitialized())return null;if(!aa){const Ea=await getDeviceCapabilities();for(const Sa of Object.keys(Ea)){const Ta=Ea[Sa];if(MlWasmJSApi$1.isVirtualCamera(Ta==null?void 0:Ta.label)){const Aa={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Aa}}}const ba=getChosenCameraInfo(aa);if(MlWasmJSApi$1.isVirtualCamera(ba==null?void 0:ba.label)){const Ea={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Ea}return{isDetected:!1,hasPriorDetection:this.isVirtualCameraDetectedByLabel}}catch(ba){console.log(`Exception: ${ba}`)}return null}async startOnboardingCheck(){this.motionStatusCheck.start()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}updatePipelineStats(){if(MlWasmJSApi$1.isInitialized())try{const aa=MlWasmJSApi$1.getPipelineState();if(aa!==""){const ba=JSON.parse(aa);this.analysisStatus=ba.statsAnalysisStatus,ba.pipelinesBundle=this.pipelinesBundle?this.pipelinesBundle:"unknown",ba.estimatedPerformance=this.estimatedPerformance,ba.simdIsEnabled=this.simdIsEnabled,ba.wasmVersion=this.wasmVersion,this.pipelineLogs=ba,this.motionStatus===""&&(this.motionStatus=this.motionStatusCheck.check())}}catch(aa){console.error(`Exception: ${aa}`)}}}const OnboardingAnalytics$1=OnboardingAnalytics.getInstance();var define_import_meta_env_default={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"1.76.0-rc.20241030222225",PROD:!0,SSR:!1};class DetectionSetup{constructor(){this.setupDetectPromise=null,this.isSetupDetect=!1,this.pipelinesBundle=null,this.profiles=null}static getInstance(){return DetectionSetup.instance||(DetectionSetup.instance=new DetectionSetup),DetectionSetup.instance}setIsIPhone14OrHigher(){if(!mobile.iOS())return;if(new URLSearchParams(window.location.search).get("smallFrame")==="true"){localStorage.setItem("isIPhone14OrHigher","true");return}localStorage.setItem("isIPhone14OrHigher",String(window.outerHeight===852&&window.outerWidth===393||window.outerHeight===932&&window.outerWidth===430||window.innerHeight===631&&window.innerWidth===375))}async setupDetect(){return this.setupDetectPromise?this.setupDetectPromise:(this.setupDetectPromise=this._runSetupDetect(),this.setupDetectPromise)}getPipelinesBundle(){return this.pipelinesBundle}getProfile(aa){var ba;return((ba=this.profiles)==null?void 0:ba.get(aa))??null}async warmup(){for(;!MlWasmJSApi$1.isInitialized();)await new Promise(aa=>setTimeout(aa,100))}async _runSetupDetect(){var Ta,Aa,xa;if(this.isSetupDetect)return;addEvent({token:(Ta=state$1.token)==null?void 0:Ta.token,code:"modelLoadStart"}),this.setIsIPhone14OrHigher();const aa=getInitializationParams(options.hostingApp==="Incode ID");this.pipelinesBundle=aa.bundle,this.profiles=aa.profiles,OnboardingAnalytics$1.setPipelinesBundle(this.pipelinesBundle),OnboardingAnalytics$1.startOnboardingCheck();const ba=await MlWasmJSApi$1.initialize(aa.wasmModulePath,aa.wasmSimdModulePath,aa.glueCodePath,aa.enableSIMD,aa.versionsFilePath,aa.pipelineModels);for(;!MlWasmJSApi$1.isInitialized();)await new Promise(wa=>setTimeout(wa,100));OnboardingAnalytics$1.estimatePerformance(),OnboardingAnalytics$1.setWasmVersion(aa.wasmVersion),OnboardingAnalytics$1.setSimdIsEnabled(ba);const Ea=await OnboardingAnalytics$1.checkForVirtualCameraByLabel();Ea!=null&&Ea.isDetected&&!Ea.hasPriorDetection&&addDeviceStats((Aa=state$1.token)==null?void 0:Aa.token,{cameraLabelInspectionStatus:"FAIL"}),await MlWasmJSApi$1.initializePipelines();const Sa=define_import_meta_env_default.VITE_WASM_PRODUCTION_MODE==="true";try{await MlWasmJSApi$1.setProductionMode(Sa)}catch(wa){console.error(`Exception: ${wa}`)}this.isSetupDetect=!0,addEvent({token:(xa=state$1.token)==null?void 0:xa.token,code:"modelLoadEnd",payload:{loadSuccessful:!0}})}}const detectionSetup=DetectionSetup.getInstance();function _typeof$a(oa){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(aa){return typeof aa}:function(aa){return aa&&typeof Symbol=="function"&&aa.constructor===Symbol&&aa!==Symbol.prototype?"symbol":typeof aa},_typeof$a(oa)}function _classCallCheck$m(oa,aa){if(!(oa instanceof aa))throw new TypeError("Cannot call a class as a function")}function toPrimitive(oa,aa){if(_typeof$a(oa)!="object"||!oa)return oa;var ba=oa[Symbol.toPrimitive];if(ba!==void 0){var Ea=ba.call(oa,aa||"default");if(_typeof$a(Ea)!="object")return Ea;throw new TypeError("@@toPrimitive must return a primitive value.")}return(aa==="string"?String:Number)(oa)}function toPropertyKey(oa){var aa=toPrimitive(oa,"string");return _typeof$a(aa)=="symbol"?aa:String(aa)}function _defineProperties$9(oa,aa){for(var ba=0;ba<aa.length;ba++){var Ea=aa[ba];Ea.enumerable=Ea.enumerable||!1,Ea.configurable=!0,"value"in Ea&&(Ea.writable=!0),Object.defineProperty(oa,toPropertyKey(Ea.key),Ea)}}function _createClass$l(oa,aa,ba){return aa&&_defineProperties$9(oa.prototype,aa),ba&&_defineProperties$9(oa,ba),Object.defineProperty(oa,"prototype",{writable:!1}),oa}function _assertThisInitialized$1(oa){if(oa===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oa}function _setPrototypeOf$1(oa,aa){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ea,Sa){return Ea.__proto__=Sa,Ea},_setPrototypeOf$1(oa,aa)}function _inherits$c(oa,aa){if(typeof aa!="function"&&aa!==null)throw new TypeError("Super expression must either be null or a function");oa.prototype=Object.create(aa&&aa.prototype,{constructor:{value:oa,writable:!0,configurable:!0}}),Object.defineProperty(oa,"prototype",{writable:!1}),aa&&_setPrototypeOf$1(oa,aa)}function _possibleConstructorReturn$c(oa,aa){if(aa&&(_typeof$a(aa)==="object"||typeof aa=="function"))return aa;if(aa!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(oa)}function _getPrototypeOf$1(oa){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(ba){return ba.__proto__||Object.getPrototypeOf(ba)},_getPrototypeOf$1(oa)}function _defineProperty$6(oa,aa,ba){return aa=toPropertyKey(aa),aa in oa?Object.defineProperty(oa,aa,{value:ba,enumerable:!0,configurable:!0,writable:!0}):oa[aa]=ba,oa}function _arrayWithHoles$3(oa){if(Array.isArray(oa))return oa}function _iterableToArray(oa){if(typeof Symbol<"u"&&oa[Symbol.iterator]!=null||oa["@@iterator"]!=null)return Array.from(oa)}function _arrayLikeToArray$b(oa,aa){(aa==null||aa>oa.length)&&(aa=oa.length);for(var ba=0,Ea=new Array(aa);ba<aa;ba++)Ea[ba]=oa[ba];return Ea}function _unsupportedIterableToArray$b(oa,aa){if(oa){if(typeof oa=="string")return _arrayLikeToArray$b(oa,aa);var ba=Object.prototype.toString.call(oa).slice(8,-1);if(ba==="Object"&&oa.constructor&&(ba=oa.constructor.name),ba==="Map"||ba==="Set")return Array.from(oa);if(ba==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ba))return _arrayLikeToArray$b(oa,aa)}}function _nonIterableRest$3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
80
|
+
`,typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let oa,aa;return{promise:new Promise((Ea,Sa)=>{oa=Ea,aa=Sa}),resolve:oa,reject:aa}});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,E164_PHONE_NUMBER:/^\+?[1-9]\d{7,14}$/,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};exports.api=void 0;function setApi(oa){exports.api=oa}const deviceStatsQueue=[];let isReady=!1;function addDeviceStats(oa,aa){if(!isReady){deviceStatsQueue.push(aa);return}return exports.api.post("/omni/device/stats",aa,{headers:{"X-Incode-Hardware-Id":oa}}).catch(()=>{})}function emptyDeviceStatsQueue(oa){isReady=!0,deviceStatsQueue.forEach(aa=>{addDeviceStats(oa,aa)})}const eventsQueue=[];function addEvent(oa){const{token:aa,code:ba,module:Ea,screen:Sa,clientTimestamp:Ta,payload:Aa={}}=oa;if(!aa){eventsQueue.push(oa);return}return exports.api.post("/omni/interview-events",[{code:ba,module:Ea,screen:Sa,clientTimestamp:Ta??new Date().getTime(),payload:Aa}],{headers:{"X-Incode-Hardware-Id":aa}}).catch(()=>{})}function emptyQueue(oa){eventsQueue.forEach(aa=>{addEvent({...aa,token:oa})})}const state$1={token:null};let options={darkMode:!1,hostingApp:"Web SDK",unsafeMode:!1,redirectFromUnsupportedBrowsers:!1,recorderProvider:"openVidu"};const setOptions=oa=>(options={...options,...oa},options);var PipelineProfileName=(oa=>(oa[oa.IdCapture_2_01=0]="IdCapture_2_01",oa[oa.IdVideoSelfie_2_01=1]="IdVideoSelfie_2_01",oa[oa.SelfieWithAggregationMetrics=2]="SelfieWithAggregationMetrics",oa[oa.SelfieWithQualityMetrics=3]="SelfieWithQualityMetrics",oa))(PipelineProfileName||{});class PipelineProfile{constructor(aa,ba,Ea,Sa,Ta,Aa=null,xa=""){this.pipelineType=aa,this.name=ba,this.detectionType=Ea,this.modelNames=Sa,this.parameters=Ta,this.paramsConfigurator=Aa,this.description=xa}reconfigureParams(aa=null){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,aa)}}var DetectionType=(oa=>(oa[oa.IDCapture=0]="IDCapture",oa[oa.Selfie=1]="Selfie",oa[oa.IdVideoSelfie=2]="IdVideoSelfie",oa))(DetectionType||{}),WasmPipelineType=(oa=>(oa[oa.IdCapturePipeline=0]="IdCapturePipeline",oa[oa.IdVideoSelfiePipeline=1]="IdVideoSelfiePipeline",oa[oa.SelfieWithAggregationMetrics=2]="SelfieWithAggregationMetrics",oa[oa.SelfieWithQualityMetrics=3]="SelfieWithQualityMetrics",oa[oa.IdFaceDetectionPipeline=4]="IdFaceDetectionPipeline",oa))(WasmPipelineType||{});function IdCaptureParamsConfigurator(oa,aa,ba){Object.assign(oa,{areaDown:ba?55e3:25e3,areaUp:ba?75e3:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:aa==WasmPipelineType.IdCapturePipeline?125:180,widthIOSDown:aa==WasmPipelineType.IdCapturePipeline?85:150,widthDown:ba?185:135,widthUp:ba?255:205})}const SelfieFaceDetectionPipelineParams={frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.95,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.5,minFaceQualityScore:.65},pipelineProfiles=[new PipelineProfile(WasmPipelineType.IdCapturePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sharpnessThreshold:.2,sharpnessChangeThreshold:.2},IdCaptureParamsConfigurator,"Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.9,sharpnessThreshold:.2,sharpnessChangeThreshold:.2},IdCaptureParamsConfigurator,"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","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","bf_attrib_31b8f9d92fb345c2b4bbdd222792562c_0_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2"],SelfieFaceDetectionPipelineParams,null,"Selfie face detection profile with quality metrics")];function getProfile(oa){const aa=pipelineProfiles.find(ba=>ba.name===oa);if(!aa)throw new Error(`Profile not found for type: ${oa}`);return aa}const probabilityThreshold=.9,wasmVersion="v1.9.4",pipelineBundles=new Map([["selfieAggregationMetrics",[PipelineProfileName.IdCapture_2_01,PipelineProfileName.IdVideoSelfie_2_01,PipelineProfileName.SelfieWithAggregationMetrics]],["selfieQualityMetrics",[PipelineProfileName.IdCapture_2_01,PipelineProfileName.IdVideoSelfie_2_01,PipelineProfileName.SelfieWithQualityMetrics]]]);function switchBundle(){return Math.random()<probabilityThreshold?"selfieAggregationMetrics":"selfieQualityMetrics"}function getInitializationParams(oa){const ba=oa?switchBundle():"selfieAggregationMetrics",Ea="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",Sa=`${Ea}/${wasmVersion}/webLib.wasm`,Ta=`${Ea}/${wasmVersion}/webLibSimd.wasm`,Aa=`${Ea}/${wasmVersion}/webLib.js`,xa=`${Ea}/${wasmVersion}/versions.json`;let wa=new Map,ka=new Map;for(const La of pipelineBundles.get(ba)){const tl=getProfile(La);if(!tl)throw new Error(`Profile not found: ${La}`);const el=tl.modelNames;let nl=[];for(const il of el)nl.push(`${Ea}/${wasmVersion}/models/${il}`);wa.set(tl.pipelineType,nl),ka.set(tl.detectionType,tl)}return{wasmModulePath:Sa,wasmSimdModulePath:Ta,glueCodePath:Aa,versionsFilePath:xa,pipelineModels:wa,enableSIMD:!0,bundle:ba,profiles:ka,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.wasmApiHelpers=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.Module=null,this.loadModule=async aa=>{this.Module=(await import(aa)).Module}}async initialize(aa,ba,Ea,Sa,Ta,Aa){await this.freeResources(),this.pipelines_=Aa,this.versionsFile=Ta,await this.loadModule(Ea);const xa=await this.loadWasm(Sa,aa,ba);return this.wasmApiHelpers=new this.wasmModule.MlWasmApiHelpers,this.idCaptureWasmApi=new this.wasmModule.IdCaptureWasmApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionWasmApi,this.isInitialized_=!0,xa}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.wasmApiHelpers!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(aa,ba){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(aa&&ba&&aa==this.imageWidth_&&ba==this.imageHeight_&&this.inputImageBuffer&&aa*ba*4===this.inputImageBuffer.length)&&(this.imageWidth_=aa,this.imageHeight_=ba,this.inputImageBuffer=this.wasmApiHelpers.allocateInputImageBuffer(aa,ba,4))}async handleDetectionCallAndUpdateState(aa){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.handleDetectionCallAndUpdateState(this.toWasmEnum(aa))}async encryptImage(aa){return this.checkWasmInitialization("Unable to encrypt the image, cpp API hasn't been initialized"),this.wasmApiHelpers.encryptImage(aa)}isVirtualCamera(aa){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),aa)return this.wasmApiHelpers.isVirtualCamera(aa)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.wasmApiHelpers.estimatePerformance()}async analyzeFrame(aa){return this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(aa.width,aa.height),this.inputImageBuffer.set(aa.data),this.wasmApiHelpers.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.wasmApiHelpers&&typeof this.wasmApiHelpers.delete=="function"&&(this.wasmApiHelpers.delete(),this.wasmApiHelpers=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(aa){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.wasmApiHelpers.resetPipeline(this.toWasmEnum(aa))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[aa,ba]of this.pipelines_)this.resetPipeline(aa)}async process(aa,ba){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(aa.data),ba){case WasmPipelineType.IdCapturePipeline:return this.idCaptureWasmApi.runIdCapturePipeline();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.toWasmEnum(ba));default:throw new Error("Unknown pipeline type")}}async runIdCapture(aa){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(aa.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(aa){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(aa.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(aa,ba,Ea,Sa,Ta){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.toWasmEnum(aa),ba,Ea,Sa,Ta)}async setFaceDetectionThresholds(aa,ba,Ea,Sa,Ta,Aa,xa){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa)}async setFaceAttributesThresholds(aa,ba,Ea,Sa,Ta){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.toWasmEnum(aa),ba,Ea,Sa,Ta)}async setFaceAttributesEnabled(aa,ba,Ea,Sa,Ta){this.checkWasmInitialization("Unable to set face attributes enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesEnabled(this.toWasmEnum(aa),ba,Ea,Sa,Ta)}async setFaceDetectionMode(aa,ba){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.toWasmEnum(aa),ba)}async setFaceDetectionCallbacks(aa,ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el,nl,il,sl,al,rl){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el,nl,il,sl,al,rl)}async setIdCaptureThresholds(aa,ba,Ea,Sa,Ta,Aa,xa){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa)}async setIdCaptureCallbacks(aa,ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl)}async setIdCaptureGeometryParams(aa,ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el,nl){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el,nl)}async setIdCaptureConfigParams(aa,ba,Ea,Sa,Ta,Aa){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.toWasmEnum(aa),ba,Ea,Sa,Ta,Aa)}async getVersions(){const ba=await(await fetch(this.versionsFile)).text();return JSON.parse(ba)}async loadWasm(aa,ba,Ea){const Sa=aa?Ea:ba;try{window.wasmArrayBuffer=await fetch(Sa).then(Ta=>Ta.arrayBuffer()).then(Ta=>new Uint8Array(Ta)),this.wasmModule=await this.Module()}catch(Ta){if(console.log(Ta,aa,"useSmd"),aa)return await this.loadWasm(!1,ba,Ea);throw Ta}return aa}async loadModels(){var Sa;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let aa=new this.wasmModule.PipelineTypeToIntMap,ba=new Map,Ea=new Map;for(let[Ta,Aa]of this.pipelines_){let xa=this.toWasmEnum(Ta),wa=[],ka=new this.wasmModule.VectorInt;for(let La of Aa){if(!Ea.has(La)){let el=await fetch(La).then(nl=>nl.arrayBuffer()).then(nl=>new Uint8Array(nl));Ea.set(La,el)}let tl=Ea.get(La);ka.push_back(tl.byteLength),wa.push(tl)}aa.set(xa,ka),ba.set(xa,wa)}this.modelsBuffers=this.wasmApiHelpers.allocateModelsBuffers(aa);for(let[Ta,Aa]of ba){let xa=(Sa=this.modelsBuffers)==null?void 0:Sa.get(Ta);for(let wa=0;wa<xa.size();wa++){let ka=xa==null?void 0:xa.get(wa);if(ka)ka.set(Aa[wa]);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.wasmApiHelpers.initializePipelines()}async setProductionMode(aa){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.wasmApiHelpers.setProductionMode(aa)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.wasmApiHelpers.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.fromWasmEnum(this.wasmApiHelpers.getCurrentPipeline())}toWasmEnum(aa){switch(aa){case WasmPipelineType.IdCapturePipeline:return this.wasmModule.PipelineType.IdCapturePipeline;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")}}fromWasmEnum(aa){switch(aa){case this.wasmModule.PipelineType.IdCapturePipeline:return WasmPipelineType.IdCapturePipeline;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")}}checkWasmInitialization(aa){if(!this.isInitialized())throw new Error(aa)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance();class MotionStatusCheck{constructor(aa,ba,Ea,Sa,Ta,Aa,xa,wa,ka,La,tl,el){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=3,this.maxFrequency_=60,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.waitForClick=()=>new Promise(nl=>{document.addEventListener("click",async()=>{const il=await this.requestMotionPermission();nl(il)},{once:!0})}),this.deviceMotionListener=nl=>{if(nl.accelerationIncludingGravity){const il={x:nl.accelerationIncludingGravity.x,y:nl.accelerationIncludingGravity.y,z:nl.accelerationIncludingGravity.z};this.checkFields(il)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,il))}if(nl.acceleration){const il={x:nl.acceleration.x,y:nl.acceleration.y,z:nl.acceleration.z};this.checkFields(il)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,il))}if(nl.rotationRate){const il={x:nl.rotationRate.alpha,y:nl.rotationRate.beta,z:nl.rotationRate.gamma};this.checkFields(il)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,il))}},this.deviceOrientationListener=nl=>{const il={x:nl.alpha,y:nl.beta,z:nl.gamma};this.checkFields(il)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,il))},this.accThreshold_=aa,this.gyroThreshold_=ba,this.accGrOldThreshold_=Ea,this.accOldThreshold_=Sa,this.gyroscopeOldThreshold_=Ta,this.orientationOldThreshold_=Aa,this.maeAccThreshold_=xa,this.maeGyroThreshold_=wa,this.maeAccGrOldThreshold_=ka,this.maeAccOldThreshold_=La,this.maeGyroscopeOldThreshold_=tl,this.maeOrientationOldThreshold_=el}async requestMotionPermission(){DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"&&DeviceMotionEvent.requestPermission().then(aa=>{aa!=="granted"&&(this.permission_=!1)}).catch(console.error)}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!(!this.isRunning_||!this.acl_)&&(this.paramsAcc_.ptsNum+=1,this.acl_)){const aa={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(aa)&&this.updateParams(this.paramsAcc_,aa)}}updateGyro(){if(!(!this.isRunning_||!this.gyro_)&&(this.paramsGyro_.ptsNum+=1,this.gyro_)){const aa={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(aa)&&this.updateParams(this.paramsGyro_,aa)}}check(){if(!this.permission_)return"UNCLEAR";const aa=this.checkStability();return aa===null?"UNCLEAR":aa?"FAIL":"PASS"}checkStability(){if(!this.isRunning_)return null;const ba=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(xa=>xa!==null),Ea=ba.length>0?ba.every(xa=>xa):null,Ta=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(xa=>xa!==null),Aa=Ta.length>0?Ta.every(xa=>xa):null;return Ea===null?Aa===null?null:Aa:Aa!==null?Ea&&Aa:Ea}updateParams(aa,ba){const Ea=ba.x-aa.meanX,Sa=ba.y-aa.meanY,Ta=ba.z-aa.meanZ;aa.meanX+=Ea/aa.ptsNum,aa.meanY+=Sa/aa.ptsNum,aa.meanZ+=Ta/aa.ptsNum,aa.m2X+=Ea*(ba.x-aa.meanX),aa.m2Y+=Sa*(ba.y-aa.meanY),aa.m2Z+=Ta*(ba.z-aa.meanZ),aa.cumulativeAbsErrorX+=Math.abs(ba.x-aa.meanX),aa.cumulativeAbsErrorY+=Math.abs(ba.y-aa.meanY),aa.cumulativeAbsErrorZ+=Math.abs(ba.z-aa.meanZ)}calculateStd(aa){const ba={x:aa.m2X/aa.ptsNum,y:aa.m2Y/aa.ptsNum,z:aa.m2Z/aa.ptsNum};return{x:Math.sqrt(ba.x),y:Math.sqrt(ba.y),z:Math.sqrt(ba.z)}}calculateMae(aa){return{x:aa.cumulativeAbsErrorX/aa.ptsNum,y:aa.cumulativeAbsErrorY/aa.ptsNum,z:aa.cumulativeAbsErrorZ/aa.ptsNum}}checkFields(aa){return aa.x!==null&&aa.y!==null&&aa.z!==null}isBelowStdThreshold(aa,ba){if(aa.ptsNum<this.minNumberOfFrames_)return null;const Ea=this.calculateStd(aa);return Ea.x<ba&&Ea.y<ba&&Ea.z<ba}isBelowMaeThreshold(aa,ba){if(aa.ptsNum<this.minNumberOfFrames_)return null;const Ea=this.calculateMae(aa);return Ea.x<ba&&Ea.y<ba&&Ea.z<ba}}class OnboardingAnalytics{constructor(){this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.pipelinesBundle=null,this.simdIsEnabled=null,this.wasmVersion=null,this.isVirtualCameraDetectedByLabel=!1,this.motionStatusCheck=new MotionStatusCheck(.3,.3,.3,.3,10,10,.3,.3,.3,.3,10,10)}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setPipelinesBundle(aa){this.pipelinesBundle=aa}setSimdIsEnabled(aa){this.simdIsEnabled=aa}setWasmVersion(aa){this.wasmVersion=aa}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getAnalysisStatus(){return this.analysisStatus}async analyzeFrame(aa){const ba=await base64ToImageData(aa);await MlWasmJSApi$1.analyzeFrame(ba),this.updatePipelineStats()}async checkForVirtualCameraByLabel(aa=null){try{if(!MlWasmJSApi$1.isInitialized())return null;if(!aa){const Ea=await getDeviceCapabilities();for(const Sa of Object.keys(Ea)){const Ta=Ea[Sa];if(MlWasmJSApi$1.isVirtualCamera(Ta==null?void 0:Ta.label)){const Aa={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Aa}}}const ba=getChosenCameraInfo(aa);if(MlWasmJSApi$1.isVirtualCamera(ba==null?void 0:ba.label)){const Ea={isDetected:!0,hasPriorDetection:this.isVirtualCameraDetectedByLabel};return this.isVirtualCameraDetectedByLabel=!0,Ea}return{isDetected:!1,hasPriorDetection:this.isVirtualCameraDetectedByLabel}}catch(ba){console.log(`Exception: ${ba}`)}return null}async startOnboardingCheck(){this.motionStatusCheck.start()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}updatePipelineStats(){if(MlWasmJSApi$1.isInitialized())try{const aa=MlWasmJSApi$1.getPipelineState();if(aa!==""){const ba=JSON.parse(aa);this.analysisStatus=ba.statsAnalysisStatus,ba.pipelinesBundle=this.pipelinesBundle?this.pipelinesBundle:"unknown",ba.estimatedPerformance=this.estimatedPerformance,ba.simdIsEnabled=this.simdIsEnabled,ba.wasmVersion=this.wasmVersion,this.pipelineLogs=ba,this.motionStatus===""&&(this.motionStatus=this.motionStatusCheck.check())}}catch(aa){console.error(`Exception: ${aa}`)}}}const OnboardingAnalytics$1=OnboardingAnalytics.getInstance();var define_import_meta_env_default={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"1.76.0",PROD:!0,SSR:!1};class DetectionSetup{constructor(){this.setupDetectPromise=null,this.isSetupDetect=!1,this.pipelinesBundle=null,this.profiles=null}static getInstance(){return DetectionSetup.instance||(DetectionSetup.instance=new DetectionSetup),DetectionSetup.instance}setIsIPhone14OrHigher(){if(!mobile.iOS())return;if(new URLSearchParams(window.location.search).get("smallFrame")==="true"){localStorage.setItem("isIPhone14OrHigher","true");return}localStorage.setItem("isIPhone14OrHigher",String(window.outerHeight===852&&window.outerWidth===393||window.outerHeight===932&&window.outerWidth===430||window.innerHeight===631&&window.innerWidth===375))}async setupDetect(){return this.setupDetectPromise?this.setupDetectPromise:(this.setupDetectPromise=this._runSetupDetect(),this.setupDetectPromise)}getPipelinesBundle(){return this.pipelinesBundle}getProfile(aa){var ba;return((ba=this.profiles)==null?void 0:ba.get(aa))??null}async warmup(){for(;!MlWasmJSApi$1.isInitialized();)await new Promise(aa=>setTimeout(aa,100))}async _runSetupDetect(){var Ta,Aa,xa;if(this.isSetupDetect)return;addEvent({token:(Ta=state$1.token)==null?void 0:Ta.token,code:"modelLoadStart"}),this.setIsIPhone14OrHigher();const aa=getInitializationParams(options.hostingApp==="Incode ID");this.pipelinesBundle=aa.bundle,this.profiles=aa.profiles,OnboardingAnalytics$1.setPipelinesBundle(this.pipelinesBundle),OnboardingAnalytics$1.startOnboardingCheck();const ba=await MlWasmJSApi$1.initialize(aa.wasmModulePath,aa.wasmSimdModulePath,aa.glueCodePath,aa.enableSIMD,aa.versionsFilePath,aa.pipelineModels);for(;!MlWasmJSApi$1.isInitialized();)await new Promise(wa=>setTimeout(wa,100));OnboardingAnalytics$1.estimatePerformance(),OnboardingAnalytics$1.setWasmVersion(aa.wasmVersion),OnboardingAnalytics$1.setSimdIsEnabled(ba);const Ea=await OnboardingAnalytics$1.checkForVirtualCameraByLabel();Ea!=null&&Ea.isDetected&&!Ea.hasPriorDetection&&addDeviceStats((Aa=state$1.token)==null?void 0:Aa.token,{cameraLabelInspectionStatus:"FAIL"}),await MlWasmJSApi$1.initializePipelines();const Sa=define_import_meta_env_default.VITE_WASM_PRODUCTION_MODE==="true";try{await MlWasmJSApi$1.setProductionMode(Sa)}catch(wa){console.error(`Exception: ${wa}`)}this.isSetupDetect=!0,addEvent({token:(xa=state$1.token)==null?void 0:xa.token,code:"modelLoadEnd",payload:{loadSuccessful:!0}})}}const detectionSetup=DetectionSetup.getInstance();function _typeof$a(oa){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(aa){return typeof aa}:function(aa){return aa&&typeof Symbol=="function"&&aa.constructor===Symbol&&aa!==Symbol.prototype?"symbol":typeof aa},_typeof$a(oa)}function _classCallCheck$m(oa,aa){if(!(oa instanceof aa))throw new TypeError("Cannot call a class as a function")}function toPrimitive(oa,aa){if(_typeof$a(oa)!="object"||!oa)return oa;var ba=oa[Symbol.toPrimitive];if(ba!==void 0){var Ea=ba.call(oa,aa||"default");if(_typeof$a(Ea)!="object")return Ea;throw new TypeError("@@toPrimitive must return a primitive value.")}return(aa==="string"?String:Number)(oa)}function toPropertyKey(oa){var aa=toPrimitive(oa,"string");return _typeof$a(aa)=="symbol"?aa:String(aa)}function _defineProperties$9(oa,aa){for(var ba=0;ba<aa.length;ba++){var Ea=aa[ba];Ea.enumerable=Ea.enumerable||!1,Ea.configurable=!0,"value"in Ea&&(Ea.writable=!0),Object.defineProperty(oa,toPropertyKey(Ea.key),Ea)}}function _createClass$l(oa,aa,ba){return aa&&_defineProperties$9(oa.prototype,aa),ba&&_defineProperties$9(oa,ba),Object.defineProperty(oa,"prototype",{writable:!1}),oa}function _assertThisInitialized$1(oa){if(oa===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oa}function _setPrototypeOf$1(oa,aa){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ea,Sa){return Ea.__proto__=Sa,Ea},_setPrototypeOf$1(oa,aa)}function _inherits$c(oa,aa){if(typeof aa!="function"&&aa!==null)throw new TypeError("Super expression must either be null or a function");oa.prototype=Object.create(aa&&aa.prototype,{constructor:{value:oa,writable:!0,configurable:!0}}),Object.defineProperty(oa,"prototype",{writable:!1}),aa&&_setPrototypeOf$1(oa,aa)}function _possibleConstructorReturn$c(oa,aa){if(aa&&(_typeof$a(aa)==="object"||typeof aa=="function"))return aa;if(aa!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(oa)}function _getPrototypeOf$1(oa){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(ba){return ba.__proto__||Object.getPrototypeOf(ba)},_getPrototypeOf$1(oa)}function _defineProperty$6(oa,aa,ba){return aa=toPropertyKey(aa),aa in oa?Object.defineProperty(oa,aa,{value:ba,enumerable:!0,configurable:!0,writable:!0}):oa[aa]=ba,oa}function _arrayWithHoles$3(oa){if(Array.isArray(oa))return oa}function _iterableToArray(oa){if(typeof Symbol<"u"&&oa[Symbol.iterator]!=null||oa["@@iterator"]!=null)return Array.from(oa)}function _arrayLikeToArray$b(oa,aa){(aa==null||aa>oa.length)&&(aa=oa.length);for(var ba=0,Ea=new Array(aa);ba<aa;ba++)Ea[ba]=oa[ba];return Ea}function _unsupportedIterableToArray$b(oa,aa){if(oa){if(typeof oa=="string")return _arrayLikeToArray$b(oa,aa);var ba=Object.prototype.toString.call(oa).slice(8,-1);if(ba==="Object"&&oa.constructor&&(ba=oa.constructor.name),ba==="Map"||ba==="Set")return Array.from(oa);if(ba==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ba))return _arrayLikeToArray$b(oa,aa)}}function _nonIterableRest$3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
81
81
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _toArray(oa){return _arrayWithHoles$3(oa)||_iterableToArray(oa)||_unsupportedIterableToArray$b(oa)||_nonIterableRest$3()}function ownKeys$8(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$8(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$8(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$8(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}var consoleLogger={type:"logger",log:function(aa){this.output("log",aa)},warn:function(aa){this.output("warn",aa)},error:function(aa){this.output("error",aa)},output:function(aa,ba){console&&console[aa]&&console[aa].apply(console,ba)}},Logger=function(){function oa(aa){var ba=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,oa),this.init(aa,ba)}return _createClass$l(oa,[{key:"init",value:function(ba){var Ea=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=Ea.prefix||"i18next:",this.logger=ba||consoleLogger,this.options=Ea,this.debug=Ea.debug}},{key:"setDebug",value:function(ba){this.debug=ba}},{key:"log",value:function(){for(var ba=arguments.length,Ea=new Array(ba),Sa=0;Sa<ba;Sa++)Ea[Sa]=arguments[Sa];return this.forward(Ea,"log","",!0)}},{key:"warn",value:function(){for(var ba=arguments.length,Ea=new Array(ba),Sa=0;Sa<ba;Sa++)Ea[Sa]=arguments[Sa];return this.forward(Ea,"warn","",!0)}},{key:"error",value:function(){for(var ba=arguments.length,Ea=new Array(ba),Sa=0;Sa<ba;Sa++)Ea[Sa]=arguments[Sa];return this.forward(Ea,"error","")}},{key:"deprecate",value:function(){for(var ba=arguments.length,Ea=new Array(ba),Sa=0;Sa<ba;Sa++)Ea[Sa]=arguments[Sa];return this.forward(Ea,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(ba,Ea,Sa,Ta){return Ta&&!this.debug?null:(typeof ba[0]=="string"&&(ba[0]="".concat(Sa).concat(this.prefix," ").concat(ba[0])),this.logger[Ea](ba))}},{key:"create",value:function(ba){return new oa(this.logger,_objectSpread$8(_objectSpread$8({},{prefix:"".concat(this.prefix,":").concat(ba,":")}),this.options))}},{key:"clone",value:function(ba){return ba=ba||this.options,ba.prefix=ba.prefix||this.prefix,new oa(this.logger,ba)}}]),oa}(),baseLogger=new Logger,EventEmitter$7=function(){function oa(){_classCallCheck$m(this,oa),this.observers={}}return _createClass$l(oa,[{key:"on",value:function(ba,Ea){var Sa=this;return ba.split(" ").forEach(function(Ta){Sa.observers[Ta]=Sa.observers[Ta]||[],Sa.observers[Ta].push(Ea)}),this}},{key:"off",value:function(ba,Ea){if(this.observers[ba]){if(!Ea){delete this.observers[ba];return}this.observers[ba]=this.observers[ba].filter(function(Sa){return Sa!==Ea})}}},{key:"emit",value:function(ba){for(var Ea=arguments.length,Sa=new Array(Ea>1?Ea-1:0),Ta=1;Ta<Ea;Ta++)Sa[Ta-1]=arguments[Ta];if(this.observers[ba]){var Aa=[].concat(this.observers[ba]);Aa.forEach(function(wa){wa.apply(void 0,Sa)})}if(this.observers["*"]){var xa=[].concat(this.observers["*"]);xa.forEach(function(wa){wa.apply(wa,[ba].concat(Sa))})}}}]),oa}();function defer(){var oa,aa,ba=new Promise(function(Ea,Sa){oa=Ea,aa=Sa});return ba.resolve=oa,ba.reject=aa,ba}function makeString(oa){return oa==null?"":""+oa}function copy(oa,aa,ba){oa.forEach(function(Ea){aa[Ea]&&(ba[Ea]=aa[Ea])})}function getLastOfPath(oa,aa,ba){function Ea(xa){return xa&&xa.indexOf("###")>-1?xa.replace(/###/g,"."):xa}function Sa(){return!oa||typeof oa=="string"}for(var Ta=typeof aa!="string"?[].concat(aa):aa.split(".");Ta.length>1;){if(Sa())return{};var Aa=Ea(Ta.shift());!oa[Aa]&&ba&&(oa[Aa]=new ba),Object.prototype.hasOwnProperty.call(oa,Aa)?oa=oa[Aa]:oa={}}return Sa()?{}:{obj:oa,k:Ea(Ta.shift())}}function setPath(oa,aa,ba){var Ea=getLastOfPath(oa,aa,Object),Sa=Ea.obj,Ta=Ea.k;Sa[Ta]=ba}function pushPath(oa,aa,ba,Ea){var Sa=getLastOfPath(oa,aa,Object),Ta=Sa.obj,Aa=Sa.k;Ta[Aa]=Ta[Aa]||[],Ta[Aa].push(ba)}function getPath$1(oa,aa){var ba=getLastOfPath(oa,aa),Ea=ba.obj,Sa=ba.k;if(Ea)return Ea[Sa]}function getPathWithDefaults(oa,aa,ba){var Ea=getPath$1(oa,ba);return Ea!==void 0?Ea:getPath$1(aa,ba)}function deepExtend(oa,aa,ba){for(var Ea in aa)Ea!=="__proto__"&&Ea!=="constructor"&&(Ea in oa?typeof oa[Ea]=="string"||oa[Ea]instanceof String||typeof aa[Ea]=="string"||aa[Ea]instanceof String?ba&&(oa[Ea]=aa[Ea]):deepExtend(oa[Ea],aa[Ea],ba):oa[Ea]=aa[Ea]);return oa}function regexEscape(oa){return oa.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape$1(oa){return typeof oa=="string"?oa.replace(/[&<>"'\/]/g,function(aa){return _entityMap[aa]}):oa}var isIE10=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,chars$1=[" ",",","?","!",";"];function looksLikeObjectPath(oa,aa,ba){aa=aa||"",ba=ba||"";var Ea=chars$1.filter(function(xa){return aa.indexOf(xa)<0&&ba.indexOf(xa)<0});if(Ea.length===0)return!0;var Sa=new RegExp("(".concat(Ea.map(function(xa){return xa==="?"?"\\?":xa}).join("|"),")")),Ta=!Sa.test(oa);if(!Ta){var Aa=oa.indexOf(ba);Aa>0&&!Sa.test(oa.substring(0,Aa))&&(Ta=!0)}return Ta}function ownKeys$1$1(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$1$1(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$1$1(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$1$1(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}function _createSuper$1(oa){var aa=_isNativeReflectConstruct$1();return function(){var Ea=_getPrototypeOf$1(oa),Sa;if(aa){var Ta=_getPrototypeOf$1(this).constructor;Sa=Reflect.construct(Ea,arguments,Ta)}else Sa=Ea.apply(this,arguments);return _possibleConstructorReturn$c(this,Sa)}}function _isNativeReflectConstruct$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function deepFind(oa,aa){var ba=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(oa){if(oa[aa])return oa[aa];for(var Ea=aa.split(ba),Sa=oa,Ta=0;Ta<Ea.length;++Ta){if(!Sa||typeof Sa[Ea[Ta]]=="string"&&Ta+1<Ea.length)return;if(Sa[Ea[Ta]]===void 0){for(var Aa=2,xa=Ea.slice(Ta,Ta+Aa).join(ba),wa=Sa[xa];wa===void 0&&Ea.length>Ta+Aa;)Aa++,xa=Ea.slice(Ta,Ta+Aa).join(ba),wa=Sa[xa];if(wa===void 0)return;if(wa===null)return null;if(aa.endsWith(xa)){if(typeof wa=="string")return wa;if(xa&&typeof wa[xa]=="string")return wa[xa]}var ka=Ea.slice(Ta+Aa).join(ba);return ka?deepFind(wa,ka,ba):void 0}Sa=Sa[Ea[Ta]]}return Sa}}var ResourceStore=function(oa){_inherits$c(ba,oa);var aa=_createSuper$1(ba);function ba(Ea){var Sa,Ta=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck$m(this,ba),Sa=aa.call(this),isIE10&&EventEmitter$7.call(_assertThisInitialized$1(Sa)),Sa.data=Ea||{},Sa.options=Ta,Sa.options.keySeparator===void 0&&(Sa.options.keySeparator="."),Sa.options.ignoreJSONStructure===void 0&&(Sa.options.ignoreJSONStructure=!0),Sa}return _createClass$l(ba,[{key:"addNamespaces",value:function(Sa){this.options.ns.indexOf(Sa)<0&&this.options.ns.push(Sa)}},{key:"removeNamespaces",value:function(Sa){var Ta=this.options.ns.indexOf(Sa);Ta>-1&&this.options.ns.splice(Ta,1)}},{key:"getResource",value:function(Sa,Ta,Aa){var xa=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},wa=xa.keySeparator!==void 0?xa.keySeparator:this.options.keySeparator,ka=xa.ignoreJSONStructure!==void 0?xa.ignoreJSONStructure:this.options.ignoreJSONStructure,La=[Sa,Ta];Aa&&typeof Aa!="string"&&(La=La.concat(Aa)),Aa&&typeof Aa=="string"&&(La=La.concat(wa?Aa.split(wa):Aa)),Sa.indexOf(".")>-1&&(La=Sa.split("."));var tl=getPath$1(this.data,La);return tl||!ka||typeof Aa!="string"?tl:deepFind(this.data&&this.data[Sa]&&this.data[Sa][Ta],Aa,wa)}},{key:"addResource",value:function(Sa,Ta,Aa,xa){var wa=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},ka=this.options.keySeparator;ka===void 0&&(ka=".");var La=[Sa,Ta];Aa&&(La=La.concat(ka?Aa.split(ka):Aa)),Sa.indexOf(".")>-1&&(La=Sa.split("."),xa=Ta,Ta=La[1]),this.addNamespaces(Ta),setPath(this.data,La,xa),wa.silent||this.emit("added",Sa,Ta,Aa,xa)}},{key:"addResources",value:function(Sa,Ta,Aa){var xa=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var wa in Aa)(typeof Aa[wa]=="string"||Object.prototype.toString.apply(Aa[wa])==="[object Array]")&&this.addResource(Sa,Ta,wa,Aa[wa],{silent:!0});xa.silent||this.emit("added",Sa,Ta,Aa)}},{key:"addResourceBundle",value:function(Sa,Ta,Aa,xa,wa){var ka=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},La=[Sa,Ta];Sa.indexOf(".")>-1&&(La=Sa.split("."),xa=Aa,Aa=Ta,Ta=La[1]),this.addNamespaces(Ta);var tl=getPath$1(this.data,La)||{};xa?deepExtend(tl,Aa,wa):tl=_objectSpread$1$1(_objectSpread$1$1({},tl),Aa),setPath(this.data,La,tl),ka.silent||this.emit("added",Sa,Ta,Aa)}},{key:"removeResourceBundle",value:function(Sa,Ta){this.hasResourceBundle(Sa,Ta)&&delete this.data[Sa][Ta],this.removeNamespaces(Ta),this.emit("removed",Sa,Ta)}},{key:"hasResourceBundle",value:function(Sa,Ta){return this.getResource(Sa,Ta)!==void 0}},{key:"getResourceBundle",value:function(Sa,Ta){return Ta||(Ta=this.options.defaultNS),this.options.compatibilityAPI==="v1"?_objectSpread$1$1(_objectSpread$1$1({},{}),this.getResource(Sa,Ta)):this.getResource(Sa,Ta)}},{key:"getDataByLanguage",value:function(Sa){return this.data[Sa]}},{key:"hasLanguageSomeTranslations",value:function(Sa){var Ta=this.getDataByLanguage(Sa),Aa=Ta&&Object.keys(Ta)||[];return!!Aa.find(function(xa){return Ta[xa]&&Object.keys(Ta[xa]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),ba}(EventEmitter$7),postProcessor={processors:{},addPostProcessor:function(aa){this.processors[aa.name]=aa},handle:function(aa,ba,Ea,Sa,Ta){var Aa=this;return aa.forEach(function(xa){Aa.processors[xa]&&(ba=Aa.processors[xa].process(ba,Ea,Sa,Ta))}),ba}};function ownKeys$2$1(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$2$1(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$2$1(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$2$1(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}function _createSuper$1$1(oa){var aa=_isNativeReflectConstruct$1$1();return function(){var Ea=_getPrototypeOf$1(oa),Sa;if(aa){var Ta=_getPrototypeOf$1(this).constructor;Sa=Reflect.construct(Ea,arguments,Ta)}else Sa=Ea.apply(this,arguments);return _possibleConstructorReturn$c(this,Sa)}}function _isNativeReflectConstruct$1$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var checkedLoadedFor={},Translator=function(oa){_inherits$c(ba,oa);var aa=_createSuper$1$1(ba);function ba(Ea){var Sa,Ta=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _classCallCheck$m(this,ba),Sa=aa.call(this),isIE10&&EventEmitter$7.call(_assertThisInitialized$1(Sa)),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],Ea,_assertThisInitialized$1(Sa)),Sa.options=Ta,Sa.options.keySeparator===void 0&&(Sa.options.keySeparator="."),Sa.logger=baseLogger.create("translator"),Sa}return _createClass$l(ba,[{key:"changeLanguage",value:function(Sa){Sa&&(this.language=Sa)}},{key:"exists",value:function(Sa){var Ta=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(Sa==null)return!1;var Aa=this.resolve(Sa,Ta);return Aa&&Aa.res!==void 0}},{key:"extractFromKey",value:function(Sa,Ta){var Aa=Ta.nsSeparator!==void 0?Ta.nsSeparator:this.options.nsSeparator;Aa===void 0&&(Aa=":");var xa=Ta.keySeparator!==void 0?Ta.keySeparator:this.options.keySeparator,wa=Ta.ns||this.options.defaultNS||[],ka=Aa&&Sa.indexOf(Aa)>-1,La=!this.options.userDefinedKeySeparator&&!Ta.keySeparator&&!this.options.userDefinedNsSeparator&&!Ta.nsSeparator&&!looksLikeObjectPath(Sa,Aa,xa);if(ka&&!La){var tl=Sa.match(this.interpolator.nestingRegexp);if(tl&&tl.length>0)return{key:Sa,namespaces:wa};var el=Sa.split(Aa);(Aa!==xa||Aa===xa&&this.options.ns.indexOf(el[0])>-1)&&(wa=el.shift()),Sa=el.join(xa)}return typeof wa=="string"&&(wa=[wa]),{key:Sa,namespaces:wa}}},{key:"translate",value:function(Sa,Ta,Aa){var xa=this;if(_typeof$a(Ta)!=="object"&&this.options.overloadTranslationOptionHandler&&(Ta=this.options.overloadTranslationOptionHandler(arguments)),Ta||(Ta={}),Sa==null)return"";Array.isArray(Sa)||(Sa=[String(Sa)]);var wa=Ta.returnDetails!==void 0?Ta.returnDetails:this.options.returnDetails,ka=Ta.keySeparator!==void 0?Ta.keySeparator:this.options.keySeparator,La=this.extractFromKey(Sa[Sa.length-1],Ta),tl=La.key,el=La.namespaces,nl=el[el.length-1],il=Ta.lng||this.language,sl=Ta.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(il&&il.toLowerCase()==="cimode"){if(sl){var al=Ta.nsSeparator||this.options.nsSeparator;return wa?(rl.res="".concat(nl).concat(al).concat(tl),rl):"".concat(nl).concat(al).concat(tl)}return wa?(rl.res=tl,rl):tl}var rl=this.resolve(Sa,Ta),ll=rl&&rl.res,cl=rl&&rl.usedKey||tl,dl=rl&&rl.exactUsedKey||tl,pl=Object.prototype.toString.apply(ll),bl=["[object Number]","[object Function]","[object RegExp]"],Ul=Ta.joinArrays!==void 0?Ta.joinArrays:this.options.joinArrays,fl=!this.i18nFormat||this.i18nFormat.handleAsObject,Wl=typeof ll!="string"&&typeof ll!="boolean"&&typeof ll!="number";if(fl&&ll&&Wl&&bl.indexOf(pl)<0&&!(typeof Ul=="string"&&pl==="[object Array]")){if(!Ta.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var xl=this.options.returnedObjectHandler?this.options.returnedObjectHandler(cl,ll,_objectSpread$2$1(_objectSpread$2$1({},Ta),{},{ns:el})):"key '".concat(tl," (").concat(this.language,")' returned an object instead of string.");return wa?(rl.res=xl,rl):xl}if(ka){var Bl=pl==="[object Array]",El=Bl?[]:{},Rl=Bl?dl:cl;for(var ml in ll)if(Object.prototype.hasOwnProperty.call(ll,ml)){var yl="".concat(Rl).concat(ka).concat(ml);El[ml]=this.translate(yl,_objectSpread$2$1(_objectSpread$2$1({},Ta),{joinArrays:!1,ns:el})),El[ml]===yl&&(El[ml]=ll[ml])}ll=El}}else if(fl&&typeof Ul=="string"&&pl==="[object Array]")ll=ll.join(Ul),ll&&(ll=this.extendTranslation(ll,Sa,Ta,Aa));else{var Nl=!1,Fl=!1,Tl=Ta.count!==void 0&&typeof Ta.count!="string",Il=ba.hasDefaultValue(Ta),Vl=Tl?this.pluralResolver.getSuffix(il,Ta.count,Ta):"",Jl=Ta["defaultValue".concat(Vl)]||Ta.defaultValue;!this.isValidLookup(ll)&&Il&&(Nl=!0,ll=Jl),this.isValidLookup(ll)||(Fl=!0,ll=tl);var Pl=Ta.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Gl=Pl&&Fl?void 0:ll,zl=Il&&Jl!==ll&&this.options.updateMissing;if(Fl||Nl||zl){if(this.logger.log(zl?"updateKey":"missingKey",il,nl,tl,zl?Jl:ll),ka){var Zc=this.resolve(tl,_objectSpread$2$1(_objectSpread$2$1({},Ta),{},{keySeparator:!1}));Zc&&Zc.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Dl=[],e0=this.languageUtils.getFallbackCodes(this.options.fallbackLng,Ta.lng||this.language);if(this.options.saveMissingTo==="fallback"&&e0&&e0[0])for(var qc=0;qc<e0.length;qc++)Dl.push(e0[qc]);else this.options.saveMissingTo==="all"?Dl=this.languageUtils.toResolveHierarchy(Ta.lng||this.language):Dl.push(Ta.lng||this.language);var Hl=function(wl,Zl,Ll){var Ol=Il&&Ll!==ll?Ll:Gl;xa.options.missingKeyHandler?xa.options.missingKeyHandler(wl,nl,Zl,Ol,zl,Ta):xa.backendConnector&&xa.backendConnector.saveMissing&&xa.backendConnector.saveMissing(wl,nl,Zl,Ol,zl,Ta),xa.emit("missingKey",wl,nl,Zl,ll)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Tl?Dl.forEach(function(Yl){xa.pluralResolver.getSuffixes(Yl,Ta).forEach(function(wl){Hl([Yl],tl+wl,Ta["defaultValue".concat(wl)]||Jl)})}):Hl(Dl,tl,Jl))}ll=this.extendTranslation(ll,Sa,Ta,rl,Aa),Fl&&ll===tl&&this.options.appendNamespaceToMissingKey&&(ll="".concat(nl,":").concat(tl)),(Fl||Nl)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?ll=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(nl,":").concat(tl):tl,Nl?ll:void 0):ll=this.options.parseMissingKeyHandler(ll))}return wa?(rl.res=ll,rl):ll}},{key:"extendTranslation",value:function(Sa,Ta,Aa,xa,wa){var ka=this;if(this.i18nFormat&&this.i18nFormat.parse)Sa=this.i18nFormat.parse(Sa,_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation.defaultVariables),Aa),xa.usedLng,xa.usedNS,xa.usedKey,{resolved:xa});else if(!Aa.skipInterpolation){Aa.interpolation&&this.interpolator.init(_objectSpread$2$1(_objectSpread$2$1({},Aa),{interpolation:_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation),Aa.interpolation)}));var La=typeof Sa=="string"&&(Aa&&Aa.interpolation&&Aa.interpolation.skipOnVariables!==void 0?Aa.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),tl;if(La){var el=Sa.match(this.interpolator.nestingRegexp);tl=el&&el.length}var nl=Aa.replace&&typeof Aa.replace!="string"?Aa.replace:Aa;if(this.options.interpolation.defaultVariables&&(nl=_objectSpread$2$1(_objectSpread$2$1({},this.options.interpolation.defaultVariables),nl)),Sa=this.interpolator.interpolate(Sa,nl,Aa.lng||this.language,Aa),La){var il=Sa.match(this.interpolator.nestingRegexp),sl=il&&il.length;tl<sl&&(Aa.nest=!1)}Aa.nest!==!1&&(Sa=this.interpolator.nest(Sa,function(){for(var ll=arguments.length,cl=new Array(ll),dl=0;dl<ll;dl++)cl[dl]=arguments[dl];return wa&&wa[0]===cl[0]&&!Aa.context?(ka.logger.warn("It seems you are nesting recursively key: ".concat(cl[0]," in key: ").concat(Ta[0])),null):ka.translate.apply(ka,cl.concat([Ta]))},Aa)),Aa.interpolation&&this.interpolator.reset()}var al=Aa.postProcess||this.options.postProcess,rl=typeof al=="string"?[al]:al;return Sa!=null&&rl&&rl.length&&Aa.applyPostProcessor!==!1&&(Sa=postProcessor.handle(rl,Sa,Ta,this.options&&this.options.postProcessPassResolved?_objectSpread$2$1({i18nResolved:xa},Aa):Aa,this)),Sa}},{key:"resolve",value:function(Sa){var Ta=this,Aa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xa,wa,ka,La,tl;return typeof Sa=="string"&&(Sa=[Sa]),Sa.forEach(function(el){if(!Ta.isValidLookup(xa)){var nl=Ta.extractFromKey(el,Aa),il=nl.key;wa=il;var sl=nl.namespaces;Ta.options.fallbackNS&&(sl=sl.concat(Ta.options.fallbackNS));var al=Aa.count!==void 0&&typeof Aa.count!="string",rl=al&&!Aa.ordinal&&Aa.count===0&&Ta.pluralResolver.shouldUseIntlApi(),ll=Aa.context!==void 0&&(typeof Aa.context=="string"||typeof Aa.context=="number")&&Aa.context!=="",cl=Aa.lngs?Aa.lngs:Ta.languageUtils.toResolveHierarchy(Aa.lng||Ta.language,Aa.fallbackLng);sl.forEach(function(dl){Ta.isValidLookup(xa)||(tl=dl,!checkedLoadedFor["".concat(cl[0],"-").concat(dl)]&&Ta.utils&&Ta.utils.hasLoadedNamespace&&!Ta.utils.hasLoadedNamespace(tl)&&(checkedLoadedFor["".concat(cl[0],"-").concat(dl)]=!0,Ta.logger.warn('key "'.concat(wa,'" for languages "').concat(cl.join(", "),`" won't get resolved as namespace "`).concat(tl,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),cl.forEach(function(pl){if(!Ta.isValidLookup(xa)){La=pl;var bl=[il];if(Ta.i18nFormat&&Ta.i18nFormat.addLookupKeys)Ta.i18nFormat.addLookupKeys(bl,il,pl,dl,Aa);else{var Ul;al&&(Ul=Ta.pluralResolver.getSuffix(pl,Aa.count,Aa));var fl="".concat(Ta.options.pluralSeparator,"zero");if(al&&(bl.push(il+Ul),rl&&bl.push(il+fl)),ll){var Wl="".concat(il).concat(Ta.options.contextSeparator).concat(Aa.context);bl.push(Wl),al&&(bl.push(Wl+Ul),rl&&bl.push(Wl+fl))}}for(var xl;xl=bl.pop();)Ta.isValidLookup(xa)||(ka=xl,xa=Ta.getResource(pl,dl,xl,Aa))}}))})}}),{res:xa,usedKey:wa,exactUsedKey:ka,usedLng:La,usedNS:tl}}},{key:"isValidLookup",value:function(Sa){return Sa!==void 0&&!(!this.options.returnNull&&Sa===null)&&!(!this.options.returnEmptyString&&Sa==="")}},{key:"getResource",value:function(Sa,Ta,Aa){var xa=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(Sa,Ta,Aa,xa):this.resourceStore.getResource(Sa,Ta,Aa,xa)}}],[{key:"hasDefaultValue",value:function(Sa){var Ta="defaultValue";for(var Aa in Sa)if(Object.prototype.hasOwnProperty.call(Sa,Aa)&&Ta===Aa.substring(0,Ta.length)&&Sa[Aa]!==void 0)return!0;return!1}}]),ba}(EventEmitter$7);function capitalize(oa){return oa.charAt(0).toUpperCase()+oa.slice(1)}var LanguageUtil=function(){function oa(aa){_classCallCheck$m(this,oa),this.options=aa,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}return _createClass$l(oa,[{key:"getScriptPartFromCode",value:function(ba){if(!ba||ba.indexOf("-")<0)return null;var Ea=ba.split("-");return Ea.length===2||(Ea.pop(),Ea[Ea.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(Ea.join("-"))}},{key:"getLanguagePartFromCode",value:function(ba){if(!ba||ba.indexOf("-")<0)return ba;var Ea=ba.split("-");return this.formatLanguageCode(Ea[0])}},{key:"formatLanguageCode",value:function(ba){if(typeof ba=="string"&&ba.indexOf("-")>-1){var Ea=["hans","hant","latn","cyrl","cans","mong","arab"],Sa=ba.split("-");return this.options.lowerCaseLng?Sa=Sa.map(function(Ta){return Ta.toLowerCase()}):Sa.length===2?(Sa[0]=Sa[0].toLowerCase(),Sa[1]=Sa[1].toUpperCase(),Ea.indexOf(Sa[1].toLowerCase())>-1&&(Sa[1]=capitalize(Sa[1].toLowerCase()))):Sa.length===3&&(Sa[0]=Sa[0].toLowerCase(),Sa[1].length===2&&(Sa[1]=Sa[1].toUpperCase()),Sa[0]!=="sgn"&&Sa[2].length===2&&(Sa[2]=Sa[2].toUpperCase()),Ea.indexOf(Sa[1].toLowerCase())>-1&&(Sa[1]=capitalize(Sa[1].toLowerCase())),Ea.indexOf(Sa[2].toLowerCase())>-1&&(Sa[2]=capitalize(Sa[2].toLowerCase()))),Sa.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?ba.toLowerCase():ba}},{key:"isSupportedCode",value:function(ba){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(ba=this.getLanguagePartFromCode(ba)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(ba)>-1}},{key:"getBestMatchFromCodes",value:function(ba){var Ea=this;if(!ba)return null;var Sa;return ba.forEach(function(Ta){if(!Sa){var Aa=Ea.formatLanguageCode(Ta);(!Ea.options.supportedLngs||Ea.isSupportedCode(Aa))&&(Sa=Aa)}}),!Sa&&this.options.supportedLngs&&ba.forEach(function(Ta){if(!Sa){var Aa=Ea.getLanguagePartFromCode(Ta);if(Ea.isSupportedCode(Aa))return Sa=Aa;Sa=Ea.options.supportedLngs.find(function(xa){if(xa.indexOf(Aa)===0)return xa})}}),Sa||(Sa=this.getFallbackCodes(this.options.fallbackLng)[0]),Sa}},{key:"getFallbackCodes",value:function(ba,Ea){if(!ba)return[];if(typeof ba=="function"&&(ba=ba(Ea)),typeof ba=="string"&&(ba=[ba]),Object.prototype.toString.apply(ba)==="[object Array]")return ba;if(!Ea)return ba.default||[];var Sa=ba[Ea];return Sa||(Sa=ba[this.getScriptPartFromCode(Ea)]),Sa||(Sa=ba[this.formatLanguageCode(Ea)]),Sa||(Sa=ba[this.getLanguagePartFromCode(Ea)]),Sa||(Sa=ba.default),Sa||[]}},{key:"toResolveHierarchy",value:function(ba,Ea){var Sa=this,Ta=this.getFallbackCodes(Ea||this.options.fallbackLng||[],ba),Aa=[],xa=function(ka){ka&&(Sa.isSupportedCode(ka)?Aa.push(ka):Sa.logger.warn("rejecting language code not found in supportedLngs: ".concat(ka)))};return typeof ba=="string"&&ba.indexOf("-")>-1?(this.options.load!=="languageOnly"&&xa(this.formatLanguageCode(ba)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&xa(this.getScriptPartFromCode(ba)),this.options.load!=="currentOnly"&&xa(this.getLanguagePartFromCode(ba))):typeof ba=="string"&&xa(this.formatLanguageCode(ba)),Ta.forEach(function(wa){Aa.indexOf(wa)<0&&xa(Sa.formatLanguageCode(wa))}),Aa}}]),oa}(),sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(aa){return+(aa>1)},2:function(aa){return+(aa!=1)},3:function(aa){return 0},4:function(aa){return aa%10==1&&aa%100!=11?0:aa%10>=2&&aa%10<=4&&(aa%100<10||aa%100>=20)?1:2},5:function(aa){return aa==0?0:aa==1?1:aa==2?2:aa%100>=3&&aa%100<=10?3:aa%100>=11?4:5},6:function(aa){return aa==1?0:aa>=2&&aa<=4?1:2},7:function(aa){return aa==1?0:aa%10>=2&&aa%10<=4&&(aa%100<10||aa%100>=20)?1:2},8:function(aa){return aa==1?0:aa==2?1:aa!=8&&aa!=11?2:3},9:function(aa){return+(aa>=2)},10:function(aa){return aa==1?0:aa==2?1:aa<7?2:aa<11?3:4},11:function(aa){return aa==1||aa==11?0:aa==2||aa==12?1:aa>2&&aa<20?2:3},12:function(aa){return+(aa%10!=1||aa%100==11)},13:function(aa){return+(aa!==0)},14:function(aa){return aa==1?0:aa==2?1:aa==3?2:3},15:function(aa){return aa%10==1&&aa%100!=11?0:aa%10>=2&&(aa%100<10||aa%100>=20)?1:2},16:function(aa){return aa%10==1&&aa%100!=11?0:aa!==0?1:2},17:function(aa){return aa==1||aa%10==1&&aa%100!=11?0:1},18:function(aa){return aa==0?0:aa==1?1:2},19:function(aa){return aa==1?0:aa==0||aa%100>1&&aa%100<11?1:aa%100>10&&aa%100<20?2:3},20:function(aa){return aa==1?0:aa==0||aa%100>0&&aa%100<20?1:2},21:function(aa){return aa%100==1?1:aa%100==2?2:aa%100==3||aa%100==4?3:0},22:function(aa){return aa==1?0:aa==2?1:(aa<0||aa>10)&&aa%10==0?2:3}},deprecatedJsonVersions=["v1","v2","v3"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var oa={};return sets.forEach(function(aa){aa.lngs.forEach(function(ba){oa[ba]={numbers:aa.nr,plurals:_rulesPluralsTypes[aa.fc]}})}),oa}var PluralResolver=function(){function oa(aa){var ba=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,oa),this.languageUtils=aa,this.options=ba,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}return _createClass$l(oa,[{key:"addRule",value:function(ba,Ea){this.rules[ba]=Ea}},{key:"getRule",value:function(ba){var Ea=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(ba,{type:Ea.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[ba]||this.rules[this.languageUtils.getLanguagePartFromCode(ba)]}},{key:"needsPlural",value:function(ba){var Ea=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Sa=this.getRule(ba,Ea);return this.shouldUseIntlApi()?Sa&&Sa.resolvedOptions().pluralCategories.length>1:Sa&&Sa.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(ba,Ea){var Sa=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(ba,Sa).map(function(Ta){return"".concat(Ea).concat(Ta)})}},{key:"getSuffixes",value:function(ba){var Ea=this,Sa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ta=this.getRule(ba,Sa);return Ta?this.shouldUseIntlApi()?Ta.resolvedOptions().pluralCategories.sort(function(Aa,xa){return suffixesOrder[Aa]-suffixesOrder[xa]}).map(function(Aa){return"".concat(Ea.options.prepend).concat(Aa)}):Ta.numbers.map(function(Aa){return Ea.getSuffix(ba,Aa,Sa)}):[]}},{key:"getSuffix",value:function(ba,Ea){var Sa=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ta=this.getRule(ba,Sa);return Ta?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(Ta.select(Ea)):this.getSuffixRetroCompatible(Ta,Ea):(this.logger.warn("no plural rule found for: ".concat(ba)),"")}},{key:"getSuffixRetroCompatible",value:function(ba,Ea){var Sa=this,Ta=ba.noAbs?ba.plurals(Ea):ba.plurals(Math.abs(Ea)),Aa=ba.numbers[Ta];this.options.simplifyPluralSuffix&&ba.numbers.length===2&&ba.numbers[0]===1&&(Aa===2?Aa="plural":Aa===1&&(Aa=""));var xa=function(){return Sa.options.prepend&&Aa.toString()?Sa.options.prepend+Aa.toString():Aa.toString()};return this.options.compatibilityJSON==="v1"?Aa===1?"":typeof Aa=="number"?"_plural_".concat(Aa.toString()):xa():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&ba.numbers.length===2&&ba.numbers[0]===1?xa():this.options.prepend&&Ta.toString()?this.options.prepend+Ta.toString():Ta.toString()}},{key:"shouldUseIntlApi",value:function(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]),oa}();function ownKeys$3$1(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$3$1(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$3$1(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$3$1(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}var Interpolator=function(){function oa(){var aa=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$m(this,oa),this.logger=baseLogger.create("interpolator"),this.options=aa,this.format=aa.interpolation&&aa.interpolation.format||function(ba){return ba},this.init(aa)}return _createClass$l(oa,[{key:"init",value:function(){var ba=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ba.interpolation||(ba.interpolation={escapeValue:!0});var Ea=ba.interpolation;this.escape=Ea.escape!==void 0?Ea.escape:escape$1,this.escapeValue=Ea.escapeValue!==void 0?Ea.escapeValue:!0,this.useRawValueToEscape=Ea.useRawValueToEscape!==void 0?Ea.useRawValueToEscape:!1,this.prefix=Ea.prefix?regexEscape(Ea.prefix):Ea.prefixEscaped||"{{",this.suffix=Ea.suffix?regexEscape(Ea.suffix):Ea.suffixEscaped||"}}",this.formatSeparator=Ea.formatSeparator?Ea.formatSeparator:Ea.formatSeparator||",",this.unescapePrefix=Ea.unescapeSuffix?"":Ea.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":Ea.unescapeSuffix||"",this.nestingPrefix=Ea.nestingPrefix?regexEscape(Ea.nestingPrefix):Ea.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=Ea.nestingSuffix?regexEscape(Ea.nestingSuffix):Ea.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=Ea.nestingOptionsSeparator?Ea.nestingOptionsSeparator:Ea.nestingOptionsSeparator||",",this.maxReplaces=Ea.maxReplaces?Ea.maxReplaces:1e3,this.alwaysFormat=Ea.alwaysFormat!==void 0?Ea.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var ba="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(ba,"g");var Ea="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(Ea,"g");var Sa="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(Sa,"g")}},{key:"interpolate",value:function(ba,Ea,Sa,Ta){var Aa=this,xa,wa,ka,La=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function tl(al){return al.replace(/\$/g,"$$$$")}var el=function(rl){if(rl.indexOf(Aa.formatSeparator)<0){var ll=getPathWithDefaults(Ea,La,rl);return Aa.alwaysFormat?Aa.format(ll,void 0,Sa,_objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({},Ta),Ea),{},{interpolationkey:rl})):ll}var cl=rl.split(Aa.formatSeparator),dl=cl.shift().trim(),pl=cl.join(Aa.formatSeparator).trim();return Aa.format(getPathWithDefaults(Ea,La,dl),pl,Sa,_objectSpread$3$1(_objectSpread$3$1(_objectSpread$3$1({},Ta),Ea),{},{interpolationkey:dl}))};this.resetRegExp();var nl=Ta&&Ta.missingInterpolationHandler||this.options.missingInterpolationHandler,il=Ta&&Ta.interpolation&&Ta.interpolation.skipOnVariables!==void 0?Ta.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,sl=[{regex:this.regexpUnescape,safeValue:function(rl){return tl(rl)}},{regex:this.regexp,safeValue:function(rl){return Aa.escapeValue?tl(Aa.escape(rl)):tl(rl)}}];return sl.forEach(function(al){for(ka=0;xa=al.regex.exec(ba);){var rl=xa[1].trim();if(wa=el(rl),wa===void 0)if(typeof nl=="function"){var ll=nl(ba,xa,Ta);wa=typeof ll=="string"?ll:""}else if(Ta&&Ta.hasOwnProperty(rl))wa="";else if(il){wa=xa[0];continue}else Aa.logger.warn("missed to pass in variable ".concat(rl," for interpolating ").concat(ba)),wa="";else typeof wa!="string"&&!Aa.useRawValueToEscape&&(wa=makeString(wa));var cl=al.safeValue(wa);if(ba=ba.replace(xa[0],cl),il?(al.regex.lastIndex+=wa.length,al.regex.lastIndex-=xa[0].length):al.regex.lastIndex=0,ka++,ka>=Aa.maxReplaces)break}}),ba}},{key:"nest",value:function(ba,Ea){var Sa=this,Ta=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Aa,xa,wa=_objectSpread$3$1({},Ta);wa.applyPostProcessor=!1,delete wa.defaultValue;function ka(nl,il){var sl=this.nestingOptionsSeparator;if(nl.indexOf(sl)<0)return nl;var al=nl.split(new RegExp("".concat(sl,"[ ]*{"))),rl="{".concat(al[1]);nl=al[0],rl=this.interpolate(rl,wa);var ll=rl.match(/'/g),cl=rl.match(/"/g);(ll&&ll.length%2===0&&!cl||cl.length%2!==0)&&(rl=rl.replace(/'/g,'"'));try{wa=JSON.parse(rl),il&&(wa=_objectSpread$3$1(_objectSpread$3$1({},il),wa))}catch(dl){return this.logger.warn("failed parsing options string in nesting for key ".concat(nl),dl),"".concat(nl).concat(sl).concat(rl)}return delete wa.defaultValue,nl}for(;Aa=this.nestingRegexp.exec(ba);){var La=[],tl=!1;if(Aa[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(Aa[1])){var el=Aa[1].split(this.formatSeparator).map(function(nl){return nl.trim()});Aa[1]=el.shift(),La=el,tl=!0}if(xa=Ea(ka.call(this,Aa[1].trim(),wa),wa),xa&&Aa[0]===ba&&typeof xa!="string")return xa;typeof xa!="string"&&(xa=makeString(xa)),xa||(this.logger.warn("missed to resolve ".concat(Aa[1]," for nesting ").concat(ba)),xa=""),tl&&(xa=La.reduce(function(nl,il){return Sa.format(nl,il,Ta.lng,_objectSpread$3$1(_objectSpread$3$1({},Ta),{},{interpolationkey:Aa[1].trim()}))},xa.trim())),ba=ba.replace(Aa[0],xa),this.regexp.lastIndex=0}return ba}}]),oa}();function ownKeys$4$1(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$4$1(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$4$1(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$4$1(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}function parseFormatStr(oa){var aa=oa.toLowerCase().trim(),ba={};if(oa.indexOf("(")>-1){var Ea=oa.split("(");aa=Ea[0].toLowerCase().trim();var Sa=Ea[1].substring(0,Ea[1].length-1);if(aa==="currency"&&Sa.indexOf(":")<0)ba.currency||(ba.currency=Sa.trim());else if(aa==="relativetime"&&Sa.indexOf(":")<0)ba.range||(ba.range=Sa.trim());else{var Ta=Sa.split(";");Ta.forEach(function(Aa){if(Aa){var xa=Aa.split(":"),wa=_toArray(xa),ka=wa[0],La=wa.slice(1),tl=La.join(":").trim().replace(/^'+|'+$/g,"");ba[ka.trim()]||(ba[ka.trim()]=tl),tl==="false"&&(ba[ka.trim()]=!1),tl==="true"&&(ba[ka.trim()]=!0),isNaN(tl)||(ba[ka.trim()]=parseInt(tl,10))}})}}return{formatName:aa,formatOptions:ba}}function createCachedFormatter(oa){var aa={};return function(Ea,Sa,Ta){var Aa=Sa+JSON.stringify(Ta),xa=aa[Aa];return xa||(xa=oa(Sa,Ta),aa[Aa]=xa),xa(Ea)}}var Formatter$1=function(){function oa(){var aa=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_classCallCheck$m(this,oa),this.logger=baseLogger.create("formatter"),this.options=aa,this.formats={number:createCachedFormatter(function(ba,Ea){var Sa=new Intl.NumberFormat(ba,Ea);return function(Ta){return Sa.format(Ta)}}),currency:createCachedFormatter(function(ba,Ea){var Sa=new Intl.NumberFormat(ba,_objectSpread$4$1(_objectSpread$4$1({},Ea),{},{style:"currency"}));return function(Ta){return Sa.format(Ta)}}),datetime:createCachedFormatter(function(ba,Ea){var Sa=new Intl.DateTimeFormat(ba,_objectSpread$4$1({},Ea));return function(Ta){return Sa.format(Ta)}}),relativetime:createCachedFormatter(function(ba,Ea){var Sa=new Intl.RelativeTimeFormat(ba,_objectSpread$4$1({},Ea));return function(Ta){return Sa.format(Ta,Ea.range||"day")}}),list:createCachedFormatter(function(ba,Ea){var Sa=new Intl.ListFormat(ba,_objectSpread$4$1({},Ea));return function(Ta){return Sa.format(Ta)}})},this.init(aa)}return _createClass$l(oa,[{key:"init",value:function(ba){var Ea=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},Sa=Ea.interpolation;this.formatSeparator=Sa.formatSeparator?Sa.formatSeparator:Sa.formatSeparator||","}},{key:"add",value:function(ba,Ea){this.formats[ba.toLowerCase().trim()]=Ea}},{key:"addCached",value:function(ba,Ea){this.formats[ba.toLowerCase().trim()]=createCachedFormatter(Ea)}},{key:"format",value:function(ba,Ea,Sa,Ta){var Aa=this,xa=Ea.split(this.formatSeparator),wa=xa.reduce(function(ka,La){var tl=parseFormatStr(La),el=tl.formatName,nl=tl.formatOptions;if(Aa.formats[el]){var il=ka;try{var sl=Ta&&Ta.formatParams&&Ta.formatParams[Ta.interpolationkey]||{},al=sl.locale||sl.lng||Ta.locale||Ta.lng||Sa;il=Aa.formats[el](ka,al,_objectSpread$4$1(_objectSpread$4$1(_objectSpread$4$1({},nl),Ta),sl))}catch(rl){Aa.logger.warn(rl)}return il}else Aa.logger.warn("there was no format function for ".concat(el));return ka},ba);return wa}}]),oa}();function ownKeys$5$1(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$5$1(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$5$1(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$5$1(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}function _createSuper$2(oa){var aa=_isNativeReflectConstruct$2();return function(){var Ea=_getPrototypeOf$1(oa),Sa;if(aa){var Ta=_getPrototypeOf$1(this).constructor;Sa=Reflect.construct(Ea,arguments,Ta)}else Sa=Ea.apply(this,arguments);return _possibleConstructorReturn$c(this,Sa)}}function _isNativeReflectConstruct$2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function removePending(oa,aa){oa.pending[aa]!==void 0&&(delete oa.pending[aa],oa.pendingCount--)}var Connector=function(oa){_inherits$c(ba,oa);var aa=_createSuper$2(ba);function ba(Ea,Sa,Ta){var Aa,xa=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return _classCallCheck$m(this,ba),Aa=aa.call(this),isIE10&&EventEmitter$7.call(_assertThisInitialized$1(Aa)),Aa.backend=Ea,Aa.store=Sa,Aa.services=Ta,Aa.languageUtils=Ta.languageUtils,Aa.options=xa,Aa.logger=baseLogger.create("backendConnector"),Aa.waitingReads=[],Aa.maxParallelReads=xa.maxParallelReads||10,Aa.readingCalls=0,Aa.maxRetries=xa.maxRetries>=0?xa.maxRetries:5,Aa.retryTimeout=xa.retryTimeout>=1?xa.retryTimeout:350,Aa.state={},Aa.queue=[],Aa.backend&&Aa.backend.init&&Aa.backend.init(Ta,xa.backend,xa),Aa}return _createClass$l(ba,[{key:"queueLoad",value:function(Sa,Ta,Aa,xa){var wa=this,ka={},La={},tl={},el={};return Sa.forEach(function(nl){var il=!0;Ta.forEach(function(sl){var al="".concat(nl,"|").concat(sl);!Aa.reload&&wa.store.hasResourceBundle(nl,sl)?wa.state[al]=2:wa.state[al]<0||(wa.state[al]===1?La[al]===void 0&&(La[al]=!0):(wa.state[al]=1,il=!1,La[al]===void 0&&(La[al]=!0),ka[al]===void 0&&(ka[al]=!0),el[sl]===void 0&&(el[sl]=!0)))}),il||(tl[nl]=!0)}),(Object.keys(ka).length||Object.keys(La).length)&&this.queue.push({pending:La,pendingCount:Object.keys(La).length,loaded:{},errors:[],callback:xa}),{toLoad:Object.keys(ka),pending:Object.keys(La),toLoadLanguages:Object.keys(tl),toLoadNamespaces:Object.keys(el)}}},{key:"loaded",value:function(Sa,Ta,Aa){var xa=Sa.split("|"),wa=xa[0],ka=xa[1];Ta&&this.emit("failedLoading",wa,ka,Ta),Aa&&this.store.addResourceBundle(wa,ka,Aa),this.state[Sa]=Ta?-1:2;var La={};this.queue.forEach(function(tl){pushPath(tl.loaded,[wa],ka),removePending(tl,Sa),Ta&&tl.errors.push(Ta),tl.pendingCount===0&&!tl.done&&(Object.keys(tl.loaded).forEach(function(el){La[el]||(La[el]={});var nl=tl.loaded[el];nl.length&&nl.forEach(function(il){La[el][il]===void 0&&(La[el][il]=!0)})}),tl.done=!0,tl.errors.length?tl.callback(tl.errors):tl.callback())}),this.emit("loaded",La),this.queue=this.queue.filter(function(tl){return!tl.done})}},{key:"read",value:function(Sa,Ta,Aa){var xa=this,wa=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,ka=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,La=arguments.length>5?arguments[5]:void 0;if(!Sa.length)return La(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:Sa,ns:Ta,fcName:Aa,tried:wa,wait:ka,callback:La});return}return this.readingCalls++,this.backend[Aa](Sa,Ta,function(tl,el){if(xa.readingCalls--,xa.waitingReads.length>0){var nl=xa.waitingReads.shift();xa.read(nl.lng,nl.ns,nl.fcName,nl.tried,nl.wait,nl.callback)}if(tl&&el&&wa<xa.maxRetries){setTimeout(function(){xa.read.call(xa,Sa,Ta,Aa,wa+1,ka*2,La)},ka);return}La(tl,el)})}},{key:"prepareLoading",value:function(Sa,Ta){var Aa=this,xa=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},wa=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),wa&&wa();typeof Sa=="string"&&(Sa=this.languageUtils.toResolveHierarchy(Sa)),typeof Ta=="string"&&(Ta=[Ta]);var ka=this.queueLoad(Sa,Ta,xa,wa);if(!ka.toLoad.length)return ka.pending.length||wa(),null;ka.toLoad.forEach(function(La){Aa.loadOne(La)})}},{key:"load",value:function(Sa,Ta,Aa){this.prepareLoading(Sa,Ta,{},Aa)}},{key:"reload",value:function(Sa,Ta,Aa){this.prepareLoading(Sa,Ta,{reload:!0},Aa)}},{key:"loadOne",value:function(Sa){var Ta=this,Aa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",xa=Sa.split("|"),wa=xa[0],ka=xa[1];this.read(wa,ka,"read",void 0,void 0,function(La,tl){La&&Ta.logger.warn("".concat(Aa,"loading namespace ").concat(ka," for language ").concat(wa," failed"),La),!La&&tl&&Ta.logger.log("".concat(Aa,"loaded namespace ").concat(ka," for language ").concat(wa),tl),Ta.loaded(Sa,La,tl)})}},{key:"saveMissing",value:function(Sa,Ta,Aa,xa,wa){var ka=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(Ta)){this.logger.warn('did not save key "'.concat(Aa,'" as the namespace "').concat(Ta,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}Aa==null||Aa===""||(this.backend&&this.backend.create&&this.backend.create(Sa,Ta,Aa,xa,null,_objectSpread$5$1(_objectSpread$5$1({},ka),{},{isUpdate:wa})),!(!Sa||!Sa[0])&&this.store.addResource(Sa[0],Ta,Aa,xa))}}]),ba}(EventEmitter$7);function get$1(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(aa){var ba={};if(_typeof$a(aa[1])==="object"&&(ba=aa[1]),typeof aa[1]=="string"&&(ba.defaultValue=aa[1]),typeof aa[2]=="string"&&(ba.tDescription=aa[2]),_typeof$a(aa[2])==="object"||_typeof$a(aa[3])==="object"){var Ea=aa[3]||aa[2];Object.keys(Ea).forEach(function(Sa){ba[Sa]=Ea[Sa]})}return ba},interpolation:{escapeValue:!0,format:function(aa,ba,Ea,Sa){return aa},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(oa){return typeof oa.ns=="string"&&(oa.ns=[oa.ns]),typeof oa.fallbackLng=="string"&&(oa.fallbackLng=[oa.fallbackLng]),typeof oa.fallbackNS=="string"&&(oa.fallbackNS=[oa.fallbackNS]),oa.supportedLngs&&oa.supportedLngs.indexOf("cimode")<0&&(oa.supportedLngs=oa.supportedLngs.concat(["cimode"])),oa}function ownKeys$6$1(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$6$1(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$6$1(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$6$1(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}function _createSuper$3(oa){var aa=_isNativeReflectConstruct$3();return function(){var Ea=_getPrototypeOf$1(oa),Sa;if(aa){var Ta=_getPrototypeOf$1(this).constructor;Sa=Reflect.construct(Ea,arguments,Ta)}else Sa=Ea.apply(this,arguments);return _possibleConstructorReturn$c(this,Sa)}}function _isNativeReflectConstruct$3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function noop$1(){}function bindMemberFunctions(oa){var aa=Object.getOwnPropertyNames(Object.getPrototypeOf(oa));aa.forEach(function(ba){typeof oa[ba]=="function"&&(oa[ba]=oa[ba].bind(oa))})}var I18n=function(oa){_inherits$c(ba,oa);var aa=_createSuper$3(ba);function ba(){var Ea,Sa=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ta=arguments.length>1?arguments[1]:void 0;if(_classCallCheck$m(this,ba),Ea=aa.call(this),isIE10&&EventEmitter$7.call(_assertThisInitialized$1(Ea)),Ea.options=transformOptions(Sa),Ea.services={},Ea.logger=baseLogger,Ea.modules={external:[]},bindMemberFunctions(_assertThisInitialized$1(Ea)),Ta&&!Ea.isInitialized&&!Sa.isClone){if(!Ea.options.initImmediate)return Ea.init(Sa,Ta),_possibleConstructorReturn$c(Ea,_assertThisInitialized$1(Ea));setTimeout(function(){Ea.init(Sa,Ta)},0)}return Ea}return _createClass$l(ba,[{key:"init",value:function(){var Sa=this,Ta=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Aa=arguments.length>1?arguments[1]:void 0;typeof Ta=="function"&&(Aa=Ta,Ta={}),!Ta.defaultNS&&Ta.defaultNS!==!1&&Ta.ns&&(typeof Ta.ns=="string"?Ta.defaultNS=Ta.ns:Ta.ns.indexOf("translation")<0&&(Ta.defaultNS=Ta.ns[0]));var xa=get$1();this.options=_objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({},xa),this.options),transformOptions(Ta)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=_objectSpread$6$1(_objectSpread$6$1({},xa.interpolation),this.options.interpolation)),Ta.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=Ta.keySeparator),Ta.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=Ta.nsSeparator);function wa(rl){return rl?typeof rl=="function"?new rl:rl:null}if(!this.options.isClone){this.modules.logger?baseLogger.init(wa(this.modules.logger),this.options):baseLogger.init(null,this.options);var ka;this.modules.formatter?ka=this.modules.formatter:typeof Intl<"u"&&(ka=Formatter$1);var La=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var tl=this.services;tl.logger=baseLogger,tl.resourceStore=this.store,tl.languageUtils=La,tl.pluralResolver=new PluralResolver(La,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),ka&&(!this.options.interpolation.format||this.options.interpolation.format===xa.interpolation.format)&&(tl.formatter=wa(ka),tl.formatter.init(tl,this.options),this.options.interpolation.format=tl.formatter.format.bind(tl.formatter)),tl.interpolator=new Interpolator(this.options),tl.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},tl.backendConnector=new Connector(wa(this.modules.backend),tl.resourceStore,tl,this.options),tl.backendConnector.on("*",function(rl){for(var ll=arguments.length,cl=new Array(ll>1?ll-1:0),dl=1;dl<ll;dl++)cl[dl-1]=arguments[dl];Sa.emit.apply(Sa,[rl].concat(cl))}),this.modules.languageDetector&&(tl.languageDetector=wa(this.modules.languageDetector),tl.languageDetector.init(tl,this.options.detection,this.options)),this.modules.i18nFormat&&(tl.i18nFormat=wa(this.modules.i18nFormat),tl.i18nFormat.init&&tl.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(rl){for(var ll=arguments.length,cl=new Array(ll>1?ll-1:0),dl=1;dl<ll;dl++)cl[dl-1]=arguments[dl];Sa.emit.apply(Sa,[rl].concat(cl))}),this.modules.external.forEach(function(rl){rl.init&&rl.init(Sa)})}if(this.format=this.options.interpolation.format,Aa||(Aa=noop$1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var el=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);el.length>0&&el[0]!=="dev"&&(this.options.lng=el[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var nl=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];nl.forEach(function(rl){Sa[rl]=function(){var ll;return(ll=Sa.store)[rl].apply(ll,arguments)}});var il=["addResource","addResources","addResourceBundle","removeResourceBundle"];il.forEach(function(rl){Sa[rl]=function(){var ll;return(ll=Sa.store)[rl].apply(ll,arguments),Sa}});var sl=defer(),al=function(){var ll=function(dl,pl){Sa.isInitialized&&!Sa.initializedStoreOnce&&Sa.logger.warn("init: i18next is already initialized. You should call init just once!"),Sa.isInitialized=!0,Sa.options.isClone||Sa.logger.log("initialized",Sa.options),Sa.emit("initialized",Sa.options),sl.resolve(pl),Aa(dl,pl)};if(Sa.languages&&Sa.options.compatibilityAPI!=="v1"&&!Sa.isInitialized)return ll(null,Sa.t.bind(Sa));Sa.changeLanguage(Sa.options.lng,ll)};return this.options.resources||!this.options.initImmediate?al():setTimeout(al,0),sl}},{key:"loadResources",value:function(Sa){var Ta=this,Aa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$1,xa=Aa,wa=typeof Sa=="string"?Sa:this.language;if(typeof Sa=="function"&&(xa=Sa),!this.options.resources||this.options.partialBundledLanguages){if(wa&&wa.toLowerCase()==="cimode")return xa();var ka=[],La=function(nl){if(nl){var il=Ta.services.languageUtils.toResolveHierarchy(nl);il.forEach(function(sl){ka.indexOf(sl)<0&&ka.push(sl)})}};if(wa)La(wa);else{var tl=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);tl.forEach(function(el){return La(el)})}this.options.preload&&this.options.preload.forEach(function(el){return La(el)}),this.services.backendConnector.load(ka,this.options.ns,function(el){!el&&!Ta.resolvedLanguage&&Ta.language&&Ta.setResolvedLanguage(Ta.language),xa(el)})}else xa(null)}},{key:"reloadResources",value:function(Sa,Ta,Aa){var xa=defer();return Sa||(Sa=this.languages),Ta||(Ta=this.options.ns),Aa||(Aa=noop$1),this.services.backendConnector.reload(Sa,Ta,function(wa){xa.resolve(),Aa(wa)}),xa}},{key:"use",value:function(Sa){if(!Sa)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!Sa.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return Sa.type==="backend"&&(this.modules.backend=Sa),(Sa.type==="logger"||Sa.log&&Sa.warn&&Sa.error)&&(this.modules.logger=Sa),Sa.type==="languageDetector"&&(this.modules.languageDetector=Sa),Sa.type==="i18nFormat"&&(this.modules.i18nFormat=Sa),Sa.type==="postProcessor"&&postProcessor.addPostProcessor(Sa),Sa.type==="formatter"&&(this.modules.formatter=Sa),Sa.type==="3rdParty"&&this.modules.external.push(Sa),this}},{key:"setResolvedLanguage",value:function(Sa){if(!(!Sa||!this.languages)&&!(["cimode","dev"].indexOf(Sa)>-1))for(var Ta=0;Ta<this.languages.length;Ta++){var Aa=this.languages[Ta];if(!(["cimode","dev"].indexOf(Aa)>-1)&&this.store.hasLanguageSomeTranslations(Aa)){this.resolvedLanguage=Aa;break}}}},{key:"changeLanguage",value:function(Sa,Ta){var Aa=this;this.isLanguageChangingTo=Sa;var xa=defer();this.emit("languageChanging",Sa);var wa=function(el){Aa.language=el,Aa.languages=Aa.services.languageUtils.toResolveHierarchy(el),Aa.resolvedLanguage=void 0,Aa.setResolvedLanguage(el)},ka=function(el,nl){nl?(wa(nl),Aa.translator.changeLanguage(nl),Aa.isLanguageChangingTo=void 0,Aa.emit("languageChanged",nl),Aa.logger.log("languageChanged",nl)):Aa.isLanguageChangingTo=void 0,xa.resolve(function(){return Aa.t.apply(Aa,arguments)}),Ta&&Ta(el,function(){return Aa.t.apply(Aa,arguments)})},La=function(el){!Sa&&!el&&Aa.services.languageDetector&&(el=[]);var nl=typeof el=="string"?el:Aa.services.languageUtils.getBestMatchFromCodes(el);nl&&(Aa.language||wa(nl),Aa.translator.language||Aa.translator.changeLanguage(nl),Aa.services.languageDetector&&Aa.services.languageDetector.cacheUserLanguage(nl)),Aa.loadResources(nl,function(il){ka(il,nl)})};return!Sa&&this.services.languageDetector&&!this.services.languageDetector.async?La(this.services.languageDetector.detect()):!Sa&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(La):La(Sa),xa}},{key:"getFixedT",value:function(Sa,Ta,Aa){var xa=this,wa=function ka(La,tl){var el;if(_typeof$a(tl)!=="object"){for(var nl=arguments.length,il=new Array(nl>2?nl-2:0),sl=2;sl<nl;sl++)il[sl-2]=arguments[sl];el=xa.options.overloadTranslationOptionHandler([La,tl].concat(il))}else el=_objectSpread$6$1({},tl);el.lng=el.lng||ka.lng,el.lngs=el.lngs||ka.lngs,el.ns=el.ns||ka.ns,el.keyPrefix=el.keyPrefix||Aa||ka.keyPrefix;var al=xa.options.keySeparator||".",rl=el.keyPrefix?"".concat(el.keyPrefix).concat(al).concat(La):La;return xa.t(rl,el)};return typeof Sa=="string"?wa.lng=Sa:wa.lngs=Sa,wa.ns=Ta,wa.keyPrefix=Aa,wa}},{key:"t",value:function(){var Sa;return this.translator&&(Sa=this.translator).translate.apply(Sa,arguments)}},{key:"exists",value:function(){var Sa;return this.translator&&(Sa=this.translator).exists.apply(Sa,arguments)}},{key:"setDefaultNamespace",value:function(Sa){this.options.defaultNS=Sa}},{key:"hasLoadedNamespace",value:function(Sa){var Ta=this,Aa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var xa=this.resolvedLanguage||this.languages[0],wa=this.options?this.options.fallbackLng:!1,ka=this.languages[this.languages.length-1];if(xa.toLowerCase()==="cimode")return!0;var La=function(nl,il){var sl=Ta.services.backendConnector.state["".concat(nl,"|").concat(il)];return sl===-1||sl===2};if(Aa.precheck){var tl=Aa.precheck(this,La);if(tl!==void 0)return tl}return!!(this.hasResourceBundle(xa,Sa)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||La(xa,Sa)&&(!wa||La(ka,Sa)))}},{key:"loadNamespaces",value:function(Sa,Ta){var Aa=this,xa=defer();return this.options.ns?(typeof Sa=="string"&&(Sa=[Sa]),Sa.forEach(function(wa){Aa.options.ns.indexOf(wa)<0&&Aa.options.ns.push(wa)}),this.loadResources(function(wa){xa.resolve(),Ta&&Ta(wa)}),xa):(Ta&&Ta(),Promise.resolve())}},{key:"loadLanguages",value:function(Sa,Ta){var Aa=defer();typeof Sa=="string"&&(Sa=[Sa]);var xa=this.options.preload||[],wa=Sa.filter(function(ka){return xa.indexOf(ka)<0});return wa.length?(this.options.preload=xa.concat(wa),this.loadResources(function(ka){Aa.resolve(),Ta&&Ta(ka)}),Aa):(Ta&&Ta(),Promise.resolve())}},{key:"dir",value:function(Sa){if(Sa||(Sa=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!Sa)return"rtl";var Ta=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return Ta.indexOf(this.services.languageUtils.getLanguagePartFromCode(Sa))>-1||Sa.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var Sa=this,Ta=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Aa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$1,xa=_objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({},this.options),Ta),{isClone:!0}),wa=new ba(xa);(Ta.debug!==void 0||Ta.prefix!==void 0)&&(wa.logger=wa.logger.clone(Ta));var ka=["store","services","language"];return ka.forEach(function(La){wa[La]=Sa[La]}),wa.services=_objectSpread$6$1({},this.services),wa.services.utils={hasLoadedNamespace:wa.hasLoadedNamespace.bind(wa)},wa.translator=new Translator(wa.services,wa.options),wa.translator.on("*",function(La){for(var tl=arguments.length,el=new Array(tl>1?tl-1:0),nl=1;nl<tl;nl++)el[nl-1]=arguments[nl];wa.emit.apply(wa,[La].concat(el))}),wa.init(xa,Aa),wa.translator.options=wa.options,wa.translator.backendConnector.services.utils={hasLoadedNamespace:wa.hasLoadedNamespace.bind(wa)},wa}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),ba}(EventEmitter$7);_defineProperty$6(I18n,"createInstance",function(){var oa=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},aa=arguments.length>1?arguments[1]:void 0;return new I18n(oa,aa)});var instance=I18n.createInstance();instance.createInstance=I18n.createInstance,instance.createInstance,instance.init,instance.loadResources,instance.reloadResources,instance.use,instance.changeLanguage,instance.getFixedT,instance.t,instance.exists,instance.setDefaultNamespace,instance.hasLoadedNamespace,instance.loadNamespaces,instance.loadLanguages;function _typeof$9(oa){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(aa){return typeof aa}:function(aa){return aa&&typeof Symbol=="function"&&aa.constructor===Symbol&&aa!==Symbol.prototype?"symbol":typeof aa},_typeof$9(oa)}var arr$1=[],each$1=arr$1.forEach,slice$1=arr$1.slice;function defaults$6(oa){return each$1.call(slice$1.call(arguments,1),function(aa){if(aa)for(var ba in aa)oa[ba]===void 0&&(oa[ba]=aa[ba])}),oa}function hasXMLHttpRequest(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":_typeof$9(XMLHttpRequest))==="object"}function isPromise(oa){return!!oa&&typeof oa.then=="function"}function makePromise(oa){return isPromise(oa)?oa:Promise.resolve(oa)}function commonjsRequire(oa){throw new Error('Could not dynamically require "'+oa+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var getFetch$1={exports:{}},browserPonyfill={exports:{}},hasRequiredBrowserPonyfill;function requireBrowserPonyfill(){return hasRequiredBrowserPonyfill||(hasRequiredBrowserPonyfill=1,function(oa,aa){var ba=typeof self<"u"?self:commonjsGlobal,Ea=function(){function Ta(){this.fetch=!1,this.DOMException=ba.DOMException}return Ta.prototype=ba,new Ta}();(function(Ta){(function(Aa){var xa={searchParams:"URLSearchParams"in Ta,iterable:"Symbol"in Ta&&"iterator"in Symbol,blob:"FileReader"in Ta&&"Blob"in Ta&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Ta,arrayBuffer:"ArrayBuffer"in Ta};function wa(ml){return ml&&DataView.prototype.isPrototypeOf(ml)}if(xa.arrayBuffer)var ka=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],La=ArrayBuffer.isView||function(ml){return ml&&ka.indexOf(Object.prototype.toString.call(ml))>-1};function tl(ml){if(typeof ml!="string"&&(ml=String(ml)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(ml))throw new TypeError("Invalid character in header field name");return ml.toLowerCase()}function el(ml){return typeof ml!="string"&&(ml=String(ml)),ml}function nl(ml){var yl={next:function(){var Nl=ml.shift();return{done:Nl===void 0,value:Nl}}};return xa.iterable&&(yl[Symbol.iterator]=function(){return yl}),yl}function il(ml){this.map={},ml instanceof il?ml.forEach(function(yl,Nl){this.append(Nl,yl)},this):Array.isArray(ml)?ml.forEach(function(yl){this.append(yl[0],yl[1])},this):ml&&Object.getOwnPropertyNames(ml).forEach(function(yl){this.append(yl,ml[yl])},this)}il.prototype.append=function(ml,yl){ml=tl(ml),yl=el(yl);var Nl=this.map[ml];this.map[ml]=Nl?Nl+", "+yl:yl},il.prototype.delete=function(ml){delete this.map[tl(ml)]},il.prototype.get=function(ml){return ml=tl(ml),this.has(ml)?this.map[ml]:null},il.prototype.has=function(ml){return this.map.hasOwnProperty(tl(ml))},il.prototype.set=function(ml,yl){this.map[tl(ml)]=el(yl)},il.prototype.forEach=function(ml,yl){for(var Nl in this.map)this.map.hasOwnProperty(Nl)&&ml.call(yl,this.map[Nl],Nl,this)},il.prototype.keys=function(){var ml=[];return this.forEach(function(yl,Nl){ml.push(Nl)}),nl(ml)},il.prototype.values=function(){var ml=[];return this.forEach(function(yl){ml.push(yl)}),nl(ml)},il.prototype.entries=function(){var ml=[];return this.forEach(function(yl,Nl){ml.push([Nl,yl])}),nl(ml)},xa.iterable&&(il.prototype[Symbol.iterator]=il.prototype.entries);function sl(ml){if(ml.bodyUsed)return Promise.reject(new TypeError("Already read"));ml.bodyUsed=!0}function al(ml){return new Promise(function(yl,Nl){ml.onload=function(){yl(ml.result)},ml.onerror=function(){Nl(ml.error)}})}function rl(ml){var yl=new FileReader,Nl=al(yl);return yl.readAsArrayBuffer(ml),Nl}function ll(ml){var yl=new FileReader,Nl=al(yl);return yl.readAsText(ml),Nl}function cl(ml){for(var yl=new Uint8Array(ml),Nl=new Array(yl.length),Fl=0;Fl<yl.length;Fl++)Nl[Fl]=String.fromCharCode(yl[Fl]);return Nl.join("")}function dl(ml){if(ml.slice)return ml.slice(0);var yl=new Uint8Array(ml.byteLength);return yl.set(new Uint8Array(ml)),yl.buffer}function pl(){return this.bodyUsed=!1,this._initBody=function(ml){this._bodyInit=ml,ml?typeof ml=="string"?this._bodyText=ml:xa.blob&&Blob.prototype.isPrototypeOf(ml)?this._bodyBlob=ml:xa.formData&&FormData.prototype.isPrototypeOf(ml)?this._bodyFormData=ml:xa.searchParams&&URLSearchParams.prototype.isPrototypeOf(ml)?this._bodyText=ml.toString():xa.arrayBuffer&&xa.blob&&wa(ml)?(this._bodyArrayBuffer=dl(ml.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):xa.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(ml)||La(ml))?this._bodyArrayBuffer=dl(ml):this._bodyText=ml=Object.prototype.toString.call(ml):this._bodyText="",this.headers.get("content-type")||(typeof ml=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):xa.searchParams&&URLSearchParams.prototype.isPrototypeOf(ml)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},xa.blob&&(this.blob=function(){var ml=sl(this);if(ml)return ml;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?sl(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(rl)}),this.text=function(){var ml=sl(this);if(ml)return ml;if(this._bodyBlob)return ll(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(cl(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},xa.formData&&(this.formData=function(){return this.text().then(Wl)}),this.json=function(){return this.text().then(JSON.parse)},this}var bl=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ul(ml){var yl=ml.toUpperCase();return bl.indexOf(yl)>-1?yl:ml}function fl(ml,yl){yl=yl||{};var Nl=yl.body;if(ml instanceof fl){if(ml.bodyUsed)throw new TypeError("Already read");this.url=ml.url,this.credentials=ml.credentials,yl.headers||(this.headers=new il(ml.headers)),this.method=ml.method,this.mode=ml.mode,this.signal=ml.signal,!Nl&&ml._bodyInit!=null&&(Nl=ml._bodyInit,ml.bodyUsed=!0)}else this.url=String(ml);if(this.credentials=yl.credentials||this.credentials||"same-origin",(yl.headers||!this.headers)&&(this.headers=new il(yl.headers)),this.method=Ul(yl.method||this.method||"GET"),this.mode=yl.mode||this.mode||null,this.signal=yl.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Nl)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Nl)}fl.prototype.clone=function(){return new fl(this,{body:this._bodyInit})};function Wl(ml){var yl=new FormData;return ml.trim().split("&").forEach(function(Nl){if(Nl){var Fl=Nl.split("="),Tl=Fl.shift().replace(/\+/g," "),Il=Fl.join("=").replace(/\+/g," ");yl.append(decodeURIComponent(Tl),decodeURIComponent(Il))}}),yl}function xl(ml){var yl=new il,Nl=ml.replace(/\r?\n[\t ]+/g," ");return Nl.split(/\r?\n/).forEach(function(Fl){var Tl=Fl.split(":"),Il=Tl.shift().trim();if(Il){var Vl=Tl.join(":").trim();yl.append(Il,Vl)}}),yl}pl.call(fl.prototype);function Bl(ml,yl){yl||(yl={}),this.type="default",this.status=yl.status===void 0?200:yl.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in yl?yl.statusText:"OK",this.headers=new il(yl.headers),this.url=yl.url||"",this._initBody(ml)}pl.call(Bl.prototype),Bl.prototype.clone=function(){return new Bl(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new il(this.headers),url:this.url})},Bl.error=function(){var ml=new Bl(null,{status:0,statusText:""});return ml.type="error",ml};var El=[301,302,303,307,308];Bl.redirect=function(ml,yl){if(El.indexOf(yl)===-1)throw new RangeError("Invalid status code");return new Bl(null,{status:yl,headers:{location:ml}})},Aa.DOMException=Ta.DOMException;try{new Aa.DOMException}catch{Aa.DOMException=function(yl,Nl){this.message=yl,this.name=Nl;var Fl=Error(yl);this.stack=Fl.stack},Aa.DOMException.prototype=Object.create(Error.prototype),Aa.DOMException.prototype.constructor=Aa.DOMException}function Rl(ml,yl){return new Promise(function(Nl,Fl){var Tl=new fl(ml,yl);if(Tl.signal&&Tl.signal.aborted)return Fl(new Aa.DOMException("Aborted","AbortError"));var Il=new XMLHttpRequest;function Vl(){Il.abort()}Il.onload=function(){var Jl={status:Il.status,statusText:Il.statusText,headers:xl(Il.getAllResponseHeaders()||"")};Jl.url="responseURL"in Il?Il.responseURL:Jl.headers.get("X-Request-URL");var Pl="response"in Il?Il.response:Il.responseText;Nl(new Bl(Pl,Jl))},Il.onerror=function(){Fl(new TypeError("Network request failed"))},Il.ontimeout=function(){Fl(new TypeError("Network request failed"))},Il.onabort=function(){Fl(new Aa.DOMException("Aborted","AbortError"))},Il.open(Tl.method,Tl.url,!0),Tl.credentials==="include"?Il.withCredentials=!0:Tl.credentials==="omit"&&(Il.withCredentials=!1),"responseType"in Il&&xa.blob&&(Il.responseType="blob"),Tl.headers.forEach(function(Jl,Pl){Il.setRequestHeader(Pl,Jl)}),Tl.signal&&(Tl.signal.addEventListener("abort",Vl),Il.onreadystatechange=function(){Il.readyState===4&&Tl.signal.removeEventListener("abort",Vl)}),Il.send(typeof Tl._bodyInit>"u"?null:Tl._bodyInit)})}return Rl.polyfill=!0,Ta.fetch||(Ta.fetch=Rl,Ta.Headers=il,Ta.Request=fl,Ta.Response=Bl),Aa.Headers=il,Aa.Request=fl,Aa.Response=Bl,Aa.fetch=Rl,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa})({})})(Ea),Ea.fetch.ponyfill=!0,delete Ea.fetch.polyfill;var Sa=Ea;aa=Sa.fetch,aa.default=Sa.fetch,aa.fetch=Sa.fetch,aa.Headers=Sa.Headers,aa.Request=Sa.Request,aa.Response=Sa.Response,oa.exports=aa}(browserPonyfill,browserPonyfill.exports)),browserPonyfill.exports}(function(oa,aa){var ba;if(typeof fetch=="function"&&(typeof commonjsGlobal<"u"&&commonjsGlobal.fetch?ba=commonjsGlobal.fetch:typeof window<"u"&&window.fetch?ba=window.fetch:ba=fetch),typeof commonjsRequire<"u"&&(typeof window>"u"||typeof window.document>"u")){var Ea=ba||requireBrowserPonyfill();Ea.default&&(Ea=Ea.default),aa.default=Ea,oa.exports=aa.default}})(getFetch$1,getFetch$1.exports);var getFetchExports=getFetch$1.exports;const getFetch=getDefaultExportFromCjs(getFetchExports),fetchNode=_mergeNamespaces({__proto__:null,default:getFetch},[getFetchExports]);function _typeof$8(oa){"@babel/helpers - typeof";return _typeof$8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(aa){return typeof aa}:function(aa){return aa&&typeof Symbol=="function"&&aa.constructor===Symbol&&aa!==Symbol.prototype?"symbol":typeof aa},_typeof$8(oa)}var fetchApi;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?fetchApi=global.fetch:typeof window<"u"&&window.fetch?fetchApi=window.fetch:fetchApi=fetch);var XmlHttpRequestApi;hasXMLHttpRequest()&&(typeof global<"u"&&global.XMLHttpRequest?XmlHttpRequestApi=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(XmlHttpRequestApi=window.XMLHttpRequest));var ActiveXObjectApi;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ActiveXObjectApi=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ActiveXObjectApi=window.ActiveXObject)),!fetchApi&&fetchNode&&!XmlHttpRequestApi&&!ActiveXObjectApi&&(fetchApi=getFetch||fetchNode),typeof fetchApi!="function"&&(fetchApi=void 0);var addQueryString=function(aa,ba){if(ba&&_typeof$8(ba)==="object"){var Ea="";for(var Sa in ba)Ea+="&"+encodeURIComponent(Sa)+"="+encodeURIComponent(ba[Sa]);if(!Ea)return aa;aa=aa+(aa.indexOf("?")!==-1?"&":"?")+Ea.slice(1)}return aa},fetchIt=function(aa,ba,Ea){fetchApi(aa,ba).then(function(Sa){if(!Sa.ok)return Ea(Sa.statusText||"Error",{status:Sa.status});Sa.text().then(function(Ta){Ea(null,{status:Sa.status,data:Ta})}).catch(Ea)}).catch(Ea)},omitFetchOptions=!1,requestWithFetch=function(aa,ba,Ea,Sa){aa.queryStringParams&&(ba=addQueryString(ba,aa.queryStringParams));var Ta=defaults$6({},typeof aa.customHeaders=="function"?aa.customHeaders():aa.customHeaders);Ea&&(Ta["Content-Type"]="application/json");var Aa=typeof aa.requestOptions=="function"?aa.requestOptions(Ea):aa.requestOptions,xa=defaults$6({method:Ea?"POST":"GET",body:Ea?aa.stringify(Ea):void 0,headers:Ta},omitFetchOptions?{}:Aa);try{fetchIt(ba,xa,Sa)}catch(wa){if(!Aa||Object.keys(Aa).length===0||!wa.message||wa.message.indexOf("not implemented")<0)return Sa(wa);try{Object.keys(Aa).forEach(function(ka){delete xa[ka]}),fetchIt(ba,xa,Sa),omitFetchOptions=!0}catch(ka){Sa(ka)}}},requestWithXmlHttpRequest=function(aa,ba,Ea,Sa){Ea&&_typeof$8(Ea)==="object"&&(Ea=addQueryString("",Ea).slice(1)),aa.queryStringParams&&(ba=addQueryString(ba,aa.queryStringParams));try{var Ta;XmlHttpRequestApi?Ta=new XmlHttpRequestApi:Ta=new ActiveXObjectApi("MSXML2.XMLHTTP.3.0"),Ta.open(Ea?"POST":"GET",ba,1),aa.crossDomain||Ta.setRequestHeader("X-Requested-With","XMLHttpRequest"),Ta.withCredentials=!!aa.withCredentials,Ea&&Ta.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),Ta.overrideMimeType&&Ta.overrideMimeType("application/json");var Aa=aa.customHeaders;if(Aa=typeof Aa=="function"?Aa():Aa,Aa)for(var xa in Aa)Ta.setRequestHeader(xa,Aa[xa]);Ta.onreadystatechange=function(){Ta.readyState>3&&Sa(Ta.status>=400?Ta.statusText:null,{status:Ta.status,data:Ta.responseText})},Ta.send(Ea)}catch(wa){console&&console.log(wa)}},request=function(aa,ba,Ea,Sa){if(typeof Ea=="function"&&(Sa=Ea,Ea=void 0),Sa=Sa||function(){},fetchApi)return requestWithFetch(aa,ba,Ea,Sa);if(hasXMLHttpRequest()||typeof ActiveXObject=="function")return requestWithXmlHttpRequest(aa,ba,Ea,Sa);Sa(new Error("No fetch and no xhr implementation found!"))};function _classCallCheck$l(oa,aa){if(!(oa instanceof aa))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(oa,aa){for(var ba=0;ba<aa.length;ba++){var Ea=aa[ba];Ea.enumerable=Ea.enumerable||!1,Ea.configurable=!0,"value"in Ea&&(Ea.writable=!0),Object.defineProperty(oa,Ea.key,Ea)}}function _createClass$k(oa,aa,ba){return aa&&_defineProperties$8(oa.prototype,aa),Object.defineProperty(oa,"prototype",{writable:!1}),oa}function _defineProperty$5(oa,aa,ba){return aa in oa?Object.defineProperty(oa,aa,{value:ba,enumerable:!0,configurable:!0,writable:!0}):oa[aa]=ba,oa}var getDefaults$2=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(ba){return JSON.parse(ba)},stringify:JSON.stringify,parsePayload:function(ba,Ea,Sa){return _defineProperty$5({},Ea,Sa||"")},request,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Backend=function(){function oa(aa){var ba=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ea=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck$l(this,oa),this.services=aa,this.options=ba,this.allOptions=Ea,this.type="backend",this.init(aa,ba,Ea)}return _createClass$k(oa,[{key:"init",value:function(ba){var Ea=this,Sa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ta=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=ba,this.options=defaults$6(Sa,this.options||{},getDefaults$2()),this.allOptions=Ta,this.services&&this.options.reloadInterval&&setInterval(function(){return Ea.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(ba,Ea,Sa){this._readAny(ba,ba,Ea,Ea,Sa)}},{key:"read",value:function(ba,Ea,Sa){this._readAny([ba],ba,[Ea],Ea,Sa)}},{key:"_readAny",value:function(ba,Ea,Sa,Ta,Aa){var xa=this,wa=this.options.loadPath;typeof this.options.loadPath=="function"&&(wa=this.options.loadPath(ba,Sa)),wa=makePromise(wa),wa.then(function(ka){if(!ka)return Aa(null,{});var La=xa.services.interpolator.interpolate(ka,{lng:ba.join("+"),ns:Sa.join("+")});xa.loadUrl(La,Aa,Ea,Ta)})}},{key:"loadUrl",value:function(ba,Ea,Sa,Ta){var Aa=this;this.options.request(this.options,ba,void 0,function(xa,wa){if(wa&&(wa.status>=500&&wa.status<600||!wa.status))return Ea("failed loading "+ba+"; status code: "+wa.status,!0);if(wa&&wa.status>=400&&wa.status<500)return Ea("failed loading "+ba+"; status code: "+wa.status,!1);if(!wa&&xa&&xa.message&&xa.message.indexOf("Failed to fetch")>-1)return Ea("failed loading "+ba+": "+xa.message,!0);if(xa)return Ea(xa,!1);var ka,La;try{typeof wa.data=="string"?ka=Aa.options.parse(wa.data,Sa,Ta):ka=wa.data}catch{La="failed parsing "+ba+" to json"}if(La)return Ea(La,!1);Ea(null,ka)})}},{key:"create",value:function(ba,Ea,Sa,Ta,Aa){var xa=this;if(this.options.addPath){typeof ba=="string"&&(ba=[ba]);var wa=this.options.parsePayload(Ea,Sa,Ta),ka=0,La=[],tl=[];ba.forEach(function(el){var nl=xa.options.addPath;typeof xa.options.addPath=="function"&&(nl=xa.options.addPath(el,Ea));var il=xa.services.interpolator.interpolate(nl,{lng:el,ns:Ea});xa.options.request(xa.options,il,wa,function(sl,al){ka+=1,La.push(sl),tl.push(al),ka===ba.length&&Aa&&Aa(La,tl)})})}}},{key:"reload",value:function(){var ba=this,Ea=this.services,Sa=Ea.backendConnector,Ta=Ea.languageUtils,Aa=Ea.logger,xa=Sa.language;if(!(xa&&xa.toLowerCase()==="cimode")){var wa=[],ka=function(tl){var el=Ta.toResolveHierarchy(tl);el.forEach(function(nl){wa.indexOf(nl)<0&&wa.push(nl)})};ka(xa),this.allOptions.preload&&this.allOptions.preload.forEach(function(La){return ka(La)}),wa.forEach(function(La){ba.allOptions.ns.forEach(function(tl){Sa.read(La,tl,"read",null,null,function(el,nl){el&&Aa.warn("loading namespace ".concat(tl," for language ").concat(La," failed"),el),!el&&nl&&Aa.log("loaded namespace ".concat(tl," for language ").concat(La),nl),Sa.loaded("".concat(La,"|").concat(tl),el,nl)})})})}}}]),oa}();Backend.type="backend";var arr=[],each=arr.forEach,slice=arr.slice;function defaults$5(oa){return each.call(slice.call(arguments,1),function(aa){if(aa)for(var ba in aa)oa[ba]===void 0&&(oa[ba]=aa[ba])}),oa}var fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,serializeCookie=function(aa,ba,Ea){var Sa=Ea||{};Sa.path=Sa.path||"/";var Ta=encodeURIComponent(ba),Aa="".concat(aa,"=").concat(Ta);if(Sa.maxAge>0){var xa=Sa.maxAge-0;if(Number.isNaN(xa))throw new Error("maxAge should be a Number");Aa+="; Max-Age=".concat(Math.floor(xa))}if(Sa.domain){if(!fieldContentRegExp.test(Sa.domain))throw new TypeError("option domain is invalid");Aa+="; Domain=".concat(Sa.domain)}if(Sa.path){if(!fieldContentRegExp.test(Sa.path))throw new TypeError("option path is invalid");Aa+="; Path=".concat(Sa.path)}if(Sa.expires){if(typeof Sa.expires.toUTCString!="function")throw new TypeError("option expires is invalid");Aa+="; Expires=".concat(Sa.expires.toUTCString())}if(Sa.httpOnly&&(Aa+="; HttpOnly"),Sa.secure&&(Aa+="; Secure"),Sa.sameSite){var wa=typeof Sa.sameSite=="string"?Sa.sameSite.toLowerCase():Sa.sameSite;switch(wa){case!0:Aa+="; SameSite=Strict";break;case"lax":Aa+="; SameSite=Lax";break;case"strict":Aa+="; SameSite=Strict";break;case"none":Aa+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return Aa},cookie={create:function(aa,ba,Ea,Sa){var Ta=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};Ea&&(Ta.expires=new Date,Ta.expires.setTime(Ta.expires.getTime()+Ea*60*1e3)),Sa&&(Ta.domain=Sa),document.cookie=serializeCookie(aa,encodeURIComponent(ba),Ta)},read:function(aa){for(var ba="".concat(aa,"="),Ea=document.cookie.split(";"),Sa=0;Sa<Ea.length;Sa++){for(var Ta=Ea[Sa];Ta.charAt(0)===" ";)Ta=Ta.substring(1,Ta.length);if(Ta.indexOf(ba)===0)return Ta.substring(ba.length,Ta.length)}return null},remove:function(aa){this.create(aa,"",-1)}},cookie$1={name:"cookie",lookup:function(aa){var ba;if(aa.lookupCookie&&typeof document<"u"){var Ea=cookie.read(aa.lookupCookie);Ea&&(ba=Ea)}return ba},cacheUserLanguage:function(aa,ba){ba.lookupCookie&&typeof document<"u"&&cookie.create(ba.lookupCookie,aa,ba.cookieMinutes,ba.cookieDomain,ba.cookieOptions)}},querystring={name:"querystring",lookup:function(aa){var ba;if(typeof window<"u"){var Ea=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(Ea=window.location.hash.substring(window.location.hash.indexOf("?")));for(var Sa=Ea.substring(1),Ta=Sa.split("&"),Aa=0;Aa<Ta.length;Aa++){var xa=Ta[Aa].indexOf("=");if(xa>0){var wa=Ta[Aa].substring(0,xa);wa===aa.lookupQuerystring&&(ba=Ta[Aa].substring(xa+1))}}}return ba}},hasLocalStorageSupport=null,localStorageAvailable=function(){if(hasLocalStorageSupport!==null)return hasLocalStorageSupport;try{hasLocalStorageSupport=window!=="undefined"&&window.localStorage!==null;var aa="i18next.translate.boo";window.localStorage.setItem(aa,"foo"),window.localStorage.removeItem(aa)}catch{hasLocalStorageSupport=!1}return hasLocalStorageSupport},localStorage$1={name:"localStorage",lookup:function(aa){var ba;if(aa.lookupLocalStorage&&localStorageAvailable()){var Ea=window.localStorage.getItem(aa.lookupLocalStorage);Ea&&(ba=Ea)}return ba},cacheUserLanguage:function(aa,ba){ba.lookupLocalStorage&&localStorageAvailable()&&window.localStorage.setItem(ba.lookupLocalStorage,aa)}},hasSessionStorageSupport=null,sessionStorageAvailable=function(){if(hasSessionStorageSupport!==null)return hasSessionStorageSupport;try{hasSessionStorageSupport=window!=="undefined"&&window.sessionStorage!==null;var aa="i18next.translate.boo";window.sessionStorage.setItem(aa,"foo"),window.sessionStorage.removeItem(aa)}catch{hasSessionStorageSupport=!1}return hasSessionStorageSupport},sessionStorage$1={name:"sessionStorage",lookup:function(aa){var ba;if(aa.lookupSessionStorage&&sessionStorageAvailable()){var Ea=window.sessionStorage.getItem(aa.lookupSessionStorage);Ea&&(ba=Ea)}return ba},cacheUserLanguage:function(aa,ba){ba.lookupSessionStorage&&sessionStorageAvailable()&&window.sessionStorage.setItem(ba.lookupSessionStorage,aa)}},navigator$1={name:"navigator",lookup:function(aa){var ba=[];if(typeof navigator<"u"){if(navigator.languages)for(var Ea=0;Ea<navigator.languages.length;Ea++)ba.push(navigator.languages[Ea]);navigator.userLanguage&&ba.push(navigator.userLanguage),navigator.language&&ba.push(navigator.language)}return ba.length>0?ba:void 0}},htmlTag={name:"htmlTag",lookup:function(aa){var ba,Ea=aa.htmlTag||(typeof document<"u"?document.documentElement:null);return Ea&&typeof Ea.getAttribute=="function"&&(ba=Ea.getAttribute("lang")),ba}},path$1={name:"path",lookup:function(aa){var ba;if(typeof window<"u"){var Ea=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Ea instanceof Array)if(typeof aa.lookupFromPathIndex=="number"){if(typeof Ea[aa.lookupFromPathIndex]!="string")return;ba=Ea[aa.lookupFromPathIndex].replace("/","")}else ba=Ea[0].replace("/","")}return ba}},subdomain={name:"subdomain",lookup:function(aa){var ba=typeof aa.lookupFromSubdomainIndex=="number"?aa.lookupFromSubdomainIndex+1:1,Ea=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(Ea)return Ea[ba]}};function getDefaults$1(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Browser=function(){function oa(aa){var ba=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$m(this,oa),this.type="languageDetector",this.detectors={},this.init(aa,ba)}return _createClass$l(oa,[{key:"init",value:function(ba){var Ea=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Sa=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=ba,this.options=defaults$5(Ea,this.options||{},getDefaults$1()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=Sa,this.addDetector(cookie$1),this.addDetector(querystring),this.addDetector(localStorage$1),this.addDetector(sessionStorage$1),this.addDetector(navigator$1),this.addDetector(htmlTag),this.addDetector(path$1),this.addDetector(subdomain)}},{key:"addDetector",value:function(ba){this.detectors[ba.name]=ba}},{key:"detect",value:function(ba){var Ea=this;ba||(ba=this.options.order);var Sa=[];return ba.forEach(function(Ta){if(Ea.detectors[Ta]){var Aa=Ea.detectors[Ta].lookup(Ea.options);Aa&&typeof Aa=="string"&&(Aa=[Aa]),Aa&&(Sa=Sa.concat(Aa))}}),this.services.languageUtils.getBestMatchFromCodes?Sa:Sa.length>0?Sa[0]:null}},{key:"cacheUserLanguage",value:function(ba,Ea){var Sa=this;Ea||(Ea=this.options.caches),Ea&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(ba)>-1||Ea.forEach(function(Ta){Sa.detectors[Ta]&&Sa.detectors[Ta].cacheUserLanguage(ba,Sa.options)}))}}]),oa}();Browser.type="languageDetector";function _objectWithoutPropertiesLoose(oa,aa){if(oa==null)return{};var ba={},Ea=Object.keys(oa),Sa,Ta;for(Ta=0;Ta<Ea.length;Ta++)Sa=Ea[Ta],!(aa.indexOf(Sa)>=0)&&(ba[Sa]=oa[Sa]);return ba}function _objectWithoutProperties$4(oa,aa){if(oa==null)return{};var ba=_objectWithoutPropertiesLoose(oa,aa),Ea,Sa;if(Object.getOwnPropertySymbols){var Ta=Object.getOwnPropertySymbols(oa);for(Sa=0;Sa<Ta.length;Sa++)Ea=Ta[Sa],!(aa.indexOf(Ea)>=0)&&Object.prototype.propertyIsEnumerable.call(oa,Ea)&&(ba[Ea]=oa[Ea])}return ba}var voidElements={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const e$1=getDefaultExportFromCjs(voidElements);var t$2=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n$1(oa){var aa={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},ba=oa.match(/<\/?([^\s]+?)[/\s>]/);if(ba&&(aa.name=ba[1],(e$1[ba[1]]||oa.charAt(oa.length-2)==="/")&&(aa.voidElement=!0),aa.name.startsWith("!--"))){var Ea=oa.indexOf("-->");return{type:"comment",comment:Ea!==-1?oa.slice(4,Ea):""}}for(var Sa=new RegExp(t$2),Ta=null;(Ta=Sa.exec(oa))!==null;)if(Ta[0].trim())if(Ta[1]){var Aa=Ta[1].trim(),xa=[Aa,""];Aa.indexOf("=")>-1&&(xa=Aa.split("=")),aa.attrs[xa[0]]=xa[1],Sa.lastIndex--}else Ta[2]&&(aa.attrs[Ta[2]]=Ta[3].trim().substring(1,Ta[3].length-1));return aa}var r$3=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i$5=/^\s*$/,s$3=Object.create(null);function a$3(oa,aa){switch(aa.type){case"text":return oa+aa.content;case"tag":return oa+="<"+aa.name+(aa.attrs?function(ba){var Ea=[];for(var Sa in ba)Ea.push(Sa+'="'+ba[Sa]+'"');return Ea.length?" "+Ea.join(" "):""}(aa.attrs):"")+(aa.voidElement?"/>":">"),aa.voidElement?oa:oa+aa.children.reduce(a$3,"")+"</"+aa.name+">";case"comment":return oa+"<!--"+aa.comment+"-->"}}var c$3={parse:function(oa,aa){aa||(aa={}),aa.components||(aa.components=s$3);var ba,Ea=[],Sa=[],Ta=-1,Aa=!1;if(oa.indexOf("<")!==0){var xa=oa.indexOf("<");Ea.push({type:"text",content:xa===-1?oa:oa.substring(0,xa)})}return oa.replace(r$3,function(wa,ka){if(Aa){if(wa!=="</"+ba.name+">")return;Aa=!1}var La,tl=wa.charAt(1)!=="/",el=wa.startsWith("<!--"),nl=ka+wa.length,il=oa.charAt(nl);if(el){var sl=n$1(wa);return Ta<0?(Ea.push(sl),Ea):((La=Sa[Ta]).children.push(sl),Ea)}if(tl&&(Ta++,(ba=n$1(wa)).type==="tag"&&aa.components[ba.name]&&(ba.type="component",Aa=!0),ba.voidElement||Aa||!il||il==="<"||ba.children.push({type:"text",content:oa.slice(nl,oa.indexOf("<",nl))}),Ta===0&&Ea.push(ba),(La=Sa[Ta-1])&&La.children.push(ba),Sa[Ta]=ba),(!tl||ba.voidElement)&&(Ta>-1&&(ba.voidElement||ba.name===wa.slice(2,-1))&&(Ta--,ba=Ta===-1?Ea:Sa[Ta]),!Aa&&il!=="<"&&il)){La=Ta===-1?Ea:Sa[Ta].children;var al=oa.indexOf("<",nl),rl=oa.slice(nl,al===-1?void 0:al);i$5.test(rl)&&(rl=" "),(al>-1&&Ta+La.length>=0||rl!==" ")&&La.push({type:"text",content:rl})}}),Ea},stringify:function(oa){return oa.reduce(function(aa,ba){return aa+a$3("",ba)},"")}},matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},unescapeHtmlEntity=function(aa){return htmlEntities[aa]},unescape$1=function(aa){return aa.replace(matchHtmlEntity,unescapeHtmlEntity)};function ownKeys$7(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$7(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$7(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$7(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}var defaultOptions$1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1},i18nInstance,I18nContext=React.createContext();function setDefaults(){var oa=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};defaultOptions$1=_objectSpread$7(_objectSpread$7({},defaultOptions$1),oa)}function getDefaults(){return defaultOptions$1}var ReportNamespaces=function(){function oa(){_classCallCheck$m(this,oa),this.usedNamespaces={}}return _createClass$l(oa,[{key:"addUsedNamespaces",value:function(ba){var Ea=this;ba.forEach(function(Sa){Ea.usedNamespaces[Sa]||(Ea.usedNamespaces[Sa]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),oa}();function setI18n(oa){i18nInstance=oa}function getI18n(){return i18nInstance}var initReactI18next={type:"3rdParty",init:function(aa){setDefaults(aa.options.react),setI18n(aa)}};function warn$1(){if(console&&console.warn){for(var oa,aa=arguments.length,ba=new Array(aa),Ea=0;Ea<aa;Ea++)ba[Ea]=arguments[Ea];typeof ba[0]=="string"&&(ba[0]="react-i18next:: ".concat(ba[0])),(oa=console).warn.apply(oa,ba)}}var alreadyWarned={};function warnOnce$1(){for(var oa=arguments.length,aa=new Array(oa),ba=0;ba<oa;ba++)aa[ba]=arguments[ba];typeof aa[0]=="string"&&alreadyWarned[aa[0]]||(typeof aa[0]=="string"&&(alreadyWarned[aa[0]]=new Date),warn$1.apply(void 0,aa))}function loadNamespaces(oa,aa,ba){oa.loadNamespaces(aa,function(){if(oa.isInitialized)ba();else{var Ea=function Sa(){setTimeout(function(){oa.off("initialized",Sa)},0),ba()};oa.on("initialized",Ea)}})}function oldI18nextHasLoadedNamespace(oa,aa){var ba=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ea=aa.languages[0],Sa=aa.options?aa.options.fallbackLng:!1,Ta=aa.languages[aa.languages.length-1];if(Ea.toLowerCase()==="cimode")return!0;var Aa=function(wa,ka){var La=aa.services.backendConnector.state["".concat(wa,"|").concat(ka)];return La===-1||La===2};return ba.bindI18n&&ba.bindI18n.indexOf("languageChanging")>-1&&aa.services.backendConnector.backend&&aa.isLanguageChangingTo&&!Aa(aa.isLanguageChangingTo,oa)?!1:!!(aa.hasResourceBundle(Ea,oa)||!aa.services.backendConnector.backend||aa.options.resources&&!aa.options.partialBundledLanguages||Aa(Ea,oa)&&(!Sa||Aa(Ta,oa)))}function hasLoadedNamespace(oa,aa){var ba=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!aa.languages||!aa.languages.length)return warnOnce$1("i18n.languages were undefined or empty",aa.languages),!0;var Ea=aa.options.ignoreJSONStructure!==void 0;return Ea?aa.hasLoadedNamespace(oa,{precheck:function(Ta,Aa){if(ba.bindI18n&&ba.bindI18n.indexOf("languageChanging")>-1&&Ta.services.backendConnector.backend&&Ta.isLanguageChangingTo&&!Aa(Ta.isLanguageChangingTo,oa))return!1}}):oldI18nextHasLoadedNamespace(oa,aa,ba)}var _excluded=["format"],_excluded2=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function ownKeys$6(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$6(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$6(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$6(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}function hasChildren(oa,aa){if(!oa)return!1;var ba=oa.props?oa.props.children:oa.children;return aa?ba.length>0:!!ba}function getChildren$1(oa){return oa?oa.props?oa.props.children:oa.children:[]}function hasValidReactChildren(oa){return Object.prototype.toString.call(oa)!=="[object Array]"?!1:oa.every(function(aa){return React.isValidElement(aa)})}function getAsArray(oa){return Array.isArray(oa)?oa:[oa]}function mergeProps(oa,aa){var ba=_objectSpread$6({},aa);return ba.props=Object.assign(oa.props,aa.props),ba}function nodesToString(oa,aa){if(!oa)return"";var ba="",Ea=getAsArray(oa),Sa=aa.transSupportBasicHtmlNodes&&aa.transKeepBasicHtmlNodesFor?aa.transKeepBasicHtmlNodesFor:[];return Ea.forEach(function(Ta,Aa){if(typeof Ta=="string")ba+="".concat(Ta);else if(React.isValidElement(Ta)){var xa=Object.keys(Ta.props).length,wa=Sa.indexOf(Ta.type)>-1,ka=Ta.props.children;if(!ka&&wa&&xa===0)ba+="<".concat(Ta.type,"/>");else if(!ka&&(!wa||xa!==0))ba+="<".concat(Aa,"></").concat(Aa,">");else if(Ta.props.i18nIsDynamicList)ba+="<".concat(Aa,"></").concat(Aa,">");else if(wa&&xa===1&&typeof ka=="string")ba+="<".concat(Ta.type,">").concat(ka,"</").concat(Ta.type,">");else{var La=nodesToString(ka,aa);ba+="<".concat(Aa,">").concat(La,"</").concat(Aa,">")}}else if(Ta===null)warn$1("Trans: the passed in value is invalid - seems you passed in a null child.");else if(_typeof$a(Ta)==="object"){var tl=Ta.format,el=_objectWithoutProperties$4(Ta,_excluded),nl=Object.keys(el);if(nl.length===1){var il=tl?"".concat(nl[0],", ").concat(tl):nl[0];ba+="{{".concat(il,"}}")}else warn$1("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",Ta)}else warn$1("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",Ta)}),ba}function renderNodes(oa,aa,ba,Ea,Sa,Ta){if(aa==="")return[];var Aa=Ea.transKeepBasicHtmlNodesFor||[],xa=aa&&new RegExp(Aa.join("|")).test(aa);if(!oa&&!xa)return[aa];var wa={};function ka(al){var rl=getAsArray(al);rl.forEach(function(ll){typeof ll!="string"&&(hasChildren(ll)?ka(getChildren$1(ll)):_typeof$a(ll)==="object"&&!React.isValidElement(ll)&&Object.assign(wa,ll))})}ka(oa);var La=c$3.parse("<0>".concat(aa,"</0>")),tl=_objectSpread$6(_objectSpread$6({},wa),Sa);function el(al,rl,ll){var cl=getChildren$1(al),dl=il(cl,rl.children,ll);return hasValidReactChildren(cl)&&dl.length===0?cl:dl}function nl(al,rl,ll,cl,dl){al.dummy&&(al.children=rl),ll.push(React.cloneElement(al,_objectSpread$6(_objectSpread$6({},al.props),{},{key:cl}),dl?void 0:rl))}function il(al,rl,ll){var cl=getAsArray(al),dl=getAsArray(rl);return dl.reduce(function(pl,bl,Ul){var fl=bl.children&&bl.children[0]&&bl.children[0].content&&ba.services.interpolator.interpolate(bl.children[0].content,tl,ba.language);if(bl.type==="tag"){var Wl=cl[parseInt(bl.name,10)];!Wl&&ll.length===1&&ll[0][bl.name]&&(Wl=ll[0][bl.name]),Wl||(Wl={});var xl=Object.keys(bl.attrs).length!==0?mergeProps({props:bl.attrs},Wl):Wl,Bl=React.isValidElement(xl),El=Bl&&hasChildren(bl,!0)&&!bl.voidElement,Rl=xa&&_typeof$a(xl)==="object"&&xl.dummy&&!Bl,ml=_typeof$a(oa)==="object"&&oa!==null&&Object.hasOwnProperty.call(oa,bl.name);if(typeof xl=="string"){var yl=ba.services.interpolator.interpolate(xl,tl,ba.language);pl.push(yl)}else if(hasChildren(xl)||El){var Nl=el(xl,bl,ll);nl(xl,Nl,pl,Ul)}else if(Rl){var Fl=il(cl,bl.children,ll);pl.push(React.cloneElement(xl,_objectSpread$6(_objectSpread$6({},xl.props),{},{key:Ul}),Fl))}else if(Number.isNaN(parseFloat(bl.name)))if(ml){var Tl=el(xl,bl,ll);nl(xl,Tl,pl,Ul,bl.voidElement)}else if(Ea.transSupportBasicHtmlNodes&&Aa.indexOf(bl.name)>-1)if(bl.voidElement)pl.push(React.createElement(bl.name,{key:"".concat(bl.name,"-").concat(Ul)}));else{var Il=il(cl,bl.children,ll);pl.push(React.createElement(bl.name,{key:"".concat(bl.name,"-").concat(Ul)},Il))}else if(bl.voidElement)pl.push("<".concat(bl.name," />"));else{var Vl=il(cl,bl.children,ll);pl.push("<".concat(bl.name,">").concat(Vl,"</").concat(bl.name,">"))}else if(_typeof$a(xl)==="object"&&!Bl){var Jl=bl.children[0]?fl:null;Jl&&pl.push(Jl)}else bl.children.length===1&&fl?pl.push(React.cloneElement(xl,_objectSpread$6(_objectSpread$6({},xl.props),{},{key:Ul}),fl)):pl.push(React.cloneElement(xl,_objectSpread$6(_objectSpread$6({},xl.props),{},{key:Ul})))}else if(bl.type==="text"){var Pl=Ea.transWrapTextNodes,Gl=Ta?Ea.unescape(ba.services.interpolator.interpolate(bl.content,tl,ba.language)):ba.services.interpolator.interpolate(bl.content,tl,ba.language);Pl?pl.push(React.createElement(Pl,{key:"".concat(bl.name,"-").concat(Ul)},Gl)):pl.push(Gl)}return pl},[])}var sl=il([{dummy:!0,children:oa||[]}],La,getAsArray(oa||[]));return getChildren$1(sl[0])}function Trans(oa){var aa=oa.children,ba=oa.count,Ea=oa.parent,Sa=oa.i18nKey,Ta=oa.context,Aa=oa.tOptions,xa=Aa===void 0?{}:Aa,wa=oa.values,ka=oa.defaults,La=oa.components,tl=oa.ns,el=oa.i18n,nl=oa.t,il=oa.shouldUnescape,sl=_objectWithoutProperties$4(oa,_excluded2),al=React.useContext(I18nContext)||{},rl=al.i18n,ll=al.defaultNS,cl=el||rl||getI18n();if(!cl)return warnOnce$1("You will need to pass in an i18next instance by using i18nextReactModule"),aa;var dl=nl||cl.t.bind(cl)||function(yl){return yl};Ta&&(xa.context=Ta);var pl=_objectSpread$6(_objectSpread$6({},getDefaults()),cl.options&&cl.options.react),bl=tl||dl.ns||ll||cl.options&&cl.options.defaultNS;bl=typeof bl=="string"?[bl]:bl||["translation"];var Ul=ka||nodesToString(aa,pl)||pl.transEmptyNodeValue||Sa,fl=pl.hashTransKey,Wl=Sa||(fl?fl(Ul):Ul),xl=wa?xa.interpolation:{interpolation:_objectSpread$6(_objectSpread$6({},xa.interpolation),{},{prefix:"#$?",suffix:"?$#"})},Bl=_objectSpread$6(_objectSpread$6(_objectSpread$6(_objectSpread$6({},xa),{},{count:ba},wa),xl),{},{defaultValue:Ul,ns:bl}),El=Wl?dl(Wl,Bl):Ul,Rl=renderNodes(La||aa,El,cl,pl,Bl,il),ml=Ea!==void 0?Ea:pl.defaultTransParent;return ml?React.createElement(ml,sl,Rl):Rl}function _iterableToArrayLimit$3(oa,aa){var ba=oa==null?null:typeof Symbol<"u"&&oa[Symbol.iterator]||oa["@@iterator"];if(ba!=null){var Ea,Sa,Ta,Aa,xa=[],wa=!0,ka=!1;try{if(Ta=(ba=ba.call(oa)).next,aa!==0)for(;!(wa=(Ea=Ta.call(ba)).done)&&(xa.push(Ea.value),xa.length!==aa);wa=!0);}catch(La){ka=!0,Sa=La}finally{try{if(!wa&&ba.return!=null&&(Aa=ba.return(),Object(Aa)!==Aa))return}finally{if(ka)throw Sa}}return xa}}function _slicedToArray$3(oa,aa){return _arrayWithHoles$3(oa)||_iterableToArrayLimit$3(oa,aa)||_unsupportedIterableToArray$b(oa,aa)||_nonIterableRest$3()}function ownKeys$5(oa,aa){var ba=Object.keys(oa);if(Object.getOwnPropertySymbols){var Ea=Object.getOwnPropertySymbols(oa);aa&&(Ea=Ea.filter(function(Sa){return Object.getOwnPropertyDescriptor(oa,Sa).enumerable})),ba.push.apply(ba,Ea)}return ba}function _objectSpread$5(oa){for(var aa=1;aa<arguments.length;aa++){var ba=arguments[aa]!=null?arguments[aa]:{};aa%2?ownKeys$5(Object(ba),!0).forEach(function(Ea){_defineProperty$6(oa,Ea,ba[Ea])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oa,Object.getOwnPropertyDescriptors(ba)):ownKeys$5(Object(ba)).forEach(function(Ea){Object.defineProperty(oa,Ea,Object.getOwnPropertyDescriptor(ba,Ea))})}return oa}var usePrevious=function(aa,ba){var Ea=React.useRef();return React.useEffect(function(){Ea.current=aa},[aa,ba]),Ea.current};function useTranslation(oa){var aa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ba=aa.i18n,Ea=React.useContext(I18nContext)||{},Sa=Ea.i18n,Ta=Ea.defaultNS,Aa=ba||Sa||getI18n();if(Aa&&!Aa.reportNamespaces&&(Aa.reportNamespaces=new ReportNamespaces),!Aa){warnOnce$1("You will need to pass in an i18next instance by using initReactI18next");var xa=function(Wl){return Array.isArray(Wl)?Wl[Wl.length-1]:Wl},wa=[xa,{},!1];return wa.t=xa,wa.i18n={},wa.ready=!1,wa}Aa.options.react&&Aa.options.react.wait!==void 0&&warnOnce$1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var ka=_objectSpread$5(_objectSpread$5(_objectSpread$5({},getDefaults()),Aa.options.react),aa),La=ka.useSuspense,tl=ka.keyPrefix,el=Ta||Aa.options&&Aa.options.defaultNS;el=typeof el=="string"?[el]:el||["translation"],Aa.reportNamespaces.addUsedNamespaces&&Aa.reportNamespaces.addUsedNamespaces(el);var nl=(Aa.isInitialized||Aa.initializedStoreOnce)&&el.every(function(fl){return hasLoadedNamespace(fl,Aa,ka)});function il(){return Aa.getFixedT(null,ka.nsMode==="fallback"?el:el[0],tl)}var sl=React.useState(il),al=_slicedToArray$3(sl,2),rl=al[0],ll=al[1],cl=el.join(),dl=usePrevious(cl),pl=React.useRef(!0);React.useEffect(function(){var fl=ka.bindI18n,Wl=ka.bindI18nStore;pl.current=!0,!nl&&!La&&loadNamespaces(Aa,el,function(){pl.current&&ll(il)}),nl&&dl&&dl!==cl&&pl.current&&ll(il);function xl(){pl.current&&ll(il)}return fl&&Aa&&Aa.on(fl,xl),Wl&&Aa&&Aa.store.on(Wl,xl),function(){pl.current=!1,fl&&Aa&&fl.split(" ").forEach(function(Bl){return Aa.off(Bl,xl)}),Wl&&Aa&&Wl.split(" ").forEach(function(Bl){return Aa.store.off(Bl,xl)})}},[Aa,cl]);var bl=React.useRef(!0);React.useEffect(function(){pl.current&&!bl.current&&ll(il),bl.current=!1},[Aa,tl]);var Ul=[rl,Aa,nl];if(Ul.t=rl,Ul.i18n=Aa,Ul.ready=nl,nl||!nl&&!La)return Ul;throw new Promise(function(fl){loadNamespaces(Aa,el,function(){fl()})})}function I18nextProvider(oa){var aa=oa.i18n,ba=oa.defaultNS,Ea=oa.children,Sa=React.useMemo(function(){return{i18n:aa,defaultNS:ba}},[aa,ba]);return React.createElement(I18nContext.Provider,{value:Sa},Ea)}const supportedLngs=["en","en-DG","es","es-ES","sr","sr-Latn","fr","pt-BR","pt","bn","zh","hi","id","ms","tr","vi","ht","it","de","nl","tl-PH","pl","hu","ro"],keyToStartCase=oa=>{const aa=oa.split("."),ba=aa[aa.length-1];return camelToStartCase(ba)},languageDetector=new Browser;languageDetector.addDetector({name:"navigatorOnlyLanguage",lookup(){if(typeof navigator>"u")return"en";const oa=navigator.language;return supportedLngs.includes(oa)?oa:oa.split("-")[0]}});const loadPath="https://api.i18nexus.com/project_resources/translations/{{lng}}/{{ns}}.json?api_key=cg41dUINoxdp8BaHDQLJhA";function createI18n({ns:oa=["default"],...aa}){const ba=instance.createInstance();return ba.use(initReactI18next).use(Backend).use(languageDetector).init({fallbackLng:"en",supportedLngs,ns:oa,detection:{order:["querystring","cookie","localStorage","sessionStorage","navigatorOnlyLanguage","htmlTag","path","subdomain"],lookupQuerystring:"lang"},defaultNS:oa[0],parseMissingKeyHandler:keyToStartCase,partialBundledLanguages:!0,keySeparator:".",interpolation:{escapeValue:!1},backend:{loadPath},react:{useSuspense:!1},initImmediate:!1,...aa}),ba}const i18n=createI18n({ns:["default"]}),addCustomFields=({token:oa,fields:aa})=>exports.api.post("/omni/add/custom-fields",{customFields:{...aa}},{headers:{"X-Incode-Hardware-Id":oa}}).then(ba=>ba.data).catch(ba=>Promise.reject(ba.response.data));async function addContract({token:oa,image:aa}){const{url:ba,contractId:Ea}=await getContractURL({token:oa});return await fetch(ba,{method:"PUT",body:aa,headers:{"x-ms-blob-type":"BlockBlob"}}),{url:ba,contractId:Ea}}function getContractURL({token:oa}){return exports.api.post("/omni/generateContractUploadUrl",null,{headers:{"X-Incode-Hardware-Id":oa}}).then(aa=>aa.data)}async function addDocument({token:oa,type:aa,image:ba,onProgress:Ea=emptyFunc}){if(aa==="contract"){const{url:Sa,contractId:Ta}=await addContract({token:oa,image:b64toBlob(ba)});return{success:!0,sessionStatus:"Alive",additionalInformation:{contractId:Ta,url:Sa}}}return exports.api.post(`/omni/add/document/v2?type=${aa}`,{base64Image:ba},{headers:{"X-Incode-Hardware-Id":oa},onUploadProgress:({loaded:Sa,total:Ta})=>Ea(Sa/Ta*100)}).then(Sa=>Sa.data).catch(Sa=>Promise.reject(Sa.response.data))}function addName({token:oa,name:aa}){return exports.api.post("/omni/add/name",{name:aa},{headers:{"X-Incode-Hardware-Id":oa}}).catch(ba=>Promise.reject(ba.response.data))}const addQrUrl="/omni/qr";function addQr({token:oa}){return exports.api.get(addQrUrl,{headers:{"X-Incode-Hardware-Id":oa}}).then(aa=>aa.data)}function approve({token:oa}){return exports.api.post("/omni/process/approve",null,{headers:{"X-Incode-Hardware-Id":oa}}).then(aa=>{const{uuid:ba,...Ea}=aa.data;return{...Ea,customerId:ba}}).catch(aa=>{var ba;return Promise.reject((ba=aa.response)==null?void 0:ba.data)})}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/**
|
|
82
82
|
* @license React
|
|
83
83
|
* react-jsx-runtime.production.min.js
|
|
@@ -782,6 +782,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
782
782
|
`,Loader$2=()=>{const oa=useUrlTheme();return jsxRuntimeExports.jsx(SpinnerContainer$2,{children:jsxRuntimeExports.jsx(Spinner$5,{outerColor:oa==null?void 0:oa.primary,innerColor:oa==null?void 0:oa.secondary})})},Container$f=qe$1.div`
|
|
783
783
|
width: 100%;
|
|
784
784
|
height: 100%;
|
|
785
|
+
&.IncodeTutorialContainerFront {
|
|
786
|
+
height: 100vh;
|
|
787
|
+
}
|
|
785
788
|
`,RootContainer=({cssSelector:oa,children:aa})=>jsxRuntimeExports.jsx(Container$f,{className:classNames("IncodeRootContainer",oa),children:aa}),CountrySelector=({onChange:oa,value:aa,label:ba,searchPlaceholder:Ea,placeholder:Sa,countryOptions:Ta,error:Aa,...xa})=>{var rl,ll;const[wa,ka]=React.useState(""),La=React.useRef(null),{state:tl,actions:{toggle:el,off:nl}}=useToggle(!1);useClickOutside(La,()=>{ka(""),nl()});const il=React.useMemo(()=>(Ta??Object.keys(countries$1)).map(dl=>({...countries$1[dl],id:dl})),[]),sl=wa?il.filter(cl=>{var dl;return(dl=cl.name)==null?void 0:dl.toLowerCase().includes(wa.toLowerCase())}):il,al=cl=>{oa(cl),ka(""),nl()};return jsxRuntimeExports.jsxs(CountryContainer,{ref:La,...xa,children:[ba&&jsxRuntimeExports.jsx(CountryLabel,{children:ba}),jsxRuntimeExports.jsx(CountryHeader,{onClick:el,hasValue:!!aa,children:aa?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:(rl=countries$1[aa])==null?void 0:rl.emoji}),jsxRuntimeExports.jsx("span",{children:(ll=countries$1[aa])==null?void 0:ll.name})]}):jsxRuntimeExports.jsx("span",{children:Sa})}),Aa&&jsxRuntimeExports.jsx(ErrorMessage$8,{children:Aa}),tl&&jsxRuntimeExports.jsxs(CountryListContainer,{children:[jsxRuntimeExports.jsx(SearchBar,{onHandleSearch:ka,placeholder:Ea}),jsxRuntimeExports.jsx(CountryItemsContainer,{children:sl.map(cl=>{var pl;const dl=((pl=countries$1[aa])==null?void 0:pl.name)===cl.name;return jsxRuntimeExports.jsxs(CountryItem,{onClick:()=>{dl||al(cl.id)},isDisabled:dl,children:[jsxRuntimeExports.jsx("span",{children:cl.emoji}),jsxRuntimeExports.jsx("span",{children:cl.name})]},cl.name)})})]})]})},stateList=Object.values(states$1),StateSelector=({onChange:oa,value:aa,label:ba,searchPlaceholder:Ea,placeholder:Sa,error:Ta,...Aa})=>{var sl;const[xa,wa]=React.useState(""),ka=React.useRef(null),{state:La,actions:{toggle:tl,off:el}}=useToggle(!1);useClickOutside(ka,()=>{wa(""),el()});const nl=xa?stateList.filter(al=>{var rl;return(rl=al.name)==null?void 0:rl.toLowerCase().includes(xa.toLowerCase())}):stateList,il=al=>{oa(al),wa(""),el()};return jsxRuntimeExports.jsxs(CountryContainer,{ref:ka,...Aa,children:[ba&&jsxRuntimeExports.jsx(CountryLabel,{children:ba}),jsxRuntimeExports.jsx(CountryHeader,{onClick:tl,hasValue:!!aa,children:aa?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("span",{children:(sl=states$1[aa])==null?void 0:sl.name})}):jsxRuntimeExports.jsx("span",{children:Sa})}),Ta&&jsxRuntimeExports.jsx(ErrorMessage$8,{children:Ta}),La&&jsxRuntimeExports.jsxs(CountryListContainer,{children:[jsxRuntimeExports.jsx(SearchBar,{onHandleSearch:wa,placeholder:Ea}),jsxRuntimeExports.jsx(CountryItemsContainer,{children:nl.map(al=>{var ll;const rl=((ll=states$1[aa])==null?void 0:ll.name)===al.name;return jsxRuntimeExports.jsx(CountryItem,{onClick:()=>{rl||il(al.code)},isDisabled:rl,children:jsxRuntimeExports.jsx("span",{children:al.name})},al.name)})})]})]})},srOnlyHeadingStyles=Ae$1`
|
|
786
789
|
position: absolute;
|
|
787
790
|
width: 1px;
|
|
@@ -2535,7 +2538,7 @@ a=extmap-allow-mixed`)!==-1){const Cl=gl.sdp.split(`
|
|
|
2535
2538
|
border-radius: 30px;
|
|
2536
2539
|
width: 100%;
|
|
2537
2540
|
height: auto;
|
|
2538
|
-
`,ChooseCamera=({onCameraChosen:oa,token:aa})=>{const[ba,Ea]=React.useState([]),Sa=React.useRef(null),Ta=React.useRef(),[Aa,xa]=React.useState(""),{t:wa}=useTranslation();React.useEffect(()=>()=>{var el;(el=Ta.current)==null||el.getTracks().forEach(nl=>{nl.stop()})},[]);const ka=()=>{oa(Aa)},La=async el=>{xa(el);const nl=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:el}}});Ta.current=nl,Sa.current.srcObject=nl};React.useEffect(()=>{(async()=>{try{const nl=[];if(await navigator.mediaDevices.getUserMedia({video:!0}),(await navigator.mediaDevices.enumerateDevices()).forEach(sl=>{sl.kind==="videoinput"&&nl.push(sl)}),nl.length===1)return oa(nl[0].deviceId);Ea(nl),La(nl[0].deviceId)}catch(nl){nl.constructor.name==="DOMException"&&(addEvent({code:"permissionDenied",payload:{message:"User denied to use camera."},token:aa}),nl.type="permissionDenied"),oa("error")}})()},[]);const tl=async el=>{await La(el.target.value)};return ba.length===0?null:jsxRuntimeExports.jsxs(ChooseCameraContainer,{className:"IncodeChooseCameraContainer",children:[jsxRuntimeExports.jsx("h1",{className:"IncodeChooseCameraTitle",children:wa("choseCamera.confirmCameraToUse")}),jsxRuntimeExports.jsx(PreviewVideo,{className:"IncodeChooseCameraPreviewVideo",autoPlay:!0,ref:Sa}),jsxRuntimeExports.jsx(CameraSelect,{className:"IncodeChooseCameraSelector",onChange:tl,children:ba.map(el=>jsxRuntimeExports.jsx("option",{value:el.deviceId,children:el.label},el.deviceId))}),jsxRuntimeExports.jsx(Button$a,{className:"IncodeChooseCameraButton",onClick:ka,children:wa("common.continue")})]})},version$1="1.76.0-rc.20241030222225";function r$1(oa){for(var aa="",ba=0;ba<oa.length;++ba)if(ba>0){var Ea=oa[ba].toLowerCase();Ea!==oa[ba]?aa+=" ".concat(Ea):aa+=oa[ba]}else aa+=oa[ba].toUpperCase();return aa}function o(oa,aa){return function(ba,Ea){return Object.prototype.hasOwnProperty.call(ba,Ea)}(oa,aa)?oa[aa]:void 0}var i$1={default:"endpoint"},u={default:"tlsEndpoint"},a="Client timeout",R="Network connection error",c="Network request aborted",s$1="Response cannot be parsed",E="Blocked by CSP",f="The endpoint parameter is not a valid URL",d=r$1("WrongRegion"),l=r$1("SubscriptionNotActive"),_=r$1("UnsupportedVersion"),p=r$1("InstallationMethodRestricted"),v=r$1("HostnameRestricted"),O=r$1("IntegrationFailed"),I="API key required",h$1="API key not found",N="API key expired",T="Request cannot be parsed",m="Request failed",w="Request failed to process",A="Too many requests, rate limit exceeded",P="Not available for this origin",y="Not available with restricted header",D=I,S=h$1,L=N,U="3.8.6",b="9319";function g(oa,aa){var ba=[];return function(Ea,Sa){var Ta=5,Aa=(el=Ea,nl=__spreadArray$1([],el,!0),{current:function(){return nl[0]},postpone:function(){var sl=nl.shift();sl!==void 0&&nl.push(sl)},exclude:function(){nl.shift()}}),xa=(ka=100,La=3e3,tl=0,function(){return Math.random()*Math.min(La,ka*Math.pow(2,tl++))}),wa=Aa.current(),ka,La,tl,el,nl;if(wa===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var il=function(sl,al){return Sa(sl).catch(function(rl){if(al+1>=Ta)throw rl;(function(dl){if(!(dl instanceof Error))return!1;var pl=dl.message;return pl===E||pl===b})(rl)?Aa.exclude():Aa.postpone();var ll,cl=Aa.current();if(cl===void 0)throw rl;return(ll=xa(),new Promise(function(dl){return setTimeout(dl,ll)})).then(function(){return il(cl,al+1)})})};return il(wa,0)}(oa,function(Ea){var Sa=new Date,Ta=function(xa){return ba.push({url:Ea,startedAt:Sa,finishedAt:new Date,error:xa})},Aa=aa(Ea);return Aa.then(function(){return Ta()},Ta),Aa}).then(function(Ea){return[Ea,ba]})}var C="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",K=C,M="Failed to load the JS script of the agent";function B(oa){var aa;oa.scriptUrlPattern;var ba=oa.token,Ea=oa.apiKey,Sa=Ea===void 0?ba:Ea,Ta=__rest$3(oa,["scriptUrlPattern","token","apiKey"]),Aa=(aa=o(oa,"scriptUrlPattern"))!==null&&aa!==void 0?aa:C,xa=function(){var La=[],tl=function(){La.push({time:new Date,state:document.visibilityState})},el=function(nl,il,sl,al){return nl.addEventListener(il,sl,al),function(){return nl.removeEventListener(il,sl,al)}}(document,"visibilitychange",tl);return tl(),[La,el]}(),wa=xa[0],ka=xa[1];return Promise.resolve().then(function(){if(!Sa||typeof Sa!="string")throw new Error(I);var La=function(tl,el){return(Array.isArray(tl)?tl:[tl]).map(function(nl){return function(il,sl){var al=encodeURIComponent;return il.replace(/<[^<>]+>/g,function(rl){return rl==="<version>"?"3":rl==="<apiKey>"?al(sl):rl==="<loaderVersion>"?al(U):rl})}(String(nl),el)})}(Aa,Sa);return g(La,F)}).catch(function(La){throw ka(),function(tl){return tl instanceof Error&&tl.message===b?new Error(M):tl}(La)}).then(function(La){var tl=La[0],el=La[1];return ka(),tl.load(__assign$2(__assign$2({},Ta),{ldi:{attempts:el,visibilityStates:wa}}))})}function F(oa){return function(aa,ba,Ea,Sa){var Ta,Aa=document,xa="securitypolicyviolation",wa=function(La){var tl=new URL(aa,location.href),el=La.blockedURI;el!==tl.href&&el!==tl.protocol.slice(0,-1)&&el!==tl.origin||(Ta=La,ka())};Aa.addEventListener(xa,wa);var ka=function(){return Aa.removeEventListener(xa,wa)};return Promise.resolve().then(ba).then(function(La){return ka(),La},function(La){return new Promise(function(tl){return setTimeout(tl)}).then(function(){if(ka(),Ta)return Ea(Ta);throw La})})}(oa,function(){return function(aa){return new Promise(function(ba,Ea){var Sa=document.createElement("script"),Ta=function(){var xa;return(xa=Sa.parentNode)===null||xa===void 0?void 0:xa.removeChild(Sa)},Aa=document.head||document.getElementsByTagName("head")[0];Sa.onload=function(){Ta(),ba()},Sa.onerror=function(){Ta(),Ea(new Error(M))},Sa.async=!0,Sa.src=aa,Aa.appendChild(Sa)})}(oa)},function(){throw new Error(E)}).then(V)}function V(){var oa=window,aa="__fpjs_p_l_b",ba=oa[aa];if(function(Ea,Sa){var Ta,Aa=(Ta=Object.getOwnPropertyDescriptor)===null||Ta===void 0?void 0:Ta.call(Object,Ea,Sa);Aa!=null&&Aa.configurable?delete Ea[Sa]:Aa&&!Aa.writable||(Ea[Sa]=void 0)}(oa,aa),typeof(ba==null?void 0:ba.load)!="function")throw new Error(b);return ba}var k={load:B,defaultScriptUrlPattern:K,ERROR_SCRIPT_LOAD_FAIL:M,ERROR_API_KEY_EXPIRED:N,ERROR_API_KEY_INVALID:h$1,ERROR_API_KEY_MISSING:I,ERROR_BAD_REQUEST_FORMAT:T,ERROR_BAD_RESPONSE_FORMAT:s$1,ERROR_CLIENT_TIMEOUT:a,ERROR_CSP_BLOCK:E,ERROR_FORBIDDEN_ENDPOINT:v,ERROR_FORBIDDEN_HEADER:y,ERROR_FORBIDDEN_ORIGIN:P,ERROR_GENERAL_SERVER_FAILURE:m,ERROR_INSTALLATION_METHOD_RESTRICTED:p,ERROR_INTEGRATION_FAILURE:O,ERROR_INVALID_ENDPOINT:f,ERROR_NETWORK_ABORT:c,ERROR_NETWORK_CONNECTION:R,ERROR_RATE_LIMIT:A,ERROR_SERVER_TIMEOUT:w,ERROR_SUBSCRIPTION_NOT_ACTIVE:l,ERROR_TOKEN_EXPIRED:L,ERROR_TOKEN_INVALID:S,ERROR_TOKEN_MISSING:D,ERROR_UNSUPPORTED_VERSION:_,ERROR_WRONG_REGION:d,defaultEndpoint:i$1,defaultTlsEndpoint:u};let fingerprintApiKey;function setFingerprintApiKey(oa){fingerprintApiKey=oa}async function getFingerPrint(){return k.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(oa=>oa.get({extendedResult:!0}))}const fingerPrintUrl="/omni/add/device-fingerprint";function postFingerprint({hash:oa,ip:aa,deviceType:ba,token:Ea,data:Sa,osVersion:Ta,deviceModel:Aa,browser:xa,sdkVersion:wa,hasLiedBrowser:ka,hostingApp:La,ipLocation:tl}){return exports.api.post(fingerPrintUrl,{hash:oa,ip:aa,deviceType:ba,data:Sa,osVersion:Ta,deviceModel:Aa,browser:xa,hasLiedBrowser:ka,sdkVersion:wa,hostingApp:La,ipLocation:tl},{headers:{"X-Incode-Hardware-Id":Ea}}).then(el=>el.data).catch(el=>Promise.reject(el.response.data))}function formatDeviceModel({vendor:oa,model:aa}){return`${oa||""} ${aa||""}`.trim()}const emptyFingerprint={visitorId:void 0,ip:void 0,ipLocation:{country:{name:void 0},subdivisions:[],city:{name:void 0},latitude:void 0,longitude:void 0}};async function sendFingerprint({token:oa},aa=!0,ba=!0){var wa,ka,La;const Ea="WEBAPP",{os:Sa,device:Ta,browser:Aa}=getUAParserResults(),xa=ba?await getFingerPrint().catch(tl=>(addEvent({code:"fingerprintFetchFailed",payload:{message:tl.message},token:oa}),emptyFingerprint)):emptyFingerprint;return postFingerprint({hash:xa.visitorId||"",ip:aa&&xa.ip||"",deviceType:Ea,token:oa,data:JSON.stringify(xa),osVersion:`${Sa.name} ${Sa.version}`,deviceModel:formatDeviceModel(Ta),browser:`${Aa.name} ${Aa.version}`,hasLiedBrowser:isBrowserSimulation(),hostingApp:options.hostingApp,sdkVersion:version$1,ipLocation:{ipCountry:(wa=xa.ipLocation.country)==null?void 0:wa.name,ipRegion:(ka=xa.ipLocation.subdivisions)==null?void 0:ka[0].name,ipCity:(La=xa.ipLocation.city)==null?void 0:La.name,ipLatitude:xa.ipLocation.latitude,ipLongitude:xa.ipLocation.longitude}}).then(tl=>(emptyDeviceStatsQueue(oa),tl))}function mapI18nLang(oa){const aa={en:"en-US",es:"es-ES",pt:"pt-BR"},ba=oa==null?void 0:oa.substring(0,2);return aa[ba]||"en-US"}const createSessionUrl="/omni/start";async function createNewSession({externalId:oa,externalCustomerId:aa,configurationId:ba,uuid:Ea,interviewId:Sa,customFields:Ta,language:Aa}={}){const xa=Aa||mapI18nLang(i18n.language);try{const wa=await exports.api.post(createSessionUrl,{externalId:oa,externalCustomerId:aa,configurationId:ba,uuid:Ea,interviewId:Sa,customFields:Ta,language:xa});state$1.token=wa.data;const ka=wa.data;emptyQueue(ka.token);const La=await sendFingerprint({token:ka.token,interviewId:ka.interviewId}).catch(()=>({regulationType:"",showMandatoryConsent:!1}));ka.regulationType=La.regulationType??"",ka.showMandatoryConsent=La.showMandatoryConsent??!1;const el=new UAParser().getResult();return addEvent({code:"browser",payload:{userAgent:window.navigator.userAgent,isWebRtcSupported:isWebRtcSupported(),...el},token:ka.token}),ka}catch(wa){throw wa!=null&&wa.response?wa.response.data:wa}}function LoginDesktop({onError:oa,onSuccess:aa,timeout:ba=4e4,stopAtAccessDenied:Ea=!1,deviceId:Sa,oneToOneProps:Ta}){const[Aa,xa]=React.useState("selfie"),[wa,ka]=React.useState(""),[La,tl]=React.useState(""),el=React.useRef(null),nl=React.useRef(!1),il=throttle$1(async(yl,Nl)=>{MlWasmJSApi$1.resetAllPipelines();const Fl=yl.getBase64Image();await identify({base64Image:Fl,faceCoordinates:Nl,authReference:Ta==null?void 0:Ta.authReference}).then(async Tl=>{const Il=Tl.spoofAttempt===!1,Vl=!!Tl.customerId&&!Tl.error,Jl=Tl.secondFactor,Pl=Tl.hasLenses,Gl=Tl.hasFaceMask;if(Jl){xa("secondFactor"),ka(Tl.transactionId),tl(Fl);return}if(!Il||!Vl||Gl||Pl){if(xl("error"),El((()=>{switch(!0){case Gl:return al("notifications.faceMask");case Pl:return al("notifications.lenses");case!Il:return al("notifications.spoof");case!Vl:return al("selfie.accessDenied");default:return""}})()),await sleep(3e3),!Vl&&Ea){const Zc=new Error("AccessDenied");console.dir(Zc),oa(Zc);return}Bl({response:Tl,livenessPassed:Il,imageBase64:Fl}),ll();return}sl(Tl,Fl)}).catch(async Tl=>{var Il;console.error(Tl),Wl(Tl||al("notifications.serverError")),xl("error"),await sleep(3e3),Bl({response:(Il=Tl==null?void 0:Tl.response)==null?void 0:Il.data,livenessPassed:null,imageBase64:Fl}),ll()})},300);async function sl(yl,Nl){const Fl=await createNewSession({interviewId:yl.interviewId});aa({...yl,token:Fl.token,base64Image:Nl||La})}const{t:al}=useTranslation(),{notificationMessage:rl,startAutoDetect:ll,handleManualCapture:cl,isSuccess:dl,isError:pl,isLoading:bl,hideCamera:Ul,shouldShowManualCapture:fl,handleError:Wl,setMode:xl,resetLoading:Bl,setNotificationMessage:El}=useSelfie({timeout:ba,isDetecting:nl,handleCapture:il,numberOfTries:-1,webcam:el});if(Aa==="secondFactor")return jsxRuntimeExports.jsx(SecondFactor,{transactionId:wa,onSuccess:sl});const Rl=bl?al("notifications.uploading"):rl,ml=bl||pl||dl;return jsxRuntimeExports.jsxs(LoginContainer,{className:"login-desktop-container IncodeLoginDesktopContainer",children:[jsxRuntimeExports.jsx(HiddenTitle,{children:"Login Desktop"}),fl&&jsxRuntimeExports.jsxs(CaptureButtonContainer$1,{className:"capture-button-container IncodeLoginDesktopCaptureButtonContainer",initial:{scale:0},animate:{scale:1},children:[jsxRuntimeExports.jsx("p",{children:al("common.takePhoto")}),jsxRuntimeExports.jsx("button",{className:"capture-button",onClick:cl,type:"button",children:jsxRuntimeExports.jsx("img",{src:captureButton,alt:"capture button"})})]}),jsxRuntimeExports.jsxs(WebcamDesktopContainer,{className:"webcam-container IncodeLoginDesktopWebcamContainer",children:[jsxRuntimeExports.jsx(FaceMask$1,{desktop:!0,className:"face-mask-container IncodeLoginDesktopFaceMask",isCapturing:dl,isLoading:bl,error:pl,isUploading:ml,children:jsxRuntimeExports.jsx(FaceFrame$1,{src:faceFrame$1,alt:"face frame",className:classNames({hidden:Ul},"face-frame IncodeLoginDesktopFaceFrame")})}),jsxRuntimeExports.jsx(Webcam,{ref:el,type:"loginDesktop",videoSource:"user",onPlay:()=>{},isSelfie:!0,className:"video__selfie IncodeLoginDesktopWebcam",onError:oa,deviceId:Sa}),Rl&&jsxRuntimeExports.jsx(Notification$1,{className:"notification-container IncodeLoginDesktopNotification",isLoading:bl,isError:pl,"aria-live":"assertive",children:Rl})]}),jsxRuntimeExports.jsx("canvas",{id:"canvasFrame",hidden:!0})]})}function LoginWithChooseCamera(oa){const[aa,ba]=useDeviceId(),[Ea,Sa]=React.useState(!1);function Ta(Aa){Aa!=="error"&&ba(Aa),Sa(!0)}return Ea?jsxRuntimeExports.jsx(LoginDesktop,{deviceId:aa,...oa}):jsxRuntimeExports.jsx(ChooseCamera,{onCameraChosen:Ta})}function renderLoginDesktop(oa,{onSuccess:aa,onError:ba,timeout:Ea,stopAtAccessDenied:Sa}){const Ta=createRoot$1(oa),Aa={onSuccess:handleUnmountRoot(aa,Ta,oa),onError:handleUnmountRoot(ba,Ta,oa),onBoarding:this,timeout:Ea,stopAtAccessDenied:Sa};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(LoginWithChooseCamera,{...Aa})}),oa,Ta)}function renderLoginIncodeID(oa,{onCapture:aa,timeout:ba,stopAtAccessDenied:Ea,stopAtError:Sa,isOneToOne:Ta,oneToOneProps:Aa,showCustomCameraPermissionScreen:xa,isKiosk:wa=!1}){const ka=createRoot$1(oa),La={onSuccess:emptyFunc,onError:emptyFunc,onCapture:handleUnmountRoot(aa,ka,oa),onBoarding:this,timeout:ba,stopAtAccessDenied:Ea,stopAtError:Sa,isOneToOne:Ta,oneToOneProps:Aa,showCustomCameraPermissionScreen:xa,isKiosk:wa};return customRender(jsxRuntimeExports.jsx(App$1,{isKiosk:wa,children:jsxRuntimeExports.jsx(Login,{...La})}),oa,ka),{close:handleUnmountRoot(emptyFunc,ka,oa)}}function compareBackID({token:oa,image:aa}){return exports.api.post("/omni/videoselfie/compare-back-id/v2",{base64Image:aa},{headers:{"X-Incode-Hardware-Id":oa,"Content-Type":"application/json"}}).then(ba=>ba.data)}function compareBackOCR({token:oa,image:aa}){return exports.api.post("omni/videoselfie/compare-back-ocr/v2",{base64Image:aa},{headers:{"X-Incode-Hardware-Id":oa,"Content-Type":"application/json"}}).then(ba=>ba.data)}function compareID({token:oa,image:aa}){return exports.api.post("/omni/videoselfie/compare-id/v2",{base64Image:aa},{headers:{"X-Incode-Hardware-Id":oa,"Content-Type":"application/json"}}).then(ba=>ba.data)}async function compareInstantVerifyOTP({token:oa,code:aa}){return exports.api.get(`/omni/instant/confirm/otp?code=${aa}`,{headers:{"X-Incode-Hardware-Id":oa}}).then(ba=>ba.data).catch(ba=>Promise.reject(ba.response.data))}function compareOCR({token:oa,image:aa}){return exports.api.post("omni/videoselfie/compare-ocr/v2",{base64Image:aa},{headers:{"X-Incode-Hardware-Id":oa,"Content-Type":"application/json"}}).then(ba=>ba.data)}function connectToQueue({token:oa,queueName:aa=""}){return exports.api.post(`/omni/queue/conference/connect?queueName=${aa}`,{},{headers:{"X-Incode-Hardware-Id":oa}}).then(ba=>ba.data)}const Wrapper$2=qe$1.div`
|
|
2541
|
+
`,ChooseCamera=({onCameraChosen:oa,token:aa})=>{const[ba,Ea]=React.useState([]),Sa=React.useRef(null),Ta=React.useRef(),[Aa,xa]=React.useState(""),{t:wa}=useTranslation();React.useEffect(()=>()=>{var el;(el=Ta.current)==null||el.getTracks().forEach(nl=>{nl.stop()})},[]);const ka=()=>{oa(Aa)},La=async el=>{xa(el);const nl=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:el}}});Ta.current=nl,Sa.current.srcObject=nl};React.useEffect(()=>{(async()=>{try{const nl=[];if(await navigator.mediaDevices.getUserMedia({video:!0}),(await navigator.mediaDevices.enumerateDevices()).forEach(sl=>{sl.kind==="videoinput"&&nl.push(sl)}),nl.length===1)return oa(nl[0].deviceId);Ea(nl),La(nl[0].deviceId)}catch(nl){nl.constructor.name==="DOMException"&&(addEvent({code:"permissionDenied",payload:{message:"User denied to use camera."},token:aa}),nl.type="permissionDenied"),oa("error")}})()},[]);const tl=async el=>{await La(el.target.value)};return ba.length===0?null:jsxRuntimeExports.jsxs(ChooseCameraContainer,{className:"IncodeChooseCameraContainer",children:[jsxRuntimeExports.jsx("h1",{className:"IncodeChooseCameraTitle",children:wa("choseCamera.confirmCameraToUse")}),jsxRuntimeExports.jsx(PreviewVideo,{className:"IncodeChooseCameraPreviewVideo",autoPlay:!0,ref:Sa}),jsxRuntimeExports.jsx(CameraSelect,{className:"IncodeChooseCameraSelector",onChange:tl,children:ba.map(el=>jsxRuntimeExports.jsx("option",{value:el.deviceId,children:el.label},el.deviceId))}),jsxRuntimeExports.jsx(Button$a,{className:"IncodeChooseCameraButton",onClick:ka,children:wa("common.continue")})]})},version$1="1.76.0";function r$1(oa){for(var aa="",ba=0;ba<oa.length;++ba)if(ba>0){var Ea=oa[ba].toLowerCase();Ea!==oa[ba]?aa+=" ".concat(Ea):aa+=oa[ba]}else aa+=oa[ba].toUpperCase();return aa}function o(oa,aa){return function(ba,Ea){return Object.prototype.hasOwnProperty.call(ba,Ea)}(oa,aa)?oa[aa]:void 0}var i$1={default:"endpoint"},u={default:"tlsEndpoint"},a="Client timeout",R="Network connection error",c="Network request aborted",s$1="Response cannot be parsed",E="Blocked by CSP",f="The endpoint parameter is not a valid URL",d=r$1("WrongRegion"),l=r$1("SubscriptionNotActive"),_=r$1("UnsupportedVersion"),p=r$1("InstallationMethodRestricted"),v=r$1("HostnameRestricted"),O=r$1("IntegrationFailed"),I="API key required",h$1="API key not found",N="API key expired",T="Request cannot be parsed",m="Request failed",w="Request failed to process",A="Too many requests, rate limit exceeded",P="Not available for this origin",y="Not available with restricted header",D=I,S=h$1,L=N,U="3.8.6",b="9319";function g(oa,aa){var ba=[];return function(Ea,Sa){var Ta=5,Aa=(el=Ea,nl=__spreadArray$1([],el,!0),{current:function(){return nl[0]},postpone:function(){var sl=nl.shift();sl!==void 0&&nl.push(sl)},exclude:function(){nl.shift()}}),xa=(ka=100,La=3e3,tl=0,function(){return Math.random()*Math.min(La,ka*Math.pow(2,tl++))}),wa=Aa.current(),ka,La,tl,el,nl;if(wa===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var il=function(sl,al){return Sa(sl).catch(function(rl){if(al+1>=Ta)throw rl;(function(dl){if(!(dl instanceof Error))return!1;var pl=dl.message;return pl===E||pl===b})(rl)?Aa.exclude():Aa.postpone();var ll,cl=Aa.current();if(cl===void 0)throw rl;return(ll=xa(),new Promise(function(dl){return setTimeout(dl,ll)})).then(function(){return il(cl,al+1)})})};return il(wa,0)}(oa,function(Ea){var Sa=new Date,Ta=function(xa){return ba.push({url:Ea,startedAt:Sa,finishedAt:new Date,error:xa})},Aa=aa(Ea);return Aa.then(function(){return Ta()},Ta),Aa}).then(function(Ea){return[Ea,ba]})}var C="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",K=C,M="Failed to load the JS script of the agent";function B(oa){var aa;oa.scriptUrlPattern;var ba=oa.token,Ea=oa.apiKey,Sa=Ea===void 0?ba:Ea,Ta=__rest$3(oa,["scriptUrlPattern","token","apiKey"]),Aa=(aa=o(oa,"scriptUrlPattern"))!==null&&aa!==void 0?aa:C,xa=function(){var La=[],tl=function(){La.push({time:new Date,state:document.visibilityState})},el=function(nl,il,sl,al){return nl.addEventListener(il,sl,al),function(){return nl.removeEventListener(il,sl,al)}}(document,"visibilitychange",tl);return tl(),[La,el]}(),wa=xa[0],ka=xa[1];return Promise.resolve().then(function(){if(!Sa||typeof Sa!="string")throw new Error(I);var La=function(tl,el){return(Array.isArray(tl)?tl:[tl]).map(function(nl){return function(il,sl){var al=encodeURIComponent;return il.replace(/<[^<>]+>/g,function(rl){return rl==="<version>"?"3":rl==="<apiKey>"?al(sl):rl==="<loaderVersion>"?al(U):rl})}(String(nl),el)})}(Aa,Sa);return g(La,F)}).catch(function(La){throw ka(),function(tl){return tl instanceof Error&&tl.message===b?new Error(M):tl}(La)}).then(function(La){var tl=La[0],el=La[1];return ka(),tl.load(__assign$2(__assign$2({},Ta),{ldi:{attempts:el,visibilityStates:wa}}))})}function F(oa){return function(aa,ba,Ea,Sa){var Ta,Aa=document,xa="securitypolicyviolation",wa=function(La){var tl=new URL(aa,location.href),el=La.blockedURI;el!==tl.href&&el!==tl.protocol.slice(0,-1)&&el!==tl.origin||(Ta=La,ka())};Aa.addEventListener(xa,wa);var ka=function(){return Aa.removeEventListener(xa,wa)};return Promise.resolve().then(ba).then(function(La){return ka(),La},function(La){return new Promise(function(tl){return setTimeout(tl)}).then(function(){if(ka(),Ta)return Ea(Ta);throw La})})}(oa,function(){return function(aa){return new Promise(function(ba,Ea){var Sa=document.createElement("script"),Ta=function(){var xa;return(xa=Sa.parentNode)===null||xa===void 0?void 0:xa.removeChild(Sa)},Aa=document.head||document.getElementsByTagName("head")[0];Sa.onload=function(){Ta(),ba()},Sa.onerror=function(){Ta(),Ea(new Error(M))},Sa.async=!0,Sa.src=aa,Aa.appendChild(Sa)})}(oa)},function(){throw new Error(E)}).then(V)}function V(){var oa=window,aa="__fpjs_p_l_b",ba=oa[aa];if(function(Ea,Sa){var Ta,Aa=(Ta=Object.getOwnPropertyDescriptor)===null||Ta===void 0?void 0:Ta.call(Object,Ea,Sa);Aa!=null&&Aa.configurable?delete Ea[Sa]:Aa&&!Aa.writable||(Ea[Sa]=void 0)}(oa,aa),typeof(ba==null?void 0:ba.load)!="function")throw new Error(b);return ba}var k={load:B,defaultScriptUrlPattern:K,ERROR_SCRIPT_LOAD_FAIL:M,ERROR_API_KEY_EXPIRED:N,ERROR_API_KEY_INVALID:h$1,ERROR_API_KEY_MISSING:I,ERROR_BAD_REQUEST_FORMAT:T,ERROR_BAD_RESPONSE_FORMAT:s$1,ERROR_CLIENT_TIMEOUT:a,ERROR_CSP_BLOCK:E,ERROR_FORBIDDEN_ENDPOINT:v,ERROR_FORBIDDEN_HEADER:y,ERROR_FORBIDDEN_ORIGIN:P,ERROR_GENERAL_SERVER_FAILURE:m,ERROR_INSTALLATION_METHOD_RESTRICTED:p,ERROR_INTEGRATION_FAILURE:O,ERROR_INVALID_ENDPOINT:f,ERROR_NETWORK_ABORT:c,ERROR_NETWORK_CONNECTION:R,ERROR_RATE_LIMIT:A,ERROR_SERVER_TIMEOUT:w,ERROR_SUBSCRIPTION_NOT_ACTIVE:l,ERROR_TOKEN_EXPIRED:L,ERROR_TOKEN_INVALID:S,ERROR_TOKEN_MISSING:D,ERROR_UNSUPPORTED_VERSION:_,ERROR_WRONG_REGION:d,defaultEndpoint:i$1,defaultTlsEndpoint:u};let fingerprintApiKey;function setFingerprintApiKey(oa){fingerprintApiKey=oa}async function getFingerPrint(){return k.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(oa=>oa.get({extendedResult:!0}))}const fingerPrintUrl="/omni/add/device-fingerprint";function postFingerprint({hash:oa,ip:aa,deviceType:ba,token:Ea,data:Sa,osVersion:Ta,deviceModel:Aa,browser:xa,sdkVersion:wa,hasLiedBrowser:ka,hostingApp:La,ipLocation:tl}){return exports.api.post(fingerPrintUrl,{hash:oa,ip:aa,deviceType:ba,data:Sa,osVersion:Ta,deviceModel:Aa,browser:xa,hasLiedBrowser:ka,sdkVersion:wa,hostingApp:La,ipLocation:tl},{headers:{"X-Incode-Hardware-Id":Ea}}).then(el=>el.data).catch(el=>Promise.reject(el.response.data))}function formatDeviceModel({vendor:oa,model:aa}){return`${oa||""} ${aa||""}`.trim()}const emptyFingerprint={visitorId:void 0,ip:void 0,ipLocation:{country:{name:void 0},subdivisions:[],city:{name:void 0},latitude:void 0,longitude:void 0}};async function sendFingerprint({token:oa},aa=!0,ba=!0){var wa,ka,La;const Ea="WEBAPP",{os:Sa,device:Ta,browser:Aa}=getUAParserResults(),xa=ba?await getFingerPrint().catch(tl=>(addEvent({code:"fingerprintFetchFailed",payload:{message:tl.message},token:oa}),emptyFingerprint)):emptyFingerprint;return postFingerprint({hash:xa.visitorId||"",ip:aa&&xa.ip||"",deviceType:Ea,token:oa,data:JSON.stringify(xa),osVersion:`${Sa.name} ${Sa.version}`,deviceModel:formatDeviceModel(Ta),browser:`${Aa.name} ${Aa.version}`,hasLiedBrowser:isBrowserSimulation(),hostingApp:options.hostingApp,sdkVersion:version$1,ipLocation:{ipCountry:(wa=xa.ipLocation.country)==null?void 0:wa.name,ipRegion:(ka=xa.ipLocation.subdivisions)==null?void 0:ka[0].name,ipCity:(La=xa.ipLocation.city)==null?void 0:La.name,ipLatitude:xa.ipLocation.latitude,ipLongitude:xa.ipLocation.longitude}}).then(tl=>(emptyDeviceStatsQueue(oa),tl))}function mapI18nLang(oa){const aa={en:"en-US",es:"es-ES",pt:"pt-BR"},ba=oa==null?void 0:oa.substring(0,2);return aa[ba]||"en-US"}const createSessionUrl="/omni/start";async function createNewSession({externalId:oa,externalCustomerId:aa,configurationId:ba,uuid:Ea,interviewId:Sa,customFields:Ta,language:Aa}={}){const xa=Aa||mapI18nLang(i18n.language);try{const wa=await exports.api.post(createSessionUrl,{externalId:oa,externalCustomerId:aa,configurationId:ba,uuid:Ea,interviewId:Sa,customFields:Ta,language:xa});state$1.token=wa.data;const ka=wa.data;emptyQueue(ka.token);const La=await sendFingerprint({token:ka.token,interviewId:ka.interviewId}).catch(()=>({regulationType:"",showMandatoryConsent:!1}));ka.regulationType=La.regulationType??"",ka.showMandatoryConsent=La.showMandatoryConsent??!1;const el=new UAParser().getResult();return addEvent({code:"browser",payload:{userAgent:window.navigator.userAgent,isWebRtcSupported:isWebRtcSupported(),...el},token:ka.token}),ka}catch(wa){throw wa!=null&&wa.response?wa.response.data:wa}}function LoginDesktop({onError:oa,onSuccess:aa,timeout:ba=4e4,stopAtAccessDenied:Ea=!1,deviceId:Sa,oneToOneProps:Ta}){const[Aa,xa]=React.useState("selfie"),[wa,ka]=React.useState(""),[La,tl]=React.useState(""),el=React.useRef(null),nl=React.useRef(!1),il=throttle$1(async(yl,Nl)=>{MlWasmJSApi$1.resetAllPipelines();const Fl=yl.getBase64Image();await identify({base64Image:Fl,faceCoordinates:Nl,authReference:Ta==null?void 0:Ta.authReference}).then(async Tl=>{const Il=Tl.spoofAttempt===!1,Vl=!!Tl.customerId&&!Tl.error,Jl=Tl.secondFactor,Pl=Tl.hasLenses,Gl=Tl.hasFaceMask;if(Jl){xa("secondFactor"),ka(Tl.transactionId),tl(Fl);return}if(!Il||!Vl||Gl||Pl){if(xl("error"),El((()=>{switch(!0){case Gl:return al("notifications.faceMask");case Pl:return al("notifications.lenses");case!Il:return al("notifications.spoof");case!Vl:return al("selfie.accessDenied");default:return""}})()),await sleep(3e3),!Vl&&Ea){const Zc=new Error("AccessDenied");console.dir(Zc),oa(Zc);return}Bl({response:Tl,livenessPassed:Il,imageBase64:Fl}),ll();return}sl(Tl,Fl)}).catch(async Tl=>{var Il;console.error(Tl),Wl(Tl||al("notifications.serverError")),xl("error"),await sleep(3e3),Bl({response:(Il=Tl==null?void 0:Tl.response)==null?void 0:Il.data,livenessPassed:null,imageBase64:Fl}),ll()})},300);async function sl(yl,Nl){const Fl=await createNewSession({interviewId:yl.interviewId});aa({...yl,token:Fl.token,base64Image:Nl||La})}const{t:al}=useTranslation(),{notificationMessage:rl,startAutoDetect:ll,handleManualCapture:cl,isSuccess:dl,isError:pl,isLoading:bl,hideCamera:Ul,shouldShowManualCapture:fl,handleError:Wl,setMode:xl,resetLoading:Bl,setNotificationMessage:El}=useSelfie({timeout:ba,isDetecting:nl,handleCapture:il,numberOfTries:-1,webcam:el});if(Aa==="secondFactor")return jsxRuntimeExports.jsx(SecondFactor,{transactionId:wa,onSuccess:sl});const Rl=bl?al("notifications.uploading"):rl,ml=bl||pl||dl;return jsxRuntimeExports.jsxs(LoginContainer,{className:"login-desktop-container IncodeLoginDesktopContainer",children:[jsxRuntimeExports.jsx(HiddenTitle,{children:"Login Desktop"}),fl&&jsxRuntimeExports.jsxs(CaptureButtonContainer$1,{className:"capture-button-container IncodeLoginDesktopCaptureButtonContainer",initial:{scale:0},animate:{scale:1},children:[jsxRuntimeExports.jsx("p",{children:al("common.takePhoto")}),jsxRuntimeExports.jsx("button",{className:"capture-button",onClick:cl,type:"button",children:jsxRuntimeExports.jsx("img",{src:captureButton,alt:"capture button"})})]}),jsxRuntimeExports.jsxs(WebcamDesktopContainer,{className:"webcam-container IncodeLoginDesktopWebcamContainer",children:[jsxRuntimeExports.jsx(FaceMask$1,{desktop:!0,className:"face-mask-container IncodeLoginDesktopFaceMask",isCapturing:dl,isLoading:bl,error:pl,isUploading:ml,children:jsxRuntimeExports.jsx(FaceFrame$1,{src:faceFrame$1,alt:"face frame",className:classNames({hidden:Ul},"face-frame IncodeLoginDesktopFaceFrame")})}),jsxRuntimeExports.jsx(Webcam,{ref:el,type:"loginDesktop",videoSource:"user",onPlay:()=>{},isSelfie:!0,className:"video__selfie IncodeLoginDesktopWebcam",onError:oa,deviceId:Sa}),Rl&&jsxRuntimeExports.jsx(Notification$1,{className:"notification-container IncodeLoginDesktopNotification",isLoading:bl,isError:pl,"aria-live":"assertive",children:Rl})]}),jsxRuntimeExports.jsx("canvas",{id:"canvasFrame",hidden:!0})]})}function LoginWithChooseCamera(oa){const[aa,ba]=useDeviceId(),[Ea,Sa]=React.useState(!1);function Ta(Aa){Aa!=="error"&&ba(Aa),Sa(!0)}return Ea?jsxRuntimeExports.jsx(LoginDesktop,{deviceId:aa,...oa}):jsxRuntimeExports.jsx(ChooseCamera,{onCameraChosen:Ta})}function renderLoginDesktop(oa,{onSuccess:aa,onError:ba,timeout:Ea,stopAtAccessDenied:Sa}){const Ta=createRoot$1(oa),Aa={onSuccess:handleUnmountRoot(aa,Ta,oa),onError:handleUnmountRoot(ba,Ta,oa),onBoarding:this,timeout:Ea,stopAtAccessDenied:Sa};customRender(jsxRuntimeExports.jsx(App$1,{children:jsxRuntimeExports.jsx(LoginWithChooseCamera,{...Aa})}),oa,Ta)}function renderLoginIncodeID(oa,{onCapture:aa,timeout:ba,stopAtAccessDenied:Ea,stopAtError:Sa,isOneToOne:Ta,oneToOneProps:Aa,showCustomCameraPermissionScreen:xa,isKiosk:wa=!1}){const ka=createRoot$1(oa),La={onSuccess:emptyFunc,onError:emptyFunc,onCapture:handleUnmountRoot(aa,ka,oa),onBoarding:this,timeout:ba,stopAtAccessDenied:Ea,stopAtError:Sa,isOneToOne:Ta,oneToOneProps:Aa,showCustomCameraPermissionScreen:xa,isKiosk:wa};return customRender(jsxRuntimeExports.jsx(App$1,{isKiosk:wa,children:jsxRuntimeExports.jsx(Login,{...La})}),oa,ka),{close:handleUnmountRoot(emptyFunc,ka,oa)}}function compareBackID({token:oa,image:aa}){return exports.api.post("/omni/videoselfie/compare-back-id/v2",{base64Image:aa},{headers:{"X-Incode-Hardware-Id":oa,"Content-Type":"application/json"}}).then(ba=>ba.data)}function compareBackOCR({token:oa,image:aa}){return exports.api.post("omni/videoselfie/compare-back-ocr/v2",{base64Image:aa},{headers:{"X-Incode-Hardware-Id":oa,"Content-Type":"application/json"}}).then(ba=>ba.data)}function compareID({token:oa,image:aa}){return exports.api.post("/omni/videoselfie/compare-id/v2",{base64Image:aa},{headers:{"X-Incode-Hardware-Id":oa,"Content-Type":"application/json"}}).then(ba=>ba.data)}async function compareInstantVerifyOTP({token:oa,code:aa}){return exports.api.get(`/omni/instant/confirm/otp?code=${aa}`,{headers:{"X-Incode-Hardware-Id":oa}}).then(ba=>ba.data).catch(ba=>Promise.reject(ba.response.data))}function compareOCR({token:oa,image:aa}){return exports.api.post("omni/videoselfie/compare-ocr/v2",{base64Image:aa},{headers:{"X-Incode-Hardware-Id":oa,"Content-Type":"application/json"}}).then(ba=>ba.data)}function connectToQueue({token:oa,queueName:aa=""}){return exports.api.post(`/omni/queue/conference/connect?queueName=${aa}`,{},{headers:{"X-Incode-Hardware-Id":oa}}).then(ba=>ba.data)}const Wrapper$2=qe$1.div`
|
|
2539
2542
|
display: flex;
|
|
2540
2543
|
flex-direction: column;
|
|
2541
2544
|
align-items: center;
|
|
@@ -4203,13 +4206,14 @@ ${Ea.publicKey}
|
|
|
4203
4206
|
justify-content: center;
|
|
4204
4207
|
height: 100%;
|
|
4205
4208
|
|
|
4206
|
-
video
|
|
4209
|
+
video,
|
|
4210
|
+
img {
|
|
4207
4211
|
display: flex;
|
|
4208
|
-
height: calc(100vh * 0.5);
|
|
4212
|
+
height: calc(100vh * 0.5) !important;
|
|
4209
4213
|
}
|
|
4210
4214
|
`,TutorialContainer$1=qe$1.div`
|
|
4211
4215
|
padding: 0 10px;
|
|
4212
|
-
height:
|
|
4216
|
+
height: 100dvh;
|
|
4213
4217
|
width: 100%;
|
|
4214
4218
|
display: flex;
|
|
4215
4219
|
flex-direction: column;
|
|
@@ -4352,6 +4356,7 @@ ${Ea.publicKey}
|
|
|
4352
4356
|
|
|
4353
4357
|
img {
|
|
4354
4358
|
width: 73px !important;
|
|
4359
|
+
height: unset !important;
|
|
4355
4360
|
}
|
|
4356
4361
|
`,AgeStep=qe$1.div`
|
|
4357
4362
|
display: flex;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "./dist/onBoarding.umd.js",
|
|
4
4
|
"module": "./dist/onBoarding.mjs",
|
|
5
5
|
"types": "./dist/incode-welcome/src/index.d.ts",
|
|
6
|
-
"version": "1.76.0
|
|
6
|
+
"version": "1.76.0",
|
|
7
7
|
"publishConfig": {},
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
"files": [
|
|
21
|
-
"dist/**"
|
|
22
|
-
],
|
|
20
|
+
"files": ["dist/**"],
|
|
23
21
|
"scripts": {
|
|
24
22
|
"dev": "vite",
|
|
25
23
|
"test": "vitest",
|