@incodetech/welcome 1.94.0-rc.20261006000629 → 1.94.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.
@@ -157494,7 +157494,7 @@ i$2("math", function() {
157494
157494
  });
157495
157495
  });
157496
157496
  });
157497
- const version$3 = "1.94.0-rc.20261006000629", devDependencies = {
157497
+ const version$3 = "1.94.0", devDependencies = {
157498
157498
  "@fingerprintjs/fingerprintjs-pro": "3.12.3",
157499
157499
  "@thumbmarkjs/thumbmarkjs": "0.20.6"
157500
157500
  };
@@ -157582,7 +157582,7 @@ async function getFingerprintFromThumbprint(Be) {
157582
157582
  async function getFingerprint(Be = !1) {
157583
157583
  return isOfflineMode() ? getFingerprintFromThumbprint(!0) : getFeatureFlag("new_fingerprint") ? getFingerprintFromThumbprint(Be) : getFingerPrintFromFingerprint(Be);
157584
157584
  }
157585
- const SDK_BUILD_VERSION = "1.94.0-rc.20261006000629+23915a3";
157585
+ const SDK_BUILD_VERSION = "1.94.0+b0813bc";
157586
157586
  class MetadataUtils {
157587
157587
  async initializeMetadata(Le, Ye = !1) {
157588
157588
  MlWasmJSApi$1.setSdkPlatform("WEBAPP"), MlWasmJSApi$1.setSdkVersion(Le || SDK_BUILD_VERSION);
@@ -357972,7 +357972,7 @@ function init(Be = {}) {
357972
357972
  };
357973
357973
  return initAndBind(BrowserClient, tt);
357974
357974
  }
357975
- const DEPRECATION_PERIOD_MONTHS = 12, SDK_RELEASE_DATE = "2026-10-06", DEPRECATED_SDK_WARNING_MESSAGE = "You are using a deprecated SDK version. Please upgrade to the latest version to avoid any disruption.";
357975
+ const DEPRECATION_PERIOD_MONTHS = 12, SDK_RELEASE_DATE = "2026-10-10", DEPRECATED_SDK_WARNING_MESSAGE = "You are using a deprecated SDK version. Please upgrade to the latest version to avoid any disruption.";
357976
357976
  let hasWarned = !1;
357977
357977
  const parseReleaseDate = (Be) => {
357978
357978
  const Le = /^(\d{4})-(\d{2})-(\d{2})$/.exec(Be);
@@ -2505,7 +2505,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2505
2505
  void main() {
2506
2506
  gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
2507
2507
  }
2508
- `,nt=F.createShader(F.VERTEX_SHADER),ft=F.createShader(F.FRAGMENT_SHADER);if(!nt||!ft)throw new Error("Failed to create shaders");if(F.shaderSource(nt,Ye),F.shaderSource(ft,tt),F.compileShader(nt),!F.getShaderParameter(nt,F.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+F.getShaderInfoLog(nt));if(F.compileShader(ft),!F.getShaderParameter(ft,F.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+F.getShaderInfoLog(ft));var ht=F.createProgram();if(!ht)throw new Error("Failed to create shader program");if(F.attachShader(ht,nt),F.attachShader(ht,ft),F.linkProgram(ht),!F.getProgramParameter(ht,F.LINK_STATUS))throw new Error("Shader program linking failed: "+F.getProgramInfoLog(ht));F.useProgram(ht);for(var gt=137,At=new Float32Array(4*gt),xt=2*Math.PI/gt,Et=0;Et<gt;Et++){var kt=Et*xt;At[4*Et]=0,At[4*Et+1]=0,At[4*Et+2]=Math.cos(kt)*(U.width/2),At[4*Et+3]=Math.sin(kt)*(U.height/2)}var Ct=F.createBuffer();F.bindBuffer(F.ARRAY_BUFFER,Ct),F.bufferData(F.ARRAY_BUFFER,At,F.STATIC_DRAW);var yt=F.getAttribLocation(ht,"position");F.enableVertexAttribArray(yt),F.vertexAttribPointer(yt,2,F.FLOAT,!1,0,0),F.viewport(0,0,U.width,U.height),F.clearColor(0,0,0,1),F.clear(F.COLOR_BUFFER_BIT),F.drawArrays(F.LINES,0,2*gt);var vt=new Uint8ClampedArray(U.width*U.height*4);return F.readPixels(0,0,U.width,U.height,F.RGBA,F.UNSIGNED_BYTE,vt),new ImageData(vt,U.width,U.height)}catch{return new ImageData(1,1)}finally{F&&(F.bindBuffer(F.ARRAY_BUFFER,null),F.useProgram(null),F.viewport(0,0,F.drawingBufferWidth,F.drawingBufferHeight),F.clearColor(0,0,0,0))}}()}),[2,{commonImageHash:d(E(Be,U.width,U.height).data.toString()).toString()}]}catch{return[2,{webgl:"unsupported"}]}return[2]})})});var j=function(Be,Le,Ye,tt){for(var nt=(Ye-Le)/tt,ft=0,ht=0;ht<tt;ht++)ft+=Be(Le+(ht+.5)*nt);return ft*nt};i$2("math",function(){return e(void 0,void 0,void 0,function(){return n(this,function(Be){return[2,{acos:Math.acos(.5),asin:j(Math.asin,-1,1,97),atan:j(Math.atan,-1,1,97),cos:j(Math.cos,0,Math.PI,97),cosh:Math.cosh(9/7),e:Math.E,largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),log:Math.log(1e3),pi:Math.PI,sin:j(Math.sin,-Math.PI,Math.PI,97),sinh:j(Math.sinh,-9/7,7/9,97),sqrt:Math.sqrt(2),tan:j(Math.tan,0,2*Math.PI,97),tanh:j(Math.tanh,-9/7,7/9,97)}]})})});const version$3="1.94.0-rc.20261006000629",devDependencies={"@fingerprintjs/fingerprintjs-pro":"3.12.3","@thumbmarkjs/thumbmarkjs":"0.20.6"};let fingerprintApiKey;function setFingerprintApiKey(Be){fingerprintApiKey=Be}const FINGERPRINT_PRO_ALGORITHM={algorithmName:"fingerprintjs-pro",algorithmVersion:devDependencies["@fingerprintjs/fingerprintjs-pro"]},THUMBMARK_ALGORITHM={algorithmName:"thumbmarkjs",algorithmVersion:devDependencies["@thumbmarkjs/thumbmarkjs"]};let fingerPrintPromise=null;const FINGERPRINT_STORAGE_KEY="fingerprint_result";let ipPromise=null;async function getIp(){if(ipPromise)return ipPromise;if(AbortSignal.timeout)ipPromise=fetch("https://api.ipify.org?format=json",{signal:AbortSignal.timeout(3e3)}).then(Be=>Be.json()).then(Be=>Be.ip).catch(()=>"");else{const Be=new Promise((Le,Ye)=>{setTimeout(()=>Ye(new Error("Request timeout")),3e3)});ipPromise=Promise.race([fetch("https://api.ipify.org?format=json").then(Le=>Le.json()).then(Le=>Le.ip),Be]).catch(()=>"")}return ipPromise}function getCachedFingerprint(){try{const Be=localStorage.getItem(FINGERPRINT_STORAGE_KEY);return Be?JSON.parse(Be):null}catch{return null}}function setCachedFingerprint(Be){try{localStorage.setItem(FINGERPRINT_STORAGE_KEY,JSON.stringify({visitorId:Be.visitorId}))}catch{}}async function getFingerPrintFromFingerprint(Be){const Le=getCachedFingerprint();return Le?Promise.resolve({visitorId:Le.visitorId,ip:Be?void 0:await getIp(),...FINGERPRINT_PRO_ALGORITHM}):fingerPrintPromise||(fingerPrintPromise=H.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(Ye=>Ye.get({extendedResult:!0})).then(Ye=>(setCachedFingerprint(Ye),{visitorId:Ye.visitorId,ip:Ye.ip,...FINGERPRINT_PRO_ALGORITHM})),fingerPrintPromise)}let thumbprintPromise=null;async function getFingerprintFromThumbprint(Be){return thumbprintPromise||(thumbprintPromise=w$9().then(async Le=>({visitorId:Le,ip:Be?void 0:await getIp(),...THUMBMARK_ALGORITHM})),thumbprintPromise)}async function getFingerprint(Be=!1){return isOfflineMode()?getFingerprintFromThumbprint(!0):getFeatureFlag("new_fingerprint")?getFingerprintFromThumbprint(Be):getFingerPrintFromFingerprint(Be)}const SDK_BUILD_VERSION="1.94.0-rc.20261006000629+23915a3";class MetadataUtils{async initializeMetadata(Le,Ye=!1){MlWasmJSApi$1.setSdkPlatform("WEBAPP"),MlWasmJSApi$1.setSdkVersion(Le||SDK_BUILD_VERSION);const{os:tt,device:nt}=getUAParserResults(),ft=await getFingerprint(Ye).catch(At=>({visitorId:"",ip:""})),ht={kind:mobile.isDesktop()?"desktop":"mobile",model:`${nt.vendor||""} ${nt.model||""}`.trim(),os:tt.name,osVersion:tt.version,screenDimensions:{width:screen.width,height:screen.height},numTouchPoints:navigator.maxTouchPoints,fingerprintHash:ft.visitorId||"",ip:ft.ip||"",backgroundMode:!1};MlWasmJSApi$1.setDeviceInfo(ht);const gt={userAgent:navigator.userAgent,getUserMediaAvailability:{webkit:navigator.webkitGetUserMedia!==void 0,moz:navigator.mozGetUserMedia!==void 0,o:navigator.oGetUserMedia!==void 0,ms:navigator.msGetUserMedia!==void 0},webglFingerprint:webgl(),inspectorOpened:!1,isMockedBrowser:isBrowserSimulation()};MlWasmJSApi$1.setBrowserInfo(gt,!1),FingerprintSignalsReporter$1.start()}updateCameraInfo(Le){const Ye=Le.getSettings(),tt=Le.getCapabilities?Le.getCapabilities():{},nt=Le.label?[Le.label]:[],ht={facingMode:Ye.facingMode==="user"?"frontal":Ye.facingMode==="environment"?"back":Ye.facingMode||"unknown",settings:Ye,capabilities:tt,labels:nt};MlWasmJSApi$1.setCameraInfo(ht),FingerprintSignalsReporter$1.markFingerprintDataUpdated()}}class MotionStatusCheck{constructor(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,kt,Ct){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=10,this.maxFrequency_=60,this.maxPoints_=1200,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.deviceMotionListener=yt=>{if(yt.accelerationIncludingGravity){const vt={x:yt.accelerationIncludingGravity.x,y:yt.accelerationIncludingGravity.y,z:yt.accelerationIncludingGravity.z};this.checkFields(vt)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,vt))}if(yt.acceleration){const vt={x:yt.acceleration.x,y:yt.acceleration.y,z:yt.acceleration.z};this.checkFields(vt)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,vt))}if(yt.rotationRate){const vt={x:yt.rotationRate.alpha,y:yt.rotationRate.beta,z:yt.rotationRate.gamma};this.checkFields(vt)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,vt))}},this.deviceOrientationListener=yt=>{const vt={x:yt.alpha,y:yt.beta,z:yt.gamma};this.checkFields(vt)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,vt))},this.accThreshold_=Le,this.gyroThreshold_=Ye,this.accGrOldThreshold_=tt,this.accOldThreshold_=nt,this.gyroscopeOldThreshold_=ft,this.orientationOldThreshold_=ht,this.maeAccThreshold_=gt,this.maeGyroThreshold_=At,this.maeAccGrOldThreshold_=xt,this.maeAccOldThreshold_=Et,this.maeGyroscopeOldThreshold_=kt,this.maeOrientationOldThreshold_=Ct}async requestMotionPermission(){return DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"?(sessionStorage.setItem("motionSensorsPermissionsRequested",String(!0)),DeviceMotionEvent.requestPermission().then(Le=>(Le!=="granted"&&(this.permission_=!1),Le)).catch(console.error)):"granted"}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!this.isRunning_||!this.acl_)return;const Le={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(Le)&&(this.paramsAcc_.ptsNum+=1,this.updateParams(this.paramsAcc_,Le))}updateGyro(){if(!this.isRunning_||!this.gyro_)return;const Le={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(Le)&&(this.paramsGyro_.ptsNum+=1,this.updateParams(this.paramsGyro_,Le))}check(){if(!this.permission_)return"UNCLEAR";const Le=this.checkStability();return Le===null?"UNCLEAR":Le?"FAIL":"PASS"}getDetails(){return{aggregate:this.check(),permissionGranted:this.permission_,hasAccelerometer:this.acl_!==null,hasGyroscope:this.gyro_!==null,isRunning:this.isRunning_}}checkStability(){if(!this.isRunning_)return null;const Ye=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(gt=>gt!==null),tt=Ye.length>0?Ye.every(gt=>gt):null,ft=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(gt=>gt!==null),ht=ft.length>0?ft.every(gt=>gt):null;return tt===null?ht===null?null:ht:ht!==null?tt&&ht:tt}updateParams(Le,Ye){Le.ptsNum>this.maxPoints_&&(this.resetParams(Le),Le.ptsNum=1);const tt=Ye.x-Le.meanX,nt=Ye.y-Le.meanY,ft=Ye.z-Le.meanZ;Le.meanX+=tt/Le.ptsNum,Le.meanY+=nt/Le.ptsNum,Le.meanZ+=ft/Le.ptsNum,Le.m2X+=tt*(Ye.x-Le.meanX),Le.m2Y+=nt*(Ye.y-Le.meanY),Le.m2Z+=ft*(Ye.z-Le.meanZ),Le.cumulativeAbsErrorX+=Math.abs(Ye.x-Le.meanX),Le.cumulativeAbsErrorY+=Math.abs(Ye.y-Le.meanY),Le.cumulativeAbsErrorZ+=Math.abs(Ye.z-Le.meanZ)}resetParams(Le){Le.meanX=0,Le.meanY=0,Le.meanZ=0,Le.m2X=0,Le.m2Y=0,Le.m2Z=0,Le.cumulativeAbsErrorX=0,Le.cumulativeAbsErrorY=0,Le.cumulativeAbsErrorZ=0,Le.ptsNum=0}calculateStd(Le){const Ye={x:Le.m2X/Le.ptsNum,y:Le.m2Y/Le.ptsNum,z:Le.m2Z/Le.ptsNum};return{x:Math.sqrt(Ye.x),y:Math.sqrt(Ye.y),z:Math.sqrt(Ye.z)}}calculateMae(Le){return{x:Le.cumulativeAbsErrorX/Le.ptsNum,y:Le.cumulativeAbsErrorY/Le.ptsNum,z:Le.cumulativeAbsErrorZ/Le.ptsNum}}checkFields(Le){return Le.x!==null&&Le.y!==null&&Le.z!==null}isBelowStdThreshold(Le,Ye){if(Le.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateStd(Le);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}isBelowMaeThreshold(Le,Ye){if(Le.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateMae(Le);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}}class OnboardingAnalytics extends MetadataUtils{constructor(){super(),this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.backgroundModeDetected=!1,this.simdIsEnabled=null,this.wasmVersion=null,this.profiles=null,this.metadata="",this.onDeviceBarcodeDecoded=!1,this.motionStatusCheck=new MotionStatusCheck(.1,.005,.1,.1,.5,2.5,.1,.005,.1,.1,.5,2.5),document.addEventListener("visibilitychange",()=>{this.backgroundModeDetected=!0})}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setOnDeviceBarcodeDecoded(Le){this.onDeviceBarcodeDecoded=Le}getOnDeviceBarcodeDecoded(){return this.onDeviceBarcodeDecoded}setSimdIsEnabled(Le){this.simdIsEnabled=Le}setWasmVersion(Le){this.wasmVersion=Le}setProfiles(Le){this.profiles=Le}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getMotionStatusCheck(){return this.motionStatusCheck}getAnalysisStatus(){return this.analysisStatus}getMetadata(){return this.metadata}async analyzeFrame(Le){const Ye=await base64ToImageData(Le);await MlWasmJSApi$1.analyzeFrame(Ye)}async startOnboardingCheck(){return this.motionStatusCheck.requestMotionPermission()}async startMotionSensors(Le){this.motionStatusCheck.start();try{await MlWasmJSApi$1.rsp(Le),MlWasmJSApi$1.ssl(Le)}catch(Ye){appLog.warn("sensors",`startMotionSensors failed ${appLog.describeError(Ye)}`)}}stopMotionSensors(){this.motionStatusCheck.stop()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}update(){if(MlWasmJSApi$1.isInitialized())try{const Le=MlWasmJSApi$1.getWorkflowState();if(Le!==""){const Ye=JSON.parse(Le);Ye.profiles=Array.from(this.profiles.values()).map(nt=>WasmWorkflowProfileName[nt.name]),Ye.estimatedPerformance=this.estimatedPerformance,Ye.simdIsEnabled=this.simdIsEnabled,Ye.wasmVersion=this.wasmVersion,this.pipelineLogs=Ye;const tt=this.motionStatusCheck.check();this.motionStatus!=="PASS"&&(this.motionStatus=tt),MlWasmJSApi$1.setMotionStatus(this.motionStatus),this.analysisStatus=MlWasmJSApi$1.getCheck()}MlWasmJSApi$1.setBackgroundMode(this.backgroundModeDetected),this.metadata=MlWasmJSApi$1.getMetadata(),this.backgroundModeDetected=!1}catch(Le){console.error(`Exception: ${Le}`)}}}const onboardingAnalytics=OnboardingAnalytics.getInstance(),ENFORCE_KEY="incode_enforce_capture_attempts",BUDGET_KEY="incode_capture_attempt_budget",getEnforceStorageKey=Be=>`${ENFORCE_KEY}_${Be}`,getBudgetStorageKey=(Be,Le)=>`${BUDGET_KEY}_${Be}_${Le}`,readBudget=(Be,Le)=>{try{const Ye=sessionStorage.getItem(getBudgetStorageKey(Be,Le));if(Ye){const tt=JSON.parse(Ye);if(tt&&typeof tt=="object")return{used:typeof tt.used=="number"&&tt.used>0?tt.used:0,max:typeof tt.max=="number"?tt.max:null,remaining:typeof tt.remaining=="number"?Math.max(0,tt.remaining):null}}}catch{}return{used:0,max:null,remaining:null}},writeBudget=(Be,Le,Ye)=>{try{sessionStorage.setItem(getBudgetStorageKey(Be,Le),JSON.stringify(Ye))}catch{}},recordEnforceCaptureAttemptLimits=(Be,Le)=>{if(!(!Be||typeof Le!="boolean"))try{sessionStorage.setItem(getEnforceStorageKey(Be),Le?"1":"0")}catch{}},isCaptureAttemptEnforcementEnabled=Be=>{if(!Be)return!1;try{return sessionStorage.getItem(getEnforceStorageKey(Be))==="1"}catch{return!1}},recordCaptureAttempt=(Be,Le)=>{if(!isCaptureAttemptEnforcementEnabled(Be))return;const Ye=readBudget(Be,Le);writeBudget(Be,Le,{...Ye,used:Ye.used+1,remaining:Ye.remaining===null?null:Math.max(0,Ye.remaining-1)})},applyBackendAttemptsLimit=(Be,Le,Ye)=>{if(!Be||!Ye||typeof Ye!="object"||typeof Ye.max!="number"&&typeof Ye.remaining!="number")return;const tt=readBudget(Be,Le);writeBudget(Be,Le,{used:tt.used,max:typeof Ye.max=="number"?Ye.max:tt.max,remaining:typeof Ye.remaining=="number"?Math.max(0,Ye.remaining):tt.remaining})},getEnforcedAttemptsLeft=(Be,Le,Ye)=>{if(!isCaptureAttemptEnforcementEnabled(Be))return null;const tt=readBudget(Be,Le);if(tt.remaining!==null)return tt.remaining;const nt=tt.max??Ye;return!Number.isFinite(nt)||nt<=0?null:Math.max(0,nt-tt.used)},defaultFlow$1={name:"",checkTutorials:!0,checkAuthorization:!0,redirectDesktopToMobile:!1,disableUnsupportedBrowserScreen:!1,qrPhishingResistance:!1,addContinueToDesktop:!1,redirectOriginOnly:!1,displayOnboardingResultOnDesktop:!1,enableMultipleOnboardings:!1,disableLaunchScreen:!1,disableSmsOption:!1,mergeSessionRecordings:!1,mandatoryConsentCheck:!0,enableSardineRisk:!1,flowModules:[{key:"PHONE",configuration:{otpVerification:!1,otpExpirationInMinutes:10,prefill:!1}},{key:"GEOLOCATION",configuration:{allowUserToSkipGeolocation:!1}},{key:"ID",configuration:{showTutorial:!0,enableId:!0,enablePassport:!0,onlyFront:!1,onlyBack:!1,barcodeCapture:!1,fetchAdditionalPage:!1,secondId:!1,autoCaptureTimeout:18,deviceIdleTimeout:60,captureAttempts:3,manualUploadIdCapture:!1,deviceWallet:!1,digiLocker:!1,showDocumentChooserScreen:!0,enableIdRecording:!0,perCountryPerDocOverrides:{}}},{key:"ADDRESS",configuration:{disableSkipPoa:!1,title:"",text:""}},{key:"ID_OCR",configuration:{editableOcr:!1}},{key:"SELFIE",configuration:{showTutorial:!0,showPreview:!1,assistedOnboarding:!1,enableFaceRecording:!0,autoCaptureTimeout:20,captureAttempts:3,validateLenses:!0,validateFaceMask:!0,validateHeadCover:!0,validateClosedEyes:!0,validateBrightness:!0,deepsightLiveness:"SINGLE_FRAME"}},{key:"FACE_MATCH",configuration:{matchingType:"selfieVsId",disableFaceMatchAnimation:!1}},{key:"SIGNATURE",configuration:{title:"",subTitle:""}},{key:"VIDEO_ONBOARDING",configuration:{useAsSelfie:!1,showTutorials:!0,companyName:"",checkLiveness:!0,checkIdScan:!0,checkDocumentScan:!0,compareIdEnabled:!0,compareOcrEnabled:!1,compareBackIdEnabled:!1,compareBackOcrEnabled:!1,checkVoiceConsent:!0,voiceConsentQuestions:0,selfieQualityAffectsScore:!1,maxWaitingVideoSelfieFile:0,lastSecondsVideoQualityCheck:!1,lastSecondsVideoQualityCheckDuration:0}}]};function normalizeFlowModules(Be){const Le=Be.flatMap((ft,ht,gt)=>{if(ft.key==="TUTORIAL_ID"){const xt=ft.configuration,kt=[{key:"ID",configuration:xt}];return xt.secondId&&kt.push({key:"SECOND_ID",configuration:xt}),kt}const At=gt[ht-1];return ft.key==="ID"&&(At==null?void 0:At.key)==="TUTORIAL_ID"?[]:[ft]}),Ye=ft=>ft,tt=ft=>ft.filter(ht=>ht.key!=="SELFIE");return(Le.some(ft=>ft.key==="VIDEO_ONBOARDING"&&ft.configuration.useAsSelfie===!0)?tt:Ye)(Le)}function handleResponse(Be){const Le=Be.data,Ye=normalizeFlowModules(Le.flowModules);return{...Le,flowModules:Ye}}async function getFlow$1(Be){var Le,Ye;try{const tt=await api.get("/omni/onboarding/flow",{headers:{"X-Incode-Hardware-Id":Be}});return recordEnforceCaptureAttemptLimits(Be,(Le=tt.data)==null?void 0:Le.enforceCaptureAttemptLimits),handleResponse(tt)}catch(tt){if(tt instanceof WebClientError&&((Ye=tt.response)==null?void 0:Ye.status)===400)return defaultFlow$1;throw tt}}const PERMISSION_ERROR_CODES={DENIED:"PERMISSION_DENIED",REFRESH:"PERMISSION_REFRESH"},PERMISSION_ERROR_MESSAGE="Error in permissions",createPermissionError=Be=>({code:Be,message:PERMISSION_ERROR_MESSAGE,error:new Error(Be)});var FlowType=(Be=>(Be.ID="ID",Be.FACE="Face",Be))(FlowType||{});function getErrorStatusCode(Be){var tt;if(Be instanceof WebClientError)return Be.statusCode;const Le=Be,Ye=(Le==null?void 0:Le.statusCode)??((tt=Le==null?void 0:Le.response)==null?void 0:tt.status)??(Le==null?void 0:Le.status);return typeof Ye=="number"?Ye:void 0}function toError(Be,Le){return Be instanceof Error?Be:new Error(Le)}function createFlowInitializationError(Be){const Le=getErrorStatusCode(Be);if(Le===401){const tt="Session expired";return{code:"SESSION_EXPIRED",type:"SESSION_EXPIRED",message:tt,statusCode:Le,error:new Error(tt)}}const Ye="Failed to initialize FlowManager";return{code:"FETCH_FLOW_ERROR",type:"FETCH_FLOW_ERROR",message:Ye,statusCode:Le,error:toError(Be,Ye)}}class AbstractFlowManager{constructor(Le){this.subscribers=[],this.flow=null,this.sessionToken=null,this.captureConfig=null,this.captureConfiguration=null,this.parentSize={width:window.innerWidth,height:window.innerHeight},this.uiConfig=null;const Ye={currentStep:null,isLoading:!1,attempts:0,errorDetails:null,successData:null,flowOutcome:"pending",sessionToken:null,...Le};this.initialState=Object.freeze({...Ye}),this.state={...this.initialState}}async isPermissionsEnabled(){if(!navigator.permissions)return appLog.info("flow","permissions: navigator.permissions unavailable"),!1;try{const Le=await navigator.permissions.query({name:"camera"});return appLog.info("flow",`permissions: camera state=${Le.state}`),Le.state==="granted"}catch(Le){return appLog.warn("flow",`permissions.query threw ${appLog.describeError(Le)}`),!1}}subscribe(Le){return this.subscribers.push(Le),Le(this.getState()),()=>{this.subscribers=this.subscribers.filter(Ye=>Ye!==Le)}}notifySubscribers(){const Le=this.getState();this.subscribers.forEach(Ye=>Ye(Le))}setState(Le){this.state={...this.state,...Le},this.notifySubscribers()}getState(){return{...this.state}}getToken(){return this.sessionToken}getParentSize(){return this.parentSize}incrementAttempts(){this.setState({attempts:this.state.attempts+1})}resetAttempts(){this.setState({attempts:0})}canRetry(){const Le=this.getEnforcedAttemptsLeft();return Le!==null?Le>0:this.state.attempts<this.getMaxAttempts()}getAttemptsLeft(){const Le=this.getEnforcedAttemptsLeft();return Le!==null?Le:Math.max(0,this.getMaxAttempts()-this.state.attempts)}getAttemptBudgetKind(){return null}getEnforcedAttemptsLeft(){const Le=this.getAttemptBudgetKind();return!Le||!this.sessionToken?null:getEnforcedAttemptsLeft(this.sessionToken,Le,this.getMaxAttempts())}async initialize(Le){var tt,nt;if(this.setState({isLoading:!0,errorDetails:null,flowOutcome:"pending",attempts:0,successData:null,sessionToken:Le.sessionToken}),this.parentSize=(tt=Le.parentSize)!=null&&tt.width&&((nt=Le.parentSize)!=null&&nt.height)?Le.parentSize:this.parentSize,this.sessionToken=Le.sessionToken,this.sessionToken&&Le.uiConfig&&(this.uiConfig=Le.uiConfig??null),Le.captureConfig)appLog.info("flow","init config source=captureConfig"),this.captureConfig=Le.captureConfig;else if(Le.flow)appLog.info("flow","init config source=flow"),this.flow=Le.flow,recordEnforceCaptureAttemptLimits(Le.sessionToken,Le.flow.enforceCaptureAttemptLimits);else{appLog.info("flow","init config source=fetch");try{this.flow=await this.fetchFlowConfiguration(this.sessionToken)}catch(ft){appLog.error("flow",`fetchFlow failed ${appLog.describeError(ft)}`);const ht=createFlowInitializationError(ft);this.setState({errorDetails:ht,isLoading:!1,flowOutcome:"error",currentStep:"error"});return}}this.captureConfiguration=this.getCaptureConfiguration(),appLog.info("flow","determine initial step");const Ye=await this.determineInitialStep(this.captureConfiguration);appLog.info("flow",`initial step=${String(Ye)}`),this.setState({currentStep:Ye,isLoading:!1})}reset(){this.state={...this.initialState},this.flow=null,this.sessionToken=null,this.captureConfiguration=null,this.captureConfig=null,this.setState(this.state)}fetchFlowConfiguration(Le){return getFlow$1(Le)}getFlow(){return this.flow}onClose(Le){const Ye=Le==="ID"?"errors.userCancelledIdFlow":"errors.userCancelledFaceFlow";onboardingAnalytics.update(),MlWasmJSApi$1.pseInFlight||MlWasmJSApi$1.reset(),this.completeWithError({code:"USER_CANCELLED",message:i18n.t(Ye),error:new Error("User cancelled")})}}const getCustomFields=({token:Be})=>api.get("/omni/get/custom-fields",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>{var Ye;return Promise.reject(((Ye=Le==null?void 0:Le.response)==null?void 0:Ye.data)??Le)}),getDeviceRiskModuleConfiguration=async Be=>api.get("/omni/device-risk-client-id",{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(()=>({enabled:!1})),collectDeviceRiskResults=async Be=>api.post("/omni/collect-device-risk-results",null,{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(()=>({})),shouldDoSardineContextFromSardine=Be=>Be===void 0?!1:typeof Be.SardineClientID=="string"&&typeof Be.SardineSessionKey=="string"&&typeof Be.SardineUserID=="string",loadSardineSDK=async Be=>{const Le=Be?"api.sandbox.sardine.ai":"api.sardine.ai",Ye=document.createElement("script");return Ye.type="text/javascript",Ye.async=!0,Ye.src=`https://${Le}/assets/loader.min.js`,new Promise(tt=>{Ye.onload=()=>tt();const nt=document.getElementsByTagName("script")[0];nt.parentNode.insertBefore(Ye,nt)})};let sardineContext=null;const getSardineContext=()=>sardineContext,createSardineContextFromSardine=({sardineClientId:Be,sardineSessionKey:Le,sardineUserId:Ye,isSandbox:tt,token:nt,interviewId:ft})=>window._Sardine.createContext({clientId:Be,sessionKey:ft,flow:`Landing page ${location.pathname}`,environment:tt?"sandbox":"production",parentElement:document.body,parentSessionKey:Le,userIdHash:Ye,onDeviceResponse(ht){addEvent({code:"externalRiskSDKInitialized",payload:{riskService:"sardine",sardineData:{deviceId:ht.deviceId,uuid:ht.uuid},interviewId:ft,sardineClientId:Be,sardineSessionKey:Le,sardineUserId:Ye},token:nt})}}),createSardineContextIncode=({sardineClientId:Be,isSandbox:Le,token:Ye,interviewId:tt})=>window._Sardine.createContext({clientId:Be,sessionKey:tt,flow:`Landing page ${location.pathname}`,environment:"production",parentElement:document.body,userIdHash:tt,onDeviceResponse(nt){addEvent({code:"externalRiskSDKInitialized",payload:{riskService:"sardine",sardineData:{deviceId:nt.deviceId,uuid:nt.uuid},interviewId:tt,sardineClientId:Be},token:Ye})}}),enableDeviceRiskModule=async({token:Be,isSandbox:Le=!0,interviewId:Ye})=>{if(isOfflineMode())return null;const{customFields:tt}=await getCustomFields({token:Be}).catch(()=>({customFields:{SardineClientID:void 0,SardineSessionKey:void 0,SardineUserID:void 0}}));shouldDoSardineContextFromSardine(tt)&&(await loadSardineSDK(Le),sardineContext=createSardineContextFromSardine({sardineClientId:tt.SardineClientID,sardineSessionKey:tt.SardineSessionKey,sardineUserId:tt.SardineUserID,isSandbox:Le,token:Be,interviewId:Ye}));const nt=await getDeviceRiskModuleConfiguration(Be);return nt.enabled&&nt.riskClientId&&(await loadSardineSDK(!1),sardineContext=createSardineContextIncode({sardineClientId:nt.riskClientId,isSandbox:!1,token:Be,interviewId:Ye})),sardineContext},eventModuleNames={selfie:"SELFIE",authFace:"AUTH_FACE",mlConsent:"ML_CONSENT",combinedConsent:"COMBINED_CONSENT",privacyConsent:"PRIVACY_CONSENT",curpValidation:"CURP_VALIDATION",faceMatch:"FACE_MATCH",qr:"QR",videoSelfie:"VIDEO_ONBOARDING",passport:"ID",front:"ID",back:"ID",idOcr:"ID_OCR",document:"DOCUMENT_CAPTURE",creditCard:"CREDIT_CARD_FRONT",creditCardBack:"CREDIT_CARD_BACK",conference:"CONFERENCE",otp:"OTP",signature:"SIGNATURE",ekyc:"EXTERNAL_VERIFICATION",payments:"PAYMENTS",globalWatchList:"GLOBAL_WATCHLIST",customWatchList:"CUSTOM_WATCHLIST",email:"EMAIL",phone:"PHONE",instantVerifyEmail:"INSTANT_VERIFY_EMAIL",instantVerifyConsent:"INSTANT_VERIFY_CONSENT",forms:"FORMS",customModule:"CUSTOM_MODULE",mDocWallet:"MDOC_WALLET"},eventScreenNames={idOcrLoading:"ID_OCR.loading",idOcrInputting:"ID_OCR.inputting",idOcrSubmitting:"ID_OCR.submitting",idOcrError:"ID_OCR.error",faceMatch:"FACE_MATCH",faceCaptureTutorial:"SELFIE_CAPTURE_TUTORIAL",faceCaptureCamera:"SELFIE_CAMERA_CAPTURE",faceCaptureError:"SELFIE_ATTEMPT_FAILED",faceCaptureSuccess:"SELFIE_UPLOAD_SUCCEEDED",faceCaptureUpload:"SELFIE_UPLOAD_PROGRESS",mlConsent:"MACHINE_LEARNING_CONSENT",combinedConsent:"COMBINED_CONSENT",curpEnter:"ENTER_CURP",curpValidate:"VALIDATE_CURP",curpGenerate:"GENERATE_CURP",curpValidation:"CURP_VALIDATION_PROGRESS",curpValidationFailed:"CURP_VALIDATION_FAILED",curpValidationSuccess:"CURP_VALIDATION_SUCCEEDED",qrTutorial:"QR_TUTORIAL",qrScan:"QR_SCAN",smsOtp:"OTP",simpleOTP:"OTP",signatureInput:"SIGNATURE_INPUT",frontTutorial:"FRONT_ID_CAPTURE_TUTORIAL",frontCameraCapture:"FRONT_ID_CAMERA_CAPTURE",frontHelp:"FRONT_ID_HELP",frontReviewPhoto:"FRONT_ID_REVIEW_PHOTO",frontUploadProgress:"FRONT_ID_UPLOAD_PROGRESS",frontAttemptFailed:"FRONT_ID_ATTEMPT_FAILED",frontUploadSuccess:"FRONT_ID_UPLOAD_SUCCEEDED",backTutorial:"BACK_ID_CAPTURE_TUTORIAL",backCameraCapture:"BACK_ID_CAMERA_CAPTURE",backReviewPhoto:"BACK_ID_REVIEW_PHOTO",backUploadProgress:"BACK_ID_UPLOAD_PROGRESS",backAttemptFailed:"BACK_ID_ATTEMPT_FAILED",backUploadSuccess:"BACK_ID_UPLOAD_SUCCEEDED",backHelp:"BACK_ID_HELP",passportTutorial:"TUTORIAL_PASSPORT",passportCameraCapture:"PASSPORT_CAMERA_CAPTURE",passportReviewPhoto:"PASSPORT_REVIEW_PHOTO",passportUploadProgress:"PASSPORT_UPLOAD_PROGRESS",passportUploadSuccess:"PASSPORT_UPLOAD_SUCCEEDED",passportAttemptFailed:"PASSPORT_ATTEMPT_FAILED",passportHelp:"PASSPORT_HELP",passportIdError:"PASSPORT_ERROR",passportManualCapture:"PASSPORT_MANUAL_CAPTURE",passportNoAttemptsLeft:"PASSPORT_NO_ATTEMPTS_LEFT",frontIdError:"FRONT_ID_ERROR",backIdError:"BACK_ID_ERROR",frontIdNoAttemptsLeft:"FRONT_ID_NO_ATTEMPTS_LEFT",backIdNoAttemptsLeft:"BACK_ID_NO_ATTEMPTS_LEFT",frontIdManualCapture:"FRONT_ID_MANUAL_CAPTURE",backIdManualCapture:"BACK_ID_MANUAL_CAPTURE",selfieManualCapture:"SELFIE_MANUAL_CAPTURE",selfieNoAttemptsLeft:"SELFIE_NO_ATTEMPTS_LEFT",idCameraDeviceChooser:"ID_CAMERA_DEVICE_CHOOSER",idCameraPermissionSlider:"ID_CAMERA_PERMISSION_SLIDER",idCameraPermissionAllow:"ID_CAMERA_PERMISSION_ALLOW",idCameraPermissionRequesting:"ID_CAMERA_PERMISSION_REQUESTING",idCameraPermissionDenied:"ID_CAMERA_PERMISSION_DENIED",idCameraPermissionInstructions:"ID_CAMERA_PERMISSION_INSTRUCTIONS",selfieCameraPermissionAllow:"SELFIE_CAMERA_PERMISSION_ALLOW",selfieCameraPermissionRequesting:"SELFIE_CAMERA_PERMISSION_REQUESTING",selfieCameraPermissionDenied:"SELFIE_CAMERA_PERMISSION_DENIED",selfieCameraPermissionInstructions:"SELFIE_CAMERA_PERMISSION_INSTRUCTIONS",selfieCameraPermissionSlider:"SELFIE_CAMERA_PERMISSION_SLIDER",selfieNoConnection:"SELFIE_NO_CONNECTION",documentTutorial:"DOCUMENT_CAPTURE_TUTORIAL",documentManualCapture:"DOCUMENT_MANUAL_CAPTURE",documentNoAttemptsLeft:"DOCUMENT_NO_ATTEMPTS_LEFT",documentCameraCapture:"DOCUMENT_CAMERA_CAPTURE",documentHelp:"DOCUMENT_HELP",documentReviewPhoto:"DOCUMENT_REVIEW_PHOTO",documentUploadProgress:"DOCUMENT_UPLOAD_IN_PROGRESS",documentAttemptFailed:"DOCUMENT_ATTEMPT_FAILED",documentUploadSuccess:"DOCUMENT_UPLOAD_SUCCEEDED",conferenceWait:"CONFERENCE_WAIT",conferenceVideoChat:"CONFERENCE_VIDEO_CHAT",conferenceMessageChat:"CONFERENCE_MESSAGE_CHAT",videoSelfieTutorial:"VIDEO_SELFIE_TUTORIAL",videoSelfie:"VIDEO_SELFIE",videoSelfieFaceCapture:"VIDEO_SELFIE_FACE_CAPTURE",videoSelfieFaceUploadProgress:"VIDEO_SELFIE_FACE_UPLOAD_PROGRESS",videoSelfieFaceAttemptFailed:"VIDEO_SELFIE_FACE_ATTEMPT_FAILED",videoSelfieFaceUploadSucceeded:"VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED",videoSelfieFrontIdCapture:"VIDEO_SELFIE_FRONT_ID_CAPTURE",videoSelfieFrontIdUploadProgress:"VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS",videoSelfieFrontIdAttemptFailed:"VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED",videoSelfieFrontIdUploadSucceeded:"VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED",videoSelfieBackIdCapture:"VIDEO_SELFIE_BACK_ID_CAPTURE",videoSelfieBackIdUploadProgress:"VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS",videoSelfieBackIdAttemptFailed:"VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED",videoSelfieBackIdUploadSucceeded:"VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED",videoSelfieDocumentCapture:"VIDEO_SELFIE_DOCUMENT_CAPTURE",videoSelfieVoiceQuestion:"VIDEO_SELFIE_VOICE_QUESTION",videoSelfieVoiceFinalQuestion:"VIDEO_SELFIE_VOICE_FINAL_QUESTION",videoSelfieVideoUpload:"VIDEO SELFIE VIDEO UPLOAD",ekycInput:"EKYC_INPUT",ekycProgress:"EKYC_PROGRESS",ekycSucceeded:"EKYC_SUCCEEDED",ekycFailed:"EKYC_FAILED",paymentsInput:"PAYMENTS_INPUT",paymentsProgress:"PAYMENTS_PROGRESS",paymentsSucceeded:"PAYMENTS_SUCCEEDED",paymentsFailed:"PAYMENTS_FAILED",forms:"FORMS",globalWatchListInput:"GLOBAL_WATCHLIST_INPUT",globalWatchListProgress:"GLOBAL_WATCHLIST_PROGRESS",globalWatchListSuccess:"GLOBAL_WATCHLIST_SUCCEEDED",globalWatchListFailed:"GLOBAL_WATCHLIST_FAILED",customWatchListInput:"CUSTOM_WATCHLIST_INPUT",customWatchListProgress:"CUSTOM_WATCHLIST_PROGRESS",customWatchListSuccess:"CUSTOM_WATCHLIST_SUCCEEDED",customWatchListFailed:"CUSTOM_WATCHLIST_FAILED",emailInput:"EMAIL_INPUT",phoneInput:"PHONE_INPUT",instantVerify:"INSTANT_VERIFY",authFace:"AUTH_FACE",authFaceError:"AUTH_FACE_ATTEMPT_FAILED",authFaceUpload:"AUTH_FACE_UPLOAD_PROGRESS",authFaceUploadSuccess:"AUTH_FACE_UPLOAD_SUCCEEDED",authFaceUploadFailed:"AUTH_FACE_UPLOAD_FAILED",customModuleCallback:"CUSTOM_MODULE_CALLBACK",customModuleProcessing:"CUSTOM_MODULE_PROCESSING",digitalIdFileSelection:"DIGITAL_ID_FILE_SELECTION",digitalIdFileReview:"DIGITAL_ID_FILE_REVIEW",digitalIdUploadProgress:"DIGITAL_ID_UPLOAD_PROGRESS",digitalIdUploadSuccess:"DIGITAL_ID_UPLOAD_SUCCEEDED",digitalIdUploadFailed:"DIGITAL_ID_UPLOAD_FAILED",digitalIdAnalysisProgress:"DIGITAL_ID_ANALYSIS_PROGRESS",digitalIdVerificationSuccess:"DIGITAL_ID_VERIFICATION_SUCCESS",digitalIdVerificationFailed:"DIGITAL_ID_VERIFICATION_FAILED",documentChooser:"DOCUMENT_CHOOSER",landingPage:"LANDING_PAGE",privacyConsent:"PRIVACY_CONSENT",mDocWalletError:"MDOC_WALLET_ERROR"},streamingEvents={strSessionDidConnect:"strSessionDidConnect",strSessionDidDisconnect:"strSessionDidDisconnect",strSessionDidFailWithError:"strSessionDidFailWithError",strStreamVideoCaptureStart:"strStreamVideoCaptureStart",strStreamVideoCaptureStop:"strStreamVideoCaptureStop",strStreamPublisherCreated:"strStreamPublisherCreated",strStreamPublisherDestroyed:"strStreamPublisherDestroyed",strStreamPublisherDidFailWithError:"strStreamPublisherDidFailWithError"},videoSelfieEvents={imageTooBlurry:"imageTooBlurry",fillFrame:"fillFrame",checkCameraOrLighting:"checkCameraOrLighting",frontIdCaptureStarted:"frontIdCaptureStarted",lookAtCamera:"lookAtCamera",moveCloser:"moveCloser",lookingForFrontId:"lookingForFrontId",lookingForBackId:"lookingForBackId",cameraSwitchToBack:"cameraSwitchToBack",cameraSwitchToFront:"cameraSwitchToFront",audioStreamOpened:"audioStreamOpened",audioStreamClosed:"audioStreamClosed",videoSelfieVideoUploadInProgress:"videoSelfieVideoUploadInProgress",videoSelfieTosNotAccepted:"videoSelfieTosNotAccepted",videoSelfieTosAccepted:"videoSelfieTosAccepted",videoSelfieStreamCreated:"videoSelfieStreamCreated",videoSelfieStreamDestroyed:"videoSelfieStreamDestroyed",videoSelfieReconnecting:"videoSelfieReconnecting",videoSelfieReconnected:"videoSelfieReconnected"},tutorialScreenNamesMapper={passport:eventScreenNames.passportTutorial,front:eventScreenNames.frontTutorial,back:eventScreenNames.backTutorial,selfie:eventScreenNames.faceCaptureTutorial},cameraScreenNamesMapper={front:"front",back:"back",passport:"passport",creditCard:"front",creditCardBack:"back",document:"document"};function screenEvent({module:Be,payload:Le,token:Ye,screen:tt,code:nt}){try{addEvent({token:Ye,module:Be,code:nt,screen:tt,clientTimestamp:new Date().getTime(),payload:{...Le??{}}})}catch(ft){console.error(ft)}}function updateSardineConfigOnScreenChange(Be,Le){const Ye=getSardineContext(),tt=Le?`${Be} - ${Le}`:Be;Ye&&Ye.updateConfig({flow:tt})}function useScreenEvents({module:Be,screen:Le,payload:Ye={},token:tt}){React.useEffect(()=>(updateSardineConfigOnScreenChange(Be,Le),screenEvent({module:Be,payload:Ye,code:"screenOpened",token:tt,screen:Le}),()=>{screenEvent({module:Be,payload:Ye,code:"screenClosed",token:tt,screen:Le}),updateSardineConfigOnScreenChange(Be)}),[])}function useScreenTransitionEvents({module:Be,screen:Le,token:Ye}){React.useEffect(()=>(updateSardineConfigOnScreenChange(Be,Le),screenEvent({module:Be,screen:Le,code:"screenOpened",token:Ye}),()=>{screenEvent({module:Be,screen:Le,code:"screenClosed",token:Ye}),updateSardineConfigOnScreenChange(Be)}),[Be,Le,Ye])}function useModuleEvents({module:Be,payload:Le={},token:Ye,screen:tt,includeAppLogs:nt}){React.useLayoutEffect(()=>{const ft=async()=>{const ht=await getModuleFeatureFlags(Be);screenEvent({module:Be,screen:tt,payload:{...Le,...ht},code:"moduleOpened",token:Ye})};return updateSardineConfigOnScreenChange(Be,tt),ft(),()=>{const ht=async()=>{const gt=await getModuleFeatureFlags(Be);screenEvent({module:Be,payload:{...Le,...gt,...nt?{appLogs:appLog.getAppLogs()}:{}},screen:tt,code:"moduleClosed",token:Ye})};setTimeout(()=>{ht()},0)}},[])}const addScreenEvent=({module:Be,token:Le,screen:Ye,payload:tt,shouldOpen:nt,sardineScreen:ft})=>{nt&&updateSardineConfigOnScreenChange(Be,ft??Ye),screenEvent({module:Be,payload:tt,token:Le,screen:Ye,code:nt?"screenOpened":"screenClosed"})};function getIdCaptureReviewScreen(Be){return Be==="front"?eventScreenNames.frontReviewPhoto:Be==="back"?eventScreenNames.backReviewPhoto:eventScreenNames.passportReviewPhoto}function getIdCaptureNoAttemptsScreen(Be){return Be==="front"?eventScreenNames.frontIdNoAttemptsLeft:Be==="back"?eventScreenNames.backIdNoAttemptsLeft:eventScreenNames.passportNoAttemptsLeft}function getIdCaptureManualScreen(Be){return Be==="front"?eventScreenNames.frontIdManualCapture:Be==="back"?eventScreenNames.backIdManualCapture:eventScreenNames.passportManualCapture}function getCaptureIdReviewScreen(Be){return Be==="document"?eventScreenNames.documentReviewPhoto:getIdCaptureReviewScreen(Be)}function getCaptureIdManualScreen(Be){return Be==="document"?eventScreenNames.documentManualCapture:getIdCaptureManualScreen(Be)}function getCaptureIdNoAttemptsScreen(Be){return Be==="document"?eventScreenNames.documentNoAttemptsLeft:getIdCaptureNoAttemptsScreen(Be)}function getCaptureIdErrorScreen(Be){return Be==="document"?eventScreenNames.documentAttemptFailed:Be==="front"?eventScreenNames.frontIdError:Be==="back"?eventScreenNames.backIdError:Be==="passport"?eventScreenNames.passportIdError:eventScreenNames.frontIdError}function getIdV2SardineScreen(Be,Le){return Be==="passport"?Le==="uploading"?eventScreenNames.passportUploadProgress:Le==="success"?eventScreenNames.passportUploadSuccess:Le==="error"?eventScreenNames.passportIdError:Le==="manual"?eventScreenNames.passportManualCapture:Le==="noAttempts"?eventScreenNames.passportNoAttemptsLeft:eventScreenNames.passportCameraCapture:Be==="back"?Le==="uploading"?eventScreenNames.backUploadProgress:Le==="success"?eventScreenNames.backUploadSuccess:Le==="error"?eventScreenNames.backIdError:Le==="manual"?eventScreenNames.backIdManualCapture:Le==="noAttempts"?eventScreenNames.backIdNoAttemptsLeft:eventScreenNames.backCameraCapture:Le==="uploading"?eventScreenNames.frontUploadProgress:Le==="success"?eventScreenNames.frontUploadSuccess:Le==="error"?eventScreenNames.frontIdError:Le==="manual"?eventScreenNames.frontIdManualCapture:Le==="noAttempts"?eventScreenNames.frontIdNoAttemptsLeft:eventScreenNames.frontCameraCapture}const FlowPage=({uiConfig:Be,onClose:Le,onCloseCancel:Ye,hideFooterBranding:tt,hideHeaderBranding:nt,...ft})=>{var At,xt,Et,kt,Ct,yt,vt,bt,Rt,wt,Tt,Bt,Ot,Pt;const ht=!!((At=Be==null?void 0:Be.closeButton)!=null&&At.show),gt=!!((Et=(xt=Be==null?void 0:Be.branding)==null?void 0:xt.logo)!=null&&Et.src||(Ct=(kt=Be==null?void 0:Be.branding)==null?void 0:kt.logo)!=null&&Ct.height);return jsxRuntimeExports.jsx(Page$1,{closeButton:{onClose:Le,show:ht,position:(yt=Be==null?void 0:Be.closeButton)==null?void 0:yt.position,offset:(vt=Be==null?void 0:Be.closeButton)==null?void 0:vt.offset,color:(bt=Be==null?void 0:Be.closeButton)==null?void 0:bt.color,onCancel:Ye},...gt?{logo:{src:(wt=(Rt=Be==null?void 0:Be.branding)==null?void 0:Rt.logo)==null?void 0:wt.src,height:(Bt=(Tt=Be==null?void 0:Be.branding)==null?void 0:Tt.logo)==null?void 0:Bt.height}}:{},hideFooterBranding:tt||((Ot=Be==null?void 0:Be.branding)==null?void 0:Ot.hideFooterBranding),hideHeaderBranding:nt||((Pt=Be==null?void 0:Be.branding)==null?void 0:Pt.hideHeaderBranding),...ft})},breakpoints$1={xs:"568px",sm:"667px",md:"812px",lg:"926px"},ArrowRightIcon=({width:Be=13,height:Le=14})=>{const tt=useTokens().color.text.body.primary;return jsxRuntimeExports.jsx("svg",{width:Be,height:Le,viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntimeExports.jsx("path",{d:"M0 8.08009V5.92009H9.198L4.698 1.87009L6.228 0.340088L12.6 6.28009V7.70209L6.228 13.6601L4.698 12.1301L9.198 8.08009H0Z",fill:tt})})},arrowEl$1=jsxRuntimeExports.jsx(ArrowRightIcon,{}),BoldWithArrow=({i18nKey:Be})=>{const Le=useTokens();return jsxRuntimeExports.jsx(Flex$1,{as:"span",inline:!0,gap:"0.3em",forceGap:!0,align:"center",fontWeight:700,whiteSpace:"nowrap",color:Le.color.text.body.primary,children:jsxRuntimeExports.jsx(Trans,{i18nKey:Be,components:{arrow:arrowEl$1}})})},spin=mt`
2508
+ `,nt=F.createShader(F.VERTEX_SHADER),ft=F.createShader(F.FRAGMENT_SHADER);if(!nt||!ft)throw new Error("Failed to create shaders");if(F.shaderSource(nt,Ye),F.shaderSource(ft,tt),F.compileShader(nt),!F.getShaderParameter(nt,F.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+F.getShaderInfoLog(nt));if(F.compileShader(ft),!F.getShaderParameter(ft,F.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+F.getShaderInfoLog(ft));var ht=F.createProgram();if(!ht)throw new Error("Failed to create shader program");if(F.attachShader(ht,nt),F.attachShader(ht,ft),F.linkProgram(ht),!F.getProgramParameter(ht,F.LINK_STATUS))throw new Error("Shader program linking failed: "+F.getProgramInfoLog(ht));F.useProgram(ht);for(var gt=137,At=new Float32Array(4*gt),xt=2*Math.PI/gt,Et=0;Et<gt;Et++){var kt=Et*xt;At[4*Et]=0,At[4*Et+1]=0,At[4*Et+2]=Math.cos(kt)*(U.width/2),At[4*Et+3]=Math.sin(kt)*(U.height/2)}var Ct=F.createBuffer();F.bindBuffer(F.ARRAY_BUFFER,Ct),F.bufferData(F.ARRAY_BUFFER,At,F.STATIC_DRAW);var yt=F.getAttribLocation(ht,"position");F.enableVertexAttribArray(yt),F.vertexAttribPointer(yt,2,F.FLOAT,!1,0,0),F.viewport(0,0,U.width,U.height),F.clearColor(0,0,0,1),F.clear(F.COLOR_BUFFER_BIT),F.drawArrays(F.LINES,0,2*gt);var vt=new Uint8ClampedArray(U.width*U.height*4);return F.readPixels(0,0,U.width,U.height,F.RGBA,F.UNSIGNED_BYTE,vt),new ImageData(vt,U.width,U.height)}catch{return new ImageData(1,1)}finally{F&&(F.bindBuffer(F.ARRAY_BUFFER,null),F.useProgram(null),F.viewport(0,0,F.drawingBufferWidth,F.drawingBufferHeight),F.clearColor(0,0,0,0))}}()}),[2,{commonImageHash:d(E(Be,U.width,U.height).data.toString()).toString()}]}catch{return[2,{webgl:"unsupported"}]}return[2]})})});var j=function(Be,Le,Ye,tt){for(var nt=(Ye-Le)/tt,ft=0,ht=0;ht<tt;ht++)ft+=Be(Le+(ht+.5)*nt);return ft*nt};i$2("math",function(){return e(void 0,void 0,void 0,function(){return n(this,function(Be){return[2,{acos:Math.acos(.5),asin:j(Math.asin,-1,1,97),atan:j(Math.atan,-1,1,97),cos:j(Math.cos,0,Math.PI,97),cosh:Math.cosh(9/7),e:Math.E,largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),log:Math.log(1e3),pi:Math.PI,sin:j(Math.sin,-Math.PI,Math.PI,97),sinh:j(Math.sinh,-9/7,7/9,97),sqrt:Math.sqrt(2),tan:j(Math.tan,0,2*Math.PI,97),tanh:j(Math.tanh,-9/7,7/9,97)}]})})});const version$3="1.94.0",devDependencies={"@fingerprintjs/fingerprintjs-pro":"3.12.3","@thumbmarkjs/thumbmarkjs":"0.20.6"};let fingerprintApiKey;function setFingerprintApiKey(Be){fingerprintApiKey=Be}const FINGERPRINT_PRO_ALGORITHM={algorithmName:"fingerprintjs-pro",algorithmVersion:devDependencies["@fingerprintjs/fingerprintjs-pro"]},THUMBMARK_ALGORITHM={algorithmName:"thumbmarkjs",algorithmVersion:devDependencies["@thumbmarkjs/thumbmarkjs"]};let fingerPrintPromise=null;const FINGERPRINT_STORAGE_KEY="fingerprint_result";let ipPromise=null;async function getIp(){if(ipPromise)return ipPromise;if(AbortSignal.timeout)ipPromise=fetch("https://api.ipify.org?format=json",{signal:AbortSignal.timeout(3e3)}).then(Be=>Be.json()).then(Be=>Be.ip).catch(()=>"");else{const Be=new Promise((Le,Ye)=>{setTimeout(()=>Ye(new Error("Request timeout")),3e3)});ipPromise=Promise.race([fetch("https://api.ipify.org?format=json").then(Le=>Le.json()).then(Le=>Le.ip),Be]).catch(()=>"")}return ipPromise}function getCachedFingerprint(){try{const Be=localStorage.getItem(FINGERPRINT_STORAGE_KEY);return Be?JSON.parse(Be):null}catch{return null}}function setCachedFingerprint(Be){try{localStorage.setItem(FINGERPRINT_STORAGE_KEY,JSON.stringify({visitorId:Be.visitorId}))}catch{}}async function getFingerPrintFromFingerprint(Be){const Le=getCachedFingerprint();return Le?Promise.resolve({visitorId:Le.visitorId,ip:Be?void 0:await getIp(),...FINGERPRINT_PRO_ALGORITHM}):fingerPrintPromise||(fingerPrintPromise=H.load({token:fingerprintApiKey,endpoint:"https://fingerprint.incodesmile.com",scriptUrlPattern:"https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"}).then(Ye=>Ye.get({extendedResult:!0})).then(Ye=>(setCachedFingerprint(Ye),{visitorId:Ye.visitorId,ip:Ye.ip,...FINGERPRINT_PRO_ALGORITHM})),fingerPrintPromise)}let thumbprintPromise=null;async function getFingerprintFromThumbprint(Be){return thumbprintPromise||(thumbprintPromise=w$9().then(async Le=>({visitorId:Le,ip:Be?void 0:await getIp(),...THUMBMARK_ALGORITHM})),thumbprintPromise)}async function getFingerprint(Be=!1){return isOfflineMode()?getFingerprintFromThumbprint(!0):getFeatureFlag("new_fingerprint")?getFingerprintFromThumbprint(Be):getFingerPrintFromFingerprint(Be)}const SDK_BUILD_VERSION="1.94.0+b0813bc";class MetadataUtils{async initializeMetadata(Le,Ye=!1){MlWasmJSApi$1.setSdkPlatform("WEBAPP"),MlWasmJSApi$1.setSdkVersion(Le||SDK_BUILD_VERSION);const{os:tt,device:nt}=getUAParserResults(),ft=await getFingerprint(Ye).catch(At=>({visitorId:"",ip:""})),ht={kind:mobile.isDesktop()?"desktop":"mobile",model:`${nt.vendor||""} ${nt.model||""}`.trim(),os:tt.name,osVersion:tt.version,screenDimensions:{width:screen.width,height:screen.height},numTouchPoints:navigator.maxTouchPoints,fingerprintHash:ft.visitorId||"",ip:ft.ip||"",backgroundMode:!1};MlWasmJSApi$1.setDeviceInfo(ht);const gt={userAgent:navigator.userAgent,getUserMediaAvailability:{webkit:navigator.webkitGetUserMedia!==void 0,moz:navigator.mozGetUserMedia!==void 0,o:navigator.oGetUserMedia!==void 0,ms:navigator.msGetUserMedia!==void 0},webglFingerprint:webgl(),inspectorOpened:!1,isMockedBrowser:isBrowserSimulation()};MlWasmJSApi$1.setBrowserInfo(gt,!1),FingerprintSignalsReporter$1.start()}updateCameraInfo(Le){const Ye=Le.getSettings(),tt=Le.getCapabilities?Le.getCapabilities():{},nt=Le.label?[Le.label]:[],ht={facingMode:Ye.facingMode==="user"?"frontal":Ye.facingMode==="environment"?"back":Ye.facingMode||"unknown",settings:Ye,capabilities:tt,labels:nt};MlWasmJSApi$1.setCameraInfo(ht),FingerprintSignalsReporter$1.markFingerprintDataUpdated()}}class MotionStatusCheck{constructor(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,kt,Ct){this.isRunning_=!1,this.acl_=null,this.gyro_=null,this.permission_=!0,this.minNumberOfFrames_=10,this.maxFrequency_=60,this.maxPoints_=1200,this.emptyParams={meanX:0,meanY:0,meanZ:0,m2X:0,m2Y:0,m2Z:0,cumulativeAbsErrorX:0,cumulativeAbsErrorY:0,cumulativeAbsErrorZ:0,ptsNum:0},this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams},this.deviceMotionListener=yt=>{if(yt.accelerationIncludingGravity){const vt={x:yt.accelerationIncludingGravity.x,y:yt.accelerationIncludingGravity.y,z:yt.accelerationIncludingGravity.z};this.checkFields(vt)&&(this.paramsAccGrOld_.ptsNum+=1,this.updateParams(this.paramsAccGrOld_,vt))}if(yt.acceleration){const vt={x:yt.acceleration.x,y:yt.acceleration.y,z:yt.acceleration.z};this.checkFields(vt)&&(this.paramsAccOld_.ptsNum+=1,this.updateParams(this.paramsAccOld_,vt))}if(yt.rotationRate){const vt={x:yt.rotationRate.alpha,y:yt.rotationRate.beta,z:yt.rotationRate.gamma};this.checkFields(vt)&&(this.paramsGyroscopeOld_.ptsNum+=1,this.updateParams(this.paramsGyroscopeOld_,vt))}},this.deviceOrientationListener=yt=>{const vt={x:yt.alpha,y:yt.beta,z:yt.gamma};this.checkFields(vt)&&(this.paramsOrientationOld_.ptsNum+=1,this.updateParams(this.paramsOrientationOld_,vt))},this.accThreshold_=Le,this.gyroThreshold_=Ye,this.accGrOldThreshold_=tt,this.accOldThreshold_=nt,this.gyroscopeOldThreshold_=ft,this.orientationOldThreshold_=ht,this.maeAccThreshold_=gt,this.maeGyroThreshold_=At,this.maeAccGrOldThreshold_=xt,this.maeAccOldThreshold_=Et,this.maeGyroscopeOldThreshold_=kt,this.maeOrientationOldThreshold_=Ct}async requestMotionPermission(){return DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"?(sessionStorage.setItem("motionSensorsPermissionsRequested",String(!0)),DeviceMotionEvent.requestPermission().then(Le=>(Le!=="granted"&&(this.permission_=!1),Le)).catch(console.error)):"granted"}initializeAccelerometer(){if("Accelerometer"in window)try{this.acl_=new window.Accelerometer({frequency:this.maxFrequency_}),this.acl_.addEventListener("reading",()=>this.updateAcc())}catch{}}initializeGyroscope(){if("Gyroscope"in window)try{this.gyro_=new window.Gyroscope({frequency:this.maxFrequency_}),this.gyro_.addEventListener("reading",()=>this.updateGyro())}catch{}}async start(){this.run()}run(){if(!(this.isRunning_||!this.permission_)){try{this.initializeAccelerometer(),this.acl_.start()}catch{}try{this.initializeGyroscope(),this.gyro_.start()}catch{}window.addEventListener("devicemotion",this.deviceMotionListener),window.addEventListener("deviceorientation",this.deviceOrientationListener),this.isRunning_=!0}}stop(){this.isRunning_=!1,this.acl_&&this.acl_.stop(),this.gyro_&&this.gyro_.stop(),window.removeEventListener("devicemotion",this.deviceMotionListener),window.removeEventListener("deviceorientation",this.deviceOrientationListener),this.paramsAcc_={...this.emptyParams},this.paramsGyro_={...this.emptyParams},this.paramsAccGrOld_={...this.emptyParams},this.paramsAccOld_={...this.emptyParams},this.paramsGyroscopeOld_={...this.emptyParams},this.paramsOrientationOld_={...this.emptyParams}}updateAcc(){if(!this.isRunning_||!this.acl_)return;const Le={x:this.acl_.x,y:this.acl_.y,z:this.acl_.z};this.checkFields(Le)&&(this.paramsAcc_.ptsNum+=1,this.updateParams(this.paramsAcc_,Le))}updateGyro(){if(!this.isRunning_||!this.gyro_)return;const Le={x:this.gyro_.x,y:this.gyro_.y,z:this.gyro_.z};this.checkFields(Le)&&(this.paramsGyro_.ptsNum+=1,this.updateParams(this.paramsGyro_,Le))}check(){if(!this.permission_)return"UNCLEAR";const Le=this.checkStability();return Le===null?"UNCLEAR":Le?"FAIL":"PASS"}getDetails(){return{aggregate:this.check(),permissionGranted:this.permission_,hasAccelerometer:this.acl_!==null,hasGyroscope:this.gyro_!==null,isRunning:this.isRunning_}}checkStability(){if(!this.isRunning_)return null;const Ye=[this.gyro_?this.isBelowStdThreshold(this.paramsGyro_,this.gyroThreshold_):null,this.acl_?this.isBelowStdThreshold(this.paramsAcc_,this.accThreshold_):null,this.isBelowStdThreshold(this.paramsAccGrOld_,this.accGrOldThreshold_),this.isBelowStdThreshold(this.paramsAccOld_,this.accOldThreshold_),this.isBelowStdThreshold(this.paramsGyroscopeOld_,this.gyroscopeOldThreshold_),this.isBelowStdThreshold(this.paramsOrientationOld_,this.orientationOldThreshold_)].filter(gt=>gt!==null),tt=Ye.length>0?Ye.every(gt=>gt):null,ft=[this.gyro_?this.isBelowMaeThreshold(this.paramsGyro_,this.maeGyroThreshold_):null,this.acl_?this.isBelowMaeThreshold(this.paramsAcc_,this.maeAccThreshold_):null,this.isBelowMaeThreshold(this.paramsAccGrOld_,this.maeAccGrOldThreshold_),this.isBelowMaeThreshold(this.paramsAccOld_,this.maeAccOldThreshold_),this.isBelowMaeThreshold(this.paramsGyroscopeOld_,this.maeGyroscopeOldThreshold_),this.isBelowMaeThreshold(this.paramsOrientationOld_,this.maeOrientationOldThreshold_)].filter(gt=>gt!==null),ht=ft.length>0?ft.every(gt=>gt):null;return tt===null?ht===null?null:ht:ht!==null?tt&&ht:tt}updateParams(Le,Ye){Le.ptsNum>this.maxPoints_&&(this.resetParams(Le),Le.ptsNum=1);const tt=Ye.x-Le.meanX,nt=Ye.y-Le.meanY,ft=Ye.z-Le.meanZ;Le.meanX+=tt/Le.ptsNum,Le.meanY+=nt/Le.ptsNum,Le.meanZ+=ft/Le.ptsNum,Le.m2X+=tt*(Ye.x-Le.meanX),Le.m2Y+=nt*(Ye.y-Le.meanY),Le.m2Z+=ft*(Ye.z-Le.meanZ),Le.cumulativeAbsErrorX+=Math.abs(Ye.x-Le.meanX),Le.cumulativeAbsErrorY+=Math.abs(Ye.y-Le.meanY),Le.cumulativeAbsErrorZ+=Math.abs(Ye.z-Le.meanZ)}resetParams(Le){Le.meanX=0,Le.meanY=0,Le.meanZ=0,Le.m2X=0,Le.m2Y=0,Le.m2Z=0,Le.cumulativeAbsErrorX=0,Le.cumulativeAbsErrorY=0,Le.cumulativeAbsErrorZ=0,Le.ptsNum=0}calculateStd(Le){const Ye={x:Le.m2X/Le.ptsNum,y:Le.m2Y/Le.ptsNum,z:Le.m2Z/Le.ptsNum};return{x:Math.sqrt(Ye.x),y:Math.sqrt(Ye.y),z:Math.sqrt(Ye.z)}}calculateMae(Le){return{x:Le.cumulativeAbsErrorX/Le.ptsNum,y:Le.cumulativeAbsErrorY/Le.ptsNum,z:Le.cumulativeAbsErrorZ/Le.ptsNum}}checkFields(Le){return Le.x!==null&&Le.y!==null&&Le.z!==null}isBelowStdThreshold(Le,Ye){if(Le.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateStd(Le);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}isBelowMaeThreshold(Le,Ye){if(Le.ptsNum<this.minNumberOfFrames_)return null;const tt=this.calculateMae(Le);return tt.x<Ye&&tt.y<Ye&&tt.z<Ye}}class OnboardingAnalytics extends MetadataUtils{constructor(){super(),this.motionStatusCheck=null,this.estimatedPerformance=null,this.analysisStatus="",this.motionStatus="",this.pipelineLogs={},this.backgroundModeDetected=!1,this.simdIsEnabled=null,this.wasmVersion=null,this.profiles=null,this.metadata="",this.onDeviceBarcodeDecoded=!1,this.motionStatusCheck=new MotionStatusCheck(.1,.005,.1,.1,.5,2.5,.1,.005,.1,.1,.5,2.5),document.addEventListener("visibilitychange",()=>{this.backgroundModeDetected=!0})}static getInstance(){return OnboardingAnalytics.instance||(OnboardingAnalytics.instance=new OnboardingAnalytics),OnboardingAnalytics.instance}setOnDeviceBarcodeDecoded(Le){this.onDeviceBarcodeDecoded=Le}getOnDeviceBarcodeDecoded(){return this.onDeviceBarcodeDecoded}setSimdIsEnabled(Le){this.simdIsEnabled=Le}setWasmVersion(Le){this.wasmVersion=Le}setProfiles(Le){this.profiles=Le}getPipelineLogs(){return this.pipelineLogs}getMotionStatus(){return this.motionStatus}getMotionStatusCheck(){return this.motionStatusCheck}getAnalysisStatus(){return this.analysisStatus}getMetadata(){return this.metadata}async analyzeFrame(Le){const Ye=await base64ToImageData(Le);await MlWasmJSApi$1.analyzeFrame(Ye)}async startOnboardingCheck(){return this.motionStatusCheck.requestMotionPermission()}async startMotionSensors(Le){this.motionStatusCheck.start();try{await MlWasmJSApi$1.rsp(Le),MlWasmJSApi$1.ssl(Le)}catch(Ye){appLog.warn("sensors",`startMotionSensors failed ${appLog.describeError(Ye)}`)}}stopMotionSensors(){this.motionStatusCheck.stop()}estimatePerformance(){if(this.estimatedPerformance)return this.estimatedPerformance;this.estimatedPerformance=MlWasmJSApi$1.estimatePerformance()}update(){if(MlWasmJSApi$1.isInitialized())try{const Le=MlWasmJSApi$1.getWorkflowState();if(Le!==""){const Ye=JSON.parse(Le);Ye.profiles=Array.from(this.profiles.values()).map(nt=>WasmWorkflowProfileName[nt.name]),Ye.estimatedPerformance=this.estimatedPerformance,Ye.simdIsEnabled=this.simdIsEnabled,Ye.wasmVersion=this.wasmVersion,this.pipelineLogs=Ye;const tt=this.motionStatusCheck.check();this.motionStatus!=="PASS"&&(this.motionStatus=tt),MlWasmJSApi$1.setMotionStatus(this.motionStatus),this.analysisStatus=MlWasmJSApi$1.getCheck()}MlWasmJSApi$1.setBackgroundMode(this.backgroundModeDetected),this.metadata=MlWasmJSApi$1.getMetadata(),this.backgroundModeDetected=!1}catch(Le){console.error(`Exception: ${Le}`)}}}const onboardingAnalytics=OnboardingAnalytics.getInstance(),ENFORCE_KEY="incode_enforce_capture_attempts",BUDGET_KEY="incode_capture_attempt_budget",getEnforceStorageKey=Be=>`${ENFORCE_KEY}_${Be}`,getBudgetStorageKey=(Be,Le)=>`${BUDGET_KEY}_${Be}_${Le}`,readBudget=(Be,Le)=>{try{const Ye=sessionStorage.getItem(getBudgetStorageKey(Be,Le));if(Ye){const tt=JSON.parse(Ye);if(tt&&typeof tt=="object")return{used:typeof tt.used=="number"&&tt.used>0?tt.used:0,max:typeof tt.max=="number"?tt.max:null,remaining:typeof tt.remaining=="number"?Math.max(0,tt.remaining):null}}}catch{}return{used:0,max:null,remaining:null}},writeBudget=(Be,Le,Ye)=>{try{sessionStorage.setItem(getBudgetStorageKey(Be,Le),JSON.stringify(Ye))}catch{}},recordEnforceCaptureAttemptLimits=(Be,Le)=>{if(!(!Be||typeof Le!="boolean"))try{sessionStorage.setItem(getEnforceStorageKey(Be),Le?"1":"0")}catch{}},isCaptureAttemptEnforcementEnabled=Be=>{if(!Be)return!1;try{return sessionStorage.getItem(getEnforceStorageKey(Be))==="1"}catch{return!1}},recordCaptureAttempt=(Be,Le)=>{if(!isCaptureAttemptEnforcementEnabled(Be))return;const Ye=readBudget(Be,Le);writeBudget(Be,Le,{...Ye,used:Ye.used+1,remaining:Ye.remaining===null?null:Math.max(0,Ye.remaining-1)})},applyBackendAttemptsLimit=(Be,Le,Ye)=>{if(!Be||!Ye||typeof Ye!="object"||typeof Ye.max!="number"&&typeof Ye.remaining!="number")return;const tt=readBudget(Be,Le);writeBudget(Be,Le,{used:tt.used,max:typeof Ye.max=="number"?Ye.max:tt.max,remaining:typeof Ye.remaining=="number"?Math.max(0,Ye.remaining):tt.remaining})},getEnforcedAttemptsLeft=(Be,Le,Ye)=>{if(!isCaptureAttemptEnforcementEnabled(Be))return null;const tt=readBudget(Be,Le);if(tt.remaining!==null)return tt.remaining;const nt=tt.max??Ye;return!Number.isFinite(nt)||nt<=0?null:Math.max(0,nt-tt.used)},defaultFlow$1={name:"",checkTutorials:!0,checkAuthorization:!0,redirectDesktopToMobile:!1,disableUnsupportedBrowserScreen:!1,qrPhishingResistance:!1,addContinueToDesktop:!1,redirectOriginOnly:!1,displayOnboardingResultOnDesktop:!1,enableMultipleOnboardings:!1,disableLaunchScreen:!1,disableSmsOption:!1,mergeSessionRecordings:!1,mandatoryConsentCheck:!0,enableSardineRisk:!1,flowModules:[{key:"PHONE",configuration:{otpVerification:!1,otpExpirationInMinutes:10,prefill:!1}},{key:"GEOLOCATION",configuration:{allowUserToSkipGeolocation:!1}},{key:"ID",configuration:{showTutorial:!0,enableId:!0,enablePassport:!0,onlyFront:!1,onlyBack:!1,barcodeCapture:!1,fetchAdditionalPage:!1,secondId:!1,autoCaptureTimeout:18,deviceIdleTimeout:60,captureAttempts:3,manualUploadIdCapture:!1,deviceWallet:!1,digiLocker:!1,showDocumentChooserScreen:!0,enableIdRecording:!0,perCountryPerDocOverrides:{}}},{key:"ADDRESS",configuration:{disableSkipPoa:!1,title:"",text:""}},{key:"ID_OCR",configuration:{editableOcr:!1}},{key:"SELFIE",configuration:{showTutorial:!0,showPreview:!1,assistedOnboarding:!1,enableFaceRecording:!0,autoCaptureTimeout:20,captureAttempts:3,validateLenses:!0,validateFaceMask:!0,validateHeadCover:!0,validateClosedEyes:!0,validateBrightness:!0,deepsightLiveness:"SINGLE_FRAME"}},{key:"FACE_MATCH",configuration:{matchingType:"selfieVsId",disableFaceMatchAnimation:!1}},{key:"SIGNATURE",configuration:{title:"",subTitle:""}},{key:"VIDEO_ONBOARDING",configuration:{useAsSelfie:!1,showTutorials:!0,companyName:"",checkLiveness:!0,checkIdScan:!0,checkDocumentScan:!0,compareIdEnabled:!0,compareOcrEnabled:!1,compareBackIdEnabled:!1,compareBackOcrEnabled:!1,checkVoiceConsent:!0,voiceConsentQuestions:0,selfieQualityAffectsScore:!1,maxWaitingVideoSelfieFile:0,lastSecondsVideoQualityCheck:!1,lastSecondsVideoQualityCheckDuration:0}}]};function normalizeFlowModules(Be){const Le=Be.flatMap((ft,ht,gt)=>{if(ft.key==="TUTORIAL_ID"){const xt=ft.configuration,kt=[{key:"ID",configuration:xt}];return xt.secondId&&kt.push({key:"SECOND_ID",configuration:xt}),kt}const At=gt[ht-1];return ft.key==="ID"&&(At==null?void 0:At.key)==="TUTORIAL_ID"?[]:[ft]}),Ye=ft=>ft,tt=ft=>ft.filter(ht=>ht.key!=="SELFIE");return(Le.some(ft=>ft.key==="VIDEO_ONBOARDING"&&ft.configuration.useAsSelfie===!0)?tt:Ye)(Le)}function handleResponse(Be){const Le=Be.data,Ye=normalizeFlowModules(Le.flowModules);return{...Le,flowModules:Ye}}async function getFlow$1(Be){var Le,Ye;try{const tt=await api.get("/omni/onboarding/flow",{headers:{"X-Incode-Hardware-Id":Be}});return recordEnforceCaptureAttemptLimits(Be,(Le=tt.data)==null?void 0:Le.enforceCaptureAttemptLimits),handleResponse(tt)}catch(tt){if(tt instanceof WebClientError&&((Ye=tt.response)==null?void 0:Ye.status)===400)return defaultFlow$1;throw tt}}const PERMISSION_ERROR_CODES={DENIED:"PERMISSION_DENIED",REFRESH:"PERMISSION_REFRESH"},PERMISSION_ERROR_MESSAGE="Error in permissions",createPermissionError=Be=>({code:Be,message:PERMISSION_ERROR_MESSAGE,error:new Error(Be)});var FlowType=(Be=>(Be.ID="ID",Be.FACE="Face",Be))(FlowType||{});function getErrorStatusCode(Be){var tt;if(Be instanceof WebClientError)return Be.statusCode;const Le=Be,Ye=(Le==null?void 0:Le.statusCode)??((tt=Le==null?void 0:Le.response)==null?void 0:tt.status)??(Le==null?void 0:Le.status);return typeof Ye=="number"?Ye:void 0}function toError(Be,Le){return Be instanceof Error?Be:new Error(Le)}function createFlowInitializationError(Be){const Le=getErrorStatusCode(Be);if(Le===401){const tt="Session expired";return{code:"SESSION_EXPIRED",type:"SESSION_EXPIRED",message:tt,statusCode:Le,error:new Error(tt)}}const Ye="Failed to initialize FlowManager";return{code:"FETCH_FLOW_ERROR",type:"FETCH_FLOW_ERROR",message:Ye,statusCode:Le,error:toError(Be,Ye)}}class AbstractFlowManager{constructor(Le){this.subscribers=[],this.flow=null,this.sessionToken=null,this.captureConfig=null,this.captureConfiguration=null,this.parentSize={width:window.innerWidth,height:window.innerHeight},this.uiConfig=null;const Ye={currentStep:null,isLoading:!1,attempts:0,errorDetails:null,successData:null,flowOutcome:"pending",sessionToken:null,...Le};this.initialState=Object.freeze({...Ye}),this.state={...this.initialState}}async isPermissionsEnabled(){if(!navigator.permissions)return appLog.info("flow","permissions: navigator.permissions unavailable"),!1;try{const Le=await navigator.permissions.query({name:"camera"});return appLog.info("flow",`permissions: camera state=${Le.state}`),Le.state==="granted"}catch(Le){return appLog.warn("flow",`permissions.query threw ${appLog.describeError(Le)}`),!1}}subscribe(Le){return this.subscribers.push(Le),Le(this.getState()),()=>{this.subscribers=this.subscribers.filter(Ye=>Ye!==Le)}}notifySubscribers(){const Le=this.getState();this.subscribers.forEach(Ye=>Ye(Le))}setState(Le){this.state={...this.state,...Le},this.notifySubscribers()}getState(){return{...this.state}}getToken(){return this.sessionToken}getParentSize(){return this.parentSize}incrementAttempts(){this.setState({attempts:this.state.attempts+1})}resetAttempts(){this.setState({attempts:0})}canRetry(){const Le=this.getEnforcedAttemptsLeft();return Le!==null?Le>0:this.state.attempts<this.getMaxAttempts()}getAttemptsLeft(){const Le=this.getEnforcedAttemptsLeft();return Le!==null?Le:Math.max(0,this.getMaxAttempts()-this.state.attempts)}getAttemptBudgetKind(){return null}getEnforcedAttemptsLeft(){const Le=this.getAttemptBudgetKind();return!Le||!this.sessionToken?null:getEnforcedAttemptsLeft(this.sessionToken,Le,this.getMaxAttempts())}async initialize(Le){var tt,nt;if(this.setState({isLoading:!0,errorDetails:null,flowOutcome:"pending",attempts:0,successData:null,sessionToken:Le.sessionToken}),this.parentSize=(tt=Le.parentSize)!=null&&tt.width&&((nt=Le.parentSize)!=null&&nt.height)?Le.parentSize:this.parentSize,this.sessionToken=Le.sessionToken,this.sessionToken&&Le.uiConfig&&(this.uiConfig=Le.uiConfig??null),Le.captureConfig)appLog.info("flow","init config source=captureConfig"),this.captureConfig=Le.captureConfig;else if(Le.flow)appLog.info("flow","init config source=flow"),this.flow=Le.flow,recordEnforceCaptureAttemptLimits(Le.sessionToken,Le.flow.enforceCaptureAttemptLimits);else{appLog.info("flow","init config source=fetch");try{this.flow=await this.fetchFlowConfiguration(this.sessionToken)}catch(ft){appLog.error("flow",`fetchFlow failed ${appLog.describeError(ft)}`);const ht=createFlowInitializationError(ft);this.setState({errorDetails:ht,isLoading:!1,flowOutcome:"error",currentStep:"error"});return}}this.captureConfiguration=this.getCaptureConfiguration(),appLog.info("flow","determine initial step");const Ye=await this.determineInitialStep(this.captureConfiguration);appLog.info("flow",`initial step=${String(Ye)}`),this.setState({currentStep:Ye,isLoading:!1})}reset(){this.state={...this.initialState},this.flow=null,this.sessionToken=null,this.captureConfiguration=null,this.captureConfig=null,this.setState(this.state)}fetchFlowConfiguration(Le){return getFlow$1(Le)}getFlow(){return this.flow}onClose(Le){const Ye=Le==="ID"?"errors.userCancelledIdFlow":"errors.userCancelledFaceFlow";onboardingAnalytics.update(),MlWasmJSApi$1.pseInFlight||MlWasmJSApi$1.reset(),this.completeWithError({code:"USER_CANCELLED",message:i18n.t(Ye),error:new Error("User cancelled")})}}const getCustomFields=({token:Be})=>api.get("/omni/get/custom-fields",{headers:{"X-Incode-Hardware-Id":Be}}).then(Le=>Le.data).catch(Le=>{var Ye;return Promise.reject(((Ye=Le==null?void 0:Le.response)==null?void 0:Ye.data)??Le)}),getDeviceRiskModuleConfiguration=async Be=>api.get("/omni/device-risk-client-id",{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(()=>({enabled:!1})),collectDeviceRiskResults=async Be=>api.post("/omni/collect-device-risk-results",null,{headers:{"X-Incode-Hardware-Id":Be}}).then(Ye=>Ye.data).catch(()=>({})),shouldDoSardineContextFromSardine=Be=>Be===void 0?!1:typeof Be.SardineClientID=="string"&&typeof Be.SardineSessionKey=="string"&&typeof Be.SardineUserID=="string",loadSardineSDK=async Be=>{const Le=Be?"api.sandbox.sardine.ai":"api.sardine.ai",Ye=document.createElement("script");return Ye.type="text/javascript",Ye.async=!0,Ye.src=`https://${Le}/assets/loader.min.js`,new Promise(tt=>{Ye.onload=()=>tt();const nt=document.getElementsByTagName("script")[0];nt.parentNode.insertBefore(Ye,nt)})};let sardineContext=null;const getSardineContext=()=>sardineContext,createSardineContextFromSardine=({sardineClientId:Be,sardineSessionKey:Le,sardineUserId:Ye,isSandbox:tt,token:nt,interviewId:ft})=>window._Sardine.createContext({clientId:Be,sessionKey:ft,flow:`Landing page ${location.pathname}`,environment:tt?"sandbox":"production",parentElement:document.body,parentSessionKey:Le,userIdHash:Ye,onDeviceResponse(ht){addEvent({code:"externalRiskSDKInitialized",payload:{riskService:"sardine",sardineData:{deviceId:ht.deviceId,uuid:ht.uuid},interviewId:ft,sardineClientId:Be,sardineSessionKey:Le,sardineUserId:Ye},token:nt})}}),createSardineContextIncode=({sardineClientId:Be,isSandbox:Le,token:Ye,interviewId:tt})=>window._Sardine.createContext({clientId:Be,sessionKey:tt,flow:`Landing page ${location.pathname}`,environment:"production",parentElement:document.body,userIdHash:tt,onDeviceResponse(nt){addEvent({code:"externalRiskSDKInitialized",payload:{riskService:"sardine",sardineData:{deviceId:nt.deviceId,uuid:nt.uuid},interviewId:tt,sardineClientId:Be},token:Ye})}}),enableDeviceRiskModule=async({token:Be,isSandbox:Le=!0,interviewId:Ye})=>{if(isOfflineMode())return null;const{customFields:tt}=await getCustomFields({token:Be}).catch(()=>({customFields:{SardineClientID:void 0,SardineSessionKey:void 0,SardineUserID:void 0}}));shouldDoSardineContextFromSardine(tt)&&(await loadSardineSDK(Le),sardineContext=createSardineContextFromSardine({sardineClientId:tt.SardineClientID,sardineSessionKey:tt.SardineSessionKey,sardineUserId:tt.SardineUserID,isSandbox:Le,token:Be,interviewId:Ye}));const nt=await getDeviceRiskModuleConfiguration(Be);return nt.enabled&&nt.riskClientId&&(await loadSardineSDK(!1),sardineContext=createSardineContextIncode({sardineClientId:nt.riskClientId,isSandbox:!1,token:Be,interviewId:Ye})),sardineContext},eventModuleNames={selfie:"SELFIE",authFace:"AUTH_FACE",mlConsent:"ML_CONSENT",combinedConsent:"COMBINED_CONSENT",privacyConsent:"PRIVACY_CONSENT",curpValidation:"CURP_VALIDATION",faceMatch:"FACE_MATCH",qr:"QR",videoSelfie:"VIDEO_ONBOARDING",passport:"ID",front:"ID",back:"ID",idOcr:"ID_OCR",document:"DOCUMENT_CAPTURE",creditCard:"CREDIT_CARD_FRONT",creditCardBack:"CREDIT_CARD_BACK",conference:"CONFERENCE",otp:"OTP",signature:"SIGNATURE",ekyc:"EXTERNAL_VERIFICATION",payments:"PAYMENTS",globalWatchList:"GLOBAL_WATCHLIST",customWatchList:"CUSTOM_WATCHLIST",email:"EMAIL",phone:"PHONE",instantVerifyEmail:"INSTANT_VERIFY_EMAIL",instantVerifyConsent:"INSTANT_VERIFY_CONSENT",forms:"FORMS",customModule:"CUSTOM_MODULE",mDocWallet:"MDOC_WALLET"},eventScreenNames={idOcrLoading:"ID_OCR.loading",idOcrInputting:"ID_OCR.inputting",idOcrSubmitting:"ID_OCR.submitting",idOcrError:"ID_OCR.error",faceMatch:"FACE_MATCH",faceCaptureTutorial:"SELFIE_CAPTURE_TUTORIAL",faceCaptureCamera:"SELFIE_CAMERA_CAPTURE",faceCaptureError:"SELFIE_ATTEMPT_FAILED",faceCaptureSuccess:"SELFIE_UPLOAD_SUCCEEDED",faceCaptureUpload:"SELFIE_UPLOAD_PROGRESS",mlConsent:"MACHINE_LEARNING_CONSENT",combinedConsent:"COMBINED_CONSENT",curpEnter:"ENTER_CURP",curpValidate:"VALIDATE_CURP",curpGenerate:"GENERATE_CURP",curpValidation:"CURP_VALIDATION_PROGRESS",curpValidationFailed:"CURP_VALIDATION_FAILED",curpValidationSuccess:"CURP_VALIDATION_SUCCEEDED",qrTutorial:"QR_TUTORIAL",qrScan:"QR_SCAN",smsOtp:"OTP",simpleOTP:"OTP",signatureInput:"SIGNATURE_INPUT",frontTutorial:"FRONT_ID_CAPTURE_TUTORIAL",frontCameraCapture:"FRONT_ID_CAMERA_CAPTURE",frontHelp:"FRONT_ID_HELP",frontReviewPhoto:"FRONT_ID_REVIEW_PHOTO",frontUploadProgress:"FRONT_ID_UPLOAD_PROGRESS",frontAttemptFailed:"FRONT_ID_ATTEMPT_FAILED",frontUploadSuccess:"FRONT_ID_UPLOAD_SUCCEEDED",backTutorial:"BACK_ID_CAPTURE_TUTORIAL",backCameraCapture:"BACK_ID_CAMERA_CAPTURE",backReviewPhoto:"BACK_ID_REVIEW_PHOTO",backUploadProgress:"BACK_ID_UPLOAD_PROGRESS",backAttemptFailed:"BACK_ID_ATTEMPT_FAILED",backUploadSuccess:"BACK_ID_UPLOAD_SUCCEEDED",backHelp:"BACK_ID_HELP",passportTutorial:"TUTORIAL_PASSPORT",passportCameraCapture:"PASSPORT_CAMERA_CAPTURE",passportReviewPhoto:"PASSPORT_REVIEW_PHOTO",passportUploadProgress:"PASSPORT_UPLOAD_PROGRESS",passportUploadSuccess:"PASSPORT_UPLOAD_SUCCEEDED",passportAttemptFailed:"PASSPORT_ATTEMPT_FAILED",passportHelp:"PASSPORT_HELP",passportIdError:"PASSPORT_ERROR",passportManualCapture:"PASSPORT_MANUAL_CAPTURE",passportNoAttemptsLeft:"PASSPORT_NO_ATTEMPTS_LEFT",frontIdError:"FRONT_ID_ERROR",backIdError:"BACK_ID_ERROR",frontIdNoAttemptsLeft:"FRONT_ID_NO_ATTEMPTS_LEFT",backIdNoAttemptsLeft:"BACK_ID_NO_ATTEMPTS_LEFT",frontIdManualCapture:"FRONT_ID_MANUAL_CAPTURE",backIdManualCapture:"BACK_ID_MANUAL_CAPTURE",selfieManualCapture:"SELFIE_MANUAL_CAPTURE",selfieNoAttemptsLeft:"SELFIE_NO_ATTEMPTS_LEFT",idCameraDeviceChooser:"ID_CAMERA_DEVICE_CHOOSER",idCameraPermissionSlider:"ID_CAMERA_PERMISSION_SLIDER",idCameraPermissionAllow:"ID_CAMERA_PERMISSION_ALLOW",idCameraPermissionRequesting:"ID_CAMERA_PERMISSION_REQUESTING",idCameraPermissionDenied:"ID_CAMERA_PERMISSION_DENIED",idCameraPermissionInstructions:"ID_CAMERA_PERMISSION_INSTRUCTIONS",selfieCameraPermissionAllow:"SELFIE_CAMERA_PERMISSION_ALLOW",selfieCameraPermissionRequesting:"SELFIE_CAMERA_PERMISSION_REQUESTING",selfieCameraPermissionDenied:"SELFIE_CAMERA_PERMISSION_DENIED",selfieCameraPermissionInstructions:"SELFIE_CAMERA_PERMISSION_INSTRUCTIONS",selfieCameraPermissionSlider:"SELFIE_CAMERA_PERMISSION_SLIDER",selfieNoConnection:"SELFIE_NO_CONNECTION",documentTutorial:"DOCUMENT_CAPTURE_TUTORIAL",documentManualCapture:"DOCUMENT_MANUAL_CAPTURE",documentNoAttemptsLeft:"DOCUMENT_NO_ATTEMPTS_LEFT",documentCameraCapture:"DOCUMENT_CAMERA_CAPTURE",documentHelp:"DOCUMENT_HELP",documentReviewPhoto:"DOCUMENT_REVIEW_PHOTO",documentUploadProgress:"DOCUMENT_UPLOAD_IN_PROGRESS",documentAttemptFailed:"DOCUMENT_ATTEMPT_FAILED",documentUploadSuccess:"DOCUMENT_UPLOAD_SUCCEEDED",conferenceWait:"CONFERENCE_WAIT",conferenceVideoChat:"CONFERENCE_VIDEO_CHAT",conferenceMessageChat:"CONFERENCE_MESSAGE_CHAT",videoSelfieTutorial:"VIDEO_SELFIE_TUTORIAL",videoSelfie:"VIDEO_SELFIE",videoSelfieFaceCapture:"VIDEO_SELFIE_FACE_CAPTURE",videoSelfieFaceUploadProgress:"VIDEO_SELFIE_FACE_UPLOAD_PROGRESS",videoSelfieFaceAttemptFailed:"VIDEO_SELFIE_FACE_ATTEMPT_FAILED",videoSelfieFaceUploadSucceeded:"VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED",videoSelfieFrontIdCapture:"VIDEO_SELFIE_FRONT_ID_CAPTURE",videoSelfieFrontIdUploadProgress:"VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS",videoSelfieFrontIdAttemptFailed:"VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED",videoSelfieFrontIdUploadSucceeded:"VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED",videoSelfieBackIdCapture:"VIDEO_SELFIE_BACK_ID_CAPTURE",videoSelfieBackIdUploadProgress:"VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS",videoSelfieBackIdAttemptFailed:"VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED",videoSelfieBackIdUploadSucceeded:"VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED",videoSelfieDocumentCapture:"VIDEO_SELFIE_DOCUMENT_CAPTURE",videoSelfieVoiceQuestion:"VIDEO_SELFIE_VOICE_QUESTION",videoSelfieVoiceFinalQuestion:"VIDEO_SELFIE_VOICE_FINAL_QUESTION",videoSelfieVideoUpload:"VIDEO SELFIE VIDEO UPLOAD",ekycInput:"EKYC_INPUT",ekycProgress:"EKYC_PROGRESS",ekycSucceeded:"EKYC_SUCCEEDED",ekycFailed:"EKYC_FAILED",paymentsInput:"PAYMENTS_INPUT",paymentsProgress:"PAYMENTS_PROGRESS",paymentsSucceeded:"PAYMENTS_SUCCEEDED",paymentsFailed:"PAYMENTS_FAILED",forms:"FORMS",globalWatchListInput:"GLOBAL_WATCHLIST_INPUT",globalWatchListProgress:"GLOBAL_WATCHLIST_PROGRESS",globalWatchListSuccess:"GLOBAL_WATCHLIST_SUCCEEDED",globalWatchListFailed:"GLOBAL_WATCHLIST_FAILED",customWatchListInput:"CUSTOM_WATCHLIST_INPUT",customWatchListProgress:"CUSTOM_WATCHLIST_PROGRESS",customWatchListSuccess:"CUSTOM_WATCHLIST_SUCCEEDED",customWatchListFailed:"CUSTOM_WATCHLIST_FAILED",emailInput:"EMAIL_INPUT",phoneInput:"PHONE_INPUT",instantVerify:"INSTANT_VERIFY",authFace:"AUTH_FACE",authFaceError:"AUTH_FACE_ATTEMPT_FAILED",authFaceUpload:"AUTH_FACE_UPLOAD_PROGRESS",authFaceUploadSuccess:"AUTH_FACE_UPLOAD_SUCCEEDED",authFaceUploadFailed:"AUTH_FACE_UPLOAD_FAILED",customModuleCallback:"CUSTOM_MODULE_CALLBACK",customModuleProcessing:"CUSTOM_MODULE_PROCESSING",digitalIdFileSelection:"DIGITAL_ID_FILE_SELECTION",digitalIdFileReview:"DIGITAL_ID_FILE_REVIEW",digitalIdUploadProgress:"DIGITAL_ID_UPLOAD_PROGRESS",digitalIdUploadSuccess:"DIGITAL_ID_UPLOAD_SUCCEEDED",digitalIdUploadFailed:"DIGITAL_ID_UPLOAD_FAILED",digitalIdAnalysisProgress:"DIGITAL_ID_ANALYSIS_PROGRESS",digitalIdVerificationSuccess:"DIGITAL_ID_VERIFICATION_SUCCESS",digitalIdVerificationFailed:"DIGITAL_ID_VERIFICATION_FAILED",documentChooser:"DOCUMENT_CHOOSER",landingPage:"LANDING_PAGE",privacyConsent:"PRIVACY_CONSENT",mDocWalletError:"MDOC_WALLET_ERROR"},streamingEvents={strSessionDidConnect:"strSessionDidConnect",strSessionDidDisconnect:"strSessionDidDisconnect",strSessionDidFailWithError:"strSessionDidFailWithError",strStreamVideoCaptureStart:"strStreamVideoCaptureStart",strStreamVideoCaptureStop:"strStreamVideoCaptureStop",strStreamPublisherCreated:"strStreamPublisherCreated",strStreamPublisherDestroyed:"strStreamPublisherDestroyed",strStreamPublisherDidFailWithError:"strStreamPublisherDidFailWithError"},videoSelfieEvents={imageTooBlurry:"imageTooBlurry",fillFrame:"fillFrame",checkCameraOrLighting:"checkCameraOrLighting",frontIdCaptureStarted:"frontIdCaptureStarted",lookAtCamera:"lookAtCamera",moveCloser:"moveCloser",lookingForFrontId:"lookingForFrontId",lookingForBackId:"lookingForBackId",cameraSwitchToBack:"cameraSwitchToBack",cameraSwitchToFront:"cameraSwitchToFront",audioStreamOpened:"audioStreamOpened",audioStreamClosed:"audioStreamClosed",videoSelfieVideoUploadInProgress:"videoSelfieVideoUploadInProgress",videoSelfieTosNotAccepted:"videoSelfieTosNotAccepted",videoSelfieTosAccepted:"videoSelfieTosAccepted",videoSelfieStreamCreated:"videoSelfieStreamCreated",videoSelfieStreamDestroyed:"videoSelfieStreamDestroyed",videoSelfieReconnecting:"videoSelfieReconnecting",videoSelfieReconnected:"videoSelfieReconnected"},tutorialScreenNamesMapper={passport:eventScreenNames.passportTutorial,front:eventScreenNames.frontTutorial,back:eventScreenNames.backTutorial,selfie:eventScreenNames.faceCaptureTutorial},cameraScreenNamesMapper={front:"front",back:"back",passport:"passport",creditCard:"front",creditCardBack:"back",document:"document"};function screenEvent({module:Be,payload:Le,token:Ye,screen:tt,code:nt}){try{addEvent({token:Ye,module:Be,code:nt,screen:tt,clientTimestamp:new Date().getTime(),payload:{...Le??{}}})}catch(ft){console.error(ft)}}function updateSardineConfigOnScreenChange(Be,Le){const Ye=getSardineContext(),tt=Le?`${Be} - ${Le}`:Be;Ye&&Ye.updateConfig({flow:tt})}function useScreenEvents({module:Be,screen:Le,payload:Ye={},token:tt}){React.useEffect(()=>(updateSardineConfigOnScreenChange(Be,Le),screenEvent({module:Be,payload:Ye,code:"screenOpened",token:tt,screen:Le}),()=>{screenEvent({module:Be,payload:Ye,code:"screenClosed",token:tt,screen:Le}),updateSardineConfigOnScreenChange(Be)}),[])}function useScreenTransitionEvents({module:Be,screen:Le,token:Ye}){React.useEffect(()=>(updateSardineConfigOnScreenChange(Be,Le),screenEvent({module:Be,screen:Le,code:"screenOpened",token:Ye}),()=>{screenEvent({module:Be,screen:Le,code:"screenClosed",token:Ye}),updateSardineConfigOnScreenChange(Be)}),[Be,Le,Ye])}function useModuleEvents({module:Be,payload:Le={},token:Ye,screen:tt,includeAppLogs:nt}){React.useLayoutEffect(()=>{const ft=async()=>{const ht=await getModuleFeatureFlags(Be);screenEvent({module:Be,screen:tt,payload:{...Le,...ht},code:"moduleOpened",token:Ye})};return updateSardineConfigOnScreenChange(Be,tt),ft(),()=>{const ht=async()=>{const gt=await getModuleFeatureFlags(Be);screenEvent({module:Be,payload:{...Le,...gt,...nt?{appLogs:appLog.getAppLogs()}:{}},screen:tt,code:"moduleClosed",token:Ye})};setTimeout(()=>{ht()},0)}},[])}const addScreenEvent=({module:Be,token:Le,screen:Ye,payload:tt,shouldOpen:nt,sardineScreen:ft})=>{nt&&updateSardineConfigOnScreenChange(Be,ft??Ye),screenEvent({module:Be,payload:tt,token:Le,screen:Ye,code:nt?"screenOpened":"screenClosed"})};function getIdCaptureReviewScreen(Be){return Be==="front"?eventScreenNames.frontReviewPhoto:Be==="back"?eventScreenNames.backReviewPhoto:eventScreenNames.passportReviewPhoto}function getIdCaptureNoAttemptsScreen(Be){return Be==="front"?eventScreenNames.frontIdNoAttemptsLeft:Be==="back"?eventScreenNames.backIdNoAttemptsLeft:eventScreenNames.passportNoAttemptsLeft}function getIdCaptureManualScreen(Be){return Be==="front"?eventScreenNames.frontIdManualCapture:Be==="back"?eventScreenNames.backIdManualCapture:eventScreenNames.passportManualCapture}function getCaptureIdReviewScreen(Be){return Be==="document"?eventScreenNames.documentReviewPhoto:getIdCaptureReviewScreen(Be)}function getCaptureIdManualScreen(Be){return Be==="document"?eventScreenNames.documentManualCapture:getIdCaptureManualScreen(Be)}function getCaptureIdNoAttemptsScreen(Be){return Be==="document"?eventScreenNames.documentNoAttemptsLeft:getIdCaptureNoAttemptsScreen(Be)}function getCaptureIdErrorScreen(Be){return Be==="document"?eventScreenNames.documentAttemptFailed:Be==="front"?eventScreenNames.frontIdError:Be==="back"?eventScreenNames.backIdError:Be==="passport"?eventScreenNames.passportIdError:eventScreenNames.frontIdError}function getIdV2SardineScreen(Be,Le){return Be==="passport"?Le==="uploading"?eventScreenNames.passportUploadProgress:Le==="success"?eventScreenNames.passportUploadSuccess:Le==="error"?eventScreenNames.passportIdError:Le==="manual"?eventScreenNames.passportManualCapture:Le==="noAttempts"?eventScreenNames.passportNoAttemptsLeft:eventScreenNames.passportCameraCapture:Be==="back"?Le==="uploading"?eventScreenNames.backUploadProgress:Le==="success"?eventScreenNames.backUploadSuccess:Le==="error"?eventScreenNames.backIdError:Le==="manual"?eventScreenNames.backIdManualCapture:Le==="noAttempts"?eventScreenNames.backIdNoAttemptsLeft:eventScreenNames.backCameraCapture:Le==="uploading"?eventScreenNames.frontUploadProgress:Le==="success"?eventScreenNames.frontUploadSuccess:Le==="error"?eventScreenNames.frontIdError:Le==="manual"?eventScreenNames.frontIdManualCapture:Le==="noAttempts"?eventScreenNames.frontIdNoAttemptsLeft:eventScreenNames.frontCameraCapture}const FlowPage=({uiConfig:Be,onClose:Le,onCloseCancel:Ye,hideFooterBranding:tt,hideHeaderBranding:nt,...ft})=>{var At,xt,Et,kt,Ct,yt,vt,bt,Rt,wt,Tt,Bt,Ot,Pt;const ht=!!((At=Be==null?void 0:Be.closeButton)!=null&&At.show),gt=!!((Et=(xt=Be==null?void 0:Be.branding)==null?void 0:xt.logo)!=null&&Et.src||(Ct=(kt=Be==null?void 0:Be.branding)==null?void 0:kt.logo)!=null&&Ct.height);return jsxRuntimeExports.jsx(Page$1,{closeButton:{onClose:Le,show:ht,position:(yt=Be==null?void 0:Be.closeButton)==null?void 0:yt.position,offset:(vt=Be==null?void 0:Be.closeButton)==null?void 0:vt.offset,color:(bt=Be==null?void 0:Be.closeButton)==null?void 0:bt.color,onCancel:Ye},...gt?{logo:{src:(wt=(Rt=Be==null?void 0:Be.branding)==null?void 0:Rt.logo)==null?void 0:wt.src,height:(Bt=(Tt=Be==null?void 0:Be.branding)==null?void 0:Tt.logo)==null?void 0:Bt.height}}:{},hideFooterBranding:tt||((Ot=Be==null?void 0:Be.branding)==null?void 0:Ot.hideFooterBranding),hideHeaderBranding:nt||((Pt=Be==null?void 0:Be.branding)==null?void 0:Pt.hideHeaderBranding),...ft})},breakpoints$1={xs:"568px",sm:"667px",md:"812px",lg:"926px"},ArrowRightIcon=({width:Be=13,height:Le=14})=>{const tt=useTokens().color.text.body.primary;return jsxRuntimeExports.jsx("svg",{width:Be,height:Le,viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntimeExports.jsx("path",{d:"M0 8.08009V5.92009H9.198L4.698 1.87009L6.228 0.340088L12.6 6.28009V7.70209L6.228 13.6601L4.698 12.1301L9.198 8.08009H0Z",fill:tt})})},arrowEl$1=jsxRuntimeExports.jsx(ArrowRightIcon,{}),BoldWithArrow=({i18nKey:Be})=>{const Le=useTokens();return jsxRuntimeExports.jsx(Flex$1,{as:"span",inline:!0,gap:"0.3em",forceGap:!0,align:"center",fontWeight:700,whiteSpace:"nowrap",color:Le.color.text.body.primary,children:jsxRuntimeExports.jsx(Trans,{i18nKey:Be,components:{arrow:arrowEl$1}})})},spin=mt`
2509
2509
  from {
2510
2510
  transform: rotate(0deg);
2511
2511
  }
@@ -10041,7 +10041,7 @@ Event: ${getEventDescription(Be)}`),!0;if(_isDeniedUrl(Be,Le.denyUrls))return DE
10041
10041
  Event: ${getEventDescription(Be)}.
10042
10042
  Url: ${_getEventFilterUrl(Be)}`),!0;if(!_isAllowedUrl(Be,Le.allowUrls))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to not being matched by \`allowUrls\` option.
10043
10043
  Event: ${getEventDescription(Be)}.
10044
- Url: ${_getEventFilterUrl(Be)}`),!0}return!1}function _isIgnoredError(Be,Le){return Le!=null&&Le.length?getPossibleEventMessages(Be).some(Ye=>stringMatchesSomePattern(Ye,Le)):!1}function _isIgnoredTransaction(Be,Le){if(!(Le!=null&&Le.length))return!1;const Ye=Be.transaction;return Ye?stringMatchesSomePattern(Ye,Le):!1}function _isDeniedUrl(Be,Le){if(!(Le!=null&&Le.length))return!1;const Ye=_getEventFilterUrl(Be);return Ye?stringMatchesSomePattern(Ye,Le):!1}function _isAllowedUrl(Be,Le){if(!(Le!=null&&Le.length))return!0;const Ye=_getEventFilterUrl(Be);return Ye?stringMatchesSomePattern(Ye,Le):!0}function _getLastValidUrl(Be=[]){for(let Le=Be.length-1;Le>=0;Le--){const Ye=Be[Le];if(Ye&&Ye.filename!=="<anonymous>"&&Ye.filename!=="[native code]")return Ye.filename||null}return null}function _getEventFilterUrl(Be){var Le,Ye;try{const tt=[...((Le=Be.exception)==null?void 0:Le.values)??[]].reverse().find(ft=>{var ht,gt,At;return((ht=ft.mechanism)==null?void 0:ht.parent_id)===void 0&&((At=(gt=ft.stacktrace)==null?void 0:gt.frames)==null?void 0:At.length)}),nt=(Ye=tt==null?void 0:tt.stacktrace)==null?void 0:Ye.frames;return nt?_getLastValidUrl(nt):null}catch{return DEBUG_BUILD$2&&debug.error(`Cannot extract url for event ${getEventDescription(Be)}`),null}}function _isUselessError(Be){var Le,Ye;return(Ye=(Le=Be.exception)==null?void 0:Le.values)!=null&&Ye.length?!Be.message&&!Be.exception.values.some(tt=>tt.stacktrace||tt.type&&tt.type!=="Error"||tt.value):!1}function applyAggregateErrorsToEvent(Be,Le,Ye,tt,nt,ft){var gt;if(!((gt=nt.exception)!=null&&gt.values)||!ft||!isInstanceOf(ft.originalException,Error))return;const ht=nt.exception.values.length>0?nt.exception.values[nt.exception.values.length-1]:void 0;ht&&(nt.exception.values=aggregateExceptionsFromError(Be,Le,tt,ft.originalException,Ye,nt.exception.values,ht,0))}function aggregateExceptionsFromError(Be,Le,Ye,tt,nt,ft,ht,gt){if(ft.length>=Ye+1)return ft;let At=[...ft];if(isInstanceOf(tt[nt],Error)){applyExceptionGroupFieldsForParentException(ht,gt);const xt=Be(Le,tt[nt]),Et=At.length;applyExceptionGroupFieldsForChildException(xt,nt,Et,gt),At=aggregateExceptionsFromError(Be,Le,Ye,tt[nt],nt,[xt,...At],xt,Et)}return Array.isArray(tt.errors)&&tt.errors.forEach((xt,Et)=>{if(isInstanceOf(xt,Error)){applyExceptionGroupFieldsForParentException(ht,gt);const kt=Be(Le,xt),Ct=At.length;applyExceptionGroupFieldsForChildException(kt,`errors[${Et}]`,Ct,gt),At=aggregateExceptionsFromError(Be,Le,Ye,xt,nt,[kt,...At],kt,Ct)}}),At}function applyExceptionGroupFieldsForParentException(Be,Le){Be.mechanism={handled:!0,type:"auto.core.linked_errors",...Be.mechanism,...Be.type==="AggregateError"&&{is_exception_group:!0},exception_id:Le}}function applyExceptionGroupFieldsForChildException(Be,Le,Ye,tt){Be.mechanism={handled:!0,...Be.mechanism,type:"chained",source:Le,exception_id:Ye,parent_id:tt}}function addConsoleInstrumentationHandler(Be){const Le="console";addHandler(Le,Be),maybeInstrument(Le,instrumentConsole)}function instrumentConsole(){"console"in GLOBAL_OBJ&&CONSOLE_LEVELS.forEach(function(Be){Be in GLOBAL_OBJ.console&&fill(GLOBAL_OBJ.console,Be,function(Le){return originalConsoleMethods[Be]=Le,function(...Ye){triggerHandlers("console",{args:Ye,level:Be});const nt=originalConsoleMethods[Be];nt==null||nt.apply(GLOBAL_OBJ.console,Ye)}})})}function severityLevelFromString(Be){return Be==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(Be)?Be:"log"}const INTEGRATION_NAME$4="Dedupe",_dedupeIntegration=()=>{let Be;return{name:INTEGRATION_NAME$4,processEvent(Le){if(Le.type)return Le;try{if(_shouldDropEvent(Le,Be))return DEBUG_BUILD$2&&debug.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return Be=Le}}},dedupeIntegration=_dedupeIntegration;function _shouldDropEvent(Be,Le){return Le?!!(_isSameMessageEvent(Be,Le)||_isSameExceptionEvent(Be,Le)):!1}function _isSameMessageEvent(Be,Le){const Ye=Be.message,tt=Le.message;return!(!Ye&&!tt||Ye&&!tt||!Ye&&tt||Ye!==tt||!_isSameFingerprint(Be,Le)||!_isSameStacktrace(Be,Le))}function _isSameExceptionEvent(Be,Le){const Ye=_getExceptionFromEvent(Le),tt=_getExceptionFromEvent(Be);return!(!Ye||!tt||Ye.type!==tt.type||Ye.value!==tt.value||!_isSameFingerprint(Be,Le)||!_isSameStacktrace(Be,Le))}function _isSameStacktrace(Be,Le){let Ye=getFramesFromEvent(Be),tt=getFramesFromEvent(Le);if(!Ye&&!tt)return!0;if(Ye&&!tt||!Ye&&tt||(Ye=Ye,tt=tt,tt.length!==Ye.length))return!1;for(let nt=0;nt<tt.length;nt++){const ft=tt[nt],ht=Ye[nt];if(ft.filename!==ht.filename||ft.lineno!==ht.lineno||ft.colno!==ht.colno||ft.function!==ht.function)return!1}return!0}function _isSameFingerprint(Be,Le){let Ye=Be.fingerprint,tt=Le.fingerprint;if(!Ye&&!tt)return!0;if(Ye&&!tt||!Ye&&tt)return!1;Ye=Ye,tt=tt;try{return Ye.join("")===tt.join("")}catch{return!1}}function _getExceptionFromEvent(Be){var Le,Ye;return(Ye=(Le=Be.exception)==null?void 0:Le.values)==null?void 0:Ye[0]}function getBreadcrumbLogLevelFromHttpStatusCode(Be){if(Be!==void 0)return Be>=400&&Be<500?"warning":Be>=500?"error":void 0}const WINDOW$2=GLOBAL_OBJ;function supportsHistory(){return"history"in WINDOW$2&&!!WINDOW$2.history}function _isFetchSupported(){if(!("fetch"in WINDOW$2))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function isNativeFunction(Be){return Be&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(Be.toString())}function supportsNativeFetch(){var Ye;if(typeof EdgeRuntime=="string")return!0;if(!_isFetchSupported())return!1;if(isNativeFunction(WINDOW$2.fetch))return!0;let Be=!1;const Le=WINDOW$2.document;if(Le&&typeof Le.createElement=="function")try{const tt=Le.createElement("iframe");tt.hidden=!0,Le.head.appendChild(tt),(Ye=tt.contentWindow)!=null&&Ye.fetch&&(Be=isNativeFunction(tt.contentWindow.fetch)),Le.head.removeChild(tt)}catch(tt){DEBUG_BUILD$2&&debug.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",tt)}return Be}function addFetchInstrumentationHandler(Be,Le){const Ye="fetch";addHandler(Ye,Be),maybeInstrument(Ye,()=>instrumentFetch(void 0,Le))}function instrumentFetch(Be,Le=!1){Le&&!supportsNativeFetch()||fill(GLOBAL_OBJ,"fetch",function(Ye){return function(...tt){const nt=new Error,{method:ft,url:ht}=parseFetchArgs(tt),gt={args:tt,fetchData:{method:ft,url:ht},startTimestamp:timestampInSeconds()*1e3,virtualError:nt,headers:getHeadersFromFetchArgs(tt)};return triggerHandlers("fetch",{...gt}),Ye.apply(GLOBAL_OBJ,tt).then(async At=>(triggerHandlers("fetch",{...gt,endTimestamp:timestampInSeconds()*1e3,response:At}),At),At=>{if(triggerHandlers("fetch",{...gt,endTimestamp:timestampInSeconds()*1e3,error:At}),isError(At)&&At.stack===void 0&&(At.stack=nt.stack,addNonEnumerableProperty(At,"framesToPop",1)),At instanceof TypeError&&(At.message==="Failed to fetch"||At.message==="Load failed"||At.message==="NetworkError when attempting to fetch resource."))try{const xt=new URL(gt.fetchData.url);At.message=`${At.message} (${xt.host})`}catch{}throw At})}})}function hasProp(Be,Le){return!!Be&&typeof Be=="object"&&!!Be[Le]}function getUrlFromResource(Be){return typeof Be=="string"?Be:Be?hasProp(Be,"url")?Be.url:Be.toString?Be.toString():"":""}function parseFetchArgs(Be){if(Be.length===0)return{method:"GET",url:""};if(Be.length===2){const[Ye,tt]=Be;return{url:getUrlFromResource(Ye),method:hasProp(tt,"method")?String(tt.method).toUpperCase():"GET"}}const Le=Be[0];return{url:getUrlFromResource(Le),method:hasProp(Le,"method")?String(Le.method).toUpperCase():"GET"}}function getHeadersFromFetchArgs(Be){const[Le,Ye]=Be;try{if(typeof Ye=="object"&&Ye!==null&&"headers"in Ye&&Ye.headers)return new Headers(Ye.headers);if(isRequest(Le))return new Headers(Le.headers)}catch{}}function getSDKSource(){return"npm"}const WINDOW$1=GLOBAL_OBJ;let ignoreOnError=0;function shouldIgnoreOnError(){return ignoreOnError>0}function ignoreNextOnError(){ignoreOnError++,setTimeout(()=>{ignoreOnError--})}function wrap(Be,Le={}){function Ye(nt){return typeof nt=="function"}if(!Ye(Be))return Be;try{const nt=Be.__sentry_wrapped__;if(nt)return typeof nt=="function"?nt:Be;if(getOriginalFunction(Be))return Be}catch{return Be}const tt=function(...nt){try{const ft=nt.map(ht=>wrap(ht,Le));return Be.apply(this,ft)}catch(ft){throw ignoreNextOnError(),withScope(ht=>{ht.addEventProcessor(gt=>(Le.mechanism&&(addExceptionTypeValue(gt,void 0),addExceptionMechanism(gt,Le.mechanism)),gt.extra={...gt.extra,arguments:nt},gt)),captureException(ft)}),ft}};try{for(const nt in Be)Object.prototype.hasOwnProperty.call(Be,nt)&&(tt[nt]=Be[nt])}catch{}markFunctionWrapped(tt,Be),addNonEnumerableProperty(Be,"__sentry_wrapped__",tt);try{Object.getOwnPropertyDescriptor(tt,"name").configurable&&Object.defineProperty(tt,"name",{get(){return Be.name}})}catch{}return tt}function getHttpRequestData(){const Be=getLocationHref(),{referrer:Le}=WINDOW$1.document||{},{userAgent:Ye}=WINDOW$1.navigator||{},tt={...Le&&{Referer:Le},...Ye&&{"User-Agent":Ye}};return{url:Be,headers:tt}}function exceptionFromError(Be,Le){const Ye=parseStackFrames(Be,Le),tt={type:extractType(Le),value:extractMessage(Le)};return Ye.length&&(tt.stacktrace={frames:Ye}),tt.type===void 0&&tt.value===""&&(tt.value="Unrecoverable error caught"),tt}function eventFromPlainObject(Be,Le,Ye,tt){const nt=getClient(),ft=nt==null?void 0:nt.getOptions().normalizeDepth,ht=getErrorPropertyFromObject(Le),gt={__serialized__:normalizeToSize(Le,ft)};if(ht)return{exception:{values:[exceptionFromError(Be,ht)]},extra:gt};const At={exception:{values:[{type:isEvent(Le)?Le.constructor.name:tt?"UnhandledRejection":"Error",value:getNonErrorObjectExceptionValue(Le,{isUnhandledRejection:tt})}]},extra:gt};if(Ye){const xt=parseStackFrames(Be,Ye);xt.length&&(At.exception.values[0].stacktrace={frames:xt})}return At}function eventFromError(Be,Le){return{exception:{values:[exceptionFromError(Be,Le)]}}}function parseStackFrames(Be,Le){const Ye=Le.stacktrace||Le.stack||"",tt=getSkipFirstStackStringLines(Le),nt=getPopFirstTopFrames(Le);try{return Be(Ye,tt,nt)}catch{}return[]}const reactMinifiedRegexp=/Minified React error #\d+;/i;function getSkipFirstStackStringLines(Be){return Be&&reactMinifiedRegexp.test(Be.message)?1:0}function getPopFirstTopFrames(Be){return typeof Be.framesToPop=="number"?Be.framesToPop:0}function isWebAssemblyException(Be){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?Be instanceof WebAssembly.Exception:!1}function extractType(Be){const Le=Be==null?void 0:Be.name;return!Le&&isWebAssemblyException(Be)?Be.message&&Array.isArray(Be.message)&&Be.message.length==2?Be.message[0]:"WebAssembly.Exception":Le}function extractMessage(Be){const Le=Be==null?void 0:Be.message;return isWebAssemblyException(Be)?Array.isArray(Be.message)&&Be.message.length==2?Be.message[1]:"wasm exception":Le?Le.error&&typeof Le.error.message=="string"?Le.error.message:Le:"No error message"}function eventFromException(Be,Le,Ye,tt){const nt=(Ye==null?void 0:Ye.syntheticException)||void 0,ft=eventFromUnknownInput(Be,Le,nt,tt);return addExceptionMechanism(ft),ft.level="error",Ye!=null&&Ye.event_id&&(ft.event_id=Ye.event_id),resolvedSyncPromise(ft)}function eventFromMessage(Be,Le,Ye="info",tt,nt){const ft=(tt==null?void 0:tt.syntheticException)||void 0,ht=eventFromString(Be,Le,ft,nt);return ht.level=Ye,tt!=null&&tt.event_id&&(ht.event_id=tt.event_id),resolvedSyncPromise(ht)}function eventFromUnknownInput(Be,Le,Ye,tt,nt){let ft;if(isErrorEvent$1(Le)&&Le.error)return eventFromError(Be,Le.error);if(isDOMError(Le)||isDOMException(Le)){const ht=Le;if("stack"in Le)ft=eventFromError(Be,Le);else{const gt=ht.name||(isDOMError(ht)?"DOMError":"DOMException"),At=ht.message?`${gt}: ${ht.message}`:gt;ft=eventFromString(Be,At,Ye,tt),addExceptionTypeValue(ft,At)}return"code"in ht&&(ft.tags={...ft.tags,"DOMException.code":`${ht.code}`}),ft}return isError(Le)?eventFromError(Be,Le):isPlainObject(Le)||isEvent(Le)?(ft=eventFromPlainObject(Be,Le,Ye,nt),addExceptionMechanism(ft,{synthetic:!0}),ft):(ft=eventFromString(Be,Le,Ye,tt),addExceptionTypeValue(ft,`${Le}`),addExceptionMechanism(ft,{synthetic:!0}),ft)}function eventFromString(Be,Le,Ye,tt){const nt={};if(tt&&Ye){const ft=parseStackFrames(Be,Ye);ft.length&&(nt.exception={values:[{value:Le,stacktrace:{frames:ft}}]}),addExceptionMechanism(nt,{synthetic:!0})}if(isParameterizedString(Le)){const{__sentry_template_string__:ft,__sentry_template_values__:ht}=Le;return nt.logentry={message:ft,params:ht},nt}return nt.message=Le,nt}function getNonErrorObjectExceptionValue(Be,{isUnhandledRejection:Le}){const Ye=extractExceptionKeysForMessage(Be),tt=Le?"promise rejection":"exception";return isErrorEvent$1(Be)?`Event \`ErrorEvent\` captured as ${tt} with message \`${Be.message}\``:isEvent(Be)?`Event \`${getObjectClassName(Be)}\` (type=${Be.type}) captured as ${tt}`:`Object captured as ${tt} with keys: ${Ye}`}function getObjectClassName(Be){try{const Le=Object.getPrototypeOf(Be);return Le?Le.constructor.name:void 0}catch{}}function getErrorPropertyFromObject(Be){for(const Le in Be)if(Object.prototype.hasOwnProperty.call(Be,Le)){const Ye=Be[Le];if(Ye instanceof Error)return Ye}}class BrowserClient extends Client{constructor(Le){var Et;const Ye=applyDefaultOptions(Le),tt=WINDOW$1.SENTRY_SDK_SOURCE||getSDKSource();applySdkMetadata(Ye,"browser",["browser"],tt),(Et=Ye._metadata)!=null&&Et.sdk&&(Ye._metadata.sdk.settings={infer_ip:Ye.sendDefaultPii?"auto":"never",...Ye._metadata.sdk.settings}),super(Ye);const{sendDefaultPii:nt,sendClientReports:ft,enableLogs:ht,_experiments:gt,enableMetrics:At}=this._options,xt=At??(gt==null?void 0:gt.enableMetrics)??!0;WINDOW$1.document&&(ft||ht||xt)&&WINDOW$1.document.addEventListener("visibilitychange",()=>{WINDOW$1.document.visibilityState==="hidden"&&(ft&&this._flushOutcomes(),ht&&_INTERNAL_flushLogsBuffer(this),xt&&_INTERNAL_flushMetricsBuffer(this))}),nt&&this.on("beforeSendSession",addAutoIpAddressToSession)}eventFromException(Le,Ye){return eventFromException(this._options.stackParser,Le,Ye,this._options.attachStacktrace)}eventFromMessage(Le,Ye="info",tt){return eventFromMessage(this._options.stackParser,Le,Ye,tt,this._options.attachStacktrace)}_prepareEvent(Le,Ye,tt,nt){return Le.platform=Le.platform||"javascript",super._prepareEvent(Le,Ye,tt,nt)}}function applyDefaultOptions(Be){var Le;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(Le=WINDOW$1.SENTRY_RELEASE)==null?void 0:Le.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...Be}}const DEBUG_BUILD$1=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,WINDOW=GLOBAL_OBJ,DEBOUNCE_DURATION=1e3;let debounceTimerID,lastCapturedEventType,lastCapturedEventTargetId;function addClickKeypressInstrumentationHandler(Be){const Le="dom";addHandler(Le,Be),maybeInstrument(Le,instrumentDOM)}function instrumentDOM(){if(!WINDOW.document)return;const Be=triggerHandlers.bind(null,"dom"),Le=makeDOMEventHandler(Be,!0);WINDOW.document.addEventListener("click",Le,!1),WINDOW.document.addEventListener("keypress",Le,!1),["EventTarget","Node"].forEach(Ye=>{var ft,ht;const nt=(ft=WINDOW[Ye])==null?void 0:ft.prototype;(ht=nt==null?void 0:nt.hasOwnProperty)!=null&&ht.call(nt,"addEventListener")&&(fill(nt,"addEventListener",function(gt){return function(At,xt,Et){if(At==="click"||At=="keypress")try{const kt=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},Ct=kt[At]=kt[At]||{refCount:0};if(!Ct.handler){const yt=makeDOMEventHandler(Be);Ct.handler=yt,gt.call(this,At,yt,Et)}Ct.refCount++}catch{}return gt.call(this,At,xt,Et)}}),fill(nt,"removeEventListener",function(gt){return function(At,xt,Et){if(At==="click"||At=="keypress")try{const kt=this.__sentry_instrumentation_handlers__||{},Ct=kt[At];Ct&&(Ct.refCount--,Ct.refCount<=0&&(gt.call(this,At,Ct.handler,Et),Ct.handler=void 0,delete kt[At]),Object.keys(kt).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return gt.call(this,At,xt,Et)}}))})}function isSimilarToLastCapturedEvent(Be){if(Be.type!==lastCapturedEventType)return!1;try{if(!Be.target||Be.target._sentryId!==lastCapturedEventTargetId)return!1}catch{}return!0}function shouldSkipDOMEvent(Be,Le){return Be!=="keypress"?!1:Le!=null&&Le.tagName?!(Le.tagName==="INPUT"||Le.tagName==="TEXTAREA"||Le.isContentEditable):!0}function makeDOMEventHandler(Be,Le=!1){return Ye=>{if(!Ye||Ye._sentryCaptured)return;const tt=getEventTarget(Ye);if(shouldSkipDOMEvent(Ye.type,tt))return;addNonEnumerableProperty(Ye,"_sentryCaptured",!0),tt&&!tt._sentryId&&addNonEnumerableProperty(tt,"_sentryId",uuid4());const nt=Ye.type==="keypress"?"input":Ye.type;isSimilarToLastCapturedEvent(Ye)||(Be({event:Ye,name:nt,global:Le}),lastCapturedEventType=Ye.type,lastCapturedEventTargetId=tt?tt._sentryId:void 0),clearTimeout(debounceTimerID),debounceTimerID=WINDOW.setTimeout(()=>{lastCapturedEventTargetId=void 0,lastCapturedEventType=void 0},DEBOUNCE_DURATION)}}function getEventTarget(Be){try{return Be.target}catch{return null}}let lastHref;function addHistoryInstrumentationHandler(Be){const Le="history";addHandler(Le,Be),maybeInstrument(Le,instrumentHistory)}function instrumentHistory(){if(WINDOW.addEventListener("popstate",()=>{const Le=WINDOW.location.href,Ye=lastHref;if(lastHref=Le,Ye===Le)return;triggerHandlers("history",{from:Ye,to:Le})}),!supportsHistory())return;function Be(Le){return function(...Ye){const tt=Ye.length>2?Ye[2]:void 0;if(tt){const nt=lastHref,ft=getAbsoluteUrl(String(tt));if(lastHref=ft,nt===ft)return Le.apply(this,Ye);triggerHandlers("history",{from:nt,to:ft})}return Le.apply(this,Ye)}}fill(WINDOW.history,"pushState",Be),fill(WINDOW.history,"replaceState",Be)}function getAbsoluteUrl(Be){try{return new URL(Be,WINDOW.location.origin).toString()}catch{return Be}}const cachedImplementations={};function getNativeImplementation(Be){const Le=cachedImplementations[Be];if(Le)return Le;let Ye=WINDOW[Be];if(isNativeFunction(Ye))return cachedImplementations[Be]=Ye.bind(WINDOW);const tt=WINDOW.document;if(tt&&typeof tt.createElement=="function")try{const nt=tt.createElement("iframe");nt.hidden=!0,tt.head.appendChild(nt);const ft=nt.contentWindow;ft!=null&&ft[Be]&&(Ye=ft[Be]),tt.head.removeChild(nt)}catch(nt){DEBUG_BUILD$1&&debug.warn(`Could not create sandbox iframe for ${Be} check, bailing to window.${Be}: `,nt)}return Ye&&(cachedImplementations[Be]=Ye.bind(WINDOW))}function clearCachedImplementation(Be){cachedImplementations[Be]=void 0}const SENTRY_XHR_DATA_KEY="__sentry_xhr_v3__";function addXhrInstrumentationHandler(Be){const Le="xhr";addHandler(Le,Be),maybeInstrument(Le,instrumentXHR)}function instrumentXHR(){if(!WINDOW.XMLHttpRequest)return;const Be=XMLHttpRequest.prototype;Be.open=new Proxy(Be.open,{apply(Le,Ye,tt){const nt=new Error,ft=timestampInSeconds()*1e3,ht=isString(tt[0])?tt[0].toUpperCase():void 0,gt=parseXhrUrlArg(tt[1]);if(!ht||!gt)return Le.apply(Ye,tt);Ye[SENTRY_XHR_DATA_KEY]={method:ht,url:gt,request_headers:{}},ht==="POST"&&gt.match(/sentry_key/)&&(Ye.__sentry_own_request__=!0);const At=()=>{const xt=Ye[SENTRY_XHR_DATA_KEY];if(xt&&Ye.readyState===4){try{xt.status_code=Ye.status}catch{}const Et={endTimestamp:timestampInSeconds()*1e3,startTimestamp:ft,xhr:Ye,virtualError:nt};triggerHandlers("xhr",Et)}};return"onreadystatechange"in Ye&&typeof Ye.onreadystatechange=="function"?Ye.onreadystatechange=new Proxy(Ye.onreadystatechange,{apply(xt,Et,kt){return At(),xt.apply(Et,kt)}}):Ye.addEventListener("readystatechange",At),Ye.setRequestHeader=new Proxy(Ye.setRequestHeader,{apply(xt,Et,kt){const[Ct,yt]=kt,vt=Et[SENTRY_XHR_DATA_KEY];return vt&&isString(Ct)&&isString(yt)&&(vt.request_headers[Ct.toLowerCase()]=yt),xt.apply(Et,kt)}}),Le.apply(Ye,tt)}}),Be.send=new Proxy(Be.send,{apply(Le,Ye,tt){const nt=Ye[SENTRY_XHR_DATA_KEY];if(!nt)return Le.apply(Ye,tt);tt[0]!==void 0&&(nt.body=tt[0]);const ft={startTimestamp:timestampInSeconds()*1e3,xhr:Ye};return triggerHandlers("xhr",ft),Le.apply(Ye,tt)}})}function parseXhrUrlArg(Be){if(isString(Be))return Be;try{return Be.toString()}catch{}}const DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE=40;function makeFetchTransport(Be,Le=getNativeImplementation("fetch")){let Ye=0,tt=0;async function nt(ft){const ht=ft.body.length;Ye+=ht,tt++;const gt={body:ft.body,method:"POST",referrerPolicy:"strict-origin",headers:Be.headers,keepalive:Ye<=6e4&&tt<15,...Be.fetchOptions};try{const At=await Le(Be.url,gt);return{statusCode:At.status,headers:{"x-sentry-rate-limits":At.headers.get("X-Sentry-Rate-Limits"),"retry-after":At.headers.get("Retry-After")}}}catch(At){throw clearCachedImplementation("fetch"),At}finally{Ye-=ht,tt--}}return createTransport(Be,nt,makePromiseBuffer(Be.bufferSize||DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE))}const CHROME_PRIORITY=30,GECKO_PRIORITY=50;function createFrame(Be,Le,Ye,tt){const nt={filename:Be,function:Le==="<anonymous>"?UNKNOWN_FUNCTION:Le,in_app:!0};return Ye!==void 0&&(nt.lineno=Ye),tt!==void 0&&(nt.colno=tt),nt}const chromeRegexNoFnName=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,chromeRegex=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,chromeEvalRegex=/\((\S*)(?::(\d+))(?::(\d+))\)/,chromeDataUriRegex=/at (.+?) ?\(data:(.+?),/,chromeStackParserFn=Be=>{const Le=Be.match(chromeDataUriRegex);if(Le)return{filename:`<data:${Le[2]}>`,function:Le[1]};const Ye=chromeRegexNoFnName.exec(Be);if(Ye){const[,nt,ft,ht]=Ye;return createFrame(nt,UNKNOWN_FUNCTION,+ft,+ht)}const tt=chromeRegex.exec(Be);if(tt){if(tt[2]&&tt[2].indexOf("eval")===0){const gt=chromeEvalRegex.exec(tt[2]);gt&&(tt[2]=gt[1],tt[3]=gt[2],tt[4]=gt[3])}const[ft,ht]=extractSafariExtensionDetails(tt[1]||UNKNOWN_FUNCTION,tt[2]);return createFrame(ht,ft,tt[3]?+tt[3]:void 0,tt[4]?+tt[4]:void 0)}},chromeStackLineParser=[CHROME_PRIORITY,chromeStackParserFn],geckoREgex=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,geckoEvalRegex=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gecko=Be=>{const Le=geckoREgex.exec(Be);if(Le){if(Le[3]&&Le[3].indexOf(" > eval")>-1){const ft=geckoEvalRegex.exec(Le[3]);ft&&(Le[1]=Le[1]||"eval",Le[3]=ft[1],Le[4]=ft[2],Le[5]="")}let tt=Le[3],nt=Le[1]||UNKNOWN_FUNCTION;return[nt,tt]=extractSafariExtensionDetails(nt,tt),createFrame(tt,nt,Le[4]?+Le[4]:void 0,Le[5]?+Le[5]:void 0)}},geckoStackLineParser=[GECKO_PRIORITY,gecko],defaultStackLineParsers=[chromeStackLineParser,geckoStackLineParser],defaultStackParser=createStackParser(...defaultStackLineParsers),extractSafariExtensionDetails=(Be,Le)=>{const Ye=Be.indexOf("safari-extension")!==-1,tt=Be.indexOf("safari-web-extension")!==-1;return Ye||tt?[Be.indexOf("@")!==-1?Be.split("@")[0]:UNKNOWN_FUNCTION,Ye?`safari-extension:${Le}`:`safari-web-extension:${Le}`]:[Be,Le]},DEBUG_BUILD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,MAX_ALLOWED_STRING_LENGTH=1024,INTEGRATION_NAME$3="Breadcrumbs",_breadcrumbsIntegration=(Be={})=>{const Le={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...Be};return{name:INTEGRATION_NAME$3,setup(Ye){Le.console&&addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(Ye)),Le.dom&&addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(Ye,Le.dom)),Le.xhr&&addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(Ye)),Le.fetch&&addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(Ye)),Le.history&&addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(Ye)),Le.sentry&&Ye.on("beforeSendEvent",_getSentryBreadcrumbHandler(Ye))}}},breadcrumbsIntegration=_breadcrumbsIntegration;function _getSentryBreadcrumbHandler(Be){return function(Ye){getClient()===Be&&addBreadcrumb({category:`sentry.${Ye.type==="transaction"?"transaction":"event"}`,event_id:Ye.event_id,level:Ye.level,message:getEventDescription(Ye)},{event:Ye})}}function _getDomBreadcrumbHandler(Be,Le){return function(tt){if(getClient()!==Be)return;let nt,ft,ht=typeof Le=="object"?Le.serializeAttribute:void 0,gt=typeof Le=="object"&&typeof Le.maxStringLength=="number"?Le.maxStringLength:void 0;gt&&gt>MAX_ALLOWED_STRING_LENGTH&&(DEBUG_BUILD&&debug.warn(`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${gt} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`),gt=MAX_ALLOWED_STRING_LENGTH),typeof ht=="string"&&(ht=[ht]);try{const xt=tt.event,Et=_isEvent(xt)?xt.target:xt;nt=htmlTreeAsString(Et,{keyAttrs:ht,maxStringLength:gt}),ft=getComponentName(Et)}catch{nt="<unknown>"}if(nt.length===0)return;const At={category:`ui.${tt.name}`,message:nt};ft&&(At.data={"ui.component_name":ft}),addBreadcrumb(At,{event:tt.event,name:tt.name,global:tt.global})}}function _getConsoleBreadcrumbHandler(Be){return function(Ye){if(getClient()!==Be)return;const tt={category:"console",data:{arguments:Ye.args,logger:"console"},level:severityLevelFromString(Ye.level),message:safeJoin(Ye.args," ")};if(Ye.level==="assert")if(Ye.args[0]===!1)tt.message=`Assertion failed: ${safeJoin(Ye.args.slice(1)," ")||"console.assert"}`,tt.data.arguments=Ye.args.slice(1);else return;addBreadcrumb(tt,{input:Ye.args,level:Ye.level})}}function _getXhrBreadcrumbHandler(Be){return function(Ye){if(getClient()!==Be)return;const{startTimestamp:tt,endTimestamp:nt}=Ye,ft=Ye.xhr[SENTRY_XHR_DATA_KEY];if(!tt||!nt||!ft)return;const{method:ht,url:gt,status_code:At,body:xt}=ft,Et={method:ht,url:gt,status_code:At},kt={xhr:Ye.xhr,input:xt,startTimestamp:tt,endTimestamp:nt},Ct={category:"xhr",data:Et,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(At)};Be.emit("beforeOutgoingRequestBreadcrumb",Ct,kt),addBreadcrumb(Ct,kt)}}function _getFetchBreadcrumbHandler(Be){return function(Ye){if(getClient()!==Be)return;const{startTimestamp:tt,endTimestamp:nt}=Ye;if(nt&&!(Ye.fetchData.url.match(/sentry_key/)&&Ye.fetchData.method==="POST"))if(Ye.fetchData.method,Ye.fetchData.url,Ye.error){const ft=Ye.fetchData,ht={data:Ye.error,input:Ye.args,startTimestamp:tt,endTimestamp:nt},gt={category:"fetch",data:ft,level:"error",type:"http"};Be.emit("beforeOutgoingRequestBreadcrumb",gt,ht),addBreadcrumb(gt,ht)}else{const ft=Ye.response,ht={...Ye.fetchData,status_code:ft==null?void 0:ft.status};Ye.fetchData.request_body_size,Ye.fetchData.response_body_size,ft==null||ft.status;const gt={input:Ye.args,response:ft,startTimestamp:tt,endTimestamp:nt},At={category:"fetch",data:ht,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(ht.status_code)};Be.emit("beforeOutgoingRequestBreadcrumb",At,gt),addBreadcrumb(At,gt)}}}function _getHistoryBreadcrumbHandler(Be){return function(Ye){if(getClient()!==Be)return;let tt=Ye.from,nt=Ye.to;const ft=parseUrl(WINDOW$1.location.href);let ht=tt?parseUrl(tt):void 0;const gt=parseUrl(nt);ht!=null&&ht.path||(ht=ft),ft.protocol===gt.protocol&&ft.host===gt.host&&(nt=gt.relative),ft.protocol===ht.protocol&&ft.host===ht.host&&(tt=ht.relative),addBreadcrumb({category:"navigation",data:{from:tt,to:nt}})}}function _isEvent(Be){return!!Be&&!!Be.target}const DEFAULT_EVENT_TARGET=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],INTEGRATION_NAME$2="BrowserApiErrors",_browserApiErrorsIntegration=(Be={})=>{const Le={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...Be};return{name:INTEGRATION_NAME$2,setupOnce(){Le.setTimeout&&fill(WINDOW$1,"setTimeout",_wrapTimeFunction),Le.setInterval&&fill(WINDOW$1,"setInterval",_wrapTimeFunction),Le.requestAnimationFrame&&fill(WINDOW$1,"requestAnimationFrame",_wrapRAF),Le.XMLHttpRequest&&"XMLHttpRequest"in WINDOW$1&&fill(XMLHttpRequest.prototype,"send",_wrapXHR);const Ye=Le.eventTarget;Ye&&(Array.isArray(Ye)?Ye:DEFAULT_EVENT_TARGET).forEach(nt=>_wrapEventTarget(nt,Le))}}},browserApiErrorsIntegration=_browserApiErrorsIntegration;function _wrapTimeFunction(Be){return function(...Le){const Ye=Le[0];return Le[0]=wrap(Ye,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${getFunctionName(Be)}`}}),Be.apply(this,Le)}}function _wrapRAF(Be){return function(Le){return Be.apply(this,[wrap(Le,{mechanism:{data:{handler:getFunctionName(Be)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function _wrapXHR(Be){return function(...Le){const Ye=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(nt=>{nt in Ye&&typeof Ye[nt]=="function"&&fill(Ye,nt,function(ft){const ht={mechanism:{data:{handler:getFunctionName(ft)},handled:!1,type:`auto.browser.browserapierrors.xhr.${nt}`}},gt=getOriginalFunction(ft);return gt&&(ht.mechanism.data.handler=getFunctionName(gt)),wrap(ft,ht)})}),Be.apply(this,Le)}}function _wrapEventTarget(Be,Le){var nt,ft;const tt=(nt=WINDOW$1[Be])==null?void 0:nt.prototype;(ft=tt==null?void 0:tt.hasOwnProperty)!=null&&ft.call(tt,"addEventListener")&&(fill(tt,"addEventListener",function(ht){return function(gt,At,xt){try{isEventListenerObject(At)&&(At.handleEvent=wrap(At.handleEvent,{mechanism:{data:{handler:getFunctionName(At),target:Be},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return Le.unregisterOriginalCallbacks&&unregisterOriginalCallback(this,gt,At),ht.apply(this,[gt,wrap(At,{mechanism:{data:{handler:getFunctionName(At),target:Be},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),xt])}}),fill(tt,"removeEventListener",function(ht){return function(gt,At,xt){try{const Et=At.__sentry_wrapped__;Et&&ht.call(this,gt,Et,xt)}catch{}return ht.call(this,gt,At,xt)}}))}function isEventListenerObject(Be){return typeof Be.handleEvent=="function"}function unregisterOriginalCallback(Be,Le,Ye){Be&&typeof Be=="object"&&"removeEventListener"in Be&&typeof Be.removeEventListener=="function"&&Be.removeEventListener(Le,Ye)}const browserSessionIntegration=()=>({name:"BrowserSession",setupOnce(){if(typeof WINDOW$1.document>"u"){DEBUG_BUILD&&debug.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}startSession({ignoreDuration:!0}),captureSession(),addHistoryInstrumentationHandler(({from:Be,to:Le})=>{Be!==void 0&&Be!==Le&&(startSession({ignoreDuration:!0}),captureSession())})}}),INTEGRATION_NAME$1="GlobalHandlers",_globalHandlersIntegration=(Be={})=>{const Le={onerror:!0,onunhandledrejection:!0,...Be};return{name:INTEGRATION_NAME$1,setupOnce(){Error.stackTraceLimit=50},setup(Ye){Le.onerror&&(_installGlobalOnErrorHandler(Ye),globalHandlerLog("onerror")),Le.onunhandledrejection&&(_installGlobalOnUnhandledRejectionHandler(Ye),globalHandlerLog("onunhandledrejection"))}}},globalHandlersIntegration=_globalHandlersIntegration;function _installGlobalOnErrorHandler(Be){addGlobalErrorInstrumentationHandler(Le=>{const{stackParser:Ye,attachStacktrace:tt}=getOptions();if(getClient()!==Be||shouldIgnoreOnError())return;const{msg:nt,url:ft,line:ht,column:gt,error:At}=Le,xt=_enhanceEventWithInitialFrame(eventFromUnknownInput(Ye,At||nt,void 0,tt,!1),ft,ht,gt);xt.level="error",captureEvent(xt,{originalException:At,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function _installGlobalOnUnhandledRejectionHandler(Be){addGlobalUnhandledRejectionInstrumentationHandler(Le=>{const{stackParser:Ye,attachStacktrace:tt}=getOptions();if(getClient()!==Be||shouldIgnoreOnError())return;const nt=_getUnhandledRejectionError(Le),ft=isPrimitive(nt)?_eventFromRejectionWithPrimitive(nt):eventFromUnknownInput(Ye,nt,void 0,tt,!0);ft.level="error",captureEvent(ft,{originalException:nt,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function _getUnhandledRejectionError(Be){if(isPrimitive(Be))return Be;try{if("reason"in Be)return Be.reason;if("detail"in Be&&"reason"in Be.detail)return Be.detail.reason}catch{}return Be}function _eventFromRejectionWithPrimitive(Be){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(Be)}`}]}}}function _enhanceEventWithInitialFrame(Be,Le,Ye,tt){const nt=Be.exception=Be.exception||{},ft=nt.values=nt.values||[],ht=ft[0]=ft[0]||{},gt=ht.stacktrace=ht.stacktrace||{},At=gt.frames=gt.frames||[],xt=tt,Et=Ye,kt=getFilenameFromUrl(Le)??getLocationHref();return At.length===0&&At.push({colno:xt,filename:kt,function:UNKNOWN_FUNCTION,in_app:!0,lineno:Et}),Be}function globalHandlerLog(Be){DEBUG_BUILD&&debug.log(`Global Handler attached: ${Be}`)}function getOptions(){const Be=getClient();return(Be==null?void 0:Be.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function getFilenameFromUrl(Be){if(!(!isString(Be)||Be.length===0)){if(Be.startsWith("data:")){const Le=Be.match(/^data:([^;]+)/),Ye=Le?Le[1]:"text/javascript",tt=Be.includes("base64,");return`<data:${Ye}${tt?",base64":""}>`}return Be}}const httpContextIntegration=()=>({name:"HttpContext",preprocessEvent(Be){var tt;if(!WINDOW$1.navigator&&!WINDOW$1.location&&!WINDOW$1.document)return;const Le=getHttpRequestData(),Ye={...Le.headers,...(tt=Be.request)==null?void 0:tt.headers};Be.request={...Le,...Be.request,headers:Ye}}}),DEFAULT_KEY="cause",DEFAULT_LIMIT=5,INTEGRATION_NAME="LinkedErrors",_linkedErrorsIntegration=(Be={})=>{const Le=Be.limit||DEFAULT_LIMIT,Ye=Be.key||DEFAULT_KEY;return{name:INTEGRATION_NAME,preprocessEvent(tt,nt,ft){const ht=ft.getOptions();applyAggregateErrorsToEvent(exceptionFromError,ht.stackParser,Ye,Le,tt,nt)}}},linkedErrorsIntegration=_linkedErrorsIntegration;function checkAndWarnIfIsEmbeddedBrowserExtension(){return _isEmbeddedBrowserExtension()?(DEBUG_BUILD&&consoleSandbox(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function _isEmbeddedBrowserExtension(){var ft;if(typeof WINDOW$1.window>"u")return!1;const Be=WINDOW$1;if(Be.nw)return!1;const Le=Be.chrome||Be.browser;if(!((ft=Le==null?void 0:Le.runtime)!=null&&ft.id))return!1;const Ye=getLocationHref(),tt=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(WINDOW$1===WINDOW$1.top&&tt.some(ht=>Ye.startsWith(`${ht}://`)))}function getDefaultIntegrations(Be){return[inboundFiltersIntegration(),functionToStringIntegration(),browserApiErrorsIntegration(),breadcrumbsIntegration(),globalHandlersIntegration(),linkedErrorsIntegration(),dedupeIntegration(),httpContextIntegration(),browserSessionIntegration()]}function init(Be={}){const Le=!Be.skipBrowserExtensionCheck&&checkAndWarnIfIsEmbeddedBrowserExtension();let Ye=Be.defaultIntegrations==null?getDefaultIntegrations():Be.defaultIntegrations;const tt={...Be,enabled:Le?!1:Be.enabled,stackParser:stackParserFromStackParserOptions(Be.stackParser||defaultStackParser),integrations:getIntegrationsToSetup({integrations:Be.integrations,defaultIntegrations:Ye}),transport:Be.transport||makeFetchTransport};return initAndBind(BrowserClient,tt)}const DEPRECATION_PERIOD_MONTHS=12,SDK_RELEASE_DATE="2026-10-06",DEPRECATED_SDK_WARNING_MESSAGE="You are using a deprecated SDK version. Please upgrade to the latest version to avoid any disruption.";let hasWarned=!1;const parseReleaseDate=Be=>{const Le=/^(\d{4})-(\d{2})-(\d{2})$/.exec(Be);if(!Le)return null;const Ye=Number(Le[1]),tt=Number(Le[2])-1,nt=Number(Le[3]),ft=new Date(Date.UTC(Ye,tt,nt));return ft.getUTCFullYear()!==Ye||ft.getUTCMonth()!==tt||ft.getUTCDate()!==nt?null:ft},isSdkDeprecated=(Be,Le=new Date)=>{const Ye=parseReleaseDate(Be);if(!Ye)return!1;const tt=new Date(Date.UTC(Ye.getUTCFullYear(),Ye.getUTCMonth()+DEPRECATION_PERIOD_MONTHS,Ye.getUTCDate()));return Le.getTime()>=tt.getTime()},warnIfSdkDeprecated=(Be=SDK_RELEASE_DATE,Le=new Date)=>{hasWarned||!isSdkDeprecated(Be,Le)||(hasWarned=!0,console.warn(DEPRECATED_SDK_WARNING_MESSAGE))};function setupFiles(){const Be={pollingIntervalSeconds:.25,maxMillisBeforeAckWhenClosed:100,moreAnnoyingDebuggerStatements:1,onDetectOpen:()=>{var xt;addDeviceStats((xt=state.token)==null?void 0:xt.token,{inspectorOpened:!0}),MlWasmJSApi$1.setInspectorOpened(!0)},onDetectClose:void 0,startup:"asap",onCheckOpennessWhilePaused:"throw"};Object.seal(Be);const Le=new Worker(URL.createObjectURL(new Blob([`"use strict";
10044
+ Url: ${_getEventFilterUrl(Be)}`),!0}return!1}function _isIgnoredError(Be,Le){return Le!=null&&Le.length?getPossibleEventMessages(Be).some(Ye=>stringMatchesSomePattern(Ye,Le)):!1}function _isIgnoredTransaction(Be,Le){if(!(Le!=null&&Le.length))return!1;const Ye=Be.transaction;return Ye?stringMatchesSomePattern(Ye,Le):!1}function _isDeniedUrl(Be,Le){if(!(Le!=null&&Le.length))return!1;const Ye=_getEventFilterUrl(Be);return Ye?stringMatchesSomePattern(Ye,Le):!1}function _isAllowedUrl(Be,Le){if(!(Le!=null&&Le.length))return!0;const Ye=_getEventFilterUrl(Be);return Ye?stringMatchesSomePattern(Ye,Le):!0}function _getLastValidUrl(Be=[]){for(let Le=Be.length-1;Le>=0;Le--){const Ye=Be[Le];if(Ye&&Ye.filename!=="<anonymous>"&&Ye.filename!=="[native code]")return Ye.filename||null}return null}function _getEventFilterUrl(Be){var Le,Ye;try{const tt=[...((Le=Be.exception)==null?void 0:Le.values)??[]].reverse().find(ft=>{var ht,gt,At;return((ht=ft.mechanism)==null?void 0:ht.parent_id)===void 0&&((At=(gt=ft.stacktrace)==null?void 0:gt.frames)==null?void 0:At.length)}),nt=(Ye=tt==null?void 0:tt.stacktrace)==null?void 0:Ye.frames;return nt?_getLastValidUrl(nt):null}catch{return DEBUG_BUILD$2&&debug.error(`Cannot extract url for event ${getEventDescription(Be)}`),null}}function _isUselessError(Be){var Le,Ye;return(Ye=(Le=Be.exception)==null?void 0:Le.values)!=null&&Ye.length?!Be.message&&!Be.exception.values.some(tt=>tt.stacktrace||tt.type&&tt.type!=="Error"||tt.value):!1}function applyAggregateErrorsToEvent(Be,Le,Ye,tt,nt,ft){var gt;if(!((gt=nt.exception)!=null&&gt.values)||!ft||!isInstanceOf(ft.originalException,Error))return;const ht=nt.exception.values.length>0?nt.exception.values[nt.exception.values.length-1]:void 0;ht&&(nt.exception.values=aggregateExceptionsFromError(Be,Le,tt,ft.originalException,Ye,nt.exception.values,ht,0))}function aggregateExceptionsFromError(Be,Le,Ye,tt,nt,ft,ht,gt){if(ft.length>=Ye+1)return ft;let At=[...ft];if(isInstanceOf(tt[nt],Error)){applyExceptionGroupFieldsForParentException(ht,gt);const xt=Be(Le,tt[nt]),Et=At.length;applyExceptionGroupFieldsForChildException(xt,nt,Et,gt),At=aggregateExceptionsFromError(Be,Le,Ye,tt[nt],nt,[xt,...At],xt,Et)}return Array.isArray(tt.errors)&&tt.errors.forEach((xt,Et)=>{if(isInstanceOf(xt,Error)){applyExceptionGroupFieldsForParentException(ht,gt);const kt=Be(Le,xt),Ct=At.length;applyExceptionGroupFieldsForChildException(kt,`errors[${Et}]`,Ct,gt),At=aggregateExceptionsFromError(Be,Le,Ye,xt,nt,[kt,...At],kt,Ct)}}),At}function applyExceptionGroupFieldsForParentException(Be,Le){Be.mechanism={handled:!0,type:"auto.core.linked_errors",...Be.mechanism,...Be.type==="AggregateError"&&{is_exception_group:!0},exception_id:Le}}function applyExceptionGroupFieldsForChildException(Be,Le,Ye,tt){Be.mechanism={handled:!0,...Be.mechanism,type:"chained",source:Le,exception_id:Ye,parent_id:tt}}function addConsoleInstrumentationHandler(Be){const Le="console";addHandler(Le,Be),maybeInstrument(Le,instrumentConsole)}function instrumentConsole(){"console"in GLOBAL_OBJ&&CONSOLE_LEVELS.forEach(function(Be){Be in GLOBAL_OBJ.console&&fill(GLOBAL_OBJ.console,Be,function(Le){return originalConsoleMethods[Be]=Le,function(...Ye){triggerHandlers("console",{args:Ye,level:Be});const nt=originalConsoleMethods[Be];nt==null||nt.apply(GLOBAL_OBJ.console,Ye)}})})}function severityLevelFromString(Be){return Be==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(Be)?Be:"log"}const INTEGRATION_NAME$4="Dedupe",_dedupeIntegration=()=>{let Be;return{name:INTEGRATION_NAME$4,processEvent(Le){if(Le.type)return Le;try{if(_shouldDropEvent(Le,Be))return DEBUG_BUILD$2&&debug.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return Be=Le}}},dedupeIntegration=_dedupeIntegration;function _shouldDropEvent(Be,Le){return Le?!!(_isSameMessageEvent(Be,Le)||_isSameExceptionEvent(Be,Le)):!1}function _isSameMessageEvent(Be,Le){const Ye=Be.message,tt=Le.message;return!(!Ye&&!tt||Ye&&!tt||!Ye&&tt||Ye!==tt||!_isSameFingerprint(Be,Le)||!_isSameStacktrace(Be,Le))}function _isSameExceptionEvent(Be,Le){const Ye=_getExceptionFromEvent(Le),tt=_getExceptionFromEvent(Be);return!(!Ye||!tt||Ye.type!==tt.type||Ye.value!==tt.value||!_isSameFingerprint(Be,Le)||!_isSameStacktrace(Be,Le))}function _isSameStacktrace(Be,Le){let Ye=getFramesFromEvent(Be),tt=getFramesFromEvent(Le);if(!Ye&&!tt)return!0;if(Ye&&!tt||!Ye&&tt||(Ye=Ye,tt=tt,tt.length!==Ye.length))return!1;for(let nt=0;nt<tt.length;nt++){const ft=tt[nt],ht=Ye[nt];if(ft.filename!==ht.filename||ft.lineno!==ht.lineno||ft.colno!==ht.colno||ft.function!==ht.function)return!1}return!0}function _isSameFingerprint(Be,Le){let Ye=Be.fingerprint,tt=Le.fingerprint;if(!Ye&&!tt)return!0;if(Ye&&!tt||!Ye&&tt)return!1;Ye=Ye,tt=tt;try{return Ye.join("")===tt.join("")}catch{return!1}}function _getExceptionFromEvent(Be){var Le,Ye;return(Ye=(Le=Be.exception)==null?void 0:Le.values)==null?void 0:Ye[0]}function getBreadcrumbLogLevelFromHttpStatusCode(Be){if(Be!==void 0)return Be>=400&&Be<500?"warning":Be>=500?"error":void 0}const WINDOW$2=GLOBAL_OBJ;function supportsHistory(){return"history"in WINDOW$2&&!!WINDOW$2.history}function _isFetchSupported(){if(!("fetch"in WINDOW$2))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function isNativeFunction(Be){return Be&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(Be.toString())}function supportsNativeFetch(){var Ye;if(typeof EdgeRuntime=="string")return!0;if(!_isFetchSupported())return!1;if(isNativeFunction(WINDOW$2.fetch))return!0;let Be=!1;const Le=WINDOW$2.document;if(Le&&typeof Le.createElement=="function")try{const tt=Le.createElement("iframe");tt.hidden=!0,Le.head.appendChild(tt),(Ye=tt.contentWindow)!=null&&Ye.fetch&&(Be=isNativeFunction(tt.contentWindow.fetch)),Le.head.removeChild(tt)}catch(tt){DEBUG_BUILD$2&&debug.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",tt)}return Be}function addFetchInstrumentationHandler(Be,Le){const Ye="fetch";addHandler(Ye,Be),maybeInstrument(Ye,()=>instrumentFetch(void 0,Le))}function instrumentFetch(Be,Le=!1){Le&&!supportsNativeFetch()||fill(GLOBAL_OBJ,"fetch",function(Ye){return function(...tt){const nt=new Error,{method:ft,url:ht}=parseFetchArgs(tt),gt={args:tt,fetchData:{method:ft,url:ht},startTimestamp:timestampInSeconds()*1e3,virtualError:nt,headers:getHeadersFromFetchArgs(tt)};return triggerHandlers("fetch",{...gt}),Ye.apply(GLOBAL_OBJ,tt).then(async At=>(triggerHandlers("fetch",{...gt,endTimestamp:timestampInSeconds()*1e3,response:At}),At),At=>{if(triggerHandlers("fetch",{...gt,endTimestamp:timestampInSeconds()*1e3,error:At}),isError(At)&&At.stack===void 0&&(At.stack=nt.stack,addNonEnumerableProperty(At,"framesToPop",1)),At instanceof TypeError&&(At.message==="Failed to fetch"||At.message==="Load failed"||At.message==="NetworkError when attempting to fetch resource."))try{const xt=new URL(gt.fetchData.url);At.message=`${At.message} (${xt.host})`}catch{}throw At})}})}function hasProp(Be,Le){return!!Be&&typeof Be=="object"&&!!Be[Le]}function getUrlFromResource(Be){return typeof Be=="string"?Be:Be?hasProp(Be,"url")?Be.url:Be.toString?Be.toString():"":""}function parseFetchArgs(Be){if(Be.length===0)return{method:"GET",url:""};if(Be.length===2){const[Ye,tt]=Be;return{url:getUrlFromResource(Ye),method:hasProp(tt,"method")?String(tt.method).toUpperCase():"GET"}}const Le=Be[0];return{url:getUrlFromResource(Le),method:hasProp(Le,"method")?String(Le.method).toUpperCase():"GET"}}function getHeadersFromFetchArgs(Be){const[Le,Ye]=Be;try{if(typeof Ye=="object"&&Ye!==null&&"headers"in Ye&&Ye.headers)return new Headers(Ye.headers);if(isRequest(Le))return new Headers(Le.headers)}catch{}}function getSDKSource(){return"npm"}const WINDOW$1=GLOBAL_OBJ;let ignoreOnError=0;function shouldIgnoreOnError(){return ignoreOnError>0}function ignoreNextOnError(){ignoreOnError++,setTimeout(()=>{ignoreOnError--})}function wrap(Be,Le={}){function Ye(nt){return typeof nt=="function"}if(!Ye(Be))return Be;try{const nt=Be.__sentry_wrapped__;if(nt)return typeof nt=="function"?nt:Be;if(getOriginalFunction(Be))return Be}catch{return Be}const tt=function(...nt){try{const ft=nt.map(ht=>wrap(ht,Le));return Be.apply(this,ft)}catch(ft){throw ignoreNextOnError(),withScope(ht=>{ht.addEventProcessor(gt=>(Le.mechanism&&(addExceptionTypeValue(gt,void 0),addExceptionMechanism(gt,Le.mechanism)),gt.extra={...gt.extra,arguments:nt},gt)),captureException(ft)}),ft}};try{for(const nt in Be)Object.prototype.hasOwnProperty.call(Be,nt)&&(tt[nt]=Be[nt])}catch{}markFunctionWrapped(tt,Be),addNonEnumerableProperty(Be,"__sentry_wrapped__",tt);try{Object.getOwnPropertyDescriptor(tt,"name").configurable&&Object.defineProperty(tt,"name",{get(){return Be.name}})}catch{}return tt}function getHttpRequestData(){const Be=getLocationHref(),{referrer:Le}=WINDOW$1.document||{},{userAgent:Ye}=WINDOW$1.navigator||{},tt={...Le&&{Referer:Le},...Ye&&{"User-Agent":Ye}};return{url:Be,headers:tt}}function exceptionFromError(Be,Le){const Ye=parseStackFrames(Be,Le),tt={type:extractType(Le),value:extractMessage(Le)};return Ye.length&&(tt.stacktrace={frames:Ye}),tt.type===void 0&&tt.value===""&&(tt.value="Unrecoverable error caught"),tt}function eventFromPlainObject(Be,Le,Ye,tt){const nt=getClient(),ft=nt==null?void 0:nt.getOptions().normalizeDepth,ht=getErrorPropertyFromObject(Le),gt={__serialized__:normalizeToSize(Le,ft)};if(ht)return{exception:{values:[exceptionFromError(Be,ht)]},extra:gt};const At={exception:{values:[{type:isEvent(Le)?Le.constructor.name:tt?"UnhandledRejection":"Error",value:getNonErrorObjectExceptionValue(Le,{isUnhandledRejection:tt})}]},extra:gt};if(Ye){const xt=parseStackFrames(Be,Ye);xt.length&&(At.exception.values[0].stacktrace={frames:xt})}return At}function eventFromError(Be,Le){return{exception:{values:[exceptionFromError(Be,Le)]}}}function parseStackFrames(Be,Le){const Ye=Le.stacktrace||Le.stack||"",tt=getSkipFirstStackStringLines(Le),nt=getPopFirstTopFrames(Le);try{return Be(Ye,tt,nt)}catch{}return[]}const reactMinifiedRegexp=/Minified React error #\d+;/i;function getSkipFirstStackStringLines(Be){return Be&&reactMinifiedRegexp.test(Be.message)?1:0}function getPopFirstTopFrames(Be){return typeof Be.framesToPop=="number"?Be.framesToPop:0}function isWebAssemblyException(Be){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?Be instanceof WebAssembly.Exception:!1}function extractType(Be){const Le=Be==null?void 0:Be.name;return!Le&&isWebAssemblyException(Be)?Be.message&&Array.isArray(Be.message)&&Be.message.length==2?Be.message[0]:"WebAssembly.Exception":Le}function extractMessage(Be){const Le=Be==null?void 0:Be.message;return isWebAssemblyException(Be)?Array.isArray(Be.message)&&Be.message.length==2?Be.message[1]:"wasm exception":Le?Le.error&&typeof Le.error.message=="string"?Le.error.message:Le:"No error message"}function eventFromException(Be,Le,Ye,tt){const nt=(Ye==null?void 0:Ye.syntheticException)||void 0,ft=eventFromUnknownInput(Be,Le,nt,tt);return addExceptionMechanism(ft),ft.level="error",Ye!=null&&Ye.event_id&&(ft.event_id=Ye.event_id),resolvedSyncPromise(ft)}function eventFromMessage(Be,Le,Ye="info",tt,nt){const ft=(tt==null?void 0:tt.syntheticException)||void 0,ht=eventFromString(Be,Le,ft,nt);return ht.level=Ye,tt!=null&&tt.event_id&&(ht.event_id=tt.event_id),resolvedSyncPromise(ht)}function eventFromUnknownInput(Be,Le,Ye,tt,nt){let ft;if(isErrorEvent$1(Le)&&Le.error)return eventFromError(Be,Le.error);if(isDOMError(Le)||isDOMException(Le)){const ht=Le;if("stack"in Le)ft=eventFromError(Be,Le);else{const gt=ht.name||(isDOMError(ht)?"DOMError":"DOMException"),At=ht.message?`${gt}: ${ht.message}`:gt;ft=eventFromString(Be,At,Ye,tt),addExceptionTypeValue(ft,At)}return"code"in ht&&(ft.tags={...ft.tags,"DOMException.code":`${ht.code}`}),ft}return isError(Le)?eventFromError(Be,Le):isPlainObject(Le)||isEvent(Le)?(ft=eventFromPlainObject(Be,Le,Ye,nt),addExceptionMechanism(ft,{synthetic:!0}),ft):(ft=eventFromString(Be,Le,Ye,tt),addExceptionTypeValue(ft,`${Le}`),addExceptionMechanism(ft,{synthetic:!0}),ft)}function eventFromString(Be,Le,Ye,tt){const nt={};if(tt&&Ye){const ft=parseStackFrames(Be,Ye);ft.length&&(nt.exception={values:[{value:Le,stacktrace:{frames:ft}}]}),addExceptionMechanism(nt,{synthetic:!0})}if(isParameterizedString(Le)){const{__sentry_template_string__:ft,__sentry_template_values__:ht}=Le;return nt.logentry={message:ft,params:ht},nt}return nt.message=Le,nt}function getNonErrorObjectExceptionValue(Be,{isUnhandledRejection:Le}){const Ye=extractExceptionKeysForMessage(Be),tt=Le?"promise rejection":"exception";return isErrorEvent$1(Be)?`Event \`ErrorEvent\` captured as ${tt} with message \`${Be.message}\``:isEvent(Be)?`Event \`${getObjectClassName(Be)}\` (type=${Be.type}) captured as ${tt}`:`Object captured as ${tt} with keys: ${Ye}`}function getObjectClassName(Be){try{const Le=Object.getPrototypeOf(Be);return Le?Le.constructor.name:void 0}catch{}}function getErrorPropertyFromObject(Be){for(const Le in Be)if(Object.prototype.hasOwnProperty.call(Be,Le)){const Ye=Be[Le];if(Ye instanceof Error)return Ye}}class BrowserClient extends Client{constructor(Le){var Et;const Ye=applyDefaultOptions(Le),tt=WINDOW$1.SENTRY_SDK_SOURCE||getSDKSource();applySdkMetadata(Ye,"browser",["browser"],tt),(Et=Ye._metadata)!=null&&Et.sdk&&(Ye._metadata.sdk.settings={infer_ip:Ye.sendDefaultPii?"auto":"never",...Ye._metadata.sdk.settings}),super(Ye);const{sendDefaultPii:nt,sendClientReports:ft,enableLogs:ht,_experiments:gt,enableMetrics:At}=this._options,xt=At??(gt==null?void 0:gt.enableMetrics)??!0;WINDOW$1.document&&(ft||ht||xt)&&WINDOW$1.document.addEventListener("visibilitychange",()=>{WINDOW$1.document.visibilityState==="hidden"&&(ft&&this._flushOutcomes(),ht&&_INTERNAL_flushLogsBuffer(this),xt&&_INTERNAL_flushMetricsBuffer(this))}),nt&&this.on("beforeSendSession",addAutoIpAddressToSession)}eventFromException(Le,Ye){return eventFromException(this._options.stackParser,Le,Ye,this._options.attachStacktrace)}eventFromMessage(Le,Ye="info",tt){return eventFromMessage(this._options.stackParser,Le,Ye,tt,this._options.attachStacktrace)}_prepareEvent(Le,Ye,tt,nt){return Le.platform=Le.platform||"javascript",super._prepareEvent(Le,Ye,tt,nt)}}function applyDefaultOptions(Be){var Le;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(Le=WINDOW$1.SENTRY_RELEASE)==null?void 0:Le.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...Be}}const DEBUG_BUILD$1=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,WINDOW=GLOBAL_OBJ,DEBOUNCE_DURATION=1e3;let debounceTimerID,lastCapturedEventType,lastCapturedEventTargetId;function addClickKeypressInstrumentationHandler(Be){const Le="dom";addHandler(Le,Be),maybeInstrument(Le,instrumentDOM)}function instrumentDOM(){if(!WINDOW.document)return;const Be=triggerHandlers.bind(null,"dom"),Le=makeDOMEventHandler(Be,!0);WINDOW.document.addEventListener("click",Le,!1),WINDOW.document.addEventListener("keypress",Le,!1),["EventTarget","Node"].forEach(Ye=>{var ft,ht;const nt=(ft=WINDOW[Ye])==null?void 0:ft.prototype;(ht=nt==null?void 0:nt.hasOwnProperty)!=null&&ht.call(nt,"addEventListener")&&(fill(nt,"addEventListener",function(gt){return function(At,xt,Et){if(At==="click"||At=="keypress")try{const kt=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},Ct=kt[At]=kt[At]||{refCount:0};if(!Ct.handler){const yt=makeDOMEventHandler(Be);Ct.handler=yt,gt.call(this,At,yt,Et)}Ct.refCount++}catch{}return gt.call(this,At,xt,Et)}}),fill(nt,"removeEventListener",function(gt){return function(At,xt,Et){if(At==="click"||At=="keypress")try{const kt=this.__sentry_instrumentation_handlers__||{},Ct=kt[At];Ct&&(Ct.refCount--,Ct.refCount<=0&&(gt.call(this,At,Ct.handler,Et),Ct.handler=void 0,delete kt[At]),Object.keys(kt).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return gt.call(this,At,xt,Et)}}))})}function isSimilarToLastCapturedEvent(Be){if(Be.type!==lastCapturedEventType)return!1;try{if(!Be.target||Be.target._sentryId!==lastCapturedEventTargetId)return!1}catch{}return!0}function shouldSkipDOMEvent(Be,Le){return Be!=="keypress"?!1:Le!=null&&Le.tagName?!(Le.tagName==="INPUT"||Le.tagName==="TEXTAREA"||Le.isContentEditable):!0}function makeDOMEventHandler(Be,Le=!1){return Ye=>{if(!Ye||Ye._sentryCaptured)return;const tt=getEventTarget(Ye);if(shouldSkipDOMEvent(Ye.type,tt))return;addNonEnumerableProperty(Ye,"_sentryCaptured",!0),tt&&!tt._sentryId&&addNonEnumerableProperty(tt,"_sentryId",uuid4());const nt=Ye.type==="keypress"?"input":Ye.type;isSimilarToLastCapturedEvent(Ye)||(Be({event:Ye,name:nt,global:Le}),lastCapturedEventType=Ye.type,lastCapturedEventTargetId=tt?tt._sentryId:void 0),clearTimeout(debounceTimerID),debounceTimerID=WINDOW.setTimeout(()=>{lastCapturedEventTargetId=void 0,lastCapturedEventType=void 0},DEBOUNCE_DURATION)}}function getEventTarget(Be){try{return Be.target}catch{return null}}let lastHref;function addHistoryInstrumentationHandler(Be){const Le="history";addHandler(Le,Be),maybeInstrument(Le,instrumentHistory)}function instrumentHistory(){if(WINDOW.addEventListener("popstate",()=>{const Le=WINDOW.location.href,Ye=lastHref;if(lastHref=Le,Ye===Le)return;triggerHandlers("history",{from:Ye,to:Le})}),!supportsHistory())return;function Be(Le){return function(...Ye){const tt=Ye.length>2?Ye[2]:void 0;if(tt){const nt=lastHref,ft=getAbsoluteUrl(String(tt));if(lastHref=ft,nt===ft)return Le.apply(this,Ye);triggerHandlers("history",{from:nt,to:ft})}return Le.apply(this,Ye)}}fill(WINDOW.history,"pushState",Be),fill(WINDOW.history,"replaceState",Be)}function getAbsoluteUrl(Be){try{return new URL(Be,WINDOW.location.origin).toString()}catch{return Be}}const cachedImplementations={};function getNativeImplementation(Be){const Le=cachedImplementations[Be];if(Le)return Le;let Ye=WINDOW[Be];if(isNativeFunction(Ye))return cachedImplementations[Be]=Ye.bind(WINDOW);const tt=WINDOW.document;if(tt&&typeof tt.createElement=="function")try{const nt=tt.createElement("iframe");nt.hidden=!0,tt.head.appendChild(nt);const ft=nt.contentWindow;ft!=null&&ft[Be]&&(Ye=ft[Be]),tt.head.removeChild(nt)}catch(nt){DEBUG_BUILD$1&&debug.warn(`Could not create sandbox iframe for ${Be} check, bailing to window.${Be}: `,nt)}return Ye&&(cachedImplementations[Be]=Ye.bind(WINDOW))}function clearCachedImplementation(Be){cachedImplementations[Be]=void 0}const SENTRY_XHR_DATA_KEY="__sentry_xhr_v3__";function addXhrInstrumentationHandler(Be){const Le="xhr";addHandler(Le,Be),maybeInstrument(Le,instrumentXHR)}function instrumentXHR(){if(!WINDOW.XMLHttpRequest)return;const Be=XMLHttpRequest.prototype;Be.open=new Proxy(Be.open,{apply(Le,Ye,tt){const nt=new Error,ft=timestampInSeconds()*1e3,ht=isString(tt[0])?tt[0].toUpperCase():void 0,gt=parseXhrUrlArg(tt[1]);if(!ht||!gt)return Le.apply(Ye,tt);Ye[SENTRY_XHR_DATA_KEY]={method:ht,url:gt,request_headers:{}},ht==="POST"&&gt.match(/sentry_key/)&&(Ye.__sentry_own_request__=!0);const At=()=>{const xt=Ye[SENTRY_XHR_DATA_KEY];if(xt&&Ye.readyState===4){try{xt.status_code=Ye.status}catch{}const Et={endTimestamp:timestampInSeconds()*1e3,startTimestamp:ft,xhr:Ye,virtualError:nt};triggerHandlers("xhr",Et)}};return"onreadystatechange"in Ye&&typeof Ye.onreadystatechange=="function"?Ye.onreadystatechange=new Proxy(Ye.onreadystatechange,{apply(xt,Et,kt){return At(),xt.apply(Et,kt)}}):Ye.addEventListener("readystatechange",At),Ye.setRequestHeader=new Proxy(Ye.setRequestHeader,{apply(xt,Et,kt){const[Ct,yt]=kt,vt=Et[SENTRY_XHR_DATA_KEY];return vt&&isString(Ct)&&isString(yt)&&(vt.request_headers[Ct.toLowerCase()]=yt),xt.apply(Et,kt)}}),Le.apply(Ye,tt)}}),Be.send=new Proxy(Be.send,{apply(Le,Ye,tt){const nt=Ye[SENTRY_XHR_DATA_KEY];if(!nt)return Le.apply(Ye,tt);tt[0]!==void 0&&(nt.body=tt[0]);const ft={startTimestamp:timestampInSeconds()*1e3,xhr:Ye};return triggerHandlers("xhr",ft),Le.apply(Ye,tt)}})}function parseXhrUrlArg(Be){if(isString(Be))return Be;try{return Be.toString()}catch{}}const DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE=40;function makeFetchTransport(Be,Le=getNativeImplementation("fetch")){let Ye=0,tt=0;async function nt(ft){const ht=ft.body.length;Ye+=ht,tt++;const gt={body:ft.body,method:"POST",referrerPolicy:"strict-origin",headers:Be.headers,keepalive:Ye<=6e4&&tt<15,...Be.fetchOptions};try{const At=await Le(Be.url,gt);return{statusCode:At.status,headers:{"x-sentry-rate-limits":At.headers.get("X-Sentry-Rate-Limits"),"retry-after":At.headers.get("Retry-After")}}}catch(At){throw clearCachedImplementation("fetch"),At}finally{Ye-=ht,tt--}}return createTransport(Be,nt,makePromiseBuffer(Be.bufferSize||DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE))}const CHROME_PRIORITY=30,GECKO_PRIORITY=50;function createFrame(Be,Le,Ye,tt){const nt={filename:Be,function:Le==="<anonymous>"?UNKNOWN_FUNCTION:Le,in_app:!0};return Ye!==void 0&&(nt.lineno=Ye),tt!==void 0&&(nt.colno=tt),nt}const chromeRegexNoFnName=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,chromeRegex=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,chromeEvalRegex=/\((\S*)(?::(\d+))(?::(\d+))\)/,chromeDataUriRegex=/at (.+?) ?\(data:(.+?),/,chromeStackParserFn=Be=>{const Le=Be.match(chromeDataUriRegex);if(Le)return{filename:`<data:${Le[2]}>`,function:Le[1]};const Ye=chromeRegexNoFnName.exec(Be);if(Ye){const[,nt,ft,ht]=Ye;return createFrame(nt,UNKNOWN_FUNCTION,+ft,+ht)}const tt=chromeRegex.exec(Be);if(tt){if(tt[2]&&tt[2].indexOf("eval")===0){const gt=chromeEvalRegex.exec(tt[2]);gt&&(tt[2]=gt[1],tt[3]=gt[2],tt[4]=gt[3])}const[ft,ht]=extractSafariExtensionDetails(tt[1]||UNKNOWN_FUNCTION,tt[2]);return createFrame(ht,ft,tt[3]?+tt[3]:void 0,tt[4]?+tt[4]:void 0)}},chromeStackLineParser=[CHROME_PRIORITY,chromeStackParserFn],geckoREgex=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,geckoEvalRegex=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gecko=Be=>{const Le=geckoREgex.exec(Be);if(Le){if(Le[3]&&Le[3].indexOf(" > eval")>-1){const ft=geckoEvalRegex.exec(Le[3]);ft&&(Le[1]=Le[1]||"eval",Le[3]=ft[1],Le[4]=ft[2],Le[5]="")}let tt=Le[3],nt=Le[1]||UNKNOWN_FUNCTION;return[nt,tt]=extractSafariExtensionDetails(nt,tt),createFrame(tt,nt,Le[4]?+Le[4]:void 0,Le[5]?+Le[5]:void 0)}},geckoStackLineParser=[GECKO_PRIORITY,gecko],defaultStackLineParsers=[chromeStackLineParser,geckoStackLineParser],defaultStackParser=createStackParser(...defaultStackLineParsers),extractSafariExtensionDetails=(Be,Le)=>{const Ye=Be.indexOf("safari-extension")!==-1,tt=Be.indexOf("safari-web-extension")!==-1;return Ye||tt?[Be.indexOf("@")!==-1?Be.split("@")[0]:UNKNOWN_FUNCTION,Ye?`safari-extension:${Le}`:`safari-web-extension:${Le}`]:[Be,Le]},DEBUG_BUILD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,MAX_ALLOWED_STRING_LENGTH=1024,INTEGRATION_NAME$3="Breadcrumbs",_breadcrumbsIntegration=(Be={})=>{const Le={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...Be};return{name:INTEGRATION_NAME$3,setup(Ye){Le.console&&addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(Ye)),Le.dom&&addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(Ye,Le.dom)),Le.xhr&&addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(Ye)),Le.fetch&&addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(Ye)),Le.history&&addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(Ye)),Le.sentry&&Ye.on("beforeSendEvent",_getSentryBreadcrumbHandler(Ye))}}},breadcrumbsIntegration=_breadcrumbsIntegration;function _getSentryBreadcrumbHandler(Be){return function(Ye){getClient()===Be&&addBreadcrumb({category:`sentry.${Ye.type==="transaction"?"transaction":"event"}`,event_id:Ye.event_id,level:Ye.level,message:getEventDescription(Ye)},{event:Ye})}}function _getDomBreadcrumbHandler(Be,Le){return function(tt){if(getClient()!==Be)return;let nt,ft,ht=typeof Le=="object"?Le.serializeAttribute:void 0,gt=typeof Le=="object"&&typeof Le.maxStringLength=="number"?Le.maxStringLength:void 0;gt&&gt>MAX_ALLOWED_STRING_LENGTH&&(DEBUG_BUILD&&debug.warn(`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${gt} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`),gt=MAX_ALLOWED_STRING_LENGTH),typeof ht=="string"&&(ht=[ht]);try{const xt=tt.event,Et=_isEvent(xt)?xt.target:xt;nt=htmlTreeAsString(Et,{keyAttrs:ht,maxStringLength:gt}),ft=getComponentName(Et)}catch{nt="<unknown>"}if(nt.length===0)return;const At={category:`ui.${tt.name}`,message:nt};ft&&(At.data={"ui.component_name":ft}),addBreadcrumb(At,{event:tt.event,name:tt.name,global:tt.global})}}function _getConsoleBreadcrumbHandler(Be){return function(Ye){if(getClient()!==Be)return;const tt={category:"console",data:{arguments:Ye.args,logger:"console"},level:severityLevelFromString(Ye.level),message:safeJoin(Ye.args," ")};if(Ye.level==="assert")if(Ye.args[0]===!1)tt.message=`Assertion failed: ${safeJoin(Ye.args.slice(1)," ")||"console.assert"}`,tt.data.arguments=Ye.args.slice(1);else return;addBreadcrumb(tt,{input:Ye.args,level:Ye.level})}}function _getXhrBreadcrumbHandler(Be){return function(Ye){if(getClient()!==Be)return;const{startTimestamp:tt,endTimestamp:nt}=Ye,ft=Ye.xhr[SENTRY_XHR_DATA_KEY];if(!tt||!nt||!ft)return;const{method:ht,url:gt,status_code:At,body:xt}=ft,Et={method:ht,url:gt,status_code:At},kt={xhr:Ye.xhr,input:xt,startTimestamp:tt,endTimestamp:nt},Ct={category:"xhr",data:Et,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(At)};Be.emit("beforeOutgoingRequestBreadcrumb",Ct,kt),addBreadcrumb(Ct,kt)}}function _getFetchBreadcrumbHandler(Be){return function(Ye){if(getClient()!==Be)return;const{startTimestamp:tt,endTimestamp:nt}=Ye;if(nt&&!(Ye.fetchData.url.match(/sentry_key/)&&Ye.fetchData.method==="POST"))if(Ye.fetchData.method,Ye.fetchData.url,Ye.error){const ft=Ye.fetchData,ht={data:Ye.error,input:Ye.args,startTimestamp:tt,endTimestamp:nt},gt={category:"fetch",data:ft,level:"error",type:"http"};Be.emit("beforeOutgoingRequestBreadcrumb",gt,ht),addBreadcrumb(gt,ht)}else{const ft=Ye.response,ht={...Ye.fetchData,status_code:ft==null?void 0:ft.status};Ye.fetchData.request_body_size,Ye.fetchData.response_body_size,ft==null||ft.status;const gt={input:Ye.args,response:ft,startTimestamp:tt,endTimestamp:nt},At={category:"fetch",data:ht,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(ht.status_code)};Be.emit("beforeOutgoingRequestBreadcrumb",At,gt),addBreadcrumb(At,gt)}}}function _getHistoryBreadcrumbHandler(Be){return function(Ye){if(getClient()!==Be)return;let tt=Ye.from,nt=Ye.to;const ft=parseUrl(WINDOW$1.location.href);let ht=tt?parseUrl(tt):void 0;const gt=parseUrl(nt);ht!=null&&ht.path||(ht=ft),ft.protocol===gt.protocol&&ft.host===gt.host&&(nt=gt.relative),ft.protocol===ht.protocol&&ft.host===ht.host&&(tt=ht.relative),addBreadcrumb({category:"navigation",data:{from:tt,to:nt}})}}function _isEvent(Be){return!!Be&&!!Be.target}const DEFAULT_EVENT_TARGET=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],INTEGRATION_NAME$2="BrowserApiErrors",_browserApiErrorsIntegration=(Be={})=>{const Le={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...Be};return{name:INTEGRATION_NAME$2,setupOnce(){Le.setTimeout&&fill(WINDOW$1,"setTimeout",_wrapTimeFunction),Le.setInterval&&fill(WINDOW$1,"setInterval",_wrapTimeFunction),Le.requestAnimationFrame&&fill(WINDOW$1,"requestAnimationFrame",_wrapRAF),Le.XMLHttpRequest&&"XMLHttpRequest"in WINDOW$1&&fill(XMLHttpRequest.prototype,"send",_wrapXHR);const Ye=Le.eventTarget;Ye&&(Array.isArray(Ye)?Ye:DEFAULT_EVENT_TARGET).forEach(nt=>_wrapEventTarget(nt,Le))}}},browserApiErrorsIntegration=_browserApiErrorsIntegration;function _wrapTimeFunction(Be){return function(...Le){const Ye=Le[0];return Le[0]=wrap(Ye,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${getFunctionName(Be)}`}}),Be.apply(this,Le)}}function _wrapRAF(Be){return function(Le){return Be.apply(this,[wrap(Le,{mechanism:{data:{handler:getFunctionName(Be)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function _wrapXHR(Be){return function(...Le){const Ye=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(nt=>{nt in Ye&&typeof Ye[nt]=="function"&&fill(Ye,nt,function(ft){const ht={mechanism:{data:{handler:getFunctionName(ft)},handled:!1,type:`auto.browser.browserapierrors.xhr.${nt}`}},gt=getOriginalFunction(ft);return gt&&(ht.mechanism.data.handler=getFunctionName(gt)),wrap(ft,ht)})}),Be.apply(this,Le)}}function _wrapEventTarget(Be,Le){var nt,ft;const tt=(nt=WINDOW$1[Be])==null?void 0:nt.prototype;(ft=tt==null?void 0:tt.hasOwnProperty)!=null&&ft.call(tt,"addEventListener")&&(fill(tt,"addEventListener",function(ht){return function(gt,At,xt){try{isEventListenerObject(At)&&(At.handleEvent=wrap(At.handleEvent,{mechanism:{data:{handler:getFunctionName(At),target:Be},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return Le.unregisterOriginalCallbacks&&unregisterOriginalCallback(this,gt,At),ht.apply(this,[gt,wrap(At,{mechanism:{data:{handler:getFunctionName(At),target:Be},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),xt])}}),fill(tt,"removeEventListener",function(ht){return function(gt,At,xt){try{const Et=At.__sentry_wrapped__;Et&&ht.call(this,gt,Et,xt)}catch{}return ht.call(this,gt,At,xt)}}))}function isEventListenerObject(Be){return typeof Be.handleEvent=="function"}function unregisterOriginalCallback(Be,Le,Ye){Be&&typeof Be=="object"&&"removeEventListener"in Be&&typeof Be.removeEventListener=="function"&&Be.removeEventListener(Le,Ye)}const browserSessionIntegration=()=>({name:"BrowserSession",setupOnce(){if(typeof WINDOW$1.document>"u"){DEBUG_BUILD&&debug.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}startSession({ignoreDuration:!0}),captureSession(),addHistoryInstrumentationHandler(({from:Be,to:Le})=>{Be!==void 0&&Be!==Le&&(startSession({ignoreDuration:!0}),captureSession())})}}),INTEGRATION_NAME$1="GlobalHandlers",_globalHandlersIntegration=(Be={})=>{const Le={onerror:!0,onunhandledrejection:!0,...Be};return{name:INTEGRATION_NAME$1,setupOnce(){Error.stackTraceLimit=50},setup(Ye){Le.onerror&&(_installGlobalOnErrorHandler(Ye),globalHandlerLog("onerror")),Le.onunhandledrejection&&(_installGlobalOnUnhandledRejectionHandler(Ye),globalHandlerLog("onunhandledrejection"))}}},globalHandlersIntegration=_globalHandlersIntegration;function _installGlobalOnErrorHandler(Be){addGlobalErrorInstrumentationHandler(Le=>{const{stackParser:Ye,attachStacktrace:tt}=getOptions();if(getClient()!==Be||shouldIgnoreOnError())return;const{msg:nt,url:ft,line:ht,column:gt,error:At}=Le,xt=_enhanceEventWithInitialFrame(eventFromUnknownInput(Ye,At||nt,void 0,tt,!1),ft,ht,gt);xt.level="error",captureEvent(xt,{originalException:At,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function _installGlobalOnUnhandledRejectionHandler(Be){addGlobalUnhandledRejectionInstrumentationHandler(Le=>{const{stackParser:Ye,attachStacktrace:tt}=getOptions();if(getClient()!==Be||shouldIgnoreOnError())return;const nt=_getUnhandledRejectionError(Le),ft=isPrimitive(nt)?_eventFromRejectionWithPrimitive(nt):eventFromUnknownInput(Ye,nt,void 0,tt,!0);ft.level="error",captureEvent(ft,{originalException:nt,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function _getUnhandledRejectionError(Be){if(isPrimitive(Be))return Be;try{if("reason"in Be)return Be.reason;if("detail"in Be&&"reason"in Be.detail)return Be.detail.reason}catch{}return Be}function _eventFromRejectionWithPrimitive(Be){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(Be)}`}]}}}function _enhanceEventWithInitialFrame(Be,Le,Ye,tt){const nt=Be.exception=Be.exception||{},ft=nt.values=nt.values||[],ht=ft[0]=ft[0]||{},gt=ht.stacktrace=ht.stacktrace||{},At=gt.frames=gt.frames||[],xt=tt,Et=Ye,kt=getFilenameFromUrl(Le)??getLocationHref();return At.length===0&&At.push({colno:xt,filename:kt,function:UNKNOWN_FUNCTION,in_app:!0,lineno:Et}),Be}function globalHandlerLog(Be){DEBUG_BUILD&&debug.log(`Global Handler attached: ${Be}`)}function getOptions(){const Be=getClient();return(Be==null?void 0:Be.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function getFilenameFromUrl(Be){if(!(!isString(Be)||Be.length===0)){if(Be.startsWith("data:")){const Le=Be.match(/^data:([^;]+)/),Ye=Le?Le[1]:"text/javascript",tt=Be.includes("base64,");return`<data:${Ye}${tt?",base64":""}>`}return Be}}const httpContextIntegration=()=>({name:"HttpContext",preprocessEvent(Be){var tt;if(!WINDOW$1.navigator&&!WINDOW$1.location&&!WINDOW$1.document)return;const Le=getHttpRequestData(),Ye={...Le.headers,...(tt=Be.request)==null?void 0:tt.headers};Be.request={...Le,...Be.request,headers:Ye}}}),DEFAULT_KEY="cause",DEFAULT_LIMIT=5,INTEGRATION_NAME="LinkedErrors",_linkedErrorsIntegration=(Be={})=>{const Le=Be.limit||DEFAULT_LIMIT,Ye=Be.key||DEFAULT_KEY;return{name:INTEGRATION_NAME,preprocessEvent(tt,nt,ft){const ht=ft.getOptions();applyAggregateErrorsToEvent(exceptionFromError,ht.stackParser,Ye,Le,tt,nt)}}},linkedErrorsIntegration=_linkedErrorsIntegration;function checkAndWarnIfIsEmbeddedBrowserExtension(){return _isEmbeddedBrowserExtension()?(DEBUG_BUILD&&consoleSandbox(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function _isEmbeddedBrowserExtension(){var ft;if(typeof WINDOW$1.window>"u")return!1;const Be=WINDOW$1;if(Be.nw)return!1;const Le=Be.chrome||Be.browser;if(!((ft=Le==null?void 0:Le.runtime)!=null&&ft.id))return!1;const Ye=getLocationHref(),tt=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(WINDOW$1===WINDOW$1.top&&tt.some(ht=>Ye.startsWith(`${ht}://`)))}function getDefaultIntegrations(Be){return[inboundFiltersIntegration(),functionToStringIntegration(),browserApiErrorsIntegration(),breadcrumbsIntegration(),globalHandlersIntegration(),linkedErrorsIntegration(),dedupeIntegration(),httpContextIntegration(),browserSessionIntegration()]}function init(Be={}){const Le=!Be.skipBrowserExtensionCheck&&checkAndWarnIfIsEmbeddedBrowserExtension();let Ye=Be.defaultIntegrations==null?getDefaultIntegrations():Be.defaultIntegrations;const tt={...Be,enabled:Le?!1:Be.enabled,stackParser:stackParserFromStackParserOptions(Be.stackParser||defaultStackParser),integrations:getIntegrationsToSetup({integrations:Be.integrations,defaultIntegrations:Ye}),transport:Be.transport||makeFetchTransport};return initAndBind(BrowserClient,tt)}const DEPRECATION_PERIOD_MONTHS=12,SDK_RELEASE_DATE="2026-10-10",DEPRECATED_SDK_WARNING_MESSAGE="You are using a deprecated SDK version. Please upgrade to the latest version to avoid any disruption.";let hasWarned=!1;const parseReleaseDate=Be=>{const Le=/^(\d{4})-(\d{2})-(\d{2})$/.exec(Be);if(!Le)return null;const Ye=Number(Le[1]),tt=Number(Le[2])-1,nt=Number(Le[3]),ft=new Date(Date.UTC(Ye,tt,nt));return ft.getUTCFullYear()!==Ye||ft.getUTCMonth()!==tt||ft.getUTCDate()!==nt?null:ft},isSdkDeprecated=(Be,Le=new Date)=>{const Ye=parseReleaseDate(Be);if(!Ye)return!1;const tt=new Date(Date.UTC(Ye.getUTCFullYear(),Ye.getUTCMonth()+DEPRECATION_PERIOD_MONTHS,Ye.getUTCDate()));return Le.getTime()>=tt.getTime()},warnIfSdkDeprecated=(Be=SDK_RELEASE_DATE,Le=new Date)=>{hasWarned||!isSdkDeprecated(Be,Le)||(hasWarned=!0,console.warn(DEPRECATED_SDK_WARNING_MESSAGE))};function setupFiles(){const Be={pollingIntervalSeconds:.25,maxMillisBeforeAckWhenClosed:100,moreAnnoyingDebuggerStatements:1,onDetectOpen:()=>{var xt;addDeviceStats((xt=state.token)==null?void 0:xt.token,{inspectorOpened:!0}),MlWasmJSApi$1.setInspectorOpened(!0)},onDetectClose:void 0,startup:"asap",onCheckOpennessWhilePaused:"throw"};Object.seal(Be);const Le=new Worker(URL.createObjectURL(new Blob([`"use strict";
10045
10045
  onmessage = (ev) => { postMessage({isOpenBeat:true});
10046
10046
  debugger; for (let i = 0; i < ev.data.moreDebugs; i++) { debugger; }
10047
10047
  postMessage({isOpenBeat:false});
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/onBoarding.d.ts",
6
- "version": "1.94.0-rc.20261006000629",
6
+ "version": "1.94.0",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/IncodeTechnologies/ms-incodesmile-web.git",