truescene-face-id-capture-sdk 1.0.0 → 1.0.1

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/index.js CHANGED
@@ -24849,7 +24849,7 @@ const estimatePoseFromLandmarks = (zc, Wc) => {
24849
24849
  minFaceHeightRatio: .18,
24850
24850
  minFaceAreaRatio: .03,
24851
24851
  meanLum: {
24852
- min: 70,
24852
+ min: 10,
24853
24853
  max: 190
24854
24854
  },
24855
24855
  blurScoreMin: 90
@@ -25490,378 +25490,264 @@ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((zc) =
25490
25490
  })
25491
25491
  ]
25492
25492
  });
25493
- }, stripDataUrl = (zc) => {
25493
+ };
25494
+ const REGION_URLS = {
25495
+ eu: "https://eu.api.truescene.ai",
25496
+ us: "https://us.api.truescene.ai",
25497
+ sandbox: "http://13.60.232.144:3031"
25498
+ };
25499
+ var stripDataUrl = (zc) => {
25494
25500
  if (!zc) return null;
25495
25501
  let Wc = zc.indexOf(",");
25496
25502
  return Wc >= 0 ? zc.slice(Wc + 1) : zc;
25497
- }, formatNumber = (zc, Wc) => typeof zc != "number" || Number.isNaN(zc) ? "--" : zc.toFixed(Wc), CaptureExperience_default = ({ sessionToken: zc, compareUrl: Wc = "/comparev2", tokenHeader: Kc = "Authorization", tokenPrefix: qc = "Bearer", tokenField: Jc = "session_token", autoStart: Yc = !1, initialShowDebug: Zc = !1, showDebugToggle: Qc = !1, className: $c, onReadyChange: el, onStepChange: tl, onMetricsChange: nl, onCapture: rl, onCompareResult: al, onCompareError: ol, onError: sl }) => {
25498
- let [cl, ll] = (0, import_react.useState)({
25503
+ }, CaptureExperience_default = ({ sessionToken: zc, region: Wc, autoStart: Kc = !1, compareTimeoutMs: qc = 1e6, className: Jc, showHeader: Yc = !0, showInstructions: Zc = !0, showStatus: Qc = !0, headerEyebrow: $c = "TrueScene Capture", headerTitle: el = "Fast & Deepfake Resistant", headerSubtitle: tl = "ID Verification", instructions: nl = "Press Start Verification. Align your face in the oval, then place your ID under your nose so it covers your mouth. Keep your eyes visible.", onReadyChange: rl, onStepChange: al, onMetricsChange: ol, onCapture: sl, onVerificationCode: cl, onVerificationError: ll, onError: ul }) => {
25504
+ let [dl, fl] = (0, import_react.useState)({
25499
25505
  faceReady: !1,
25500
25506
  idReady: !1
25501
- }), [ul, dl] = (0, import_react.useState)("FACE_ALIGN"), [fl, pl] = (0, import_react.useState)(null), [ml, hl] = (0, import_react.useState)(Zc), [gl, _l] = (0, import_react.useState)(!1), [vl, yl] = (0, import_react.useState)({
25507
+ }), [pl, ml] = (0, import_react.useState)("FACE_ALIGN"), [hl, gl] = (0, import_react.useState)(!1), [_l, vl] = (0, import_react.useState)({
25502
25508
  faceImage: null,
25503
25509
  idImage: null,
25504
25510
  fullImage: null
25505
- }), [bl, xl] = (0, import_react.useState)(null), [Sl, Cl] = (0, import_react.useState)(null), [wl, Tl] = (0, import_react.useState)(!1), El = (0, import_react.useRef)(null), Dl = zc?.trim() ?? "", Ol = Dl.length === 0;
25511
+ }), yl = (0, import_react.useRef)(cl), bl = (0, import_react.useRef)(ll), xl = (0, import_react.useRef)(ul), Sl = (0, import_react.useRef)(null), Cl = zc?.trim() ?? "", wl = Cl.length === 0, Tl = Wc ? `${REGION_URLS[Wc]}/comparev2` : "";
25506
25512
  (0, import_react.useEffect)(() => {
25507
- !Yc || gl || Ol || _l(!0);
25513
+ !Kc || hl || wl || gl(!0);
25508
25514
  }, [
25509
- Yc,
25510
- gl,
25511
- Ol
25515
+ Kc,
25516
+ hl,
25517
+ wl
25512
25518
  ]), (0, import_react.useEffect)(() => {
25513
- if (!vl.faceImage || !vl.idImage) return;
25514
- if (Ol) {
25515
- let zc = "Session token is required to compare results.";
25516
- Cl(zc), xl(null), Tl(!1), ol?.(zc), sl?.(zc);
25519
+ yl.current = cl, bl.current = ll, xl.current = ul;
25520
+ }, [
25521
+ cl,
25522
+ ll,
25523
+ ul
25524
+ ]);
25525
+ let El = (zc) => {
25526
+ bl.current?.(zc), xl.current?.(zc.message);
25527
+ };
25528
+ (0, import_react.useEffect)(() => {
25529
+ if (!_l.faceImage || !_l.idImage) return;
25530
+ if (wl) {
25531
+ El({
25532
+ code: "MISSING_TOKEN",
25533
+ message: "Session token is required to submit verification."
25534
+ });
25535
+ return;
25536
+ }
25537
+ if (!Wc) {
25538
+ El({
25539
+ code: "MISSING_REGION",
25540
+ message: "Region is required to submit verification."
25541
+ });
25517
25542
  return;
25518
25543
  }
25519
- let zc = El.current;
25520
- if (zc && zc.faceImage === vl.faceImage && zc.idImage === vl.idImage && zc.sessionToken === Dl) return;
25521
- let Yc = stripDataUrl(vl.faceImage), Zc = stripDataUrl(vl.idImage);
25522
- if (!Yc || !Zc) return;
25523
- El.current = {
25524
- faceImage: vl.faceImage,
25525
- idImage: vl.idImage,
25526
- sessionToken: Dl
25544
+ let zc = Sl.current;
25545
+ if (zc && zc.faceImage === _l.faceImage && zc.idImage === _l.idImage && zc.sessionToken === Cl) return;
25546
+ let Kc = stripDataUrl(_l.faceImage), Jc = stripDataUrl(_l.idImage);
25547
+ if (!Kc || !Jc) return;
25548
+ Sl.current = {
25549
+ faceImage: _l.faceImage,
25550
+ idImage: _l.idImage,
25551
+ sessionToken: Cl
25527
25552
  };
25528
- let Qc = !0;
25529
- Tl(!0), Cl(null), xl(null), al?.(null);
25530
- let $c = { "Content-Type": "application/json" };
25531
- Kc && ($c[Kc] = qc ? `${qc} ${Dl}` : Dl);
25532
- let el = {
25533
- image_face: Yc,
25534
- image_idcard: Zc
25553
+ let Yc = !0;
25554
+ bl.current?.(null), yl.current?.(null);
25555
+ let Zc = new AbortController(), Qc = !1, $c = qc > 0 ? window.setTimeout(() => {
25556
+ Qc = !0, Zc.abort();
25557
+ }, qc) : null, el = { "Content-Type": "application/json" };
25558
+ el.Authorization = `Bearer ${Cl}`;
25559
+ let tl = {
25560
+ image_face: Kc,
25561
+ image_idcard: Jc,
25562
+ session_token: Cl
25535
25563
  };
25536
- return Jc && (el[Jc] = Dl), fetch(Wc, {
25564
+ return fetch(Tl, {
25537
25565
  method: "POST",
25538
- headers: $c,
25539
- body: JSON.stringify(el)
25540
- }).then(async (zc) => {
25541
- if (!zc.ok) throw Error(`Server error (${zc.status})`);
25542
- return zc.json();
25543
- }).then((zc) => {
25544
- if (Qc) {
25545
- if (typeof zc?.error == "string" && zc.error.trim().length > 0) {
25546
- Cl(zc.error), xl(null), ol?.(zc.error), sl?.(zc.error);
25566
+ headers: el,
25567
+ body: JSON.stringify(tl),
25568
+ signal: Zc.signal
25569
+ }).then(async (zc) => zc.ok ? zc.json() : (El({
25570
+ code: "HTTP_ERROR",
25571
+ message: `Server error (${zc.status})`,
25572
+ status: zc.status
25573
+ }), null)).then((zc) => {
25574
+ if (!Yc || !zc) return;
25575
+ if (typeof zc?.error == "string" && zc.error.trim().length > 0) {
25576
+ El({
25577
+ code: "INVALID_RESPONSE",
25578
+ message: zc.error
25579
+ });
25580
+ return;
25581
+ }
25582
+ if (typeof zc?.verification_code != "string" || zc.verification_code.trim().length === 0) {
25583
+ El({
25584
+ code: "INVALID_RESPONSE",
25585
+ message: "Verification code missing in response."
25586
+ });
25587
+ return;
25588
+ }
25589
+ let Wc = {
25590
+ verification_code: zc.verification_code,
25591
+ expires_at: typeof zc?.expires_at == "string" ? zc.expires_at : ""
25592
+ };
25593
+ yl.current?.(Wc);
25594
+ }).catch((zc) => {
25595
+ if (Yc) {
25596
+ if (zc instanceof DOMException && zc.name === "AbortError") {
25597
+ Qc && El({
25598
+ code: "REQUEST_TIMEOUT",
25599
+ message: "Verification request timed out."
25600
+ });
25547
25601
  return;
25548
25602
  }
25549
- xl(zc), al?.(zc);
25603
+ El({
25604
+ code: "NETWORK_ERROR",
25605
+ message: zc instanceof Error ? zc.message : "Verification request failed"
25606
+ });
25550
25607
  }
25551
- }).catch((zc) => {
25552
- if (!Qc) return;
25553
- let Wc = zc instanceof Error ? zc.message : "Compare failed";
25554
- Cl(Wc), ol?.(Wc), sl?.(Wc);
25555
25608
  }).finally(() => {
25556
- Qc && Tl(!1);
25609
+ $c && window.clearTimeout($c);
25557
25610
  }), () => {
25558
- Qc = !1;
25611
+ Yc = !1, $c && window.clearTimeout($c), Zc.abort();
25559
25612
  };
25560
25613
  }, [
25561
- vl.faceImage,
25562
- vl.idImage,
25563
- Wc,
25564
- Jc,
25565
- Kc,
25566
- Ol,
25614
+ _l.faceImage,
25615
+ _l.idImage,
25567
25616
  qc,
25568
- Dl,
25569
- ol,
25570
- al,
25571
- sl
25617
+ Tl,
25618
+ wl,
25619
+ Cl
25572
25620
  ]);
25573
- let kl = cl.idReady ? "Ready to continue" : "Not ready", Al = cl.idReady ? "status-pill status-pill--ready" : "status-pill status-pill--not", jl = ul === "FACE_ALIGN" ? "Step 1 of 2: Face align" : "Step 2 of 2: ID align", Ml = (0, import_react.useMemo)(() => fl ? [
25574
- {
25575
- label: "Step",
25576
- value: fl.step
25577
- },
25578
- {
25579
- label: "Face ready",
25580
- value: fl.ready.faceReady ? "Yes" : "No"
25581
- },
25582
- {
25583
- label: "ID ready",
25584
- value: fl.ready.idReady ? "Yes" : "No"
25585
- },
25586
- {
25587
- label: "Face count",
25588
- value: `${fl.face.faceCount}`
25589
- },
25590
- {
25591
- label: "Face box",
25592
- value: fl.face.faceBoxNorm ? `${fl.face.faceBoxNorm.x.toFixed(2)}, ${fl.face.faceBoxNorm.y.toFixed(2)}, ${fl.face.faceBoxNorm.w.toFixed(2)}, ${fl.face.faceBoxNorm.h.toFixed(2)}` : "--"
25593
- },
25594
- {
25595
- label: "Face yaw",
25596
- value: fl.face.poseValid ? `${fl.face.yawDeg.toFixed(1)} deg` : "--"
25597
- },
25598
- {
25599
- label: "Face pitch",
25600
- value: fl.face.poseValid ? `${fl.face.pitchDeg.toFixed(1)} deg` : "--"
25601
- },
25602
- {
25603
- label: "Face roll",
25604
- value: fl.face.poseValid ? `${fl.face.rollDeg.toFixed(1)} deg` : "--"
25605
- },
25606
- {
25607
- label: "ID rect",
25608
- value: fl.id.rectNorm ? `${fl.id.rectNorm.x.toFixed(2)}, ${fl.id.rectNorm.y.toFixed(2)}, ${fl.id.rectNorm.w.toFixed(2)}, ${fl.id.rectNorm.h.toFixed(2)}` : "--"
25609
- },
25610
- {
25611
- label: "ID ROI face count",
25612
- value: `${fl.id.roiFaceCount}`
25613
- },
25614
- {
25615
- label: "ID ROI face box",
25616
- value: fl.id.roiLargestFaceBoxNorm ? `${fl.id.roiLargestFaceBoxNorm.x.toFixed(2)}, ${fl.id.roiLargestFaceBoxNorm.y.toFixed(2)}, ${fl.id.roiLargestFaceBoxNorm.w.toFixed(2)}, ${fl.id.roiLargestFaceBoxNorm.h.toFixed(2)}` : "--"
25617
- },
25618
- {
25619
- label: "ID ROI face size",
25620
- value: fl.id.roiLargestFaceSizeRatio.toFixed(3)
25621
- },
25622
- {
25623
- label: "ID ROI mean lum",
25624
- value: fl.id.meanLumROI.toFixed(0)
25625
- },
25626
- {
25627
- label: "ID ROI blur",
25628
- value: fl.id.blurScoreROI.toFixed(0)
25629
- },
25630
- {
25631
- label: "Hint",
25632
- value: fl.hint
25633
- }
25634
- ] : [], [fl]);
25621
+ let Dl = dl.idReady ? "Ready to continue" : "Not ready", Ol = dl.idReady ? "status-pill status-pill--ready" : "status-pill status-pill--not", kl = pl === "FACE_ALIGN" ? "Step 1 of 2: Face align" : "Step 2 of 2: ID align", Al = Yc || Qc && hl, jl = Yc ? "app__header" : "app__header app__header--status-only";
25635
25622
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25636
- className: `ts-capture${$c ? ` ${$c}` : ""}`,
25637
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
25638
- className: "app__header",
25639
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
25640
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
25623
+ className: `ts-capture${Jc ? ` ${Jc}` : ""}`,
25624
+ children: [Al && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
25625
+ className: jl,
25626
+ children: [Yc && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
25627
+ $c && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
25641
25628
  className: "app__eyebrow",
25642
- children: "TrueScene Capture"
25629
+ children: $c
25643
25630
  }),
25644
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", {
25631
+ (el || tl) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [el && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", {
25645
25632
  className: "app__title",
25646
- children: "Fast & Deepfake Resistant"
25647
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", {
25633
+ children: el
25634
+ }), tl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", {
25648
25635
  className: "app__title",
25649
- children: "ID Verification"
25636
+ children: tl
25650
25637
  })] }),
25651
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
25638
+ Zc && nl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
25652
25639
  className: "app__subtitle",
25653
- children: "Press Start Verification. Align your face in the oval, then place your ID under your nose so it covers your mouth. Keep your eyes visible."
25640
+ children: nl
25654
25641
  })
