@getspot/spot-widget 4.3.0 → 4.4.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/CHANGELOG.md +14 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +167 -154
- package/dist/index.umd.js +4 -4
- package/dist/ui.d.ts +2 -2
- package/dist/ui.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [4.4.0](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@4.3.1...@getspot/spot-widget@4.4.0) (2026-07-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **core:** explain lack of coverage when non-US resident is selected [ST-5295] ([333435d](https://gitlab.com/getspot/spot-widget/commit/333435d9b760d70351551f559068b7643cbbbbce))
|
|
7
|
+
|
|
8
|
+
## [4.3.1](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@4.3.0...@getspot/spot-widget@4.3.1) (2026-06-29)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **core:** preserve user selection across updateQuote re-renders ([a232974](https://gitlab.com/getspot/spot-widget/commit/a23297487d0a42eb9505d256809bde1943a91001))
|
|
14
|
+
|
|
1
15
|
# [4.3.0](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@4.2.0...@getspot/spot-widget@4.3.0) (2026-06-22)
|
|
2
16
|
|
|
3
17
|
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const NON_US_RESIDENT_VALUE = "non-us-resident";
|
|
2
|
+
export declare const NON_US_RESIDENT_ERROR_TEXT = "Unfortunately, we are currently unable to offer coverage or process claims for non-US residents.";
|
|
2
3
|
export declare const US_STATES: {
|
|
3
4
|
value: string;
|
|
4
5
|
label: string;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,eAAO,MAAM,SAAS,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAyDvD,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,eAAO,MAAM,0BAA0B,qGAC6D,CAAC;AAErG,eAAO,MAAM,SAAS,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAyDvD,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EAKnB,MAAM,YAAY,CAAC;AAkBpB,cAAM,UAAU;IACd,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,cAAc,CAAC,CAAc;IACrC,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAQ;IACtB,OAAO,CAAC,cAAc,CAAC,CAAoB;IAC3C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,eAAe,CAAC,CAAiB;gBAE7B,OAAO,GAAE,OAAO,CAAC,iBAAiB,CAAM;YAuBtC,KAAK;IAoGnB,OAAO,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EAKnB,MAAM,YAAY,CAAC;AAkBpB,cAAM,UAAU;IACd,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,cAAc,CAAC,CAAc;IACrC,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAQ;IACtB,OAAO,CAAC,cAAc,CAAC,CAAoB;IAC3C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,eAAe,CAAC,CAAiB;gBAE7B,OAAO,GAAE,OAAO,CAAC,iBAAiB,CAAM;YAuBtC,KAAK;IAoGnB,OAAO,CAAC,aAAa;IA0ErB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,uBAAuB;IAqC/B,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,cAAc,CAAC,CAAS;IAEhC,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,qBAAqB;IA6F7B,kBAAkB,IAAI,IAAI;IAgB1B,kBAAkB,IAAI,IAAI;IAM1B,iBAAiB,IAAI,OAAO;IAgBtB,WAAW,CACf,mBAAmB,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,GACzD,OAAO,CAAC,OAAO,CAAC;IAsEnB,YAAY,IAAI,aAAa,GAAG,IAAI;IAgCpC,OAAO,IAAI,IAAI;CAahB;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,GACN,MAAM,YAAY,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function T(c, t, r, s) {
|
|
2
2
|
try {
|
|
3
3
|
const i = s ? { ...r, state: s } : r, a = await fetch(c, {
|
|
4
4
|
method: "POST",
|
|
@@ -36,7 +36,7 @@ async function z(c, t, r) {
|
|
|
36
36
|
throw s instanceof Error ? s : new Error("Unknown error occurred while fetching batch quote");
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async function
|
|
39
|
+
async function N(c, t, r, s) {
|
|
40
40
|
var i;
|
|
41
41
|
try {
|
|
42
42
|
const a = {
|
|
@@ -56,18 +56,18 @@ async function S(c, t, r, s) {
|
|
|
56
56
|
(v, h) => (v.cartItemId || `item-${h + 1}`) === m.cartItemId
|
|
57
57
|
);
|
|
58
58
|
return f ? f.participantDescription ? `${f.productName} - ${f.participantDescription}` : f.productName : `Item ${m.id}`;
|
|
59
|
-
}),
|
|
59
|
+
}), p = Math.round((e.totalSpotPrice || e.spotPrice || 0) * 100) / 100;
|
|
60
60
|
return {
|
|
61
61
|
status: "QUOTE_AVAILABLE",
|
|
62
62
|
data: {
|
|
63
63
|
id: e.quotes ? e.quotes.map((m) => m.id).join(",") : ((i = e.data) == null ? void 0 : i.id) || "",
|
|
64
|
-
spotPrice:
|
|
64
|
+
spotPrice: p,
|
|
65
65
|
currencyCode: e.currencyCode || "",
|
|
66
66
|
communication: {
|
|
67
67
|
...e.communication,
|
|
68
68
|
yesOptionText: e.communication.yesOptionText.replace(
|
|
69
69
|
String(e.totalSpotPrice),
|
|
70
|
-
String(
|
|
70
|
+
String(p)
|
|
71
71
|
)
|
|
72
72
|
},
|
|
73
73
|
payoutSchedule: e.payoutSchedule.map((m) => ({
|
|
@@ -77,14 +77,14 @@ async function S(c, t, r, s) {
|
|
|
77
77
|
coveredItems: o,
|
|
78
78
|
originalQuotes: e.quotes || (e.data ? [e.data] : [])
|
|
79
79
|
},
|
|
80
|
-
spotPrice:
|
|
80
|
+
spotPrice: p,
|
|
81
81
|
coveredItems: o
|
|
82
82
|
};
|
|
83
83
|
} catch (a) {
|
|
84
84
|
throw a instanceof Error ? a : new Error("Unknown error occurred while fetching multiple quotes");
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const E = "non-us-resident", A = "Unfortunately, we are currently unable to offer coverage or process claims for non-US residents.", L = [
|
|
88
88
|
{ value: "AL", label: "Alabama" },
|
|
89
89
|
{ value: "AK", label: "Alaska" },
|
|
90
90
|
{ value: "AS", label: "American Samoa" },
|
|
@@ -141,7 +141,7 @@ const q = "non-us-resident", A = [
|
|
|
141
141
|
{ value: "WV", label: "West Virginia" },
|
|
142
142
|
{ value: "WI", label: "Wisconsin" },
|
|
143
143
|
{ value: "WY", label: "Wyoming" }
|
|
144
|
-
], O = new Set(
|
|
144
|
+
], O = new Set(L.map((c) => c.value)), I = [
|
|
145
145
|
"USD",
|
|
146
146
|
"CAD",
|
|
147
147
|
"AUD",
|
|
@@ -165,7 +165,7 @@ const q = "non-us-resident", A = [
|
|
|
165
165
|
"SGD",
|
|
166
166
|
"THB",
|
|
167
167
|
"ZAR"
|
|
168
|
-
],
|
|
168
|
+
], P = {
|
|
169
169
|
sandbox: "https://api.sandbox.getspot.com/v1/quote",
|
|
170
170
|
production: "https://api.getspot.com/v1/quote",
|
|
171
171
|
local: "http://localhost:3999/api/v1/quote"
|
|
@@ -180,11 +180,11 @@ function M(c) {
|
|
|
180
180
|
} = c, {
|
|
181
181
|
environment: e = "sandbox",
|
|
182
182
|
partnerId: o,
|
|
183
|
-
customEndpoint:
|
|
183
|
+
customEndpoint: p
|
|
184
184
|
} = t;
|
|
185
185
|
if (!o || typeof o != "string")
|
|
186
186
|
throw new Error("Invalid or missing partnerId in apiConfig");
|
|
187
|
-
if (!(
|
|
187
|
+
if (!(p || P[e]))
|
|
188
188
|
throw new Error(`Invalid environment in apiConfig: ${e}`);
|
|
189
189
|
if (!r || typeof r != "object" && !Array.isArray(r))
|
|
190
190
|
throw new Error("quoteRequestData must be a non-null object or array");
|
|
@@ -200,57 +200,57 @@ function M(c) {
|
|
|
200
200
|
"cartId",
|
|
201
201
|
"productName"
|
|
202
202
|
];
|
|
203
|
-
function v(
|
|
203
|
+
function v(l, u = null) {
|
|
204
204
|
const d = u !== null ? `quoteRequestData[${u}]` : "quoteRequestData";
|
|
205
205
|
f.forEach((g) => {
|
|
206
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
206
|
+
if (!Object.prototype.hasOwnProperty.call(l, g) || l[g] === void 0 || l[g] === null)
|
|
207
207
|
throw new Error(`Missing required ${d} field: '${g}'`);
|
|
208
208
|
});
|
|
209
|
-
const
|
|
210
|
-
if (!
|
|
209
|
+
const b = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
210
|
+
if (!b.test(l.startDate))
|
|
211
211
|
throw new Error(`${d}.startDate must be a valid ISO8601 string`);
|
|
212
|
-
if (!
|
|
212
|
+
if (!b.test(l.endDate))
|
|
213
213
|
throw new Error(`${d}.endDate must be a valid ISO8601 string`);
|
|
214
|
-
if (typeof
|
|
214
|
+
if (typeof l.currencyCode != "string")
|
|
215
215
|
throw new Error(`${d}.currencyCode must be a string`);
|
|
216
|
-
if (!I.includes(
|
|
217
|
-
throw new Error(`Invalid ${d}.currencyCode: ${
|
|
218
|
-
if (typeof
|
|
216
|
+
if (!I.includes(l.currencyCode))
|
|
217
|
+
throw new Error(`Invalid ${d}.currencyCode: ${l.currencyCode}`);
|
|
218
|
+
if (typeof l.eventType != "string")
|
|
219
219
|
throw new Error(`${d}.eventType must be a string`);
|
|
220
|
-
if (typeof
|
|
220
|
+
if (typeof l.productType != "string")
|
|
221
221
|
throw new Error(`${d}.productType must be a string`);
|
|
222
|
-
const
|
|
223
|
-
if (!
|
|
222
|
+
const w = ["Pass", "Trip", "Registration"];
|
|
223
|
+
if (!w.includes(l.productType))
|
|
224
224
|
throw new Error(
|
|
225
|
-
`${d}.productType must be one of ${
|
|
225
|
+
`${d}.productType must be one of ${w.join(", ")}`
|
|
226
226
|
);
|
|
227
|
-
if (typeof
|
|
227
|
+
if (typeof l.productDuration != "string")
|
|
228
228
|
throw new Error(`${d}.productDuration must be a string`);
|
|
229
229
|
const C = ["Daily", "Seasonal", "Trip", "Event"];
|
|
230
|
-
if (!C.includes(
|
|
230
|
+
if (!C.includes(l.productDuration))
|
|
231
231
|
throw new Error(
|
|
232
232
|
`${d}.productDuration must be one of ${C.join(", ")}`
|
|
233
233
|
);
|
|
234
|
-
if (typeof
|
|
234
|
+
if (typeof l.productPrice != "number" || isNaN(l.productPrice))
|
|
235
235
|
throw new Error(`${d}.productPrice must be a valid number`);
|
|
236
|
-
if (typeof
|
|
236
|
+
if (typeof l.productId != "string")
|
|
237
237
|
throw new Error(`${d}.productId must be a string`);
|
|
238
|
-
if (typeof
|
|
238
|
+
if (typeof l.cartId != "string")
|
|
239
239
|
throw new Error(`${d}.cartId must be a string`);
|
|
240
|
-
if (typeof
|
|
240
|
+
if (typeof l.productName != "string")
|
|
241
241
|
throw new Error(`${d}.productName must be a string`);
|
|
242
242
|
}
|
|
243
243
|
if ("items" in r) {
|
|
244
|
-
const
|
|
244
|
+
const l = r, { cartId: u, cartName: d, currencyCode: b, items: w } = l;
|
|
245
245
|
if (!u || typeof u != "string")
|
|
246
246
|
throw new Error("quoteRequestData.cartId must be a string");
|
|
247
247
|
if (!d || typeof d != "string")
|
|
248
248
|
throw new Error("quoteRequestData.cartName must be a string");
|
|
249
|
-
if (!
|
|
249
|
+
if (!b || typeof b != "string")
|
|
250
250
|
throw new Error("quoteRequestData.currencyCode must be a string");
|
|
251
|
-
if (!I.includes(
|
|
252
|
-
throw new Error(`Invalid quoteRequestData.currencyCode: ${
|
|
253
|
-
if (!Array.isArray(
|
|
251
|
+
if (!I.includes(b))
|
|
252
|
+
throw new Error(`Invalid quoteRequestData.currencyCode: ${b}`);
|
|
253
|
+
if (!Array.isArray(w) || w.length === 0)
|
|
254
254
|
throw new Error("quoteRequestData.items must be a non-empty array");
|
|
255
255
|
const C = [
|
|
256
256
|
"startDate",
|
|
@@ -262,45 +262,45 @@ function M(c) {
|
|
|
262
262
|
"productId",
|
|
263
263
|
"productName"
|
|
264
264
|
];
|
|
265
|
-
|
|
265
|
+
w.forEach((g, k) => {
|
|
266
266
|
if (!g || typeof g != "object")
|
|
267
267
|
throw new Error(`quoteRequestData.items[${k}] must be a non-null object`);
|
|
268
|
-
const
|
|
269
|
-
C.forEach((
|
|
270
|
-
if (!Object.prototype.hasOwnProperty.call(g,
|
|
271
|
-
throw new Error(`Missing required ${
|
|
268
|
+
const y = `quoteRequestData.items[${k}]`;
|
|
269
|
+
C.forEach((q) => {
|
|
270
|
+
if (!Object.prototype.hasOwnProperty.call(g, q) || g[q] === void 0 || g[q] === null)
|
|
271
|
+
throw new Error(`Missing required ${y} field: '${q}'`);
|
|
272
272
|
});
|
|
273
273
|
const x = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
274
274
|
if (!x.test(g.startDate))
|
|
275
|
-
throw new Error(`${
|
|
275
|
+
throw new Error(`${y}.startDate must be a valid ISO8601 string`);
|
|
276
276
|
if (!x.test(g.endDate))
|
|
277
|
-
throw new Error(`${
|
|
277
|
+
throw new Error(`${y}.endDate must be a valid ISO8601 string`);
|
|
278
278
|
if (typeof g.eventType != "string")
|
|
279
|
-
throw new Error(`${
|
|
279
|
+
throw new Error(`${y}.eventType must be a string`);
|
|
280
280
|
if (typeof g.productType != "string")
|
|
281
|
-
throw new Error(`${
|
|
281
|
+
throw new Error(`${y}.productType must be a string`);
|
|
282
282
|
const D = ["Pass", "Trip", "Registration"];
|
|
283
283
|
if (!D.includes(g.productType))
|
|
284
|
-
throw new Error(`${
|
|
284
|
+
throw new Error(`${y}.productType must be one of ${D.join(", ")}`);
|
|
285
285
|
if (typeof g.productDuration != "string")
|
|
286
|
-
throw new Error(`${
|
|
287
|
-
const
|
|
288
|
-
if (!
|
|
289
|
-
throw new Error(`${
|
|
286
|
+
throw new Error(`${y}.productDuration must be a string`);
|
|
287
|
+
const S = ["Daily", "Seasonal", "Trip", "Event"];
|
|
288
|
+
if (!S.includes(g.productDuration))
|
|
289
|
+
throw new Error(`${y}.productDuration must be one of ${S.join(", ")}`);
|
|
290
290
|
if (typeof g.productPrice != "number" || isNaN(g.productPrice))
|
|
291
|
-
throw new Error(`${
|
|
291
|
+
throw new Error(`${y}.productPrice must be a valid number`);
|
|
292
292
|
if (typeof g.productId != "string")
|
|
293
|
-
throw new Error(`${
|
|
293
|
+
throw new Error(`${y}.productId must be a string`);
|
|
294
294
|
if (typeof g.productName != "string")
|
|
295
|
-
throw new Error(`${
|
|
295
|
+
throw new Error(`${y}.productName must be a string`);
|
|
296
296
|
});
|
|
297
297
|
} else if (Array.isArray(r)) {
|
|
298
298
|
if (r.length === 0)
|
|
299
299
|
throw new Error("quoteRequestData array cannot be empty");
|
|
300
|
-
r.forEach((
|
|
301
|
-
if (!
|
|
300
|
+
r.forEach((l, u) => {
|
|
301
|
+
if (!l || typeof l != "object")
|
|
302
302
|
throw new Error(`quoteRequestData[${u}] must be a non-null object`);
|
|
303
|
-
v(
|
|
303
|
+
v(l, u);
|
|
304
304
|
});
|
|
305
305
|
} else
|
|
306
306
|
v(r);
|
|
@@ -310,10 +310,10 @@ function M(c) {
|
|
|
310
310
|
"onQuoteRetrieved",
|
|
311
311
|
"onError",
|
|
312
312
|
"noMatchingQuote"
|
|
313
|
-
].forEach((
|
|
314
|
-
const u = s[
|
|
313
|
+
].forEach((l) => {
|
|
314
|
+
const u = s[l];
|
|
315
315
|
if (u && typeof u != "function")
|
|
316
|
-
throw new Error(`Callback '${
|
|
316
|
+
throw new Error(`Callback '${l}' must be a function.`);
|
|
317
317
|
}), typeof i == "string" && !document.querySelector(i))
|
|
318
318
|
throw new Error(`Invalid location selector: '${i}'`);
|
|
319
319
|
if (a && typeof a != "object")
|
|
@@ -323,12 +323,12 @@ function M(c) {
|
|
|
323
323
|
if (c.state && !O.has(c.state))
|
|
324
324
|
throw new Error(`Invalid state: '${c.state}'. Must be a 2-character US state or territory code.`);
|
|
325
325
|
}
|
|
326
|
-
var
|
|
326
|
+
var _ = /* @__PURE__ */ ((c) => (c.YES = "yes", c.NO = "no", c.UNSELECTED = "unselected", c))(_ || {});
|
|
327
327
|
function n(c, { text: t, className: r, parent: s, innerHTML: i, href: a, target: e } = {}) {
|
|
328
328
|
const o = document.createElement(c);
|
|
329
329
|
return r && (o.className = r), t != null && (o.textContent = t), i != null && (o.innerHTML = i), a && "href" in o && (o.href = a), e && "target" in o && (o.target = e), s && s.appendChild(o), o;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function $(c, { name: t, description: r }) {
|
|
332
332
|
n("div", {
|
|
333
333
|
className: "spot-header__title",
|
|
334
334
|
text: t,
|
|
@@ -339,7 +339,7 @@ function P(c, { name: t, description: r }) {
|
|
|
339
339
|
parent: c
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function V(c, t = []) {
|
|
343
343
|
const r = n("ul", {
|
|
344
344
|
className: "spot-benefits__list",
|
|
345
345
|
parent: c
|
|
@@ -353,12 +353,12 @@ function $(c, t = []) {
|
|
|
353
353
|
</svg>`, n("span", { text: s, parent: i });
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function Q(c, t = []) {
|
|
357
357
|
if (!t || t.length === 0) return;
|
|
358
358
|
const r = n("div", {
|
|
359
359
|
className: "spot-qualifying-reasons__container",
|
|
360
360
|
parent: c
|
|
361
|
-
}), s = [...t].sort((o,
|
|
361
|
+
}), s = [...t].sort((o, p) => o.rank - p.rank), i = n("div", {
|
|
362
362
|
className: "spot-qualifying-reasons__grid",
|
|
363
363
|
parent: r
|
|
364
364
|
}), a = {
|
|
@@ -375,8 +375,8 @@ function V(c, t = []) {
|
|
|
375
375
|
try {
|
|
376
376
|
const o = document.currentScript;
|
|
377
377
|
if (o != null && o.src) {
|
|
378
|
-
const
|
|
379
|
-
e =
|
|
378
|
+
const p = new URL(o.src);
|
|
379
|
+
e = p.origin + p.pathname.replace(/\/[^/]*$/, "/");
|
|
380
380
|
} else
|
|
381
381
|
e = window.location.origin + window.location.pathname.replace(/\/[^/]*$/, "/");
|
|
382
382
|
e += "assets/";
|
|
@@ -384,13 +384,13 @@ function V(c, t = []) {
|
|
|
384
384
|
e = "./assets/";
|
|
385
385
|
}
|
|
386
386
|
s.forEach((o) => {
|
|
387
|
-
var v, h,
|
|
388
|
-
const
|
|
387
|
+
var v, h, l;
|
|
388
|
+
const p = n("div", {
|
|
389
389
|
className: "spot-qualifying-reasons__item",
|
|
390
390
|
parent: i
|
|
391
391
|
}), m = n("div", {
|
|
392
392
|
className: "spot-qualifying-reasons__icon-wrapper",
|
|
393
|
-
parent:
|
|
393
|
+
parent: p
|
|
394
394
|
}), f = a[((v = o.benefitType) == null ? void 0 : v.name) || ""] || a[o.name || ""];
|
|
395
395
|
if (f) {
|
|
396
396
|
const u = n("img", {
|
|
@@ -400,12 +400,12 @@ function V(c, t = []) {
|
|
|
400
400
|
}
|
|
401
401
|
n("span", {
|
|
402
402
|
className: "spot-qualifying-reasons__label",
|
|
403
|
-
text: ((
|
|
404
|
-
parent:
|
|
403
|
+
text: ((l = o.benefitType) == null ? void 0 : l.name) || o.name || "",
|
|
404
|
+
parent: p
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function U(c, t = [], r) {
|
|
409
409
|
if (t.length === 0 || !r || r <= 1)
|
|
410
410
|
return;
|
|
411
411
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -419,7 +419,7 @@ function Q(c, t = [], r) {
|
|
|
419
419
|
displayText: d > 1 ? `${d} x ${u}` : u
|
|
420
420
|
})
|
|
421
421
|
).sort((u, d) => {
|
|
422
|
-
const
|
|
422
|
+
const b = u.item.charAt(0), w = d.item.charAt(0), C = /[a-zA-Z]/.test(b), g = /[a-zA-Z]/.test(w);
|
|
423
423
|
return !C && g ? -1 : C && !g ? 1 : u.item.localeCompare(d.item, void 0, { sensitivity: "base" });
|
|
424
424
|
}), e = n("div", {
|
|
425
425
|
className: "spot-covered-items__container",
|
|
@@ -427,18 +427,18 @@ function Q(c, t = [], r) {
|
|
|
427
427
|
}), o = n("div", {
|
|
428
428
|
className: "spot-covered-items__header",
|
|
429
429
|
parent: e
|
|
430
|
-
}),
|
|
430
|
+
}), p = n("button", {
|
|
431
431
|
className: "spot-covered-items__toggle",
|
|
432
432
|
parent: o
|
|
433
433
|
});
|
|
434
434
|
n("span", {
|
|
435
435
|
className: "spot-covered-items__title",
|
|
436
436
|
text: `Items Covered in Your Cart (${t.length})`,
|
|
437
|
-
parent:
|
|
437
|
+
parent: p
|
|
438
438
|
});
|
|
439
439
|
const m = n("div", {
|
|
440
440
|
className: "spot-covered-items__right-section",
|
|
441
|
-
parent:
|
|
441
|
+
parent: p
|
|
442
442
|
});
|
|
443
443
|
n("span", {
|
|
444
444
|
className: "spot-covered-items__view-all",
|
|
@@ -460,12 +460,12 @@ function Q(c, t = [], r) {
|
|
|
460
460
|
const d = n("li", { parent: h });
|
|
461
461
|
n("span", { text: u, parent: d });
|
|
462
462
|
});
|
|
463
|
-
let
|
|
464
|
-
v.style.display = "none",
|
|
465
|
-
u.stopPropagation(),
|
|
466
|
-
}),
|
|
463
|
+
let l = !1;
|
|
464
|
+
v.style.display = "none", p.addEventListener("click", (u) => {
|
|
465
|
+
u.stopPropagation(), l = !l, v.style.display = l ? "block" : "none", f.innerHTML = l ? "▲" : "▼", p.setAttribute("aria-expanded", l.toString());
|
|
466
|
+
}), p.setAttribute("aria-expanded", "false"), p.setAttribute("aria-controls", "covered-items-list"), v.setAttribute("id", "covered-items-list");
|
|
467
467
|
}
|
|
468
|
-
const
|
|
468
|
+
const Z = {
|
|
469
469
|
USD: "$",
|
|
470
470
|
CAD: "CAD $",
|
|
471
471
|
AUD: "AUD $",
|
|
@@ -490,8 +490,8 @@ const U = {
|
|
|
490
490
|
THB: "THB ฿",
|
|
491
491
|
ZAR: "ZAR R"
|
|
492
492
|
};
|
|
493
|
-
function
|
|
494
|
-
const s =
|
|
493
|
+
function B(c, t = [], r = "USD") {
|
|
494
|
+
const s = Z[r] ?? `${r} `, i = n("div", {
|
|
495
495
|
className: "spot-table__container",
|
|
496
496
|
parent: c
|
|
497
497
|
}), a = n("table", {
|
|
@@ -499,15 +499,15 @@ function Z(c, t = [], r = "USD") {
|
|
|
499
499
|
parent: i
|
|
500
500
|
}), e = n("thead", { parent: a }), o = n("tr", { parent: e });
|
|
501
501
|
n("th", { text: "When you cancel", parent: o }), n("th", { text: "You will receive", parent: o });
|
|
502
|
-
const
|
|
502
|
+
const p = n("tbody", { parent: a });
|
|
503
503
|
t.forEach(({ text: m, percent: f, amount: v }) => {
|
|
504
|
-
const h = n("tr", { parent:
|
|
504
|
+
const h = n("tr", { parent: p });
|
|
505
505
|
n("td", { text: m, parent: h });
|
|
506
|
-
const
|
|
507
|
-
n("td", { text:
|
|
506
|
+
const l = f === "Not eligible for refund" ? "Not eligible for a refund" : `${s}${v} refund`;
|
|
507
|
+
n("td", { text: l, parent: h });
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function j(c, t) {
|
|
511
511
|
const r = n("div", {
|
|
512
512
|
className: "spot-state-dropdown__wrapper",
|
|
513
513
|
parent: c
|
|
@@ -526,25 +526,29 @@ function B(c, t) {
|
|
|
526
526
|
text: "Select a state...",
|
|
527
527
|
parent: s
|
|
528
528
|
});
|
|
529
|
-
i.value = "", i.selected = !t,
|
|
530
|
-
const
|
|
531
|
-
|
|
529
|
+
i.value = "", i.selected = !t, L.forEach(({ value: e, label: o }) => {
|
|
530
|
+
const p = n("option", { text: o, parent: s });
|
|
531
|
+
p.value = e, e === t && (p.selected = !0);
|
|
532
532
|
});
|
|
533
533
|
const a = n("option", {
|
|
534
534
|
text: "Not a US Resident",
|
|
535
535
|
parent: s
|
|
536
536
|
});
|
|
537
|
-
return a.value =
|
|
537
|
+
return a.value = E, t === E && (a.selected = !0), n("div", {
|
|
538
|
+
className: "spot-state-dropdown__error",
|
|
539
|
+
text: A,
|
|
540
|
+
parent: r
|
|
541
|
+
}), s;
|
|
538
542
|
}
|
|
539
|
-
function
|
|
543
|
+
function F(c, t, r, s = !1) {
|
|
540
544
|
const i = n("div", {
|
|
541
545
|
className: `spot-selection__options${s ? " spot-selection__options--disabled" : ""}`,
|
|
542
546
|
parent: c
|
|
543
547
|
}), a = n("label", {
|
|
544
|
-
className: `spot-selection__option ${t ===
|
|
548
|
+
className: `spot-selection__option ${t === _.YES ? "selected" : ""}`,
|
|
545
549
|
parent: i
|
|
546
550
|
}), e = n("input", { parent: a });
|
|
547
|
-
e.type = "radio", e.name = "selection", e.value =
|
|
551
|
+
e.type = "radio", e.name = "selection", e.value = _.YES, t === _.YES && (e.checked = !0), s && (e.disabled = !0), n("strong", {
|
|
548
552
|
text: r.yesOptionText,
|
|
549
553
|
parent: a
|
|
550
554
|
}), n("span", {
|
|
@@ -553,10 +557,10 @@ function j(c, t, r, s = !1) {
|
|
|
553
557
|
parent: a
|
|
554
558
|
});
|
|
555
559
|
const o = n("label", {
|
|
556
|
-
className: `spot-selection__option ${t ===
|
|
560
|
+
className: `spot-selection__option ${t === _.NO ? "selected" : ""}`,
|
|
557
561
|
parent: i
|
|
558
|
-
}),
|
|
559
|
-
return
|
|
562
|
+
}), p = n("input", { parent: o });
|
|
563
|
+
return p.type = "radio", p.name = "selection", p.value = _.NO, t === _.NO && (p.checked = !0), s && (p.disabled = !0), n("span", { text: r.noOptionText, parent: o }), i;
|
|
560
564
|
}
|
|
561
565
|
function H(c, t) {
|
|
562
566
|
var s;
|
|
@@ -577,7 +581,7 @@ function H(c, t) {
|
|
|
577
581
|
}), i;
|
|
578
582
|
}
|
|
579
583
|
}
|
|
580
|
-
function
|
|
584
|
+
function W(c, t, r = "bottom-right") {
|
|
581
585
|
if (r === "top-right") {
|
|
582
586
|
const o = n("div", {
|
|
583
587
|
className: "spot-logo__top-right",
|
|
@@ -637,18 +641,18 @@ function F(c, t, r = "bottom-right") {
|
|
|
637
641
|
}
|
|
638
642
|
return s;
|
|
639
643
|
}
|
|
640
|
-
const W = ":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-border-line-width: .0625rem;--spot-border-color: #e0e0e0;--spot-max-width: 51rem;--spot-margin: 1rem;--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-bullets-checkmark-color: #2e2e2e;--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-state-dropdown-label-font-size: .875rem;--spot-state-dropdown-label-font-weight: 600;--spot-state-dropdown-label-margin-bottom: .25rem;--spot-state-dropdown-select-border: .0625rem solid #e0e0e0;--spot-state-dropdown-select-border-radius: .375rem;--spot-state-dropdown-select-padding: .5rem .75rem;--spot-state-dropdown-select-font-size: .875rem;--spot-state-dropdown-select-background: #ffffff;--spot-state-dropdown-wrapper-margin-bottom: .75rem;--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-covered-items-background: #f1f3f5;--spot-covered-items-hover-background: #e9ecef;--spot-covered-items-border-radius: .5rem;--spot-covered-items-padding: .75rem 1rem;--spot-covered-items-font-size: .875rem;--spot-covered-items-font-weight: 400;--spot-covered-items-font-color: #000000;--spot-covered-items-font-family: Arial;--spot-covered-items-arrow-font-size: .6rem;--spot-covered-items-arrow-color: #636569;--spot-covered-items-view-all-color: #636569;--spot-covered-items-view-all-font-size: .875rem;--spot-covered-items-view-all-font-weight: 400;--spot-covered-items-content-background: #f8f9fa;--spot-covered-items-content-border: 1px solid #e0e0e0;--spot-covered-items-content-border-radius: .5rem;--spot-covered-items-content-padding: .75rem 1rem;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 1.5rem;--spot-footer-gap: 1rem;--spot-footer-terms-margin-right: 7rem;--spot-payment-terms-margin-top: .5rem;--spot-logo-top-right-margin: 1rem}.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:var(--spot-border-line-width) solid var(--spot-border-color);border-radius:var(--spot-border-radius);max-width:var(--spot-max-width);margin:var(--spot-margin);container-type:inline-size;position:relative;word-wrap:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.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}.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr auto;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container,.desktop-layout .spot-covered-items__container,.desktop-layout .spot-selection__wrapper{min-width:0;word-wrap:normal}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container{grid-row:1;margin-bottom:var(--spot-benefits-margin-bottom)}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1;margin-bottom:var(--spot-covered-items-margin-bottom)}.desktop-layout .spot-selection__wrapper{grid-row:3;grid-column:1;margin-top:var(--spot-desktop-radio-margin-top)}.desktop-layout .spot-payment-terms__wrapper{grid-row:4;grid-column:1;margin-top:var(--spot-payment-terms-margin-top)}.desktop-layout .spot-table__container{grid-row:1 / span 4;grid-column:2;width:auto;min-width:20.3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-table__container{display:flex;justify-content:flex-start;margin-top:1rem;margin-bottom:1rem;box-sizing:border-box;padding:0 .3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-refund__table{width:100%;max-width:22rem;table-layout:auto}@media (max-width: 850px){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 500px){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 600px){.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:.375rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-bullets__checkmark path{stroke:var(--spot-bullets-checkmark-color)}.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:.85rem;margin-bottom:.5rem;max-width:26rem}.spot-content__wrapper.desktop-layout:has(.spot-table__container) .spot-covered-items__container{margin-top:0rem;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-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-covered-items__list li:last-child{margin-bottom:0}.spot-covered-items__header{margin-bottom:.5rem}.spot-covered-items__toggle{background:var(--spot-covered-items-background);border:none;border-radius:var(--spot-covered-items-border-radius);padding:var(--spot-covered-items-padding);cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;transition:all .2s ease}.spot-covered-items__toggle:hover{background-color:var(--spot-covered-items-hover-background)}.spot-covered-items__toggle:focus{outline:none;box-shadow:0 0 0 2px #0000001a}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;margin:0;padding:0}.spot-covered-items__right-section{display:flex;align-items:center;gap:.5rem;margin-left:auto}.spot-covered-items__view-all{font-size:var(--spot-covered-items-view-all-font-size);font-weight:var(--spot-covered-items-view-all-font-weight);color:var(--spot-covered-items-view-all-color);font-family:var(--spot-covered-items-font-family);line-height:125%}.spot-covered-items__arrow{font-size:var(--spot-covered-items-arrow-font-size);transition:transform .2s ease;color:var(--spot-covered-items-arrow-color);flex-shrink:0;transform:scaleX(1.5)}.spot-covered-items__content{margin-top:.5rem;transition:all .2s ease;overflow:hidden}.spot-covered-items__list{background-color:var(--spot-covered-items-content-background);border:var(--spot-covered-items-content-border);border-radius:var(--spot-covered-items-content-border-radius);margin:0;padding:var(--spot-covered-items-content-padding)}.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:.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)}.spot-state-dropdown__wrapper{display:flex;flex-direction:column;margin-bottom:var(--spot-state-dropdown-wrapper-margin-bottom)}.spot-state-dropdown__label{font-size:var(--spot-state-dropdown-label-font-size);font-weight:var(--spot-state-dropdown-label-font-weight);font-family:var(--spot-font-family);color:var(--spot-font-color);margin-bottom:var(--spot-state-dropdown-label-margin-bottom)}.spot-state-dropdown__select{width:100%;box-sizing:border-box;border:var(--spot-state-dropdown-select-border);border-radius:var(--spot-state-dropdown-select-border-radius);padding:var(--spot-state-dropdown-select-padding);font-size:var(--spot-state-dropdown-select-font-size);font-family:var(--spot-font-family);color:var(--spot-font-color);background-color:var(--spot-state-dropdown-select-background);cursor:pointer;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.spot-state-dropdown__select:focus{outline:none;box-shadow:0 0 0 2px #00000026}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;min-width:.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;flex-shrink:0}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:flex;align-items:center;flex-wrap:nowrap;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}.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:.75rem;white-space:nowrap;flex-shrink:0}@media (max-width: 850px){.spot-selection__recommended-tag{margin-left:.5rem}}@media (max-width: 600px){.spot-selection__recommended-tag{margin-left:.5rem;font-size:.75rem;padding:.1875rem .4375rem}}.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-selection__options--disabled .spot-selection__option{opacity:.4;cursor:not-allowed;pointer-events:none}.spot-selection__options--disabled input[type=radio]{cursor:not-allowed}.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);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);line-height:1.4;word-wrap:normal;-webkit-hyphens:none;hyphens:none;flex:1;min-width:0;overflow-wrap:normal}.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;flex-direction:row;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spot-footer-gap)}@container (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}@media (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}.spot-footer__powered-by{margin-top:0;flex-shrink:0}.spot-logo__top-right{position:absolute;top:-14px;right:40px;z-index:10;background:linear-gradient(to bottom,transparent 50%,inherit 50%);padding:0 .25rem}.spot-logo__top-right svg{border-radius:1.25rem;border:var(--spot-border-line-width) solid var(--spot-border-color);display:block;background:var(--spot-background-color)}@container (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}@media (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}";
|
|
641
|
-
function
|
|
644
|
+
const Y = ":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-border-line-width: .0625rem;--spot-border-color: #e0e0e0;--spot-max-width: 51rem;--spot-margin: 1rem;--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-bullets-checkmark-color: #2e2e2e;--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-state-dropdown-label-font-size: .875rem;--spot-state-dropdown-label-font-weight: 600;--spot-state-dropdown-label-margin-bottom: .25rem;--spot-state-dropdown-select-border: .0625rem solid #e0e0e0;--spot-state-dropdown-select-border-radius: .375rem;--spot-state-dropdown-select-padding: .5rem .75rem;--spot-state-dropdown-select-font-size: .875rem;--spot-state-dropdown-select-background: #ffffff;--spot-state-dropdown-wrapper-margin-bottom: .75rem;--spot-state-dropdown-error-color: var(--spot-selection-error-font-color);--spot-state-dropdown-error-font-size: .8125rem;--spot-state-dropdown-error-margin-top: .25rem;--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-covered-items-background: #f1f3f5;--spot-covered-items-hover-background: #e9ecef;--spot-covered-items-border-radius: .5rem;--spot-covered-items-padding: .75rem 1rem;--spot-covered-items-font-size: .875rem;--spot-covered-items-font-weight: 400;--spot-covered-items-font-color: #000000;--spot-covered-items-font-family: Arial;--spot-covered-items-arrow-font-size: .6rem;--spot-covered-items-arrow-color: #636569;--spot-covered-items-view-all-color: #636569;--spot-covered-items-view-all-font-size: .875rem;--spot-covered-items-view-all-font-weight: 400;--spot-covered-items-content-background: #f8f9fa;--spot-covered-items-content-border: 1px solid #e0e0e0;--spot-covered-items-content-border-radius: .5rem;--spot-covered-items-content-padding: .75rem 1rem;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 1.5rem;--spot-footer-gap: 1rem;--spot-footer-terms-margin-right: 7rem;--spot-payment-terms-margin-top: .5rem;--spot-logo-top-right-margin: 1rem}.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:var(--spot-border-line-width) solid var(--spot-border-color);border-radius:var(--spot-border-radius);max-width:var(--spot-max-width);margin:var(--spot-margin);container-type:inline-size;position:relative;word-wrap:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.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}.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr auto;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container,.desktop-layout .spot-covered-items__container,.desktop-layout .spot-selection__wrapper{min-width:0;word-wrap:normal}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container{grid-row:1;margin-bottom:var(--spot-benefits-margin-bottom)}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1;margin-bottom:var(--spot-covered-items-margin-bottom)}.desktop-layout .spot-selection__wrapper{grid-row:3;grid-column:1;margin-top:var(--spot-desktop-radio-margin-top)}.desktop-layout .spot-payment-terms__wrapper{grid-row:4;grid-column:1;margin-top:var(--spot-payment-terms-margin-top)}.desktop-layout .spot-table__container{grid-row:1 / span 4;grid-column:2;width:auto;min-width:20.3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-table__container{display:flex;justify-content:flex-start;margin-top:1rem;margin-bottom:1rem;box-sizing:border-box;padding:0 .3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-refund__table{width:100%;max-width:22rem;table-layout:auto}@media (max-width: 850px){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 500px){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 600px){.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:.375rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-bullets__checkmark path{stroke:var(--spot-bullets-checkmark-color)}.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:.85rem;margin-bottom:.5rem;max-width:26rem}.spot-content__wrapper.desktop-layout:has(.spot-table__container) .spot-covered-items__container{margin-top:0rem;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-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-covered-items__list li:last-child{margin-bottom:0}.spot-covered-items__header{margin-bottom:.5rem}.spot-covered-items__toggle{background:var(--spot-covered-items-background);border:none;border-radius:var(--spot-covered-items-border-radius);padding:var(--spot-covered-items-padding);cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;transition:all .2s ease}.spot-covered-items__toggle:hover{background-color:var(--spot-covered-items-hover-background)}.spot-covered-items__toggle:focus{outline:none;box-shadow:0 0 0 2px #0000001a}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;margin:0;padding:0}.spot-covered-items__right-section{display:flex;align-items:center;gap:.5rem;margin-left:auto}.spot-covered-items__view-all{font-size:var(--spot-covered-items-view-all-font-size);font-weight:var(--spot-covered-items-view-all-font-weight);color:var(--spot-covered-items-view-all-color);font-family:var(--spot-covered-items-font-family);line-height:125%}.spot-covered-items__arrow{font-size:var(--spot-covered-items-arrow-font-size);transition:transform .2s ease;color:var(--spot-covered-items-arrow-color);flex-shrink:0;transform:scaleX(1.5)}.spot-covered-items__content{margin-top:.5rem;transition:all .2s ease;overflow:hidden}.spot-covered-items__list{background-color:var(--spot-covered-items-content-background);border:var(--spot-covered-items-content-border);border-radius:var(--spot-covered-items-content-border-radius);margin:0;padding:var(--spot-covered-items-content-padding)}.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:.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)}.spot-state-dropdown__wrapper{display:flex;flex-direction:column;margin-bottom:var(--spot-state-dropdown-wrapper-margin-bottom)}.spot-state-dropdown__label{font-size:var(--spot-state-dropdown-label-font-size);font-weight:var(--spot-state-dropdown-label-font-weight);font-family:var(--spot-font-family);color:var(--spot-font-color);margin-bottom:var(--spot-state-dropdown-label-margin-bottom)}.spot-state-dropdown__select{width:100%;box-sizing:border-box;border:var(--spot-state-dropdown-select-border);border-radius:var(--spot-state-dropdown-select-border-radius);padding:var(--spot-state-dropdown-select-padding);font-size:var(--spot-state-dropdown-select-font-size);font-family:var(--spot-font-family);color:var(--spot-font-color);background-color:var(--spot-state-dropdown-select-background);cursor:pointer;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.spot-state-dropdown__select:focus{outline:none;box-shadow:0 0 0 2px #00000026}.spot-state-dropdown__select--error{border-color:var(--spot-state-dropdown-error-color)}.spot-state-dropdown__select--error:focus{box-shadow:0 0 0 2px #ff000026}.spot-state-dropdown__error{display:none;color:var(--spot-state-dropdown-error-color);font-size:var(--spot-state-dropdown-error-font-size);font-family:var(--spot-font-family);margin-top:var(--spot-state-dropdown-error-margin-top)}.spot-state-dropdown__error--visible{display:block}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;min-width:.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;flex-shrink:0}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:flex;align-items:center;flex-wrap:nowrap;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}.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:.75rem;white-space:nowrap;flex-shrink:0}@media (max-width: 850px){.spot-selection__recommended-tag{margin-left:.5rem}}@media (max-width: 600px){.spot-selection__recommended-tag{margin-left:.5rem;font-size:.75rem;padding:.1875rem .4375rem}}.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-selection__options--disabled .spot-selection__option{opacity:.4;cursor:not-allowed;pointer-events:none}.spot-selection__options--disabled input[type=radio]{cursor:not-allowed}.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);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);line-height:1.4;word-wrap:normal;-webkit-hyphens:none;hyphens:none;flex:1;min-width:0;overflow-wrap:normal}.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;flex-direction:row;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spot-footer-gap)}@container (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}@media (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}.spot-footer__powered-by{margin-top:0;flex-shrink:0}.spot-logo__top-right{position:absolute;top:-14px;right:40px;z-index:10;background:linear-gradient(to bottom,transparent 50%,inherit 50%);padding:0 .25rem}.spot-logo__top-right svg{border-radius:1.25rem;border:var(--spot-border-line-width) solid var(--spot-border-color);display:block;background:var(--spot-background-color)}@container (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}@media (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}";
|
|
645
|
+
function G(c) {
|
|
642
646
|
const t = document.createElement("style");
|
|
643
647
|
t.textContent = c, document.head.appendChild(t);
|
|
644
648
|
}
|
|
645
|
-
Y
|
|
646
|
-
const
|
|
649
|
+
G(Y);
|
|
650
|
+
const R = {
|
|
647
651
|
sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
|
|
648
652
|
production: "https://api.getspot.com/api/v1/quote",
|
|
649
653
|
local: "http://localhost:3999/api/v1/quote"
|
|
650
654
|
};
|
|
651
|
-
class
|
|
655
|
+
class K {
|
|
652
656
|
constructor(t = {}) {
|
|
653
657
|
this.options = {
|
|
654
658
|
location: "body",
|
|
@@ -659,7 +663,7 @@ class G {
|
|
|
659
663
|
callbacks: {},
|
|
660
664
|
useMockData: !1,
|
|
661
665
|
...t,
|
|
662
|
-
selection: t.selection ??
|
|
666
|
+
selection: t.selection ?? _.UNSELECTED
|
|
663
667
|
}, 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.selection, this._init();
|
|
664
668
|
}
|
|
665
669
|
async _init() {
|
|
@@ -670,15 +674,15 @@ class G {
|
|
|
670
674
|
if (this.options.useMockData && this.options.mockData)
|
|
671
675
|
e = this.options.mockData;
|
|
672
676
|
else {
|
|
673
|
-
const { environment: o, partnerId:
|
|
674
|
-
e = "items" in this.options.quoteRequestData ? await
|
|
677
|
+
const { environment: o, partnerId: p } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || R[o];
|
|
678
|
+
e = "items" in this.options.quoteRequestData ? await N(
|
|
675
679
|
f,
|
|
676
|
-
|
|
680
|
+
p,
|
|
677
681
|
this.options.quoteRequestData,
|
|
678
682
|
this._validState()
|
|
679
|
-
) : await
|
|
683
|
+
) : await T(
|
|
680
684
|
f,
|
|
681
|
-
|
|
685
|
+
p,
|
|
682
686
|
this.options.quoteRequestData,
|
|
683
687
|
this._validState()
|
|
684
688
|
);
|
|
@@ -692,7 +696,7 @@ class G {
|
|
|
692
696
|
}
|
|
693
697
|
if (this.quote = e.data, !this.quote)
|
|
694
698
|
throw new Error("No quote data in response");
|
|
695
|
-
if (this._renderWidget(), this.options.selection ===
|
|
699
|
+
if (this._renderWidget(), this.options.selection === _.YES && ((r = this.options.callbacks) != null && r.onOptIn)) {
|
|
696
700
|
const o = {
|
|
697
701
|
status: "QUOTE_ACCEPTED",
|
|
698
702
|
spotPrice: this.quote.spotPrice,
|
|
@@ -700,11 +704,11 @@ class G {
|
|
|
700
704
|
state: this._validState()
|
|
701
705
|
};
|
|
702
706
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
703
|
-
const
|
|
707
|
+
const p = this.options.quoteRequestData;
|
|
704
708
|
o.batchQuoteDetails = this.quote.originalQuotes.map((m) => {
|
|
705
709
|
var v;
|
|
706
|
-
const f = (v =
|
|
707
|
-
(h) => (h.cartItemId || `item-${
|
|
710
|
+
const f = (v = p.items) == null ? void 0 : v.find(
|
|
711
|
+
(h) => (h.cartItemId || `item-${p.items.indexOf(h) + 1}`) === m.cartItemId
|
|
708
712
|
);
|
|
709
713
|
return {
|
|
710
714
|
quoteId: m.id,
|
|
@@ -733,30 +737,30 @@ class G {
|
|
|
733
737
|
_renderWidget() {
|
|
734
738
|
if (!this.quote) return;
|
|
735
739
|
this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([e, o]) => {
|
|
736
|
-
const
|
|
737
|
-
this.container.style.setProperty(
|
|
738
|
-
}),
|
|
740
|
+
const p = `--${e}`;
|
|
741
|
+
this.container.style.setProperty(p, o);
|
|
742
|
+
}), $(this.container, this.quote.communication);
|
|
739
743
|
const t = document.createElement("div");
|
|
740
|
-
if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ?
|
|
744
|
+
if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? Q(t, this.quote.qualifyingReasons) : V(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
|
|
741
745
|
const e = this._getTotalItemsInRequest();
|
|
742
|
-
|
|
746
|
+
U(t, this.quote.coveredItems, e);
|
|
743
747
|
}
|
|
744
|
-
this.options.showTable && !this.quote.qualifyingReasons &&
|
|
748
|
+
this.options.showTable && !this.quote.qualifyingReasons && B(t, this.quote.payoutSchedule, this.quote.currencyCode);
|
|
745
749
|
const r = n("div", {
|
|
746
750
|
className: "spot-selection__wrapper",
|
|
747
751
|
parent: t
|
|
748
752
|
});
|
|
749
|
-
this._isPassOrTrip() && !this.options.state && (this._stateSelectEl =
|
|
750
|
-
const i = !this._isQuotingAvailable(), a =
|
|
753
|
+
this._isPassOrTrip() && !this.options.state && (this._stateSelectEl = j(r, this.currentState), this._setNonUsResidentError(this.currentState === E));
|
|
754
|
+
const i = !this._isQuotingAvailable(), a = F(
|
|
751
755
|
r,
|
|
752
|
-
this.
|
|
756
|
+
this.currentSelection,
|
|
753
757
|
this.quote.communication,
|
|
754
758
|
i
|
|
755
759
|
);
|
|
756
760
|
this.paymentTermsEl = n("div", {
|
|
757
761
|
className: "spot-payment-terms__wrapper",
|
|
758
762
|
parent: t
|
|
759
|
-
}), this.currentSelection ===
|
|
763
|
+
}), this.currentSelection === _.YES && H(this.paymentTermsEl, this.quote), W(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(a), this._setupStateDropdownListener();
|
|
760
764
|
}
|
|
761
765
|
_updateLayout() {
|
|
762
766
|
if (!this.container || !this.quote) return;
|
|
@@ -782,8 +786,8 @@ class G {
|
|
|
782
786
|
);
|
|
783
787
|
if (!e)
|
|
784
788
|
return a && t.classList.add("desktop-layout"), a;
|
|
785
|
-
const
|
|
786
|
-
return a && t.classList.add("desktop-layout"), r >=
|
|
789
|
+
const p = Math.min(e.scrollWidth, 400) + s + i;
|
|
790
|
+
return a && t.classList.add("desktop-layout"), r >= p;
|
|
787
791
|
}
|
|
788
792
|
return !1;
|
|
789
793
|
}
|
|
@@ -815,11 +819,11 @@ class G {
|
|
|
815
819
|
return r.productType === "Pass" || r.productType === "Trip";
|
|
816
820
|
}
|
|
817
821
|
_validState() {
|
|
818
|
-
if (this._isPassOrTrip() && !(!this.currentState || this.currentState ===
|
|
822
|
+
if (this._isPassOrTrip() && !(!this.currentState || this.currentState === E))
|
|
819
823
|
return this.currentState;
|
|
820
824
|
}
|
|
821
825
|
_isQuotingAvailable() {
|
|
822
|
-
return !this._isPassOrTrip() || this.options.state ? !0 : !!this.currentState && this.currentState !==
|
|
826
|
+
return !this._isPassOrTrip() || this.options.state ? !0 : !!this.currentState && this.currentState !== E;
|
|
823
827
|
}
|
|
824
828
|
_setRadiosDisabled(t) {
|
|
825
829
|
var i, a, e;
|
|
@@ -830,11 +834,20 @@ class G {
|
|
|
830
834
|
o.checked = !1;
|
|
831
835
|
}), (e = this.container) == null || e.querySelectorAll(".spot-selection__option").forEach((o) => {
|
|
832
836
|
o.classList.remove("selected");
|
|
833
|
-
}), this.currentSelection =
|
|
837
|
+
}), this.currentSelection = _.UNSELECTED, this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""));
|
|
838
|
+
}
|
|
839
|
+
_setNonUsResidentError(t) {
|
|
840
|
+
var s;
|
|
841
|
+
if (!this._stateSelectEl) return;
|
|
842
|
+
this._stateSelectEl.classList.toggle("spot-state-dropdown__select--error", t);
|
|
843
|
+
const r = (s = this._stateSelectEl.parentElement) == null ? void 0 : s.querySelector(
|
|
844
|
+
".spot-state-dropdown__error"
|
|
845
|
+
);
|
|
846
|
+
r == null || r.classList.toggle("spot-state-dropdown__error--visible", t);
|
|
834
847
|
}
|
|
835
848
|
_setupStateDropdownListener() {
|
|
836
849
|
this._stateSelectEl && this._stateSelectEl.addEventListener("change", () => {
|
|
837
|
-
this.currentState = this._stateSelectEl.value, this._setRadiosDisabled(!this._isQuotingAvailable());
|
|
850
|
+
this.currentState = this._stateSelectEl.value, this._setRadiosDisabled(!this._isQuotingAvailable()), this._setNonUsResidentError(this.currentState === E);
|
|
838
851
|
});
|
|
839
852
|
}
|
|
840
853
|
_setupOptionListeners(t) {
|
|
@@ -843,9 +856,9 @@ class G {
|
|
|
843
856
|
), s = t.querySelectorAll(".spot-selection__option");
|
|
844
857
|
r.forEach((i) => {
|
|
845
858
|
i.addEventListener("change", (a) => {
|
|
846
|
-
var
|
|
859
|
+
var p, m, f, v;
|
|
847
860
|
const e = a.target, o = e.value;
|
|
848
|
-
if (this.hideSelectionError(), this.currentSelection = o, s.forEach((h) => h.classList.remove("selected")), (
|
|
861
|
+
if (this.hideSelectionError(), this.currentSelection = o, s.forEach((h) => h.classList.remove("selected")), (p = e.closest(".spot-selection__option")) == null || p.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), o === _.YES && ((m = this.quote) != null && m.communication.paymentTerms && H(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
|
|
849
862
|
const h = {
|
|
850
863
|
status: "QUOTE_ACCEPTED",
|
|
851
864
|
spotPrice: this.quote.spotPrice,
|
|
@@ -853,12 +866,12 @@ class G {
|
|
|
853
866
|
state: this._validState()
|
|
854
867
|
};
|
|
855
868
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
856
|
-
const
|
|
869
|
+
const l = this.options.quoteRequestData;
|
|
857
870
|
h.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
858
871
|
(u) => {
|
|
859
|
-
var
|
|
860
|
-
const d = (
|
|
861
|
-
(
|
|
872
|
+
var b;
|
|
873
|
+
const d = (b = l.items) == null ? void 0 : b.find(
|
|
874
|
+
(w) => (w.cartItemId || `item-${l.items.indexOf(w) + 1}`) === u.cartItemId
|
|
862
875
|
);
|
|
863
876
|
return {
|
|
864
877
|
quoteId: u.id,
|
|
@@ -870,19 +883,19 @@ class G {
|
|
|
870
883
|
}
|
|
871
884
|
this.options.callbacks.onOptIn(h);
|
|
872
885
|
}
|
|
873
|
-
if (o ===
|
|
886
|
+
if (o === _.NO && ((v = this.options.callbacks) != null && v.onOptOut)) {
|
|
874
887
|
const h = {
|
|
875
888
|
status: "QUOTE_DECLINED",
|
|
876
889
|
quoteId: this.quote.id,
|
|
877
890
|
state: this._validState()
|
|
878
891
|
};
|
|
879
892
|
if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
880
|
-
const
|
|
893
|
+
const l = this.options.quoteRequestData;
|
|
881
894
|
h.batchQuoteDetails = this.quote.originalQuotes.map(
|
|
882
895
|
(u) => {
|
|
883
|
-
var
|
|
884
|
-
const d = (
|
|
885
|
-
(
|
|
896
|
+
var b;
|
|
897
|
+
const d = (b = l.items) == null ? void 0 : b.find(
|
|
898
|
+
(w) => (w.cartItemId || `item-${l.items.indexOf(w) + 1}`) === u.cartItemId
|
|
886
899
|
);
|
|
887
900
|
return {
|
|
888
901
|
quoteId: u.id,
|
|
@@ -926,14 +939,14 @@ class G {
|
|
|
926
939
|
quoteRequestData: t
|
|
927
940
|
};
|
|
928
941
|
M(e);
|
|
929
|
-
const { environment: o, partnerId:
|
|
942
|
+
const { environment: o, partnerId: p, customEndpoint: m } = this.options.apiConfig, f = m || R[o], h = "items" in e.quoteRequestData ? await N(
|
|
930
943
|
f,
|
|
931
|
-
|
|
944
|
+
p,
|
|
932
945
|
e.quoteRequestData,
|
|
933
946
|
this._validState()
|
|
934
|
-
) : await
|
|
947
|
+
) : await T(
|
|
935
948
|
f,
|
|
936
|
-
|
|
949
|
+
p,
|
|
937
950
|
e.quoteRequestData,
|
|
938
951
|
this._validState()
|
|
939
952
|
);
|
|
@@ -942,9 +955,9 @@ class G {
|
|
|
942
955
|
status: "NO_MATCHING_QUOTE",
|
|
943
956
|
data: e.quoteRequestData
|
|
944
957
|
}), !1;
|
|
945
|
-
if (this.options.quoteRequestData = e.quoteRequestData, this.quote = h.data, this.
|
|
946
|
-
const
|
|
947
|
-
|
|
958
|
+
if (this.options.quoteRequestData = e.quoteRequestData, this.quote = h.data, this.destroy(), this._renderWidget(), (s = this.options.callbacks) != null && s.onQuoteRetrieved) {
|
|
959
|
+
const l = this.options.callbacks.onQuoteRetrieved(this.quote);
|
|
960
|
+
l && this._applyQuoteUpdates(l);
|
|
948
961
|
}
|
|
949
962
|
return !0;
|
|
950
963
|
} catch (e) {
|
|
@@ -958,19 +971,19 @@ class G {
|
|
|
958
971
|
}
|
|
959
972
|
getSelection() {
|
|
960
973
|
var r, s, i;
|
|
961
|
-
if (this.currentSelection == null || this.currentSelection ==
|
|
974
|
+
if (this.currentSelection == null || this.currentSelection == _.UNSELECTED) return null;
|
|
962
975
|
const t = {
|
|
963
976
|
selection: this.currentSelection,
|
|
964
977
|
quoteId: (r = this.quote) == null ? void 0 : r.id,
|
|
965
978
|
spotPrice: (s = this.quote) == null ? void 0 : s.spotPrice,
|
|
966
|
-
status: this.currentSelection ===
|
|
979
|
+
status: this.currentSelection === _.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED",
|
|
967
980
|
state: this.currentState
|
|
968
981
|
};
|
|
969
982
|
if ((i = this.quote) != null && i.originalQuotes && this.quote.originalQuotes.length > 0) {
|
|
970
983
|
const a = this.options.quoteRequestData;
|
|
971
984
|
t.batchQuoteDetails = this.quote.originalQuotes.map((e) => {
|
|
972
|
-
var
|
|
973
|
-
const o = (
|
|
985
|
+
var p;
|
|
986
|
+
const o = (p = a.items) == null ? void 0 : p.find(
|
|
974
987
|
(m) => (m.cartItemId || `item-${a.items.indexOf(m) + 1}`) === e.cartItemId
|
|
975
988
|
);
|
|
976
989
|
return {
|
|
@@ -987,7 +1000,7 @@ class G {
|
|
|
987
1000
|
}
|
|
988
1001
|
}
|
|
989
1002
|
export {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1003
|
+
E as NON_US_RESIDENT_VALUE,
|
|
1004
|
+
_ as SelectionEnum,
|
|
1005
|
+
K as default
|
|
993
1006
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(C,
|
|
1
|
+
(function(C,k){typeof exports=="object"&&typeof module<"u"?k(exports):typeof define=="function"&&define.amd?define(["exports"],k):(C=typeof globalThis<"u"?globalThis:C||self,k(C.SpotWidget={}))})(this,function(C){"use strict";async function k(c,t,r,s){try{const i=s?{...r,state:s}:r,n=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(i)}),e=await n.json();if(!n.ok){const o=new Error((e==null?void 0:e.message)||"Failed to fetch quote");throw o.status=n.status,o.responseBody=e,o}return e}catch(i){throw i instanceof Error?i:new Error("Unknown error occurred while fetching quote")}}async function z(c,t,r){try{const s=c.replace("/quote","/quote/batch"),i=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(r)}),n=await i.json();if(!i.ok){const e=new Error((n==null?void 0:n.message)||"Failed to fetch batch quote");throw e.status=i.status,e.responseBody=n,e}return n}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching batch quote")}}async function S(c,t,r,s){var i;try{const n={...r,...s?{state:s}:{},isPartialPayment:r.isPartialPayment||!1,roundTo:r.roundTo||void 0,items:r.items.map((m,f)=>({...m,cartItemId:m.cartItemId||`item-${f+1}`}))},e=await z(c,t,n);if(e.status!=="QUOTES_AVAILABLE"&&e.status!=="QUOTE_AVAILABLE")return{status:"NO_MATCHING_QUOTE"};const o=e.quotes.map(m=>{const f=r.items.find((v,h)=>(v.cartItemId||`item-${h+1}`)===m.cartItemId);return f?f.participantDescription?`${f.productName} - ${f.participantDescription}`:f.productName:`Item ${m.id}`}),p=Math.round((e.totalSpotPrice||e.spotPrice||0)*100)/100;return{status:"QUOTE_AVAILABLE",data:{id:e.quotes?e.quotes.map(m=>m.id).join(","):((i=e.data)==null?void 0:i.id)||"",spotPrice:p,currencyCode:e.currencyCode||"",communication:{...e.communication,yesOptionText:e.communication.yesOptionText.replace(String(e.totalSpotPrice),String(p))},payoutSchedule:e.payoutSchedule.map(m=>({...m,amount:m.amount!==void 0?m.amount:0})),coveredItems:o,originalQuotes:e.quotes||(e.data?[e.data]:[])},spotPrice:p,coveredItems:o}}catch(n){throw n instanceof Error?n:new Error("Unknown error occurred while fetching multiple quotes")}}const E="non-us-resident",A="Unfortunately, we are currently unable to offer coverage or process claims for non-US residents.",T=[{value:"AL",label:"Alabama"},{value:"AK",label:"Alaska"},{value:"AS",label:"American Samoa"},{value:"AZ",label:"Arizona"},{value:"AR",label:"Arkansas"},{value:"CA",label:"California"},{value:"CO",label:"Colorado"},{value:"CT",label:"Connecticut"},{value:"DE",label:"Delaware"},{value:"DC",label:"District of Columbia"},{value:"FL",label:"Florida"},{value:"GA",label:"Georgia"},{value:"GU",label:"Guam"},{value:"HI",label:"Hawaii"},{value:"ID",label:"Idaho"},{value:"IL",label:"Illinois"},{value:"IN",label:"Indiana"},{value:"IA",label:"Iowa"},{value:"KS",label:"Kansas"},{value:"KY",label:"Kentucky"},{value:"LA",label:"Louisiana"},{value:"ME",label:"Maine"},{value:"MD",label:"Maryland"},{value:"MA",label:"Massachusetts"},{value:"MI",label:"Michigan"},{value:"MN",label:"Minnesota"},{value:"MS",label:"Mississippi"},{value:"MO",label:"Missouri"},{value:"MT",label:"Montana"},{value:"NE",label:"Nebraska"},{value:"NV",label:"Nevada"},{value:"NH",label:"New Hampshire"},{value:"NJ",label:"New Jersey"},{value:"NM",label:"New Mexico"},{value:"NY",label:"New York"},{value:"NC",label:"North Carolina"},{value:"ND",label:"North Dakota"},{value:"MP",label:"Northern Mariana Islands"},{value:"OH",label:"Ohio"},{value:"OK",label:"Oklahoma"},{value:"OR",label:"Oregon"},{value:"PA",label:"Pennsylvania"},{value:"PR",label:"Puerto Rico"},{value:"RI",label:"Rhode Island"},{value:"SC",label:"South Carolina"},{value:"SD",label:"South Dakota"},{value:"TN",label:"Tennessee"},{value:"TX",label:"Texas"},{value:"VI",label:"U.S. Virgin Islands"},{value:"UT",label:"Utah"},{value:"VT",label:"Vermont"},{value:"VA",label:"Virginia"},{value:"WA",label:"Washington"},{value:"WV",label:"West Virginia"},{value:"WI",label:"Wisconsin"},{value:"WY",label:"Wyoming"}],P=new Set(T.map(c=>c.value)),D=["USD","CAD","AUD","NZD","EUR","MXN","AED","GBP","MAD","SAR","BGN","BRL","CHF","DKK","INR","JPY","MYR","NOK","PLN","SEK","SGD","THB","ZAR"],$={sandbox:"https://api.sandbox.getspot.com/v1/quote",production:"https://api.getspot.com/v1/quote",local:"http://localhost:3999/api/v1/quote"};function N(c){const{apiConfig:t={},quoteRequestData:r,callbacks:s={},location:i,theme:n}=c,{environment:e="sandbox",partnerId:o,customEndpoint:p}=t;if(!o||typeof o!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(p||$[e]))throw new Error(`Invalid environment in apiConfig: ${e}`);if(!r||typeof r!="object"&&!Array.isArray(r))throw new Error("quoteRequestData must be a non-null object or array");const f=["startDate","endDate","currencyCode","eventType","productType","productDuration","productPrice","productId","cartId","productName"];function v(l,u=null){const d=u!==null?`quoteRequestData[${u}]`:"quoteRequestData";f.forEach(g=>{if(!Object.prototype.hasOwnProperty.call(l,g)||l[g]===void 0||l[g]===null)throw new Error(`Missing required ${d} field: '${g}'`)});const _=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!_.test(l.startDate))throw new Error(`${d}.startDate must be a valid ISO8601 string`);if(!_.test(l.endDate))throw new Error(`${d}.endDate must be a valid ISO8601 string`);if(typeof l.currencyCode!="string")throw new Error(`${d}.currencyCode must be a string`);if(!D.includes(l.currencyCode))throw new Error(`Invalid ${d}.currencyCode: ${l.currencyCode}`);if(typeof l.eventType!="string")throw new Error(`${d}.eventType must be a string`);if(typeof l.productType!="string")throw new Error(`${d}.productType must be a string`);const w=["Pass","Trip","Registration"];if(!w.includes(l.productType))throw new Error(`${d}.productType must be one of ${w.join(", ")}`);if(typeof l.productDuration!="string")throw new Error(`${d}.productDuration must be a string`);const q=["Daily","Seasonal","Trip","Event"];if(!q.includes(l.productDuration))throw new Error(`${d}.productDuration must be one of ${q.join(", ")}`);if(typeof l.productPrice!="number"||isNaN(l.productPrice))throw new Error(`${d}.productPrice must be a valid number`);if(typeof l.productId!="string")throw new Error(`${d}.productId must be a string`);if(typeof l.cartId!="string")throw new Error(`${d}.cartId must be a string`);if(typeof l.productName!="string")throw new Error(`${d}.productName must be a string`)}if("items"in r){const l=r,{cartId:u,cartName:d,currencyCode:_,items:w}=l;if(!u||typeof u!="string")throw new Error("quoteRequestData.cartId must be a string");if(!d||typeof d!="string")throw new Error("quoteRequestData.cartName must be a string");if(!_||typeof _!="string")throw new Error("quoteRequestData.currencyCode must be a string");if(!D.includes(_))throw new Error(`Invalid quoteRequestData.currencyCode: ${_}`);if(!Array.isArray(w)||w.length===0)throw new Error("quoteRequestData.items must be a non-empty array");const q=["startDate","endDate","eventType","productType","productDuration","productPrice","productId","productName"];w.forEach((g,H)=>{if(!g||typeof g!="object")throw new Error(`quoteRequestData.items[${H}] must be a non-null object`);const y=`quoteRequestData.items[${H}]`;q.forEach(x=>{if(!Object.prototype.hasOwnProperty.call(g,x)||g[x]===void 0||g[x]===null)throw new Error(`Missing required ${y} field: '${x}'`)});const R=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!R.test(g.startDate))throw new Error(`${y}.startDate must be a valid ISO8601 string`);if(!R.test(g.endDate))throw new Error(`${y}.endDate must be a valid ISO8601 string`);if(typeof g.eventType!="string")throw new Error(`${y}.eventType must be a string`);if(typeof g.productType!="string")throw new Error(`${y}.productType must be a string`);const L=["Pass","Trip","Registration"];if(!L.includes(g.productType))throw new Error(`${y}.productType must be one of ${L.join(", ")}`);if(typeof g.productDuration!="string")throw new Error(`${y}.productDuration must be a string`);const O=["Daily","Seasonal","Trip","Event"];if(!O.includes(g.productDuration))throw new Error(`${y}.productDuration must be one of ${O.join(", ")}`);if(typeof g.productPrice!="number"||isNaN(g.productPrice))throw new Error(`${y}.productPrice must be a valid number`);if(typeof g.productId!="string")throw new Error(`${y}.productId must be a string`);if(typeof g.productName!="string")throw new Error(`${y}.productName must be a string`)})}else if(Array.isArray(r)){if(r.length===0)throw new Error("quoteRequestData array cannot be empty");r.forEach((l,u)=>{if(!l||typeof l!="object")throw new Error(`quoteRequestData[${u}] must be a non-null object`);v(l,u)})}else v(r);if(["onOptIn","onOptOut","onQuoteRetrieved","onError","noMatchingQuote"].forEach(l=>{const u=s[l];if(u&&typeof u!="function")throw new Error(`Callback '${l}' must be a function.`)}),typeof i=="string"&&!document.querySelector(i))throw new Error(`Invalid location selector: '${i}'`);if(n&&typeof n!="object")throw new Error("Theme must be an object with CSS variables, do not include the '--' prefix");if(c.state&&!P.has(c.state))throw new Error(`Invalid state: '${c.state}'. Must be a 2-character US state or territory code.`)}var b=(c=>(c.YES="yes",c.NO="no",c.UNSELECTED="unselected",c))(b||{});function a(c,{text:t,className:r,parent:s,innerHTML:i,href:n,target:e}={}){const o=document.createElement(c);return r&&(o.className=r),t!=null&&(o.textContent=t),i!=null&&(o.innerHTML=i),n&&"href"in o&&(o.href=n),e&&"target"in o&&(o.target=e),s&&s.appendChild(o),o}function V(c,{name:t,description:r}){a("div",{className:"spot-header__title",text:t,parent:c}),a("div",{className:"spot-header__description",text:r,parent:c})}function U(c,t=[]){const r=a("ul",{className:"spot-benefits__list",parent:c});t.forEach(s=>{const i=a("li",{parent:r});i.innerHTML=`
|
|
2
2
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="spot-bullets__checkmark">
|
|
3
3
|
<path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
|
|
4
4
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
-
</svg>`,
|
|
5
|
+
</svg>`,a("span",{text:s,parent:i})})}function Q(c,t=[]){if(!t||t.length===0)return;const r=a("div",{className:"spot-qualifying-reasons__container",parent:c}),s=[...t].sort((o,p)=>o.rank-p.rank),i=a("div",{className:"spot-qualifying-reasons__grid",parent:r}),n={"Accident & Illness":"cross.svg","Family Emergencies":"users.svg",Layoffs:"building.svg","Jury Duty":"scale.svg","Work Travel Conflict":"briefcase.svg","Severe Weather":"umbrella.svg","Travel Interruption":"plane.svg","Military Duty":"medal.svg"};let e;try{const o=document.currentScript;if(o!=null&&o.src){const p=new URL(o.src);e=p.origin+p.pathname.replace(/\/[^/]*$/,"/")}else e=window.location.origin+window.location.pathname.replace(/\/[^/]*$/,"/");e+="assets/"}catch{e="./assets/"}s.forEach(o=>{var v,h,l;const p=a("div",{className:"spot-qualifying-reasons__item",parent:i}),m=a("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:p}),f=n[((v=o.benefitType)==null?void 0:v.name)||""]||n[o.name||""];if(f){const u=a("img",{parent:m});u.src=e+f,u.alt=((h=o.benefitType)==null?void 0:h.name)||o.name||"",u.className="spot-qualifying-reasons__icon"}a("span",{className:"spot-qualifying-reasons__label",text:((l=o.benefitType)==null?void 0:l.name)||o.name||"",parent:p})})}function Z(c,t=[],r){if(t.length===0||!r||r<=1)return;const s=new Map;t.forEach(u=>{s.set(u,(s.get(u)||0)+1)});const n=Array.from(s.entries()).map(([u,d])=>({item:u,count:d,displayText:d>1?`${d} x ${u}`:u})).sort((u,d)=>{const _=u.item.charAt(0),w=d.item.charAt(0),q=/[a-zA-Z]/.test(_),g=/[a-zA-Z]/.test(w);return!q&&g?-1:q&&!g?1:u.item.localeCompare(d.item,void 0,{sensitivity:"base"})}),e=a("div",{className:"spot-covered-items__container",parent:c}),o=a("div",{className:"spot-covered-items__header",parent:e}),p=a("button",{className:"spot-covered-items__toggle",parent:o});a("span",{className:"spot-covered-items__title",text:`Items Covered in Your Cart (${t.length})`,parent:p});const m=a("div",{className:"spot-covered-items__right-section",parent:p});a("span",{className:"spot-covered-items__view-all",text:"View All",parent:m});const f=a("span",{className:"spot-covered-items__arrow",innerHTML:"▼",parent:m}),v=a("div",{className:"spot-covered-items__content",parent:e}),h=a("ul",{className:"spot-covered-items__list",parent:v});n.forEach(({displayText:u})=>{const d=a("li",{parent:h});a("span",{text:u,parent:d})});let l=!1;v.style.display="none",p.addEventListener("click",u=>{u.stopPropagation(),l=!l,v.style.display=l?"block":"none",f.innerHTML=l?"▲":"▼",p.setAttribute("aria-expanded",l.toString())}),p.setAttribute("aria-expanded","false"),p.setAttribute("aria-controls","covered-items-list"),v.setAttribute("id","covered-items-list")}const B={USD:"$",CAD:"CAD $",AUD:"AUD $",NZD:"NZD $",MXN:"MXN $",EUR:"EUR €",GBP:"GBP £",AED:"AED ",MAD:"MAD ",SAR:"SAR ",BGN:"BGN лв",BRL:"BRL R$",CHF:"CHF ",DKK:"DKK kr",INR:"INR ₹",JPY:"JPY ¥",MYR:"MYR RM",NOK:"NOK kr",PLN:"PLN zł",SEK:"SEK kr",SGD:"SGD $",THB:"THB ฿",ZAR:"ZAR R"};function j(c,t=[],r="USD"){const s=B[r]??`${r} `,i=a("div",{className:"spot-table__container",parent:c}),n=a("table",{className:"spot-refund__table spot-table--dynamic",parent:i}),e=a("thead",{parent:n}),o=a("tr",{parent:e});a("th",{text:"When you cancel",parent:o}),a("th",{text:"You will receive",parent:o});const p=a("tbody",{parent:n});t.forEach(({text:m,percent:f,amount:v})=>{const h=a("tr",{parent:p});a("td",{text:m,parent:h});const l=f==="Not eligible for refund"?"Not eligible for a refund":`${s}${v} refund`;a("td",{text:l,parent:h})})}function F(c,t){const r=a("div",{className:"spot-state-dropdown__wrapper",parent:c});a("label",{className:"spot-state-dropdown__label",text:"State of Residence",parent:r});const s=a("select",{className:"spot-state-dropdown__select",parent:r});s.setAttribute("aria-label","State of Residence");const i=a("option",{text:"Select a state...",parent:s});i.value="",i.selected=!t,T.forEach(({value:e,label:o})=>{const p=a("option",{text:o,parent:s});p.value=e,e===t&&(p.selected=!0)});const n=a("option",{text:"Not a US Resident",parent:s});return n.value=E,t===E&&(n.selected=!0),a("div",{className:"spot-state-dropdown__error",text:A,parent:r}),s}function W(c,t,r,s=!1){const i=a("div",{className:`spot-selection__options${s?" spot-selection__options--disabled":""}`,parent:c}),n=a("label",{className:`spot-selection__option ${t===b.YES?"selected":""}`,parent:i}),e=a("input",{parent:n});e.type="radio",e.name="selection",e.value=b.YES,t===b.YES&&(e.checked=!0),s&&(e.disabled=!0),a("strong",{text:r.yesOptionText,parent:n}),a("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:n});const o=a("label",{className:`spot-selection__option ${t===b.NO?"selected":""}`,parent:i}),p=a("input",{parent:o});return p.type="radio",p.name="selection",p.value=b.NO,t===b.NO&&(p.checked=!0),s&&(p.disabled=!0),a("span",{text:r.noOptionText,parent:o}),i}function I(c,t){var s;const r=(s=t.communication)==null?void 0:s.paymentTerms;if(r){const i=a("div",{className:"spot-payment-terms",parent:c});return a("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:i}),a("div",{className:"spot-payment-terms__body",text:r||"",parent:i}),i}}function Y(c,t,r="bottom-right"){if(r==="top-right"){const o=a("div",{className:"spot-logo__top-right",parent:c});o.innerHTML=`
|
|
6
6
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
7
|
<rect width="145" height="28"/>
|
|
8
8
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<rect width="45.405" height="14.8867" fill="white" transform="translate(87 8)"/>
|
|
18
18
|
</clipPath>
|
|
19
19
|
</defs>
|
|
20
|
-
</svg>`}const s=
|
|
20
|
+
</svg>`}const s=a("div",{className:"spot-footer__container",parent:c}),i=a("div",{className:"spot-footer__terms",parent:s}),n=`<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`,e=t.communication.legalDisclaimer.replace(/terms (and|&) conditions/gi,n);if(a("span",{innerHTML:e,parent:i}),r==="bottom-right"){const o=a("p",{className:"spot-footer__powered-by",parent:s});o.innerHTML=`
|
|
21
21
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
22
22
|
<rect width="145" height="28"/>
|
|
23
23
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
<rect width="45.405" height="14.8867" fill="white" transform="translate(87 8)"/>
|
|
33
33
|
</clipPath>
|
|
34
34
|
</defs>
|
|
35
|
-
</svg>`}return s}const Y=":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-border-line-width: .0625rem;--spot-border-color: #e0e0e0;--spot-max-width: 51rem;--spot-margin: 1rem;--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-bullets-checkmark-color: #2e2e2e;--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-state-dropdown-label-font-size: .875rem;--spot-state-dropdown-label-font-weight: 600;--spot-state-dropdown-label-margin-bottom: .25rem;--spot-state-dropdown-select-border: .0625rem solid #e0e0e0;--spot-state-dropdown-select-border-radius: .375rem;--spot-state-dropdown-select-padding: .5rem .75rem;--spot-state-dropdown-select-font-size: .875rem;--spot-state-dropdown-select-background: #ffffff;--spot-state-dropdown-wrapper-margin-bottom: .75rem;--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-covered-items-background: #f1f3f5;--spot-covered-items-hover-background: #e9ecef;--spot-covered-items-border-radius: .5rem;--spot-covered-items-padding: .75rem 1rem;--spot-covered-items-font-size: .875rem;--spot-covered-items-font-weight: 400;--spot-covered-items-font-color: #000000;--spot-covered-items-font-family: Arial;--spot-covered-items-arrow-font-size: .6rem;--spot-covered-items-arrow-color: #636569;--spot-covered-items-view-all-color: #636569;--spot-covered-items-view-all-font-size: .875rem;--spot-covered-items-view-all-font-weight: 400;--spot-covered-items-content-background: #f8f9fa;--spot-covered-items-content-border: 1px solid #e0e0e0;--spot-covered-items-content-border-radius: .5rem;--spot-covered-items-content-padding: .75rem 1rem;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 1.5rem;--spot-footer-gap: 1rem;--spot-footer-terms-margin-right: 7rem;--spot-payment-terms-margin-top: .5rem;--spot-logo-top-right-margin: 1rem}.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:var(--spot-border-line-width) solid var(--spot-border-color);border-radius:var(--spot-border-radius);max-width:var(--spot-max-width);margin:var(--spot-margin);container-type:inline-size;position:relative;word-wrap:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.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}.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr auto;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container,.desktop-layout .spot-covered-items__container,.desktop-layout .spot-selection__wrapper{min-width:0;word-wrap:normal}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container{grid-row:1;margin-bottom:var(--spot-benefits-margin-bottom)}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1;margin-bottom:var(--spot-covered-items-margin-bottom)}.desktop-layout .spot-selection__wrapper{grid-row:3;grid-column:1;margin-top:var(--spot-desktop-radio-margin-top)}.desktop-layout .spot-payment-terms__wrapper{grid-row:4;grid-column:1;margin-top:var(--spot-payment-terms-margin-top)}.desktop-layout .spot-table__container{grid-row:1 / span 4;grid-column:2;width:auto;min-width:20.3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-table__container{display:flex;justify-content:flex-start;margin-top:1rem;margin-bottom:1rem;box-sizing:border-box;padding:0 .3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-refund__table{width:100%;max-width:22rem;table-layout:auto}@media (max-width: 850px){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 500px){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 600px){.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:.375rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-bullets__checkmark path{stroke:var(--spot-bullets-checkmark-color)}.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:.85rem;margin-bottom:.5rem;max-width:26rem}.spot-content__wrapper.desktop-layout:has(.spot-table__container) .spot-covered-items__container{margin-top:0rem;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-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-covered-items__list li:last-child{margin-bottom:0}.spot-covered-items__header{margin-bottom:.5rem}.spot-covered-items__toggle{background:var(--spot-covered-items-background);border:none;border-radius:var(--spot-covered-items-border-radius);padding:var(--spot-covered-items-padding);cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;transition:all .2s ease}.spot-covered-items__toggle:hover{background-color:var(--spot-covered-items-hover-background)}.spot-covered-items__toggle:focus{outline:none;box-shadow:0 0 0 2px #0000001a}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;margin:0;padding:0}.spot-covered-items__right-section{display:flex;align-items:center;gap:.5rem;margin-left:auto}.spot-covered-items__view-all{font-size:var(--spot-covered-items-view-all-font-size);font-weight:var(--spot-covered-items-view-all-font-weight);color:var(--spot-covered-items-view-all-color);font-family:var(--spot-covered-items-font-family);line-height:125%}.spot-covered-items__arrow{font-size:var(--spot-covered-items-arrow-font-size);transition:transform .2s ease;color:var(--spot-covered-items-arrow-color);flex-shrink:0;transform:scaleX(1.5)}.spot-covered-items__content{margin-top:.5rem;transition:all .2s ease;overflow:hidden}.spot-covered-items__list{background-color:var(--spot-covered-items-content-background);border:var(--spot-covered-items-content-border);border-radius:var(--spot-covered-items-content-border-radius);margin:0;padding:var(--spot-covered-items-content-padding)}.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:.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)}.spot-state-dropdown__wrapper{display:flex;flex-direction:column;margin-bottom:var(--spot-state-dropdown-wrapper-margin-bottom)}.spot-state-dropdown__label{font-size:var(--spot-state-dropdown-label-font-size);font-weight:var(--spot-state-dropdown-label-font-weight);font-family:var(--spot-font-family);color:var(--spot-font-color);margin-bottom:var(--spot-state-dropdown-label-margin-bottom)}.spot-state-dropdown__select{width:100%;box-sizing:border-box;border:var(--spot-state-dropdown-select-border);border-radius:var(--spot-state-dropdown-select-border-radius);padding:var(--spot-state-dropdown-select-padding);font-size:var(--spot-state-dropdown-select-font-size);font-family:var(--spot-font-family);color:var(--spot-font-color);background-color:var(--spot-state-dropdown-select-background);cursor:pointer;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.spot-state-dropdown__select:focus{outline:none;box-shadow:0 0 0 2px #00000026}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;min-width:.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;flex-shrink:0}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:flex;align-items:center;flex-wrap:nowrap;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}.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:.75rem;white-space:nowrap;flex-shrink:0}@media (max-width: 850px){.spot-selection__recommended-tag{margin-left:.5rem}}@media (max-width: 600px){.spot-selection__recommended-tag{margin-left:.5rem;font-size:.75rem;padding:.1875rem .4375rem}}.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-selection__options--disabled .spot-selection__option{opacity:.4;cursor:not-allowed;pointer-events:none}.spot-selection__options--disabled input[type=radio]{cursor:not-allowed}.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);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);line-height:1.4;word-wrap:normal;-webkit-hyphens:none;hyphens:none;flex:1;min-width:0;overflow-wrap:normal}.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;flex-direction:row;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spot-footer-gap)}@container (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}@media (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}.spot-footer__powered-by{margin-top:0;flex-shrink:0}.spot-logo__top-right{position:absolute;top:-14px;right:40px;z-index:10;background:linear-gradient(to bottom,transparent 50%,inherit 50%);padding:0 .25rem}.spot-logo__top-right svg{border-radius:1.25rem;border:var(--spot-border-line-width) solid var(--spot-border-color);display:block;background:var(--spot-background-color)}@container (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}@media (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}";function G(c){const t=document.createElement("style");t.textContent=c,document.head.appendChild(t)}G(Y);const M={sandbox:"https://api.sandbox.getspot.com/api/v1/quote",production:"https://api.getspot.com/api/v1/quote",local:"http://localhost:3999/api/v1/quote"};class K{constructor(t={}){this.options={location:"body",showTable:!0,logoPosition:"bottom-right",apiConfig:{environment:"production",partnerId:""},quoteRequestData:{},callbacks:{},useMockData:!1,...t,selection:t.selection??b.UNSELECTED},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.selection,this._init()}async _init(){var t,r,s,i,a;try{N(this.options),this.currentState=this.options.state;let e;if(this.options.useMockData&&this.options.mockData)e=this.options.mockData;else{const{environment:o,partnerId:l}=this.options.apiConfig,f=this.options.apiConfig.customEndpoint||M[o];e="items"in this.options.quoteRequestData?await D(f,l,this.options.quoteRequestData,this._validState()):await q(f,l,this.options.quoteRequestData,this._validState())}if(e.status!=="QUOTE_AVAILABLE"){e.status==="NO_MATCHING_QUOTE"&&((t=this.options.callbacks)!=null&&t.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:this.options.quoteRequestData});return}if(this.quote=e.data,!this.quote)throw new Error("No quote data in response");if(this._renderWidget(),this.options.selection===b.YES&&((r=this.options.callbacks)!=null&&r.onOptIn)){const o={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id,state:this._validState()};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const l=this.options.quoteRequestData;o.batchQuoteDetails=this.quote.originalQuotes.map(m=>{var v;const f=(v=l.items)==null?void 0:v.find(h=>(h.cartItemId||`item-${l.items.indexOf(h)+1}`)===m.cartItemId);return{quoteId:m.id,productPrice:(f==null?void 0:f.productPrice)||m.spotPrice,cartItemId:(f==null?void 0:f.cartItemId)||""}})}this.options.callbacks.onOptIn(o)}if((s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const o=this.options.callbacks.onQuoteRetrieved(this.quote);o&&this._applyQuoteUpdates(o)}}catch(e){if((i=this.options.callbacks)!=null&&i.onError){const o=e;(a=this.options.callbacks)==null||a.onError({message:o.message,status:o.status,responseBody:o.responseBody})}}}_renderWidget(){if(!this.quote)return;this.container=document.createElement("div"),this.container.className="spot-refund-guarantee",this.root.appendChild(this.container),Object.entries(this.options.theme||{}).forEach(([e,o])=>{const l=`--${e}`;this.container.style.setProperty(l,o)}),$(this.container,this.quote.communication);const t=document.createElement("div");if(t.className="spot-content__wrapper",this.container.appendChild(t),this.quote.qualifyingReasons?Q(t,this.quote.qualifyingReasons):V(t,this.quote.communication.bulletPoints),this.quote.coveredItems){const e=this._getTotalItemsInRequest();U(t,this.quote.coveredItems,e)}this.options.showTable&&!this.quote.qualifyingReasons&&B(t,this.quote.payoutSchedule,this.quote.currencyCode);const r=n("div",{className:"spot-selection__wrapper",parent:t});this._isPassOrTrip()&&!this.options.state&&(this._stateSelectEl=j(r,this.currentState));const i=!this._isQuotingAvailable(),a=F(r,this.options.selection,this.quote.communication,i);this.paymentTermsEl=n("div",{className:"spot-payment-terms__wrapper",parent:t}),this.currentSelection===b.YES&&I(this.paymentTermsEl,this.quote),W(this.container,this.quote,this.options.logoPosition),window.addEventListener("resize",this._onResize),this._setupResizeObserver(),this._updateLayout(),this._setupOptionListeners(a),this._setupStateDropdownListener()}_updateLayout(){if(!this.container||!this.quote)return;const t=this.container.querySelector(".spot-content__wrapper"),r=this.options.showTable&&!this.quote.qualifyingReasons;if(!t||!r){t==null||t.classList.remove("desktop-layout");return}const s=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",s)}_shouldUseDesktopLayout(t){const r=this.container.offsetWidth-40,s=325,i=16;if(r>=900)return!0;if(r>=650){const a=t.classList.contains("desktop-layout");t.classList.remove("desktop-layout"),t.offsetHeight;const e=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!e)return a&&t.classList.add("desktop-layout"),a;const l=Math.min(e.scrollWidth,400)+s+i;return a&&t.classList.add("desktop-layout"),r>=l}return!1}_setupResizeObserver(){!this.container||!window.ResizeObserver||(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=window.setTimeout(()=>{this._updateLayout()},100)}),this._resizeObserver.observe(this.container))}_getTotalItemsInRequest(){return"items"in this.options.quoteRequestData?this.options.quoteRequestData.items.length:1}_applyQuoteUpdates(t){!this.quote||!this.container||(t.spotPriceWithFees!==void 0&&(this.quote.communication.yesOptionText=this.quote.communication.yesOptionText.replace(`$${this.quote.spotPrice.toFixed(2)}`,`$${t.spotPriceWithFees.toFixed(2)}`)),this.destroy(),this._renderWidget())}_isPassOrTrip(){const t=this.options.quoteRequestData;if(Array.isArray(t))return t.some(s=>s.productType==="Pass"||s.productType==="Trip");if("items"in t)return t.items.some(s=>s.productType==="Pass"||s.productType==="Trip");const r=t;return r.productType==="Pass"||r.productType==="Trip"}_validState(){if(this._isPassOrTrip()&&!(!this.currentState||this.currentState===k))return this.currentState}_isQuotingAvailable(){return!this._isPassOrTrip()||this.options.state?!0:!!this.currentState&&this.currentState!==k}_setRadiosDisabled(t){var i,a,e;const r=(i=this.container)==null?void 0:i.querySelectorAll('input[name="selection"]'),s=(a=this.container)==null?void 0:a.querySelector(".spot-selection__options");r==null||r.forEach(o=>{o.disabled=t}),s==null||s.classList.toggle("spot-selection__options--disabled",t),t&&(r==null||r.forEach(o=>{o.checked=!1}),(e=this.container)==null||e.querySelectorAll(".spot-selection__option").forEach(o=>{o.classList.remove("selected")}),this.currentSelection=b.UNSELECTED,this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""))}_setupStateDropdownListener(){this._stateSelectEl&&this._stateSelectEl.addEventListener("change",()=>{this.currentState=this._stateSelectEl.value,this._setRadiosDisabled(!this._isQuotingAvailable())})}_setupOptionListeners(t){const r=t.querySelectorAll('input[type="radio"]'),s=t.querySelectorAll(".spot-selection__option");r.forEach(i=>{i.addEventListener("change",a=>{var l,m,f,v;const e=a.target,o=e.value;if(this.hideSelectionError(),this.currentSelection=o,s.forEach(h=>h.classList.remove("selected")),(l=e.closest(".spot-selection__option"))==null||l.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),o===b.YES&&((m=this.quote)!=null&&m.communication.paymentTerms&&I(this.paymentTermsEl,this.quote),(f=this.options.callbacks)!=null&&f.onOptIn)){const h={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id,state:this._validState()};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const p=this.options.quoteRequestData;h.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var w;const d=(w=p.items)==null?void 0:w.find(y=>(y.cartItemId||`item-${p.items.indexOf(y)+1}`)===u.cartItemId);return{quoteId:u.id,productPrice:(d==null?void 0:d.productPrice)||u.spotPrice,cartItemId:(d==null?void 0:d.cartItemId)||""}})}this.options.callbacks.onOptIn(h)}if(o===b.NO&&((v=this.options.callbacks)!=null&&v.onOptOut)){const h={status:"QUOTE_DECLINED",quoteId:this.quote.id,state:this._validState()};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const p=this.options.quoteRequestData;h.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var w;const d=(w=p.items)==null?void 0:w.find(y=>(y.cartItemId||`item-${p.items.indexOf(y)+1}`)===u.cartItemId);return{quoteId:u.id,productPrice:(d==null?void 0:d.productPrice)||u.spotPrice,cartItemId:(d==null?void 0:d.cartItemId)||""}})}this.options.callbacks.onOptOut(h)}})})}showSelectionError(){var t;if(!this.errorEl){this.errorEl=document.createElement("div"),this.errorEl.className="spot-selection__error",this.errorEl.textContent="Please make a selection";const r=(t=this.container)==null?void 0:t.querySelector(".spot-selection__options");r&&r.insertAdjacentElement("afterend",this.errorEl)}this.errorEl.style.display="block"}hideSelectionError(){this.errorEl&&(this.errorEl.style.display="none")}validateSelection(){if(!this.container)return!1;const t=!!this.container.querySelector('input[name="selection"]:checked');return t?this.hideSelectionError():this.showSelectionError(),t}async updateQuote(t){var r,s,i,a;try{const e={...this.options,quoteRequestData:t};N(e);const{environment:o,partnerId:l,customEndpoint:m}=this.options.apiConfig,f=m||M[o],h="items"in e.quoteRequestData?await D(f,l,e.quoteRequestData,this._validState()):await q(f,l,e.quoteRequestData,this._validState());if(h.status!=="QUOTE_AVAILABLE")return this.destroy(),h.status==="NO_MATCHING_QUOTE"&&((r=this.options.callbacks)!=null&&r.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:e.quoteRequestData}),!1;if(this.options.quoteRequestData=e.quoteRequestData,this.quote=h.data,this.currentSelection=b.UNSELECTED,this.destroy(),this._renderWidget(),(s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const p=this.options.callbacks.onQuoteRetrieved(this.quote);p&&this._applyQuoteUpdates(p)}return!0}catch(e){const o=e;return(a=(i=this.options.callbacks)==null?void 0:i.onError)==null||a.call(i,{message:o.message,status:o.status,responseBody:o.responseBody}),!1}}getSelection(){var r,s,i;if(this.currentSelection==null||this.currentSelection==b.UNSELECTED)return null;const t={selection:this.currentSelection,quoteId:(r=this.quote)==null?void 0:r.id,spotPrice:(s=this.quote)==null?void 0:s.spotPrice,status:this.currentSelection===b.YES?"QUOTE_ACCEPTED":"QUOTE_DECLINED",state:this.currentState};if((i=this.quote)!=null&&i.originalQuotes&&this.quote.originalQuotes.length>0){const a=this.options.quoteRequestData;t.batchQuoteDetails=this.quote.originalQuotes.map(e=>{var l;const o=(l=a.items)==null?void 0:l.find(m=>(m.cartItemId||`item-${a.items.indexOf(m)+1}`)===e.cartItemId);return{quoteId:e.id,productPrice:(o==null?void 0:o.productPrice)||e.spotPrice,cartItemId:(o==null?void 0:o.cartItemId)||""}})}return t}destroy(){window.removeEventListener("resize",this._onResize),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),this._resizeTimeout&&window.clearTimeout(this._resizeTimeout),this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}}C.NON_US_RESIDENT_VALUE=k,C.SelectionEnum=b,C.default=K,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
35
|
+
</svg>`}return s}const G=":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-border-line-width: .0625rem;--spot-border-color: #e0e0e0;--spot-max-width: 51rem;--spot-margin: 1rem;--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-bullets-checkmark-color: #2e2e2e;--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-state-dropdown-label-font-size: .875rem;--spot-state-dropdown-label-font-weight: 600;--spot-state-dropdown-label-margin-bottom: .25rem;--spot-state-dropdown-select-border: .0625rem solid #e0e0e0;--spot-state-dropdown-select-border-radius: .375rem;--spot-state-dropdown-select-padding: .5rem .75rem;--spot-state-dropdown-select-font-size: .875rem;--spot-state-dropdown-select-background: #ffffff;--spot-state-dropdown-wrapper-margin-bottom: .75rem;--spot-state-dropdown-error-color: var(--spot-selection-error-font-color);--spot-state-dropdown-error-font-size: .8125rem;--spot-state-dropdown-error-margin-top: .25rem;--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-covered-items-background: #f1f3f5;--spot-covered-items-hover-background: #e9ecef;--spot-covered-items-border-radius: .5rem;--spot-covered-items-padding: .75rem 1rem;--spot-covered-items-font-size: .875rem;--spot-covered-items-font-weight: 400;--spot-covered-items-font-color: #000000;--spot-covered-items-font-family: Arial;--spot-covered-items-arrow-font-size: .6rem;--spot-covered-items-arrow-color: #636569;--spot-covered-items-view-all-color: #636569;--spot-covered-items-view-all-font-size: .875rem;--spot-covered-items-view-all-font-weight: 400;--spot-covered-items-content-background: #f8f9fa;--spot-covered-items-content-border: 1px solid #e0e0e0;--spot-covered-items-content-border-radius: .5rem;--spot-covered-items-content-padding: .75rem 1rem;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 1.5rem;--spot-footer-gap: 1rem;--spot-footer-terms-margin-right: 7rem;--spot-payment-terms-margin-top: .5rem;--spot-logo-top-right-margin: 1rem}.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:var(--spot-border-line-width) solid var(--spot-border-color);border-radius:var(--spot-border-radius);max-width:var(--spot-max-width);margin:var(--spot-margin);container-type:inline-size;position:relative;word-wrap:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.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}.spot-content__wrapper.desktop-layout{display:grid;grid-template-columns:1fr auto;align-items:start;gap:1rem}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container,.desktop-layout .spot-covered-items__container,.desktop-layout .spot-selection__wrapper{min-width:0;word-wrap:normal}.desktop-layout .spot-benefits__list,.desktop-layout .spot-qualifying-reasons__container{grid-row:1;margin-bottom:var(--spot-benefits-margin-bottom)}.desktop-layout .spot-covered-items__container{grid-row:2;grid-column:1;margin-bottom:var(--spot-covered-items-margin-bottom)}.desktop-layout .spot-selection__wrapper{grid-row:3;grid-column:1;margin-top:var(--spot-desktop-radio-margin-top)}.desktop-layout .spot-payment-terms__wrapper{grid-row:4;grid-column:1;margin-top:var(--spot-payment-terms-margin-top)}.desktop-layout .spot-table__container{grid-row:1 / span 4;grid-column:2;width:auto;min-width:20.3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-table__container{display:flex;justify-content:flex-start;margin-top:1rem;margin-bottom:1rem;box-sizing:border-box;padding:0 .3125rem}.spot-content__wrapper:not(.desktop-layout) .spot-refund__table{width:100%;max-width:22rem;table-layout:auto}@media (max-width: 850px){.spot-selection__recommended-tag{display:inline-block;margin-left:0}}@media (max-width: 500px){.spot-selection__recommended-tag{margin-top:.5rem}}@media (max-width: 600px){.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:.375rem;display:flex;align-items:flex-start;gap:.5rem}.spot-benefits__list li svg{flex-shrink:0;position:relative;top:.125rem}.spot-bullets__checkmark path{stroke:var(--spot-bullets-checkmark-color)}.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:.85rem;margin-bottom:.5rem;max-width:26rem}.spot-content__wrapper.desktop-layout:has(.spot-table__container) .spot-covered-items__container{margin-top:0rem;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-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-covered-items__list li:last-child{margin-bottom:0}.spot-covered-items__header{margin-bottom:.5rem}.spot-covered-items__toggle{background:var(--spot-covered-items-background);border:none;border-radius:var(--spot-covered-items-border-radius);padding:var(--spot-covered-items-padding);cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;transition:all .2s ease}.spot-covered-items__toggle:hover{background-color:var(--spot-covered-items-hover-background)}.spot-covered-items__toggle:focus{outline:none;box-shadow:0 0 0 2px #0000001a}.spot-covered-items__title{font-size:var(--spot-covered-items-font-size);font-weight:var(--spot-covered-items-font-weight);color:var(--spot-covered-items-font-color);font-family:var(--spot-covered-items-font-family);line-height:125%;margin:0;padding:0}.spot-covered-items__right-section{display:flex;align-items:center;gap:.5rem;margin-left:auto}.spot-covered-items__view-all{font-size:var(--spot-covered-items-view-all-font-size);font-weight:var(--spot-covered-items-view-all-font-weight);color:var(--spot-covered-items-view-all-color);font-family:var(--spot-covered-items-font-family);line-height:125%}.spot-covered-items__arrow{font-size:var(--spot-covered-items-arrow-font-size);transition:transform .2s ease;color:var(--spot-covered-items-arrow-color);flex-shrink:0;transform:scaleX(1.5)}.spot-covered-items__content{margin-top:.5rem;transition:all .2s ease;overflow:hidden}.spot-covered-items__list{background-color:var(--spot-covered-items-content-background);border:var(--spot-covered-items-content-border);border-radius:var(--spot-covered-items-content-border-radius);margin:0;padding:var(--spot-covered-items-content-padding)}.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:.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)}.spot-state-dropdown__wrapper{display:flex;flex-direction:column;margin-bottom:var(--spot-state-dropdown-wrapper-margin-bottom)}.spot-state-dropdown__label{font-size:var(--spot-state-dropdown-label-font-size);font-weight:var(--spot-state-dropdown-label-font-weight);font-family:var(--spot-font-family);color:var(--spot-font-color);margin-bottom:var(--spot-state-dropdown-label-margin-bottom)}.spot-state-dropdown__select{width:100%;box-sizing:border-box;border:var(--spot-state-dropdown-select-border);border-radius:var(--spot-state-dropdown-select-border-radius);padding:var(--spot-state-dropdown-select-padding);font-size:var(--spot-state-dropdown-select-font-size);font-family:var(--spot-font-family);color:var(--spot-font-color);background-color:var(--spot-state-dropdown-select-background);cursor:pointer;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.spot-state-dropdown__select:focus{outline:none;box-shadow:0 0 0 2px #00000026}.spot-state-dropdown__select--error{border-color:var(--spot-state-dropdown-error-color)}.spot-state-dropdown__select--error:focus{box-shadow:0 0 0 2px #ff000026}.spot-state-dropdown__error{display:none;color:var(--spot-state-dropdown-error-color);font-size:var(--spot-state-dropdown-error-font-size);font-family:var(--spot-font-family);margin-top:var(--spot-state-dropdown-error-margin-top)}.spot-state-dropdown__error--visible{display:block}input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75rem;height:.75rem;min-width:.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;flex-shrink:0}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:flex;align-items:center;flex-wrap:nowrap;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}.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:.75rem;white-space:nowrap;flex-shrink:0}@media (max-width: 850px){.spot-selection__recommended-tag{margin-left:.5rem}}@media (max-width: 600px){.spot-selection__recommended-tag{margin-left:.5rem;font-size:.75rem;padding:.1875rem .4375rem}}.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-selection__options--disabled .spot-selection__option{opacity:.4;cursor:not-allowed;pointer-events:none}.spot-selection__options--disabled input[type=radio]{cursor:not-allowed}.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);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);line-height:1.4;word-wrap:normal;-webkit-hyphens:none;hyphens:none;flex:1;min-width:0;overflow-wrap:normal}.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;flex-direction:row;justify-content:space-between;align-items:flex-start;flex-wrap:nowrap;gap:var(--spot-footer-gap)}@container (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}@media (max-width: 650px){.spot-footer__container{flex-direction:column!important;align-items:flex-start!important;flex-wrap:wrap!important}.spot-footer__terms{margin-right:0!important;margin-bottom:.5rem!important;flex:none!important;width:100%!important;max-width:none!important}}.spot-footer__powered-by{margin-top:0;flex-shrink:0}.spot-logo__top-right{position:absolute;top:-14px;right:40px;z-index:10;background:linear-gradient(to bottom,transparent 50%,inherit 50%);padding:0 .25rem}.spot-logo__top-right svg{border-radius:1.25rem;border:var(--spot-border-line-width) solid var(--spot-border-color);display:block;background:var(--spot-background-color)}@container (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}@media (min-width: 651px){.spot-footer__powered-by{margin-top:0;align-self:center}.spot-footer__terms{margin-right:var(--spot-footer-terms-margin-right)}}";function K(c){const t=document.createElement("style");t.textContent=c,document.head.appendChild(t)}K(G);const M={sandbox:"https://api.sandbox.getspot.com/api/v1/quote",production:"https://api.getspot.com/api/v1/quote",local:"http://localhost:3999/api/v1/quote"};class X{constructor(t={}){this.options={location:"body",showTable:!0,logoPosition:"bottom-right",apiConfig:{environment:"production",partnerId:""},quoteRequestData:{},callbacks:{},useMockData:!1,...t,selection:t.selection??b.UNSELECTED},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.selection,this._init()}async _init(){var t,r,s,i,n;try{N(this.options),this.currentState=this.options.state;let e;if(this.options.useMockData&&this.options.mockData)e=this.options.mockData;else{const{environment:o,partnerId:p}=this.options.apiConfig,f=this.options.apiConfig.customEndpoint||M[o];e="items"in this.options.quoteRequestData?await S(f,p,this.options.quoteRequestData,this._validState()):await k(f,p,this.options.quoteRequestData,this._validState())}if(e.status!=="QUOTE_AVAILABLE"){e.status==="NO_MATCHING_QUOTE"&&((t=this.options.callbacks)!=null&&t.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:this.options.quoteRequestData});return}if(this.quote=e.data,!this.quote)throw new Error("No quote data in response");if(this._renderWidget(),this.options.selection===b.YES&&((r=this.options.callbacks)!=null&&r.onOptIn)){const o={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id,state:this._validState()};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const p=this.options.quoteRequestData;o.batchQuoteDetails=this.quote.originalQuotes.map(m=>{var v;const f=(v=p.items)==null?void 0:v.find(h=>(h.cartItemId||`item-${p.items.indexOf(h)+1}`)===m.cartItemId);return{quoteId:m.id,productPrice:(f==null?void 0:f.productPrice)||m.spotPrice,cartItemId:(f==null?void 0:f.cartItemId)||""}})}this.options.callbacks.onOptIn(o)}if((s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const o=this.options.callbacks.onQuoteRetrieved(this.quote);o&&this._applyQuoteUpdates(o)}}catch(e){if((i=this.options.callbacks)!=null&&i.onError){const o=e;(n=this.options.callbacks)==null||n.onError({message:o.message,status:o.status,responseBody:o.responseBody})}}}_renderWidget(){if(!this.quote)return;this.container=document.createElement("div"),this.container.className="spot-refund-guarantee",this.root.appendChild(this.container),Object.entries(this.options.theme||{}).forEach(([e,o])=>{const p=`--${e}`;this.container.style.setProperty(p,o)}),V(this.container,this.quote.communication);const t=document.createElement("div");if(t.className="spot-content__wrapper",this.container.appendChild(t),this.quote.qualifyingReasons?Q(t,this.quote.qualifyingReasons):U(t,this.quote.communication.bulletPoints),this.quote.coveredItems){const e=this._getTotalItemsInRequest();Z(t,this.quote.coveredItems,e)}this.options.showTable&&!this.quote.qualifyingReasons&&j(t,this.quote.payoutSchedule,this.quote.currencyCode);const r=a("div",{className:"spot-selection__wrapper",parent:t});this._isPassOrTrip()&&!this.options.state&&(this._stateSelectEl=F(r,this.currentState),this._setNonUsResidentError(this.currentState===E));const i=!this._isQuotingAvailable(),n=W(r,this.currentSelection,this.quote.communication,i);this.paymentTermsEl=a("div",{className:"spot-payment-terms__wrapper",parent:t}),this.currentSelection===b.YES&&I(this.paymentTermsEl,this.quote),Y(this.container,this.quote,this.options.logoPosition),window.addEventListener("resize",this._onResize),this._setupResizeObserver(),this._updateLayout(),this._setupOptionListeners(n),this._setupStateDropdownListener()}_updateLayout(){if(!this.container||!this.quote)return;const t=this.container.querySelector(".spot-content__wrapper"),r=this.options.showTable&&!this.quote.qualifyingReasons;if(!t||!r){t==null||t.classList.remove("desktop-layout");return}const s=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",s)}_shouldUseDesktopLayout(t){const r=this.container.offsetWidth-40,s=325,i=16;if(r>=900)return!0;if(r>=650){const n=t.classList.contains("desktop-layout");t.classList.remove("desktop-layout"),t.offsetHeight;const e=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!e)return n&&t.classList.add("desktop-layout"),n;const p=Math.min(e.scrollWidth,400)+s+i;return n&&t.classList.add("desktop-layout"),r>=p}return!1}_setupResizeObserver(){!this.container||!window.ResizeObserver||(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=window.setTimeout(()=>{this._updateLayout()},100)}),this._resizeObserver.observe(this.container))}_getTotalItemsInRequest(){return"items"in this.options.quoteRequestData?this.options.quoteRequestData.items.length:1}_applyQuoteUpdates(t){!this.quote||!this.container||(t.spotPriceWithFees!==void 0&&(this.quote.communication.yesOptionText=this.quote.communication.yesOptionText.replace(`$${this.quote.spotPrice.toFixed(2)}`,`$${t.spotPriceWithFees.toFixed(2)}`)),this.destroy(),this._renderWidget())}_isPassOrTrip(){const t=this.options.quoteRequestData;if(Array.isArray(t))return t.some(s=>s.productType==="Pass"||s.productType==="Trip");if("items"in t)return t.items.some(s=>s.productType==="Pass"||s.productType==="Trip");const r=t;return r.productType==="Pass"||r.productType==="Trip"}_validState(){if(this._isPassOrTrip()&&!(!this.currentState||this.currentState===E))return this.currentState}_isQuotingAvailable(){return!this._isPassOrTrip()||this.options.state?!0:!!this.currentState&&this.currentState!==E}_setRadiosDisabled(t){var i,n,e;const r=(i=this.container)==null?void 0:i.querySelectorAll('input[name="selection"]'),s=(n=this.container)==null?void 0:n.querySelector(".spot-selection__options");r==null||r.forEach(o=>{o.disabled=t}),s==null||s.classList.toggle("spot-selection__options--disabled",t),t&&(r==null||r.forEach(o=>{o.checked=!1}),(e=this.container)==null||e.querySelectorAll(".spot-selection__option").forEach(o=>{o.classList.remove("selected")}),this.currentSelection=b.UNSELECTED,this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""))}_setNonUsResidentError(t){var s;if(!this._stateSelectEl)return;this._stateSelectEl.classList.toggle("spot-state-dropdown__select--error",t);const r=(s=this._stateSelectEl.parentElement)==null?void 0:s.querySelector(".spot-state-dropdown__error");r==null||r.classList.toggle("spot-state-dropdown__error--visible",t)}_setupStateDropdownListener(){this._stateSelectEl&&this._stateSelectEl.addEventListener("change",()=>{this.currentState=this._stateSelectEl.value,this._setRadiosDisabled(!this._isQuotingAvailable()),this._setNonUsResidentError(this.currentState===E)})}_setupOptionListeners(t){const r=t.querySelectorAll('input[type="radio"]'),s=t.querySelectorAll(".spot-selection__option");r.forEach(i=>{i.addEventListener("change",n=>{var p,m,f,v;const e=n.target,o=e.value;if(this.hideSelectionError(),this.currentSelection=o,s.forEach(h=>h.classList.remove("selected")),(p=e.closest(".spot-selection__option"))==null||p.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),o===b.YES&&((m=this.quote)!=null&&m.communication.paymentTerms&&I(this.paymentTermsEl,this.quote),(f=this.options.callbacks)!=null&&f.onOptIn)){const h={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id,state:this._validState()};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const l=this.options.quoteRequestData;h.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var _;const d=(_=l.items)==null?void 0:_.find(w=>(w.cartItemId||`item-${l.items.indexOf(w)+1}`)===u.cartItemId);return{quoteId:u.id,productPrice:(d==null?void 0:d.productPrice)||u.spotPrice,cartItemId:(d==null?void 0:d.cartItemId)||""}})}this.options.callbacks.onOptIn(h)}if(o===b.NO&&((v=this.options.callbacks)!=null&&v.onOptOut)){const h={status:"QUOTE_DECLINED",quoteId:this.quote.id,state:this._validState()};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const l=this.options.quoteRequestData;h.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var _;const d=(_=l.items)==null?void 0:_.find(w=>(w.cartItemId||`item-${l.items.indexOf(w)+1}`)===u.cartItemId);return{quoteId:u.id,productPrice:(d==null?void 0:d.productPrice)||u.spotPrice,cartItemId:(d==null?void 0:d.cartItemId)||""}})}this.options.callbacks.onOptOut(h)}})})}showSelectionError(){var t;if(!this.errorEl){this.errorEl=document.createElement("div"),this.errorEl.className="spot-selection__error",this.errorEl.textContent="Please make a selection";const r=(t=this.container)==null?void 0:t.querySelector(".spot-selection__options");r&&r.insertAdjacentElement("afterend",this.errorEl)}this.errorEl.style.display="block"}hideSelectionError(){this.errorEl&&(this.errorEl.style.display="none")}validateSelection(){if(!this.container)return!1;const t=!!this.container.querySelector('input[name="selection"]:checked');return t?this.hideSelectionError():this.showSelectionError(),t}async updateQuote(t){var r,s,i,n;try{const e={...this.options,quoteRequestData:t};N(e);const{environment:o,partnerId:p,customEndpoint:m}=this.options.apiConfig,f=m||M[o],h="items"in e.quoteRequestData?await S(f,p,e.quoteRequestData,this._validState()):await k(f,p,e.quoteRequestData,this._validState());if(h.status!=="QUOTE_AVAILABLE")return this.destroy(),h.status==="NO_MATCHING_QUOTE"&&((r=this.options.callbacks)!=null&&r.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:e.quoteRequestData}),!1;if(this.options.quoteRequestData=e.quoteRequestData,this.quote=h.data,this.destroy(),this._renderWidget(),(s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const l=this.options.callbacks.onQuoteRetrieved(this.quote);l&&this._applyQuoteUpdates(l)}return!0}catch(e){const o=e;return(n=(i=this.options.callbacks)==null?void 0:i.onError)==null||n.call(i,{message:o.message,status:o.status,responseBody:o.responseBody}),!1}}getSelection(){var r,s,i;if(this.currentSelection==null||this.currentSelection==b.UNSELECTED)return null;const t={selection:this.currentSelection,quoteId:(r=this.quote)==null?void 0:r.id,spotPrice:(s=this.quote)==null?void 0:s.spotPrice,status:this.currentSelection===b.YES?"QUOTE_ACCEPTED":"QUOTE_DECLINED",state:this.currentState};if((i=this.quote)!=null&&i.originalQuotes&&this.quote.originalQuotes.length>0){const n=this.options.quoteRequestData;t.batchQuoteDetails=this.quote.originalQuotes.map(e=>{var p;const o=(p=n.items)==null?void 0:p.find(m=>(m.cartItemId||`item-${n.items.indexOf(m)+1}`)===e.cartItemId);return{quoteId:e.id,productPrice:(o==null?void 0:o.productPrice)||e.spotPrice,cartItemId:(o==null?void 0:o.cartItemId)||""}})}return t}destroy(){window.removeEventListener("resize",this._onResize),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),this._resizeTimeout&&window.clearTimeout(this._resizeTimeout),this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}}C.NON_US_RESIDENT_VALUE=E,C.SelectionEnum=b,C.default=X,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementOptions, Communication, QualifyingReason, PayoutScheduleItem, Quote, SelectionEnum } from "./types.js";
|
|
2
|
-
import { NON_US_RESIDENT_VALUE, US_STATES } from './constants.js';
|
|
3
|
-
export { NON_US_RESIDENT_VALUE, US_STATES };
|
|
2
|
+
import { NON_US_RESIDENT_ERROR_TEXT, NON_US_RESIDENT_VALUE, US_STATES } from './constants.js';
|
|
3
|
+
export { NON_US_RESIDENT_ERROR_TEXT, NON_US_RESIDENT_VALUE, US_STATES };
|
|
4
4
|
export declare function makeEl<K extends keyof HTMLElementTagNameMap>(tag: K, { text, className, parent, innerHTML, href, target }?: ElementOptions): HTMLElementTagNameMap[K];
|
|
5
5
|
export declare function renderHeader(container: HTMLElement, { name, description }: Pick<Communication, "name" | "description">): void;
|
|
6
6
|
export declare function renderBenefits(container: HTMLElement, bullets?: string[]): void;
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC;AAExE,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAC1D,GAAG,EAAE,CAAC,EACN,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE,cAAmB,GACxE,qBAAqB,CAAC,CAAC,CAAC,CAS1B;AAGD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,WAAW,EACtB,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAC,GACjE,IAAI,CAWN;AAGD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,WAAW,EACtB,OAAO,GAAE,MAAM,EAAO,GACrB,IAAI,CAcN;AAGD,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,WAAW,EACtB,iBAAiB,GAAE,gBAAgB,EAAO,GACzC,IAAI,CA0EN;AAGD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EACtB,YAAY,GAAE,MAAM,EAAO,EAC3B,mBAAmB,CAAC,EAAE,MAAM,GAC3B,IAAI,CAiHN;AA6BD,wBAAgB,WAAW,CACzB,SAAS,EAAE,WAAW,EACtB,QAAQ,GAAE,kBAAkB,EAAO,EACnC,YAAY,GAAE,MAAc,GAC3B,IAAI,CA2BN;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,WAAW,EACtB,YAAY,CAAC,EAAE,MAAM,GACpB,iBAAiB,CA6CnB;AAGD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,aAAa,EACxB,aAAa,EAAE,aAAa,EAC5B,QAAQ,UAAQ,GACf,WAAW,CA4Cb;AAGD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,KAAK,GACX,WAAW,GAAG,IAAI,CAuBpB;AAGD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,KAAK,EACZ,YAAY,GAAE,cAAc,GAAG,WAA4B,GAC1D,WAAW,CAwEb"}
|