@getspot/spot-widget 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @getspot/spot-widget
2
2
 
3
+ ## 2.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0308688: test publish commands
8
+
3
9
  ## 2.1.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -525,6 +525,8 @@ export interface SpotWidgetOptions {
525
525
  callbacks?: Callbacks;
526
526
  theme?: Theme;
527
527
  isPartialPayment?: boolean;
528
+ useMockData?: boolean;
529
+ mockData?: ApiResponse;
528
530
  }
529
531
  ```
530
532
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EAEd,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;YAsBtC,KAAK;IA8EnB,OAAO,CAAC,aAAa;IAkDrB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,uBAAuB;IA0C/B,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,cAAc,CAAC,CAAS;IAEhC,OAAO,CAAC,qBAAqB;IA2F7B,kBAAkB,IAAI,IAAI;IAgB1B,kBAAkB,IAAI,IA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IAM1B,iBAAiB,IAAI,OAAO;IAgBtB,WAAW,CACf,mBAAmB,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,GACzD,OAAO,CAAC,OAAO,CAAC;IAiEnB,YAAY,IAAI,aAAa,GAAG,IAAI;IA+BpC,OAAO,IAAI,IAAI;CAahB;AAED,eAAe,UAAU,CAAC;AAC1B,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,KAAK,EACL,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
@@ -1,6 +1,6 @@
1
- async function k(u, t, o) {
1
+ async function k(d, t, o) {
2
2
  try {
3
- const i = await fetch(u, {
3
+ const i = await fetch(d, {
4
4
  method: "POST",
5
5
  headers: {
6
6
  "Content-Type": "application/json",
@@ -17,9 +17,9 @@ async function k(u, t, o) {
17
17
  throw i instanceof Error ? i : new Error("Unknown error occurred while fetching quote");
18
18
  }
19
19
  }
20
- async function H(u, t, o) {
20
+ async function H(d, t, o) {
21
21
  try {
22
- const i = u.replace("/quote", "/quote/batch"), r = await fetch(i, {
22
+ const i = d.replace("/quote", "/quote/batch"), r = await fetch(i, {
23
23
  method: "POST",
24
24
  headers: {
25
25
  "Content-Type": "application/json",
@@ -28,64 +28,64 @@ async function H(u, t, o) {
28
28
  body: JSON.stringify(o)
29
29
  }), e = await r.json();
30
30
  if (!r.ok) {
31
- const s = new Error((e == null ? void 0 : e.message) || "Failed to fetch batch quote");
32
- throw s.status = r.status, s.responseBody = e, s;
31
+ const n = new Error((e == null ? void 0 : e.message) || "Failed to fetch batch quote");
32
+ throw n.status = r.status, n.responseBody = e, n;
33
33
  }
34
34
  return e;
35
35
  } catch (i) {
36
36
  throw i instanceof Error ? i : new Error("Unknown error occurred while fetching batch quote");
37
37
  }
38
38
  }
39
- async function I(u, t, o) {
39
+ async function D(d, t, o) {
40
40
  var i;
41
41
  try {
42
42
  const r = {
43
43
  cartId: o.cartInfo.cartId,
44
44
  cartName: o.cartInfo.cartName,
45
45
  currencyCode: o.cartInfo.currencyCode,
46
- items: o.items.map((p, m) => ({
47
- cartItemId: p.cartItemId || `item-${m + 1}`,
48
- productPrice: p.productPrice,
49
- productType: p.productType,
50
- productDuration: p.productDuration,
51
- productId: p.productId,
52
- productName: p.productName,
53
- participantDescription: p.participantDescription,
54
- eventType: p.eventType,
55
- startDate: p.startDate,
56
- endDate: p.endDate
46
+ items: o.items.map((s, u) => ({
47
+ cartItemId: s.cartItemId || `item-${u + 1}`,
48
+ productPrice: s.productPrice,
49
+ productType: s.productType,
50
+ productDuration: s.productDuration,
51
+ productId: s.productId,
52
+ productName: s.productName,
53
+ participantDescription: s.participantDescription,
54
+ eventType: s.eventType,
55
+ startDate: s.startDate,
56
+ endDate: s.endDate
57
57
  }))
58
- }, e = await H(u, t, r);
58
+ }, e = await H(d, t, r);
59
59
  if (e.status !== "QUOTES_AVAILABLE" && e.status !== "QUOTE_AVAILABLE")
60
60
  return { status: "NO_MATCHING_QUOTE" };
61
- const s = e.quotes.map((p) => {
62
- const m = o.items.find(
63
- (b, f) => (b.cartItemId || `item-${f + 1}`) === p.cartItemId
61
+ const n = e.quotes.map((s) => {
62
+ const u = o.items.find(
63
+ (h, f) => (h.cartItemId || `item-${f + 1}`) === s.cartItemId
64
64
  );
65
- return m ? m.participantDescription ? `${m.productName} - ${m.participantDescription}` : m.productName : `Item ${p.id}`;
66
- }), n = Math.round((e.totalSpotPrice || e.spotPrice || 0) * 100) / 100;
65
+ return u ? u.participantDescription ? `${u.productName} - ${u.participantDescription}` : u.productName : `Item ${s.id}`;
66
+ }), a = Math.round((e.totalSpotPrice || e.spotPrice || 0) * 100) / 100;
67
67
  return {
68
68
  status: "QUOTE_AVAILABLE",
69
69
  data: {
70
- id: e.quotes ? e.quotes.map((p) => p.id).join(",") : ((i = e.data) == null ? void 0 : i.id) || "",
71
- spotPrice: n,
70
+ id: e.quotes ? e.quotes.map((s) => s.id).join(",") : ((i = e.data) == null ? void 0 : i.id) || "",
71
+ spotPrice: a,
72
72
  currencyCode: e.currencyCode || "",
73
73
  communication: {
74
74
  ...e.communication,
75
75
  yesOptionText: e.communication.yesOptionText.replace(
76
76
  String(e.totalSpotPrice),
77
- String(n)
77
+ String(a)
78
78
  )
79
79
  },
80
- payoutSchedule: e.payoutSchedule.map((p) => ({
81
- ...p,
82
- amount: p.amount !== void 0 ? p.amount : 0
80
+ payoutSchedule: e.payoutSchedule.map((s) => ({
81
+ ...s,
82
+ amount: s.amount !== void 0 ? s.amount : 0
83
83
  })),
84
- coveredItems: s,
84
+ coveredItems: n,
85
85
  originalQuotes: e.quotes || (e.data ? [e.data] : [])
86
86
  },
87
- spotPrice: n,
88
- coveredItems: s
87
+ spotPrice: a,
88
+ coveredItems: n
89
89
  };
90
90
  } catch (r) {
91
91
  throw r instanceof Error ? r : new Error("Unknown error occurred while fetching multiple quotes");
@@ -96,25 +96,25 @@ const M = {
96
96
  production: "https://api.getspot.com/v1/quote",
97
97
  local: "http://localhost:3999/api/v1/quote"
98
98
  };
99
- function D(u) {
99
+ function I(d) {
100
100
  const {
101
101
  apiConfig: t = {},
102
102
  quoteRequestData: o,
103
103
  callbacks: i = {},
104
104
  location: r,
105
105
  theme: e
106
- } = u, {
107
- environment: s = "sandbox",
108
- partnerId: n,
109
- customEndpoint: p
106
+ } = d, {
107
+ environment: n = "sandbox",
108
+ partnerId: a,
109
+ customEndpoint: s
110
110
  } = t;
111
- if (!n || typeof n != "string")
111
+ if (!a || typeof a != "string")
112
112
  throw new Error("Invalid or missing partnerId in apiConfig");
113
- if (!(p || M[s]))
114
- throw new Error(`Invalid environment in apiConfig: ${s}`);
113
+ if (!(s || M[n]))
114
+ throw new Error(`Invalid environment in apiConfig: ${n}`);
115
115
  if (!o || typeof o != "object" && !Array.isArray(o))
116
116
  throw new Error("quoteRequestData must be a non-null object or array");
117
- const b = [
117
+ const h = [
118
118
  "startDate",
119
119
  "endDate",
120
120
  "currencyCode",
@@ -126,61 +126,61 @@ function D(u) {
126
126
  "cartId",
127
127
  "productName"
128
128
  ];
129
- function f(c, d = null) {
130
- const l = d !== null ? `quoteRequestData[${d}]` : "quoteRequestData";
131
- b.forEach((y) => {
132
- if (!Object.prototype.hasOwnProperty.call(c, y) || c[y] === void 0 || c[y] === null)
133
- throw new Error(`Missing required ${l} field: '${y}'`);
129
+ function f(c, l = null) {
130
+ const m = l !== null ? `quoteRequestData[${l}]` : "quoteRequestData";
131
+ h.forEach((w) => {
132
+ if (!Object.prototype.hasOwnProperty.call(c, w) || c[w] === void 0 || c[w] === null)
133
+ throw new Error(`Missing required ${m} field: '${w}'`);
134
134
  });
135
- const w = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
136
- if (!w.test(c.startDate))
137
- throw new Error(`${l}.startDate must be a valid ISO8601 string`);
138
- if (!w.test(c.endDate))
139
- throw new Error(`${l}.endDate must be a valid ISO8601 string`);
135
+ const b = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
136
+ if (!b.test(c.startDate))
137
+ throw new Error(`${m}.startDate must be a valid ISO8601 string`);
138
+ if (!b.test(c.endDate))
139
+ throw new Error(`${m}.endDate must be a valid ISO8601 string`);
140
140
  if (typeof c.currencyCode != "string")
141
- throw new Error(`${l}.currencyCode must be a string`);
141
+ throw new Error(`${m}.currencyCode must be a string`);
142
142
  if (!["USD", "CAD", "AUD"].includes(c.currencyCode))
143
- throw new Error(`Invalid ${l}.currencyCode: ${c.currencyCode}`);
143
+ throw new Error(`Invalid ${m}.currencyCode: ${c.currencyCode}`);
144
144
  if (typeof c.eventType != "string")
145
- throw new Error(`${l}.eventType must be a string`);
145
+ throw new Error(`${m}.eventType must be a string`);
146
146
  if (typeof c.productType != "string")
147
- throw new Error(`${l}.productType must be a string`);
148
- const h = ["Pass", "Trip", "Registration"];
149
- if (!h.includes(c.productType))
147
+ throw new Error(`${m}.productType must be a string`);
148
+ const g = ["Pass", "Trip", "Registration"];
149
+ if (!g.includes(c.productType))
150
150
  throw new Error(
151
- `${l}.productType must be one of ${h.join(", ")}`
151
+ `${m}.productType must be one of ${g.join(", ")}`
152
152
  );
153
153
  if (typeof c.productDuration != "string")
154
- throw new Error(`${l}.productDuration must be a string`);
155
- const v = ["Daily", "Seasonal", "Trip", "Event"];
156
- if (!v.includes(c.productDuration))
154
+ throw new Error(`${m}.productDuration must be a string`);
155
+ const _ = ["Daily", "Seasonal", "Trip", "Event"];
156
+ if (!_.includes(c.productDuration))
157
157
  throw new Error(
158
- `${l}.productDuration must be one of ${v.join(", ")}`
158
+ `${m}.productDuration must be one of ${_.join(", ")}`
159
159
  );
160
160
  if (typeof c.productPrice != "number" || isNaN(c.productPrice))
161
- throw new Error(`${l}.productPrice must be a valid number`);
161
+ throw new Error(`${m}.productPrice must be a valid number`);
162
162
  if (typeof c.productId != "string")
163
- throw new Error(`${l}.productId must be a string`);
163
+ throw new Error(`${m}.productId must be a string`);
164
164
  if (typeof c.cartId != "string")
165
- throw new Error(`${l}.cartId must be a string`);
165
+ throw new Error(`${m}.cartId must be a string`);
166
166
  if (typeof c.productName != "string")
167
- throw new Error(`${l}.productName must be a string`);
167
+ throw new Error(`${m}.productName must be a string`);
168
168
  }
169
169
  if ("cartInfo" in o && "items" in o) {
170
- const c = o, { cartInfo: d, items: l } = c;
171
- if (!d || typeof d != "object")
170
+ const c = o, { cartInfo: l, items: m } = c;
171
+ if (!l || typeof l != "object")
172
172
  throw new Error("quoteRequestData.cartInfo must be a non-null object");
173
- if (!d.cartId || typeof d.cartId != "string")
173
+ if (!l.cartId || typeof l.cartId != "string")
174
174
  throw new Error("quoteRequestData.cartInfo.cartId must be a string");
175
- if (!d.cartName || typeof d.cartName != "string")
175
+ if (!l.cartName || typeof l.cartName != "string")
176
176
  throw new Error("quoteRequestData.cartInfo.cartName must be a string");
177
- if (!d.currencyCode || typeof d.currencyCode != "string")
177
+ if (!l.currencyCode || typeof l.currencyCode != "string")
178
178
  throw new Error("quoteRequestData.cartInfo.currencyCode must be a string");
179
- if (!["USD", "CAD", "AUD"].includes(d.currencyCode))
180
- throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${d.currencyCode}`);
181
- if (!Array.isArray(l) || l.length === 0)
179
+ if (!["USD", "CAD", "AUD"].includes(l.currencyCode))
180
+ throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${l.currencyCode}`);
181
+ if (!Array.isArray(m) || m.length === 0)
182
182
  throw new Error("quoteRequestData.items must be a non-empty array");
183
- const _ = [
183
+ const C = [
184
184
  "startDate",
185
185
  "endDate",
186
186
  "eventType",
@@ -190,45 +190,45 @@ function D(u) {
190
190
  "productId",
191
191
  "productName"
192
192
  ];
193
- l.forEach((h, v) => {
194
- if (!h || typeof h != "object")
195
- throw new Error(`quoteRequestData.items[${v}] must be a non-null object`);
196
- const y = `quoteRequestData.items[${v}]`;
197
- _.forEach((C) => {
198
- if (!Object.prototype.hasOwnProperty.call(h, C) || h[C] === void 0 || h[C] === null)
199
- throw new Error(`Missing required ${y} field: '${C}'`);
193
+ m.forEach((g, _) => {
194
+ if (!g || typeof g != "object")
195
+ throw new Error(`quoteRequestData.items[${_}] must be a non-null object`);
196
+ const w = `quoteRequestData.items[${_}]`;
197
+ C.forEach((v) => {
198
+ if (!Object.prototype.hasOwnProperty.call(g, v) || g[v] === void 0 || g[v] === null)
199
+ throw new Error(`Missing required ${w} field: '${v}'`);
200
200
  });
201
201
  const q = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
202
- if (!q.test(h.startDate))
203
- throw new Error(`${y}.startDate must be a valid ISO8601 string`);
204
- if (!q.test(h.endDate))
205
- throw new Error(`${y}.endDate must be a valid ISO8601 string`);
206
- if (typeof h.eventType != "string")
207
- throw new Error(`${y}.eventType must be a string`);
208
- if (typeof h.productType != "string")
209
- throw new Error(`${y}.productType must be a string`);
202
+ if (!q.test(g.startDate))
203
+ throw new Error(`${w}.startDate must be a valid ISO8601 string`);
204
+ if (!q.test(g.endDate))
205
+ throw new Error(`${w}.endDate must be a valid ISO8601 string`);
206
+ if (typeof g.eventType != "string")
207
+ throw new Error(`${w}.eventType must be a string`);
208
+ if (typeof g.productType != "string")
209
+ throw new Error(`${w}.productType must be a string`);
210
210
  const E = ["Pass", "Trip", "Registration"];
211
- if (!E.includes(h.productType))
212
- throw new Error(`${y}.productType must be one of ${E.join(", ")}`);
213
- if (typeof h.productDuration != "string")
214
- throw new Error(`${y}.productDuration must be a string`);
211
+ if (!E.includes(g.productType))
212
+ throw new Error(`${w}.productType must be one of ${E.join(", ")}`);
213
+ if (typeof g.productDuration != "string")
214
+ throw new Error(`${w}.productDuration must be a string`);
215
215
  const x = ["Daily", "Seasonal", "Trip", "Event"];
216
- if (!x.includes(h.productDuration))
217
- throw new Error(`${y}.productDuration must be one of ${x.join(", ")}`);
218
- if (typeof h.productPrice != "number" || isNaN(h.productPrice))
219
- throw new Error(`${y}.productPrice must be a valid number`);
220
- if (typeof h.productId != "string")
221
- throw new Error(`${y}.productId must be a string`);
222
- if (typeof h.productName != "string")
223
- throw new Error(`${y}.productName must be a string`);
216
+ if (!x.includes(g.productDuration))
217
+ throw new Error(`${w}.productDuration must be one of ${x.join(", ")}`);
218
+ if (typeof g.productPrice != "number" || isNaN(g.productPrice))
219
+ throw new Error(`${w}.productPrice must be a valid number`);
220
+ if (typeof g.productId != "string")
221
+ throw new Error(`${w}.productId must be a string`);
222
+ if (typeof g.productName != "string")
223
+ throw new Error(`${w}.productName must be a string`);
224
224
  });
225
225
  } else if (Array.isArray(o)) {
226
226
  if (o.length === 0)
227
227
  throw new Error("quoteRequestData array cannot be empty");
228
- o.forEach((c, d) => {
228
+ o.forEach((c, l) => {
229
229
  if (!c || typeof c != "object")
230
- throw new Error(`quoteRequestData[${d}] must be a non-null object`);
231
- f(c, d);
230
+ throw new Error(`quoteRequestData[${l}] must be a non-null object`);
231
+ f(c, l);
232
232
  });
233
233
  } else
234
234
  f(o);
@@ -239,8 +239,8 @@ function D(u) {
239
239
  "onError",
240
240
  "noMatchingQuote"
241
241
  ].forEach((c) => {
242
- const d = i[c];
243
- if (d && typeof d != "function")
242
+ const l = i[c];
243
+ if (l && typeof l != "function")
244
244
  throw new Error(`Callback '${c}' must be a function.`);
245
245
  }), typeof r == "string" && !document.querySelector(r))
246
246
  throw new Error(`Invalid location selector: '${r}'`);
@@ -249,41 +249,41 @@ function D(u) {
249
249
  "Theme must be an object with CSS variables, do not include the '--' prefix"
250
250
  );
251
251
  }
252
- function a(u, { text: t, className: o, parent: i, innerHTML: r, href: e, target: s } = {}) {
253
- const n = document.createElement(u);
254
- return o && (n.className = o), t != null && (n.textContent = t), r != null && (n.innerHTML = r), e && "href" in n && (n.href = e), s && "target" in n && (n.target = s), i && i.appendChild(n), n;
252
+ function p(d, { text: t, className: o, parent: i, innerHTML: r, href: e, target: n } = {}) {
253
+ const a = document.createElement(d);
254
+ return o && (a.className = o), t != null && (a.textContent = t), r != null && (a.innerHTML = r), e && "href" in a && (a.href = e), n && "target" in a && (a.target = n), i && i.appendChild(a), a;
255
255
  }
256
- function N(u, { name: t, description: o }) {
257
- a("div", {
256
+ function N(d, { name: t, description: o }) {
257
+ p("div", {
258
258
  className: "spot-header__title",
259
259
  text: t,
260
- parent: u
261
- }), a("div", {
260
+ parent: d
261
+ }), p("div", {
262
262
  className: "spot-header__description",
263
263
  text: o,
264
- parent: u
264
+ parent: d
265
265
  });
266
266
  }
267
- function z(u, t = []) {
268
- const o = a("ul", {
267
+ function z(d, t = []) {
268
+ const o = p("ul", {
269
269
  className: "spot-benefits__list",
270
- parent: u
270
+ parent: d
271
271
  });
272
272
  t.forEach((i) => {
273
- const r = a("li", { parent: o });
273
+ const r = p("li", { parent: o });
274
274
  r.innerHTML = `