25655
- ] }), gl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25642
+ ] }), hl && Qc && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25656
25643
  className: "app__status",
25657
25644
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25658
25645
  className: "app__status-stack",
25659
25646
  children: [
25660
25647
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
25661
25648
  className: "status-pill status-pill--step",
25662
- children: jl
25649
+ children: kl
25663
25650
  }),
25664
25651
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
25665
- className: cl.faceReady ? "status-pill status-pill--ready" : "status-pill status-pill--pending",
25666
- children: ["Face ", cl.faceReady ? "ready" : "not ready"]
25652
+ className: dl.faceReady ? "status-pill status-pill--ready" : "status-pill status-pill--pending",
25653
+ children: ["Face ", dl.faceReady ? "ready" : "not ready"]
25667
25654
  }),
25668
25655
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
25669
- className: cl.idReady ? "status-pill status-pill--ready" : "status-pill status-pill--pending",
25670
- children: ["ID ", cl.idReady ? "ready" : "not ready"]
25656
+ className: dl.idReady ? "status-pill status-pill--ready" : "status-pill status-pill--pending",
25657
+ children: ["ID ", dl.idReady ? "ready" : "not ready"]
25671
25658
  })
25672
25659
  ]
25673
25660
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
25674
- className: Al,
25675
- children: kl
25661
+ className: Ol,
25662
+ children: Dl
25676
25663
  })]
25677
25664
  })]
25678
25665
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("main", {
25679
25666
  className: "app__grid",
25680
25667
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
25681
25668
  className: "app__camera",
25682
- children: [
25683
- gl ? vl.idImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25684
- className: "app__captures",
25685
- children: [
25686
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25687
- className: "capture-card",
25688
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Face capture" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
25689
- src: vl.faceImage ?? "",
25690
- alt: "Face capture"
25691
- })]
25692
- }),
25693
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25694
- className: "capture-card",
25695
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "ID capture (cropped)" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
25696
- src: vl.idImage,
25697
- alt: "ID capture"
25698
- })]
25699
- }),
25700
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25701
- className: "capture-card",
25702
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Full frame" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
25703
- src: vl.fullImage ?? "",
25704
- alt: "Full frame capture"
25705
- })]
25706
- })
25707
- ]
25708
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaceAndIdCapture_default, {
25709
- onReadyChange: (zc) => {
25710
- ll(zc), el?.(zc);
25711
- },
25712
- onMetricsChange: (zc) => {
25713
- pl(zc), nl?.(zc);
25714
- },
25715
- onStepChange: (zc) => {
25716
- dl(zc), tl?.(zc);
25717
- },
25718
- onCapture: (zc) => {
25719
- yl(zc), rl?.(zc);
25720
- }
25721
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25722
- className: "app__start",
25723
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
25724
- className: "btn btn--primary",
25725
- type: "button",
25726
- disabled: Ol,
25727
- onClick: () => _l(!0),
25728
- children: "Start Verification"
25729
- }), Ol && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
25730
- className: "app__token-hint",
25731
- children: "Provide a session token before starting."
25732
- })]
25733
- }),
25734
- gl ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
25735
- gl && Qc && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
25736
- className: "app__actions",
25737
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
25738
- className: "btn btn--ghost",
25739
- type: "button",
25740
- onClick: () => hl((zc) => !zc),
25741
- children: ml ? "Hide Capture debug" : "Show Capture Debug"
25742
- })
25743
- })
25744
- ]
25745
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", {
25669
+ children: [hl ? _l.idImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25670
+ className: "panel-card panel-card--metrics",
25671
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Capture complete" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "You can continue in the verification flow." })]
25672
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaceAndIdCapture_default, {
25673
+ onReadyChange: (zc) => {
25674
+ fl(zc), rl?.(zc);
25675
+ },
25676
+ onMetricsChange: (zc) => {
25677
+ ol?.(zc);
25678
+ },
25679
+ onStepChange: (zc) => {
25680
+ ml(zc), al?.(zc);
25681
+ },
25682
+ onCapture: (zc) => {
25683
+ vl(zc), sl?.(zc);
25684
+ }
25685
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25686
+ className: "app__start",
25687
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
25688
+ className: "btn btn--primary",
25689
+ type: "button",
25690
+ disabled: wl,
25691
+ onClick: () => gl(!0),
25692
+ children: "Start Verification"
25693
+ }), wl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
25694
+ className: "app__token-hint",
25695
+ children: "Provide a session token before starting."
25696
+ })]
25697
+ }), hl ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {})]
25698
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("aside", {
25746
25699
  className: "app__panel",
25747
- children: [
25748
- vl.idImage && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25749
- className: "panel-card panel-card--accent",
25750
- children: [
25751
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Match result" }),
25752
- wl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25753
- className: "metrics-row",
25754
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Comparing face to ID..." }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
25755
- className: "spinner",
25756
- "aria-hidden": "true"
25757
- })]
25758
- }),
25759
- Sl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: Sl }),
25760
- bl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25761
- className: "metrics-grid",
25762
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25763
- className: "metrics-row",
25764
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Match" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
25765
- className: bl.match ? "match-result match-result--yes" : "match-result match-result--no",
25766
- children: bl.match ? "YES" : "NO"
25767
- })]
25768
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
25769
- className: "metrics-details",
25770
- children: [
25771
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
25772
- className: "metrics-summary",
25773
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
25774
- className: "metrics-summary__top",
25775
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Match %" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
25776
- className: "metrics-summary__value",
25777
- children: [formatNumber(bl.match_percentage, 2), "%"]
25778
- })]
25779
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
25780
- className: "metrics-summary__arrow",
25781
- "aria-hidden": "true"
25782
- })]
25783
- }),
25784
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25785
- className: "metrics-row",
25786
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Cosine distance" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: formatNumber(bl.cosine_distance, 4) })]
25787
- }),
25788
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25789
- className: "metrics-row",
25790
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Cosine similarity" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: formatNumber(bl.cosine_similarity, 4) })]
25791
- })
25792
- ]
25793
- })]
25794
- })
25795
- ]
25796
- }),
25797
- vl.idImage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
25798
- ml && fl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25799
- className: "panel-card panel-card--metrics",
25800
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Debug metrics" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
25801
- className: "metrics-grid",
25802
- children: Ml.map((zc) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25803
- className: "metrics-row",
25804
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: zc.label }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: zc.value })]
25805
- }, zc.label))
25806
- })]
25807
- }),
25808
- ml && fl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}) }),
25809
- !vl.idImage && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25810
- className: "panel-card",
25811
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Quick checklist" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", { children: [
25812
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "Fill the oval, but avoid getting too close." }),
25813
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "Place the ID under your nose and keep eyes visible." }),
25814
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "Face a soft, even light source and avoid glare." }),
25815
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "Hold steady until the status turns ready." })
25816
- ] })]
25817
- }),
25818
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
25819
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25820
- className: "app__cta-row",
25821
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Already tried verification? Let's start integrating it into your app." }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
25822
- className: "btn btn--ghost",
25823
- href: "https://truescene.site/",
25824
- target: "_blank",
25825
- rel: "noreferrer",
25826
- children: "Start Building"
25827
- })]
25828
- })
25829
- ]
25700
+ children: !_l.idImage && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25701
+ className: "panel-card",
25702
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Quick checklist" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", { children: [
25703
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "Fill the oval, but avoid getting too close." }),
25704
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "Place the ID under your nose and keep eyes visible." }),
25705
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "Face a soft, even light source and avoid glare." }),
25706
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "Hold steady until the status turns ready." })
25707
+ ] })]
25708
+ })
25830
25709
  })]
25831
25710
  })]
25832
25711
  });
25833
- }, parseBoolean = (zc) => {
25834
- if (zc === null) return !1;
25712
+ }, parseBoolean = (zc, Wc = !1) => {
25713
+ if (zc === null) return Wc;
25835
25714
  if (zc === "") return !0;
25836
- let Wc = zc.toLowerCase();
25837
- return !(Wc === "false" || Wc === "0" || Wc === "no");
25838
- }, TrueSceneCaptureElement = class extends HTMLElement {
25715
+ let Kc = zc.toLowerCase();
25716
+ return !(Kc === "false" || Kc === "0" || Kc === "no");
25717
+ }, parseNumber = (zc) => {
25718
+ if (zc === null || zc.trim() === "") return;
25719
+ let Wc = Number(zc);
25720
+ return Number.isFinite(Wc) ? Wc : void 0;
25721
+ }, parseRegion = (zc) => zc && zc in REGION_URLS ? zc : void 0, TrueSceneCaptureElement = class extends HTMLElement {
25839
25722
  constructor(...zc) {
25840
25723
  super(...zc), this.root = null, this.mount = null, this.styleEl = null;
25841
25724
  }
25842
25725
  static #e = this.observedAttributes = [
25843
25726
  "session-token",
25844
- "compare-url",
25845
- "token-header",
25846
- "token-prefix",
25847
- "token-field",
25727
+ "region",
25728
+ "compare-timeout-ms",
25848
25729
  "auto-start",
25849
- "show-debug",
25850
- "debug-toggle"
25730
+ "show-header",
25731
+ "show-instructions",
25732
+ "show-status",
25733
+ "header-eyebrow",
25734
+ "header-title",
25735
+ "header-subtitle",
25736
+ "instructions"
25851
25737
  ];
