@getspot/spot-widget 3.3.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- async function x(m, t, o) {
1
+ async function D(m, t, o) {
2
2
  try {
3
3
  const s = await fetch(m, {
4
4
  method: "POST",
@@ -7,52 +7,52 @@ async function x(m, t, o) {
7
7
  "X-Spot-Partner-Id": t
8
8
  },
9
9
  body: JSON.stringify(o)
10
- }), n = await s.json();
10
+ }), i = await s.json();
11
11
  if (!s.ok) {
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;
12
+ const r = new Error((i == null ? void 0 : i.message) || "Failed to fetch quote");
13
+ throw r.status = s.status, r.responseBody = i, r;
14
14
  }
15
- return n;
15
+ return i;
16
16
  } catch (s) {
17
17
  throw s instanceof Error ? s : new Error("Unknown error occurred while fetching quote");
18
18
  }
19
19
  }
20
- async function H(m, t, o) {
20
+ async function L(m, t, o) {
21
21
  try {
22
- const s = m.replace("/quote", "/quote/batch"), n = await fetch(s, {
22
+ const s = m.replace("/quote", "/quote/batch"), i = 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 n.json();
30
- if (!n.ok) {
31
- const i = new Error((r == null ? void 0 : r.message) || "Failed to fetch batch quote");
32
- throw i.status = n.status, i.responseBody = r, i;
29
+ }), r = await i.json();
30
+ if (!i.ok) {
31
+ const n = new Error((r == null ? void 0 : r.message) || "Failed to fetch batch quote");
32
+ throw n.status = i.status, n.responseBody = r, n;
33
33
  }
34
34
  return r;
35
35
  } catch (s) {
36
36
  throw s instanceof Error ? s : new Error("Unknown error occurred while fetching batch quote");
37
37
  }
38
38
  }
39
- async function I(m, t, o) {
39
+ async function H(m, t, o) {
40
40
  var s;
41
41
  try {
42
- const n = {
43
- cartId: o.cartInfo.cartId,
44
- cartName: o.cartInfo.cartName,
45
- currencyCode: o.cartInfo.currencyCode,
46
- isPartialPayment: o.cartInfo.isPartialPayment || !1,
47
- roundTo: o.cartInfo.roundTo || void 0,
42
+ const i = {
43
+ cartId: o.cartId,
44
+ cartName: o.cartName,
45
+ currencyCode: o.currencyCode,
46
+ isPartialPayment: o.isPartialPayment || !1,
47
+ roundTo: o.roundTo || void 0,
48
48
  items: o.items.map((p, u) => ({
49
49
  ...p,
50
50
  cartItemId: p.cartItemId || `item-${u + 1}`
51
51
  }))
52
- }, r = await H(m, t, n);
52
+ }, r = await L(m, t, i);
53
53
  if (r.status !== "QUOTES_AVAILABLE" && r.status !== "QUOTE_AVAILABLE")
54
54
  return { status: "NO_MATCHING_QUOTE" };
55
- const i = r.quotes.map((p) => {
55
+ const n = r.quotes.map((p) => {
56
56
  const u = o.items.find(
57
57
  (f, h) => (f.cartItemId || `item-${h + 1}`) === p.cartItemId
58
58
  );
@@ -75,37 +75,37 @@ async function I(m, t, o) {
75
75
  ...p,
76
76
  amount: p.amount !== void 0 ? p.amount : 0
77
77
  })),
78
- coveredItems: i,
78
+ coveredItems: n,
79
79
  originalQuotes: r.quotes || (r.data ? [r.data] : [])
80
80
  },
81
81
  spotPrice: e,
82
- coveredItems: i
82
+ coveredItems: n
83
83
  };
84
- } catch (n) {
85
- throw n instanceof Error ? n : new Error("Unknown error occurred while fetching multiple quotes");
84
+ } catch (i) {
85
+ throw i instanceof Error ? i : new Error("Unknown error occurred while fetching multiple quotes");
86
86
  }
87
87
  }
88
- const z = {
88
+ const M = {
89
89
  sandbox: "https://api.sandbox.getspot.com/v1/quote",
90
90
  production: "https://api.getspot.com/v1/quote",
91
91
  local: "http://localhost:3999/api/v1/quote"
92
92
  };
93
- function T(m) {
93
+ function z(m) {
94
94
  const {
95
95
  apiConfig: t = {},
96
96
  quoteRequestData: o,
97
97
  callbacks: s = {},
98
- location: n,
98
+ location: i,
99
99
  theme: r
100
100
  } = m, {
101
- environment: i = "sandbox",
101
+ environment: n = "sandbox",
102
102
  partnerId: e,
103
103
  customEndpoint: p
104
104
  } = t;
105
105
  if (!e || typeof e != "string")
106
106
  throw new Error("Invalid or missing partnerId in apiConfig");
107
- if (!(p || z[i]))
108
- throw new Error(`Invalid environment in apiConfig: ${i}`);
107
+ if (!(p || M[n]))
108
+ throw new Error(`Invalid environment in apiConfig: ${n}`);
109
109
  if (!o || typeof o != "object" && !Array.isArray(o))
110
110
  throw new Error("quoteRequestData must be a non-null object or array");
111
111
  const f = [
@@ -120,61 +120,59 @@ function T(m) {
120
120
  "cartId",
121
121
  "productName"
122
122
  ];
123
- function h(c, d = null) {
124
- const l = d !== null ? `quoteRequestData[${d}]` : "quoteRequestData";
125
- f.forEach((v) => {
126
- if (!Object.prototype.hasOwnProperty.call(c, v) || c[v] === void 0 || c[v] === null)
127
- throw new Error(`Missing required ${l} field: '${v}'`);
123
+ function h(c, l = null) {
124
+ const d = l !== null ? `quoteRequestData[${l}]` : "quoteRequestData";
125
+ f.forEach((g) => {
126
+ if (!Object.prototype.hasOwnProperty.call(c, g) || c[g] === void 0 || c[g] === null)
127
+ throw new Error(`Missing required ${d} field: '${g}'`);
128
128
  });
129
- const w = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
130
- if (!w.test(c.startDate))
131
- throw new Error(`${l}.startDate must be a valid ISO8601 string`);
132
- if (!w.test(c.endDate))
133
- throw new Error(`${l}.endDate must be a valid ISO8601 string`);
129
+ const y = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
130
+ if (!y.test(c.startDate))
131
+ throw new Error(`${d}.startDate must be a valid ISO8601 string`);
132
+ if (!y.test(c.endDate))
133
+ throw new Error(`${d}.endDate must be a valid ISO8601 string`);
134
134
  if (typeof c.currencyCode != "string")
135
- throw new Error(`${l}.currencyCode must be a string`);
135
+ throw new Error(`${d}.currencyCode must be a string`);
136
136
  if (!["USD", "CAD", "AUD"].includes(c.currencyCode))
137
- throw new Error(`Invalid ${l}.currencyCode: ${c.currencyCode}`);
137
+ throw new Error(`Invalid ${d}.currencyCode: ${c.currencyCode}`);
138
138
  if (typeof c.eventType != "string")
139
- throw new Error(`${l}.eventType must be a string`);
139
+ throw new Error(`${d}.eventType must be a string`);
140
140
  if (typeof c.productType != "string")
141
- throw new Error(`${l}.productType must be a string`);
142
- const g = ["Pass", "Trip", "Registration"];
143
- if (!g.includes(c.productType))
141
+ throw new Error(`${d}.productType must be a string`);
142
+ const q = ["Pass", "Trip", "Registration"];
143
+ if (!q.includes(c.productType))
144
144
  throw new Error(
145
- `${l}.productType must be one of ${g.join(", ")}`
145
+ `${d}.productType must be one of ${q.join(", ")}`
146
146
  );
147
147
  if (typeof c.productDuration != "string")
148
- throw new Error(`${l}.productDuration must be a string`);
149
- const _ = ["Daily", "Seasonal", "Trip", "Event"];
150
- if (!_.includes(c.productDuration))
148
+ throw new Error(`${d}.productDuration must be a string`);
149
+ const C = ["Daily", "Seasonal", "Trip", "Event"];
150
+ if (!C.includes(c.productDuration))
151
151
  throw new Error(
152
- `${l}.productDuration must be one of ${_.join(", ")}`
152
+ `${d}.productDuration must be one of ${C.join(", ")}`
153
153
  );
154
154
  if (typeof c.productPrice != "number" || isNaN(c.productPrice))
155
- throw new Error(`${l}.productPrice must be a valid number`);
155
+ throw new Error(`${d}.productPrice must be a valid number`);
156
156
  if (typeof c.productId != "string")
157
- throw new Error(`${l}.productId must be a string`);
157
+ throw new Error(`${d}.productId must be a string`);
158
158
  if (typeof c.cartId != "string")
159
- throw new Error(`${l}.cartId must be a string`);
159
+ throw new Error(`${d}.cartId must be a string`);
160
160
  if (typeof c.productName != "string")
161
- throw new Error(`${l}.productName must be a string`);
161
+ throw new Error(`${d}.productName must be a string`);
162
162
  }
163
- if ("cartInfo" in o && "items" in o) {
164
- const c = o, { cartInfo: d, items: l } = c;
165
- if (!d || typeof d != "object")
166
- throw new Error("quoteRequestData.cartInfo must be a non-null object");
167
- if (!d.cartId || typeof d.cartId != "string")
168
- throw new Error("quoteRequestData.cartInfo.cartId must be a string");
169
- if (!d.cartName || typeof d.cartName != "string")
170
- throw new Error("quoteRequestData.cartInfo.cartName must be a string");
171
- if (!d.currencyCode || typeof d.currencyCode != "string")
172
- throw new Error("quoteRequestData.cartInfo.currencyCode must be a string");
173
- if (!["USD", "CAD", "AUD"].includes(d.currencyCode))
174
- throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${d.currencyCode}`);
175
- if (!Array.isArray(l) || l.length === 0)
163
+ if ("items" in o) {
164
+ const c = o, { cartId: l, cartName: d, currencyCode: y, items: w } = c;
165
+ if (!l || typeof l != "string")
166
+ throw new Error("quoteRequestData.cartId must be a string");
167
+ if (!d || typeof d != "string")
168
+ throw new Error("quoteRequestData.cartName must be a string");
169
+ if (!y || typeof y != "string")
170
+ throw new Error("quoteRequestData.currencyCode must be a string");
171
+ if (!["USD", "CAD", "AUD"].includes(y))
172
+ throw new Error(`Invalid quoteRequestData.currencyCode: ${y}`);
173
+ if (!Array.isArray(w) || w.length === 0)
176
174
  throw new Error("quoteRequestData.items must be a non-empty array");
177
- const b = [
175
+ const C = [
178
176
  "startDate",
179
177
  "endDate",
180
178
  "eventType",
@@ -184,45 +182,45 @@ function T(m) {
184
182
  "productId",
185
183
  "productName"
186
184
  ];
187
- l.forEach((g, _) => {
185
+ w.forEach((g, k) => {
188
186
  if (!g || typeof g != "object")
189
- throw new Error(`quoteRequestData.items[${_}] must be a non-null object`);
190
- const v = `quoteRequestData.items[${_}]`;
191
- b.forEach((C) => {
192
- if (!Object.prototype.hasOwnProperty.call(g, C) || g[C] === void 0 || g[C] === null)
193
- throw new Error(`Missing required ${v} field: '${C}'`);
187
+ throw new Error(`quoteRequestData.items[${k}] must be a non-null object`);
188
+ const _ = `quoteRequestData.items[${k}]`;
189
+ C.forEach((E) => {
190
+ if (!Object.prototype.hasOwnProperty.call(g, E) || g[E] === void 0 || g[E] === null)
191
+ throw new Error(`Missing required ${_} field: '${E}'`);
194
192
  });
195
- const q = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
196
- if (!q.test(g.startDate))
197
- throw new Error(`${v}.startDate must be a valid ISO8601 string`);
198
- if (!q.test(g.endDate))
199
- throw new Error(`${v}.endDate must be a valid ISO8601 string`);
193
+ const x = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
194
+ if (!x.test(g.startDate))
195
+ throw new Error(`${_}.startDate must be a valid ISO8601 string`);
196
+ if (!x.test(g.endDate))
197
+ throw new Error(`${_}.endDate must be a valid ISO8601 string`);
200
198
  if (typeof g.eventType != "string")
201
- throw new Error(`${v}.eventType must be a string`);
199
+ throw new Error(`${_}.eventType must be a string`);
202
200
  if (typeof g.productType != "string")
203
- throw new Error(`${v}.productType must be a string`);
204
- const k = ["Pass", "Trip", "Registration"];
205
- if (!k.includes(g.productType))
206
- throw new Error(`${v}.productType must be one of ${k.join(", ")}`);
201
+ throw new Error(`${_}.productType must be a string`);
202
+ const T = ["Pass", "Trip", "Registration"];
203
+ if (!T.includes(g.productType))
204
+ throw new Error(`${_}.productType must be one of ${T.join(", ")}`);
207
205
  if (typeof g.productDuration != "string")
208
- throw new Error(`${v}.productDuration must be a string`);
209
- const E = ["Daily", "Seasonal", "Trip", "Event"];
210
- if (!E.includes(g.productDuration))
211
- throw new Error(`${v}.productDuration must be one of ${E.join(", ")}`);
206
+ throw new Error(`${_}.productDuration must be a string`);
207
+ const I = ["Daily", "Seasonal", "Trip", "Event"];
208
+ if (!I.includes(g.productDuration))
209
+ throw new Error(`${_}.productDuration must be one of ${I.join(", ")}`);
212
210
  if (typeof g.productPrice != "number" || isNaN(g.productPrice))
213
- throw new Error(`${v}.productPrice must be a valid number`);
211
+ throw new Error(`${_}.productPrice must be a valid number`);
214
212
  if (typeof g.productId != "string")
215
- throw new Error(`${v}.productId must be a string`);
213
+ throw new Error(`${_}.productId must be a string`);
216
214
  if (typeof g.productName != "string")
217
- throw new Error(`${v}.productName must be a string`);
215
+ throw new Error(`${_}.productName must be a string`);
218
216
  });
219
217
  } else if (Array.isArray(o)) {
220
218
  if (o.length === 0)
221
219
  throw new Error("quoteRequestData array cannot be empty");
222
- o.forEach((c, d) => {
220
+ o.forEach((c, l) => {
223
221
  if (!c || typeof c != "object")
224
- throw new Error(`quoteRequestData[${d}] must be a non-null object`);
225
- h(c, d);
222
+ throw new Error(`quoteRequestData[${l}] must be a non-null object`);
223
+ h(c, l);
226
224
  });
227
225
  } else
228
226
  h(o);
@@ -233,21 +231,22 @@ function T(m) {
233
231
  "onError",
234
232
  "noMatchingQuote"
235
233
  ].forEach((c) => {
236
- const d = s[c];
237
- if (d && typeof d != "function")
234
+ const l = s[c];
235
+ if (l && typeof l != "function")
238
236
  throw new Error(`Callback '${c}' must be a function.`);
239
- }), typeof n == "string" && !document.querySelector(n))
240
- throw new Error(`Invalid location selector: '${n}'`);
237
+ }), typeof i == "string" && !document.querySelector(i))
238
+ throw new Error(`Invalid location selector: '${i}'`);
241
239
  if (r && typeof r != "object")
242
240
  throw new Error(
243
241
  "Theme must be an object with CSS variables, do not include the '--' prefix"
244
242
  );
245
243
  }
246
- function a(m, { text: t, className: o, parent: s, innerHTML: n, href: r, target: i } = {}) {
244
+ var b = /* @__PURE__ */ ((m) => (m.YES = "yes", m.NO = "no", m.UNSELECTED = "unselected", m))(b || {});
245
+ function a(m, { text: t, className: o, parent: s, innerHTML: i, href: r, target: n } = {}) {
247
246
  const e = document.createElement(m);
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;
247
+ return o && (e.className = o), t != null && (e.textContent = t), i != null && (e.innerHTML = i), r && "href" in e && (e.href = r), n && "target" in e && (e.target = n), s && s.appendChild(e), e;
249
248
  }
250
- function M(m, { name: t, description: o }) {
249
+ function O(m, { name: t, description: o }) {
251
250
  a("div", {
252
251
  className: "spot-header__title",
253
252
  text: t,
@@ -258,26 +257,26 @@ function M(m, { name: t, description: o }) {
258
257
  parent: m
259
258
  });
260
259
  }
261
- function N(m, t = []) {
260
+ function P(m, t = []) {
262
261
  const o = a("ul", {
263
262
  className: "spot-benefits__list",
264
263
  parent: m
265
264
  });
266
265
  t.forEach((s) => {
267
- const n = a("li", { parent: o });
268
- n.innerHTML = `
266
+ const i = a("li", { parent: o });
267
+ i.innerHTML = `
269
268
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="spot-bullets__checkmark">
270
269
  <path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
271
270
  stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
272
- </svg>`, a("span", { text: s, parent: n });
271
+ </svg>`, a("span", { text: s, parent: i });
273
272
  });
274
273
  }
275
- function L(m, t = []) {
274
+ function $(m, t = []) {
276
275
  if (!t || t.length === 0) return;
277
276
  const o = a("div", {
278
277
  className: "spot-qualifying-reasons__container",
279
278
  parent: m
280
- }), s = [...t].sort((e, p) => e.rank - p.rank), n = a("div", {
279
+ }), s = [...t].sort((e, p) => e.rank - p.rank), i = a("div", {
281
280
  className: "spot-qualifying-reasons__grid",
282
281
  parent: o
283
282
  }), r = {
@@ -290,32 +289,32 @@ function L(m, t = []) {
290
289
  "Travel Interruption": "plane.svg",
291
290
  "Military Duty": "medal.svg"
292
291
  };
293
- let i;
292
+ let n;
294
293
  try {
295
294
  const e = document.currentScript;
296
295
  if (e != null && e.src) {
297
296
  const p = new URL(e.src);
298
- i = p.origin + p.pathname.replace(/\/[^/]*$/, "/");
297
+ n = p.origin + p.pathname.replace(/\/[^/]*$/, "/");
299
298
  } else
300
- i = window.location.origin + window.location.pathname.replace(/\/[^/]*$/, "/");
301
- i += "assets/";
299
+ n = window.location.origin + window.location.pathname.replace(/\/[^/]*$/, "/");
300
+ n += "assets/";
302
301
  } catch {
303
- i = "./assets/";
302
+ n = "./assets/";
304
303
  }
305
304
  s.forEach((e) => {
306
- var h, y, c;
305
+ var h, v, c;
307
306
  const p = a("div", {
308
307
  className: "spot-qualifying-reasons__item",
309
- parent: n
308
+ parent: i
310
309
  }), u = a("div", {
311
310
  className: "spot-qualifying-reasons__icon-wrapper",
312
311
  parent: p
313
312
  }), f = r[((h = e.benefitType) == null ? void 0 : h.name) || ""] || r[e.name || ""];
314
313
  if (f) {
315
- const d = a("img", {
314
+ const l = a("img", {
316
315
  parent: u
317
316
  });
318
- d.src = i + f, d.alt = ((y = e.benefitType) == null ? void 0 : y.name) || e.name || "", d.className = "spot-qualifying-reasons__icon";
317
+ l.src = n + f, l.alt = ((v = e.benefitType) == null ? void 0 : v.name) || e.name || "", l.className = "spot-qualifying-reasons__icon";
319
318
  }
320
319
  a("span", {
321
320
  className: "spot-qualifying-reasons__label",
@@ -324,28 +323,28 @@ function L(m, t = []) {
324
323
  });
325
324
  });
326
325
  }
327
- function O(m, t = [], o) {
326
+ function S(m, t = [], o) {
328
327
  if (t.length === 0 || !o || o <= 1)
329
328
  return;
330
329
  const s = /* @__PURE__ */ new Map();
331
- t.forEach((d) => {
332
- s.set(d, (s.get(d) || 0) + 1);
330
+ t.forEach((l) => {
331
+ s.set(l, (s.get(l) || 0) + 1);
333
332
  });
334
333
  const r = Array.from(s.entries()).map(
335
- ([d, l]) => ({
336
- item: d,
337
- count: l,
338
- displayText: l > 1 ? `${l} x ${d}` : d
334
+ ([l, d]) => ({
335
+ item: l,
336
+ count: d,
337
+ displayText: d > 1 ? `${d} x ${l}` : l
339
338
  })
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", {
339
+ ).sort((l, d) => {
340
+ const y = l.item.charAt(0), w = d.item.charAt(0), q = /[a-zA-Z]/.test(y), C = /[a-zA-Z]/.test(w);
341
+ return !q && C ? -1 : q && !C ? 1 : l.item.localeCompare(d.item, void 0, { sensitivity: "base" });
342
+ }), n = a("div", {
344
343
  className: "spot-covered-items__container",
345
344
  parent: m
346
345
  }), e = a("div", {
347
346
  className: "spot-covered-items__header",
348
- parent: i
347
+ parent: n
349
348
  }), p = a("button", {
350
349
  className: "spot-covered-items__toggle",
351
350
  parent: e
@@ -370,62 +369,62 @@ function O(m, t = [], o) {
370
369
  parent: u
371
370
  }), h = a("div", {
372
371
  className: "spot-covered-items__content",
373
- parent: i
374
- }), y = a("ul", {
372
+ parent: n
373
+ }), v = a("ul", {
375
374
  className: "spot-covered-items__list",
376
375
  parent: h
377
376
  });
378
- r.forEach(({ displayText: d }) => {
379
- const l = a("li", { parent: y });
380
- a("span", { text: d, parent: l });
377
+ r.forEach(({ displayText: l }) => {
378
+ const d = a("li", { parent: v });
379
+ a("span", { text: l, parent: d });
381
380
  });
382
381
  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());
382
+ h.style.display = "none", p.addEventListener("click", (l) => {
383
+ l.stopPropagation(), c = !c, h.style.display = c ? "block" : "none", f.innerHTML = c ? "▲" : "▼", p.setAttribute("aria-expanded", c.toString());
385
384
  }), p.setAttribute("aria-expanded", "false"), p.setAttribute("aria-controls", "covered-items-list"), h.setAttribute("id", "covered-items-list");
386
385
  }
387
- function P(m, t = []) {
386
+ function V(m, t = []) {
388
387
  const o = a("div", {
389
388
  className: "spot-table__container",
390
389
  parent: m
391
390
  }), s = a("table", {
392
391
  className: "spot-refund__table spot-table--dynamic",
393
392
  parent: o
394
- }), n = a("thead", { parent: s }), r = a("tr", { parent: n });
393
+ }), i = a("thead", { parent: s }), r = a("tr", { parent: i });
395
394
  a("th", { text: "When you cancel", parent: r }), a("th", { text: "You will receive", parent: r });
396
- const i = a("tbody", { parent: s });
395
+ const n = a("tbody", { parent: s });
397
396
  t.forEach(({ text: e, percent: p, amount: u }) => {
398
- const f = a("tr", { parent: i });
397
+ const f = a("tr", { parent: n });
399
398
  a("td", { text: e, parent: f });
400
399
  const h = p === "Not eligible for refund" ? "Not eligible for a refund" : `$${u} refund`;
401
400
  a("td", { text: h, parent: f });
402
401
  });
403
402
  }
404
- function $(m, t, o) {
403
+ function Q(m, t, o) {
405
404
  const s = a("div", {
406
405
  className: "spot-selection__options",
407
406
  parent: m
408
- }), n = a("label", {
409
- className: `spot-selection__option ${t ? "selected" : ""}`,
407
+ }), i = a("label", {
408
+ className: `spot-selection__option ${t === b.YES ? "selected" : ""}`,
410
409
  parent: s
411
- }), r = a("input", { parent: n });
412
- r.type = "radio", r.name = "selection", r.value = "yes", t && (r.checked = !0), a("strong", {
410
+ }), r = a("input", { parent: i });
411
+ r.type = "radio", r.name = "selection", r.value = b.YES, t === b.YES && (r.checked = !0), a("strong", {
413
412
  text: o.yesOptionText,
414
- parent: n
413
+ parent: i
415
414
  }), a("span", {
416
415
  className: "spot-selection__recommended-tag",
417
416
  text: "Recommended",
418
- parent: n
417
+ parent: i
419
418
  });
420
- const i = a("label", {
419
+ const n = a("label", {
421
420
  className: "spot-selection__option",
422
421
  parent: 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;
422
+ }), e = a("input", { parent: n });
423
+ return e.type = "radio", e.name = "selection", e.value = b.NO, a("span", { text: o.noOptionText, parent: n }), s;
425
424
  }
426
425
  function R(m, t) {
427
- var n;
428
- const o = (n = t.communication) == null ? void 0 : n.paymentTerms, s = a("div", {
426
+ var i;
427
+ const o = (i = t.communication) == null ? void 0 : i.paymentTerms, s = a("div", {
429
428
  className: "spot-payment-terms",
430
429
  parent: m
431
430
  });
@@ -439,7 +438,7 @@ function R(m, t) {
439
438
  parent: s
440
439
  }), s;
441
440
  }
442
- function V(m, t, o = "bottom-right") {
441
+ function A(m, t, o = "bottom-right") {
443
442
  if (o === "top-right") {
444
443
  const e = a("div", {
445
444
  className: "spot-logo__top-right",
@@ -465,16 +464,16 @@ function V(m, t, o = "bottom-right") {
465
464
  const s = a("div", {
466
465
  className: "spot-footer__container",
467
466
  parent: m
468
- }), n = a("div", {
467
+ }), i = a("div", {
469
468
  className: "spot-footer__terms",
470
469
  parent: s
471
- }), r = `<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`, i = t.communication.legalDisclaimer.replace(
470
+ }), r = `<a href="${t.communication.termsAndConditionsUrl}" target="_blank" class="spot-footer__terms-link">Terms & Conditions</a>`, n = t.communication.legalDisclaimer.replace(
472
471
  /terms (and|&) conditions/gi,
473
472
  r
474
473
  );
475
474
  if (a("span", {
476
- innerHTML: i,
477
- parent: n
475
+ innerHTML: n,
476
+ parent: i
478
477
  }), o === "bottom-right") {
479
478
  const e = a("p", {
480
479
  className: "spot-footer__powered-by",
@@ -499,60 +498,60 @@ function V(m, t, o = "bottom-right") {
499
498
  }
500
499
  return s;
501
500
  }
502
- const Q = ":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)}}";
503
- function S(m) {
501
+ const Z = ":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)}}";
502
+ function U(m) {
504
503
  const t = document.createElement("style");
505
504
  t.textContent = m, document.head.appendChild(t);
506
505
  }
507
- S(Q);
508
- const D = {
506
+ U(Z);
507
+ const N = {
509
508
  sandbox: "https://api.sandbox.getspot.com/api/v1/quote",
510
509
  production: "https://api.getspot.com/api/v1/quote",
511
510
  local: "http://localhost:3999/api/v1/quote"
512
511
  };
513
- class A {
512
+ class j {
514
513
  constructor(t = {}) {
515
514
  this.options = {
516
515
  location: "body",
517
516
  showTable: !0,
518
- optInSelected: !1,
519
517
  logoPosition: "bottom-right",
520
518
  apiConfig: { environment: "production", partnerId: "" },
521
519
  quoteRequestData: {},
522
520
  callbacks: {},
523
521
  useMockData: !1,
524
- ...t
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();
522
+ ...t,
523
+ selection: t.selection ?? b.UNSELECTED
524
+ }, this._onResize = this._updateLayout.bind(this), this.root = typeof this.options.location == "string" ? document.querySelector(this.options.location) : this.options.location, this.currentSelection = this.options.selection, this._init();
526
525
  }
527
526
  async _init() {
528
- var t, o, s, n, r;
527
+ var t, o, s, i, r;
529
528
  try {
530
- T(this.options);
531
- let i;
529
+ z(this.options);
530
+ let n;
532
531
  if (this.options.useMockData && this.options.mockData)
533
- i = this.options.mockData;
532
+ n = this.options.mockData;
534
533
  else {
535
- const { environment: e, partnerId: p } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || D[e];
536
- i = "cartInfo" in this.options.quoteRequestData && "items" in this.options.quoteRequestData ? await I(
534
+ const { environment: e, partnerId: p } = this.options.apiConfig, f = this.options.apiConfig.customEndpoint || N[e];
535
+ n = "items" in this.options.quoteRequestData ? await H(
537
536
  f,
538
537
  p,
539
538
  this.options.quoteRequestData
540
- ) : await x(
539
+ ) : await D(
541
540
  f,
542
541
  p,
543
542
  this.options.quoteRequestData
544
543
  );
545
544
  }
546
- if (i.status !== "QUOTE_AVAILABLE") {
547
- i.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
545
+ if (n.status !== "QUOTE_AVAILABLE") {
546
+ n.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
548
547
  status: "NO_MATCHING_QUOTE",
549
548
  data: this.options.quoteRequestData
550
549
  });
551
550
  return;
552
551
  }
553
- if (this.quote = i.data, !this.quote)
552
+ if (this.quote = n.data, !this.quote)
554
553
  throw new Error("No quote data in response");
555
- if (this._renderWidget(), this.options.optInSelected && ((o = this.options.callbacks) != null && o.onOptIn)) {
554
+ if (this._renderWidget(), this.options.selection === b.YES && ((o = this.options.callbacks) != null && o.onOptIn)) {
556
555
  const e = {
557
556
  status: "QUOTE_ACCEPTED",
558
557
  spotPrice: this.quote.spotPrice,
@@ -563,7 +562,7 @@ class A {
563
562
  e.batchQuoteDetails = this.quote.originalQuotes.map((u) => {
564
563
  var h;
565
564
  const f = (h = p.items) == null ? void 0 : h.find(
566
- (y) => (y.cartItemId || `item-${p.items.indexOf(y) + 1}`) === u.cartItemId
565
+ (v) => (v.cartItemId || `item-${p.items.indexOf(v) + 1}`) === u.cartItemId
567
566
  );
568
567
  return {
569
568
  quoteId: u.id,
@@ -578,9 +577,9 @@ class A {
578
577
  const e = this.options.callbacks.onQuoteRetrieved(this.quote);
579
578
  e && this._applyQuoteUpdates(e);
580
579
  }
581
- } catch (i) {
582
- if ((n = this.options.callbacks) != null && n.onError) {
583
- const e = i;
580
+ } catch (n) {
581
+ if ((i = this.options.callbacks) != null && i.onError) {
582
+ const e = n;
584
583
  (r = this.options.callbacks) == null || r.onError({
585
584
  message: e.message,
586
585
  status: e.status,
@@ -591,25 +590,25 @@ class A {
591
590
  }
592
591
  _renderWidget() {
593
592
  if (!this.quote) return;
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]) => {
593
+ this.container = document.createElement("div"), this.container.className = "spot-refund-guarantee", this.root.appendChild(this.container), Object.entries(this.options.theme || {}).forEach(([s, i]) => {
595
594
  const r = `--${s}`;
596
- this.container.style.setProperty(r, n);
597
- }), M(this.container, this.quote.communication);
595
+ this.container.style.setProperty(r, i);
596
+ }), O(this.container, this.quote.communication);
598
597
  const t = document.createElement("div");
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) {
598
+ if (t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? $(t, this.quote.qualifyingReasons) : P(t, this.quote.communication.bulletPoints), this.quote.coveredItems) {
600
599
  const s = this._getTotalItemsInRequest();
601
- O(t, this.quote.coveredItems, s);
600
+ S(t, this.quote.coveredItems, s);
602
601
  }
603
- this.options.showTable && !this.quote.qualifyingReasons && P(t, this.quote.payoutSchedule);
604
- const o = $(
602
+ this.options.showTable && !this.quote.qualifyingReasons && V(t, this.quote.payoutSchedule);
603
+ const o = Q(
605
604
  t,
606
- this.options.optInSelected,
605
+ this.options.selection,
607
606
  this.quote.communication
608
607
  );
609
608
  t.appendChild(o), this.paymentTermsEl = a("div", {
610
609
  className: "spot-payment-terms__wrapper",
611
610
  parent: t
612
- }), V(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(o);
611
+ }), A(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(o);
613
612
  }
614
613
  _updateLayout() {
615
614
  if (!this.container || !this.quote) return;
@@ -624,18 +623,18 @@ class A {
624
623
  t.classList.toggle("desktop-layout", s);
625
624
  }
626
625
  _shouldUseDesktopLayout(t) {
627
- const o = this.container.offsetWidth - 40, s = 325, n = 16;
626
+ const o = this.container.offsetWidth - 40, s = 325, i = 16;
628
627
  if (o >= 900)
629
628
  return !0;
630
629
  if (o >= 650) {
631
630
  const r = t.classList.contains("desktop-layout");
632
631
  t.classList.remove("desktop-layout"), t.offsetHeight;
633
- const i = t.querySelector(
632
+ const n = t.querySelector(
634
633
  ".spot-benefits__list, .spot-qualifying-reasons__container"
635
634
  );
636
- if (!i)
635
+ if (!n)
637
636
  return r && t.classList.add("desktop-layout"), r;
638
- const p = Math.min(i.scrollWidth, 400) + s + n;
637
+ const p = Math.min(n.scrollWidth, 400) + s + i;
639
638
  return r && t.classList.add("desktop-layout"), o >= p;
640
639
  }
641
640
  return !1;
@@ -648,7 +647,7 @@ class A {
648
647
  }), this._resizeObserver.observe(this.container));
649
648
  }
650
649
  _getTotalItemsInRequest() {
651
- return "cartInfo" in this.options.quoteRequestData && "items" in this.options.quoteRequestData ? this.options.quoteRequestData.items.length : 1;
650
+ return "items" in this.options.quoteRequestData ? this.options.quoteRequestData.items.length : 1;
652
651
  }
653
652
  _applyQuoteUpdates(t) {
654
653
  !this.quote || !this.container || (t.spotPriceWithFees !== void 0 && (this.quote.communication.yesOptionText = this.quote.communication.yesOptionText.replace(
@@ -660,56 +659,56 @@ class A {
660
659
  const o = t.querySelectorAll(
661
660
  'input[type="radio"]'
662
661
  ), s = t.querySelectorAll(".spot-selection__option");
663
- o.forEach((n) => {
664
- n.addEventListener("change", (r) => {
662
+ o.forEach((i) => {
663
+ i.addEventListener("change", (r) => {
665
664
  var p, u, f, h;
666
- const i = r.target, e = i.value;
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 = {
665
+ const n = r.target, e = n.value;
666
+ if (this.hideSelectionError(), this.currentSelection = e, s.forEach((v) => v.classList.remove("selected")), (p = n.closest(".spot-selection__option")) == null || p.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), e === b.YES && ((u = this.quote) != null && u.communication.paymentTerms && R(this.paymentTermsEl, this.quote), (f = this.options.callbacks) != null && f.onOptIn)) {
667
+ const v = {
669
668
  status: "QUOTE_ACCEPTED",
670
669
  spotPrice: this.quote.spotPrice,
671
670
  quoteId: this.quote.id
672
671
  };
673
672
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
674
673
  const c = this.options.quoteRequestData;
675
- y.batchQuoteDetails = this.quote.originalQuotes.map(
676
- (d) => {
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
674
+ v.batchQuoteDetails = this.quote.originalQuotes.map(
675
+ (l) => {
676
+ var y;
677
+ const d = (y = c.items) == null ? void 0 : y.find(
678
+ (w) => (w.cartItemId || `item-${c.items.indexOf(w) + 1}`) === l.cartItemId
680
679
  );
681
680
  return {
682
- quoteId: d.id,
683
- productPrice: (l == null ? void 0 : l.productPrice) || d.spotPrice,
684
- cartItemId: (l == null ? void 0 : l.cartItemId) || ""
681
+ quoteId: l.id,
682
+ productPrice: (d == null ? void 0 : d.productPrice) || l.spotPrice,
683
+ cartItemId: (d == null ? void 0 : d.cartItemId) || ""
685
684
  };
686
685
  }
687
686
  );
688
687
  }
689
- this.options.callbacks.onOptIn(y);
688
+ this.options.callbacks.onOptIn(v);
690
689
  }
691
- if (e === "no" && ((h = this.options.callbacks) != null && h.onOptOut)) {
692
- const y = {
690
+ if (e === b.NO && ((h = this.options.callbacks) != null && h.onOptOut)) {
691
+ const v = {
693
692
  status: "QUOTE_DECLINED",
694
693
  quoteId: this.quote.id
695
694
  };
696
695
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
697
696
  const c = this.options.quoteRequestData;
698
- y.batchQuoteDetails = this.quote.originalQuotes.map(
699
- (d) => {
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
697
+ v.batchQuoteDetails = this.quote.originalQuotes.map(
698
+ (l) => {
699
+ var y;
700
+ const d = (y = c.items) == null ? void 0 : y.find(
701
+ (w) => (w.cartItemId || `item-${c.items.indexOf(w) + 1}`) === l.cartItemId
703
702
  );
704
703
  return {
705
- quoteId: d.id,
706
- productPrice: (l == null ? void 0 : l.productPrice) || d.spotPrice,
707
- cartItemId: (l == null ? void 0 : l.cartItemId) || ""
704
+ quoteId: l.id,
705
+ productPrice: (d == null ? void 0 : d.productPrice) || l.spotPrice,
706
+ cartItemId: (d == null ? void 0 : d.cartItemId) || ""
708
707
  };
709
708
  }
710
709
  );
711
710
  }
712
- this.options.callbacks.onOptOut(y);
711
+ this.options.callbacks.onOptOut(v);
713
712
  }
714
713
  });
715
714
  });
@@ -736,35 +735,35 @@ class A {
736
735
  return t ? this.hideSelectionError() : this.showSelectionError(), t;
737
736
  }
738
737
  async updateQuote(t) {
739
- var o, s, n, r;
738
+ var o, s, i, r;
740
739
  try {
741
- const i = {
740
+ const n = {
742
741
  ...this.options,
743
742
  quoteRequestData: t
744
743
  };
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(
744
+ z(n);
745
+ const { environment: e, partnerId: p, customEndpoint: u } = this.options.apiConfig, f = u || N[e], v = "items" in n.quoteRequestData ? await H(
747
746
  f,
748
747
  p,
749
- i.quoteRequestData
750
- ) : await x(
748
+ n.quoteRequestData
749
+ ) : await D(
751
750
  f,
752
751
  p,
753
- i.quoteRequestData
752
+ n.quoteRequestData
754
753
  );
755
- if (y.status !== "QUOTE_AVAILABLE")
756
- return this.destroy(), y.status === "NO_MATCHING_QUOTE" && ((o = this.options.callbacks) != null && o.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
754
+ if (v.status !== "QUOTE_AVAILABLE")
755
+ return this.destroy(), v.status === "NO_MATCHING_QUOTE" && ((o = this.options.callbacks) != null && o.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
757
756
  status: "NO_MATCHING_QUOTE",
758
- data: i.quoteRequestData
757
+ data: n.quoteRequestData
759
758
  }), !1;
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) {
759
+ if (this.options.quoteRequestData = n.quoteRequestData, this.quote = v.data, this.currentSelection = b.UNSELECTED, this.destroy(), this._renderWidget(), (s = this.options.callbacks) != null && s.onQuoteRetrieved) {
761
760
  const c = this.options.callbacks.onQuoteRetrieved(this.quote);
762
761
  c && this._applyQuoteUpdates(c);
763
762
  }
764
763
  return !0;
765
- } catch (i) {
766
- const e = i;
767
- return (r = (n = this.options.callbacks) == null ? void 0 : n.onError) == null || r.call(n, {
764
+ } catch (n) {
765
+ const e = n;
766
+ return (r = (i = this.options.callbacks) == null ? void 0 : i.onError) == null || r.call(i, {
768
767
  message: e.message,
769
768
  status: e.status,
770
769
  responseBody: e.responseBody
@@ -772,24 +771,24 @@ class A {
772
771
  }
773
772
  }
774
773
  getSelection() {
775
- var o, s, n;
776
- if (this.currentSelection == null) return null;
774
+ var o, s, i;
775
+ if (this.currentSelection == null || this.currentSelection == b.UNSELECTED) return null;
777
776
  const t = {
778
777
  selection: this.currentSelection,
779
778
  quoteId: (o = this.quote) == null ? void 0 : o.id,
780
779
  spotPrice: (s = this.quote) == null ? void 0 : s.spotPrice,
781
- status: this.currentSelection === "yes" ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED"
780
+ status: this.currentSelection === b.YES ? "QUOTE_ACCEPTED" : "QUOTE_DECLINED"
782
781
  };
783
- if ((n = this.quote) != null && n.originalQuotes && this.quote.originalQuotes.length > 0) {
782
+ if ((i = this.quote) != null && i.originalQuotes && this.quote.originalQuotes.length > 0) {
784
783
  const r = this.options.quoteRequestData;
785
- t.batchQuoteDetails = this.quote.originalQuotes.map((i) => {
784
+ t.batchQuoteDetails = this.quote.originalQuotes.map((n) => {
786
785
  var p;
787
786
  const e = (p = r.items) == null ? void 0 : p.find(
788
- (u) => (u.cartItemId || `item-${r.items.indexOf(u) + 1}`) === i.cartItemId
787
+ (u) => (u.cartItemId || `item-${r.items.indexOf(u) + 1}`) === n.cartItemId
789
788
  );
790
789
  return {
791
- quoteId: i.id,
792
- productPrice: (e == null ? void 0 : e.productPrice) || i.spotPrice,
790
+ quoteId: n.id,
791
+ productPrice: (e == null ? void 0 : e.productPrice) || n.spotPrice,
793
792
  cartItemId: (e == null ? void 0 : e.cartItemId) || ""
794
793
  };
795
794
  });
@@ -801,5 +800,6 @@ class A {
801
800
  }
802
801
  }
803
802
  export {
804
- A as default
803
+ b as SelectionEnum,
804
+ j as default
805
805
  };