@getspot/spot-widget 1.4.0 → 2.0.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/CHANGELOG.md +12 -0
- package/README.md +562 -5
- package/dist/__mocks__/ui.d.ts +12 -0
- package/dist/__mocks__/ui.d.ts.map +1 -0
- package/dist/api.d.ts +26 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +364 -327
- package/dist/index.umd.js +3 -3
- package/dist/types.d.ts +144 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui.d.ts +11 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/validateOptions.d.ts +3 -0
- package/dist/validateOptions.d.ts.map +1 -0
- package/package.json +22 -3
- package/.turbo/turbo-build.log +0 -13
- package/assets/briefcase.svg +0 -1
- package/assets/building.svg +0 -1
- package/assets/cross.svg +0 -1
- package/assets/medal.svg +0 -1
- package/assets/plane.svg +0 -1
- package/assets/scale.svg +0 -1
- package/assets/umbrella.svg +0 -1
- package/assets/users.svg +0 -1
- package/src/api.js +0 -154
- package/src/index.js +0 -422
- package/src/styles.css +0 -481
- package/src/ui.js +0 -267
- package/src/validateOptions.js +0 -253
- package/vite.config.js +0 -18
package/dist/index.es.js
CHANGED
|
@@ -1,116 +1,120 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function D(u, t, e) {
|
|
2
2
|
try {
|
|
3
|
-
const
|
|
3
|
+
const r = await fetch(u, {
|
|
4
4
|
method: "POST",
|
|
5
5
|
headers: {
|
|
6
6
|
"Content-Type": "application/json",
|
|
7
7
|
"X-Spot-Partner-Id": t
|
|
8
8
|
},
|
|
9
9
|
body: JSON.stringify(e)
|
|
10
|
-
}),
|
|
11
|
-
if (!
|
|
12
|
-
const
|
|
13
|
-
throw
|
|
10
|
+
}), n = await r.json();
|
|
11
|
+
if (!r.ok) {
|
|
12
|
+
const o = new Error((n == null ? void 0 : n.message) || "Failed to fetch quote");
|
|
13
|
+
throw o.status = r.status, o.responseBody = n, o;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
16
|
-
} catch (
|
|
17
|
-
throw
|
|
15
|
+
return n;
|
|
16
|
+
} catch (r) {
|
|
17
|
+
throw r instanceof Error ? r : new Error("Unknown error occurred while fetching quote");
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
20
|
+
async function N(u, t, e) {
|
|
21
21
|
try {
|
|
22
|
-
const
|
|
22
|
+
const r = u.replace("/quote", "/quote/batch"), n = await fetch(r, {
|
|
23
23
|
method: "POST",
|
|
24
24
|
headers: {
|
|
25
25
|
"Content-Type": "application/json",
|
|
26
26
|
"X-Spot-Partner-Id": t
|
|
27
27
|
},
|
|
28
28
|
body: JSON.stringify(e)
|
|
29
|
-
}),
|
|
30
|
-
if (!
|
|
31
|
-
const p = new Error((
|
|
32
|
-
throw p.status =
|
|
29
|
+
}), o = await n.json();
|
|
30
|
+
if (!n.ok) {
|
|
31
|
+
const p = new Error((o == null ? void 0 : o.message) || "Failed to fetch batch quote");
|
|
32
|
+
throw p.status = n.status, p.responseBody = o, p;
|
|
33
33
|
}
|
|
34
|
-
return
|
|
35
|
-
} catch (
|
|
36
|
-
throw
|
|
34
|
+
return o;
|
|
35
|
+
} catch (r) {
|
|
36
|
+
throw r instanceof Error ? r : new Error("Unknown error occurred while fetching batch quote");
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async function
|
|
39
|
+
async function k(u, t, e) {
|
|
40
|
+
var r;
|
|
40
41
|
try {
|
|
41
42
|
const n = {
|
|
42
43
|
cartId: e.cartInfo.cartId,
|
|
43
44
|
cartName: e.cartInfo.cartName,
|
|
44
45
|
currencyCode: e.cartInfo.currencyCode,
|
|
45
|
-
items: e.items.map((
|
|
46
|
-
cartItemId:
|
|
47
|
-
productPrice:
|
|
48
|
-
productType:
|
|
49
|
-
productDuration:
|
|
50
|
-
productId:
|
|
51
|
-
productName:
|
|
52
|
-
participantDescription:
|
|
53
|
-
eventType:
|
|
54
|
-
startDate:
|
|
55
|
-
endDate:
|
|
46
|
+
items: e.items.map((c, m) => ({
|
|
47
|
+
cartItemId: c.cartItemId || `item-${m + 1}`,
|
|
48
|
+
productPrice: c.productPrice,
|
|
49
|
+
productType: c.productType,
|
|
50
|
+
productDuration: c.productDuration,
|
|
51
|
+
productId: c.productId,
|
|
52
|
+
productName: c.productName,
|
|
53
|
+
participantDescription: c.participantDescription,
|
|
54
|
+
eventType: c.eventType,
|
|
55
|
+
startDate: c.startDate,
|
|
56
|
+
endDate: c.endDate
|
|
56
57
|
}))
|
|
57
|
-
}, o = await
|
|
58
|
+
}, o = await N(u, t, n);
|
|
58
59
|
if (o.status !== "QUOTES_AVAILABLE" && o.status !== "QUOTE_AVAILABLE")
|
|
59
60
|
return { status: "NO_MATCHING_QUOTE" };
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
(
|
|
61
|
+
const p = o.quotes.map((c) => {
|
|
62
|
+
const m = e.items.find(
|
|
63
|
+
(b, f) => (b.cartItemId || `item-${f + 1}`) === c.cartItemId
|
|
63
64
|
);
|
|
64
|
-
return
|
|
65
|
-
}),
|
|
65
|
+
return m ? m.participantDescription ? `${m.productName} - ${m.participantDescription}` : m.productName : `Item ${c.id}`;
|
|
66
|
+
}), s = Math.round((o.totalSpotPrice || o.spotPrice || 0) * 100) / 100;
|
|
66
67
|
return {
|
|
67
68
|
status: "QUOTE_AVAILABLE",
|
|
68
69
|
data: {
|
|
69
|
-
id: o.quotes ? o.quotes.map((
|
|
70
|
-
spotPrice:
|
|
71
|
-
currencyCode: o.currencyCode,
|
|
70
|
+
id: o.quotes ? o.quotes.map((c) => c.id).join(",") : ((r = o.data) == null ? void 0 : r.id) || "",
|
|
71
|
+
spotPrice: s,
|
|
72
|
+
currencyCode: o.currencyCode || "",
|
|
72
73
|
communication: {
|
|
73
74
|
...o.communication,
|
|
74
|
-
yesOptionText: o.communication.yesOptionText.replace(
|
|
75
|
+
yesOptionText: o.communication.yesOptionText.replace(
|
|
76
|
+
String(o.totalSpotPrice),
|
|
77
|
+
String(s)
|
|
78
|
+
)
|
|
75
79
|
},
|
|
76
|
-
payoutSchedule: o.payoutSchedule.map((
|
|
77
|
-
...
|
|
78
|
-
amount:
|
|
80
|
+
payoutSchedule: o.payoutSchedule.map((c) => ({
|
|
81
|
+
...c,
|
|
82
|
+
amount: c.amount !== void 0 ? c.amount : 0
|
|
79
83
|
})),
|
|
80
|
-
coveredItems:
|
|
81
|
-
originalQuotes: o.quotes || [o]
|
|
84
|
+
coveredItems: p,
|
|
85
|
+
originalQuotes: o.quotes || (o.data ? [o.data] : [])
|
|
82
86
|
},
|
|
83
|
-
spotPrice:
|
|
84
|
-
coveredItems:
|
|
87
|
+
spotPrice: s,
|
|
88
|
+
coveredItems: p
|
|
85
89
|
};
|
|
86
90
|
} catch (n) {
|
|
87
91
|
throw n instanceof Error ? n : new Error("Unknown error occurred while fetching multiple quotes");
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
|
-
const
|
|
94
|
+
const O = {
|
|
91
95
|
sandbox: "https://api.sandbox.getspot.com/v1/quote",
|
|
92
96
|
production: "https://api.getspot.com/v1/quote",
|
|
93
97
|
local: "http://localhost:3999/api/v1/quote"
|
|
94
98
|
};
|
|
95
|
-
function
|
|
99
|
+
function T(u) {
|
|
96
100
|
const {
|
|
97
101
|
apiConfig: t = {},
|
|
98
102
|
quoteRequestData: e,
|
|
99
|
-
callbacks:
|
|
100
|
-
location:
|
|
101
|
-
theme:
|
|
102
|
-
} =
|
|
103
|
+
callbacks: r = {},
|
|
104
|
+
location: n,
|
|
105
|
+
theme: o
|
|
106
|
+
} = u, {
|
|
103
107
|
environment: p = "sandbox",
|
|
104
|
-
partnerId:
|
|
105
|
-
|
|
108
|
+
partnerId: s,
|
|
109
|
+
customEndpoint: c
|
|
106
110
|
} = t;
|
|
107
|
-
if (!
|
|
111
|
+
if (!s || typeof s != "string")
|
|
108
112
|
throw new Error("Invalid or missing partnerId in apiConfig");
|
|
109
|
-
if (!(
|
|
113
|
+
if (!(c || O[p]))
|
|
110
114
|
throw new Error(`Invalid environment in apiConfig: ${p}`);
|
|
111
115
|
if (!e || typeof e != "object" && !Array.isArray(e))
|
|
112
116
|
throw new Error("quoteRequestData must be a non-null object or array");
|
|
113
|
-
const
|
|
117
|
+
const b = [
|
|
114
118
|
"startDate",
|
|
115
119
|
"endDate",
|
|
116
120
|
"currencyCode",
|
|
@@ -122,158 +126,167 @@ function k(c) {
|
|
|
122
126
|
"cartId",
|
|
123
127
|
"productName"
|
|
124
128
|
];
|
|
125
|
-
function
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
129
|
-
throw new Error(`Missing required ${
|
|
129
|
+
function f(a, d = null) {
|
|
130
|
+
const l = d !== null ? `quoteRequestData[${d}]` : "quoteRequestData";
|
|
131
|
+
b.forEach((y) => {
|
|
132
|
+
if (!Object.prototype.hasOwnProperty.call(a, y) || a[y] === void 0 || a[y] === null)
|
|
133
|
+
throw new Error(`Missing required ${l} field: '${y}'`);
|
|
130
134
|
});
|
|
131
135
|
const w = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
132
|
-
if (!w.test(
|
|
133
|
-
throw new Error(`${
|
|
134
|
-
if (!w.test(
|
|
135
|
-
throw new Error(`${
|
|
136
|
-
if (typeof
|
|
137
|
-
throw new Error(`${
|
|
138
|
-
if (!["USD", "CAD", "AUD"].includes(
|
|
139
|
-
throw new Error(`Invalid ${
|
|
140
|
-
if (typeof
|
|
141
|
-
throw new Error(`${
|
|
142
|
-
if (typeof
|
|
143
|
-
throw new Error(`${
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
136
|
+
if (!w.test(a.startDate))
|
|
137
|
+
throw new Error(`${l}.startDate must be a valid ISO8601 string`);
|
|
138
|
+
if (!w.test(a.endDate))
|
|
139
|
+
throw new Error(`${l}.endDate must be a valid ISO8601 string`);
|
|
140
|
+
if (typeof a.currencyCode != "string")
|
|
141
|
+
throw new Error(`${l}.currencyCode must be a string`);
|
|
142
|
+
if (!["USD", "CAD", "AUD"].includes(a.currencyCode))
|
|
143
|
+
throw new Error(`Invalid ${l}.currencyCode: ${a.currencyCode}`);
|
|
144
|
+
if (typeof a.eventType != "string")
|
|
145
|
+
throw new Error(`${l}.eventType must be a string`);
|
|
146
|
+
if (typeof a.productType != "string")
|
|
147
|
+
throw new Error(`${l}.productType must be a string`);
|
|
148
|
+
const h = ["Pass", "Trip", "Registration"];
|
|
149
|
+
if (!h.includes(a.productType))
|
|
146
150
|
throw new Error(
|
|
147
|
-
`${
|
|
151
|
+
`${l}.productType must be one of ${h.join(", ")}`
|
|
148
152
|
);
|
|
149
|
-
if (typeof
|
|
150
|
-
throw new Error(`${
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
153
|
+
if (typeof a.productDuration != "string")
|
|
154
|
+
throw new Error(`${l}.productDuration must be a string`);
|
|
155
|
+
const _ = ["Daily", "Seasonal", "Trip", "Event"];
|
|
156
|
+
if (!_.includes(a.productDuration))
|
|
153
157
|
throw new Error(
|
|
154
|
-
`${
|
|
158
|
+
`${l}.productDuration must be one of ${_.join(", ")}`
|
|
155
159
|
);
|
|
156
|
-
if (typeof
|
|
157
|
-
throw new Error(`${
|
|
158
|
-
if (typeof
|
|
159
|
-
throw new Error(`${
|
|
160
|
-
if (typeof
|
|
161
|
-
throw new Error(`${
|
|
162
|
-
if (typeof
|
|
163
|
-
throw new Error(`${
|
|
160
|
+
if (typeof a.productPrice != "number" || isNaN(a.productPrice))
|
|
161
|
+
throw new Error(`${l}.productPrice must be a valid number`);
|
|
162
|
+
if (typeof a.productId != "string")
|
|
163
|
+
throw new Error(`${l}.productId must be a string`);
|
|
164
|
+
if (typeof a.cartId != "string")
|
|
165
|
+
throw new Error(`${l}.cartId must be a string`);
|
|
166
|
+
if (typeof a.productName != "string")
|
|
167
|
+
throw new Error(`${l}.productName must be a string`);
|
|
164
168
|
}
|
|
165
|
-
if (
|
|
166
|
-
const { cartInfo:
|
|
167
|
-
if (!
|
|
169
|
+
if ("cartInfo" in e && "items" in e) {
|
|
170
|
+
const a = e, { cartInfo: d, items: l } = a;
|
|
171
|
+
if (!d || typeof d != "object")
|
|
168
172
|
throw new Error("quoteRequestData.cartInfo must be a non-null object");
|
|
169
|
-
if (!
|
|
173
|
+
if (!d.cartId || typeof d.cartId != "string")
|
|
170
174
|
throw new Error("quoteRequestData.cartInfo.cartId must be a string");
|
|
171
|
-
if (!
|
|
175
|
+
if (!d.cartName || typeof d.cartName != "string")
|
|
172
176
|
throw new Error("quoteRequestData.cartInfo.cartName must be a string");
|
|
173
|
-
if (!
|
|
177
|
+
if (!d.currencyCode || typeof d.currencyCode != "string")
|
|
174
178
|
throw new Error("quoteRequestData.cartInfo.currencyCode must be a string");
|
|
175
|
-
if (!["USD", "CAD", "AUD"].includes(
|
|
176
|
-
throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${
|
|
177
|
-
if (!Array.isArray(
|
|
179
|
+
if (!["USD", "CAD", "AUD"].includes(d.currencyCode))
|
|
180
|
+
throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${d.currencyCode}`);
|
|
181
|
+
if (!Array.isArray(l) || l.length === 0)
|
|
178
182
|
throw new Error("quoteRequestData.items must be a non-empty array");
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
183
|
+
const v = [
|
|
184
|
+
"startDate",
|
|
185
|
+
"endDate",
|
|
186
|
+
"eventType",
|
|
187
|
+
"productType",
|
|
188
|
+
"productDuration",
|
|
189
|
+
"productPrice",
|
|
190
|
+
"productId",
|
|
191
|
+
"productName"
|
|
192
|
+
];
|
|
193
|
+
l.forEach((h, _) => {
|
|
194
|
+
if (!h || typeof h != "object")
|
|
182
195
|
throw new Error(`quoteRequestData.items[${_}] must be a non-null object`);
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
186
|
-
throw new Error(`Missing required ${
|
|
196
|
+
const y = `quoteRequestData.items[${_}]`;
|
|
197
|
+
v.forEach((q) => {
|
|
198
|
+
if (!Object.prototype.hasOwnProperty.call(h, q) || h[q] === void 0 || h[q] === null)
|
|
199
|
+
throw new Error(`Missing required ${y} field: '${q}'`);
|
|
187
200
|
});
|
|
188
|
-
const
|
|
189
|
-
if (!
|
|
190
|
-
throw new Error(`${
|
|
191
|
-
if (!
|
|
192
|
-
throw new Error(`${
|
|
193
|
-
if (typeof
|
|
194
|
-
throw new Error(`${
|
|
195
|
-
if (typeof
|
|
196
|
-
throw new Error(`${
|
|
197
|
-
const
|
|
198
|
-
if (!
|
|
199
|
-
throw new Error(`${
|
|
200
|
-
if (typeof
|
|
201
|
-
throw new Error(`${
|
|
202
|
-
const
|
|
203
|
-
if (!
|
|
204
|
-
throw new Error(`${
|
|
205
|
-
if (typeof
|
|
206
|
-
throw new Error(`${
|
|
207
|
-
if (typeof
|
|
208
|
-
throw new Error(`${
|
|
209
|
-
if (typeof
|
|
210
|
-
throw new Error(`${
|
|
201
|
+
const C = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
202
|
+
if (!C.test(h.startDate))
|
|
203
|
+
throw new Error(`${y}.startDate must be a valid ISO8601 string`);
|
|
204
|
+
if (!C.test(h.endDate))
|
|
205
|
+
throw new Error(`${y}.endDate must be a valid ISO8601 string`);
|
|
206
|
+
if (typeof h.eventType != "string")
|
|
207
|
+
throw new Error(`${y}.eventType must be a string`);
|
|
208
|
+
if (typeof h.productType != "string")
|
|
209
|
+
throw new Error(`${y}.productType must be a string`);
|
|
210
|
+
const E = ["Pass", "Trip", "Registration"];
|
|
211
|
+
if (!E.includes(h.productType))
|
|
212
|
+
throw new Error(`${y}.productType must be one of ${E.join(", ")}`);
|
|
213
|
+
if (typeof h.productDuration != "string")
|
|
214
|
+
throw new Error(`${y}.productDuration must be a string`);
|
|
215
|
+
const I = ["Daily", "Seasonal", "Trip", "Event"];
|
|
216
|
+
if (!I.includes(h.productDuration))
|
|
217
|
+
throw new Error(`${y}.productDuration must be one of ${I.join(", ")}`);
|
|
218
|
+
if (typeof h.productPrice != "number" || isNaN(h.productPrice))
|
|
219
|
+
throw new Error(`${y}.productPrice must be a valid number`);
|
|
220
|
+
if (typeof h.productId != "string")
|
|
221
|
+
throw new Error(`${y}.productId must be a string`);
|
|
222
|
+
if (typeof h.productName != "string")
|
|
223
|
+
throw new Error(`${y}.productName must be a string`);
|
|
211
224
|
});
|
|
212
225
|
} else if (Array.isArray(e)) {
|
|
213
226
|
if (e.length === 0)
|
|
214
227
|
throw new Error("quoteRequestData array cannot be empty");
|
|
215
|
-
e.forEach((
|
|
216
|
-
if (!
|
|
217
|
-
throw new Error(`quoteRequestData[${
|
|
218
|
-
|
|
228
|
+
e.forEach((a, d) => {
|
|
229
|
+
if (!a || typeof a != "object")
|
|
230
|
+
throw new Error(`quoteRequestData[${d}] must be a non-null object`);
|
|
231
|
+
f(a, d);
|
|
219
232
|
});
|
|
220
233
|
} else
|
|
221
|
-
|
|
234
|
+
f(e);
|
|
222
235
|
if ([
|
|
223
236
|
"onOptIn",
|
|
224
237
|
"onOptOut",
|
|
225
238
|
"onQuoteRetrieved",
|
|
226
239
|
"onError",
|
|
227
240
|
"noMatchingQuote"
|
|
228
|
-
].forEach((
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
throw new Error(`Callback '${
|
|
232
|
-
}), typeof
|
|
233
|
-
throw new Error(`Invalid location selector: '${
|
|
234
|
-
if (
|
|
241
|
+
].forEach((a) => {
|
|
242
|
+
const d = r[a];
|
|
243
|
+
if (d && typeof d != "function")
|
|
244
|
+
throw new Error(`Callback '${a}' must be a function.`);
|
|
245
|
+
}), typeof n == "string" && !document.querySelector(n))
|
|
246
|
+
throw new Error(`Invalid location selector: '${n}'`);
|
|
247
|
+
if (o && typeof o != "object")
|
|
235
248
|
throw new Error(
|
|
236
249
|
"Theme must be an object with CSS variables, do not include the '--' prefix"
|
|
237
250
|
);
|
|
238
251
|
}
|
|
239
|
-
function i(
|
|
240
|
-
const
|
|
241
|
-
return e && (
|
|
252
|
+
function i(u, { text: t, className: e, parent: r, innerHTML: n, href: o, target: p } = {}) {
|
|
253
|
+
const s = document.createElement(u);
|
|
254
|
+
return e && (s.className = e), t != null && (s.textContent = t), n != null && (s.innerHTML = n), o && "href" in s && (s.href = o), p && "target" in s && (s.target = p), r && r.appendChild(s), s;
|
|
242
255
|
}
|
|
243
|
-
function
|
|
256
|
+
function P(u, { name: t, description: e }) {
|
|
244
257
|
i("div", {
|
|
245
258
|
className: "spot-header__title",
|
|
246
259
|
text: t,
|
|
247
|
-
parent:
|
|
260
|
+
parent: u
|
|
248
261
|
}), i("div", {
|
|
249
262
|
className: "spot-header__description",
|
|
250
263
|
text: e,
|
|
251
|
-
parent:
|
|
264
|
+
parent: u
|
|
252
265
|
});
|
|
253
266
|
}
|
|
254
|
-
function
|
|
267
|
+
function $(u, t = []) {
|
|
255
268
|
const e = i("ul", {
|
|
256
269
|
className: "spot-benefits__list",
|
|
257
|
-
parent:
|
|
270
|
+
parent: u
|
|
258
271
|
});
|
|
259
|
-
t.forEach((
|
|
260
|
-
const
|
|
261
|
-
|
|
272
|
+
t.forEach((r) => {
|
|
273
|
+
const n = i("li", { parent: e });
|
|
274
|
+
n.innerHTML = `
|
|
262
275
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
263
276
|
<path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
|
|
264
277
|
stroke="#2E2E2E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
265
|
-
</svg>`, i("span", { text:
|
|
278
|
+
</svg>`, i("span", { text: r, parent: n });
|
|
266
279
|
});
|
|
267
280
|
}
|
|
268
|
-
function
|
|
281
|
+
function z(u, t = []) {
|
|
269
282
|
if (!t || t.length === 0) return;
|
|
270
283
|
const e = i("div", {
|
|
271
284
|
className: "spot-qualifying-reasons__container",
|
|
272
|
-
parent:
|
|
273
|
-
}),
|
|
285
|
+
parent: u
|
|
286
|
+
}), r = [...t].sort((c, m) => c.rank - m.rank), n = i("div", {
|
|
274
287
|
className: "spot-qualifying-reasons__grid",
|
|
275
288
|
parent: e
|
|
276
|
-
}),
|
|
289
|
+
}), o = {
|
|
277
290
|
"Accident & Illness": "cross.svg",
|
|
278
291
|
"Family Emergencies": "users.svg",
|
|
279
292
|
Layoffs: "building.svg",
|
|
@@ -282,126 +295,127 @@ function P(c, t = []) {
|
|
|
282
295
|
"Severe Weather": "umbrella.svg",
|
|
283
296
|
"Travel Interruption": "plane.svg",
|
|
284
297
|
"Military Duty": "medal.svg"
|
|
285
|
-
}, p = new URL(import.meta.url),
|
|
286
|
-
|
|
287
|
-
var
|
|
288
|
-
const
|
|
298
|
+
}, p = new URL(import.meta.url), s = p.origin + p.pathname.replace(/\/src\/[^/]*$/, "/assets/");
|
|
299
|
+
r.forEach((c) => {
|
|
300
|
+
var g, a, d;
|
|
301
|
+
const m = i("div", {
|
|
289
302
|
className: "spot-qualifying-reasons__item",
|
|
290
|
-
parent:
|
|
291
|
-
}),
|
|
303
|
+
parent: n
|
|
304
|
+
}), b = i("div", {
|
|
292
305
|
className: "spot-qualifying-reasons__icon-wrapper",
|
|
293
|
-
parent:
|
|
294
|
-
}),
|
|
295
|
-
if (
|
|
296
|
-
const
|
|
297
|
-
parent:
|
|
306
|
+
parent: m
|
|
307
|
+
}), f = o[((g = c.benefitType) == null ? void 0 : g.name) || ""] || o[c.name || ""];
|
|
308
|
+
if (f) {
|
|
309
|
+
const l = i("img", {
|
|
310
|
+
parent: b
|
|
298
311
|
});
|
|
299
|
-
|
|
312
|
+
l.src = s + f, l.alt = ((a = c.benefitType) == null ? void 0 : a.name) || c.name || "", l.className = "spot-qualifying-reasons__icon";
|
|
300
313
|
}
|
|
301
314
|
i("span", {
|
|
302
315
|
className: "spot-qualifying-reasons__label",
|
|
303
|
-
text: ((
|
|
304
|
-
parent:
|
|
316
|
+
text: ((d = c.benefitType) == null ? void 0 : d.name) || c.name || "",
|
|
317
|
+
parent: m
|
|
305
318
|
});
|
|
306
319
|
});
|
|
307
320
|
}
|
|
308
|
-
function
|
|
321
|
+
function R(u, t = []) {
|
|
309
322
|
if (t.length === 0) return;
|
|
310
323
|
const e = i("div", {
|
|
311
324
|
className: "spot-covered-items__container",
|
|
312
|
-
parent:
|
|
325
|
+
parent: u
|
|
313
326
|
});
|
|
314
327
|
i("div", {
|
|
315
328
|
className: "spot-covered-items__title",
|
|
316
329
|
text: "Items covered in your cart:",
|
|
317
330
|
parent: e
|
|
318
331
|
});
|
|
319
|
-
const
|
|
332
|
+
const r = i("ul", {
|
|
320
333
|
className: "spot-covered-items__list",
|
|
321
334
|
parent: e
|
|
322
335
|
});
|
|
323
|
-
t.forEach((
|
|
324
|
-
const
|
|
325
|
-
i("span", { text:
|
|
336
|
+
t.forEach((n) => {
|
|
337
|
+
const o = i("li", { parent: r });
|
|
338
|
+
i("span", { text: n, parent: o });
|
|
326
339
|
});
|
|
327
340
|
}
|
|
328
|
-
function
|
|
341
|
+
function S(u, t = []) {
|
|
329
342
|
const e = i("div", {
|
|
330
343
|
className: "spot-table__container",
|
|
331
|
-
parent:
|
|
332
|
-
}),
|
|
344
|
+
parent: u
|
|
345
|
+
}), r = i("table", {
|
|
333
346
|
className: "spot-refund__table spot-table--dynamic",
|
|
334
347
|
parent: e
|
|
335
|
-
}),
|
|
336
|
-
i("th", { text: "When you cancel", parent:
|
|
337
|
-
const p = i("tbody", { parent:
|
|
338
|
-
t.forEach(({ text:
|
|
339
|
-
const
|
|
340
|
-
i("td", { text:
|
|
341
|
-
const
|
|
342
|
-
i("td", { text:
|
|
348
|
+
}), n = i("thead", { parent: r }), o = i("tr", { parent: n });
|
|
349
|
+
i("th", { text: "When you cancel", parent: o }), i("th", { text: "You will receive", parent: o });
|
|
350
|
+
const p = i("tbody", { parent: r });
|
|
351
|
+
t.forEach(({ text: s, percent: c, amount: m }) => {
|
|
352
|
+
const b = i("tr", { parent: p });
|
|
353
|
+
i("td", { text: s, parent: b });
|
|
354
|
+
const f = c === "Not eligible for refund" ? "Not eligible for a refund" : `$${m} refund`;
|
|
355
|
+
i("td", { text: f, parent: b });
|
|
343
356
|
});
|
|
344
357
|
}
|
|
345
|
-
function Q(
|
|
346
|
-
const
|
|
358
|
+
function Q(u, t, e) {
|
|
359
|
+
const r = i("div", {
|
|
347
360
|
className: "spot-selection__options",
|
|
348
|
-
parent:
|
|
349
|
-
}),
|
|
361
|
+
parent: u
|
|
362
|
+
}), n = i("label", {
|
|
350
363
|
className: `spot-selection__option ${t ? "selected" : ""}`,
|
|
351
|
-
parent:
|
|
352
|
-
}),
|
|
353
|
-
|
|
364
|
+
parent: r
|
|
365
|
+
}), o = i("input", { parent: n });
|
|
366
|
+
o.type = "radio", o.name = "selection", o.value = "yes", t && (o.checked = !0), i("strong", {
|
|
354
367
|
text: e.yesOptionText,
|
|
355
|
-
parent:
|
|
368
|
+
parent: n
|
|
356
369
|
}), i("span", {
|
|
357
370
|
className: "spot-selection__recommended-tag",
|
|
358
371
|
text: "Recommended",
|
|
359
|
-
parent:
|
|
372
|
+
parent: n
|
|
360
373
|
});
|
|
361
374
|
const p = i("label", {
|
|
362
375
|
className: "spot-selection__option",
|
|
363
|
-
parent:
|
|
364
|
-
}),
|
|
365
|
-
return
|
|
376
|
+
parent: r
|
|
377
|
+
}), s = i("input", { parent: p });
|
|
378
|
+
return s.type = "radio", s.name = "selection", s.value = "no", i("span", { text: e.noOptionText, parent: p }), r;
|
|
366
379
|
}
|
|
367
|
-
function
|
|
368
|
-
var
|
|
369
|
-
const e = (
|
|
380
|
+
function H(u, t) {
|
|
381
|
+
var n;
|
|
382
|
+
const e = (n = t.communication) == null ? void 0 : n.paymentTerms, r = i("div", {
|
|
370
383
|
className: "spot-payment-terms",
|
|
371
|
-
parent:
|
|
384
|
+
parent: u
|
|
372
385
|
});
|
|
373
386
|
return i("div", {
|
|
374
387
|
className: "spot-payment-terms__header",
|
|
375
388
|
text: "PAYMENT TERMS",
|
|
376
|
-
parent:
|
|
389
|
+
parent: r
|
|
377
390
|
}), i("div", {
|
|
378
391
|
className: "spot-payment-terms__body",
|
|
379
|
-
text: e,
|
|
380
|
-
parent:
|
|
381
|
-
}),
|
|
392
|
+
text: e || "",
|
|
393
|
+
parent: r
|
|
394
|
+
}), r;
|
|
382
395
|
}
|
|
383
|
-
function
|
|
396
|
+
function M(u, t) {
|
|
384
397
|
const e = i("div", {
|
|
385
398
|
className: "spot-footer__container",
|
|
386
|
-
parent:
|
|
387
|
-
}),
|
|
399
|
+
parent: u
|
|
400
|
+
}), r = i("div", {
|
|
388
401
|
className: "spot-footer__terms",
|
|
389
402
|
parent: e
|
|
390
403
|
});
|
|
391
404
|
i("span", {
|
|
392
405
|
innerHTML: t.communication.legalDisclaimer,
|
|
393
|
-
parent:
|
|
394
|
-
}), i("br", { parent:
|
|
406
|
+
parent: r
|
|
407
|
+
}), i("br", { parent: r }), i("a", {
|
|
395
408
|
href: t.communication.termsAndConditionsUrl,
|
|
409
|
+
target: "_blank",
|
|
396
410
|
className: "spot-footer__terms-link",
|
|
397
411
|
text: "Refund Guarantee Terms and Conditions",
|
|
398
|
-
parent:
|
|
412
|
+
parent: r
|
|
399
413
|
});
|
|
400
|
-
const
|
|
414
|
+
const n = i("p", {
|
|
401
415
|
className: "spot-footer__powered-by",
|
|
402
416
|
parent: e
|
|
403
417
|
});
|
|
404
|
-
return
|
|
418
|
+
return n.innerHTML = `
|
|
405
419
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
406
420
|
<rect width="145" height="28"/>
|
|
407
421
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -418,18 +432,18 @@ function H(c, t) {
|
|
|
418
432
|
</defs>
|
|
419
433
|
</svg>`, e;
|
|
420
434
|
}
|
|
421
|
-
const M = ":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-title-font-size: 1.25rem;--spot-title-font-weight: 700;--spot-title-padding: 0 0 1.25rem 0;--spot-description-font-size: .875rem;--spot-description-font-weight: 400;--spot-description-padding: 0 0 .5rem 0;--spot-bullets-font-size: .875rem;--spot-bullets-font-weight: 400;--spot-bullets-padding: .3125rem;--spot-table-border-radius: .625rem;--spot-table-header-font-size: .875rem;--spot-table-header-font-weight: 700;--spot-table-header-padding: 0 .5rem .625rem;--spot-table-cell-font-size: .815rem;--spot-table-cell-font-weight: 400;--spot-table-cell-padding: 0 .625rem;--spot-radio-border: #000000;--spot-radio-border-radius: .625rem;--spot-radio-checked-background: #000000;--spot-radio-text-font-size: .875rem;--spot-radio-text-font-weight: 400;--spot-radio-text-padding: .625rem;--spot-radio-selection-background: #f4f4f4;--spot-radio-selection-border-radius: .625rem;--spot-radio-selection-padding: .625rem;--spot-recommended-tag-background: #000000;--spot-recommended-tag-font-color: #ffffff;--spot-recommended-tag-font-size: .875rem;--spot-recommended-tag-font-weight: 700;--spot-recommended-tag-padding: .25rem .5rem;--spot-recommended-tag-border-radius: .5rem;--spot-selection-error-font-color: #ff0000;--spot-selection-error-font-size: .875rem;--spot-qualifying-reasons-margin: .75rem 0;--spot-qualifying-reasons-padding: 0 .3125rem;--spot-qualifying-reasons-column-gap: 3rem;--spot-qualifying-reasons-row-gap: .25rem;--spot-qualifying-reasons-grid-padding-left: 1rem;--spot-qualifying-reasons-icon-wrapper-size: 1.125rem;--spot-qualifying-reasons-icon-size: .75rem;--spot-qualifying-reasons-icon-border-color: #2E2E2E;--spot-qualifying-reasons-icon-border-width: 1px;--spot-qualifying-reasons-icon-background: #ffffff;--spot-qualifying-reasons-item-gap: .625rem;--spot-qualifying-reasons-label-font-size: .8rem;--spot-qualifying-reasons-label-font-weight: 400;--spot-qualifying-reasons-label-font-color: #000000;--spot-qualifying-reasons-label-font-family: Arial;--spot-selection-error-padding: .5rem;--spot-payment-terms-background: #f4f4f4;--spot-payment-terms-border-radius: .625rem;--spot-payment-terms-padding: 1rem;--spot-payment-terms-font-color: #636569;--spot-payment-terms-font-size: .75rem;--spot-payment-terms-header-font-weight: 700;--spot-payment-terms-header-font-size: .875rem;--spot-payment-terms-header-margin-bottom: .5rem;--spot-payment-terms-header-border-color: #c2c2c2;--spot-payment-terms-header-padding: 0 0 .5rem 0;--spot-terms-font-size: .75rem;--spot-terms-font-weight: 400;--spot-terms-font-color: #636569;--spot-terms-padding: 0;--spot-terms-link-text-decoration: underline;--spot-terms-link-font-size: .75rem;--spot-terms-link-font-weight: 400;--spot-terms-link-font-color: #636569;--spot-terms-link-padding: 0}.spot-refund-guarantee{font-family:var(--spot-font-family);padding:var(--spot-padding);background-color:var(--spot-background-color);color:var(--spot-font-color);border:.0625rem solid #e0e0e0;border-radius:var(--spot-border-radius);max-width:51rem;margin:1rem}.spot-refund-guarantee *{color:inherit}.spot-header__title{font-size:var(--spot-title-font-size);font-weight:var(--spot-title-font-weight);padding:var(--spot-title-padding);color:var(--spot-title-font-color);font-family:var(--spot-title-font-family);line-height:120%;letter-spacing:-.03125rem}.spot-header__description{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:var(--spot-description-padding);line-height:125%;letter-spacing:-.025rem}.spot-content__wrapper{display:flex;flex-direction:column}@media (min-width: 48rem){.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr 20.3125rem;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list{grid-row:1}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1}.desktop-layout .spot-selection__options{grid-row:3}.desktop-layout .spot-table__container{grid-row:1 / span 3}}@media (max-width: 52.438rem){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 47.938rem){.spot-selection__recommended-tag{margin-top:0rem}}@media (max-width: 32.125rem){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 47.9375rem){.spot-table__container{display:flex;justify-content:center}.spot-selection__recommended-tag{display:inline-block;margin-left:0}.spot-footer__container{flex-direction:column;margin-top:.5rem}.spot-refund__table{width:100%;table-layout:auto}.spot-refund__table th{padding:0rem}}.spot-benefits__list{list-style-type:none;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-benefits__list li{margin-bottom:.5rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-qualifying-reasons__container{margin:var(--spot-qualifying-reasons-margin);padding:var(--spot-qualifying-reasons-padding)}.spot-qualifying-reasons__grid{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:var(--spot-qualifying-reasons-column-gap);row-gap:var(--spot-qualifying-reasons-row-gap);max-width:100%;padding-left:var(--spot-qualifying-reasons-grid-padding-left)}.spot-qualifying-reasons__item{display:flex;align-items:center;gap:var(--spot-qualifying-reasons-item-gap)}.spot-qualifying-reasons__icon-wrapper{width:var(--spot-qualifying-reasons-icon-wrapper-size);height:var(--spot-qualifying-reasons-icon-wrapper-size);border-radius:50%;border:var(--spot-qualifying-reasons-icon-border-width) solid var(--spot-qualifying-reasons-icon-border-color);background-color:var(--spot-qualifying-reasons-icon-background);display:flex;align-items:center;justify-content:center;flex-shrink:0}.spot-qualifying-reasons__icon{width:var(--spot-qualifying-reasons-icon-size);height:var(--spot-qualifying-reasons-icon-size)}.spot-qualifying-reasons__label{font-size:var(--spot-qualifying-reasons-label-font-size);font-weight:var(--spot-qualifying-reasons-label-font-weight);color:var(--spot-qualifying-reasons-label-font-color);font-family:var(--spot-qualifying-reasons-label-font-family);line-height:1.2}@media (max-width: 480px){.spot-qualifying-reasons__grid{grid-template-columns:1fr}}.spot-covered-items__container{margin-top:0;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:0 .3125rem .25rem;line-height:125%;margin:0}.spot-covered-items__list{list-style-type:disc;list-style-position:inside;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-covered-items__list li{margin-bottom:.3rem;text-align:left}.spot-table__container{width:100%}.spot-refund__table{max-width:22rem;border-radius:var(--spot-table-border-radius);overflow:hidden;border:.09375rem solid #636569;table-layout:fixed;margin-bottom:1.5rem;margin-top:.25rem;padding:.625rem}.spot-refund__table--dynamic{height:auto!important;min-height:7.5rem}.spot-refund__table td,.spot-refund__table th{padding:.375rem .625rem;text-align:left}.spot-refund__table th{text-align:left;font-size:var(--spot-table-header-font-size);font-weight:var(--spot-table-header-font-weight);color:var(--spot-table-header-font-color);font-family:var(--spot-table-header-font-family);padding:var(--spot-table-header-padding)}.spot-refund__table td{text-align:left;font-size:var(--spot-table-cell-font-size);font-weight:var(--spot-table-cell-font-weight);color:var(--spot-table-cell-font-color);font-family:var(--spot-table-cell-font-family);padding:var(--spot-table-cell-padding)}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;border:.0625rem solid var(--spot-radio-border);border-radius:var(--spot-radio-border-radius);margin-right:.5rem;position:relative;vertical-align:middle;top:-.0625rem;cursor:pointer}input[type=radio]:checked{background:var(--spot-radio-checked-background);box-shadow:inset 0 0 0 .0625rem #fff}.spot-selection__options{display:flex;flex-direction:column;gap:.5rem}.spot-selection__option{display:block;position:relative;transition:background .2s;cursor:pointer;font-size:var(--spot-radio-text-font-size);font-weight:var(--spot-radio-text-font-weight);color:var(--spot-radio-text-font-color);font-family:var(--spot-radio-text-font-family);padding:var(--spot-radio-text-padding);margin-right:.5rem;gap:.5rem;flex:1 0 0;align-self:stretch}.spot-selection__option.selected{background:var(--spot-radio-selection-background);border-radius:var(--spot-radio-selection-border-radius);padding:var(--spot-radio-selection-padding)}.spot-selection__recommended-tag{background:var(--spot-recommended-tag-background);color:var(--spot-recommended-tag-font-color);font-size:var(--spot-recommended-tag-font-size);font-weight:var(--spot-recommended-tag-font-weight);padding:var(--spot-recommended-tag-padding);border-radius:var(--spot-recommended-tag-border-radius);margin-left:1.5rem;white-space:nowrap}.spot-selection__error{color:var(--spot-selection-error-font-color);font-size:var(--spot-selection-error-font-size);padding:var(--spot-selection-error-padding);display:none}.spot-payment-terms__wrapper{margin-top:1rem}.spot-payment-terms__header{font-weight:var(--spot-payment-terms-header-font-weight);margin-bottom:.5rem;padding:var(--spot-payment-terms-header-padding);font-size:var(--spot-payment-terms-header-font-size);border-bottom:1px solid var(--spot-payment-terms-header-border-color)}.spot-payment-terms{background-color:var(--spot-payment-terms-background);border-radius:var(--spot-payment-terms-border-radius);padding:var(--spot-payment-terms-padding);margin-right:.5rem;color:var(--spot-payment-terms-font-color);font-size:var(--spot-payment-terms-font-size)}.spot-footer__terms{margin-top:.625rem;margin-right:.25rem;font-size:var(--spot-terms-font-size);font-weight:var(--spot-terms-font-weight);color:var(--spot-terms-font-color);font-family:var(--spot-terms-font-family);padding:var(--spot-terms-padding)}.spot-footer__terms-link{text-decoration:var(--spot-terms-link-text-decoration);font-size:var(--spot-terms-link-font-size);font-weight:var(--spot-terms-link-font-weight);color:var(--spot-terms-link-font-color);font-family:var(--spot-terms-link-font-family);padding:var(--spot-terms-link-padding)}.spot-footer__container{display:flex;justify-content:space-between;align-items:center}.spot-footer__powered-by{margin-top:1.5rem}";
|
|
422
|
-
function
|
|
435
|
+
const L = ":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-title-font-size: 1.25rem;--spot-title-font-weight: 700;--spot-title-padding: 0 0 1.25rem 0;--spot-description-font-size: .875rem;--spot-description-font-weight: 400;--spot-description-padding: 0 0 .5rem 0;--spot-bullets-font-size: .875rem;--spot-bullets-font-weight: 400;--spot-bullets-padding: .3125rem;--spot-table-border-radius: .625rem;--spot-table-header-font-size: .875rem;--spot-table-header-font-weight: 700;--spot-table-header-padding: 0 .5rem .625rem;--spot-table-cell-font-size: .815rem;--spot-table-cell-font-weight: 400;--spot-table-cell-padding: 0 .625rem;--spot-radio-border: #000000;--spot-radio-border-radius: .625rem;--spot-radio-checked-background: #000000;--spot-radio-text-font-size: .875rem;--spot-radio-text-font-weight: 400;--spot-radio-text-padding: .625rem;--spot-radio-selection-background: #f4f4f4;--spot-radio-selection-border-radius: .625rem;--spot-radio-selection-padding: .625rem;--spot-recommended-tag-background: #000000;--spot-recommended-tag-font-color: #ffffff;--spot-recommended-tag-font-size: .875rem;--spot-recommended-tag-font-weight: 700;--spot-recommended-tag-padding: .25rem .5rem;--spot-recommended-tag-border-radius: .5rem;--spot-selection-error-font-color: #ff0000;--spot-selection-error-font-size: .875rem;--spot-qualifying-reasons-margin: .75rem 0;--spot-qualifying-reasons-padding: 0 .3125rem;--spot-qualifying-reasons-column-gap: 3rem;--spot-qualifying-reasons-row-gap: .25rem;--spot-qualifying-reasons-grid-padding-left: 1rem;--spot-qualifying-reasons-icon-wrapper-size: 1.125rem;--spot-qualifying-reasons-icon-size: .75rem;--spot-qualifying-reasons-icon-border-color: #2E2E2E;--spot-qualifying-reasons-icon-border-width: 1px;--spot-qualifying-reasons-icon-background: #ffffff;--spot-qualifying-reasons-item-gap: .625rem;--spot-qualifying-reasons-label-font-size: .8rem;--spot-qualifying-reasons-label-font-weight: 400;--spot-qualifying-reasons-label-font-color: #000000;--spot-qualifying-reasons-label-font-family: Arial;--spot-selection-error-padding: .5rem;--spot-payment-terms-background: #f4f4f4;--spot-payment-terms-border-radius: .625rem;--spot-payment-terms-padding: 1rem;--spot-payment-terms-font-color: #636569;--spot-payment-terms-font-size: .75rem;--spot-payment-terms-header-font-weight: 700;--spot-payment-terms-header-font-size: .875rem;--spot-payment-terms-header-margin-bottom: .5rem;--spot-payment-terms-header-border-color: #c2c2c2;--spot-payment-terms-header-padding: 0 0 .5rem 0;--spot-terms-font-size: .75rem;--spot-terms-font-weight: 400;--spot-terms-font-color: #636569;--spot-terms-padding: 0;--spot-terms-link-text-decoration: underline;--spot-terms-link-font-size: .75rem;--spot-terms-link-font-weight: 400;--spot-terms-link-font-color: #636569;--spot-terms-link-padding: 0}.spot-refund-guarantee{font-family:var(--spot-font-family);padding:var(--spot-padding);background-color:var(--spot-background-color);color:var(--spot-font-color);border:.0625rem solid #e0e0e0;border-radius:var(--spot-border-radius);max-width:51rem;margin:1rem}.spot-refund-guarantee *{color:inherit}.spot-header__title{font-size:var(--spot-title-font-size);font-weight:var(--spot-title-font-weight);padding:var(--spot-title-padding);color:var(--spot-title-font-color);font-family:var(--spot-title-font-family);line-height:120%;letter-spacing:-.03125rem}.spot-header__description{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:var(--spot-description-padding);line-height:125%;letter-spacing:-.025rem}.spot-content__wrapper{display:flex;flex-direction:column}@media (min-width: 48rem){.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr 20.3125rem;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list{grid-row:1}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1}.desktop-layout .spot-selection__options{grid-row:3}.desktop-layout .spot-table__container{grid-row:1 / span 3}}@media (max-width: 52.438rem){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 47.938rem){.spot-selection__recommended-tag{margin-top:0rem}}@media (max-width: 32.125rem){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 47.9375rem){.spot-table__container{display:flex;justify-content:center}.spot-selection__recommended-tag{display:inline-block;margin-left:0}.spot-footer__container{flex-direction:column;margin-top:.5rem}.spot-refund__table{width:100%;table-layout:auto}.spot-refund__table th{padding:0rem}}.spot-benefits__list{list-style-type:none;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-benefits__list li{margin-bottom:.5rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-qualifying-reasons__container{margin:var(--spot-qualifying-reasons-margin);padding:var(--spot-qualifying-reasons-padding)}.spot-qualifying-reasons__grid{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:var(--spot-qualifying-reasons-column-gap);row-gap:var(--spot-qualifying-reasons-row-gap);max-width:100%;padding-left:var(--spot-qualifying-reasons-grid-padding-left)}.spot-qualifying-reasons__item{display:flex;align-items:center;gap:var(--spot-qualifying-reasons-item-gap)}.spot-qualifying-reasons__icon-wrapper{width:var(--spot-qualifying-reasons-icon-wrapper-size);height:var(--spot-qualifying-reasons-icon-wrapper-size);border-radius:50%;border:var(--spot-qualifying-reasons-icon-border-width) solid var(--spot-qualifying-reasons-icon-border-color);background-color:var(--spot-qualifying-reasons-icon-background);display:flex;align-items:center;justify-content:center;flex-shrink:0}.spot-qualifying-reasons__icon{width:var(--spot-qualifying-reasons-icon-size);height:var(--spot-qualifying-reasons-icon-size)}.spot-qualifying-reasons__label{font-size:var(--spot-qualifying-reasons-label-font-size);font-weight:var(--spot-qualifying-reasons-label-font-weight);color:var(--spot-qualifying-reasons-label-font-color);font-family:var(--spot-qualifying-reasons-label-font-family);line-height:1.2}@media (max-width: 480px){.spot-qualifying-reasons__grid{grid-template-columns:1fr}}.spot-covered-items__container{margin-top:0;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:0 .3125rem .25rem;line-height:125%;margin:0}.spot-covered-items__list{list-style-type:disc;list-style-position:inside;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-covered-items__list li{margin-bottom:.3rem;text-align:left}.spot-table__container{width:100%}.spot-refund__table{max-width:22rem;border-radius:var(--spot-table-border-radius);overflow:hidden;border:.09375rem solid #636569;table-layout:fixed;margin-bottom:1.5rem;margin-top:.25rem;padding:.625rem}.spot-refund__table--dynamic{height:auto!important;min-height:7.5rem}.spot-refund__table td,.spot-refund__table th{padding:.375rem .625rem;text-align:left}.spot-refund__table th{text-align:left;font-size:var(--spot-table-header-font-size);font-weight:var(--spot-table-header-font-weight);color:var(--spot-table-header-font-color);font-family:var(--spot-table-header-font-family);padding:var(--spot-table-header-padding)}.spot-refund__table td{text-align:left;font-size:var(--spot-table-cell-font-size);font-weight:var(--spot-table-cell-font-weight);color:var(--spot-table-cell-font-color);font-family:var(--spot-table-cell-font-family);padding:var(--spot-table-cell-padding)}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;border:.0625rem solid var(--spot-radio-border);border-radius:var(--spot-radio-border-radius);margin-right:.5rem;position:relative;vertical-align:middle;top:-.0625rem;cursor:pointer}input[type=radio]:checked{background:var(--spot-radio-checked-background);box-shadow:inset 0 0 0 .0625rem #fff}.spot-selection__options{display:flex;flex-direction:column;gap:.5rem}.spot-selection__option{display:block;position:relative;transition:background .2s;cursor:pointer;font-size:var(--spot-radio-text-font-size);font-weight:var(--spot-radio-text-font-weight);color:var(--spot-radio-text-font-color);font-family:var(--spot-radio-text-font-family);padding:var(--spot-radio-text-padding);margin-right:.5rem;gap:.5rem;flex:1 0 0;align-self:stretch}.spot-selection__option.selected{background:var(--spot-radio-selection-background);border-radius:var(--spot-radio-selection-border-radius);padding:var(--spot-radio-selection-padding)}.spot-selection__recommended-tag{background:var(--spot-recommended-tag-background);color:var(--spot-recommended-tag-font-color);font-size:var(--spot-recommended-tag-font-size);font-weight:var(--spot-recommended-tag-font-weight);padding:var(--spot-recommended-tag-padding);border-radius:var(--spot-recommended-tag-border-radius);margin-left:1.5rem;white-space:nowrap}.spot-selection__error{color:var(--spot-selection-error-font-color);font-size:var(--spot-selection-error-font-size);padding:var(--spot-selection-error-padding);display:none}.spot-payment-terms__wrapper{margin-top:1rem}.spot-payment-terms__header{font-weight:var(--spot-payment-terms-header-font-weight);margin-bottom:.5rem;padding:var(--spot-payment-terms-header-padding);font-size:var(--spot-payment-terms-header-font-size);border-bottom:1px solid var(--spot-payment-terms-header-border-color)}.spot-payment-terms{background-color:var(--spot-payment-terms-background);border-radius:var(--spot-payment-terms-border-radius);padding:var(--spot-payment-terms-padding);margin-right:.5rem;color:var(--spot-payment-terms-font-color);font-size:var(--spot-payment-terms-font-size)}.spot-footer__terms{margin-top:.625rem;margin-right:.25rem;font-size:var(--spot-terms-font-size);font-weight:var(--spot-terms-font-weight);color:var(--spot-terms-font-color);font-family:var(--spot-terms-font-family);padding:var(--spot-terms-padding)}.spot-footer__terms-link{text-decoration:var(--spot-terms-link-text-decoration);font-size:var(--spot-terms-link-font-size);font-weight:var(--spot-terms-link-font-weight);color:var(--spot-terms-link-font-color);font-family:var(--spot-terms-link-font-family);padding:var(--spot-terms-link-padding)}.spot-footer__container{display:flex;justify-content:space-between;align-items:center}.spot-footer__powered-by{margin-top:1.5rem}";
|
|
436
|
+
function A(u) {
|
|
423
437
|
const t = document.createElement("style");
|
|
424
|
-
t.textContent =
|
|
438
|
+
t.textContent = u, document.head.appendChild(t);
|
|
425
439
|
}
|
|
426
|
-
L
|
|
440
|
+
A(L);
|
|
427
441
|
const x = {
|
|
428
442
|
sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
|
|
429
443
|
production: "https://api.getspot.com/api/v1/quote",
|
|
430
444
|
local: "http://localhost:3999/api/v1/quote"
|
|
431
445
|
};
|
|
432
|
-
class
|
|
446
|
+
class V {
|
|
433
447
|
constructor(t = {}) {
|
|
434
448
|
this.options = {
|
|
435
449
|
location: "body",
|
|
@@ -442,55 +456,63 @@ class A {
|
|
|
442
456
|
}, this._onResize = this._updateLayout.bind(this), this.root = typeof this.options.location == "string" ? document.querySelector(this.options.location) : this.options.location, this.currentSelection = this.options.optInSelected ? "yes" : null, this._init();
|
|
443
457
|
}
|
|
444
458
|
async _init() {
|
|
445
|
-
var t, e, n, o
|
|
459
|
+
var t, e, r, n, o;
|
|
446
460
|
try {
|
|
447
|
-
|
|
448
|
-
const { environment: p, partnerId:
|
|
449
|
-
|
|
450
|
-
|
|
461
|
+
T(this.options);
|
|
462
|
+
const { environment: p, partnerId: s } = this.options.apiConfig, m = this.options.apiConfig.customEndpoint || x[p], f = "cartInfo" in this.options.quoteRequestData && "items" in this.options.quoteRequestData ? await k(
|
|
463
|
+
m,
|
|
464
|
+
s,
|
|
451
465
|
this.options.quoteRequestData
|
|
452
|
-
) : await
|
|
453
|
-
if (
|
|
454
|
-
|
|
466
|
+
) : await D(m, s, this.options.quoteRequestData);
|
|
467
|
+
if (f.status !== "QUOTE_AVAILABLE") {
|
|
468
|
+
f.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
455
469
|
status: "NO_MATCHING_QUOTE",
|
|
456
470
|
data: this.options.quoteRequestData
|
|
457
471
|
});
|
|
458
472
|
return;
|
|
459
473
|
}
|
|
460
|
-
if (this.quote =
|
|
461
|
-
const
|
|
474
|
+
if (this.quote = f.data, this._renderWidget(), this.options.optInSelected && ((e = this.options.callbacks) != null && e.onOptIn)) {
|
|
475
|
+
const g = {
|
|
462
476
|
status: "QUOTE_ACCEPTED",
|
|
463
477
|
spotPrice: this.quote.spotPrice,
|
|
464
478
|
quoteId: this.quote.id
|
|
465
479
|
};
|
|
466
|
-
this.quote.originalQuotes && this.quote.originalQuotes.length > 0
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
480
|
+
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
481
|
+
const a = this.options.quoteRequestData;
|
|
482
|
+
g.batchQuoteDetails = this.quote.originalQuotes.map((d) => {
|
|
483
|
+
var w;
|
|
484
|
+
const l = (w = a.items) == null ? void 0 : w.find(
|
|
485
|
+
(v) => (v.cartItemId || `item-${a.items.indexOf(v) + 1}`) === d.id
|
|
486
|
+
);
|
|
487
|
+
return {
|
|
488
|
+
quoteId: d.id,
|
|
489
|
+
productPrice: (l == null ? void 0 : l.productPrice) || d.spotPrice,
|
|
490
|
+
cartItemId: d.id
|
|
491
|
+
};
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
this.options.callbacks.onOptIn(g);
|
|
477
495
|
}
|
|
478
|
-
(
|
|
496
|
+
(r = this.options.callbacks) != null && r.onQuoteRetrieved && this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
479
497
|
} catch (p) {
|
|
480
|
-
(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
498
|
+
if ((n = this.options.callbacks) != null && n.onError) {
|
|
499
|
+
const s = p;
|
|
500
|
+
(o = this.options.callbacks) == null || o.onError({
|
|
501
|
+
message: s.message,
|
|
502
|
+
status: s.status,
|
|
503
|
+
responseBody: s.responseBody
|
|
504
|
+
});
|
|
505
|
+
}
|
|
485
506
|
}
|
|
486
507
|
}
|
|
487
508
|
_renderWidget() {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
509
|
+
if (!this.quote) return;
|
|
510
|
+
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([r, n]) => {
|
|
511
|
+
const o = `--${r}`;
|
|
512
|
+
this.container.style.setProperty(o, n);
|
|
513
|
+
}), P(this.container, this.quote.communication);
|
|
492
514
|
const t = document.createElement("div");
|
|
493
|
-
t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ?
|
|
515
|
+
t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? z(t, this.quote.qualifyingReasons) : $(t, this.quote.communication.bulletPoints), this.quote.coveredItems && R(t, this.quote.coveredItems), this.options.showTable && !this.quote.qualifyingReasons && S(t, this.quote.payoutSchedule);
|
|
494
516
|
const e = Q(
|
|
495
517
|
t,
|
|
496
518
|
this.options.optInSelected,
|
|
@@ -499,56 +521,66 @@ class A {
|
|
|
499
521
|
t.appendChild(e), this.paymentTermsEl = i("div", {
|
|
500
522
|
className: "spot-payment-terms__wrapper",
|
|
501
523
|
parent: t
|
|
502
|
-
}),
|
|
524
|
+
}), M(this.container, this.quote), window.addEventListener("resize", this._onResize), this._updateLayout(), this._setupOptionListeners(e);
|
|
503
525
|
}
|
|
504
526
|
_updateLayout() {
|
|
527
|
+
var r;
|
|
528
|
+
if (!this.container || !this.quote) return;
|
|
505
529
|
const t = window.matchMedia("(min-width: 768px)").matches, e = this.options.showTable && !this.quote.qualifyingReasons;
|
|
506
|
-
this.container.querySelector(".spot-content__wrapper").classList.toggle("desktop-layout", t && e);
|
|
530
|
+
(r = this.container.querySelector(".spot-content__wrapper")) == null || r.classList.toggle("desktop-layout", t && e);
|
|
507
531
|
}
|
|
508
532
|
_setupOptionListeners(t) {
|
|
509
|
-
const e = t.querySelectorAll('input[type="radio"]'),
|
|
510
|
-
e.forEach((
|
|
511
|
-
|
|
512
|
-
var
|
|
513
|
-
const p =
|
|
514
|
-
if (this.hideSelectionError(), this.currentSelection =
|
|
515
|
-
const
|
|
533
|
+
const e = t.querySelectorAll('input[type="radio"]'), r = t.querySelectorAll(".spot-selection__option");
|
|
534
|
+
e.forEach((n) => {
|
|
535
|
+
n.addEventListener("change", (o) => {
|
|
536
|
+
var c, m, b;
|
|
537
|
+
const p = o.target, s = p.value;
|
|
538
|
+
if (this.hideSelectionError(), this.currentSelection = s, r.forEach((f) => f.classList.remove("selected")), (c = p.closest(".spot-selection__option")) == null || c.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), s === "yes" && (this.options.quoteRequestData.isPartialPayment && H(this.paymentTermsEl, this.quote), (m = this.options.callbacks) != null && m.onOptIn)) {
|
|
539
|
+
const f = {
|
|
516
540
|
status: "QUOTE_ACCEPTED",
|
|
517
541
|
spotPrice: this.quote.spotPrice,
|
|
518
542
|
quoteId: this.quote.id
|
|
519
543
|
};
|
|
520
|
-
this.quote.originalQuotes && this.quote.originalQuotes.length > 0
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
544
|
+
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
545
|
+
const g = this.options.quoteRequestData;
|
|
546
|
+
f.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
547
|
+
(a) => {
|
|
548
|
+
var l;
|
|
549
|
+
const d = (l = g.items) == null ? void 0 : l.find(
|
|
550
|
+
(w) => (w.cartItemId || `item-${g.items.indexOf(w) + 1}`) === a.id
|
|
551
|
+
);
|
|
552
|
+
return {
|
|
553
|
+
quoteId: a.id,
|
|
554
|
+
productPrice: (d == null ? void 0 : d.productPrice) || a.spotPrice,
|
|
555
|
+
cartItemId: a.id
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
this.options.callbacks.onOptIn(f);
|
|
533
561
|
}
|
|
534
|
-
if (
|
|
535
|
-
const
|
|
562
|
+
if (s === "no" && ((b = this.options.callbacks) != null && b.onOptOut)) {
|
|
563
|
+
const f = {
|
|
536
564
|
status: "QUOTE_DECLINED",
|
|
537
565
|
quoteId: this.quote.id
|
|
538
566
|
};
|
|
539
|
-
this.quote.originalQuotes && this.quote.originalQuotes.length > 0
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
567
|
+
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
568
|
+
const g = this.options.quoteRequestData;
|
|
569
|
+
f.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
570
|
+
(a) => {
|
|
571
|
+
var l;
|
|
572
|
+
const d = (l = g.items) == null ? void 0 : l.find(
|
|
573
|
+
(w) => (w.cartItemId || `item-${g.items.indexOf(w) + 1}`) === a.id
|
|
574
|
+
);
|
|
575
|
+
return {
|
|
576
|
+
quoteId: a.id,
|
|
577
|
+
productPrice: (d == null ? void 0 : d.productPrice) || a.spotPrice,
|
|
578
|
+
cartItemId: a.id
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
this.options.callbacks.onOptOut(f);
|
|
552
584
|
}
|
|
553
585
|
});
|
|
554
586
|
});
|
|
@@ -575,63 +607,68 @@ class A {
|
|
|
575
607
|
return t ? this.hideSelectionError() : this.showSelectionError(), t;
|
|
576
608
|
}
|
|
577
609
|
async updateQuote(t) {
|
|
578
|
-
var e, n, o;
|
|
610
|
+
var e, r, n, o;
|
|
579
611
|
try {
|
|
580
|
-
const
|
|
612
|
+
const p = {
|
|
581
613
|
...this.options,
|
|
582
614
|
quoteRequestData: t
|
|
583
615
|
};
|
|
584
|
-
|
|
616
|
+
T(p);
|
|
585
617
|
const {
|
|
586
|
-
environment:
|
|
587
|
-
partnerId:
|
|
588
|
-
|
|
589
|
-
} = this.options.apiConfig,
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
) : await
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
618
|
+
environment: s,
|
|
619
|
+
partnerId: c,
|
|
620
|
+
customEndpoint: m
|
|
621
|
+
} = this.options.apiConfig, b = m || x[s], g = "cartInfo" in p.quoteRequestData && "items" in p.quoteRequestData ? await k(
|
|
622
|
+
b,
|
|
623
|
+
c,
|
|
624
|
+
p.quoteRequestData
|
|
625
|
+
) : await D(
|
|
626
|
+
b,
|
|
627
|
+
c,
|
|
628
|
+
p.quoteRequestData
|
|
597
629
|
);
|
|
598
|
-
return
|
|
630
|
+
return g.status !== "QUOTE_AVAILABLE" ? (g.status === "NO_MATCHING_QUOTE" && ((e = this.options.callbacks) != null && e.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
|
|
599
631
|
status: "NO_MATCHING_QUOTE",
|
|
600
|
-
data:
|
|
601
|
-
}), !1) : (this.options.quoteRequestData =
|
|
602
|
-
} catch (
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
632
|
+
data: p.quoteRequestData
|
|
633
|
+
}), !1) : (this.options.quoteRequestData = p.quoteRequestData, this.quote = g.data, this.currentSelection = null, this.destroy(), this._renderWidget(), (r = this.options.callbacks) != null && r.onQuoteRetrieved && this.options.callbacks.onQuoteRetrieved(this.quote), !0);
|
|
634
|
+
} catch (p) {
|
|
635
|
+
const s = p;
|
|
636
|
+
return (o = (n = this.options.callbacks) == null ? void 0 : n.onError) == null || o.call(n, {
|
|
637
|
+
message: s.message,
|
|
638
|
+
status: s.status,
|
|
639
|
+
responseBody: s.responseBody
|
|
607
640
|
}), !1;
|
|
608
641
|
}
|
|
609
642
|
}
|
|
610
643
|
getSelection() {
|
|
611
|
-
var e,
|
|
644
|
+
var e, r, n;
|
|
612
645
|
if (this.currentSelection == null) return null;
|
|
613
646
|
const t = {
|
|
614
647
|
selection: this.currentSelection,
|
|
615
648
|
quoteId: (e = this.quote) == null ? void 0 : e.id,
|
|
616
|
-
spotPrice: (
|
|
649
|
+
spotPrice: (r = this.quote) == null ? void 0 : r.spotPrice,
|
|
617
650
|
status: this.currentSelection === "yes" ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED"
|
|
618
651
|
};
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
652
|
+
if ((n = this.quote) != null && n.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
653
|
+
const o = this.options.quoteRequestData;
|
|
654
|
+
t.batchQuoteDetails = this.quote.originalQuotes.map((p) => {
|
|
655
|
+
var c;
|
|
656
|
+
const s = (c = o.items) == null ? void 0 : c.find(
|
|
657
|
+
(m) => (m.cartItemId || `item-${o.items.indexOf(m) + 1}`) === p.id
|
|
658
|
+
);
|
|
659
|
+
return {
|
|
660
|
+
quoteId: p.id,
|
|
661
|
+
productPrice: (s == null ? void 0 : s.productPrice) || p.spotPrice,
|
|
662
|
+
cartItemId: p.id
|
|
663
|
+
};
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
return t;
|
|
630
667
|
}
|
|
631
668
|
destroy() {
|
|
632
669
|
window.removeEventListener("resize", this._onResize), this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container);
|
|
633
670
|
}
|
|
634
671
|
}
|
|
635
672
|
export {
|
|
636
|
-
|
|
673
|
+
V as default
|
|
637
674
|
};
|