@getspot/spot-widget 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +13 -10
- package/dist/index.umd.js +3 -3
- package/dist/types.d.ts +1 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @getspot/spot-widget
|
|
2
2
|
|
|
3
|
+
## 3.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f3c5aed: fix rerender errors
|
|
8
|
+
|
|
9
|
+
## 3.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- a7c82e3: Update to possible values of QuoteUpdates; Also, handle the yesOptionText replacement for spotPriceWithFees
|
|
14
|
+
|
|
3
15
|
## 3.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
package/README.md
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EAGd,MAAM,YAAY,CAAC;AAkBpB,cAAM,UAAU;IACd,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,cAAc,CAAC,CAAc;IACrC,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAQ;IACtB,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,eAAe,CAAC,CAAiB;gBAE7B,OAAO,GAAE,OAAO,CAAC,iBAAiB,CAAM;YAuBtC,KAAK;IAiGnB,OAAO,CAAC,aAAa;IAkDrB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,uBAAuB;IAqC/B,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,cAAc,CAAC,CAAS;IAEhC,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,qBAAqB;IA2F7B,kBAAkB,IAAI,IAAI;IAgB1B,kBAAkB,IAAI,IAAI;IAM1B,iBAAiB,IAAI,OAAO;IAgBtB,WAAW,CACf,mBAAmB,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,GACzD,OAAO,CAAC,OAAO,CAAC;IAoEnB,YAAY,IAAI,aAAa,GAAG,IAAI;IA+BpC,OAAO,IAAI,IAAI;CAahB;AAED,eAAe,UAAU,CAAC;AAC1B,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,KAAK,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,GACN,MAAM,YAAY,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -264,7 +264,7 @@ function N(d, { name: t, description: o }) {
|
|
|
264
264
|
parent: d
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function z(d, t = []) {
|
|
268
268
|
const o = p("ul", {
|
|
269
269
|
className: "spot-benefits__list",
|
|
270
270
|
parent: d
|
|
@@ -278,7 +278,7 @@ function O(d, t = []) {
|
|
|
278
278
|
</svg>`, p("span", { text: i, parent: r });
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function O(d, t = []) {
|
|
282
282
|
if (!t || t.length === 0) return;
|
|
283
283
|
const o = p("div", {
|
|
284
284
|
className: "spot-qualifying-reasons__container",
|
|
@@ -355,7 +355,7 @@ function P(d, t = []) {
|
|
|
355
355
|
p("td", { text: f, parent: h });
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function $(d, t, o) {
|
|
359
359
|
const i = p("div", {
|
|
360
360
|
className: "spot-selection__options",
|
|
361
361
|
parent: d
|
|
@@ -377,7 +377,7 @@ function V(d, t, o) {
|
|
|
377
377
|
}), s = p("input", { parent: n });
|
|
378
378
|
return s.type = "radio", s.name = "selection", s.value = "no", p("span", { text: o.noOptionText, parent: n }), i;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function V(d, t) {
|
|
381
381
|
var r;
|
|
382
382
|
const o = (r = t.communication) == null ? void 0 : r.paymentTerms, i = p("div", {
|
|
383
383
|
className: "spot-payment-terms",
|
|
@@ -393,7 +393,7 @@ function R(d, t) {
|
|
|
393
393
|
parent: i
|
|
394
394
|
}), i;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function R(d, t, o = "bottom-right") {
|
|
397
397
|
if (o === "top-right") {
|
|
398
398
|
const e = p("div", {
|
|
399
399
|
className: "spot-logo__top-right",
|
|
@@ -553,8 +553,8 @@ class Z {
|
|
|
553
553
|
this.container.style.setProperty(e, r);
|
|
554
554
|
}), N(this.container, this.quote.communication);
|
|
555
555
|
const t = document.createElement("div");
|
|
556
|
-
t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ?
|
|
557
|
-
const o =
|
|
556
|
+
t.className = "spot-content__wrapper", this.container.appendChild(t), this.quote.qualifyingReasons ? O(t, this.quote.qualifyingReasons) : z(t, this.quote.communication.bulletPoints), this.quote.coveredItems && L(t, this.quote.coveredItems), this.options.showTable && !this.quote.qualifyingReasons && P(t, this.quote.payoutSchedule);
|
|
557
|
+
const o = $(
|
|
558
558
|
t,
|
|
559
559
|
this.options.optInSelected,
|
|
560
560
|
this.quote.communication
|
|
@@ -562,7 +562,7 @@ class Z {
|
|
|
562
562
|
t.appendChild(o), this.paymentTermsEl = p("div", {
|
|
563
563
|
className: "spot-payment-terms__wrapper",
|
|
564
564
|
parent: t
|
|
565
|
-
}),
|
|
565
|
+
}), R(this.container, this.quote, this.options.logoPosition), window.addEventListener("resize", this._onResize), this._setupResizeObserver(), this._updateLayout(), this._setupOptionListeners(o);
|
|
566
566
|
}
|
|
567
567
|
_updateLayout() {
|
|
568
568
|
if (!this.container || !this.quote) return;
|
|
@@ -601,7 +601,10 @@ class Z {
|
|
|
601
601
|
}), this._resizeObserver.observe(this.container));
|
|
602
602
|
}
|
|
603
603
|
_applyQuoteUpdates(t) {
|
|
604
|
-
!this.quote || !this.container || (t.
|
|
604
|
+
!this.quote || !this.container || (t.spotPriceWithFees !== void 0 && (this.quote.communication.yesOptionText = this.quote.communication.yesOptionText.replace(
|
|
605
|
+
`$${this.quote.spotPrice.toFixed(2)}`,
|
|
606
|
+
`$${t.spotPriceWithFees.toFixed(2)}`
|
|
607
|
+
)), this.destroy(), this._renderWidget());
|
|
605
608
|
}
|
|
606
609
|
_setupOptionListeners(t) {
|
|
607
610
|
const o = t.querySelectorAll(
|
|
@@ -611,7 +614,7 @@ class Z {
|
|
|
611
614
|
r.addEventListener("change", (e) => {
|
|
612
615
|
var a, u, h;
|
|
613
616
|
const n = e.target, s = n.value;
|
|
614
|
-
if (this.hideSelectionError(), this.currentSelection = s, i.forEach((f) => f.classList.remove("selected")), (a = n.closest(".spot-selection__option")) == null || a.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), s === "yes" && (this.options.quoteRequestData.isPartialPayment &&
|
|
617
|
+
if (this.hideSelectionError(), this.currentSelection = s, i.forEach((f) => f.classList.remove("selected")), (a = n.closest(".spot-selection__option")) == null || a.classList.add("selected"), this.paymentTermsEl && (this.paymentTermsEl.innerHTML = ""), s === "yes" && (this.options.quoteRequestData.isPartialPayment && V(this.paymentTermsEl, this.quote), (u = this.options.callbacks) != null && u.onOptIn)) {
|
|
615
618
|
const f = {
|
|
616
619
|
status: "QUOTE_ACCEPTED",
|
|
617
620
|
spotPrice: this.quote.spotPrice,
|
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(d,t,o){try{const i=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),r=await i.json();if(!i.ok){const e=new Error((r==null?void 0:r.message)||"Failed to fetch quote");throw e.status=i.status,e.responseBody=r,e}return r}catch(i){throw i instanceof Error?i:new Error("Unknown error occurred while fetching quote")}}async function M(d,t,o){try{const i=d.replace("/quote","/quote/batch"),r=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),e=await r.json();if(!r.ok){const s=new Error((e==null?void 0:e.message)||"Failed to fetch batch quote");throw s.status=r.status,s.responseBody=e,s}return e}catch(i){throw i instanceof Error?i:new Error("Unknown error occurred while fetching batch quote")}}async function E(d,t,o){var i;try{const r={cartId:o.cartInfo.cartId,cartName:o.cartInfo.cartName,currencyCode:o.cartInfo.currencyCode,items:o.items.map((a,u)=>({cartItemId:a.cartItemId||`item-${u+1}`,productPrice:a.productPrice,productType:a.productType,productDuration:a.productDuration,productId:a.productId,productName:a.productName,participantDescription:a.participantDescription,eventType:a.eventType,startDate:a.startDate,endDate:a.endDate}))},e=await M(d,t,r);if(e.status!=="QUOTES_AVAILABLE"&&e.status!=="QUOTE_AVAILABLE")return{status:"NO_MATCHING_QUOTE"};const s=e.quotes.map(a=>{const u=o.items.find((h,f)=>(h.cartItemId||`item-${f+1}`)===a.cartItemId);return u?u.participantDescription?`${u.productName} - ${u.participantDescription}`:u.productName:`Item ${a.id}`}),n=Math.round((e.totalSpotPrice||e.spotPrice||0)*100)/100;return{status:"QUOTE_AVAILABLE",data:{id:e.quotes?e.quotes.map(a=>a.id).join(","):((i=e.data)==null?void 0:i.id)||"",spotPrice:n,currencyCode:e.currencyCode||"",communication:{...e.communication,yesOptionText:e.communication.yesOptionText.replace(String(e.totalSpotPrice),String(n))},payoutSchedule:e.payoutSchedule.map(a=>({...a,amount:a.amount!==void 0?a.amount:0})),coveredItems:s,originalQuotes:e.quotes||(e.data?[e.data]:[])},spotPrice:n,coveredItems:s}}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:i={},location:r,theme:e}=d,{environment:s="sandbox",partnerId:n,customEndpoint:a}=t;if(!n||typeof n!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(a||N[s]))throw new Error(`Invalid environment in apiConfig: ${s}`);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=i[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:i,innerHTML:r,href:e,target:s}={}){const n=document.createElement(d);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}function
|
|
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 i=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),r=await i.json();if(!i.ok){const e=new Error((r==null?void 0:r.message)||"Failed to fetch quote");throw e.status=i.status,e.responseBody=r,e}return r}catch(i){throw i instanceof Error?i:new Error("Unknown error occurred while fetching quote")}}async function M(d,t,o){try{const i=d.replace("/quote","/quote/batch"),r=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","X-Spot-Partner-Id":t},body:JSON.stringify(o)}),e=await r.json();if(!r.ok){const s=new Error((e==null?void 0:e.message)||"Failed to fetch batch quote");throw s.status=r.status,s.responseBody=e,s}return e}catch(i){throw i instanceof Error?i:new Error("Unknown error occurred while fetching batch quote")}}async function E(d,t,o){var i;try{const r={cartId:o.cartInfo.cartId,cartName:o.cartInfo.cartName,currencyCode:o.cartInfo.currencyCode,items:o.items.map((a,u)=>({cartItemId:a.cartItemId||`item-${u+1}`,productPrice:a.productPrice,productType:a.productType,productDuration:a.productDuration,productId:a.productId,productName:a.productName,participantDescription:a.participantDescription,eventType:a.eventType,startDate:a.startDate,endDate:a.endDate}))},e=await M(d,t,r);if(e.status!=="QUOTES_AVAILABLE"&&e.status!=="QUOTE_AVAILABLE")return{status:"NO_MATCHING_QUOTE"};const s=e.quotes.map(a=>{const u=o.items.find((h,f)=>(h.cartItemId||`item-${f+1}`)===a.cartItemId);return u?u.participantDescription?`${u.productName} - ${u.participantDescription}`:u.productName:`Item ${a.id}`}),n=Math.round((e.totalSpotPrice||e.spotPrice||0)*100)/100;return{status:"QUOTE_AVAILABLE",data:{id:e.quotes?e.quotes.map(a=>a.id).join(","):((i=e.data)==null?void 0:i.id)||"",spotPrice:n,currencyCode:e.currencyCode||"",communication:{...e.communication,yesOptionText:e.communication.yesOptionText.replace(String(e.totalSpotPrice),String(n))},payoutSchedule:e.payoutSchedule.map(a=>({...a,amount:a.amount!==void 0?a.amount:0})),coveredItems:s,originalQuotes:e.quotes||(e.data?[e.data]:[])},spotPrice:n,coveredItems:s}}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:i={},location:r,theme:e}=d,{environment:s="sandbox",partnerId:n,customEndpoint:a}=t;if(!n||typeof n!="string")throw new Error("Invalid or missing partnerId in apiConfig");if(!(a||N[s]))throw new Error(`Invalid environment in apiConfig: ${s}`);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=i[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:i,innerHTML:r,href:e,target:s}={}){const n=document.createElement(d);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}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(i=>{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>`,p("span",{text:i,parent:r})})}function L(d,t=[]){if(!t||t.length===0)return;const o=p("div",{className:"spot-qualifying-reasons__container",parent:d}),i=[...t].sort((a,u)=>a.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"},s=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),n=s.origin+s.pathname.replace(/\/src\/[^/]*$/,"/assets/");i.forEach(a=>{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=a.benefitType)==null?void 0:y.name)||""]||e[a.name||""];if(f){const m=p("img",{parent:h});m.src=n+f,m.alt=((c=a.benefitType)==null?void 0:c.name)||a.name||"",m.className="spot-qualifying-reasons__icon"}p("span",{className:"spot-qualifying-reasons__label",text:((l=a.benefitType)==null?void 0:l.name)||a.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 i=p("ul",{className:"spot-covered-items__list",parent:o});t.forEach(r=>{const e=p("li",{parent:i});p("span",{text:r,parent:e})})}function R(d,t=[]){const o=p("div",{className:"spot-table__container",parent:d}),i=p("table",{className:"spot-refund__table spot-table--dynamic",parent:o}),r=p("thead",{parent:i}),e=p("tr",{parent:r});p("th",{text:"When you cancel",parent:e}),p("th",{text:"You will receive",parent:e});const s=p("tbody",{parent:i});t.forEach(({text:n,percent:a,amount:u})=>{const h=p("tr",{parent:s});p("td",{text:n,parent:h});const f=a==="Not eligible for refund"?"Not eligible for a refund":`$${u} refund`;p("td",{text:f,parent:h})})}function
|
|
5
|
+
</svg>`,p("span",{text:i,parent:r})})}function L(d,t=[]){if(!t||t.length===0)return;const o=p("div",{className:"spot-qualifying-reasons__container",parent:d}),i=[...t].sort((a,u)=>a.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"},s=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),n=s.origin+s.pathname.replace(/\/src\/[^/]*$/,"/assets/");i.forEach(a=>{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=a.benefitType)==null?void 0:y.name)||""]||e[a.name||""];if(f){const m=p("img",{parent:h});m.src=n+f,m.alt=((c=a.benefitType)==null?void 0:c.name)||a.name||"",m.className="spot-qualifying-reasons__icon"}p("span",{className:"spot-qualifying-reasons__label",text:((l=a.benefitType)==null?void 0:l.name)||a.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 i=p("ul",{className:"spot-covered-items__list",parent:o});t.forEach(r=>{const e=p("li",{parent:i});p("span",{text:r,parent:e})})}function R(d,t=[]){const o=p("div",{className:"spot-table__container",parent:d}),i=p("table",{className:"spot-refund__table spot-table--dynamic",parent:o}),r=p("thead",{parent:i}),e=p("tr",{parent:r});p("th",{text:"When you cancel",parent:e}),p("th",{text:"You will receive",parent:e});const s=p("tbody",{parent:i});t.forEach(({text:n,percent:a,amount:u})=>{const h=p("tr",{parent:s});p("td",{text:n,parent:h});const f=a==="Not eligible for refund"?"Not eligible for a refund":`$${u} refund`;p("td",{text:f,parent:h})})}function $(d,t,o){const i=p("div",{className:"spot-selection__options",parent:d}),r=p("label",{className:`spot-selection__option ${t?"selected":""}`,parent:i}),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 s=p("label",{className:"spot-selection__option",parent:i}),n=p("input",{parent:s});return n.type="radio",n.name="selection",n.value="no",p("span",{text:o.noOptionText,parent:s}),i}function V(d,t){var r;const o=(r=t.communication)==null?void 0:r.paymentTerms,i=p("div",{className:"spot-payment-terms",parent:d});return p("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:i}),p("div",{className:"spot-payment-terms__body",text:o||"",parent:i}),i}function S(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"/>
|
|
@@ -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 i}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,i,r,e;try{x(this.options);let s;if(this.options.useMockData&&this.options.mockData)s=this.options.mockData;else{const{environment:n,partnerId:a}=this.options.apiConfig,h=this.options.apiConfig.customEndpoint||k[n];s="cartInfo"in this.options.quoteRequestData&&"items"in this.options.quoteRequestData?await E(h,a,this.options.quoteRequestData):await v(h,a,this.options.quoteRequestData)}if(s.status!=="QUOTE_AVAILABLE"){s.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=s.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 n={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const a=this.options.quoteRequestData;n.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var f;const h=(f=a.items)==null?void 0:f.find(y=>(y.cartItemId||`item-${a.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(n)}if((i=this.options.callbacks)!=null&&i.onQuoteRetrieved){const n=this.options.callbacks.onQuoteRetrieved(this.quote);n&&this._applyQuoteUpdates(n)}}catch(s){if((r=this.options.callbacks)!=null&&r.onError){const n=s;(e=this.options.callbacks)==null||e.onError({message:n.message,status:n.status,responseBody:n.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(([i,r])=>{const e=`--${i}`;this.container.style.setProperty(e,r)}),O(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):z(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 i=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",i)}_shouldUseDesktopLayout(t){const o=this.container.offsetWidth-40,i=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 s=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!s)return e&&t.classList.add("desktop-layout"),e;const a=Math.min(s.scrollWidth,400)+i+r;return e&&t.classList.add("desktop-layout"),o>=a}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))}_applyQuoteUpdates(t){!this.quote||!this.container||(t.spotPrice!==void 0&&(this.quote.spotPrice=t.spotPrice),t.yesOptionText!==void 0&&(this.quote.communication.yesOptionText=t.yesOptionText),this.destroy(),this._renderWidget())}_setupOptionListeners(t){const o=t.querySelectorAll('input[type="radio"]'),i=t.querySelectorAll(".spot-selection__option");o.forEach(r=>{r.addEventListener("change",e=>{var a,u,h;const s=e.target,n=s.value;if(this.hideSelectionError(),this.currentSelection=n,i.forEach(f=>f.classList.remove("selected")),(a=s.closest(".spot-selection__option"))==null||a.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),n==="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(n==="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,i,r,e;try{const s={...this.options,quoteRequestData:t};x(s);const{environment:n,partnerId:a,customEndpoint:u}=this.options.apiConfig,h=u||k[n],y="cartInfo"in s.quoteRequestData&&"items"in s.quoteRequestData?await E(h,a,s.quoteRequestData):await v(h,a,s.quoteRequestData);if(y.status!=="QUOTE_AVAILABLE")return y.status==="NO_MATCHING_QUOTE"&&((o=this.options.callbacks)!=null&&o.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:s.quoteRequestData}),!1;if(this.options.quoteRequestData=s.quoteRequestData,this.quote=y.data,this.currentSelection=null,this.destroy(),this._renderWidget(),(i=this.options.callbacks)!=null&&i.onQuoteRetrieved){const c=this.options.callbacks.onQuoteRetrieved(this.quote);c&&this._applyQuoteUpdates(c)}return!0}catch(s){const n=s;return(e=(r=this.options.callbacks)==null?void 0:r.onError)==null||e.call(r,{message:n.message,status:n.status,responseBody:n.responseBody}),!1}}getSelection(){var o,i,r;if(this.currentSelection==null)return null;const t={selection:this.currentSelection,quoteId:(o=this.quote)==null?void 0:o.id,spotPrice:(i=this.quote)==null?void 0:i.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(s=>{var a;const n=(a=e.items)==null?void 0:a.find(u=>(u.cartItemId||`item-${e.items.indexOf(u)+1}`)===s.id);return{quoteId:s.id,productPrice:(n==null?void 0:n.productPrice)||s.spotPrice,cartItemId:s.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 i}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,i,r,e;try{x(this.options);let s;if(this.options.useMockData&&this.options.mockData)s=this.options.mockData;else{const{environment:n,partnerId:a}=this.options.apiConfig,h=this.options.apiConfig.customEndpoint||k[n];s="cartInfo"in this.options.quoteRequestData&&"items"in this.options.quoteRequestData?await E(h,a,this.options.quoteRequestData):await v(h,a,this.options.quoteRequestData)}if(s.status!=="QUOTE_AVAILABLE"){s.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=s.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 n={status:"QUOTE_ACCEPTED",spotPrice:this.quote.spotPrice,quoteId:this.quote.id};if(this.quote.originalQuotes&&this.quote.originalQuotes.length>0){const a=this.options.quoteRequestData;n.batchQuoteDetails=this.quote.originalQuotes.map(u=>{var f;const h=(f=a.items)==null?void 0:f.find(y=>(y.cartItemId||`item-${a.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(n)}if((i=this.options.callbacks)!=null&&i.onQuoteRetrieved){const n=this.options.callbacks.onQuoteRetrieved(this.quote);n&&this._applyQuoteUpdates(n)}}catch(s){if((r=this.options.callbacks)!=null&&r.onError){const n=s;(e=this.options.callbacks)==null||e.onError({message:n.message,status:n.status,responseBody:n.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(([i,r])=>{const e=`--${i}`;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=$(t,this.options.optInSelected,this.quote.communication);t.appendChild(o),this.paymentTermsEl=p("div",{className:"spot-payment-terms__wrapper",parent:t}),S(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 i=this._shouldUseDesktopLayout(t);t.classList.toggle("desktop-layout",i)}_shouldUseDesktopLayout(t){const o=this.container.offsetWidth-40,i=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 s=t.querySelector(".spot-benefits__list, .spot-qualifying-reasons__container");if(!s)return e&&t.classList.add("desktop-layout"),e;const a=Math.min(s.scrollWidth,400)+i+r;return e&&t.classList.add("desktop-layout"),o>=a}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))}_applyQuoteUpdates(t){!this.quote||!this.container||(t.spotPriceWithFees!==void 0&&(this.quote.communication.yesOptionText=this.quote.communication.yesOptionText.replace(`$${this.quote.spotPrice.toFixed(2)}`,`$${t.spotPriceWithFees.toFixed(2)}`)),this.destroy(),this._renderWidget())}_setupOptionListeners(t){const o=t.querySelectorAll('input[type="radio"]'),i=t.querySelectorAll(".spot-selection__option");o.forEach(r=>{r.addEventListener("change",e=>{var a,u,h;const s=e.target,n=s.value;if(this.hideSelectionError(),this.currentSelection=n,i.forEach(f=>f.classList.remove("selected")),(a=s.closest(".spot-selection__option"))==null||a.classList.add("selected"),this.paymentTermsEl&&(this.paymentTermsEl.innerHTML=""),n==="yes"&&(this.options.quoteRequestData.isPartialPayment&&V(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(n==="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,i,r,e;try{const s={...this.options,quoteRequestData:t};x(s);const{environment:n,partnerId:a,customEndpoint:u}=this.options.apiConfig,h=u||k[n],y="cartInfo"in s.quoteRequestData&&"items"in s.quoteRequestData?await E(h,a,s.quoteRequestData):await v(h,a,s.quoteRequestData);if(y.status!=="QUOTE_AVAILABLE")return y.status==="NO_MATCHING_QUOTE"&&((o=this.options.callbacks)!=null&&o.noMatchingQuote)&&this.options.callbacks.noMatchingQuote({status:"NO_MATCHING_QUOTE",data:s.quoteRequestData}),!1;if(this.options.quoteRequestData=s.quoteRequestData,this.quote=y.data,this.currentSelection=null,this.destroy(),this._renderWidget(),(i=this.options.callbacks)!=null&&i.onQuoteRetrieved){const c=this.options.callbacks.onQuoteRetrieved(this.quote);c&&this._applyQuoteUpdates(c)}return!0}catch(s){const n=s;return(e=(r=this.options.callbacks)==null?void 0:r.onError)==null||e.call(r,{message:n.message,status:n.status,responseBody:n.responseBody}),!1}}getSelection(){var o,i,r;if(this.currentSelection==null)return null;const t={selection:this.currentSelection,quoteId:(o=this.quote)==null?void 0:o.id,spotPrice:(i=this.quote)==null?void 0:i.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(s=>{var a;const n=(a=e.items)==null?void 0:a.find(u=>(u.cartItemId||`item-${e.items.indexOf(u)+1}`)===s.id);return{quoteId:s.id,productPrice:(n==null?void 0:n.productPrice)||s.spotPrice,cartItemId:s.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
|
@@ -80,8 +80,7 @@ export interface Quote {
|
|
|
80
80
|
originalQuotes?: Quote[];
|
|
81
81
|
}
|
|
82
82
|
export interface QuoteUpdates {
|
|
83
|
-
|
|
84
|
-
yesOptionText?: string;
|
|
83
|
+
spotPriceWithFees?: number;
|
|
85
84
|
}
|
|
86
85
|
export interface ApiResponse {
|
|
87
86
|
status: "QUOTE_AVAILABLE" | "QUOTES_AVAILABLE" | "NO_MATCHING_QUOTE";
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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,CA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