@getspot/spot-widget 4.2.0 → 4.3.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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [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
+
3
+
4
+ ### Features
5
+
6
+ * **core:** publish 13 currencies for Competition Corner [ST-5242] ([c700cc6](https://gitlab.com/getspot/spot-widget/commit/c700cc6557c66a4b9d24e799fdbe3b9f24f342eb))
7
+
1
8
  # [4.2.0](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@4.1.1...@getspot/spot-widget@4.2.0) (2026-05-12)
2
9
 
3
10
 
package/README.md CHANGED
@@ -98,7 +98,7 @@ const widget = new SpotWidget(options);
98
98
  {
99
99
  startDate: string; // ISO 8601 date
100
100
  endDate: string; // ISO 8601 date
101
- currencyCode: 'USD' | 'CAD' | 'AUD' | 'NZD' | 'EUR' | 'MXN' | 'AED' | 'GBP' | 'MAD' | 'SAR';
101
+ currencyCode: 'USD' | 'CAD' | 'AUD' | 'NZD' | 'EUR' | 'MXN' | 'AED' | 'GBP' | 'MAD' | 'SAR' | 'BGN' | 'BRL' | 'CHF' | 'DKK' | 'INR' | 'JPY' | 'MYR' | 'NOK' | 'PLN' | 'SEK' | 'SGD' | 'THB' | 'ZAR';
102
102
  eventType: string; // Event description
103
103
  productType: 'Pass' | 'Trip' | 'Registration';
104
104
  productDuration: 'Daily' | 'Seasonal' | 'Trip' | 'Event';
@@ -116,7 +116,7 @@ const widget = new SpotWidget(options);
116
116
  {
117
117
  cartId: string;
118
118
  cartName: string;
119
- currencyCode: 'USD' | 'CAD' | 'AUD' | 'NZD' | 'EUR' | 'MXN' | 'AED' | 'GBP' | 'MAD' | 'SAR';
119
+ currencyCode: 'USD' | 'CAD' | 'AUD' | 'NZD' | 'EUR' | 'MXN' | 'AED' | 'GBP' | 'MAD' | 'SAR' | 'BGN' | 'BRL' | 'CHF' | 'DKK' | 'INR' | 'JPY' | 'MYR' | 'NOK' | 'PLN' | 'SEK' | 'SGD' | 'THB' | 'ZAR';
120
120
  items: Array<{
121
121
  // All single product fields except cartId and currencyCode
122
122
  cartItemId?: string; // Optional item identifier
@@ -370,7 +370,30 @@ export interface QuoteItem {
370
370
  participantDescription?: string;
371
371
  eventType: string;
372
372
  eventId?: string;
373
- currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR";
373
+ currencyCode:
374
+ | "USD"
375
+ | "CAD"
376
+ | "AUD"
377
+ | "NZD"
378
+ | "EUR"
379
+ | "MXN"
380
+ | "AED"
381
+ | "GBP"
382
+ | "MAD"
383
+ | "SAR"
384
+ | "BGN"
385
+ | "BRL"
386
+ | "CHF"
387
+ | "DKK"
388
+ | "INR"
389
+ | "JPY"
390
+ | "MYR"
391
+ | "NOK"
392
+ | "PLN"
393
+ | "SEK"
394
+ | "SGD"
395
+ | "THB"
396
+ | "ZAR";
374
397
  startDate: string;
375
398
  endDate: string;
376
399
  partnerRiskEnd?: Date;
@@ -390,7 +413,30 @@ export interface QuoteItem {
390
413
  export interface BatchQuoteRequest {
391
414
  cartId: string;
392
415
  cartName: string;
393
- currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR";
416
+ currencyCode:
417
+ | "USD"
418
+ | "CAD"
419
+ | "AUD"
420
+ | "NZD"
421
+ | "EUR"
422
+ | "MXN"
423
+ | "AED"
424
+ | "GBP"
425
+ | "MAD"
426
+ | "SAR"
427
+ | "BGN"
428
+ | "BRL"
429
+ | "CHF"
430
+ | "DKK"
431
+ | "INR"
432
+ | "JPY"
433
+ | "MYR"
434
+ | "NOK"
435
+ | "PLN"
436
+ | "SEK"
437
+ | "SGD"
438
+ | "THB"
439
+ | "ZAR";
394
440
  metadata?: QuoteMetadata;
395
441
  isPartialPayment?: boolean;
396
442
  roundTo?: number;
package/dist/index.es.js CHANGED
@@ -17,7 +17,7 @@ async function N(c, t, r, s) {
17
17
  throw i instanceof Error ? i : new Error("Unknown error occurred while fetching quote");
18
18
  }
19
19
  }
20
- async function L(c, t, r) {
20
+ async function z(c, t, r) {
21
21
  try {
22
22
  const s = c.replace("/quote", "/quote/batch"), i = await fetch(s, {
23
23
  method: "POST",
@@ -36,7 +36,7 @@ async function L(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 I(c, t, r, s) {
39
+ async function S(c, t, r, s) {
40
40
  var i;
41
41
  try {
42
42
  const a = {
@@ -48,12 +48,12 @@ async function I(c, t, r, s) {
48
48
  ...m,
49
49
  cartItemId: m.cartItemId || `item-${f + 1}`
50
50
  }))
51
- }, e = await L(c, t, a);
51
+ }, e = await z(c, t, a);
52
52
  if (e.status !== "QUOTES_AVAILABLE" && e.status !== "QUOTE_AVAILABLE")
53
53
  return { status: "NO_MATCHING_QUOTE" };
54
54
  const o = e.quotes.map((m) => {
55
55
  const f = r.items.find(
56
- (g, h) => (g.cartItemId || `item-${h + 1}`) === m.cartItemId
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
  }), l = Math.round((e.totalSpotPrice || e.spotPrice || 0) * 100) / 100;
@@ -84,7 +84,7 @@ async function I(c, t, r, s) {
84
84
  throw a instanceof Error ? a : new Error("Unknown error occurred while fetching multiple quotes");
85
85
  }
86
86
  }
87
- const k = "non-us-resident", z = [
87
+ const q = "non-us-resident", A = [
88
88
  { value: "AL", label: "Alabama" },
89
89
  { value: "AK", label: "Alaska" },
90
90
  { value: "AS", label: "American Samoa" },
@@ -141,7 +141,31 @@ const k = "non-us-resident", z = [
141
141
  { value: "WV", label: "West Virginia" },
142
142
  { value: "WI", label: "Wisconsin" },
143
143
  { value: "WY", label: "Wyoming" }
144
- ], O = new Set(z.map((c) => c.value)), P = {
144
+ ], O = new Set(A.map((c) => c.value)), I = [
145
+ "USD",
146
+ "CAD",
147
+ "AUD",
148
+ "NZD",
149
+ "EUR",
150
+ "MXN",
151
+ "AED",
152
+ "GBP",
153
+ "MAD",
154
+ "SAR",
155
+ "BGN",
156
+ "BRL",
157
+ "CHF",
158
+ "DKK",
159
+ "INR",
160
+ "JPY",
161
+ "MYR",
162
+ "NOK",
163
+ "PLN",
164
+ "SEK",
165
+ "SGD",
166
+ "THB",
167
+ "ZAR"
168
+ ], R = {
145
169
  sandbox: "https://api.sandbox.getspot.com/v1/quote",
146
170
  production: "https://api.getspot.com/v1/quote",
147
171
  local: "http://localhost:3999/api/v1/quote"
@@ -160,7 +184,7 @@ function M(c) {
160
184
  } = t;
161
185
  if (!o || typeof o != "string")
162
186
  throw new Error("Invalid or missing partnerId in apiConfig");
163
- if (!(l || P[e]))
187
+ if (!(l || R[e]))
164
188
  throw new Error(`Invalid environment in apiConfig: ${e}`);
165
189
  if (!r || typeof r != "object" && !Array.isArray(r))
166
190
  throw new Error("quoteRequestData must be a non-null object or array");
@@ -176,29 +200,29 @@ function M(c) {
176
200
  "cartId",
177
201
  "productName"
178
202
  ];
179
- function g(p, u = null) {
203
+ function v(p, u = null) {
180
204
  const d = u !== null ? `quoteRequestData[${u}]` : "quoteRequestData";
181
- f.forEach((v) => {
182
- if (!Object.prototype.hasOwnProperty.call(p, v) || p[v] === void 0 || p[v] === null)
183
- throw new Error(`Missing required ${d} field: '${v}'`);
205
+ f.forEach((g) => {
206
+ if (!Object.prototype.hasOwnProperty.call(p, g) || p[g] === void 0 || p[g] === null)
207
+ throw new Error(`Missing required ${d} field: '${g}'`);
184
208
  });
185
- const y = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
186
- if (!y.test(p.startDate))
209
+ const w = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
210
+ if (!w.test(p.startDate))
187
211
  throw new Error(`${d}.startDate must be a valid ISO8601 string`);
188
- if (!y.test(p.endDate))
212
+ if (!w.test(p.endDate))
189
213
  throw new Error(`${d}.endDate must be a valid ISO8601 string`);
190
214
  if (typeof p.currencyCode != "string")
191
215
  throw new Error(`${d}.currencyCode must be a string`);
192
- if (!["USD", "CAD", "AUD", "NZD", "EUR", "MXN", "AED", "GBP", "MAD", "SAR"].includes(p.currencyCode))
216
+ if (!I.includes(p.currencyCode))
193
217
  throw new Error(`Invalid ${d}.currencyCode: ${p.currencyCode}`);
194
218
  if (typeof p.eventType != "string")
195
219
  throw new Error(`${d}.eventType must be a string`);
196
220
  if (typeof p.productType != "string")
197
221
  throw new Error(`${d}.productType must be a string`);
198
- const q = ["Pass", "Trip", "Registration"];
199
- if (!q.includes(p.productType))
222
+ const y = ["Pass", "Trip", "Registration"];
223
+ if (!y.includes(p.productType))
200
224
  throw new Error(
201
- `${d}.productType must be one of ${q.join(", ")}`
225
+ `${d}.productType must be one of ${y.join(", ")}`
202
226
  );
203
227
  if (typeof p.productDuration != "string")
204
228
  throw new Error(`${d}.productDuration must be a string`);
@@ -217,16 +241,16 @@ function M(c) {
217
241
  throw new Error(`${d}.productName must be a string`);
218
242
  }
219
243
  if ("items" in r) {
220
- const p = r, { cartId: u, cartName: d, currencyCode: y, items: w } = p;
244
+ const p = r, { cartId: u, cartName: d, currencyCode: w, items: y } = p;
221
245
  if (!u || typeof u != "string")
222
246
  throw new Error("quoteRequestData.cartId must be a string");
223
247
  if (!d || typeof d != "string")
224
248
  throw new Error("quoteRequestData.cartName must be a string");
225
- if (!y || typeof y != "string")
249
+ if (!w || typeof w != "string")
226
250
  throw new Error("quoteRequestData.currencyCode must be a string");
227
- if (!["USD", "CAD", "AUD", "NZD", "EUR", "MXN", "AED", "GBP", "MAD", "SAR"].includes(y))
228
- throw new Error(`Invalid quoteRequestData.currencyCode: ${y}`);
229
- if (!Array.isArray(w) || w.length === 0)
251
+ if (!I.includes(w))
252
+ throw new Error(`Invalid quoteRequestData.currencyCode: ${w}`);
253
+ if (!Array.isArray(y) || y.length === 0)
230
254
  throw new Error("quoteRequestData.items must be a non-empty array");
231
255
  const C = [
232
256
  "startDate",
@@ -238,36 +262,36 @@ function M(c) {
238
262
  "productId",
239
263
  "productName"
240
264
  ];
241
- w.forEach((v, x) => {
242
- if (!v || typeof v != "object")
243
- throw new Error(`quoteRequestData.items[${x}] must be a non-null object`);
244
- const _ = `quoteRequestData.items[${x}]`;
265
+ y.forEach((g, k) => {
266
+ if (!g || typeof g != "object")
267
+ throw new Error(`quoteRequestData.items[${k}] must be a non-null object`);
268
+ const _ = `quoteRequestData.items[${k}]`;
245
269
  C.forEach((E) => {
246
- if (!Object.prototype.hasOwnProperty.call(v, E) || v[E] === void 0 || v[E] === null)
270
+ if (!Object.prototype.hasOwnProperty.call(g, E) || g[E] === void 0 || g[E] === null)
247
271
  throw new Error(`Missing required ${_} field: '${E}'`);
248
272
  });
249
- const D = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
250
- if (!D.test(v.startDate))
273
+ const x = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
274
+ if (!x.test(g.startDate))
251
275
  throw new Error(`${_}.startDate must be a valid ISO8601 string`);
252
- if (!D.test(v.endDate))
276
+ if (!x.test(g.endDate))
253
277
  throw new Error(`${_}.endDate must be a valid ISO8601 string`);
254
- if (typeof v.eventType != "string")
278
+ if (typeof g.eventType != "string")
255
279
  throw new Error(`${_}.eventType must be a string`);
256
- if (typeof v.productType != "string")
280
+ if (typeof g.productType != "string")
257
281
  throw new Error(`${_}.productType must be a string`);
258
- const T = ["Pass", "Trip", "Registration"];
259
- if (!T.includes(v.productType))
260
- throw new Error(`${_}.productType must be one of ${T.join(", ")}`);
261
- if (typeof v.productDuration != "string")
282
+ const D = ["Pass", "Trip", "Registration"];
283
+ if (!D.includes(g.productType))
284
+ throw new Error(`${_}.productType must be one of ${D.join(", ")}`);
285
+ if (typeof g.productDuration != "string")
262
286
  throw new Error(`${_}.productDuration must be a string`);
263
- const S = ["Daily", "Seasonal", "Trip", "Event"];
264
- if (!S.includes(v.productDuration))
265
- throw new Error(`${_}.productDuration must be one of ${S.join(", ")}`);
266
- if (typeof v.productPrice != "number" || isNaN(v.productPrice))
287
+ const T = ["Daily", "Seasonal", "Trip", "Event"];
288
+ if (!T.includes(g.productDuration))
289
+ throw new Error(`${_}.productDuration must be one of ${T.join(", ")}`);
290
+ if (typeof g.productPrice != "number" || isNaN(g.productPrice))
267
291
  throw new Error(`${_}.productPrice must be a valid number`);
268
- if (typeof v.productId != "string")
292
+ if (typeof g.productId != "string")
269
293
  throw new Error(`${_}.productId must be a string`);
270
- if (typeof v.productName != "string")
294
+ if (typeof g.productName != "string")
271
295
  throw new Error(`${_}.productName must be a string`);
272
296
  });
273
297
  } else if (Array.isArray(r)) {
@@ -276,10 +300,10 @@ function M(c) {
276
300
  r.forEach((p, u) => {
277
301
  if (!p || typeof p != "object")
278
302
  throw new Error(`quoteRequestData[${u}] must be a non-null object`);
279
- g(p, u);
303
+ v(p, u);
280
304
  });
281
305
  } else
282
- g(r);
306
+ v(r);
283
307
  if ([
284
308
  "onOptIn",
285
309
  "onOptOut",
@@ -304,7 +328,7 @@ function n(c, { text: t, className: r, parent: s, innerHTML: i, href: a, target:
304
328
  const o = document.createElement(c);
305
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;
306
330
  }
307
- function R(c, { name: t, description: r }) {
331
+ function P(c, { name: t, description: r }) {
308
332
  n("div", {
309
333
  className: "spot-header__title",
310
334
  text: t,
@@ -360,14 +384,14 @@ function V(c, t = []) {
360
384
  e = "./assets/";
361
385
  }
362
386
  s.forEach((o) => {
363
- var g, h, p;
387
+ var v, h, p;
364
388
  const l = n("div", {
365
389
  className: "spot-qualifying-reasons__item",
366
390
  parent: i
367
391
  }), m = n("div", {
368
392
  className: "spot-qualifying-reasons__icon-wrapper",
369
393
  parent: l
370
- }), f = a[((g = o.benefitType) == null ? void 0 : g.name) || ""] || a[o.name || ""];
394
+ }), f = a[((v = o.benefitType) == null ? void 0 : v.name) || ""] || a[o.name || ""];
371
395
  if (f) {
372
396
  const u = n("img", {
373
397
  parent: m
@@ -395,8 +419,8 @@ function Q(c, t = [], r) {
395
419
  displayText: d > 1 ? `${d} x ${u}` : u
396
420
  })
397
421
  ).sort((u, d) => {
398
- const y = u.item.charAt(0), w = d.item.charAt(0), q = /[a-zA-Z]/.test(y), C = /[a-zA-Z]/.test(w);
399
- return !q && C ? -1 : q && !C ? 1 : u.item.localeCompare(d.item, void 0, { sensitivity: "base" });
422
+ const w = u.item.charAt(0), y = d.item.charAt(0), C = /[a-zA-Z]/.test(w), g = /[a-zA-Z]/.test(y);
423
+ return !C && g ? -1 : C && !g ? 1 : u.item.localeCompare(d.item, void 0, { sensitivity: "base" });
400
424
  }), e = n("div", {
401
425
  className: "spot-covered-items__container",
402
426
  parent: c
@@ -425,21 +449,21 @@ function Q(c, t = [], r) {
425
449
  className: "spot-covered-items__arrow",
426
450
  innerHTML: "▼",
427
451
  parent: m
428
- }), g = n("div", {
452
+ }), v = n("div", {
429
453
  className: "spot-covered-items__content",
430
454
  parent: e
431
455
  }), h = n("ul", {
432
456
  className: "spot-covered-items__list",
433
- parent: g
457
+ parent: v
434
458
  });
435
459
  a.forEach(({ displayText: u }) => {
436
460
  const d = n("li", { parent: h });
437
461
  n("span", { text: u, parent: d });
438
462
  });
439
463
  let p = !1;
440
- g.style.display = "none", l.addEventListener("click", (u) => {
441
- u.stopPropagation(), p = !p, g.style.display = p ? "block" : "none", f.innerHTML = p ? "▲" : "▼", l.setAttribute("aria-expanded", p.toString());
442
- }), l.setAttribute("aria-expanded", "false"), l.setAttribute("aria-controls", "covered-items-list"), g.setAttribute("id", "covered-items-list");
464
+ v.style.display = "none", l.addEventListener("click", (u) => {
465
+ u.stopPropagation(), p = !p, v.style.display = p ? "block" : "none", f.innerHTML = p ? "▲" : "▼", l.setAttribute("aria-expanded", p.toString());
466
+ }), l.setAttribute("aria-expanded", "false"), l.setAttribute("aria-controls", "covered-items-list"), v.setAttribute("id", "covered-items-list");
443
467
  }
444
468
  const U = {
445
469
  USD: "$",
@@ -451,7 +475,20 @@ const U = {
451
475
  GBP: "GBP £",
452
476
  AED: "AED ",
453
477
  MAD: "MAD ",
454
- SAR: "SAR "
478
+ SAR: "SAR ",
479
+ BGN: "BGN лв",
480
+ BRL: "BRL R$",
481
+ CHF: "CHF ",
482
+ DKK: "DKK kr",
483
+ INR: "INR ₹",
484
+ JPY: "JPY ¥",
485
+ MYR: "MYR RM",
486
+ NOK: "NOK kr",
487
+ PLN: "PLN zł",
488
+ SEK: "SEK kr",
489
+ SGD: "SGD $",
490
+ THB: "THB ฿",
491
+ ZAR: "ZAR R"
455
492
  };
456
493
  function Z(c, t = [], r = "USD") {
457
494
  const s = U[r] ?? `${r} `, i = n("div", {
@@ -463,10 +500,10 @@ function Z(c, t = [], r = "USD") {
463
500
  }), e = n("thead", { parent: a }), o = n("tr", { parent: e });
464
501
  n("th", { text: "When you cancel", parent: o }), n("th", { text: "You will receive", parent: o });
465
502
  const l = n("tbody", { parent: a });
466
- t.forEach(({ text: m, percent: f, amount: g }) => {
503
+ t.forEach(({ text: m, percent: f, amount: v }) => {
467
504
  const h = n("tr", { parent: l });
468
505
  n("td", { text: m, parent: h });
469
- const p = f === "Not eligible for refund" ? "Not eligible for a refund" : `${s}${g} refund`;
506
+ const p = f === "Not eligible for refund" ? "Not eligible for a refund" : `${s}${v} refund`;
470
507
  n("td", { text: p, parent: h });
471
508
  });
472
509
  }
@@ -489,7 +526,7 @@ function B(c, t) {
489
526
  text: "Select a state...",
490
527
  parent: s
491
528
  });
492
- i.value = "", i.selected = !t, z.forEach(({ value: e, label: o }) => {
529
+ i.value = "", i.selected = !t, A.forEach(({ value: e, label: o }) => {
493
530
  const l = n("option", { text: o, parent: s });
494
531
  l.value = e, e === t && (l.selected = !0);
495
532
  });
@@ -497,7 +534,7 @@ function B(c, t) {
497
534
  text: "Not a US Resident",
498
535
  parent: s
499
536
  });
500
- return a.value = k, t === k && (a.selected = !0), s;
537
+ return a.value = q, t === q && (a.selected = !0), s;
501
538
  }
502
539
  function j(c, t, r, s = !1) {
503
540
  const i = n("div", {
@@ -606,7 +643,7 @@ function Y(c) {
606
643
  t.textContent = c, document.head.appendChild(t);
607
644
  }
608
645
  Y(W);
609
- const A = {
646
+ const L = {
610
647
  sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
611
648
  production: "https://api.getspot.com/api/v1/quote",
612
649
  local: "http://localhost:3999/api/v1/quote"
@@ -633,8 +670,8 @@ class G {
633
670
  if (this.options.useMockData && this.options.mockData)
634
671
  e = this.options.mockData;
635
672
  else {
636
- const { environment: o, partnerId: l } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || A[o];
637
- e = "items" in this.options.quoteRequestData ? await I(
673
+ const { environment: o, partnerId: l } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || L[o];
674
+ e = "items" in this.options.quoteRequestData ? await S(
638
675
  f,
639
676
  l,
640
677
  this.options.quoteRequestData,
@@ -665,8 +702,8 @@ class G {
665
702
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
666
703
  const l = this.options.quoteRequestData;
667
704
  o.batchQuoteDetails = this.quote.originalQuotes.map((m) => {
668
- var g;
669
- const f = (g = l.items) == null ? void 0 : g.find(
705
+ var v;
706
+ const f = (v = l.items) == null ? void 0 : v.find(
670
707
  (h) => (h.cartItemId || `item-${l.items.indexOf(h) + 1}`) === m.cartItemId
671
708
  );
672
709
  return {
@@ -698,7 +735,7 @@ class G {
698
735
  this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([e, o]) => {
699
736
  const l = `--${e}`;
700
737
  this.container.style.setProperty(l, o);
701
- }), R(this.container, this.quote.communication);
738
+ }), P(this.container, this.quote.communication);
702
739
  const t = document.createElement("div");
703
740
  if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? V(t, this.quote.qualifyingReasons) : $(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
704
741
  const e = this._getTotalItemsInRequest();
@@ -778,11 +815,11 @@ class G {
778
815
  return r.productType === "Pass" || r.productType === "Trip";
779
816
  }
780
817
  _validState() {
781
- if (this._isPassOrTrip() && !(!this.currentState || this.currentState === k))
818
+ if (this._isPassOrTrip() && !(!this.currentState || this.currentState === q))
782
819
  return this.currentState;
783
820
  }
784
821
  _isQuotingAvailable() {
785
- return !this._isPassOrTrip() || this.options.state ? !0 : !!this.currentState && this.currentState !== k;
822
+ return !this._isPassOrTrip() || this.options.state ? !0 : !!this.currentState && this.currentState !== q;
786
823
  }
787
824
  _setRadiosDisabled(t) {
788
825
  var i, a, e;
@@ -806,7 +843,7 @@ class G {
806
843
  ), s = t.querySelectorAll(".spot-selection__option");
807
844
  r.forEach((i) => {
808
845
  i.addEventListener("change", (a) => {
809
- var l, m, f, g;
846
+ var l, m, f, v;
810
847
  const e = a.target, o = e.value;
811
848
  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 && H(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
812
849
  const h = {
@@ -819,9 +856,9 @@ class G {
819
856
  const p = this.options.quoteRequestData;
820
857
  h.batchQuoteDetails = this.quote.originalQuotes.map(
821
858
  (u) => {
822
- var y;
823
- const d = (y = p.items) == null ? void 0 : y.find(
824
- (w) => (w.cartItemId || `item-${p.items.indexOf(w) + 1}`) === u.cartItemId
859
+ var w;
860
+ const d = (w = p.items) == null ? void 0 : w.find(
861
+ (y) => (y.cartItemId || `item-${p.items.indexOf(y) + 1}`) === u.cartItemId
825
862
  );
826
863
  return {
827
864
  quoteId: u.id,
@@ -833,7 +870,7 @@ class G {
833
870
  }
834
871
  this.options.callbacks.onOptIn(h);
835
872
  }
836
- if (o === b.NO && ((g = this.options.callbacks) != null && g.onOptOut)) {
873
+ if (o === b.NO && ((v = this.options.callbacks) != null && v.onOptOut)) {
837
874
  const h = {
838
875
  status: "QUOTE_DECLINED",
839
876
  quoteId: this.quote.id,
@@ -843,9 +880,9 @@ class G {
843
880
  const p = this.options.quoteRequestData;
844
881
  h.batchQuoteDetails = this.quote.originalQuotes.map(
845
882
  (u) => {
846
- var y;
847
- const d = (y = p.items) == null ? void 0 : y.find(
848
- (w) => (w.cartItemId || `item-${p.items.indexOf(w) + 1}`) === u.cartItemId
883
+ var w;
884
+ const d = (w = p.items) == null ? void 0 : w.find(
885
+ (y) => (y.cartItemId || `item-${p.items.indexOf(y) + 1}`) === u.cartItemId
849
886
  );
850
887
  return {
851
888
  quoteId: u.id,
@@ -889,7 +926,7 @@ class G {
889
926
  quoteRequestData: t
890
927
  };
891
928
  M(e);
892
- const { environment: o, partnerId: l, customEndpoint: m } = this.options.apiConfig, f = m || A[o], h = "items" in e.quoteRequestData ? await I(
929
+ const { environment: o, partnerId: l, customEndpoint: m } = this.options.apiConfig, f = m || L[o], h = "items" in e.quoteRequestData ? await S(
893
930
  f,
894
931
  l,
895
932
  e.quoteRequestData,
@@ -950,7 +987,7 @@ class G {
950
987
  }
951
988
  }
952
989
  export {
953
- k as NON_US_RESIDENT_VALUE,
990
+ q as NON_US_RESIDENT_VALUE,
954
991
  b as SelectionEnum,
955
992
  G as default
956
993
  };
package/dist/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(C,q){typeof exports=="object"&&typeof module<"u"?q(exports):typeof define=="function"&&define.amd?define(["exports"],q):(C=typeof globalThis<"u"?globalThis:C||self,q(C.SpotWidget={}))})(this,function(C){"use strict";async function q(c,t,r,s){try{const i=s?{...r,state:s}:r,a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(i)}),e=await a.json();if(!a.ok){const o=new Error((e==null?void 0:e.message)||"Failed to fetch quote");throw o.status=a.status,o.responseBody=e,o}return e}catch(i){throw i instanceof Error?i:new Error("Unknown error occurred while fetching quote")}}async function L(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)}),a=await i.json();if(!i.ok){const e=new Error((a==null?void 0:a.message)||"Failed to fetch batch quote");throw e.status=i.status,e.responseBody=a,e}return a}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching batch quote")}}async function T(c,t,r,s){var i;try{const a={...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 L(c,t,a);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((g,h)=>(g.cartItemId||`item-${h+1}`)===m.cartItemId);return f?f.participantDescription?`${f.productName} - ${f.participantDescription}`:f.productName:`Item ${m.id}`}),l=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:l,currencyCode:e.currencyCode||"",communication:{...e.communication,yesOptionText:e.communication.yesOptionText.replace(String(e.totalSpotPrice),String(l))},payoutSchedule:e.payoutSchedule.map(m=>({...m,amount:m.amount!==void 0?m.amount:0})),coveredItems:o,originalQuotes:e.quotes||(e.data?[e.data]:[])},spotPrice:l,coveredItems:o}}catch(a){throw a instanceof Error?a:new Error("Unknown error occurred while fetching multiple quotes")}}const x="non-us-resident",S=[{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(S.map(c=>c.value)),R={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:a}=c,{environment:e="sandbox",partnerId:o,customEndpoint:l}=t;if(!o||typeof o!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(l||R[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 g(p,u=null){const d=u!==null?`quoteRequestData[${u}]`:"quoteRequestData";f.forEach(v=>{if(!Object.prototype.hasOwnProperty.call(p,v)||p[v]===void 0||p[v]===null)throw new Error(`Missing required ${d} field: '${v}'`)});const y=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!y.test(p.startDate))throw new Error(`${d}.startDate must be a valid ISO8601 string`);if(!y.test(p.endDate))throw new Error(`${d}.endDate must be a valid ISO8601 string`);if(typeof p.currencyCode!="string")throw new Error(`${d}.currencyCode must be a string`);if(!["USD","CAD","AUD","NZD","EUR","MXN","AED","GBP","MAD","SAR"].includes(p.currencyCode))throw new Error(`Invalid ${d}.currencyCode: ${p.currencyCode}`);if(typeof p.eventType!="string")throw new Error(`${d}.eventType must be a string`);if(typeof p.productType!="string")throw new Error(`${d}.productType must be a string`);const k=["Pass","Trip","Registration"];if(!k.includes(p.productType))throw new Error(`${d}.productType must be one of ${k.join(", ")}`);if(typeof p.productDuration!="string")throw new Error(`${d}.productDuration must be a string`);const E=["Daily","Seasonal","Trip","Event"];if(!E.includes(p.productDuration))throw new Error(`${d}.productDuration must be one of ${E.join(", ")}`);if(typeof p.productPrice!="number"||isNaN(p.productPrice))throw new Error(`${d}.productPrice must be a valid number`);if(typeof p.productId!="string")throw new Error(`${d}.productId must be a string`);if(typeof p.cartId!="string")throw new Error(`${d}.cartId must be a string`);if(typeof p.productName!="string")throw new Error(`${d}.productName must be a string`)}if("items"in r){const p=r,{cartId:u,cartName:d,currencyCode:y,items:w}=p;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(!y||typeof y!="string")throw new Error("quoteRequestData.currencyCode must be a string");if(!["USD","CAD","AUD","NZD","EUR","MXN","AED","GBP","MAD","SAR"].includes(y))throw new Error(`Invalid quoteRequestData.currencyCode: ${y}`);if(!Array.isArray(w)||w.length===0)throw new Error("quoteRequestData.items must be a non-empty array");const E=["startDate","endDate","eventType","productType","productDuration","productPrice","productId","productName"];w.forEach((v,A)=>{if(!v||typeof v!="object")throw new Error(`quoteRequestData.items[${A}] must be a non-null object`);const _=`quoteRequestData.items[${A}]`;E.forEach(D=>{if(!Object.prototype.hasOwnProperty.call(v,D)||v[D]===void 0||v[D]===null)throw new Error(`Missing required ${_} field: '${D}'`)});const H=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!H.test(v.startDate))throw new Error(`${_}.startDate must be a valid ISO8601 string`);if(!H.test(v.endDate))throw new Error(`${_}.endDate must be a valid ISO8601 string`);if(typeof v.eventType!="string")throw new Error(`${_}.eventType must be a string`);if(typeof v.productType!="string")throw new Error(`${_}.productType must be a string`);const z=["Pass","Trip","Registration"];if(!z.includes(v.productType))throw new Error(`${_}.productType must be one of ${z.join(", ")}`);if(typeof v.productDuration!="string")throw new Error(`${_}.productDuration must be a string`);const O=["Daily","Seasonal","Trip","Event"];if(!O.includes(v.productDuration))throw new Error(`${_}.productDuration must be one of ${O.join(", ")}`);if(typeof v.productPrice!="number"||isNaN(v.productPrice))throw new Error(`${_}.productPrice must be a valid number`);if(typeof v.productId!="string")throw new Error(`${_}.productId must be a string`);if(typeof v.productName!="string")throw new Error(`${_}.productName must be a string`)})}else if(Array.isArray(r)){if(r.length===0)throw new Error("quoteRequestData array cannot be empty");r.forEach((p,u)=>{if(!p||typeof p!="object")throw new Error(`quoteRequestData[${u}] must be a non-null object`);g(p,u)})}else g(r);if(["onOptIn","onOptOut","onQuoteRetrieved","onError","noMatchingQuote"].forEach(p=>{const u=s[p];if(u&&typeof u!="function")throw new Error(`Callback '${p}' must be a function.`)}),typeof i=="string"&&!document.querySelector(i))throw new Error(`Invalid location selector: '${i}'`);if(a&&typeof a!="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 n(c,{text:t,className:r,parent:s,innerHTML:i,href:a,target:e}={}){const o=document.createElement(c);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}function $(c,{name:t,description:r}){n("div",{className:"spot-header__title",text:t,parent:c}),n("div",{className:"spot-header__description",text:r,parent:c})}function V(c,t=[]){const r=n("ul",{className:"spot-benefits__list",parent:c});t.forEach(s=>{const i=n("li",{parent:r});i.innerHTML=`
1
+ (function(C,q){typeof exports=="object"&&typeof module<"u"?q(exports):typeof define=="function"&&define.amd?define(["exports"],q):(C=typeof globalThis<"u"?globalThis:C||self,q(C.SpotWidget={}))})(this,function(C){"use strict";async function q(c,t,r,s){try{const i=s?{...r,state:s}:r,a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(i)}),e=await a.json();if(!a.ok){const o=new Error((e==null?void 0:e.message)||"Failed to fetch quote");throw o.status=a.status,o.responseBody=e,o}return e}catch(i){throw i instanceof Error?i:new Error("Unknown error occurred while fetching quote")}}async function R(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)}),a=await i.json();if(!i.ok){const e=new Error((a==null?void 0:a.message)||"Failed to fetch batch quote");throw e.status=i.status,e.responseBody=a,e}return a}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching batch quote")}}async function D(c,t,r,s){var i;try{const a={...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 R(c,t,a);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}`}),l=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:l,currencyCode:e.currencyCode||"",communication:{...e.communication,yesOptionText:e.communication.yesOptionText.replace(String(e.totalSpotPrice),String(l))},payoutSchedule:e.payoutSchedule.map(m=>({...m,amount:m.amount!==void 0?m.amount:0})),coveredItems:o,originalQuotes:e.quotes||(e.data?[e.data]:[])},spotPrice:l,coveredItems:o}}catch(a){throw a instanceof Error?a:new Error("Unknown error occurred while fetching multiple quotes")}}const k="non-us-resident",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"}],z=new Set(T.map(c=>c.value)),S=["USD","CAD","AUD","NZD","EUR","MXN","AED","GBP","MAD","SAR","BGN","BRL","CHF","DKK","INR","JPY","MYR","NOK","PLN","SEK","SGD","THB","ZAR"],P={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:a}=c,{environment:e="sandbox",partnerId:o,customEndpoint:l}=t;if(!o||typeof o!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(l||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(p,u=null){const d=u!==null?`quoteRequestData[${u}]`:"quoteRequestData";f.forEach(g=>{if(!Object.prototype.hasOwnProperty.call(p,g)||p[g]===void 0||p[g]===null)throw new Error(`Missing required ${d} field: '${g}'`)});const w=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!w.test(p.startDate))throw new Error(`${d}.startDate must be a valid ISO8601 string`);if(!w.test(p.endDate))throw new Error(`${d}.endDate must be a valid ISO8601 string`);if(typeof p.currencyCode!="string")throw new Error(`${d}.currencyCode must be a string`);if(!S.includes(p.currencyCode))throw new Error(`Invalid ${d}.currencyCode: ${p.currencyCode}`);if(typeof p.eventType!="string")throw new Error(`${d}.eventType must be a string`);if(typeof p.productType!="string")throw new Error(`${d}.productType must be a string`);const y=["Pass","Trip","Registration"];if(!y.includes(p.productType))throw new Error(`${d}.productType must be one of ${y.join(", ")}`);if(typeof p.productDuration!="string")throw new Error(`${d}.productDuration must be a string`);const E=["Daily","Seasonal","Trip","Event"];if(!E.includes(p.productDuration))throw new Error(`${d}.productDuration must be one of ${E.join(", ")}`);if(typeof p.productPrice!="number"||isNaN(p.productPrice))throw new Error(`${d}.productPrice must be a valid number`);if(typeof p.productId!="string")throw new Error(`${d}.productId must be a string`);if(typeof p.cartId!="string")throw new Error(`${d}.cartId must be a string`);if(typeof p.productName!="string")throw new Error(`${d}.productName must be a string`)}if("items"in r){const p=r,{cartId:u,cartName:d,currencyCode:w,items:y}=p;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(!w||typeof w!="string")throw new Error("quoteRequestData.currencyCode must be a string");if(!S.includes(w))throw new Error(`Invalid quoteRequestData.currencyCode: ${w}`);if(!Array.isArray(y)||y.length===0)throw new Error("quoteRequestData.items must be a non-empty array");const E=["startDate","endDate","eventType","productType","productDuration","productPrice","productId","productName"];y.forEach((g,H)=>{if(!g||typeof g!="object")throw new Error(`quoteRequestData.items[${H}] must be a non-null object`);const _=`quoteRequestData.items[${H}]`;E.forEach(x=>{if(!Object.prototype.hasOwnProperty.call(g,x)||g[x]===void 0||g[x]===null)throw new Error(`Missing required ${_} field: '${x}'`)});const L=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!L.test(g.startDate))throw new Error(`${_}.startDate must be a valid ISO8601 string`);if(!L.test(g.endDate))throw new Error(`${_}.endDate must be a valid ISO8601 string`);if(typeof g.eventType!="string")throw new Error(`${_}.eventType must be a string`);if(typeof g.productType!="string")throw new Error(`${_}.productType must be a string`);const A=["Pass","Trip","Registration"];if(!A.includes(g.productType))throw new Error(`${_}.productType must be one of ${A.join(", ")}`);if(typeof g.productDuration!="string")throw new Error(`${_}.productDuration must be a string`);const O=["Daily","Seasonal","Trip","Event"];if(!O.includes(g.productDuration))throw new Error(`${_}.productDuration must be one of ${O.join(", ")}`);if(typeof g.productPrice!="number"||isNaN(g.productPrice))throw new Error(`${_}.productPrice must be a valid number`);if(typeof g.productId!="string")throw new Error(`${_}.productId must be a string`);if(typeof g.productName!="string")throw new Error(`${_}.productName must be a string`)})}else if(Array.isArray(r)){if(r.length===0)throw new Error("quoteRequestData array cannot be empty");r.forEach((p,u)=>{if(!p||typeof p!="object")throw new Error(`quoteRequestData[${u}] must be a non-null object`);v(p,u)})}else v(r);if(["onOptIn","onOptOut","onQuoteRetrieved","onError","noMatchingQuote"].forEach(p=>{const u=s[p];if(u&&typeof u!="function")throw new Error(`Callback '${p}' must be a function.`)}),typeof i=="string"&&!document.querySelector(i))throw new Error(`Invalid location selector: '${i}'`);if(a&&typeof a!="object")throw new Error("Theme must be an object with CSS variables, do not include the '--' prefix");if(c.state&&!z.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 n(c,{text:t,className:r,parent:s,innerHTML:i,href:a,target:e}={}){const o=document.createElement(c);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}function $(c,{name:t,description:r}){n("div",{className:"spot-header__title",text:t,parent:c}),n("div",{className:"spot-header__description",text:r,parent:c})}function V(c,t=[]){const r=n("ul",{className:"spot-benefits__list",parent:c});t.forEach(s=>{const i=n("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>`,n("span",{text:s,parent:i})})}function Q(c,t=[]){if(!t||t.length===0)return;const r=n("div",{className:"spot-qualifying-reasons__container",parent:c}),s=[...t].sort((o,l)=>o.rank-l.rank),i=n("div",{className:"spot-qualifying-reasons__grid",parent:r}),a={"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 l=new URL(o.src);e=l.origin+l.pathname.replace(/\/[^/]*$/,"/")}else e=window.location.origin+window.location.pathname.replace(/\/[^/]*$/,"/");e+="assets/"}catch{e="./assets/"}s.forEach(o=>{var g,h,p;const l=n("div",{className:"spot-qualifying-reasons__item",parent:i}),m=n("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:l}),f=a[((g=o.benefitType)==null?void 0:g.name)||""]||a[o.name||""];if(f){const u=n("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"}n("span",{className:"spot-qualifying-reasons__label",text:((p=o.benefitType)==null?void 0:p.name)||o.name||"",parent:l})})}function U(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 a=Array.from(s.entries()).map(([u,d])=>({item:u,count:d,displayText:d>1?`${d} x ${u}`:u})).sort((u,d)=>{const y=u.item.charAt(0),w=d.item.charAt(0),k=/[a-zA-Z]/.test(y),E=/[a-zA-Z]/.test(w);return!k&&E?-1:k&&!E?1:u.item.localeCompare(d.item,void 0,{sensitivity:"base"})}),e=n("div",{className:"spot-covered-items__container",parent:c}),o=n("div",{className:"spot-covered-items__header",parent:e}),l=n("button",{className:"spot-covered-items__toggle",parent:o});n("span",{className:"spot-covered-items__title",text:`Items Covered in Your Cart (${t.length})`,parent:l});const m=n("div",{className:"spot-covered-items__right-section",parent:l});n("span",{className:"spot-covered-items__view-all",text:"View All",parent:m});const f=n("span",{className:"spot-covered-items__arrow",innerHTML:"▼",parent:m}),g=n("div",{className:"spot-covered-items__content",parent:e}),h=n("ul",{className:"spot-covered-items__list",parent:g});a.forEach(({displayText:u})=>{const d=n("li",{parent:h});n("span",{text:u,parent:d})});let p=!1;g.style.display="none",l.addEventListener("click",u=>{u.stopPropagation(),p=!p,g.style.display=p?"block":"none",f.innerHTML=p?"▲":"▼",l.setAttribute("aria-expanded",p.toString())}),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-controls","covered-items-list"),g.setAttribute("id","covered-items-list")}const Z={USD:"$",CAD:"CAD $",AUD:"AUD $",NZD:"NZD $",MXN:"MXN $",EUR:"EUR €",GBP:"GBP £",AED:"AED ",MAD:"MAD ",SAR:"SAR "};function B(c,t=[],r="USD"){const s=Z[r]??`${r} `,i=n("div",{className:"spot-table__container",parent:c}),a=n("table",{className:"spot-refund__table spot-table--dynamic",parent:i}),e=n("thead",{parent:a}),o=n("tr",{parent:e});n("th",{text:"When you cancel",parent:o}),n("th",{text:"You will receive",parent:o});const l=n("tbody",{parent:a});t.forEach(({text:m,percent:f,amount:g})=>{const h=n("tr",{parent:l});n("td",{text:m,parent:h});const p=f==="Not eligible for refund"?"Not eligible for a refund":`${s}${g} refund`;n("td",{text:p,parent:h})})}function j(c,t){const r=n("div",{className:"spot-state-dropdown__wrapper",parent:c});n("label",{className:"spot-state-dropdown__label",text:"State of Residence",parent:r});const s=n("select",{className:"spot-state-dropdown__select",parent:r});s.setAttribute("aria-label","State of Residence");const i=n("option",{text:"Select a state...",parent:s});i.value="",i.selected=!t,S.forEach(({value:e,label:o})=>{const l=n("option",{text:o,parent:s});l.value=e,e===t&&(l.selected=!0)});const a=n("option",{text:"Not a US Resident",parent:s});return a.value=x,t===x&&(a.selected=!0),s}function W(c,t,r,s=!1){const i=n("div",{className:`spot-selection__options${s?" spot-selection__options--disabled":""}`,parent:c}),a=n("label",{className:`spot-selection__option ${t===b.YES?"selected":""}`,parent:i}),e=n("input",{parent:a});e.type="radio",e.name="selection",e.value=b.YES,t===b.YES&&(e.checked=!0),s&&(e.disabled=!0),n("strong",{text:r.yesOptionText,parent:a}),n("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:a});const o=n("label",{className:`spot-selection__option ${t===b.NO?"selected":""}`,parent:i}),l=n("input",{parent:o});return l.type="radio",l.name="selection",l.value=b.NO,t===b.NO&&(l.checked=!0),s&&(l.disabled=!0),n("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=n("div",{className:"spot-payment-terms",parent:c});return n("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:i}),n("div",{className:"spot-payment-terms__body",text:r||"",parent:i}),i}}function F(c,t,r="bottom-right"){if(r==="top-right"){const o=n("div",{className:"spot-logo__top-right",parent:c});o.innerHTML=`
5
+ </svg>`,n("span",{text:s,parent:i})})}function Q(c,t=[]){if(!t||t.length===0)return;const r=n("div",{className:"spot-qualifying-reasons__container",parent:c}),s=[...t].sort((o,l)=>o.rank-l.rank),i=n("div",{className:"spot-qualifying-reasons__grid",parent:r}),a={"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 l=new URL(o.src);e=l.origin+l.pathname.replace(/\/[^/]*$/,"/")}else e=window.location.origin+window.location.pathname.replace(/\/[^/]*$/,"/");e+="assets/"}catch{e="./assets/"}s.forEach(o=>{var v,h,p;const l=n("div",{className:"spot-qualifying-reasons__item",parent:i}),m=n("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:l}),f=a[((v=o.benefitType)==null?void 0:v.name)||""]||a[o.name||""];if(f){const u=n("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"}n("span",{className:"spot-qualifying-reasons__label",text:((p=o.benefitType)==null?void 0:p.name)||o.name||"",parent:l})})}function U(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 a=Array.from(s.entries()).map(([u,d])=>({item:u,count:d,displayText:d>1?`${d} x ${u}`:u})).sort((u,d)=>{const w=u.item.charAt(0),y=d.item.charAt(0),E=/[a-zA-Z]/.test(w),g=/[a-zA-Z]/.test(y);return!E&&g?-1:E&&!g?1:u.item.localeCompare(d.item,void 0,{sensitivity:"base"})}),e=n("div",{className:"spot-covered-items__container",parent:c}),o=n("div",{className:"spot-covered-items__header",parent:e}),l=n("button",{className:"spot-covered-items__toggle",parent:o});n("span",{className:"spot-covered-items__title",text:`Items Covered in Your Cart (${t.length})`,parent:l});const m=n("div",{className:"spot-covered-items__right-section",parent:l});n("span",{className:"spot-covered-items__view-all",text:"View All",parent:m});const f=n("span",{className:"spot-covered-items__arrow",innerHTML:"▼",parent:m}),v=n("div",{className:"spot-covered-items__content",parent:e}),h=n("ul",{className:"spot-covered-items__list",parent:v});a.forEach(({displayText:u})=>{const d=n("li",{parent:h});n("span",{text:u,parent:d})});let p=!1;v.style.display="none",l.addEventListener("click",u=>{u.stopPropagation(),p=!p,v.style.display=p?"block":"none",f.innerHTML=p?"▲":"▼",l.setAttribute("aria-expanded",p.toString())}),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-controls","covered-items-list"),v.setAttribute("id","covered-items-list")}const Z={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 B(c,t=[],r="USD"){const s=Z[r]??`${r} `,i=n("div",{className:"spot-table__container",parent:c}),a=n("table",{className:"spot-refund__table spot-table--dynamic",parent:i}),e=n("thead",{parent:a}),o=n("tr",{parent:e});n("th",{text:"When you cancel",parent:o}),n("th",{text:"You will receive",parent:o});const l=n("tbody",{parent:a});t.forEach(({text:m,percent:f,amount:v})=>{const h=n("tr",{parent:l});n("td",{text:m,parent:h});const p=f==="Not eligible for refund"?"Not eligible for a refund":`${s}${v} refund`;n("td",{text:p,parent:h})})}function j(c,t){const r=n("div",{className:"spot-state-dropdown__wrapper",parent:c});n("label",{className:"spot-state-dropdown__label",text:"State of Residence",parent:r});const s=n("select",{className:"spot-state-dropdown__select",parent:r});s.setAttribute("aria-label","State of Residence");const i=n("option",{text:"Select a state...",parent:s});i.value="",i.selected=!t,T.forEach(({value:e,label:o})=>{const l=n("option",{text:o,parent:s});l.value=e,e===t&&(l.selected=!0)});const a=n("option",{text:"Not a US Resident",parent:s});return a.value=k,t===k&&(a.selected=!0),s}function F(c,t,r,s=!1){const i=n("div",{className:`spot-selection__options${s?" spot-selection__options--disabled":""}`,parent:c}),a=n("label",{className:`spot-selection__option ${t===b.YES?"selected":""}`,parent:i}),e=n("input",{parent:a});e.type="radio",e.name="selection",e.value=b.YES,t===b.YES&&(e.checked=!0),s&&(e.disabled=!0),n("strong",{text:r.yesOptionText,parent:a}),n("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:a});const o=n("label",{className:`spot-selection__option ${t===b.NO?"selected":""}`,parent:i}),l=n("input",{parent:o});return l.type="radio",l.name="selection",l.value=b.NO,t===b.NO&&(l.checked=!0),s&&(l.disabled=!0),n("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=n("div",{className:"spot-payment-terms",parent:c});return n("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:i}),n("div",{className:"spot-payment-terms__body",text:r||"",parent:i}),i}}function W(c,t,r="bottom-right"){if(r==="top-right"){const o=n("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"/>
@@ -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 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,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 T(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 g;const f=(g=l.items)==null?void 0:g.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=W(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),F(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===x))return this.currentState}_isQuotingAvailable(){return!this._isPassOrTrip()||this.options.state?!0:!!this.currentState&&this.currentState!==x}_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,g;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 y;const d=(y=p.items)==null?void 0:y.find(w=>(w.cartItemId||`item-${p.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&&((g=this.options.callbacks)!=null&&g.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 y;const d=(y=p.items)==null?void 0:y.find(w=>(w.cartItemId||`item-${p.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,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 T(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=x,C.SelectionEnum=b,C.default=X,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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"}})});
package/dist/types.d.ts CHANGED
@@ -21,7 +21,7 @@ export interface QuoteItem {
21
21
  participantDescription?: string;
22
22
  eventType: string;
23
23
  eventId?: string;
24
- currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR";
24
+ currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR" | "BGN" | "BRL" | "CHF" | "DKK" | "INR" | "JPY" | "MYR" | "NOK" | "PLN" | "SEK" | "SGD" | "THB" | "ZAR";
25
25
  startDate: string;
26
26
  endDate: string;
27
27
  partnerRiskEnd?: Date;
@@ -40,7 +40,7 @@ export interface BatchQuoteItem extends BatchItem {
40
40
  export interface BatchQuoteRequest {
41
41
  cartId: string;
42
42
  cartName: string;
43
- currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR";
43
+ currencyCode: "USD" | "CAD" | "AUD" | "NZD" | "EUR" | "MXN" | "AED" | "GBP" | "MAD" | "SAR" | "BGN" | "BRL" | "CHF" | "DKK" | "INR" | "JPY" | "MYR" | "NOK" | "PLN" | "SEK" | "SGD" | "THB" | "ZAR";
44
44
  metadata?: QuoteMetadata;
45
45
  isPartialPayment?: boolean;
46
46
  roundTo?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,CAAC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;IAC9C,eAAe,EAAE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AAY,GAAE,cAAc,GAAG,WAA4B,GAC1D,WAAW,CAwEb"}
@@ -1 +1 @@
1
- {"version":3,"file":"validateOptions.d.ts","sourceRoot":"","sources":["../src/validateOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,YAAY,CAAC;AAWvF,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CA+PhE"}
1
+ {"version":3,"file":"validateOptions.d.ts","sourceRoot":"","sources":["../src/validateOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,YAAY,CAAC;AAqCvF,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CA6PhE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getspot/spot-widget",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },