@leatcom/portal-sessions 0.0.81 → 0.0.83

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.
@@ -5126,7 +5126,7 @@ function nA(e) {
5126
5126
  shop_uuid: e.shopUuid,
5127
5127
  contact_uuid: e.contactUuid
5128
5128
  };
5129
- return e.cameraService && (a.camera_service = e.cameraService), e.cameraFacingMode && (a.camera_facing_mode = e.cameraFacingMode), e.amountInCents && (a.amount_in_cents = e.amountInCents), e.allowMultipleGiftcards && (a.allow_multiple_giftcards = e.allowMultipleGiftcards), e.enableRegistration && (a.enable_registration = e.enableRegistration), e.enableEmailIdentification && (a.enable_email_identification = e.enableEmailIdentification), e.enableOnScreenKeyboard && (a.enable_on_screen_keyboard = e.enableOnScreenKeyboard), e.primaryIdentificationMethod && (a.primary_identification_method = e.primaryIdentificationMethod), a;
5129
+ return e.cameraService && (a.camera_service = e.cameraService), e.cameraFacingMode && (a.facing_mode = e.cameraFacingMode), e.amountInCents && (a.amount_in_cents = e.amountInCents), e.allowMultipleGiftcards && (a.allow_multiple_giftcards = e.allowMultipleGiftcards), e.enableRegistration && (a.enable_registration = e.enableRegistration), e.enableEmailIdentification && (a.enable_email_identification = e.enableEmailIdentification), e.enableOnScreenKeyboard && (a.enable_on_screen_keyboard = e.enableOnScreenKeyboard), e.primaryIdentificationMethod && (a.primary_identification_method = e.primaryIdentificationMethod), a;
5130
5130
  }, s = () => {
5131
5131
  o.post("/", i(), {
5132
5132
  baseURL: `${e.host}/api/v1/portal-sessions`,
@@ -37197,7 +37197,7 @@ function mL({ onScan: e }) {
37197
37197
  onResult: (o) => {
37198
37198
  o && e(o.getText());
37199
37199
  },
37200
- constraints: { facingMode: n },
37200
+ constraints: { advanced: [{ facingMode: n }] },
37201
37201
  videoStyle: {
37202
37202
  maxHeight: "calc(100vh-381px)",
37203
37203
  minHeight: 267,
@@ -37508,22 +37508,24 @@ st.NO_QR_CODE_FOUND = "No QR code found";
37508
37508
  st._disableBarcodeDetector = !1;
37509
37509
  st._workerMessageId = 0;
37510
37510
  function yL({ onScan: e }) {
37511
- const { cameraFacingMode: t } = Sn(), [n, r] = we(t), o = ze(), i = ze(null), [s, a] = we(!0), c = (f) => {
37512
- e(f == null ? void 0 : f.data);
37513
- }, u = (f) => {
37514
- };
37515
- return Me(() => {
37516
- var f;
37517
- return i != null && i.current && !o.current && (o.current = new st(i == null ? void 0 : i.current, c, {
37511
+ const { cameraFacingMode: t } = Sn(), [n, r] = we(t), o = ze(), i = ze(null), [s, a] = we(!0), c = (d) => {
37512
+ e(d == null ? void 0 : d.data);
37513
+ }, u = (d) => {
37514
+ }, f = () => {
37515
+ var d;
37516
+ i != null && i.current && !o.current && (o.current = new st(i == null ? void 0 : i.current, c, {
37518
37517
  onDecodeError: u,
37519
37518
  preferredCamera: n
37520
- }), (f = o == null ? void 0 : o.current) == null || f.start().then(() => a(!0)).catch((h) => {
37521
- h && a(!1);
37522
- })), () => {
37523
- var h;
37524
- i != null && i.current || (h = o == null ? void 0 : o.current) == null || h.stop();
37525
- };
37526
- }, []), Me(() => {
37519
+ }), (d = o == null ? void 0 : o.current) == null || d.start().then(() => a(!0)).catch((p) => {
37520
+ p && a(!1);
37521
+ }));
37522
+ }, h = () => {
37523
+ var d;
37524
+ i != null && i.current || (d = o == null ? void 0 : o.current) == null || d.stop();
37525
+ };
37526
+ return Me(() => (f(), () => {
37527
+ h();
37528
+ }), [n]), Me(() => {
37527
37529
  s || alert("Camera is blocked or not accessible. Please allow camera in your browser permissions and reload.");
37528
37530
  }, [s]), /* @__PURE__ */ w.jsxs("div", { className: "relative", children: [
37529
37531
  /* @__PURE__ */ w.jsx("video", { className: "max-h-[calc(100vh-381px)] min-h-[370px] rounded object-cover", ref: i }),
@@ -37531,7 +37533,9 @@ function yL({ onScan: e }) {
37531
37533
  "div",
37532
37534
  {
37533
37535
  className: "absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",
37534
- onClick: () => n === vr.USER ? r(vr.ENVIRONMENT) : r(vr.USER),
37536
+ onClick: () => {
37537
+ n === vr.USER ? r(vr.ENVIRONMENT) : r(vr.USER);
37538
+ },
37535
37539
  children: /* @__PURE__ */ w.jsx("img", { src: zp, alt: "camera-switch" })
37536
37540
  }
37537
37541
  )