275
275
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
276
276
  <path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
277
277
  stroke="#2E2E2E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
278
- </svg>`, a("span", { text: i, parent: r });
278
+ </svg>`, p("span", { text: i, parent: r });
279
279
  });
280
280
  }
281
- function O(u, t = []) {
281
+ function O(d, t = []) {
282
282
  if (!t || t.length === 0) return;
283
- const o = a("div", {
283
+ const o = p("div", {
284
284
  className: "spot-qualifying-reasons__container",
285
- parent: u
286
- }), i = [...t].sort((p, m) => p.rank - m.rank), r = a("div", {
285
+ parent: d
286
+ }), i = [...t].sort((s, u) => s.rank - u.rank), r = p("div", {
287
287
  className: "spot-qualifying-reasons__grid",
288
288
  parent: o
289
289
  }), e = {
@@ -295,109 +295,109 @@ function O(u, t = []) {
295
295
  "Severe Weather": "umbrella.svg",
296
296
  "Travel Interruption": "plane.svg",
297
297
  "Military Duty": "medal.svg"
298
- }, s = new URL(import.meta.url), n = s.origin + s.pathname.replace(/\/src\/[^/]*$/, "/assets/");
299
- i.forEach((p) => {
300
- var g, c, d;
301
- const m = a("div", {
298
+ }, n = new URL(import.meta.url), a = n.origin + n.pathname.replace(/\/src\/[^/]*$/, "/assets/");
299
+ i.forEach((s) => {
300
+ var y, c, l;
301
+ const u = p("div", {
302
302
  className: "spot-qualifying-reasons__item",
303
303
  parent: r
304
- }), b = a("div", {
304
+ }), h = p("div", {
305
305
  className: "spot-qualifying-reasons__icon-wrapper",
306
- parent: m
307
- }), f = e[((g = p.benefitType) == null ? void 0 : g.name) || ""] || e[p.name || ""];
306
+ parent: u
307
+ }), f = e[((y = s.benefitType) == null ? void 0 : y.name) || ""] || e[s.name || ""];
308
308
  if (f) {
309
- const l = a("img", {
310
- parent: b
309
+ const m = p("img", {
310
+ parent: h
311
311
  });
312
- l.src = n + f, l.alt = ((c = p.benefitType) == null ? void 0 : c.name) || p.name || "", l.className = "spot-qualifying-reasons__icon";
312
+ m.src = a + f, m.alt = ((c = s.benefitType) == null ? void 0 : c.name) || s.name || "", m.className = "spot-qualifying-reasons__icon";
313
313
  }
314
- a("span", {
314
+ p("span", {
315
315
  className: "spot-qualifying-reasons__label",
316
- text: ((d = p.benefitType) == null ? void 0 : d.name) || p.name || "",
317
- parent: m
316
+ text: ((l = s.benefitType) == null ? void 0 : l.name) || s.name || "",
317
+ parent: u
318
318
  });
319
319
  });
320
320
  }
321
- function L(u, t = []) {
321
+ function L(d, t = []) {
322
322
  if (t.length === 0) return;
323
- const o = a("div", {
323
+ const o = p("div", {
324
324
  className: "spot-covered-items__container",
325
- parent: u
325
+ parent: d
326
326
  });
327
- a("div", {
327
+ p("div", {
328
328
  className: "spot-covered-items__title",
329
329
  text: "Items covered in your cart:",
330
330
  parent: o
331
331
  });
332
- const i = a("ul", {
332
+ const i = p("ul", {
333
333
  className: "spot-covered-items__list",
334
334
  parent: o
335
335
  });
336
336
  t.forEach((r) => {
337
- const e = a("li", { parent: i });
338
- a("span", { text: r, parent: e });
337
+ const e = p("li", { parent: i });
338
+ p("span", { text: r, parent: e });
339
339
  });
340
340
  }
341
- function P(u, t = []) {
342
- const o = a("div", {
341
+ function P(d, t = []) {
342
+ const o = p("div", {
343
343
  className: "spot-table__container",
344
- parent: u
345
- }), i = a("table", {
344
+ parent: d
345
+ }), i = p("table", {
346
346
  className: "spot-refund__table spot-table--dynamic",
347
347
  parent: o
348
- }), r = a("thead", { parent: i }), e = a("tr", { parent: r });
349
- a("th", { text: "When you cancel", parent: e }), a("th", { text: "You will receive", parent: e });
350
- const s = a("tbody", { parent: i });
351
- t.forEach(({ text: n, percent: p, amount: m }) => {
352
- const b = a("tr", { parent: s });
353
- a("td", { text: n, parent: b });
354
- const f = p === "Not eligible for refund" ? "Not eligible for a refund" : `$${m} refund`;
355
- a("td", { text: f, parent: b });
348
+ }), r = p("thead", { parent: i }), e = p("tr", { parent: r });
349
+ p("th", { text: "When you cancel", parent: e }), p("th", { text: "You will receive", parent: e });
350
+ const n = p("tbody", { parent: i });
351
+ t.forEach(({ text: a, percent: s, amount: u }) => {
352
+ const h = p("tr", { parent: n });
353
+ p("td", { text: a, parent: h });
354
+ const f = s === "Not eligible for refund" ? "Not eligible for a refund" : `$${u} refund`;
355
+ p("td", { text: f, parent: h });
356
356
  });
357
357
  }
358
- function V(u, t, o) {
359
- const i = a("div", {
358
+ function V(d, t, o) {
359
+ const i = p("div", {
360
360
  className: "spot-selection__options",
361
- parent: u
362
- }), r = a("label", {
361
+ parent: d
362
+ }), r = p("label", {
363
363
  className: `spot-selection__option ${t ? "selected" : ""}`,
364
364
  parent: i
365
- }), e = a("input", { parent: r });
366
- e.type = "radio", e.name = "selection", e.value = "yes", t && (e.checked = !0), a("strong", {
365
+ }), e = p("input", { parent: r });
366
+ e.type = "radio", e.name = "selection", e.value = "yes", t && (e.checked = !0), p("strong", {
367
367
  text: o.yesOptionText,
368
368
  parent: r
369
- }), a("span", {
369
+ }), p("span", {
370
370
  className: "spot-selection__recommended-tag",
371
371
  text: "Recommended",
372
372
  parent: r
373
373
  });
374
- const s = a("label", {
374
+ const n = p("label", {
375
375
  className: "spot-selection__option",
376
376
  parent: i
377
- }), n = a("input", { parent: s });
378
- return n.type = "radio", n.name = "selection", n.value = "no", a("span", { text: o.noOptionText, parent: s }), i;
377
+ }), a = p("input", { parent: n });
378
+ return a.type = "radio", a.name = "selection", a.value = "no", p("span", { text: o.noOptionText, parent: n }), i;
379
379
  }
380
- function R(u, t) {
380
+ function R(d, t) {
381
381
  var r;
382
- const o = (r = t.communication) == null ? void 0 : r.paymentTerms, i = a("div", {
382
+ const o = (r = t.communication) == null ? void 0 : r.paymentTerms, i = p("div", {
383
383
  className: "spot-payment-terms",
384
- parent: u
384
+ parent: d
385
385
  });
386
- return a("div", {
386
+ return p("div", {
387
387
  className: "spot-payment-terms__header",
388
388
  text: "PAYMENT TERMS",
389
389
  parent: i
390
- }), a("div", {
390
+ }), p("div", {
391
391
  className: "spot-payment-terms__body",
392
392
  text: o || "",
393
393
  parent: i
394
394
  }), i;
395
395
  }
396
- function $(u, t, o = "bottom-right") {
396
+ function $(d, t, o = "bottom-right") {
397
397
  if (o === "top-right") {
398
- const e = a("div", {
398
+ const e = p("div", {
399
399
  className: "spot-logo__top-right",
400
- parent: u
400
+ parent: d
401
401
  });
402
402
  e.innerHTML = `
403
403
  <svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -416,24 +416,24 @@ function $(u, t, o = "bottom-right") {
416
416
  </defs>
417
417
  </svg>`;
418
418
  }
419
- const i = a("div", {
419
+ const i = p("div", {
420
420
  className: "spot-footer__container",
421
- parent: u
422
- }), r = a("div", {
421
+ parent: d
422
+ }), r = p("div", {
423
423
  className: "spot-footer__terms",
424
424
  parent: i
425
425
  });
426
- if (a("span", {
426
+ if (p("span", {
427
427
  innerHTML: t.communication.legalDisclaimer,
428
428
  parent: r
429
- }), a("br", { parent: r }), a("a", {
429
+ }), p("br", { parent: r }), p("a", {
430
430
  href: t.communication.termsAndConditionsUrl,
431
431
  target: "_blank",
432
432
  className: "spot-footer__terms-link",
433
433
  text: "Refund Guarantee Terms and Conditions",
434
434
  parent: r
435
435
  }), o === "bottom-right") {
436
- const e = a("p", {
436
+ const e = p("p", {
437
437
  className: "spot-footer__powered-by",
438
438
  parent: i
439
439
  });
@@ -457,9 +457,9 @@ function $(u, t, o = "bottom-right") {
457
457
  return i;
458
458
  }
459
459
  const S = ":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-title-font-size: 1.25rem;--spot-title-font-weight: 700;--spot-title-padding: 0 0 1.25rem 0;--spot-description-font-size: .875rem;--spot-description-font-weight: 400;--spot-description-padding: 0 0 .5rem 0;--spot-bullets-font-size: .875rem;--spot-bullets-font-weight: 400;--spot-bullets-padding: .3125rem;--spot-table-border-radius: .625rem;--spot-table-header-font-size: .875rem;--spot-table-header-font-weight: 700;--spot-table-header-padding: 0 .5rem .625rem;--spot-table-cell-font-size: .815rem;--spot-table-cell-font-weight: 400;--spot-table-cell-padding: 0 .625rem;--spot-radio-border: #000000;--spot-radio-border-radius: .625rem;--spot-radio-checked-background: #000000;--spot-radio-text-font-size: .875rem;--spot-radio-text-font-weight: 400;--spot-radio-text-padding: .625rem;--spot-radio-selection-background: #f4f4f4;--spot-radio-selection-border-radius: .625rem;--spot-radio-selection-padding: .625rem;--spot-recommended-tag-background: #000000;--spot-recommended-tag-font-color: #ffffff;--spot-recommended-tag-font-size: .875rem;--spot-recommended-tag-font-weight: 700;--spot-recommended-tag-padding: .25rem .5rem;--spot-recommended-tag-border-radius: .5rem;--spot-selection-error-font-color: #ff0000;--spot-selection-error-font-size: .875rem;--spot-qualifying-reasons-margin: .75rem 0;--spot-qualifying-reasons-padding: 0 .3125rem;--spot-qualifying-reasons-column-gap: 3rem;--spot-qualifying-reasons-row-gap: .25rem;--spot-qualifying-reasons-grid-padding-left: 1rem;--spot-qualifying-reasons-icon-wrapper-size: 1.125rem;--spot-qualifying-reasons-icon-size: .75rem;--spot-qualifying-reasons-icon-border-color: #2e2e2e;--spot-qualifying-reasons-icon-border-width: 1px;--spot-qualifying-reasons-icon-background: #ffffff;--spot-qualifying-reasons-item-gap: .625rem;--spot-qualifying-reasons-label-font-size: .8rem;--spot-qualifying-reasons-label-font-weight: 400;--spot-qualifying-reasons-label-font-color: #000000;--spot-qualifying-reasons-label-font-family: Arial;--spot-selection-error-padding: .5rem;--spot-payment-terms-background: #f4f4f4;--spot-payment-terms-border-radius: .625rem;--spot-payment-terms-padding: 1rem;--spot-payment-terms-font-color: #636569;--spot-payment-terms-font-size: .75rem;--spot-payment-terms-header-font-weight: 700;--spot-payment-terms-header-font-size: .875rem;--spot-payment-terms-header-margin-bottom: .5rem;--spot-payment-terms-header-border-color: #c2c2c2;--spot-payment-terms-header-padding: 0 0 .5rem 0;--spot-terms-font-size: .75rem;--spot-terms-font-weight: 400;--spot-terms-font-color: #636569;--spot-terms-padding: 0;--spot-terms-link-text-decoration: underline;--spot-terms-link-font-size: .75rem;--spot-terms-link-font-weight: 400;--spot-terms-link-font-color: #636569;--spot-terms-link-padding: 0;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 0rem;--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:51rem;margin:1rem;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-qualifying-reasons__container{margin:var(--spot-qualifying-reasons-margin);padding:var(--spot-qualifying-reasons-padding)}.spot-qualifying-reasons__grid{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:var(--spot-qualifying-reasons-column-gap);row-gap:var(--spot-qualifying-reasons-row-gap);max-width:100%;padding-left:var(--spot-qualifying-reasons-grid-padding-left)}.spot-qualifying-reasons__item{display:flex;align-items:center;gap:var(--spot-qualifying-reasons-item-gap)}.spot-qualifying-reasons__icon-wrapper{width:var(--spot-qualifying-reasons-icon-wrapper-size);height:var(--spot-qualifying-reasons-icon-wrapper-size);border-radius:50%;border:var(--spot-qualifying-reasons-icon-border-width) solid var(--spot-qualifying-reasons-icon-border-color);background-color:var(--spot-qualifying-reasons-icon-background);display:flex;align-items:center;justify-content:center;flex-shrink:0}.spot-qualifying-reasons__icon{width:var(--spot-qualifying-reasons-icon-size);height:var(--spot-qualifying-reasons-icon-size)}.spot-qualifying-reasons__label{font-size:var(--spot-qualifying-reasons-label-font-size);font-weight:var(--spot-qualifying-reasons-label-font-weight);color:var(--spot-qualifying-reasons-label-font-color);font-family:var(--spot-qualifying-reasons-label-font-family);line-height:1.2}@media (max-width: 480px){.spot-qualifying-reasons__grid{grid-template-columns:1fr}}.spot-covered-items__container{margin-top:0;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:0 .3125rem .25rem;line-height:125%;margin:0}.spot-covered-items__list{list-style-type:disc;list-style-position:inside;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-covered-items__list li{margin-bottom:.3rem;text-align:left}.spot-table__container{width:100%}.spot-refund__table{max-width:22rem;border-radius:var(--spot-table-border-radius);overflow:hidden;border:.09375rem solid #636569;table-layout:fixed;margin-bottom:.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)}}";
460
- function Q(u) {
460
+ function Q(d) {
461
461
  const t = document.createElement("style");
462
- t.textContent = u, document.head.appendChild(t);
462
+ t.textContent = d, document.head.appendChild(t);
463
463
  }
464
464
  Q(S);
465
465
  const T = {
@@ -477,55 +477,68 @@ class Z {
477
477
  apiConfig: { environment: "production", partnerId: "" },
478
478
  quoteRequestData: {},
479
479
  callbacks: {},
480
+ useMockData: !1,
480
481
  ...t
481
482
  }, 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();
482
483
  }
483
484
  async _init() {
484
485
  var t, o, i, r, e;
485
486
  try {
486
- D(this.options);
487
- const { environment: s, partnerId: n } = this.options.apiConfig, m = this.options.apiConfig.customEndpoint || T[s], f = "cartInfo" in this.options.quoteRequestData && "items" in this.options.quoteRequestData ? await I(
488
- m,
489
- n,
490
- this.options.quoteRequestData
491
- ) : await k(m, n, this.options.quoteRequestData);
492
- if (f.status !== "QUOTE_AVAILABLE") {
493
- f.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
487
+ I(this.options);
488
+ let n;
489
+ if (this.options.useMockData && this.options.mockData)
490
+ n = this.options.mockData;
491
+ else {
492
+ const { environment: a, partnerId: s } = this.options.apiConfig, h = this.options.apiConfig.customEndpoint || T[a];
493
+ n = "cartInfo" in this.options.quoteRequestData && "items" in this.options.quoteRequestData ? await D(
494
+ h,
495
+ s,
496
+ this.options.quoteRequestData
497
+ ) : await k(
498
+ h,
499
+ s,
500
+ this.options.quoteRequestData
501
+ );
502
+ }
503
+ if (n.status !== "QUOTE_AVAILABLE") {
504
+ n.status === "NO_MATCHING_QUOTE" && ((t = this.options.callbacks) != null && t.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
494
505
  status: "NO_MATCHING_QUOTE",
495
506
  data: this.options.quoteRequestData
496
507
  });
497
508
  return;
498
509
  }
499
- if (this.quote = f.data, this._renderWidget(), this.options.optInSelected && ((o = this.options.callbacks) != null && o.onOptIn)) {
500
- const g = {
510
+ if (this.quote = n.data, !this.quote)
511
+ throw new Error("No quote data in response");
512
+ if (this._renderWidget(), this.options.optInSelected && ((o = this.options.callbacks) != null && o.onOptIn)) {
513
+ const a = {
501
514
  status: "QUOTE_ACCEPTED",
502
515
  spotPrice: this.quote.spotPrice,
503
516
  quoteId: this.quote.id
504
517
  };
505
518
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
506
- const c = this.options.quoteRequestData;
507
- g.batchQuoteDetails = this.quote.originalQuotes.map((d) => {
508
- var w;
509
- const l = (w = c.items) == null ? void 0 : w.find(
510
- (_) => (_.cartItemId || `item-${c.items.indexOf(_) + 1}`) === d.id
519
+ const s = this.options.quoteRequestData;
520
+ a.batchQuoteDetails = this.quote.originalQuotes.map((u) => {
521
+ var f;
522
+ const h = (f = s.items) == null ? void 0 : f.find(
523
+ (y) => (y.cartItemId || `item-${s.items.indexOf(y) + 1}`) === u.id
511
524
  );
512
525
  return {
513
- quoteId: d.id,
514
- productPrice: (l == null ? void 0 : l.productPrice) || d.spotPrice,
515
- cartItemId: d.id
526
+ quoteId: u.id,
527
+ productPrice: (h == null ? void 0 : h.productPrice) || u.spotPrice,
528
+ cartItemId: u.id
516
529
  };
517
530
  });
518
531
  }
519
- this.options.callbacks.onOptIn(g);
532
+ this.options.callbacks.onOptIn(a);
520
533
  }
521
534
  (i = this.options.callbacks) != null && i.onQuoteRetrieved && this.options.callbacks.onQuoteRetrieved(this.quote);
522
- } catch (s) {
535
+ } catch (n) {
523
536
  if ((r = this.options.callbacks) != null && r.onError) {
524
- const n = s;
537
+ const a = n;
525
538
  (e = this.options.callbacks) == null || e.onError({
526
- message: n.message,
527
- status: n.status,
528
- responseBody: n.responseBody
539
+ message: a.message,
540
+ status: a.status,
541
+ responseBody: a.responseBody
529
542
  });
530
543
  }
531
544
  }
@@ -543,7 +556,7 @@ class Z {
543
556
  this.options.optInSelected,
544
557
  this.quote.communication
545
558
  );
546
- t.appendChild(o), this.paymentTermsEl = a("div", {
559
+ t.appendChild(o), this.paymentTermsEl = p("div", {
547
560
  className: "spot-payment-terms__wrapper",
548
561
  parent: t
549
562
  }), $(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(o);
@@ -567,13 +580,13 @@ class Z {
567
580
  if (o >= 650) {
568
581
  const e = t.classList.contains("desktop-layout");
569
582
  t.classList.remove("desktop-layout"), t.offsetHeight;
570
- const s = t.querySelector(
583
+ const n = t.querySelector(
571
584
  ".spot-benefits__list, .spot-qualifying-reasons__container"
572
585
  );
573
- if (!s)
586
+ if (!n)
574
587
  return e && t.classList.add("desktop-layout"), e;
575
- const p = Math.min(s.scrollWidth, 400) + i + r;
576
- return e && t.classList.add("desktop-layout"), o >= p;
588
+ const s = Math.min(n.scrollWidth, 400) + i + r;
589
+ return e && t.classList.add("desktop-layout"), o >= s;
577
590
  }
578
591
  return !1;
579
592
  }
@@ -590,25 +603,25 @@ class Z {
590
603
  ), i = t.querySelectorAll(".spot-selection__option");
591
604
  o.forEach((r) => {
592
605
  r.addEventListener("change", (e) => {
593
- var p, m, b;
594
- const s = e.target, n = s.value;
595
- if (this.hideSelectionError(), this.currentSelection = n, i.forEach((f) => f.classList.remove("selected")), (p = s.closest(".spot-selection__option")) == null || p.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), n === "yes" && (this.options.quoteRequestData.isPartialPayment && R(this.paymentTermsEl, this.quote), (m = this.options.callbacks) != null && m.onOptIn)) {
606
+ var s, u, h;
607
+ const n = e.target, a = n.value;
608
+ if (this.hideSelectionError(), this.currentSelection = a, i.forEach((f) => f.classList.remove("selected")), (s = n.closest(".spot-selection__option")) == null || s.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), a === "yes" && (this.options.quoteRequestData.isPartialPayment && R(this.paymentTermsEl, this.quote), (u = this.options.callbacks) != null && u.onOptIn)) {
596
609
  const f = {
597
610
  status: "QUOTE_ACCEPTED",
598
611
  spotPrice: this.quote.spotPrice,
599
612
  quoteId: this.quote.id
600
613
  };
601
614
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
602
- const g = this.options.quoteRequestData;
615
+ const y = this.options.quoteRequestData;
603
616
  f.batchQuoteDetails = this.quote.originalQuotes.map(
604
617
  (c) => {
605
- var l;
606
- const d = (l = g.items) == null ? void 0 : l.find(
607
- (w) => (w.cartItemId || `item-${g.items.indexOf(w) + 1}`) === c.id
618
+ var m;
619
+ const l = (m = y.items) == null ? void 0 : m.find(
620
+ (b) => (b.cartItemId || `item-${y.items.indexOf(b) + 1}`) === c.id
608
621
  );
609
622
  return {
610
623
  quoteId: c.id,
611
- productPrice: (d == null ? void 0 : d.productPrice) || c.spotPrice,
624
+ productPrice: (l == null ? void 0 : l.productPrice) || c.spotPrice,
612
625
  cartItemId: c.id
613
626
  };
614
627
  }
@@ -616,22 +629,22 @@ class Z {
616
629
  }
617
630
  this.options.callbacks.onOptIn(f);
618
631
  }
619
- if (n === "no" && ((b = this.options.callbacks) != null && b.onOptOut)) {
632
+ if (a === "no" && ((h = this.options.callbacks) != null && h.onOptOut)) {
620
633
  const f = {
621
634
  status: "QUOTE_DECLINED",
622
635
  quoteId: this.quote.id
623
636
  };
624
637
  if (this.quote.originalQuotes && this.quote.originalQuotes.length > 0) {
625
- const g = this.options.quoteRequestData;
638
+ const y = this.options.quoteRequestData;
626
639
  f.batchQuoteDetails = this.quote.originalQuotes.map(
627
640
  (c) => {
628
- var l;
629
- const d = (l = g.items) == null ? void 0 : l.find(
630
- (w) => (w.cartItemId || `item-${g.items.indexOf(w) + 1}`) === c.id
641
+ var m;
642
+ const l = (m = y.items) == null ? void 0 : m.find(
643
+ (b) => (b.cartItemId || `item-${y.items.indexOf(b) + 1}`) === c.id
631
644
  );
632
645
  return {
633
646
  quoteId: c.id,
634
- productPrice: (d == null ? void 0 : d.productPrice) || c.spotPrice,
647
+ productPrice: (l == null ? void 0 : l.productPrice) || c.spotPrice,
635
648
  cartItemId: c.id
636
649
  };
637
650
  }
@@ -666,30 +679,30 @@ class Z {
666
679
  async updateQuote(t) {
667
680
  var o, i, r, e;
668
681
  try {
669
- const s = {
682
+ const n = {
670
683
  ...this.options,
671
684
  quoteRequestData: t
672
685
  };
673
- D(s);
674
- const { environment: n, partnerId: p, customEndpoint: m } = this.options.apiConfig, b = m || T[n], g = "cartInfo" in s.quoteRequestData && "items" in s.quoteRequestData ? await I(
675
- b,
676
- p,
677
- s.quoteRequestData
686
+ I(n);
687
+ const { environment: a, partnerId: s, customEndpoint: u } = this.options.apiConfig, h = u || T[a], y = "cartInfo" in n.quoteRequestData && "items" in n.quoteRequestData ? await D(
688
+ h,
689
+ s,
690
+ n.quoteRequestData
678
691
  ) : await k(
679
- b,
680
- p,
681
- s.quoteRequestData
692
+ h,
693
+ s,
694
+ n.quoteRequestData
682
695
  );
683
- return g.status !== "QUOTE_AVAILABLE" ? (g.status === "NO_MATCHING_QUOTE" && ((o = this.options.callbacks) != null && o.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
696
+ return y.status !== "QUOTE_AVAILABLE" ? (y.status === "NO_MATCHING_QUOTE" && ((o = this.options.callbacks) != null && o.noMatchingQuote) && this.options.callbacks.noMatchingQuote({
684
697
  status: "NO_MATCHING_QUOTE",
685
- data: s.quoteRequestData
686
- }), !1) : (this.options.quoteRequestData = s.quoteRequestData, this.quote = g.data, this.currentSelection = null, this.destroy(), this._renderWidget(), (i = this.options.callbacks) != null && i.onQuoteRetrieved && this.options.callbacks.onQuoteRetrieved(this.quote), !0);
687
- } catch (s) {
688
- const n = s;
698
+ data: n.quoteRequestData
699
+ }), !1) : (this.options.quoteRequestData = n.quoteRequestData, this.quote = y.data, this.currentSelection = null, this.destroy(), this._renderWidget(), (i = this.options.callbacks) != null && i.onQuoteRetrieved && this.options.callbacks.onQuoteRetrieved(this.quote), !0);
700
+ } catch (n) {
701
+ const a = n;
689
702
  return (e = (r = this.options.callbacks) == null ? void 0 : r.onError) == null || e.call(r, {
690
- message: n.message,
691
- status: n.status,
692
- responseBody: n.responseBody
703
+ message: a.message,
704
+ status: a.status,
705
+ responseBody: a.responseBody
693
706
  }), !1;
694
707
  }
695
708
  }
@@ -704,15 +717,15 @@ class Z {
704
717
  };
705
718
  if ((r = this.quote) != null && r.originalQuotes && this.quote.originalQuotes.length > 0) {
706
719
  const e = this.options.quoteRequestData;
707
- t.batchQuoteDetails = this.quote.originalQuotes.map((s) => {
708
- var p;
709
- const n = (p = e.items) == null ? void 0 : p.find(
710
- (m) => (m.cartItemId || `item-${e.items.indexOf(m) + 1}`) === s.id
720
+ t.batchQuoteDetails = this.quote.originalQuotes.map((n) => {
721
+ var s;
722
+ const a = (s = e.items) == null ? void 0 : s.find(
723
+ (u) => (u.cartItemId || `item-${e.items.indexOf(u) + 1}`) === n.id
711
724
  );
712
725
  return {
713
- quoteId: s.id,
714
- productPrice: (n == null ? void 0 : n.productPrice) || s.spotPrice,
715
- cartItemId: s.id
726
+ quoteId: n.id,
727
+ productPrice: (a == null ? void 0 : a.productPrice) || n.spotPrice,
728
+ cartItemId: n.id
716
729
  };
717
730
  });
718
731
  }
package/dist/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(_,v){typeof exports=="object"&&typeof module<"u"?module.exports=v():typeof define=="function"&&define.amd?define(v):(_=typeof globalThis<"u"?globalThis:_||self,_.SpotWidget=v())})(this,function(){"use strict";var _=typeof document<"u"?document.currentScript:null;async function v(u,t,o){try{const n=await fetch(u,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),r=await n.json();if(!n.ok){const e=new Error((r==null?void 0:r.message)||"Failed to fetch quote");throw e.status=n.status,e.responseBody=r,e}return r}catch(n){throw n instanceof Error?n:new Error("Unknown error occurred while fetching quote")}}async function N(u,t,o){try{const n=u.replace("/quote","/quote/batch"),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),e=await r.json();if(!r.ok){const a=new Error((e==null?void 0:e.message)||"Failed to fetch batch quote");throw a.status=r.status,a.responseBody=e,a}return e}catch(n){throw n instanceof Error?n:new Error("Unknown error occurred while fetching batch quote")}}async function x(u,t,o){var n;try{const r={cartId:o.cartInfo.cartId,cartName:o.cartInfo.cartName,currencyCode:o.cartInfo.currencyCode,items:o.items.map((p,m)=>({cartItemId:p.cartItemId||`item-${m+1}`,productPrice:p.productPrice,productType:p.productType,productDuration:p.productDuration,productId:p.productId,productName:p.productName,participantDescription:p.participantDescription,eventType:p.eventType,startDate:p.startDate,endDate:p.endDate}))},e=await N(u,t,r);if(e.status!=="QUOTES_AVAILABLE"&&e.status!=="QUOTE_AVAILABLE")return{status:"NO_MATCHING_QUOTE"};const a=e.quotes.map(p=>{const m=o.items.find((b,f)=>(b.cartItemId||`item-${f+1}`)===p.cartItemId);return m?m.participantDescription?`${m.productName} - ${m.participantDescription}`:m.productName:`Item ${p.id}`}),i=Math.round((e.totalSpotPrice||e.spotPrice||0)*100)/100;return{status:"QUOTE_AVAILABLE",data:{id:e.quotes?e.quotes.map(p=>p.id).join(","):((n=e.data)==null?void 0:n.id)||"",spotPrice:i,currencyCode:e.currencyCode||"",communication:{...e.communication,yesOptionText:e.communication.yesOptionText.replace(String(e.totalSpotPrice),String(i))},payoutSchedule:e.payoutSchedule.map(p=>({...p,amount:p.amount!==void 0?p.amount:0})),coveredItems:a,originalQuotes:e.quotes||(e.data?[e.data]:[])},spotPrice:i,coveredItems:a}}catch(r){throw r instanceof Error?r:new Error("Unknown error occurred while fetching multiple quotes")}}const M={sandbox:"https://api.sandbox.getspot.com/v1/quote",production:"https://api.getspot.com/v1/quote",local:"http://localhost:3999/api/v1/quote"};function k(u){const{apiConfig:t={},quoteRequestData:o,callbacks:n={},location:r,theme:e}=u,{environment:a="sandbox",partnerId:i,customEndpoint:p}=t;if(!i||typeof i!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(p||M[a]))throw new Error(`Invalid environment in apiConfig: ${a}`);if(!o||typeof o!="object"&&!Array.isArray(o))throw new Error("quoteRequestData must be a non-null object or array");const b=["startDate","endDate","currencyCode","eventType","productType","productDuration","productPrice","productId","cartId","productName"];function f(c,d=null){const l=d!==null?`quoteRequestData[${d}]`:"quoteRequestData";b.forEach(y=>{if(!Object.prototype.hasOwnProperty.call(c,y)||c[y]===void 0||c[y]===null)throw new Error(`Missing required ${l} field: '${y}'`)});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 h=["Pass","Trip","Registration"];if(!h.includes(c.productType))throw new Error(`${l}.productType must be one of ${h.join(", ")}`);if(typeof c.productDuration!="string")throw new Error(`${l}.productDuration must be a string`);const q=["Daily","Seasonal","Trip","Event"];if(!q.includes(c.productDuration))throw new Error(`${l}.productDuration must be one of ${q.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 C=["startDate","endDate","eventType","productType","productDuration","productPrice","productId","productName"];l.forEach((h,q)=>{if(!h||typeof h!="object")throw new Error(`quoteRequestData.items[${q}] must be a non-null object`);const y=`quoteRequestData.items[${q}]`;C.forEach(E=>{if(!Object.prototype.hasOwnProperty.call(h,E)||h[E]===void 0||h[E]===null)throw new Error(`Missing required ${y} field: '${E}'`)});const D=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!D.test(h.startDate))throw new Error(`${y}.startDate must be a valid ISO8601 string`);if(!D.test(h.endDate))throw new Error(`${y}.endDate must be a valid ISO8601 string`);if(typeof h.eventType!="string")throw new Error(`${y}.eventType must be a string`);if(typeof h.productType!="string")throw new Error(`${y}.productType must be a string`);const T=["Pass","Trip","Registration"];if(!T.includes(h.productType))throw new Error(`${y}.productType must be one of ${T.join(", ")}`);if(typeof h.productDuration!="string")throw new Error(`${y}.productDuration must be a string`);const H=["Daily","Seasonal","Trip","Event"];if(!H.includes(h.productDuration))throw new Error(`${y}.productDuration must be one of ${H.join(", ")}`);if(typeof h.productPrice!="number"||isNaN(h.productPrice))throw new Error(`${y}.productPrice must be a valid number`);if(typeof h.productId!="string")throw new Error(`${y}.productId must be a string`);if(typeof h.productName!="string")throw new Error(`${y}.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`);f(c,d)})}else f(o);if(["onOptIn","onOptOut","onQuoteRetrieved","onError","noMatchingQuote"].forEach(c=>{const d=n[c];if(d&&typeof d!="function")throw new Error(`Callback '${c}' must be a function.`)}),typeof r=="string"&&!document.querySelector(r))throw new Error(`Invalid location selector: '${r}'`);if(e&&typeof e!="object")throw new Error("Theme must be an object with CSS variables, do not include the '--' prefix")}function s(u,{text:t,className:o,parent:n,innerHTML:r,href:e,target:a}={}){const i=document.createElement(u);return o&&(i.className=o),t!=null&&(i.textContent=t),r!=null&&(i.innerHTML=r),e&&"href"in i&&(i.href=e),a&&"target"in i&&(i.target=a),n&&n.appendChild(i),i}function z(u,{name:t,description:o}){s("div",{className:"spot-header__title",text:t,parent:u}),s("div",{className:"spot-header__description",text:o,parent:u})}function O(u,t=[]){const o=s("ul",{className:"spot-benefits__list",parent:u});t.forEach(n=>{const r=s("li",{parent:o});r.innerHTML=`
1
+ (function(_,v){typeof exports=="object"&&typeof module<"u"?module.exports=v():typeof define=="function"&&define.amd?define(v):(_=typeof globalThis<"u"?globalThis:_||self,_.SpotWidget=v())})(this,function(){"use strict";var _=typeof document<"u"?document.currentScript:null;async function v(d,t,o){try{const n=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),r=await n.json();if(!n.ok){const e=new Error((r==null?void 0:r.message)||"Failed to fetch quote");throw e.status=n.status,e.responseBody=r,e}return r}catch(n){throw n instanceof Error?n:new Error("Unknown error occurred while fetching quote")}}async function M(d,t,o){try{const n=d.replace("/quote","/quote/batch"),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),e=await r.json();if(!r.ok){const i=new Error((e==null?void 0:e.message)||"Failed to fetch batch quote");throw i.status=r.status,i.responseBody=e,i}return e}catch(n){throw n instanceof Error?n:new Error("Unknown error occurred while fetching batch quote")}}async function E(d,t,o){var n;try{const r={cartId:o.cartInfo.cartId,cartName:o.cartInfo.cartName,currencyCode:o.cartInfo.currencyCode,items:o.items.map((s,u)=>({cartItemId:s.cartItemId||`item-${u+1}`,productPrice:s.productPrice,productType:s.productType,productDuration:s.productDuration,productId:s.productId,productName:s.productName,participantDescription:s.participantDescription,eventType:s.eventType,startDate:s.startDate,endDate:s.endDate}))},e=await M(d,t,r);if(e.status!=="QUOTES_AVAILABLE"&&e.status!=="QUOTE_AVAILABLE")return{status:"NO_MATCHING_QUOTE"};const i=e.quotes.map(s=>{const u=o.items.find((h,f)=>(h.cartItemId||`item-${f+1}`)===s.cartItemId);return u?u.participantDescription?`${u.productName} - ${u.participantDescription}`:u.productName:`Item ${s.id}`}),a=Math.round((e.totalSpotPrice||e.spotPrice||0)*100)/100;return{status:"QUOTE_AVAILABLE",data:{id:e.quotes?e.quotes.map(s=>s.id).join(","):((n=e.data)==null?void 0:n.id)||"",spotPrice:a,currencyCode:e.currencyCode||"",communication:{...e.communication,yesOptionText:e.communication.yesOptionText.replace(String(e.totalSpotPrice),String(a))},payoutSchedule:e.payoutSchedule.map(s=>({...s,amount:s.amount!==void 0?s.amount:0})),coveredItems:i,originalQuotes:e.quotes||(e.data?[e.data]:[])},spotPrice:a,coveredItems:i}}catch(r){throw r instanceof Error?r:new Error("Unknown error occurred while fetching multiple quotes")}}const N={sandbox:"https://api.sandbox.getspot.com/v1/quote",production:"https://api.getspot.com/v1/quote",local:"http://localhost:3999/api/v1/quote"};function x(d){const{apiConfig:t={},quoteRequestData:o,callbacks:n={},location:r,theme:e}=d,{environment:i="sandbox",partnerId:a,customEndpoint:s}=t;if(!a||typeof a!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(s||N[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 h=["startDate","endDate","currencyCode","eventType","productType","productDuration","productPrice","productId","cartId","productName"];function f(c,l=null){const m=l!==null?`quoteRequestData[${l}]`:"quoteRequestData";h.forEach(w=>{if(!Object.prototype.hasOwnProperty.call(c,w)||c[w]===void 0||c[w]===null)throw new Error(`Missing required ${m} field: '${w}'`)});const b=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;if(!b.test(c.startDate))throw new Error(`${m}.startDate must be a valid ISO8601 string`);if(!b.test(c.endDate))throw new Error(`${m}.endDate must be a valid ISO8601 string`);if(typeof c.currencyCode!="string")throw new Error(`${m}.currencyCode must be a string`);if(!["USD","CAD","AUD"].includes(c.currencyCode))throw new Error(`Invalid ${m}.currencyCode: ${c.currencyCode}`);if(typeof c.eventType!="string")throw new Error(`${m}.eventType must be a string`);if(typeof c.productType!="string")throw new Error(`${m}.productType must be a string`);const g=["Pass","Trip","Registration"];if(!g.includes(c.productType))throw new Error(`${m}.productType must be one of ${g.join(", ")}`);if(typeof c.productDuration!="string")throw new Error(`${m}.productDuration must be a string`);const C=["Daily","Seasonal","Trip","Event"];if(!C.includes(c.productDuration))throw new Error(`${m}.productDuration must be one of ${C.join(", ")}`);if(typeof c.productPrice!="number"||isNaN(c.productPrice))throw new Error(`${m}.productPrice must be a valid number`);if(typeof c.productId!="string")throw new Error(`${m}.productId must be a string`);if(typeof c.cartId!="string")throw new Error(`${m}.cartId must be a string`);if(typeof c.productName!="string")throw new Error(`${m}.productName must be a string`)}if("cartInfo"in o&&"items"in o){const c=o,{cartInfo:l,items:m}=c;if(!l||typeof l!="object")throw new Error("quoteRequestData.cartInfo must be a non-null object");if(!l.cartId||typeof l.cartId!="string")throw new Error("quoteRequestData.cartInfo.cartId must be a string");if(!l.cartName||typeof l.cartName!="string")throw new Error("quoteRequestData.cartInfo.cartName must be a string");if(!l.currencyCode||typeof l.currencyCode!="string")throw new Error("quoteRequestData.cartInfo.currencyCode must be a string");if(!["USD","CAD","AUD"].includes(l.currencyCode))throw new Error(`Invalid quoteRequestData.cartInfo.currencyCode: ${l.currencyCode}`);if(!Array.isArray(m)||m.length===0)throw new Error("quoteRequestData.items must be a non-empty array");const I=["startDate","endDate","eventType","productType","productDuration","productPrice","productId","productName"];m.forEach((g,C)=>{if(!g||typeof g!="object")throw new Error(`quoteRequestData.items[${C}] must be a non-null object`);const w=`quoteRequestData.items[${C}]`;I.forEach(q=>{if(!Object.prototype.hasOwnProperty.call(g,q)||g[q]===void 0||g[q]===null)throw new Error(`Missing required ${w} field: '${q}'`)});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(`${w}.startDate must be a valid ISO8601 string`);if(!D.test(g.endDate))throw new Error(`${w}.endDate must be a valid ISO8601 string`);if(typeof g.eventType!="string")throw new Error(`${w}.eventType must be a string`);if(typeof g.productType!="string")throw new Error(`${w}.productType must be a string`);const T=["Pass","Trip","Registration"];if(!T.includes(g.productType))throw new Error(`${w}.productType must be one of ${T.join(", ")}`);if(typeof g.productDuration!="string")throw new Error(`${w}.productDuration must be a string`);const H=["Daily","Seasonal","Trip","Event"];if(!H.includes(g.productDuration))throw new Error(`${w}.productDuration must be one of ${H.join(", ")}`);if(typeof g.productPrice!="number"||isNaN(g.productPrice))throw new Error(`${w}.productPrice must be a valid number`);if(typeof g.productId!="string")throw new Error(`${w}.productId must be a string`);if(typeof g.productName!="string")throw new Error(`${w}.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,l)=>{if(!c||typeof c!="object")throw new Error(`quoteRequestData[${l}] must be a non-null object`);f(c,l)})}else f(o);if(["onOptIn","onOptOut","onQuoteRetrieved","onError","noMatchingQuote"].forEach(c=>{const l=n[c];if(l&&typeof l!="function")throw new Error(`Callback '${c}' must be a function.`)}),typeof r=="string"&&!document.querySelector(r))throw new Error(`Invalid location selector: '${r}'`);if(e&&typeof e!="object")throw new Error("Theme must be an object with CSS variables, do not include the '--' prefix")}function p(d,{text:t,className:o,parent:n,innerHTML:r,href:e,target:i}={}){const a=document.createElement(d);return o&&(a.className=o),t!=null&&(a.textContent=t),r!=null&&(a.innerHTML=r),e&&"href"in a&&(a.href=e),i&&"target"in a&&(a.target=i),n&&n.appendChild(a),a}function z(d,{name:t,description:o}){p("div",{className:"spot-header__title",text:t,parent:d}),p("div",{className:"spot-header__description",text:o,parent:d})}function O(d,t=[]){const o=p("ul",{className:"spot-benefits__list",parent:d});t.forEach(n=>{const r=p("li",{parent:o});r.innerHTML=`
2
2
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
3
3
  <path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
4
4
  stroke="#2E2E2E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
- </svg>`,s("span",{text:n,parent:r})})}function L(u,t=[]){if(!t||t.length===0)return;const o=s("div",{className:"spot-qualifying-reasons__container",parent:u}),n=[...t].sort((p,m)=>p.rank-m.rank),r=s("div",{className:"spot-qualifying-reasons__grid",parent:o}),e={"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"},a=new URL(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:_&&_.tagName.toUpperCase()==="SCRIPT"&&_.src||new URL("index.umd.js",document.baseURI).href),i=a.origin+a.pathname.replace(/\/src\/[^/]*$/,"/assets/");n.forEach(p=>{var g,c,d;const m=s("div",{className:"spot-qualifying-reasons__item",parent:r}),b=s("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:m}),f=e[((g=p.benefitType)==null?void 0:g.name)||""]||e[p.name||""];if(f){const l=s("img",{parent:b});l.src=i+f,l.alt=((c=p.benefitType)==null?void 0:c.name)||p.name||"",l.className="spot-qualifying-reasons__icon"}s("span",{className:"spot-qualifying-reasons__label",text:((d=p.benefitType)==null?void 0:d.name)||p.name||"",parent:m})})}function P(u,t=[]){if(t.length===0)return;const o=s("div",{className:"spot-covered-items__container",parent:u});s("div",{className:"spot-covered-items__title",text:"Items covered in your cart:",parent:o});const n=s("ul",{className:"spot-covered-items__list",parent:o});t.forEach(r=>{const e=s("li",{parent:n});s("span",{text:r,parent:e})})}function R(u,t=[]){const o=s("div",{className:"spot-table__container",parent:u}),n=s("table",{className:"spot-refund__table spot-table--dynamic",parent:o}),r=s("thead",{parent:n}),e=s("tr",{parent:r});s("th",{text:"When you cancel",parent:e}),s("th",{text:"You will receive",parent:e});const a=s("tbody",{parent:n});t.forEach(({text:i,percent:p,amount:m})=>{const b=s("tr",{parent:a});s("td",{text:i,parent:b});const f=p==="Not eligible for refund"?"Not eligible for a refund":`$${m} refund`;s("td",{text:f,parent:b})})}function V(u,t,o){const n=s("div",{className:"spot-selection__options",parent:u}),r=s("label",{className:`spot-selection__option ${t?"selected":""}`,parent:n}),e=s("input",{parent:r});e.type="radio",e.name="selection",e.value="yes",t&&(e.checked=!0),s("strong",{text:o.yesOptionText,parent:r}),s("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:r});const a=s("label",{className:"spot-selection__option",parent:n}),i=s("input",{parent:a});return i.type="radio",i.name="selection",i.value="no",s("span",{text:o.noOptionText,parent:a}),n}function S(u,t){var r;const o=(r=t.communication)==null?void 0:r.paymentTerms,n=s("div",{className:"spot-payment-terms",parent:u});return s("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:n}),s("div",{className:"spot-payment-terms__body",text:o||"",parent:n}),n}function $(u,t,o="bottom-right"){if(o==="top-right"){const e=s("div",{className:"spot-logo__top-right",parent:u});e.innerHTML=`
5
+ </svg>`,p("span",{text:n,parent:r})})}function L(d,t=[]){if(!t||t.length===0)return;const o=p("div",{className:"spot-qualifying-reasons__container",parent:d}),n=[...t].sort((s,u)=>s.rank-u.rank),r=p("div",{className:"spot-qualifying-reasons__grid",parent:o}),e={"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"},i=new URL(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:_&&_.tagName.toUpperCase()==="SCRIPT"&&_.src||new URL("index.umd.js",document.baseURI).href),a=i.origin+i.pathname.replace(/\/src\/[^/]*$/,"/assets/");n.forEach(s=>{var y,c,l;const u=p("div",{className:"spot-qualifying-reasons__item",parent:r}),h=p("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:u}),f=e[((y=s.benefitType)==null?void 0:y.name)||""]||e[s.name||""];if(f){const m=p("img",{parent:h});m.src=a+f,m.alt=((c=s.benefitType)==null?void 0:c.name)||s.name||"",m.className="spot-qualifying-reasons__icon"}p("span",{className:"spot-qualifying-reasons__label",text:((l=s.benefitType)==null?void 0:l.name)||s.name||"",parent:u})})}function P(d,t=[]){if(t.length===0)return;const o=p("div",{className:"spot-covered-items__container",parent:d});p("div",{className:"spot-covered-items__title",text:"Items covered in your cart:",parent:o});const n=p("ul",{className:"spot-covered-items__list",parent:o});t.forEach(r=>{const e=p("li",{parent:n});p("span",{text:r,parent:e})})}function R(d,t=[]){const o=p("div",{className:"spot-table__container",parent:d}),n=p("table",{className:"spot-refund__table spot-table--dynamic",parent:o}),r=p("thead",{parent:n}),e=p("tr",{parent:r});p("th",{text:"When you cancel",parent:e}),p("th",{text:"You will receive",parent:e});const i=p("tbody",{parent:n});t.forEach(({text:a,percent:s,amount:u})=>{const h=p("tr",{parent:i});p("td",{text:a,parent:h});const f=s==="Not eligible for refund"?"Not eligible for a refund":`$${u} refund`;p("td",{text:f,parent:h})})}function V(d,t,o){const n=p("div",{className:"spot-selection__options",parent:d}),r=p("label",{className:`spot-selection__option ${t?"selected":""}`,parent:n}),e=p("input",{parent:r});e.type="radio",e.name="selection",e.value="yes",t&&(e.checked=!0),p("strong",{text:o.yesOptionText,parent:r}),p("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:r});const i=p("label",{className:"spot-selection__option",parent:n}),a=p("input",{parent:i});return a.type="radio",a.name="selection",a.value="no",p("span",{text:o.noOptionText,parent:i}),n}function S(d,t){var r;const o=(r=t.communication)==null?void 0:r.paymentTerms,n=p("div",{className:"spot-payment-terms",parent:d});return p("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:n}),p("div",{className:"spot-payment-terms__body",text:o||"",parent:n}),n}function $(d,t,o="bottom-right"){if(o==="top-right"){const e=p("div",{className:"spot-logo__top-right",parent:d});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 n=s("div",{className:"spot-footer__container",parent:u}),r=s("div",{className:"spot-footer__terms",parent:n});if(s("span",{innerHTML:t.communication.legalDisclaimer,parent:r}),s("br",{parent:r}),s("a",{href:t.communication.termsAndConditionsUrl,target:"_blank",className:"spot-footer__terms-link",text:"Refund Guarantee Terms and Conditions",parent:r}),o==="bottom-right"){const e=s("p",{className:"spot-footer__powered-by",parent:n});e.innerHTML=`
20
+ </svg>`}const n=p("div",{className:"spot-footer__container",parent:d}),r=p("div",{className:"spot-footer__terms",parent:n});if(p("span",{innerHTML:t.communication.legalDisclaimer,parent:r}),p("br",{parent:r}),p("a",{href:t.communication.termsAndConditionsUrl,target:"_blank",className:"spot-footer__terms-link",text:"Refund Guarantee Terms and Conditions",parent:r}),o==="bottom-right"){const e=p("p",{className:"spot-footer__powered-by",parent:n});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 n}const Q=":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-title-font-size: 1.25rem;--spot-title-font-weight: 700;--spot-title-padding: 0 0 1.25rem 0;--spot-description-font-size: .875rem;--spot-description-font-weight: 400;--spot-description-padding: 0 0 .5rem 0;--spot-bullets-font-size: .875rem;--spot-bullets-font-weight: 400;--spot-bullets-padding: .3125rem;--spot-table-border-radius: .625rem;--spot-table-header-font-size: .875rem;--spot-table-header-font-weight: 700;--spot-table-header-padding: 0 .5rem .625rem;--spot-table-cell-font-size: .815rem;--spot-table-cell-font-weight: 400;--spot-table-cell-padding: 0 .625rem;--spot-radio-border: #000000;--spot-radio-border-radius: .625rem;--spot-radio-checked-background: #000000;--spot-radio-text-font-size: .875rem;--spot-radio-text-font-weight: 400;--spot-radio-text-padding: .625rem;--spot-radio-selection-background: #f4f4f4;--spot-radio-selection-border-radius: .625rem;--spot-radio-selection-padding: .625rem;--spot-recommended-tag-background: #000000;--spot-recommended-tag-font-color: #ffffff;--spot-recommended-tag-font-size: .875rem;--spot-recommended-tag-font-weight: 700;--spot-recommended-tag-padding: .25rem .5rem;--spot-recommended-tag-border-radius: .5rem;--spot-selection-error-font-color: #ff0000;--spot-selection-error-font-size: .875rem;--spot-qualifying-reasons-margin: .75rem 0;--spot-qualifying-reasons-padding: 0 .3125rem;--spot-qualifying-reasons-column-gap: 3rem;--spot-qualifying-reasons-row-gap: .25rem;--spot-qualifying-reasons-grid-padding-left: 1rem;--spot-qualifying-reasons-icon-wrapper-size: 1.125rem;--spot-qualifying-reasons-icon-size: .75rem;--spot-qualifying-reasons-icon-border-color: #2e2e2e;--spot-qualifying-reasons-icon-border-width: 1px;--spot-qualifying-reasons-icon-background: #ffffff;--spot-qualifying-reasons-item-gap: .625rem;--spot-qualifying-reasons-label-font-size: .8rem;--spot-qualifying-reasons-label-font-weight: 400;--spot-qualifying-reasons-label-font-color: #000000;--spot-qualifying-reasons-label-font-family: Arial;--spot-selection-error-padding: .5rem;--spot-payment-terms-background: #f4f4f4;--spot-payment-terms-border-radius: .625rem;--spot-payment-terms-padding: 1rem;--spot-payment-terms-font-color: #636569;--spot-payment-terms-font-size: .75rem;--spot-payment-terms-header-font-weight: 700;--spot-payment-terms-header-font-size: .875rem;--spot-payment-terms-header-margin-bottom: .5rem;--spot-payment-terms-header-border-color: #c2c2c2;--spot-payment-terms-header-padding: 0 0 .5rem 0;--spot-terms-font-size: .75rem;--spot-terms-font-weight: 400;--spot-terms-font-color: #636569;--spot-terms-padding: 0;--spot-terms-link-text-decoration: underline;--spot-terms-link-font-size: .75rem;--spot-terms-link-font-weight: 400;--spot-terms-link-font-color: #636569;--spot-terms-link-padding: 0;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 0rem;--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:51rem;margin:1rem;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-qualifying-reasons__container{margin:var(--spot-qualifying-reasons-margin);padding:var(--spot-qualifying-reasons-padding)}.spot-qualifying-reasons__grid{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:var(--spot-qualifying-reasons-column-gap);row-gap:var(--spot-qualifying-reasons-row-gap);max-width:100%;padding-left:var(--spot-qualifying-reasons-grid-padding-left)}.spot-qualifying-reasons__item{display:flex;align-items:center;gap:var(--spot-qualifying-reasons-item-gap)}.spot-qualifying-reasons__icon-wrapper{width:var(--spot-qualifying-reasons-icon-wrapper-size);height:var(--spot-qualifying-reasons-icon-wrapper-size);border-radius:50%;border:var(--spot-qualifying-reasons-icon-border-width) solid var(--spot-qualifying-reasons-icon-border-color);background-color:var(--spot-qualifying-reasons-icon-background);display:flex;align-items:center;justify-content:center;flex-shrink:0}.spot-qualifying-reasons__icon{width:var(--spot-qualifying-reasons-icon-size);height:var(--spot-qualifying-reasons-icon-size)}.spot-qualifying-reasons__label{font-size:var(--spot-qualifying-reasons-label-font-size);font-weight:var(--spot-qualifying-reasons-label-font-weight);color:var(--spot-qualifying-reasons-label-font-color);font-family:var(--spot-qualifying-reasons-label-font-family);line-height:1.2}@media (max-width: 480px){.spot-qualifying-reasons__grid{grid-template-columns:1fr}}.spot-covered-items__container{margin-top:0;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:0 .3125rem .25rem;line-height:125%;margin:0}.spot-covered-items__list{list-style-type:disc;list-style-position:inside;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-covered-items__list li{margin-bottom:.3rem;text-align:left}.spot-table__container{width:100%}.spot-refund__table{max-width:22rem;border-radius:var(--spot-table-border-radius);overflow:hidden;border:.09375rem solid #636569;table-layout:fixed;margin-bottom:.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 Z(u){const t=document.createElement("style");t.textContent=u,document.head.appendChild(t)}Z(Q);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:{},...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,n,r,e;try{k(this.options);const{environment:a,partnerId:i}=this.options.apiConfig,m=this.options.apiConfig.customEndpoint||I[a],f="cartInfo"in this.options.quoteRequestData&&"items"in this.options.quoteRequestData?await x(m,i,this.options.quoteRequestData):await v(m,i,this.options.quoteRequestData);if(f.status!=="QUOTE_AVAILABLE"){f.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=f.data,this._renderWidget(),this.options.optInSelected&&((o=this.options.callbacks)!=null&&o.onOptIn)){const g={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;g.batchQuoteDetails=this.quote.originalQuotes.map(d=>{var w;const l=(w=c.items)==null?void 0:w.find(C=>(C.cartItemId||`item-${c.items.indexOf(C)+1}`)===d.id);return{quoteId:d.id,productPrice:(l==null?void 0:l.productPrice)||d.spotPrice,cartItemId:d.id}})}this.options.callbacks.onOptIn(g)}(n=this.options.callbacks)!=null&&n.onQuoteRetrieved&&this.options.callbacks.onQuoteRetrieved(this.quote)}catch(a){if((r=this.options.callbacks)!=null&&r.onError){const i=a;(e=this.options.callbacks)==null||e.onError({message:i.message,status:i.status,responseBody:i.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(([n,r])=>{const e=`--${n}`;this.container.style.setProperty(e,r)}),z(this.container,this.quote.communication);const t=document.createElement("div");t.className="spot-content__wrapper",this.container.appendChild(t),this.quote.qualifyingReasons?L(t,this.quote.qualifyingReasons):O(t,this.quote.communication.bulletPoints),this.quote.coveredItems&&P(t,this.quote.coveredItems),this.options.showTable&&!this.quote.qualifyingReasons&&R(t,this.quote.payoutSchedule);const o=V(t,this.options.optInSelected,this.quote.communication);t.appendChild(o),this.paymentTermsEl=s("div",{className:"spot-payment-terms__wrapper",parent:t}),$(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 n=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",n)}_shouldUseDesktopLayout(t){const o=this.container.offsetWidth-40,n=325,r=16;if(o>=900)return!0;if(o>=650){const e=t.classList.contains("desktop-layout");t.classList.remove("desktop-layout"),t.offsetHeight;const a=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!a)return e&&t.classList.add("desktop-layout"),e;const p=Math.min(a.scrollWidth,400)+n+r;return e&&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))}_setupOptionListeners(t){const o=t.querySelectorAll('input[type="radio"]'),n=t.querySelectorAll(".spot-selection__option");o.forEach(r=>{r.addEventListener("change",e=>{var p,m,b;const a=e.target,i=a.value;if(this.hideSelectionError(),this.currentSelection=i,n.forEach(f=>f.classList.remove("selected")),(p=a.closest(".spot-selection__option"))==null||p.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),i==="yes"&&(this.options.quoteRequestData.isPartialPayment&&S(this.paymentTermsEl,this.quote),(m=this.options.callbacks)!=null&&m.onOptIn)){const f={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const g=this.options.quoteRequestData;f.batchQuoteDetails=this.quote.originalQuotes.map(c=>{var l;const d=(l=g.items)==null?void 0:l.find(w=>(w.cartItemId||`item-${g.items.indexOf(w)+1}`)===c.id);return{quoteId:c.id,productPrice:(d==null?void 0:d.productPrice)||c.spotPrice,cartItemId:c.id}})}this.options.callbacks.onOptIn(f)}if(i==="no"&&((b=this.options.callbacks)!=null&&b.onOptOut)){const f={status:"QUOTE_DECLINED",quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const g=this.options.quoteRequestData;f.batchQuoteDetails=this.quote.originalQuotes.map(c=>{var l;const d=(l=g.items)==null?void 0:l.find(w=>(w.cartItemId||`item-${g.items.indexOf(w)+1}`)===c.id);return{quoteId:c.id,productPrice:(d==null?void 0:d.productPrice)||c.spotPrice,cartItemId:c.id}})}this.options.callbacks.onOptOut(f)}})})}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,n,r,e;try{const a={...this.options,quoteRequestData:t};k(a);const{environment:i,partnerId:p,customEndpoint:m}=this.options.apiConfig,b=m||I[i],g="cartInfo"in a.quoteRequestData&&"items"in a.quoteRequestData?await x(b,p,a.quoteRequestData):await v(b,p,a.quoteRequestData);return g.status!=="QUOTE_AVAILABLE"?(g.status==="NO_MATCHING_QUOTE"&&((o=this.options.callbacks)!=null&&o.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:a.quoteRequestData}),!1):(this.options.quoteRequestData=a.quoteRequestData,this.quote=g.data,this.currentSelection=null,this.destroy(),this._renderWidget(),(n=this.options.callbacks)!=null&&n.onQuoteRetrieved&&this.options.callbacks.onQuoteRetrieved(this.quote),!0)}catch(a){const i=a;return(e=(r=this.options.callbacks)==null?void 0:r.onError)==null||e.call(r,{message:i.message,status:i.status,responseBody:i.responseBody}),!1}}getSelection(){var o,n,r;if(this.currentSelection==null)return null;const t={selection:this.currentSelection,quoteId:(o=this.quote)==null?void 0:o.id,spotPrice:(n=this.quote)==null?void 0:n.spotPrice,status:this.currentSelection==="yes"?"QUOTE_ACCEPTED":"QUOTE_DECLINED"};if((r=this.quote)!=null&&r.originalQuotes&&this.quote.originalQuotes.length>0){const e=this.options.quoteRequestData;t.batchQuoteDetails=this.quote.originalQuotes.map(a=>{var p;const i=(p=e.items)==null?void 0:p.find(m=>(m.cartItemId||`item-${e.items.indexOf(m)+1}`)===a.id);return{quoteId:a.id,productPrice:(i==null?void 0:i.productPrice)||a.spotPrice,cartItemId:a.id}})}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 n}const Q=":root{--spot-font-family: Arial;--spot-padding: 1.25rem;--spot-background-color: #ffffff;--spot-font-color: #000000;--spot-border-radius: .5rem;--spot-title-font-size: 1.25rem;--spot-title-font-weight: 700;--spot-title-padding: 0 0 1.25rem 0;--spot-description-font-size: .875rem;--spot-description-font-weight: 400;--spot-description-padding: 0 0 .5rem 0;--spot-bullets-font-size: .875rem;--spot-bullets-font-weight: 400;--spot-bullets-padding: .3125rem;--spot-table-border-radius: .625rem;--spot-table-header-font-size: .875rem;--spot-table-header-font-weight: 700;--spot-table-header-padding: 0 .5rem .625rem;--spot-table-cell-font-size: .815rem;--spot-table-cell-font-weight: 400;--spot-table-cell-padding: 0 .625rem;--spot-radio-border: #000000;--spot-radio-border-radius: .625rem;--spot-radio-checked-background: #000000;--spot-radio-text-font-size: .875rem;--spot-radio-text-font-weight: 400;--spot-radio-text-padding: .625rem;--spot-radio-selection-background: #f4f4f4;--spot-radio-selection-border-radius: .625rem;--spot-radio-selection-padding: .625rem;--spot-recommended-tag-background: #000000;--spot-recommended-tag-font-color: #ffffff;--spot-recommended-tag-font-size: .875rem;--spot-recommended-tag-font-weight: 700;--spot-recommended-tag-padding: .25rem .5rem;--spot-recommended-tag-border-radius: .5rem;--spot-selection-error-font-color: #ff0000;--spot-selection-error-font-size: .875rem;--spot-qualifying-reasons-margin: .75rem 0;--spot-qualifying-reasons-padding: 0 .3125rem;--spot-qualifying-reasons-column-gap: 3rem;--spot-qualifying-reasons-row-gap: .25rem;--spot-qualifying-reasons-grid-padding-left: 1rem;--spot-qualifying-reasons-icon-wrapper-size: 1.125rem;--spot-qualifying-reasons-icon-size: .75rem;--spot-qualifying-reasons-icon-border-color: #2e2e2e;--spot-qualifying-reasons-icon-border-width: 1px;--spot-qualifying-reasons-icon-background: #ffffff;--spot-qualifying-reasons-item-gap: .625rem;--spot-qualifying-reasons-label-font-size: .8rem;--spot-qualifying-reasons-label-font-weight: 400;--spot-qualifying-reasons-label-font-color: #000000;--spot-qualifying-reasons-label-font-family: Arial;--spot-selection-error-padding: .5rem;--spot-payment-terms-background: #f4f4f4;--spot-payment-terms-border-radius: .625rem;--spot-payment-terms-padding: 1rem;--spot-payment-terms-font-color: #636569;--spot-payment-terms-font-size: .75rem;--spot-payment-terms-header-font-weight: 700;--spot-payment-terms-header-font-size: .875rem;--spot-payment-terms-header-margin-bottom: .5rem;--spot-payment-terms-header-border-color: #c2c2c2;--spot-payment-terms-header-padding: 0 0 .5rem 0;--spot-terms-font-size: .75rem;--spot-terms-font-weight: 400;--spot-terms-font-color: #636569;--spot-terms-padding: 0;--spot-terms-link-text-decoration: underline;--spot-terms-link-font-size: .75rem;--spot-terms-link-font-weight: 400;--spot-terms-link-font-color: #636569;--spot-terms-link-padding: 0;--spot-desktop-radio-margin-top: -1.5rem;--spot-benefits-margin-bottom: 0rem;--spot-covered-items-margin-bottom: 0rem;--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:51rem;margin:1rem;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-qualifying-reasons__container{margin:var(--spot-qualifying-reasons-margin);padding:var(--spot-qualifying-reasons-padding)}.spot-qualifying-reasons__grid{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:var(--spot-qualifying-reasons-column-gap);row-gap:var(--spot-qualifying-reasons-row-gap);max-width:100%;padding-left:var(--spot-qualifying-reasons-grid-padding-left)}.spot-qualifying-reasons__item{display:flex;align-items:center;gap:var(--spot-qualifying-reasons-item-gap)}.spot-qualifying-reasons__icon-wrapper{width:var(--spot-qualifying-reasons-icon-wrapper-size);height:var(--spot-qualifying-reasons-icon-wrapper-size);border-radius:50%;border:var(--spot-qualifying-reasons-icon-border-width) solid var(--spot-qualifying-reasons-icon-border-color);background-color:var(--spot-qualifying-reasons-icon-background);display:flex;align-items:center;justify-content:center;flex-shrink:0}.spot-qualifying-reasons__icon{width:var(--spot-qualifying-reasons-icon-size);height:var(--spot-qualifying-reasons-icon-size)}.spot-qualifying-reasons__label{font-size:var(--spot-qualifying-reasons-label-font-size);font-weight:var(--spot-qualifying-reasons-label-font-weight);color:var(--spot-qualifying-reasons-label-font-color);font-family:var(--spot-qualifying-reasons-label-font-family);line-height:1.2}@media (max-width: 480px){.spot-qualifying-reasons__grid{grid-template-columns:1fr}}.spot-covered-items__container{margin-top:0;margin-bottom:1rem}.spot-covered-items__title{font-size:var(--spot-description-font-size);font-weight:var(--spot-description-font-weight);color:var(--spot-description-font-color);font-family:var(--spot-description-font-family);padding:0 .3125rem .25rem;line-height:125%;margin:0}.spot-covered-items__list{list-style-type:disc;list-style-position:inside;line-height:125%;gap:.5625rem;font-size:var(--spot-bullets-font-size);font-weight:var(--spot-bullets-font-weight);color:var(--spot-bullets-font-color);font-family:var(--spot-bullets-font-family);padding:var(--spot-bullets-padding);margin-block-start:0rem;margin-block-end:0rem}.spot-covered-items__list li{margin-bottom:.3rem;text-align:left}.spot-table__container{width:100%}.spot-refund__table{max-width:22rem;border-radius:var(--spot-table-border-radius);overflow:hidden;border:.09375rem solid #636569;table-layout:fixed;margin-bottom:.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 Z(d){const t=document.createElement("style");t.textContent=d,document.head.appendChild(t)}Z(Q);const k={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,n,r,e;try{x(this.options);let i;if(this.options.useMockData&&this.options.mockData)i=this.options.mockData;else{const{environment:a,partnerId:s}=this.options.apiConfig,h=this.options.apiConfig.customEndpoint||k[a];i="cartInfo"in this.options.quoteRequestData&&"items"in this.options.quoteRequestData?await E(h,s,this.options.quoteRequestData):await v(h,s,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 a={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const s=this.options.quoteRequestData;a.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var f;const h=(f=s.items)==null?void 0:f.find(y=>(y.cartItemId||`item-${s.items.indexOf(y)+1}`)===u.id);return{quoteId:u.id,productPrice:(h==null?void 0:h.productPrice)||u.spotPrice,cartItemId:u.id}})}this.options.callbacks.onOptIn(a)}(n=this.options.callbacks)!=null&&n.onQuoteRetrieved&&this.options.callbacks.onQuoteRetrieved(this.quote)}catch(i){if((r=this.options.callbacks)!=null&&r.onError){const a=i;(e=this.options.callbacks)==null||e.onError({message:a.message,status:a.status,responseBody:a.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(([n,r])=>{const e=`--${n}`;this.container.style.setProperty(e,r)}),z(this.container,this.quote.communication);const t=document.createElement("div");t.className="spot-content__wrapper",this.container.appendChild(t),this.quote.qualifyingReasons?L(t,this.quote.qualifyingReasons):O(t,this.quote.communication.bulletPoints),this.quote.coveredItems&&P(t,this.quote.coveredItems),this.options.showTable&&!this.quote.qualifyingReasons&&R(t,this.quote.payoutSchedule);const o=V(t,this.options.optInSelected,this.quote.communication);t.appendChild(o),this.paymentTermsEl=p("div",{className:"spot-payment-terms__wrapper",parent:t}),$(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 n=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",n)}_shouldUseDesktopLayout(t){const o=this.container.offsetWidth-40,n=325,r=16;if(o>=900)return!0;if(o>=650){const e=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 e&&t.classList.add("desktop-layout"),e;const s=Math.min(i.scrollWidth,400)+n+r;return e&&t.classList.add("desktop-layout"),o>=s}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))}_setupOptionListeners(t){const o=t.querySelectorAll('input[type="radio"]'),n=t.querySelectorAll(".spot-selection__option");o.forEach(r=>{r.addEventListener("change",e=>{var s,u,h;const i=e.target,a=i.value;if(this.hideSelectionError(),this.currentSelection=a,n.forEach(f=>f.classList.remove("selected")),(s=i.closest(".spot-selection__option"))==null||s.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),a==="yes"&&(this.options.quoteRequestData.isPartialPayment&&S(this.paymentTermsEl,this.quote),(u=this.options.callbacks)!=null&&u.onOptIn)){const f={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;f.batchQuoteDetails=this.quote.originalQuotes.map(c=>{var m;const l=(m=y.items)==null?void 0:m.find(b=>(b.cartItemId||`item-${y.items.indexOf(b)+1}`)===c.id);return{quoteId:c.id,productPrice:(l==null?void 0:l.productPrice)||c.spotPrice,cartItemId:c.id}})}this.options.callbacks.onOptIn(f)}if(a==="no"&&((h=this.options.callbacks)!=null&&h.onOptOut)){const f={status:"QUOTE_DECLINED",quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const y=this.options.quoteRequestData;f.batchQuoteDetails=this.quote.originalQuotes.map(c=>{var m;const l=(m=y.items)==null?void 0:m.find(b=>(b.cartItemId||`item-${y.items.indexOf(b)+1}`)===c.id);return{quoteId:c.id,productPrice:(l==null?void 0:l.productPrice)||c.spotPrice,cartItemId:c.id}})}this.options.callbacks.onOptOut(f)}})})}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,n,r,e;try{const i={...this.options,quoteRequestData:t};x(i);const{environment:a,partnerId:s,customEndpoint:u}=this.options.apiConfig,h=u||k[a],y="cartInfo"in i.quoteRequestData&&"items"in i.quoteRequestData?await E(h,s,i.quoteRequestData):await v(h,s,i.quoteRequestData);return y.status!=="QUOTE_AVAILABLE"?(y.status==="NO_MATCHING_QUOTE"&&((o=this.options.callbacks)!=null&&o.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:i.quoteRequestData}),!1):(this.options.quoteRequestData=i.quoteRequestData,this.quote=y.data,this.currentSelection=null,this.destroy(),this._renderWidget(),(n=this.options.callbacks)!=null&&n.onQuoteRetrieved&&this.options.callbacks.onQuoteRetrieved(this.quote),!0)}catch(i){const a=i;return(e=(r=this.options.callbacks)==null?void 0:r.onError)==null||e.call(r,{message:a.message,status:a.status,responseBody:a.responseBody}),!1}}getSelection(){var o,n,r;if(this.currentSelection==null)return null;const t={selection:this.currentSelection,quoteId:(o=this.quote)==null?void 0:o.id,spotPrice:(n=this.quote)==null?void 0:n.spotPrice,status:this.currentSelection==="yes"?"QUOTE_ACCEPTED":"QUOTE_DECLINED"};if((r=this.quote)!=null&&r.originalQuotes&&this.quote.originalQuotes.length>0){const e=this.options.quoteRequestData;t.batchQuoteDetails=this.quote.originalQuotes.map(i=>{var s;const a=(s=e.items)==null?void 0:s.find(u=>(u.cartItemId||`item-${e.items.indexOf(u)+1}`)===i.id);return{quoteId:i.id,productPrice:(a==null?void 0:a.productPrice)||i.spotPrice,cartItemId:i.id}})}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
@@ -128,6 +128,8 @@ export interface SpotWidgetOptions {
128
128
  callbacks?: Callbacks;
129
129
  theme?: Theme;
130
130
  isPartialPayment?: boolean;
131
+ useMockData?: boolean;
132
+ mockData?: ApiResponse;
131
133
  }
132
134
  export interface ApiError extends Error {
133
135
  status?: 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,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,c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AC;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": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },