@getspot/spot-widget 3.3.0 → 3.3.2

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,17 @@
1
+ ## [3.3.2](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@3.3.1...@getspot/spot-widget@3.3.2) (2026-01-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **core:** render payment terms if quote contains paymentTerms ([852af4e](https://gitlab.com/getspot/spot-widget/commit/852af4e7fe9838aac0409e26713614e20d523a9b))
7
+
8
+ ## [3.3.1](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@3.3.0...@getspot/spot-widget@3.3.1) (2026-01-07)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **core:** pass along isPartialPayment and roundTo on batch quote request ([50295cb](https://gitlab.com/getspot/spot-widget/commit/50295cbdf7860dd93c261bfb27294f10cd1f045c))
14
+
1
15
  # [3.3.0](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@3.2.5...@getspot/spot-widget@3.3.0) (2025-12-22)
2
16
 
3
17
 
package/README.md CHANGED
@@ -365,6 +365,7 @@ export interface CartInfo {
365
365
  currencyCode: "USD" | "CAD" | "AUD";
366
366
  metadata?: QuoteMetadata;
367
367
  isPartialPayment?: boolean;
368
+ roundTo?: number;
368
369
  }
369
370
  ```
370
371
 
@@ -393,6 +394,7 @@ export interface QuoteItem {
393
394
  hostCountryState?: string;
394
395
  destinations?: string[];
395
396
  dob?: string;
397
+ roundTo?: number;
396
398
  }
397
399
  ```
398
400
 
@@ -405,6 +407,20 @@ export interface BatchQuoteRequest {
405
407
  }
406
408
  ```
407
409
 
410
+ #### ApiBatchQuoteRequest
411
+
412
+ ```typescript
413
+ export interface ApiBatchQuoteRequest {
414
+ cartId: string;
415
+ cartName: string;
416
+ currencyCode: "USD" | "CAD" | "AUD";
417
+ metadata?: QuoteMetadata;
418
+ isPartialPayment?: boolean;
419
+ roundTo?: number;
420
+ items: BatchQuoteItem[];
421
+ }
422
+ ```
423
+
408
424
  #### QualifyingReason
409
425
 
410
426
  ```typescript
package/dist/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ApiResponse, QuoteRequestData, BatchQuoteRequest } from './types.js';
1
+ import type { ApiResponse, QuoteRequestData, BatchQuoteRequest, ApiBatchQuoteRequest } from './types.js';
2
2
  /**
3
3
  * Retrieve quote from Spot API
4
4
  * @param endpoint – Spot API URL
@@ -14,7 +14,7 @@ export declare function fetchQuote(endpoint: string, partnerId: string, payload:
14
14
  * @param batchPayload – batch request data with items array
15
15
  * @returns Promise resolving to API response
16
16
  */
