@odus/checkout 1.17.0-beta.1 → 1.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.
- package/dist/checkout.es.js +168 -153
- package/dist/components/checkout/form/Form.d.ts +6 -1
- package/dist/components/checkout/form/Form.d.ts.map +1 -1
- package/dist/components/checkout/form/SubmitButton.d.ts.map +1 -1
- package/dist/core/vgs/VGSCollectService.d.ts +8 -1
- package/dist/core/vgs/VGSCollectService.d.ts.map +1 -1
- package/dist/core/vgs/VgsSession.d.ts +51 -0
- package/dist/core/vgs/VgsSession.d.ts.map +1 -0
- package/dist/core/vgs/index.d.ts +2 -0
- package/dist/core/vgs/index.d.ts.map +1 -1
- package/dist/core/vgs/vgs.constants.d.ts +17 -0
- package/dist/core/vgs/vgs.constants.d.ts.map +1 -1
- package/dist/elements/CardElement.d.ts +7 -1
- package/dist/elements/CardElement.d.ts.map +1 -1
- package/dist/elements/OdusElements.d.ts +6 -0
- package/dist/elements/OdusElements.d.ts.map +1 -1
- package/dist/elements/card/VgsCardAdapter.d.ts +5 -2
- package/dist/elements/card/VgsCardAdapter.d.ts.map +1 -1
- package/dist/elements.es.js +223 -162
- package/dist/loader.es.js +1 -1
- package/dist/shared.js +791 -746
- package/dist/types/telemetry/TelemetryEvents.type.d.ts +18 -0
- package/dist/types/telemetry/TelemetryEvents.type.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/elements.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as e, B as t, C as n, E as r, G as i, I as a, J as o, K as s, L as c,
|
|
1
|
+
import { $ as e, B as t, C as n, E as r, G as i, I as a, J as o, K as s, L as c, Q as l, R as u, S as ee, T as d, U as te, W as ne, X as re, Y as f, Z as ie, _ as ae, _t as p, a as oe, at as m, b as se, bt as ce, c as le, ct as h, d as g, f as _, ft as v, gt as y, ht as b, i as ue, it as de, l as fe, lt as pe, mt as x, n as S, nt as me, o as he, ot as C, p as w, q as ge, r as _e, rt as ve, s as ye, t as be, tt as T, ut as E, vt as D, w as xe, xt as O, y as Se, yt as k, z as A } from "./shared.js";
|
|
2
2
|
//#region libs/checkout/src/assets/styles/helperText.css?inline
|
|
3
|
-
var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-index:3;position:relative}.form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);font-size:12px;font-weight:500;line-height:var(--odus-helper-text-line-height,14px);background:var(--odus-color-background,#fff);pointer-events:none;transition:opacity .2s ease-in-out;display:block;position:absolute;top:2px;left:0;right:0}.form-helper-text-hidden{opacity:0;visibility:hidden}.form-helper-text-hint{color:var(--odus-color-muted,#6b7280);font-weight:400}", M = ".input-wrapper{box-sizing:border-box;flex-direction:column;align-items:stretch;width:100%;min-width:0;display:flex}.input-wrapper *{box-sizing:border-box}.form-input{opacity:1;font-size:var(--odus-input-font-size,16px);font-weight:var(--odus-input-font-weight,400);letter-spacing:var(--odus-input-letter-spacing,.02em);box-shadow:0 0 0 1px var(--odus-border-color,#e0e0e0), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d;background:var(--odus-color-background,#fff);padding:var(--odus-input-padding,8px 12px);line-height:var(--odus-input-line-height,1.5);z-index:0;box-sizing:border-box;border:none;outline:none;flex:1;width:100%;min-height:0;transition:box-shadow .1s ease-in,border-radius .2s ease-in}.form-input[name=cardNumber]{padding-right:100px}.form-input-error{box-shadow:0 0 0 1px var(--odus-color-error,#dc2727), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d}.form-input::placeholder{color:var(--odus-input-placeholder-color,#717173);opacity:var(--odus-input-placeholder-opacity,.3)}.form-input:focus{z-index:2;position:relative;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}", N = ".input-label{font-family:var(--odus-font-family,inherit);font-size:var(--odus-label-font-size,14px);font-weight:var(--odus-label-font-weight,400);color:var(--odus-label-color,var(--odus-color-text,#1a1a1a));letter-spacing:var(--odus-label-letter-spacing,normal);line-height:var(--odus-label-line-height,1.4);margin-bottom:var(--odus-label-margin-bottom,6px)}", P = (e) => "adoptedStyleSheets" in e,
|
|
3
|
+
var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-index:3;position:relative}.form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);font-size:12px;font-weight:500;line-height:var(--odus-helper-text-line-height,14px);background:var(--odus-color-background,#fff);pointer-events:none;transition:opacity .2s ease-in-out;display:block;position:absolute;top:2px;left:0;right:0}.form-helper-text-hidden{opacity:0;visibility:hidden}.form-helper-text-hint{color:var(--odus-color-muted,#6b7280);font-weight:400}", M = ".input-wrapper{box-sizing:border-box;flex-direction:column;align-items:stretch;width:100%;min-width:0;display:flex}.input-wrapper *{box-sizing:border-box}.form-input{opacity:1;font-size:var(--odus-input-font-size,16px);font-weight:var(--odus-input-font-weight,400);letter-spacing:var(--odus-input-letter-spacing,.02em);box-shadow:0 0 0 1px var(--odus-border-color,#e0e0e0), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d;background:var(--odus-color-background,#fff);padding:var(--odus-input-padding,8px 12px);line-height:var(--odus-input-line-height,1.5);z-index:0;box-sizing:border-box;border:none;outline:none;flex:1;width:100%;min-height:0;transition:box-shadow .1s ease-in,border-radius .2s ease-in}.form-input[name=cardNumber]{padding-right:100px}.form-input-error{box-shadow:0 0 0 1px var(--odus-color-error,#dc2727), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d}.form-input::placeholder{color:var(--odus-input-placeholder-color,#717173);opacity:var(--odus-input-placeholder-opacity,.3)}.form-input:focus{z-index:2;position:relative;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}", N = ".input-label{font-family:var(--odus-font-family,inherit);font-size:var(--odus-label-font-size,14px);font-weight:var(--odus-label-font-weight,400);color:var(--odus-label-color,var(--odus-color-text,#1a1a1a));letter-spacing:var(--odus-label-letter-spacing,normal);line-height:var(--odus-label-line-height,1.4);margin-bottom:var(--odus-label-margin-bottom,6px)}", P = (e) => "adoptedStyleSheets" in e, Ce = (e, t) => {
|
|
4
4
|
let n = (e.nodeType === Node.DOCUMENT_NODE ? e : e.ownerDocument)?.defaultView?.CSSStyleSheet;
|
|
5
5
|
if (!n) return null;
|
|
6
6
|
try {
|
|
@@ -10,7 +10,7 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
12
|
}, F = (e, t, n) => {
|
|
13
|
-
let r = e.getRootNode(), i = P(r) ?
|
|
13
|
+
let r = e.getRootNode(), i = P(r) ? Ce(r, t) : null;
|
|
14
14
|
if (i && P(r)) try {
|
|
15
15
|
return r.adoptedStyleSheets = [...r.adoptedStyleSheets, i], {
|
|
16
16
|
update: (e) => i.replaceSync(e),
|
|
@@ -26,7 +26,7 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
26
26
|
},
|
|
27
27
|
remove: () => a.remove()
|
|
28
28
|
};
|
|
29
|
-
},
|
|
29
|
+
}, we = ":host{--odus-font-family:system-ui, sans-serif;--odus-font-size:16px;--odus-color-error:#dc2727;--odus-color-text:#1a1a1a;--odus-color-background:#fff;--odus-border-color:#e0e0e0;--odus-border-radius:6px;--odus-spacing-sm:8px;--odus-spacing-md:16px;--odus-spacing-lg:24px;--odus-input-height:44px;--odus-input-padding:8px 12px;--odus-input-font-size:var(--odus-font-size);--odus-input-font-weight:400;--odus-input-letter-spacing:.02em;--odus-input-line-height:1.5;--odus-input-placeholder-color:#717173;--odus-input-placeholder-opacity:.3;--odus-input-focus-shadow:0 0 0 1px #3297d3b3, 0 1px 1px 0 #00000012, 0 0 0 4px #3297d34d;--odus-label-font-size:14px;--odus-label-font-weight:400;--odus-label-color:var(--odus-color-text);--odus-label-letter-spacing:normal;--odus-label-line-height:1.4;--odus-label-margin-bottom:6px;--odus-card-gap:12px;--odus-button-height:48px;--odus-button-border-radius:var(--odus-border-radius)}.form-input{opacity:1;font-weight:var(--odus-input-font-weight,400);letter-spacing:var(--odus-input-letter-spacing,.02em);box-shadow:0 0 0 1px var(--odus-border-color,#e0e0e0), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d;background:var(--odus-color-background,#fff);padding:var(--odus-input-padding,8px 12px);line-height:var(--odus-input-line-height,1.5);z-index:0;box-sizing:border-box;border:none;outline:none;flex:1;width:100%;min-height:0;transition:box-shadow .1s ease-in,border-radius .2s ease-in}.form-input::placeholder{color:var(--odus-input-placeholder-color,#717173);opacity:var(--odus-input-placeholder-opacity,.3)}.form-input:focus{box-shadow:var(--odus-input-focus-shadow,0 0 0 1px #3297d3b3, 0 1px 1px 0 #00000012, 0 0 0 4px #3297d34d);z-index:2;position:relative}.input-label{font-family:var(--odus-font-family,inherit)!important;font-size:var(--odus-label-font-size,14px)!important;font-weight:var(--odus-label-font-weight,400)!important;color:var(--odus-label-color,var(--odus-color-text,#1a1a1a))!important;letter-spacing:var(--odus-label-letter-spacing,normal)!important;line-height:var(--odus-label-line-height,1.4)!important;margin-bottom:var(--odus-label-margin-bottom,6px)!important}.form-helper-text{font-family:var(--odus-font-family,inherit)!important}", I = (e) => typeof e == "string" ? e : e instanceof HTMLElement ? e.id ? `#${e.id}` : e.tagName.toLowerCase() : String(e), L = class {
|
|
30
30
|
shadowRoot = null;
|
|
31
31
|
host = null;
|
|
32
32
|
options = {};
|
|
@@ -50,10 +50,10 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
50
50
|
if (!n) throw Error(`[${this.elementName}] mount target not found: ${String(e)}`);
|
|
51
51
|
t = !0, this.mountTarget = e, this.attach(n);
|
|
52
52
|
} catch (n) {
|
|
53
|
-
throw this.unmount(), b
|
|
53
|
+
throw this.unmount(), C(b.CHECKOUT_MOUNT_FAILED, {
|
|
54
54
|
container_id: I(e),
|
|
55
55
|
error_message: n instanceof Error ? n.message : "Unknown error"
|
|
56
|
-
}),
|
|
56
|
+
}), m(n instanceof Error ? n : /* @__PURE__ */ Error("Failed to mount element"), { container_id: I(e) }), this._mountFailureListener?.(t ? y.MOUNT_FAILED : y.CONTAINER_NOT_FOUND), n;
|
|
57
57
|
}
|
|
58
58
|
this.emit("ready");
|
|
59
59
|
}
|
|
@@ -104,7 +104,7 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
104
104
|
this.options.callbacks?.[e]?.(t);
|
|
105
105
|
}
|
|
106
106
|
getCss() {
|
|
107
|
-
return
|
|
107
|
+
return we;
|
|
108
108
|
}
|
|
109
109
|
}, R = class extends L {
|
|
110
110
|
_value = "";
|
|
@@ -157,13 +157,13 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
157
157
|
if (!this.shadowRoot) return;
|
|
158
158
|
this._select?.getElement().remove(), this.options.initialValue && !this._value && (this._value = String(this.options.initialValue), this.emit("change", this._value));
|
|
159
159
|
let { t: e, locale: t } = d();
|
|
160
|
-
this._select = new
|
|
160
|
+
this._select = new _({
|
|
161
161
|
name: "billingAddress.country",
|
|
162
162
|
label: this.options.label ?? e("address.chooseCountry"),
|
|
163
163
|
error: !1,
|
|
164
164
|
placeholder: this.options.placeholder ?? e("address.chooseCountry"),
|
|
165
165
|
value: this._value,
|
|
166
|
-
options:
|
|
166
|
+
options: ae(this._allowedCountries, t),
|
|
167
167
|
autocomplete: "country",
|
|
168
168
|
onChange: (e) => {
|
|
169
169
|
this._value = e.target.value, this._error = null, this.emit("change", this._value);
|
|
@@ -277,7 +277,7 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
277
277
|
if (this._country = e, !this.shadowRoot) return;
|
|
278
278
|
let r = A(n), i = A(e);
|
|
279
279
|
if (r && i && n !== e) {
|
|
280
|
-
let { t: n } = d(), r = t(e), i = n(
|
|
280
|
+
let { t: n } = d(), r = t(e), i = n(u(r));
|
|
281
281
|
this._select?.setOptions(c(r), this.options.placeholder ?? i), this._select?.setValue(""), this._value = "", this.emit("change", this._value);
|
|
282
282
|
} else r !== i && (this._value = "", this.render(), this.emit("change", this._value));
|
|
283
283
|
}
|
|
@@ -302,8 +302,8 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
302
302
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
303
303
|
}
|
|
304
304
|
_renderSelect(e) {
|
|
305
|
-
let { t } = d(), n = c(e), r = t(
|
|
306
|
-
this._select = new
|
|
305
|
+
let { t } = d(), n = c(e), r = t(u(e));
|
|
306
|
+
this._select = new _({
|
|
307
307
|
name: "billingAddress.state",
|
|
308
308
|
label: this.options.label ?? t("address.state"),
|
|
309
309
|
error: !1,
|
|
@@ -421,7 +421,7 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
421
421
|
getError() {
|
|
422
422
|
return this._error;
|
|
423
423
|
}
|
|
424
|
-
},
|
|
424
|
+
}, Te = "apple-pay-button{appearance:-apple-pay-button;-apple-pay-button-type:plain;-apple-pay-button-style:black;cursor:pointer;box-sizing:border-box;border-radius:4px;width:100%;height:40px;min-height:40px;display:inline-block}apple-pay-button:hover{filter:brightness(.9)}", Ee = {
|
|
425
425
|
name: "odus-elements",
|
|
426
426
|
styles: {
|
|
427
427
|
fontSize: 14,
|
|
@@ -464,8 +464,8 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
464
464
|
return;
|
|
465
465
|
}
|
|
466
466
|
let { paymentId: e, checkoutKey: t, environment: n, checkoutDetails: r, displayName: i, countries: a, requiredBillingContactFields: o, requiredShippingContactFields: s, onAuthorize: c, onStartFailed: l, onPaymentDataFailed: u } = this._paymentContext;
|
|
467
|
-
|
|
468
|
-
checkoutProfile:
|
|
467
|
+
he(a, r?.countryCode) && oe() ? (this._button = new ue({
|
|
468
|
+
checkoutProfile: Ee,
|
|
469
469
|
paymentId: e,
|
|
470
470
|
checkoutKey: t,
|
|
471
471
|
environment: n,
|
|
@@ -487,7 +487,7 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
487
487
|
this._isAvailable = e, this.host && (e ? this.host.style.removeProperty("display") : this.host.style.display = "none");
|
|
488
488
|
}
|
|
489
489
|
getCss() {
|
|
490
|
-
return super.getCss() +
|
|
490
|
+
return super.getCss() + Te + "\n :host { display: block; }\n apple-pay-button {\n width: 100%;\n height: var(--odus-button-height, 48px);\n border-radius: var(--odus-button-border-radius, 6px);\n }\n ";
|
|
491
491
|
}
|
|
492
492
|
getValue() {
|
|
493
493
|
return this._applePayData;
|
|
@@ -498,7 +498,7 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
498
498
|
getError() {
|
|
499
499
|
return null;
|
|
500
500
|
}
|
|
501
|
-
},
|
|
501
|
+
}, De = ".card-icon{opacity:1;width:18px;transition:opacity .6s ease-in}.card-icon img{max-width:100%;height:auto;display:block}.cards-position{z-index:10;pointer-events:none;align-items:center;gap:8px;display:flex;position:absolute;top:50%;right:12px;transform:translateY(-50%)}.loading{position:relative}.loading:after{content:\"\";border-radius:inherit;background-color:#fff;width:100%;height:100%;position:absolute;inset:0}@media only screen and (min-width:600px){.card-icon{width:20px}}.vgs-card-group iframe,.vgs-wrap iframe{width:100%;min-width:0;display:block}.fake-ph{color:#717173;opacity:.3;font-size:var(--odus-input-font-size,16px);letter-spacing:.02em;font-weight:400;line-height:1.5;font-family:var(--odus-font-family,inherit);pointer-events:none;-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:0;background:#fff;align-items:center;padding:8px 12px;display:flex;position:absolute;inset:0}@keyframes vgs-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.vgs-field-skeleton{pointer-events:none;z-index:11;border-radius:inherit;background:linear-gradient(90deg,#f7f7f7 25%,#fdfdfd 50%,#f7f7f7 75%) 0 0/200% 100%;animation:1.5s ease-in-out infinite vgs-shimmer;position:absolute;inset:0}.card-unavailable-message{color:var(--odus-color-error,#dc2727);background:color-mix(in srgb, var(--odus-color-error,#dc2727) 6%, transparent);box-shadow:0 0 0 1px var(--odus-color-error,#dc2727);box-sizing:border-box;padding:12px;line-height:1.4}.card-pending{width:100%;position:relative;overflow:hidden}", q = {
|
|
502
502
|
name: "odus-elements",
|
|
503
503
|
styles: {
|
|
504
504
|
fontSize: 14,
|
|
@@ -546,13 +546,13 @@ var j = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
546
546
|
"--odus-button-height": "48px",
|
|
547
547
|
"--odus-button-border-radius": "var(--odus-border-radius)"
|
|
548
548
|
}["--odus-font-size"];
|
|
549
|
-
function
|
|
549
|
+
function Oe(e, t) {
|
|
550
550
|
let n = Object.keys(e);
|
|
551
551
|
return n.length === Object.keys(t).length && n.every((n) => e[n] === t[n]);
|
|
552
552
|
}
|
|
553
|
-
var
|
|
553
|
+
var ke = class {
|
|
554
554
|
_vgsService;
|
|
555
|
-
|
|
555
|
+
_vgsSession;
|
|
556
556
|
_vgsState = {};
|
|
557
557
|
_vgsFieldsValid = !1;
|
|
558
558
|
_vgsReinitTimer = null;
|
|
@@ -563,8 +563,11 @@ var De = class {
|
|
|
563
563
|
_onInitFailure = null;
|
|
564
564
|
_onFieldsNotReady = null;
|
|
565
565
|
_onFieldsReady = null;
|
|
566
|
-
constructor(e, t, n = {}) {
|
|
567
|
-
this.
|
|
566
|
+
constructor(e, t, n = {}, r) {
|
|
567
|
+
this._vgsSession = new ge(e, r), this._environment = t, this._onInitFailure = n.onInitFailure ?? null, this._onFieldsNotReady = n.onFieldsNotReady ?? null, this._onFieldsReady = n.onFieldsReady ?? null, this._vgsService = new f();
|
|
568
|
+
}
|
|
569
|
+
setJwtRenewer(e) {
|
|
570
|
+
this._vgsSession.setRenewer(e);
|
|
568
571
|
}
|
|
569
572
|
get section() {
|
|
570
573
|
return this._section;
|
|
@@ -572,7 +575,7 @@ var De = class {
|
|
|
572
575
|
renderSection(e, t) {
|
|
573
576
|
this._section?.getElement().remove();
|
|
574
577
|
let { t: n } = d();
|
|
575
|
-
this._section = new
|
|
578
|
+
this._section = new fe({
|
|
576
579
|
checkoutProfile: q,
|
|
577
580
|
translationFunc: n,
|
|
578
581
|
vgsService: this._vgsService
|
|
@@ -585,7 +588,7 @@ var De = class {
|
|
|
585
588
|
}
|
|
586
589
|
_onChangeEmit = null;
|
|
587
590
|
initVgs() {
|
|
588
|
-
let e = ++this._initGeneration, t = { ...this._currentTheme }, n =
|
|
591
|
+
let e = ++this._initGeneration, t = { ...this._currentTheme }, n = ee(this._buildProfileFromTheme(t).styles.fontFamily);
|
|
589
592
|
this._vgsService.init(this._environment).then((r) => {
|
|
590
593
|
e === this._initGeneration && (this._vgsService.createForm(r, (e) => this._handleStateChange(e)), this._mountFields(e, t, n).catch((t) => {
|
|
591
594
|
e === this._initGeneration && (console.error("Failed to mount VGS card fields:", t), this._onFieldsNotReady?.());
|
|
@@ -595,13 +598,13 @@ var De = class {
|
|
|
595
598
|
});
|
|
596
599
|
}
|
|
597
600
|
async getPayload() {
|
|
598
|
-
if (!this.
|
|
599
|
-
let
|
|
601
|
+
if (!this._vgsSession.jwt) throw T(/* @__PURE__ */ Error("VGS not initialized"), O.NOT_INITIALIZED);
|
|
602
|
+
let e = await this._vgsService.createCard(this._vgsSession);
|
|
600
603
|
return {
|
|
601
|
-
cardId:
|
|
602
|
-
expMonth:
|
|
603
|
-
expYear:
|
|
604
|
-
name:
|
|
604
|
+
cardId: e.cardId,
|
|
605
|
+
expMonth: e.expMonth,
|
|
606
|
+
expYear: e.expYear,
|
|
607
|
+
name: e.name
|
|
605
608
|
};
|
|
606
609
|
}
|
|
607
610
|
isValid() {
|
|
@@ -613,7 +616,7 @@ var De = class {
|
|
|
613
616
|
if (!n?.isTouched || n.isFocused || n.isValid) continue;
|
|
614
617
|
let r = n.errors?.[0];
|
|
615
618
|
if (!r) continue;
|
|
616
|
-
let i =
|
|
619
|
+
let i = g(t, r.code);
|
|
617
620
|
if (i) return e(i);
|
|
618
621
|
}
|
|
619
622
|
return null;
|
|
@@ -623,7 +626,7 @@ var De = class {
|
|
|
623
626
|
...this._currentTheme,
|
|
624
627
|
...e
|
|
625
628
|
};
|
|
626
|
-
|
|
629
|
+
Oe(this._currentTheme, t) || (this._currentTheme = t, this._section && (this._applySkeletonMetrics(), this._reinitWithTheme()));
|
|
627
630
|
}
|
|
628
631
|
resetTheme(e) {
|
|
629
632
|
let t = e.filter((e) => e in this._currentTheme);
|
|
@@ -637,7 +640,7 @@ var De = class {
|
|
|
637
640
|
}
|
|
638
641
|
_reinitWithTheme() {
|
|
639
642
|
this._vgsReinitTimer && clearTimeout(this._vgsReinitTimer), this._vgsReinitTimer = setTimeout(() => {
|
|
640
|
-
this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new
|
|
643
|
+
this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new f(), this._section?.setVgsService(this._vgsService), this.initVgs();
|
|
641
644
|
}, 300);
|
|
642
645
|
}
|
|
643
646
|
_buildProfileFromTheme(e) {
|
|
@@ -700,19 +703,19 @@ var De = class {
|
|
|
700
703
|
if (!r?.isTouched || r.isFocused || r.isValid) continue;
|
|
701
704
|
let i = r.errors?.[0];
|
|
702
705
|
if (!i) continue;
|
|
703
|
-
let a =
|
|
706
|
+
let a = g(n, i.code);
|
|
704
707
|
a && (t[n] = e(a));
|
|
705
708
|
}
|
|
706
709
|
return t;
|
|
707
710
|
}
|
|
708
|
-
},
|
|
711
|
+
}, Y = "odus-card-vgs-host", Ae = "Card capture is unavailable: no tokenization session", X = class extends L {
|
|
709
712
|
elementName = "CardElement";
|
|
710
713
|
_environment = "test";
|
|
711
714
|
_captureState = "pending";
|
|
712
715
|
_vgsAdapter = null;
|
|
713
716
|
_vgsJwt = null;
|
|
714
717
|
_reportedUnavailable = !1;
|
|
715
|
-
_unavailableReason =
|
|
718
|
+
_unavailableReason = x.NO_TOKENIZATION_SESSION;
|
|
716
719
|
_loadOutcomeListener = null;
|
|
717
720
|
get isVgsMode() {
|
|
718
721
|
return this._captureState === "vgs";
|
|
@@ -726,23 +729,26 @@ var De = class {
|
|
|
726
729
|
setLoadOutcomeListener(e) {
|
|
727
730
|
this._loadOutcomeListener = e;
|
|
728
731
|
}
|
|
729
|
-
setVgsJwt(e) {
|
|
730
|
-
if (this._vgsAdapter && this._vgsJwt === e)
|
|
732
|
+
setVgsJwt(e, t) {
|
|
733
|
+
if (this._vgsAdapter && this._vgsJwt === e) {
|
|
734
|
+
this._vgsAdapter.setJwtRenewer(t);
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
731
737
|
this._captureState = "vgs", this._reportedUnavailable = !1, this._vgsJwt = e, this._vgsAdapter?.destroy();
|
|
732
|
-
let
|
|
738
|
+
let n = new ke(e, this._environment, {
|
|
733
739
|
onInitFailure: () => {
|
|
734
|
-
this._vgsAdapter ===
|
|
740
|
+
this._vgsAdapter === n && this.isMounted && this.markCaptureUnavailable(x.INIT_FAILED);
|
|
735
741
|
},
|
|
736
742
|
onFieldsNotReady: () => {
|
|
737
|
-
this._vgsAdapter ===
|
|
743
|
+
this._vgsAdapter === n && this.isMounted && this.markCaptureUnavailable(x.FIELDS_NOT_READY);
|
|
738
744
|
},
|
|
739
745
|
onFieldsReady: () => {
|
|
740
|
-
this._vgsAdapter ===
|
|
746
|
+
this._vgsAdapter === n && this.isMounted && this._loadOutcomeListener?.({ status: "ready" });
|
|
741
747
|
}
|
|
742
|
-
});
|
|
743
|
-
this._vgsAdapter =
|
|
748
|
+
}, t);
|
|
749
|
+
this._vgsAdapter = n, this.isMounted && this.mountTarget && (this.unmount(), this.mount(this.mountTarget));
|
|
744
750
|
}
|
|
745
|
-
markCaptureUnavailable(e =
|
|
751
|
+
markCaptureUnavailable(e = x.NO_TOKENIZATION_SESSION) {
|
|
746
752
|
if (this._captureState === "unavailable") return;
|
|
747
753
|
let t = this.mountTarget, n = this.isMounted && t !== null;
|
|
748
754
|
this.isMounted && this.unmount(), this._unavailableReason = e, this._captureState = "unavailable", this._vgsAdapter?.destroy(), this._vgsAdapter = null, this._vgsJwt = null, n && t && this.mount(t);
|
|
@@ -753,7 +759,7 @@ var De = class {
|
|
|
753
759
|
this.isMounted && this.unmount(), this._captureState = "unsupported", this._reportedUnavailable = !1, this._vgsAdapter?.destroy(), this._vgsAdapter = null, this._vgsJwt = null, t && e && this.mount(e);
|
|
754
760
|
}
|
|
755
761
|
attach(e) {
|
|
756
|
-
this._captureState === "vgs" ? (this.host = (e.ownerDocument ?? document).createElement("div"), e.appendChild(this.host), this.styles = F(this.host, this.getCss(), this.host), this.reapplyTheme(), Object.keys(this._appliedTheme).length > 0 && this._vgsAdapter?.applyTheme(this._appliedTheme), this.render(), this._vgsAdapter?.initVgs()) : super.attach(e);
|
|
762
|
+
this._captureState === "vgs" ? (this.host = (e.ownerDocument ?? document).createElement("div"), this.host.className = Y, e.appendChild(this.host), this.styles = F(this.host, this.getCss(), this.host), this.reapplyTheme(), Object.keys(this._appliedTheme).length > 0 && this._vgsAdapter?.applyTheme(this._appliedTheme), this.render(), this._vgsAdapter?.initVgs()) : super.attach(e);
|
|
757
763
|
}
|
|
758
764
|
unmount() {
|
|
759
765
|
this._captureState === "vgs" ? (this.styles?.remove(), this.styles = null, this.host?.parentElement?.removeChild(this.host), this.host = null, this.shadowRoot = null) : super.unmount();
|
|
@@ -772,7 +778,7 @@ var De = class {
|
|
|
772
778
|
this.clearBody();
|
|
773
779
|
let e = document.createElement("div");
|
|
774
780
|
e.className = "card-pending";
|
|
775
|
-
let t =
|
|
781
|
+
let t = se(Se, q.styles.fontSize);
|
|
776
782
|
e.style.height = `calc((${t}) * 2 - 1px)`, e.style.borderRadius = `var(--odus-border-radius, ${q.styles.borderRadius}px)`;
|
|
777
783
|
let n = document.createElement("div");
|
|
778
784
|
n.className = "vgs-field-skeleton", e.appendChild(n), this.shadowRoot.appendChild(e);
|
|
@@ -780,11 +786,11 @@ var De = class {
|
|
|
780
786
|
renderUnavailableNotice() {
|
|
781
787
|
if (!this.shadowRoot) return;
|
|
782
788
|
this.clearBody();
|
|
783
|
-
let { t: e } = d(), t = new
|
|
789
|
+
let { t: e } = d(), t = new le({
|
|
784
790
|
checkoutProfile: q,
|
|
785
791
|
translationFunc: e
|
|
786
792
|
});
|
|
787
|
-
this.shadowRoot.appendChild(t.getElement()), this.emit("error", e("cardUnavailable")), this._reportedUnavailable || (this._reportedUnavailable = !0, b
|
|
793
|
+
this.shadowRoot.appendChild(t.getElement()), this.emit("error", e("cardUnavailable")), this._reportedUnavailable || (this._reportedUnavailable = !0, C(b.CARD_CAPTURE_UNAVAILABLE, { reason: this._unavailableReason })), this._loadOutcomeListener?.({
|
|
788
794
|
status: "failed",
|
|
789
795
|
reason: this._unavailableReason
|
|
790
796
|
});
|
|
@@ -809,8 +815,56 @@ var De = class {
|
|
|
809
815
|
M,
|
|
810
816
|
N,
|
|
811
817
|
j,
|
|
812
|
-
|
|
813
|
-
].join("\n") +
|
|
818
|
+
De
|
|
819
|
+
].join("\n") + `
|
|
820
|
+
:host { display: block; }
|
|
821
|
+
/* The theme's :host defaults never reach the light-DOM VGS host, so
|
|
822
|
+
without this its labels inherit the merchant page's font. */
|
|
823
|
+
.${Y} {
|
|
824
|
+
--odus-font-family: system-ui, sans-serif;
|
|
825
|
+
}
|
|
826
|
+
.card-grid {
|
|
827
|
+
display: flex;
|
|
828
|
+
flex-direction: column;
|
|
829
|
+
gap: var(--odus-card-gap, 12px);
|
|
830
|
+
}
|
|
831
|
+
.card-details {
|
|
832
|
+
display: flex;
|
|
833
|
+
gap: var(--odus-card-gap, 12px);
|
|
834
|
+
}
|
|
835
|
+
.form-input,
|
|
836
|
+
.form-select {
|
|
837
|
+
color: var(--odus-color-text, #1a1a1a) !important;
|
|
838
|
+
font-family: var(--odus-font-family, system-ui, sans-serif) !important;
|
|
839
|
+
font-size: var(--odus-input-font-size, 16px) !important;
|
|
840
|
+
background: var(--odus-color-background, #ffffff) !important;
|
|
841
|
+
border-radius: var(--odus-border-radius, 6px) !important;
|
|
842
|
+
box-shadow:
|
|
843
|
+
0 0 0 1px var(--odus-border-color, #e0e0e0),
|
|
844
|
+
0 2px 4px 0 rgba(0, 0, 0, 0.07),
|
|
845
|
+
0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;
|
|
846
|
+
}
|
|
847
|
+
.form-input:focus,
|
|
848
|
+
.form-select:focus {
|
|
849
|
+
box-shadow: var(
|
|
850
|
+
--odus-input-focus-shadow,
|
|
851
|
+
0 0 0 1px rgba(50, 151, 211, 0.7),
|
|
852
|
+
0 1px 1px 0 rgba(0, 0, 0, 0.07),
|
|
853
|
+
0 0 0 4px rgba(50, 151, 211, 0.3)
|
|
854
|
+
) !important;
|
|
855
|
+
outline: none !important;
|
|
856
|
+
}
|
|
857
|
+
.form-input-error,
|
|
858
|
+
.form-select-error {
|
|
859
|
+
box-shadow:
|
|
860
|
+
0 0 0 1px var(--odus-color-error, #dc2727),
|
|
861
|
+
0 2px 4px 0 rgba(0, 0, 0, 0.07),
|
|
862
|
+
0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;
|
|
863
|
+
}
|
|
864
|
+
.form-helper-text {
|
|
865
|
+
color: var(--odus-color-error, #dc2727) !important;
|
|
866
|
+
}
|
|
867
|
+
`;
|
|
814
868
|
}
|
|
815
869
|
getValue() {
|
|
816
870
|
return {
|
|
@@ -820,7 +874,7 @@ var De = class {
|
|
|
820
874
|
};
|
|
821
875
|
}
|
|
822
876
|
async getPayload() {
|
|
823
|
-
if (this._captureState !== "vgs" || !this._vgsAdapter) throw Error(
|
|
877
|
+
if (this._captureState !== "vgs" || !this._vgsAdapter) throw Error(Ae);
|
|
824
878
|
return this._vgsAdapter.getPayload();
|
|
825
879
|
}
|
|
826
880
|
getIsValid() {
|
|
@@ -829,7 +883,7 @@ var De = class {
|
|
|
829
883
|
getError() {
|
|
830
884
|
return this._captureState === "unavailable" ? d().t("cardUnavailable") : this._vgsAdapter?.getError() ?? null;
|
|
831
885
|
}
|
|
832
|
-
},
|
|
886
|
+
}, Z = class extends L {
|
|
833
887
|
_value = "";
|
|
834
888
|
_error = null;
|
|
835
889
|
_input = null;
|
|
@@ -869,7 +923,7 @@ var De = class {
|
|
|
869
923
|
getError() {
|
|
870
924
|
return this._error;
|
|
871
925
|
}
|
|
872
|
-
},
|
|
926
|
+
}, je = {
|
|
873
927
|
name: "odus-elements",
|
|
874
928
|
styles: {
|
|
875
929
|
fontSize: 14,
|
|
@@ -893,7 +947,7 @@ var De = class {
|
|
|
893
947
|
}
|
|
894
948
|
},
|
|
895
949
|
additionalPaymentMethods: {}
|
|
896
|
-
},
|
|
950
|
+
}, Q = class extends L {
|
|
897
951
|
_email = "";
|
|
898
952
|
_error = null;
|
|
899
953
|
_suggestion = null;
|
|
@@ -902,10 +956,10 @@ var De = class {
|
|
|
902
956
|
if (!this.shadowRoot) return;
|
|
903
957
|
this._field?.getElement().remove(), this.options.initialValue && !this._email && (this._email = String(this.options.initialValue));
|
|
904
958
|
let { t: e } = d();
|
|
905
|
-
this._field = new
|
|
959
|
+
this._field = new ye({
|
|
906
960
|
value: this._email,
|
|
907
961
|
error: !1,
|
|
908
|
-
checkoutProfile:
|
|
962
|
+
checkoutProfile: je,
|
|
909
963
|
translationFunc: e,
|
|
910
964
|
label: this.options.label,
|
|
911
965
|
placeholder: this.options.placeholder,
|
|
@@ -938,7 +992,7 @@ var De = class {
|
|
|
938
992
|
get suggestion() {
|
|
939
993
|
return this._suggestion;
|
|
940
994
|
}
|
|
941
|
-
},
|
|
995
|
+
}, Me = "@keyframes slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.error-alert{background-color:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:16px;animation:.3s ease-out slideIn;box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f}.error-alert-content{align-items:flex-start;gap:12px;display:flex}.error-alert-icon-container{color:#dc2626;background-color:#fee2e2;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;display:flex}.error-alert-icon{color:#dc2626}.error-alert-text-container{flex:1;min-width:0}.error-alert-title{color:#991b1b;margin:0 0 4px;font-size:14px;font-weight:600;line-height:1.4}.error-alert-message{font-family:var(--odus-font-family,inherit);color:#7f1d1d;word-break:break-word;margin:0;font-size:14px;line-height:1.5}", $ = class extends L {
|
|
942
996
|
_alert = null;
|
|
943
997
|
_message = null;
|
|
944
998
|
render() {
|
|
@@ -951,7 +1005,7 @@ var De = class {
|
|
|
951
1005
|
this._message = null, this._alert?.getElement().remove(), this._alert = null;
|
|
952
1006
|
}
|
|
953
1007
|
getCss() {
|
|
954
|
-
return super.getCss() +
|
|
1008
|
+
return super.getCss() + Me + "\n :host { display: block; }\n .error-alert-icon,\n .error-alert-icon-container {\n color: var(--odus-color-error, #e53e3e) !important;\n }\n .error-alert-message {\n color: var(--odus-color-text, #1a1a1a) !important;\n }\n ";
|
|
955
1009
|
}
|
|
956
1010
|
getValue() {
|
|
957
1011
|
return null;
|
|
@@ -962,7 +1016,7 @@ var De = class {
|
|
|
962
1016
|
getError() {
|
|
963
1017
|
return this._message;
|
|
964
1018
|
}
|
|
965
|
-
},
|
|
1019
|
+
}, Ne = ".paypal{color:#253b80;text-transform:none;cursor:pointer;background-color:#ffc439;border-radius:4px;padding:8px 16px;font-weight:700;box-shadow:0 2px 4px #0000001a}.paypal:hover{filter:brightness(.95);background-color:#ffc439}.paypal-icon-container{justify-content:center;align-items:center;display:flex}.paypal-icon-container img{width:69px;height:22px}", Pe = {
|
|
966
1020
|
name: "odus-elements",
|
|
967
1021
|
styles: {
|
|
968
1022
|
fontSize: 14,
|
|
@@ -986,7 +1040,7 @@ var De = class {
|
|
|
986
1040
|
}
|
|
987
1041
|
},
|
|
988
1042
|
additionalPaymentMethods: {}
|
|
989
|
-
},
|
|
1043
|
+
}, Fe = class extends L {
|
|
990
1044
|
_paymentContext = null;
|
|
991
1045
|
_button = null;
|
|
992
1046
|
setPaymentContext(e) {
|
|
@@ -995,8 +1049,8 @@ var De = class {
|
|
|
995
1049
|
render() {
|
|
996
1050
|
if (!this.shadowRoot || (this._button?.getElement().remove(), this._button = null, !this._paymentContext)) return;
|
|
997
1051
|
let { onAuthorize: e } = this._paymentContext;
|
|
998
|
-
this._button = new
|
|
999
|
-
checkoutProfile:
|
|
1052
|
+
this._button = new _e({
|
|
1053
|
+
checkoutProfile: Pe,
|
|
1000
1054
|
onSubmit: async () => {
|
|
1001
1055
|
this._button?.setSubmitting(!0);
|
|
1002
1056
|
try {
|
|
@@ -1008,7 +1062,7 @@ var De = class {
|
|
|
1008
1062
|
}), this.shadowRoot.appendChild(this._button.getElement());
|
|
1009
1063
|
}
|
|
1010
1064
|
getCss() {
|
|
1011
|
-
return super.getCss() +
|
|
1065
|
+
return super.getCss() + Ne + "\n :host { display: block; }\n .paypal {\n width: 100%;\n box-sizing: border-box;\n border-radius: var(--odus-button-border-radius, 6px);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n ";
|
|
1012
1066
|
}
|
|
1013
1067
|
getValue() {
|
|
1014
1068
|
return null;
|
|
@@ -1019,7 +1073,7 @@ var De = class {
|
|
|
1019
1073
|
getError() {
|
|
1020
1074
|
return null;
|
|
1021
1075
|
}
|
|
1022
|
-
},
|
|
1076
|
+
}, Ie = ".country-dial-code-dropdown{display:inline-block;position:relative}.country-dial-code-trigger{padding:var(--odus-input-padding,8px 12px);cursor:pointer;letter-spacing:.02em;font-weight:400;line-height:var(--odus-input-line-height,1.5);white-space:nowrap;box-sizing:border-box;background:#fff;border:none;border-right:1px solid #e0e0e0;align-items:center;gap:6px;padding-right:8px;transition:all .1s ease-in;display:flex}.country-dial-code-trigger:hover{background:#f5f5f5}.country-dial-code-trigger:focus{outline:none}.country-dial-code-trigger .country-flag{font-size:14px;line-height:1}.country-dial-code-trigger .country-chevron{color:#717173;flex-shrink:0;transition:transform .15s}.country-dial-code-trigger[aria-expanded=true] .country-chevron{transform:rotate(180deg)}.country-dial-code-panel{z-index:10000;background:#fff;border-radius:8px;flex-direction:column;width:280px;max-height:360px;display:flex;position:fixed;top:0;left:0;overflow:hidden;box-shadow:0 0 0 1px #0000000d,0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.country-dial-code-panel.hidden{display:none}.country-search-wrapper{border-bottom:1px solid #e0e0e0;flex-shrink:0;padding:12px}.country-search{width:100%;font-size:inherit;box-sizing:border-box;border:1px solid #e0e0e0;border-radius:6px;outline:none;padding:6px 12px;font-family:inherit;transition:all .1s ease-in}.country-search:focus{border-color:#3297d3b3;box-shadow:0 0 0 3px #3297d31a}.country-search::placeholder{color:#717173;opacity:.6}.countries-list{flex:1;min-height:0;overflow-y:auto}.countries-list::-webkit-scrollbar{width:8px}.countries-list::-webkit-scrollbar-track{background:#f5f5f5}.countries-list::-webkit-scrollbar-thumb{background:#d0d0d0;border-radius:4px}.countries-list::-webkit-scrollbar-thumb:hover{background:#b0b0b0}.country-group-header{color:#717173;text-transform:uppercase;letter-spacing:.05em;z-index:1;background:#fafafa;padding:8px 16px 4px;font-size:12px;font-weight:600;position:sticky;top:0}.country-item{cursor:pointer;text-align:left;width:100%;color:inherit;background:#fff;border:none;align-items:center;gap:12px;padding:10px 16px;font-family:inherit;font-size:14px;transition:background .1s;display:flex}.country-item:hover{background:#f5f5f5}.country-item.selected{color:#3297d3;background:#3297d314}.country-item:focus{background:#f0f0f0;outline:none}.country-item .country-flag{flex-shrink:0;font-size:20px;line-height:1}.country-item .country-name{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.country-item .country-dial-code{color:#717173;flex-shrink:0;font-size:.95em}.country-item.selected .country-dial-code{color:#3297d3cc}.no-results{text-align:center;color:#717173;padding:24px 16px;font-size:14px}.phone-number-field-wrapper{width:100%;display:flex}.phone-number-field-container{border-radius:inherit;background:#fff;align-items:center;width:100%;transition:box-shadow .1s ease-in,border-radius .2s ease-in;display:flex;position:relative;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.phone-number-field-container.focused{z-index:2;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}.phone-number-field-container.error{box-shadow:0 0 0 1px #dc2727,0 2px 4px #dc27271a}.phone-number-field-container.error.focused{box-shadow:0 0 0 1px #dc2727,0 1px 1px #00000012,0 0 0 4px #dc272733}.phone-number-field-container .country-select-wrapper{padding:var(--odus-input-padding,8px 12px);border-top-left-radius:var(--phone-border-radius,0px);border-bottom-left-radius:var(--phone-border-radius,0px);white-space:nowrap;background:0 0;flex-shrink:0;align-items:center;gap:4px;padding-right:6px;display:flex;position:relative}.phone-number-field-container .country-select-wrapper .country-flag{pointer-events:none;font-size:14px;line-height:1}.phone-number-field-container .country-select-wrapper .country-chevron{color:#717173;pointer-events:none;flex-shrink:0;align-items:center;display:flex}.phone-number-field-container .country-select-wrapper .country-select{cursor:pointer;opacity:0;background:0 0;border:none;outline:none;width:100%;height:100%;position:absolute;inset:0}.phone-number-field-container .phone-input-wrapper{flex:1;min-width:0}.phone-number-field-container .phone-input-wrapper .form-input{box-shadow:none;border-radius:0;border-top-right-radius:var(--phone-border-radius,0px);border-bottom-right-radius:var(--phone-border-radius,0px);padding:var(--odus-input-padding,8px 2px);border:none}.phone-number-field-container .phone-input-wrapper .form-input:focus{box-shadow:none;z-index:auto}", Le = {
|
|
1023
1077
|
name: "odus-elements",
|
|
1024
1078
|
styles: {
|
|
1025
1079
|
fontSize: 14,
|
|
@@ -1043,7 +1097,7 @@ var De = class {
|
|
|
1043
1097
|
}
|
|
1044
1098
|
},
|
|
1045
1099
|
additionalPaymentMethods: {}
|
|
1046
|
-
},
|
|
1100
|
+
}, Re = class extends L {
|
|
1047
1101
|
_phone = "";
|
|
1048
1102
|
_error = null;
|
|
1049
1103
|
_field = null;
|
|
@@ -1059,13 +1113,13 @@ var De = class {
|
|
|
1059
1113
|
if (!this.shadowRoot) return;
|
|
1060
1114
|
this._field?.destroy(), this._field?.getElement().remove(), this._field = null, this.options.initialValue && !this._phone && (this._phone = String(this.options.initialValue));
|
|
1061
1115
|
let e = ++this._renderGeneration;
|
|
1062
|
-
|
|
1116
|
+
te().then(({ PhoneNumberField: t }) => {
|
|
1063
1117
|
if (!this.shadowRoot || this._renderGeneration !== e) return;
|
|
1064
1118
|
let { t: n, locale: r } = d();
|
|
1065
1119
|
this._field = new t({
|
|
1066
1120
|
value: this._phone,
|
|
1067
1121
|
error: !1,
|
|
1068
|
-
checkoutProfile:
|
|
1122
|
+
checkoutProfile: Le,
|
|
1069
1123
|
translationFunc: n,
|
|
1070
1124
|
locale: r,
|
|
1071
1125
|
label: this.options.label,
|
|
@@ -1083,10 +1137,10 @@ var De = class {
|
|
|
1083
1137
|
}).catch((t) => {
|
|
1084
1138
|
this.shadowRoot && this._renderGeneration === e && (console.error("Error creating phone number field:", t), this._loadOutcomeListener?.({
|
|
1085
1139
|
status: "failed",
|
|
1086
|
-
reason:
|
|
1140
|
+
reason: y.FORM_RENDER_FAILED,
|
|
1087
1141
|
attributes: {
|
|
1088
1142
|
form_part: "phone_number",
|
|
1089
|
-
error_class:
|
|
1143
|
+
error_class: ve(t)
|
|
1090
1144
|
}
|
|
1091
1145
|
}));
|
|
1092
1146
|
});
|
|
@@ -1096,7 +1150,7 @@ var De = class {
|
|
|
1096
1150
|
M,
|
|
1097
1151
|
N,
|
|
1098
1152
|
j,
|
|
1099
|
-
|
|
1153
|
+
Ie
|
|
1100
1154
|
].join("\n") + "\n :host { display: block; }\n .form-input,\n .country-select-wrapper {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: 0 !important;\n box-shadow: none !important;\n }\n .phone-number-field-container {\n min-height: calc(var(--odus-input-font-size, 16px) * 1.5 + 16px);\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n overflow: hidden;\n }\n .phone-number-field-container:focus-within {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n }\n .phone-number-field-container.error {\n box-shadow: 0 0 0 1px var(--odus-color-error, #dc2727) !important;\n }\n .form-input:focus {\n box-shadow: none !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
1101
1155
|
}
|
|
1102
1156
|
getValue() {
|
|
@@ -1112,7 +1166,7 @@ var De = class {
|
|
|
1112
1166
|
destroy() {
|
|
1113
1167
|
this._loadOutcomeListener = null, super.destroy();
|
|
1114
1168
|
}
|
|
1115
|
-
},
|
|
1169
|
+
}, ze = "Payment failed", Be = "We couldn't securely process your card details. Please check your card information and try again.", Ve = "No payment details were entered. Please add your card and try again.", He = "This payment is no longer available. Please reload the page and try again.", Ue = class {
|
|
1116
1170
|
_config;
|
|
1117
1171
|
_apiService;
|
|
1118
1172
|
_changeListeners = [];
|
|
@@ -1144,13 +1198,13 @@ var De = class {
|
|
|
1144
1198
|
environment: e.environment,
|
|
1145
1199
|
sessionId: this._sessionId,
|
|
1146
1200
|
integration: "elements"
|
|
1147
|
-
}), b
|
|
1201
|
+
}), C(b.CHECKOUT_INITIALIZED, { environment: e.environment }), e.locale && r.setLocale(e.locale), this._apiService = new xe(e.apiKey, e.environment);
|
|
1148
1202
|
let t = {};
|
|
1149
1203
|
Object.defineProperty(t, "email", {
|
|
1150
|
-
get: () => (this._email || (this._email = new
|
|
1204
|
+
get: () => (this._email || (this._email = new Q(), this._trackElement(this._email)), this._email),
|
|
1151
1205
|
enumerable: !0
|
|
1152
1206
|
}), Object.defineProperty(t, "phone", {
|
|
1153
|
-
get: () => (this._phone || (this._phone = new
|
|
1207
|
+
get: () => (this._phone || (this._phone = new Re(), this._trackElement(this._phone), this._phone.setLoadOutcomeListener((e) => {
|
|
1154
1208
|
e.status === "ready" ? this._settleLoad() : this._readiness.fail({
|
|
1155
1209
|
reason: e.reason,
|
|
1156
1210
|
attributes: e.attributes
|
|
@@ -1175,7 +1229,7 @@ var De = class {
|
|
|
1175
1229
|
})), this._applePay),
|
|
1176
1230
|
enumerable: !0
|
|
1177
1231
|
}), Object.defineProperty(n, "payPal", {
|
|
1178
|
-
get: () => (this._paypal || (this._paypal = new
|
|
1232
|
+
get: () => (this._paypal || (this._paypal = new Fe(), this._trackElement(this._paypal), this._paymentState.paymentId && this._paymentState.checkoutKey && this._paypal.setPaymentContext({
|
|
1179
1233
|
paymentId: this._paymentState.paymentId,
|
|
1180
1234
|
checkoutKey: this._paymentState.checkoutKey,
|
|
1181
1235
|
onAuthorize: async () => {
|
|
@@ -1214,30 +1268,37 @@ var De = class {
|
|
|
1214
1268
|
express: n
|
|
1215
1269
|
};
|
|
1216
1270
|
Object.defineProperty(a, "card", {
|
|
1217
|
-
get: () => (this._card || (this._card = new
|
|
1271
|
+
get: () => (this._card || (this._card = new X(), this._card.setEnvironment(this._config.environment), this._card.on("ready", () => {
|
|
1218
1272
|
this._cardFieldsReady = !1;
|
|
1219
1273
|
}), this._trackElement(this._card), this._card.setLoadOutcomeListener((e) => {
|
|
1220
1274
|
this._readiness.markMounted(), e.status === "ready" ? (this._cardFieldsReady = !0, this._settleLoad()) : this._readiness.settle(e);
|
|
1221
|
-
}), this._paymentState.vgsJwt ? this._card.setVgsJwt(this._paymentState.vgsJwt) : this._paymentState.cardCapture === "unavailable" ? this._card.markCaptureUnavailable() : this._paymentState.cardCapture === "unsupported" && this._card.resetCardCapture()), this._card),
|
|
1275
|
+
}), this._paymentState.vgsJwt ? this._card.setVgsJwt(this._paymentState.vgsJwt, this._renewVgsJwt(this._paymentState)) : this._paymentState.cardCapture === "unavailable" ? this._card.markCaptureUnavailable() : this._paymentState.cardCapture === "unsupported" && this._card.resetCardCapture()), this._card),
|
|
1222
1276
|
enumerable: !0
|
|
1223
1277
|
}), Object.defineProperty(a, "cardholderName", {
|
|
1224
|
-
get: () => (this._cardholderName || (this._cardholderName = new
|
|
1278
|
+
get: () => (this._cardholderName || (this._cardholderName = new Z(), this._trackElement(this._cardholderName)), this._cardholderName),
|
|
1225
1279
|
enumerable: !0
|
|
1226
1280
|
}), Object.defineProperty(a, "address", {
|
|
1227
1281
|
get: () => i,
|
|
1228
1282
|
enumerable: !0
|
|
1229
1283
|
}), Object.defineProperty(a, "error", {
|
|
1230
|
-
get: () => (this._error || (this._error = new
|
|
1284
|
+
get: () => (this._error || (this._error = new $(), this._trackElement(this._error)), this._error),
|
|
1231
1285
|
enumerable: !0
|
|
1232
1286
|
}), this.elements = a;
|
|
1233
1287
|
}
|
|
1288
|
+
_renewVgsJwt({ paymentId: e, checkoutKey: t }) {
|
|
1289
|
+
if (e && t) return o({
|
|
1290
|
+
id: e,
|
|
1291
|
+
checkoutKey: t,
|
|
1292
|
+
environment: this._config.environment
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1234
1295
|
async associatePayment(e, t) {
|
|
1235
1296
|
if (!e || !t) throw Error("paymentId and checkoutKey are required");
|
|
1236
1297
|
let n = ++this._associationSequence;
|
|
1237
|
-
this._readiness.start(e),
|
|
1298
|
+
this._readiness.start(e), re(this._config.environment);
|
|
1238
1299
|
let r;
|
|
1239
1300
|
try {
|
|
1240
|
-
r = await
|
|
1301
|
+
r = await pe({
|
|
1241
1302
|
id: e,
|
|
1242
1303
|
checkoutKey: t,
|
|
1243
1304
|
environment: this._config.environment
|
|
@@ -1245,15 +1306,15 @@ var De = class {
|
|
|
1245
1306
|
} catch (t) {
|
|
1246
1307
|
if (n === this._associationSequence) {
|
|
1247
1308
|
this._paymentState = {};
|
|
1248
|
-
let { ours: e, ...n } =
|
|
1309
|
+
let { ours: e, ...n } = l(t, k.CHECKOUT_DETAILS);
|
|
1249
1310
|
e ? this._readiness.fail(n) : this._readiness.exclude(n);
|
|
1250
1311
|
}
|
|
1251
|
-
throw b
|
|
1312
|
+
throw C(b.PAYMENT_ASSOCIATION_FAILED, {
|
|
1252
1313
|
payment_id: e,
|
|
1253
1314
|
error_message: t instanceof Error ? t.message : "Unknown error",
|
|
1254
|
-
stage:
|
|
1255
|
-
...
|
|
1256
|
-
}),
|
|
1315
|
+
stage: k.CHECKOUT_DETAILS,
|
|
1316
|
+
...E(t)
|
|
1317
|
+
}), m(t instanceof Error ? t : Error("Failed to associate payment"), { payment_id: e }), t;
|
|
1257
1318
|
}
|
|
1258
1319
|
n === this._associationSequence && (this._paymentState = {
|
|
1259
1320
|
paymentId: e,
|
|
@@ -1263,11 +1324,11 @@ var De = class {
|
|
|
1263
1324
|
currency: r.currency,
|
|
1264
1325
|
countryCode: r.countryCode
|
|
1265
1326
|
}
|
|
1266
|
-
}, this._readiness.markAssociated(), b
|
|
1327
|
+
}, this._readiness.markAssociated(), C(b.PAYMENT_ASSOCIATED, {
|
|
1267
1328
|
payment_id: e,
|
|
1268
1329
|
currency: r.currency,
|
|
1269
1330
|
country_code: r.countryCode
|
|
1270
|
-
}), this._card?.setEnvironment(this._config.environment), r.supportedPaymentMethods?.includes("card") ? r.vgsJwt ? (this._paymentState.vgsJwt = r.vgsJwt, this._paymentState.cardCapture = void 0, this._card?.setVgsJwt(r.vgsJwt)) : (this._paymentState.vgsJwt = void 0, this._paymentState.cardCapture = "unavailable", this._card?.markCaptureUnavailable()) : (this._paymentState.vgsJwt = void 0, this._paymentState.cardCapture = "unsupported", this._card?.resetCardCapture()), this._applePay?.setPaymentContext({
|
|
1331
|
+
}), this._card?.setEnvironment(this._config.environment), r.supportedPaymentMethods?.includes("card") ? r.vgsJwt ? (this._paymentState.vgsJwt = r.vgsJwt, this._paymentState.cardCapture = void 0, this._card?.setVgsJwt(r.vgsJwt, this._renewVgsJwt(this._paymentState))) : (this._paymentState.vgsJwt = void 0, this._paymentState.cardCapture = "unavailable", this._card?.markCaptureUnavailable()) : (this._paymentState.vgsJwt = void 0, this._paymentState.cardCapture = "unsupported", this._card?.resetCardCapture()), this._applePay?.setPaymentContext({
|
|
1271
1332
|
paymentId: e,
|
|
1272
1333
|
checkoutKey: t,
|
|
1273
1334
|
environment: this._config.environment,
|
|
@@ -1295,7 +1356,7 @@ var De = class {
|
|
|
1295
1356
|
};
|
|
1296
1357
|
}
|
|
1297
1358
|
async _getPayload() {
|
|
1298
|
-
let
|
|
1359
|
+
let e = this._email?.isMounted ? this._email.value : "", t = this._phone?.isMounted ? this._phone.value : void 0, n = this._addressStreet?.isMounted || this._addressCity?.isMounted || this._addressCountry?.isMounted || this._addressFirstName?.isMounted || this._addressLastName?.isMounted || this._cardholderName?.isMounted || this._addressState?.isMounted || this._addressZipCode?.isMounted ? {
|
|
1299
1360
|
street: this._addressStreet?.isMounted ? this._addressStreet.value : "",
|
|
1300
1361
|
city: this._addressCity?.isMounted ? this._addressCity.value : "",
|
|
1301
1362
|
country: this._addressCountry?.isMounted ? this._addressCountry.value : "",
|
|
@@ -1303,46 +1364,46 @@ var De = class {
|
|
|
1303
1364
|
lastName: this._addressLastName?.isMounted ? this._addressLastName.value : "",
|
|
1304
1365
|
state: this._addressState?.isMounted ? this._addressState.value : "",
|
|
1305
1366
|
zipCode: this._addressZipCode?.isMounted ? this._addressZipCode.value : ""
|
|
1306
|
-
} : void 0,
|
|
1367
|
+
} : void 0, r = this._cardholderName?.isMounted ? this._cardholderName.value : "", i = [n?.firstName ?? "", n?.lastName ?? ""].filter(Boolean), a = r || i.join(" ");
|
|
1307
1368
|
if (!this._card?.isMounted || this._card.captureState === "unsupported") return {
|
|
1308
1369
|
ok: !1,
|
|
1309
1370
|
error: {
|
|
1310
|
-
message:
|
|
1371
|
+
message: Ve,
|
|
1311
1372
|
status: 0,
|
|
1312
1373
|
statusText: "No Payment Method",
|
|
1313
|
-
failureClass:
|
|
1374
|
+
failureClass: D.NOT_SENT
|
|
1314
1375
|
}
|
|
1315
1376
|
};
|
|
1316
|
-
if (!this._card.isVgsMode) return b
|
|
1377
|
+
if (!this._card.isVgsMode) return C(b.CARD_CAPTURE_UNAVAILABLE, { reason: x.NO_TOKENIZATION_SESSION }), {
|
|
1317
1378
|
ok: !1,
|
|
1318
|
-
error:
|
|
1379
|
+
error: T({
|
|
1319
1380
|
message: d().t("cardUnavailable"),
|
|
1320
1381
|
status: 0,
|
|
1321
1382
|
statusText: "Card Capture Unavailable",
|
|
1322
|
-
failureClass:
|
|
1323
|
-
},
|
|
1383
|
+
failureClass: D.NOT_SENT
|
|
1384
|
+
}, O.CAPTURE_UNAVAILABLE)
|
|
1324
1385
|
};
|
|
1325
1386
|
try {
|
|
1326
|
-
let
|
|
1387
|
+
let r = await this._card.getPayload();
|
|
1327
1388
|
return {
|
|
1328
1389
|
ok: !0,
|
|
1329
1390
|
formData: {
|
|
1330
|
-
name:
|
|
1331
|
-
email:
|
|
1332
|
-
phoneNumber:
|
|
1333
|
-
billingAddress:
|
|
1334
|
-
vgsCardData:
|
|
1391
|
+
name: a,
|
|
1392
|
+
email: e,
|
|
1393
|
+
phoneNumber: t || void 0,
|
|
1394
|
+
billingAddress: n,
|
|
1395
|
+
vgsCardData: r
|
|
1335
1396
|
}
|
|
1336
1397
|
};
|
|
1337
|
-
} catch (
|
|
1398
|
+
} catch (e) {
|
|
1338
1399
|
return {
|
|
1339
1400
|
ok: !1,
|
|
1340
|
-
error:
|
|
1341
|
-
message:
|
|
1401
|
+
error: T({
|
|
1402
|
+
message: Be,
|
|
1342
1403
|
status: 0,
|
|
1343
1404
|
statusText: "Card Tokenization Failed",
|
|
1344
|
-
failureClass:
|
|
1345
|
-
},
|
|
1405
|
+
failureClass: D.NOT_SENT
|
|
1406
|
+
}, me(e) ?? O.SDK_ERROR)
|
|
1346
1407
|
};
|
|
1347
1408
|
}
|
|
1348
1409
|
}
|
|
@@ -1387,13 +1448,13 @@ var De = class {
|
|
|
1387
1448
|
setCallbacks(e) {
|
|
1388
1449
|
Object.assign(this._callbacks, e);
|
|
1389
1450
|
}
|
|
1390
|
-
_onApplePayStartFailed = (e) => this._readiness.reportSubmit(
|
|
1451
|
+
_onApplePayStartFailed = (e) => this._readiness.reportSubmit(ie(e));
|
|
1391
1452
|
_onApplePayPaymentDataFailed = (e) => this._readiness.reportSubmit(e);
|
|
1392
1453
|
_trackElement(e) {
|
|
1393
1454
|
e.setMountFailureListener((e) => {
|
|
1394
|
-
e ===
|
|
1455
|
+
e === y.MOUNT_FAILED ? this._readiness.fail({ reason: e }) : this._readiness.exclude({ reason: e });
|
|
1395
1456
|
}), e.on("ready", () => {
|
|
1396
|
-
this._mountedReported || (this._mountedReported = !0, b
|
|
1457
|
+
this._mountedReported || (this._mountedReported = !0, C(b.CHECKOUT_MOUNTED, { container_id: "elements" })), this._readiness.markMounted(), this._settleLoad();
|
|
1397
1458
|
}), e.on("change", () => {
|
|
1398
1459
|
for (let e of this._changeListeners) e();
|
|
1399
1460
|
});
|
|
@@ -1419,50 +1480,50 @@ var De = class {
|
|
|
1419
1480
|
this._error
|
|
1420
1481
|
].filter((e) => e !== void 0);
|
|
1421
1482
|
}
|
|
1422
|
-
async _executeAuthorization({ formData:
|
|
1423
|
-
let { paymentId:
|
|
1424
|
-
if (!
|
|
1425
|
-
message:
|
|
1483
|
+
async _executeAuthorization({ formData: t, applePayData: n, customCustomerData: r }) {
|
|
1484
|
+
let { paymentId: i, checkoutKey: a } = this._paymentState, o = this._getPaymentMethod(t, n);
|
|
1485
|
+
if (!i || !a) return this._reportSubmitFailure({
|
|
1486
|
+
message: He,
|
|
1426
1487
|
status: 0,
|
|
1427
1488
|
statusText: "No Associated Payment",
|
|
1428
|
-
failureClass:
|
|
1429
|
-
},
|
|
1430
|
-
this._emitLoadingState(!0), b
|
|
1431
|
-
payment_id:
|
|
1432
|
-
payment_method:
|
|
1489
|
+
failureClass: D.NOT_SENT
|
|
1490
|
+
}, o), !1;
|
|
1491
|
+
this._emitLoadingState(!0), C(b.PAYMENT_SUBMIT_STARTED, {
|
|
1492
|
+
payment_id: i,
|
|
1493
|
+
payment_method: o
|
|
1433
1494
|
});
|
|
1434
|
-
let
|
|
1495
|
+
let s = performance.now();
|
|
1435
1496
|
try {
|
|
1436
|
-
let
|
|
1437
|
-
paymentId:
|
|
1438
|
-
checkoutKey:
|
|
1439
|
-
formData:
|
|
1497
|
+
let e = await this._apiService.authorizePayment({
|
|
1498
|
+
paymentId: i,
|
|
1499
|
+
checkoutKey: a,
|
|
1500
|
+
formData: t,
|
|
1440
1501
|
returnUrl: this._config.returnUrl,
|
|
1441
|
-
applePayData:
|
|
1442
|
-
customCustomerData:
|
|
1502
|
+
applePayData: n,
|
|
1503
|
+
customCustomerData: r
|
|
1443
1504
|
});
|
|
1444
1505
|
return this._readiness.reportSubmit({
|
|
1445
|
-
outcome:
|
|
1446
|
-
paymentMethod:
|
|
1447
|
-
}),
|
|
1448
|
-
payment_id:
|
|
1449
|
-
payment_method:
|
|
1506
|
+
outcome: ce.SUCCEEDED,
|
|
1507
|
+
paymentMethod: o
|
|
1508
|
+
}), h(p.PAYMENT_AUTHORIZATION_TIME, performance.now() - s, "ms", {
|
|
1509
|
+
payment_id: i,
|
|
1510
|
+
payment_method: o,
|
|
1450
1511
|
status: "success"
|
|
1451
|
-
}), b
|
|
1452
|
-
payment_id:
|
|
1453
|
-
payment_method:
|
|
1454
|
-
}), this._handlePaymentResponse(
|
|
1455
|
-
} catch (
|
|
1456
|
-
return
|
|
1457
|
-
payment_id:
|
|
1458
|
-
payment_method:
|
|
1512
|
+
}), C(b.PAYMENT_SUBMIT_SUCCESS, {
|
|
1513
|
+
payment_id: i,
|
|
1514
|
+
payment_method: o
|
|
1515
|
+
}), this._handlePaymentResponse(e);
|
|
1516
|
+
} catch (t) {
|
|
1517
|
+
return h(p.PAYMENT_AUTHORIZATION_TIME, performance.now() - s, "ms", {
|
|
1518
|
+
payment_id: i,
|
|
1519
|
+
payment_method: o,
|
|
1459
1520
|
status: "failed"
|
|
1460
|
-
}), b
|
|
1461
|
-
payment_id:
|
|
1462
|
-
payment_method:
|
|
1463
|
-
error_message: this._readErrorMessage(
|
|
1464
|
-
...
|
|
1465
|
-
}), this._readiness.reportSubmit(
|
|
1521
|
+
}), C(b.PAYMENT_SUBMIT_FAILED, {
|
|
1522
|
+
payment_id: i,
|
|
1523
|
+
payment_method: o,
|
|
1524
|
+
error_message: this._readErrorMessage(t, "Unknown error"),
|
|
1525
|
+
...E(t)
|
|
1526
|
+
}), this._readiness.reportSubmit(e(t, o)), this._handleAuthorizationError(t), !1;
|
|
1466
1527
|
} finally {
|
|
1467
1528
|
this._emitLoadingState(!1);
|
|
1468
1529
|
}
|
|
@@ -1476,37 +1537,37 @@ var De = class {
|
|
|
1476
1537
|
} catch {}
|
|
1477
1538
|
}
|
|
1478
1539
|
_handlePaymentResponse(e) {
|
|
1479
|
-
let t = this._paymentState.paymentId ?? "", n =
|
|
1480
|
-
return n === "authorized" ? (b
|
|
1540
|
+
let t = this._paymentState.paymentId ?? "", n = be(e);
|
|
1541
|
+
return n === "authorized" ? (C(b.PAYMENT_AUTHORIZED, {
|
|
1481
1542
|
payment_id: t,
|
|
1482
1543
|
status: n
|
|
1483
|
-
}),
|
|
1544
|
+
}), v(() => this._callbacks.onPaymentSucceeded?.(n)), !0) : n === "failed" ? (C(b.PAYMENT_FAILED, {
|
|
1484
1545
|
payment_id: t,
|
|
1485
1546
|
status: n
|
|
1486
|
-
}),
|
|
1547
|
+
}), v(() => this._callbacks.onPaymentFailed?.(n)), !1) : e.status === "requires_action" && (C(b.PAYMENT_ACTION_REQUIRED, {
|
|
1487
1548
|
payment_id: t,
|
|
1488
1549
|
status: e.status
|
|
1489
|
-
}),
|
|
1550
|
+
}), v(() => this._callbacks.onActionRequired?.(e.action.redirectUrl)), !0);
|
|
1490
1551
|
}
|
|
1491
|
-
_reportSubmitFailure(
|
|
1492
|
-
let
|
|
1552
|
+
_reportSubmitFailure(t, n) {
|
|
1553
|
+
let r = {
|
|
1493
1554
|
payment_id: this._paymentState.paymentId ?? "",
|
|
1494
|
-
payment_method:
|
|
1555
|
+
payment_method: n
|
|
1495
1556
|
};
|
|
1496
|
-
b
|
|
1497
|
-
...
|
|
1498
|
-
error_message: this._readErrorMessage(
|
|
1499
|
-
...
|
|
1500
|
-
}), this._readiness.reportSubmit(
|
|
1557
|
+
C(b.PAYMENT_SUBMIT_STARTED, r), C(b.PAYMENT_SUBMIT_FAILED, {
|
|
1558
|
+
...r,
|
|
1559
|
+
error_message: this._readErrorMessage(t, "Unknown error"),
|
|
1560
|
+
...E(t)
|
|
1561
|
+
}), this._readiness.reportSubmit(e(t, n)), this._handleAuthorizationError(t);
|
|
1501
1562
|
}
|
|
1502
1563
|
_handleAuthorizationError(e) {
|
|
1503
|
-
let t = this._readErrorMessage(e,
|
|
1564
|
+
let t = this._readErrorMessage(e, ze);
|
|
1504
1565
|
this._callbacks.onPaymentFailed?.(t), this._error?.isMounted && this._error.setError(t);
|
|
1505
1566
|
}
|
|
1506
1567
|
_readErrorMessage(e, t) {
|
|
1507
1568
|
let n = e;
|
|
1508
|
-
return typeof n?.message == "string" && n.message ? n.message :
|
|
1569
|
+
return typeof n?.message == "string" && n.message ? n.message : ne(n?.details) ?? t;
|
|
1509
1570
|
}
|
|
1510
1571
|
};
|
|
1511
1572
|
//#endregion
|
|
1512
|
-
export { R as AddressCityElement, B as AddressCountryElement, V as AddressFirstNameElement, H as AddressLastNameElement, U as AddressStateElement, W as AddressStreetElement, G as AddressZipCodeElement, K as ApplePayElement, L as BaseElement,
|
|
1573
|
+
export { R as AddressCityElement, B as AddressCountryElement, V as AddressFirstNameElement, H as AddressLastNameElement, U as AddressStateElement, W as AddressStreetElement, G as AddressZipCodeElement, K as ApplePayElement, L as BaseElement, X as CardElement, Z as CardholderElement, Q as EmailElement, $ as ErrorElement, Ue as OdusElements, Fe as PayPalElement, Re as PhoneElement };
|