@incodetech/welcome 1.85.0-20251219204942.0 → 1.85.0-20251219230908.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/onBoarding.mjs +24 -21
- package/dist/onBoarding.umd.js +9 -10
- package/package.json +1 -1
package/dist/onBoarding.mjs
CHANGED
|
@@ -8289,7 +8289,7 @@ class MlWasmJSApi {
|
|
|
8289
8289
|
);
|
|
8290
8290
|
}
|
|
8291
8291
|
}
|
|
8292
|
-
const MlWasmJSApi$1 = MlWasmJSApi.getInstance(), version$4 = "1.85.0-
|
|
8292
|
+
const MlWasmJSApi$1 = MlWasmJSApi.getInstance(), version$4 = "1.85.0-20251219230908.0";
|
|
8293
8293
|
function e$2(Be, Le) {
|
|
8294
8294
|
return function(Ye, tt) {
|
|
8295
8295
|
return Object.prototype.hasOwnProperty.call(Ye, tt);
|
|
@@ -203092,11 +203092,7 @@ const FrameContainer = ({ children: Be }) => /* @__PURE__ */ jsxRuntimeExports.j
|
|
|
203092
203092
|
transform: translate(-50%, 0);
|
|
203093
203093
|
opacity: 1;
|
|
203094
203094
|
}
|
|
203095
|
-
`,
|
|
203096
|
-
background: transparent;
|
|
203097
|
-
border: none;
|
|
203098
|
-
cursor: pointer;
|
|
203099
|
-
padding: 0;
|
|
203095
|
+
`, AnimatedWrapper = dt(Box)`
|
|
203100
203096
|
position: absolute;
|
|
203101
203097
|
bottom: 44px;
|
|
203102
203098
|
left: 50%;
|
|
@@ -203104,35 +203100,42 @@ const FrameContainer = ({ children: Be }) => /* @__PURE__ */ jsxRuntimeExports.j
|
|
|
203104
203100
|
width: 68px;
|
|
203105
203101
|
height: 68px;
|
|
203106
203102
|
z-index: 101;
|
|
203103
|
+
animation: ${slideUp} 0.5s ease-out forwards;
|
|
203104
|
+
`, StyledSVGWrapper = dt.div`
|
|
203105
|
+
width: 100%;
|
|
203106
|
+
height: 100%;
|
|
203107
203107
|
display: flex;
|
|
203108
203108
|
align-items: center;
|
|
203109
203109
|
justify-content: center;
|
|
203110
|
-
|
|
203111
|
-
|
|
203110
|
+
|
|
203112
203111
|
svg {
|
|
203113
203112
|
width: 100%;
|
|
203114
203113
|
height: 100%;
|
|
203115
203114
|
transition: filter 0.2s ease, transform 0.2s ease;
|
|
203116
203115
|
}
|
|
203117
203116
|
|
|
203118
|
-
|
|
203117
|
+
button:active & svg {
|
|
203119
203118
|
filter: brightness(0.8);
|
|
203120
203119
|
transform: scale(0.95);
|
|
203121
203120
|
}
|
|
203122
203121
|
`, ManualCaptureButton = (Be) => {
|
|
203123
203122
|
const { t: Le } = useTranslation$1();
|
|
203124
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
203125
|
-
|
|
203126
|
-
|
|
203127
|
-
|
|
203128
|
-
|
|
203129
|
-
|
|
203130
|
-
|
|
203131
|
-
|
|
203132
|
-
|
|
203133
|
-
|
|
203134
|
-
|
|
203135
|
-
|
|
203123
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(AnimatedWrapper, { children: [
|
|
203124
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CaptureTooltip, {}),
|
|
203125
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
203126
|
+
Button$b,
|
|
203127
|
+
{
|
|
203128
|
+
variant: "link",
|
|
203129
|
+
type: "button",
|
|
203130
|
+
"aria-label": Le("idv2.capture.manualCapture.ariaLabel"),
|
|
203131
|
+
hFull: !0,
|
|
203132
|
+
wFull: !0,
|
|
203133
|
+
p: 0,
|
|
203134
|
+
...Be,
|
|
203135
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(StyledSVGWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgManualCaptureButton, { title: Le("idv2.capture.manualCapture.title") }) })
|
|
203136
|
+
}
|
|
203137
|
+
)
|
|
203138
|
+
] });
|
|
203136
203139
|
}, SvgBlurIcon = (Be) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...Be }, /* @__PURE__ */ React.createElement("path", { d: "M12.2597 4.15625C14.3285 4.1835 16.3243 4.916 17.9199 6.23242C18.2394 6.49605 18.2851 6.96957 18.0214 7.28906C17.7578 7.60828 17.2852 7.65315 16.9658 7.38965C15.6357 6.29217 13.9729 5.68098 12.249 5.65625C10.5346 5.67942 8.878 6.28369 7.5527 7.37207C6.03992 8.62375 4.84504 10.2126 4.06246 12.0107C4.83423 13.8004 6.01967 15.3822 7.52242 16.626C7.84151 16.8901 7.88613 17.3635 7.62203 17.6826C7.35793 18.0017 6.88449 18.0463 6.56539 17.7822C4.79235 16.3147 3.41234 14.427 2.5527 12.29C2.48019 12.1096 2.48144 11.9077 2.55465 11.7275C3.42639 9.58276 4.81515 7.68881 6.5986 6.21387L6.60055 6.21289C8.19264 4.90541 10.1832 4.18132 12.2412 4.15625H12.2597Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { d: "M19.3963 3.80561C19.6892 3.51272 20.165 3.51271 20.4579 3.80561C20.7504 4.09843 20.7504 4.57333 20.4579 4.86615L5.10728 20.2158C4.81438 20.5087 4.33962 20.5087 4.04673 20.2158C3.75401 19.9229 3.7539 19.4481 4.04673 19.1552L19.3963 3.80561Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { d: "M12.4287 8.18359C13.377 8.22855 14.2762 8.62583 14.9502 9.2998C15.2429 9.59271 15.243 10.0675 14.9502 10.3604C14.6574 10.653 14.1825 10.653 13.8897 10.3604C13.4528 9.92345 12.8603 9.6783 12.2422 9.67969H12.2412C10.9575 9.68196 9.91866 10.725 9.92092 12.0088V12.0127C9.91873 12.6266 10.1629 13.2142 10.5987 13.6455C10.893 13.9369 10.8949 14.4117 10.6035 14.7061C10.3122 15.0003 9.83736 15.0032 9.54299 14.7119C8.82092 13.9973 8.41718 13.0228 8.42092 12.0068C8.41946 9.89669 10.1276 8.18357 12.2383 8.17969L12.4287 8.18359Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { d: "M19.0536 8.34264C19.3864 8.09617 19.8559 8.16611 20.1024 8.49889C20.8393 9.49403 21.4571 10.5723 21.9413 11.7128C22.0214 11.9015 22.0206 12.1153 21.9393 12.3036C19.9504 16.911 16.3507 19.8602 12.2499 19.8602C11.3317 19.8602 10.421 19.7108 9.55163 19.4217C9.15858 19.2911 8.94538 18.8665 9.07605 18.4735C9.20672 18.0805 9.63127 17.8683 10.0243 17.9989C10.7428 18.2378 11.4942 18.3602 12.2499 18.3602C15.4814 18.3602 18.5736 16.0795 20.4296 12.0047C20.0129 11.0822 19.5004 10.2058 18.8973 9.39147C18.6509 9.05863 18.7208 8.58917 19.0536 8.34264Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { d: "M14.5349 12.4195C14.6094 12.0122 14.9996 11.7418 15.407 11.816C15.8145 11.8902 16.0848 12.2815 16.0105 12.689C15.7256 14.2521 14.5032 15.4787 12.9392 15.7662C12.5318 15.841 12.1411 15.571 12.0662 15.1636C11.9914 14.7563 12.2605 14.3655 12.6677 14.2906C13.6177 14.116 14.3617 13.3702 14.5349 12.4195Z", fill: "#14151A" })), SvgGlareIcon = (Be) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...Be }, /* @__PURE__ */ React.createElement("path", { d: "M2.25 15.1279V9.51172C2.25 7.88342 2.76123 6.43316 3.74023 5.38281C4.72472 4.32662 6.12676 3.73535 7.78223 3.73535H13.2705L13.3477 3.73926C13.7258 3.7777 14.0205 4.09705 14.0205 4.48535C14.0205 4.87365 13.7258 5.193 13.3477 5.23145L13.2705 5.23535H7.78223C6.49854 5.23535 5.50964 5.68477 4.83789 6.40527C4.16068 7.13181 3.75 8.19485 3.75 9.51172V15.1279C3.75003 16.4457 4.1591 17.5083 4.83496 18.2344C5.5052 18.9542 6.49361 19.4043 7.78223 19.4043H16.2158C17.5051 19.4043 18.4945 18.9544 19.165 18.2344C19.8412 17.5083 20.25 16.4456 20.25 15.1279V12.458C20.25 12.0438 20.5858 11.708 21 11.708C21.4142 11.708 21.75 12.0438 21.75 12.458V15.1279C21.75 16.7554 21.2412 18.2061 20.2627 19.2568C19.2785 20.3135 17.8755 20.9043 16.2158 20.9043H7.78223C6.12294 20.9043 4.72013 20.3136 3.73633 19.2568C2.7582 18.2061 2.25003 16.7553 2.25 15.1279Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { d: "M14.2705 14.4121C14.6846 14.4123 15.0205 14.748 15.0205 15.1621C15.0205 15.5762 14.6846 15.912 14.2705 15.9121H7.04102C6.62682 15.9121 6.29105 15.5763 6.29102 15.1621C6.29102 14.7479 6.6268 14.4121 7.04102 14.4121H14.2705ZM8.96094 10.6523C9.37494 10.6526 9.71094 10.9883 9.71094 11.4023C9.71094 11.8164 9.37494 12.1521 8.96094 12.1523H7.04102C6.6268 12.1523 6.29102 11.8166 6.29102 11.4023C6.29102 10.9881 6.6268 10.6523 7.04102 10.6523H8.96094Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { d: "M18.4043 3.0957C18.7183 3.0957 18.9986 3.29142 19.1074 3.58594L19.209 3.85938C19.5141 4.68491 20.1638 5.33534 20.9873 5.64062L21.2607 5.74219C21.5548 5.85125 21.75 6.13168 21.75 6.44531C21.75 6.75893 21.5548 7.03941 21.2607 7.14844L20.9873 7.25C20.215 7.5363 19.5953 8.1258 19.2695 8.87891L19.209 9.03125L19.1074 9.30469C18.9986 9.59909 18.7182 9.79492 18.4043 9.79492C18.0904 9.79492 17.81 9.59909 17.7012 9.30469L17.5996 9.03125C17.2945 8.20566 16.6448 7.55532 15.8213 7.25L15.5479 7.14844C15.2538 7.03941 15.0586 6.75893 15.0586 6.44531C15.0586 6.13168 15.2538 5.85125 15.5479 5.74219L15.8213 5.64062C16.6448 5.33534 17.2945 4.68491 17.5996 3.85938L17.7012 3.58594L17.749 3.48047C17.8799 3.24552 18.1294 3.0957 18.4043 3.0957ZM18.4043 5.49414C18.1366 5.85711 17.8158 6.17742 17.4531 6.44531C17.8156 6.71307 18.1367 7.03278 18.4043 7.39551C18.6718 7.03299 18.9922 6.71298 19.3545 6.44531C18.992 6.17751 18.6719 5.8569 18.4043 5.49414Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { d: "M13.9019 8.29492C14.232 8.29495 14.5236 8.51122 14.6196 8.82715C14.7187 9.15288 14.9733 9.4071 15.2974 9.50586C15.6128 9.60214 15.8286 9.89376 15.8286 10.2236C15.8285 10.5534 15.6127 10.8441 15.2974 10.9404C14.973 11.0393 14.7187 11.2942 14.6196 11.6201C14.5236 11.936 14.232 12.1513 13.9019 12.1514C13.5717 12.1514 13.2801 11.936 13.1841 11.6201C13.0851 11.2943 12.8307 11.0393 12.5063 10.9404C12.1909 10.8442 11.9752 10.5534 11.9751 10.2236C11.9751 9.89369 12.1908 9.60208 12.5063 9.50586C12.8305 9.40708 13.085 9.15282 13.1841 8.82715C13.2801 8.5112 13.5716 8.29492 13.9019 8.29492Z", fill: "#14151A" })), SvgInfoNotReadable = (Be) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...Be }, /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.51987 5.07032C4.36282 4.16615 5.5605 3.66406 6.96486 3.66406H17.0351C18.4424 3.66406 19.6405 4.16586 20.483 5.07066C21.3199 5.96941 21.75 7.20487 21.75 8.58033V11.5041C21.75 11.9183 21.4142 12.2541 21 12.2541C20.5858 12.2541 20.25 11.9183 20.25 11.5041V8.58033C20.25 7.5146 19.9198 6.66693 19.3852 6.09284C18.8563 5.52481 18.0719 5.16406 17.0351 5.16406H6.96486C5.93193 5.16406 5.14718 5.52452 4.61702 6.09318C4.08142 6.66769 3.75 7.51548 3.75 8.58033V15.1683C3.75 16.2346 4.08027 17.0822 4.61474 17.6561C5.1436 18.224 5.92794 18.5846 6.96486 18.5846H11.1224C11.5366 18.5846 11.8724 18.9204 11.8724 19.3346C11.8724 19.7488 11.5366 20.0846 11.1224 20.0846H6.96486C5.55768 20.0846 4.35959 19.5831 3.51704 18.6784C2.68011 17.7797 2.25 16.5442 2.25 15.1683V8.58033C2.25 7.20399 2.68237 5.96865 3.51987 5.07032Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.25 9.71191C2.25 9.2977 2.58579 8.96191 3 8.96191H21C21.4142 8.96191 21.75 9.2977 21.75 9.71191C21.75 10.1261 21.4142 10.4619 21 10.4619H3C2.58579 10.4619 2.25 10.1261 2.25 9.71191Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.4359 14.3971C17.5875 13.5487 16.2128 13.5487 15.3644 14.3971C14.516 15.2455 14.516 16.6202 15.3644 17.4686C16.2128 18.317 17.5875 18.317 18.4359 17.4686C19.2843 16.6202 19.2843 15.2455 18.4359 14.3971ZM14.3037 13.3364C15.7379 11.9022 18.0624 11.9022 19.4966 13.3364C20.9308 14.7706 20.9308 17.0951 19.4966 18.5293C18.0624 19.9635 15.7379 19.9635 14.3037 18.5293C12.8695 17.0951 12.8695 14.7706 14.3037 13.3364Z", fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.436 17.4707C18.7289 17.1778 19.2038 17.1778 19.4967 17.4707L21.0797 19.0538C21.3726 19.3467 21.3726 19.8215 21.0797 20.1144C20.7868 20.4073 20.3119 20.4073 20.019 20.1144L18.436 18.5314C18.1431 18.2385 18.1431 17.7636 18.436 17.4707Z", fill: "#14151A" })), SvgQuestionIcon = (Be) => /* @__PURE__ */ React.createElement("svg", { width: 64, height: 64, viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...Be }, /* @__PURE__ */ React.createElement("circle", { cx: 32, cy: 32, r: 32, fill: "#14151A" }), /* @__PURE__ */ React.createElement("path", { d: "M32 41C33.1045 41 34 41.8955 34 43C34 44.1045 33.1045 45 32 45C30.8954 45 30 44.1045 30 43C30 41.8954 30.8954 41 32 41ZM32 18.5C36.6906 18.5001 40.1669 22.0578 40.167 26.5605C40.167 28.8363 39.239 30.7175 37.7119 32.0381C36.5502 33.0426 35.086 33.6855 33.5 33.9863V38H30.5V31.2568L31.9072 31.1699C33.5141 31.0696 34.8469 30.5494 35.75 29.7686C36.6245 29.0121 37.167 27.9561 37.167 26.5605C37.1669 23.7203 35.0394 21.5001 32 21.5C28.9065 21.5001 26.7253 23.7825 26.1406 26.8418L23.1934 26.2793C23.9755 22.1855 27.1118 18.5001 32 18.5Z", fill: "white" })), CommonIssues = ({
|
|
203137
203140
|
onClose: Be,
|
|
203138
203141
|
switchToManualCapture: Le,
|
package/dist/onBoarding.umd.js
CHANGED
|
@@ -63,7 +63,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[St]+=1);const breakpoints$3={
|
|
|
63
63
|
justify-content: center;
|
|
64
64
|
align-items: center;
|
|
65
65
|
flex-direction: column;
|
|
66
|
-
`;typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let Be,Le;return{promise:new Promise((tt,nt)=>{Be=tt,Le=nt}),resolve:Be,reject:Le}});class InterruptionHandler{constructor(){this.boundVisibilityChange=this.handleVisibilityChange.bind(this),this.boundOnline=this.handleOnline.bind(this),this.boundOffline=this.handleOffline.bind(this),this.boundUnhandledRejection=this.handleUnhandledRejection.bind(this),this.boundError=this.handleError.bind(this),this.initialized=!1}registerEventListeners(){this.initialized||(document.addEventListener("visibilitychange",this.boundVisibilityChange),window.addEventListener("online",this.boundOnline),window.addEventListener("offline",this.boundOffline),window.addEventListener("unhandledrejection",this.boundUnhandledRejection),window.addEventListener("error",this.boundError),this.initialized=!0)}removeEventListeners(){this.initialized&&(this.initialized=!1,document.removeEventListener("visibilitychange",this.boundVisibilityChange),window.removeEventListener("online",this.boundOnline),window.removeEventListener("offline",this.boundOffline),window.removeEventListener("unhandledrejection",this.boundUnhandledRejection),window.removeEventListener("error",this.boundError))}handleVisibilityChange(){document.hidden?this.onAppHidden():this.onAppVisible()}onAppHidden(){}onAppVisible(){}handleOnline(){}handleOffline(){}handleUnhandledRejection(Le){}handleError(Le){}}const regex$1={CURP_PATTERN:/^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,EMAIL_PATTERN:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};function webgl(){let Be,Le,Ye=256,tt=128;Be=document.body.appendChild(document.createElement("canvas")),Be.width=Ye,Be.height=tt;try{Le=Be.getContext("webgl2")||Be.getContext("experimental-webgl2")||Be.getContext("webgl")||Be.getContext("experimental-webgl")||Be.getContext("moz-webgl");const nt="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",ft="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",ht=Le.createBuffer();Le.bindBuffer(Le.ARRAY_BUFFER,ht);const gt=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0]);Le.bufferData(Le.ARRAY_BUFFER,gt,Le.STATIC_DRAW),ht.itemSize=3,ht.numItems=3;const At=Le.createProgram(),xt=Le.createShader(Le.VERTEX_SHADER);Le.shaderSource(xt,nt),Le.compileShader(xt);const Et=Le.createShader(Le.FRAGMENT_SHADER);Le.shaderSource(Et,ft),Le.compileShader(Et),Le.attachShader(At,xt),Le.attachShader(At,Et),Le.linkProgram(At),Le.useProgram(At),At.vertexPosAttrib=Le.getAttribLocation(At,"attrVertex"),At.offsetUniform=Le.getUniformLocation(At,"uniformOffset"),Le.enableVertexAttribArray(At.vertexPosAttrib),Le.vertexAttribPointer(At.vertexPosAttrib,ht.itemSize,Le.FLOAT,!1,0,0),Le.uniform2f(At.offsetUniform,1,1),Le.drawArrays(Le.TRIANGLE_STRIP,0,ht.numItems);let yt="";const Ct=new Uint8Array(Ye*tt*4);return Le.readPixels(0,0,Ye,tt,Le.RGBA,Le.UNSIGNED_BYTE,Ct),yt=JSON.stringify(Ct).replace(/,?"[0-9]+":/g,""),document.body.removeChild(Be),sha256(yt)}catch{return""}}const sha256=(()=>{let Be=1,Le,Ye=[],tt=[];for(;++Be<18;)for(Le=Be*Be;Le<312;Le+=Be)Ye[Le]=1;function nt(gt,At){return Math.pow(gt,1/At)%1*4294967296|0}for(Be=1,Le=0;Be<313;)Ye[++Be]||(tt[Le]=nt(Be,2),Ye[Le++]=nt(Be,3));function ft(gt,At){return gt>>>At|gt<<32-At}function ht(gt){let At=tt.slice(Be=0),xt=unescape(encodeURI(gt)),Et=[],yt=xt.length,Ct=[],kt,vt,bt;for(;Be<yt;)Ct[Be>>2]|=(xt.charCodeAt(Be)&255)<<8*(3-Be++%4);for(yt*=8,Ct[yt>>5]|=128<<24-yt%32,Ct[bt=yt+64>>5|15]=yt,Be=0;Be<bt;Be+=16){for(kt=At.slice(Le=0,8);Le<64;kt[4]+=vt)Le<16?Et[Le]=Ct[Le+Be]:Et[Le]=(ft(vt=Et[Le-2],17)^ft(vt,19)^vt>>>10)+(Et[Le-7]|0)+(ft(vt=Et[Le-15],7)^ft(vt,18)^vt>>>3)+(Et[Le-16]|0),kt.unshift((vt=(kt.pop()+(ft(gt=kt[4],6)^ft(gt,11)^ft(gt,25))+((gt&kt[5]^~gt&kt[6])+Ye[Le])|0)+(Et[Le++]|0))+(ft(yt=kt[0],2)^ft(yt,13)^ft(yt,22))+(yt&kt[1]^kt[1]&kt[2]^kt[2]&yt));for(Le=8;Le--;)At[Le]=kt[Le]+At[Le]}for(xt="";Le<63;)xt+=(At[++Le>>3]>>4*(7-Le%8)&15).toString(16);return xt}return ht})();var store;function getGlobalConfig$1(Be){return{lang:store==null?void 0:store.lang,message:Be==null?void 0:Be.message,abortEarly:store==null?void 0:store.abortEarly,abortPipeEarly:store==null?void 0:store.abortPipeEarly}}var store2;function getGlobalMessage$1(Be){return store2==null?void 0:store2.get(Be)}var store3;function getSchemaMessage$1(Be){return store3==null?void 0:store3.get(Be)}var store4;function getSpecificMessage$1(Be,Le){var Ye;return(Ye=store4==null?void 0:store4.get(Be))==null?void 0:Ye.get(Le)}function _stringify$4(Be){var Ye,tt;const Le=typeof Be;return Le==="string"?`"${Be}"`:Le==="number"||Le==="bigint"||Le==="boolean"?`${Be}`:Le==="object"||Le==="function"?(Be&&((tt=(Ye=Object.getPrototypeOf(Be))==null?void 0:Ye.constructor)==null?void 0:tt.name))??"null":Le}function _addIssue$1(Be,Le,Ye,tt,nt){const ft=nt&&"input"in nt?nt.input:Ye.value,ht=(nt==null?void 0:nt.expected)??Be.expects??null,gt=(nt==null?void 0:nt.received)??_stringify$4(ft),At={kind:Be.kind,type:Be.type,input:ft,expected:ht,received:gt,message:`Invalid ${Le}: ${ht?`Expected ${ht} but r`:"R"}eceived ${gt}`,requirement:Be.requirement,path:nt==null?void 0:nt.path,issues:nt==null?void 0:nt.issues,lang:tt.lang,abortEarly:tt.abortEarly,abortPipeEarly:tt.abortPipeEarly},xt=Be.kind==="schema",Et=(nt==null?void 0:nt.message)??Be.message??getSpecificMessage$1(Be.reference,At.lang)??(xt?getSchemaMessage$1(At.lang):null)??tt.message??getGlobalMessage$1(At.lang);Et!==void 0&&(At.message=typeof Et=="function"?Et(At):Et),xt&&(Ye.typed=!1),Ye.issues?Ye.issues.push(At):Ye.issues=[At]}function _getStandardProps$1(Be){return{version:1,vendor:"valibot",validate(Le){return Be["~run"]({value:Le},getGlobalConfig$1())}}}function _joinExpects(Be,Le){const Ye=[...new Set(Be)];return Ye.length>1?`(${Ye.join(` ${Le} `)})`:Ye[0]??"never"}function isValiError(Be){return Be instanceof ValiError}var ValiError=class extends Error{constructor(Be){super(Be[0].message),this.name="ValiError",this.issues=Be}};function getFallback$1(Be,Le,Ye){return typeof Be.fallback=="function"?Be.fallback(Le,Ye):Be.fallback}function getDefault$1(Be,Le,Ye){return typeof Be.default=="function"?Be.default(Le,Ye):Be.default}function boolean$2(Be){return{kind:"schema",type:"boolean",reference:boolean$2,expects:"boolean",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="boolean"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function custom(Be,Le){return{kind:"schema",type:"custom",reference:custom,expects:"unknown",async:!1,check:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return this.check(Ye.value)?Ye.typed=!0:_addIssue$1(this,"type",Ye,tt),Ye}}}function function_(Be){return{kind:"schema",type:"function",reference:function_,expects:"Function",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="function"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function literal(Be,Le){return{kind:"schema",type:"literal",reference:literal,expects:_stringify$4(Be),async:!1,literal:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return Ye.value===this.literal?Ye.typed=!0:_addIssue$1(this,"type",Ye,tt),Ye}}}function null_(Be){return{kind:"schema",type:"null",reference:null_,expects:"null",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return Le.value===null?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function number$3(Be){return{kind:"schema",type:"number",reference:number$3,expects:"number",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="number"&&!isNaN(Le.value)?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function object$1(Be,Le){return{kind:"schema",type:"object",reference:object$1,expects:"Object",async:!1,entries:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){var ft;const nt=Ye.value;if(nt&&typeof nt=="object"){Ye.typed=!0,Ye.value={};for(const ht in this.entries){const gt=this.entries[ht];if(ht in nt||(gt.type==="exact_optional"||gt.type==="optional"||gt.type==="nullish")&>.default!==void 0){const At=ht in nt?nt[ht]:getDefault$1(gt),xt=gt["~run"]({value:At},tt);if(xt.issues){const Et={type:"object",origin:"value",input:nt,key:ht,value:At};for(const yt of xt.issues)yt.path?yt.path.unshift(Et):yt.path=[Et],(ft=Ye.issues)==null||ft.push(yt);if(Ye.issues||(Ye.issues=xt.issues),tt.abortEarly){Ye.typed=!1;break}}xt.typed||(Ye.typed=!1),Ye.value[ht]=xt.value}else if(gt.fallback!==void 0)Ye.value[ht]=getFallback$1(gt);else if(gt.type!=="exact_optional"&>.type!=="optional"&>.type!=="nullish"&&(_addIssue$1(this,"key",Ye,tt,{input:void 0,expected:`"${ht}"`,path:[{type:"object",origin:"key",input:nt,key:ht,value:nt[ht]}]}),tt.abortEarly))break}}else _addIssue$1(this,"type",Ye,tt);return Ye}}}function optional$1(Be,Le){return{kind:"schema",type:"optional",reference:optional$1,expects:`(${Be.expects} | undefined)`,async:!1,wrapped:Be,default:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return Ye.value===void 0&&(this.default!==void 0&&(Ye.value=getDefault$1(this,Ye,tt)),Ye.value===void 0)?(Ye.typed=!0,Ye):this.wrapped["~run"](Ye,tt)}}}function string$3(Be){return{kind:"schema",type:"string",reference:string$3,expects:"string",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="string"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function _subIssues(Be){let Le;if(Be)for(const Ye of Be)Le?Le.push(...Ye.issues):Le=Ye.issues;return Le}function union(Be,Le){return{kind:"schema",type:"union",reference:union,expects:_joinExpects(Be.map(Ye=>Ye.expects),"|"),async:!1,options:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){let nt,ft,ht;for(const gt of this.options){const At=gt["~run"]({value:Ye.value},tt);if(At.typed)if(At.issues)ft?ft.push(At):ft=[At];else{nt=At;break}else ht?ht.push(At):ht=[At]}if(nt)return nt;if(ft){if(ft.length===1)return ft[0];_addIssue$1(this,"type",Ye,tt,{issues:_subIssues(ft)}),Ye.typed=!0}else{if((ht==null?void 0:ht.length)===1)return ht[0];_addIssue$1(this,"type",Ye,tt,{issues:_subIssues(ht)})}return Ye}}}function parse$8(Be,Le,Ye){const tt=Be["~run"]({value:Le},getGlobalConfig$1(Ye));if(tt.issues)throw new ValiError(tt.issues);return tt.value}function validate$2(...Be){try{Be.forEach(({schema:Le,value:Ye})=>parse$8(Le,Ye))}catch(Le){if(isValiError(Le)){const Ye=Le.issues.map(tt=>{var ft;return`${((ft=tt.path)==null?void 0:ft.map(ht=>ht.key).join("."))||"root"}: ${tt.message}`}).join(", ");throw new Error(`Validation failed: ${Ye}`)}throw Le}}exports.api=void 0;function setApi(Be){exports.api=Be}function setToken(Be){exports.api.defaults.headers["X-Incode-Hardware-Id"]=Be}const eventsQueue=[];function addEvent(Be){const{token:Le,code:Ye,module:tt,screen:nt,clientTimestamp:ft,payload:ht={}}=Be;if(!Le){eventsQueue.push(Be);return}return exports.api.post("/omni/interview-events",[{code:Ye,module:tt,screen:nt,clientTimestamp:ft??new Date().getTime(),payload:ht}],{headers:{"X-Incode-Hardware-Id":Le}}).catch(()=>{})}function emptyQueue(Be){eventsQueue.forEach(Le=>{addEvent({...Le,token:Be})})}const state={token:null};var PipelineProfileName=(Be=>(Be[Be.IdCapture_2_01=0]="IdCapture_2_01",Be[Be.IdCapture_2_02=1]="IdCapture_2_02",Be[Be.IdCapture_3_02=2]="IdCapture_3_02",Be[Be.IdVideoSelfie_2_01=3]="IdVideoSelfie_2_01",Be[Be.SelfieWithAggregationMetrics=4]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=5]="SelfieWithQualityMetrics",Be[Be.SelfieVideoSelfie=6]="SelfieVideoSelfie",Be))(PipelineProfileName||{});class PipelineProfile{constructor(Le,Ye,tt,nt,ft,ht=null,gt=""){this.pipelineType=Le,this.name=Ye,this.detectionType=tt,this.modelNames=nt,this.parameters=ft,this.paramsConfigurator=ht,this.description=gt}reconfigureParams(Le,Ye){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,Le,Ye)}}var DetectionType=(Be=>(Be[Be.IDCapture=0]="IDCapture",Be[Be.Selfie=1]="Selfie",Be[Be.SelfieVideoSelfie=2]="SelfieVideoSelfie",Be[Be.IdVideoSelfie=3]="IdVideoSelfie",Be))(DetectionType||{}),WasmPipelineType=(Be=>(Be[Be.IdBlurGlarePipeline=0]="IdBlurGlarePipeline",Be[Be.IdBarcodeAndTextQualityPipeline=1]="IdBarcodeAndTextQualityPipeline",Be[Be.IdVideoSelfiePipeline=2]="IdVideoSelfiePipeline",Be[Be.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",Be[Be.IdFaceDetectionPipeline=5]="IdFaceDetectionPipeline",Be))(WasmPipelineType||{}),IdCaptureModelType=(Be=>(Be[Be.IdCaptureV1x=0]="IdCaptureV1x",Be[Be.IdCaptureV2x=1]="IdCaptureV2x",Be[Be.IdCaptureV3x=2]="IdCaptureV3x",Be))(IdCaptureModelType||{}),src$2={},src$1={},$_StatsigGlobal={},Log={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Log=Be.LogLevel=void 0;const Le=" DEBUG ",Ye=" INFO ",tt=" WARN ",nt=" ERROR ";function ft(gt){return gt.unshift("[Statsig]"),gt}Be.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class ht{static info(...At){ht.level>=Be.LogLevel.Info&&console.info(Ye,...ft(At))}static debug(...At){ht.level>=Be.LogLevel.Debug&&console.debug(Le,...ft(At))}static warn(...At){ht.level>=Be.LogLevel.Warn&&console.warn(tt,...ft(At))}static error(...At){ht.level>=Be.LogLevel.Error&&console.error(nt,...ft(At))}}Be.Log=ht,ht.level=Be.LogLevel.Warn})(Log),function(Be){var Le,Ye,tt;Object.defineProperty(Be,"__esModule",{value:!0}),Be._getInstance=Be._getStatsigGlobalFlag=Be._getStatsigGlobal=void 0;const nt=Log,ft=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:Ct}catch{return Ct}};Be._getStatsigGlobal=ft;const ht=kt=>(0,Be._getStatsigGlobal)()[kt];Be._getStatsigGlobalFlag=ht;const gt=kt=>{const vt=(0,Be._getStatsigGlobal)();return kt?vt.instances&&vt.instances[kt]:(vt.instances&&Object.keys(vt.instances).length>1&&nt.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),vt.firstInstance)};Be._getInstance=gt;const At="__STATSIG__",xt=typeof window<"u"?window:{},Et=typeof commonjsGlobal<"u"?commonjsGlobal:{},yt=typeof globalThis<"u"?globalThis:{},Ct=(tt=(Ye=(Le=xt[At])!==null&&Le!==void 0?Le:Et[At])!==null&&Ye!==void 0?Ye:yt[At])!==null&&tt!==void 0?tt:{instance:Be._getInstance};xt[At]=Ct,Et[At]=Ct,yt[At]=Ct}($_StatsigGlobal);var Diagnostics={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Diagnostics=void 0;const Le=new Map,Ye="start",tt="end",nt="statsig::diagnostics";Be.Diagnostics={_getMarkers:xt=>Le.get(xt),_markInitOverallStart:xt=>{gt(xt,ft({},Ye,"overall"))},_markInitOverallEnd:(xt,Et,yt)=>{gt(xt,ft({success:Et,error:Et?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:yt},tt,"overall"))},_markInitNetworkReqStart:(xt,Et)=>{gt(xt,ft(Et,Ye,"initialize","network_request"))},_markInitNetworkReqEnd:(xt,Et)=>{gt(xt,ft(Et,tt,"initialize","network_request"))},_markInitProcessStart:xt=>{gt(xt,ft({},Ye,"initialize","process"))},_markInitProcessEnd:(xt,Et)=>{gt(xt,ft(Et,tt,"initialize","process"))},_clearMarkers:xt=>{Le.delete(xt)},_formatError(xt){if(xt&&typeof xt=="object")return{code:At(xt,"code"),name:At(xt,"name"),message:At(xt,"message")}},_getDiagnosticsData(xt,Et,yt,Ct){var kt;return{success:(xt==null?void 0:xt.ok)===!0,statusCode:xt==null?void 0:xt.status,sdkRegion:(kt=xt==null?void 0:xt.headers)===null||kt===void 0?void 0:kt.get("x-statsig-region"),isDelta:yt.includes('"is_delta":true')===!0?!0:void 0,attempt:Et,error:Be.Diagnostics._formatError(Ct)}},_enqueueDiagnosticsEvent(xt,Et,yt,Ct){const kt=Be.Diagnostics._getMarkers(yt);if(kt==null||kt.length<=0)return-1;const vt=kt[kt.length-1].timestamp-kt[0].timestamp;Be.Diagnostics._clearMarkers(yt);const bt=ht(xt,{context:"initialize",markers:kt.slice(),statsigOptions:Ct});return Et.enqueue(bt),vt}};function ft(xt,Et,yt,Ct){return Object.assign({key:yt,action:Et,step:Ct,timestamp:Date.now()},xt)}function ht(xt,Et){return{eventName:nt,user:xt,value:null,metadata:Et,time:Date.now()}}function gt(xt,Et){var yt;const Ct=(yt=Le.get(xt))!==null&&yt!==void 0?yt:[];Ct.push(Et),Le.set(xt,Ct)}function At(xt,Et){if(Et in xt)return xt[Et]}})(Diagnostics);var EventLogger$1={},CacheKey={},Hashing={},TypingUtils={};Object.defineProperty(TypingUtils,"__esModule",{value:!0}),TypingUtils._isTypeMatch=TypingUtils._typeOf=void 0;function _typeOf(Be){return Array.isArray(Be)?"array":typeof Be}TypingUtils._typeOf=_typeOf;function _isTypeMatch(Be,Le){const Ye=tt=>Array.isArray(tt)?"array":tt===null?"null":typeof tt;return Ye(Be)===Ye(Le)}TypingUtils._isTypeMatch=_isTypeMatch,function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getSortedObject=Be._DJB2Object=Be._DJB2=void 0;const Le=TypingUtils,Ye=ft=>{let ht=0;for(let gt=0;gt<ft.length;gt++){const At=ft.charCodeAt(gt);ht=(ht<<5)-ht+At,ht=ht&ht}return String(ht>>>0)};Be._DJB2=Ye;const tt=(ft,ht)=>(0,Be._DJB2)(JSON.stringify((0,Be._getSortedObject)(ft,ht)));Be._DJB2Object=tt;const nt=(ft,ht)=>{if(ft==null)return null;const gt=Object.keys(ft).sort(),At={};return gt.forEach(xt=>{const Et=ft[xt];if(ht===0||(0,Le._typeOf)(Et)!=="object"){At[xt]=Et;return}At[xt]=(0,Be._getSortedObject)(Et,ht!=null?ht-1:ht)}),At};Be._getSortedObject=nt}(Hashing),Object.defineProperty(CacheKey,"__esModule",{value:!0}),CacheKey._getStorageKey=CacheKey._getUserStorageKey=void 0;const Hashing_1$4=Hashing;function _getUserStorageKey(Be,Le,Ye){var tt;if(Ye)return Ye(Be,Le);const nt=Le&&Le.customIDs?Le.customIDs:{},ft=[`uid:${(tt=Le==null?void 0:Le.userID)!==null&&tt!==void 0?tt:""}`,`cids:${Object.keys(nt).sort((ht,gt)=>ht.localeCompare(gt)).map(ht=>`${ht}-${nt[ht]}`).join(",")}`,`k:${Be}`];return(0,Hashing_1$4._DJB2)(ft.join("|"))}CacheKey._getUserStorageKey=_getUserStorageKey;function _getStorageKey(Be,Le,Ye){return Le?_getUserStorageKey(Be,Le,Ye):(0,Hashing_1$4._DJB2)(`k:${Be}`)}CacheKey._getStorageKey=_getStorageKey;var NetworkConfig={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.NetworkParam=Be.NetworkDefault=Be.Endpoint=void 0,Be.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},Be.NetworkDefault={[Be.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[Be.Endpoint._initialize]:"https://featureassets.org/v1",[Be.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},Be.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}})(NetworkConfig);var SafeJs={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getUnloadEvent=Be._getCurrentPageUrlSafe=Be._addDocumentEventListenerSafe=Be._addWindowEventListenerSafe=Be._isServerEnv=Be._getDocumentSafe=Be._getWindowSafe=void 0;const Le=()=>typeof window<"u"?window:null;Be._getWindowSafe=Le;const Ye=()=>{var At;const xt=(0,Be._getWindowSafe)();return(At=xt==null?void 0:xt.document)!==null&&At!==void 0?At:null};Be._getDocumentSafe=Ye;const tt=()=>{if((0,Be._getDocumentSafe)()!==null)return!1;const At=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||At};Be._isServerEnv=tt;const nt=(At,xt)=>{const Et=(0,Be._getWindowSafe)();typeof(Et==null?void 0:Et.addEventListener)=="function"&&Et.addEventListener(At,xt)};Be._addWindowEventListenerSafe=nt;const ft=(At,xt)=>{const Et=(0,Be._getDocumentSafe)();typeof(Et==null?void 0:Et.addEventListener)=="function"&&Et.addEventListener(At,xt)};Be._addDocumentEventListenerSafe=ft;const ht=()=>{var At;try{return(At=(0,Be._getWindowSafe)())===null||At===void 0?void 0:At.location.href.split(/[?#]/)[0]}catch{return}};Be._getCurrentPageUrlSafe=ht;const gt=()=>{const At=(0,Be._getWindowSafe)();return At&&"onpagehide"in At?"pagehide":"beforeunload"};Be._getUnloadEvent=gt})(SafeJs);var StatsigEvent={};Object.defineProperty(StatsigEvent,"__esModule",{value:!0}),StatsigEvent._createLayerParameterExposure=StatsigEvent._createConfigExposure=StatsigEvent._mapExposures=StatsigEvent._createGateExposure=StatsigEvent._isExposureEvent=void 0;const CONFIG_EXPOSURE_NAME="statsig::config_exposure",GATE_EXPOSURE_NAME="statsig::gate_exposure",LAYER_EXPOSURE_NAME="statsig::layer_exposure",_createExposure=(Be,Le,Ye,tt,nt)=>(Ye.bootstrapMetadata&&(tt.bootstrapMetadata=Ye.bootstrapMetadata),{eventName:Be,user:Le,value:null,metadata:_addEvaluationDetailsToMetadata(Ye,tt),secondaryExposures:nt,time:Date.now()}),_isExposureEvent=({eventName:Be})=>Be===GATE_EXPOSURE_NAME||Be===CONFIG_EXPOSURE_NAME||Be===LAYER_EXPOSURE_NAME;StatsigEvent._isExposureEvent=_isExposureEvent;const _createGateExposure=(Be,Le,Ye)=>{var tt,nt,ft;const ht={gate:Le.name,gateValue:String(Le.value),ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(ht.configVersion=Le.__evaluation.version),_createExposure(GATE_EXPOSURE_NAME,Be,Le.details,ht,_mapExposures((ft=(nt=Le.__evaluation)===null||nt===void 0?void 0:nt.secondary_exposures)!==null&&ft!==void 0?ft:[],Ye))};StatsigEvent._createGateExposure=_createGateExposure;function _mapExposures(Be,Le){return Be.map(Ye=>typeof Ye=="string"?(Le??{})[Ye]:Ye).filter(Ye=>Ye!=null)}StatsigEvent._mapExposures=_mapExposures;const _createConfigExposure=(Be,Le,Ye)=>{var tt,nt,ft,ht;const gt={config:Le.name,ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(gt.configVersion=Le.__evaluation.version),((nt=Le.__evaluation)===null||nt===void 0?void 0:nt.passed)!=null&&(gt.rulePassed=String(Le.__evaluation.passed)),_createExposure(CONFIG_EXPOSURE_NAME,Be,Le.details,gt,_mapExposures((ht=(ft=Le.__evaluation)===null||ft===void 0?void 0:ft.secondary_exposures)!==null&&ht!==void 0?ht:[],Ye))};StatsigEvent._createConfigExposure=_createConfigExposure;const _createLayerParameterExposure=(Be,Le,Ye,tt)=>{var nt,ft,ht,gt,At,xt,Et;const yt=Le.__evaluation,Ct=((nt=yt==null?void 0:yt.explicit_parameters)===null||nt===void 0?void 0:nt.includes(Ye))===!0;let kt="",vt=(ft=yt==null?void 0:yt.undelegated_secondary_exposures)!==null&&ft!==void 0?ft:[];Ct&&(kt=(ht=yt.allocated_experiment_name)!==null&&ht!==void 0?ht:"",vt=(gt=yt.secondary_exposures)!==null&>!==void 0?gt:[]);const bt=(At=Le.__evaluation)===null||At===void 0?void 0:At.parameter_rule_ids,It={config:Le.name,parameterName:Ye,ruleID:(xt=bt==null?void 0:bt[Ye])!==null&&xt!==void 0?xt:Le.ruleID,allocatedExperiment:kt,isExplicitParameter:String(Ct)};return((Et=Le.__evaluation)===null||Et===void 0?void 0:Et.version)!=null&&(It.configVersion=Le.__evaluation.version),_createExposure(LAYER_EXPOSURE_NAME,Be,Le.details,It,_mapExposures(vt,tt))};StatsigEvent._createLayerParameterExposure=_createLayerParameterExposure;const _addEvaluationDetailsToMetadata=(Be,Le)=>(Le.reason=Be.reason,Be.lcut&&(Le.lcut=String(Be.lcut)),Be.receivedAt&&(Le.receivedAt=String(Be.receivedAt)),Le);var StatsigOptionsCommon={};Object.defineProperty(StatsigOptionsCommon,"__esModule",{value:!0}),StatsigOptionsCommon.LoggingEnabledOption=StatsigOptionsCommon.LogEventCompressionMode=void 0,StatsigOptionsCommon.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},StatsigOptionsCommon.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"};var StorageProvider={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._setObjectInStorage=Be._getObjectFromStorage=Be.Storage=void 0;const Le=Log,Ye=SafeJs,tt={},nt={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:yt=>tt[yt]?tt[yt]:null,setItem:(yt,Ct)=>{tt[yt]=Ct},removeItem:yt=>{delete tt[yt]},getAllKeys:()=>Object.keys(tt)};let ft=null;try{const yt=(0,Ye._getWindowSafe)();yt&&yt.localStorage&&typeof yt.localStorage.getItem=="function"&&(ft={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:Ct=>yt.localStorage.getItem(Ct),setItem:(Ct,kt)=>yt.localStorage.setItem(Ct,kt),removeItem:Ct=>yt.localStorage.removeItem(Ct),getAllKeys:()=>Object.keys(yt.localStorage)})}catch{Le.Log.warn("Failed to setup localStorageProvider.")}let ht=ft??nt,gt=ht;function At(yt){try{return yt()}catch(Ct){if(Ct instanceof Error&&Ct.name==="SecurityError")return Be.Storage._setProvider(nt),null;throw Ct}}Be.Storage={isReady:()=>gt.isReady(),isReadyResolver:()=>gt.isReadyResolver(),getProviderName:()=>gt.getProviderName(),getItem:yt=>At(()=>gt.getItem(yt)),setItem:(yt,Ct)=>At(()=>gt.setItem(yt,Ct)),removeItem:yt=>gt.removeItem(yt),getAllKeys:()=>gt.getAllKeys(),_setProvider:yt=>{ht=yt,gt=yt},_setDisabled:yt=>{yt?gt=nt:gt=ht}};function xt(yt){const Ct=Be.Storage.getItem(yt);return JSON.parse(Ct??"null")}Be._getObjectFromStorage=xt;function Et(yt,Ct){Be.Storage.setItem(yt,JSON.stringify(Ct))}Be._setObjectInStorage=Et})(StorageProvider);var UrlConfiguration$1={};Object.defineProperty(UrlConfiguration$1,"__esModule",{value:!0}),UrlConfiguration$1.UrlConfiguration=void 0;const Hashing_1$3=Hashing,NetworkConfig_1$2=NetworkConfig,ENDPOINT_DNS_KEY_MAP={[NetworkConfig_1$2.Endpoint._initialize]:"i",[NetworkConfig_1$2.Endpoint._rgstr]:"e",[NetworkConfig_1$2.Endpoint._download_config_specs]:"d"};class UrlConfiguration{constructor(Le,Ye,tt,nt){this.customUrl=null,this.fallbackUrls=null,this.endpoint=Le,this.endpointDnsKey=ENDPOINT_DNS_KEY_MAP[Le],Ye&&(this.customUrl=Ye),!Ye&&tt&&(this.customUrl=tt.endsWith("/")?`${tt}${Le}`:`${tt}/${Le}`),nt&&(this.fallbackUrls=nt);const ft=NetworkConfig_1$2.NetworkDefault[Le];this.defaultUrl=`${ft}/${Le}`}getUrl(){var Le;return(Le=this.customUrl)!==null&&Le!==void 0?Le:this.defaultUrl}getChecksum(){var Le;const Ye=((Le=this.fallbackUrls)!==null&&Le!==void 0?Le:[]).sort().join(",");return(0,Hashing_1$3._DJB2)(this.customUrl+Ye)}}UrlConfiguration$1.UrlConfiguration=UrlConfiguration;var VisibilityObserving={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._notifyVisibilityChanged=Be._subscribeToVisiblityChanged=Be._isUnloading=Be._isCurrentlyVisible=void 0;const Le=SafeJs,Ye="foreground",tt="background",nt=[];let ft=Ye,ht=!1;const gt=()=>ft===Ye;Be._isCurrentlyVisible=gt;const At=()=>ht;Be._isUnloading=At;const xt=yt=>{nt.unshift(yt)};Be._subscribeToVisiblityChanged=xt;const Et=yt=>{yt!==ft&&(ft=yt,nt.forEach(Ct=>Ct(yt)))};Be._notifyVisibilityChanged=Et,(0,Le._addWindowEventListenerSafe)("focus",()=>{ht=!1,(0,Be._notifyVisibilityChanged)(Ye)}),(0,Le._addWindowEventListenerSafe)("blur",()=>(0,Be._notifyVisibilityChanged)(tt)),(0,Le._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,Be._notifyVisibilityChanged)(document.visibilityState==="visible"?Ye:tt)}),(0,Le._addWindowEventListenerSafe)((0,Le._getUnloadEvent)(),()=>{ht=!0,(0,Be._notifyVisibilityChanged)(tt)})})(VisibilityObserving);var __awaiter$f=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(EventLogger$1,"__esModule",{value:!0}),EventLogger$1.EventLogger=void 0;const CacheKey_1$1=CacheKey,Hashing_1$2=Hashing,Log_1$8=Log,NetworkConfig_1$1=NetworkConfig,SafeJs_1$3=SafeJs,StatsigEvent_1=StatsigEvent,StatsigOptionsCommon_1$2=StatsigOptionsCommon,StorageProvider_1$4=StorageProvider,UrlConfiguration_1=UrlConfiguration$1,VisibilityObserving_1$1=VisibilityObserving,DEFAULT_QUEUE_SIZE=100,DEFAULT_FLUSH_INTERVAL_MS=1e4,MAX_DEDUPER_KEYS=1e3,DEDUPER_WINDOW_DURATION_MS=6e5,MAX_FAILED_LOGS=500,QUICK_FLUSH_WINDOW_MS=200,EVENT_LOGGER_MAP={},RetryFailedLogsTrigger={Startup:"startup",GainedFocus:"gained_focus"};class EventLogger{static _safeFlushAndForget(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye.flush().catch(()=>{})}static _safeRetryFailedLogs(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus)}constructor(Le,Ye,tt,nt){var ft,ht;this._sdkKey=Le,this._emitter=Ye,this._network=tt,this._options=nt,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=(ft=nt==null?void 0:nt.loggingEnabled)!==null&&ft!==void 0?ft:(nt==null?void 0:nt.disableLogging)===!0?StatsigOptionsCommon_1$2.LoggingEnabledOption.disabled:StatsigOptionsCommon_1$2.LoggingEnabledOption.browserOnly,nt!=null&&nt.loggingEnabled&&nt.disableLogging!==void 0&&Log_1$8.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=(ht=nt==null?void 0:nt.loggingBufferMaxSize)!==null&&ht!==void 0?ht:DEFAULT_QUEUE_SIZE;const gt=nt==null?void 0:nt.networkConfig;this._logEventUrlConfig=new UrlConfiguration_1.UrlConfiguration(NetworkConfig_1$1.Endpoint._rgstr,gt==null?void 0:gt.logEventUrl,gt==null?void 0:gt.api,gt==null?void 0:gt.logEventFallbackUrls)}setLogEventCompressionMode(Le){this._network.setLogEventCompressionMode(Le)}setLoggingEnabled(Le){if(this._loggingEnabled==="disabled"&&Le!=="disabled"){const Ye=this._getStorageKey(),tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);tt&&this._queue.push(...tt),StorageProvider_1$4.Storage.removeItem(Ye)}this._loggingEnabled=Le}enqueue(Le){this._shouldLogEvent(Le)&&(this._normalizeAndAppendEvent(Le),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&EventLogger._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(Le){var Ye;const tt=(Ye=this._nonExposedChecks[Le])!==null&&Ye!==void 0?Ye:0;this._nonExposedChecks[Le]=tt+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var Le;const Ye=(0,SafeJs_1$3._isServerEnv)();Ye&&((Le=this._options)===null||Le===void 0?void 0:Le.loggingEnabled)!=="always"||(EVENT_LOGGER_MAP[this._sdkKey]=this,Ye||(0,VisibilityObserving_1$1._subscribeToVisiblityChanged)(tt=>{tt==="background"?EventLogger._safeFlushAndForget(this._sdkKey):tt==="foreground"&&EventLogger._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(RetryFailedLogsTrigger.Startup),this._startBackgroundFlushInterval())}stop(){return __awaiter$f(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete EVENT_LOGGER_MAP[this._sdkKey],yield this.flush()})}flush(){return __awaiter$f(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;const Le=this._queue;this._queue=[],yield this._sendEvents(Le)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>QUICK_FLUSH_WINDOW_MS)&&setTimeout(()=>EventLogger._safeFlushAndForget(this._sdkKey),QUICK_FLUSH_WINDOW_MS))}_shouldLogEvent(Le){var Ye;if(((Ye=this._options)===null||Ye===void 0?void 0:Ye.loggingEnabled)!=="always"&&(0,SafeJs_1$3._isServerEnv)())return!1;if(!(0,StatsigEvent_1._isExposureEvent)(Le))return!0;const tt=Le.user?Le.user:{statsigEnvironment:void 0},nt=(0,CacheKey_1$1._getUserStorageKey)(this._sdkKey,tt),ft=Le.metadata?Le.metadata:{},ht=[Le.eventName,nt,ft.gate,ft.config,ft.ruleID,ft.allocatedExperiment,ft.parameterName,String(ft.isExplicitParameter),ft.reason].join("|"),gt=this._lastExposureTimeMap[ht],At=Date.now();return gt&&At-gt<DEDUPER_WINDOW_DURATION_MS?!1:(Object.keys(this._lastExposureTimeMap).length>MAX_DEDUPER_KEYS&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[ht]=At,!0)}_sendEvents(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye,tt;if(this._loggingEnabled==="disabled")return this._saveFailedLogsToStorage(Le),!1;try{const ft=(0,VisibilityObserving_1$1._isUnloading)()&&this._network.isBeaconSupported()&&((tt=(Ye=this._options)===null||Ye===void 0?void 0:Ye.networkConfig)===null||tt===void 0?void 0:tt.networkOverrideFunc)==null;return this._emitter({name:"pre_logs_flushed",events:Le}),(ft?this._sendEventsViaBeacon(Le):yield this._sendEventsViaPost(Le)).success?(this._emitter({name:"logs_flushed",events:Le}),!0):(Log_1$8.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(Le),!1)}catch{return Log_1$8.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye;const tt=yield this._network.post(this._getRequestData(Le)),nt=(Ye=tt==null?void 0:tt.code)!==null&&Ye!==void 0?Ye:-1;return{success:nt>=200&&nt<300}})}_sendEventsViaBeacon(Le){return{success:this._network.beacon(this._getRequestData(Le))}}_getRequestData(Le){return{sdkKey:this._sdkKey,data:{events:Le},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[NetworkConfig_1$1.NetworkParam.EventCount]:String(Le.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(Le){for(;Le.length>MAX_FAILED_LOGS;)Le.shift();const Ye=this._getStorageKey();try{const tt=this._getFailedLogsFromStorage(Ye);(0,StorageProvider_1$4._setObjectInStorage)(Ye,[...tt,...Le])}catch{Log_1$8.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(Le){let Ye=[];try{const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Le);return Array.isArray(tt)&&(Ye=tt),Ye}catch{return[]}}_retryFailedLogs(Le){const Ye=this._getStorageKey();__awaiter$f(this,void 0,void 0,function*(){StorageProvider_1$4.Storage.isReady()||(yield StorageProvider_1$4.Storage.isReadyResolver());const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);if(!tt)return;Le===RetryFailedLogsTrigger.Startup&&StorageProvider_1$4.Storage.removeItem(Ye),(yield this._sendEvents(tt))&&Le===RetryFailedLogsTrigger.GainedFocus&&StorageProvider_1$4.Storage.removeItem(Ye)}).catch(()=>{Log_1$8.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,Hashing_1$2._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(Le){Le.user&&(Le.user=Object.assign({},Le.user),delete Le.user.privateAttributes);const Ye={},tt=this._getCurrentPageUrl();tt&&(Ye.statsigMetadata={currentPage:tt});const nt=Object.assign(Object.assign({},Le),Ye);Log_1$8.Log.debug("Enqueued Event:",nt),this._queue.push(nt)}_appendAndResetNonExposedChecks(){Object.keys(this._nonExposedChecks).length!==0&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var Le;if(((Le=this._options)===null||Le===void 0?void 0:Le.includeCurrentPageUrlWithEvents)!==!1)return(0,SafeJs_1$3._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var Le,Ye;const tt=(Ye=(Le=this._options)===null||Le===void 0?void 0:Le.loggingIntervalMs)!==null&&Ye!==void 0?Ye:DEFAULT_FLUSH_INTERVAL_MS,nt=setInterval(()=>{const ft=EVENT_LOGGER_MAP[this._sdkKey];!ft||ft._flushIntervalId!==nt?clearInterval(nt):EventLogger._safeFlushAndForget(this._sdkKey)},tt);this._flushIntervalId=nt}}EventLogger$1.EventLogger=EventLogger;var StatsigMetadata={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigMetadataProvider=Be.SDK_VERSION=void 0,Be.SDK_VERSION="3.28.1";let Le={sdkVersion:Be.SDK_VERSION,sdkType:"js-mono"};Be.StatsigMetadataProvider={get:()=>Le,add:Ye=>{Le=Object.assign(Object.assign({},Le),Ye)}}})(StatsigMetadata);var ClientInterfaces={};Object.defineProperty(ClientInterfaces,"__esModule",{value:!0});var DataAdapterCore$1={},StableID={},UUID={};Object.defineProperty(UUID,"__esModule",{value:!0}),UUID.getUUID=void 0;function getUUID(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let Be=new Date().getTime(),Le=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,tt=>{let nt=Math.random()*16;return Be>0?(nt=(Be+nt)%16|0,Be=Math.floor(Be/16)):(nt=(Le+nt)%16|0,Le=Math.floor(Le/16)),(tt==="x"?nt:nt&7|8).toString(16)})}UUID.getUUID=getUUID,Object.defineProperty(StableID,"__esModule",{value:!0}),StableID.getCookieName=StableID.StableID=void 0;const CacheKey_1=CacheKey,Log_1$7=Log,SafeJs_1$2=SafeJs,StorageProvider_1$3=StorageProvider,UUID_1=UUID,PROMISE_MAP={},COOKIE_ENABLED_MAP={},DISABLED_MAP={};StableID.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:Be=>{if(DISABLED_MAP[Be])return null;if(PROMISE_MAP[Be]!=null)return PROMISE_MAP[Be];let Le=null;return Le=_loadFromCookie(Be),Le!=null?(PROMISE_MAP[Be]=Le,_persistToStorage(Le,Be),Le):(Le=_loadFromStorage(Be),Le==null&&(Le=(0,UUID_1.getUUID)()),_persistToStorage(Le,Be),_persistToCookie(Le,Be),PROMISE_MAP[Be]=Le,Le)},setOverride:(Be,Le)=>{PROMISE_MAP[Le]=Be,_persistToStorage(Be,Le),_persistToCookie(Be,Le)},_setCookiesEnabled:(Be,Le)=>{COOKIE_ENABLED_MAP[Be]=Le},_setDisabled:(Be,Le)=>{DISABLED_MAP[Be]=Le}};function _getStableIDStorageKey(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}function _persistToStorage(Be,Le){const Ye=_getStableIDStorageKey(Le);try{(0,StorageProvider_1$3._setObjectInStorage)(Ye,Be)}catch{Log_1$7.Log.warn("Failed to save StableID to storage")}}function _loadFromStorage(Be){const Le=_getStableIDStorageKey(Be);return(0,StorageProvider_1$3._getObjectFromStorage)(Le)}function _loadFromCookie(Be){if(!COOKIE_ENABLED_MAP[Be]||(0,SafeJs_1$2._getDocumentSafe)()==null)return null;const Le=document.cookie.split(";");for(const Ye of Le){const[tt,nt]=Ye.trim().split("=");if(tt===getCookieName(Be))return decodeURIComponent(nt)}return null}function _persistToCookie(Be,Le){if(!COOKIE_ENABLED_MAP[Le]||(0,SafeJs_1$2._getDocumentSafe)()==null)return;const Ye=new Date;Ye.setFullYear(Ye.getFullYear()+1),document.cookie=`${getCookieName(Le)}=${encodeURIComponent(Be)}; expires=${Ye.toUTCString()}; path=/`}function getCookieName(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}StableID.getCookieName=getCookieName;var StatsigUser={};Object.defineProperty(StatsigUser,"__esModule",{value:!0}),StatsigUser._getFullUserHash=StatsigUser._normalizeUser=void 0;const Hashing_1$1=Hashing,Log_1$6=Log;function _normalizeUser(Be,Le,Ye){try{const tt=JSON.parse(JSON.stringify(Be));return Le!=null&&Le.environment!=null?tt.statsigEnvironment=Le.environment:Ye!=null&&(tt.statsigEnvironment={tier:Ye}),tt}catch{return Log_1$6.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}}StatsigUser._normalizeUser=_normalizeUser;function _getFullUserHash(Be){return Be?(0,Hashing_1$1._DJB2Object)(Be):null}StatsigUser._getFullUserHash=_getFullUserHash;var TypedJsonParse={};Object.defineProperty(TypedJsonParse,"__esModule",{value:!0}),TypedJsonParse._typedJsonParse=void 0;const Log_1$5=Log;function _typedJsonParse(Be,Le,Ye){try{const tt=JSON.parse(Be);if(tt&&typeof tt=="object"&&Le in tt)return tt}catch{}return Log_1$5.Log.error(`Failed to parse ${Ye}`),null}TypedJsonParse._typedJsonParse=_typedJsonParse;var __awaiter$e=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DataAdapterCore$1,"__esModule",{value:!0}),DataAdapterCore$1._makeDataAdapterResult=DataAdapterCore$1.DataAdapterCore=void 0;const Log_1$4=Log,StableID_1$2=StableID,StatsigUser_1=StatsigUser,StorageProvider_1$2=StorageProvider,TypedJsonParse_1=TypedJsonParse,CACHE_LIMIT=10,MAX_CACHE_WRITE_ATTEMPTS=8;class DataAdapterCore{constructor(Le,Ye){this._adapterName=Le,this._cacheSuffix=Ye,this._options=null,this._sdkKey=null,this._cacheLimit=CACHE_LIMIT,this._lastModifiedStoreKey=`statsig.last_modified_time.${Ye}`,this._inMemoryCache=new InMemoryCache}attach(Le,Ye,tt){this._sdkKey=Le,this._options=Ye}getDataSync(Le){const Ye=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),tt=this._getCacheKey(Ye),nt=this._inMemoryCache.get(tt,Ye);if(nt&&this._getIsCacheValueValid(nt))return nt;const ft=this._loadFromCache(tt);return ft&&this._getIsCacheValueValid(ft)?(this._inMemoryCache.add(tt,ft,this._cacheLimit),this._inMemoryCache.get(tt,Ye)):null}setData(Le,Ye){const tt=Ye&&(0,StatsigUser_1._normalizeUser)(Ye,this._options),nt=this._getCacheKey(tt);this._inMemoryCache.add(nt,_makeDataAdapterResult("Bootstrap",Le,null,tt),this._cacheLimit)}_getIsCacheValueValid(Le){return Le.stableID==null||Le.stableID===StableID_1$2.StableID.get(this._getSdkKey())}_getDataAsyncImpl(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){StorageProvider_1$2.Storage.isReady()||(yield StorageProvider_1$2.Storage.isReadyResolver());const nt=Le??this.getDataSync(Ye),ft=[this._fetchAndPrepFromNetwork(nt,Ye,tt)];return tt!=null&&tt.timeoutMs&&ft.push(new Promise(ht=>setTimeout(ht,tt.timeoutMs)).then(()=>(Log_1$4.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(ft)})}_prefetchDataImpl(Le,Ye){return __awaiter$e(this,void 0,void 0,function*(){const tt=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),nt=this._getCacheKey(tt),ft=yield this._getDataAsyncImpl(null,tt,Ye);ft&&this._inMemoryCache.add(nt,Object.assign(Object.assign({},ft),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){var nt;const ft=(nt=Le==null?void 0:Le.data)!==null&&nt!==void 0?nt:null,ht=Le!=null&&this._isCachedResultValidFor204(Le,Ye),gt=yield this._fetchFromNetwork(ft,Ye,tt,ht);if(!gt)return Log_1$4.Log.debug("No response returned for latest value"),null;const At=(0,TypedJsonParse_1._typedJsonParse)(gt,"has_updates","Response"),xt=this._getSdkKey(),Et=StableID_1$2.StableID.get(xt);let yt=null;if((At==null?void 0:At.has_updates)===!0)yt=_makeDataAdapterResult("Network",gt,Et,Ye);else if(ft&&(At==null?void 0:At.has_updates)===!1)yt=_makeDataAdapterResult("NetworkNotModified",ft,Et,Ye);else return null;const Ct=this._getCacheKey(Ye);return this._inMemoryCache.add(Ct,yt,this._cacheLimit),this._writeToCache(Ct,yt),yt})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(Log_1$4.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(Le){var Ye;const tt=(Ye=StorageProvider_1$2.Storage.getItem)===null||Ye===void 0?void 0:Ye.call(StorageProvider_1$2.Storage,Le);if(tt==null)return null;const nt=(0,TypedJsonParse_1._typedJsonParse)(tt,"source","Cached Result");return nt?Object.assign(Object.assign({},nt),{source:"Cache"}):null}_writeToCache(Le,Ye){const tt=JSON.stringify(Ye);for(let nt=0;nt<MAX_CACHE_WRITE_ATTEMPTS;nt++)try{StorageProvider_1$2.Storage.setItem(Le,tt);break}catch(ft){if(!(ft instanceof Error)||!(ft.toString().includes("QuotaExceededError")||ft.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw ft;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(Le,this._cacheLimit-1)}this._runLocalStorageCacheEviction(Le)}_runLocalStorageCacheEviction(Le,Ye=this._cacheLimit){var tt;const nt=(tt=(0,StorageProvider_1$2._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&tt!==void 0?tt:{};nt[Le]=Date.now();const ft=_getEvictableKeys(nt,Ye);for(const ht of ft)delete nt[ht],StorageProvider_1$2.Storage.removeItem(ht);(0,StorageProvider_1$2._setObjectInStorage)(this._lastModifiedStoreKey,nt)}}DataAdapterCore$1.DataAdapterCore=DataAdapterCore;function _makeDataAdapterResult(Be,Le,Ye,tt){return{source:Be,data:Le,receivedAt:Date.now(),stableID:Ye,fullUserHash:(0,StatsigUser_1._getFullUserHash)(tt)}}DataAdapterCore$1._makeDataAdapterResult=_makeDataAdapterResult;class InMemoryCache{constructor(){this._data={}}get(Le,Ye){var tt;const nt=this._data[Le],ft=nt==null?void 0:nt.stableID,ht=(tt=Ye==null?void 0:Ye.customIDs)===null||tt===void 0?void 0:tt.stableID;return ht&&ft&&ht!==ft?(Log_1$4.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):nt}add(Le,Ye,tt){const nt=_getEvictableKeys(this._data,tt-1);for(const ft of nt)delete this._data[ft];this._data[Le]=Ye}merge(Le){this._data=Object.assign(Object.assign({},this._data),Le)}}function _getEvictableKeys(Be,Le){const Ye=Object.keys(Be);return Ye.length<=Le?[]:Le===0?Ye:Ye.sort((tt,nt)=>{const ft=Be[tt],ht=Be[nt];return typeof ft=="object"&&typeof ht=="object"?ft.receivedAt-ht.receivedAt:ft-ht}).slice(0,Ye.length-Le)}var DownloadConfigSpecsResponse={};Object.defineProperty(DownloadConfigSpecsResponse,"__esModule",{value:!0});var ErrorBoundary={},SDKType={};Object.defineProperty(SDKType,"__esModule",{value:!0}),SDKType.SDKType=void 0;const SDK_CLIENT={};let suffix;SDKType.SDKType={_get:Be=>{var Le;return((Le=SDK_CLIENT[Be])!==null&&Le!==void 0?Le:"js-mono")+(suffix??"")},_setClientType(Be,Le){SDK_CLIENT[Be]=Le},_setBindingType(Be){(!suffix||suffix==="-react")&&(suffix="-"+Be)}},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__awaiter||function(yt,Ct,kt,vt){function bt(It){return It instanceof kt?It:new kt(function(wt){wt(It)})}return new(kt||(kt=Promise))(function(It,wt){function Rt(Dt){try{Bt(vt.next(Dt))}catch(Pt){wt(Pt)}}function Tt(Dt){try{Bt(vt.throw(Dt))}catch(Pt){wt(Pt)}}function Bt(Dt){Dt.done?It(Dt.value):bt(Dt.value).then(Rt,Tt)}Bt((vt=vt.apply(yt,Ct||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.ErrorBoundary=Be.EXCEPTION_ENDPOINT=void 0;const Ye=Log,tt=SDKType,nt=StatsigMetadata;Be.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const ft="[Statsig] UnknownError";class ht{constructor(Ct,kt,vt,bt){this._sdkKey=Ct,this._options=kt,this._emitter=vt,this._lastSeenError=bt,this._seen=new Set}wrap(Ct,kt){try{const vt=Ct;xt(vt).forEach(bt=>{const It=vt[bt];"$EB"in It||(vt[bt]=(...wt)=>this._capture(kt?`${kt}:${bt}`:bt,()=>It.apply(Ct,wt)),vt[bt].$EB=!0)})}catch(vt){this._onError("eb:wrap",vt)}}logError(Ct,kt){this._onError(Ct,kt)}getLastSeenErrorAndReset(){const Ct=this._lastSeenError;return this._lastSeenError=void 0,Ct??null}attachErrorIfNoneExists(Ct){this._lastSeenError||(this._lastSeenError=gt(Ct))}_capture(Ct,kt){try{const vt=kt();return vt&&vt instanceof Promise?vt.catch(bt=>this._onError(Ct,bt)):vt}catch(vt){return this._onError(Ct,vt),null}}_onError(Ct,kt){try{Ye.Log.warn(`Caught error in ${Ct}`,{error:kt}),Le(this,void 0,void 0,function*(){var bt,It,wt,Rt,Tt,Bt,Dt;const Pt=kt||Error(ft),Nt=Pt instanceof Error,Lt=Nt?Pt.name:"No Name",Wt=gt(Pt);if(this._lastSeenError=Wt,this._seen.has(Lt))return;if(this._seen.add(Lt),!((It=(bt=this._options)===null||bt===void 0?void 0:bt.networkConfig)===null||It===void 0)&&It.preventAllNetworkTraffic){(wt=this._emitter)===null||wt===void 0||wt.call(this,{name:"error",error:kt,tag:Ct});return}const $t=tt.SDKType._get(this._sdkKey),Kt=nt.StatsigMetadataProvider.get(),Vt=Nt?Pt.stack:At(Pt),Ut=Object.assign({tag:Ct,exception:Lt,info:Vt,statsigOptions:Et(this._options)},Object.assign(Object.assign({},Kt),{sdkType:$t}));yield((Bt=(Tt=(Rt=this._options)===null||Rt===void 0?void 0:Rt.networkConfig)===null||Tt===void 0?void 0:Tt.networkOverrideFunc)!==null&&Bt!==void 0?Bt:fetch)(Be.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String($t),"STATSIG-SDK-VERSION":String(Kt.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(Ut)}),(Dt=this._emitter)===null||Dt===void 0||Dt.call(this,{name:"error",error:kt,tag:Ct})}).then(()=>{}).catch(()=>{})}catch{}}}Be.ErrorBoundary=ht;function gt(yt){return yt instanceof Error?yt:typeof yt=="string"?new Error(yt):new Error("An unknown error occurred.")}function At(yt){try{return JSON.stringify(yt)}catch{return ft}}function xt(yt){const Ct=new Set;let kt=Object.getPrototypeOf(yt);for(;kt&&kt!==Object.prototype;)Object.getOwnPropertyNames(kt).filter(vt=>typeof(kt==null?void 0:kt[vt])=="function").forEach(vt=>Ct.add(vt)),kt=Object.getPrototypeOf(kt);return Array.from(Ct)}function Et(yt){if(!yt)return{};const Ct={};return Object.keys(yt).forEach(kt=>{const vt=kt,bt=yt[vt];switch(typeof bt){case"number":case"bigint":case"boolean":Ct[String(vt)]=bt;break;case"string":bt.length<50?Ct[String(vt)]=bt:Ct[String(vt)]="set";break;case"object":vt==="environment"?Ct.environment=bt:vt==="networkConfig"?Ct.networkConfig=bt:Ct[String(vt)]=bt!=null?"set":"unset";break}}),Ct}}(ErrorBoundary);var EvaluationOptions={};Object.defineProperty(EvaluationOptions,"__esModule",{value:!0});var EvaluationTypes={};Object.defineProperty(EvaluationTypes,"__esModule",{value:!0});var InitializeResponse={};Object.defineProperty(InitializeResponse,"__esModule",{value:!0});var MemoKey={};Object.defineProperty(MemoKey,"__esModule",{value:!0}),MemoKey.createMemoKey=MemoKey.MemoPrefix=void 0,MemoKey.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const EXIST_KEYS=new Set([]),DO_NOT_MEMO_KEYS=new Set(["userPersistedValues"]);function createMemoKey(Be,Le,Ye){let tt=`${Be}|${Le}`;if(!Ye)return tt;for(const nt of Object.keys(Ye)){if(DO_NOT_MEMO_KEYS.has(nt))return;EXIST_KEYS.has(nt)?tt+=`|${nt}=true`:tt+=`|${nt}=${Ye[nt]}`}return tt}MemoKey.createMemoKey=createMemoKey;var NetworkCore$1={},NetworkFallbackResolver$1={},DnsTxtQuery={},__awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DnsTxtQuery,"__esModule",{value:!0}),DnsTxtQuery._fetchTxtRecords=void 0;const FEATURE_ASSETS_DNS_QUERY=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),DNS_QUERY_ENDPOINT="https://cloudflare-dns.com/dns-query",DOMAIN_CHARS=["i","e","d"],MAX_START_LOOKUP=200;function _fetchTxtRecords(Be){return __awaiter$d(this,void 0,void 0,function*(){const Le=yield Be(DNS_QUERY_ENDPOINT,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:FEATURE_ASSETS_DNS_QUERY});if(!Le.ok){const nt=new Error("Failed to fetch TXT records from DNS");throw nt.name="DnsTxtFetchError",nt}const Ye=yield Le.arrayBuffer(),tt=new Uint8Array(Ye);return _parseDnsResponse(tt)})}DnsTxtQuery._fetchTxtRecords=_fetchTxtRecords;function _parseDnsResponse(Be){const Le=Be.findIndex((tt,nt)=>nt<MAX_START_LOOKUP&&String.fromCharCode(tt)==="="&&DOMAIN_CHARS.includes(String.fromCharCode(Be[nt-1])));if(Le===-1){const tt=new Error("Failed to parse TXT records from DNS");throw tt.name="DnsTxtParseError",tt}let Ye="";for(let tt=Le-1;tt<Be.length;tt++)Ye+=String.fromCharCode(Be[tt]);return Ye.split(",")}var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkFallbackResolver$1,"__esModule",{value:!0}),NetworkFallbackResolver$1._isDomainFailure=NetworkFallbackResolver$1.NetworkFallbackResolver=void 0;const DnsTxtQuery_1=DnsTxtQuery,Hashing_1=Hashing,Log_1$3=Log,StorageProvider_1$1=StorageProvider,DEFAULT_TTL_MS=7*24*60*60*1e3,COOLDOWN_TIME_MS=4*60*60*1e3;class NetworkFallbackResolver{constructor(Le){var Ye;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(Ye=Le.networkConfig)===null||Ye===void 0?void 0:Ye.networkOverrideFunc}setErrorBoundary(Le){this._errorBoundary=Le}tryBumpExpiryTime(Le,Ye){var tt;const nt=(tt=this._fallbackInfo)===null||tt===void 0?void 0:tt[Ye.endpoint];nt&&(nt.expiryTime=Date.now()+DEFAULT_TTL_MS,_tryWriteFallbackInfoToCache(Le,Object.assign(Object.assign({},this._fallbackInfo),{[Ye.endpoint]:nt})))}getActiveFallbackUrl(Le,Ye){var tt,nt;if(Ye.customUrl!=null&&Ye.fallbackUrls!=null)return null;let ft=this._fallbackInfo;ft==null&&(ft=(tt=_readFallbackInfoFromCache(Le))!==null&&tt!==void 0?tt:{},this._fallbackInfo=ft);const ht=ft[Ye.endpoint];return!ht||Date.now()>((nt=ht.expiryTime)!==null&&nt!==void 0?nt:0)||Ye.getChecksum()!==ht.urlConfigChecksum?(delete ft[Ye.endpoint],this._fallbackInfo=ft,_tryWriteFallbackInfoToCache(Le,this._fallbackInfo),null):ht.url?ht.url:null}tryFetchUpdatedFallbackInfo(Le,Ye,tt,nt){return __awaiter$c(this,void 0,void 0,function*(){var ft,ht;try{if(!_isDomainFailure(tt,nt))return!1;const At=Ye.customUrl==null&&Ye.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(Ye):Ye.fallbackUrls,xt=this._pickNewFallbackUrl((ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[Ye.endpoint],At);return xt?(this._updateFallbackInfoWithNewUrl(Le,Ye,xt),!0):!1}catch(gt){return(ht=this._errorBoundary)===null||ht===void 0||ht.logError("tryFetchUpdatedFallbackInfo",gt),!1}})}_updateFallbackInfoWithNewUrl(Le,Ye,tt){var nt,ft,ht;const gt={urlConfigChecksum:Ye.getChecksum(),url:tt,expiryTime:Date.now()+DEFAULT_TTL_MS,previous:[]},At=Ye.endpoint,xt=(nt=this._fallbackInfo)===null||nt===void 0?void 0:nt[At];xt&>.previous.push(...xt.previous),gt.previous.length>10&&(gt.previous=[]);const Et=(ht=(ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[At])===null||ht===void 0?void 0:ht.url;Et!=null&>.previous.push(Et),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[At]:gt}),_tryWriteFallbackInfoToCache(Le,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(Le){return __awaiter$c(this,void 0,void 0,function*(){var Ye;const tt=this._dnsQueryCooldowns[Le.endpoint];if(tt&&Date.now()<tt)return null;this._dnsQueryCooldowns[Le.endpoint]=Date.now()+COOLDOWN_TIME_MS;const nt=[],ft=yield(0,DnsTxtQuery_1._fetchTxtRecords)((Ye=this._networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch),ht=_extractPathFromUrl(Le.defaultUrl);for(const gt of ft){if(!gt.startsWith(Le.endpointDnsKey+"="))continue;const At=gt.split("=");if(At.length>1){let xt=At[1];xt.endsWith("/")&&(xt=xt.slice(0,-1)),nt.push(`https://${xt}${ht}`)}}return nt})}_pickNewFallbackUrl(Le,Ye){var tt;if(Ye==null)return null;const nt=new Set((tt=Le==null?void 0:Le.previous)!==null&&tt!==void 0?tt:[]),ft=Le==null?void 0:Le.url;let ht=null;for(const gt of Ye){const At=gt.endsWith("/")?gt.slice(0,-1):gt;if(!nt.has(gt)&&At!==ft){ht=At;break}}return ht}}NetworkFallbackResolver$1.NetworkFallbackResolver=NetworkFallbackResolver;function _isDomainFailure(Be,Le){var Ye;const tt=(Ye=Be==null?void 0:Be.toLowerCase())!==null&&Ye!==void 0?Ye:"";return Le||tt.includes("uncaught exception")||tt.includes("failed to fetch")||tt.includes("networkerror when attempting to fetch resource")}NetworkFallbackResolver$1._isDomainFailure=_isDomainFailure;function _getFallbackInfoStorageKey(Be){return`statsig.network_fallback.${(0,Hashing_1._DJB2)(Be)}`}function _tryWriteFallbackInfoToCache(Be,Le){const Ye=_getFallbackInfoStorageKey(Be);if(!Le||Object.keys(Le).length===0){StorageProvider_1$1.Storage.removeItem(Ye);return}StorageProvider_1$1.Storage.setItem(Ye,JSON.stringify(Le))}function _readFallbackInfoFromCache(Be){const Le=_getFallbackInfoStorageKey(Be),Ye=StorageProvider_1$1.Storage.getItem(Le);if(!Ye)return null;try{return JSON.parse(Ye)}catch{return Log_1$3.Log.error("Failed to parse FallbackInfo"),null}}function _extractPathFromUrl(Be){try{return new URL(Be).pathname}catch{return null}}var SDKFlags={};Object.defineProperty(SDKFlags,"__esModule",{value:!0}),SDKFlags.SDKFlags=void 0;const FLAGMAP={};SDKFlags.SDKFlags={setFlags:(Be,Le)=>{FLAGMAP[Be]=Le},get:(Be,Le)=>{var Ye,tt;return(tt=(Ye=FLAGMAP[Be])===null||Ye===void 0?void 0:Ye[Le])!==null&&tt!==void 0?tt:!1}};var SessionID={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigSession=Be.SessionID=void 0;const Le=$_StatsigGlobal,Ye=CacheKey,tt=Log,nt=StorageProvider,ft=UUID,ht=30*60*1e3,gt=4*60*60*1e3,At={};Be.SessionID={get:Rt=>Be.StatsigSession.get(Rt).data.sessionID},Be.StatsigSession={get:Rt=>{At[Rt]==null&&(At[Rt]=xt(Rt));const Tt=At[Rt];return yt(Tt)},overrideInitialSessionID:(Rt,Tt)=>{At[Tt]=Et(Rt,Tt)}};function xt(Rt){let Tt=wt(Rt);const Bt=Date.now();return Tt||(Tt={sessionID:(0,ft.getUUID)(),startTime:Bt,lastUpdate:Bt}),{data:Tt,sdkKey:Rt}}function Et(Rt,Tt){const Bt=Date.now();return{data:{sessionID:Rt,startTime:Bt,lastUpdate:Bt},sdkKey:Tt}}function yt(Rt){const Tt=Date.now(),Bt=Rt.data,Dt=Rt.sdkKey;if(kt(Bt)||vt(Bt)){Bt.sessionID=(0,ft.getUUID)(),Bt.startTime=Tt;const Nt=__STATSIG__==null?void 0:__STATSIG__.instance(Dt);Nt&&Nt.$emt({name:"session_expired"})}Bt.lastUpdate=Tt,It(Bt,Rt.sdkKey),clearTimeout(Rt.idleTimeoutID),clearTimeout(Rt.ageTimeoutID);const Pt=Tt-Bt.startTime;return Rt.idleTimeoutID=Ct(Dt,ht),Rt.ageTimeoutID=Ct(Dt,gt-Pt),Rt}function Ct(Rt,Tt){return setTimeout(()=>{var Bt;const Dt=(Bt=(0,Le._getStatsigGlobal)())===null||Bt===void 0?void 0:Bt.instance(Rt);Dt&&Dt.$emt({name:"session_expired"})},Tt)}function kt({lastUpdate:Rt}){return Date.now()-Rt>ht}function vt({startTime:Rt}){return Date.now()-Rt>gt}function bt(Rt){return`statsig.session_id.${(0,Ye._getStorageKey)(Rt)}`}function It(Rt,Tt){const Bt=bt(Tt);try{(0,nt._setObjectInStorage)(Bt,Rt)}catch{tt.Log.warn("Failed to save SessionID")}}function wt(Rt){const Tt=bt(Rt);return(0,nt._getObjectFromStorage)(Tt)}})(SessionID);var StatsigClientEventEmitter={};Object.defineProperty(StatsigClientEventEmitter,"__esModule",{value:!0}),StatsigClientEventEmitter.ErrorTag=void 0,StatsigClientEventEmitter.ErrorTag={NetworkError:"NetworkError"};var __awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkCore$1,"__esModule",{value:!0}),NetworkCore$1.NetworkCore=void 0;const __StatsigGlobal_1$1=$_StatsigGlobal,Diagnostics_1=Diagnostics,Log_1$2=Log,NetworkConfig_1=NetworkConfig,NetworkFallbackResolver_1=NetworkFallbackResolver$1,SDKFlags_1=SDKFlags,SDKType_1=SDKType,SafeJs_1$1=SafeJs,SessionID_1$1=SessionID,StableID_1$1=StableID,StatsigClientEventEmitter_1=StatsigClientEventEmitter,StatsigMetadata_1=StatsigMetadata,StatsigOptionsCommon_1$1=StatsigOptionsCommon,VisibilityObserving_1=VisibilityObserving,DEFAULT_TIMEOUT_MS=1e4,BACKOFF_BASE_MS=500,BACKOFF_MAX_MS=3e4,RATE_LIMIT_WINDOW_MS=1e3,RATE_LIMIT_MAX_REQ_COUNT=50,LEAK_RATE=RATE_LIMIT_MAX_REQ_COUNT/RATE_LIMIT_WINDOW_MS,RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class NetworkCore{constructor(Le,Ye){this._emitter=Ye,this._errorBoundary=null,this._timeout=DEFAULT_TIMEOUT_MS,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,Le&&(this._options=Le),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new NetworkFallbackResolver_1.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(Le))}setLogEventCompressionMode(Le){this._options.logEventCompressionMode=Le}setErrorBoundary(Le){this._errorBoundary=Le,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(Le)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const Le=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,Le}beacon(Le){if(!_ensureValidSdkKey(Le))return!1;const Ye=this._getInternalRequestArgs("POST",Le),tt=this._getPopulatedURL(Ye),nt=navigator;return nt.sendBeacon.bind(nt)(tt,Ye.body)}post(Le){return __awaiter$b(this,void 0,void 0,function*(){const Ye=this._getInternalRequestArgs("POST",Le);return this._tryEncodeBody(Ye),yield this._tryToCompressBody(Ye),this._sendRequest(Ye)})}get(Le){const Ye=this._getInternalRequestArgs("GET",Le);return this._sendRequest(Ye)}_sendRequest(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye,tt,nt,ft;if(!_ensureValidSdkKey(Le)||this._netConfig.preventAllNetworkTraffic)return null;const{method:ht,body:gt,retries:At,attempt:xt}=Le,Et=Le.urlConfig.endpoint;if(this._isRateLimited(Et))return Log_1$2.Log.warn(`Request to ${Et} was blocked because you are making requests too frequently.`),null;const yt=xt??1;let Ct=!1;const kt=this._getPopulatedURL(Le);let vt=null;const bt=(0,VisibilityObserving_1._isUnloading)();try{const It={method:ht,body:gt,headers:Object.assign({},Le.headers),priority:Le.priority,keepalive:bt};_tryMarkInitStart(Le,yt);const wt=this._leakyBucket[Et];wt&&(wt.lastRequestTime=Date.now(),this._leakyBucket[Et]=wt);const Rt=(Ye=this._netConfig.networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch;let Tt;if(vt=yield Promise.race([Rt(kt,It).finally(()=>clearTimeout(Tt)),new Promise((Dt,Pt)=>{Tt=setTimeout(()=>{Ct=!0,Pt(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!vt.ok){const Dt=yield vt.text().catch(()=>"No Text"),Pt=new Error(`NetworkError: ${kt} ${Dt}`);throw Pt.name="NetworkError",Pt}const Bt=yield vt.text();return _tryMarkInitEnd(Le,vt,yt,Bt),this._fallbackResolver.tryBumpExpiryTime(Le.sdkKey,Le.urlConfig),{body:Bt,code:vt.status}}catch(It){const wt=_getErrorMessage(It),Rt=_didTimeout(wt??"",Ct);if(_tryMarkInitEnd(Le,vt,yt,"",It),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(Le.sdkKey,Le.urlConfig,wt,Rt))&&(Le.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(Le.sdkKey,Le.urlConfig)),!At||yt>At||!RETRYABLE_CODES.has((tt=vt==null?void 0:vt.status)!==null&&tt!==void 0?tt:500)){(nt=this._emitter)===null||nt===void 0||nt.call(this,{name:"error",error:It,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:Le});const Bt=`A networking error occurred during ${ht} request to ${kt}.`;return Log_1$2.Log.error(Bt,wt,It),(ft=this._errorBoundary)===null||ft===void 0||ft.attachErrorIfNoneExists(Bt),null}return yield _exponentialBackoff(yt),this._sendRequest(Object.assign(Object.assign({},Le),{retries:At,attempt:yt+1}))}})}_getLogEventCompressionMode(Le){let Ye=Le==null?void 0:Le.logEventCompressionMode;return!Ye&&(Le==null?void 0:Le.disableCompression)===!0&&(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled),Ye||(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled),Ye}_isRateLimited(Le){var Ye;const tt=Date.now(),nt=(Ye=this._leakyBucket[Le])!==null&&Ye!==void 0?Ye:{count:0,lastRequestTime:tt},ft=tt-nt.lastRequestTime,ht=Math.floor(ft*LEAK_RATE);return nt.count=Math.max(0,nt.count-ht),nt.count>=RATE_LIMIT_MAX_REQ_COUNT?!0:(nt.count+=1,nt.lastRequestTime=tt,this._leakyBucket[Le]=nt,!1)}_getPopulatedURL(Le){var Ye;const tt=(Ye=Le.fallbackUrl)!==null&&Ye!==void 0?Ye:Le.urlConfig.getUrl();(Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize||Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=tt);const nt=Object.assign({[NetworkConfig_1.NetworkParam.SdkKey]:Le.sdkKey,[NetworkConfig_1.NetworkParam.SdkType]:SDKType_1.SDKType._get(Le.sdkKey),[NetworkConfig_1.NetworkParam.SdkVersion]:StatsigMetadata_1.SDK_VERSION,[NetworkConfig_1.NetworkParam.Time]:String(Date.now()),[NetworkConfig_1.NetworkParam.SessionID]:SessionID_1$1.SessionID.get(Le.sdkKey)},Le.params),ft=Object.keys(nt).map(ht=>`${encodeURIComponent(ht)}=${encodeURIComponent(nt[ht])}`).join("&");return`${tt}${ft?`?${ft}`:""}`}_tryEncodeBody(Le){var Ye;const tt=(0,SafeJs_1$1._getWindowSafe)(),nt=Le.body;if(!(!Le.isStatsigEncodable||this._options.disableStatsigEncoding||typeof nt!="string"||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-encode")!=null||!(tt!=null&&tt.btoa)))try{Le.body=tt.btoa(nt).split("").reverse().join(""),Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.StatsigEncoded]:"1"})}catch(ft){Log_1$2.Log.warn(`Request encoding failed for ${Le.urlConfig.getUrl()}`,ft)}}_tryToCompressBody(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye;const tt=Le.body;if(!(typeof tt!="string"||!_allowCompression(Le,this._options)))try{const nt=new TextEncoder().encode(tt),ft=new CompressionStream("gzip"),ht=ft.writable.getWriter();ht.write(nt).catch(Log_1$2.Log.error),ht.close().catch(Log_1$2.Log.error);const gt=ft.readable.getReader(),At=[];let xt;for(;!(xt=yield gt.read()).done;)At.push(xt.value);const Et=At.reduce((kt,vt)=>kt+vt.length,0),yt=new Uint8Array(Et);let Ct=0;for(const kt of At)yt.set(kt,Ct),Ct+=kt.length;Le.body=yt,Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.IsGzipped]:"1"})}catch(nt){Log_1$2.Log.warn(`Request compression failed for ${Le.urlConfig.getUrl()}`,nt)}})}_getInternalRequestArgs(Le,Ye){const tt=this._fallbackResolver.getActiveFallbackUrl(Ye.sdkKey,Ye.urlConfig),nt=Object.assign(Object.assign({},Ye),{method:Le,fallbackUrl:tt});return"data"in Ye&&_populateRequestBody(nt,Ye.data),nt}}NetworkCore$1.NetworkCore=NetworkCore;const _ensureValidSdkKey=Be=>Be.sdkKey?!0:(Log_1$2.Log.warn("Unable to make request without an SDK key"),!1),_populateRequestBody=(Be,Le)=>{const{sdkKey:Ye,fallbackUrl:tt}=Be,nt=StableID_1$1.StableID.get(Ye),ft=SessionID_1$1.SessionID.get(Ye),ht=SDKType_1.SDKType._get(Ye);Be.body=JSON.stringify(Object.assign(Object.assign({},Le),{statsigMetadata:Object.assign(Object.assign({},StatsigMetadata_1.StatsigMetadataProvider.get()),{stableID:nt,sessionID:ft,sdkType:ht,fallbackUrl:tt})}))};function _allowCompression(Be,Le){if(!Be.isCompressable||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const Ye=Be.urlConfig.customUrl!=null||Be.urlConfig.fallbackUrls!=null,tt=SDKFlags_1.SDKFlags.get(Be.sdkKey,"enable_log_event_compression")===!0;switch(Le.logEventCompressionMode){case StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled:return!1;case StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled:return!(Ye&&!tt);case StatsigOptionsCommon_1$1.LogEventCompressionMode.Forced:return!0;default:return!1}}function _getErrorMessage(Be){return typeof Be=="string"?Be:Be instanceof Error?`${Be.name}: ${Be.message}`:"Unknown Error"}function _didTimeout(Be,Le){return Be.includes("Timeout")||Le}function _tryMarkInitStart(Be,Le){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqStart(Be.sdkKey,{attempt:Le})}function _tryMarkInitEnd(Be,Le,Ye,tt,nt){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(Be.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(Le,Ye,tt,nt))}function _exponentialBackoff(Be){return __awaiter$b(this,void 0,void 0,function*(){yield new Promise(Le=>setTimeout(Le,Math.min(BACKOFF_BASE_MS*(Be*Be),BACKOFF_MAX_MS)))})}var OverrideAdapter={};Object.defineProperty(OverrideAdapter,"__esModule",{value:!0});var ParamStoreTypes={};Object.defineProperty(ParamStoreTypes,"__esModule",{value:!0});var SizeOf={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._fastApproxSizeOf=void 0;const Le=2,Ye=1,tt=(nt,ft)=>{let ht=0;const gt=Object.keys(nt);for(let At=0;At<gt.length;At++){const xt=gt[At],Et=nt[xt];if(ht+=xt.length,typeof Et=="object"&&Et!==null?ht+=(0,Be._fastApproxSizeOf)(Et,ft)+Le:ht+=String(Et).length+Ye,ht>=ft)return ht}return ht};Be._fastApproxSizeOf=tt})(SizeOf);var StatsigClientBase$1={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigClientBase$1,"__esModule",{value:!0}),StatsigClientBase$1.StatsigClientBase=void 0;const __StatsigGlobal_1=$_StatsigGlobal,ErrorBoundary_1=ErrorBoundary,EventLogger_1=EventLogger$1,Log_1$1=Log,MemoKey_1=MemoKey,SafeJs_1=SafeJs,SessionID_1=SessionID,StableID_1=StableID,StatsigOptionsCommon_1=StatsigOptionsCommon,StorageProvider_1=StorageProvider,MAX_MEMO_CACHE_SIZE=3e3;class StatsigClientBase{constructor(Le,Ye,tt,nt){var ft,ht,gt,At;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const xt=this.$emt.bind(this);(nt==null?void 0:nt.logLevel)!=null&&(Log_1$1.Log.level=nt.logLevel),nt!=null&&nt.disableStorage&&StorageProvider_1.Storage._setDisabled(!0),nt!=null&&nt.initialSessionID&&SessionID_1.StatsigSession.overrideInitialSessionID(nt.initialSessionID,Le),nt!=null&&nt.storageProvider&&StorageProvider_1.Storage._setProvider(nt.storageProvider),nt!=null&&nt.enableCookies&&StableID_1.StableID._setCookiesEnabled(Le,nt.enableCookies),nt!=null&&nt.disableStableID&&StableID_1.StableID._setDisabled(Le,!0),this._sdkKey=Le,this._options=nt??{},this._memoCache={},this.overrideAdapter=(ft=nt==null?void 0:nt.overrideAdapter)!==null&&ft!==void 0?ft:null,this._logger=new EventLogger_1.EventLogger(Le,xt,tt,nt),this._errorBoundary=new ErrorBoundary_1.ErrorBoundary(Le,nt,xt),this._errorBoundary.wrap(this),this._errorBoundary.wrap(Ye),this._errorBoundary.wrap(this._logger),tt.setErrorBoundary(this._errorBoundary),this.dataAdapter=Ye,this.dataAdapter.attach(Le,nt,tt),this.storageProvider=StorageProvider_1.Storage,(At=(gt=(ht=this.overrideAdapter)===null||ht===void 0?void 0:ht.loadFromStorage)===null||gt===void 0?void 0:gt.call(ht))===null||At===void 0||At.catch(Et=>this._errorBoundary.logError("OA::loadFromStorage",Et)),this._primeReadyRipcord(),_assignGlobalInstance(Le,this)}updateRuntimeOptions(Le){Le.loggingEnabled?(this._options.loggingEnabled=Le.loggingEnabled,this._logger.setLoggingEnabled(Le.loggingEnabled)):Le.disableLogging!=null&&(this._options.disableLogging=Le.disableLogging,this._logger.setLoggingEnabled(Le.disableLogging?"disabled":"browser-only")),Le.disableStorage!=null&&(this._options.disableStorage=Le.disableStorage,StorageProvider_1.Storage._setDisabled(Le.disableStorage)),Le.enableCookies!=null&&(this._options.enableCookies=Le.enableCookies,StableID_1.StableID._setCookiesEnabled(this._sdkKey,Le.enableCookies)),Le.logEventCompressionMode?this._logger.setLogEventCompressionMode(Le.logEventCompressionMode):Le.disableCompression&&this._logger.setLogEventCompressionMode(StatsigOptionsCommon_1.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return __awaiter$a(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(Le,Ye){this._listeners[Le]||(this._listeners[Le]=[]),this._listeners[Le].push(Ye)}off(Le,Ye){if(this._listeners[Le]){const tt=this._listeners[Le].indexOf(Ye);tt!==-1&&this._listeners[Le].splice(tt,1)}}$on(Le,Ye){Ye.__isInternal=!0,this.on(Le,Ye)}$emt(Le){var Ye;const tt=nt=>{try{nt(Le)}catch(ft){if(nt.__isInternal===!0){this._errorBoundary.logError(`__emit:${Le.name}`,ft);return}Log_1$1.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",Le)}};this._listeners[Le.name]&&this._listeners[Le.name].forEach(nt=>tt(nt)),(Ye=this._listeners["*"])===null||Ye===void 0||Ye.forEach(tt)}_setStatus(Le,Ye){this.loadingStatus=Le,this._memoCache={},this.$emt({name:"values_updated",status:Le,values:Ye})}_enqueueExposure(Le,Ye,tt){if((tt==null?void 0:tt.disableExposureLog)===!0){this._logger.incrementNonExposureCount(Le);return}this._logger.enqueue(Ye)}_memoize(Le,Ye){return(tt,nt)=>{if(this._options.disableEvaluationMemoization)return Ye(tt,nt);const ft=(0,MemoKey_1.createMemoKey)(Le,tt,nt);return ft?(ft in this._memoCache||(Object.keys(this._memoCache).length>=MAX_MEMO_CACHE_SIZE&&(this._memoCache={}),this._memoCache[ft]=Ye(tt,nt)),this._memoCache[ft]):Ye(tt,nt)}}}StatsigClientBase$1.StatsigClientBase=StatsigClientBase;function _assignGlobalInstance(Be,Le){var Ye;if((0,SafeJs_1._isServerEnv)())return;const tt=(0,__StatsigGlobal_1._getStatsigGlobal)(),nt=(Ye=tt.instances)!==null&&Ye!==void 0?Ye:{},ft=Le;nt[Be]!=null&&Log_1$1.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),nt[Be]=ft,tt.firstInstance||(tt.firstInstance=ft),tt.instances=nt,__STATSIG__=tt}var StatsigDataAdapter={};Object.defineProperty(StatsigDataAdapter,"__esModule",{value:!0}),StatsigDataAdapter.DataAdapterCachePrefix=void 0,StatsigDataAdapter.DataAdapterCachePrefix="statsig.cached";var StatsigPlugin={};Object.defineProperty(StatsigPlugin,"__esModule",{value:!0});var StatsigTypeFactories={};Object.defineProperty(StatsigTypeFactories,"__esModule",{value:!0}),StatsigTypeFactories._makeTypedGet=StatsigTypeFactories._mergeOverride=StatsigTypeFactories._makeLayer=StatsigTypeFactories._makeExperiment=StatsigTypeFactories._makeDynamicConfig=StatsigTypeFactories._makeFeatureGate=void 0;const Log_1=Log,TypingUtils_1=TypingUtils;function _makeEvaluation(Be,Le,Ye,tt){var nt;return{name:Be,details:Le,ruleID:(nt=Ye==null?void 0:Ye.rule_id)!==null&&nt!==void 0?nt:"",__evaluation:Ye,value:tt}}function _makeFeatureGate(Be,Le,Ye){var tt;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,(Ye==null?void 0:Ye.value)===!0)),{idType:(tt=Ye==null?void 0:Ye.id_type)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeFeatureGate=_makeFeatureGate;function _makeDynamicConfig(Be,Le,Ye){var tt,nt;const ft=(tt=Ye==null?void 0:Ye.value)!==null&&tt!==void 0?tt:{};return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,ft)),{idType:(nt=Ye==null?void 0:Ye.id_type)!==null&&nt!==void 0?nt:null,get:_makeTypedGet(Be,Ye==null?void 0:Ye.value)})}StatsigTypeFactories._makeDynamicConfig=_makeDynamicConfig;function _makeExperiment(Be,Le,Ye){var tt;const nt=_makeDynamicConfig(Be,Le,Ye);return Object.assign(Object.assign({},nt),{groupName:(tt=Ye==null?void 0:Ye.group_name)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeExperiment=_makeExperiment;function _makeLayer(Be,Le,Ye,tt){var nt,ft;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,void 0)),{get:_makeTypedGet(Be,Ye==null?void 0:Ye.value,tt),groupName:(nt=Ye==null?void 0:Ye.group_name)!==null&&nt!==void 0?nt:null,__value:(ft=Ye==null?void 0:Ye.value)!==null&&ft!==void 0?ft:{}})}StatsigTypeFactories._makeLayer=_makeLayer;function _mergeOverride(Be,Le,Ye,tt){return Object.assign(Object.assign(Object.assign({},Be),Le),{get:_makeTypedGet(Be.name,Ye,tt)})}StatsigTypeFactories._mergeOverride=_mergeOverride;function _makeTypedGet(Be,Le,Ye){return(tt,nt)=>{var ft;const ht=(ft=Le==null?void 0:Le[tt])!==null&&ft!==void 0?ft:null;return ht==null?nt??null:nt!=null&&!(0,TypingUtils_1._isTypeMatch)(ht,nt)?(Log_1.Log.warn(`Parameter type mismatch. '${Be}.${tt}' was found to be type '${typeof ht}' but fallback/return type is '${typeof nt}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),nt??null):(Ye==null||Ye(tt),ht)}}StatsigTypeFactories._makeTypedGet=_makeTypedGet;var StatsigTypes={};Object.defineProperty(StatsigTypes,"__esModule",{value:!0});var StatsigUpdateDetails={};Object.defineProperty(StatsigUpdateDetails,"__esModule",{value:!0}),StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES=StatsigUpdateDetails.createUpdateDetails=void 0;const createUpdateDetails=(Be,Le,Ye,tt,nt,ft)=>({duration:Ye,source:Le,success:Be,error:tt,sourceUrl:nt,warnings:ft});StatsigUpdateDetails.createUpdateDetails=createUpdateDetails,StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(xt,Et,yt,Ct){Ct===void 0&&(Ct=yt);var kt=Object.getOwnPropertyDescriptor(Et,yt);(!kt||("get"in kt?!Et.__esModule:kt.writable||kt.configurable))&&(kt={enumerable:!0,get:function(){return Et[yt]}}),Object.defineProperty(xt,Ct,kt)}:function(xt,Et,yt,Ct){Ct===void 0&&(Ct=yt),xt[Ct]=Et[yt]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(xt,Et){for(var yt in xt)yt!=="default"&&!Object.prototype.hasOwnProperty.call(Et,yt)&&Le(Et,xt,yt)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.Storage=Be.Log=Be.EventLogger=Be.Diagnostics=void 0;const tt=$_StatsigGlobal,nt=Diagnostics;Object.defineProperty(Be,"Diagnostics",{enumerable:!0,get:function(){return nt.Diagnostics}});const ft=EventLogger$1;Object.defineProperty(Be,"EventLogger",{enumerable:!0,get:function(){return ft.EventLogger}});const ht=Log;Object.defineProperty(Be,"Log",{enumerable:!0,get:function(){return ht.Log}});const gt=StatsigMetadata,At=StorageProvider;Object.defineProperty(Be,"Storage",{enumerable:!0,get:function(){return At.Storage}}),Ye($_StatsigGlobal,Be),Ye(CacheKey,Be),Ye(ClientInterfaces,Be),Ye(DataAdapterCore$1,Be),Ye(Diagnostics,Be),Ye(DownloadConfigSpecsResponse,Be),Ye(ErrorBoundary,Be),Ye(EvaluationOptions,Be),Ye(EvaluationTypes,Be),Ye(Hashing,Be),Ye(InitializeResponse,Be),Ye(Log,Be),Ye(MemoKey,Be),Ye(NetworkConfig,Be),Ye(NetworkCore$1,Be),Ye(OverrideAdapter,Be),Ye(ParamStoreTypes,Be),Ye(SafeJs,Be),Ye(SDKType,Be),Ye(SessionID,Be),Ye(SizeOf,Be),Ye(StableID,Be),Ye(StatsigClientBase$1,Be),Ye(StatsigClientEventEmitter,Be),Ye(StatsigDataAdapter,Be),Ye(StatsigEvent,Be),Ye(StatsigMetadata,Be),Ye(StatsigOptionsCommon,Be),Ye(StatsigPlugin,Be),Ye(StatsigTypeFactories,Be),Ye(StatsigTypes,Be),Ye(StatsigUser,Be),Ye(StorageProvider,Be),Ye(TypedJsonParse,Be),Ye(TypingUtils,Be),Ye(UrlConfiguration$1,Be),Ye(UUID,Be),Ye(VisibilityObserving,Be),Ye(StatsigUpdateDetails,Be),Ye(SDKFlags,Be),Object.assign((0,tt._getStatsigGlobal)(),{Log:ht.Log,SDK_VERSION:gt.SDK_VERSION})}(src$1);var StatsigClient$1={},EvaluationStore$1={},V1InitializeContainer$1={};Object.defineProperty(V1InitializeContainer$1,"__esModule",{value:!0}),V1InitializeContainer$1.V1InitializeContainer=void 0;const client_core_1$7=src$1;class V1InitializeContainer{constructor(Le){this._values=Le}getGate(Le){return this._getResultFromLookup(this._values.feature_gates,Le)}getConfig(Le){return this._getResultFromLookup(this._values.dynamic_configs,Le)}getLayer(Le){return this._getResultFromLookup(this._values.layer_configs,Le)}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$7._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V1InitializeContainer$1.V1InitializeContainer=V1InitializeContainer;var V2InitializeContainer$1={};Object.defineProperty(V2InitializeContainer$1,"__esModule",{value:!0}),V2InitializeContainer$1.V2InitializeContainer=void 0;const client_core_1$6=src$1;class V2InitializeContainer{constructor(Le){this._values=Le}getGate(Le){var Ye,tt,nt;const ft=this._getResultFromLookup(this._values.feature_gates,Le);return ft?{name:Le,value:ft.v===!0,rule_id:(Ye=ft.r)!==null&&Ye!==void 0?Ye:"default",secondary_exposures:(tt=ft.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ft.i)!==null&&nt!==void 0?nt:""}:null}getConfig(Le){var Ye,tt,nt,ft;const ht=this._getResultFromLookup(this._values.dynamic_configs,Le);return ht?{name:Le,value:(Ye=this._values.values[ht.v])!==null&&Ye!==void 0?Ye:{},rule_id:ht.r,secondary_exposures:(tt=ht.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ht.i)!==null&&nt!==void 0?nt:"",is_user_in_experiment:ht.ue===!0,passed:ht.p===!0,group_name:(ft=ht.gn)!==null&&ft!==void 0?ft:void 0,is_experiment_active:ht.ea===!0,group:ht.r,is_device_based:ht.i==="stableID"}:null}getLayer(Le){var Ye,tt,nt,ft,ht,gt;const At=this._getResultFromLookup(this._values.layer_configs,Le);return At?{name:Le,value:(Ye=this._values.values[At.v])!==null&&Ye!==void 0?Ye:{},rule_id:At.r,secondary_exposures:(tt=At.s)!==null&&tt!==void 0?tt:[],is_user_in_experiment:At.ue===!0,group_name:(nt=At.gn)!==null&&nt!==void 0?nt:void 0,is_experiment_active:At.ea===!0,group:At.r,is_device_based:At.i==="stableID",allocated_experiment_name:(ft=At.ae)!==null&&ft!==void 0?ft:"",explicit_parameters:(ht=At.ep)!==null&&ht!==void 0?ht:[],undelegated_secondary_exposures:(gt=At.us)!==null&>!==void 0?gt:[],parameter_rule_ids:At.pr}:null}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$6._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V2InitializeContainer$1.V2InitializeContainer=V2InitializeContainer,Object.defineProperty(EvaluationStore$1,"__esModule",{value:!0});const client_core_1$5=src$1,V1InitializeContainer_1=V1InitializeContainer$1,V2InitializeContainer_1=V2InitializeContainer$1;class EvaluationStore{constructor(Le){this._sdkKey=Le,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,client_core_1$5._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(Le,Ye){var tt,nt;if(!Le)return!1;const ft=(0,client_core_1$5._typedJsonParse)(Le.data,"has_updates","EvaluationResponse");return ft==null?!1:(this._source=Le.source,(ft==null?void 0:ft.has_updates)!==!0||((tt=ft.time)!==null&&tt!==void 0?tt:0)<this._lcut||(this._rawValues=Le.data,this._lcut=ft.time,this._receivedAt=Le.receivedAt,ft.response_format==="init-v2"?this._values=new V2InitializeContainer_1.V2InitializeContainer(ft):this._values=new V1InitializeContainer_1.V1InitializeContainer(ft),this._bootstrapMetadata=this._extractBootstrapMetadata(Le.source,ft),Le.source&&ft.user&&this._setWarningState(Ye,ft),client_core_1$5.SDKFlags.setFlags(this._sdkKey,(nt=ft.sdk_flags)!==null&&nt!==void 0?nt:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(Le){const Ye=this._values?this._values.getGate(Le):null;return this._getDetailedStoreResult(Ye)}getConfig(Le){const Ye=this._values?this._values.getConfig(Le):null;return this._getDetailedStoreResult(Ye)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(Le){const Ye=this._values?this._values.getLayer(Le):null;return this._getDetailedStoreResult(Ye)}getParamStore(Le){const Ye=this._values?this._values.getParamStore(Le):null;return this._getDetailedStoreResult(Ye)}getSource(){return this._source}getExposureMapping(){var Le;return(Le=this._values)===null||Le===void 0?void 0:Le.getExposureMapping()}_extractBootstrapMetadata(Le,Ye){if(Le!=="Bootstrap")return null;const tt={};return Ye.user&&(tt.user=Ye.user),Ye.sdkInfo&&(tt.generatorSDKInfo=Ye.sdkInfo),tt.lcut=Ye.time,tt}_getDetailedStoreResult(Le){return{result:Le,details:this._getDetails(Le==null)}}_setWarningState(Le,Ye){var tt,nt;const ft=client_core_1$5.StableID.get(this._sdkKey);if(((tt=Le.customIDs)===null||tt===void 0?void 0:tt.stableID)!==ft&&(!((nt=Le.customIDs)===null||nt===void 0)&&nt.stableID||ft)){this._warnings.add("StableIDMismatch");return}if("user"in Ye){const ht=Ye.user,gt=Object.assign(Object.assign({},Le),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,client_core_1$5._getFullUserHash)(gt)!==(0,client_core_1$5._getFullUserHash)(ht)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const Le={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(Le.warnings=Array.from(this._warnings)),Le}_getDetails(Le){var Ye,tt;const nt=this.getCurrentSourceDetails();let ft=nt.reason;const ht=(Ye=nt.warnings)!==null&&Ye!==void 0?Ye:[];this._source==="Bootstrap"&&ht.length>0&&(ft=ft+ht[0]),ft!=="Uninitialized"&&ft!=="NoValues"&&(ft=`${ft}:${Le?"Unrecognized":"Recognized"}`);const gt=this._source==="Bootstrap"&&(tt=this._bootstrapMetadata)!==null&&tt!==void 0?tt:void 0;return gt&&(nt.bootstrapMetadata=gt),Object.assign(Object.assign({},nt),{reason:ft})}}EvaluationStore$1.default=EvaluationStore;var Network={},EvaluationResponseDeltas={};Object.defineProperty(EvaluationResponseDeltas,"__esModule",{value:!0}),EvaluationResponseDeltas._resolveDeltasResponse=void 0;const client_core_1$4=src$1,MAX_DELTAS_SORT_DEPTH=2;function _resolveDeltasResponse(Be,Le){const Ye=(0,client_core_1$4._typedJsonParse)(Le,"checksum","DeltasEvaluationResponse");if(!Ye)return{hadBadDeltaChecksum:!0};const tt=_mergeDeltasIntoCache(Be,Ye),nt=_handleDeletedEntries(tt),ft=(0,client_core_1$4._DJB2Object)({feature_gates:nt.feature_gates,dynamic_configs:nt.dynamic_configs,layer_configs:nt.layer_configs},MAX_DELTAS_SORT_DEPTH);return ft===Ye.checksumV2?JSON.stringify(nt):{hadBadDeltaChecksum:!0,badChecksum:ft,badMergedConfigs:nt,badFullResponse:Ye.deltas_full_response}}EvaluationResponseDeltas._resolveDeltasResponse=_resolveDeltasResponse;function _mergeDeltasIntoCache(Be,Le){return Object.assign(Object.assign(Object.assign({},Be),Le),{feature_gates:Object.assign(Object.assign({},Be.feature_gates),Le.feature_gates),layer_configs:Object.assign(Object.assign({},Be.layer_configs),Le.layer_configs),dynamic_configs:Object.assign(Object.assign({},Be.dynamic_configs),Le.dynamic_configs)})}function _handleDeletedEntries(Be){const Le=Be;return _deleteEntriesInRecord(Be.deleted_gates,Le.feature_gates),delete Le.deleted_gates,_deleteEntriesInRecord(Be.deleted_configs,Le.dynamic_configs),delete Le.deleted_configs,_deleteEntriesInRecord(Be.deleted_layers,Le.layer_configs),delete Le.deleted_layers,Le}function _deleteEntriesInRecord(Be,Le){Be==null||Be.forEach(Ye=>{delete Le[Ye]})}var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(Network,"__esModule",{value:!0});const client_core_1$3=src$1,EvaluationResponseDeltas_1=EvaluationResponseDeltas;class StatsigNetwork extends client_core_1$3.NetworkCore{constructor(Le,Ye){super(Le,Ye);const tt=Le==null?void 0:Le.networkConfig;this._option=Le,this._initializeUrlConfig=new client_core_1$3.UrlConfiguration(client_core_1$3.Endpoint._initialize,tt==null?void 0:tt.initializeUrl,tt==null?void 0:tt.api,tt==null?void 0:tt.initializeFallbackUrls)}fetchEvaluations(Le,Ye,tt,nt,ft){return __awaiter$9(this,void 0,void 0,function*(){var ht,gt,At,xt,Et,yt;const Ct=Ye?(0,client_core_1$3._typedJsonParse)(Ye,"has_updates","InitializeResponse"):null;let kt={user:nt,hash:(At=(gt=(ht=this._option)===null||ht===void 0?void 0:ht.networkConfig)===null||gt===void 0?void 0:gt.initializeHashAlgorithm)!==null&&At!==void 0?At:"djb2",deltasResponseRequested:!1,full_checksum:null};if(Ct!=null&&Ct.has_updates){const vt=(Ct==null?void 0:Ct.hash_used)!==((yt=(Et=(xt=this._option)===null||xt===void 0?void 0:xt.networkConfig)===null||Et===void 0?void 0:Et.initializeHashAlgorithm)!==null&&yt!==void 0?yt:"djb2");kt=Object.assign(Object.assign({},kt),{sinceTime:ft&&!vt?Ct.time:0,previousDerivedFields:"derived_fields"in Ct&&ft?Ct.derived_fields:{},deltasResponseRequested:!0,full_checksum:Ct.full_checksum,partialUserMatchSinceTime:vt?0:Ct.time})}return this._fetchEvaluations(Le,Ct,kt,tt)})}_fetchEvaluations(Le,Ye,tt,nt){return __awaiter$9(this,void 0,void 0,function*(){var ft,ht;const gt=yield this.post({sdkKey:Le,urlConfig:this._initializeUrlConfig,data:tt,retries:2,isStatsigEncodable:!0,priority:nt});if((gt==null?void 0:gt.code)===204)return'{"has_updates": false}';if((gt==null?void 0:gt.code)!==200)return(ft=gt==null?void 0:gt.body)!==null&&ft!==void 0?ft:null;if((Ye==null?void 0:Ye.has_updates)!==!0||((ht=gt.body)===null||ht===void 0?void 0:ht.includes('"is_delta":true'))!==!0||tt.deltasResponseRequested!==!0)return gt.body;const At=(0,EvaluationResponseDeltas_1._resolveDeltasResponse)(Ye,gt.body);return typeof At=="string"?At:this._fetchEvaluations(Le,Ye,Object.assign(Object.assign(Object.assign({},tt),At),{deltasResponseRequested:!1}),nt)})}}Network.default=StatsigNetwork;var ParamStoreGetterFactory={};Object.defineProperty(ParamStoreGetterFactory,"__esModule",{value:!0}),ParamStoreGetterFactory._makeParamStoreGetter=void 0;const client_core_1$2=src$1,NO_EXPOSURE_OPT={disableExposureLog:!0};function _shouldLogExposure(Be){return Be==null||Be.disableExposureLog===!1}function _shouldReturnFallback(Be,Le){return Le!=null&&!(0,client_core_1$2._isTypeMatch)(Be,Le)}function _getMappedStaticValue(Be,Le){return Be.value}function _getMappedGateValue(Be,Le,Ye){return Be.getFeatureGate(Le.gate_name,_shouldLogExposure(Ye)?void 0:NO_EXPOSURE_OPT).value?Le.pass_value:Le.fail_value}function _getMappedDynamicConfigValue(Be,Le,Ye,tt){const ft=Be.getDynamicConfig(Le.config_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedExperimentValue(Be,Le,Ye,tt){const ft=Be.getExperiment(Le.experiment_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedLayerValue(Be,Le,Ye,tt){const ft=Be.getLayer(Le.layer_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _makeParamStoreGetter(Be,Le,Ye){return(tt,nt)=>{if(Le==null)return nt;const ft=Le[tt];if(ft==null||nt!=null&&(0,client_core_1$2._typeOf)(nt)!==ft.param_type)return nt;switch(ft.ref_type){case"static":return _getMappedStaticValue(ft);case"gate":return _getMappedGateValue(Be,ft,Ye);case"dynamic_config":return _getMappedDynamicConfigValue(Be,ft,nt,Ye);case"experiment":return _getMappedExperimentValue(Be,ft,nt,Ye);case"layer":return _getMappedLayerValue(Be,ft,nt,Ye);default:return nt}}}ParamStoreGetterFactory._makeParamStoreGetter=_makeParamStoreGetter;var StatsigEvaluationsDataAdapter$1={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigEvaluationsDataAdapter$1,"__esModule",{value:!0}),StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=void 0;const client_core_1$1=src$1,Network_1$1=Network;class StatsigEvaluationsDataAdapter extends client_core_1$1.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(Le,Ye,tt){super.attach(Le,Ye,tt),tt!==null&&tt instanceof Network_1$1.default?this._network=tt:this._network=new Network_1$1.default(Ye??{})}getDataAsync(Le,Ye,tt){return this._getDataAsyncImpl(Le,(0,client_core_1$1._normalizeUser)(Ye,this._options),tt)}prefetchData(Le,Ye){return this._prefetchDataImpl(Le,Ye)}setData(Le){const Ye=(0,client_core_1$1._typedJsonParse)(Le,"has_updates","data");Ye&&"user"in Ye?super.setData(Le,Ye.user):client_core_1$1.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(Le,Ye){super.setData(Le,Ye)}_fetchFromNetwork(Le,Ye,tt,nt){return __awaiter$8(this,void 0,void 0,function*(){var ft;const ht=yield(ft=this._network)===null||ft===void 0?void 0:ft.fetchEvaluations(this._getSdkKey(),Le,tt==null?void 0:tt.priority,Ye,nt);return ht??null})}_getCacheKey(Le){var Ye;const tt=(0,client_core_1$1._getStorageKey)(this._getSdkKey(),Le,(Ye=this._options)===null||Ye===void 0?void 0:Ye.customUserCacheKeyFunc);return`${client_core_1$1.DataAdapterCachePrefix}.${this._cacheSuffix}.${tt}`}_isCachedResultValidFor204(Le,Ye){return Le.fullUserHash!=null&&Le.fullUserHash===(0,client_core_1$1._getFullUserHash)(Ye)}}StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=StatsigEvaluationsDataAdapter;var __awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigClient$1,"__esModule",{value:!0});const client_core_1=src$1,EvaluationStore_1=EvaluationStore$1,Network_1=Network,ParamStoreGetterFactory_1=ParamStoreGetterFactory,StatsigEvaluationsDataAdapter_1=StatsigEvaluationsDataAdapter$1;class StatsigClient extends client_core_1.StatsigClientBase{static instance(Le){const Ye=(0,client_core_1._getStatsigGlobal)().instance(Le);return Ye instanceof StatsigClient?Ye:(client_core_1.Log.warn((0,client_core_1._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new StatsigClient(Le??"",{}))}constructor(Le,Ye,tt=null){var nt,ft;client_core_1.SDKType._setClientType(Le,"javascript-client");const ht=new Network_1.default(tt,At=>{this.$emt(At)});super(Le,(nt=tt==null?void 0:tt.dataAdapter)!==null&&nt!==void 0?nt:new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter,ht,tt),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(client_core_1.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(client_core_1.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(client_core_1.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(client_core_1.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(client_core_1.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(client_core_1.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new EvaluationStore_1.default(Le),this._network=ht,this._user=this._configureUser(Ye,tt),this._sdkInstanceID=(0,client_core_1.getUUID)();const gt=(ft=tt==null?void 0:tt.plugins)!==null&&ft!==void 0?ft:[];for(const At of gt)At.bind(this)}initializeSync(Le){var Ye;return this.loadingStatus!=="Uninitialized"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(Ye=this._store.getWarnings())!==null&&Ye!==void 0?Ye:[]]):(this._logger.start(),this.updateUserSync(this._user,Le))}initializeAsync(Le){return __awaiter$7(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(Le),this._initializePromise)})}updateUserSync(Le,Ye){const tt=performance.now();try{return this._updateUserSyncImpl(Le,Ye,tt)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}}_updateUserSyncImpl(Le,Ye,tt){var nt;const ft=[...(nt=this._store.getWarnings())!==null&&nt!==void 0?nt:[]];this._resetForUser(Le);const ht=this.dataAdapter.getDataSync(this._user);ht==null&&ft.push("NoCachedValues"),this._store.setValues(ht,this._user),this._finalizeUpdate(ht);const gt=Ye==null?void 0:Ye.disableBackgroundCacheRefresh;return gt===!0||gt==null&&(ht==null?void 0:ht.source)==="Bootstrap"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft):(this._runPostUpdate(ht??null,this._user),(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft))}updateUserAsync(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){const tt=performance.now();try{return yield this._updateUserAsyncImpl(Le,Ye)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}})}_updateUserAsyncImpl(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){this._resetForUser(Le);const tt=this._user;client_core_1.Diagnostics._markInitOverallStart(this._sdkKey);let nt=this.dataAdapter.getDataSync(tt);if(this._store.setValues(nt,this._user),this._setStatus("Loading",nt),nt=yield this.dataAdapter.getDataAsync(nt,tt,Ye),tt!==this._user)return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let ft=!1;nt!=null&&(client_core_1.Diagnostics._markInitProcessStart(this._sdkKey),ft=this._store.setValues(nt,this._user),client_core_1.Diagnostics._markInitProcessEnd(this._sdkKey,{success:ft})),this._finalizeUpdate(nt),ft||(this._errorBoundary.attachErrorIfNoneExists(client_core_1.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),client_core_1.Diagnostics._markInitOverallEnd(this._sdkKey,ft,this._store.getCurrentSourceDetails());const ht=client_core_1.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,client_core_1.createUpdateDetails)(ft,this._store.getSource(),ht,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:client_core_1.StatsigSession.get(this._sdkKey),stableID:client_core_1.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(Le,Ye){return this.getFeatureGate(Le,Ye).value}logEvent(Le,Ye,tt){const nt=typeof Le=="string"?{eventName:Le,value:Ye,metadata:tt}:Le;this.$emt({name:"log_event_called",event:nt}),this._logger.enqueue(Object.assign(Object.assign({},nt),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(Le){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:Le}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(Le){return __awaiter$7(this,void 0,void 0,function*(){return client_core_1.Storage.isReady()||(yield client_core_1.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,Le)})}_createErrorUpdateDetails(Le,Ye){var tt;return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),performance.now()-Ye,Le,null,[...(tt=this._store.getWarnings())!==null&&tt!==void 0?tt:[]])}_finalizeUpdate(Le){this._store.finalize(),this._setStatus("Ready",Le)}_runPostUpdate(Le,Ye){this.dataAdapter.getDataAsync(Le,Ye,{priority:"low"}).catch(tt=>{client_core_1.Log.error("An error occurred after update.",tt)})}_resetForUser(Le){this._logger.reset(),this._store.reset(),this._user=this._configureUser(Le,this._options)}_configureUser(Le,Ye){var tt,nt,ft;const ht=(0,client_core_1._normalizeUser)(Le,Ye),gt=(tt=ht.customIDs)===null||tt===void 0?void 0:tt.stableID;if(gt){const At=(ft=(nt=this.storageProvider).isReadyResolver)===null||ft===void 0?void 0:ft.call(nt);At?At.then(()=>client_core_1.StableID.setOverride(gt,this._sdkKey),()=>client_core_1.StableID.setOverride(gt,this._sdkKey)):client_core_1.StableID.setOverride(gt,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(ht.analyticsOnlyMetadata=Object.assign(Object.assign({},ht.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),ht}_getFeatureGateImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getGate(Le),gt=(0,client_core_1._makeFeatureGate)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getGateOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createGateExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"gate_evaluation",gate:xt}),xt}_getDynamicConfigImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getConfig(Le),gt=(0,client_core_1._makeDynamicConfig)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getDynamicConfigOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:xt}),xt}_getExperimentImpl(Le,Ye){var tt,nt,ft,ht;const{result:gt,details:At}=this._store.getConfig(Le),xt=(0,client_core_1._makeExperiment)(Le,At,gt);xt.__evaluation!=null&&(xt.__evaluation.secondary_exposures=(0,client_core_1._mapExposures)((nt=(tt=xt.__evaluation)===null||tt===void 0?void 0:tt.secondary_exposures)!==null&&nt!==void 0?nt:[],this._store.getExposureMapping()));const Et=(ht=(ft=this.overrideAdapter)===null||ft===void 0?void 0:ft.getExperimentOverride)===null||ht===void 0?void 0:ht.call(ft,xt,this._user,Ye),yt=Et??xt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,yt,this._store.getExposureMapping()),Ye),this.$emt({name:"experiment_evaluation",experiment:yt}),yt}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(Le,Ye){var tt,nt,ft;const{result:ht,details:gt}=this._store.getLayer(Le),At=(0,client_core_1._makeLayer)(Le,gt,ht),xt=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getLayerOverride)===null||nt===void 0?void 0:nt.call(tt,At,this._user,Ye);Ye!=null&&Ye.disableExposureLog&&this._logger.incrementNonExposureCount(Le);const Et=(0,client_core_1._mergeOverride)(At,xt,(ft=xt==null?void 0:xt.__value)!==null&&ft!==void 0?ft:At.__value,yt=>{Ye!=null&&Ye.disableExposureLog||this._enqueueExposure(Le,(0,client_core_1._createLayerParameterExposure)(this._user,Et,yt,this._store.getExposureMapping()),Ye)});return this.$emt({name:"layer_evaluation",layer:Et}),Et}_getParameterStoreImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getParamStore(Le);this._logger.incrementNonExposureCount(Le);const gt={name:Le,details:ht,__configuration:ft,get:(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,ft,Ye)},At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getParamStoreOverride)===null||nt===void 0?void 0:nt.call(tt,gt,Ye);return At!=null&&(gt.__configuration=At.config,gt.details=At.details,gt.get=(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,At.config,Ye)),gt}}StatsigClient$1.default=StatsigClient,function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ht,gt,At,xt){xt===void 0&&(xt=At);var Et=Object.getOwnPropertyDescriptor(gt,At);(!Et||("get"in Et?!gt.__esModule:Et.writable||Et.configurable))&&(Et={enumerable:!0,get:function(){return gt[At]}}),Object.defineProperty(ht,xt,Et)}:function(ht,gt,At,xt){xt===void 0&&(xt=At),ht[xt]=gt[At]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(ht,gt){for(var At in ht)At!=="default"&&!Object.prototype.hasOwnProperty.call(gt,At)&&Le(gt,ht,At)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigClient=void 0;const tt=src$1,nt=StatsigClient$1;Be.StatsigClient=nt.default,Ye(src$1,Be);const ft=Object.assign((0,tt._getStatsigGlobal)(),{StatsigClient:nt.default});Be.default=ft}(src$2);const FEATURE_FLAGS=["id_text_barcode_readability","selfie_local_lenses_check_web","id_model_hebrew_back_id","id_face_readability","new_id_capture_ux_least_risky_clients","id_test_aa","id_iou_check","iad_checks","iad_c_checks","new_fingerprint","mp_test_hashed_id","darwinium_profiling"],GLOBAL_FLAGS=["new_fingerprint"],ID_MODULE_FLAGS=["id_face_readability","id_test_aa","iad_c_checks","mp_test_hashed_id","id_model_hebrew_back_id","id_iou_check","iad_checks","new_id_capture_ux_least_risky_clients","id_text_barcode_readability"],SELFIE_MODULE_FLAGS=["selfie_local_lenses_check_web"];function getStatsigEnvironment(Be){return isStageK8sEnv(Be)?{tier:"development"}:isStageEnv(Be)||isDemoEnv(Be)?{tier:"staging"}:isSaasEnv(Be)?{tier:"production"}:{tier:"development"}}const clientApiKey="client-GBTzsiJ99rvyZQdNXDFkftx3ZoMF1TED2rsB3m3IUqc",featureFlagsValues={id_text_barcode_readability:!1,selfie_local_lenses_check_web:!1,id_model_hebrew_back_id:!1,id_face_readability:!1,new_id_capture_ux_least_risky_clients:!1,id_test_aa:!1,iad_checks:!1,iad_c_checks:!1,id_iou_check:!0,new_fingerprint:!1,mp_test_hashed_id:!1,darwinium_profiling:!1},clientExperimentIds={new_id_capture_ux_least_risky_clients:"experimentV2"};let initPromise=null;const initialize=async({flowId:Be,apiKey:Le,sessionIdentifier:Ye,apiURL:tt,clientExperimentId:nt})=>{if(initPromise)return initPromise;initPromise=(async()=>{var gt;const ft={customIDs:{client_api_key:Le,hashed_onboarding_id:Ye,flow_id:Be},custom:{landing_page:(gt=window==null?void 0:window.location)==null?void 0:gt.href}},ht=new src$2.StatsigClient(clientApiKey,ft,{environment:getStatsigEnvironment(tt)});await ht.initializeAsync(),FEATURE_FLAGS.forEach(At=>{if(nt&&clientExperimentIds[At]===nt){featureFlagsValues[At]=!0;return}featureFlagsValues[At]=ht.checkGate(At)})})(),await initPromise},getFeatureFlag=Be=>featureFlagsValues[Be]??!1,getModuleFeatureFlags=async Be=>{const Le={};GLOBAL_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]});const Ye=Be.toLowerCase();return Ye.includes("id")||Ye==="government-validation"?ID_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}):(Ye.includes("selfie")||Ye==="face")&&SELFIE_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}),Le};function IdCaptureParamsConfigurator(Be,Le,Ye,tt){Object.assign(Be,{areaDown:25e3,areaUp:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:160,widthIOSDown:85,widthDown:tt?110:135,widthUp:205,framesAggregationInterval:tt?3e3:2e3,minFaceIdQualityScore:.62})}function getSelfieFaceDetectionPipelineParams(){return{frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.86,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.85,minFaceQualityScore:.63,isOcclusionCheckEnabled:!1,faceOcclusionThreshold:.3}}const getProfiles=()=>[new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Current Prod - Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_02,DetectionType.IDCapture,["id_capture_2_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"https://www.notion.so/ML-Update-ID-processing-model-to-accept-more-back-ID-types-18c4c3caef49801e95b4fd6bf9b92883?pvs=4"),new PipelineProfile(WasmPipelineType.IdBarcodeAndTextQualityPipeline,PipelineProfileName.IdCapture_3_02,DetectionType.IDCapture,["id_capture_3_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV3x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Pipeline with text and barcode quality: https://www.notion.so/Web-Use-Text-Barcode-model-2nd-iteration-1bc4c3caef49805aa9e6d308db9fc6dd?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:!0},IdCaptureParamsConfigurator,"Current Prod - Id Videoselfie profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieWithAggregationMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Current Prod - Selfie face detection profile with quality metrics"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieVideoSelfie,DetectionType.SelfieVideoSelfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"VideoSelfie face detection profile")];function getProfile(Be){const Le=getProfiles().find(Ye=>Ye.name===Be);if(!Le)throw new Error(`Profile not found for type: ${Be}`);return Le}const wasmVersion="v2.12.47";function generateBundle(){const Be=getFeatureFlag("id_text_barcode_readability")?PipelineProfileName.IdCapture_3_02:getFeatureFlag("id_model_hebrew_back_id")?PipelineProfileName.IdCapture_2_02:PipelineProfileName.IdCapture_2_01,Le=PipelineProfileName.SelfieWithQualityMetrics,Ye=PipelineProfileName.SelfieVideoSelfie,tt=PipelineProfileName.IdVideoSelfie_2_01;return[Be,tt,Le,Ye]}function getInitializationParams(){const Le=generateBundle(),Ye="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",tt=`${Ye}/${wasmVersion}/webLib.wasm`,nt=`${Ye}/${wasmVersion}/webLibSimd.wasm`,ft=`${Ye}/${wasmVersion}/webLib.js`,ht=`${Ye}/${wasmVersion}/versions.json`;let gt=new Map,At=new Map;for(const xt of Le){const Et=getProfile(xt);if(!Et)throw new Error(`Profile not found: ${xt}`);const yt=Et.modelNames;let Ct=[];for(const kt of yt)Ct.push(`${Ye}/${wasmVersion}/models/${kt}`);gt.set(Et.pipelineType,Ct),At.set(Et.detectionType,Et)}return{wasmModulePath:tt,wasmSimdModulePath:nt,glueCodePath:ft,versionsFilePath:ht,pipelineModels:gt,enableSIMD:!0,profiles:At,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.pipelineApiUtilities=null,this.utilityApi=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.inspectorOpened_=!1,this.wasmCallMutex=new Mutex,this.Module=null,this.loadModule=async Le=>{this.Module=(await import(Le)).Module}}async initialize(Le,Ye,tt,nt,ft,ht){await this.freeResources(),this.pipelines_=ht,this.versionsFile=ft,await this.loadModule(tt);const gt=await this.loadWasm(nt,Le,Ye);return this.pipelineApiUtilities=new this.wasmModule.PipelineApiUtilities,this.utilityApi=new this.wasmModule.UtilityApi,this.idCaptureWasmApi=new this.wasmModule.IdCaptureApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionApi,this.isInitialized_=!0,gt}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.pipelineApiUtilities!=null&&this.utilityApi!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(Le,Ye){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(Le&&Ye&&Le==this.imageWidth_&&Ye==this.imageHeight_&&this.inputImageBuffer&&Le*Ye*4===this.inputImageBuffer.length)&&(this.imageWidth_=Le,this.imageHeight_=Ye,this.inputImageBuffer=this.pipelineApiUtilities.allocateInputImageBuffer(Le,Ye,4))}async handleDetectionCallAndUpdateState(Le){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.handleDetectionCallAndUpdateState(this.pipelineTypeToWasmEnum(Le))}ens(Le){return this.checkWasmInitialization("Unable to ens, cpp API hasn't been initialized"),this.utilityApi.ens(Le)}ckvcks(Le){this.checkWasmInitialization("Unable to ckvcks, cpp API hasn't been initialized"),this.utilityApi.ckvcks(Le)}isVirtualCamera(Le){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),Le)return this.utilityApi.isVirtualCamera(Le)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.utilityApi.estimatePerformance()}async analyzeFrame(Le){this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(Le.width,Le.height),this.inputImageBuffer.set(Le.data),this.utilityApi.analyzeFrame()}async freeResources(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,window.wasmArrayBuffer=null,this.pipelineApiUtilities&&typeof this.pipelineApiUtilities.delete=="function"&&(this.pipelineApiUtilities.delete(),this.pipelineApiUtilities=null),this.utilityApi&&typeof this.utilityApi.delete=="function"&&(this.utilityApi.delete(),this.utilityApi=null),this.idCaptureWasmApi&&typeof this.idCaptureWasmApi.delete=="function"&&(this.idCaptureWasmApi.delete(),this.idCaptureWasmApi=null),this.faceDetectionWasmApi&&typeof this.faceDetectionWasmApi.delete=="function"&&(this.faceDetectionWasmApi.delete(),this.faceDetectionWasmApi=null),this.wasmModule=null,this.isInitialized_=!1}resetPipeline(Le){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.pipelineApiUtilities.resetPipeline(this.pipelineTypeToWasmEnum(Le))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[Le,Ye]of this.pipelines_)this.resetPipeline(Le)}resetOther(){this.checkWasmInitialization("Unable to reset other states, cpp API hasn't been initialized"),this.utilityApi.resetOther()}reset(){this.resetAllPipelines(),this.resetOther()}async process(Le,Ye){if(this.checkWasmInitialization("Unable to process the image, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");switch(this.inputImageBuffer.set(Le.data),Ye){case WasmPipelineType.IdBlurGlarePipeline:case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.idCaptureWasmApi.runIdCapturePipeline(this.pipelineTypeToWasmEnum(Ye));case WasmPipelineType.IdFaceDetectionPipeline:return this.faceDetectionWasmApi.runIdFaceDetectionPipeline();case WasmPipelineType.IdVideoSelfiePipeline:return this.idCaptureWasmApi.runIdVideoSelfiePipeline();case WasmPipelineType.SelfieWithAggregationMetrics:case WasmPipelineType.SelfieWithQualityMetrics:return this.faceDetectionWasmApi.runSelfieFaceDetectionPipeline(this.pipelineTypeToWasmEnum(Ye));default:throw new Error("Unknown pipeline type")}}async runIdCapture(Le){if(this.checkWasmInitialization("Unable to run Id Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(Le.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(Le){if(this.checkWasmInitialization("Unable to run Selfie Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(Le.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceDetectionThresholds(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}async setFaceAttributesThresholds(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceChecksEnabled(Le,Ye,tt,nt,ft,ht){this.checkWasmInitialization("Unable to set face checks enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceChecksEnabled(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht)}async setFaceDetectionMode(Le,Ye){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.pipelineTypeToWasmEnum(Le),Ye)}async setFaceDetectionCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt,bt,It,wt,Rt,Tt){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt,bt,It,wt,Rt,Tt)}async setIdCaptureThresholds(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt)}async setIdCaptureCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt)}async setIdCaptureGeometryParams(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt)}async setIdCaptureConfigParams(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}setIdCaptureModelType(Le,Ye){this.checkWasmInitialization("Unable to set model type, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureModelType(this.pipelineTypeToWasmEnum(Le),this.IdCaptureModelTypeToWasmEnum(Ye))}IdPerspectiveTransform(Le,Ye){return this.checkWasmInitialization("Unable to perform perspective transform, cpp API hasn't been initialized"),this.idCaptureWasmApi.IdPerspectiveTransform(Le,Ye)}async getVersions(){const Ye=await(await fetch(this.versionsFile)).text();return JSON.parse(Ye)}async loadWasm(Le,Ye,tt){const nt=Le?tt:Ye;try{window.wasmArrayBuffer=await fetch(nt).then(ft=>ft.arrayBuffer()).then(ft=>new Uint8Array(ft)),this.wasmModule=await this.Module()}catch(ft){if(console.log(ft,Le,"useSmd"),Le)return await this.loadWasm(!1,Ye,tt);throw ft}return Le}async loadModels(){var nt;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let Le=new this.wasmModule.PipelineTypeToIntMap,Ye=new Map,tt=new Map;for(let[ft,ht]of this.pipelines_){let gt=this.pipelineTypeToWasmEnum(ft),At=[],xt=new this.wasmModule.VectorInt;for(let Et of ht){if(!tt.has(Et)){let Ct=await fetch(Et).then(kt=>kt.arrayBuffer()).then(kt=>new Uint8Array(kt));tt.set(Et,Ct)}let yt=tt.get(Et);xt.push_back(yt.byteLength),At.push(yt)}Le.set(gt,xt),Ye.set(gt,At)}this.modelsBuffers=this.pipelineApiUtilities.allocateModelsBuffers(Le);for(let[ft,ht]of Ye){let gt=(nt=this.modelsBuffers)==null?void 0:nt.get(ft);for(let At=0;At<gt.size();At++){let xt=gt==null?void 0:gt.get(At);if(xt)xt.set(ht[At]);else throw new Error("Unable to get model buffer from shared memory!")}}}async initializePipelines(){this.checkWasmInitialization("Unable to initialize pipelines, cpp API hasn't been initialized"),this.modelsBuffers||await this.loadModels(),this.pipelineApiUtilities.initializePipelines()}async setProductionMode(Le){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.utilityApi.setProductionMode(Le)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.pipelineTypeFromWasmEnum(this.pipelineApiUtilities.getCurrentPipeline())}setSdkVersion(Le){this.checkWasmInitialization("Unable to set sdk version, cpp API hasn't been initialized"),this.utilityApi.setSdkVersion(Le)}setSdkPlatform(Le){this.checkWasmInitialization("Unable to set device type, cpp API hasn't been initialized"),this.utilityApi.setSdkPlatform(Le)}setDeviceInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set device info, cpp API hasn't been initialized"),this.utilityApi.setDeviceInfo(Le,Ye)}setBrowserInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set browser info, cpp API hasn't been initialized"),this.utilityApi.setBrowserInfo(Le,Ye)}setCameraInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set camera info, cpp API hasn't been initialized"),this.utilityApi.setCameraInfo(Le,Ye)}setZc(Le){this.checkWasmInitialization("Unable to set zc, cpp API hasn't been initialized"),this.utilityApi.setZc(Le)}setMotionStatus(Le){this.checkWasmInitialization("Unable to set motion status, cpp API hasn't been initialized"),this.utilityApi.setMotionStatus(Le)}setMetadataField(Le,Ye){this.checkWasmInitialization("Unable to set metadata field, cpp API hasn't been initialized"),this.utilityApi.setMetadataField(Le,Ye)}setInspectorOpened(Le){this.inspectorOpened_=Le}setBackgroundMode(Le){this.checkWasmInitialization("Unable to set background mode, cpp API hasn't been initialized"),this.utilityApi.setBackgroundMode(Le)}getCheck(){return this.checkWasmInitialization("Unable to get check, cpp API hasn't been initialized"),this.utilityApi.getCheck()}getMetadata(){return this.checkWasmInitialization("Unable to get metadata, cpp API hasn't been initialized"),this.utilityApi.setInspectorOpened(this.inspectorOpened_),this.utilityApi.getMetadata()}async prc(){return this.checkWasmInitialization("Unable to prc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.prc.bind(this.utilityApi),[])}async poc(Le){this.checkWasmInitialization("Unable to poc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.poc.bind(this.utilityApi),[Le])}pipelineTypeToWasmEnum(Le){switch(Le){case WasmPipelineType.IdBlurGlarePipeline:return this.wasmModule.PipelineType.IdBlurGlarePipeline;case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.wasmModule.PipelineType.IdBarcodeAndTextQualityPipeline;case WasmPipelineType.IdFaceDetectionPipeline:return this.wasmModule.PipelineType.IdFaceDetectionPipeline;case WasmPipelineType.IdVideoSelfiePipeline:return this.wasmModule.PipelineType.IdVideoSelfiePipeline;case WasmPipelineType.SelfieWithAggregationMetrics:return this.wasmModule.PipelineType.SelfieWithAggregationMetrics;case WasmPipelineType.SelfieWithQualityMetrics:return this.wasmModule.PipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}pipelineTypeFromWasmEnum(Le){switch(Le){case this.wasmModule.PipelineType.IdBlurGlarePipeline:return WasmPipelineType.IdBlurGlarePipeline;case this.wasmModule.IdBarcodeAndTextQualityPipeline:return WasmPipelineType.IdBarcodeAndTextQualityPipeline;case this.wasmModule.PipelineType.IdFaceDetectionPipeline:return WasmPipelineType.IdFaceDetectionPipeline;case this.wasmModule.PipelineType.IdVideoSelfiePipeline:return WasmPipelineType.IdVideoSelfiePipeline;case this.wasmModule.PipelineType.SelfieWithAggregationMetrics:return WasmPipelineType.SelfieWithAggregationMetrics;case this.wasmModule.PipelineType.SelfieWithQualityMetrics:return WasmPipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}IdCaptureModelTypeToWasmEnum(Le){switch(Le){case IdCaptureModelType.IdCaptureV1x:return this.wasmModule.IdCaptureModelType.IdCaptureV1x;case IdCaptureModelType.IdCaptureV2x:return this.wasmModule.IdCaptureModelType.IdCaptureV2x;case IdCaptureModelType.IdCaptureV3x:return this.wasmModule.IdCaptureModelType.IdCaptureV3x;default:throw new Error("Unknown Id Capture model type")}}checkWasmInitialization(Le){if(!this.isInitialized())throw new Error(Le)}async wasmCallWrapper(Le,Ye=[]){return await this.wasmCallMutex.withLock(async(...tt)=>{let nt=!1;try{for(;;){if(nt=Le(...tt),nt)return;await new Promise(ft=>setTimeout(ft,0))}}catch(ft){console.log("Error in wasmCallWrapper:",ft)}},...Ye)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance(),version$4="1.85.0-20251219204942.0";function e$2(Be,Le){return function(Ye,tt){return Object.prototype.hasOwnProperty.call(Ye,tt)}(Be,Le)?Be[Le]:void 0}function t$2(Be,Le,Ye,tt){const nt=document,ft="securitypolicyviolation";let ht;const gt=xt=>{const Et=new URL(Be,location.href),{blockedURI:yt}=xt;yt!==Et.href&&yt!==Et.protocol.slice(0,-1)&&yt!==Et.origin||(ht=xt,At())};nt.addEventListener(ft,gt);const At=()=>nt.removeEventListener(ft,gt);return Promise.resolve().then(Le).then(xt=>(At(),xt),xt=>new Promise(Et=>{const yt=new MessageChannel;yt.port1.onmessage=()=>Et(),yt.port2.postMessage(null)}).then(()=>{if(At(),ht)return Ye(ht);throw xt}))}function n$2(Be){let Le="";for(let Ye=0;Ye<Be.length;++Ye)if(Ye>0){const tt=Be[Ye].toLowerCase();tt!==Be[Ye]?Le+=` ${tt}`:Le+=Be[Ye]}else Le+=Be[Ye].toUpperCase();return Le}const r$4={default:"endpoint"},o$1={default:"tlsEndpoint"},i$5="Client timeout",R$2="Network connection error",s$3="Network request aborted",a$3="Response cannot be parsed",c$3="Blocked by CSP",E$1="The endpoint parameter is not a valid URL",l$1="Handle on demand agent data error",u$1=n$2("WrongRegion"),d$1=n$2("SubscriptionNotActive"),_$2=n$2("UnsupportedVersion"),O$1=n$2("InstallationMethodRestricted"),p$1=n$2("HostnameRestricted"),I$1=n$2("IntegrationFailed"),f$2=n$2("NetworkRestricted"),N$1=n$2("InvalidProxyIntegrationSecret"),T$1=n$2("InvalidProxyIntegrationHeaders"),h$e=n$2("ProxyIntegrationSecretEnvironmentMismatch"),v$d="API key required",m$2="API key not found",A$1="API key expired",w$e="Request cannot be parsed",P$1="Request failed",D$1="Request failed to process",S$1="Too many requests, rate limit exceeded",y="Not available for this origin",g$1="Not available with restricted header",L$1=v$d,C$1=m$2,U$1=A$1;var b$2="3.12.3";const M$1="Failed to load the JS script of the agent",K="9319";function V(Be,Le){const Ye=[],[tt,nt]=function(gt){const At=function(yt){const Ct=[...yt];return{current:()=>Ct[0],postpone(){const kt=Ct.shift();kt!==void 0&&Ct.push(kt)},exclude(){Ct.shift()}}}(gt),xt=function(yt,Ct){let kt=0;return()=>Math.random()*Math.min(Ct,yt*Math.pow(2,kt++))}(100,3e3),Et=new Set;return[At.current(),(yt,Ct)=>{let kt;const vt=Ct instanceof Error?Ct.message:"";if(vt===c$3||vt===E$1)At.exclude(),kt=0;else if(vt===K)At.exclude();else if(vt===M$1){const It=Date.now()-yt.getTime()<50,wt=At.current();wt&&It&&!Et.has(wt)&&(Et.add(wt),kt=0),At.postpone()}else At.postpone();const bt=At.current();return bt===void 0?void 0:[bt,kt??yt.getTime()+xt()-Date.now()]}]}(Be);let ft;if(tt===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));const ht=gt=>{const At=new Date,xt=yt=>Ye.push({url:gt,startedAt:At,finishedAt:new Date,error:yt}),Et=Le(gt);return Et.then(()=>xt(),xt),Et.catch(yt=>{if(ft!=null||(ft=yt),Ye.length>=5)throw ft;const Ct=nt(At,yt);if(!Ct)throw ft;const[kt,vt]=Ct;return(bt=vt,new Promise(It=>setTimeout(It,bt))).then(()=>ht(kt));var bt})};return ht(tt).then(gt=>[gt,Ye])}const k$1="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",G=k$1;function B$1(Be){var Le,Ye;const{picked:tt,rest:nt}=function(Et,yt){const Ct={},kt={};for(const[vt,bt]of Object.entries(Et))yt.includes(vt)?Ct[vt]=bt:kt[vt]=bt;return{picked:Ct,rest:kt}}(Be,["scriptUrlPattern","token","apiKey"]),ft=tt.token,ht=(Le=tt.apiKey)!==null&&Le!==void 0?Le:ft,gt=(Ye=e$2(Be,"scriptUrlPattern"))!==null&&Ye!==void 0?Ye:k$1,[At,xt]=function(){const Et=[],yt=()=>{Et.push({time:new Date,state:document.visibilityState})},Ct=function(kt,vt,bt,It){return kt.addEventListener(vt,bt,It),()=>kt.removeEventListener(vt,bt,It)}(document,"visibilitychange",yt);return yt(),[Et,Ct]}();return Promise.resolve().then(()=>{if(!ht||typeof ht!="string")throw new Error(v$d);const Et=function(yt,Ct){return(Array.isArray(yt)?yt:[yt]).map(kt=>function(vt,bt){const It=encodeURIComponent;return vt.replace(/<[^<>]+>/g,wt=>wt==="<version>"?"3":wt==="<apiKey>"?It(bt):wt==="<loaderVersion>"?It(b$2):wt)}(String(kt),Ct))}(gt,ht);return V(Et,F$1)}).catch(Et=>{throw xt(),function(yt){return yt instanceof Error&&yt.message===K?new Error(M$1):yt}(Et)}).then(([Et,yt])=>(xt(),Et.load({...nt,ldi:{attempts:yt,visibilityStates:At}})))}function F$1(Be){return t$2(Be,()=>function(Le){return new Promise((Ye,tt)=>{if(function(gt){if(URL.prototype)try{return new URL(gt,location.href),!1}catch(At){if(At instanceof Error&&At.name==="TypeError")return!0;throw At}}(Le))throw new Error(E$1);const nt=document.createElement("script"),ft=()=>{var gt;return(gt=nt.parentNode)===null||gt===void 0?void 0:gt.removeChild(nt)},ht=document.head||document.getElementsByTagName("head")[0];nt.onload=()=>{ft(),Ye()},nt.onerror=()=>{ft(),tt(new Error(M$1))},nt.async=!0,nt.src=Le,ht.appendChild(nt)})}(Be),()=>{throw new Error(c$3)}).then(x$1)}function x$1(){const Be=window,Le="__fpjs_p_l_b",Ye=Be[Le];if(function(tt,nt){var ft;const ht=(ft=Object.getOwnPropertyDescriptor)===null||ft===void 0?void 0:ft.call(Object,tt,nt);ht!=null&&ht.configurable?delete tt[nt]:ht&&!ht.writable||(tt[nt]=void 0)}(Be,Le),typeof(Ye==null?void 0:Ye.load)!="function")throw new Error(K);return Ye}var H={load:B$1,defaultScriptUrlPattern:G,ERROR_SCRIPT_LOAD_FAIL:M$1,ERROR_API_KEY_EXPIRED:A$1,ERROR_API_KEY_INVALID:m$2,ERROR_API_KEY_MISSING:v$d,ERROR_BAD_REQUEST_FORMAT:w$e,ERROR_BAD_RESPONSE_FORMAT:a$3,ERROR_CLIENT_TIMEOUT:i$5,ERROR_CSP_BLOCK:c$3,ERROR_FORBIDDEN_ENDPOINT:p$1,ERROR_FORBIDDEN_HEADER:g$1,ERROR_FORBIDDEN_ORIGIN:y,ERROR_GENERAL_SERVER_FAILURE:P$1,ERROR_HANDLE_AGENT_DATA:l$1,ERROR_INSTALLATION_METHOD_RESTRICTED:O$1,ERROR_INTEGRATION_FAILURE:I$1,ERROR_INVALID_ENDPOINT:E$1,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:T$1,ERROR_INVALID_PROXY_INTEGRATION_SECRET:N$1,ERROR_NETWORK_ABORT:s$3,ERROR_NETWORK_CONNECTION:R$2,ERROR_NETWORK_RESTRICTED:f$2,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:h$e,ERROR_RATE_LIMIT:S$1,ERROR_SERVER_TIMEOUT:D$1,ERROR_SUBSCRIPTION_NOT_ACTIVE:d$1,ERROR_TOKEN_EXPIRED:U$1,ERROR_TOKEN_INVALID:C$1,ERROR_TOKEN_MISSING:L$1,ERROR_UNSUPPORTED_VERSION:_$2,ERROR_WRONG_REGION:u$1,defaultEndpoint:r$4,defaultTlsEndpoint:o$1};function e$1(Be,Le,Ye,tt){return new(Ye||(Ye=Promise))(function(nt,ft){function ht(xt){try{At(tt.next(xt))}catch(Et){ft(Et)}}function gt(xt){try{At(tt.throw(xt))}catch(Et){ft(Et)}}function At(xt){var Et;xt.done?nt(xt.value):(Et=xt.value,Et instanceof Ye?Et:new Ye(function(yt){yt(Et)})).then(ht,gt)}At((tt=tt.apply(Be,[])).next())})}function n$1(Be,Le){var Ye,tt,nt,ft,ht={label:0,sent:function(){if(1&nt[0])throw nt[1];return nt[1]},trys:[],ops:[]};return ft={next:gt(0),throw:gt(1),return:gt(2)},typeof Symbol=="function"&&(ft[Symbol.iterator]=function(){return this}),ft;function gt(At){return function(xt){return function(Et){if(Ye)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,Et[0]&&(ht=0)),ht;)try{if(Ye=1,tt&&(nt=2&Et[0]?tt.return:Et[0]?tt.throw||((nt=tt.return)&&nt.call(tt),0):tt.next)&&!(nt=nt.call(tt,Et[1])).done)return nt;switch(tt=0,nt&&(Et=[2&Et[0],nt.value]),Et[0]){case 0:case 1:nt=Et;break;case 4:return ht.label++,{value:Et[1],done:!1};case 5:ht.label++,tt=Et[1],Et=[0];continue;case 7:Et=ht.ops.pop(),ht.trys.pop();continue;default:if(nt=ht.trys,!((nt=nt.length>0&&nt[nt.length-1])||Et[0]!==6&&Et[0]!==2)){ht=0;continue}if(Et[0]===3&&(!nt||Et[1]>nt[0]&&Et[1]<nt[3])){ht.label=Et[1];break}if(Et[0]===6&&ht.label<nt[1]){ht.label=nt[1],nt=Et;break}if(nt&&ht.label<nt[2]){ht.label=nt[2],ht.ops.push(Et);break}nt[2]&&ht.ops.pop(),ht.trys.pop();continue}Et=Le.call(Be,ht)}catch(yt){Et=[6,yt],tt=0}finally{Ye=nt=0}if(5&Et[0])throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}([At,xt])}}}typeof SuppressedError=="function"&&SuppressedError;var r$3={exclude:[],include:[],logging:!0,timeout:1e3},o={},a$2={timeout:"true"},i$4=function(Be,Le){typeof window<"u"&&(o[Be]=Le)},u=function(){return Object.fromEntries(Object.entries(o).filter(function(Be){var Le,Ye=Be[0];return!(!((Le=r$3==null?void 0:r$3.exclude)===null||Le===void 0)&&Le.includes(Ye))}).filter(function(Be){var Le,Ye,tt,nt,ft=Be[0];return!((Le=r$3==null?void 0:r$3.include)===null||Le===void 0)&&Le.some(function(ht){return ht.includes(".")})?(Ye=r$3==null?void 0:r$3.include)===null||Ye===void 0?void 0:Ye.some(function(ht){return ht.startsWith(ft)}):((tt=r$3==null?void 0:r$3.include)===null||tt===void 0?void 0:tt.length)===0||((nt=r$3==null?void 0:r$3.include)===null||nt===void 0?void 0:nt.includes(ft))}).map(function(Be){return[Be[0],(0,Be[1])()]}))};function c$2(Be){return Be^=Be>>>16,Be=Math.imul(Be,2246822507),Be^=Be>>>13,Be=Math.imul(Be,3266489909),(Be^=Be>>>16)>>>0}var s$2=new Uint32Array([597399067,2869860233,951274213,2716044179]);function l(Be,Le){return Be<<Le|Be>>>32-Le}function d(Be,Le){var Ye;if(Le===void 0&&(Le=0),Le=Le?0|Le:0,typeof Be=="string"&&(Ye=Be,Be=new TextEncoder().encode(Ye).buffer),!(Be instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");var tt=new Uint32Array([Le,Le,Le,Le]);(function(ft,ht){for(var gt=ft.byteLength/16|0,At=new Uint32Array(ft,0,4*gt),xt=0;xt<gt;xt++){var Et=At.subarray(4*xt,4*(xt+1));Et[0]=Math.imul(Et[0],s$2[0]),Et[0]=l(Et[0],15),Et[0]=Math.imul(Et[0],s$2[1]),ht[0]=ht[0]^Et[0],ht[0]=l(ht[0],19),ht[0]=ht[0]+ht[1],ht[0]=Math.imul(ht[0],5)+1444728091,Et[1]=Math.imul(Et[1],s$2[1]),Et[1]=l(Et[1],16),Et[1]=Math.imul(Et[1],s$2[2]),ht[1]=ht[1]^Et[1],ht[1]=l(ht[1],17),ht[1]=ht[1]+ht[2],ht[1]=Math.imul(ht[1],5)+197830471,Et[2]=Math.imul(Et[2],s$2[2]),Et[2]=l(Et[2],17),Et[2]=Math.imul(Et[2],s$2[3]),ht[2]=ht[2]^Et[2],ht[2]=l(ht[2],15),ht[2]=ht[2]+ht[3],ht[2]=Math.imul(ht[2],5)+2530024501,Et[3]=Math.imul(Et[3],s$2[3]),Et[3]=l(Et[3],18),Et[3]=Math.imul(Et[3],s$2[0]),ht[3]=ht[3]^Et[3],ht[3]=l(ht[3],13),ht[3]=ht[3]+ht[0],ht[3]=Math.imul(ht[3],5)+850148119}})(Be,tt),function(ft,ht){var gt=ft.byteLength/16|0,At=ft.byteLength%16,xt=new Uint32Array(4),Et=new Uint8Array(ft,16*gt,At);switch(At){case 15:xt[3]=xt[3]^Et[14]<<16;case 14:xt[3]=xt[3]^Et[13]<<8;case 13:xt[3]=xt[3]^Et[12],xt[3]=Math.imul(xt[3],s$2[3]),xt[3]=l(xt[3],18),xt[3]=Math.imul(xt[3],s$2[0]),ht[3]=ht[3]^xt[3];case 12:xt[2]=xt[2]^Et[11]<<24;case 11:xt[2]=xt[2]^Et[10]<<16;case 10:xt[2]=xt[2]^Et[9]<<8;case 9:xt[2]=xt[2]^Et[8],xt[2]=Math.imul(xt[2],s$2[2]),xt[2]=l(xt[2],17),xt[2]=Math.imul(xt[2],s$2[3]),ht[2]=ht[2]^xt[2];case 8:xt[1]=xt[1]^Et[7]<<24;case 7:xt[1]=xt[1]^Et[6]<<16;case 6:xt[1]=xt[1]^Et[5]<<8;case 5:xt[1]=xt[1]^Et[4],xt[1]=Math.imul(xt[1],s$2[1]),xt[1]=l(xt[1],16),xt[1]=Math.imul(xt[1],s$2[2]),ht[1]=ht[1]^xt[1];case 4:xt[0]=xt[0]^Et[3]<<24;case 3:xt[0]=xt[0]^Et[2]<<16;case 2:xt[0]=xt[0]^Et[1]<<8;case 1:xt[0]=xt[0]^Et[0],xt[0]=Math.imul(xt[0],s$2[0]),xt[0]=l(xt[0],15),xt[0]=Math.imul(xt[0],s$2[1]),ht[0]=ht[0]^xt[0]}}(Be,tt),function(ft,ht){ht[0]=ht[0]^ft.byteLength,ht[1]=ht[1]^ft.byteLength,ht[2]=ht[2]^ft.byteLength,ht[3]=ht[3]^ft.byteLength,ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0,ht[0]=c$2(ht[0]),ht[1]=c$2(ht[1]),ht[2]=c$2(ht[2]),ht[3]=c$2(ht[3]),ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0}(Be,tt);var nt=new Uint8Array(tt.buffer);return Array.from(nt).map(function(ft){return ft.toString(16).padStart(2,"0")}).join("")}function f$1(Be,Le){return new Promise(function(Ye){setTimeout(function(){return Ye(Le)},Be)})}function m$1(Be,Le,Ye){return Promise.all(Be.map(function(tt){return Promise.race([tt,f$1(Le,Ye)])}))}function g(){return e$1(this,void 0,void 0,function(){var Be,Le,Ye,tt,nt;return n$1(this,function(ft){switch(ft.label){case 0:return ft.trys.push([0,2,,3]),Be=u(),Le=Object.keys(Be),[4,m$1(Object.values(Be),(r$3==null?void 0:r$3.timeout)||1e3,a$2)];case 1:return Ye=ft.sent(),tt=Ye.filter(function(ht){return ht!==void 0}),nt={},tt.forEach(function(ht,gt){nt[Le[gt]]=ht}),[2,p(nt,r$3.exclude||[],r$3.include||[],"")];case 2:throw ft.sent();case 3:return[2]}})})}function p(Be,Le,Ye,tt){tt===void 0&&(tt="");for(var nt={},ft=function(xt,Et){var yt=tt+xt+".";if(typeof Et!="object"||Array.isArray(Et)){var Ct=Le.some(function(bt){return yt.startsWith(bt)}),kt=Ye.some(function(bt){return yt.startsWith(bt)});Ct&&!kt||(nt[xt]=Et)}else{var vt=p(Et,Le,Ye,yt);Object.keys(vt).length>0&&(nt[xt]=vt)}},ht=0,gt=Object.entries(Be);ht<gt.length;ht++){var At=gt[ht];ft(At[0],At[1])}return nt}function w$d(Be){return e$1(this,void 0,void 0,function(){var Le,Ye;return n$1(this,function(tt){switch(tt.label){case 0:return tt.trys.push([0,2,,3]),[4,g()];case 1:return Le=tt.sent(),Ye=d(JSON.stringify(Le)),Math.random()<1e-5&&r$3.logging&&function(nt,ft){e$1(this,void 0,void 0,function(){var ht,gt;return n$1(this,function(At){switch(At.label){case 0:if(ht="https://logging.thumbmarkjs.com/v1/log",gt={thumbmark:nt,components:ft,version:"0.20.6"},sessionStorage.getItem("_tmjs_l"))return[3,4];sessionStorage.setItem("_tmjs_l","1"),At.label=1;case 1:return At.trys.push([1,3,,4]),[4,fetch(ht,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)})];case 2:case 3:return At.sent(),[3,4];case 4:return[2]}})})}(Ye,Le),[2,Ye.toString()];case 2:throw tt.sent();case 3:return[2]}})})}function b$1(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};for(var Be=navigator.userAgent,Le={edg:"Edge",opr:"Opera",samsung:"SamsungBrowser"},Ye=0,tt=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/,/(?<name>samsung).*Version\/(?<version>\d+(?:\.\d+)?)/i,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/];Ye<tt.length;Ye++){var nt=tt[Ye],ft=Be.match(nt);if(ft&&ft.groups)return{name:Le[ft.groups.name.toLowerCase()]||ft.groups.name,version:ft.groups.version}}return{name:"unknown",version:"unknown"}}function S(Be){for(var Le=0,Ye=0;Ye<Be.length;++Ye)Le+=Math.abs(Be[Ye]);return Le}var M=b$1();function E(Be,Le,Ye){for(var tt=[],nt=0;nt<Be[0].data.length;nt++){for(var ft=[],ht=0;ht<Be.length;ht++)ft.push(Be[ht].data[nt]);tt.push(P(ft))}var gt=new Uint8ClampedArray(tt);return new ImageData(gt,Le,Ye)}function P(Be){if(Be.length===0)return 0;for(var Le={},Ye=0,tt=Be;Ye<tt.length;Ye++)Le[ft=tt[Ye]]=(Le[ft]||0)+1;var nt=Be[0];for(var ft in Le)Le[ft]>Le[nt]&&(nt=parseInt(ft,10));return nt}["SamsungBrowser","Safari"].includes(M.name)||i$4("audio",function(){return e$1(this,void 0,void 0,function(){return n$1(this,function(Be){return[2,new Promise(function(Le,Ye){try{var tt=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),nt=tt.createBufferSource(),ft=tt.createOscillator();ft.frequency.value=1e3;var ht,gt=tt.createDynamicsCompressor();gt.threshold.value=-50,gt.knee.value=40,gt.ratio.value=12,gt.attack.value=0,gt.release.value=.2,ft.connect(gt),gt.connect(tt.destination),ft.start(),tt.oncomplete=function(At){ht=At.renderedBuffer.getChannelData(0),Le({sampleHash:S(ht),oscillator:ft.type,maxChannels:tt.destination.maxChannelCount,channelCountMode:nt.channelCountMode})},tt.startRendering()}catch(At){console.error("Error creating audio fingerprint:",At),Ye(At)}})]})})});var A=b$1(),C=A.name.toLowerCase(),x=A.version.split(".")[0]||"0",T=parseInt(x,10);C==="firefox"||C==="safari"&&T===17||i$4("canvas",function(){return document.createElement("canvas").getContext("2d"),new Promise(function(Be){var Le=Array.from({length:3},function(){return function(){var Ye=document.createElement("canvas"),tt=Ye.getContext("2d");if(!tt)return new ImageData(1,1);Ye.width=280,Ye.height=20;var nt=tt.createLinearGradient(0,0,Ye.width,Ye.height);nt.addColorStop(0,"red"),nt.addColorStop(.16666666666666666,"orange"),nt.addColorStop(.3333333333333333,"yellow"),nt.addColorStop(.5,"green"),nt.addColorStop(.6666666666666666,"blue"),nt.addColorStop(.8333333333333334,"indigo"),nt.addColorStop(1,"violet"),tt.fillStyle=nt,tt.fillRect(0,0,Ye.width,Ye.height);var ft="Random Text WMwmil10Oo";return tt.font="23.123px Arial",tt.fillStyle="black",tt.fillText(ft,-5,15),tt.fillStyle="rgba(0, 0, 255, 0.5)",tt.fillText(ft,-3.3,17.7),tt.beginPath(),tt.moveTo(0,0),tt.lineTo(2*Ye.width/7,Ye.height),tt.strokeStyle="white",tt.lineWidth=2,tt.stroke(),tt.getImageData(0,0,Ye.width,Ye.height)}()});Be({commonImageDataHash:d(E(Le,280,20).data.toString()).toString()})})});var k,I=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],R$1=["monospace","sans-serif","serif"];function L(Be,Le){if(!Be)throw new Error("Canvas context not supported");return Be.font,Be.font="72px ".concat(Le),Be.measureText("WwMmLli0Oo").width}function _$1(){var Be,Le=document.createElement("canvas"),Ye=(Be=Le.getContext("webgl"))!==null&&Be!==void 0?Be:Le.getContext("experimental-webgl");if(Ye&&"getParameter"in Ye)try{var tt=(Ye.getParameter(Ye.VENDOR)||"").toString(),nt=(Ye.getParameter(Ye.RENDERER)||"").toString(),ft={vendor:tt,renderer:nt,version:(Ye.getParameter(Ye.VERSION)||"").toString(),shadingLanguageVersion:(Ye.getParameter(Ye.SHADING_LANGUAGE_VERSION)||"").toString()};if(!nt.length||!tt.length){var ht=Ye.getExtension("WEBGL_debug_renderer_info");if(ht){var gt=(Ye.getParameter(ht.UNMASKED_VENDOR_WEBGL)||"").toString(),At=(Ye.getParameter(ht.UNMASKED_RENDERER_WEBGL)||"").toString();gt&&(ft.vendorUnmasked=gt),At&&(ft.rendererUnmasked=At)}}return ft}catch{}return"undefined"}function O(){var Be=new Float32Array(1),Le=new Uint8Array(Be.buffer);return Be[0]=1/0,Be[0]=Be[0]-Be[0],Le[3]}function B(Be,Le){var Ye={};return Le.forEach(function(tt){var nt=function(ft){if(ft.length===0)return null;var ht={};ft.forEach(function(xt){var Et=String(xt);ht[Et]=(ht[Et]||0)+1});var gt=ft[0],At=1;return Object.keys(ht).forEach(function(xt){ht[xt]>At&&(gt=xt,At=ht[xt])}),gt}(Be.map(function(ft){return tt in ft?ft[tt]:void 0}).filter(function(ft){return ft!==void 0}));nt&&(Ye[tt]=nt)}),Ye}function D(){var Be=[],Le={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(Le).forEach(function(Ye){Le[Ye].forEach(function(tt){matchMedia("(".concat(Ye,": ").concat(tt,")")).matches&&Be.push("".concat(Ye,": ").concat(tt))})}),Be}b$1().name!="Firefox"&&i$4("fonts",function(){var Be=this;return new Promise(function(Le,Ye){try{(function(tt){var nt;e$1(this,void 0,void 0,function(){var ft,ht,gt;return n$1(this,function(At){switch(At.label){case 0:return document.body?[3,2]:[4,(xt=50,new Promise(function(yt){return setTimeout(yt,xt,Et)}))];case 1:return At.sent(),[3,0];case 2:if((ft=document.createElement("iframe")).setAttribute("frameBorder","0"),(ht=ft.style).setProperty("position","fixed"),ht.setProperty("display","block","important"),ht.setProperty("visibility","visible"),ht.setProperty("border","0"),ht.setProperty("opacity","0"),ft.src="about:blank",document.body.appendChild(ft),!(gt=ft.contentDocument||((nt=ft.contentWindow)===null||nt===void 0?void 0:nt.document)))throw new Error("Iframe document is not accessible");return tt({iframe:gt}),setTimeout(function(){document.body.removeChild(ft)},0),[2]}var xt,Et})})})(function(tt){var nt=tt.iframe;return e$1(Be,void 0,void 0,function(){var ft,ht,gt,At;return n$1(this,function(xt){return ft=nt.createElement("canvas"),ht=ft.getContext("2d"),gt=R$1.map(function(Et){return L(ht,Et)}),At={},I.forEach(function(Et){var yt=L(ht,Et);gt.includes(yt)||(At[Et]=yt)}),Le(At),[2]})})})}catch{Ye({error:"unsupported"})}})}),i$4("hardware",function(){return new Promise(function(Be,Le){var Ye=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,tt=window.performance&&window.performance.memory?window.performance.memory:0;Be({videocard:_$1(),architecture:O(),deviceMemory:Ye.toString()||"undefined",jsHeapSizeLimit:tt.jsHeapSizeLimit||0})})}),i$4("locales",function(){return new Promise(function(Be){Be({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}),i$4("permissions",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){return k=(r$3==null?void 0:r$3.permissions_to_check)||["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],b$1().name.toLowerCase()==="safari"&&(k=k.filter(function(Ye){return!["camera","geolocation","microphone"].includes(Ye)})),Be=Array.from({length:(r$3==null?void 0:r$3.retries)||3},function(){return function(){return e$1(this,void 0,void 0,function(){var Ye,tt,nt,ft,ht;return n$1(this,function(gt){switch(gt.label){case 0:Ye={},tt=0,nt=k,gt.label=1;case 1:if(!(tt<nt.length))return[3,6];ft=nt[tt],gt.label=2;case 2:return gt.trys.push([2,4,,5]),[4,navigator.permissions.query({name:ft})];case 3:return ht=gt.sent(),Ye[ft]=ht.state.toString(),[3,5];case 4:return gt.sent(),[3,5];case 5:return tt++,[3,1];case 6:return[2,Ye]}})})}()}),[2,Promise.all(Be).then(function(Ye){return B(Ye,k)})]})})}),i$4("plugins",function(){var Be=[];if(navigator.plugins)for(var Le=0;Le<navigator.plugins.length;Le++){var Ye=navigator.plugins[Le];Be.push([Ye.name,Ye.filename,Ye.description].join("|"))}return new Promise(function(tt){tt({plugins:Be})})}),i$4("screen",function(){return new Promise(function(Be){Be({is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:D()})})}),i$4("system",function(){return new Promise(function(Be){var Le=b$1(),Ye={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:Le.name,version:Le.version}};Le.name.toLowerCase()!=="safari"&&(Ye.applePayVersion=function(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{for(var tt=window.ApplePaySession.supportsVersion,nt=15;nt>0;nt--)if(tt(nt))return nt}catch{return 0}return 0}(),Ye.cookieEnabled=window.navigator.cookieEnabled),Be(Ye)})});var U,N=b$1().name!=="SamsungBrowser"?1:3,F=null;i$4("webgl",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){typeof document<"u"&&((U=document.createElement("canvas")).width=200,U.height=100,F=U.getContext("webgl"));try{if(!F)throw new Error("WebGL not supported");return Be=Array.from({length:N},function(){return function(){try{if(!F)throw new Error("WebGL not supported");var Ye=`
|
|
66
|
+
`;typeof Promise.withResolvers!="function"&&(Promise.withResolvers=()=>{let Be,Le;return{promise:new Promise((tt,nt)=>{Be=tt,Le=nt}),resolve:Be,reject:Le}});class InterruptionHandler{constructor(){this.boundVisibilityChange=this.handleVisibilityChange.bind(this),this.boundOnline=this.handleOnline.bind(this),this.boundOffline=this.handleOffline.bind(this),this.boundUnhandledRejection=this.handleUnhandledRejection.bind(this),this.boundError=this.handleError.bind(this),this.initialized=!1}registerEventListeners(){this.initialized||(document.addEventListener("visibilitychange",this.boundVisibilityChange),window.addEventListener("online",this.boundOnline),window.addEventListener("offline",this.boundOffline),window.addEventListener("unhandledrejection",this.boundUnhandledRejection),window.addEventListener("error",this.boundError),this.initialized=!0)}removeEventListeners(){this.initialized&&(this.initialized=!1,document.removeEventListener("visibilitychange",this.boundVisibilityChange),window.removeEventListener("online",this.boundOnline),window.removeEventListener("offline",this.boundOffline),window.removeEventListener("unhandledrejection",this.boundUnhandledRejection),window.removeEventListener("error",this.boundError))}handleVisibilityChange(){document.hidden?this.onAppHidden():this.onAppVisible()}onAppHidden(){}onAppVisible(){}handleOnline(){}handleOffline(){}handleUnhandledRejection(Le){}handleError(Le){}}const regex$1={CURP_PATTERN:/^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,EMAIL_PATTERN:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,SSN_PATTERN:/^\d{3}-?\d{2}-?\d{4}$/};function webgl(){let Be,Le,Ye=256,tt=128;Be=document.body.appendChild(document.createElement("canvas")),Be.width=Ye,Be.height=tt;try{Le=Be.getContext("webgl2")||Be.getContext("experimental-webgl2")||Be.getContext("webgl")||Be.getContext("experimental-webgl")||Be.getContext("moz-webgl");const nt="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",ft="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",ht=Le.createBuffer();Le.bindBuffer(Le.ARRAY_BUFFER,ht);const gt=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0]);Le.bufferData(Le.ARRAY_BUFFER,gt,Le.STATIC_DRAW),ht.itemSize=3,ht.numItems=3;const At=Le.createProgram(),xt=Le.createShader(Le.VERTEX_SHADER);Le.shaderSource(xt,nt),Le.compileShader(xt);const Et=Le.createShader(Le.FRAGMENT_SHADER);Le.shaderSource(Et,ft),Le.compileShader(Et),Le.attachShader(At,xt),Le.attachShader(At,Et),Le.linkProgram(At),Le.useProgram(At),At.vertexPosAttrib=Le.getAttribLocation(At,"attrVertex"),At.offsetUniform=Le.getUniformLocation(At,"uniformOffset"),Le.enableVertexAttribArray(At.vertexPosAttrib),Le.vertexAttribPointer(At.vertexPosAttrib,ht.itemSize,Le.FLOAT,!1,0,0),Le.uniform2f(At.offsetUniform,1,1),Le.drawArrays(Le.TRIANGLE_STRIP,0,ht.numItems);let yt="";const Ct=new Uint8Array(Ye*tt*4);return Le.readPixels(0,0,Ye,tt,Le.RGBA,Le.UNSIGNED_BYTE,Ct),yt=JSON.stringify(Ct).replace(/,?"[0-9]+":/g,""),document.body.removeChild(Be),sha256(yt)}catch{return""}}const sha256=(()=>{let Be=1,Le,Ye=[],tt=[];for(;++Be<18;)for(Le=Be*Be;Le<312;Le+=Be)Ye[Le]=1;function nt(gt,At){return Math.pow(gt,1/At)%1*4294967296|0}for(Be=1,Le=0;Be<313;)Ye[++Be]||(tt[Le]=nt(Be,2),Ye[Le++]=nt(Be,3));function ft(gt,At){return gt>>>At|gt<<32-At}function ht(gt){let At=tt.slice(Be=0),xt=unescape(encodeURI(gt)),Et=[],yt=xt.length,Ct=[],kt,vt,bt;for(;Be<yt;)Ct[Be>>2]|=(xt.charCodeAt(Be)&255)<<8*(3-Be++%4);for(yt*=8,Ct[yt>>5]|=128<<24-yt%32,Ct[bt=yt+64>>5|15]=yt,Be=0;Be<bt;Be+=16){for(kt=At.slice(Le=0,8);Le<64;kt[4]+=vt)Le<16?Et[Le]=Ct[Le+Be]:Et[Le]=(ft(vt=Et[Le-2],17)^ft(vt,19)^vt>>>10)+(Et[Le-7]|0)+(ft(vt=Et[Le-15],7)^ft(vt,18)^vt>>>3)+(Et[Le-16]|0),kt.unshift((vt=(kt.pop()+(ft(gt=kt[4],6)^ft(gt,11)^ft(gt,25))+((gt&kt[5]^~gt&kt[6])+Ye[Le])|0)+(Et[Le++]|0))+(ft(yt=kt[0],2)^ft(yt,13)^ft(yt,22))+(yt&kt[1]^kt[1]&kt[2]^kt[2]&yt));for(Le=8;Le--;)At[Le]=kt[Le]+At[Le]}for(xt="";Le<63;)xt+=(At[++Le>>3]>>4*(7-Le%8)&15).toString(16);return xt}return ht})();var store;function getGlobalConfig$1(Be){return{lang:store==null?void 0:store.lang,message:Be==null?void 0:Be.message,abortEarly:store==null?void 0:store.abortEarly,abortPipeEarly:store==null?void 0:store.abortPipeEarly}}var store2;function getGlobalMessage$1(Be){return store2==null?void 0:store2.get(Be)}var store3;function getSchemaMessage$1(Be){return store3==null?void 0:store3.get(Be)}var store4;function getSpecificMessage$1(Be,Le){var Ye;return(Ye=store4==null?void 0:store4.get(Be))==null?void 0:Ye.get(Le)}function _stringify$4(Be){var Ye,tt;const Le=typeof Be;return Le==="string"?`"${Be}"`:Le==="number"||Le==="bigint"||Le==="boolean"?`${Be}`:Le==="object"||Le==="function"?(Be&&((tt=(Ye=Object.getPrototypeOf(Be))==null?void 0:Ye.constructor)==null?void 0:tt.name))??"null":Le}function _addIssue$1(Be,Le,Ye,tt,nt){const ft=nt&&"input"in nt?nt.input:Ye.value,ht=(nt==null?void 0:nt.expected)??Be.expects??null,gt=(nt==null?void 0:nt.received)??_stringify$4(ft),At={kind:Be.kind,type:Be.type,input:ft,expected:ht,received:gt,message:`Invalid ${Le}: ${ht?`Expected ${ht} but r`:"R"}eceived ${gt}`,requirement:Be.requirement,path:nt==null?void 0:nt.path,issues:nt==null?void 0:nt.issues,lang:tt.lang,abortEarly:tt.abortEarly,abortPipeEarly:tt.abortPipeEarly},xt=Be.kind==="schema",Et=(nt==null?void 0:nt.message)??Be.message??getSpecificMessage$1(Be.reference,At.lang)??(xt?getSchemaMessage$1(At.lang):null)??tt.message??getGlobalMessage$1(At.lang);Et!==void 0&&(At.message=typeof Et=="function"?Et(At):Et),xt&&(Ye.typed=!1),Ye.issues?Ye.issues.push(At):Ye.issues=[At]}function _getStandardProps$1(Be){return{version:1,vendor:"valibot",validate(Le){return Be["~run"]({value:Le},getGlobalConfig$1())}}}function _joinExpects(Be,Le){const Ye=[...new Set(Be)];return Ye.length>1?`(${Ye.join(` ${Le} `)})`:Ye[0]??"never"}function isValiError(Be){return Be instanceof ValiError}var ValiError=class extends Error{constructor(Be){super(Be[0].message),this.name="ValiError",this.issues=Be}};function getFallback$1(Be,Le,Ye){return typeof Be.fallback=="function"?Be.fallback(Le,Ye):Be.fallback}function getDefault$1(Be,Le,Ye){return typeof Be.default=="function"?Be.default(Le,Ye):Be.default}function boolean$2(Be){return{kind:"schema",type:"boolean",reference:boolean$2,expects:"boolean",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="boolean"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function custom(Be,Le){return{kind:"schema",type:"custom",reference:custom,expects:"unknown",async:!1,check:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return this.check(Ye.value)?Ye.typed=!0:_addIssue$1(this,"type",Ye,tt),Ye}}}function function_(Be){return{kind:"schema",type:"function",reference:function_,expects:"Function",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="function"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function literal(Be,Le){return{kind:"schema",type:"literal",reference:literal,expects:_stringify$4(Be),async:!1,literal:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return Ye.value===this.literal?Ye.typed=!0:_addIssue$1(this,"type",Ye,tt),Ye}}}function null_(Be){return{kind:"schema",type:"null",reference:null_,expects:"null",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return Le.value===null?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function number$3(Be){return{kind:"schema",type:"number",reference:number$3,expects:"number",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="number"&&!isNaN(Le.value)?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function object$1(Be,Le){return{kind:"schema",type:"object",reference:object$1,expects:"Object",async:!1,entries:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){var ft;const nt=Ye.value;if(nt&&typeof nt=="object"){Ye.typed=!0,Ye.value={};for(const ht in this.entries){const gt=this.entries[ht];if(ht in nt||(gt.type==="exact_optional"||gt.type==="optional"||gt.type==="nullish")&>.default!==void 0){const At=ht in nt?nt[ht]:getDefault$1(gt),xt=gt["~run"]({value:At},tt);if(xt.issues){const Et={type:"object",origin:"value",input:nt,key:ht,value:At};for(const yt of xt.issues)yt.path?yt.path.unshift(Et):yt.path=[Et],(ft=Ye.issues)==null||ft.push(yt);if(Ye.issues||(Ye.issues=xt.issues),tt.abortEarly){Ye.typed=!1;break}}xt.typed||(Ye.typed=!1),Ye.value[ht]=xt.value}else if(gt.fallback!==void 0)Ye.value[ht]=getFallback$1(gt);else if(gt.type!=="exact_optional"&>.type!=="optional"&>.type!=="nullish"&&(_addIssue$1(this,"key",Ye,tt,{input:void 0,expected:`"${ht}"`,path:[{type:"object",origin:"key",input:nt,key:ht,value:nt[ht]}]}),tt.abortEarly))break}}else _addIssue$1(this,"type",Ye,tt);return Ye}}}function optional$1(Be,Le){return{kind:"schema",type:"optional",reference:optional$1,expects:`(${Be.expects} | undefined)`,async:!1,wrapped:Be,default:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){return Ye.value===void 0&&(this.default!==void 0&&(Ye.value=getDefault$1(this,Ye,tt)),Ye.value===void 0)?(Ye.typed=!0,Ye):this.wrapped["~run"](Ye,tt)}}}function string$3(Be){return{kind:"schema",type:"string",reference:string$3,expects:"string",async:!1,message:Be,get"~standard"(){return _getStandardProps$1(this)},"~run"(Le,Ye){return typeof Le.value=="string"?Le.typed=!0:_addIssue$1(this,"type",Le,Ye),Le}}}function _subIssues(Be){let Le;if(Be)for(const Ye of Be)Le?Le.push(...Ye.issues):Le=Ye.issues;return Le}function union(Be,Le){return{kind:"schema",type:"union",reference:union,expects:_joinExpects(Be.map(Ye=>Ye.expects),"|"),async:!1,options:Be,message:Le,get"~standard"(){return _getStandardProps$1(this)},"~run"(Ye,tt){let nt,ft,ht;for(const gt of this.options){const At=gt["~run"]({value:Ye.value},tt);if(At.typed)if(At.issues)ft?ft.push(At):ft=[At];else{nt=At;break}else ht?ht.push(At):ht=[At]}if(nt)return nt;if(ft){if(ft.length===1)return ft[0];_addIssue$1(this,"type",Ye,tt,{issues:_subIssues(ft)}),Ye.typed=!0}else{if((ht==null?void 0:ht.length)===1)return ht[0];_addIssue$1(this,"type",Ye,tt,{issues:_subIssues(ht)})}return Ye}}}function parse$8(Be,Le,Ye){const tt=Be["~run"]({value:Le},getGlobalConfig$1(Ye));if(tt.issues)throw new ValiError(tt.issues);return tt.value}function validate$2(...Be){try{Be.forEach(({schema:Le,value:Ye})=>parse$8(Le,Ye))}catch(Le){if(isValiError(Le)){const Ye=Le.issues.map(tt=>{var ft;return`${((ft=tt.path)==null?void 0:ft.map(ht=>ht.key).join("."))||"root"}: ${tt.message}`}).join(", ");throw new Error(`Validation failed: ${Ye}`)}throw Le}}exports.api=void 0;function setApi(Be){exports.api=Be}function setToken(Be){exports.api.defaults.headers["X-Incode-Hardware-Id"]=Be}const eventsQueue=[];function addEvent(Be){const{token:Le,code:Ye,module:tt,screen:nt,clientTimestamp:ft,payload:ht={}}=Be;if(!Le){eventsQueue.push(Be);return}return exports.api.post("/omni/interview-events",[{code:Ye,module:tt,screen:nt,clientTimestamp:ft??new Date().getTime(),payload:ht}],{headers:{"X-Incode-Hardware-Id":Le}}).catch(()=>{})}function emptyQueue(Be){eventsQueue.forEach(Le=>{addEvent({...Le,token:Be})})}const state={token:null};var PipelineProfileName=(Be=>(Be[Be.IdCapture_2_01=0]="IdCapture_2_01",Be[Be.IdCapture_2_02=1]="IdCapture_2_02",Be[Be.IdCapture_3_02=2]="IdCapture_3_02",Be[Be.IdVideoSelfie_2_01=3]="IdVideoSelfie_2_01",Be[Be.SelfieWithAggregationMetrics=4]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=5]="SelfieWithQualityMetrics",Be[Be.SelfieVideoSelfie=6]="SelfieVideoSelfie",Be))(PipelineProfileName||{});class PipelineProfile{constructor(Le,Ye,tt,nt,ft,ht=null,gt=""){this.pipelineType=Le,this.name=Ye,this.detectionType=tt,this.modelNames=nt,this.parameters=ft,this.paramsConfigurator=ht,this.description=gt}reconfigureParams(Le,Ye){if(this.paramsConfigurator==null)throw new Error("PipelineProfile does not have a paramsConfigurator");this.paramsConfigurator(this.parameters,this.pipelineType,Le,Ye)}}var DetectionType=(Be=>(Be[Be.IDCapture=0]="IDCapture",Be[Be.Selfie=1]="Selfie",Be[Be.SelfieVideoSelfie=2]="SelfieVideoSelfie",Be[Be.IdVideoSelfie=3]="IdVideoSelfie",Be))(DetectionType||{}),WasmPipelineType=(Be=>(Be[Be.IdBlurGlarePipeline=0]="IdBlurGlarePipeline",Be[Be.IdBarcodeAndTextQualityPipeline=1]="IdBarcodeAndTextQualityPipeline",Be[Be.IdVideoSelfiePipeline=2]="IdVideoSelfiePipeline",Be[Be.SelfieWithAggregationMetrics=3]="SelfieWithAggregationMetrics",Be[Be.SelfieWithQualityMetrics=4]="SelfieWithQualityMetrics",Be[Be.IdFaceDetectionPipeline=5]="IdFaceDetectionPipeline",Be))(WasmPipelineType||{}),IdCaptureModelType=(Be=>(Be[Be.IdCaptureV1x=0]="IdCaptureV1x",Be[Be.IdCaptureV2x=1]="IdCaptureV2x",Be[Be.IdCaptureV3x=2]="IdCaptureV3x",Be))(IdCaptureModelType||{}),src$2={},src$1={},$_StatsigGlobal={},Log={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Log=Be.LogLevel=void 0;const Le=" DEBUG ",Ye=" INFO ",tt=" WARN ",nt=" ERROR ";function ft(gt){return gt.unshift("[Statsig]"),gt}Be.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class ht{static info(...At){ht.level>=Be.LogLevel.Info&&console.info(Ye,...ft(At))}static debug(...At){ht.level>=Be.LogLevel.Debug&&console.debug(Le,...ft(At))}static warn(...At){ht.level>=Be.LogLevel.Warn&&console.warn(tt,...ft(At))}static error(...At){ht.level>=Be.LogLevel.Error&&console.error(nt,...ft(At))}}Be.Log=ht,ht.level=Be.LogLevel.Warn})(Log),function(Be){var Le,Ye,tt;Object.defineProperty(Be,"__esModule",{value:!0}),Be._getInstance=Be._getStatsigGlobalFlag=Be._getStatsigGlobal=void 0;const nt=Log,ft=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:Ct}catch{return Ct}};Be._getStatsigGlobal=ft;const ht=kt=>(0,Be._getStatsigGlobal)()[kt];Be._getStatsigGlobalFlag=ht;const gt=kt=>{const vt=(0,Be._getStatsigGlobal)();return kt?vt.instances&&vt.instances[kt]:(vt.instances&&Object.keys(vt.instances).length>1&&nt.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),vt.firstInstance)};Be._getInstance=gt;const At="__STATSIG__",xt=typeof window<"u"?window:{},Et=typeof commonjsGlobal<"u"?commonjsGlobal:{},yt=typeof globalThis<"u"?globalThis:{},Ct=(tt=(Ye=(Le=xt[At])!==null&&Le!==void 0?Le:Et[At])!==null&&Ye!==void 0?Ye:yt[At])!==null&&tt!==void 0?tt:{instance:Be._getInstance};xt[At]=Ct,Et[At]=Ct,yt[At]=Ct}($_StatsigGlobal);var Diagnostics={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.Diagnostics=void 0;const Le=new Map,Ye="start",tt="end",nt="statsig::diagnostics";Be.Diagnostics={_getMarkers:xt=>Le.get(xt),_markInitOverallStart:xt=>{gt(xt,ft({},Ye,"overall"))},_markInitOverallEnd:(xt,Et,yt)=>{gt(xt,ft({success:Et,error:Et?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:yt},tt,"overall"))},_markInitNetworkReqStart:(xt,Et)=>{gt(xt,ft(Et,Ye,"initialize","network_request"))},_markInitNetworkReqEnd:(xt,Et)=>{gt(xt,ft(Et,tt,"initialize","network_request"))},_markInitProcessStart:xt=>{gt(xt,ft({},Ye,"initialize","process"))},_markInitProcessEnd:(xt,Et)=>{gt(xt,ft(Et,tt,"initialize","process"))},_clearMarkers:xt=>{Le.delete(xt)},_formatError(xt){if(xt&&typeof xt=="object")return{code:At(xt,"code"),name:At(xt,"name"),message:At(xt,"message")}},_getDiagnosticsData(xt,Et,yt,Ct){var kt;return{success:(xt==null?void 0:xt.ok)===!0,statusCode:xt==null?void 0:xt.status,sdkRegion:(kt=xt==null?void 0:xt.headers)===null||kt===void 0?void 0:kt.get("x-statsig-region"),isDelta:yt.includes('"is_delta":true')===!0?!0:void 0,attempt:Et,error:Be.Diagnostics._formatError(Ct)}},_enqueueDiagnosticsEvent(xt,Et,yt,Ct){const kt=Be.Diagnostics._getMarkers(yt);if(kt==null||kt.length<=0)return-1;const vt=kt[kt.length-1].timestamp-kt[0].timestamp;Be.Diagnostics._clearMarkers(yt);const bt=ht(xt,{context:"initialize",markers:kt.slice(),statsigOptions:Ct});return Et.enqueue(bt),vt}};function ft(xt,Et,yt,Ct){return Object.assign({key:yt,action:Et,step:Ct,timestamp:Date.now()},xt)}function ht(xt,Et){return{eventName:nt,user:xt,value:null,metadata:Et,time:Date.now()}}function gt(xt,Et){var yt;const Ct=(yt=Le.get(xt))!==null&&yt!==void 0?yt:[];Ct.push(Et),Le.set(xt,Ct)}function At(xt,Et){if(Et in xt)return xt[Et]}})(Diagnostics);var EventLogger$1={},CacheKey={},Hashing={},TypingUtils={};Object.defineProperty(TypingUtils,"__esModule",{value:!0}),TypingUtils._isTypeMatch=TypingUtils._typeOf=void 0;function _typeOf(Be){return Array.isArray(Be)?"array":typeof Be}TypingUtils._typeOf=_typeOf;function _isTypeMatch(Be,Le){const Ye=tt=>Array.isArray(tt)?"array":tt===null?"null":typeof tt;return Ye(Be)===Ye(Le)}TypingUtils._isTypeMatch=_isTypeMatch,function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getSortedObject=Be._DJB2Object=Be._DJB2=void 0;const Le=TypingUtils,Ye=ft=>{let ht=0;for(let gt=0;gt<ft.length;gt++){const At=ft.charCodeAt(gt);ht=(ht<<5)-ht+At,ht=ht&ht}return String(ht>>>0)};Be._DJB2=Ye;const tt=(ft,ht)=>(0,Be._DJB2)(JSON.stringify((0,Be._getSortedObject)(ft,ht)));Be._DJB2Object=tt;const nt=(ft,ht)=>{if(ft==null)return null;const gt=Object.keys(ft).sort(),At={};return gt.forEach(xt=>{const Et=ft[xt];if(ht===0||(0,Le._typeOf)(Et)!=="object"){At[xt]=Et;return}At[xt]=(0,Be._getSortedObject)(Et,ht!=null?ht-1:ht)}),At};Be._getSortedObject=nt}(Hashing),Object.defineProperty(CacheKey,"__esModule",{value:!0}),CacheKey._getStorageKey=CacheKey._getUserStorageKey=void 0;const Hashing_1$4=Hashing;function _getUserStorageKey(Be,Le,Ye){var tt;if(Ye)return Ye(Be,Le);const nt=Le&&Le.customIDs?Le.customIDs:{},ft=[`uid:${(tt=Le==null?void 0:Le.userID)!==null&&tt!==void 0?tt:""}`,`cids:${Object.keys(nt).sort((ht,gt)=>ht.localeCompare(gt)).map(ht=>`${ht}-${nt[ht]}`).join(",")}`,`k:${Be}`];return(0,Hashing_1$4._DJB2)(ft.join("|"))}CacheKey._getUserStorageKey=_getUserStorageKey;function _getStorageKey(Be,Le,Ye){return Le?_getUserStorageKey(Be,Le,Ye):(0,Hashing_1$4._DJB2)(`k:${Be}`)}CacheKey._getStorageKey=_getStorageKey;var NetworkConfig={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.NetworkParam=Be.NetworkDefault=Be.Endpoint=void 0,Be.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},Be.NetworkDefault={[Be.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[Be.Endpoint._initialize]:"https://featureassets.org/v1",[Be.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},Be.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}})(NetworkConfig);var SafeJs={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._getUnloadEvent=Be._getCurrentPageUrlSafe=Be._addDocumentEventListenerSafe=Be._addWindowEventListenerSafe=Be._isServerEnv=Be._getDocumentSafe=Be._getWindowSafe=void 0;const Le=()=>typeof window<"u"?window:null;Be._getWindowSafe=Le;const Ye=()=>{var At;const xt=(0,Be._getWindowSafe)();return(At=xt==null?void 0:xt.document)!==null&&At!==void 0?At:null};Be._getDocumentSafe=Ye;const tt=()=>{if((0,Be._getDocumentSafe)()!==null)return!1;const At=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||At};Be._isServerEnv=tt;const nt=(At,xt)=>{const Et=(0,Be._getWindowSafe)();typeof(Et==null?void 0:Et.addEventListener)=="function"&&Et.addEventListener(At,xt)};Be._addWindowEventListenerSafe=nt;const ft=(At,xt)=>{const Et=(0,Be._getDocumentSafe)();typeof(Et==null?void 0:Et.addEventListener)=="function"&&Et.addEventListener(At,xt)};Be._addDocumentEventListenerSafe=ft;const ht=()=>{var At;try{return(At=(0,Be._getWindowSafe)())===null||At===void 0?void 0:At.location.href.split(/[?#]/)[0]}catch{return}};Be._getCurrentPageUrlSafe=ht;const gt=()=>{const At=(0,Be._getWindowSafe)();return At&&"onpagehide"in At?"pagehide":"beforeunload"};Be._getUnloadEvent=gt})(SafeJs);var StatsigEvent={};Object.defineProperty(StatsigEvent,"__esModule",{value:!0}),StatsigEvent._createLayerParameterExposure=StatsigEvent._createConfigExposure=StatsigEvent._mapExposures=StatsigEvent._createGateExposure=StatsigEvent._isExposureEvent=void 0;const CONFIG_EXPOSURE_NAME="statsig::config_exposure",GATE_EXPOSURE_NAME="statsig::gate_exposure",LAYER_EXPOSURE_NAME="statsig::layer_exposure",_createExposure=(Be,Le,Ye,tt,nt)=>(Ye.bootstrapMetadata&&(tt.bootstrapMetadata=Ye.bootstrapMetadata),{eventName:Be,user:Le,value:null,metadata:_addEvaluationDetailsToMetadata(Ye,tt),secondaryExposures:nt,time:Date.now()}),_isExposureEvent=({eventName:Be})=>Be===GATE_EXPOSURE_NAME||Be===CONFIG_EXPOSURE_NAME||Be===LAYER_EXPOSURE_NAME;StatsigEvent._isExposureEvent=_isExposureEvent;const _createGateExposure=(Be,Le,Ye)=>{var tt,nt,ft;const ht={gate:Le.name,gateValue:String(Le.value),ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(ht.configVersion=Le.__evaluation.version),_createExposure(GATE_EXPOSURE_NAME,Be,Le.details,ht,_mapExposures((ft=(nt=Le.__evaluation)===null||nt===void 0?void 0:nt.secondary_exposures)!==null&&ft!==void 0?ft:[],Ye))};StatsigEvent._createGateExposure=_createGateExposure;function _mapExposures(Be,Le){return Be.map(Ye=>typeof Ye=="string"?(Le??{})[Ye]:Ye).filter(Ye=>Ye!=null)}StatsigEvent._mapExposures=_mapExposures;const _createConfigExposure=(Be,Le,Ye)=>{var tt,nt,ft,ht;const gt={config:Le.name,ruleID:Le.ruleID};return((tt=Le.__evaluation)===null||tt===void 0?void 0:tt.version)!=null&&(gt.configVersion=Le.__evaluation.version),((nt=Le.__evaluation)===null||nt===void 0?void 0:nt.passed)!=null&&(gt.rulePassed=String(Le.__evaluation.passed)),_createExposure(CONFIG_EXPOSURE_NAME,Be,Le.details,gt,_mapExposures((ht=(ft=Le.__evaluation)===null||ft===void 0?void 0:ft.secondary_exposures)!==null&&ht!==void 0?ht:[],Ye))};StatsigEvent._createConfigExposure=_createConfigExposure;const _createLayerParameterExposure=(Be,Le,Ye,tt)=>{var nt,ft,ht,gt,At,xt,Et;const yt=Le.__evaluation,Ct=((nt=yt==null?void 0:yt.explicit_parameters)===null||nt===void 0?void 0:nt.includes(Ye))===!0;let kt="",vt=(ft=yt==null?void 0:yt.undelegated_secondary_exposures)!==null&&ft!==void 0?ft:[];Ct&&(kt=(ht=yt.allocated_experiment_name)!==null&&ht!==void 0?ht:"",vt=(gt=yt.secondary_exposures)!==null&>!==void 0?gt:[]);const bt=(At=Le.__evaluation)===null||At===void 0?void 0:At.parameter_rule_ids,It={config:Le.name,parameterName:Ye,ruleID:(xt=bt==null?void 0:bt[Ye])!==null&&xt!==void 0?xt:Le.ruleID,allocatedExperiment:kt,isExplicitParameter:String(Ct)};return((Et=Le.__evaluation)===null||Et===void 0?void 0:Et.version)!=null&&(It.configVersion=Le.__evaluation.version),_createExposure(LAYER_EXPOSURE_NAME,Be,Le.details,It,_mapExposures(vt,tt))};StatsigEvent._createLayerParameterExposure=_createLayerParameterExposure;const _addEvaluationDetailsToMetadata=(Be,Le)=>(Le.reason=Be.reason,Be.lcut&&(Le.lcut=String(Be.lcut)),Be.receivedAt&&(Le.receivedAt=String(Be.receivedAt)),Le);var StatsigOptionsCommon={};Object.defineProperty(StatsigOptionsCommon,"__esModule",{value:!0}),StatsigOptionsCommon.LoggingEnabledOption=StatsigOptionsCommon.LogEventCompressionMode=void 0,StatsigOptionsCommon.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},StatsigOptionsCommon.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"};var StorageProvider={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._setObjectInStorage=Be._getObjectFromStorage=Be.Storage=void 0;const Le=Log,Ye=SafeJs,tt={},nt={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:yt=>tt[yt]?tt[yt]:null,setItem:(yt,Ct)=>{tt[yt]=Ct},removeItem:yt=>{delete tt[yt]},getAllKeys:()=>Object.keys(tt)};let ft=null;try{const yt=(0,Ye._getWindowSafe)();yt&&yt.localStorage&&typeof yt.localStorage.getItem=="function"&&(ft={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:Ct=>yt.localStorage.getItem(Ct),setItem:(Ct,kt)=>yt.localStorage.setItem(Ct,kt),removeItem:Ct=>yt.localStorage.removeItem(Ct),getAllKeys:()=>Object.keys(yt.localStorage)})}catch{Le.Log.warn("Failed to setup localStorageProvider.")}let ht=ft??nt,gt=ht;function At(yt){try{return yt()}catch(Ct){if(Ct instanceof Error&&Ct.name==="SecurityError")return Be.Storage._setProvider(nt),null;throw Ct}}Be.Storage={isReady:()=>gt.isReady(),isReadyResolver:()=>gt.isReadyResolver(),getProviderName:()=>gt.getProviderName(),getItem:yt=>At(()=>gt.getItem(yt)),setItem:(yt,Ct)=>At(()=>gt.setItem(yt,Ct)),removeItem:yt=>gt.removeItem(yt),getAllKeys:()=>gt.getAllKeys(),_setProvider:yt=>{ht=yt,gt=yt},_setDisabled:yt=>{yt?gt=nt:gt=ht}};function xt(yt){const Ct=Be.Storage.getItem(yt);return JSON.parse(Ct??"null")}Be._getObjectFromStorage=xt;function Et(yt,Ct){Be.Storage.setItem(yt,JSON.stringify(Ct))}Be._setObjectInStorage=Et})(StorageProvider);var UrlConfiguration$1={};Object.defineProperty(UrlConfiguration$1,"__esModule",{value:!0}),UrlConfiguration$1.UrlConfiguration=void 0;const Hashing_1$3=Hashing,NetworkConfig_1$2=NetworkConfig,ENDPOINT_DNS_KEY_MAP={[NetworkConfig_1$2.Endpoint._initialize]:"i",[NetworkConfig_1$2.Endpoint._rgstr]:"e",[NetworkConfig_1$2.Endpoint._download_config_specs]:"d"};class UrlConfiguration{constructor(Le,Ye,tt,nt){this.customUrl=null,this.fallbackUrls=null,this.endpoint=Le,this.endpointDnsKey=ENDPOINT_DNS_KEY_MAP[Le],Ye&&(this.customUrl=Ye),!Ye&&tt&&(this.customUrl=tt.endsWith("/")?`${tt}${Le}`:`${tt}/${Le}`),nt&&(this.fallbackUrls=nt);const ft=NetworkConfig_1$2.NetworkDefault[Le];this.defaultUrl=`${ft}/${Le}`}getUrl(){var Le;return(Le=this.customUrl)!==null&&Le!==void 0?Le:this.defaultUrl}getChecksum(){var Le;const Ye=((Le=this.fallbackUrls)!==null&&Le!==void 0?Le:[]).sort().join(",");return(0,Hashing_1$3._DJB2)(this.customUrl+Ye)}}UrlConfiguration$1.UrlConfiguration=UrlConfiguration;var VisibilityObserving={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._notifyVisibilityChanged=Be._subscribeToVisiblityChanged=Be._isUnloading=Be._isCurrentlyVisible=void 0;const Le=SafeJs,Ye="foreground",tt="background",nt=[];let ft=Ye,ht=!1;const gt=()=>ft===Ye;Be._isCurrentlyVisible=gt;const At=()=>ht;Be._isUnloading=At;const xt=yt=>{nt.unshift(yt)};Be._subscribeToVisiblityChanged=xt;const Et=yt=>{yt!==ft&&(ft=yt,nt.forEach(Ct=>Ct(yt)))};Be._notifyVisibilityChanged=Et,(0,Le._addWindowEventListenerSafe)("focus",()=>{ht=!1,(0,Be._notifyVisibilityChanged)(Ye)}),(0,Le._addWindowEventListenerSafe)("blur",()=>(0,Be._notifyVisibilityChanged)(tt)),(0,Le._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,Be._notifyVisibilityChanged)(document.visibilityState==="visible"?Ye:tt)}),(0,Le._addWindowEventListenerSafe)((0,Le._getUnloadEvent)(),()=>{ht=!0,(0,Be._notifyVisibilityChanged)(tt)})})(VisibilityObserving);var __awaiter$f=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(EventLogger$1,"__esModule",{value:!0}),EventLogger$1.EventLogger=void 0;const CacheKey_1$1=CacheKey,Hashing_1$2=Hashing,Log_1$8=Log,NetworkConfig_1$1=NetworkConfig,SafeJs_1$3=SafeJs,StatsigEvent_1=StatsigEvent,StatsigOptionsCommon_1$2=StatsigOptionsCommon,StorageProvider_1$4=StorageProvider,UrlConfiguration_1=UrlConfiguration$1,VisibilityObserving_1$1=VisibilityObserving,DEFAULT_QUEUE_SIZE=100,DEFAULT_FLUSH_INTERVAL_MS=1e4,MAX_DEDUPER_KEYS=1e3,DEDUPER_WINDOW_DURATION_MS=6e5,MAX_FAILED_LOGS=500,QUICK_FLUSH_WINDOW_MS=200,EVENT_LOGGER_MAP={},RetryFailedLogsTrigger={Startup:"startup",GainedFocus:"gained_focus"};class EventLogger{static _safeFlushAndForget(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye.flush().catch(()=>{})}static _safeRetryFailedLogs(Le){var Ye;(Ye=EVENT_LOGGER_MAP[Le])===null||Ye===void 0||Ye._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus)}constructor(Le,Ye,tt,nt){var ft,ht;this._sdkKey=Le,this._emitter=Ye,this._network=tt,this._options=nt,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=(ft=nt==null?void 0:nt.loggingEnabled)!==null&&ft!==void 0?ft:(nt==null?void 0:nt.disableLogging)===!0?StatsigOptionsCommon_1$2.LoggingEnabledOption.disabled:StatsigOptionsCommon_1$2.LoggingEnabledOption.browserOnly,nt!=null&&nt.loggingEnabled&&nt.disableLogging!==void 0&&Log_1$8.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=(ht=nt==null?void 0:nt.loggingBufferMaxSize)!==null&&ht!==void 0?ht:DEFAULT_QUEUE_SIZE;const gt=nt==null?void 0:nt.networkConfig;this._logEventUrlConfig=new UrlConfiguration_1.UrlConfiguration(NetworkConfig_1$1.Endpoint._rgstr,gt==null?void 0:gt.logEventUrl,gt==null?void 0:gt.api,gt==null?void 0:gt.logEventFallbackUrls)}setLogEventCompressionMode(Le){this._network.setLogEventCompressionMode(Le)}setLoggingEnabled(Le){if(this._loggingEnabled==="disabled"&&Le!=="disabled"){const Ye=this._getStorageKey(),tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);tt&&this._queue.push(...tt),StorageProvider_1$4.Storage.removeItem(Ye)}this._loggingEnabled=Le}enqueue(Le){this._shouldLogEvent(Le)&&(this._normalizeAndAppendEvent(Le),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&EventLogger._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(Le){var Ye;const tt=(Ye=this._nonExposedChecks[Le])!==null&&Ye!==void 0?Ye:0;this._nonExposedChecks[Le]=tt+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var Le;const Ye=(0,SafeJs_1$3._isServerEnv)();Ye&&((Le=this._options)===null||Le===void 0?void 0:Le.loggingEnabled)!=="always"||(EVENT_LOGGER_MAP[this._sdkKey]=this,Ye||(0,VisibilityObserving_1$1._subscribeToVisiblityChanged)(tt=>{tt==="background"?EventLogger._safeFlushAndForget(this._sdkKey):tt==="foreground"&&EventLogger._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(RetryFailedLogsTrigger.Startup),this._startBackgroundFlushInterval())}stop(){return __awaiter$f(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete EVENT_LOGGER_MAP[this._sdkKey],yield this.flush()})}flush(){return __awaiter$f(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),this._queue.length===0)return;const Le=this._queue;this._queue=[],yield this._sendEvents(Le)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,!(Date.now()-this._creationTime>QUICK_FLUSH_WINDOW_MS)&&setTimeout(()=>EventLogger._safeFlushAndForget(this._sdkKey),QUICK_FLUSH_WINDOW_MS))}_shouldLogEvent(Le){var Ye;if(((Ye=this._options)===null||Ye===void 0?void 0:Ye.loggingEnabled)!=="always"&&(0,SafeJs_1$3._isServerEnv)())return!1;if(!(0,StatsigEvent_1._isExposureEvent)(Le))return!0;const tt=Le.user?Le.user:{statsigEnvironment:void 0},nt=(0,CacheKey_1$1._getUserStorageKey)(this._sdkKey,tt),ft=Le.metadata?Le.metadata:{},ht=[Le.eventName,nt,ft.gate,ft.config,ft.ruleID,ft.allocatedExperiment,ft.parameterName,String(ft.isExplicitParameter),ft.reason].join("|"),gt=this._lastExposureTimeMap[ht],At=Date.now();return gt&&At-gt<DEDUPER_WINDOW_DURATION_MS?!1:(Object.keys(this._lastExposureTimeMap).length>MAX_DEDUPER_KEYS&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[ht]=At,!0)}_sendEvents(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye,tt;if(this._loggingEnabled==="disabled")return this._saveFailedLogsToStorage(Le),!1;try{const ft=(0,VisibilityObserving_1$1._isUnloading)()&&this._network.isBeaconSupported()&&((tt=(Ye=this._options)===null||Ye===void 0?void 0:Ye.networkConfig)===null||tt===void 0?void 0:tt.networkOverrideFunc)==null;return this._emitter({name:"pre_logs_flushed",events:Le}),(ft?this._sendEventsViaBeacon(Le):yield this._sendEventsViaPost(Le)).success?(this._emitter({name:"logs_flushed",events:Le}),!0):(Log_1$8.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(Le),!1)}catch{return Log_1$8.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(Le){return __awaiter$f(this,void 0,void 0,function*(){var Ye;const tt=yield this._network.post(this._getRequestData(Le)),nt=(Ye=tt==null?void 0:tt.code)!==null&&Ye!==void 0?Ye:-1;return{success:nt>=200&&nt<300}})}_sendEventsViaBeacon(Le){return{success:this._network.beacon(this._getRequestData(Le))}}_getRequestData(Le){return{sdkKey:this._sdkKey,data:{events:Le},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[NetworkConfig_1$1.NetworkParam.EventCount]:String(Le.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(Le){for(;Le.length>MAX_FAILED_LOGS;)Le.shift();const Ye=this._getStorageKey();try{const tt=this._getFailedLogsFromStorage(Ye);(0,StorageProvider_1$4._setObjectInStorage)(Ye,[...tt,...Le])}catch{Log_1$8.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(Le){let Ye=[];try{const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Le);return Array.isArray(tt)&&(Ye=tt),Ye}catch{return[]}}_retryFailedLogs(Le){const Ye=this._getStorageKey();__awaiter$f(this,void 0,void 0,function*(){StorageProvider_1$4.Storage.isReady()||(yield StorageProvider_1$4.Storage.isReadyResolver());const tt=(0,StorageProvider_1$4._getObjectFromStorage)(Ye);if(!tt)return;Le===RetryFailedLogsTrigger.Startup&&StorageProvider_1$4.Storage.removeItem(Ye),(yield this._sendEvents(tt))&&Le===RetryFailedLogsTrigger.GainedFocus&&StorageProvider_1$4.Storage.removeItem(Ye)}).catch(()=>{Log_1$8.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,Hashing_1$2._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(Le){Le.user&&(Le.user=Object.assign({},Le.user),delete Le.user.privateAttributes);const Ye={},tt=this._getCurrentPageUrl();tt&&(Ye.statsigMetadata={currentPage:tt});const nt=Object.assign(Object.assign({},Le),Ye);Log_1$8.Log.debug("Enqueued Event:",nt),this._queue.push(nt)}_appendAndResetNonExposedChecks(){Object.keys(this._nonExposedChecks).length!==0&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var Le;if(((Le=this._options)===null||Le===void 0?void 0:Le.includeCurrentPageUrlWithEvents)!==!1)return(0,SafeJs_1$3._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var Le,Ye;const tt=(Ye=(Le=this._options)===null||Le===void 0?void 0:Le.loggingIntervalMs)!==null&&Ye!==void 0?Ye:DEFAULT_FLUSH_INTERVAL_MS,nt=setInterval(()=>{const ft=EVENT_LOGGER_MAP[this._sdkKey];!ft||ft._flushIntervalId!==nt?clearInterval(nt):EventLogger._safeFlushAndForget(this._sdkKey)},tt);this._flushIntervalId=nt}}EventLogger$1.EventLogger=EventLogger;var StatsigMetadata={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigMetadataProvider=Be.SDK_VERSION=void 0,Be.SDK_VERSION="3.28.1";let Le={sdkVersion:Be.SDK_VERSION,sdkType:"js-mono"};Be.StatsigMetadataProvider={get:()=>Le,add:Ye=>{Le=Object.assign(Object.assign({},Le),Ye)}}})(StatsigMetadata);var ClientInterfaces={};Object.defineProperty(ClientInterfaces,"__esModule",{value:!0});var DataAdapterCore$1={},StableID={},UUID={};Object.defineProperty(UUID,"__esModule",{value:!0}),UUID.getUUID=void 0;function getUUID(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let Be=new Date().getTime(),Le=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,tt=>{let nt=Math.random()*16;return Be>0?(nt=(Be+nt)%16|0,Be=Math.floor(Be/16)):(nt=(Le+nt)%16|0,Le=Math.floor(Le/16)),(tt==="x"?nt:nt&7|8).toString(16)})}UUID.getUUID=getUUID,Object.defineProperty(StableID,"__esModule",{value:!0}),StableID.getCookieName=StableID.StableID=void 0;const CacheKey_1=CacheKey,Log_1$7=Log,SafeJs_1$2=SafeJs,StorageProvider_1$3=StorageProvider,UUID_1=UUID,PROMISE_MAP={},COOKIE_ENABLED_MAP={},DISABLED_MAP={};StableID.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:Be=>{if(DISABLED_MAP[Be])return null;if(PROMISE_MAP[Be]!=null)return PROMISE_MAP[Be];let Le=null;return Le=_loadFromCookie(Be),Le!=null?(PROMISE_MAP[Be]=Le,_persistToStorage(Le,Be),Le):(Le=_loadFromStorage(Be),Le==null&&(Le=(0,UUID_1.getUUID)()),_persistToStorage(Le,Be),_persistToCookie(Le,Be),PROMISE_MAP[Be]=Le,Le)},setOverride:(Be,Le)=>{PROMISE_MAP[Le]=Be,_persistToStorage(Be,Le),_persistToCookie(Be,Le)},_setCookiesEnabled:(Be,Le)=>{COOKIE_ENABLED_MAP[Be]=Le},_setDisabled:(Be,Le)=>{DISABLED_MAP[Be]=Le}};function _getStableIDStorageKey(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}function _persistToStorage(Be,Le){const Ye=_getStableIDStorageKey(Le);try{(0,StorageProvider_1$3._setObjectInStorage)(Ye,Be)}catch{Log_1$7.Log.warn("Failed to save StableID to storage")}}function _loadFromStorage(Be){const Le=_getStableIDStorageKey(Be);return(0,StorageProvider_1$3._getObjectFromStorage)(Le)}function _loadFromCookie(Be){if(!COOKIE_ENABLED_MAP[Be]||(0,SafeJs_1$2._getDocumentSafe)()==null)return null;const Le=document.cookie.split(";");for(const Ye of Le){const[tt,nt]=Ye.trim().split("=");if(tt===getCookieName(Be))return decodeURIComponent(nt)}return null}function _persistToCookie(Be,Le){if(!COOKIE_ENABLED_MAP[Le]||(0,SafeJs_1$2._getDocumentSafe)()==null)return;const Ye=new Date;Ye.setFullYear(Ye.getFullYear()+1),document.cookie=`${getCookieName(Le)}=${encodeURIComponent(Be)}; expires=${Ye.toUTCString()}; path=/`}function getCookieName(Be){return`statsig.stable_id.${(0,CacheKey_1._getStorageKey)(Be)}`}StableID.getCookieName=getCookieName;var StatsigUser={};Object.defineProperty(StatsigUser,"__esModule",{value:!0}),StatsigUser._getFullUserHash=StatsigUser._normalizeUser=void 0;const Hashing_1$1=Hashing,Log_1$6=Log;function _normalizeUser(Be,Le,Ye){try{const tt=JSON.parse(JSON.stringify(Be));return Le!=null&&Le.environment!=null?tt.statsigEnvironment=Le.environment:Ye!=null&&(tt.statsigEnvironment={tier:Ye}),tt}catch{return Log_1$6.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}}StatsigUser._normalizeUser=_normalizeUser;function _getFullUserHash(Be){return Be?(0,Hashing_1$1._DJB2Object)(Be):null}StatsigUser._getFullUserHash=_getFullUserHash;var TypedJsonParse={};Object.defineProperty(TypedJsonParse,"__esModule",{value:!0}),TypedJsonParse._typedJsonParse=void 0;const Log_1$5=Log;function _typedJsonParse(Be,Le,Ye){try{const tt=JSON.parse(Be);if(tt&&typeof tt=="object"&&Le in tt)return tt}catch{}return Log_1$5.Log.error(`Failed to parse ${Ye}`),null}TypedJsonParse._typedJsonParse=_typedJsonParse;var __awaiter$e=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DataAdapterCore$1,"__esModule",{value:!0}),DataAdapterCore$1._makeDataAdapterResult=DataAdapterCore$1.DataAdapterCore=void 0;const Log_1$4=Log,StableID_1$2=StableID,StatsigUser_1=StatsigUser,StorageProvider_1$2=StorageProvider,TypedJsonParse_1=TypedJsonParse,CACHE_LIMIT=10,MAX_CACHE_WRITE_ATTEMPTS=8;class DataAdapterCore{constructor(Le,Ye){this._adapterName=Le,this._cacheSuffix=Ye,this._options=null,this._sdkKey=null,this._cacheLimit=CACHE_LIMIT,this._lastModifiedStoreKey=`statsig.last_modified_time.${Ye}`,this._inMemoryCache=new InMemoryCache}attach(Le,Ye,tt){this._sdkKey=Le,this._options=Ye}getDataSync(Le){const Ye=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),tt=this._getCacheKey(Ye),nt=this._inMemoryCache.get(tt,Ye);if(nt&&this._getIsCacheValueValid(nt))return nt;const ft=this._loadFromCache(tt);return ft&&this._getIsCacheValueValid(ft)?(this._inMemoryCache.add(tt,ft,this._cacheLimit),this._inMemoryCache.get(tt,Ye)):null}setData(Le,Ye){const tt=Ye&&(0,StatsigUser_1._normalizeUser)(Ye,this._options),nt=this._getCacheKey(tt);this._inMemoryCache.add(nt,_makeDataAdapterResult("Bootstrap",Le,null,tt),this._cacheLimit)}_getIsCacheValueValid(Le){return Le.stableID==null||Le.stableID===StableID_1$2.StableID.get(this._getSdkKey())}_getDataAsyncImpl(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){StorageProvider_1$2.Storage.isReady()||(yield StorageProvider_1$2.Storage.isReadyResolver());const nt=Le??this.getDataSync(Ye),ft=[this._fetchAndPrepFromNetwork(nt,Ye,tt)];return tt!=null&&tt.timeoutMs&&ft.push(new Promise(ht=>setTimeout(ht,tt.timeoutMs)).then(()=>(Log_1$4.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(ft)})}_prefetchDataImpl(Le,Ye){return __awaiter$e(this,void 0,void 0,function*(){const tt=Le&&(0,StatsigUser_1._normalizeUser)(Le,this._options),nt=this._getCacheKey(tt),ft=yield this._getDataAsyncImpl(null,tt,Ye);ft&&this._inMemoryCache.add(nt,Object.assign(Object.assign({},ft),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(Le,Ye,tt){return __awaiter$e(this,void 0,void 0,function*(){var nt;const ft=(nt=Le==null?void 0:Le.data)!==null&&nt!==void 0?nt:null,ht=Le!=null&&this._isCachedResultValidFor204(Le,Ye),gt=yield this._fetchFromNetwork(ft,Ye,tt,ht);if(!gt)return Log_1$4.Log.debug("No response returned for latest value"),null;const At=(0,TypedJsonParse_1._typedJsonParse)(gt,"has_updates","Response"),xt=this._getSdkKey(),Et=StableID_1$2.StableID.get(xt);let yt=null;if((At==null?void 0:At.has_updates)===!0)yt=_makeDataAdapterResult("Network",gt,Et,Ye);else if(ft&&(At==null?void 0:At.has_updates)===!1)yt=_makeDataAdapterResult("NetworkNotModified",ft,Et,Ye);else return null;const Ct=this._getCacheKey(Ye);return this._inMemoryCache.add(Ct,yt,this._cacheLimit),this._writeToCache(Ct,yt),yt})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(Log_1$4.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(Le){var Ye;const tt=(Ye=StorageProvider_1$2.Storage.getItem)===null||Ye===void 0?void 0:Ye.call(StorageProvider_1$2.Storage,Le);if(tt==null)return null;const nt=(0,TypedJsonParse_1._typedJsonParse)(tt,"source","Cached Result");return nt?Object.assign(Object.assign({},nt),{source:"Cache"}):null}_writeToCache(Le,Ye){const tt=JSON.stringify(Ye);for(let nt=0;nt<MAX_CACHE_WRITE_ATTEMPTS;nt++)try{StorageProvider_1$2.Storage.setItem(Le,tt);break}catch(ft){if(!(ft instanceof Error)||!(ft.toString().includes("QuotaExceededError")||ft.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw ft;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(Le,this._cacheLimit-1)}this._runLocalStorageCacheEviction(Le)}_runLocalStorageCacheEviction(Le,Ye=this._cacheLimit){var tt;const nt=(tt=(0,StorageProvider_1$2._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&tt!==void 0?tt:{};nt[Le]=Date.now();const ft=_getEvictableKeys(nt,Ye);for(const ht of ft)delete nt[ht],StorageProvider_1$2.Storage.removeItem(ht);(0,StorageProvider_1$2._setObjectInStorage)(this._lastModifiedStoreKey,nt)}}DataAdapterCore$1.DataAdapterCore=DataAdapterCore;function _makeDataAdapterResult(Be,Le,Ye,tt){return{source:Be,data:Le,receivedAt:Date.now(),stableID:Ye,fullUserHash:(0,StatsigUser_1._getFullUserHash)(tt)}}DataAdapterCore$1._makeDataAdapterResult=_makeDataAdapterResult;class InMemoryCache{constructor(){this._data={}}get(Le,Ye){var tt;const nt=this._data[Le],ft=nt==null?void 0:nt.stableID,ht=(tt=Ye==null?void 0:Ye.customIDs)===null||tt===void 0?void 0:tt.stableID;return ht&&ft&&ht!==ft?(Log_1$4.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):nt}add(Le,Ye,tt){const nt=_getEvictableKeys(this._data,tt-1);for(const ft of nt)delete this._data[ft];this._data[Le]=Ye}merge(Le){this._data=Object.assign(Object.assign({},this._data),Le)}}function _getEvictableKeys(Be,Le){const Ye=Object.keys(Be);return Ye.length<=Le?[]:Le===0?Ye:Ye.sort((tt,nt)=>{const ft=Be[tt],ht=Be[nt];return typeof ft=="object"&&typeof ht=="object"?ft.receivedAt-ht.receivedAt:ft-ht}).slice(0,Ye.length-Le)}var DownloadConfigSpecsResponse={};Object.defineProperty(DownloadConfigSpecsResponse,"__esModule",{value:!0});var ErrorBoundary={},SDKType={};Object.defineProperty(SDKType,"__esModule",{value:!0}),SDKType.SDKType=void 0;const SDK_CLIENT={};let suffix;SDKType.SDKType={_get:Be=>{var Le;return((Le=SDK_CLIENT[Be])!==null&&Le!==void 0?Le:"js-mono")+(suffix??"")},_setClientType(Be,Le){SDK_CLIENT[Be]=Le},_setBindingType(Be){(!suffix||suffix==="-react")&&(suffix="-"+Be)}},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__awaiter||function(yt,Ct,kt,vt){function bt(It){return It instanceof kt?It:new kt(function(wt){wt(It)})}return new(kt||(kt=Promise))(function(It,wt){function Rt(Dt){try{Bt(vt.next(Dt))}catch(Pt){wt(Pt)}}function Tt(Dt){try{Bt(vt.throw(Dt))}catch(Pt){wt(Pt)}}function Bt(Dt){Dt.done?It(Dt.value):bt(Dt.value).then(Rt,Tt)}Bt((vt=vt.apply(yt,Ct||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.ErrorBoundary=Be.EXCEPTION_ENDPOINT=void 0;const Ye=Log,tt=SDKType,nt=StatsigMetadata;Be.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const ft="[Statsig] UnknownError";class ht{constructor(Ct,kt,vt,bt){this._sdkKey=Ct,this._options=kt,this._emitter=vt,this._lastSeenError=bt,this._seen=new Set}wrap(Ct,kt){try{const vt=Ct;xt(vt).forEach(bt=>{const It=vt[bt];"$EB"in It||(vt[bt]=(...wt)=>this._capture(kt?`${kt}:${bt}`:bt,()=>It.apply(Ct,wt)),vt[bt].$EB=!0)})}catch(vt){this._onError("eb:wrap",vt)}}logError(Ct,kt){this._onError(Ct,kt)}getLastSeenErrorAndReset(){const Ct=this._lastSeenError;return this._lastSeenError=void 0,Ct??null}attachErrorIfNoneExists(Ct){this._lastSeenError||(this._lastSeenError=gt(Ct))}_capture(Ct,kt){try{const vt=kt();return vt&&vt instanceof Promise?vt.catch(bt=>this._onError(Ct,bt)):vt}catch(vt){return this._onError(Ct,vt),null}}_onError(Ct,kt){try{Ye.Log.warn(`Caught error in ${Ct}`,{error:kt}),Le(this,void 0,void 0,function*(){var bt,It,wt,Rt,Tt,Bt,Dt;const Pt=kt||Error(ft),Nt=Pt instanceof Error,Lt=Nt?Pt.name:"No Name",Wt=gt(Pt);if(this._lastSeenError=Wt,this._seen.has(Lt))return;if(this._seen.add(Lt),!((It=(bt=this._options)===null||bt===void 0?void 0:bt.networkConfig)===null||It===void 0)&&It.preventAllNetworkTraffic){(wt=this._emitter)===null||wt===void 0||wt.call(this,{name:"error",error:kt,tag:Ct});return}const $t=tt.SDKType._get(this._sdkKey),Kt=nt.StatsigMetadataProvider.get(),Vt=Nt?Pt.stack:At(Pt),Ut=Object.assign({tag:Ct,exception:Lt,info:Vt,statsigOptions:Et(this._options)},Object.assign(Object.assign({},Kt),{sdkType:$t}));yield((Bt=(Tt=(Rt=this._options)===null||Rt===void 0?void 0:Rt.networkConfig)===null||Tt===void 0?void 0:Tt.networkOverrideFunc)!==null&&Bt!==void 0?Bt:fetch)(Be.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String($t),"STATSIG-SDK-VERSION":String(Kt.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(Ut)}),(Dt=this._emitter)===null||Dt===void 0||Dt.call(this,{name:"error",error:kt,tag:Ct})}).then(()=>{}).catch(()=>{})}catch{}}}Be.ErrorBoundary=ht;function gt(yt){return yt instanceof Error?yt:typeof yt=="string"?new Error(yt):new Error("An unknown error occurred.")}function At(yt){try{return JSON.stringify(yt)}catch{return ft}}function xt(yt){const Ct=new Set;let kt=Object.getPrototypeOf(yt);for(;kt&&kt!==Object.prototype;)Object.getOwnPropertyNames(kt).filter(vt=>typeof(kt==null?void 0:kt[vt])=="function").forEach(vt=>Ct.add(vt)),kt=Object.getPrototypeOf(kt);return Array.from(Ct)}function Et(yt){if(!yt)return{};const Ct={};return Object.keys(yt).forEach(kt=>{const vt=kt,bt=yt[vt];switch(typeof bt){case"number":case"bigint":case"boolean":Ct[String(vt)]=bt;break;case"string":bt.length<50?Ct[String(vt)]=bt:Ct[String(vt)]="set";break;case"object":vt==="environment"?Ct.environment=bt:vt==="networkConfig"?Ct.networkConfig=bt:Ct[String(vt)]=bt!=null?"set":"unset";break}}),Ct}}(ErrorBoundary);var EvaluationOptions={};Object.defineProperty(EvaluationOptions,"__esModule",{value:!0});var EvaluationTypes={};Object.defineProperty(EvaluationTypes,"__esModule",{value:!0});var InitializeResponse={};Object.defineProperty(InitializeResponse,"__esModule",{value:!0});var MemoKey={};Object.defineProperty(MemoKey,"__esModule",{value:!0}),MemoKey.createMemoKey=MemoKey.MemoPrefix=void 0,MemoKey.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const EXIST_KEYS=new Set([]),DO_NOT_MEMO_KEYS=new Set(["userPersistedValues"]);function createMemoKey(Be,Le,Ye){let tt=`${Be}|${Le}`;if(!Ye)return tt;for(const nt of Object.keys(Ye)){if(DO_NOT_MEMO_KEYS.has(nt))return;EXIST_KEYS.has(nt)?tt+=`|${nt}=true`:tt+=`|${nt}=${Ye[nt]}`}return tt}MemoKey.createMemoKey=createMemoKey;var NetworkCore$1={},NetworkFallbackResolver$1={},DnsTxtQuery={},__awaiter$d=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(DnsTxtQuery,"__esModule",{value:!0}),DnsTxtQuery._fetchTxtRecords=void 0;const FEATURE_ASSETS_DNS_QUERY=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),DNS_QUERY_ENDPOINT="https://cloudflare-dns.com/dns-query",DOMAIN_CHARS=["i","e","d"],MAX_START_LOOKUP=200;function _fetchTxtRecords(Be){return __awaiter$d(this,void 0,void 0,function*(){const Le=yield Be(DNS_QUERY_ENDPOINT,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:FEATURE_ASSETS_DNS_QUERY});if(!Le.ok){const nt=new Error("Failed to fetch TXT records from DNS");throw nt.name="DnsTxtFetchError",nt}const Ye=yield Le.arrayBuffer(),tt=new Uint8Array(Ye);return _parseDnsResponse(tt)})}DnsTxtQuery._fetchTxtRecords=_fetchTxtRecords;function _parseDnsResponse(Be){const Le=Be.findIndex((tt,nt)=>nt<MAX_START_LOOKUP&&String.fromCharCode(tt)==="="&&DOMAIN_CHARS.includes(String.fromCharCode(Be[nt-1])));if(Le===-1){const tt=new Error("Failed to parse TXT records from DNS");throw tt.name="DnsTxtParseError",tt}let Ye="";for(let tt=Le-1;tt<Be.length;tt++)Ye+=String.fromCharCode(Be[tt]);return Ye.split(",")}var __awaiter$c=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkFallbackResolver$1,"__esModule",{value:!0}),NetworkFallbackResolver$1._isDomainFailure=NetworkFallbackResolver$1.NetworkFallbackResolver=void 0;const DnsTxtQuery_1=DnsTxtQuery,Hashing_1=Hashing,Log_1$3=Log,StorageProvider_1$1=StorageProvider,DEFAULT_TTL_MS=7*24*60*60*1e3,COOLDOWN_TIME_MS=4*60*60*1e3;class NetworkFallbackResolver{constructor(Le){var Ye;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(Ye=Le.networkConfig)===null||Ye===void 0?void 0:Ye.networkOverrideFunc}setErrorBoundary(Le){this._errorBoundary=Le}tryBumpExpiryTime(Le,Ye){var tt;const nt=(tt=this._fallbackInfo)===null||tt===void 0?void 0:tt[Ye.endpoint];nt&&(nt.expiryTime=Date.now()+DEFAULT_TTL_MS,_tryWriteFallbackInfoToCache(Le,Object.assign(Object.assign({},this._fallbackInfo),{[Ye.endpoint]:nt})))}getActiveFallbackUrl(Le,Ye){var tt,nt;if(Ye.customUrl!=null&&Ye.fallbackUrls!=null)return null;let ft=this._fallbackInfo;ft==null&&(ft=(tt=_readFallbackInfoFromCache(Le))!==null&&tt!==void 0?tt:{},this._fallbackInfo=ft);const ht=ft[Ye.endpoint];return!ht||Date.now()>((nt=ht.expiryTime)!==null&&nt!==void 0?nt:0)||Ye.getChecksum()!==ht.urlConfigChecksum?(delete ft[Ye.endpoint],this._fallbackInfo=ft,_tryWriteFallbackInfoToCache(Le,this._fallbackInfo),null):ht.url?ht.url:null}tryFetchUpdatedFallbackInfo(Le,Ye,tt,nt){return __awaiter$c(this,void 0,void 0,function*(){var ft,ht;try{if(!_isDomainFailure(tt,nt))return!1;const At=Ye.customUrl==null&&Ye.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(Ye):Ye.fallbackUrls,xt=this._pickNewFallbackUrl((ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[Ye.endpoint],At);return xt?(this._updateFallbackInfoWithNewUrl(Le,Ye,xt),!0):!1}catch(gt){return(ht=this._errorBoundary)===null||ht===void 0||ht.logError("tryFetchUpdatedFallbackInfo",gt),!1}})}_updateFallbackInfoWithNewUrl(Le,Ye,tt){var nt,ft,ht;const gt={urlConfigChecksum:Ye.getChecksum(),url:tt,expiryTime:Date.now()+DEFAULT_TTL_MS,previous:[]},At=Ye.endpoint,xt=(nt=this._fallbackInfo)===null||nt===void 0?void 0:nt[At];xt&>.previous.push(...xt.previous),gt.previous.length>10&&(gt.previous=[]);const Et=(ht=(ft=this._fallbackInfo)===null||ft===void 0?void 0:ft[At])===null||ht===void 0?void 0:ht.url;Et!=null&>.previous.push(Et),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[At]:gt}),_tryWriteFallbackInfoToCache(Le,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(Le){return __awaiter$c(this,void 0,void 0,function*(){var Ye;const tt=this._dnsQueryCooldowns[Le.endpoint];if(tt&&Date.now()<tt)return null;this._dnsQueryCooldowns[Le.endpoint]=Date.now()+COOLDOWN_TIME_MS;const nt=[],ft=yield(0,DnsTxtQuery_1._fetchTxtRecords)((Ye=this._networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch),ht=_extractPathFromUrl(Le.defaultUrl);for(const gt of ft){if(!gt.startsWith(Le.endpointDnsKey+"="))continue;const At=gt.split("=");if(At.length>1){let xt=At[1];xt.endsWith("/")&&(xt=xt.slice(0,-1)),nt.push(`https://${xt}${ht}`)}}return nt})}_pickNewFallbackUrl(Le,Ye){var tt;if(Ye==null)return null;const nt=new Set((tt=Le==null?void 0:Le.previous)!==null&&tt!==void 0?tt:[]),ft=Le==null?void 0:Le.url;let ht=null;for(const gt of Ye){const At=gt.endsWith("/")?gt.slice(0,-1):gt;if(!nt.has(gt)&&At!==ft){ht=At;break}}return ht}}NetworkFallbackResolver$1.NetworkFallbackResolver=NetworkFallbackResolver;function _isDomainFailure(Be,Le){var Ye;const tt=(Ye=Be==null?void 0:Be.toLowerCase())!==null&&Ye!==void 0?Ye:"";return Le||tt.includes("uncaught exception")||tt.includes("failed to fetch")||tt.includes("networkerror when attempting to fetch resource")}NetworkFallbackResolver$1._isDomainFailure=_isDomainFailure;function _getFallbackInfoStorageKey(Be){return`statsig.network_fallback.${(0,Hashing_1._DJB2)(Be)}`}function _tryWriteFallbackInfoToCache(Be,Le){const Ye=_getFallbackInfoStorageKey(Be);if(!Le||Object.keys(Le).length===0){StorageProvider_1$1.Storage.removeItem(Ye);return}StorageProvider_1$1.Storage.setItem(Ye,JSON.stringify(Le))}function _readFallbackInfoFromCache(Be){const Le=_getFallbackInfoStorageKey(Be),Ye=StorageProvider_1$1.Storage.getItem(Le);if(!Ye)return null;try{return JSON.parse(Ye)}catch{return Log_1$3.Log.error("Failed to parse FallbackInfo"),null}}function _extractPathFromUrl(Be){try{return new URL(Be).pathname}catch{return null}}var SDKFlags={};Object.defineProperty(SDKFlags,"__esModule",{value:!0}),SDKFlags.SDKFlags=void 0;const FLAGMAP={};SDKFlags.SDKFlags={setFlags:(Be,Le)=>{FLAGMAP[Be]=Le},get:(Be,Le)=>{var Ye,tt;return(tt=(Ye=FLAGMAP[Be])===null||Ye===void 0?void 0:Ye[Le])!==null&&tt!==void 0?tt:!1}};var SessionID={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigSession=Be.SessionID=void 0;const Le=$_StatsigGlobal,Ye=CacheKey,tt=Log,nt=StorageProvider,ft=UUID,ht=30*60*1e3,gt=4*60*60*1e3,At={};Be.SessionID={get:Rt=>Be.StatsigSession.get(Rt).data.sessionID},Be.StatsigSession={get:Rt=>{At[Rt]==null&&(At[Rt]=xt(Rt));const Tt=At[Rt];return yt(Tt)},overrideInitialSessionID:(Rt,Tt)=>{At[Tt]=Et(Rt,Tt)}};function xt(Rt){let Tt=wt(Rt);const Bt=Date.now();return Tt||(Tt={sessionID:(0,ft.getUUID)(),startTime:Bt,lastUpdate:Bt}),{data:Tt,sdkKey:Rt}}function Et(Rt,Tt){const Bt=Date.now();return{data:{sessionID:Rt,startTime:Bt,lastUpdate:Bt},sdkKey:Tt}}function yt(Rt){const Tt=Date.now(),Bt=Rt.data,Dt=Rt.sdkKey;if(kt(Bt)||vt(Bt)){Bt.sessionID=(0,ft.getUUID)(),Bt.startTime=Tt;const Nt=__STATSIG__==null?void 0:__STATSIG__.instance(Dt);Nt&&Nt.$emt({name:"session_expired"})}Bt.lastUpdate=Tt,It(Bt,Rt.sdkKey),clearTimeout(Rt.idleTimeoutID),clearTimeout(Rt.ageTimeoutID);const Pt=Tt-Bt.startTime;return Rt.idleTimeoutID=Ct(Dt,ht),Rt.ageTimeoutID=Ct(Dt,gt-Pt),Rt}function Ct(Rt,Tt){return setTimeout(()=>{var Bt;const Dt=(Bt=(0,Le._getStatsigGlobal)())===null||Bt===void 0?void 0:Bt.instance(Rt);Dt&&Dt.$emt({name:"session_expired"})},Tt)}function kt({lastUpdate:Rt}){return Date.now()-Rt>ht}function vt({startTime:Rt}){return Date.now()-Rt>gt}function bt(Rt){return`statsig.session_id.${(0,Ye._getStorageKey)(Rt)}`}function It(Rt,Tt){const Bt=bt(Tt);try{(0,nt._setObjectInStorage)(Bt,Rt)}catch{tt.Log.warn("Failed to save SessionID")}}function wt(Rt){const Tt=bt(Rt);return(0,nt._getObjectFromStorage)(Tt)}})(SessionID);var StatsigClientEventEmitter={};Object.defineProperty(StatsigClientEventEmitter,"__esModule",{value:!0}),StatsigClientEventEmitter.ErrorTag=void 0,StatsigClientEventEmitter.ErrorTag={NetworkError:"NetworkError"};var __awaiter$b=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(NetworkCore$1,"__esModule",{value:!0}),NetworkCore$1.NetworkCore=void 0;const __StatsigGlobal_1$1=$_StatsigGlobal,Diagnostics_1=Diagnostics,Log_1$2=Log,NetworkConfig_1=NetworkConfig,NetworkFallbackResolver_1=NetworkFallbackResolver$1,SDKFlags_1=SDKFlags,SDKType_1=SDKType,SafeJs_1$1=SafeJs,SessionID_1$1=SessionID,StableID_1$1=StableID,StatsigClientEventEmitter_1=StatsigClientEventEmitter,StatsigMetadata_1=StatsigMetadata,StatsigOptionsCommon_1$1=StatsigOptionsCommon,VisibilityObserving_1=VisibilityObserving,DEFAULT_TIMEOUT_MS=1e4,BACKOFF_BASE_MS=500,BACKOFF_MAX_MS=3e4,RATE_LIMIT_WINDOW_MS=1e3,RATE_LIMIT_MAX_REQ_COUNT=50,LEAK_RATE=RATE_LIMIT_MAX_REQ_COUNT/RATE_LIMIT_WINDOW_MS,RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class NetworkCore{constructor(Le,Ye){this._emitter=Ye,this._errorBoundary=null,this._timeout=DEFAULT_TIMEOUT_MS,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,Le&&(this._options=Le),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new NetworkFallbackResolver_1.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(Le))}setLogEventCompressionMode(Le){this._options.logEventCompressionMode=Le}setErrorBoundary(Le){this._errorBoundary=Le,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(Le)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const Le=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,Le}beacon(Le){if(!_ensureValidSdkKey(Le))return!1;const Ye=this._getInternalRequestArgs("POST",Le),tt=this._getPopulatedURL(Ye),nt=navigator;return nt.sendBeacon.bind(nt)(tt,Ye.body)}post(Le){return __awaiter$b(this,void 0,void 0,function*(){const Ye=this._getInternalRequestArgs("POST",Le);return this._tryEncodeBody(Ye),yield this._tryToCompressBody(Ye),this._sendRequest(Ye)})}get(Le){const Ye=this._getInternalRequestArgs("GET",Le);return this._sendRequest(Ye)}_sendRequest(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye,tt,nt,ft;if(!_ensureValidSdkKey(Le)||this._netConfig.preventAllNetworkTraffic)return null;const{method:ht,body:gt,retries:At,attempt:xt}=Le,Et=Le.urlConfig.endpoint;if(this._isRateLimited(Et))return Log_1$2.Log.warn(`Request to ${Et} was blocked because you are making requests too frequently.`),null;const yt=xt??1;let Ct=!1;const kt=this._getPopulatedURL(Le);let vt=null;const bt=(0,VisibilityObserving_1._isUnloading)();try{const It={method:ht,body:gt,headers:Object.assign({},Le.headers),priority:Le.priority,keepalive:bt};_tryMarkInitStart(Le,yt);const wt=this._leakyBucket[Et];wt&&(wt.lastRequestTime=Date.now(),this._leakyBucket[Et]=wt);const Rt=(Ye=this._netConfig.networkOverrideFunc)!==null&&Ye!==void 0?Ye:fetch;let Tt;if(vt=yield Promise.race([Rt(kt,It).finally(()=>clearTimeout(Tt)),new Promise((Dt,Pt)=>{Tt=setTimeout(()=>{Ct=!0,Pt(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!vt.ok){const Dt=yield vt.text().catch(()=>"No Text"),Pt=new Error(`NetworkError: ${kt} ${Dt}`);throw Pt.name="NetworkError",Pt}const Bt=yield vt.text();return _tryMarkInitEnd(Le,vt,yt,Bt),this._fallbackResolver.tryBumpExpiryTime(Le.sdkKey,Le.urlConfig),{body:Bt,code:vt.status}}catch(It){const wt=_getErrorMessage(It),Rt=_didTimeout(wt??"",Ct);if(_tryMarkInitEnd(Le,vt,yt,"",It),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(Le.sdkKey,Le.urlConfig,wt,Rt))&&(Le.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(Le.sdkKey,Le.urlConfig)),!At||yt>At||!RETRYABLE_CODES.has((tt=vt==null?void 0:vt.status)!==null&&tt!==void 0?tt:500)){(nt=this._emitter)===null||nt===void 0||nt.call(this,{name:"error",error:It,tag:StatsigClientEventEmitter_1.ErrorTag.NetworkError,requestArgs:Le});const Bt=`A networking error occurred during ${ht} request to ${kt}.`;return Log_1$2.Log.error(Bt,wt,It),(ft=this._errorBoundary)===null||ft===void 0||ft.attachErrorIfNoneExists(Bt),null}return yield _exponentialBackoff(yt),this._sendRequest(Object.assign(Object.assign({},Le),{retries:At,attempt:yt+1}))}})}_getLogEventCompressionMode(Le){let Ye=Le==null?void 0:Le.logEventCompressionMode;return!Ye&&(Le==null?void 0:Le.disableCompression)===!0&&(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled),Ye||(Ye=StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled),Ye}_isRateLimited(Le){var Ye;const tt=Date.now(),nt=(Ye=this._leakyBucket[Le])!==null&&Ye!==void 0?Ye:{count:0,lastRequestTime:tt},ft=tt-nt.lastRequestTime,ht=Math.floor(ft*LEAK_RATE);return nt.count=Math.max(0,nt.count-ht),nt.count>=RATE_LIMIT_MAX_REQ_COUNT?!0:(nt.count+=1,nt.lastRequestTime=tt,this._leakyBucket[Le]=nt,!1)}_getPopulatedURL(Le){var Ye;const tt=(Ye=Le.fallbackUrl)!==null&&Ye!==void 0?Ye:Le.urlConfig.getUrl();(Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize||Le.urlConfig.endpoint===NetworkConfig_1.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=tt);const nt=Object.assign({[NetworkConfig_1.NetworkParam.SdkKey]:Le.sdkKey,[NetworkConfig_1.NetworkParam.SdkType]:SDKType_1.SDKType._get(Le.sdkKey),[NetworkConfig_1.NetworkParam.SdkVersion]:StatsigMetadata_1.SDK_VERSION,[NetworkConfig_1.NetworkParam.Time]:String(Date.now()),[NetworkConfig_1.NetworkParam.SessionID]:SessionID_1$1.SessionID.get(Le.sdkKey)},Le.params),ft=Object.keys(nt).map(ht=>`${encodeURIComponent(ht)}=${encodeURIComponent(nt[ht])}`).join("&");return`${tt}${ft?`?${ft}`:""}`}_tryEncodeBody(Le){var Ye;const tt=(0,SafeJs_1$1._getWindowSafe)(),nt=Le.body;if(!(!Le.isStatsigEncodable||this._options.disableStatsigEncoding||typeof nt!="string"||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-encode")!=null||!(tt!=null&&tt.btoa)))try{Le.body=tt.btoa(nt).split("").reverse().join(""),Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.StatsigEncoded]:"1"})}catch(ft){Log_1$2.Log.warn(`Request encoding failed for ${Le.urlConfig.getUrl()}`,ft)}}_tryToCompressBody(Le){return __awaiter$b(this,void 0,void 0,function*(){var Ye;const tt=Le.body;if(!(typeof tt!="string"||!_allowCompression(Le,this._options)))try{const nt=new TextEncoder().encode(tt),ft=new CompressionStream("gzip"),ht=ft.writable.getWriter();ht.write(nt).catch(Log_1$2.Log.error),ht.close().catch(Log_1$2.Log.error);const gt=ft.readable.getReader(),At=[];let xt;for(;!(xt=yield gt.read()).done;)At.push(xt.value);const Et=At.reduce((kt,vt)=>kt+vt.length,0),yt=new Uint8Array(Et);let Ct=0;for(const kt of At)yt.set(kt,Ct),Ct+=kt.length;Le.body=yt,Le.params=Object.assign(Object.assign({},(Ye=Le.params)!==null&&Ye!==void 0?Ye:{}),{[NetworkConfig_1.NetworkParam.IsGzipped]:"1"})}catch(nt){Log_1$2.Log.warn(`Request compression failed for ${Le.urlConfig.getUrl()}`,nt)}})}_getInternalRequestArgs(Le,Ye){const tt=this._fallbackResolver.getActiveFallbackUrl(Ye.sdkKey,Ye.urlConfig),nt=Object.assign(Object.assign({},Ye),{method:Le,fallbackUrl:tt});return"data"in Ye&&_populateRequestBody(nt,Ye.data),nt}}NetworkCore$1.NetworkCore=NetworkCore;const _ensureValidSdkKey=Be=>Be.sdkKey?!0:(Log_1$2.Log.warn("Unable to make request without an SDK key"),!1),_populateRequestBody=(Be,Le)=>{const{sdkKey:Ye,fallbackUrl:tt}=Be,nt=StableID_1$1.StableID.get(Ye),ft=SessionID_1$1.SessionID.get(Ye),ht=SDKType_1.SDKType._get(Ye);Be.body=JSON.stringify(Object.assign(Object.assign({},Le),{statsigMetadata:Object.assign(Object.assign({},StatsigMetadata_1.StatsigMetadataProvider.get()),{stableID:nt,sessionID:ft,sdkType:ht,fallbackUrl:tt})}))};function _allowCompression(Be,Le){if(!Be.isCompressable||(0,__StatsigGlobal_1$1._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const Ye=Be.urlConfig.customUrl!=null||Be.urlConfig.fallbackUrls!=null,tt=SDKFlags_1.SDKFlags.get(Be.sdkKey,"enable_log_event_compression")===!0;switch(Le.logEventCompressionMode){case StatsigOptionsCommon_1$1.LogEventCompressionMode.Disabled:return!1;case StatsigOptionsCommon_1$1.LogEventCompressionMode.Enabled:return!(Ye&&!tt);case StatsigOptionsCommon_1$1.LogEventCompressionMode.Forced:return!0;default:return!1}}function _getErrorMessage(Be){return typeof Be=="string"?Be:Be instanceof Error?`${Be.name}: ${Be.message}`:"Unknown Error"}function _didTimeout(Be,Le){return Be.includes("Timeout")||Le}function _tryMarkInitStart(Be,Le){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqStart(Be.sdkKey,{attempt:Le})}function _tryMarkInitEnd(Be,Le,Ye,tt,nt){Be.urlConfig.endpoint===NetworkConfig_1.Endpoint._initialize&&Diagnostics_1.Diagnostics._markInitNetworkReqEnd(Be.sdkKey,Diagnostics_1.Diagnostics._getDiagnosticsData(Le,Ye,tt,nt))}function _exponentialBackoff(Be){return __awaiter$b(this,void 0,void 0,function*(){yield new Promise(Le=>setTimeout(Le,Math.min(BACKOFF_BASE_MS*(Be*Be),BACKOFF_MAX_MS)))})}var OverrideAdapter={};Object.defineProperty(OverrideAdapter,"__esModule",{value:!0});var ParamStoreTypes={};Object.defineProperty(ParamStoreTypes,"__esModule",{value:!0});var SizeOf={};(function(Be){Object.defineProperty(Be,"__esModule",{value:!0}),Be._fastApproxSizeOf=void 0;const Le=2,Ye=1,tt=(nt,ft)=>{let ht=0;const gt=Object.keys(nt);for(let At=0;At<gt.length;At++){const xt=gt[At],Et=nt[xt];if(ht+=xt.length,typeof Et=="object"&&Et!==null?ht+=(0,Be._fastApproxSizeOf)(Et,ft)+Le:ht+=String(Et).length+Ye,ht>=ft)return ht}return ht};Be._fastApproxSizeOf=tt})(SizeOf);var StatsigClientBase$1={},__awaiter$a=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigClientBase$1,"__esModule",{value:!0}),StatsigClientBase$1.StatsigClientBase=void 0;const __StatsigGlobal_1=$_StatsigGlobal,ErrorBoundary_1=ErrorBoundary,EventLogger_1=EventLogger$1,Log_1$1=Log,MemoKey_1=MemoKey,SafeJs_1=SafeJs,SessionID_1=SessionID,StableID_1=StableID,StatsigOptionsCommon_1=StatsigOptionsCommon,StorageProvider_1=StorageProvider,MAX_MEMO_CACHE_SIZE=3e3;class StatsigClientBase{constructor(Le,Ye,tt,nt){var ft,ht,gt,At;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const xt=this.$emt.bind(this);(nt==null?void 0:nt.logLevel)!=null&&(Log_1$1.Log.level=nt.logLevel),nt!=null&&nt.disableStorage&&StorageProvider_1.Storage._setDisabled(!0),nt!=null&&nt.initialSessionID&&SessionID_1.StatsigSession.overrideInitialSessionID(nt.initialSessionID,Le),nt!=null&&nt.storageProvider&&StorageProvider_1.Storage._setProvider(nt.storageProvider),nt!=null&&nt.enableCookies&&StableID_1.StableID._setCookiesEnabled(Le,nt.enableCookies),nt!=null&&nt.disableStableID&&StableID_1.StableID._setDisabled(Le,!0),this._sdkKey=Le,this._options=nt??{},this._memoCache={},this.overrideAdapter=(ft=nt==null?void 0:nt.overrideAdapter)!==null&&ft!==void 0?ft:null,this._logger=new EventLogger_1.EventLogger(Le,xt,tt,nt),this._errorBoundary=new ErrorBoundary_1.ErrorBoundary(Le,nt,xt),this._errorBoundary.wrap(this),this._errorBoundary.wrap(Ye),this._errorBoundary.wrap(this._logger),tt.setErrorBoundary(this._errorBoundary),this.dataAdapter=Ye,this.dataAdapter.attach(Le,nt,tt),this.storageProvider=StorageProvider_1.Storage,(At=(gt=(ht=this.overrideAdapter)===null||ht===void 0?void 0:ht.loadFromStorage)===null||gt===void 0?void 0:gt.call(ht))===null||At===void 0||At.catch(Et=>this._errorBoundary.logError("OA::loadFromStorage",Et)),this._primeReadyRipcord(),_assignGlobalInstance(Le,this)}updateRuntimeOptions(Le){Le.loggingEnabled?(this._options.loggingEnabled=Le.loggingEnabled,this._logger.setLoggingEnabled(Le.loggingEnabled)):Le.disableLogging!=null&&(this._options.disableLogging=Le.disableLogging,this._logger.setLoggingEnabled(Le.disableLogging?"disabled":"browser-only")),Le.disableStorage!=null&&(this._options.disableStorage=Le.disableStorage,StorageProvider_1.Storage._setDisabled(Le.disableStorage)),Le.enableCookies!=null&&(this._options.enableCookies=Le.enableCookies,StableID_1.StableID._setCookiesEnabled(this._sdkKey,Le.enableCookies)),Le.logEventCompressionMode?this._logger.setLogEventCompressionMode(Le.logEventCompressionMode):Le.disableCompression&&this._logger.setLogEventCompressionMode(StatsigOptionsCommon_1.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return __awaiter$a(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(Le,Ye){this._listeners[Le]||(this._listeners[Le]=[]),this._listeners[Le].push(Ye)}off(Le,Ye){if(this._listeners[Le]){const tt=this._listeners[Le].indexOf(Ye);tt!==-1&&this._listeners[Le].splice(tt,1)}}$on(Le,Ye){Ye.__isInternal=!0,this.on(Le,Ye)}$emt(Le){var Ye;const tt=nt=>{try{nt(Le)}catch(ft){if(nt.__isInternal===!0){this._errorBoundary.logError(`__emit:${Le.name}`,ft);return}Log_1$1.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",Le)}};this._listeners[Le.name]&&this._listeners[Le.name].forEach(nt=>tt(nt)),(Ye=this._listeners["*"])===null||Ye===void 0||Ye.forEach(tt)}_setStatus(Le,Ye){this.loadingStatus=Le,this._memoCache={},this.$emt({name:"values_updated",status:Le,values:Ye})}_enqueueExposure(Le,Ye,tt){if((tt==null?void 0:tt.disableExposureLog)===!0){this._logger.incrementNonExposureCount(Le);return}this._logger.enqueue(Ye)}_memoize(Le,Ye){return(tt,nt)=>{if(this._options.disableEvaluationMemoization)return Ye(tt,nt);const ft=(0,MemoKey_1.createMemoKey)(Le,tt,nt);return ft?(ft in this._memoCache||(Object.keys(this._memoCache).length>=MAX_MEMO_CACHE_SIZE&&(this._memoCache={}),this._memoCache[ft]=Ye(tt,nt)),this._memoCache[ft]):Ye(tt,nt)}}}StatsigClientBase$1.StatsigClientBase=StatsigClientBase;function _assignGlobalInstance(Be,Le){var Ye;if((0,SafeJs_1._isServerEnv)())return;const tt=(0,__StatsigGlobal_1._getStatsigGlobal)(),nt=(Ye=tt.instances)!==null&&Ye!==void 0?Ye:{},ft=Le;nt[Be]!=null&&Log_1$1.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),nt[Be]=ft,tt.firstInstance||(tt.firstInstance=ft),tt.instances=nt,__STATSIG__=tt}var StatsigDataAdapter={};Object.defineProperty(StatsigDataAdapter,"__esModule",{value:!0}),StatsigDataAdapter.DataAdapterCachePrefix=void 0,StatsigDataAdapter.DataAdapterCachePrefix="statsig.cached";var StatsigPlugin={};Object.defineProperty(StatsigPlugin,"__esModule",{value:!0});var StatsigTypeFactories={};Object.defineProperty(StatsigTypeFactories,"__esModule",{value:!0}),StatsigTypeFactories._makeTypedGet=StatsigTypeFactories._mergeOverride=StatsigTypeFactories._makeLayer=StatsigTypeFactories._makeExperiment=StatsigTypeFactories._makeDynamicConfig=StatsigTypeFactories._makeFeatureGate=void 0;const Log_1=Log,TypingUtils_1=TypingUtils;function _makeEvaluation(Be,Le,Ye,tt){var nt;return{name:Be,details:Le,ruleID:(nt=Ye==null?void 0:Ye.rule_id)!==null&&nt!==void 0?nt:"",__evaluation:Ye,value:tt}}function _makeFeatureGate(Be,Le,Ye){var tt;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,(Ye==null?void 0:Ye.value)===!0)),{idType:(tt=Ye==null?void 0:Ye.id_type)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeFeatureGate=_makeFeatureGate;function _makeDynamicConfig(Be,Le,Ye){var tt,nt;const ft=(tt=Ye==null?void 0:Ye.value)!==null&&tt!==void 0?tt:{};return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,ft)),{idType:(nt=Ye==null?void 0:Ye.id_type)!==null&&nt!==void 0?nt:null,get:_makeTypedGet(Be,Ye==null?void 0:Ye.value)})}StatsigTypeFactories._makeDynamicConfig=_makeDynamicConfig;function _makeExperiment(Be,Le,Ye){var tt;const nt=_makeDynamicConfig(Be,Le,Ye);return Object.assign(Object.assign({},nt),{groupName:(tt=Ye==null?void 0:Ye.group_name)!==null&&tt!==void 0?tt:null})}StatsigTypeFactories._makeExperiment=_makeExperiment;function _makeLayer(Be,Le,Ye,tt){var nt,ft;return Object.assign(Object.assign({},_makeEvaluation(Be,Le,Ye,void 0)),{get:_makeTypedGet(Be,Ye==null?void 0:Ye.value,tt),groupName:(nt=Ye==null?void 0:Ye.group_name)!==null&&nt!==void 0?nt:null,__value:(ft=Ye==null?void 0:Ye.value)!==null&&ft!==void 0?ft:{}})}StatsigTypeFactories._makeLayer=_makeLayer;function _mergeOverride(Be,Le,Ye,tt){return Object.assign(Object.assign(Object.assign({},Be),Le),{get:_makeTypedGet(Be.name,Ye,tt)})}StatsigTypeFactories._mergeOverride=_mergeOverride;function _makeTypedGet(Be,Le,Ye){return(tt,nt)=>{var ft;const ht=(ft=Le==null?void 0:Le[tt])!==null&&ft!==void 0?ft:null;return ht==null?nt??null:nt!=null&&!(0,TypingUtils_1._isTypeMatch)(ht,nt)?(Log_1.Log.warn(`Parameter type mismatch. '${Be}.${tt}' was found to be type '${typeof ht}' but fallback/return type is '${typeof nt}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),nt??null):(Ye==null||Ye(tt),ht)}}StatsigTypeFactories._makeTypedGet=_makeTypedGet;var StatsigTypes={};Object.defineProperty(StatsigTypes,"__esModule",{value:!0});var StatsigUpdateDetails={};Object.defineProperty(StatsigUpdateDetails,"__esModule",{value:!0}),StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES=StatsigUpdateDetails.createUpdateDetails=void 0;const createUpdateDetails=(Be,Le,Ye,tt,nt,ft)=>({duration:Ye,source:Le,success:Be,error:tt,sourceUrl:nt,warnings:ft});StatsigUpdateDetails.createUpdateDetails=createUpdateDetails,StatsigUpdateDetails.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(xt,Et,yt,Ct){Ct===void 0&&(Ct=yt);var kt=Object.getOwnPropertyDescriptor(Et,yt);(!kt||("get"in kt?!Et.__esModule:kt.writable||kt.configurable))&&(kt={enumerable:!0,get:function(){return Et[yt]}}),Object.defineProperty(xt,Ct,kt)}:function(xt,Et,yt,Ct){Ct===void 0&&(Ct=yt),xt[Ct]=Et[yt]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(xt,Et){for(var yt in xt)yt!=="default"&&!Object.prototype.hasOwnProperty.call(Et,yt)&&Le(Et,xt,yt)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.Storage=Be.Log=Be.EventLogger=Be.Diagnostics=void 0;const tt=$_StatsigGlobal,nt=Diagnostics;Object.defineProperty(Be,"Diagnostics",{enumerable:!0,get:function(){return nt.Diagnostics}});const ft=EventLogger$1;Object.defineProperty(Be,"EventLogger",{enumerable:!0,get:function(){return ft.EventLogger}});const ht=Log;Object.defineProperty(Be,"Log",{enumerable:!0,get:function(){return ht.Log}});const gt=StatsigMetadata,At=StorageProvider;Object.defineProperty(Be,"Storage",{enumerable:!0,get:function(){return At.Storage}}),Ye($_StatsigGlobal,Be),Ye(CacheKey,Be),Ye(ClientInterfaces,Be),Ye(DataAdapterCore$1,Be),Ye(Diagnostics,Be),Ye(DownloadConfigSpecsResponse,Be),Ye(ErrorBoundary,Be),Ye(EvaluationOptions,Be),Ye(EvaluationTypes,Be),Ye(Hashing,Be),Ye(InitializeResponse,Be),Ye(Log,Be),Ye(MemoKey,Be),Ye(NetworkConfig,Be),Ye(NetworkCore$1,Be),Ye(OverrideAdapter,Be),Ye(ParamStoreTypes,Be),Ye(SafeJs,Be),Ye(SDKType,Be),Ye(SessionID,Be),Ye(SizeOf,Be),Ye(StableID,Be),Ye(StatsigClientBase$1,Be),Ye(StatsigClientEventEmitter,Be),Ye(StatsigDataAdapter,Be),Ye(StatsigEvent,Be),Ye(StatsigMetadata,Be),Ye(StatsigOptionsCommon,Be),Ye(StatsigPlugin,Be),Ye(StatsigTypeFactories,Be),Ye(StatsigTypes,Be),Ye(StatsigUser,Be),Ye(StorageProvider,Be),Ye(TypedJsonParse,Be),Ye(TypingUtils,Be),Ye(UrlConfiguration$1,Be),Ye(UUID,Be),Ye(VisibilityObserving,Be),Ye(StatsigUpdateDetails,Be),Ye(SDKFlags,Be),Object.assign((0,tt._getStatsigGlobal)(),{Log:ht.Log,SDK_VERSION:gt.SDK_VERSION})}(src$1);var StatsigClient$1={},EvaluationStore$1={},V1InitializeContainer$1={};Object.defineProperty(V1InitializeContainer$1,"__esModule",{value:!0}),V1InitializeContainer$1.V1InitializeContainer=void 0;const client_core_1$7=src$1;class V1InitializeContainer{constructor(Le){this._values=Le}getGate(Le){return this._getResultFromLookup(this._values.feature_gates,Le)}getConfig(Le){return this._getResultFromLookup(this._values.dynamic_configs,Le)}getLayer(Le){return this._getResultFromLookup(this._values.layer_configs,Le)}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$7._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V1InitializeContainer$1.V1InitializeContainer=V1InitializeContainer;var V2InitializeContainer$1={};Object.defineProperty(V2InitializeContainer$1,"__esModule",{value:!0}),V2InitializeContainer$1.V2InitializeContainer=void 0;const client_core_1$6=src$1;class V2InitializeContainer{constructor(Le){this._values=Le}getGate(Le){var Ye,tt,nt;const ft=this._getResultFromLookup(this._values.feature_gates,Le);return ft?{name:Le,value:ft.v===!0,rule_id:(Ye=ft.r)!==null&&Ye!==void 0?Ye:"default",secondary_exposures:(tt=ft.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ft.i)!==null&&nt!==void 0?nt:""}:null}getConfig(Le){var Ye,tt,nt,ft;const ht=this._getResultFromLookup(this._values.dynamic_configs,Le);return ht?{name:Le,value:(Ye=this._values.values[ht.v])!==null&&Ye!==void 0?Ye:{},rule_id:ht.r,secondary_exposures:(tt=ht.s)!==null&&tt!==void 0?tt:[],id_type:(nt=ht.i)!==null&&nt!==void 0?nt:"",is_user_in_experiment:ht.ue===!0,passed:ht.p===!0,group_name:(ft=ht.gn)!==null&&ft!==void 0?ft:void 0,is_experiment_active:ht.ea===!0,group:ht.r,is_device_based:ht.i==="stableID"}:null}getLayer(Le){var Ye,tt,nt,ft,ht,gt;const At=this._getResultFromLookup(this._values.layer_configs,Le);return At?{name:Le,value:(Ye=this._values.values[At.v])!==null&&Ye!==void 0?Ye:{},rule_id:At.r,secondary_exposures:(tt=At.s)!==null&&tt!==void 0?tt:[],is_user_in_experiment:At.ue===!0,group_name:(nt=At.gn)!==null&&nt!==void 0?nt:void 0,is_experiment_active:At.ea===!0,group:At.r,is_device_based:At.i==="stableID",allocated_experiment_name:(ft=At.ae)!==null&&ft!==void 0?ft:"",explicit_parameters:(ht=At.ep)!==null&&ht!==void 0?ht:[],undelegated_secondary_exposures:(gt=At.us)!==null&>!==void 0?gt:[],parameter_rule_ids:At.pr}:null}getParamStore(Le){return this._getResultFromLookup(this._values.param_stores,Le)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(Le,Ye){var tt,nt;return Le&&(nt=(tt=Le[Ye])!==null&&tt!==void 0?tt:Le[(0,client_core_1$6._DJB2)(Ye)])!==null&&nt!==void 0?nt:null}}V2InitializeContainer$1.V2InitializeContainer=V2InitializeContainer,Object.defineProperty(EvaluationStore$1,"__esModule",{value:!0});const client_core_1$5=src$1,V1InitializeContainer_1=V1InitializeContainer$1,V2InitializeContainer_1=V2InitializeContainer$1;class EvaluationStore{constructor(Le){this._sdkKey=Le,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,client_core_1$5._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(Le,Ye){var tt,nt;if(!Le)return!1;const ft=(0,client_core_1$5._typedJsonParse)(Le.data,"has_updates","EvaluationResponse");return ft==null?!1:(this._source=Le.source,(ft==null?void 0:ft.has_updates)!==!0||((tt=ft.time)!==null&&tt!==void 0?tt:0)<this._lcut||(this._rawValues=Le.data,this._lcut=ft.time,this._receivedAt=Le.receivedAt,ft.response_format==="init-v2"?this._values=new V2InitializeContainer_1.V2InitializeContainer(ft):this._values=new V1InitializeContainer_1.V1InitializeContainer(ft),this._bootstrapMetadata=this._extractBootstrapMetadata(Le.source,ft),Le.source&&ft.user&&this._setWarningState(Ye,ft),client_core_1$5.SDKFlags.setFlags(this._sdkKey,(nt=ft.sdk_flags)!==null&&nt!==void 0?nt:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(Le){const Ye=this._values?this._values.getGate(Le):null;return this._getDetailedStoreResult(Ye)}getConfig(Le){const Ye=this._values?this._values.getConfig(Le):null;return this._getDetailedStoreResult(Ye)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(Le){const Ye=this._values?this._values.getLayer(Le):null;return this._getDetailedStoreResult(Ye)}getParamStore(Le){const Ye=this._values?this._values.getParamStore(Le):null;return this._getDetailedStoreResult(Ye)}getSource(){return this._source}getExposureMapping(){var Le;return(Le=this._values)===null||Le===void 0?void 0:Le.getExposureMapping()}_extractBootstrapMetadata(Le,Ye){if(Le!=="Bootstrap")return null;const tt={};return Ye.user&&(tt.user=Ye.user),Ye.sdkInfo&&(tt.generatorSDKInfo=Ye.sdkInfo),tt.lcut=Ye.time,tt}_getDetailedStoreResult(Le){return{result:Le,details:this._getDetails(Le==null)}}_setWarningState(Le,Ye){var tt,nt;const ft=client_core_1$5.StableID.get(this._sdkKey);if(((tt=Le.customIDs)===null||tt===void 0?void 0:tt.stableID)!==ft&&(!((nt=Le.customIDs)===null||nt===void 0)&&nt.stableID||ft)){this._warnings.add("StableIDMismatch");return}if("user"in Ye){const ht=Ye.user,gt=Object.assign(Object.assign({},Le),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(0,client_core_1$5._getFullUserHash)(gt)!==(0,client_core_1$5._getFullUserHash)(ht)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const Le={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(Le.warnings=Array.from(this._warnings)),Le}_getDetails(Le){var Ye,tt;const nt=this.getCurrentSourceDetails();let ft=nt.reason;const ht=(Ye=nt.warnings)!==null&&Ye!==void 0?Ye:[];this._source==="Bootstrap"&&ht.length>0&&(ft=ft+ht[0]),ft!=="Uninitialized"&&ft!=="NoValues"&&(ft=`${ft}:${Le?"Unrecognized":"Recognized"}`);const gt=this._source==="Bootstrap"&&(tt=this._bootstrapMetadata)!==null&&tt!==void 0?tt:void 0;return gt&&(nt.bootstrapMetadata=gt),Object.assign(Object.assign({},nt),{reason:ft})}}EvaluationStore$1.default=EvaluationStore;var Network={},EvaluationResponseDeltas={};Object.defineProperty(EvaluationResponseDeltas,"__esModule",{value:!0}),EvaluationResponseDeltas._resolveDeltasResponse=void 0;const client_core_1$4=src$1,MAX_DELTAS_SORT_DEPTH=2;function _resolveDeltasResponse(Be,Le){const Ye=(0,client_core_1$4._typedJsonParse)(Le,"checksum","DeltasEvaluationResponse");if(!Ye)return{hadBadDeltaChecksum:!0};const tt=_mergeDeltasIntoCache(Be,Ye),nt=_handleDeletedEntries(tt),ft=(0,client_core_1$4._DJB2Object)({feature_gates:nt.feature_gates,dynamic_configs:nt.dynamic_configs,layer_configs:nt.layer_configs},MAX_DELTAS_SORT_DEPTH);return ft===Ye.checksumV2?JSON.stringify(nt):{hadBadDeltaChecksum:!0,badChecksum:ft,badMergedConfigs:nt,badFullResponse:Ye.deltas_full_response}}EvaluationResponseDeltas._resolveDeltasResponse=_resolveDeltasResponse;function _mergeDeltasIntoCache(Be,Le){return Object.assign(Object.assign(Object.assign({},Be),Le),{feature_gates:Object.assign(Object.assign({},Be.feature_gates),Le.feature_gates),layer_configs:Object.assign(Object.assign({},Be.layer_configs),Le.layer_configs),dynamic_configs:Object.assign(Object.assign({},Be.dynamic_configs),Le.dynamic_configs)})}function _handleDeletedEntries(Be){const Le=Be;return _deleteEntriesInRecord(Be.deleted_gates,Le.feature_gates),delete Le.deleted_gates,_deleteEntriesInRecord(Be.deleted_configs,Le.dynamic_configs),delete Le.deleted_configs,_deleteEntriesInRecord(Be.deleted_layers,Le.layer_configs),delete Le.deleted_layers,Le}function _deleteEntriesInRecord(Be,Le){Be==null||Be.forEach(Ye=>{delete Le[Ye]})}var __awaiter$9=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(Network,"__esModule",{value:!0});const client_core_1$3=src$1,EvaluationResponseDeltas_1=EvaluationResponseDeltas;class StatsigNetwork extends client_core_1$3.NetworkCore{constructor(Le,Ye){super(Le,Ye);const tt=Le==null?void 0:Le.networkConfig;this._option=Le,this._initializeUrlConfig=new client_core_1$3.UrlConfiguration(client_core_1$3.Endpoint._initialize,tt==null?void 0:tt.initializeUrl,tt==null?void 0:tt.api,tt==null?void 0:tt.initializeFallbackUrls)}fetchEvaluations(Le,Ye,tt,nt,ft){return __awaiter$9(this,void 0,void 0,function*(){var ht,gt,At,xt,Et,yt;const Ct=Ye?(0,client_core_1$3._typedJsonParse)(Ye,"has_updates","InitializeResponse"):null;let kt={user:nt,hash:(At=(gt=(ht=this._option)===null||ht===void 0?void 0:ht.networkConfig)===null||gt===void 0?void 0:gt.initializeHashAlgorithm)!==null&&At!==void 0?At:"djb2",deltasResponseRequested:!1,full_checksum:null};if(Ct!=null&&Ct.has_updates){const vt=(Ct==null?void 0:Ct.hash_used)!==((yt=(Et=(xt=this._option)===null||xt===void 0?void 0:xt.networkConfig)===null||Et===void 0?void 0:Et.initializeHashAlgorithm)!==null&&yt!==void 0?yt:"djb2");kt=Object.assign(Object.assign({},kt),{sinceTime:ft&&!vt?Ct.time:0,previousDerivedFields:"derived_fields"in Ct&&ft?Ct.derived_fields:{},deltasResponseRequested:!0,full_checksum:Ct.full_checksum,partialUserMatchSinceTime:vt?0:Ct.time})}return this._fetchEvaluations(Le,Ct,kt,tt)})}_fetchEvaluations(Le,Ye,tt,nt){return __awaiter$9(this,void 0,void 0,function*(){var ft,ht;const gt=yield this.post({sdkKey:Le,urlConfig:this._initializeUrlConfig,data:tt,retries:2,isStatsigEncodable:!0,priority:nt});if((gt==null?void 0:gt.code)===204)return'{"has_updates": false}';if((gt==null?void 0:gt.code)!==200)return(ft=gt==null?void 0:gt.body)!==null&&ft!==void 0?ft:null;if((Ye==null?void 0:Ye.has_updates)!==!0||((ht=gt.body)===null||ht===void 0?void 0:ht.includes('"is_delta":true'))!==!0||tt.deltasResponseRequested!==!0)return gt.body;const At=(0,EvaluationResponseDeltas_1._resolveDeltasResponse)(Ye,gt.body);return typeof At=="string"?At:this._fetchEvaluations(Le,Ye,Object.assign(Object.assign(Object.assign({},tt),At),{deltasResponseRequested:!1}),nt)})}}Network.default=StatsigNetwork;var ParamStoreGetterFactory={};Object.defineProperty(ParamStoreGetterFactory,"__esModule",{value:!0}),ParamStoreGetterFactory._makeParamStoreGetter=void 0;const client_core_1$2=src$1,NO_EXPOSURE_OPT={disableExposureLog:!0};function _shouldLogExposure(Be){return Be==null||Be.disableExposureLog===!1}function _shouldReturnFallback(Be,Le){return Le!=null&&!(0,client_core_1$2._isTypeMatch)(Be,Le)}function _getMappedStaticValue(Be,Le){return Be.value}function _getMappedGateValue(Be,Le,Ye){return Be.getFeatureGate(Le.gate_name,_shouldLogExposure(Ye)?void 0:NO_EXPOSURE_OPT).value?Le.pass_value:Le.fail_value}function _getMappedDynamicConfigValue(Be,Le,Ye,tt){const ft=Be.getDynamicConfig(Le.config_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedExperimentValue(Be,Le,Ye,tt){const ft=Be.getExperiment(Le.experiment_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _getMappedLayerValue(Be,Le,Ye,tt){const ft=Be.getLayer(Le.layer_name,_shouldLogExposure(tt)?void 0:NO_EXPOSURE_OPT).get(Le.param_name);return _shouldReturnFallback(ft,Ye)?Ye:ft}function _makeParamStoreGetter(Be,Le,Ye){return(tt,nt)=>{if(Le==null)return nt;const ft=Le[tt];if(ft==null||nt!=null&&(0,client_core_1$2._typeOf)(nt)!==ft.param_type)return nt;switch(ft.ref_type){case"static":return _getMappedStaticValue(ft);case"gate":return _getMappedGateValue(Be,ft,Ye);case"dynamic_config":return _getMappedDynamicConfigValue(Be,ft,nt,Ye);case"experiment":return _getMappedExperimentValue(Be,ft,nt,Ye);case"layer":return _getMappedLayerValue(Be,ft,nt,Ye);default:return nt}}}ParamStoreGetterFactory._makeParamStoreGetter=_makeParamStoreGetter;var StatsigEvaluationsDataAdapter$1={},__awaiter$8=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigEvaluationsDataAdapter$1,"__esModule",{value:!0}),StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=void 0;const client_core_1$1=src$1,Network_1$1=Network;class StatsigEvaluationsDataAdapter extends client_core_1$1.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(Le,Ye,tt){super.attach(Le,Ye,tt),tt!==null&&tt instanceof Network_1$1.default?this._network=tt:this._network=new Network_1$1.default(Ye??{})}getDataAsync(Le,Ye,tt){return this._getDataAsyncImpl(Le,(0,client_core_1$1._normalizeUser)(Ye,this._options),tt)}prefetchData(Le,Ye){return this._prefetchDataImpl(Le,Ye)}setData(Le){const Ye=(0,client_core_1$1._typedJsonParse)(Le,"has_updates","data");Ye&&"user"in Ye?super.setData(Le,Ye.user):client_core_1$1.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(Le,Ye){super.setData(Le,Ye)}_fetchFromNetwork(Le,Ye,tt,nt){return __awaiter$8(this,void 0,void 0,function*(){var ft;const ht=yield(ft=this._network)===null||ft===void 0?void 0:ft.fetchEvaluations(this._getSdkKey(),Le,tt==null?void 0:tt.priority,Ye,nt);return ht??null})}_getCacheKey(Le){var Ye;const tt=(0,client_core_1$1._getStorageKey)(this._getSdkKey(),Le,(Ye=this._options)===null||Ye===void 0?void 0:Ye.customUserCacheKeyFunc);return`${client_core_1$1.DataAdapterCachePrefix}.${this._cacheSuffix}.${tt}`}_isCachedResultValidFor204(Le,Ye){return Le.fullUserHash!=null&&Le.fullUserHash===(0,client_core_1$1._getFullUserHash)(Ye)}}StatsigEvaluationsDataAdapter$1.StatsigEvaluationsDataAdapter=StatsigEvaluationsDataAdapter;var __awaiter$7=commonjsGlobal&&commonjsGlobal.__awaiter||function(Be,Le,Ye,tt){function nt(ft){return ft instanceof Ye?ft:new Ye(function(ht){ht(ft)})}return new(Ye||(Ye=Promise))(function(ft,ht){function gt(Et){try{xt(tt.next(Et))}catch(yt){ht(yt)}}function At(Et){try{xt(tt.throw(Et))}catch(yt){ht(yt)}}function xt(Et){Et.done?ft(Et.value):nt(Et.value).then(gt,At)}xt((tt=tt.apply(Be,Le||[])).next())})};Object.defineProperty(StatsigClient$1,"__esModule",{value:!0});const client_core_1=src$1,EvaluationStore_1=EvaluationStore$1,Network_1=Network,ParamStoreGetterFactory_1=ParamStoreGetterFactory,StatsigEvaluationsDataAdapter_1=StatsigEvaluationsDataAdapter$1;class StatsigClient extends client_core_1.StatsigClientBase{static instance(Le){const Ye=(0,client_core_1._getStatsigGlobal)().instance(Le);return Ye instanceof StatsigClient?Ye:(client_core_1.Log.warn((0,client_core_1._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new StatsigClient(Le??"",{}))}constructor(Le,Ye,tt=null){var nt,ft;client_core_1.SDKType._setClientType(Le,"javascript-client");const ht=new Network_1.default(tt,At=>{this.$emt(At)});super(Le,(nt=tt==null?void 0:tt.dataAdapter)!==null&&nt!==void 0?nt:new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter,ht,tt),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(client_core_1.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(client_core_1.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(client_core_1.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(client_core_1.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(client_core_1.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(client_core_1.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new EvaluationStore_1.default(Le),this._network=ht,this._user=this._configureUser(Ye,tt),this._sdkInstanceID=(0,client_core_1.getUUID)();const gt=(ft=tt==null?void 0:tt.plugins)!==null&&ft!==void 0?ft:[];for(const At of gt)At.bind(this)}initializeSync(Le){var Ye;return this.loadingStatus!=="Uninitialized"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(Ye=this._store.getWarnings())!==null&&Ye!==void 0?Ye:[]]):(this._logger.start(),this.updateUserSync(this._user,Le))}initializeAsync(Le){return __awaiter$7(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(Le),this._initializePromise)})}updateUserSync(Le,Ye){const tt=performance.now();try{return this._updateUserSyncImpl(Le,Ye,tt)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}}_updateUserSyncImpl(Le,Ye,tt){var nt;const ft=[...(nt=this._store.getWarnings())!==null&&nt!==void 0?nt:[]];this._resetForUser(Le);const ht=this.dataAdapter.getDataSync(this._user);ht==null&&ft.push("NoCachedValues"),this._store.setValues(ht,this._user),this._finalizeUpdate(ht);const gt=Ye==null?void 0:Ye.disableBackgroundCacheRefresh;return gt===!0||gt==null&&(ht==null?void 0:ht.source)==="Bootstrap"?(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft):(this._runPostUpdate(ht??null,this._user),(0,client_core_1.createUpdateDetails)(!0,this._store.getSource(),performance.now()-tt,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),ft))}updateUserAsync(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){const tt=performance.now();try{return yield this._updateUserAsyncImpl(Le,Ye)}catch(nt){const ft=nt instanceof Error?nt:new Error(String(nt));return this._createErrorUpdateDetails(ft,tt)}})}_updateUserAsyncImpl(Le,Ye){return __awaiter$7(this,void 0,void 0,function*(){this._resetForUser(Le);const tt=this._user;client_core_1.Diagnostics._markInitOverallStart(this._sdkKey);let nt=this.dataAdapter.getDataSync(tt);if(this._store.setValues(nt,this._user),this._setStatus("Loading",nt),nt=yield this.dataAdapter.getDataAsync(nt,tt,Ye),tt!==this._user)return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let ft=!1;nt!=null&&(client_core_1.Diagnostics._markInitProcessStart(this._sdkKey),ft=this._store.setValues(nt,this._user),client_core_1.Diagnostics._markInitProcessEnd(this._sdkKey,{success:ft})),this._finalizeUpdate(nt),ft||(this._errorBoundary.attachErrorIfNoneExists(client_core_1.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),client_core_1.Diagnostics._markInitOverallEnd(this._sdkKey,ft,this._store.getCurrentSourceDetails());const ht=client_core_1.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,client_core_1.createUpdateDetails)(ft,this._store.getSource(),ht,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:client_core_1.StatsigSession.get(this._sdkKey),stableID:client_core_1.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(Le,Ye){return this.getFeatureGate(Le,Ye).value}logEvent(Le,Ye,tt){const nt=typeof Le=="string"?{eventName:Le,value:Ye,metadata:tt}:Le;this.$emt({name:"log_event_called",event:nt}),this._logger.enqueue(Object.assign(Object.assign({},nt),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(Le){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:Le}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(Le){return __awaiter$7(this,void 0,void 0,function*(){return client_core_1.Storage.isReady()||(yield client_core_1.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,Le)})}_createErrorUpdateDetails(Le,Ye){var tt;return(0,client_core_1.createUpdateDetails)(!1,this._store.getSource(),performance.now()-Ye,Le,null,[...(tt=this._store.getWarnings())!==null&&tt!==void 0?tt:[]])}_finalizeUpdate(Le){this._store.finalize(),this._setStatus("Ready",Le)}_runPostUpdate(Le,Ye){this.dataAdapter.getDataAsync(Le,Ye,{priority:"low"}).catch(tt=>{client_core_1.Log.error("An error occurred after update.",tt)})}_resetForUser(Le){this._logger.reset(),this._store.reset(),this._user=this._configureUser(Le,this._options)}_configureUser(Le,Ye){var tt,nt,ft;const ht=(0,client_core_1._normalizeUser)(Le,Ye),gt=(tt=ht.customIDs)===null||tt===void 0?void 0:tt.stableID;if(gt){const At=(ft=(nt=this.storageProvider).isReadyResolver)===null||ft===void 0?void 0:ft.call(nt);At?At.then(()=>client_core_1.StableID.setOverride(gt,this._sdkKey),()=>client_core_1.StableID.setOverride(gt,this._sdkKey)):client_core_1.StableID.setOverride(gt,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(ht.analyticsOnlyMetadata=Object.assign(Object.assign({},ht.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),ht}_getFeatureGateImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getGate(Le),gt=(0,client_core_1._makeFeatureGate)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getGateOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createGateExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"gate_evaluation",gate:xt}),xt}_getDynamicConfigImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getConfig(Le),gt=(0,client_core_1._makeDynamicConfig)(Le,ht,ft),At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getDynamicConfigOverride)===null||nt===void 0?void 0:nt.call(tt,gt,this._user,Ye),xt=At??gt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,xt,this._store.getExposureMapping()),Ye),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:xt}),xt}_getExperimentImpl(Le,Ye){var tt,nt,ft,ht;const{result:gt,details:At}=this._store.getConfig(Le),xt=(0,client_core_1._makeExperiment)(Le,At,gt);xt.__evaluation!=null&&(xt.__evaluation.secondary_exposures=(0,client_core_1._mapExposures)((nt=(tt=xt.__evaluation)===null||tt===void 0?void 0:tt.secondary_exposures)!==null&&nt!==void 0?nt:[],this._store.getExposureMapping()));const Et=(ht=(ft=this.overrideAdapter)===null||ft===void 0?void 0:ft.getExperimentOverride)===null||ht===void 0?void 0:ht.call(ft,xt,this._user,Ye),yt=Et??xt;return this._enqueueExposure(Le,(0,client_core_1._createConfigExposure)(this._user,yt,this._store.getExposureMapping()),Ye),this.$emt({name:"experiment_evaluation",experiment:yt}),yt}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(Le,Ye){var tt,nt,ft;const{result:ht,details:gt}=this._store.getLayer(Le),At=(0,client_core_1._makeLayer)(Le,gt,ht),xt=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getLayerOverride)===null||nt===void 0?void 0:nt.call(tt,At,this._user,Ye);Ye!=null&&Ye.disableExposureLog&&this._logger.incrementNonExposureCount(Le);const Et=(0,client_core_1._mergeOverride)(At,xt,(ft=xt==null?void 0:xt.__value)!==null&&ft!==void 0?ft:At.__value,yt=>{Ye!=null&&Ye.disableExposureLog||this._enqueueExposure(Le,(0,client_core_1._createLayerParameterExposure)(this._user,Et,yt,this._store.getExposureMapping()),Ye)});return this.$emt({name:"layer_evaluation",layer:Et}),Et}_getParameterStoreImpl(Le,Ye){var tt,nt;const{result:ft,details:ht}=this._store.getParamStore(Le);this._logger.incrementNonExposureCount(Le);const gt={name:Le,details:ht,__configuration:ft,get:(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,ft,Ye)},At=(nt=(tt=this.overrideAdapter)===null||tt===void 0?void 0:tt.getParamStoreOverride)===null||nt===void 0?void 0:nt.call(tt,gt,Ye);return At!=null&&(gt.__configuration=At.config,gt.details=At.details,gt.get=(0,ParamStoreGetterFactory_1._makeParamStoreGetter)(this,At.config,Ye)),gt}}StatsigClient$1.default=StatsigClient,function(Be){var Le=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ht,gt,At,xt){xt===void 0&&(xt=At);var Et=Object.getOwnPropertyDescriptor(gt,At);(!Et||("get"in Et?!gt.__esModule:Et.writable||Et.configurable))&&(Et={enumerable:!0,get:function(){return gt[At]}}),Object.defineProperty(ht,xt,Et)}:function(ht,gt,At,xt){xt===void 0&&(xt=At),ht[xt]=gt[At]}),Ye=commonjsGlobal&&commonjsGlobal.__exportStar||function(ht,gt){for(var At in ht)At!=="default"&&!Object.prototype.hasOwnProperty.call(gt,At)&&Le(gt,ht,At)};Object.defineProperty(Be,"__esModule",{value:!0}),Be.StatsigClient=void 0;const tt=src$1,nt=StatsigClient$1;Be.StatsigClient=nt.default,Ye(src$1,Be);const ft=Object.assign((0,tt._getStatsigGlobal)(),{StatsigClient:nt.default});Be.default=ft}(src$2);const FEATURE_FLAGS=["id_text_barcode_readability","selfie_local_lenses_check_web","id_model_hebrew_back_id","id_face_readability","new_id_capture_ux_least_risky_clients","id_test_aa","id_iou_check","iad_checks","iad_c_checks","new_fingerprint","mp_test_hashed_id","darwinium_profiling"],GLOBAL_FLAGS=["new_fingerprint"],ID_MODULE_FLAGS=["id_face_readability","id_test_aa","iad_c_checks","mp_test_hashed_id","id_model_hebrew_back_id","id_iou_check","iad_checks","new_id_capture_ux_least_risky_clients","id_text_barcode_readability"],SELFIE_MODULE_FLAGS=["selfie_local_lenses_check_web"];function getStatsigEnvironment(Be){return isStageK8sEnv(Be)?{tier:"development"}:isStageEnv(Be)||isDemoEnv(Be)?{tier:"staging"}:isSaasEnv(Be)?{tier:"production"}:{tier:"development"}}const clientApiKey="client-GBTzsiJ99rvyZQdNXDFkftx3ZoMF1TED2rsB3m3IUqc",featureFlagsValues={id_text_barcode_readability:!1,selfie_local_lenses_check_web:!1,id_model_hebrew_back_id:!1,id_face_readability:!1,new_id_capture_ux_least_risky_clients:!1,id_test_aa:!1,iad_checks:!1,iad_c_checks:!1,id_iou_check:!0,new_fingerprint:!1,mp_test_hashed_id:!1,darwinium_profiling:!1},clientExperimentIds={new_id_capture_ux_least_risky_clients:"experimentV2"};let initPromise=null;const initialize=async({flowId:Be,apiKey:Le,sessionIdentifier:Ye,apiURL:tt,clientExperimentId:nt})=>{if(initPromise)return initPromise;initPromise=(async()=>{var gt;const ft={customIDs:{client_api_key:Le,hashed_onboarding_id:Ye,flow_id:Be},custom:{landing_page:(gt=window==null?void 0:window.location)==null?void 0:gt.href}},ht=new src$2.StatsigClient(clientApiKey,ft,{environment:getStatsigEnvironment(tt)});await ht.initializeAsync(),FEATURE_FLAGS.forEach(At=>{if(nt&&clientExperimentIds[At]===nt){featureFlagsValues[At]=!0;return}featureFlagsValues[At]=ht.checkGate(At)})})(),await initPromise},getFeatureFlag=Be=>featureFlagsValues[Be]??!1,getModuleFeatureFlags=async Be=>{const Le={};GLOBAL_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]});const Ye=Be.toLowerCase();return Ye.includes("id")||Ye==="government-validation"?ID_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}):(Ye.includes("selfie")||Ye==="face")&&SELFIE_MODULE_FLAGS.forEach(tt=>{Le[tt]=featureFlagsValues[tt]}),Le};function IdCaptureParamsConfigurator(Be,Le,Ye,tt){Object.assign(Be,{areaDown:25e3,areaUp:55e3,areaIOSPassportUp:3e4,areaIOSPassportDown:2e4,widthIOSUp:160,widthIOSDown:85,widthDown:tt?110:135,widthUp:205,framesAggregationInterval:tt?3e3:2e3,minFaceIdQualityScore:.62})}function getSelfieFaceDetectionPipelineParams(){return{frameMinX:0,frameMinY:0,frameMaxX:1,frameMaxY:1,brightnessThreshold:50,blurrinessThreshold:50,tiltRotationAngleThreshold:15,minMagicCropSize:200,headwearThreshold:.86,lensesThreshold:.95,closedEyesThreshold:.9,maskThreshold:.85,minFaceQualityScore:.63,isOcclusionCheckEnabled:!1,faceOcclusionThreshold:.3}}const getProfiles=()=>[new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_01,DetectionType.IDCapture,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Current Prod - Id Capture Profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.IdBlurGlarePipeline,PipelineProfileName.IdCapture_2_02,DetectionType.IDCapture,["id_capture_2_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:getFeatureFlag("id_face_readability"),isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"https://www.notion.so/ML-Update-ID-processing-model-to-accept-more-back-ID-types-18c4c3caef49801e95b4fd6bf9b92883?pvs=4"),new PipelineProfile(WasmPipelineType.IdBarcodeAndTextQualityPipeline,PipelineProfileName.IdCapture_3_02,DetectionType.IDCapture,["id_capture_3_02_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV3x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:getFeatureFlag("id_iou_check")},IdCaptureParamsConfigurator,"Pipeline with text and barcode quality: https://www.notion.so/Web-Use-Text-Barcode-model-2nd-iteration-1bc4c3caef49805aa9e6d308db9fc6dd?pvs=4"),new PipelineProfile(WasmPipelineType.IdVideoSelfiePipeline,PipelineProfileName.IdVideoSelfie_2_01,DetectionType.IdVideoSelfie,["id_capture_2_01_fp16.ortmodelv2","id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2"],{glareThreshold:.3,classificationThreshold:.98,sideThreshold:.8,iouThreshold:.8,sharpnessThreshold:.2,sharpnessChangeThreshold:.2,modelType:IdCaptureModelType.IdCaptureV2x,isIdFaceQualityCheckEnabled:!1,isIouCheckEnabled:!0},IdCaptureParamsConfigurator,"Current Prod - Id Videoselfie profile with model https://www.notion.so/ID-cropping-web-2-01-d011d878c6f4406394609cbfbf03c259?pvs=4"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieWithAggregationMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Selfie face detection profile with aggregation metrics"),new PipelineProfile(WasmPipelineType.SelfieWithQualityMetrics,PipelineProfileName.SelfieWithQualityMetrics,DetectionType.Selfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"Current Prod - Selfie face detection profile with quality metrics"),new PipelineProfile(WasmPipelineType.SelfieWithAggregationMetrics,PipelineProfileName.SelfieVideoSelfie,DetectionType.SelfieVideoSelfie,["selfie_bf_angles_192x192_opset9_fp16.ortmodelv2","face_attributes_v1_3_fp16.ortmodelv2","mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2","face_occlusion_v0_1_fp16.ortmodelv2"],getSelfieFaceDetectionPipelineParams(),null,"VideoSelfie face detection profile")];function getProfile(Be){const Le=getProfiles().find(Ye=>Ye.name===Be);if(!Le)throw new Error(`Profile not found for type: ${Be}`);return Le}const wasmVersion="v2.12.47";function generateBundle(){const Be=getFeatureFlag("id_text_barcode_readability")?PipelineProfileName.IdCapture_3_02:getFeatureFlag("id_model_hebrew_back_id")?PipelineProfileName.IdCapture_2_02:PipelineProfileName.IdCapture_2_01,Le=PipelineProfileName.SelfieWithQualityMetrics,Ye=PipelineProfileName.SelfieVideoSelfie,tt=PipelineProfileName.IdVideoSelfie_2_01;return[Be,tt,Le,Ye]}function getInitializationParams(){const Le=generateBundle(),Ye="https://d3vv997wtl2myz.cloudfront.net/webcamera/onnx-backend-wasm",tt=`${Ye}/${wasmVersion}/webLib.wasm`,nt=`${Ye}/${wasmVersion}/webLibSimd.wasm`,ft=`${Ye}/${wasmVersion}/webLib.js`,ht=`${Ye}/${wasmVersion}/versions.json`;let gt=new Map,At=new Map;for(const xt of Le){const Et=getProfile(xt);if(!Et)throw new Error(`Profile not found: ${xt}`);const yt=Et.modelNames;let Ct=[];for(const kt of yt)Ct.push(`${Ye}/${wasmVersion}/models/${kt}`);gt.set(Et.pipelineType,Ct),At.set(Et.detectionType,Et)}return{wasmModulePath:tt,wasmSimdModulePath:nt,glueCodePath:ft,versionsFilePath:ht,pipelineModels:gt,enableSIMD:!0,profiles:At,wasmVersion}}window.wasmArrayBuffer=null;class MlWasmJSApi{constructor(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.wasmModule=null,this.pipelineApiUtilities=null,this.utilityApi=null,this.idCaptureWasmApi=null,this.faceDetectionWasmApi=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,this.isInitialized_=!1,this.inspectorOpened_=!1,this.wasmCallMutex=new Mutex,this.Module=null,this.loadModule=async Le=>{this.Module=(await import(Le)).Module}}async initialize(Le,Ye,tt,nt,ft,ht){await this.freeResources(),this.pipelines_=ht,this.versionsFile=ft,await this.loadModule(tt);const gt=await this.loadWasm(nt,Le,Ye);return this.pipelineApiUtilities=new this.wasmModule.PipelineApiUtilities,this.utilityApi=new this.wasmModule.UtilityApi,this.idCaptureWasmApi=new this.wasmModule.IdCaptureApi,this.faceDetectionWasmApi=new this.wasmModule.FaceDetectionApi,this.isInitialized_=!0,gt}static getInstance(){return MlWasmJSApi.instance||(MlWasmJSApi.instance=new MlWasmJSApi),MlWasmJSApi.instance}isInitialized(){return this.pipelineApiUtilities!=null&&this.utilityApi!=null&&this.idCaptureWasmApi!=null&&this.faceDetectionWasmApi!=null&&this.isInitialized_}async allocateImageBuffers(Le,Ye){this.checkWasmInitialization("Unable to allocate image buffers, cpp API hasn't been initialized"),!(Le&&Ye&&Le==this.imageWidth_&&Ye==this.imageHeight_&&this.inputImageBuffer&&Le*Ye*4===this.inputImageBuffer.length)&&(this.imageWidth_=Le,this.imageHeight_=Ye,this.inputImageBuffer=this.pipelineApiUtilities.allocateInputImageBuffer(Le,Ye,4))}async handleDetectionCallAndUpdateState(Le){this.checkWasmInitialization("Unable to update pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.handleDetectionCallAndUpdateState(this.pipelineTypeToWasmEnum(Le))}ens(Le){return this.checkWasmInitialization("Unable to ens, cpp API hasn't been initialized"),this.utilityApi.ens(Le)}ckvcks(Le){this.checkWasmInitialization("Unable to ckvcks, cpp API hasn't been initialized"),this.utilityApi.ckvcks(Le)}isVirtualCamera(Le){if(this.checkWasmInitialization("Unable to check if the camera is virtual, cpp API hasn't been initialized"),Le)return this.utilityApi.isVirtualCamera(Le)}estimatePerformance(){return this.checkWasmInitialization("Unable to estimate performance, cpp API hasn't been initialized"),this.utilityApi.estimatePerformance()}async analyzeFrame(Le){this.checkWasmInitialization("Unable to analyze the frame, cpp API hasn't been initialized"),await this.allocateImageBuffers(Le.width,Le.height),this.inputImageBuffer.set(Le.data),this.utilityApi.analyzeFrame()}async freeResources(){this.versionsFile=null,this.modelsBuffers=null,this.inputImageBuffer=null,this.imageWidth_=null,this.imageHeight_=null,this.pipelines_=null,window.wasmArrayBuffer=null,this.pipelineApiUtilities&&typeof this.pipelineApiUtilities.delete=="function"&&(this.pipelineApiUtilities.delete(),this.pipelineApiUtilities=null),this.utilityApi&&typeof this.utilityApi.delete=="function"&&(this.utilityApi.delete(),this.utilityApi=null),this.idCaptureWasmApi&&typeof this.idCaptureWasmApi.delete=="function"&&(this.idCaptureWasmApi.delete(),this.idCaptureWasmApi=null),this.faceDetectionWasmApi&&typeof this.faceDetectionWasmApi.delete=="function"&&(this.faceDetectionWasmApi.delete(),this.faceDetectionWasmApi=null),this.wasmModule=null,this.isInitialized_=!1}resetPipeline(Le){this.checkWasmInitialization("Unable to reset pipeline, cpp API hasn't been initialized"),this.pipelineApiUtilities.resetPipeline(this.pipelineTypeToWasmEnum(Le))}resetAllPipelines(){this.checkWasmInitialization("Unable to reset pipelines, cpp API hasn't been initialized");for(const[Le,Ye]of this.pipelines_)this.resetPipeline(Le)}resetOther(){this.checkWasmInitialization("Unable to reset other states, cpp API hasn't been initialized"),this.utilityApi.resetOther()}reset(){this.resetAllPipelines(),this.resetOther()}async process(Le,Ye){if(this.checkWasmInitialization("Unable to process the image, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");switch(this.inputImageBuffer.set(Le.data),Ye){case WasmPipelineType.IdBlurGlarePipeline:case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.idCaptureWasmApi.runIdCapturePipeline(this.pipelineTypeToWasmEnum(Ye));case WasmPipelineType.IdFaceDetectionPipeline:return this.faceDetectionWasmApi.runIdFaceDetectionPipeline();case WasmPipelineType.IdVideoSelfiePipeline:return this.idCaptureWasmApi.runIdVideoSelfiePipeline();case WasmPipelineType.SelfieWithAggregationMetrics:case WasmPipelineType.SelfieWithQualityMetrics:return this.faceDetectionWasmApi.runSelfieFaceDetectionPipeline(this.pipelineTypeToWasmEnum(Ye));default:throw new Error("Unknown pipeline type")}}async runIdCapture(Le){if(this.checkWasmInitialization("Unable to run Id Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(Le.data),this.idCaptureWasmApi.runIdCapture()}async runSelfieCapture(Le){if(this.checkWasmInitialization("Unable to run Selfie Capture, cpp API hasn't been initialized"),this.inputImageBuffer===null)throw new Error("Unable to process the image, buffers haven't been allocated!");return this.inputImageBuffer.set(Le.data),this.faceDetectionWasmApi.runSelfieCapture()}async setFacePositionConstraints(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face position constraints, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFacePositionConstraints(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceDetectionThresholds(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set face detection thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}async setFaceAttributesThresholds(Le,Ye,tt,nt,ft){this.checkWasmInitialization("Unable to set face attributes thresholds, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceAttributesThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft)}async setFaceChecksEnabled(Le,Ye,tt,nt,ft,ht){this.checkWasmInitialization("Unable to set face checks enabled flags, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceChecksEnabled(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht)}async setFaceDetectionMode(Le,Ye){this.checkWasmInitialization("Unable to set face detection mode, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionMode(this.pipelineTypeToWasmEnum(Le),Ye)}async setFaceDetectionCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt,bt,It,wt,Rt,Tt){this.checkWasmInitialization("Unable to set face detection callbacks, cpp API hasn't been initialized"),this.faceDetectionWasmApi.setFaceDetectionCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt,bt,It,wt,Rt,Tt)}async setIdCaptureThresholds(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt){this.checkWasmInitialization("Unable to set thresholds, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureThresholds(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt)}async setIdCaptureCallbacks(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt){this.checkWasmInitialization("Unable to set callbacks, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureCallbacks(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt,vt)}async setIdCaptureGeometryParams(Le,Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt){this.checkWasmInitialization("Unable to set geometry params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureGeometryParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At,xt,Et,yt,Ct,kt)}async setIdCaptureConfigParams(Le,Ye,tt,nt,ft,ht,gt,At){this.checkWasmInitialization("Unable to set config params, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureConfigParams(this.pipelineTypeToWasmEnum(Le),Ye,tt,nt,ft,ht,gt,At)}setIdCaptureModelType(Le,Ye){this.checkWasmInitialization("Unable to set model type, cpp API hasn't been initialized"),this.idCaptureWasmApi.setIdCaptureModelType(this.pipelineTypeToWasmEnum(Le),this.IdCaptureModelTypeToWasmEnum(Ye))}IdPerspectiveTransform(Le,Ye){return this.checkWasmInitialization("Unable to perform perspective transform, cpp API hasn't been initialized"),this.idCaptureWasmApi.IdPerspectiveTransform(Le,Ye)}async getVersions(){const Ye=await(await fetch(this.versionsFile)).text();return JSON.parse(Ye)}async loadWasm(Le,Ye,tt){const nt=Le?tt:Ye;try{window.wasmArrayBuffer=await fetch(nt).then(ft=>ft.arrayBuffer()).then(ft=>new Uint8Array(ft)),this.wasmModule=await this.Module()}catch(ft){if(console.log(ft,Le,"useSmd"),Le)return await this.loadWasm(!1,Ye,tt);throw ft}return Le}async loadModels(){var nt;this.checkWasmInitialization("Unable load the models, cpp API hasn't been initialized");let Le=new this.wasmModule.PipelineTypeToIntMap,Ye=new Map,tt=new Map;for(let[ft,ht]of this.pipelines_){let gt=this.pipelineTypeToWasmEnum(ft),At=[],xt=new this.wasmModule.VectorInt;for(let Et of ht){if(!tt.has(Et)){let Ct=await fetch(Et).then(kt=>kt.arrayBuffer()).then(kt=>new Uint8Array(kt));tt.set(Et,Ct)}let yt=tt.get(Et);xt.push_back(yt.byteLength),At.push(yt)}Le.set(gt,xt),Ye.set(gt,At)}this.modelsBuffers=this.pipelineApiUtilities.allocateModelsBuffers(Le);for(let[ft,ht]of Ye){let gt=(nt=this.modelsBuffers)==null?void 0:nt.get(ft);for(let At=0;At<gt.size();At++){let xt=gt==null?void 0:gt.get(At);if(xt)xt.set(ht[At]);else throw new Error("Unable to get model buffer from shared memory!")}}}async initializePipelines(){this.checkWasmInitialization("Unable to initialize pipelines, cpp API hasn't been initialized"),this.modelsBuffers||await this.loadModels(),this.pipelineApiUtilities.initializePipelines()}async setProductionMode(Le){this.checkWasmInitialization("Unable to set production mode, cpp API hasn't been initialized"),this.utilityApi.setProductionMode(Le)}getPipelineState(){return this.checkWasmInitialization("Unable to get pipeline state, cpp API hasn't been initialized"),this.pipelineApiUtilities.getPipelineState()}getCurrentPipeline(){return this.checkWasmInitialization("Unable to get current pipeline, cpp API hasn't been initialized"),this.pipelineTypeFromWasmEnum(this.pipelineApiUtilities.getCurrentPipeline())}setSdkVersion(Le){this.checkWasmInitialization("Unable to set sdk version, cpp API hasn't been initialized"),this.utilityApi.setSdkVersion(Le)}setSdkPlatform(Le){this.checkWasmInitialization("Unable to set device type, cpp API hasn't been initialized"),this.utilityApi.setSdkPlatform(Le)}setDeviceInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set device info, cpp API hasn't been initialized"),this.utilityApi.setDeviceInfo(Le,Ye)}setBrowserInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set browser info, cpp API hasn't been initialized"),this.utilityApi.setBrowserInfo(Le,Ye)}setCameraInfo(Le,Ye=!0){this.checkWasmInitialization("Unable to set camera info, cpp API hasn't been initialized"),this.utilityApi.setCameraInfo(Le,Ye)}setZc(Le){this.checkWasmInitialization("Unable to set zc, cpp API hasn't been initialized"),this.utilityApi.setZc(Le)}setMotionStatus(Le){this.checkWasmInitialization("Unable to set motion status, cpp API hasn't been initialized"),this.utilityApi.setMotionStatus(Le)}setMetadataField(Le,Ye){this.checkWasmInitialization("Unable to set metadata field, cpp API hasn't been initialized"),this.utilityApi.setMetadataField(Le,Ye)}setInspectorOpened(Le){this.inspectorOpened_=Le}setBackgroundMode(Le){this.checkWasmInitialization("Unable to set background mode, cpp API hasn't been initialized"),this.utilityApi.setBackgroundMode(Le)}getCheck(){return this.checkWasmInitialization("Unable to get check, cpp API hasn't been initialized"),this.utilityApi.getCheck()}getMetadata(){return this.checkWasmInitialization("Unable to get metadata, cpp API hasn't been initialized"),this.utilityApi.setInspectorOpened(this.inspectorOpened_),this.utilityApi.getMetadata()}async prc(){return this.checkWasmInitialization("Unable to prc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.prc.bind(this.utilityApi),[])}async poc(Le){this.checkWasmInitialization("Unable to poc, cpp API hasn't been initialized"),await this.wasmCallWrapper(this.utilityApi.poc.bind(this.utilityApi),[Le])}pipelineTypeToWasmEnum(Le){switch(Le){case WasmPipelineType.IdBlurGlarePipeline:return this.wasmModule.PipelineType.IdBlurGlarePipeline;case WasmPipelineType.IdBarcodeAndTextQualityPipeline:return this.wasmModule.PipelineType.IdBarcodeAndTextQualityPipeline;case WasmPipelineType.IdFaceDetectionPipeline:return this.wasmModule.PipelineType.IdFaceDetectionPipeline;case WasmPipelineType.IdVideoSelfiePipeline:return this.wasmModule.PipelineType.IdVideoSelfiePipeline;case WasmPipelineType.SelfieWithAggregationMetrics:return this.wasmModule.PipelineType.SelfieWithAggregationMetrics;case WasmPipelineType.SelfieWithQualityMetrics:return this.wasmModule.PipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}pipelineTypeFromWasmEnum(Le){switch(Le){case this.wasmModule.PipelineType.IdBlurGlarePipeline:return WasmPipelineType.IdBlurGlarePipeline;case this.wasmModule.IdBarcodeAndTextQualityPipeline:return WasmPipelineType.IdBarcodeAndTextQualityPipeline;case this.wasmModule.PipelineType.IdFaceDetectionPipeline:return WasmPipelineType.IdFaceDetectionPipeline;case this.wasmModule.PipelineType.IdVideoSelfiePipeline:return WasmPipelineType.IdVideoSelfiePipeline;case this.wasmModule.PipelineType.SelfieWithAggregationMetrics:return WasmPipelineType.SelfieWithAggregationMetrics;case this.wasmModule.PipelineType.SelfieWithQualityMetrics:return WasmPipelineType.SelfieWithQualityMetrics;default:throw new Error("Unknown pipeline type")}}IdCaptureModelTypeToWasmEnum(Le){switch(Le){case IdCaptureModelType.IdCaptureV1x:return this.wasmModule.IdCaptureModelType.IdCaptureV1x;case IdCaptureModelType.IdCaptureV2x:return this.wasmModule.IdCaptureModelType.IdCaptureV2x;case IdCaptureModelType.IdCaptureV3x:return this.wasmModule.IdCaptureModelType.IdCaptureV3x;default:throw new Error("Unknown Id Capture model type")}}checkWasmInitialization(Le){if(!this.isInitialized())throw new Error(Le)}async wasmCallWrapper(Le,Ye=[]){return await this.wasmCallMutex.withLock(async(...tt)=>{let nt=!1;try{for(;;){if(nt=Le(...tt),nt)return;await new Promise(ft=>setTimeout(ft,0))}}catch(ft){console.log("Error in wasmCallWrapper:",ft)}},...Ye)}}const MlWasmJSApi$1=MlWasmJSApi.getInstance(),version$4="1.85.0-20251219230908.0";function e$2(Be,Le){return function(Ye,tt){return Object.prototype.hasOwnProperty.call(Ye,tt)}(Be,Le)?Be[Le]:void 0}function t$2(Be,Le,Ye,tt){const nt=document,ft="securitypolicyviolation";let ht;const gt=xt=>{const Et=new URL(Be,location.href),{blockedURI:yt}=xt;yt!==Et.href&&yt!==Et.protocol.slice(0,-1)&&yt!==Et.origin||(ht=xt,At())};nt.addEventListener(ft,gt);const At=()=>nt.removeEventListener(ft,gt);return Promise.resolve().then(Le).then(xt=>(At(),xt),xt=>new Promise(Et=>{const yt=new MessageChannel;yt.port1.onmessage=()=>Et(),yt.port2.postMessage(null)}).then(()=>{if(At(),ht)return Ye(ht);throw xt}))}function n$2(Be){let Le="";for(let Ye=0;Ye<Be.length;++Ye)if(Ye>0){const tt=Be[Ye].toLowerCase();tt!==Be[Ye]?Le+=` ${tt}`:Le+=Be[Ye]}else Le+=Be[Ye].toUpperCase();return Le}const r$4={default:"endpoint"},o$1={default:"tlsEndpoint"},i$5="Client timeout",R$2="Network connection error",s$3="Network request aborted",a$3="Response cannot be parsed",c$3="Blocked by CSP",E$1="The endpoint parameter is not a valid URL",l$1="Handle on demand agent data error",u$1=n$2("WrongRegion"),d$1=n$2("SubscriptionNotActive"),_$2=n$2("UnsupportedVersion"),O$1=n$2("InstallationMethodRestricted"),p$1=n$2("HostnameRestricted"),I$1=n$2("IntegrationFailed"),f$2=n$2("NetworkRestricted"),N$1=n$2("InvalidProxyIntegrationSecret"),T$1=n$2("InvalidProxyIntegrationHeaders"),h$e=n$2("ProxyIntegrationSecretEnvironmentMismatch"),v$d="API key required",m$2="API key not found",A$1="API key expired",w$e="Request cannot be parsed",P$1="Request failed",D$1="Request failed to process",S$1="Too many requests, rate limit exceeded",y="Not available for this origin",g$1="Not available with restricted header",L$1=v$d,C$1=m$2,U$1=A$1;var b$2="3.12.3";const M$1="Failed to load the JS script of the agent",K="9319";function V(Be,Le){const Ye=[],[tt,nt]=function(gt){const At=function(yt){const Ct=[...yt];return{current:()=>Ct[0],postpone(){const kt=Ct.shift();kt!==void 0&&Ct.push(kt)},exclude(){Ct.shift()}}}(gt),xt=function(yt,Ct){let kt=0;return()=>Math.random()*Math.min(Ct,yt*Math.pow(2,kt++))}(100,3e3),Et=new Set;return[At.current(),(yt,Ct)=>{let kt;const vt=Ct instanceof Error?Ct.message:"";if(vt===c$3||vt===E$1)At.exclude(),kt=0;else if(vt===K)At.exclude();else if(vt===M$1){const It=Date.now()-yt.getTime()<50,wt=At.current();wt&&It&&!Et.has(wt)&&(Et.add(wt),kt=0),At.postpone()}else At.postpone();const bt=At.current();return bt===void 0?void 0:[bt,kt??yt.getTime()+xt()-Date.now()]}]}(Be);let ft;if(tt===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));const ht=gt=>{const At=new Date,xt=yt=>Ye.push({url:gt,startedAt:At,finishedAt:new Date,error:yt}),Et=Le(gt);return Et.then(()=>xt(),xt),Et.catch(yt=>{if(ft!=null||(ft=yt),Ye.length>=5)throw ft;const Ct=nt(At,yt);if(!Ct)throw ft;const[kt,vt]=Ct;return(bt=vt,new Promise(It=>setTimeout(It,bt))).then(()=>ht(kt));var bt})};return ht(tt).then(gt=>[gt,Ye])}const k$1="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",G=k$1;function B$1(Be){var Le,Ye;const{picked:tt,rest:nt}=function(Et,yt){const Ct={},kt={};for(const[vt,bt]of Object.entries(Et))yt.includes(vt)?Ct[vt]=bt:kt[vt]=bt;return{picked:Ct,rest:kt}}(Be,["scriptUrlPattern","token","apiKey"]),ft=tt.token,ht=(Le=tt.apiKey)!==null&&Le!==void 0?Le:ft,gt=(Ye=e$2(Be,"scriptUrlPattern"))!==null&&Ye!==void 0?Ye:k$1,[At,xt]=function(){const Et=[],yt=()=>{Et.push({time:new Date,state:document.visibilityState})},Ct=function(kt,vt,bt,It){return kt.addEventListener(vt,bt,It),()=>kt.removeEventListener(vt,bt,It)}(document,"visibilitychange",yt);return yt(),[Et,Ct]}();return Promise.resolve().then(()=>{if(!ht||typeof ht!="string")throw new Error(v$d);const Et=function(yt,Ct){return(Array.isArray(yt)?yt:[yt]).map(kt=>function(vt,bt){const It=encodeURIComponent;return vt.replace(/<[^<>]+>/g,wt=>wt==="<version>"?"3":wt==="<apiKey>"?It(bt):wt==="<loaderVersion>"?It(b$2):wt)}(String(kt),Ct))}(gt,ht);return V(Et,F$1)}).catch(Et=>{throw xt(),function(yt){return yt instanceof Error&&yt.message===K?new Error(M$1):yt}(Et)}).then(([Et,yt])=>(xt(),Et.load({...nt,ldi:{attempts:yt,visibilityStates:At}})))}function F$1(Be){return t$2(Be,()=>function(Le){return new Promise((Ye,tt)=>{if(function(gt){if(URL.prototype)try{return new URL(gt,location.href),!1}catch(At){if(At instanceof Error&&At.name==="TypeError")return!0;throw At}}(Le))throw new Error(E$1);const nt=document.createElement("script"),ft=()=>{var gt;return(gt=nt.parentNode)===null||gt===void 0?void 0:gt.removeChild(nt)},ht=document.head||document.getElementsByTagName("head")[0];nt.onload=()=>{ft(),Ye()},nt.onerror=()=>{ft(),tt(new Error(M$1))},nt.async=!0,nt.src=Le,ht.appendChild(nt)})}(Be),()=>{throw new Error(c$3)}).then(x$1)}function x$1(){const Be=window,Le="__fpjs_p_l_b",Ye=Be[Le];if(function(tt,nt){var ft;const ht=(ft=Object.getOwnPropertyDescriptor)===null||ft===void 0?void 0:ft.call(Object,tt,nt);ht!=null&&ht.configurable?delete tt[nt]:ht&&!ht.writable||(tt[nt]=void 0)}(Be,Le),typeof(Ye==null?void 0:Ye.load)!="function")throw new Error(K);return Ye}var H={load:B$1,defaultScriptUrlPattern:G,ERROR_SCRIPT_LOAD_FAIL:M$1,ERROR_API_KEY_EXPIRED:A$1,ERROR_API_KEY_INVALID:m$2,ERROR_API_KEY_MISSING:v$d,ERROR_BAD_REQUEST_FORMAT:w$e,ERROR_BAD_RESPONSE_FORMAT:a$3,ERROR_CLIENT_TIMEOUT:i$5,ERROR_CSP_BLOCK:c$3,ERROR_FORBIDDEN_ENDPOINT:p$1,ERROR_FORBIDDEN_HEADER:g$1,ERROR_FORBIDDEN_ORIGIN:y,ERROR_GENERAL_SERVER_FAILURE:P$1,ERROR_HANDLE_AGENT_DATA:l$1,ERROR_INSTALLATION_METHOD_RESTRICTED:O$1,ERROR_INTEGRATION_FAILURE:I$1,ERROR_INVALID_ENDPOINT:E$1,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:T$1,ERROR_INVALID_PROXY_INTEGRATION_SECRET:N$1,ERROR_NETWORK_ABORT:s$3,ERROR_NETWORK_CONNECTION:R$2,ERROR_NETWORK_RESTRICTED:f$2,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:h$e,ERROR_RATE_LIMIT:S$1,ERROR_SERVER_TIMEOUT:D$1,ERROR_SUBSCRIPTION_NOT_ACTIVE:d$1,ERROR_TOKEN_EXPIRED:U$1,ERROR_TOKEN_INVALID:C$1,ERROR_TOKEN_MISSING:L$1,ERROR_UNSUPPORTED_VERSION:_$2,ERROR_WRONG_REGION:u$1,defaultEndpoint:r$4,defaultTlsEndpoint:o$1};function e$1(Be,Le,Ye,tt){return new(Ye||(Ye=Promise))(function(nt,ft){function ht(xt){try{At(tt.next(xt))}catch(Et){ft(Et)}}function gt(xt){try{At(tt.throw(xt))}catch(Et){ft(Et)}}function At(xt){var Et;xt.done?nt(xt.value):(Et=xt.value,Et instanceof Ye?Et:new Ye(function(yt){yt(Et)})).then(ht,gt)}At((tt=tt.apply(Be,[])).next())})}function n$1(Be,Le){var Ye,tt,nt,ft,ht={label:0,sent:function(){if(1&nt[0])throw nt[1];return nt[1]},trys:[],ops:[]};return ft={next:gt(0),throw:gt(1),return:gt(2)},typeof Symbol=="function"&&(ft[Symbol.iterator]=function(){return this}),ft;function gt(At){return function(xt){return function(Et){if(Ye)throw new TypeError("Generator is already executing.");for(;ft&&(ft=0,Et[0]&&(ht=0)),ht;)try{if(Ye=1,tt&&(nt=2&Et[0]?tt.return:Et[0]?tt.throw||((nt=tt.return)&&nt.call(tt),0):tt.next)&&!(nt=nt.call(tt,Et[1])).done)return nt;switch(tt=0,nt&&(Et=[2&Et[0],nt.value]),Et[0]){case 0:case 1:nt=Et;break;case 4:return ht.label++,{value:Et[1],done:!1};case 5:ht.label++,tt=Et[1],Et=[0];continue;case 7:Et=ht.ops.pop(),ht.trys.pop();continue;default:if(nt=ht.trys,!((nt=nt.length>0&&nt[nt.length-1])||Et[0]!==6&&Et[0]!==2)){ht=0;continue}if(Et[0]===3&&(!nt||Et[1]>nt[0]&&Et[1]<nt[3])){ht.label=Et[1];break}if(Et[0]===6&&ht.label<nt[1]){ht.label=nt[1],nt=Et;break}if(nt&&ht.label<nt[2]){ht.label=nt[2],ht.ops.push(Et);break}nt[2]&&ht.ops.pop(),ht.trys.pop();continue}Et=Le.call(Be,ht)}catch(yt){Et=[6,yt],tt=0}finally{Ye=nt=0}if(5&Et[0])throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}([At,xt])}}}typeof SuppressedError=="function"&&SuppressedError;var r$3={exclude:[],include:[],logging:!0,timeout:1e3},o={},a$2={timeout:"true"},i$4=function(Be,Le){typeof window<"u"&&(o[Be]=Le)},u=function(){return Object.fromEntries(Object.entries(o).filter(function(Be){var Le,Ye=Be[0];return!(!((Le=r$3==null?void 0:r$3.exclude)===null||Le===void 0)&&Le.includes(Ye))}).filter(function(Be){var Le,Ye,tt,nt,ft=Be[0];return!((Le=r$3==null?void 0:r$3.include)===null||Le===void 0)&&Le.some(function(ht){return ht.includes(".")})?(Ye=r$3==null?void 0:r$3.include)===null||Ye===void 0?void 0:Ye.some(function(ht){return ht.startsWith(ft)}):((tt=r$3==null?void 0:r$3.include)===null||tt===void 0?void 0:tt.length)===0||((nt=r$3==null?void 0:r$3.include)===null||nt===void 0?void 0:nt.includes(ft))}).map(function(Be){return[Be[0],(0,Be[1])()]}))};function c$2(Be){return Be^=Be>>>16,Be=Math.imul(Be,2246822507),Be^=Be>>>13,Be=Math.imul(Be,3266489909),(Be^=Be>>>16)>>>0}var s$2=new Uint32Array([597399067,2869860233,951274213,2716044179]);function l(Be,Le){return Be<<Le|Be>>>32-Le}function d(Be,Le){var Ye;if(Le===void 0&&(Le=0),Le=Le?0|Le:0,typeof Be=="string"&&(Ye=Be,Be=new TextEncoder().encode(Ye).buffer),!(Be instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");var tt=new Uint32Array([Le,Le,Le,Le]);(function(ft,ht){for(var gt=ft.byteLength/16|0,At=new Uint32Array(ft,0,4*gt),xt=0;xt<gt;xt++){var Et=At.subarray(4*xt,4*(xt+1));Et[0]=Math.imul(Et[0],s$2[0]),Et[0]=l(Et[0],15),Et[0]=Math.imul(Et[0],s$2[1]),ht[0]=ht[0]^Et[0],ht[0]=l(ht[0],19),ht[0]=ht[0]+ht[1],ht[0]=Math.imul(ht[0],5)+1444728091,Et[1]=Math.imul(Et[1],s$2[1]),Et[1]=l(Et[1],16),Et[1]=Math.imul(Et[1],s$2[2]),ht[1]=ht[1]^Et[1],ht[1]=l(ht[1],17),ht[1]=ht[1]+ht[2],ht[1]=Math.imul(ht[1],5)+197830471,Et[2]=Math.imul(Et[2],s$2[2]),Et[2]=l(Et[2],17),Et[2]=Math.imul(Et[2],s$2[3]),ht[2]=ht[2]^Et[2],ht[2]=l(ht[2],15),ht[2]=ht[2]+ht[3],ht[2]=Math.imul(ht[2],5)+2530024501,Et[3]=Math.imul(Et[3],s$2[3]),Et[3]=l(Et[3],18),Et[3]=Math.imul(Et[3],s$2[0]),ht[3]=ht[3]^Et[3],ht[3]=l(ht[3],13),ht[3]=ht[3]+ht[0],ht[3]=Math.imul(ht[3],5)+850148119}})(Be,tt),function(ft,ht){var gt=ft.byteLength/16|0,At=ft.byteLength%16,xt=new Uint32Array(4),Et=new Uint8Array(ft,16*gt,At);switch(At){case 15:xt[3]=xt[3]^Et[14]<<16;case 14:xt[3]=xt[3]^Et[13]<<8;case 13:xt[3]=xt[3]^Et[12],xt[3]=Math.imul(xt[3],s$2[3]),xt[3]=l(xt[3],18),xt[3]=Math.imul(xt[3],s$2[0]),ht[3]=ht[3]^xt[3];case 12:xt[2]=xt[2]^Et[11]<<24;case 11:xt[2]=xt[2]^Et[10]<<16;case 10:xt[2]=xt[2]^Et[9]<<8;case 9:xt[2]=xt[2]^Et[8],xt[2]=Math.imul(xt[2],s$2[2]),xt[2]=l(xt[2],17),xt[2]=Math.imul(xt[2],s$2[3]),ht[2]=ht[2]^xt[2];case 8:xt[1]=xt[1]^Et[7]<<24;case 7:xt[1]=xt[1]^Et[6]<<16;case 6:xt[1]=xt[1]^Et[5]<<8;case 5:xt[1]=xt[1]^Et[4],xt[1]=Math.imul(xt[1],s$2[1]),xt[1]=l(xt[1],16),xt[1]=Math.imul(xt[1],s$2[2]),ht[1]=ht[1]^xt[1];case 4:xt[0]=xt[0]^Et[3]<<24;case 3:xt[0]=xt[0]^Et[2]<<16;case 2:xt[0]=xt[0]^Et[1]<<8;case 1:xt[0]=xt[0]^Et[0],xt[0]=Math.imul(xt[0],s$2[0]),xt[0]=l(xt[0],15),xt[0]=Math.imul(xt[0],s$2[1]),ht[0]=ht[0]^xt[0]}}(Be,tt),function(ft,ht){ht[0]=ht[0]^ft.byteLength,ht[1]=ht[1]^ft.byteLength,ht[2]=ht[2]^ft.byteLength,ht[3]=ht[3]^ft.byteLength,ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0,ht[0]=c$2(ht[0]),ht[1]=c$2(ht[1]),ht[2]=c$2(ht[2]),ht[3]=c$2(ht[3]),ht[0]=ht[0]+ht[1]|0,ht[0]=ht[0]+ht[2]|0,ht[0]=ht[0]+ht[3]|0,ht[1]=ht[1]+ht[0]|0,ht[2]=ht[2]+ht[0]|0,ht[3]=ht[3]+ht[0]|0}(Be,tt);var nt=new Uint8Array(tt.buffer);return Array.from(nt).map(function(ft){return ft.toString(16).padStart(2,"0")}).join("")}function f$1(Be,Le){return new Promise(function(Ye){setTimeout(function(){return Ye(Le)},Be)})}function m$1(Be,Le,Ye){return Promise.all(Be.map(function(tt){return Promise.race([tt,f$1(Le,Ye)])}))}function g(){return e$1(this,void 0,void 0,function(){var Be,Le,Ye,tt,nt;return n$1(this,function(ft){switch(ft.label){case 0:return ft.trys.push([0,2,,3]),Be=u(),Le=Object.keys(Be),[4,m$1(Object.values(Be),(r$3==null?void 0:r$3.timeout)||1e3,a$2)];case 1:return Ye=ft.sent(),tt=Ye.filter(function(ht){return ht!==void 0}),nt={},tt.forEach(function(ht,gt){nt[Le[gt]]=ht}),[2,p(nt,r$3.exclude||[],r$3.include||[],"")];case 2:throw ft.sent();case 3:return[2]}})})}function p(Be,Le,Ye,tt){tt===void 0&&(tt="");for(var nt={},ft=function(xt,Et){var yt=tt+xt+".";if(typeof Et!="object"||Array.isArray(Et)){var Ct=Le.some(function(bt){return yt.startsWith(bt)}),kt=Ye.some(function(bt){return yt.startsWith(bt)});Ct&&!kt||(nt[xt]=Et)}else{var vt=p(Et,Le,Ye,yt);Object.keys(vt).length>0&&(nt[xt]=vt)}},ht=0,gt=Object.entries(Be);ht<gt.length;ht++){var At=gt[ht];ft(At[0],At[1])}return nt}function w$d(Be){return e$1(this,void 0,void 0,function(){var Le,Ye;return n$1(this,function(tt){switch(tt.label){case 0:return tt.trys.push([0,2,,3]),[4,g()];case 1:return Le=tt.sent(),Ye=d(JSON.stringify(Le)),Math.random()<1e-5&&r$3.logging&&function(nt,ft){e$1(this,void 0,void 0,function(){var ht,gt;return n$1(this,function(At){switch(At.label){case 0:if(ht="https://logging.thumbmarkjs.com/v1/log",gt={thumbmark:nt,components:ft,version:"0.20.6"},sessionStorage.getItem("_tmjs_l"))return[3,4];sessionStorage.setItem("_tmjs_l","1"),At.label=1;case 1:return At.trys.push([1,3,,4]),[4,fetch(ht,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)})];case 2:case 3:return At.sent(),[3,4];case 4:return[2]}})})}(Ye,Le),[2,Ye.toString()];case 2:throw tt.sent();case 3:return[2]}})})}function b$1(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};for(var Be=navigator.userAgent,Le={edg:"Edge",opr:"Opera",samsung:"SamsungBrowser"},Ye=0,tt=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/,/(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/,/(?<name>samsung).*Version\/(?<version>\d+(?:\.\d+)?)/i,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/];Ye<tt.length;Ye++){var nt=tt[Ye],ft=Be.match(nt);if(ft&&ft.groups)return{name:Le[ft.groups.name.toLowerCase()]||ft.groups.name,version:ft.groups.version}}return{name:"unknown",version:"unknown"}}function S(Be){for(var Le=0,Ye=0;Ye<Be.length;++Ye)Le+=Math.abs(Be[Ye]);return Le}var M=b$1();function E(Be,Le,Ye){for(var tt=[],nt=0;nt<Be[0].data.length;nt++){for(var ft=[],ht=0;ht<Be.length;ht++)ft.push(Be[ht].data[nt]);tt.push(P(ft))}var gt=new Uint8ClampedArray(tt);return new ImageData(gt,Le,Ye)}function P(Be){if(Be.length===0)return 0;for(var Le={},Ye=0,tt=Be;Ye<tt.length;Ye++)Le[ft=tt[Ye]]=(Le[ft]||0)+1;var nt=Be[0];for(var ft in Le)Le[ft]>Le[nt]&&(nt=parseInt(ft,10));return nt}["SamsungBrowser","Safari"].includes(M.name)||i$4("audio",function(){return e$1(this,void 0,void 0,function(){return n$1(this,function(Be){return[2,new Promise(function(Le,Ye){try{var tt=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),nt=tt.createBufferSource(),ft=tt.createOscillator();ft.frequency.value=1e3;var ht,gt=tt.createDynamicsCompressor();gt.threshold.value=-50,gt.knee.value=40,gt.ratio.value=12,gt.attack.value=0,gt.release.value=.2,ft.connect(gt),gt.connect(tt.destination),ft.start(),tt.oncomplete=function(At){ht=At.renderedBuffer.getChannelData(0),Le({sampleHash:S(ht),oscillator:ft.type,maxChannels:tt.destination.maxChannelCount,channelCountMode:nt.channelCountMode})},tt.startRendering()}catch(At){console.error("Error creating audio fingerprint:",At),Ye(At)}})]})})});var A=b$1(),C=A.name.toLowerCase(),x=A.version.split(".")[0]||"0",T=parseInt(x,10);C==="firefox"||C==="safari"&&T===17||i$4("canvas",function(){return document.createElement("canvas").getContext("2d"),new Promise(function(Be){var Le=Array.from({length:3},function(){return function(){var Ye=document.createElement("canvas"),tt=Ye.getContext("2d");if(!tt)return new ImageData(1,1);Ye.width=280,Ye.height=20;var nt=tt.createLinearGradient(0,0,Ye.width,Ye.height);nt.addColorStop(0,"red"),nt.addColorStop(.16666666666666666,"orange"),nt.addColorStop(.3333333333333333,"yellow"),nt.addColorStop(.5,"green"),nt.addColorStop(.6666666666666666,"blue"),nt.addColorStop(.8333333333333334,"indigo"),nt.addColorStop(1,"violet"),tt.fillStyle=nt,tt.fillRect(0,0,Ye.width,Ye.height);var ft="Random Text WMwmil10Oo";return tt.font="23.123px Arial",tt.fillStyle="black",tt.fillText(ft,-5,15),tt.fillStyle="rgba(0, 0, 255, 0.5)",tt.fillText(ft,-3.3,17.7),tt.beginPath(),tt.moveTo(0,0),tt.lineTo(2*Ye.width/7,Ye.height),tt.strokeStyle="white",tt.lineWidth=2,tt.stroke(),tt.getImageData(0,0,Ye.width,Ye.height)}()});Be({commonImageDataHash:d(E(Le,280,20).data.toString()).toString()})})});var k,I=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],R$1=["monospace","sans-serif","serif"];function L(Be,Le){if(!Be)throw new Error("Canvas context not supported");return Be.font,Be.font="72px ".concat(Le),Be.measureText("WwMmLli0Oo").width}function _$1(){var Be,Le=document.createElement("canvas"),Ye=(Be=Le.getContext("webgl"))!==null&&Be!==void 0?Be:Le.getContext("experimental-webgl");if(Ye&&"getParameter"in Ye)try{var tt=(Ye.getParameter(Ye.VENDOR)||"").toString(),nt=(Ye.getParameter(Ye.RENDERER)||"").toString(),ft={vendor:tt,renderer:nt,version:(Ye.getParameter(Ye.VERSION)||"").toString(),shadingLanguageVersion:(Ye.getParameter(Ye.SHADING_LANGUAGE_VERSION)||"").toString()};if(!nt.length||!tt.length){var ht=Ye.getExtension("WEBGL_debug_renderer_info");if(ht){var gt=(Ye.getParameter(ht.UNMASKED_VENDOR_WEBGL)||"").toString(),At=(Ye.getParameter(ht.UNMASKED_RENDERER_WEBGL)||"").toString();gt&&(ft.vendorUnmasked=gt),At&&(ft.rendererUnmasked=At)}}return ft}catch{}return"undefined"}function O(){var Be=new Float32Array(1),Le=new Uint8Array(Be.buffer);return Be[0]=1/0,Be[0]=Be[0]-Be[0],Le[3]}function B(Be,Le){var Ye={};return Le.forEach(function(tt){var nt=function(ft){if(ft.length===0)return null;var ht={};ft.forEach(function(xt){var Et=String(xt);ht[Et]=(ht[Et]||0)+1});var gt=ft[0],At=1;return Object.keys(ht).forEach(function(xt){ht[xt]>At&&(gt=xt,At=ht[xt])}),gt}(Be.map(function(ft){return tt in ft?ft[tt]:void 0}).filter(function(ft){return ft!==void 0}));nt&&(Ye[tt]=nt)}),Ye}function D(){var Be=[],Le={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(Le).forEach(function(Ye){Le[Ye].forEach(function(tt){matchMedia("(".concat(Ye,": ").concat(tt,")")).matches&&Be.push("".concat(Ye,": ").concat(tt))})}),Be}b$1().name!="Firefox"&&i$4("fonts",function(){var Be=this;return new Promise(function(Le,Ye){try{(function(tt){var nt;e$1(this,void 0,void 0,function(){var ft,ht,gt;return n$1(this,function(At){switch(At.label){case 0:return document.body?[3,2]:[4,(xt=50,new Promise(function(yt){return setTimeout(yt,xt,Et)}))];case 1:return At.sent(),[3,0];case 2:if((ft=document.createElement("iframe")).setAttribute("frameBorder","0"),(ht=ft.style).setProperty("position","fixed"),ht.setProperty("display","block","important"),ht.setProperty("visibility","visible"),ht.setProperty("border","0"),ht.setProperty("opacity","0"),ft.src="about:blank",document.body.appendChild(ft),!(gt=ft.contentDocument||((nt=ft.contentWindow)===null||nt===void 0?void 0:nt.document)))throw new Error("Iframe document is not accessible");return tt({iframe:gt}),setTimeout(function(){document.body.removeChild(ft)},0),[2]}var xt,Et})})})(function(tt){var nt=tt.iframe;return e$1(Be,void 0,void 0,function(){var ft,ht,gt,At;return n$1(this,function(xt){return ft=nt.createElement("canvas"),ht=ft.getContext("2d"),gt=R$1.map(function(Et){return L(ht,Et)}),At={},I.forEach(function(Et){var yt=L(ht,Et);gt.includes(yt)||(At[Et]=yt)}),Le(At),[2]})})})}catch{Ye({error:"unsupported"})}})}),i$4("hardware",function(){return new Promise(function(Be,Le){var Ye=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,tt=window.performance&&window.performance.memory?window.performance.memory:0;Be({videocard:_$1(),architecture:O(),deviceMemory:Ye.toString()||"undefined",jsHeapSizeLimit:tt.jsHeapSizeLimit||0})})}),i$4("locales",function(){return new Promise(function(Be){Be({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}),i$4("permissions",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){return k=(r$3==null?void 0:r$3.permissions_to_check)||["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],b$1().name.toLowerCase()==="safari"&&(k=k.filter(function(Ye){return!["camera","geolocation","microphone"].includes(Ye)})),Be=Array.from({length:(r$3==null?void 0:r$3.retries)||3},function(){return function(){return e$1(this,void 0,void 0,function(){var Ye,tt,nt,ft,ht;return n$1(this,function(gt){switch(gt.label){case 0:Ye={},tt=0,nt=k,gt.label=1;case 1:if(!(tt<nt.length))return[3,6];ft=nt[tt],gt.label=2;case 2:return gt.trys.push([2,4,,5]),[4,navigator.permissions.query({name:ft})];case 3:return ht=gt.sent(),Ye[ft]=ht.state.toString(),[3,5];case 4:return gt.sent(),[3,5];case 5:return tt++,[3,1];case 6:return[2,Ye]}})})}()}),[2,Promise.all(Be).then(function(Ye){return B(Ye,k)})]})})}),i$4("plugins",function(){var Be=[];if(navigator.plugins)for(var Le=0;Le<navigator.plugins.length;Le++){var Ye=navigator.plugins[Le];Be.push([Ye.name,Ye.filename,Ye.description].join("|"))}return new Promise(function(tt){tt({plugins:Be})})}),i$4("screen",function(){return new Promise(function(Be){Be({is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:D()})})}),i$4("system",function(){return new Promise(function(Be){var Le=b$1(),Ye={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:Le.name,version:Le.version}};Le.name.toLowerCase()!=="safari"&&(Ye.applePayVersion=function(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{for(var tt=window.ApplePaySession.supportsVersion,nt=15;nt>0;nt--)if(tt(nt))return nt}catch{return 0}return 0}(),Ye.cookieEnabled=window.navigator.cookieEnabled),Be(Ye)})});var U,N=b$1().name!=="SamsungBrowser"?1:3,F=null;i$4("webgl",function(){return e$1(this,void 0,void 0,function(){var Be;return n$1(this,function(Le){typeof document<"u"&&((U=document.createElement("canvas")).width=200,U.height=100,F=U.getContext("webgl"));try{if(!F)throw new Error("WebGL not supported");return Be=Array.from({length:N},function(){return function(){try{if(!F)throw new Error("WebGL not supported");var Ye=`
|
|
67
67
|
attribute vec2 position;
|
|
68
68
|
void main() {
|
|
69
69
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
@@ -5684,11 +5684,7 @@ linearGradient:first-of-type {
|
|
|
5684
5684
|
transform: translate(-50%, 0);
|
|
5685
5685
|
opacity: 1;
|
|
5686
5686
|
}
|
|
5687
|
-
`,
|
|
5688
|
-
background: transparent;
|
|
5689
|
-
border: none;
|
|
5690
|
-
cursor: pointer;
|
|
5691
|
-
padding: 0;
|
|
5687
|
+
`,AnimatedWrapper=dt(Box)`
|
|
5692
5688
|
position: absolute;
|
|
5693
5689
|
bottom: 44px;
|
|
5694
5690
|
left: 50%;
|
|
@@ -5696,22 +5692,25 @@ linearGradient:first-of-type {
|
|
|
5696
5692
|
width: 68px;
|
|
5697
5693
|
height: 68px;
|
|
5698
5694
|
z-index: 101;
|
|
5695
|
+
animation: ${slideUp} 0.5s ease-out forwards;
|
|
5696
|
+
`,StyledSVGWrapper=dt.div`
|
|
5697
|
+
width: 100%;
|
|
5698
|
+
height: 100%;
|
|
5699
5699
|
display: flex;
|
|
5700
5700
|
align-items: center;
|
|
5701
5701
|
justify-content: center;
|
|
5702
|
-
|
|
5703
|
-
|
|
5702
|
+
|
|
5704
5703
|
svg {
|
|
5705
5704
|
width: 100%;
|
|
5706
5705
|
height: 100%;
|
|
5707
5706
|
transition: filter 0.2s ease, transform 0.2s ease;
|
|
5708
5707
|
}
|
|
5709
5708
|
|
|
5710
|
-
|
|
5709
|
+
button:active & svg {
|
|
5711
5710
|
filter: brightness(0.8);
|
|
5712
5711
|
transform: scale(0.95);
|
|
5713
5712
|
}
|
|
5714
|
-
`,ManualCaptureButton=Be=>{const{t:Le}=useTranslation$1();return jsxRuntimeExports.jsxs(StyledManualCaptureButton,{type:"button","aria-label":Le("idv2.capture.manualCapture.ariaLabel"),...Be,children:[jsxRuntimeExports.jsx(CaptureTooltip,{}),jsxRuntimeExports.jsx(SvgManualCaptureButton,{title:Le("idv2.capture.manualCapture.title")})]})},SvgBlurIcon=Be=>React__namespace.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{d:"M12.2597 4.15625C14.3285 4.1835 16.3243 4.916 17.9199 6.23242C18.2394 6.49605 18.2851 6.96957 18.0214 7.28906C17.7578 7.60828 17.2852 7.65315 16.9658 7.38965C15.6357 6.29217 13.9729 5.68098 12.249 5.65625C10.5346 5.67942 8.878 6.28369 7.5527 7.37207C6.03992 8.62375 4.84504 10.2126 4.06246 12.0107C4.83423 13.8004 6.01967 15.3822 7.52242 16.626C7.84151 16.8901 7.88613 17.3635 7.62203 17.6826C7.35793 18.0017 6.88449 18.0463 6.56539 17.7822C4.79235 16.3147 3.41234 14.427 2.5527 12.29C2.48019 12.1096 2.48144 11.9077 2.55465 11.7275C3.42639 9.58276 4.81515 7.68881 6.5986 6.21387L6.60055 6.21289C8.19264 4.90541 10.1832 4.18132 12.2412 4.15625H12.2597Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M19.3963 3.80561C19.6892 3.51272 20.165 3.51271 20.4579 3.80561C20.7504 4.09843 20.7504 4.57333 20.4579 4.86615L5.10728 20.2158C4.81438 20.5087 4.33962 20.5087 4.04673 20.2158C3.75401 19.9229 3.7539 19.4481 4.04673 19.1552L19.3963 3.80561Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M12.4287 8.18359C13.377 8.22855 14.2762 8.62583 14.9502 9.2998C15.2429 9.59271 15.243 10.0675 14.9502 10.3604C14.6574 10.653 14.1825 10.653 13.8897 10.3604C13.4528 9.92345 12.8603 9.6783 12.2422 9.67969H12.2412C10.9575 9.68196 9.91866 10.725 9.92092 12.0088V12.0127C9.91873 12.6266 10.1629 13.2142 10.5987 13.6455C10.893 13.9369 10.8949 14.4117 10.6035 14.7061C10.3122 15.0003 9.83736 15.0032 9.54299 14.7119C8.82092 13.9973 8.41718 13.0228 8.42092 12.0068C8.41946 9.89669 10.1276 8.18357 12.2383 8.17969L12.4287 8.18359Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M19.0536 8.34264C19.3864 8.09617 19.8559 8.16611 20.1024 8.49889C20.8393 9.49403 21.4571 10.5723 21.9413 11.7128C22.0214 11.9015 22.0206 12.1153 21.9393 12.3036C19.9504 16.911 16.3507 19.8602 12.2499 19.8602C11.3317 19.8602 10.421 19.7108 9.55163 19.4217C9.15858 19.2911 8.94538 18.8665 9.07605 18.4735C9.20672 18.0805 9.63127 17.8683 10.0243 17.9989C10.7428 18.2378 11.4942 18.3602 12.2499 18.3602C15.4814 18.3602 18.5736 16.0795 20.4296 12.0047C20.0129 11.0822 19.5004 10.2058 18.8973 9.39147C18.6509 9.05863 18.7208 8.58917 19.0536 8.34264Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M14.5349 12.4195C14.6094 12.0122 14.9996 11.7418 15.407 11.816C15.8145 11.8902 16.0848 12.2815 16.0105 12.689C15.7256 14.2521 14.5032 15.4787 12.9392 15.7662C12.5318 15.841 12.1411 15.571 12.0662 15.1636C11.9914 14.7563 12.2605 14.3655 12.6677 14.2906C13.6177 14.116 14.3617 13.3702 14.5349 12.4195Z",fill:"#14151A"})),SvgGlareIcon=Be=>React__namespace.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{d:"M2.25 15.1279V9.51172C2.25 7.88342 2.76123 6.43316 3.74023 5.38281C4.72472 4.32662 6.12676 3.73535 7.78223 3.73535H13.2705L13.3477 3.73926C13.7258 3.7777 14.0205 4.09705 14.0205 4.48535C14.0205 4.87365 13.7258 5.193 13.3477 5.23145L13.2705 5.23535H7.78223C6.49854 5.23535 5.50964 5.68477 4.83789 6.40527C4.16068 7.13181 3.75 8.19485 3.75 9.51172V15.1279C3.75003 16.4457 4.1591 17.5083 4.83496 18.2344C5.5052 18.9542 6.49361 19.4043 7.78223 19.4043H16.2158C17.5051 19.4043 18.4945 18.9544 19.165 18.2344C19.8412 17.5083 20.25 16.4456 20.25 15.1279V12.458C20.25 12.0438 20.5858 11.708 21 11.708C21.4142 11.708 21.75 12.0438 21.75 12.458V15.1279C21.75 16.7554 21.2412 18.2061 20.2627 19.2568C19.2785 20.3135 17.8755 20.9043 16.2158 20.9043H7.78223C6.12294 20.9043 4.72013 20.3136 3.73633 19.2568C2.7582 18.2061 2.25003 16.7553 2.25 15.1279Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M14.2705 14.4121C14.6846 14.4123 15.0205 14.748 15.0205 15.1621C15.0205 15.5762 14.6846 15.912 14.2705 15.9121H7.04102C6.62682 15.9121 6.29105 15.5763 6.29102 15.1621C6.29102 14.7479 6.6268 14.4121 7.04102 14.4121H14.2705ZM8.96094 10.6523C9.37494 10.6526 9.71094 10.9883 9.71094 11.4023C9.71094 11.8164 9.37494 12.1521 8.96094 12.1523H7.04102C6.6268 12.1523 6.29102 11.8166 6.29102 11.4023C6.29102 10.9881 6.6268 10.6523 7.04102 10.6523H8.96094Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M18.4043 3.0957C18.7183 3.0957 18.9986 3.29142 19.1074 3.58594L19.209 3.85938C19.5141 4.68491 20.1638 5.33534 20.9873 5.64062L21.2607 5.74219C21.5548 5.85125 21.75 6.13168 21.75 6.44531C21.75 6.75893 21.5548 7.03941 21.2607 7.14844L20.9873 7.25C20.215 7.5363 19.5953 8.1258 19.2695 8.87891L19.209 9.03125L19.1074 9.30469C18.9986 9.59909 18.7182 9.79492 18.4043 9.79492C18.0904 9.79492 17.81 9.59909 17.7012 9.30469L17.5996 9.03125C17.2945 8.20566 16.6448 7.55532 15.8213 7.25L15.5479 7.14844C15.2538 7.03941 15.0586 6.75893 15.0586 6.44531C15.0586 6.13168 15.2538 5.85125 15.5479 5.74219L15.8213 5.64062C16.6448 5.33534 17.2945 4.68491 17.5996 3.85938L17.7012 3.58594L17.749 3.48047C17.8799 3.24552 18.1294 3.0957 18.4043 3.0957ZM18.4043 5.49414C18.1366 5.85711 17.8158 6.17742 17.4531 6.44531C17.8156 6.71307 18.1367 7.03278 18.4043 7.39551C18.6718 7.03299 18.9922 6.71298 19.3545 6.44531C18.992 6.17751 18.6719 5.8569 18.4043 5.49414Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M13.9019 8.29492C14.232 8.29495 14.5236 8.51122 14.6196 8.82715C14.7187 9.15288 14.9733 9.4071 15.2974 9.50586C15.6128 9.60214 15.8286 9.89376 15.8286 10.2236C15.8285 10.5534 15.6127 10.8441 15.2974 10.9404C14.973 11.0393 14.7187 11.2942 14.6196 11.6201C14.5236 11.936 14.232 12.1513 13.9019 12.1514C13.5717 12.1514 13.2801 11.936 13.1841 11.6201C13.0851 11.2943 12.8307 11.0393 12.5063 10.9404C12.1909 10.8442 11.9752 10.5534 11.9751 10.2236C11.9751 9.89369 12.1908 9.60208 12.5063 9.50586C12.8305 9.40708 13.085 9.15282 13.1841 8.82715C13.2801 8.5112 13.5716 8.29492 13.9019 8.29492Z",fill:"#14151A"})),SvgInfoNotReadable=Be=>React__namespace.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.51987 5.07032C4.36282 4.16615 5.5605 3.66406 6.96486 3.66406H17.0351C18.4424 3.66406 19.6405 4.16586 20.483 5.07066C21.3199 5.96941 21.75 7.20487 21.75 8.58033V11.5041C21.75 11.9183 21.4142 12.2541 21 12.2541C20.5858 12.2541 20.25 11.9183 20.25 11.5041V8.58033C20.25 7.5146 19.9198 6.66693 19.3852 6.09284C18.8563 5.52481 18.0719 5.16406 17.0351 5.16406H6.96486C5.93193 5.16406 5.14718 5.52452 4.61702 6.09318C4.08142 6.66769 3.75 7.51548 3.75 8.58033V15.1683C3.75 16.2346 4.08027 17.0822 4.61474 17.6561C5.1436 18.224 5.92794 18.5846 6.96486 18.5846H11.1224C11.5366 18.5846 11.8724 18.9204 11.8724 19.3346C11.8724 19.7488 11.5366 20.0846 11.1224 20.0846H6.96486C5.55768 20.0846 4.35959 19.5831 3.51704 18.6784C2.68011 17.7797 2.25 16.5442 2.25 15.1683V8.58033C2.25 7.20399 2.68237 5.96865 3.51987 5.07032Z",fill:"#14151A"}),React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.25 9.71191C2.25 9.2977 2.58579 8.96191 3 8.96191H21C21.4142 8.96191 21.75 9.2977 21.75 9.71191C21.75 10.1261 21.4142 10.4619 21 10.4619H3C2.58579 10.4619 2.25 10.1261 2.25 9.71191Z",fill:"#14151A"}),React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.4359 14.3971C17.5875 13.5487 16.2128 13.5487 15.3644 14.3971C14.516 15.2455 14.516 16.6202 15.3644 17.4686C16.2128 18.317 17.5875 18.317 18.4359 17.4686C19.2843 16.6202 19.2843 15.2455 18.4359 14.3971ZM14.3037 13.3364C15.7379 11.9022 18.0624 11.9022 19.4966 13.3364C20.9308 14.7706 20.9308 17.0951 19.4966 18.5293C18.0624 19.9635 15.7379 19.9635 14.3037 18.5293C12.8695 17.0951 12.8695 14.7706 14.3037 13.3364Z",fill:"#14151A"}),React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.436 17.4707C18.7289 17.1778 19.2038 17.1778 19.4967 17.4707L21.0797 19.0538C21.3726 19.3467 21.3726 19.8215 21.0797 20.1144C20.7868 20.4073 20.3119 20.4073 20.019 20.1144L18.436 18.5314C18.1431 18.2385 18.1431 17.7636 18.436 17.4707Z",fill:"#14151A"})),SvgQuestionIcon=Be=>React__namespace.createElement("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("circle",{cx:32,cy:32,r:32,fill:"#14151A"}),React__namespace.createElement("path",{d:"M32 41C33.1045 41 34 41.8955 34 43C34 44.1045 33.1045 45 32 45C30.8954 45 30 44.1045 30 43C30 41.8954 30.8954 41 32 41ZM32 18.5C36.6906 18.5001 40.1669 22.0578 40.167 26.5605C40.167 28.8363 39.239 30.7175 37.7119 32.0381C36.5502 33.0426 35.086 33.6855 33.5 33.9863V38H30.5V31.2568L31.9072 31.1699C33.5141 31.0696 34.8469 30.5494 35.75 29.7686C36.6245 29.0121 37.167 27.9561 37.167 26.5605C37.1669 23.7203 35.0394 21.5001 32 21.5C28.9065 21.5001 26.7253 23.7825 26.1406 26.8418L23.1934 26.2793C23.9755 22.1855 27.1118 18.5001 32 18.5Z",fill:"white"})),CommonIssues=({onClose:Be,switchToManualCapture:Le,onCloseCancel:Ye})=>{const{t:tt}=useTranslation$1(),nt=useTokens(),ft=At=>{At.preventDefault(),Be()},ht=()=>{Be()},gt=()=>{Le(),Be()};return jsxRuntimeExports.jsx(Modal$3,{open:!0,onClose:Be,children:jsxRuntimeExports.jsx(Page$1,{hideHeaderBranding:!0,hideFooterBranding:!0,closeButton:{onCancel:Ye},maxW:"468px",children:jsxRuntimeExports.jsxs(Flex,{direction:"column",py:nt.spacing[6],align:"center",hFull:!0,wFull:!0,children:[jsxRuntimeExports.jsx(SvgQuestionIcon,{}),jsxRuntimeExports.jsx(Spacer,{size:nt.spacing[3]}),jsxRuntimeExports.jsx(Title$o,{children:tt("commonIssues.commonIssues")}),jsxRuntimeExports.jsx(Spacer,{size:nt.spacing[6]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:nt.spacing[8],py:nt.spacing[4],wFull:!0,children:[jsxRuntimeExports.jsx(Card,{image:jsxRuntimeExports.jsx(SvgGlareIcon,{}),title:tt("commonIssues.glarePresent"),body:tt("commonIssues.glarePresentDescription")}),jsxRuntimeExports.jsx(Card,{image:jsxRuntimeExports.jsx(SvgBlurIcon,{}),title:tt("commonIssues.blurPresent"),body:tt("commonIssues.blurPresentDescription")}),jsxRuntimeExports.jsx(Card,{image:jsxRuntimeExports.jsx(SvgInfoNotReadable,{}),title:tt("commonIssues.notReadable"),body:tt("commonIssues.notReadableDescription")})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",mt:"auto",wFull:!0,children:[jsxRuntimeExports.jsx(Button$b,{variant:"link",fontWeight:500,color:nt.color.text.body.primary,fontSize:nt.primitives.typography.fontSize.lg,h:nt.spacing[8],onClick:gt,children:tt("commonIssues.takeManually")}),jsxRuntimeExports.jsx(Spacer,{size:nt.spacing[3]}),jsxRuntimeExports.jsx(Button$b,{onClick:ht,onTouchEnd:ft,children:tt("commonIssues.tryAgain")})]})]})})})},SvgCommonIssuesIcon=Be=>React__namespace.createElement("svg",{width:30,height:30,viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 0C6.7279 0 0 6.72947 0 15C0 23.2705 6.7279 30 15 30C23.2705 30 30 23.2705 30 15C30 6.72947 23.2705 0 15 0Z",fill:"white"}),React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.3532 16.0616L17.1305 16.1863C16.1074 16.7579 15.7458 17.0516 15.7537 17.5537C15.7616 18.2074 15.2389 18.7442 14.5853 18.7537H14.5695C13.9221 18.7537 13.3932 18.2342 13.3853 17.5853C13.3584 15.5832 14.9958 14.6674 15.9732 14.1211L16.1958 13.9947C17.0942 13.5005 17.5426 12.8153 17.5426 11.9532C17.5426 10.5274 16.3821 9.36842 14.9563 9.36842C13.5053 9.36842 12.3684 10.5037 12.3684 11.9532C12.3684 12.6068 11.8379 13.1374 11.1842 13.1374C10.5305 13.1374 10 12.6068 10 11.9532C10 9.22158 12.2232 7 14.9563 7C17.6879 7 19.9111 9.22158 19.9111 11.9532C19.9111 13.6947 19.0016 15.1537 17.3532 16.0616ZM14.5711 22.6379C13.9174 22.6379 13.3868 22.1311 13.3868 21.4774V21.43C13.3868 20.7763 13.9174 20.2458 14.5711 20.2458C15.2247 20.2458 15.7553 20.7763 15.7553 21.43C15.7553 22.0837 15.2247 22.6379 14.5711 22.6379Z",fill:"black"})),IconContainer$2=dt.div`
|
|
5713
|
+
`,ManualCaptureButton=Be=>{const{t:Le}=useTranslation$1();return jsxRuntimeExports.jsxs(AnimatedWrapper,{children:[jsxRuntimeExports.jsx(CaptureTooltip,{}),jsxRuntimeExports.jsx(Button$b,{variant:"link",type:"button","aria-label":Le("idv2.capture.manualCapture.ariaLabel"),hFull:!0,wFull:!0,p:0,...Be,children:jsxRuntimeExports.jsx(StyledSVGWrapper,{children:jsxRuntimeExports.jsx(SvgManualCaptureButton,{title:Le("idv2.capture.manualCapture.title")})})})]})},SvgBlurIcon=Be=>React__namespace.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{d:"M12.2597 4.15625C14.3285 4.1835 16.3243 4.916 17.9199 6.23242C18.2394 6.49605 18.2851 6.96957 18.0214 7.28906C17.7578 7.60828 17.2852 7.65315 16.9658 7.38965C15.6357 6.29217 13.9729 5.68098 12.249 5.65625C10.5346 5.67942 8.878 6.28369 7.5527 7.37207C6.03992 8.62375 4.84504 10.2126 4.06246 12.0107C4.83423 13.8004 6.01967 15.3822 7.52242 16.626C7.84151 16.8901 7.88613 17.3635 7.62203 17.6826C7.35793 18.0017 6.88449 18.0463 6.56539 17.7822C4.79235 16.3147 3.41234 14.427 2.5527 12.29C2.48019 12.1096 2.48144 11.9077 2.55465 11.7275C3.42639 9.58276 4.81515 7.68881 6.5986 6.21387L6.60055 6.21289C8.19264 4.90541 10.1832 4.18132 12.2412 4.15625H12.2597Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M19.3963 3.80561C19.6892 3.51272 20.165 3.51271 20.4579 3.80561C20.7504 4.09843 20.7504 4.57333 20.4579 4.86615L5.10728 20.2158C4.81438 20.5087 4.33962 20.5087 4.04673 20.2158C3.75401 19.9229 3.7539 19.4481 4.04673 19.1552L19.3963 3.80561Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M12.4287 8.18359C13.377 8.22855 14.2762 8.62583 14.9502 9.2998C15.2429 9.59271 15.243 10.0675 14.9502 10.3604C14.6574 10.653 14.1825 10.653 13.8897 10.3604C13.4528 9.92345 12.8603 9.6783 12.2422 9.67969H12.2412C10.9575 9.68196 9.91866 10.725 9.92092 12.0088V12.0127C9.91873 12.6266 10.1629 13.2142 10.5987 13.6455C10.893 13.9369 10.8949 14.4117 10.6035 14.7061C10.3122 15.0003 9.83736 15.0032 9.54299 14.7119C8.82092 13.9973 8.41718 13.0228 8.42092 12.0068C8.41946 9.89669 10.1276 8.18357 12.2383 8.17969L12.4287 8.18359Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M19.0536 8.34264C19.3864 8.09617 19.8559 8.16611 20.1024 8.49889C20.8393 9.49403 21.4571 10.5723 21.9413 11.7128C22.0214 11.9015 22.0206 12.1153 21.9393 12.3036C19.9504 16.911 16.3507 19.8602 12.2499 19.8602C11.3317 19.8602 10.421 19.7108 9.55163 19.4217C9.15858 19.2911 8.94538 18.8665 9.07605 18.4735C9.20672 18.0805 9.63127 17.8683 10.0243 17.9989C10.7428 18.2378 11.4942 18.3602 12.2499 18.3602C15.4814 18.3602 18.5736 16.0795 20.4296 12.0047C20.0129 11.0822 19.5004 10.2058 18.8973 9.39147C18.6509 9.05863 18.7208 8.58917 19.0536 8.34264Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M14.5349 12.4195C14.6094 12.0122 14.9996 11.7418 15.407 11.816C15.8145 11.8902 16.0848 12.2815 16.0105 12.689C15.7256 14.2521 14.5032 15.4787 12.9392 15.7662C12.5318 15.841 12.1411 15.571 12.0662 15.1636C11.9914 14.7563 12.2605 14.3655 12.6677 14.2906C13.6177 14.116 14.3617 13.3702 14.5349 12.4195Z",fill:"#14151A"})),SvgGlareIcon=Be=>React__namespace.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{d:"M2.25 15.1279V9.51172C2.25 7.88342 2.76123 6.43316 3.74023 5.38281C4.72472 4.32662 6.12676 3.73535 7.78223 3.73535H13.2705L13.3477 3.73926C13.7258 3.7777 14.0205 4.09705 14.0205 4.48535C14.0205 4.87365 13.7258 5.193 13.3477 5.23145L13.2705 5.23535H7.78223C6.49854 5.23535 5.50964 5.68477 4.83789 6.40527C4.16068 7.13181 3.75 8.19485 3.75 9.51172V15.1279C3.75003 16.4457 4.1591 17.5083 4.83496 18.2344C5.5052 18.9542 6.49361 19.4043 7.78223 19.4043H16.2158C17.5051 19.4043 18.4945 18.9544 19.165 18.2344C19.8412 17.5083 20.25 16.4456 20.25 15.1279V12.458C20.25 12.0438 20.5858 11.708 21 11.708C21.4142 11.708 21.75 12.0438 21.75 12.458V15.1279C21.75 16.7554 21.2412 18.2061 20.2627 19.2568C19.2785 20.3135 17.8755 20.9043 16.2158 20.9043H7.78223C6.12294 20.9043 4.72013 20.3136 3.73633 19.2568C2.7582 18.2061 2.25003 16.7553 2.25 15.1279Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M14.2705 14.4121C14.6846 14.4123 15.0205 14.748 15.0205 15.1621C15.0205 15.5762 14.6846 15.912 14.2705 15.9121H7.04102C6.62682 15.9121 6.29105 15.5763 6.29102 15.1621C6.29102 14.7479 6.6268 14.4121 7.04102 14.4121H14.2705ZM8.96094 10.6523C9.37494 10.6526 9.71094 10.9883 9.71094 11.4023C9.71094 11.8164 9.37494 12.1521 8.96094 12.1523H7.04102C6.6268 12.1523 6.29102 11.8166 6.29102 11.4023C6.29102 10.9881 6.6268 10.6523 7.04102 10.6523H8.96094Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M18.4043 3.0957C18.7183 3.0957 18.9986 3.29142 19.1074 3.58594L19.209 3.85938C19.5141 4.68491 20.1638 5.33534 20.9873 5.64062L21.2607 5.74219C21.5548 5.85125 21.75 6.13168 21.75 6.44531C21.75 6.75893 21.5548 7.03941 21.2607 7.14844L20.9873 7.25C20.215 7.5363 19.5953 8.1258 19.2695 8.87891L19.209 9.03125L19.1074 9.30469C18.9986 9.59909 18.7182 9.79492 18.4043 9.79492C18.0904 9.79492 17.81 9.59909 17.7012 9.30469L17.5996 9.03125C17.2945 8.20566 16.6448 7.55532 15.8213 7.25L15.5479 7.14844C15.2538 7.03941 15.0586 6.75893 15.0586 6.44531C15.0586 6.13168 15.2538 5.85125 15.5479 5.74219L15.8213 5.64062C16.6448 5.33534 17.2945 4.68491 17.5996 3.85938L17.7012 3.58594L17.749 3.48047C17.8799 3.24552 18.1294 3.0957 18.4043 3.0957ZM18.4043 5.49414C18.1366 5.85711 17.8158 6.17742 17.4531 6.44531C17.8156 6.71307 18.1367 7.03278 18.4043 7.39551C18.6718 7.03299 18.9922 6.71298 19.3545 6.44531C18.992 6.17751 18.6719 5.8569 18.4043 5.49414Z",fill:"#14151A"}),React__namespace.createElement("path",{d:"M13.9019 8.29492C14.232 8.29495 14.5236 8.51122 14.6196 8.82715C14.7187 9.15288 14.9733 9.4071 15.2974 9.50586C15.6128 9.60214 15.8286 9.89376 15.8286 10.2236C15.8285 10.5534 15.6127 10.8441 15.2974 10.9404C14.973 11.0393 14.7187 11.2942 14.6196 11.6201C14.5236 11.936 14.232 12.1513 13.9019 12.1514C13.5717 12.1514 13.2801 11.936 13.1841 11.6201C13.0851 11.2943 12.8307 11.0393 12.5063 10.9404C12.1909 10.8442 11.9752 10.5534 11.9751 10.2236C11.9751 9.89369 12.1908 9.60208 12.5063 9.50586C12.8305 9.40708 13.085 9.15282 13.1841 8.82715C13.2801 8.5112 13.5716 8.29492 13.9019 8.29492Z",fill:"#14151A"})),SvgInfoNotReadable=Be=>React__namespace.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.51987 5.07032C4.36282 4.16615 5.5605 3.66406 6.96486 3.66406H17.0351C18.4424 3.66406 19.6405 4.16586 20.483 5.07066C21.3199 5.96941 21.75 7.20487 21.75 8.58033V11.5041C21.75 11.9183 21.4142 12.2541 21 12.2541C20.5858 12.2541 20.25 11.9183 20.25 11.5041V8.58033C20.25 7.5146 19.9198 6.66693 19.3852 6.09284C18.8563 5.52481 18.0719 5.16406 17.0351 5.16406H6.96486C5.93193 5.16406 5.14718 5.52452 4.61702 6.09318C4.08142 6.66769 3.75 7.51548 3.75 8.58033V15.1683C3.75 16.2346 4.08027 17.0822 4.61474 17.6561C5.1436 18.224 5.92794 18.5846 6.96486 18.5846H11.1224C11.5366 18.5846 11.8724 18.9204 11.8724 19.3346C11.8724 19.7488 11.5366 20.0846 11.1224 20.0846H6.96486C5.55768 20.0846 4.35959 19.5831 3.51704 18.6784C2.68011 17.7797 2.25 16.5442 2.25 15.1683V8.58033C2.25 7.20399 2.68237 5.96865 3.51987 5.07032Z",fill:"#14151A"}),React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.25 9.71191C2.25 9.2977 2.58579 8.96191 3 8.96191H21C21.4142 8.96191 21.75 9.2977 21.75 9.71191C21.75 10.1261 21.4142 10.4619 21 10.4619H3C2.58579 10.4619 2.25 10.1261 2.25 9.71191Z",fill:"#14151A"}),React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.4359 14.3971C17.5875 13.5487 16.2128 13.5487 15.3644 14.3971C14.516 15.2455 14.516 16.6202 15.3644 17.4686C16.2128 18.317 17.5875 18.317 18.4359 17.4686C19.2843 16.6202 19.2843 15.2455 18.4359 14.3971ZM14.3037 13.3364C15.7379 11.9022 18.0624 11.9022 19.4966 13.3364C20.9308 14.7706 20.9308 17.0951 19.4966 18.5293C18.0624 19.9635 15.7379 19.9635 14.3037 18.5293C12.8695 17.0951 12.8695 14.7706 14.3037 13.3364Z",fill:"#14151A"}),React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.436 17.4707C18.7289 17.1778 19.2038 17.1778 19.4967 17.4707L21.0797 19.0538C21.3726 19.3467 21.3726 19.8215 21.0797 20.1144C20.7868 20.4073 20.3119 20.4073 20.019 20.1144L18.436 18.5314C18.1431 18.2385 18.1431 17.7636 18.436 17.4707Z",fill:"#14151A"})),SvgQuestionIcon=Be=>React__namespace.createElement("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("circle",{cx:32,cy:32,r:32,fill:"#14151A"}),React__namespace.createElement("path",{d:"M32 41C33.1045 41 34 41.8955 34 43C34 44.1045 33.1045 45 32 45C30.8954 45 30 44.1045 30 43C30 41.8954 30.8954 41 32 41ZM32 18.5C36.6906 18.5001 40.1669 22.0578 40.167 26.5605C40.167 28.8363 39.239 30.7175 37.7119 32.0381C36.5502 33.0426 35.086 33.6855 33.5 33.9863V38H30.5V31.2568L31.9072 31.1699C33.5141 31.0696 34.8469 30.5494 35.75 29.7686C36.6245 29.0121 37.167 27.9561 37.167 26.5605C37.1669 23.7203 35.0394 21.5001 32 21.5C28.9065 21.5001 26.7253 23.7825 26.1406 26.8418L23.1934 26.2793C23.9755 22.1855 27.1118 18.5001 32 18.5Z",fill:"white"})),CommonIssues=({onClose:Be,switchToManualCapture:Le,onCloseCancel:Ye})=>{const{t:tt}=useTranslation$1(),nt=useTokens(),ft=At=>{At.preventDefault(),Be()},ht=()=>{Be()},gt=()=>{Le(),Be()};return jsxRuntimeExports.jsx(Modal$3,{open:!0,onClose:Be,children:jsxRuntimeExports.jsx(Page$1,{hideHeaderBranding:!0,hideFooterBranding:!0,closeButton:{onCancel:Ye},maxW:"468px",children:jsxRuntimeExports.jsxs(Flex,{direction:"column",py:nt.spacing[6],align:"center",hFull:!0,wFull:!0,children:[jsxRuntimeExports.jsx(SvgQuestionIcon,{}),jsxRuntimeExports.jsx(Spacer,{size:nt.spacing[3]}),jsxRuntimeExports.jsx(Title$o,{children:tt("commonIssues.commonIssues")}),jsxRuntimeExports.jsx(Spacer,{size:nt.spacing[6]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:nt.spacing[8],py:nt.spacing[4],wFull:!0,children:[jsxRuntimeExports.jsx(Card,{image:jsxRuntimeExports.jsx(SvgGlareIcon,{}),title:tt("commonIssues.glarePresent"),body:tt("commonIssues.glarePresentDescription")}),jsxRuntimeExports.jsx(Card,{image:jsxRuntimeExports.jsx(SvgBlurIcon,{}),title:tt("commonIssues.blurPresent"),body:tt("commonIssues.blurPresentDescription")}),jsxRuntimeExports.jsx(Card,{image:jsxRuntimeExports.jsx(SvgInfoNotReadable,{}),title:tt("commonIssues.notReadable"),body:tt("commonIssues.notReadableDescription")})]}),jsxRuntimeExports.jsxs(Flex,{direction:"column",mt:"auto",wFull:!0,children:[jsxRuntimeExports.jsx(Button$b,{variant:"link",fontWeight:500,color:nt.color.text.body.primary,fontSize:nt.primitives.typography.fontSize.lg,h:nt.spacing[8],onClick:gt,children:tt("commonIssues.takeManually")}),jsxRuntimeExports.jsx(Spacer,{size:nt.spacing[3]}),jsxRuntimeExports.jsx(Button$b,{onClick:ht,onTouchEnd:ft,children:tt("commonIssues.tryAgain")})]})]})})})},SvgCommonIssuesIcon=Be=>React__namespace.createElement("svg",{width:30,height:30,viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...Be},React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 0C6.7279 0 0 6.72947 0 15C0 23.2705 6.7279 30 15 30C23.2705 30 30 23.2705 30 15C30 6.72947 23.2705 0 15 0Z",fill:"white"}),React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.3532 16.0616L17.1305 16.1863C16.1074 16.7579 15.7458 17.0516 15.7537 17.5537C15.7616 18.2074 15.2389 18.7442 14.5853 18.7537H14.5695C13.9221 18.7537 13.3932 18.2342 13.3853 17.5853C13.3584 15.5832 14.9958 14.6674 15.9732 14.1211L16.1958 13.9947C17.0942 13.5005 17.5426 12.8153 17.5426 11.9532C17.5426 10.5274 16.3821 9.36842 14.9563 9.36842C13.5053 9.36842 12.3684 10.5037 12.3684 11.9532C12.3684 12.6068 11.8379 13.1374 11.1842 13.1374C10.5305 13.1374 10 12.6068 10 11.9532C10 9.22158 12.2232 7 14.9563 7C17.6879 7 19.9111 9.22158 19.9111 11.9532C19.9111 13.6947 19.0016 15.1537 17.3532 16.0616ZM14.5711 22.6379C13.9174 22.6379 13.3868 22.1311 13.3868 21.4774V21.43C13.3868 20.7763 13.9174 20.2458 14.5711 20.2458C15.2247 20.2458 15.7553 20.7763 15.7553 21.43C15.7553 22.0837 15.2247 22.6379 14.5711 22.6379Z",fill:"black"})),IconContainer$2=dt.div`
|
|
5715
5714
|
position: absolute;
|
|
5716
5715
|
bottom: 14px;
|
|
5717
5716
|
right: 22px;
|
package/package.json
CHANGED