25852
25738
  connectedCallback() {
25853
- console.count("truescene-capture connected"), this.shadowRoot || this.attachShadow({ mode: "open" });
25739
+ this.shadowRoot || this.attachShadow({ mode: "open" });
25854
25740
  let zc = this.shadowRoot;
25855
25741
  if (zc) {
25856
25742
  if (!this.styleEl) {
25857
25743
  let Wc = document.createElement("style");
25858
- Wc.textContent = "@import \"https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&family=Space+Mono:wght@400;700&display=swap\";:host{display:block}:host,.ts-capture{color:#0f1c2e;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--ink:#0f1c2e;--muted:#5a6b7a;--panel:#fff;font-family:Sora,Segoe UI,sans-serif;font-weight:400;line-height:1.5}.ts-capture,.ts-capture *{box-sizing:border-box}.ts-capture{min-height:100%;color:var(--ink);flex-direction:column;gap:2.5rem;padding:clamp(2rem,5vw,4rem);display:flex}.ts-capture button{font-family:inherit}.ts-capture .app__header{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:2rem;display:flex}.ts-capture .app__eyebrow{text-transform:uppercase;letter-spacing:.3em;color:var(--muted);font-size:.7rem}.ts-capture .app__title{margin:0;font-size:clamp(2.2rem,4vw,3.4rem)}.ts-capture .app__subtitle{max-width:34rem;color:var(--muted);margin:0;font-size:1.05rem}.ts-capture .app__cta-row{text-align:center;color:var(--muted);flex-wrap:wrap;justify-content:center;align-items:center;gap:1rem;display:flex}.ts-capture .app__cta-row p{margin:0;font-size:1rem}.ts-capture .app__status{text-align:right;flex-direction:column;align-items:flex-end;gap:.75rem;max-width:18rem;display:flex}.ts-capture .app__status-stack{flex-direction:column;align-items:flex-end;gap:.5rem;display:flex}.ts-capture .app__grid{grid-template-columns:minmax(0,1.35fr) minmax(0,.9fr);align-items:start;gap:2rem;display:grid}.ts-capture .app__camera{flex-direction:column;gap:1.1rem;display:flex}.ts-capture .app__actions{flex-wrap:wrap;justify-content:center;gap:.75rem;display:flex}.ts-capture .app__captures{gap:1rem;display:grid}.ts-capture .app__start{align-self:center;justify-items:center;gap:.5rem;width:fit-content;display:grid}.ts-capture .app__token-hint{color:var(--muted);text-align:center;margin:0;font-size:.95rem}.ts-capture .capture-card{color:#f8fafc;background:#0f172a;border-radius:18px;gap:.5rem;padding:.75rem;display:grid}.ts-capture .capture-card span{font-size:.95rem;font-weight:600}.ts-capture .capture-card img{object-fit:cover;border-radius:12px;width:100%}.ts-capture .status-pill{border:1px solid #0000;border-radius:999px;align-items:center;gap:.5rem;padding:.5rem .95rem;font-size:.9rem;font-weight:600;display:inline-flex}.ts-capture .status-pill--step{color:#1f2937;background:#14212f14;border-color:#14212f1f}.ts-capture .status-pill--ready{color:#1b6d57;background:#46e3a82e;border-color:#46e3a866}.ts-capture .status-pill--not{color:#a33b3b;background:#ff6b6b2e;border-color:#ff6b6b59}.ts-capture .status-pill--pending{color:#8a5c1b;background:#f7c45233;border-color:#f7c45259}.ts-capture .btn{cursor:pointer;border:none;border-radius:999px;padding:.75rem 1.4rem;font-family:Sora,sans-serif;font-size:.95rem;font-weight:600;transition:transform .2s,box-shadow .2s}.ts-capture .btn:active{transform:translateY(1px)}.ts-capture .btn--primary{color:#f8fafc;background:#14212f;box-shadow:0 12px 24px #14212f40}.ts-capture .btn--primary:disabled{color:#64748b;cursor:not-allowed;box-shadow:none;background:#cbd5e1}.ts-capture .btn--ghost{color:#14212f;background:#14212f14;border:1px solid #14212f26}.ts-capture .panel-card{background:var(--panel);border-radius:24px;flex-direction:column;gap:.8rem;padding:1.4rem;display:flex;box-shadow:0 18px 40px #0f172a1f}.ts-capture .panel-card h2{margin:0;font-size:1.2rem}.ts-capture .panel-card ul{color:var(--muted);margin:0;padding-left:1.2rem;line-height:1.6}.ts-capture .panel-card p{color:var(--muted);margin:0;line-height:1.6}.ts-capture .panel-card--accent{background:linear-gradient(135deg,#fef0d9,#e7f6f2);border:1px solid #14212f14}.ts-capture .panel-card--metrics{background:#fbfbf8}.ts-capture .spinner{border:2px solid #14212f33;border-top-color:#14212f;border-radius:50%;width:18px;height:18px;animation:.8s linear infinite spinner-rotate}@keyframes spinner-rotate{to{transform:rotate(360deg)}}.ts-capture .metrics-grid{gap:.6rem;font-family:Space Mono,monospace;font-size:.85rem;display:grid}.ts-capture .metrics-row{border-bottom:1px dashed #14212f1f;justify-content:space-between;gap:.75rem;padding-bottom:.4rem;display:flex}.ts-capture .metrics-row span:last-child{color:var(--muted);text-align:right;max-width:12rem}.ts-capture .metrics-details{border-bottom:1px dashed #14212f1f;padding-bottom:.4rem}.ts-capture .metrics-summary{cursor:pointer;flex-direction:column;gap:.35rem;font-family:Space Mono,monospace;font-size:.85rem;list-style:none;display:flex}.ts-capture .metrics-summary::-webkit-details-marker{display:none}.ts-capture .metrics-summary__top{justify-content:space-between;gap:.75rem;display:flex}.ts-capture .metrics-summary__value{color:var(--muted);text-align:right}.ts-capture .metrics-summary__arrow{border-left:6px solid #0000;border-right:6px solid #0000;border-top:7px solid var(--muted);align-self:center;width:0;height:0;transition:transform .2s}.ts-capture .metrics-details[open] .metrics-summary__arrow{transform:rotate(180deg)}.ts-capture .match-result{font-weight:700}.ts-capture .metrics-row span.match-result--yes{color:#1b6d57}.ts-capture .metrics-row span.match-result--no{color:#a33b3b}.ts-capture .face-aligner{aspect-ratio:4/3;background:#10141c;border-radius:24px;width:100%;position:relative;overflow:hidden;box-shadow:0 20px 60px #0b0f1640,inset 0 0 0 1px #ffffff14}.ts-capture .face-aligner__video,.ts-capture .face-aligner__overlay{object-fit:cover;width:100%;height:100%;position:absolute;inset:0}.ts-capture .face-aligner__video{background:#0f172a}.ts-capture .face-aligner__overlay{pointer-events:none}.ts-capture .face-aligner__message{color:#f8fafc;text-align:center;background:#0a0c12c7;place-items:center;padding:1.5rem;font-size:1rem;font-weight:600;display:grid;position:absolute;inset:0}.ts-capture .face-aligner__back{z-index:2;color:#f8fafc;cursor:pointer;background:#0f172ab3;border:none;border-radius:999px;padding:.5rem 1rem;font-size:.85rem;font-weight:600;transition:transform .2s,background .2s;position:absolute;top:16px;left:16px;box-shadow:0 12px 20px #0f172a40}.ts-capture .face-aligner__back:hover{background:#0f172ad9}.ts-capture .face-aligner__back:active{transform:translateY(1px)}.ts-capture .face-aligner__sr{clip:rect(0,0,0,0);border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (max-width:980px){.ts-capture .app__grid{grid-template-columns:1fr}.ts-capture .app__status{text-align:left;align-items:flex-start}.ts-capture .app__status-stack{align-items:flex-start}}@media (max-width:640px){.ts-capture{gap:1.5rem;padding:0}.ts-capture .app__title{font-size:2rem}.ts-capture .app__header{padding:1.25rem 1.25rem 0}.ts-capture .app__grid{gap:0}.ts-capture .app__camera{padding:0}.ts-capture .app__actions{padding:0 1.25rem 1.5rem}.ts-capture .app__panel{padding:0 1.25rem 1.75rem}.ts-capture .app__captures{padding:0 1.25rem}.ts-capture .app__cta-row{padding:0 1.25rem;font-size:.95rem}.ts-capture .face-aligner{aspect-ratio:auto;border-radius:0;width:100vw;height:100svh;max-height:100svh}}", zc.appendChild(Wc), this.styleEl = Wc;
25744
+ Wc.textContent = "@import \"https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&family=Space+Mono:wght@400;700&display=swap\";:host{display:block}:host,.ts-capture{color:#0f1c2e;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--ink:#0f1c2e;--muted:#5a6b7a;--panel:#fff;font-family:Sora,Segoe UI,sans-serif;font-weight:400;line-height:1.5}.ts-capture,.ts-capture *{box-sizing:border-box}.ts-capture{min-height:100%;color:var(--ink);flex-direction:column;gap:2.5rem;padding:clamp(2rem,5vw,4rem);display:flex}.ts-capture button{font-family:inherit}.ts-capture .app__header{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:2rem;display:flex}.ts-capture .app__header--status-only{justify-content:flex-end}.ts-capture .app__eyebrow{text-transform:uppercase;letter-spacing:.3em;color:var(--muted);font-size:.7rem}.ts-capture .app__title{margin:0;font-size:clamp(2.2rem,4vw,3.4rem)}.ts-capture .app__subtitle{max-width:34rem;color:var(--muted);margin:0;font-size:1.05rem}.ts-capture .app__cta-row{text-align:center;color:var(--muted);flex-wrap:wrap;justify-content:center;align-items:center;gap:1rem;display:flex}.ts-capture .app__cta-row p{margin:0;font-size:1rem}.ts-capture .app__status{text-align:right;flex-direction:column;align-items:flex-end;gap:.75rem;max-width:18rem;display:flex}.ts-capture .app__status-stack{flex-direction:column;align-items:flex-end;gap:.5rem;display:flex}.ts-capture .app__grid{grid-template-columns:minmax(0,1.35fr) minmax(0,.9fr);align-items:start;gap:2rem;display:grid}.ts-capture .app__camera{flex-direction:column;gap:1.1rem;display:flex}.ts-capture .app__actions{flex-wrap:wrap;justify-content:center;gap:.75rem;display:flex}.ts-capture .app__captures{gap:1rem;display:grid}.ts-capture .app__start{align-self:center;justify-items:center;gap:.5rem;width:fit-content;display:grid}.ts-capture .app__token-hint{color:var(--muted);text-align:center;margin:0;font-size:.95rem}.ts-capture .capture-card{color:#f8fafc;background:#0f172a;border-radius:18px;gap:.5rem;padding:.75rem;display:grid}.ts-capture .capture-card span{font-size:.95rem;font-weight:600}.ts-capture .capture-card img{object-fit:cover;border-radius:12px;width:100%}.ts-capture .status-pill{border:1px solid #0000;border-radius:999px;align-items:center;gap:.5rem;padding:.5rem .95rem;font-size:.9rem;font-weight:600;display:inline-flex}.ts-capture .status-pill--step{color:#1f2937;background:#14212f14;border-color:#14212f1f}.ts-capture .status-pill--ready{color:#1b6d57;background:#46e3a82e;border-color:#46e3a866}.ts-capture .status-pill--not{color:#a33b3b;background:#ff6b6b2e;border-color:#ff6b6b59}.ts-capture .status-pill--pending{color:#8a5c1b;background:#f7c45233;border-color:#f7c45259}.ts-capture .btn{cursor:pointer;border:none;border-radius:999px;padding:.75rem 1.4rem;font-family:Sora,sans-serif;font-size:.95rem;font-weight:600;transition:transform .2s,box-shadow .2s}.ts-capture .btn:active{transform:translateY(1px)}.ts-capture .btn--primary{color:#f8fafc;background:#14212f;box-shadow:0 12px 24px #14212f40}.ts-capture .btn--primary:disabled{color:#64748b;cursor:not-allowed;box-shadow:none;background:#cbd5e1}.ts-capture .btn--ghost{color:#14212f;background:#14212f14;border:1px solid #14212f26}.ts-capture .panel-card{background:var(--panel);border-radius:24px;flex-direction:column;gap:.8rem;padding:1.4rem;display:flex;box-shadow:0 18px 40px #0f172a1f}.ts-capture .panel-card h2{margin:0;font-size:1.2rem}.ts-capture .panel-card ul{color:var(--muted);margin:0;padding-left:1.2rem;line-height:1.6}.ts-capture .panel-card p{color:var(--muted);margin:0;line-height:1.6}.ts-capture .panel-card--accent{background:linear-gradient(135deg,#fef0d9,#e7f6f2);border:1px solid #14212f14}.ts-capture .panel-card--metrics{background:#fbfbf8}.ts-capture .spinner{border:2px solid #14212f33;border-top-color:#14212f;border-radius:50%;width:18px;height:18px;animation:.8s linear infinite spinner-rotate}@keyframes spinner-rotate{to{transform:rotate(360deg)}}.ts-capture .metrics-grid{gap:.6rem;font-family:Space Mono,monospace;font-size:.85rem;display:grid}.ts-capture .metrics-row{border-bottom:1px dashed #14212f1f;justify-content:space-between;gap:.75rem;padding-bottom:.4rem;display:flex}.ts-capture .metrics-row span:last-child:not(.spinner){color:var(--muted);text-align:right;overflow-wrap:anywhere;word-break:break-word;flex:1;min-width:0;max-width:100%}.ts-capture .metrics-row .spinner{flex:none;align-self:center;margin-left:.5rem}.ts-capture .metrics-details{border-bottom:1px dashed #14212f1f;padding-bottom:.4rem}.ts-capture .metrics-summary{cursor:pointer;flex-direction:column;gap:.35rem;font-family:Space Mono,monospace;font-size:.85rem;list-style:none;display:flex}.ts-capture .metrics-summary::-webkit-details-marker{display:none}.ts-capture .metrics-summary__top{justify-content:space-between;gap:.75rem;display:flex}.ts-capture .metrics-summary__value{color:var(--muted);text-align:right}.ts-capture .metrics-summary__arrow{border-left:6px solid #0000;border-right:6px solid #0000;border-top:7px solid var(--muted);align-self:center;width:0;height:0;transition:transform .2s}.ts-capture .metrics-details[open] .metrics-summary__arrow{transform:rotate(180deg)}.ts-capture .match-result{font-weight:700}.ts-capture .metrics-row span.match-result--yes{color:#1b6d57}.ts-capture .metrics-row span.match-result--no{color:#a33b3b}.ts-capture .face-aligner{aspect-ratio:4/3;background:#10141c;border-radius:24px;width:100%;position:relative;overflow:hidden;box-shadow:0 20px 60px #0b0f1640,inset 0 0 0 1px #ffffff14}.ts-capture .face-aligner__video,.ts-capture .face-aligner__overlay{object-fit:cover;width:100%;height:100%;position:absolute;inset:0}.ts-capture .face-aligner__video{background:#0f172a}.ts-capture .face-aligner__overlay{pointer-events:none}.ts-capture .face-aligner__message{color:#f8fafc;text-align:center;background:#0a0c12c7;place-items:center;padding:1.5rem;font-size:1rem;font-weight:600;display:grid;position:absolute;inset:0}.ts-capture .face-aligner__back{z-index:2;color:#f8fafc;cursor:pointer;background:#0f172ab3;border:none;border-radius:999px;padding:.5rem 1rem;font-size:.85rem;font-weight:600;transition:transform .2s,background .2s;position:absolute;top:16px;left:16px;box-shadow:0 12px 20px #0f172a40}.ts-capture .face-aligner__back:hover{background:#0f172ad9}.ts-capture .face-aligner__back:active{transform:translateY(1px)}.ts-capture .face-aligner__sr{clip:rect(0,0,0,0);border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (max-width:980px){.ts-capture .app__grid{grid-template-columns:1fr}.ts-capture .app__status{text-align:left;align-items:flex-start}.ts-capture .app__status-stack{align-items:flex-start}}@media (max-width:640px){.ts-capture{gap:1.5rem;padding:0}.ts-capture .app__title{font-size:2rem}.ts-capture .app__header{padding:1.25rem 1.25rem 0}.ts-capture .app__grid{gap:0}.ts-capture .app__camera{padding:0}.ts-capture .app__actions{padding:0 1.25rem 1.5rem}.ts-capture .app__panel{padding:0 1.25rem 1.75rem}.ts-capture .app__captures{padding:0 1.25rem}.ts-capture .app__cta-row{padding:0 1.25rem;font-size:.95rem}.ts-capture .face-aligner{aspect-ratio:auto;border-radius:0;width:100vw;height:100svh;max-height:100svh}}", zc.appendChild(Wc), this.styleEl = Wc;
25859
25745
  }
25860
25746
  this.mount || (this.mount = document.createElement("div"), zc.appendChild(this.mount)), this.root ||= (0, import_client.createRoot)(this.mount), this.renderReact();
25861
25747
  }
25862
25748
  }