17
- export declare function fetchBatchQuote(endpoint: string, partnerId: string, batchPayload: any): Promise<ApiResponse>;
17
+ export declare function fetchBatchQuote(endpoint: string, partnerId: string, batchPayload: ApiBatchQuoteRequest): Promise<ApiResponse>;
18
18
  /**
19
19
  * Retrieve multiple quotes in parallel from Spot API
20
20
  * @param endpoint – Spot API URL
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAY,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE7F;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,WAAW,CAAC,CAwBtB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,GAAG,GAChB,OAAO,CAAC,WAAW,CAAC,CAyBtB;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,iBAAiB,GAC3B,OAAO,CAAC,WAAW,CAAC,CA+EtB"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAY,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAkB,MAAM,YAAY,CAAC;AAEnI;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,WAAW,CAAC,CAwBtB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,oBAAoB,GACjC,OAAO,CAAC,WAAW,CAAC,CAyBtB;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,iBAAiB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAwEtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EAGd,MAAM,YAAY,CAAC;AAkBpB,cAAM,UAAU;IACd,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,cAAc,CAAC,CAAc;IACrC,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAQ;IACtB,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,eAAe,CAAC,CAAiB;gBAE7B,OAAO,GAAE,OAAO,CAAC,iBAAiB,CAAM;YAuBtC,KAAK;IAiGnB,OAAO,CAAC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AAE,OAAO,CAAC,iBAAiB,CAAM;YAuBtC,KAAK;IAiGnB,OAAO,CAAC,aAAa;IAoDrB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,uBAAuB;IAqC/B,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,cAAc,CAAC,CAAS;IAEhC,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,qBAAqB;IA2F7B,kBAAkB,IAAI,IAAI;IAgB1B,kBAAkB,IAAI,IAAI;IAM1B,iBAAiB,IAAI,OAAO;IAgBtB,WAAW,CACf,mBAAmB,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,GACzD,OAAO,CAAC,OAAO,CAAC;IAuEnB,YAAY,IAAI,aAAa,GAAG,IAAI;IA+BpC,OAAO,IAAI,IAAI;CAahB;AAED,eAAe,UAAU,CAAC;AAC1B,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,GACN,MAAM,YAAY,CAAC"}
package/dist/index.es.js CHANGED
@@ -7,29 +7,29 @@ async function x(m, t, o) {
7
7
  "X-Spot-Partner-Id": t
8
8
  },
9
9
  body: JSON.stringify(o)
10
- }), a = await s.json();
10
+ }), n = await s.json();
11
11
  if (!s.ok) {
12
- const r = new Error((a == null ? void 0 : a.message) || "Failed to fetch quote");
13
- throw r.status = s.status, r.responseBody = a, r;
12
+ const r = new Error((n == null ? void 0 : n.message) || "Failed to fetch quote");
13
+ throw r.status = s.status, r.responseBody = n, r;
14
14
  }
15
- return a;
15
+ return n;
16
16
  } catch (s) {
17
17
  throw s instanceof Error ? s : new Error("Unknown error occurred while fetching quote");
18
18
  }
19
19
  }
20
20
  async function H(m, t, o) {
21
21
  try {
22
- const s = m.replace("/quote", "/quote/batch"), a = await fetch(s, {
22
+ const s = m.replace("/quote", "/quote/batch"), n = await fetch(s, {
23
23
  method: "POST",
24
24
  headers: {
25
25
  "Content-Type": "application/json",
26
26
  "X-Spot-Partner-Id": t
27
27
  },
28
28
  body: JSON.stringify(o)
29
- }), r = await a.json();
30
- if (!a.ok) {
29
+ }), r = await n.json();
30
+ if (!n.ok) {
31
31
  const i = new Error((r == null ? void 0 : r.message) || "Failed to fetch batch quote");
32
- throw i.status = a.status, i.responseBody = r, i;
32
+ throw i.status = n.status, i.responseBody = r, i;
33
33
  }
34
34
  return r;
35
35
  } catch (s) {
@@ -39,36 +39,29 @@ async function H(m, t, o) {
39
39
  async function I(m, t, o) {
40
40
  var s;
41
41
  try {
42
- const a = {
42
+ const n = {
43
43
  cartId: o.cartInfo.cartId,
44
44
  cartName: o.cartInfo.cartName,
45
45
  currencyCode: o.cartInfo.currencyCode,
46
- items: o.items.map((n, u) => ({
47
- cartItemId: n.cartItemId || `item-${u + 1}`,
48
- productPrice: n.productPrice,
49
- productType: n.productType,
50
- productDuration: n.productDuration,
51
- productId: n.productId,
52
- productName: n.productName,
53
- participantDescription: n.participantDescription,
54
- eventType: n.eventType,
55
- eventId: n.eventId,
56
- startDate: n.startDate,
57
- endDate: n.endDate
46
+ isPartialPayment: o.cartInfo.isPartialPayment || !1,
47
+ roundTo: o.cartInfo.roundTo || void 0,
48
+ items: o.items.map((p, u) => ({
49
+ ...p,
50
+ cartItemId: p.cartItemId || `item-${u + 1}`
58
51
  }))
59
- }, r = await H(m, t, a);
52
+ }, r = await H(m, t, n);
60
53
  if (r.status !== "QUOTES_AVAILABLE" && r.status !== "QUOTE_AVAILABLE")
61
54
  return { status: "NO_MATCHING_QUOTE" };
62
- const i = r.quotes.map((n) => {
55
+ const i = r.quotes.map((p) => {
63
56
  const u = o.items.find(
64
- (f, h) => (f.cartItemId || `item-${h + 1}`) === n.cartItemId
57
+ (f, h) => (f.cartItemId || `item-${h + 1}`) === p.cartItemId
65
58
  );
66
- return u ? u.participantDescription ? `${u.productName} - ${u.participantDescription}` : u.productName : `Item ${n.id}`;
59
+ return u ? u.participantDescription ? `${u.productName} - ${u.participantDescription}` : u.productName : `Item ${p.id}`;
67
60
  }), e = Math.round((r.totalSpotPrice || r.spotPrice || 0) * 100) / 100;
68
61
  return {
69
62
  status: "QUOTE_AVAILABLE",
70
63
  data: {
71
- id: r.quotes ? r.quotes.map((n) => n.id).join(",") : ((s = r.data) == null ? void 0 : s.id) || "",
64
+ id: r.quotes ? r.quotes.map((p) => p.id).join(",") : ((s = r.data) == null ? void 0 : s.id) || "",
72
65
  spotPrice: e,
73
66
  currencyCode: r.currencyCode || "",
74
67
  communication: {
@@ -78,9 +71,9 @@ async function I(m, t, o) {
78
71
  String(e)
79
72
  )
80
73
  },
81
- payoutSchedule: r.payoutSchedule.map((n) => ({
82
- ...n,
83
- amount: n.amount !== void 0 ? n.amount : 0
74
+ payoutSchedule: r.payoutSchedule.map((p) => ({
75
+ ...p,
76
+ amount: p.amount !== void 0 ? p.amount : 0
84
77
  })),
85
78
  coveredItems: i,
86
79
  originalQuotes: r.quotes || (r.data ? [r.data] : [])
@@ -88,8 +81,8 @@ async function I(m, t, o) {
88
81
  spotPrice: e,
89
82
  coveredItems: i
90
83
  };
91
- } catch (a) {
92
- throw a instanceof Error ? a : new Error("Unknown error occurred while fetching multiple quotes");
84
+ } catch (n) {
85
+ throw n instanceof Error ? n : new Error("Unknown error occurred while fetching multiple quotes");
93
86
  }
94
87
  }
95
88
  const z = {
@@ -97,21 +90,21 @@ const z = {
97
90
  production: "https://api.getspot.com/v1/quote",
98
91
  local: "http://localhost:3999/api/v1/quote"
99
92
  };
100
- function D(m) {
93
+ function T(m) {
101
94
  const {
102
95
  apiConfig: t = {},
103
96
  quoteRequestData: o,
104
97
  callbacks: s = {},
105
- location: a,
98
+ location: n,
106
99
  theme: r
107
100
  } = m, {
108
101
  environment: i = "sandbox",
109
102
  partnerId: e,
110
- customEndpoint: n
103
+ customEndpoint: p
111
104
  } = t;
112
105
  if (!e || typeof e != "string")
113
106
  throw new Error("Invalid or missing partnerId in apiConfig");
114
- if (!(n || z[i]))
107
+ if (!(p || z[i]))
115
108
  throw new Error(`Invalid environment in apiConfig: ${i}`);
116
109
  if (!o || typeof o != "object" && !Array.isArray(o))
117
110
  throw new Error("quoteRequestData must be a non-null object or array");
@@ -127,61 +120,61 @@ function D(m) {
127
120
  "cartId",
128
121
  "productName"
129
122
  ];
130
- function h(d, p = null) {
131
- const l = p !== null ? `quoteRequestData[${p}]` : "quoteRequestData";
123
+ function h(c, d = null) {
124
+ const l = d !== null ? `quoteRequestData[${d}]` : "quoteRequestData";
132
125
  f.forEach((v) => {
133
- if (!Object.prototype.hasOwnProperty.call(d, v) || d[v] === void 0 || d[v] === null)
126
+ if (!Object.prototype.hasOwnProperty.call(c, v) || c[v] === void 0 || c[v] === null)
134
127
  throw new Error(`Missing required ${l} field: '${v}'`);
135
128
  });
136
129
  const w = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
137
- if (!w.test(d.startDate))
130
+ if (!w.test(c.startDate))
138
131
  throw new Error(`${l}.startDate must be a valid ISO8601 string`);
139
- if (!w.test(d.endDate))
132
+ if (!w.test(c.endDate))
140
133
  throw new Error(`${l}.endDate must be a valid ISO8601 string`);
141
- if (typeof d.currencyCode != "string")
134
+ if (typeof c.currencyCode != "string")
142
135
  throw new Error(`${l}.currencyCode must be a string`);
143
- if (!["USD", "CAD", "AUD"].includes(d.currencyCode))
144
- throw new Error(`Invalid ${l}.currencyCode: ${d.currencyCode}`);
145
- if (typeof d.eventType != "string")
136
+ if (!["USD", "CAD", "AUD"].includes(c.currencyCode))
137
+ throw new Error(`Invalid ${l}.currencyCode: ${c.currencyCode}`);
138
+ if (typeof c.eventType != "string")
146
139
  throw new Error(`${l}.eventType must be a string`);
147
- if (typeof d.productType != "string")
140
+ if (typeof c.productType != "string")
148
141
  throw new Error(`${l}.productType must be a string`);
149
142
  const g = ["Pass", "Trip", "Registration"];
150
- if (!g.includes(d.productType))
143
+ if (!g.includes(c.productType))
151
144
  throw new Error(
152
145
  `${l}.productType must be one of ${g.join(", ")}`
153
146
  );
154
- if (typeof d.productDuration != "string")
147
+ if (typeof c.productDuration != "string")
155
148
  throw new Error(`${l}.productDuration must be a string`);
156
- const b = ["Daily", "Seasonal", "Trip", "Event"];
157
- if (!b.includes(d.productDuration))
149
+ const _ = ["Daily", "Seasonal", "Trip", "Event"];
150
+ if (!_.includes(c.productDuration))
158
151
  throw new Error(
159
- `${l}.productDuration must be one of ${b.join(", ")}`
152
+ `${l}.productDuration must be one of ${_.join(", ")}`
160
153
  );
161
- if (typeof d.productPrice != "number" || isNaN(d.productPrice))
154
+ if (typeof c.productPrice != "number" || isNaN(c.productPrice))
162
155
  throw new Error(`${l}.productPrice must be a valid number`);
163
- if (typeof d.productId != "string")
156
+ if (typeof c.productId != "string")
164
157
  throw new Error(`${l}.productId must be a string`);
165
- if (typeof d.cartId != "string")
158
+ if (typeof c.cartId != "string")
166
159
  throw new Error(`${l}.cartId must be a string`);
167
- if (typeof d.productName != "string")
160
+ if (typeof c.productName != "string")
168
161
  throw new Error(`${l}.productName must be a string`);
169
162
  }
170
163
  if ("cartInfo" in o && "items" in o) {
171
- const d = o, { cartInfo: p, items: l } = d;
172
- if (!p || typeof p != "object")
164
+ const c = o, { cartInfo: d, items: l } = c;
165
+ if (!d || typeof d != "object")
173
166
  throw new Error("quoteRequestData.cartInfo must be a non-null object");
174
- if (!p.cartId || typeof p.cartId != "string")
167
+ if (!d.cartId || typeof d.cartId != "string")
175
168
  throw new Error("quoteRequestData.cartInfo.cartId must be a string");
176
- if (!p.cartName || typeof p.cartName != "string")
169
+ if (!d.cartName || typeof d.cartName != "string")
177
170
  throw new Error("quoteRequestData.cartInfo.cartName must be a string");
178
- if (!p.currencyCode || typeof p.currencyCode != "string")
171
+ if (!d.currencyCode || typeof d.currencyCode != "string")
179
172
  throw new Error("quoteRequestData.cartInfo.currencyCode must be a string");
180
- if (!["USD", "CAD", "AUD"].includes(p.currencyCode))
181
- throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${p.currencyCode}`);
173
+ if (!["USD", "CAD", "AUD"].includes(d.currencyCode))
174
+ throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${d.currencyCode}`);
182
175
  if (!Array.isArray(l) || l.length === 0)
183
176
  throw new Error("quoteRequestData.items must be a non-empty array");
184
- const _ = [
177
+ const b = [
185
178
  "startDate",
186
179
  "endDate",
187
180
  "eventType",
@@ -191,11 +184,11 @@ function D(m) {
191
184
  "productId",
192
185
  "productName"
193
186
  ];
194
- l.forEach((g, b) => {
187
+ l.forEach((g, _) => {
195
188
  if (!g || typeof g != "object")
196
- throw new Error(`quoteRequestData.items[${b}] must be a non-null object`);
197
- const v = `quoteRequestData.items[${b}]`;
198
- _.forEach((C) => {
189
+ throw new Error(`quoteRequestData.items[${_}] must be a non-null object`);
190
+ const v = `quoteRequestData.items[${_}]`;
191
+ b.forEach((C) => {
199
192
  if (!Object.prototype.hasOwnProperty.call(g, C) || g[C] === void 0 || g[C] === null)
200
193
  throw new Error(`Missing required ${v} field: '${C}'`);
201
194
  });
@@ -226,10 +219,10 @@ function D(m) {
226
219
  } else if (Array.isArray(o)) {
227
220
  if (o.length === 0)
228
221
  throw new Error("quoteRequestData array cannot be empty");
229
- o.forEach((d, p) => {
230
- if (!d || typeof d != "object")
231
- throw new Error(`quoteRequestData[${p}] must be a non-null object`);
232
- h(d, p);
222
+ o.forEach((c, d) => {
223
+ if (!c || typeof c != "object")
224
+ throw new Error(`quoteRequestData[${d}] must be a non-null object`);
225
+ h(c, d);
233
226
  });
234
227
  } else
235
228
  h(o);
@@ -239,52 +232,52 @@ function D(m) {
239
232
  "onQuoteRetrieved",
240
233
  "onError",
241
234
  "noMatchingQuote"
242
- ].forEach((d) => {
243
- const p = s[d];
244
- if (p && typeof p != "function")
245
- throw new Error(`Callback '${d}' must be a function.`);
246
- }), typeof a == "string" && !document.querySelector(a))
247
- throw new Error(`Invalid location selector: '${a}'`);
235
+ ].forEach((c) => {
236
+ const d = s[c];
237
+ if (d && typeof d != "function")
238
+ throw new Error(`Callback '${c}' must be a function.`);
239
+ }), typeof n == "string" && !document.querySelector(n))
240
+ throw new Error(`Invalid location selector: '${n}'`);
248
241
  if (r && typeof r != "object")
249
242
  throw new Error(
250
243
  "Theme must be an object with CSS variables, do not include the '--' prefix"
251
244
  );
252
245
  }
253
- function c(m, { text: t, className: o, parent: s, innerHTML: a, href: r, target: i } = {}) {
246
+ function a(m, { text: t, className: o, parent: s, innerHTML: n, href: r, target: i } = {}) {
254
247
  const e = document.createElement(m);
255
- return o && (e.className = o), t != null && (e.textContent = t), a != null && (e.innerHTML = a), r && "href" in e && (e.href = r), i && "target" in e && (e.target = i), s && s.appendChild(e), e;
248
+ return o && (e.className = o), t != null && (e.textContent = t), n != null && (e.innerHTML = n), r && "href" in e && (e.href = r), i && "target" in e && (e.target = i), s && s.appendChild(e), e;
256
249
  }
257
- function N(m, { name: t, description: o }) {
258
- c("div", {
250
+ function M(m, { name: t, description: o }) {
251
+ a("div", {
259
252
  className: "spot-header__title",
260
253
  text: t,
261
254
  parent: m
262
- }), c("div", {
255
+ }), a("div", {
263
256
  className: "spot-header__description",
264
257
  text: o,
265
258
  parent: m
266
259
  });
267
260
  }
268
- function M(m, t = []) {
269
- const o = c("ul", {
261
+ function N(m, t = []) {
262
+ const o = a("ul", {
270
263
  className: "spot-benefits__list",
271
264
  parent: m
272
265
  });
273
266
  t.forEach((s) => {
274
- const a = c("li", { parent: o });
275
- a.innerHTML = `
267
+ const n = a("li", { parent: o });
268
+ n.innerHTML = `
276
269
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="spot-bullets__checkmark">
277
270
  <path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
278
271
  stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
279
- </svg>`, c("span", { text: s, parent: a });
272
+ </svg>`, a("span", { text: s, parent: n });
280
273
  });
281
274
  }
282
275
  function L(m, t = []) {
283
276
  if (!t || t.length === 0) return;
284
- const o = c("div", {
277
+ const o = a("div", {
285
278
  className: "spot-qualifying-reasons__container",
286
279
  parent: m
287
- }), s = [...t].sort((e, n) => e.rank - n.rank), a = c("div", {
280
+ }), s = [...t].sort((e, p) => e.rank - p.rank), n = a("div", {
288
281
  className: "spot-qualifying-reasons__grid",
289
282
  parent: o
290
283
  }), r = {
@@ -301,8 +294,8 @@ function L(m, t = []) {
301
294
  try {
302
295
  const e = document.currentScript;
303
296
  if (e != null && e.src) {
304
- const n = new URL(e.src);
305
- i = n.origin + n.pathname.replace(/\/[^/]*$/, "/");
297
+ const p = new URL(e.src);
298
+ i = p.origin + p.pathname.replace(/\/[^/]*$/, "/");
306
299
  } else
307
300
  i = window.location.origin + window.location.pathname.replace(/\/[^/]*$/, "/");
308
301
  i += "assets/";
@@ -310,24 +303,24 @@ function L(m, t = []) {
310
303
  i = "./assets/";
311
304
  }
312
305
  s.forEach((e) => {
313
- var h, y, d;
314
- const n = c("div", {
306
+ var h, y, c;
307
+ const p = a("div", {
315
308
  className: "spot-qualifying-reasons__item",
316
- parent: a
317
- }), u = c("div", {
318
- className: "spot-qualifying-reasons__icon-wrapper",
319
309
  parent: n
310
+ }), u = a("div", {
311
+ className: "spot-qualifying-reasons__icon-wrapper",
312
+ parent: p
320
313
  }), f = r[((h = e.benefitType) == null ? void 0 : h.name) || ""] || r[e.name || ""];
321
314
  if (f) {
322
- const p = c("img", {
315
+ const d = a("img", {
323
316
  parent: u
324
317
  });
325
- p.src = i + f, p.alt = ((y = e.benefitType) == null ? void 0 : y.name) || e.name || "", p.className = "spot-qualifying-reasons__icon";
318
+ d.src = i + f, d.alt = ((y = e.benefitType) == null ? void 0 : y.name) || e.name || "", d.className = "spot-qualifying-reasons__icon";
326
319
  }
327
- c("span", {
320
+ a("span", {
328
321
  className: "spot-qualifying-reasons__label",
329
- text: ((d = e.benefitType) == null ? void 0 : d.name) || e.name || "",
330
- parent: n
322
+ text: ((c = e.benefitType) == null ? void 0 : c.name) || e.name || "",
323
+ parent: p
331
324
  });
332
325
  });
333
326
  }
@@ -335,112 +328,112 @@ function O(m, t = [], o) {
335
328
  if (t.length === 0 || !o || o <= 1)
336
329
  return;
337
330
  const s = /* @__PURE__ */ new Map();
338
- t.forEach((p) => {
339
- s.set(p, (s.get(p) || 0) + 1);
331
+ t.forEach((d) => {
332
+ s.set(d, (s.get(d) || 0) + 1);
340
333
  });
341
334
  const r = Array.from(s.entries()).map(
342
- ([p, l]) => ({
343
- item: p,
335
+ ([d, l]) => ({
336
+ item: d,
344
337
  count: l,
345
- displayText: l > 1 ? `${l} x ${p}` : p
338
+ displayText: l > 1 ? `${l} x ${d}` : d
346
339
  })
347
- ).sort((p, l) => {
348
- const w = p.item.charAt(0), _ = l.item.charAt(0), g = /[a-zA-Z]/.test(w), b = /[a-zA-Z]/.test(_);
349
- return !g && b ? -1 : g && !b ? 1 : p.item.localeCompare(l.item, void 0, { sensitivity: "base" });
350
- }), i = c("div", {
340
+ ).sort((d, l) => {
341
+ const w = d.item.charAt(0), b = l.item.charAt(0), g = /[a-zA-Z]/.test(w), _ = /[a-zA-Z]/.test(b);
342
+ return !g && _ ? -1 : g && !_ ? 1 : d.item.localeCompare(l.item, void 0, { sensitivity: "base" });
343
+ }), i = a("div", {
351
344
  className: "spot-covered-items__container",
352
345
  parent: m
353
- }), e = c("div", {
346
+ }), e = a("div", {
354
347
  className: "spot-covered-items__header",
355
348
  parent: i
356
- }), n = c("button", {
349
+ }), p = a("button", {
357
350
  className: "spot-covered-items__toggle",
358
351
  parent: e
359
352
  });
360
- c("span", {
353
+ a("span", {
361
354
  className: "spot-covered-items__title",
362
355
  text: `Items Covered in Your Cart (${t.length})`,
363
- parent: n
356
+ parent: p
364
357
  });
365
- const u = c("div", {
358
+ const u = a("div", {
366
359
  className: "spot-covered-items__right-section",
367
- parent: n
360
+ parent: p
368
361
  });
369
- c("span", {
362
+ a("span", {
370
363
  className: "spot-covered-items__view-all",
371
364
  text: "View All",
372
365
  parent: u
373
366
  });
374
- const f = c("span", {
367
+ const f = a("span", {
375
368
  className: "spot-covered-items__arrow",
376
369
  innerHTML: "▼",
377
370
  parent: u
378
- }), h = c("div", {
371
+ }), h = a("div", {
379
372
  className: "spot-covered-items__content",
380
373
  parent: i
381
- }), y = c("ul", {
374
+ }), y = a("ul", {
382
375
  className: "spot-covered-items__list",
383
376
  parent: h
384
377
  });
385
- r.forEach(({ displayText: p }) => {
386
- const l = c("li", { parent: y });
387
- c("span", { text: p, parent: l });
378
+ r.forEach(({ displayText: d }) => {
379
+ const l = a("li", { parent: y });
380
+ a("span", { text: d, parent: l });
388
381
  });
389
- let d = !1;
390
- h.style.display = "none", n.addEventListener("click", (p) => {
391
- p.stopPropagation(), d = !d, h.style.display = d ? "block" : "none", f.innerHTML = d ? "▲" : "▼", n.setAttribute("aria-expanded", d.toString());
392
- }), n.setAttribute("aria-expanded", "false"), n.setAttribute("aria-controls", "covered-items-list"), h.setAttribute("id", "covered-items-list");
382
+ let c = !1;
383
+ h.style.display = "none", p.addEventListener("click", (d) => {
384
+ d.stopPropagation(), c = !c, h.style.display = c ? "block" : "none", f.innerHTML = c ? "▲" : "▼", p.setAttribute("aria-expanded", c.toString());
385
+ }), p.setAttribute("aria-expanded", "false"), p.setAttribute("aria-controls", "covered-items-list"), h.setAttribute("id", "covered-items-list");
393
386
  }
394
387
  function P(m, t = []) {
395
- const o = c("div", {
388
+ const o = a("div", {
396
389
  className: "spot-table__container",
397
390
  parent: m
398
- }), s = c("table", {
391
+ }), s = a("table", {
399
392
  className: "spot-refund__table spot-table--dynamic",
400
393
  parent: o
401
- }), a = c("thead", { parent: s }), r = c("tr", { parent: a });
402
- c("th", { text: "When you cancel", parent: r }), c("th", { text: "You will receive", parent: r });
403
- const i = c("tbody", { parent: s });
404
- t.forEach(({ text: e, percent: n, amount: u }) => {
405
- const f = c("tr", { parent: i });
406
- c("td", { text: e, parent: f });
407
- const h = n === "Not eligible for refund" ? "Not eligible for a refund" : `$${u} refund`;
408
- c("td", { text: h, parent: f });
394
+ }), n = a("thead", { parent: s }), r = a("tr", { parent: n });
395
+ a("th", { text: "When you cancel", parent: r }), a("th", { text: "You will receive", parent: r });
396
+ const i = a("tbody", { parent: s });
397
+ t.forEach(({ text: e, percent: p, amount: u }) => {
398
+ const f = a("tr", { parent: i });
399
+ a("td", { text: e, parent: f });
400
+ const h = p === "Not eligible for refund" ? "Not eligible for a refund" : `$${u} refund`;
401
+ a("td", { text: h, parent: f });
409
402
  });
410
403
  }
411
404
  function $(m, t, o) {
412
- const s = c("div", {
405
+ const s = a("div", {
413
406
  className: "spot-selection__options",
414
407
  parent: m
415
- }), a = c("label", {
408
+ }), n = a("label", {
416
409
  className: `spot-selection__option ${t ? "selected" : ""}`,
417
410
  parent: s
418
- }), r = c("input", { parent: a });
419
- r.type = "radio", r.name = "selection", r.value = "yes", t && (r.checked = !0), c("strong", {
411
+ }), r = a("input", { parent: n });
412
+ r.type = "radio", r.name = "selection", r.value = "yes", t && (r.checked = !0), a("strong", {
420
413
  text: o.yesOptionText,
421
- parent: a
422
- }), c("span", {
414
+ parent: n
415
+ }), a("span", {
423
416
  className: "spot-selection__recommended-tag",
424
417
  text: "Recommended",
425
- parent: a
418
+ parent: n
426
419
  });
427
- const i = c("label", {
420
+ const i = a("label", {
428
421
  className: "spot-selection__option",
429
422
  parent: s
430
- }), e = c("input", { parent: i });
431
- return e.type = "radio", e.name = "selection", e.value = "no", c("span", { text: o.noOptionText, parent: i }), s;
423
+ }), e = a("input", { parent: i });
424
+ return e.type = "radio", e.name = "selection", e.value = "no", a("span", { text: o.noOptionText, parent: i }), s;
432
425
  }
433
426
  function R(m, t) {
434
- var a;
435
- const o = (a = t.communication) == null ? void 0 : a.paymentTerms, s = c("div", {
427
+ var n;
428
+ const o = (n = t.communication) == null ? void 0 : n.paymentTerms, s = a("div", {
436
429
  className: "spot-payment-terms",
437
430
  parent: m
438
431
  });
439
- return c("div", {
432
+ return a("div", {
440
433
  className: "spot-payment-terms__header",
441
434
  text: "PAYMENT TERMS",
442
435
  parent: s
443
- }), c("div", {
436
+ }), a("div", {
444
437
  className: "spot-payment-terms__body",
445
438
  text: o || "",
446
439
  parent: s
@@ -448,7 +441,7 @@ function R(m, t) {
448
441
  }
449
442
  function V(m, t, o = "bottom-right") {
450
443
  if (o === "top-right") {
451
- const e = c("div", {
444
+ const e = a("div", {
452
445
  className: "spot-logo__top-right",
453
446
  parent: m
454
447
  });
@@ -469,21 +462,21 @@ function V(m, t, o = "bottom-right") {
469
462
  </defs>
470
463
  </svg>`;
471
464
  }
472
- const s = c("div", {
465
+ const s = a("div", {
473
466
  className: "spot-footer__container",
474
467
  parent: m
475
- }), a = c("div", {
468
+ }), n = a("div", {
476
469
  className: "spot-footer__terms",
477
470
  parent: s
478
471
  }), r = `<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`, i = t.communication.legalDisclaimer.replace(
479
472
  /terms (and|&) conditions/gi,
480
473
  r
481
474
  );
482
- if (c("span", {
475
+ if (a("span", {
483
476
  innerHTML: i,
484
- parent: a
477
+ parent: n
485
478
  }), o === "bottom-right") {
486
- const e = c("p", {
479
+ const e = a("p", {
487
480
  className: "spot-footer__powered-by",
488
481
  parent: s
489
482
  });
@@ -512,7 +505,7 @@ function S(m) {
512
505
  t.textContent = m, document.head.appendChild(t);
513
506
  }
514
507
  S(Q);
515
- const T = {
508
+ const D = {
516
509
  sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
517
510
  production: "https://api.getspot.com/api/v1/quote",
518
511
  local: "http://localhost:3999/api/v1/quote"
@@ -532,21 +525,21 @@ class A {
532
525
  }, this._onResize = this._updateLayout.bind(this), this.root = typeof this.options.location == "string" ? document.querySelector(this.options.location) : this.options.location, this.currentSelection = this.options.optInSelected ? "yes" : null, this._init();
533
526
  }
534
527
  async _init() {
535
- var t, o, s, a, r;
528
+ var t, o, s, n, r;
536
529
  try {
537
- D(this.options);
530
+ T(this.options);
538
531
  let i;
539
532
  if (this.options.useMockData && this.options.mockData)
540
533
  i = this.options.mockData;
541
534
  else {
542
- const { environment: e, partnerId: n } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || T[e];
535
+ const { environment: e, partnerId: p } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || D[e];
543
536
  i = "cartInfo" in this.options.quoteRequestData && "items" in this.options.quoteRequestData ? await I(
544
537
  f,
545
- n,
538
+ p,
546
539
  this.options.quoteRequestData
547
540
  ) : await x(
548
541
  f,
549
- n,
542
+ p,
550
543
  this.options.quoteRequestData
551
544
  );
552
545
  }
@@ -566,11 +559,11 @@ class A {
566
559
  quoteId: this.quote.id
567
560
  };
568
561
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
569
- const n = this.options.quoteRequestData;
562
+ const p = this.options.quoteRequestData;
570
563
  e.batchQuoteDetails = this.quote.originalQuotes.map((u) => {
571
564
  var h;
572
- const f = (h = n.items) == null ? void 0 : h.find(
573
- (y) => (y.cartItemId || `item-${n.items.indexOf(y) + 1}`) === u.cartItemId
565
+ const f = (h = p.items) == null ? void 0 : h.find(
566
+ (y) => (y.cartItemId || `item-${p.items.indexOf(y) + 1}`) === u.cartItemId
574
567
  );
575
568
  return {
576
569
  quoteId: u.id,
@@ -586,7 +579,7 @@ class A {
586
579
  e && this._applyQuoteUpdates(e);
587
580
  }
588
581
  } catch (i) {
589
- if ((a = this.options.callbacks) != null && a.onError) {
582
+ if ((n = this.options.callbacks) != null && n.onError) {
590
583
  const e = i;
591
584
  (r = this.options.callbacks) == null || r.onError({
592
585
  message: e.message,
@@ -598,12 +591,12 @@ class A {
598
591
  }
599
592
  _renderWidget() {
600
593
  if (!this.quote) return;
601
- this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([s, a]) => {
594
+ this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([s, n]) => {
602
595
  const r = `--${s}`;
603
- this.container.style.setProperty(r, a);
604
- }), N(this.container, this.quote.communication);
596
+ this.container.style.setProperty(r, n);
597
+ }), M(this.container, this.quote.communication);
605
598
  const t = document.createElement("div");
606
- if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? L(t, this.quote.qualifyingReasons) : M(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
599
+ if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? L(t, this.quote.qualifyingReasons) : N(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
607
600
  const s = this._getTotalItemsInRequest();
608
601
  O(t, this.quote.coveredItems, s);
609
602
  }
@@ -613,7 +606,7 @@ class A {
613
606
  this.options.optInSelected,
614
607
  this.quote.communication
615
608
  );
616
- t.appendChild(o), this.paymentTermsEl = c("div", {
609
+ t.appendChild(o), this.paymentTermsEl = a("div", {
617
610
  className: "spot-payment-terms__wrapper",
618
611
  parent: t
619
612
  }), V(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(o);
@@ -631,7 +624,7 @@ class A {
631
624
  t.classList.toggle("desktop-layout", s);
632
625
  }
633
626
  _shouldUseDesktopLayout(t) {
634
- const o = this.container.offsetWidth - 40, s = 325, a = 16;
627
+ const o = this.container.offsetWidth - 40, s = 325, n = 16;
635
628
  if (o >= 900)
636
629
  return !0;
637
630
  if (o >= 650) {
@@ -642,8 +635,8 @@ class A {
642
635
  );
643
636
  if (!i)
644
637
  return r && t.classList.add("desktop-layout"), r;
645
- const n = Math.min(i.scrollWidth, 400) + s + a;
646
- return r && t.classList.add("desktop-layout"), o >= n;
638
+ const p = Math.min(i.scrollWidth, 400) + s + n;
639
+ return r && t.classList.add("desktop-layout"), o >= p;
647
640
  }
648
641
  return !1;
649
642
  }
@@ -667,56 +660,56 @@ class A {
667
660
  const o = t.querySelectorAll(
668
661
  'input[type="radio"]'
669
662
  ), s = t.querySelectorAll(".spot-selection__option");
670
- o.forEach((a) => {
671
- a.addEventListener("change", (r) => {
672
- var n, u, f;
663
+ o.forEach((n) => {
664
+ n.addEventListener("change", (r) => {
665
+ var p, u, f, h;
673
666
  const i = r.target, e = i.value;
674
- if (this.hideSelectionError(), this.currentSelection = e, s.forEach((h) => h.classList.remove("selected")), (n = i.closest(".spot-selection__option")) == null || n.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), e === "yes" && (this.options.quoteRequestData.isPartialPayment && R(this.paymentTermsEl, this.quote), (u = this.options.callbacks) != null && u.onOptIn)) {
675
- const h = {
667
+ if (this.hideSelectionError(), this.currentSelection = e, s.forEach((y) => y.classList.remove("selected")), (p = i.closest(".spot-selection__option")) == null || p.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), e === "yes" && ((u = this.quote) != null && u.communication.paymentTerms && R(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
668
+ const y = {
676
669
  status: "QUOTE_ACCEPTED",
677
670
  spotPrice: this.quote.spotPrice,
678
671
  quoteId: this.quote.id
679
672
  };
680
673
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
681
- const y = this.options.quoteRequestData;
682
- h.batchQuoteDetails = this.quote.originalQuotes.map(
674
+ const c = this.options.quoteRequestData;
675
+ y.batchQuoteDetails = this.quote.originalQuotes.map(
683
676
  (d) => {
684
- var l;
685
- const p = (l = y.items) == null ? void 0 : l.find(
686
- (w) => (w.cartItemId || `item-${y.items.indexOf(w) + 1}`) === d.cartItemId
677
+ var w;
678
+ const l = (w = c.items) == null ? void 0 : w.find(
679
+ (b) => (b.cartItemId || `item-${c.items.indexOf(b) + 1}`) === d.cartItemId
687
680
  );
688
681
  return {
689
682
  quoteId: d.id,
690
- productPrice: (p == null ? void 0 : p.productPrice) || d.spotPrice,
691
- cartItemId: (p == null ? void 0 : p.cartItemId) || ""
683
+ productPrice: (l == null ? void 0 : l.productPrice) || d.spotPrice,
684
+ cartItemId: (l == null ? void 0 : l.cartItemId) || ""
692
685
  };
693
686
  }
694
687
  );
695
688
  }
696
- this.options.callbacks.onOptIn(h);
689
+ this.options.callbacks.onOptIn(y);
697
690
  }
698
- if (e === "no" && ((f = this.options.callbacks) != null && f.onOptOut)) {
699
- const h = {
691
+ if (e === "no" && ((h = this.options.callbacks) != null && h.onOptOut)) {
692
+ const y = {
700
693
  status: "QUOTE_DECLINED",
701
694
  quoteId: this.quote.id
702
695
  };
703
696
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
704
- const y = this.options.quoteRequestData;
705
- h.batchQuoteDetails = this.quote.originalQuotes.map(
697
+ const c = this.options.quoteRequestData;
698
+ y.batchQuoteDetails = this.quote.originalQuotes.map(
706
699
  (d) => {
707
- var l;
708
- const p = (l = y.items) == null ? void 0 : l.find(
709
- (w) => (w.cartItemId || `item-${y.items.indexOf(w) + 1}`) === d.cartItemId
700
+ var w;
701
+ const l = (w = c.items) == null ? void 0 : w.find(
702
+ (b) => (b.cartItemId || `item-${c.items.indexOf(b) + 1}`) === d.cartItemId
710
703
  );
711
704
  return {
712
705
  quoteId: d.id,
713
- productPrice: (p == null ? void 0 : p.productPrice) || d.spotPrice,
714
- cartItemId: (p == null ? void 0 : p.cartItemId) || ""
706
+ productPrice: (l == null ? void 0 : l.productPrice) || d.spotPrice,
707
+ cartItemId: (l == null ? void 0 : l.cartItemId) || ""
715
708
  };
716
709
  }
717
710
  );
718
711
  }
719
- this.options.callbacks.onOptOut(h);
712
+ this.options.callbacks.onOptOut(y);
720
713
  }
721
714
  });
722
715
  });
@@ -743,35 +736,35 @@ class A {
743
736
  return t ? this.hideSelectionError() : this.showSelectionError(), t;
744
737
  }
745
738
  async updateQuote(t) {
746
- var o, s, a, r;
739
+ var o, s, n, r;
747
740
  try {
748
741
  const i = {
749
742
  ...this.options,
750
743
  quoteRequestData: t
751
744
  };
752
- D(i);
753
- const { environment: e, partnerId: n, customEndpoint: u } = this.options.apiConfig, f = u || T[e], y = "cartInfo" in i.quoteRequestData && "items" in i.quoteRequestData ? await I(
745
+ T(i);
746
+ const { environment: e, partnerId: p, customEndpoint: u } = this.options.apiConfig, f = u || D[e], y = "cartInfo" in i.quoteRequestData && "items" in i.quoteRequestData ? await I(
754
747
  f,
755
- n,
748
+ p,
756
749
  i.quoteRequestData
757
750
  ) : await x(
758
751
  f,
759
- n,
752
+ p,
760
753
  i.quoteRequestData
761
754
  );
762
755
  if (y.status !== "QUOTE_AVAILABLE")
763
- return y.status === "NO_MATCHING_QUOTE" && ((o = this.options.callbacks) != null && o.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
756
+ return this.destroy(), y.status === "NO_MATCHING_QUOTE" && ((o = this.options.callbacks) != null && o.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
764
757
  status: "NO_MATCHING_QUOTE",
765
758
  data: i.quoteRequestData
766
759
  }), !1;
767
760
  if (this.options.quoteRequestData = i.quoteRequestData, this.quote = y.data, this.currentSelection = null, this.destroy(), this._renderWidget(), (s = this.options.callbacks) != null && s.onQuoteRetrieved) {
768
- const d = this.options.callbacks.onQuoteRetrieved(this.quote);
769
- d && this._applyQuoteUpdates(d);
761
+ const c = this.options.callbacks.onQuoteRetrieved(this.quote);
762
+ c && this._applyQuoteUpdates(c);
770
763
  }
771
764
  return !0;
772
765
  } catch (i) {
773
766
  const e = i;
774
- return (r = (a = this.options.callbacks) == null ? void 0 : a.onError) == null || r.call(a, {
767
+ return (r = (n = this.options.callbacks) == null ? void 0 : n.onError) == null || r.call(n, {
775
768
  message: e.message,
776
769
  status: e.status,
777
770
  responseBody: e.responseBody
@@ -779,7 +772,7 @@ class A {
779
772
  }
780
773
  }
781
774
  getSelection() {
782
- var o, s, a;
775
+ var o, s, n;
783
776
  if (this.currentSelection == null) return null;
784
777
  const t = {
785
778
  selection: this.currentSelection,
@@ -787,11 +780,11 @@ class A {
787
780
  spotPrice: (s = this.quote) == null ? void 0 : s.spotPrice,
788
781
  status: this.currentSelection === "yes" ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED"
789
782
  };
790
- if ((a = this.quote) != null && a.originalQuotes && this.quote.originalQuotes.length > 0) {
783
+ if ((n = this.quote) != null && n.originalQuotes && this.quote.originalQuotes.length > 0) {
791
784
  const r = this.options.quoteRequestData;
792
785
  t.batchQuoteDetails = this.quote.originalQuotes.map((i) => {
793
- var n;
794
- const e = (n = r.items) == null ? void 0 : n.find(
786
+ var p;
787
+ const e = (p = r.items) == null ? void 0 : p.find(
795
788
  (u) => (u.cartItemId || `item-${r.items.indexOf(u) + 1}`) === i.cartItemId
796
789
  );
797
790
  return {
package/dist/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(_,C){typeof exports=="object"&&typeof module<"u"?module.exports=C():typeof define=="function"&&define.amd?define(C):(_=typeof globalThis<"u"?globalThis:_||self,_.SpotWidget=C())})(this,function(){"use strict";async function _(m,t,o){try{const s=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),a=await s.json();if(!s.ok){const r=new Error((a==null?void 0:a.message)||"Failed to fetch quote");throw r.status=s.status,r.responseBody=a,r}return a}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching quote")}}async function C(m,t,o){try{const s=m.replace("/quote","/quote/batch"),a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),r=await a.json();if(!a.ok){const i=new Error((r==null?void 0:r.message)||"Failed to fetch batch quote");throw i.status=a.status,i.responseBody=r,i}return r}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching batch quote")}}async function x(m,t,o){var s;try{const a={cartId:o.cartInfo.cartId,cartName:o.cartInfo.cartName,currencyCode:o.cartInfo.currencyCode,items:o.items.map((n,u)=>({cartItemId:n.cartItemId||`item-${u+1}`,productPrice:n.productPrice,productType:n.productType,productDuration:n.productDuration,productId:n.productId,productName:n.productName,participantDescription:n.participantDescription,eventType:n.eventType,eventId:n.eventId,startDate:n.startDate,endDate:n.endDate}))},r=await C(m,t,a);if(r.status!=="QUOTES_AVAILABLE"&&r.status!=="QUOTE_AVAILABLE")return{status:"NO_MATCHING_QUOTE"};const i=r.quotes.map(n=>{const u=o.items.find((f,h)=>(f.cartItemId||`item-${h+1}`)===n.cartItemId);return u?u.participantDescription?`${u.productName} - ${u.participantDescription}`:u.productName:`Item ${n.id}`}),e=Math.round((r.totalSpotPrice||r.spotPrice||0)*100)/100;return{status:"QUOTE_AVAILABLE",data:{id:r.quotes?r.quotes.map(n=>n.id).join(","):((s=r.data)==null?void 0:s.id)||"",spotPrice:e,currencyCode:r.currencyCode||"",communication:{...r.communication,yesOptionText:r.communication.yesOptionText.replace(String(r.totalSpotPrice),String(e))},payoutSchedule:r.payoutSchedule.map(n=>({...n,amount:n.amount!==void 0?n.amount:0})),coveredItems:i,originalQuotes:r.quotes||(r.data?[r.data]:[])},spotPrice:e,coveredItems:i}}catch(a){throw a instanceof Error?a:new Error("Unknown error occurred while fetching multiple quotes")}}const z={sandbox:"https://api.sandbox.getspot.com/v1/quote",production:"https://api.getspot.com/v1/quote",local:"http://localhost:3999/api/v1/quote"};function E(m){const{apiConfig:t={},quoteRequestData:o,callbacks:s={},location:a,theme:r}=m,{environment:i="sandbox",partnerId:e,customEndpoint:n}=t;if(!e||typeof e!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(n||z[i]))throw new Error(`Invalid environment in apiConfig: ${i}`);if(!o||typeof o!="object"&&!Array.isArray(o))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 h(d,p=null){const l=p!==null?`quoteRequestData[${p}]`:"quoteRequestData";f.forEach(v=>{if(!Object.prototype.hasOwnProperty.call(d,v)||d[v]===void 0||d[v]===null)throw new Error(`Missing required ${l} field: '${v}'`)});const w=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!w.test(d.startDate))throw new Error(`${l}.startDate must be a valid ISO8601 string`);if(!w.test(d.endDate))throw new Error(`${l}.endDate must be a valid ISO8601 string`);if(typeof d.currencyCode!="string")throw new Error(`${l}.currencyCode must be a string`);if(!["USD","CAD","AUD"].includes(d.currencyCode))throw new Error(`Invalid ${l}.currencyCode: ${d.currencyCode}`);if(typeof d.eventType!="string")throw new Error(`${l}.eventType must be a string`);if(typeof d.productType!="string")throw new Error(`${l}.productType must be a string`);const g=["Pass","Trip","Registration"];if(!g.includes(d.productType))throw new Error(`${l}.productType must be one of ${g.join(", ")}`);if(typeof d.productDuration!="string")throw new Error(`${l}.productDuration must be a string`);const b=["Daily","Seasonal","Trip","Event"];if(!b.includes(d.productDuration))throw new Error(`${l}.productDuration must be one of ${b.join(", ")}`);if(typeof d.productPrice!="number"||isNaN(d.productPrice))throw new Error(`${l}.productPrice must be a valid number`);if(typeof d.productId!="string")throw new Error(`${l}.productId must be a string`);if(typeof d.cartId!="string")throw new Error(`${l}.cartId must be a string`);if(typeof d.productName!="string")throw new Error(`${l}.productName must be a string`)}if("cartInfo"in o&&"items"in o){const d=o,{cartInfo:p,items:l}=d;if(!p||typeof p!="object")throw new Error("quoteRequestData.cartInfo must be a non-null object");if(!p.cartId||typeof p.cartId!="string")throw new Error("quoteRequestData.cartInfo.cartId must be a string");if(!p.cartName||typeof p.cartName!="string")throw new Error("quoteRequestData.cartInfo.cartName must be a string");if(!p.currencyCode||typeof p.currencyCode!="string")throw new Error("quoteRequestData.cartInfo.currencyCode must be a string");if(!["USD","CAD","AUD"].includes(p.currencyCode))throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${p.currencyCode}`);if(!Array.isArray(l)||l.length===0)throw new Error("quoteRequestData.items must be a non-empty array");const q=["startDate","endDate","eventType","productType","productDuration","productPrice","productId","productName"];l.forEach((g,b)=>{if(!g||typeof g!="object")throw new Error(`quoteRequestData.items[${b}] must be a non-null object`);const v=`quoteRequestData.items[${b}]`;q.forEach(k=>{if(!Object.prototype.hasOwnProperty.call(g,k)||g[k]===void 0||g[k]===null)throw new Error(`Missing required ${v} field: '${k}'`)});const D=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!D.test(g.startDate))throw new Error(`${v}.startDate must be a valid ISO8601 string`);if(!D.test(g.endDate))throw new Error(`${v}.endDate must be a valid ISO8601 string`);if(typeof g.eventType!="string")throw new Error(`${v}.eventType must be a string`);if(typeof g.productType!="string")throw new Error(`${v}.productType must be a string`);const T=["Pass","Trip","Registration"];if(!T.includes(g.productType))throw new Error(`${v}.productType must be one of ${T.join(", ")}`);if(typeof g.productDuration!="string")throw new Error(`${v}.productDuration must be a string`);const H=["Daily","Seasonal","Trip","Event"];if(!H.includes(g.productDuration))throw new Error(`${v}.productDuration must be one of ${H.join(", ")}`);if(typeof g.productPrice!="number"||isNaN(g.productPrice))throw new Error(`${v}.productPrice must be a valid number`);if(typeof g.productId!="string")throw new Error(`${v}.productId must be a string`);if(typeof g.productName!="string")throw new Error(`${v}.productName must be a string`)})}else if(Array.isArray(o)){if(o.length===0)throw new Error("quoteRequestData array cannot be empty");o.forEach((d,p)=>{if(!d||typeof d!="object")throw new Error(`quoteRequestData[${p}] must be a non-null object`);h(d,p)})}else h(o);if(["onOptIn","onOptOut","onQuoteRetrieved","onError","noMatchingQuote"].forEach(d=>{const p=s[d];if(p&&typeof p!="function")throw new Error(`Callback '${d}' must be a function.`)}),typeof a=="string"&&!document.querySelector(a))throw new Error(`Invalid location selector: '${a}'`);if(r&&typeof r!="object")throw new Error("Theme must be an object with CSS variables, do not include the '--' prefix")}function c(m,{text:t,className:o,parent:s,innerHTML:a,href:r,target:i}={}){const e=document.createElement(m);return o&&(e.className=o),t!=null&&(e.textContent=t),a!=null&&(e.innerHTML=a),r&&"href"in e&&(e.href=r),i&&"target"in e&&(e.target=i),s&&s.appendChild(e),e}function N(m,{name:t,description:o}){c("div",{className:"spot-header__title",text:t,parent:m}),c("div",{className:"spot-header__description",text:o,parent:m})}function M(m,t=[]){const o=c("ul",{className:"spot-benefits__list",parent:m});t.forEach(s=>{const a=c("li",{parent:o});a.innerHTML=`
1
+ (function(C,q){typeof exports=="object"&&typeof module<"u"?module.exports=q():typeof define=="function"&&define.amd?define(q):(C=typeof globalThis<"u"?globalThis:C||self,C.SpotWidget=q())})(this,function(){"use strict";async function C(m,t,o){try{const s=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),n=await s.json();if(!s.ok){const r=new Error((n==null?void 0:n.message)||"Failed to fetch quote");throw r.status=s.status,r.responseBody=n,r}return n}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching quote")}}async function q(m,t,o){try{const s=m.replace("/quote","/quote/batch"),n=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),r=await n.json();if(!n.ok){const i=new Error((r==null?void 0:r.message)||"Failed to fetch batch quote");throw i.status=n.status,i.responseBody=r,i}return r}catch(s){throw s instanceof Error?s:new Error("Unknown error occurred while fetching batch quote")}}async function x(m,t,o){var s;try{const n={cartId:o.cartInfo.cartId,cartName:o.cartInfo.cartName,currencyCode:o.cartInfo.currencyCode,isPartialPayment:o.cartInfo.isPartialPayment||!1,roundTo:o.cartInfo.roundTo||void 0,items:o.items.map((p,u)=>({...p,cartItemId:p.cartItemId||`item-${u+1}`}))},r=await q(m,t,n);if(r.status!=="QUOTES_AVAILABLE"&&r.status!=="QUOTE_AVAILABLE")return{status:"NO_MATCHING_QUOTE"};const i=r.quotes.map(p=>{const u=o.items.find((f,h)=>(f.cartItemId||`item-${h+1}`)===p.cartItemId);return u?u.participantDescription?`${u.productName} - ${u.participantDescription}`:u.productName:`Item ${p.id}`}),e=Math.round((r.totalSpotPrice||r.spotPrice||0)*100)/100;return{status:"QUOTE_AVAILABLE",data:{id:r.quotes?r.quotes.map(p=>p.id).join(","):((s=r.data)==null?void 0:s.id)||"",spotPrice:e,currencyCode:r.currencyCode||"",communication:{...r.communication,yesOptionText:r.communication.yesOptionText.replace(String(r.totalSpotPrice),String(e))},payoutSchedule:r.payoutSchedule.map(p=>({...p,amount:p.amount!==void 0?p.amount:0})),coveredItems:i,originalQuotes:r.quotes||(r.data?[r.data]:[])},spotPrice:e,coveredItems:i}}catch(n){throw n instanceof Error?n:new Error("Unknown error occurred while fetching multiple quotes")}}const z={sandbox:"https://api.sandbox.getspot.com/v1/quote",production:"https://api.getspot.com/v1/quote",local:"http://localhost:3999/api/v1/quote"};function E(m){const{apiConfig:t={},quoteRequestData:o,callbacks:s={},location:n,theme:r}=m,{environment:i="sandbox",partnerId:e,customEndpoint:p}=t;if(!e||typeof e!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(p||z[i]))throw new Error(`Invalid environment in apiConfig: ${i}`);if(!o||typeof o!="object"&&!Array.isArray(o))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 h(c,d=null){const l=d!==null?`quoteRequestData[${d}]`:"quoteRequestData";f.forEach(v=>{if(!Object.prototype.hasOwnProperty.call(c,v)||c[v]===void 0||c[v]===null)throw new Error(`Missing required ${l} field: '${v}'`)});const w=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!w.test(c.startDate))throw new Error(`${l}.startDate must be a valid ISO8601 string`);if(!w.test(c.endDate))throw new Error(`${l}.endDate must be a valid ISO8601 string`);if(typeof c.currencyCode!="string")throw new Error(`${l}.currencyCode must be a string`);if(!["USD","CAD","AUD"].includes(c.currencyCode))throw new Error(`Invalid ${l}.currencyCode: ${c.currencyCode}`);if(typeof c.eventType!="string")throw new Error(`${l}.eventType must be a string`);if(typeof c.productType!="string")throw new Error(`${l}.productType must be a string`);const g=["Pass","Trip","Registration"];if(!g.includes(c.productType))throw new Error(`${l}.productType must be one of ${g.join(", ")}`);if(typeof c.productDuration!="string")throw new Error(`${l}.productDuration must be a string`);const _=["Daily","Seasonal","Trip","Event"];if(!_.includes(c.productDuration))throw new Error(`${l}.productDuration must be one of ${_.join(", ")}`);if(typeof c.productPrice!="number"||isNaN(c.productPrice))throw new Error(`${l}.productPrice must be a valid number`);if(typeof c.productId!="string")throw new Error(`${l}.productId must be a string`);if(typeof c.cartId!="string")throw new Error(`${l}.cartId must be a string`);if(typeof c.productName!="string")throw new Error(`${l}.productName must be a string`)}if("cartInfo"in o&&"items"in o){const c=o,{cartInfo:d,items:l}=c;if(!d||typeof d!="object")throw new Error("quoteRequestData.cartInfo must be a non-null object");if(!d.cartId||typeof d.cartId!="string")throw new Error("quoteRequestData.cartInfo.cartId must be a string");if(!d.cartName||typeof d.cartName!="string")throw new Error("quoteRequestData.cartInfo.cartName must be a string");if(!d.currencyCode||typeof d.currencyCode!="string")throw new Error("quoteRequestData.cartInfo.currencyCode must be a string");if(!["USD","CAD","AUD"].includes(d.currencyCode))throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${d.currencyCode}`);if(!Array.isArray(l)||l.length===0)throw new Error("quoteRequestData.items must be a non-empty array");const b=["startDate","endDate","eventType","productType","productDuration","productPrice","productId","productName"];l.forEach((g,_)=>{if(!g||typeof g!="object")throw new Error(`quoteRequestData.items[${_}] must be a non-null object`);const v=`quoteRequestData.items[${_}]`;b.forEach(k=>{if(!Object.prototype.hasOwnProperty.call(g,k)||g[k]===void 0||g[k]===null)throw new Error(`Missing required ${v} field: '${k}'`)});const T=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!T.test(g.startDate))throw new Error(`${v}.startDate must be a valid ISO8601 string`);if(!T.test(g.endDate))throw new Error(`${v}.endDate must be a valid ISO8601 string`);if(typeof g.eventType!="string")throw new Error(`${v}.eventType must be a string`);if(typeof g.productType!="string")throw new Error(`${v}.productType must be a string`);const D=["Pass","Trip","Registration"];if(!D.includes(g.productType))throw new Error(`${v}.productType must be one of ${D.join(", ")}`);if(typeof g.productDuration!="string")throw new Error(`${v}.productDuration must be a string`);const H=["Daily","Seasonal","Trip","Event"];if(!H.includes(g.productDuration))throw new Error(`${v}.productDuration must be one of ${H.join(", ")}`);if(typeof g.productPrice!="number"||isNaN(g.productPrice))throw new Error(`${v}.productPrice must be a valid number`);if(typeof g.productId!="string")throw new Error(`${v}.productId must be a string`);if(typeof g.productName!="string")throw new Error(`${v}.productName must be a string`)})}else if(Array.isArray(o)){if(o.length===0)throw new Error("quoteRequestData array cannot be empty");o.forEach((c,d)=>{if(!c||typeof c!="object")throw new Error(`quoteRequestData[${d}] must be a non-null object`);h(c,d)})}else h(o);if(["onOptIn","onOptOut","onQuoteRetrieved","onError","noMatchingQuote"].forEach(c=>{const d=s[c];if(d&&typeof d!="function")throw new Error(`Callback '${c}' must be a function.`)}),typeof n=="string"&&!document.querySelector(n))throw new Error(`Invalid location selector: '${n}'`);if(r&&typeof r!="object")throw new Error("Theme must be an object with CSS variables, do not include the '--' prefix")}function a(m,{text:t,className:o,parent:s,innerHTML:n,href:r,target:i}={}){const e=document.createElement(m);return o&&(e.className=o),t!=null&&(e.textContent=t),n!=null&&(e.innerHTML=n),r&&"href"in e&&(e.href=r),i&&"target"in e&&(e.target=i),s&&s.appendChild(e),e}function M(m,{name:t,description:o}){a("div",{className:"spot-header__title",text:t,parent:m}),a("div",{className:"spot-header__description",text:o,parent:m})}function N(m,t=[]){const o=a("ul",{className:"spot-benefits__list",parent:m});t.forEach(s=>{const n=a("li",{parent:o});n.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>`,c("span",{text:s,parent:a})})}function L(m,t=[]){if(!t||t.length===0)return;const o=c("div",{className:"spot-qualifying-reasons__container",parent:m}),s=[...t].sort((e,n)=>e.rank-n.rank),a=c("div",{className:"spot-qualifying-reasons__grid",parent:o}),r={"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 i;try{const e=document.currentScript;if(e!=null&&e.src){const n=new URL(e.src);i=n.origin+n.pathname.replace(/\/[^/]*$/,"/")}else i=window.location.origin+window.location.pathname.replace(/\/[^/]*$/,"/");i+="assets/"}catch{i="./assets/"}s.forEach(e=>{var h,y,d;const n=c("div",{className:"spot-qualifying-reasons__item",parent:a}),u=c("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:n}),f=r[((h=e.benefitType)==null?void 0:h.name)||""]||r[e.name||""];if(f){const p=c("img",{parent:u});p.src=i+f,p.alt=((y=e.benefitType)==null?void 0:y.name)||e.name||"",p.className="spot-qualifying-reasons__icon"}c("span",{className:"spot-qualifying-reasons__label",text:((d=e.benefitType)==null?void 0:d.name)||e.name||"",parent:n})})}function O(m,t=[],o){if(t.length===0||!o||o<=1)return;const s=new Map;t.forEach(p=>{s.set(p,(s.get(p)||0)+1)});const r=Array.from(s.entries()).map(([p,l])=>({item:p,count:l,displayText:l>1?`${l} x ${p}`:p})).sort((p,l)=>{const w=p.item.charAt(0),q=l.item.charAt(0),g=/[a-zA-Z]/.test(w),b=/[a-zA-Z]/.test(q);return!g&&b?-1:g&&!b?1:p.item.localeCompare(l.item,void 0,{sensitivity:"base"})}),i=c("div",{className:"spot-covered-items__container",parent:m}),e=c("div",{className:"spot-covered-items__header",parent:i}),n=c("button",{className:"spot-covered-items__toggle",parent:e});c("span",{className:"spot-covered-items__title",text:`Items Covered in Your Cart (${t.length})`,parent:n});const u=c("div",{className:"spot-covered-items__right-section",parent:n});c("span",{className:"spot-covered-items__view-all",text:"View All",parent:u});const f=c("span",{className:"spot-covered-items__arrow",innerHTML:"▼",parent:u}),h=c("div",{className:"spot-covered-items__content",parent:i}),y=c("ul",{className:"spot-covered-items__list",parent:h});r.forEach(({displayText:p})=>{const l=c("li",{parent:y});c("span",{text:p,parent:l})});let d=!1;h.style.display="none",n.addEventListener("click",p=>{p.stopPropagation(),d=!d,h.style.display=d?"block":"none",f.innerHTML=d?"▲":"▼",n.setAttribute("aria-expanded",d.toString())}),n.setAttribute("aria-expanded","false"),n.setAttribute("aria-controls","covered-items-list"),h.setAttribute("id","covered-items-list")}function P(m,t=[]){const o=c("div",{className:"spot-table__container",parent:m}),s=c("table",{className:"spot-refund__table spot-table--dynamic",parent:o}),a=c("thead",{parent:s}),r=c("tr",{parent:a});c("th",{text:"When you cancel",parent:r}),c("th",{text:"You will receive",parent:r});const i=c("tbody",{parent:s});t.forEach(({text:e,percent:n,amount:u})=>{const f=c("tr",{parent:i});c("td",{text:e,parent:f});const h=n==="Not eligible for refund"?"Not eligible for a refund":`$${u} refund`;c("td",{text:h,parent:f})})}function $(m,t,o){const s=c("div",{className:"spot-selection__options",parent:m}),a=c("label",{className:`spot-selection__option ${t?"selected":""}`,parent:s}),r=c("input",{parent:a});r.type="radio",r.name="selection",r.value="yes",t&&(r.checked=!0),c("strong",{text:o.yesOptionText,parent:a}),c("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:a});const i=c("label",{className:"spot-selection__option",parent:s}),e=c("input",{parent:i});return e.type="radio",e.name="selection",e.value="no",c("span",{text:o.noOptionText,parent:i}),s}function R(m,t){var a;const o=(a=t.communication)==null?void 0:a.paymentTerms,s=c("div",{className:"spot-payment-terms",parent:m});return c("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:s}),c("div",{className:"spot-payment-terms__body",text:o||"",parent:s}),s}function V(m,t,o="bottom-right"){if(o==="top-right"){const e=c("div",{className:"spot-logo__top-right",parent:m});e.innerHTML=`
5
+ </svg>`,a("span",{text:s,parent:n})})}function L(m,t=[]){if(!t||t.length===0)return;const o=a("div",{className:"spot-qualifying-reasons__container",parent:m}),s=[...t].sort((e,p)=>e.rank-p.rank),n=a("div",{className:"spot-qualifying-reasons__grid",parent:o}),r={"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 i;try{const e=document.currentScript;if(e!=null&&e.src){const p=new URL(e.src);i=p.origin+p.pathname.replace(/\/[^/]*$/,"/")}else i=window.location.origin+window.location.pathname.replace(/\/[^/]*$/,"/");i+="assets/"}catch{i="./assets/"}s.forEach(e=>{var h,y,c;const p=a("div",{className:"spot-qualifying-reasons__item",parent:n}),u=a("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:p}),f=r[((h=e.benefitType)==null?void 0:h.name)||""]||r[e.name||""];if(f){const d=a("img",{parent:u});d.src=i+f,d.alt=((y=e.benefitType)==null?void 0:y.name)||e.name||"",d.className="spot-qualifying-reasons__icon"}a("span",{className:"spot-qualifying-reasons__label",text:((c=e.benefitType)==null?void 0:c.name)||e.name||"",parent:p})})}function O(m,t=[],o){if(t.length===0||!o||o<=1)return;const s=new Map;t.forEach(d=>{s.set(d,(s.get(d)||0)+1)});const r=Array.from(s.entries()).map(([d,l])=>({item:d,count:l,displayText:l>1?`${l} x ${d}`:d})).sort((d,l)=>{const w=d.item.charAt(0),b=l.item.charAt(0),g=/[a-zA-Z]/.test(w),_=/[a-zA-Z]/.test(b);return!g&&_?-1:g&&!_?1:d.item.localeCompare(l.item,void 0,{sensitivity:"base"})}),i=a("div",{className:"spot-covered-items__container",parent:m}),e=a("div",{className:"spot-covered-items__header",parent:i}),p=a("button",{className:"spot-covered-items__toggle",parent:e});a("span",{className:"spot-covered-items__title",text:`Items Covered in Your Cart (${t.length})`,parent:p});const u=a("div",{className:"spot-covered-items__right-section",parent:p});a("span",{className:"spot-covered-items__view-all",text:"View All",parent:u});const f=a("span",{className:"spot-covered-items__arrow",innerHTML:"▼",parent:u}),h=a("div",{className:"spot-covered-items__content",parent:i}),y=a("ul",{className:"spot-covered-items__list",parent:h});r.forEach(({displayText:d})=>{const l=a("li",{parent:y});a("span",{text:d,parent:l})});let c=!1;h.style.display="none",p.addEventListener("click",d=>{d.stopPropagation(),c=!c,h.style.display=c?"block":"none",f.innerHTML=c?"▲":"▼",p.setAttribute("aria-expanded",c.toString())}),p.setAttribute("aria-expanded","false"),p.setAttribute("aria-controls","covered-items-list"),h.setAttribute("id","covered-items-list")}function P(m,t=[]){const o=a("div",{className:"spot-table__container",parent:m}),s=a("table",{className:"spot-refund__table spot-table--dynamic",parent:o}),n=a("thead",{parent:s}),r=a("tr",{parent:n});a("th",{text:"When you cancel",parent:r}),a("th",{text:"You will receive",parent:r});const i=a("tbody",{parent:s});t.forEach(({text:e,percent:p,amount:u})=>{const f=a("tr",{parent:i});a("td",{text:e,parent:f});const h=p==="Not eligible for refund"?"Not eligible for a refund":`$${u} refund`;a("td",{text:h,parent:f})})}function $(m,t,o){const s=a("div",{className:"spot-selection__options",parent:m}),n=a("label",{className:`spot-selection__option ${t?"selected":""}`,parent:s}),r=a("input",{parent:n});r.type="radio",r.name="selection",r.value="yes",t&&(r.checked=!0),a("strong",{text:o.yesOptionText,parent:n}),a("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:n});const i=a("label",{className:"spot-selection__option",parent:s}),e=a("input",{parent:i});return e.type="radio",e.name="selection",e.value="no",a("span",{text:o.noOptionText,parent:i}),s}function R(m,t){var n;const o=(n=t.communication)==null?void 0:n.paymentTerms,s=a("div",{className:"spot-payment-terms",parent:m});return a("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:s}),a("div",{className:"spot-payment-terms__body",text:o||"",parent:s}),s}function V(m,t,o="bottom-right"){if(o==="top-right"){const e=a("div",{className:"spot-logo__top-right",parent:m});e.innerHTML=`
6
6
  <svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
7
7
  <rect width="145" height="28"/>
8
8
  <rect x="-655" y="-270" width="819" height="325" rx="10"/>
@@ -17,7 +17,7 @@
17
17
  <rect width="45.405" height="14.8867" fill="white" transform="translate(87 8)"/>
18
18
  </clipPath>
19
19
  </defs>
20
- </svg>`}const s=c("div",{className:"spot-footer__container",parent:m}),a=c("div",{className:"spot-footer__terms",parent:s}),r=`<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`,i=t.communication.legalDisclaimer.replace(/terms (and|&) conditions/gi,r);if(c("span",{innerHTML:i,parent:a}),o==="bottom-right"){const e=c("p",{className:"spot-footer__powered-by",parent:s});e.innerHTML=`
20
+ </svg>`}const s=a("div",{className:"spot-footer__container",parent:m}),n=a("div",{className:"spot-footer__terms",parent:s}),r=`<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`,i=t.communication.legalDisclaimer.replace(/terms (and|&) conditions/gi,r);if(a("span",{innerHTML:i,parent:n}),o==="bottom-right"){const e=a("p",{className:"spot-footer__powered-by",parent:s});e.innerHTML=`
21
21
  <svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
22
22
  <rect width="145" height="28"/>
23
23
  <rect x="-655" y="-270" width="819" height="325" rx="10"/>
@@ -32,4 +32,4 @@
32
32
  <rect width="45.405" height="14.8867" fill="white" transform="translate(87 8)"/>
33
33
  </clipPath>
34
34
  </defs>
35
- </svg>`}return s}const S=":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--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-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:.0625rem solid #e0e0e0;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__options{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__options{grid-row:3;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;padding-left:.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)}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-payment-terms__wrapper{margin-top:1rem}.spot-payment-terms__header{font-weight:var(--spot-payment-terms-header-font-weight);margin-bottom:.5rem;padding:var(--spot-payment-terms-header-padding);font-size:var(--spot-payment-terms-header-font-size);border-bottom:1px solid var(--spot-payment-terms-header-border-color)}.spot-payment-terms{background-color:var(--spot-payment-terms-background);border-radius:var(--spot-payment-terms-border-radius);padding:var(--spot-payment-terms-padding);margin-right:.5rem;color:var(--spot-payment-terms-font-color);font-size:var(--spot-payment-terms-font-size)}.spot-footer__terms{margin-top:.625rem;margin-right:.25rem;font-size:var(--spot-terms-font-size);font-weight:var(--spot-terms-font-weight);color:var(--spot-terms-font-color);font-family:var(--spot-terms-font-family);padding:var(--spot-terms-padding);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:#fff;padding:0 8px}@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 Q(m){const t=document.createElement("style");t.textContent=m,document.head.appendChild(t)}Q(S);const I={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 A{constructor(t={}){this.options={location:"body",showTable:!0,optInSelected:!1,logoPosition:"bottom-right",apiConfig:{environment:"production",partnerId:""},quoteRequestData:{},callbacks:{},useMockData:!1,...t},this._onResize=this._updateLayout.bind(this),this.root=typeof this.options.location=="string"?document.querySelector(this.options.location):this.options.location,this.currentSelection=this.options.optInSelected?"yes":null,this._init()}async _init(){var t,o,s,a,r;try{E(this.options);let i;if(this.options.useMockData&&this.options.mockData)i=this.options.mockData;else{const{environment:e,partnerId:n}=this.options.apiConfig,f=this.options.apiConfig.customEndpoint||I[e];i="cartInfo"in this.options.quoteRequestData&&"items"in this.options.quoteRequestData?await x(f,n,this.options.quoteRequestData):await _(f,n,this.options.quoteRequestData)}if(i.status!=="QUOTE_AVAILABLE"){i.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=i.data,!this.quote)throw new Error("No quote data in response");if(this._renderWidget(),this.options.optInSelected&&((o=this.options.callbacks)!=null&&o.onOptIn)){const e={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const n=this.options.quoteRequestData;e.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var h;const f=(h=n.items)==null?void 0:h.find(y=>(y.cartItemId||`item-${n.items.indexOf(y)+1}`)===u.cartItemId);return{quoteId:u.id,productPrice:(f==null?void 0:f.productPrice)||u.spotPrice,cartItemId:(f==null?void 0:f.cartItemId)||""}})}this.options.callbacks.onOptIn(e)}if((s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const e=this.options.callbacks.onQuoteRetrieved(this.quote);e&&this._applyQuoteUpdates(e)}}catch(i){if((a=this.options.callbacks)!=null&&a.onError){const e=i;(r=this.options.callbacks)==null||r.onError({message:e.message,status:e.status,responseBody:e.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(([s,a])=>{const r=`--${s}`;this.container.style.setProperty(r,a)}),N(this.container,this.quote.communication);const t=document.createElement("div");if(t.className="spot-content__wrapper",this.container.appendChild(t),this.quote.qualifyingReasons?L(t,this.quote.qualifyingReasons):M(t,this.quote.communication.bulletPoints),this.quote.coveredItems){const s=this._getTotalItemsInRequest();O(t,this.quote.coveredItems,s)}this.options.showTable&&!this.quote.qualifyingReasons&&P(t,this.quote.payoutSchedule);const o=$(t,this.options.optInSelected,this.quote.communication);t.appendChild(o),this.paymentTermsEl=c("div",{className:"spot-payment-terms__wrapper",parent:t}),V(this.container,this.quote,this.options.logoPosition),window.addEventListener("resize",this._onResize),this._setupResizeObserver(),this._updateLayout(),this._setupOptionListeners(o)}_updateLayout(){if(!this.container||!this.quote)return;const t=this.container.querySelector(".spot-content__wrapper"),o=this.options.showTable&&!this.quote.qualifyingReasons;if(!t||!o){t==null||t.classList.remove("desktop-layout");return}const s=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",s)}_shouldUseDesktopLayout(t){const o=this.container.offsetWidth-40,s=325,a=16;if(o>=900)return!0;if(o>=650){const r=t.classList.contains("desktop-layout");t.classList.remove("desktop-layout"),t.offsetHeight;const i=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!i)return r&&t.classList.add("desktop-layout"),r;const n=Math.min(i.scrollWidth,400)+s+a;return r&&t.classList.add("desktop-layout"),o>=n}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"cartInfo"in this.options.quoteRequestData&&"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())}_setupOptionListeners(t){const o=t.querySelectorAll('input[type="radio"]'),s=t.querySelectorAll(".spot-selection__option");o.forEach(a=>{a.addEventListener("change",r=>{var n,u,f;const i=r.target,e=i.value;if(this.hideSelectionError(),this.currentSelection=e,s.forEach(h=>h.classList.remove("selected")),(n=i.closest(".spot-selection__option"))==null||n.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),e==="yes"&&(this.options.quoteRequestData.isPartialPayment&&R(this.paymentTermsEl,this.quote),(u=this.options.callbacks)!=null&&u.onOptIn)){const h={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const y=this.options.quoteRequestData;h.batchQuoteDetails=this.quote.originalQuotes.map(d=>{var l;const p=(l=y.items)==null?void 0:l.find(w=>(w.cartItemId||`item-${y.items.indexOf(w)+1}`)===d.cartItemId);return{quoteId:d.id,productPrice:(p==null?void 0:p.productPrice)||d.spotPrice,cartItemId:(p==null?void 0:p.cartItemId)||""}})}this.options.callbacks.onOptIn(h)}if(e==="no"&&((f=this.options.callbacks)!=null&&f.onOptOut)){const h={status:"QUOTE_DECLINED",quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const y=this.options.quoteRequestData;h.batchQuoteDetails=this.quote.originalQuotes.map(d=>{var l;const p=(l=y.items)==null?void 0:l.find(w=>(w.cartItemId||`item-${y.items.indexOf(w)+1}`)===d.cartItemId);return{quoteId:d.id,productPrice:(p==null?void 0:p.productPrice)||d.spotPrice,cartItemId:(p==null?void 0:p.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 o=(t=this.container)==null?void 0:t.querySelector(".spot-selection__options");o&&o.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 o,s,a,r;try{const i={...this.options,quoteRequestData:t};E(i);const{environment:e,partnerId:n,customEndpoint:u}=this.options.apiConfig,f=u||I[e],y="cartInfo"in i.quoteRequestData&&"items"in i.quoteRequestData?await x(f,n,i.quoteRequestData):await _(f,n,i.quoteRequestData);if(y.status!=="QUOTE_AVAILABLE")return y.status==="NO_MATCHING_QUOTE"&&((o=this.options.callbacks)!=null&&o.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:i.quoteRequestData}),!1;if(this.options.quoteRequestData=i.quoteRequestData,this.quote=y.data,this.currentSelection=null,this.destroy(),this._renderWidget(),(s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const d=this.options.callbacks.onQuoteRetrieved(this.quote);d&&this._applyQuoteUpdates(d)}return!0}catch(i){const e=i;return(r=(a=this.options.callbacks)==null?void 0:a.onError)==null||r.call(a,{message:e.message,status:e.status,responseBody:e.responseBody}),!1}}getSelection(){var o,s,a;if(this.currentSelection==null)return null;const t={selection:this.currentSelection,quoteId:(o=this.quote)==null?void 0:o.id,spotPrice:(s=this.quote)==null?void 0:s.spotPrice,status:this.currentSelection==="yes"?"QUOTE_ACCEPTED":"QUOTE_DECLINED"};if((a=this.quote)!=null&&a.originalQuotes&&this.quote.originalQuotes.length>0){const r=this.options.quoteRequestData;t.batchQuoteDetails=this.quote.originalQuotes.map(i=>{var n;const e=(n=r.items)==null?void 0:n.find(u=>(u.cartItemId||`item-${r.items.indexOf(u)+1}`)===i.cartItemId);return{quoteId:i.id,productPrice:(e==null?void 0:e.productPrice)||i.spotPrice,cartItemId:(e==null?void 0:e.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)}}return A});
35
+ </svg>`}return s}const S=":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--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-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:.0625rem solid #e0e0e0;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__options{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__options{grid-row:3;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;padding-left:.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)}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-payment-terms__wrapper{margin-top:1rem}.spot-payment-terms__header{font-weight:var(--spot-payment-terms-header-font-weight);margin-bottom:.5rem;padding:var(--spot-payment-terms-header-padding);font-size:var(--spot-payment-terms-header-font-size);border-bottom:1px solid var(--spot-payment-terms-header-border-color)}.spot-payment-terms{background-color:var(--spot-payment-terms-background);border-radius:var(--spot-payment-terms-border-radius);padding:var(--spot-payment-terms-padding);margin-right:.5rem;color:var(--spot-payment-terms-font-color);font-size:var(--spot-payment-terms-font-size)}.spot-footer__terms{margin-top:.625rem;margin-right:.25rem;font-size:var(--spot-terms-font-size);font-weight:var(--spot-terms-font-weight);color:var(--spot-terms-font-color);font-family:var(--spot-terms-font-family);padding:var(--spot-terms-padding);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:#fff;padding:0 8px}@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 Q(m){const t=document.createElement("style");t.textContent=m,document.head.appendChild(t)}Q(S);const I={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 A{constructor(t={}){this.options={location:"body",showTable:!0,optInSelected:!1,logoPosition:"bottom-right",apiConfig:{environment:"production",partnerId:""},quoteRequestData:{},callbacks:{},useMockData:!1,...t},this._onResize=this._updateLayout.bind(this),this.root=typeof this.options.location=="string"?document.querySelector(this.options.location):this.options.location,this.currentSelection=this.options.optInSelected?"yes":null,this._init()}async _init(){var t,o,s,n,r;try{E(this.options);let i;if(this.options.useMockData&&this.options.mockData)i=this.options.mockData;else{const{environment:e,partnerId:p}=this.options.apiConfig,f=this.options.apiConfig.customEndpoint||I[e];i="cartInfo"in this.options.quoteRequestData&&"items"in this.options.quoteRequestData?await x(f,p,this.options.quoteRequestData):await C(f,p,this.options.quoteRequestData)}if(i.status!=="QUOTE_AVAILABLE"){i.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=i.data,!this.quote)throw new Error("No quote data in response");if(this._renderWidget(),this.options.optInSelected&&((o=this.options.callbacks)!=null&&o.onOptIn)){const e={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const p=this.options.quoteRequestData;e.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var h;const f=(h=p.items)==null?void 0:h.find(y=>(y.cartItemId||`item-${p.items.indexOf(y)+1}`)===u.cartItemId);return{quoteId:u.id,productPrice:(f==null?void 0:f.productPrice)||u.spotPrice,cartItemId:(f==null?void 0:f.cartItemId)||""}})}this.options.callbacks.onOptIn(e)}if((s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const e=this.options.callbacks.onQuoteRetrieved(this.quote);e&&this._applyQuoteUpdates(e)}}catch(i){if((n=this.options.callbacks)!=null&&n.onError){const e=i;(r=this.options.callbacks)==null||r.onError({message:e.message,status:e.status,responseBody:e.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(([s,n])=>{const r=`--${s}`;this.container.style.setProperty(r,n)}),M(this.container,this.quote.communication);const t=document.createElement("div");if(t.className="spot-content__wrapper",this.container.appendChild(t),this.quote.qualifyingReasons?L(t,this.quote.qualifyingReasons):N(t,this.quote.communication.bulletPoints),this.quote.coveredItems){const s=this._getTotalItemsInRequest();O(t,this.quote.coveredItems,s)}this.options.showTable&&!this.quote.qualifyingReasons&&P(t,this.quote.payoutSchedule);const o=$(t,this.options.optInSelected,this.quote.communication);t.appendChild(o),this.paymentTermsEl=a("div",{className:"spot-payment-terms__wrapper",parent:t}),V(this.container,this.quote,this.options.logoPosition),window.addEventListener("resize",this._onResize),this._setupResizeObserver(),this._updateLayout(),this._setupOptionListeners(o)}_updateLayout(){if(!this.container||!this.quote)return;const t=this.container.querySelector(".spot-content__wrapper"),o=this.options.showTable&&!this.quote.qualifyingReasons;if(!t||!o){t==null||t.classList.remove("desktop-layout");return}const s=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",s)}_shouldUseDesktopLayout(t){const o=this.container.offsetWidth-40,s=325,n=16;if(o>=900)return!0;if(o>=650){const r=t.classList.contains("desktop-layout");t.classList.remove("desktop-layout"),t.offsetHeight;const i=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!i)return r&&t.classList.add("desktop-layout"),r;const p=Math.min(i.scrollWidth,400)+s+n;return r&&t.classList.add("desktop-layout"),o>=p}return!1}_setupResizeObserver(){!this.container||!window.ResizeObserver||(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=window.setTimeout(()=>{this._updateLayout()},100)}),this._resizeObserver.observe(this.container))}_getTotalItemsInRequest(){return"cartInfo"in this.options.quoteRequestData&&"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())}_setupOptionListeners(t){const o=t.querySelectorAll('input[type="radio"]'),s=t.querySelectorAll(".spot-selection__option");o.forEach(n=>{n.addEventListener("change",r=>{var p,u,f,h;const i=r.target,e=i.value;if(this.hideSelectionError(),this.currentSelection=e,s.forEach(y=>y.classList.remove("selected")),(p=i.closest(".spot-selection__option"))==null||p.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),e==="yes"&&((u=this.quote)!=null&&u.communication.paymentTerms&&R(this.paymentTermsEl,this.quote),(f=this.options.callbacks)!=null&&f.onOptIn)){const y={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const c=this.options.quoteRequestData;y.batchQuoteDetails=this.quote.originalQuotes.map(d=>{var w;const l=(w=c.items)==null?void 0:w.find(b=>(b.cartItemId||`item-${c.items.indexOf(b)+1}`)===d.cartItemId);return{quoteId:d.id,productPrice:(l==null?void 0:l.productPrice)||d.spotPrice,cartItemId:(l==null?void 0:l.cartItemId)||""}})}this.options.callbacks.onOptIn(y)}if(e==="no"&&((h=this.options.callbacks)!=null&&h.onOptOut)){const y={status:"QUOTE_DECLINED",quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const c=this.options.quoteRequestData;y.batchQuoteDetails=this.quote.originalQuotes.map(d=>{var w;const l=(w=c.items)==null?void 0:w.find(b=>(b.cartItemId||`item-${c.items.indexOf(b)+1}`)===d.cartItemId);return{quoteId:d.id,productPrice:(l==null?void 0:l.productPrice)||d.spotPrice,cartItemId:(l==null?void 0:l.cartItemId)||""}})}this.options.callbacks.onOptOut(y)}})})}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 o=(t=this.container)==null?void 0:t.querySelector(".spot-selection__options");o&&o.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 o,s,n,r;try{const i={...this.options,quoteRequestData:t};E(i);const{environment:e,partnerId:p,customEndpoint:u}=this.options.apiConfig,f=u||I[e],y="cartInfo"in i.quoteRequestData&&"items"in i.quoteRequestData?await x(f,p,i.quoteRequestData):await C(f,p,i.quoteRequestData);if(y.status!=="QUOTE_AVAILABLE")return this.destroy(),y.status==="NO_MATCHING_QUOTE"&&((o=this.options.callbacks)!=null&&o.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:i.quoteRequestData}),!1;if(this.options.quoteRequestData=i.quoteRequestData,this.quote=y.data,this.currentSelection=null,this.destroy(),this._renderWidget(),(s=this.options.callbacks)!=null&&s.onQuoteRetrieved){const c=this.options.callbacks.onQuoteRetrieved(this.quote);c&&this._applyQuoteUpdates(c)}return!0}catch(i){const e=i;return(r=(n=this.options.callbacks)==null?void 0:n.onError)==null||r.call(n,{message:e.message,status:e.status,responseBody:e.responseBody}),!1}}getSelection(){var o,s,n;if(this.currentSelection==null)return null;const t={selection:this.currentSelection,quoteId:(o=this.quote)==null?void 0:o.id,spotPrice:(s=this.quote)==null?void 0:s.spotPrice,status:this.currentSelection==="yes"?"QUOTE_ACCEPTED":"QUOTE_DECLINED"};if((n=this.quote)!=null&&n.originalQuotes&&this.quote.originalQuotes.length>0){const r=this.options.quoteRequestData;t.batchQuoteDetails=this.quote.originalQuotes.map(i=>{var p;const e=(p=r.items)==null?void 0:p.find(u=>(u.cartItemId||`item-${r.items.indexOf(u)+1}`)===i.cartItemId);return{quoteId:i.id,productPrice:(e==null?void 0:e.productPrice)||i.spotPrice,cartItemId:(e==null?void 0:e.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)}}return A});
package/dist/types.d.ts CHANGED
@@ -15,6 +15,7 @@ export interface CartInfo {
15
15
  currencyCode: "USD" | "CAD" | "AUD";
16
16
  metadata?: QuoteMetadata;
17
17
  isPartialPayment?: boolean;
18
+ roundTo?: number;
18
19
  }
19
20
  export interface QuoteItem {
20
21
  productPrice: number;
@@ -38,8 +39,9 @@ export interface QuoteItem {
38
39
  hostCountryState?: string;
39
40
  destinations?: string[];
40
41
  dob?: string;
42
+ roundTo?: number;
41
43
  }
42
- type BatchItem = Omit<QuoteItem, "cartName" | "cartItemId" | "cartId" | "currencyCode" | "isPartialPayment" | "metadata">;
44
+ type BatchItem = Omit<QuoteItem, "cartName" | "cartItemId" | "cartId" | "currencyCode" | "isPartialPayment" | "metadata" | "roundTo">;
43
45
  export interface BatchQuoteItem extends BatchItem {
44
46
  cartItemId: string;
45
47
  }
@@ -47,6 +49,15 @@ export interface BatchQuoteRequest {
47
49
  cartInfo: CartInfo;
48
50
  items: BatchQuoteItem[];
49
51
  }
52
+ export interface ApiBatchQuoteRequest {
53
+ cartId: string;
54
+ cartName: string;
55
+ currencyCode: "USD" | "CAD" | "AUD";
56
+ metadata?: QuoteMetadata;
57
+ isPartialPayment?: boolean;
58
+ roundTo?: number;
59
+ items: BatchQuoteItem[];
60
+ }
50
61
  export type QuoteRequestData = QuoteItem | BatchQuoteRequest;
51
62
  export interface QualifyingReason {
52
63
  rank: 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;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACpC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,W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AC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,gBAAgB,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9E;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC;IAC5C,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,MAAM,WAAW,QAAS,SAAQ,KAAK;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getspot/spot-widget",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },