@lydianpay/sdk-web 3.16.0 → 3.17.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.
@@ -1,4 +1,4 @@
1
- import { g as c } from "./mountEngine-B9qRQyLg.js";
1
+ import { g as c } from "./mountEngine-Dv4yxjrJ.js";
2
2
  function f(t, i) {
3
3
  for (var o = 0; o < i.length; o++) {
4
4
  const e = i[o];
@@ -1,8 +1,8 @@
1
1
  var Va = Object.defineProperty;
2
2
  var Ka = (e, t, r) => t in e ? Va(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var Ee = (e, t, r) => Ka(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { E as Ja } from "./index-Bwl_cWLK.js";
5
- import { g as ri, c as gr } from "./mountEngine-B9qRQyLg.js";
4
+ import { E as Ja } from "./index-DPMWeBay.js";
5
+ import { g as ri, c as gr } from "./mountEngine-Dv4yxjrJ.js";
6
6
  var _r = { exports: {} }, on, Hi;
7
7
  function Ya() {
8
8
  if (Hi) return on;
@@ -7879,7 +7879,7 @@ var Cn, Rs, Is, Fs, qe, gt, _t, xr, Bs, Os, Cr, zt, Ps, Ns, Ds, ta, ra = V({
7879
7879
  }
7880
7880
  getActiveSession() {
7881
7881
  return S(this, null, function* () {
7882
- const { kvstore: e } = this, { SessionStore: t } = yield import("./index-CD8P_mOo.js").then((n) => n.i), r = yield t.create(e);
7882
+ const { kvstore: e } = this, { SessionStore: t } = yield import("./index-DtsHVAzb.js").then((n) => n.i), r = yield t.create(e);
7883
7883
  try {
7884
7884
  const [n] = yield r.list();
7885
7885
  return n;
@@ -8058,7 +8058,7 @@ Xr(na, {
8058
8058
  });
8059
8059
  function Qd() {
8060
8060
  return S(this, null, function* () {
8061
- const { decrypt: e, encrypt: t, PrivateKey: r, PublicKey: n } = yield import("./index-DAsQ6TuK.js").then((i) => i.i);
8061
+ const { decrypt: e, encrypt: t, PrivateKey: r, PublicKey: n } = yield import("./index-CwLxCtBs.js").then((i) => i.i);
8062
8062
  return {
8063
8063
  generateKeyPair() {
8064
8064
  const i = new r();
@@ -9329,12 +9329,12 @@ Ta = function() {
9329
9329
  Ui = function() {
9330
9330
  return S(this, null, function* () {
9331
9331
  const [e, { DappClient: t }, { createKeyManager: r }] = yield Promise.all([
9332
- import("./index-CD8P_mOo.js").then((h) => h.i),
9333
- import("./index-DFLPr81C.js"),
9332
+ import("./index-DtsHVAzb.js").then((h) => h.i),
9333
+ import("./index-BtfXd3M2.js"),
9334
9334
  Promise.resolve().then(() => (eh(), na))
9335
9335
  ]), n = yield r(), { adapter: i } = this.options.storage, o = yield e.SessionStore.create(i), l = (
9336
9336
  // eslint-disable-next-line no-negated-condition
9337
- typeof window < "u" ? WebSocket : (yield import("./browser-CvvbM3fl.js").then((h) => h.b)).WebSocket
9337
+ typeof window < "u" ? WebSocket : (yield import("./browser-D-wITOYv.js").then((h) => h.b)).WebSocket
9338
9338
  ), c = yield e.WebSocketTransport.create({
9339
9339
  url: uh,
9340
9340
  kvstore: i,
@@ -9399,7 +9399,7 @@ Ba = function(e, t, r, n) {
9399
9399
  /* MWP */
9400
9400
  );
9401
9401
  })).catch((c) => S(this, null, function* () {
9402
- const { ProtocolError: d, ErrorCode: h } = yield import("./index-CD8P_mOo.js").then((y) => y.i);
9402
+ const { ProtocolError: d, ErrorCode: h } = yield import("./index-DtsHVAzb.js").then((y) => y.i);
9403
9403
  if (c instanceof d)
9404
9404
  c.code !== h.REQUEST_EXPIRED && (this.status = "disconnected", yield this.options.ui.factory.unload(c), i.reject(c));
9405
9405
  else {
@@ -9456,7 +9456,7 @@ Pa = function(e, t, r) {
9456
9456
  /* MWP */
9457
9457
  );
9458
9458
  } catch (i) {
9459
- const { ProtocolError: o } = yield import("./index-CD8P_mOo.js").then((l) => l.i);
9459
+ const { ProtocolError: o } = yield import("./index-DtsHVAzb.js").then((l) => l.i);
9460
9460
  throw this.status = "disconnected", yield this.storage.removeTransportType(), i instanceof o || i instanceof Error ? i : new Error(String(i));
9461
9461
  } finally {
9462
9462
  this.dappClient.off("session_request", n);
@@ -1,9 +1,9 @@
1
1
  var f = Object.defineProperty;
2
2
  var S = (e, t, n) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var h = (e, t, n) => S(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { d as s } from "./index-CD8P_mOo.js";
5
- import { v as w } from "./connect-multichain-JrYKtq5o.js";
6
- import { a as l } from "./mountEngine-B9qRQyLg.js";
4
+ import { d as s } from "./index-DtsHVAzb.js";
5
+ import { v as w } from "./connect-multichain-BhbBjXAb.js";
6
+ import { a as l } from "./mountEngine-Dv4yxjrJ.js";
7
7
  function m(e) {
8
8
  var t, n;
9
9
  return typeof ((n = (t = e == null ? void 0 : e.prototype) == null ? void 0 : t.constructor) == null ? void 0 : n.name) == "string";
@@ -1,6 +1,6 @@
1
- import { i as Te, I as Xe, h as et, g as yn, b as vn, s as kn } from "./mountEngine-B9qRQyLg.js";
1
+ import { i as Te, I as Xe, h as et, g as yn, b as vn, s as kn } from "./mountEngine-Dv4yxjrJ.js";
2
2
  import { r as En, a as In } from "./utils-Ca8X9WUu.js";
3
- import { E as Cn } from "./index-Bwl_cWLK.js";
3
+ import { E as Cn } from "./index-DPMWeBay.js";
4
4
  function Sn(t, e) {
5
5
  if (!Te(t, { strict: !1 }))
6
6
  throw new Xe({ address: t });
@@ -1,4 +1,4 @@
1
- import { g as cn } from "./mountEngine-B9qRQyLg.js";
1
+ import { g as cn } from "./mountEngine-Dv4yxjrJ.js";
2
2
  import { a as Ot, r as an } from "./utils-Ca8X9WUu.js";
3
3
  function fn(t, f) {
4
4
  for (var y = 0; y < f.length; y++) {
@@ -1,4 +1,4 @@
1
- import { g as L } from "./mountEngine-B9qRQyLg.js";
1
+ import { g as L } from "./mountEngine-Dv4yxjrJ.js";
2
2
  var x = { exports: {} }, E;
3
3
  function C() {
4
4
  return E || (E = 1, (function(g) {
@@ -1,5 +1,5 @@
1
- import { d as Si, g as wi } from "./mountEngine-B9qRQyLg.js";
2
- import { r as Ti } from "./index-Bwl_cWLK.js";
1
+ import { d as Si, g as wi } from "./mountEngine-Dv4yxjrJ.js";
2
+ import { r as Ti } from "./index-DPMWeBay.js";
3
3
  function Pi(r, u) {
4
4
  for (var f = 0; f < u.length; f++) {
5
5
  const h = u[f];
@@ -1,8 +1,8 @@
1
- const v = ["USD", "TRY", "PHP"];
1
+ const E = ["USD", "TRY", "PHP"];
2
2
  function U(e) {
3
- return typeof e == "string" && v.includes(e);
3
+ return typeof e == "string" && E.includes(e);
4
4
  }
5
- function d(e) {
5
+ function u(e) {
6
6
  return "sessionID" in e && typeof e.sessionID == "string" && e.sessionID.length > 0;
7
7
  }
8
8
  class O extends Error {
@@ -14,7 +14,7 @@ class O extends Error {
14
14
  super(t, { cause: n }), this.name = "GatewayRequestError", this.errorCode = a;
15
15
  }
16
16
  }
17
- async function m(e) {
17
+ async function h(e) {
18
18
  const t = await e.clone().json().catch(() => null);
19
19
  return new O({
20
20
  statusText: e.statusText,
@@ -44,7 +44,7 @@ class p {
44
44
  const n = `${this.baseUri}${t}`, o = this.headers({ "Content-Type": "application/json" }), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
45
45
  if (s.ok)
46
46
  return await s.json();
47
- throw await m(s);
47
+ throw await h(s);
48
48
  }
49
49
  // For endpoints that reply text/plain rather than JSON (e.g. PATCH
50
50
  // /customer/otp -> "OTP sent"). Sends the same JSON request headers but does
@@ -53,17 +53,34 @@ class p {
53
53
  const n = `${this.baseUri}${t}`, o = this.headers({ "Content-Type": "application/json" }), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
54
54
  if (s.ok)
55
55
  return await s.text();
56
- throw await m(s);
56
+ throw await h(s);
57
57
  }
58
58
  async requestWithFormData(t, a) {
59
59
  const n = `${this.baseUri}${t}`, o = this.headers(), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
60
60
  if (s.ok)
61
61
  return await s.json();
62
- throw await m(s);
63
- }
64
- }
65
- const c = "transaction";
66
- class W extends p {
62
+ throw await h(s);
63
+ }
64
+ }
65
+ const c = "transaction", W = [
66
+ "firstName",
67
+ "lastName",
68
+ "email",
69
+ "street",
70
+ "city",
71
+ "region",
72
+ "postalCode",
73
+ "country",
74
+ "yearOfBirth",
75
+ "monthOfBirth",
76
+ "dayOfBirth",
77
+ "cityOfBirth",
78
+ "regionOfBirth",
79
+ "countryOfBirth",
80
+ "nationalIDNumber",
81
+ "customerIDNumber"
82
+ ];
83
+ class $ extends p {
67
84
  async getCryptoTransaction(t) {
68
85
  return await this.request(`/${c}/${t}`);
69
86
  }
@@ -105,7 +122,12 @@ class W extends p {
105
122
  }
106
123
  async kycVerification(t, a) {
107
124
  const n = new FormData();
108
- return n.append("asset", a.asset), n.append("network", a.network), n.append("firstName", a.firstName), n.append("lastName", a.lastName), n.append("email", a.email), n.append("street", a.street), n.append("city", a.city), n.append("region", a.region), n.append("postalCode", a.postalCode), n.append("country", a.country), n.append("storeKYC", a.storeKYC ? "true" : "false"), a.customerUUID && n.append("customerUUID", a.customerUUID), a.walletAddress && n.append("walletAddress", a.walletAddress), a.documentType && n.append("documentType", a.documentType), a.documentFiles.forEach((o) => n.append("documentFiles", o)), await this.requestWithFormData(
125
+ return n.append("asset", a.asset), n.append("network", a.network), W.forEach((o) => {
126
+ const r = a[o];
127
+ r && n.append(o, r);
128
+ }), n.append("storeKYC", a.storeKYC ? "true" : "false"), a.customerUUID && n.append("customerUUID", a.customerUUID), a.walletAddress && n.append("walletAddress", a.walletAddress), a.documentType && n.append("documentType", a.documentType), a.documentFiles.forEach(
129
+ (o, r) => n.append("documentFiles", o, `${r + 1}-${o.name}`)
130
+ ), await this.requestWithFormData(
109
131
  `/${c}/${t}/verification`,
110
132
  {
111
133
  method: "POST",
@@ -114,7 +136,7 @@ class W extends p {
114
136
  );
115
137
  }
116
138
  }
117
- function $(e, t) {
139
+ function Y(e, t) {
118
140
  t.forEach((a) => {
119
141
  Object.getOwnPropertyNames(a.prototype).forEach((n) => {
120
142
  const o = Object.getOwnPropertyDescriptor(a.prototype, n);
@@ -140,7 +162,7 @@ class x extends p {
140
162
  }
141
163
  }
142
164
  const l = "session";
143
- class M extends p {
165
+ class B extends p {
144
166
  async createSession(t) {
145
167
  return await this.request(`/${l}`, {
146
168
  method: "POST",
@@ -176,11 +198,11 @@ class M extends p {
176
198
  });
177
199
  }
178
200
  }
179
- class E extends p {
201
+ class S extends p {
180
202
  }
181
- $(E, [W, x, M]);
182
- const Y = E;
183
- var u = {
203
+ Y(S, [$, x, B]);
204
+ const M = S;
205
+ var d = {
184
206
  COMPLIANCE_PENDING: -10,
185
207
  API_CANCELLED: -9,
186
208
  PAYMENT_TIMEOUT: -8,
@@ -197,21 +219,21 @@ var u = {
197
219
  FRAUD: -1,
198
220
  PENDING: 0,
199
221
  SUCCESS: 1
200
- }, se = {
222
+ }, ie = {
201
223
  PARTIALLY_PAID: 1,
202
224
  OVERPAID: 3
203
- }, B = {
225
+ }, G = {
204
226
  PENDING: 0,
205
227
  CONFIRMED: 1
206
- }, h = {
228
+ }, m = {
207
229
  dev: "https://api.lydian.dev",
208
230
  sandbox: "https://api.sandbox.lydian.com",
209
231
  prod: "https://api.lydian.com"
210
232
  };
211
- function G(e) {
212
- return e.gatewayUrl ? new URL(e.gatewayUrl).origin : e.dev ? h.dev : e.sandbox ? h.sandbox : h.prod;
233
+ function _(e) {
234
+ return e.gatewayUrl ? new URL(e.gatewayUrl).origin : e.dev ? m.dev : e.sandbox ? m.sandbox : m.prod;
213
235
  }
214
- function S({
236
+ function v({
215
237
  options: e,
216
238
  unsupportedKeys: t,
217
239
  entryPoint: a
@@ -235,18 +257,18 @@ function q(e) {
235
257
  }
236
258
  return (t.protocol === "http:" || t.protocol === "https:") && t.pathname === "/" && t.search === "" && t.hash === "";
237
259
  }
238
- function ie(e) {
239
- return e !== null && !d(e) && !!e.publishableKey;
240
- }
241
260
  function ce(e) {
242
- return e !== null && !d(e);
261
+ return e !== null && !u(e) && !!e.publishableKey;
243
262
  }
244
- function le({
263
+ function le(e) {
264
+ return e !== null && !u(e);
265
+ }
266
+ function ue({
245
267
  options: e,
246
268
  session: t,
247
269
  settled: a
248
270
  }) {
249
- return !a && t !== null && e !== null && d(e);
271
+ return !a && t !== null && e !== null && u(e);
250
272
  }
251
273
  function A(e, t, a) {
252
274
  try {
@@ -266,59 +288,59 @@ function y(e) {
266
288
  }
267
289
  return t.protocol === "https:" || t.protocol === "http:" ? e : void 0;
268
290
  }
269
- async function _({
291
+ async function j({
270
292
  api: e,
271
293
  options: t,
272
294
  emit: a
273
295
  }) {
274
296
  try {
275
- const n = await H({ api: e, options: t }), { session: o, sessionPromoted: r } = await K({ api: e, sessionID: n });
276
- a("session.loaded", z(o));
277
- const s = await J({
297
+ const n = await K({ api: e, options: t }), { session: o, sessionPromoted: r } = await z({ api: e, sessionID: n });
298
+ a("session.loaded", J(o));
299
+ const s = await Q({
278
300
  api: e,
279
301
  transactionID: o.transactionID
280
302
  });
281
303
  return { ok: !0, session: o, sessionPromoted: r, linkedTransaction: s };
282
304
  } catch (n) {
283
- return { ok: !1, ...await j(n) };
305
+ return { ok: !1, ...await H(n) };
284
306
  }
285
307
  }
286
- async function j(e) {
308
+ async function H(e) {
287
309
  const t = e instanceof Error ? e.cause : void 0;
288
310
  if (!(t instanceof Response && t.status === 404))
289
311
  return {};
290
312
  try {
291
313
  const n = await t.json();
292
314
  return {
293
- failureURL: P(n == null ? void 0 : n.failureURL),
294
- cancelURL: P(n == null ? void 0 : n.cancelURL)
315
+ failureURL: k(n == null ? void 0 : n.failureURL),
316
+ cancelURL: k(n == null ? void 0 : n.cancelURL)
295
317
  };
296
318
  } catch {
297
319
  return {};
298
320
  }
299
321
  }
300
- function P(e) {
322
+ function k(e) {
301
323
  return typeof e == "string" ? y(e) : void 0;
302
324
  }
303
- async function H({
325
+ async function K({
304
326
  api: e,
305
327
  options: t
306
328
  }) {
307
- return d(t) ? t.sessionID : (await e.createSession({
329
+ return u(t) ? t.sessionID : (await e.createSession({
308
330
  amount: t.transaction.amount,
309
331
  amountCurrency: t.transaction.currency,
310
332
  descriptor: t.transaction.descriptor,
311
333
  referenceNumber: t.transaction.referenceNumber
312
334
  })).sessionID;
313
335
  }
314
- async function K({
336
+ async function z({
315
337
  api: e,
316
338
  sessionID: t
317
339
  }) {
318
340
  const a = await e.getSession(t);
319
341
  return { session: a, sessionPromoted: I(a) };
320
342
  }
321
- function z(e) {
343
+ function J(e) {
322
344
  return {
323
345
  sessionID: e.sessionID,
324
346
  merchantName: e.merchantName,
@@ -328,7 +350,7 @@ function z(e) {
328
350
  function I(e) {
329
351
  return !!e.transactionID;
330
352
  }
331
- async function J({
353
+ async function Q({
332
354
  api: e,
333
355
  transactionID: t
334
356
  }) {
@@ -340,7 +362,7 @@ async function J({
340
362
  return console.error("Failed to resolve the session transaction:", a), null;
341
363
  }
342
364
  }
343
- function k({
365
+ function P({
344
366
  message: e,
345
367
  reason: t,
346
368
  shouldEndCheckout: a,
@@ -360,7 +382,7 @@ function k({
360
382
  }
361
383
  };
362
384
  }
363
- const Q = {
385
+ const X = {
364
386
  "common.cancelTransaction": "Cancel Transaction",
365
387
  "common.cancel": "Cancel",
366
388
  "common.back": "Back",
@@ -423,11 +445,13 @@ const Q = {
423
445
  "network.noNetworksAvailable": "No networks are available for this payment. Contact the merchant if you think this is wrong.",
424
446
  "network.recommended": "RECOMMENDED",
425
447
  "network.fee": "Network fee: {fee}",
426
- "kyc.additionalInfoRequired": "Additional info required",
448
+ "kyc.yourDetails": "Your details",
449
+ "kyc.yourDetailsDescription": "This information is required to comply with applicable regulations.",
450
+ "kyc.groupHeading": "Customer Identity",
451
+ "kyc.groupGuidance": "Complete {required} of the {total} fields below to continue.",
452
+ "kyc.groupGuidanceAcrossForm": "Complete {required} of the {total} identity details to continue ({completed} done).",
453
+ "kyc.groupComplete": "You've completed this section.",
427
454
  "kyc.complianceWaiting": "Your details are being verified. This can take a few moments.",
428
- "kyc.stepBasic": "Basic details",
429
- "kyc.stepAddress": "Address",
430
- "kyc.stepDocument": "Verification document",
431
455
  "kyc.firstNamesLabel": "Legal first name",
432
456
  "kyc.firstNamesPlaceholder": "Enter legal first name",
433
457
  "kyc.lastNameLabel": "Legal last name",
@@ -440,6 +464,16 @@ const Q = {
440
464
  "kyc.regionPlaceholder": "Enter state or region",
441
465
  "kyc.postalCodeLabel": "ZIP / Postal code",
442
466
  "kyc.postalCodePlaceholder": "Enter ZIP or postal code",
467
+ "kyc.walletAddressLabel": "Wallet address",
468
+ "kyc.walletAddressPlaceholder": "Enter wallet address",
469
+ "kyc.dateOfBirthLabel": "Date of birth",
470
+ "kyc.cityOfBirthLabel": "City of birth",
471
+ "kyc.regionOfBirthLabel": "State / Region of birth",
472
+ "kyc.countryOfBirthLabel": "Country of birth",
473
+ "kyc.nationalIdLabel": "National identity number",
474
+ "kyc.nationalIdPlaceholder": "Enter national ID number",
475
+ "kyc.customerIdLabel": "Customer identification number",
476
+ "kyc.customerIdPlaceholder": "Enter customer ID number",
443
477
  "kyc.documentTypeLabel": "Document type",
444
478
  "kyc.documentTypeAria": "Document Type",
445
479
  "kyc.docTypeIdCard": "Identity (ID) Card",
@@ -577,25 +611,18 @@ const Q = {
577
611
  "errors.walletSignedNotSent": "Your wallet signed the payment, but it couldn’t be sent. You can still pay by scanning the code below.",
578
612
  "errors.unableToCreateCryptoTransaction": "We couldn't set up your payment. Please try again, or choose a different coin.",
579
613
  "errors.cryptoTransactionNotCreated": "Your payment hasn’t been set up yet. Choose a coin and network to continue.",
614
+ "errors.unsupportedRequirements": "We can't collect the details this payment needs. Please contact support.",
615
+ "errors.verificationRejected": "We couldn't verify your identity, so this payment can't continue. Please contact support.",
580
616
  "errors.unableToVerifyDetails": "We could not verify your details. Please try again or contact support.",
581
617
  "errors.unableToRestoreDetails": "Unable to restore your details. Please try again.",
582
618
  "errors.couldNotRestoreDetails": "We could not restore your details. Please try again or contact support.",
583
- "validation.emailRequired": "Please enter your email address.",
584
- "validation.firstNameRequired": "Please enter your legal first name.",
585
- "validation.lastNameRequired": "Please enter your legal last name.",
586
- "validation.countryRequired": "Please select your country.",
587
- "validation.streetRequired": "Please enter your street address.",
588
- "validation.cityRequired": "Please enter your city.",
589
- "validation.regionRequired": "Please enter your state or region.",
590
- "validation.postalCodeRequired": "Please enter your ZIP or postal code.",
591
- "validation.documentFrontRequired": "Please upload the front image of the document.",
592
- "validation.documentBackRequired": "Please upload the back image of the document.",
593
619
  "validation.emailOrCountryMissing": "Email or country is missing.",
594
620
  "validation.invalidEmail": "Please enter a valid email address.",
621
+ "validation.invalidDateOfBirth": "Please enter a valid date of birth.",
595
622
  "validation.customerDetailsMissing": "Customer details are missing.",
596
623
  "validation.invalidOtp": "Please enter a valid 6-digit code.",
597
624
  "terms.notice": 'By continuing, you agree to Lydian <a href="https://lydian.com/privacy" target="_blank" rel="noopener noreferrer">Terms and Conditions</a> and understand your data will be processed according to the <a href="https://lydian.com/privacy" target="_blank" rel="noopener noreferrer">Privacy Notice</a>.'
598
- }, T = { en: Q }, L = "en";
625
+ }, T = { en: X }, L = "en";
599
626
  let R = L;
600
627
  function de() {
601
628
  return R;
@@ -609,9 +636,9 @@ function w(e, t) {
609
636
  ) : a;
610
637
  }
611
638
  function Z(e) {
612
- return e === u.SUCCESS ? "succeeded" : e < u.PENDING && e !== u.KYC_VERIFICATION_PENDING && e !== u.COMPLIANCE_PENDING ? "failed" : "active";
639
+ return e === d.SUCCESS ? "succeeded" : e < d.PENDING && e !== d.KYC_VERIFICATION_PENDING && e !== d.COMPLIANCE_PENDING ? "failed" : "active";
613
640
  }
614
- function X({
641
+ function V({
615
642
  transaction: e,
616
643
  session: t
617
644
  }) {
@@ -632,7 +659,7 @@ function X({
632
659
  }
633
660
  };
634
661
  const n = (o = e.payments) == null ? void 0 : o.find(
635
- (i) => i.status === B.CONFIRMED
662
+ (i) => i.status === G.CONFIRMED
636
663
  );
637
664
  return {
638
665
  outcome: a,
@@ -652,7 +679,7 @@ function X({
652
679
  }
653
680
  };
654
681
  }
655
- function V() {
682
+ function ee() {
656
683
  let e = null;
657
684
  return {
658
685
  setOptions: (t) => {
@@ -673,7 +700,7 @@ function V() {
673
700
  }
674
701
  };
675
702
  }
676
- class ee extends HTMLElement {
703
+ class te extends HTMLElement {
677
704
  constructor() {
678
705
  super(), this.engine = null, this.engineLoadPromise = null, this.isTornDown = !1, this.shadow = this.attachShadow({ mode: "open" });
679
706
  }
@@ -683,7 +710,7 @@ class ee extends HTMLElement {
683
710
  this.isTornDown = !1;
684
711
  }
685
712
  async initialize(t) {
686
- const a = te(t), n = ae({ api: a, options: t }), o = await this.loadEngine(t, n);
713
+ const a = ae(t), n = ne({ api: a, options: t }), o = await this.loadEngine(t, n);
687
714
  !o || this.isTornDown || (this.engine = o, await o.initialize(t, { api: a, sessionLoad: n }));
688
715
  }
689
716
  async loadEngine(t, a) {
@@ -711,7 +738,7 @@ class ee extends HTMLElement {
711
738
  // Not started in the constructor: a page can carry the tag and never check out.
712
739
  // Overlapping initialize() calls share one download.
713
740
  getOrLoadEngine() {
714
- return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-B9qRQyLg.js").then((t) => t.m).then((t) => {
741
+ return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-Dv4yxjrJ.js").then((t) => t.m).then((t) => {
715
742
  const a = t.mountCheckoutEngine({
716
743
  host: this,
717
744
  shadowRoot: this.shadow
@@ -744,9 +771,9 @@ class ee extends HTMLElement {
744
771
  const n = await a;
745
772
  if (this.isDismissedByHost)
746
773
  return;
747
- const o = V();
774
+ const o = ee();
748
775
  o.setOptions(t);
749
- const r = n.ok && n.linkedTransaction ? X({
776
+ const r = n.ok && n.linkedTransaction ? V({
750
777
  transaction: n.linkedTransaction,
751
778
  session: n.session
752
779
  }) : null;
@@ -767,7 +794,7 @@ class ee extends HTMLElement {
767
794
  return;
768
795
  }
769
796
  if (!n.ok && n.failureURL) {
770
- const g = w("errors.unableToCreateSession"), b = k({
797
+ const g = w("errors.unableToCreateSession"), b = P({
771
798
  message: g,
772
799
  reason: "sessionExpired",
773
800
  shouldEndCheckout: !0,
@@ -776,7 +803,7 @@ class ee extends HTMLElement {
776
803
  o.emit("payment.failed", b.event), o.paymentFailed(g, b.failure);
777
804
  return;
778
805
  }
779
- const s = w("errors.checkoutUnavailable"), i = k({
806
+ const s = w("errors.checkoutUnavailable"), i = P({
780
807
  message: s,
781
808
  reason: "error",
782
809
  shouldEndCheckout: !0,
@@ -790,27 +817,27 @@ class ee extends HTMLElement {
790
817
  t == null || t.teardown(), t == null || t.unmount(), this.engine = null, this.engineLoadPromise = null;
791
818
  }
792
819
  }
793
- function te(e) {
794
- return new Y(
795
- G(e),
796
- d(e) ? void 0 : e.publishableKey
820
+ function ae(e) {
821
+ return new M(
822
+ _(e),
823
+ u(e) ? void 0 : e.publishableKey
797
824
  );
798
825
  }
799
- function ae({
826
+ function ne({
800
827
  api: e,
801
828
  options: t
802
829
  }) {
803
- return _({
830
+ return j({
804
831
  api: e,
805
832
  options: t,
806
833
  emit: (a, n) => A(t.onEvent, a, n)
807
834
  });
808
835
  }
809
- customElements.get("lydian-checkout") || customElements.define("lydian-checkout", ee);
836
+ customElements.get("lydian-checkout") || customElements.define("lydian-checkout", te);
810
837
  function f() {
811
838
  return document.querySelector("lydian-checkout");
812
839
  }
813
- async function ne(e) {
840
+ async function oe(e) {
814
841
  if (!e.publishableKey || !e.transaction.amount || !e.transaction.currency)
815
842
  throw new Error("SDK initialization requires publishableKey and a transaction");
816
843
  const t = D(e);
@@ -820,8 +847,8 @@ async function ne(e) {
820
847
  if (a)
821
848
  throw new Error(a);
822
849
  if (!U(e.transaction.currency))
823
- throw new Error("Invalid value for currency, valid values are: " + v.join(", "));
824
- const n = S({
850
+ throw new Error("Invalid value for currency, valid values are: " + E.join(", "));
851
+ const n = v({
825
852
  options: e,
826
853
  unsupportedKeys: ["sessionID"],
827
854
  entryPoint: "init"
@@ -830,7 +857,7 @@ async function ne(e) {
830
857
  throw new Error(n);
831
858
  await f().initialize(e);
832
859
  }
833
- async function oe(e) {
860
+ async function re(e) {
834
861
  if (!e.sessionID)
835
862
  throw new Error("initExistingSession requires a sessionID");
836
863
  const t = D(e);
@@ -839,7 +866,7 @@ async function oe(e) {
839
866
  const a = N(e);
840
867
  if (a)
841
868
  throw new Error(a);
842
- const n = S({
869
+ const n = v({
843
870
  options: e,
844
871
  unsupportedKeys: ["publishableKey", "transaction"],
845
872
  entryPoint: "initExistingSession"
@@ -848,31 +875,31 @@ async function oe(e) {
848
875
  throw new Error(n);
849
876
  await f().initialize(e);
850
877
  }
851
- async function re(e) {
878
+ async function se(e) {
852
879
  await f().updateTransaction(e);
853
880
  }
854
- window.Lydian = { init: ne, initExistingSession: oe, updateTransaction: re };
881
+ window.Lydian = { init: oe, initExistingSession: re, updateTransaction: se };
855
882
  export {
856
883
  O as G,
857
- se as P,
858
- u as T,
859
- B as a,
860
- ce as b,
861
- v as c,
862
- K as d,
863
- z as e,
864
- J as f,
884
+ ie as P,
885
+ d as T,
886
+ G as a,
887
+ le as b,
888
+ E as c,
889
+ z as d,
890
+ J as e,
891
+ Q as f,
865
892
  de as g,
866
- d as h,
893
+ u as h,
867
894
  U as i,
868
895
  Z as j,
869
- X as k,
896
+ V as k,
870
897
  I as l,
871
- le as m,
872
- k as n,
873
- ie as o,
874
- V as p,
875
- H as r,
898
+ ue as m,
899
+ P as n,
900
+ ce as o,
901
+ ee as p,
902
+ K as r,
876
903
  y as s,
877
904
  w as t
878
905
  };