25863
25749
  disconnectedCallback() {
25864
- console.count("truescene-capture disconnected"), this.root?.unmount(), this.root = null;
25750
+ this.root?.unmount(), this.root = null;
25865
25751
  }
25866
25752
  attributeChangedCallback() {
25867
25753
  this.renderReact();
@@ -25876,75 +25762,104 @@ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((zc) =
25876
25762
  get sessionToken() {
25877
25763
  return this.getAttribute("session-token") ?? "";
25878
25764
  }
25879
- set compareUrl(zc) {
25765
+ set region(zc) {
25880
25766
  if (!zc) {
25881
- this.removeAttribute("compare-url");
25767
+ this.removeAttribute("region");
25882
25768
  return;
25883
25769
  }
25884
- this.setAttribute("compare-url", zc);
25770
+ this.setAttribute("region", zc);
25885
25771
  }
25886
- get compareUrl() {
25887
- return this.getAttribute("compare-url") ?? void 0;
25772
+ get region() {
25773
+ return parseRegion(this.getAttribute("region"));
25888
25774
  }
25889
- set tokenHeader(zc) {
25890
- if (!zc) {
25891
- this.removeAttribute("token-header");
25775
+ set compareTimeoutMs(zc) {
25776
+ if (zc == null) {
25777
+ this.removeAttribute("compare-timeout-ms");
25892
25778
  return;
25893
25779
  }
25894
- this.setAttribute("token-header", zc);
25780
+ this.setAttribute("compare-timeout-ms", String(zc));
25895
25781
  }
25896
- get tokenHeader() {
25897
- return this.getAttribute("token-header") ?? void 0;
25782
+ get compareTimeoutMs() {
25783
+ return parseNumber(this.getAttribute("compare-timeout-ms"));
25898
25784
  }
25899
- set tokenPrefix(zc) {
25900
- if (!zc) {
25901
- this.removeAttribute("token-prefix");
25902
- return;
25903
- }
25904
- this.setAttribute("token-prefix", zc);
25785
+ set autoStart(zc) {
25786
+ zc ? this.setAttribute("auto-start", "") : this.removeAttribute("auto-start");
25787
+ }
25788
+ get autoStart() {
25789
+ return parseBoolean(this.getAttribute("auto-start"));
25905
25790
  }
25906
- get tokenPrefix() {
25907
- return this.getAttribute("token-prefix") ?? void 0;
25791
+ set showHeader(zc) {
25792
+ this.setAttribute("show-header", zc ? "" : "false");
25908
25793
  }
25909
- set tokenField(zc) {
25910
- if (!zc) {
25911
- this.removeAttribute("token-field");
25794
+ get showHeader() {
25795
+ return parseBoolean(this.getAttribute("show-header"), !0);
25796
+ }
25797
+ set showInstructions(zc) {
25798
+ this.setAttribute("show-instructions", zc ? "" : "false");
25799
+ }
25800
+ get showInstructions() {
25801
+ return parseBoolean(this.getAttribute("show-instructions"), !0);
25802
+ }
25803
+ set showStatus(zc) {
25804
+ this.setAttribute("show-status", zc ? "" : "false");
25805
+ }
25806
+ get showStatus() {
25807
+ return parseBoolean(this.getAttribute("show-status"), !0);
25808
+ }
25809
+ set headerEyebrow(zc) {
25810
+ if (zc == null) {
25811
+ this.removeAttribute("header-eyebrow");
25912
25812
  return;
25913
25813
  }
25914
- this.setAttribute("token-field", zc);
25814
+ this.setAttribute("header-eyebrow", zc);
25915
25815
  }
25916
- get tokenField() {
25917
- return this.getAttribute("token-field") ?? void 0;
25816
+ get headerEyebrow() {
25817
+ return this.getAttribute("header-eyebrow") ?? void 0;
25918
25818
  }
25919
- set autoStart(zc) {
25920
- zc ? this.setAttribute("auto-start", "") : this.removeAttribute("auto-start");
25819
+ set headerTitle(zc) {
25820
+ if (zc == null) {
25821
+ this.removeAttribute("header-title");
25822
+ return;
25823
+ }
25824
+ this.setAttribute("header-title", zc);
25921
25825
  }
25922
- get autoStart() {
25923
- return parseBoolean(this.getAttribute("auto-start"));
25826
+ get headerTitle() {
25827
+ return this.getAttribute("header-title") ?? void 0;
25924
25828
  }
25925
- set initialShowDebug(zc) {
25926
- zc ? this.setAttribute("show-debug", "") : this.removeAttribute("show-debug");
25829
+ set headerSubtitle(zc) {
25830
+ if (zc == null) {
25831
+ this.removeAttribute("header-subtitle");
25832
+ return;
25833
+ }
25834
+ this.setAttribute("header-subtitle", zc);
25927
25835
  }
25928
- get initialShowDebug() {
25929
- return parseBoolean(this.getAttribute("show-debug"));
25836
+ get headerSubtitle() {
25837
+ return this.getAttribute("header-subtitle") ?? void 0;
25930
25838
  }
25931
- set showDebugToggle(zc) {
25932
- zc ? this.setAttribute("debug-toggle", "") : this.removeAttribute("debug-toggle");
25839
+ set instructions(zc) {
25840
+ if (zc == null) {
25841
+ this.removeAttribute("instructions");
25842
+ return;
25843
+ }
25844
+ this.setAttribute("instructions", zc);
25933
25845
  }
25934
- get showDebugToggle() {
25935
- return parseBoolean(this.getAttribute("debug-toggle"));
25846
+ get instructions() {
25847
+ return this.getAttribute("instructions") ?? void 0;
25936
25848
  }
25937
25849
  renderReact() {
25938
25850
  if (!this.root) return;
25939
25851
  let zc = {
25940
25852
  sessionToken: this.sessionToken,
25941
- compareUrl: this.compareUrl,
25942
- tokenHeader: this.tokenHeader,
25943
- tokenPrefix: this.tokenPrefix,
25944
- tokenField: this.tokenField,
25853
+ region: this.region,
25854
+ compareTimeoutMs: this.compareTimeoutMs,
25945
25855
  autoStart: this.autoStart,
25946
- initialShowDebug: this.initialShowDebug,
25947
- showDebugToggle: this.showDebugToggle,
25856
+ showHeader: this.showHeader,
25857
+ showInstructions: this.showInstructions,
25858
+ showStatus: this.showStatus,
25859
+ headerEyebrow: this.headerEyebrow,
25860
+ headerTitle: this.headerTitle,
25861
+ headerSubtitle: this.headerSubtitle,
25862
+ instructions: this.instructions,
25948
25863
  onReadyChange: (zc) => {
25949
25864
  this.dispatchEvent(new CustomEvent("ready-change", {
25950
25865
  detail: zc,
@@ -25973,15 +25888,15 @@ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((zc) =
25973
25888
  composed: !0
25974
25889
  }));
25975
25890
  },
25976
- onCompareResult: (zc) => {
25977
- this.dispatchEvent(new CustomEvent("compare-result", {
25891
+ onVerificationCode: (zc) => {
25892
+ this.dispatchEvent(new CustomEvent("verification-code", {
25978
25893
  detail: zc,
25979
25894
  bubbles: !0,
25980
25895
  composed: !0
25981
25896
  }));
25982
25897
  },
25983
- onCompareError: (zc) => {
25984
- this.dispatchEvent(new CustomEvent("compare-error", {
25898
+ onVerificationError: (zc) => {
25899
+ this.dispatchEvent(new CustomEvent("verification-error", {
25985
25900
  detail: zc,
25986
25901
  bubbles: !0,
25987
25902
  composed: !0