@lydianpay/sdk-web 3.2.0 → 3.3.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.
@@ -1,7 +1,7 @@
1
1
  var oA = Object.defineProperty;
2
2
  var lA = (t, e, n) => e in t ? oA(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var Ge = (t, e, n) => lA(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { t as re, g as cA, i as ny, P as iy, a as JE, s as ex, h as um, c as uA, T as ry, b as qb, r as fA, d as dA, e as hA, f as tx, j as pA, k as gA, l as mA, m as yA, n as wA, o as bA, p as vA } from "./index-BhtU_AAG.js";
4
+ import { t as re, g as cA, i as ny, P as iy, a as JE, s as ex, h as um, c as uA, T as ry, b as qb, r as fA, d as dA, e as hA, f as tx, j as pA, k as gA, l as mA, m as yA, n as wA, o as bA, p as vA } from "./index-D3Zl7b5P.js";
5
5
  function sy(t) {
6
6
  return [...new Set(t)];
7
7
  }
@@ -17280,7 +17280,7 @@ function tC(t, e = {}) {
17280
17280
  const a = (t.length - 2) / 2, l = (1n << BigInt(a) * 8n - 1n) - 1n;
17281
17281
  return r <= l ? r : r - BigInt(`0x${"f".padStart(a * 2, "f")}`) - 1n;
17282
17282
  }
17283
- function Gj(t, e = {}) {
17283
+ function Yj(t, e = {}) {
17284
17284
  const n = tC(t, e), r = Number(n);
17285
17285
  if (!Number.isSafeInteger(r))
17286
17286
  throw new yy({
@@ -33041,6 +33041,9 @@ var Zd = class {
33041
33041
  function J3() {
33042
33042
  return typeof window < "u" ? window.location.origin : "";
33043
33043
  }
33044
+ function tj() {
33045
+ return typeof window > "u" ? "" : window.location.origin + window.location.pathname;
33046
+ }
33044
33047
  var KE = { timeoutMs: 4e3, intervalMs: 100 };
33045
33048
  function _r(t) {
33046
33049
  if (!t) return "eip155:1";
@@ -33051,7 +33054,7 @@ async function e5(t) {
33051
33054
  const e = await t({ method: "eth_chainId" }).catch(() => null);
33052
33055
  return _r(typeof e == "string" ? e : null);
33053
33056
  }
33054
- async function tj({
33057
+ async function nj({
33055
33058
  rpc: t,
33056
33059
  chainId: e,
33057
33060
  timeoutMs: n,
@@ -33081,7 +33084,7 @@ async function a0({
33081
33084
  // Chain not added to the wallet, or the user declined — the caller's
33082
33085
  // chainChanged will reflect reality. No settle: the chain isn't moving.
33083
33086
  () => !1
33084
- ) && await tj({ rpc: t, chainId: l, timeoutMs: n, intervalMs: r });
33087
+ ) && await nj({ rpc: t, chainId: l, timeoutMs: n, intervalMs: r });
33085
33088
  }
33086
33089
  function o0(t, e, n) {
33087
33090
  return e ? e.aborted ? (n == null || n(), Promise.reject(new DOMException("Aborted", "AbortError"))) : new Promise((r, a) => {
@@ -33098,7 +33101,7 @@ function o0(t, e, n) {
33098
33101
  );
33099
33102
  }) : t;
33100
33103
  }
33101
- var Va = "metamask", nj = class extends Zd {
33104
+ var Va = "metamask", ij = class extends Zd {
33102
33105
  constructor(t) {
33103
33106
  super(), this.app = t, this.type = "sdk", this.walletIds = [Va], this.sdk = null, this.provider = null, this.listenersBound = !1;
33104
33107
  }
@@ -33110,7 +33113,7 @@ var Va = "metamask", nj = class extends Zd {
33110
33113
  }
33111
33114
  async getProvider() {
33112
33115
  if (this.provider) return this.provider;
33113
- const { MetaMaskSDK: t } = await import("./metamask-sdk-BwVxHW1_.js"), e = {
33116
+ const { MetaMaskSDK: t } = await import("./metamask-sdk-B-CyZW84.js"), e = {
33114
33117
  name: this.app.appName,
33115
33118
  url: J3(),
33116
33119
  ...this.app.icon ? { iconUrl: this.app.icon } : {}
@@ -33143,7 +33146,7 @@ var Va = "metamask", nj = class extends Zd {
33143
33146
  ), r = n == null ? void 0 : n[0];
33144
33147
  if (!r) throw new Error("MetaMask returned no account");
33145
33148
  await a0({
33146
- rpc: ij(e),
33149
+ rpc: rj(e),
33147
33150
  chainId: s0(t)
33148
33151
  });
33149
33152
  const a = _r(
@@ -33185,7 +33188,7 @@ var Va = "metamask", nj = class extends Zd {
33185
33188
  };
33186
33189
  }
33187
33190
  };
33188
- function ij(t) {
33191
+ function rj(t) {
33189
33192
  return (e) => t.request(e);
33190
33193
  }
33191
33194
  var Ka = "coinbase";
@@ -33195,7 +33198,7 @@ function il(t, e, n) {
33195
33198
  params: n
33196
33199
  });
33197
33200
  }
33198
- var rj = class extends Zd {
33201
+ var sj = class extends Zd {
33199
33202
  constructor(t) {
33200
33203
  super(), this.app = t, this.type = "sdk", this.walletIds = [Ka], this.provider = null, this.listenersBound = !1;
33201
33204
  }
@@ -33207,7 +33210,7 @@ var rj = class extends Zd {
33207
33210
  }
33208
33211
  async getProvider(t) {
33209
33212
  if (this.provider) return this.provider;
33210
- const { CoinbaseWalletSDK: e } = await import("./index-CVTOXcSY.js"), r = new e({
33213
+ const { CoinbaseWalletSDK: e } = await import("./index-CZgQVAU2.js"), r = new e({
33211
33214
  appName: this.app.appName,
33212
33215
  appLogoUrl: this.app.icon,
33213
33216
  appChainIds: t
@@ -33232,10 +33235,10 @@ var rj = class extends Zd {
33232
33235
  }
33233
33236
  async connect(t) {
33234
33237
  return this.duringConnect(async () => {
33235
- const e = await this.getProvider(aj(t)), n = await il(e, "eth_requestAccounts"), r = n == null ? void 0 : n[0];
33238
+ const e = await this.getProvider(oj(t)), n = await il(e, "eth_requestAccounts"), r = n == null ? void 0 : n[0];
33236
33239
  if (!r) throw new Error("Coinbase Wallet returned no account");
33237
33240
  await a0({
33238
- rpc: sj(e),
33241
+ rpc: aj(e),
33239
33242
  chainId: s0(t)
33240
33243
  });
33241
33244
  const a = _r(await il(e, "eth_chainId"));
@@ -33275,15 +33278,15 @@ var rj = class extends Zd {
33275
33278
  };
33276
33279
  }
33277
33280
  };
33278
- function sj(t) {
33281
+ function aj(t) {
33279
33282
  return ({ method: e, params: n }) => il(t, e, n);
33280
33283
  }
33281
- function aj(t) {
33284
+ function oj(t) {
33282
33285
  var r;
33283
33286
  const e = (r = t.namespace.value.chains) == null ? void 0 : r[0], n = e ? Number(e.split(":")[1]) : NaN;
33284
33287
  return Number.isFinite(n) && n > 0 ? [n] : void 0;
33285
33288
  }
33286
- var GE = 100, oj = class extends Zd {
33289
+ var GE = 100, lj = class extends Zd {
33287
33290
  constructor(t) {
33288
33291
  super(), this.rdnsByWallet = t, this.type = "injected", this.discovered = /* @__PURE__ */ new Map(), this.bound = /* @__PURE__ */ new WeakSet(), this.listening = !1, this.walletIds = Object.keys(t), this.startDiscovery();
33289
33292
  }
@@ -33315,7 +33318,7 @@ var GE = 100, oj = class extends Zd {
33315
33318
  ), r = n == null ? void 0 : n[0];
33316
33319
  if (!r)
33317
33320
  throw new Error(`${t.walletId} extension returned no account`);
33318
- await a0({ rpc: lj(e), chainId: s0(t) });
33321
+ await a0({ rpc: cj(e), chainId: s0(t) });
33319
33322
  const a = _r(
33320
33323
  await e.request({ method: "eth_chainId" })
33321
33324
  );
@@ -33379,10 +33382,10 @@ var GE = 100, oj = class extends Zd {
33379
33382
  };
33380
33383
  }
33381
33384
  };
33382
- function lj(t) {
33385
+ function cj(t) {
33383
33386
  return (e) => t.request(e);
33384
33387
  }
33385
- var cj = {
33388
+ var uj = {
33386
33389
  metamask: {
33387
33390
  native: "metamask://",
33388
33391
  scheme: "metamask://wc",
@@ -33812,14 +33815,14 @@ var cj = {
33812
33815
  android: "https://play.google.com/store/apps/details?id=co.arculus.wallet.android"
33813
33816
  }
33814
33817
  }
33815
- }, uj = cj;
33818
+ }, fj = uj;
33816
33819
  function YE() {
33817
33820
  var n;
33818
33821
  if (typeof navigator > "u") return !1;
33819
33822
  const t = navigator.userAgent || "", e = ((n = navigator.userAgentData) == null ? void 0 : n.mobile) ?? !1;
33820
33823
  return /iPhone|iPad|iPod|Android/i.test(t) || e;
33821
33824
  }
33822
- function fj(t, e) {
33825
+ function dj(t, e) {
33823
33826
  const n = t.includes("?") ? "&" : "?";
33824
33827
  return `${t}${n}uri=${encodeURIComponent(e)}`;
33825
33828
  }
@@ -33829,7 +33832,7 @@ function WE(t) {
33829
33832
  function ZE(t, e, n = "scheme") {
33830
33833
  if (typeof document > "u") return !1;
33831
33834
  const r = n === "universal" ? t.universal : t.scheme ?? t.universal;
33832
- return r ? (t5(fj(r, e)), !0) : !1;
33835
+ return r ? (t5(dj(r, e)), !0) : !1;
33833
33836
  }
33834
33837
  function XE(t) {
33835
33838
  typeof document > "u" || t.native && t5(t.native);
@@ -33838,7 +33841,7 @@ function t5(t, e) {
33838
33841
  const n = document.createElement("a");
33839
33842
  n.href = t, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n);
33840
33843
  }
33841
- function dj(t) {
33844
+ function hj(t) {
33842
33845
  return typeof document > "u" ? Promise.resolve(!1) : new Promise((e) => {
33843
33846
  let n = !1;
33844
33847
  const r = (f) => {
@@ -33850,40 +33853,42 @@ function dj(t) {
33850
33853
  const u = setTimeout(() => r(!1), t);
33851
33854
  });
33852
33855
  }
33853
- var QE = "lydianconnect.wc.topics", hj = 3e3, pj = class extends Zd {
33856
+ var QE = "lydianconnect.wc.topics", pj = 3e3, gj = class extends Zd {
33854
33857
  constructor(t, e) {
33855
- super(), this.app = t, this.options = e, this.type = "walletconnect", this.walletIds = [], this.client = null, this.topics = /* @__PURE__ */ new Map(), this.pending = /* @__PURE__ */ new Map(), this.links = { ...uj, ...e.walletLinks ?? {} };
33858
+ super(), this.app = t, this.options = e, this.type = "walletconnect", this.walletIds = [], this.client = null, this.topics = /* @__PURE__ */ new Map(), this.pending = /* @__PURE__ */ new Map(), this.links = { ...fj, ...e.walletLinks ?? {} };
33856
33859
  }
33857
33860
  isAvailable() {
33858
33861
  return !0;
33859
33862
  }
33860
33863
  async getClient() {
33861
33864
  if (this.client) return this.client;
33862
- const t = await Yq.init({
33865
+ const t = tj(), e = await Yq.init({
33863
33866
  projectId: this.options.projectId,
33864
33867
  metadata: {
33865
33868
  name: this.app.appName,
33866
33869
  description: this.app.description ?? this.app.appName,
33867
33870
  url: J3(),
33868
- icons: this.app.icon ? [this.app.icon] : []
33871
+ icons: this.app.icon ? [this.app.icon] : [],
33872
+ // Wallets may use this to return the user after deep-link approvals.
33873
+ ...t ? { redirect: { universal: t } } : {}
33869
33874
  },
33870
33875
  relayUrl: this.options.relayUrl
33871
33876
  });
33872
- return t.on("session_delete", ({ topic: e }) => {
33873
- const n = this.walletForTopic(e);
33874
- n && (this.topics.delete(n), this.persist(), this.emit({ type: "disconnect", walletId: n }));
33875
- }), t.on("session_event", ({ topic: e, params: n }) => {
33876
- const r = this.walletForTopic(e);
33877
- if (!r) return;
33878
- const { name: a, data: l } = n.event;
33879
- if (a === "chainChanged") {
33880
- const u = n.chainId.split(":")[0] ?? "eip155", f = typeof l == "string" && l.includes(":") ? l : `${u}:${String(l)}`;
33881
- this.emit({ type: "chainChanged", walletId: r, chainId: f });
33882
- } else if (a === "accountsChanged" && Array.isArray(l) && l[0]) {
33883
- const u = String(l[0]).split(":").pop() ?? "";
33884
- u && this.emit({ type: "accountsChanged", walletId: r, account: u });
33885
- }
33886
- }), this.client = t, this.load(), t;
33877
+ return e.on("session_delete", ({ topic: n }) => {
33878
+ const r = this.walletForTopic(n);
33879
+ r && (this.topics.delete(r), this.persist(), this.emit({ type: "disconnect", walletId: r }));
33880
+ }), e.on("session_event", ({ topic: n, params: r }) => {
33881
+ const a = this.walletForTopic(n);
33882
+ if (!a) return;
33883
+ const { name: l, data: u } = r.event;
33884
+ if (l === "chainChanged") {
33885
+ const f = r.chainId.split(":")[0] ?? "eip155", h = typeof u == "string" && u.includes(":") ? u : `${f}:${String(u)}`;
33886
+ this.emit({ type: "chainChanged", walletId: a, chainId: h });
33887
+ } else if (l === "accountsChanged" && Array.isArray(u) && u[0]) {
33888
+ const f = String(u[0]).split(":").pop() ?? "";
33889
+ f && this.emit({ type: "accountsChanged", walletId: a, account: f });
33890
+ }
33891
+ }), this.client = e, this.load(), e;
33887
33892
  }
33888
33893
  async connect(t) {
33889
33894
  const e = await this.getClient(), n = await this.tryReuse(e, t);
@@ -33898,7 +33903,7 @@ var QE = "lydianconnect.wc.topics", hj = 3e3, pj = class extends Zd {
33898
33903
  walletId: t.walletId,
33899
33904
  uri: r,
33900
33905
  deepLink: WE(l)
33901
- }), l && WE(l) && (this.pending.set(t.walletId, r), ZE(l, r), dj(this.options.openTimeoutMs ?? 2e3).then((d) => {
33906
+ }), l && WE(l) && (this.pending.set(t.walletId, r), ZE(l, r), hj(this.options.openTimeoutMs ?? 2e3).then((d) => {
33902
33907
  d || this.emit({
33903
33908
  type: "wallet_open_failed",
33904
33909
  walletId: t.walletId,
@@ -33939,7 +33944,7 @@ var QE = "lydianconnect.wc.topics", hj = 3e3, pj = class extends Zd {
33939
33944
  this.topics.delete(r);
33940
33945
  continue;
33941
33946
  }
33942
- const l = gj(a);
33947
+ const l = mj(a);
33943
33948
  l && n.push(this.toConnection(t, r, a, l));
33944
33949
  }
33945
33950
  return this.persist(), n;
@@ -34006,7 +34011,7 @@ var QE = "lydianconnect.wc.topics", hj = 3e3, pj = class extends Zd {
34006
34011
  return await Promise.race([
34007
34012
  t.ping({ topic: e }).then(() => !0).catch(() => !1),
34008
34013
  new Promise((l) => {
34009
- r = setTimeout(() => l(!1), hj);
34014
+ r = setTimeout(() => l(!1), pj);
34010
34015
  })
34011
34016
  ]).finally(() => clearTimeout(r)) ? n : void 0;
34012
34017
  }
@@ -34028,7 +34033,7 @@ var QE = "lydianconnect.wc.topics", hj = 3e3, pj = class extends Zd {
34028
34033
  }
34029
34034
  }
34030
34035
  };
34031
- function gj(t) {
34036
+ function mj(t) {
34032
34037
  const e = Object.keys(t.namespaces)[0];
34033
34038
  if (!e) return null;
34034
34039
  const n = t.namespaces[e];
@@ -34037,29 +34042,29 @@ function gj(t) {
34037
34042
  value: { chains: n.chains, methods: n.methods, events: n.events }
34038
34043
  } : null;
34039
34044
  }
34040
- function mj(t) {
34045
+ function yj(t) {
34041
34046
  const e = {};
34042
34047
  for (const n of ej)
34043
34048
  n.rdns && n.namespaces.includes("eip155") && !t.has(n.id) && (e[n.id] = n.rdns);
34044
34049
  return e;
34045
34050
  }
34046
- function yj(t) {
34051
+ function wj(t) {
34047
34052
  const e = {
34048
34053
  appName: t.appName,
34049
34054
  icon: t.icon,
34050
34055
  description: t.description
34051
- }, n = [new nj(e), new rj(e)], r = new Set(n.flatMap((a) => a.walletIds));
34056
+ }, n = [new ij(e), new sj(e)], r = new Set(n.flatMap((a) => a.walletIds));
34052
34057
  return [
34053
34058
  ...n,
34054
- new oj(mj(r)),
34055
- new pj(e, {
34059
+ new lj(yj(r)),
34060
+ new gj(e, {
34056
34061
  projectId: t.walletConnectProjectId
34057
34062
  })
34058
34063
  ];
34059
34064
  }
34060
- var wj = class {
34065
+ var bj = class {
34061
34066
  constructor(t) {
34062
- this.manager = new Wq(yj(t));
34067
+ this.manager = new Wq(wj(t));
34063
34068
  }
34064
34069
  init() {
34065
34070
  return this.manager.init();
@@ -34105,12 +34110,12 @@ var wj = class {
34105
34110
  return this.manager.on(t);
34106
34111
  }
34107
34112
  };
34108
- class bj {
34113
+ class vj {
34109
34114
  constructor() {
34110
34115
  this.client = null, this.unsubscribe = null, this.handlers = {};
34111
34116
  }
34112
34117
  async init(e, n) {
34113
- this.handlers = n, this.client = new wj({ appName: "Lydian", walletConnectProjectId: e }), this.unsubscribe = this.client.on((r) => this.dispatch(r)), await this.client.init(), await this.client.reset();
34118
+ this.handlers = n, this.client = new bj({ appName: "Lydian", walletConnectProjectId: e }), this.unsubscribe = this.client.on((r) => this.dispatch(r)), await this.client.init(), await this.client.reset();
34114
34119
  }
34115
34120
  dispatch(e) {
34116
34121
  var n, r, a, l, u, f, h, d, g, y;
@@ -34160,11 +34165,11 @@ class bj {
34160
34165
  (e = this.unsubscribe) == null || e.call(this), this.unsubscribe = null, (n = this.client) == null || n.reset(), this.client = null;
34161
34166
  }
34162
34167
  }
34163
- const vj = "open-button", n5 = "qr";
34164
- function Ej(t) {
34165
- return t.deepLink ? vj : n5;
34168
+ const Ej = "open-button", n5 = "qr";
34169
+ function xj(t) {
34170
+ return t.deepLink ? Ej : n5;
34166
34171
  }
34167
- function xj(t, e) {
34172
+ function Sj(t, e) {
34168
34173
  if (!(!t || !e)) {
34169
34174
  if (/(iPhone|iPad|iPod)/i.test(e))
34170
34175
  return t.ios;
@@ -34172,7 +34177,7 @@ function xj(t, e) {
34172
34177
  return t.android;
34173
34178
  }
34174
34179
  }
34175
- function Sj({
34180
+ function _j({
34176
34181
  store: t,
34177
34182
  presentation: e,
34178
34183
  screenNavigator: n,
@@ -34241,12 +34246,12 @@ function Sj({
34241
34246
  const X = (R = l()) == null ? void 0 : R.walletConnectProjectId;
34242
34247
  if (!d().walletConnectFlow || !X)
34243
34248
  return;
34244
- const te = new bj();
34249
+ const te = new vj();
34245
34250
  try {
34246
34251
  await te.init(X, {
34247
34252
  onDisplayUri: (j, C) => {
34248
34253
  if (d().selectedWallet) {
34249
- if (B(j), Ej({ deepLink: C }) === n5) {
34254
+ if (B(j), xj({ deepLink: C }) === n5) {
34250
34255
  L();
34251
34256
  return;
34252
34257
  }
@@ -34256,7 +34261,7 @@ function Sj({
34256
34261
  onWalletOpenFailed: (j, C) => {
34257
34262
  d().selectedWallet && h({
34258
34263
  type: "connect/openFailed",
34259
- installHref: xj(C, navigator.userAgent) ?? null
34264
+ installHref: Sj(C, navigator.userAgent) ?? null
34260
34265
  });
34261
34266
  },
34262
34267
  onDisconnect: () => {
@@ -34350,7 +34355,7 @@ function Sj({
34350
34355
  }
34351
34356
  };
34352
34357
  }
34353
- function _j({
34358
+ function Aj({
34354
34359
  store: t,
34355
34360
  screenNavigator: e,
34356
34361
  paymentFlow: n,
@@ -34400,7 +34405,7 @@ function _j({
34400
34405
  }
34401
34406
  };
34402
34407
  }
34403
- async function Aj(t, e) {
34408
+ async function Tj(t, e) {
34404
34409
  var r;
34405
34410
  const n = (r = globalThis.navigator) == null ? void 0 : r.clipboard;
34406
34411
  if (!n)
@@ -34411,19 +34416,19 @@ async function Aj(t, e) {
34411
34416
  return "manual";
34412
34417
  }
34413
34418
  }
34414
- const Tj = 1500;
34415
- function Dj(t, e) {
34416
- t && (t.innerText = e, t.classList.remove("hidden"), setTimeout(() => t.classList.add("hidden"), Tj));
34419
+ const Dj = 1500;
34420
+ function Cj(t, e) {
34421
+ t && (t.innerText = e, t.classList.remove("hidden"), setTimeout(() => t.classList.add("hidden"), Dj));
34417
34422
  }
34418
34423
  async function i5({
34419
34424
  value: t,
34420
34425
  bubble: e,
34421
34426
  copiedText: n = re("copy.copied")
34422
34427
  }) {
34423
- const r = await Aj(t);
34424
- Dj(e, r === "copied" ? n : re("copy.pressToCopy"));
34428
+ const r = await Tj(t);
34429
+ Cj(e, r === "copied" ? n : re("copy.pressToCopy"));
34425
34430
  }
34426
- function Cj({
34431
+ function Oj({
34427
34432
  store: t,
34428
34433
  shadowRoot: e,
34429
34434
  screenNavigator: n,
@@ -34541,7 +34546,7 @@ function Cj({
34541
34546
  }
34542
34547
  };
34543
34548
  }
34544
- function Oj({
34549
+ function Nj({
34545
34550
  shadowRoot: t,
34546
34551
  hostCallbacks: e,
34547
34552
  store: n,
@@ -34666,7 +34671,7 @@ function Oj({
34666
34671
  reportFailure: y,
34667
34672
  closeRestoreDialog: () => d.close("restoreDetails")
34668
34673
  }
34669
- }), P = Sj({
34674
+ }), P = _j({
34670
34675
  store: n,
34671
34676
  presentation: k,
34672
34677
  screenNavigator: r,
@@ -34678,7 +34683,7 @@ function Oj({
34678
34683
  reportFailure: y,
34679
34684
  setProcessingMessage: ({ message: X = null, subMessage: te = null, cancellable: R = !0 }) => a({ type: "processing/prompt", message: X, subMessage: te, cancellable: R })
34680
34685
  }
34681
- }), Q = _j({
34686
+ }), Q = Aj({
34682
34687
  store: n,
34683
34688
  screenNavigator: r,
34684
34689
  paymentFlow: L,
@@ -34687,7 +34692,7 @@ function Oj({
34687
34692
  getDialogs: () => d,
34688
34693
  getOptions: () => u,
34689
34694
  emit: h
34690
- }), ee = Cj({
34695
+ }), ee = Oj({
34691
34696
  store: n,
34692
34697
  shadowRoot: t,
34693
34698
  screenNavigator: r,
@@ -34741,7 +34746,7 @@ function Oj({
34741
34746
  }
34742
34747
  };
34743
34748
  }
34744
- function Nj() {
34749
+ function Ij() {
34745
34750
  const { shadowRoot: t } = l0();
34746
34751
  T.useLayoutEffect(() => {
34747
34752
  const e = (n) => {
@@ -34761,7 +34766,7 @@ function Nj() {
34761
34766
  return t.addEventListener("click", e), () => t.removeEventListener("click", e);
34762
34767
  }, [t]);
34763
34768
  }
34764
- function Ij() {
34769
+ function Rj() {
34765
34770
  const { shadowRoot: t, host: e, dialogs: n } = l0(), r = Be((a) => a.processingVisible);
34766
34771
  T.useLayoutEffect(() => {
34767
34772
  var a;
@@ -34772,7 +34777,7 @@ function Ij() {
34772
34777
  e.classList.remove("lydian-loading-fill"), n.setNarrow(!1);
34773
34778
  }, [r, t, e, n]);
34774
34779
  }
34775
- function Rj() {
34780
+ function kj() {
34776
34781
  var l, u, f;
34777
34782
  const { host: t } = l0(), e = Be((h) => {
34778
34783
  var d;
@@ -34787,10 +34792,10 @@ function Rj() {
34787
34792
  return h.rel = "stylesheet", h.href = a, document.head.appendChild(h), () => h.remove();
34788
34793
  }, [a]);
34789
34794
  }
34790
- function kj() {
34795
+ function Mj() {
34791
34796
  return T.useMemo(vA, []);
34792
34797
  }
34793
- function Mj(t) {
34798
+ function Bj(t) {
34794
34799
  const e = ga(t);
34795
34800
  let n = null, r = null;
34796
34801
  const a = () => t.getState().isCheckoutSettled, l = () => t.getState().assetFirstFlow, u = () => {
@@ -34829,8 +34834,8 @@ function Mj(t) {
34829
34834
  stashKycDraft: f
34830
34835
  };
34831
34836
  }
34832
- function Bj(t) {
34833
- return T.useMemo(() => Mj(t), [t]);
34837
+ function Uj(t) {
34838
+ return T.useMemo(() => Bj(t), [t]);
34834
34839
  }
34835
34840
  const r5 = T.createContext(null);
34836
34841
  function l0() {
@@ -34839,14 +34844,14 @@ function l0() {
34839
34844
  throw new Error("Orchestration hooks must be used inside <CheckoutEngine>.");
34840
34845
  return t;
34841
34846
  }
34842
- function Uj({
34847
+ function zj({
34843
34848
  host: t,
34844
34849
  shadowRoot: e,
34845
34850
  targets: n,
34846
34851
  ref: r
34847
34852
  }) {
34848
- const a = kj(), l = T.useMemo(V8, []), u = Bj(l), f = T.useRef(null);
34849
- f.current ?? (f.current = Oj({
34853
+ const a = Mj(), l = T.useMemo(V8, []), u = Uj(l), f = T.useRef(null);
34854
+ f.current ?? (f.current = Nj({
34850
34855
  shadowRoot: e,
34851
34856
  hostCallbacks: a,
34852
34857
  store: l,
@@ -34871,20 +34876,20 @@ function Uj({
34871
34876
  }),
34872
34877
  [e, t, n, h]
34873
34878
  );
34874
- return /* @__PURE__ */ T.createElement(zj, { store: l, callbacks: h.callbacks, runtime: d, targets: n });
34879
+ return /* @__PURE__ */ T.createElement(Lj, { store: l, callbacks: h.callbacks, runtime: d, targets: n });
34875
34880
  }
34876
- function zj({
34881
+ function Lj({
34877
34882
  store: t,
34878
34883
  callbacks: e,
34879
34884
  runtime: n,
34880
34885
  targets: r
34881
34886
  }) {
34882
- return /* @__PURE__ */ T.createElement(F8, { store: t, callbacks: e }, /* @__PURE__ */ T.createElement(r5.Provider, { value: n }, /* @__PURE__ */ T.createElement(Lj, null), /* @__PURE__ */ T.createElement(LT, { targets: r })));
34887
+ return /* @__PURE__ */ T.createElement(F8, { store: t, callbacks: e }, /* @__PURE__ */ T.createElement(r5.Provider, { value: n }, /* @__PURE__ */ T.createElement($j, null), /* @__PURE__ */ T.createElement(LT, { targets: r })));
34883
34888
  }
34884
- function Lj() {
34885
- return Nj(), Ij(), Rj(), null;
34889
+ function $j() {
34890
+ return Ij(), Rj(), kj(), null;
34886
34891
  }
34887
- function $j({
34892
+ function Pj({
34888
34893
  host: t,
34889
34894
  shadowRoot: e,
34890
34895
  targets: n
@@ -34893,7 +34898,7 @@ function $j({
34893
34898
  try {
34894
34899
  if (Ga.flushSync(() => {
34895
34900
  r.render(
34896
- /* @__PURE__ */ T.createElement(Uj, { ref: a, host: t, shadowRoot: e, targets: n })
34901
+ /* @__PURE__ */ T.createElement(zj, { ref: a, host: t, shadowRoot: e, targets: n })
34897
34902
  );
34898
34903
  }), !a.current)
34899
34904
  throw new Error("Checkout engine did not mount.");
@@ -34902,7 +34907,7 @@ function $j({
34902
34907
  }
34903
34908
  return { engine: a.current, unmount: () => r.unmount() };
34904
34909
  }
34905
- function Pj({
34910
+ function qj({
34906
34911
  host: t,
34907
34912
  shadowRoot: e
34908
34913
  }) {
@@ -34910,7 +34915,7 @@ function Pj({
34910
34915
  const { targets: n, missing: r } = v8(e);
34911
34916
  if (!n)
34912
34917
  throw new Error(`Checkout template is missing React mount targets: ${r.join(", ")}`);
34913
- const a = $j({ host: t, shadowRoot: e, targets: n }), l = a.engine;
34918
+ const a = Pj({ host: t, shadowRoot: e, targets: n }), l = a.engine;
34914
34919
  return {
34915
34920
  initialize(u, f) {
34916
34921
  return w8(e, u), l.initialize(u, f);
@@ -34920,17 +34925,17 @@ function Pj({
34920
34925
  unmount: () => a.unmount()
34921
34926
  };
34922
34927
  }
34923
- const IH = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
34928
+ const RH = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
34924
34929
  __proto__: null,
34925
- mountCheckoutEngine: Pj
34930
+ mountCheckoutEngine: qj
34926
34931
  }, Symbol.toStringTag, { value: "Module" }));
34927
34932
  export {
34928
34933
  UC as I,
34929
34934
  al as b,
34930
34935
  Yo as c,
34931
34936
  hx as g,
34932
- Gj as h,
34937
+ Yj as h,
34933
34938
  fd as i,
34934
- IH as m,
34939
+ RH as m,
34935
34940
  Ud as s
34936
34941
  };
package/dist/lydian.js CHANGED
@@ -1 +1 @@
1
- import "./chunks/index-BhtU_AAG.js";
1
+ import "./chunks/index-D3Zl7b5P.js";