@odus/checkout 1.7.10 → 1.8.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.
- package/dist/checkout.es.js +2 -1
- package/dist/elements/OdusElements.d.ts +3 -0
- package/dist/elements/OdusElements.d.ts.map +1 -1
- package/dist/elements.es.js +202 -148
- package/dist/index.css +1 -1
- package/dist/services/checkout/Checkout.service.d.ts.map +1 -1
- package/dist/services/telemetry/Telemetry.service.d.ts +2 -0
- package/dist/services/telemetry/Telemetry.service.d.ts.map +1 -1
- package/dist/shared.js +763 -755
- package/package.json +1 -1
package/dist/elements.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as e, C as t, F as n,
|
|
1
|
+
import { B as e, C as t, F as n, G as r, H as i, J as a, K as o, L as s, P as c, R as l, S as ee, U as u, V as d, a as f, b as p, c as m, h, i as g, l as _, m as v, n as te, o as y, q as b, r as ne, t as x, u as S, w as re, y as ie, z as C } from "./shared.js";
|
|
2
2
|
//#region libs/checkout/src/assets/styles/helperText.css?inline
|
|
3
|
-
var
|
|
3
|
+
var w = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);max-height:100px;margin-top:4px;font-size:12px;font-weight:500;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;display:block;overflow:hidden}.form-helper-text-hidden{opacity:0;max-height:0;margin-top:0;overflow:hidden}.form-helper-text-hint{color:var(--odus-color-muted,#6b7280);font-weight:400}", T = ".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}", E = ".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)}", D = ":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}", O = class {
|
|
4
4
|
shadowRoot = null;
|
|
5
5
|
host = null;
|
|
6
6
|
options = {};
|
|
@@ -64,9 +64,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
64
64
|
this.options.callbacks?.[e]?.(t);
|
|
65
65
|
}
|
|
66
66
|
getCss() {
|
|
67
|
-
return
|
|
67
|
+
return D;
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, k = class extends O {
|
|
70
70
|
_value = "";
|
|
71
71
|
_error = null;
|
|
72
72
|
_input = null;
|
|
@@ -74,7 +74,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
74
74
|
if (!this.shadowRoot) return;
|
|
75
75
|
this._input?.getElement().remove();
|
|
76
76
|
let { t: e } = t();
|
|
77
|
-
this._input = new
|
|
77
|
+
this._input = new S({
|
|
78
78
|
name: "billingAddress.city",
|
|
79
79
|
label: this.options.label ?? e("address.townCity"),
|
|
80
80
|
error: !1,
|
|
@@ -91,9 +91,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
91
91
|
}
|
|
92
92
|
getCss() {
|
|
93
93
|
return super.getCss() + [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
T,
|
|
95
|
+
E,
|
|
96
|
+
w
|
|
97
97
|
].join("\n") + "\n :host { display: block; }\n .form-input {\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: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus {\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 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 ";
|
|
98
98
|
}
|
|
99
99
|
getValue() {
|
|
@@ -105,7 +105,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
105
105
|
getError() {
|
|
106
106
|
return this._error;
|
|
107
107
|
}
|
|
108
|
-
},
|
|
108
|
+
}, A = ".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-select{opacity:1;letter-spacing:.02em;padding:var(--odus-input-padding,8px 12px);z-index:0;box-sizing:border-box;cursor:pointer;appearance:none;background:#fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='%23717173' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") right 12px center no-repeat;border:none;outline:none;flex:1;width:100%;min-height:0;padding-right:32px;font-weight:400;line-height:1.5;transition:box-shadow .1s ease-in,border-radius .2s ease-in;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.form-select-error{box-shadow:0 0 0 1px var(--odus-color-error,#dc2727), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d}.form-select-placeholder{color:#d4d4d5}.form-select option[disabled]{color:#717173;opacity:.5}.form-select:focus{z-index:2;position:relative;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}", j = class extends O {
|
|
109
109
|
_value = "";
|
|
110
110
|
_error = null;
|
|
111
111
|
_select = null;
|
|
@@ -117,13 +117,13 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
117
117
|
if (!this.shadowRoot) return;
|
|
118
118
|
this._select?.getElement().remove(), this.options.initialValue && !this._value && (this._value = String(this.options.initialValue), this.emit("change", this._value));
|
|
119
119
|
let { t: e, locale: n } = t();
|
|
120
|
-
this._select = new
|
|
120
|
+
this._select = new _({
|
|
121
121
|
name: "billingAddress.country",
|
|
122
122
|
label: this.options.label ?? e("address.chooseCountry"),
|
|
123
123
|
error: !1,
|
|
124
124
|
placeholder: this.options.placeholder ?? e("address.chooseCountry"),
|
|
125
125
|
value: this._value,
|
|
126
|
-
options:
|
|
126
|
+
options: h(this._allowedCountries, n),
|
|
127
127
|
autocomplete: "country",
|
|
128
128
|
onChange: (e) => {
|
|
129
129
|
this._value = e.target.value, this._error = null, this.emit("change", this._value);
|
|
@@ -135,9 +135,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
135
135
|
}
|
|
136
136
|
getCss() {
|
|
137
137
|
return super.getCss() + [
|
|
138
|
+
E,
|
|
138
139
|
w,
|
|
139
|
-
|
|
140
|
-
O
|
|
140
|
+
A
|
|
141
141
|
].join("\n") + "\n :host { display: block; }\n .form-select {\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-color: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\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 }\n .form-select:focus {\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 outline: none !important;\n }\n .form-select-error {\n color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
142
142
|
}
|
|
143
143
|
getValue() {
|
|
@@ -149,7 +149,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
149
149
|
getError() {
|
|
150
150
|
return this._error;
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, M = class extends O {
|
|
153
153
|
_value = "";
|
|
154
154
|
_error = null;
|
|
155
155
|
_input = null;
|
|
@@ -157,7 +157,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
157
157
|
if (!this.shadowRoot) return;
|
|
158
158
|
this._input?.getElement().remove();
|
|
159
159
|
let { t: e } = t();
|
|
160
|
-
this._input = new
|
|
160
|
+
this._input = new S({
|
|
161
161
|
name: "billingAddress.firstName",
|
|
162
162
|
label: this.options.label ?? e("address.firstName"),
|
|
163
163
|
error: !1,
|
|
@@ -174,9 +174,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
174
174
|
}
|
|
175
175
|
getCss() {
|
|
176
176
|
return super.getCss() + [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
T,
|
|
178
|
+
E,
|
|
179
|
+
w
|
|
180
180
|
].join("\n") + "\n :host { display: block; }\n .form-input {\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: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus {\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 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 ";
|
|
181
181
|
}
|
|
182
182
|
getValue() {
|
|
@@ -188,7 +188,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
188
188
|
getError() {
|
|
189
189
|
return this._error;
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, N = class extends O {
|
|
192
192
|
_value = "";
|
|
193
193
|
_error = null;
|
|
194
194
|
_input = null;
|
|
@@ -196,7 +196,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
196
196
|
if (!this.shadowRoot) return;
|
|
197
197
|
this._input?.getElement().remove();
|
|
198
198
|
let { t: e } = t();
|
|
199
|
-
this._input = new
|
|
199
|
+
this._input = new S({
|
|
200
200
|
name: "billingAddress.lastName",
|
|
201
201
|
label: this.options.label ?? e("address.lastName"),
|
|
202
202
|
error: !1,
|
|
@@ -213,9 +213,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
213
213
|
}
|
|
214
214
|
getCss() {
|
|
215
215
|
return super.getCss() + [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
T,
|
|
217
|
+
E,
|
|
218
|
+
w
|
|
219
219
|
].join("\n") + "\n :host { display: block; }\n .form-input {\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: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus {\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 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 ";
|
|
220
220
|
}
|
|
221
221
|
getValue() {
|
|
@@ -227,7 +227,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
227
227
|
getError() {
|
|
228
228
|
return this._error;
|
|
229
229
|
}
|
|
230
|
-
},
|
|
230
|
+
}, P = /* @__PURE__ */ new Set(["US", "CA"]), F = class extends O {
|
|
231
231
|
_value = "";
|
|
232
232
|
_country = "";
|
|
233
233
|
_input = null;
|
|
@@ -235,17 +235,17 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
235
235
|
setCountry(e) {
|
|
236
236
|
let n = this._country;
|
|
237
237
|
if (this._country = e, !this.shadowRoot) return;
|
|
238
|
-
let r =
|
|
238
|
+
let r = P.has(n), i = P.has(e);
|
|
239
239
|
if (r && i && n !== e) {
|
|
240
240
|
let { t: n } = t(), r = e, i = n(r === "US" ? "address.chooseState" : "address.chooseProvince");
|
|
241
|
-
this._select?.setOptions(
|
|
241
|
+
this._select?.setOptions(v(r), this.options.placeholder ?? i), this._value = "", this.emit("change", this._value);
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
244
|
r !== i && (this._value = "", this.render(), this.emit("change", this._value));
|
|
245
245
|
}
|
|
246
246
|
render() {
|
|
247
247
|
if (this.shadowRoot) {
|
|
248
|
-
if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null,
|
|
248
|
+
if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, P.has(this._country)) {
|
|
249
249
|
let e = this._country;
|
|
250
250
|
this._renderSelect(e);
|
|
251
251
|
} else this._renderInput();
|
|
@@ -253,7 +253,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
253
253
|
}
|
|
254
254
|
_renderInput() {
|
|
255
255
|
let { t: e } = t();
|
|
256
|
-
this._input = new
|
|
256
|
+
this._input = new S({
|
|
257
257
|
name: "billingAddress.state",
|
|
258
258
|
label: this.options.label ?? e("address.state"),
|
|
259
259
|
error: !1,
|
|
@@ -269,8 +269,8 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
269
269
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
270
270
|
}
|
|
271
271
|
_renderSelect(e) {
|
|
272
|
-
let { t: n } = t(), r =
|
|
273
|
-
this._select = new
|
|
272
|
+
let { t: n } = t(), r = v(e), i = n(e === "US" ? "address.chooseState" : "address.chooseProvince");
|
|
273
|
+
this._select = new _({
|
|
274
274
|
name: "billingAddress.state",
|
|
275
275
|
label: this.options.label ?? n("address.state"),
|
|
276
276
|
error: !1,
|
|
@@ -288,10 +288,10 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
288
288
|
}
|
|
289
289
|
getCss() {
|
|
290
290
|
return super.getCss() + [
|
|
291
|
-
|
|
291
|
+
T,
|
|
292
|
+
E,
|
|
292
293
|
w,
|
|
293
|
-
|
|
294
|
-
O
|
|
294
|
+
A
|
|
295
295
|
].join("\n") + "\n :host { display: block; }\n .form-input,\n .form-select {\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-color: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus,\n .form-select:focus {\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 outline: none !important;\n }\n .form-input-error,\n .form-select-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 ";
|
|
296
296
|
}
|
|
297
297
|
getValue() {
|
|
@@ -305,7 +305,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
305
305
|
let { t: e } = t();
|
|
306
306
|
return e("validation.stateRequired");
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, I = class extends O {
|
|
309
309
|
_value = "";
|
|
310
310
|
_error = null;
|
|
311
311
|
_input = null;
|
|
@@ -313,7 +313,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
313
313
|
if (!this.shadowRoot) return;
|
|
314
314
|
this._input?.getElement().remove();
|
|
315
315
|
let { t: e } = t();
|
|
316
|
-
this._input = new
|
|
316
|
+
this._input = new S({
|
|
317
317
|
name: "billingAddress.street",
|
|
318
318
|
label: this.options.label ?? e("address.addressLine1"),
|
|
319
319
|
error: !1,
|
|
@@ -335,9 +335,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
335
335
|
}
|
|
336
336
|
getCss() {
|
|
337
337
|
return super.getCss() + [
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
338
|
+
T,
|
|
339
|
+
E,
|
|
340
|
+
w
|
|
341
341
|
].join("\n") + "\n :host { display: block; }\n .form-input {\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: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus {\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 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 ";
|
|
342
342
|
}
|
|
343
343
|
getValue() {
|
|
@@ -349,7 +349,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
349
349
|
getError() {
|
|
350
350
|
return this._error;
|
|
351
351
|
}
|
|
352
|
-
},
|
|
352
|
+
}, L = class extends O {
|
|
353
353
|
_value = "";
|
|
354
354
|
_error = null;
|
|
355
355
|
_input = null;
|
|
@@ -357,7 +357,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
357
357
|
if (!this.shadowRoot) return;
|
|
358
358
|
this._input?.getElement().remove();
|
|
359
359
|
let { t: e } = t();
|
|
360
|
-
this._input = new
|
|
360
|
+
this._input = new S({
|
|
361
361
|
name: "billingAddress.zipCode",
|
|
362
362
|
label: this.options.label ?? e("address.postalCode"),
|
|
363
363
|
error: !1,
|
|
@@ -374,9 +374,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
374
374
|
}
|
|
375
375
|
getCss() {
|
|
376
376
|
return super.getCss() + [
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
377
|
+
T,
|
|
378
|
+
E,
|
|
379
|
+
w
|
|
380
380
|
].join("\n") + "\n :host { display: block; }\n .form-input {\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: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus {\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 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 ";
|
|
381
381
|
}
|
|
382
382
|
getValue() {
|
|
@@ -388,7 +388,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
388
388
|
getError() {
|
|
389
389
|
return this._error;
|
|
390
390
|
}
|
|
391
|
-
},
|
|
391
|
+
}, R = "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)}", z = {
|
|
392
392
|
name: "odus-elements",
|
|
393
393
|
styles: {
|
|
394
394
|
fontSize: 14,
|
|
@@ -412,7 +412,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
412
412
|
}
|
|
413
413
|
},
|
|
414
414
|
additionalPaymentMethods: {}
|
|
415
|
-
},
|
|
415
|
+
}, B = class extends O {
|
|
416
416
|
_paymentContext = null;
|
|
417
417
|
_applePayData = null;
|
|
418
418
|
_authorized = !1;
|
|
@@ -435,12 +435,12 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
435
435
|
this._setAvailability(!1);
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
438
|
-
if (!
|
|
438
|
+
if (!g()) {
|
|
439
439
|
this._setAvailability(!1);
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
|
-
this._button = new
|
|
443
|
-
checkoutProfile:
|
|
442
|
+
this._button = new ne({
|
|
443
|
+
checkoutProfile: z,
|
|
444
444
|
paymentId: e,
|
|
445
445
|
checkoutKey: t,
|
|
446
446
|
environment: n,
|
|
@@ -457,7 +457,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
457
457
|
this._isAvailable = e, this.host && (e ? this.host.style.removeProperty("display") : this.host.style.display = "none");
|
|
458
458
|
}
|
|
459
459
|
getCss() {
|
|
460
|
-
return super.getCss() +
|
|
460
|
+
return super.getCss() + R + "\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 ";
|
|
461
461
|
}
|
|
462
462
|
getValue() {
|
|
463
463
|
return this._applePayData;
|
|
@@ -468,7 +468,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
468
468
|
getError() {
|
|
469
469
|
return null;
|
|
470
470
|
}
|
|
471
|
-
},
|
|
471
|
+
}, V = ".card-element{border-radius:inherit;box-sizing:border-box;background:#fff;border:none;height:38.5px;padding:0;transition:box-shadow .1s ease-in;position:relative;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.card-element iframe{width:100%;min-width:0;display:block}.card-element-focus{box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}.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}", H = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvWpIQFjQQCPpaIlJKpegirp5kLkzLB1AxHmnLk73D3TJbAGqr1QmlsWDBtMPMRpdzzUM7ZwX3kzhIuATV4Pe7RKp3nZlVmcrT0YCQXBrTwqZNh775z58GP2kZs+gVfNqBampJPzSB/hB62KkByhECn6grrRjiAVwJyZVEvs/2vrxaEpO+aE16emtX12RgI5JdzdOiNyZEQteU6zRBRJEocPWVxExaOpVVVJ5+UnW0LcalzA+lRGRTrQJ5JguAPiAOzRPTK/lYFFpCAl/F8wtoAVG1c8zO2NcQ0Pko+fmeidRFxJ/did2btV+9Mkze3mBphwFmvnxa35LF+Cs/XJHDwIDAQAB", U = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8gGPMwBRPuVyJReZGIkWH/+Bf5pnpDN1bSR2cLYLXVT8CaSnTw74qeboSnktgYCi1D9R3Bj2fYzTIwGGZb8KinLdxwbqZmHwrE9cFhCaHbG/E0PbqQGhXP2vbniZTT4M0i0Cbi7ES3Bw5zqNbIZZnX041QEpxLvIyWPKZCX+fBogNMhWfCF779aclChjHkwZMsufThVWE9xklWGxXiytx5aL4I5JPxq0I7cAkZGGs4aF/GxWwPaq7R3wPikJQ0YHnCMfcURzl2Hnw/inqyMy+JB6djTq2/BdzMAhWTh3cDWq9Xu+gEkb/QCd0n1yYIdKuDISlk/AfHdWe34IvzhVyQIDAQAB", W = {
|
|
472
472
|
name: "odus-elements",
|
|
473
473
|
styles: {
|
|
474
474
|
fontSize: 14,
|
|
@@ -492,12 +492,12 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
492
492
|
}
|
|
493
493
|
},
|
|
494
494
|
additionalPaymentMethods: {}
|
|
495
|
-
},
|
|
495
|
+
}, G = class {
|
|
496
496
|
_cardNumber = "";
|
|
497
497
|
_cardExpiry = "";
|
|
498
498
|
_cardCvv = "";
|
|
499
499
|
_section = null;
|
|
500
|
-
_focusManager = new
|
|
500
|
+
_focusManager = new ie();
|
|
501
501
|
_touchedFields = /* @__PURE__ */ new Set();
|
|
502
502
|
_focusHandlers = [];
|
|
503
503
|
get section() {
|
|
@@ -505,16 +505,16 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
505
505
|
}
|
|
506
506
|
renderSection(e, r, i) {
|
|
507
507
|
this._section?.getElement().remove();
|
|
508
|
-
let { t:
|
|
509
|
-
this._section = new
|
|
510
|
-
checkoutProfile:
|
|
508
|
+
let { t: a } = t();
|
|
509
|
+
this._section = new y({
|
|
510
|
+
checkoutProfile: W,
|
|
511
511
|
cardNumber: this._cardNumber,
|
|
512
512
|
cardNumberTouched: !1,
|
|
513
513
|
cardCvv: this._cardCvv,
|
|
514
514
|
cardCvvTouched: !1,
|
|
515
515
|
cardExpiry: this._cardExpiry,
|
|
516
516
|
cardExpiryTouched: !1,
|
|
517
|
-
translationFunc:
|
|
517
|
+
translationFunc: a,
|
|
518
518
|
onChange: (e) => {
|
|
519
519
|
let t = e.target;
|
|
520
520
|
if (t.name === "cardNumber") this._cardNumber = t.value;
|
|
@@ -525,7 +525,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
525
525
|
this._touchedFields.add(t.name), this._updateFocusManagerState(), r(this.getValue());
|
|
526
526
|
},
|
|
527
527
|
onBlur: (e) => {
|
|
528
|
-
let t = e.target, n = t.name ?? "cardExpiry", r =
|
|
528
|
+
let t = e.target, n = t.name ?? "cardExpiry", r = c();
|
|
529
529
|
if (this._touchedFields.add(n), t.name === "cardNumber") {
|
|
530
530
|
let e = r.cardNumber(this._cardNumber);
|
|
531
531
|
this._section?.updateCardNumber(this._cardNumber, e, !0);
|
|
@@ -548,7 +548,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
550
|
async getPayload(t) {
|
|
551
|
-
let n = t === "live" ?
|
|
551
|
+
let n = t === "live" ? U : H, r = new e();
|
|
552
552
|
r.setPublicKey(n);
|
|
553
553
|
let i = this._cardNumber.replace(/\s+/g, ""), a = this._cardExpiry.replace(/\s+/g, "").split("/"), o = a[0] ?? "", s = a[1] ?? "";
|
|
554
554
|
return s.length === 2 && (s = `20${s}`), {
|
|
@@ -559,11 +559,11 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
561
|
isValid() {
|
|
562
|
-
let e =
|
|
562
|
+
let e = c(), t = this._cardCvv.length >= 3;
|
|
563
563
|
return !e.cardNumber(this._cardNumber) && !e.cardExpiry(this._cardExpiry) && t;
|
|
564
564
|
}
|
|
565
565
|
getError() {
|
|
566
|
-
let e =
|
|
566
|
+
let e = c();
|
|
567
567
|
return e.cardNumber(this._cardNumber) ?? e.cardExpiry(this._cardExpiry) ?? null;
|
|
568
568
|
}
|
|
569
569
|
destroy() {
|
|
@@ -589,19 +589,19 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
589
589
|
this._focusHandlers = [];
|
|
590
590
|
}
|
|
591
591
|
_updateFocusManagerState() {
|
|
592
|
-
let e =
|
|
592
|
+
let e = c(), t = {
|
|
593
593
|
cardNumber: this._cardNumber,
|
|
594
594
|
cardExpiry: this._cardExpiry,
|
|
595
595
|
cardCvv: this._cardCvv,
|
|
596
596
|
name: "",
|
|
597
597
|
email: ""
|
|
598
|
-
}, n = {}, r = e.cardNumber(this._cardNumber), i = e.cardExpiry(this._cardExpiry),
|
|
599
|
-
r && (n.cardNumber = r), i && (n.cardExpiry = i),
|
|
600
|
-
let
|
|
601
|
-
for (let e of this._touchedFields)
|
|
602
|
-
this._focusManager.handleStateUpdate(t, n,
|
|
598
|
+
}, n = {}, r = e.cardNumber(this._cardNumber), i = e.cardExpiry(this._cardExpiry), a = e.cardCvv(this._cardCvv, this._cardNumber);
|
|
599
|
+
r && (n.cardNumber = r), i && (n.cardExpiry = i), a && (n.cardCvv = a);
|
|
600
|
+
let o = {};
|
|
601
|
+
for (let e of this._touchedFields) o[e] = !0;
|
|
602
|
+
this._focusManager.handleStateUpdate(t, n, o);
|
|
603
603
|
}
|
|
604
|
-
},
|
|
604
|
+
}, K = {
|
|
605
605
|
"--odus-font-family": "system-ui, sans-serif",
|
|
606
606
|
"--odus-font-size": "16px",
|
|
607
607
|
"--odus-color-error": "#dc2727",
|
|
@@ -624,7 +624,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
624
624
|
"--odus-card-gap": "12px",
|
|
625
625
|
"--odus-button-height": "48px",
|
|
626
626
|
"--odus-button-border-radius": "var(--odus-border-radius)"
|
|
627
|
-
}["--odus-font-size"],
|
|
627
|
+
}["--odus-font-size"], q = class {
|
|
628
628
|
_vgsService;
|
|
629
629
|
_vgsJwt;
|
|
630
630
|
_vgsState = {};
|
|
@@ -635,7 +635,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
635
635
|
_section = null;
|
|
636
636
|
_initGeneration = 0;
|
|
637
637
|
constructor(e, t) {
|
|
638
|
-
this._vgsJwt = e, this._environment = t, this._vgsService = new
|
|
638
|
+
this._vgsJwt = e, this._environment = t, this._vgsService = new s();
|
|
639
639
|
}
|
|
640
640
|
get section() {
|
|
641
641
|
return this._section;
|
|
@@ -643,8 +643,8 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
643
643
|
renderSection(e, n) {
|
|
644
644
|
this._section?.getElement().remove();
|
|
645
645
|
let { t: r } = t();
|
|
646
|
-
this._section = new
|
|
647
|
-
checkoutProfile:
|
|
646
|
+
this._section = new y({
|
|
647
|
+
checkoutProfile: W,
|
|
648
648
|
cardNumber: "",
|
|
649
649
|
cardNumberTouched: !1,
|
|
650
650
|
cardCvv: "",
|
|
@@ -683,7 +683,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
683
683
|
if (!n?.isTouched || n.isFocused || n.isValid) continue;
|
|
684
684
|
let r = n.errors?.[0];
|
|
685
685
|
if (!r) continue;
|
|
686
|
-
let i =
|
|
686
|
+
let i = m(t, r.code);
|
|
687
687
|
if (i) return e(i);
|
|
688
688
|
}
|
|
689
689
|
return null;
|
|
@@ -707,19 +707,19 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
707
707
|
}
|
|
708
708
|
_reinitWithTheme() {
|
|
709
709
|
this._vgsReinitTimer && clearTimeout(this._vgsReinitTimer), this._vgsReinitTimer = setTimeout(() => {
|
|
710
|
-
this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new
|
|
710
|
+
this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new s(), this._section?.setVgsService(this._vgsService), this.initVgs();
|
|
711
711
|
}, 300);
|
|
712
712
|
}
|
|
713
713
|
_buildProfileFromTheme(e) {
|
|
714
|
-
let t = e["--odus-input-font-size"] ?? e["--odus-font-size"] ??
|
|
714
|
+
let t = e["--odus-input-font-size"] ?? e["--odus-font-size"] ?? K, n = e["--odus-font-family"] ?? W.styles.fontFamily, r = e["--odus-color-text"] ?? W.styles.textColor, i = e["--odus-border-radius"] ?? `${W.styles.borderRadius}px`;
|
|
715
715
|
return {
|
|
716
|
-
...
|
|
716
|
+
...W,
|
|
717
717
|
styles: {
|
|
718
|
-
...
|
|
719
|
-
fontSize: parseInt(t, 10) || parseInt(
|
|
718
|
+
...W.styles,
|
|
719
|
+
fontSize: parseInt(t, 10) || parseInt(K, 10),
|
|
720
720
|
fontFamily: n,
|
|
721
721
|
textColor: r,
|
|
722
|
-
borderRadius: parseInt(i, 10) ||
|
|
722
|
+
borderRadius: parseInt(i, 10) || W.styles.borderRadius
|
|
723
723
|
}
|
|
724
724
|
};
|
|
725
725
|
}
|
|
@@ -733,7 +733,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
733
733
|
let t = document.getElementById(e);
|
|
734
734
|
t && t.querySelectorAll("iframe").forEach((e) => e.remove());
|
|
735
735
|
}
|
|
736
|
-
let a = await
|
|
736
|
+
let a = await p(n.styles.fontFamily);
|
|
737
737
|
if (e !== this._initGeneration) return;
|
|
738
738
|
let o = this._section.buildVgsFieldCss(n, a, {
|
|
739
739
|
borderColor: r,
|
|
@@ -768,16 +768,16 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
768
768
|
if (!r?.isTouched || r.isFocused || r.isValid) continue;
|
|
769
769
|
let i = r.errors?.[0];
|
|
770
770
|
if (!i) continue;
|
|
771
|
-
let a =
|
|
771
|
+
let a = m(n, i.code);
|
|
772
772
|
a && (t[n] = e(a));
|
|
773
773
|
}
|
|
774
774
|
return t;
|
|
775
775
|
}
|
|
776
|
-
},
|
|
776
|
+
}, J = class extends O {
|
|
777
777
|
_environment = "test";
|
|
778
778
|
_isVgsMode = !1;
|
|
779
779
|
_mountContainer = null;
|
|
780
|
-
_nativeAdapter = new
|
|
780
|
+
_nativeAdapter = new G();
|
|
781
781
|
_vgsAdapter = null;
|
|
782
782
|
get isVgsMode() {
|
|
783
783
|
return this._isVgsMode;
|
|
@@ -786,7 +786,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
786
786
|
this._environment = e;
|
|
787
787
|
}
|
|
788
788
|
setVgsJwt(e) {
|
|
789
|
-
this._isVgsMode = !0, this._vgsAdapter = new
|
|
789
|
+
this._isVgsMode = !0, this._vgsAdapter = new q(e, this._environment), this.isMounted && this._mountContainer && (this.unmount(), this.mount(this._mountContainer));
|
|
790
790
|
}
|
|
791
791
|
mount(e) {
|
|
792
792
|
this.isMounted && this.unmount();
|
|
@@ -827,10 +827,10 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
827
827
|
}
|
|
828
828
|
getCss() {
|
|
829
829
|
return super.getCss() + [
|
|
830
|
-
|
|
830
|
+
T,
|
|
831
|
+
E,
|
|
831
832
|
w,
|
|
832
|
-
|
|
833
|
-
R
|
|
833
|
+
V
|
|
834
834
|
].join("\n") + "\n :host { display: block; }\n .card-grid {\n display: flex;\n flex-direction: column;\n gap: var(--odus-card-gap, 12px);\n }\n .card-details {\n display: flex;\n gap: var(--odus-card-gap, 12px);\n }\n .form-input,\n .form-select {\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: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus,\n .form-select:focus {\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 outline: none !important;\n }\n .form-input-error,\n .form-select-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 ";
|
|
835
835
|
}
|
|
836
836
|
getValue() {
|
|
@@ -853,7 +853,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
853
853
|
getError() {
|
|
854
854
|
return this._isVgsMode ? this._vgsAdapter?.getError() ?? null : this._nativeAdapter.getError();
|
|
855
855
|
}
|
|
856
|
-
},
|
|
856
|
+
}, Y = class extends O {
|
|
857
857
|
_value = "";
|
|
858
858
|
_error = null;
|
|
859
859
|
_input = null;
|
|
@@ -861,7 +861,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
861
861
|
if (!this.shadowRoot) return;
|
|
862
862
|
this._input?.getElement().remove();
|
|
863
863
|
let { t: e } = t();
|
|
864
|
-
this._input = new
|
|
864
|
+
this._input = new S({
|
|
865
865
|
name: "billingAddress.cardholderName",
|
|
866
866
|
label: this.options.label ?? e("cardholderNameLabel"),
|
|
867
867
|
error: !1,
|
|
@@ -879,9 +879,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
879
879
|
}
|
|
880
880
|
getCss() {
|
|
881
881
|
return super.getCss() + [
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
882
|
+
T,
|
|
883
|
+
E,
|
|
884
|
+
w
|
|
885
885
|
].join("\n") + "\n :host { display: block; }\n .form-input {\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: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus {\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 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 ";
|
|
886
886
|
}
|
|
887
887
|
getValue() {
|
|
@@ -893,7 +893,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
893
893
|
getError() {
|
|
894
894
|
return this._error;
|
|
895
895
|
}
|
|
896
|
-
},
|
|
896
|
+
}, ae = {
|
|
897
897
|
name: "odus-elements",
|
|
898
898
|
styles: {
|
|
899
899
|
fontSize: 14,
|
|
@@ -917,7 +917,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
917
917
|
}
|
|
918
918
|
},
|
|
919
919
|
additionalPaymentMethods: {}
|
|
920
|
-
},
|
|
920
|
+
}, X = class extends O {
|
|
921
921
|
_email = "";
|
|
922
922
|
_error = null;
|
|
923
923
|
_suggestion = null;
|
|
@@ -926,10 +926,10 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
926
926
|
if (!this.shadowRoot) return;
|
|
927
927
|
this._field?.getElement().remove(), this.options.initialValue && !this._email && (this._email = String(this.options.initialValue));
|
|
928
928
|
let { t: e } = t();
|
|
929
|
-
this._field = new
|
|
929
|
+
this._field = new f({
|
|
930
930
|
value: this._email,
|
|
931
931
|
error: !1,
|
|
932
|
-
checkoutProfile:
|
|
932
|
+
checkoutProfile: ae,
|
|
933
933
|
translationFunc: e,
|
|
934
934
|
label: this.options.label,
|
|
935
935
|
placeholder: this.options.placeholder,
|
|
@@ -938,23 +938,23 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
938
938
|
this._email = t.value ?? this._field?.getValue() ?? "", this._error = null, this._suggestion = null, this._field?.setError(!1), this._field?.setSuggestion(null), this.emit("change", this._email);
|
|
939
939
|
},
|
|
940
940
|
onBlur: () => {
|
|
941
|
-
let e =
|
|
941
|
+
let e = c();
|
|
942
942
|
this._error = e.email(this._email) ?? null, this._suggestion = e.emailSuggestion(this._email) ?? null, this._field?.setError(!!this._error, this._error ?? void 0), this._field?.setSuggestion(this._suggestion), this.emit("blur", this._email);
|
|
943
943
|
}
|
|
944
944
|
}), this.shadowRoot.appendChild(this._field.getElement());
|
|
945
945
|
}
|
|
946
946
|
getCss() {
|
|
947
947
|
return super.getCss() + [
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
948
|
+
T,
|
|
949
|
+
E,
|
|
950
|
+
w
|
|
951
951
|
].join("\n") + "\n :host { display: block; }\n .form-input {\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: var(--odus-border-radius, 6px) !important;\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 }\n .form-input:focus {\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 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 .form-helper-text-hint {\n color: var(--odus-color-muted, #6b7280) !important;\n }\n ";
|
|
952
952
|
}
|
|
953
953
|
getValue() {
|
|
954
954
|
return this._email;
|
|
955
955
|
}
|
|
956
956
|
getIsValid() {
|
|
957
|
-
return !
|
|
957
|
+
return !c().email(this._email);
|
|
958
958
|
}
|
|
959
959
|
getError() {
|
|
960
960
|
return this._error;
|
|
@@ -962,24 +962,24 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
962
962
|
get suggestion() {
|
|
963
963
|
return this._suggestion;
|
|
964
964
|
}
|
|
965
|
-
},
|
|
965
|
+
}, oe = "@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}", Z = class extends O {
|
|
966
966
|
_alert = null;
|
|
967
967
|
_message = null;
|
|
968
968
|
render() {
|
|
969
|
-
this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new
|
|
969
|
+
this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new x({ message: this._message }), this.shadowRoot.appendChild(this._alert.getElement())));
|
|
970
970
|
}
|
|
971
971
|
setError(e) {
|
|
972
972
|
if (this._message = e, !this.shadowRoot) {
|
|
973
973
|
this.emit("error", e);
|
|
974
974
|
return;
|
|
975
975
|
}
|
|
976
|
-
this._alert ? this._alert.setMessage(e) : (this._alert = new
|
|
976
|
+
this._alert ? this._alert.setMessage(e) : (this._alert = new x({ message: e }), this.shadowRoot.appendChild(this._alert.getElement())), this.emit("error", e);
|
|
977
977
|
}
|
|
978
978
|
clearError() {
|
|
979
979
|
this._message = null, this._alert?.getElement().remove(), this._alert = null;
|
|
980
980
|
}
|
|
981
981
|
getCss() {
|
|
982
|
-
return super.getCss() +
|
|
982
|
+
return super.getCss() + oe + "\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 ";
|
|
983
983
|
}
|
|
984
984
|
getValue() {
|
|
985
985
|
return null;
|
|
@@ -990,7 +990,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
990
990
|
getError() {
|
|
991
991
|
return this._message;
|
|
992
992
|
}
|
|
993
|
-
},
|
|
993
|
+
}, se = ".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}", ce = {
|
|
994
994
|
name: "odus-elements",
|
|
995
995
|
styles: {
|
|
996
996
|
fontSize: 14,
|
|
@@ -1014,7 +1014,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1014
1014
|
}
|
|
1015
1015
|
},
|
|
1016
1016
|
additionalPaymentMethods: {}
|
|
1017
|
-
}, Q = class extends
|
|
1017
|
+
}, Q = class extends O {
|
|
1018
1018
|
_paymentContext = null;
|
|
1019
1019
|
_button = null;
|
|
1020
1020
|
setPaymentContext(e) {
|
|
@@ -1023,8 +1023,8 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1023
1023
|
render() {
|
|
1024
1024
|
if (!this.shadowRoot || (this._button?.getElement().remove(), this._button = null, !this._paymentContext)) return;
|
|
1025
1025
|
let { onAuthorize: e } = this._paymentContext;
|
|
1026
|
-
this._button = new
|
|
1027
|
-
checkoutProfile:
|
|
1026
|
+
this._button = new te({
|
|
1027
|
+
checkoutProfile: ce,
|
|
1028
1028
|
onSubmit: async () => {
|
|
1029
1029
|
this._button?.setSubmitting(!0);
|
|
1030
1030
|
try {
|
|
@@ -1036,7 +1036,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1036
1036
|
}), this.shadowRoot.appendChild(this._button.getElement());
|
|
1037
1037
|
}
|
|
1038
1038
|
getCss() {
|
|
1039
|
-
return super.getCss() +
|
|
1039
|
+
return super.getCss() + se + "\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 ";
|
|
1040
1040
|
}
|
|
1041
1041
|
getValue() {
|
|
1042
1042
|
return null;
|
|
@@ -1047,7 +1047,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1047
1047
|
getError() {
|
|
1048
1048
|
return null;
|
|
1049
1049
|
}
|
|
1050
|
-
},
|
|
1050
|
+
}, le = ".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}", ue = {
|
|
1051
1051
|
name: "odus-elements",
|
|
1052
1052
|
styles: {
|
|
1053
1053
|
fontSize: 14,
|
|
@@ -1071,7 +1071,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1071
1071
|
}
|
|
1072
1072
|
},
|
|
1073
1073
|
additionalPaymentMethods: {}
|
|
1074
|
-
}, $ = class extends
|
|
1074
|
+
}, $ = class extends O {
|
|
1075
1075
|
_phone = "";
|
|
1076
1076
|
_error = null;
|
|
1077
1077
|
_field = null;
|
|
@@ -1080,13 +1080,13 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1080
1080
|
if (!this.shadowRoot) return;
|
|
1081
1081
|
this._field?.destroy(), this._field?.getElement().remove(), this._field = null, this.options.initialValue && !this._phone && (this._phone = String(this.options.initialValue));
|
|
1082
1082
|
let e = ++this._renderGeneration;
|
|
1083
|
-
|
|
1083
|
+
C().then(({ PhoneNumberField: n }) => {
|
|
1084
1084
|
if (!this.shadowRoot || this._renderGeneration !== e) return;
|
|
1085
1085
|
let { t: r, locale: i } = t();
|
|
1086
1086
|
this._field = new n({
|
|
1087
1087
|
value: this._phone,
|
|
1088
1088
|
error: !1,
|
|
1089
|
-
checkoutProfile:
|
|
1089
|
+
checkoutProfile: ue,
|
|
1090
1090
|
translationFunc: r,
|
|
1091
1091
|
locale: i,
|
|
1092
1092
|
label: this.options.label,
|
|
@@ -1097,7 +1097,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1097
1097
|
},
|
|
1098
1098
|
onBlur: () => {
|
|
1099
1099
|
this._phone = this._field?.getValue() ?? "";
|
|
1100
|
-
let e =
|
|
1100
|
+
let e = c(), t = this._field?.getCountry();
|
|
1101
1101
|
this._error = e.phoneNumber(this._phone, t) ?? null, this._field?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._phone);
|
|
1102
1102
|
}
|
|
1103
1103
|
}), this.shadowRoot.appendChild(this._field.getElement());
|
|
@@ -1105,29 +1105,31 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1105
1105
|
}
|
|
1106
1106
|
getCss() {
|
|
1107
1107
|
return super.getCss() + [
|
|
1108
|
-
|
|
1108
|
+
T,
|
|
1109
|
+
E,
|
|
1109
1110
|
w,
|
|
1110
|
-
|
|
1111
|
-
re
|
|
1111
|
+
le
|
|
1112
1112
|
].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 ";
|
|
1113
1113
|
}
|
|
1114
1114
|
getValue() {
|
|
1115
1115
|
return this._phone;
|
|
1116
1116
|
}
|
|
1117
1117
|
getIsValid() {
|
|
1118
|
-
let e =
|
|
1118
|
+
let e = c(), t = this._field?.getCountry();
|
|
1119
1119
|
return !e.phoneNumber(this._phone, t);
|
|
1120
1120
|
}
|
|
1121
1121
|
getError() {
|
|
1122
1122
|
return this._error;
|
|
1123
1123
|
}
|
|
1124
|
-
},
|
|
1124
|
+
}, de = class {
|
|
1125
1125
|
_config;
|
|
1126
1126
|
_apiService;
|
|
1127
1127
|
_changeListeners = [];
|
|
1128
1128
|
_callbacks;
|
|
1129
1129
|
_paymentState = {};
|
|
1130
1130
|
_fontCleanup;
|
|
1131
|
+
_sessionId;
|
|
1132
|
+
_mountedReported = !1;
|
|
1131
1133
|
_card;
|
|
1132
1134
|
_email;
|
|
1133
1135
|
_phone;
|
|
@@ -1144,10 +1146,14 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1144
1146
|
_error;
|
|
1145
1147
|
elements;
|
|
1146
1148
|
constructor(e) {
|
|
1147
|
-
this._config = e, this._callbacks = { ...e.callbacks },
|
|
1149
|
+
this._config = e, this._callbacks = { ...e.callbacks }, this._sessionId = crypto.randomUUID(), d({
|
|
1150
|
+
environment: e.environment,
|
|
1151
|
+
sessionId: this._sessionId,
|
|
1152
|
+
integration: "elements"
|
|
1153
|
+
}), u(o.CHECKOUT_INITIALIZED, { environment: e.environment }), e.locale && re.setLocale(e.locale), this._apiService = new l(e.apiKey, e.environment);
|
|
1148
1154
|
let t = {};
|
|
1149
1155
|
Object.defineProperty(t, "email", {
|
|
1150
|
-
get: () => (this._email || (this._email = new
|
|
1156
|
+
get: () => (this._email || (this._email = new X(), this._trackElement(this._email)), this._email),
|
|
1151
1157
|
enumerable: !0
|
|
1152
1158
|
}), Object.defineProperty(t, "phone", {
|
|
1153
1159
|
get: () => (this._phone || (this._phone = new $(), this._trackElement(this._phone)), this._phone),
|
|
@@ -1155,7 +1161,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1155
1161
|
});
|
|
1156
1162
|
let n = {};
|
|
1157
1163
|
Object.defineProperty(n, "applePay", {
|
|
1158
|
-
get: () => (this._applePay || (this._applePay = new
|
|
1164
|
+
get: () => (this._applePay || (this._applePay = new B(), this._trackElement(this._applePay), this._paymentState.paymentId && this._paymentState.checkoutKey && this._applePay.setPaymentContext({
|
|
1159
1165
|
paymentId: this._paymentState.paymentId,
|
|
1160
1166
|
checkoutKey: this._paymentState.checkoutKey,
|
|
1161
1167
|
environment: this._config.environment,
|
|
@@ -1177,25 +1183,25 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1177
1183
|
});
|
|
1178
1184
|
let r = {};
|
|
1179
1185
|
Object.defineProperty(r, "street", {
|
|
1180
|
-
get: () => (this._addressStreet || (this._addressStreet = new
|
|
1186
|
+
get: () => (this._addressStreet || (this._addressStreet = new I(), this._trackElement(this._addressStreet)), this._addressStreet),
|
|
1181
1187
|
enumerable: !0
|
|
1182
1188
|
}), Object.defineProperty(r, "firstName", {
|
|
1183
|
-
get: () => (this._addressFirstName || (this._addressFirstName = new
|
|
1189
|
+
get: () => (this._addressFirstName || (this._addressFirstName = new M(), this._trackElement(this._addressFirstName)), this._addressFirstName),
|
|
1184
1190
|
enumerable: !0
|
|
1185
1191
|
}), Object.defineProperty(r, "lastName", {
|
|
1186
|
-
get: () => (this._addressLastName || (this._addressLastName = new
|
|
1192
|
+
get: () => (this._addressLastName || (this._addressLastName = new N(), this._trackElement(this._addressLastName)), this._addressLastName),
|
|
1187
1193
|
enumerable: !0
|
|
1188
1194
|
}), Object.defineProperty(r, "city", {
|
|
1189
|
-
get: () => (this._addressCity || (this._addressCity = new
|
|
1195
|
+
get: () => (this._addressCity || (this._addressCity = new k(), this._trackElement(this._addressCity)), this._addressCity),
|
|
1190
1196
|
enumerable: !0
|
|
1191
1197
|
}), Object.defineProperty(r, "state", {
|
|
1192
|
-
get: () => (this._addressState || (this._addressState = new
|
|
1198
|
+
get: () => (this._addressState || (this._addressState = new F(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
|
|
1193
1199
|
enumerable: !0
|
|
1194
1200
|
}), Object.defineProperty(r, "zipCode", {
|
|
1195
|
-
get: () => (this._addressZipCode || (this._addressZipCode = new
|
|
1201
|
+
get: () => (this._addressZipCode || (this._addressZipCode = new L(), this._trackElement(this._addressZipCode)), this._addressZipCode),
|
|
1196
1202
|
enumerable: !0
|
|
1197
1203
|
}), Object.defineProperty(r, "country", {
|
|
1198
|
-
get: () => (this._addressCountry || (this._addressCountry = new
|
|
1204
|
+
get: () => (this._addressCountry || (this._addressCountry = new j(), this._trackElement(this._addressCountry), this._addressCountry.on("change", (e) => {
|
|
1199
1205
|
this._addressState?.setCountry(e);
|
|
1200
1206
|
})), this._addressCountry),
|
|
1201
1207
|
enumerable: !0
|
|
@@ -1205,32 +1211,44 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1205
1211
|
express: n
|
|
1206
1212
|
};
|
|
1207
1213
|
Object.defineProperty(i, "card", {
|
|
1208
|
-
get: () => (this._card || (this._card = new
|
|
1214
|
+
get: () => (this._card || (this._card = new J(), this._card.setEnvironment(this._config.environment), this._trackElement(this._card), this._paymentState.vgsJwt && this._card.setVgsJwt(this._paymentState.vgsJwt)), this._card),
|
|
1209
1215
|
enumerable: !0
|
|
1210
1216
|
}), Object.defineProperty(i, "cardholderName", {
|
|
1211
|
-
get: () => (this._cardholderName || (this._cardholderName = new
|
|
1217
|
+
get: () => (this._cardholderName || (this._cardholderName = new Y(), this._trackElement(this._cardholderName)), this._cardholderName),
|
|
1212
1218
|
enumerable: !0
|
|
1213
1219
|
}), Object.defineProperty(i, "address", {
|
|
1214
1220
|
get: () => r,
|
|
1215
1221
|
enumerable: !0
|
|
1216
1222
|
}), Object.defineProperty(i, "error", {
|
|
1217
|
-
get: () => (this._error || (this._error = new
|
|
1223
|
+
get: () => (this._error || (this._error = new Z(), this._trackElement(this._error)), this._error),
|
|
1218
1224
|
enumerable: !0
|
|
1219
1225
|
}), this.elements = i;
|
|
1220
1226
|
}
|
|
1221
1227
|
async associatePayment(e, t) {
|
|
1222
1228
|
if (!e || !t) throw Error("paymentId and checkoutKey are required");
|
|
1223
1229
|
this._paymentState.paymentId = e, this._paymentState.checkoutKey = t;
|
|
1224
|
-
let n
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1230
|
+
let n;
|
|
1231
|
+
try {
|
|
1232
|
+
n = await a({
|
|
1233
|
+
id: e,
|
|
1234
|
+
checkoutKey: t,
|
|
1235
|
+
environment: this._config.environment
|
|
1236
|
+
});
|
|
1237
|
+
} catch (t) {
|
|
1238
|
+
throw u(o.PAYMENT_ASSOCIATION_FAILED, {
|
|
1239
|
+
payment_id: e,
|
|
1240
|
+
error_message: t instanceof Error ? t.message : "Unknown error"
|
|
1241
|
+
}), i(t instanceof Error ? t : Error("Failed to associate payment"), { payment_id: e }), t;
|
|
1242
|
+
}
|
|
1229
1243
|
this._paymentState.checkoutDetails = {
|
|
1230
1244
|
amount: n.amount,
|
|
1231
1245
|
currency: n.currency,
|
|
1232
1246
|
countryCode: n.countryCode
|
|
1233
|
-
},
|
|
1247
|
+
}, u(o.PAYMENT_ASSOCIATED, {
|
|
1248
|
+
payment_id: e,
|
|
1249
|
+
currency: n.currency,
|
|
1250
|
+
country_code: n.countryCode
|
|
1251
|
+
}), n.vgsJwt && (this._paymentState.vgsJwt = n.vgsJwt, this._card?.setVgsJwt(n.vgsJwt)), this._card?.setEnvironment(this._config.environment), this._applePay?.setPaymentContext({
|
|
1234
1252
|
paymentId: e,
|
|
1235
1253
|
checkoutKey: t,
|
|
1236
1254
|
environment: this._config.environment,
|
|
@@ -1314,7 +1332,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1314
1332
|
let t = e["--odus-font-family"];
|
|
1315
1333
|
if (t) {
|
|
1316
1334
|
this._fontCleanup?.();
|
|
1317
|
-
let { cleanup: e } =
|
|
1335
|
+
let { cleanup: e } = ee({ fontFamily: t });
|
|
1318
1336
|
this._fontCleanup = e;
|
|
1319
1337
|
}
|
|
1320
1338
|
for (let t of this._allElements()) t.setTheme(e);
|
|
@@ -1336,7 +1354,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1336
1354
|
Object.assign(this._callbacks, e);
|
|
1337
1355
|
}
|
|
1338
1356
|
_trackElement(e) {
|
|
1339
|
-
e.on("
|
|
1357
|
+
e.on("ready", () => {
|
|
1358
|
+
this._mountedReported || (this._mountedReported = !0, u(o.CHECKOUT_MOUNTED, { container_id: "elements" }));
|
|
1359
|
+
}), e.on("change", () => {
|
|
1340
1360
|
for (let e of this._changeListeners) e();
|
|
1341
1361
|
});
|
|
1342
1362
|
}
|
|
@@ -1360,37 +1380,71 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1360
1380
|
}
|
|
1361
1381
|
async _executeAuthorization({ formData: e, applePayData: t, customCustomerData: n }) {
|
|
1362
1382
|
this._emitLoadingState(!0);
|
|
1383
|
+
let i = this._paymentState.paymentId, a = this._getPaymentMethod(e, t);
|
|
1384
|
+
u(o.PAYMENT_SUBMIT_STARTED, {
|
|
1385
|
+
payment_id: i,
|
|
1386
|
+
payment_method: a
|
|
1387
|
+
});
|
|
1388
|
+
let s = performance.now();
|
|
1363
1389
|
try {
|
|
1364
|
-
let
|
|
1365
|
-
paymentId:
|
|
1390
|
+
let c = await this._apiService.authorizePayment({
|
|
1391
|
+
paymentId: i,
|
|
1366
1392
|
checkoutKey: this._paymentState.checkoutKey,
|
|
1367
1393
|
formData: e,
|
|
1368
1394
|
returnUrl: this._config.returnUrl,
|
|
1369
1395
|
applePayData: t,
|
|
1370
1396
|
customCustomerData: n
|
|
1371
1397
|
});
|
|
1372
|
-
|
|
1398
|
+
r(b.PAYMENT_AUTHORIZATION_TIME, performance.now() - s, "ms", {
|
|
1399
|
+
payment_id: i,
|
|
1400
|
+
payment_method: a,
|
|
1401
|
+
status: "success"
|
|
1402
|
+
}), u(o.PAYMENT_SUBMIT_SUCCESS, {
|
|
1403
|
+
payment_id: i,
|
|
1404
|
+
payment_method: a
|
|
1405
|
+
}), this._handlePaymentResponse(c);
|
|
1373
1406
|
} catch (e) {
|
|
1374
|
-
|
|
1407
|
+
r(b.PAYMENT_AUTHORIZATION_TIME, performance.now() - s, "ms", {
|
|
1408
|
+
payment_id: i,
|
|
1409
|
+
payment_method: a,
|
|
1410
|
+
status: "failed"
|
|
1411
|
+
}), u(o.PAYMENT_SUBMIT_FAILED, {
|
|
1412
|
+
payment_id: i,
|
|
1413
|
+
payment_method: a,
|
|
1414
|
+
error_message: e.details?.message ?? "Unknown error"
|
|
1415
|
+
}), this._handleAuthorizationError(e);
|
|
1375
1416
|
} finally {
|
|
1376
1417
|
this._emitLoadingState(!1);
|
|
1377
1418
|
}
|
|
1378
1419
|
}
|
|
1420
|
+
_getPaymentMethod(e, t) {
|
|
1421
|
+
return t ? "apple_pay" : e === null ? "paypal" : "card";
|
|
1422
|
+
}
|
|
1379
1423
|
_emitLoadingState(e) {
|
|
1380
1424
|
try {
|
|
1381
1425
|
this._callbacks.onLoadingStateChange?.(e);
|
|
1382
1426
|
} catch {}
|
|
1383
1427
|
}
|
|
1384
1428
|
_handlePaymentResponse(e) {
|
|
1429
|
+
let t = this._paymentState.paymentId ?? "";
|
|
1385
1430
|
if (e.latestTransaction.status === "authorized") {
|
|
1386
|
-
|
|
1431
|
+
u(o.PAYMENT_AUTHORIZED, {
|
|
1432
|
+
payment_id: t,
|
|
1433
|
+
status: e.latestTransaction.status
|
|
1434
|
+
}), this._callbacks.onPaymentSucceeded?.(e.latestTransaction.status);
|
|
1387
1435
|
return;
|
|
1388
1436
|
}
|
|
1389
1437
|
if (e.latestTransaction.status === "failed") {
|
|
1390
|
-
|
|
1438
|
+
u(o.PAYMENT_FAILED, {
|
|
1439
|
+
payment_id: t,
|
|
1440
|
+
status: e.latestTransaction.status
|
|
1441
|
+
}), this._callbacks.onPaymentFailed?.(e.latestTransaction.status);
|
|
1391
1442
|
return;
|
|
1392
1443
|
}
|
|
1393
|
-
e.status === "requires_action" &&
|
|
1444
|
+
e.status === "requires_action" && (u(o.PAYMENT_ACTION_REQUIRED, {
|
|
1445
|
+
payment_id: t,
|
|
1446
|
+
status: e.status
|
|
1447
|
+
}), this._callbacks.onActionRequired?.(e.action.redirectUrl));
|
|
1394
1448
|
}
|
|
1395
1449
|
_handleAuthorizationError(e) {
|
|
1396
1450
|
let t = e.details?.message ?? "Payment failed";
|
|
@@ -1398,4 +1452,4 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1398
1452
|
}
|
|
1399
1453
|
};
|
|
1400
1454
|
//#endregion
|
|
1401
|
-
export {
|
|
1455
|
+
export { k as AddressCityElement, j as AddressCountryElement, M as AddressFirstNameElement, N as AddressLastNameElement, F as AddressStateElement, I as AddressStreetElement, L as AddressZipCodeElement, B as ApplePayElement, O as BaseElement, J as CardElement, Y as CardholderElement, X as EmailElement, Z as ErrorElement, de as OdusElements, Q as PayPalElement, $ as PhoneElement };
|