ui.shipaid.com 0.0.3 → 0.0.6

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.
@@ -1,136 +1,139 @@
1
- var vt=Object.defineProperty,ft=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var _t=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var K=(s,t,e)=>t in s?vt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,C=(s,t)=>{for(var e in t||(t={}))_t.call(t,e)&&K(s,e,t[e]);if(J)for(var e of J(t))$t.call(t,e)&&K(s,e,t[e]);return s},P=(s,t)=>ft(s,mt(t));/**
1
+ var vt=Object.defineProperty,mt=Object.defineProperties;var _t=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var $t=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var Z=(s,t,e)=>t in s?vt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,C=(s,t)=>{for(var e in t||(t={}))$t.call(t,e)&&Z(s,e,t[e]);if(K)for(var e of K(t))gt.call(t,e)&&Z(s,e,t[e]);return s},P=(s,t)=>mt(s,_t(t));/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const gt=s=>t=>typeof t=="function"?((e,i)=>(window.customElements.define(e,i),i))(s,t):((e,i)=>{const{kind:o,elements:r}=i;return{kind:o,elements:r,finisher(n){window.customElements.define(e,n)}}})(s,t);/**
5
+ */const yt=s=>t=>typeof t=="function"?((e,i)=>(window.customElements.define(e,i),i))(s,t):((e,i)=>{const{kind:r,elements:o}=i;return{kind:r,elements:o,finisher(n){window.customElements.define(e,n)}}})(s,t);/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const yt=(s,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?P(C({},t),{finisher(e){e.createProperty(t.key,s)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,s)}};function At(s){return(t,e)=>e!==void 0?((i,o,r)=>{o.constructor.createProperty(r,i)})(s,t,e):yt(s,t)}/**
9
+ */const At=(s,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?P(C({},t),{finisher(e){e.createProperty(t.key,s)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,s)}};function wt(s){return(t,e)=>e!==void 0?((i,r,o)=>{r.constructor.createProperty(o,i)})(s,t,e):At(s,t)}/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */function g(s){return At(P(C({},s),{state:!0}))}/**
13
+ */function g(s){return wt(P(C({},s),{state:!0}))}/**
14
14
  * @license
15
15
  * Copyright 2021 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
- */var R;((R=window.HTMLSlotElement)===null||R===void 0?void 0:R.prototype.assignedElements)!=null;/**
17
+ */var D;((D=window.HTMLSlotElement)===null||D===void 0?void 0:D.prototype.assignedElements)!=null;/**
18
18
  * @license
19
19
  * Copyright 2019 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
- */const z=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Z=Symbol(),G=new Map;class wt{constructor(t,e){if(this._$cssResult$=!0,e!==Z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=G.get(this.cssText);return z&&t===void 0&&(G.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const Et=s=>new wt(typeof s=="string"?s:s+"",Z),bt=(s,t)=>{z?s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const i=document.createElement("style"),o=window.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=e.cssText,s.appendChild(i)})},Q=z?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Et(e)})(s):s;/**
21
+ */const z=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),G=new Map;class Q{constructor(t,e){if(this._$cssResult$=!0,e!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=G.get(this.cssText);return z&&t===void 0&&(G.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const Et=s=>new Q(typeof s=="string"?s:s+"",L),bt=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new Q(e,L)},St=(s,t)=>{z?s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const i=document.createElement("style"),r=window.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)})},X=z?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Et(e)})(s):s;/**
22
22
  * @license
23
23
  * Copyright 2017 Google LLC
24
24
  * SPDX-License-Identifier: BSD-3-Clause
25
- */var L;const X=window.trustedTypes,St=X?X.emptyScript:"",Y=window.reactiveElementPolyfillSupport,j={toAttribute(s,t){switch(t){case Boolean:s=s?St:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},tt=(s,t)=>t!==s&&(t==t||s==s),V={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};class A extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;(e=this.l)!==null&&e!==void 0||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,i)=>{const o=this._$Eh(i,e);o!==void 0&&(this._$Eu.set(o,i),t.push(o))}),t}static createProperty(t,e=V){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i=typeof t=="symbol"?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);o!==void 0&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const r=this[t];this[e]=o,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||V}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const o of i)this.createProperty(o,e[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const o of i)e.unshift(Q(o))}else t!==void 0&&e.push(Q(t));return e}static _$Eh(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Em(),this.requestUpdate(),(t=this.constructor.l)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$Eg)!==null&&e!==void 0?e:this._$Eg=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$Eg)===null||e===void 0||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return bt(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=V){var o,r;const n=this.constructor._$Eh(t,i);if(n!==void 0&&i.reflect===!0){const d=((r=(o=i.converter)===null||o===void 0?void 0:o.toAttribute)!==null&&r!==void 0?r:j.toAttribute)(e,i.type);this._$Ei=t,d==null?this.removeAttribute(n):this.setAttribute(n,d),this._$Ei=null}}_$AK(t,e){var i,o,r;const n=this.constructor,d=n._$Eu.get(t);if(d!==void 0&&this._$Ei!==d){const a=n.getPropertyOptions(d),h=a.converter,u=(r=(o=(i=h)===null||i===void 0?void 0:i.fromAttribute)!==null&&o!==void 0?o:typeof h=="function"?h:null)!==null&&r!==void 0?r:j.fromAttribute;this._$Ei=d,this[d]=u(e,a.type),this._$Ei=null}}requestUpdate(t,e,i){let o=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||tt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Ei!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((o,r)=>this[r]=o),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$Eg)===null||t===void 0||t.forEach(o=>{var r;return(r=o.hostUpdate)===null||r===void 0?void 0:r.call(o)}),this.update(i)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$Eg)===null||e===void 0||e.forEach(i=>{var o;return(o=i.hostUpdated)===null||o===void 0?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$ES(i,this[i],e)),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}A.finalized=!0,A.elementProperties=new Map,A.elementStyles=[],A.shadowRootOptions={mode:"open"},Y==null||Y({ReactiveElement:A}),((L=globalThis.reactiveElementVersions)!==null&&L!==void 0?L:globalThis.reactiveElementVersions=[]).push("1.3.0");/**
25
+ */var j;const Y=window.trustedTypes,xt=Y?Y.emptyScript:"",tt=window.reactiveElementPolyfillSupport,V={toAttribute(s,t){switch(t){case Boolean:s=s?xt:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},et=(s,t)=>t!==s&&(t==t||s==s),B={attribute:!0,type:String,converter:V,reflect:!1,hasChanged:et};class A extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;(e=this.l)!==null&&e!==void 0||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,i)=>{const r=this._$Eh(i,e);r!==void 0&&(this._$Eu.set(r,i),t.push(r))}),t}static createProperty(t,e=B){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i=typeof t=="symbol"?Symbol():"__"+t,r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const o=this[t];this[e]=r,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||B}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const r of i)this.createProperty(r,e[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(X(r))}else t!==void 0&&e.push(X(t));return e}static _$Eh(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Em(),this.requestUpdate(),(t=this.constructor.l)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$Eg)!==null&&e!==void 0?e:this._$Eg=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$Eg)===null||e===void 0||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return St(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=B){var r,o;const n=this.constructor._$Eh(t,i);if(n!==void 0&&i.reflect===!0){const l=((o=(r=i.converter)===null||r===void 0?void 0:r.toAttribute)!==null&&o!==void 0?o:V.toAttribute)(e,i.type);this._$Ei=t,l==null?this.removeAttribute(n):this.setAttribute(n,l),this._$Ei=null}}_$AK(t,e){var i,r,o;const n=this.constructor,l=n._$Eu.get(t);if(l!==void 0&&this._$Ei!==l){const a=n.getPropertyOptions(l),h=a.converter,u=(o=(r=(i=h)===null||i===void 0?void 0:i.fromAttribute)!==null&&r!==void 0?r:typeof h=="function"?h:null)!==null&&o!==void 0?o:V.fromAttribute;this._$Ei=l,this[l]=u(e,a.type),this._$Ei=null}}requestUpdate(t,e,i){let r=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||et)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Ei!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):r=!1),!this.isUpdatePending&&r&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((r,o)=>this[o]=r),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$Eg)===null||t===void 0||t.forEach(r=>{var o;return(o=r.hostUpdate)===null||o===void 0?void 0:o.call(r)}),this.update(i)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$Eg)===null||e===void 0||e.forEach(i=>{var r;return(r=i.hostUpdated)===null||r===void 0?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$ES(i,this[i],e)),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}A.finalized=!0,A.elementProperties=new Map,A.elementStyles=[],A.shadowRootOptions={mode:"open"},tt==null||tt({ReactiveElement:A}),((j=globalThis.reactiveElementVersions)!==null&&j!==void 0?j:globalThis.reactiveElementVersions=[]).push("1.3.0");/**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */var B;const w=globalThis.trustedTypes,et=w?w.createPolicy("lit-html",{createHTML:s=>s}):void 0,_=`lit$${(Math.random()+"").slice(9)}$`,it="?"+_,xt=`<${it}>`,E=document,U=(s="")=>E.createComment(s),T=s=>s===null||typeof s!="object"&&typeof s!="function",st=Array.isArray,Ct=s=>{var t;return st(s)||typeof((t=s)===null||t===void 0?void 0:t[Symbol.iterator])=="function"},N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ot=/-->/g,rt=/>/g,y=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,nt=/'/g,at=/"/g,ht=/^(?:script|style|textarea|title)$/i,Pt=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),q=Pt(1),b=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),dt=new WeakMap,Ut=(s,t,e)=>{var i,o;const r=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t;let n=r._$litPart$;if(n===void 0){const d=(o=e==null?void 0:e.renderBefore)!==null&&o!==void 0?o:null;r._$litPart$=n=new O(t.insertBefore(U(),d),d,void 0,e!=null?e:{})}return n._$AI(s),n},S=E.createTreeWalker(E,129,null,!1),Tt=(s,t)=>{const e=s.length-1,i=[];let o,r=t===2?"<svg>":"",n=N;for(let a=0;a<e;a++){const h=s[a];let u,l,c=-1,v=0;for(;v<h.length&&(n.lastIndex=v,l=n.exec(h),l!==null);)v=n.lastIndex,n===N?l[1]==="!--"?n=ot:l[1]!==void 0?n=rt:l[2]!==void 0?(ht.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=y):l[3]!==void 0&&(n=y):n===y?l[0]===">"?(n=o!=null?o:N,c=-1):l[1]===void 0?c=-2:(c=n.lastIndex-l[2].length,u=l[1],n=l[3]===void 0?y:l[3]==='"'?at:nt):n===at||n===nt?n=y:n===ot||n===rt?n=N:(n=y,o=void 0);const k=n===y&&s[a+1].startsWith("/>")?" ":"";r+=n===N?h+xt:c>=0?(i.push(u),h.slice(0,c)+"$lit$"+h.slice(c)+_+k):h+_+(c===-2?(i.push(void 0),a):k)}const d=r+(s[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return[et!==void 0?et.createHTML(d):d,i]};class I{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,n=0;const d=t.length-1,a=this.parts,[h,u]=Tt(t,e);if(this.el=I.createElement(h,i),S.currentNode=this.el.content,e===2){const l=this.el.content,c=l.firstChild;c.remove(),l.append(...c.childNodes)}for(;(o=S.nextNode())!==null&&a.length<d;){if(o.nodeType===1){if(o.hasAttributes()){const l=[];for(const c of o.getAttributeNames())if(c.endsWith("$lit$")||c.startsWith(_)){const v=u[n++];if(l.push(c),v!==void 0){const k=o.getAttribute(v.toLowerCase()+"$lit$").split(_),M=/([.?@])?(.*)/.exec(v);a.push({type:1,index:r,name:M[2],strings:k,ctor:M[1]==="."?Ht:M[1]==="?"?Ot:M[1]==="@"?kt:D})}else a.push({type:6,index:r})}for(const c of l)o.removeAttribute(c)}if(ht.test(o.tagName)){const l=o.textContent.split(_),c=l.length-1;if(c>0){o.textContent=w?w.emptyScript:"";for(let v=0;v<c;v++)o.append(l[v],U()),S.nextNode(),a.push({type:2,index:++r});o.append(l[c],U())}}}else if(o.nodeType===8)if(o.data===it)a.push({type:2,index:r});else{let l=-1;for(;(l=o.data.indexOf(_,l+1))!==-1;)a.push({type:7,index:r}),l+=_.length-1}r++}}static createElement(t,e){const i=E.createElement("template");return i.innerHTML=t,i}}function x(s,t,e=s,i){var o,r,n,d;if(t===b)return t;let a=i!==void 0?(o=e._$Cl)===null||o===void 0?void 0:o[i]:e._$Cu;const h=T(t)?void 0:t._$litDirective$;return(a==null?void 0:a.constructor)!==h&&((r=a==null?void 0:a._$AO)===null||r===void 0||r.call(a,!1),h===void 0?a=void 0:(a=new h(s),a._$AT(s,e,i)),i!==void 0?((n=(d=e)._$Cl)!==null&&n!==void 0?n:d._$Cl=[])[i]=a:e._$Cu=a),a!==void 0&&(t=x(s,a._$AS(s,t.values),a,i)),t}class Nt{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:o}=this._$AD,r=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:E).importNode(i,!0);S.currentNode=r;let n=S.nextNode(),d=0,a=0,h=o[0];for(;h!==void 0;){if(d===h.index){let u;h.type===2?u=new O(n,n.nextSibling,this,t):h.type===1?u=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(u=new Mt(n,this,t)),this.v.push(u),h=o[++a]}d!==(h==null?void 0:h.index)&&(n=S.nextNode(),d++)}return r}m(t){let e=0;for(const i of this.v)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class O{constructor(t,e,i,o){var r;this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cg=(r=o==null?void 0:o.isConnected)===null||r===void 0||r}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),T(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==b&&this.$(t):t._$litType$!==void 0?this.T(t):t.nodeType!==void 0?this.k(t):Ct(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==p&&T(this._$AH)?this._$AA.nextSibling.data=t:this.k(E.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:o}=t,r=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=I.createElement(o.h,this.options)),o);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===r)this._$AH.m(i);else{const n=new Nt(r,this),d=n.p(this.options);n.m(i),this.k(d),this._$AH=n}}_$AC(t){let e=dt.get(t.strings);return e===void 0&&dt.set(t.strings,e=new I(t)),e}S(t){st(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new O(this.A(U()),this.A(U()),this,this.options)):i=e[o],i._$AI(r),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){const o=t.nextSibling;t.remove(),t=o}}setConnected(t){var e;this._$AM===void 0&&(this._$Cg=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class D{constructor(t,e,i,o,r){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=p}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let n=!1;if(r===void 0)t=x(this,t,e,0),n=!T(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else{const d=t;let a,h;for(t=r[0],a=0;a<r.length-1;a++)h=x(this,d[i+a],e,a),h===b&&(h=this._$AH[a]),n||(n=!T(h)||h!==this._$AH[a]),h===p?t=p:t!==p&&(t+=(h!=null?h:"")+r[a+1]),this._$AH[a]=h}n&&!o&&this.C(t)}C(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}}class Ht extends D{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===p?void 0:t}}const It=w?w.emptyScript:"";class Ot extends D{constructor(){super(...arguments),this.type=4}C(t){t&&t!==p?this.element.setAttribute(this.name,It):this.element.removeAttribute(this.name)}}class kt extends D{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){var i;if((t=(i=x(this,t,e,0))!==null&&i!==void 0?i:p)===b)return;const o=this._$AH,r=t===p&&o!==p||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==p&&(o===p||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$AH.handleEvent(t)}}class Mt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){x(this,t)}}const lt=window.litHtmlPolyfillSupport;lt==null||lt(I,O),((B=globalThis.litHtmlVersions)!==null&&B!==void 0?B:globalThis.litHtmlVersions=[]).push("2.2.0");/**
29
+ */var q;const w=globalThis.trustedTypes,it=w?w.createPolicy("lit-html",{createHTML:s=>s}):void 0,_=`lit$${(Math.random()+"").slice(9)}$`,st="?"+_,Ct=`<${st}>`,E=document,U=(s="")=>E.createComment(s),T=s=>s===null||typeof s!="object"&&typeof s!="function",rt=Array.isArray,Pt=s=>{var t;return rt(s)||typeof((t=s)===null||t===void 0?void 0:t[Symbol.iterator])=="function"},N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ot=/-->/g,nt=/>/g,y=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,at=/'/g,ht=/"/g,lt=/^(?:script|style|textarea|title)$/i,Ut=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),F=Ut(1),b=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),dt=new WeakMap,Tt=(s,t,e)=>{var i,r;const o=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t;let n=o._$litPart$;if(n===void 0){const l=(r=e==null?void 0:e.renderBefore)!==null&&r!==void 0?r:null;o._$litPart$=n=new O(t.insertBefore(U(),l),l,void 0,e!=null?e:{})}return n._$AI(s),n},S=E.createTreeWalker(E,129,null,!1),Nt=(s,t)=>{const e=s.length-1,i=[];let r,o=t===2?"<svg>":"",n=N;for(let a=0;a<e;a++){const h=s[a];let u,d,c=-1,f=0;for(;f<h.length&&(n.lastIndex=f,d=n.exec(h),d!==null);)f=n.lastIndex,n===N?d[1]==="!--"?n=ot:d[1]!==void 0?n=nt:d[2]!==void 0?(lt.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=y):d[3]!==void 0&&(n=y):n===y?d[0]===">"?(n=r!=null?r:N,c=-1):d[1]===void 0?c=-2:(c=n.lastIndex-d[2].length,u=d[1],n=d[3]===void 0?y:d[3]==='"'?ht:at):n===ht||n===at?n=y:n===ot||n===nt?n=N:(n=y,r=void 0);const k=n===y&&s[a+1].startsWith("/>")?" ":"";o+=n===N?h+Ct:c>=0?(i.push(u),h.slice(0,c)+"$lit$"+h.slice(c)+_+k):h+_+(c===-2?(i.push(void 0),a):k)}const l=o+(s[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return[it!==void 0?it.createHTML(l):l,i]};class I{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0;const l=t.length-1,a=this.parts,[h,u]=Nt(t,e);if(this.el=I.createElement(h,i),S.currentNode=this.el.content,e===2){const d=this.el.content,c=d.firstChild;c.remove(),d.append(...c.childNodes)}for(;(r=S.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes()){const d=[];for(const c of r.getAttributeNames())if(c.endsWith("$lit$")||c.startsWith(_)){const f=u[n++];if(d.push(c),f!==void 0){const k=r.getAttribute(f.toLowerCase()+"$lit$").split(_),M=/([.?@])?(.*)/.exec(f);a.push({type:1,index:o,name:M[2],strings:k,ctor:M[1]==="."?It:M[1]==="?"?kt:M[1]==="@"?Mt:R})}else a.push({type:6,index:o})}for(const c of d)r.removeAttribute(c)}if(lt.test(r.tagName)){const d=r.textContent.split(_),c=d.length-1;if(c>0){r.textContent=w?w.emptyScript:"";for(let f=0;f<c;f++)r.append(d[f],U()),S.nextNode(),a.push({type:2,index:++o});r.append(d[c],U())}}}else if(r.nodeType===8)if(r.data===st)a.push({type:2,index:o});else{let d=-1;for(;(d=r.data.indexOf(_,d+1))!==-1;)a.push({type:7,index:o}),d+=_.length-1}o++}}static createElement(t,e){const i=E.createElement("template");return i.innerHTML=t,i}}function x(s,t,e=s,i){var r,o,n,l;if(t===b)return t;let a=i!==void 0?(r=e._$Cl)===null||r===void 0?void 0:r[i]:e._$Cu;const h=T(t)?void 0:t._$litDirective$;return(a==null?void 0:a.constructor)!==h&&((o=a==null?void 0:a._$AO)===null||o===void 0||o.call(a,!1),h===void 0?a=void 0:(a=new h(s),a._$AT(s,e,i)),i!==void 0?((n=(l=e)._$Cl)!==null&&n!==void 0?n:l._$Cl=[])[i]=a:e._$Cu=a),a!==void 0&&(t=x(s,a._$AS(s,t.values),a,i)),t}class Ht{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:r}=this._$AD,o=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:E).importNode(i,!0);S.currentNode=o;let n=S.nextNode(),l=0,a=0,h=r[0];for(;h!==void 0;){if(l===h.index){let u;h.type===2?u=new O(n,n.nextSibling,this,t):h.type===1?u=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(u=new Rt(n,this,t)),this.v.push(u),h=r[++a]}l!==(h==null?void 0:h.index)&&(n=S.nextNode(),l++)}return o}m(t){let e=0;for(const i of this.v)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class O{constructor(t,e,i,r){var o;this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cg=(o=r==null?void 0:r.isConnected)===null||o===void 0||o}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),T(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==b&&this.$(t):t._$litType$!==void 0?this.T(t):t.nodeType!==void 0?this.k(t):Pt(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==p&&T(this._$AH)?this._$AA.nextSibling.data=t:this.k(E.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:r}=t,o=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=I.createElement(r.h,this.options)),r);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.m(i);else{const n=new Ht(o,this),l=n.p(this.options);n.m(i),this.k(l),this._$AH=n}}_$AC(t){let e=dt.get(t.strings);return e===void 0&&dt.set(t.strings,e=new I(t)),e}S(t){rt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const o of t)r===e.length?e.push(i=new O(this.A(U()),this.A(U()),this,this.options)):i=e[r],i._$AI(o),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cg=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class R{constructor(t,e,i,r,o){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=p}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){const o=this.strings;let n=!1;if(o===void 0)t=x(this,t,e,0),n=!T(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else{const l=t;let a,h;for(t=o[0],a=0;a<o.length-1;a++)h=x(this,l[i+a],e,a),h===b&&(h=this._$AH[a]),n||(n=!T(h)||h!==this._$AH[a]),h===p?t=p:t!==p&&(t+=(h!=null?h:"")+o[a+1]),this._$AH[a]=h}n&&!r&&this.C(t)}C(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}}class It extends R{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===p?void 0:t}}const Ot=w?w.emptyScript:"";class kt extends R{constructor(){super(...arguments),this.type=4}C(t){t&&t!==p?this.element.setAttribute(this.name,Ot):this.element.removeAttribute(this.name)}}class Mt extends R{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}_$AI(t,e=this){var i;if((t=(i=x(this,t,e,0))!==null&&i!==void 0?i:p)===b)return;const r=this._$AH,o=t===p&&r!==p||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==p&&(r===p||o);o&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$AH.handleEvent(t)}}class Rt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){x(this,t)}}const ct=window.litHtmlPolyfillSupport;ct==null||ct(I,O),((q=globalThis.litHtmlVersions)!==null&&q!==void 0?q:globalThis.litHtmlVersions=[]).push("2.2.0");/**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */var F,W;class H extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=Ut(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!1)}render(){return b}}H.finalized=!0,H._$litElement$=!0,(F=globalThis.litElementHydrateSupport)===null||F===void 0||F.call(globalThis,{LitElement:H});const ct=globalThis.litElementPolyfillSupport;ct==null||ct({LitElement:H}),((W=globalThis.litElementVersions)!==null&&W!==void 0?W:globalThis.litElementVersions=[]).push("3.2.0");function Dt(s){if(!s.dispatchEvent||!s.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return s}const m="__registered_effects";function Rt(s){const t=s;if(t[m])return t;const e=Dt(s),i=e.updated;return t[m]={index:0,count:0,effects:[]},e.updated=o=>(t[m].index=0,i(o)),t}function zt(s,t){const e=Rt(s),{index:i,count:o}=e[m];return i===o?(e[m].index++,e[m].count++,e[m].effects.push(t),t):(e[m].index++,e[m].effects[i])}function pt(s,t,e){const i=zt(s,{on:t,observe:["__initial__dirty"]});i.observe.some((o,r)=>e[r]!==o)&&i.on(),i.observe=e}const Lt=(s,t)=>pt(s,t,[]);/**
33
+ */var W,J;class H extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=Tt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!1)}render(){return b}}H.finalized=!0,H._$litElement$=!0,(W=globalThis.litElementHydrateSupport)===null||W===void 0||W.call(globalThis,{LitElement:H});const pt=globalThis.litElementPolyfillSupport;pt==null||pt({LitElement:H}),((J=globalThis.litElementVersions)!==null&&J!==void 0?J:globalThis.litElementVersions=[]).push("3.2.0");function Dt(s){if(!s.dispatchEvent||!s.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return s}const m="__registered_effects";function zt(s){const t=s;if(t[m])return t;const e=Dt(s),i=e.updated;return t[m]={index:0,count:0,effects:[]},e.updated=r=>(t[m].index=0,i(r)),t}function Lt(s,t){const e=zt(s),{index:i,count:r}=e[m];return i===r?(e[m].index++,e[m].count++,e[m].effects.push(t),t):(e[m].index++,e[m].effects[i])}function ut(s,t,e){const i=Lt(s,{on:t,observe:["__initial__dirty"]});i.observe.some((r,o)=>e[o]!==r)&&i.on(),i.observe=e}const jt=(s,t)=>ut(s,t,[]);/**
34
34
  * @license
35
35
  * Copyright 2021 Google LLC
36
36
  * SPDX-License-Identifier: BSD-3-Clause
37
- */function jt(s,t,e){return s?t():e==null?void 0:e()}var Vt=`.shipaid-prompt {
38
- --shipaid-primary: #002bd6;
39
- --shipaid-secondary: #0076ff;
40
- --shipaid-text: #000000;
41
- --shipaid-text-muted: #cccccc;
42
- --shipaid-text-grey: #aaaaaa;
43
- --shipaid-light-grey: #ebecf0;
44
- --shipaid-font: "Lato", sans-serif;
45
- --shipaid-font-sm: 14px;
46
- --shipaid-font-base: 16px;
47
- --shipaid-font-lg: 18px;
48
- --shipaid-font-regular: 400;
49
- --shipaid-font-heavy: 700;
50
- width: 400px;
51
- font-family: var(--shipaid-font);
52
- font-size: var(--shipaid-font-base);
53
- color: var(--shipaid-text);
54
- display: flex;
55
- flex-direction: column;
56
- gap: 1rem;
57
- margin: 2rem 0 2rem auto;
58
- }
59
- .shipaid-prompt p, .shipaid-prompt a {
60
- margin: 0;
61
- line-height: 1;
62
- }
63
- .shipaid-prompt .prompt-title {
64
- text-align: center;
65
- font-size: var(--shipaid-font-lg);
66
- font-weight: var(--shipaid-font-heavy);
67
- }
68
- .shipaid-prompt .prompt-product {
69
- display: flex;
70
- flex-direction: row;
71
- gap: 2rem;
72
- height: 55px;
73
- margin-top: 1rem;
74
- }
75
- .shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-title {
76
- font-size: var(--shipaid-font-base);
77
- font-weight: var(--shipaid-font-heavy);
78
- }
79
- .shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-description {
80
- font-size: var(--shipaid-font-sm);
81
- margin-top: 1rem;
82
- }
83
- .shipaid-prompt .prompt-product .prompt-product-actions {
84
- margin-left: auto;
85
- display: flex;
86
- flex-direction: column;
87
- justify-content: space-between;
88
- text-align: right;
89
- }
90
- .shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-price {
91
- color: var(--shipaid-text-muted);
92
- font-size: var(--shipaid-font-base);
93
- }
94
- .shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-button {
95
- background-color: transparent;
96
- border: none;
97
- color: var(--shipaid-primary);
98
- text-transform: uppercase;
99
- font-weight: var(--shipaid-font-heavy);
100
- cursor: pointer;
101
- }
102
- .shipaid-prompt .prompt-footer {
103
- display: flex;
104
- flex-direction: row;
105
- justify-content: space-between;
106
- align-items: center;
107
- margin-top: 1rem;
108
- }
109
- .shipaid-prompt .prompt-footer .prompt-footer-about {
110
- color: var(--shipaid-text-grey);
111
- cursor: pointer;
112
- text-decoration: underline;
113
- font-size: var(--shipaid-font-sm);
114
- }
115
- .shipaid-prompt .prompt-footer .prompt-footer-badge {
116
- background-color: var(--shipaid-light-grey);
117
- color: var(--shipaid-text);
118
- padding: 0.5rem 1.5rem;
119
- border-radius: 30px;
120
- cursor: pointer;
121
- text-decoration: none;
122
- font-size: var(--shipaid-font-sm);
123
- }
124
- .shipaid-prompt .prompt-footer .prompt-footer-badge .ship {
125
- text-transform: uppercase;
126
- color: var(--shipaid-secondary);
127
- font-weight: var(--shipaid-font-heavy);
128
- }
129
- .shipaid-prompt .prompt-footer .prompt-footer-badge .aid {
130
- text-transform: uppercase;
131
- color: var(--shipaid-text-grey);
132
- font-weight: var(--shipaid-font-heavy);
133
- }`,Bt=Object.defineProperty,qt=Object.getOwnPropertyDescriptor,$=(s,t,e,i)=>{for(var o=i>1?void 0:i?qt(t,e):t,r=s.length-1,n;r>=0;r--)(n=s[r])&&(o=(i?n(t,e,o):n(o))||o);return i&&o&&Bt(t,e,o),o},Ft=(s=>(s.LOADED="shipaid-loaded",s.STATUS_UPDATE="shipaid-protection-status",s))(Ft||{});const Wt=s=>{var t,e,i,o,r;return new Intl.NumberFormat((e=(t=window.Shopify)==null?void 0:t.locale)!=null?e:void 0,{currency:(r=(o=(i=window.Shopify)==null?void 0:i.currency)==null?void 0:o.active)!=null?r:"USD",style:"currency"}).format(s)},ut=async(s,t)=>{try{const e=await fetch(s,t);if(!e.ok)throw new Error(await e.text());return await e.json()}catch(e){throw console.error(e),new Error("Failed to complete fetch request.")}};let f=class extends H{constructor(){super(...arguments);var s;this._storeDomain=(s=window.Shopify)==null?void 0:s.shop,this._hasFinishedSetup=!1,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._fetch={get:t=>ut(t),post:(t,e)=>ut(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}render(){var t,e;Lt(this,async()=>{var n,d;const[i,o]=await Promise.all([this._fetchShipAidData(),this._fetchCart()]);this._store=i,this._cart=o;const r=(d=(n=o.items)==null?void 0:n.some(a=>a.variant_id===i.productVariantNumericId))!=null?d:!1;this._hasProtectionInCart=r,this._hasFinishedSetup=!0,this._dispatchEvent("shipaid-loaded",i)}),pt(this,()=>{var r,n,d,a;if(!((r=this._cart)!=null&&r.items))return;const i=(d=(n=this._cart)==null?void 0:n.items)==null?void 0:d.findIndex(h=>{var u;return h.variant_id===((u=this._store)==null?void 0:u.productVariantNumericId)}),o=(a=this._cart)==null?void 0:a.items[i];this._hasProtectionInCart=!!o,o&&(this._protectionProduct=P(C({},o),{index:i,position:i+1}))},[this._store,this._cart]);const s=q`
37
+ */function Vt(s,t,e){return s?t():e==null?void 0:e()}var Bt=bt`
38
+ .shipaid-prompt {
39
+ --shipaid-primary: #002bd6;
40
+ --shipaid-secondary: #0076ff;
41
+ --shipaid-text: #000000;
42
+ --shipaid-text-muted: #cccccc;
43
+ --shipaid-text-grey: #aaaaaa;
44
+ --shipaid-light-grey: #ebecf0;
45
+ --shipaid-font: 'Lato', sans-serif;
46
+ --shipaid-font-sm: 14px;
47
+ --shipaid-font-base: 16px;
48
+ --shipaid-font-lg: 18px;
49
+ --shipaid-font-regular: 400;
50
+ --shipaid-font-heavy: 700;
51
+
52
+ width: 400px;
53
+ font-family: var(--shipaid-font);
54
+ font-size: var(--shipaid-font-base);
55
+ color: var(--shipaid-text);
56
+ display: flex;
57
+ flex-direction: column;
58
+ gap: 1rem;
59
+ margin: 2rem 0 2rem auto;
60
+ }
61
+ .shipaid-prompt p, .shipaid-prompt a {
62
+ margin: 0;
63
+ line-height: 1;
64
+ }
65
+ .shipaid-prompt .prompt-title {
66
+ text-align: center;
67
+ font-size: var(--shipaid-font-lg);
68
+ font-weight: var(--shipaid-font-heavy);
69
+ }
70
+ .shipaid-prompt .prompt-product {
71
+ display: flex;
72
+ flex-direction: row;
73
+ gap: 2rem;
74
+ height: 55px;
75
+ margin-top: 1rem;
76
+ }
77
+ .shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-title {
78
+ font-size: var(--shipaid-font-base);
79
+ font-weight: var(--shipaid-font-heavy);
80
+ }
81
+ .shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-description {
82
+ font-size: var(--shipaid-font-sm);
83
+ margin-top: 1rem;
84
+ }
85
+ .shipaid-prompt .prompt-product .prompt-product-actions {
86
+ margin-left: auto;
87
+ display: flex;
88
+ flex-direction: column;
89
+ justify-content: space-between;
90
+ text-align: right;
91
+ }
92
+ .shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-price {
93
+ color: var(--shipaid-text-muted);
94
+ font-size: var(--shipaid-font-base);
95
+ }
96
+ .shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-button {
97
+ background-color: transparent;
98
+ border: none;
99
+ color: var(--shipaid-primary);
100
+ text-transform: uppercase;
101
+ font-weight: var(--shipaid-font-heavy);
102
+ cursor: pointer;
103
+ }
104
+ .shipaid-prompt .prompt-footer {
105
+ display: flex;
106
+ flex-direction: row;
107
+ justify-content: space-between;
108
+ align-items: center;
109
+ margin-top: 1rem;
110
+ }
111
+ .shipaid-prompt .prompt-footer .prompt-footer-about {
112
+ color: var(--shipaid-text-grey);
113
+ cursor: pointer;
114
+ text-decoration: underline;
115
+ font-size: var(--shipaid-font-sm);
116
+ }
117
+ .shipaid-prompt .prompt-footer .prompt-footer-badge {
118
+ background-color: var(--shipaid-light-grey);
119
+ color: var(--shipaid-text);
120
+ padding: 0.5rem 1.5rem;
121
+ border-radius: 30px;
122
+ cursor: pointer;
123
+ text-decoration: none;
124
+ font-size: var(--shipaid-font-sm);
125
+ }
126
+ .shipaid-prompt .prompt-footer .prompt-footer-badge .ship {
127
+ text-transform: uppercase;
128
+ color: var(--shipaid-secondary);
129
+ font-weight: var(--shipaid-font-heavy);
130
+ }
131
+ .shipaid-prompt .prompt-footer .prompt-footer-badge .aid {
132
+ text-transform: uppercase;
133
+ color: var(--shipaid-text-grey);
134
+ font-weight: var(--shipaid-font-heavy);
135
+ }
136
+ `,qt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,$=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ft(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&qt(t,e,r),r},Wt=(s=>(s.LOADED="shipaid-loaded",s.STATUS_UPDATE="shipaid-protection-status",s))(Wt||{});const Jt=s=>{var t,e,i,r,o;return new Intl.NumberFormat((e=(t=window.Shopify)==null?void 0:t.locale)!=null?e:void 0,{currency:(o=(r=(i=window.Shopify)==null?void 0:i.currency)==null?void 0:r.active)!=null?o:"USD",style:"currency"}).format(s)},ft=async(s,t)=>{try{const e=await fetch(s,t);if(!e.ok)throw new Error(await e.text());return await e.json()}catch(e){throw console.error(e),new Error("Failed to complete fetch request.")}};let v=class extends H{constructor(){super(...arguments);var s;this._storeDomain=(s=window.Shopify)==null?void 0:s.shop,this._hasFinishedSetup=!1,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._fetch={get:t=>ft(t),post:(t,e)=>ft(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}render(){var t,e;jt(this,async()=>{var n,l;const[i,r]=await Promise.all([this._fetchShipAidData(),this._fetchCart()]);this._store=i,this._cart=r;const o=(l=(n=r.items)==null?void 0:n.some(a=>a.variant_id===i.productVariantNumericId))!=null?l:!1;this._hasProtectionInCart=o,this._hasFinishedSetup=!0,this._dispatchEvent("shipaid-loaded",i)}),ut(this,()=>{var o,n,l,a;if(!((o=this._cart)!=null&&o.items))return;const i=(l=(n=this._cart)==null?void 0:n.items)==null?void 0:l.findIndex(h=>{var u;return h.variant_id===((u=this._store)==null?void 0:u.productVariantNumericId)}),r=(a=this._cart)==null?void 0:a.items[i];this._hasProtectionInCart=!!r,r&&(this._protectionProduct=P(C({},r),{index:i,position:i+1}))},[this._store,this._cart]);const s=F`
134
137
  <div class="shipaid-prompt">
135
138
  <p class="prompt-title">${this._hasProtectionInCart?"Active":"Inactive"}</p>
136
139
  <div class="prompt-product">
@@ -142,7 +145,7 @@ var vt=Object.defineProperty,ft=Object.defineProperties;var mt=Object.getOwnProp
142
145
  <p class="prompt-product-details-description">Resolve shipping issues care-free</p>
143
146
  </div>
144
147
  <div class="prompt-product-actions">
145
- <p class="prompt-product-actions-price">${Wt((e=(t=this._store)==null?void 0:t.productPrice)!=null?e:0)}</p>
148
+ <p class="prompt-product-actions-price">${Jt((e=(t=this._store)==null?void 0:t.productPrice)!=null?e:0)}</p>
146
149
  <button class="prompt-product-actions-button" @click=${this._updateProtection} ?disabled=${this._state.loading}>
147
150
  ${this._state.loading?"Loading...":this._hasProtectionInCart?"Remove":"+ Add"}
148
151
  </button>
@@ -157,8 +160,8 @@ var vt=Object.defineProperty,ft=Object.defineProperties;var mt=Object.getOwnProp
157
160
  </a>
158
161
  </div>
159
162
  </div>
160
- `;return q`
161
- ${jt(this._hasFinishedSetup&&this._store,()=>s,()=>q`<p>Loading...</p>`)}
163
+ `;return F`
164
+ ${Vt(this._hasFinishedSetup&&this._store,()=>s,()=>F`<p>Loading...</p>`)}
162
165
  `}_dispatchEvent(s,t={}){this.dispatchEvent(new CustomEvent(s,{bubbles:!0,composed:!0,detail:t}))}_setState(s,t){this._state={loading:s==="loading",success:s==="success",error:s==="error"?t||!0:!1}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){try{if(!this._storeDomain)throw new Error("Missing store domain - cannot continue.");const s={store:this._storeDomain},t=`query StoreByDomain($store: String!) {
163
166
  store(store: $store) {
164
167
  store
@@ -167,4 +170,4 @@ var vt=Object.defineProperty,ft=Object.defineProperties;var mt=Object.getOwnProp
167
170
  productVariantNumericId
168
171
  productPrice
169
172
  }
170
- }`,{data:e}=await this._fetch.post("http://localhost:1337/v1/graphql",{query:t,variables:s});if(!e.store)throw new Error(`Could not find a store for ${this._storeDomain}`);if(!e.store.productVariantNumericId)throw new Error("Missing variant ID for ShipAid product.");return e.store}catch(s){throw console.error(s),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(s){throw console.error(s),new Error("Could not fetch cart for current domain.")}}hasProtection(){return this._hasProtectionInCart}async addProtection(){var s,t;try{if(!((s=this._store)!=null&&s.productVariantNumericId))throw new Error("Store has not been loaded.");if(!((t=this._cart)!=null&&t.items))throw new Error("Cart has not been loaded.");this._setState("loading");const e={id:this._store.productVariantNumericId,quantity:1},i=await this._fetch.post("/cart/add.js",e),o=P(C({},this._cart),{items:[i,...this._cart.items]});this._cart=o,this._setState("success"),this._dispatchEvent("shipaid-protection-status",{protection:!0,cart:o,lineItem:i})}catch(e){console.error(e),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}async removeProtection(){var s;try{if(!((s=this._store)!=null&&s.productVariantNumericId))throw new Error("Store has not been loaded.");if(!this._protectionProduct)throw new Error("Protection product not found.");this._setState("loading");const t={id:this._protectionProduct.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);this._dispatchEvent("shipaid-protection-status",{protection:!1,cart:e,lineItem:this._protectionProduct}),this._cart=e,this._setState("success")}catch(t){console.error(t),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}};f.styles=Vt,$([g()],f.prototype,"_storeDomain",2),$([g()],f.prototype,"_store",2),$([g()],f.prototype,"_cart",2),$([g()],f.prototype,"_hasFinishedSetup",2),$([g()],f.prototype,"_hasProtectionInCart",2),$([g()],f.prototype,"_protectionProduct",2),$([g()],f.prototype,"_state",2),f=$([gt("shipaid-widget")],f);export{f as ShipAidWidget};
173
+ }`,{data:e}=await this._fetch.post("http://localhost:1337/v1/graphql",{query:t,variables:s});if(!e.store)throw new Error(`Could not find a store for ${this._storeDomain}`);if(!e.store.productVariantNumericId)throw new Error("Missing variant ID for ShipAid product.");return e.store}catch(s){throw console.error(s),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(s){throw console.error(s),new Error("Could not fetch cart for current domain.")}}hasProtection(){return this._hasProtectionInCart}async addProtection(){var s,t;try{if(!((s=this._store)!=null&&s.productVariantNumericId))throw new Error("Store has not been loaded.");if(!((t=this._cart)!=null&&t.items))throw new Error("Cart has not been loaded.");this._setState("loading");const e={id:this._store.productVariantNumericId,quantity:1},i=await this._fetch.post("/cart/add.js",e),r=P(C({},this._cart),{items:[i,...this._cart.items]});this._cart=r,this._setState("success"),this._dispatchEvent("shipaid-protection-status",{protection:!0,cart:r,lineItem:i})}catch(e){console.error(e),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}async removeProtection(){var s;try{if(!((s=this._store)!=null&&s.productVariantNumericId))throw new Error("Store has not been loaded.");if(!this._protectionProduct)throw new Error("Protection product not found.");this._setState("loading");const t={id:this._protectionProduct.key,quantity:0},e=await this._fetch.post("/cart/change.js",t);this._dispatchEvent("shipaid-protection-status",{protection:!1,cart:e,lineItem:this._protectionProduct}),this._cart=e,this._setState("success")}catch(t){console.error(t),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}};v.styles=Bt,$([g()],v.prototype,"_storeDomain",2),$([g()],v.prototype,"_store",2),$([g()],v.prototype,"_cart",2),$([g()],v.prototype,"_hasFinishedSetup",2),$([g()],v.prototype,"_hasProtectionInCart",2),$([g()],v.prototype,"_protectionProduct",2),$([g()],v.prototype,"_state",2),v=$([yt("shipaid-widget")],v);export{v as ShipAidWidget};
@@ -1,9 +1,9 @@
1
- var Wt=Object.defineProperty,Vt=Object.defineProperties,Bt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable,ft=(t,e,i)=>e in t?Wt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,M=(t,e)=>{for(var i in e||(e={}))qt.call(e,i)&&ft(t,i,e[i]);if(vt)for(var i of vt(e))Ft.call(e,i)&&ft(t,i,e[i]);return t},k=(t,e)=>Vt(t,Bt(e)),ShipAidWidget=function(t){"use strict";
1
+ var Vt=Object.defineProperty,Bt=Object.defineProperties,qt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,Ft=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,mt=(t,e,i)=>e in t?Vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,k=(t,e)=>{for(var i in e||(e={}))Ft.call(e,i)&&mt(t,i,e[i]);if(vt)for(var i of vt(e))Jt.call(e,i)&&mt(t,i,e[i]);return t},M=(t,e)=>Bt(t,qt(e)),ShipAidWidget=function(t){"use strict";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const e=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?k(M({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};
6
+ */const e=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?M(k({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
@@ -14,7 +14,7 @@ var Wt=Object.defineProperty,Vt=Object.defineProperties,Bt=Object.getOwnProperty
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- function i(t){return function(t){return(i,s)=>{return void 0!==s?(r=t,o=s,void i.constructor.createProperty(o,r)):e(t,i);var r,o}}(k(M({},t),{state:!0}))}
17
+ function i(t){return function(t){return(i,s)=>{return void 0!==s?(r=t,o=s,void i.constructor.createProperty(o,r)):e(t,i);var r,o}}(M(k({},t),{state:!0}))}
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2021 Google LLC
@@ -25,29 +25,128 @@ function i(t){return function(t){return(i,s)=>{return void 0!==s?(r=t,o=s,void i
25
25
  * Copyright 2019 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
27
  */
28
- const r=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),n=new Map;class a{constructor(t,e){if(this._$cssResult$=!0,e!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=n.get(this.cssText);return r&&void 0===t&&(n.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const h=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new a("string"==typeof t?t:t+"",o))(e)})(t):t
28
+ const r=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),n=new Map;class a{constructor(t,e){if(this._$cssResult$=!0,e!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=n.get(this.cssText);return r&&void 0===t&&(n.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const l=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new a("string"==typeof t?t:t+"",o))(e)})(t):t
29
29
  /**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */;var l;const d=window.trustedTypes,p=d?d.emptyScript:"",c=window.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},v=(t,e)=>e!==t&&(e==e||t==t),f={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:v};class _ extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Eh(i,e);void 0!==s&&(this._$Eu.set(s,i),t.push(s))})),t}static createProperty(t,e=f){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=f){var s,r;const o=this.constructor._$Eh(t,i);if(void 0!==o&&!0===i.reflect){const n=(null!==(r=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==r?r:u.toAttribute)(e,i.type);this._$Ei=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Ei=null}}_$AK(t,e){var i,s,r;const o=this.constructor,n=o._$Eu.get(t);if(void 0!==n&&this._$Ei!==n){const t=o.getPropertyOptions(n),a=t.converter,h=null!==(r=null!==(s=null===(i=a)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof a?a:null)&&void 0!==r?r:u.fromAttribute;this._$Ei=n,this[n]=h(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
33
+ */;var h;const d=window.trustedTypes,c=d?d.emptyScript:"",p=window.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},v=(t,e)=>e!==t&&(e==e||t==t),f={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:v};class m extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Eh(i,e);void 0!==s&&(this._$Eu.set(s,i),t.push(s))})),t}static createProperty(t,e=f){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=f){var s,r;const o=this.constructor._$Eh(t,i);if(void 0!==o&&!0===i.reflect){const n=(null!==(r=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==r?r:u.toAttribute)(e,i.type);this._$Ei=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Ei=null}}_$AK(t,e){var i,s,r;const o=this.constructor,n=o._$Eu.get(t);if(void 0!==n&&this._$Ei!==n){const t=o.getPropertyOptions(n),a=t.converter,l=null!==(r=null!==(s=null===(i=a)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof a?a:null)&&void 0!==r?r:u.fromAttribute;this._$Ei=n,this[n]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
34
34
  /**
35
35
  * @license
36
36
  * Copyright 2017 Google LLC
37
37
  * SPDX-License-Identifier: BSD-3-Clause
38
38
  */
39
- var m;_.finalized=!0,_.elementProperties=new Map,_.elementStyles=[],_.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:_}),(null!==(l=globalThis.reactiveElementVersions)&&void 0!==l?l:globalThis.reactiveElementVersions=[]).push("1.3.0");const g=globalThis.trustedTypes,$=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,y=`lit$${(Math.random()+"").slice(9)}$`,A="?"+y,b=`<${A}>`,w=document,S=(t="")=>w.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,U=/>/g,O=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,T=/'/g,N=/"/g,H=/^(?:script|style|textarea|title)$/i,I=(L=1,(t,...e)=>({_$litType$:L,strings:t,values:e})),D=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),j=new WeakMap,z=w.createTreeWalker(w,129,null,!1);var L;class W{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const n=t.length-1,a=this.parts,[h,l]=((t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"<svg>":"",n=P;for(let h=0;h<i;h++){const e=t[h];let i,a,l=-1,d=0;for(;d<e.length&&(n.lastIndex=d,a=n.exec(e),null!==a);)d=n.lastIndex,n===P?"!--"===a[1]?n=C:void 0!==a[1]?n=U:void 0!==a[2]?(H.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=O):void 0!==a[3]&&(n=O):n===O?">"===a[0]?(n=null!=r?r:P,l=-1):void 0===a[1]?l=-2:(l=n.lastIndex-a[2].length,i=a[1],n=void 0===a[3]?O:'"'===a[3]?N:T):n===N||n===T?n=O:n===C||n===U?n=P:(n=O,r=void 0);const p=n===O&&t[h+1].startsWith("/>")?" ":"";o+=n===P?e+b:l>=0?(s.push(i),e.slice(0,l)+"$lit$"+e.slice(l)+y+p):e+y+(-2===l?(s.push(void 0),h):p)}const a=o+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==$?$.createHTML(a):a,s]})(t,e);if(this.el=W.createElement(h,i),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=z.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(y)){const i=l[o++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(y),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?J:"?"===e[1]?Z:"@"===e[1]?G:F})}else a.push({type:6,index:r})}for(const e of t)s.removeAttribute(e)}if(H.test(s.tagName)){const t=s.textContent.split(y),e=t.length-1;if(e>0){s.textContent=g?g.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],S()),z.nextNode(),a.push({type:2,index:++r});s.append(t[e],S())}}}else if(8===s.nodeType)if(s.data===A)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(y,t+1));)a.push({type:7,index:r}),t+=y.length-1}r++}}static createElement(t,e){const i=w.createElement("template");return i.innerHTML=t,i}}function B(t,e,i=t,s){var r,o,n,a;if(e===D)return e;let h=void 0!==s?null===(r=i._$Cl)||void 0===r?void 0:r[s]:i._$Cu;const l=E(e)?void 0:e._$litDirective$;return(null==h?void 0:h.constructor)!==l&&(null===(o=null==h?void 0:h._$AO)||void 0===o||o.call(h,!1),void 0===l?h=void 0:(h=new l(t),h._$AT(t,i,s)),void 0!==s?(null!==(n=(a=i)._$Cl)&&void 0!==n?n:a._$Cl=[])[s]=h:i._$Cu=h),void 0!==h&&(e=B(t,h._$AS(t,e.values),h,s)),e}class V{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:w).importNode(i,!0);z.currentNode=r;let o=z.nextNode(),n=0,a=0,h=s[0];for(;void 0!==h;){if(n===h.index){let e;2===h.type?e=new q(o,o.nextSibling,this,t):1===h.type?e=new h.ctor(o,h.name,h.strings,this,t):6===h.type&&(e=new Q(o,this,t)),this.v.push(e),h=s[++a]}n!==(null==h?void 0:h.index)&&(o=z.nextNode(),n++)}return r}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class q{constructor(t,e,i,s){var r;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=null===(r=null==s?void 0:s.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=B(this,t,e),E(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==D&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return x(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==R&&E(this._$AH)?this._$AA.nextSibling.data=t:this.k(w.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,r="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=W.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.m(i);else{const t=new V(r,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=j.get(t.strings);return void 0===e&&j.set(t.strings,e=new W(t)),e}S(t){x(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new q(this.A(S()),this.A(S()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class F{constructor(t,e,i,s,r){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=B(this,t,e,0),o=!E(t)||t!==this._$AH&&t!==D,o&&(this._$AH=t);else{const s=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=B(this,s[i+n],e,n),a===D&&(a=this._$AH[n]),o||(o=!E(a)||a!==this._$AH[n]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}o&&!s&&this.C(t)}C(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class J extends F{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===R?void 0:t}}const K=g?g.emptyScript:"";class Z extends F{constructor(){super(...arguments),this.type=4}C(t){t&&t!==R?this.element.setAttribute(this.name,K):this.element.removeAttribute(this.name)}}class G extends F{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=B(this,t,e,0))&&void 0!==i?i:R)===D)return;const s=this._$AH,r=t===R&&s!==R||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==R&&(s===R||r);r&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const X=window.litHtmlPolyfillSupport;
39
+ var _;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==p||p({ReactiveElement:m}),(null!==(h=globalThis.reactiveElementVersions)&&void 0!==h?h:globalThis.reactiveElementVersions=[]).push("1.3.0");const g=globalThis.trustedTypes,$=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,y=`lit$${(Math.random()+"").slice(9)}$`,A="?"+y,b=`<${A}>`,w=document,S=(t="")=>w.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,U=/>/g,O=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,T=/'/g,N=/"/g,H=/^(?:script|style|textarea|title)$/i,I=(L=1,(t,...e)=>({_$litType$:L,strings:t,values:e})),R=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),j=new WeakMap,z=w.createTreeWalker(w,129,null,!1);var L;class V{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const n=t.length-1,a=this.parts,[l,h]=((t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"<svg>":"",n=C;for(let l=0;l<i;l++){const e=t[l];let i,a,h=-1,d=0;for(;d<e.length&&(n.lastIndex=d,a=n.exec(e),null!==a);)d=n.lastIndex,n===C?"!--"===a[1]?n=P:void 0!==a[1]?n=U:void 0!==a[2]?(H.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=O):void 0!==a[3]&&(n=O):n===O?">"===a[0]?(n=null!=r?r:C,h=-1):void 0===a[1]?h=-2:(h=n.lastIndex-a[2].length,i=a[1],n=void 0===a[3]?O:'"'===a[3]?N:T):n===N||n===T?n=O:n===P||n===U?n=C:(n=O,r=void 0);const c=n===O&&t[l+1].startsWith("/>")?" ":"";o+=n===C?e+b:h>=0?(s.push(i),e.slice(0,h)+"$lit$"+e.slice(h)+y+c):e+y+(-2===h?(s.push(void 0),l):c)}const a=o+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==$?$.createHTML(a):a,s]})(t,e);if(this.el=V.createElement(l,i),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=z.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(y)){const i=h[o++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(y),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?J:"?"===e[1]?Z:"@"===e[1]?G:F})}else a.push({type:6,index:r})}for(const e of t)s.removeAttribute(e)}if(H.test(s.tagName)){const t=s.textContent.split(y),e=t.length-1;if(e>0){s.textContent=g?g.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],S()),z.nextNode(),a.push({type:2,index:++r});s.append(t[e],S())}}}else if(8===s.nodeType)if(s.data===A)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(y,t+1));)a.push({type:7,index:r}),t+=y.length-1}r++}}static createElement(t,e){const i=w.createElement("template");return i.innerHTML=t,i}}function W(t,e,i=t,s){var r,o,n,a;if(e===R)return e;let l=void 0!==s?null===(r=i._$Cl)||void 0===r?void 0:r[s]:i._$Cu;const h=E(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(o=null==l?void 0:l._$AO)||void 0===o||o.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,s)),void 0!==s?(null!==(n=(a=i)._$Cl)&&void 0!==n?n:a._$Cl=[])[s]=l:i._$Cu=l),void 0!==l&&(e=W(t,l._$AS(t,e.values),l,s)),e}class B{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:w).importNode(i,!0);z.currentNode=r;let o=z.nextNode(),n=0,a=0,l=s[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new q(o,o.nextSibling,this,t):1===l.type?e=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(e=new Q(o,this,t)),this.v.push(e),l=s[++a]}n!==(null==l?void 0:l.index)&&(o=z.nextNode(),n++)}return r}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class q{constructor(t,e,i,s){var r;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=null===(r=null==s?void 0:s.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=W(this,t,e),E(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==R&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return x(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==D&&E(this._$AH)?this._$AA.nextSibling.data=t:this.k(w.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,r="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=V.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.m(i);else{const t=new B(r,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=j.get(t.strings);return void 0===e&&j.set(t.strings,e=new V(t)),e}S(t){x(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new q(this.A(S()),this.A(S()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class F{constructor(t,e,i,s,r){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=W(this,t,e,0),o=!E(t)||t!==this._$AH&&t!==R,o&&(this._$AH=t);else{const s=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=W(this,s[i+n],e,n),a===R&&(a=this._$AH[n]),o||(o=!E(a)||a!==this._$AH[n]),a===D?t=D:t!==D&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}o&&!s&&this.C(t)}C(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class J extends F{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===D?void 0:t}}const K=g?g.emptyScript:"";class Z extends F{constructor(){super(...arguments),this.type=4}C(t){t&&t!==D?this.element.setAttribute(this.name,K):this.element.removeAttribute(this.name)}}class G extends F{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=W(this,t,e,0))&&void 0!==i?i:D)===R)return;const s=this._$AH,r=t===D&&s!==D||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==D&&(s===D||r);r&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){W(this,t)}}const X=window.litHtmlPolyfillSupport;
40
40
  /**
41
41
  * @license
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
44
  */
45
- var Y,tt;null==X||X(W,q),(null!==(m=globalThis.litHtmlVersions)&&void 0!==m?m:globalThis.litHtmlVersions=[]).push("2.2.0");class et extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,i)=>{var s,r;const o=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let n=o._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new q(e.insertBefore(S(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return D}}et.finalized=!0,et._$litElement$=!0,null===(Y=globalThis.litElementHydrateSupport)||void 0===Y||Y.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.0");const st="__registered_effects";function rt(t){const e=t;if(e[st])return e;const i=function(t){if(!t.dispatchEvent||!t.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return t}(t),s=i.updated;return e[st]={index:0,count:0,effects:[]},i.updated=t=>(e[st].index=0,s(t)),e}function ot(t,e,i){const s=function(t,e){const i=rt(t),{index:s,count:r}=i[st];return s===r?(i[st].index++,i[st].count++,i[st].effects.push(e),e):(i[st].index++,i[st].effects[s])}(t,{on:e,observe:["__initial__dirty"]});s.observe.some(((t,e)=>i[e]!==t))&&s.on(),s.observe=i}var nt=Object.defineProperty,at=Object.getOwnPropertyDescriptor,ht=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?at(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&nt(e,i,o),o},lt=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(lt||{});const dt=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}};return t.ShipAidWidget=class extends et{constructor(){var t;super(...arguments),this._storeDomain=null==(t=window.Shopify)?void 0:t.shop,this._hasFinishedSetup=!1,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._fetch={get:t=>dt(t),post:(t,e)=>dt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}render(){var t,e;((t,e)=>{ot(t,e,[]);
45
+ var Y,tt;null==X||X(V,q),(null!==(_=globalThis.litHtmlVersions)&&void 0!==_?_:globalThis.litHtmlVersions=[]).push("2.2.0");class et extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,i)=>{var s,r;const o=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let n=o._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new q(e.insertBefore(S(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return R}}et.finalized=!0,et._$litElement$=!0,null===(Y=globalThis.litElementHydrateSupport)||void 0===Y||Y.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.0");const st="__registered_effects";function rt(t){const e=t;if(e[st])return e;const i=function(t){if(!t.dispatchEvent||!t.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return t}(t),s=i.updated;return e[st]={index:0,count:0,effects:[]},i.updated=t=>(e[st].index=0,s(t)),e}function ot(t,e,i){const s=function(t,e){const i=rt(t),{index:s,count:r}=i[st];return s===r?(i[st].index++,i[st].count++,i[st].effects.push(e),e):(i[st].index++,i[st].effects[s])}(t,{on:e,observe:["__initial__dirty"]});s.observe.some(((t,e)=>i[e]!==t))&&s.on(),s.observe=i}var nt=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new a(i,o)})`
46
+ .shipaid-prompt {
47
+ --shipaid-primary: #002bd6;
48
+ --shipaid-secondary: #0076ff;
49
+ --shipaid-text: #000000;
50
+ --shipaid-text-muted: #cccccc;
51
+ --shipaid-text-grey: #aaaaaa;
52
+ --shipaid-light-grey: #ebecf0;
53
+ --shipaid-font: 'Lato', sans-serif;
54
+ --shipaid-font-sm: 14px;
55
+ --shipaid-font-base: 16px;
56
+ --shipaid-font-lg: 18px;
57
+ --shipaid-font-regular: 400;
58
+ --shipaid-font-heavy: 700;
59
+
60
+ width: 400px;
61
+ font-family: var(--shipaid-font);
62
+ font-size: var(--shipaid-font-base);
63
+ color: var(--shipaid-text);
64
+ display: flex;
65
+ flex-direction: column;
66
+ gap: 1rem;
67
+ margin: 2rem 0 2rem auto;
68
+ }
69
+ .shipaid-prompt p, .shipaid-prompt a {
70
+ margin: 0;
71
+ line-height: 1;
72
+ }
73
+ .shipaid-prompt .prompt-title {
74
+ text-align: center;
75
+ font-size: var(--shipaid-font-lg);
76
+ font-weight: var(--shipaid-font-heavy);
77
+ }
78
+ .shipaid-prompt .prompt-product {
79
+ display: flex;
80
+ flex-direction: row;
81
+ gap: 2rem;
82
+ height: 55px;
83
+ margin-top: 1rem;
84
+ }
85
+ .shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-title {
86
+ font-size: var(--shipaid-font-base);
87
+ font-weight: var(--shipaid-font-heavy);
88
+ }
89
+ .shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-description {
90
+ font-size: var(--shipaid-font-sm);
91
+ margin-top: 1rem;
92
+ }
93
+ .shipaid-prompt .prompt-product .prompt-product-actions {
94
+ margin-left: auto;
95
+ display: flex;
96
+ flex-direction: column;
97
+ justify-content: space-between;
98
+ text-align: right;
99
+ }
100
+ .shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-price {
101
+ color: var(--shipaid-text-muted);
102
+ font-size: var(--shipaid-font-base);
103
+ }
104
+ .shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-button {
105
+ background-color: transparent;
106
+ border: none;
107
+ color: var(--shipaid-primary);
108
+ text-transform: uppercase;
109
+ font-weight: var(--shipaid-font-heavy);
110
+ cursor: pointer;
111
+ }
112
+ .shipaid-prompt .prompt-footer {
113
+ display: flex;
114
+ flex-direction: row;
115
+ justify-content: space-between;
116
+ align-items: center;
117
+ margin-top: 1rem;
118
+ }
119
+ .shipaid-prompt .prompt-footer .prompt-footer-about {
120
+ color: var(--shipaid-text-grey);
121
+ cursor: pointer;
122
+ text-decoration: underline;
123
+ font-size: var(--shipaid-font-sm);
124
+ }
125
+ .shipaid-prompt .prompt-footer .prompt-footer-badge {
126
+ background-color: var(--shipaid-light-grey);
127
+ color: var(--shipaid-text);
128
+ padding: 0.5rem 1.5rem;
129
+ border-radius: 30px;
130
+ cursor: pointer;
131
+ text-decoration: none;
132
+ font-size: var(--shipaid-font-sm);
133
+ }
134
+ .shipaid-prompt .prompt-footer .prompt-footer-badge .ship {
135
+ text-transform: uppercase;
136
+ color: var(--shipaid-secondary);
137
+ font-weight: var(--shipaid-font-heavy);
138
+ }
139
+ .shipaid-prompt .prompt-footer .prompt-footer-badge .aid {
140
+ text-transform: uppercase;
141
+ color: var(--shipaid-text-grey);
142
+ font-weight: var(--shipaid-font-heavy);
143
+ }
144
+ `,at=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,ht=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?lt(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&at(e,i,o),o},dt=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(dt||{});const ct=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}};return t.ShipAidWidget=class extends et{constructor(){var t;super(...arguments),this._storeDomain=null==(t=window.Shopify)?void 0:t.shop,this._hasFinishedSetup=!1,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._fetch={get:t=>ct(t),post:(t,e)=>ct(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}render(){var t,e;((t,e)=>{ot(t,e,[]);
46
145
  /**
47
146
  * @license
48
147
  * Copyright 2021 Google LLC
49
148
  * SPDX-License-Identifier: BSD-3-Clause
50
- */})(this,(async()=>{var t,e;const[i,s]=await Promise.all([this._fetchShipAidData(),this._fetchCart()]);this._store=i,this._cart=s;const r=null!=(e=null==(t=s.items)?void 0:t.some((t=>t.variant_id===i.productVariantNumericId)))&&e;this._hasProtectionInCart=r,this._hasFinishedSetup=!0,this._dispatchEvent("shipaid-loaded",i)})),ot(this,(()=>{var t,e,i,s;if(null==(t=this._cart)||!t.items)return;const r=null==(i=null==(e=this._cart)?void 0:e.items)?void 0:i.findIndex((t=>{var e;return t.variant_id===(null==(e=this._store)?void 0:e.productVariantNumericId)})),o=null==(s=this._cart)?void 0:s.items[r];this._hasProtectionInCart=!!o,o&&(this._protectionProduct=k(M({},o),{index:r,position:r+1}))}),[this._store,this._cart]);const i=I`
149
+ */})(this,(async()=>{var t,e;const[i,s]=await Promise.all([this._fetchShipAidData(),this._fetchCart()]);this._store=i,this._cart=s;const r=null!=(e=null==(t=s.items)?void 0:t.some((t=>t.variant_id===i.productVariantNumericId)))&&e;this._hasProtectionInCart=r,this._hasFinishedSetup=!0,this._dispatchEvent("shipaid-loaded",i)})),ot(this,(()=>{var t,e,i,s;if(null==(t=this._cart)||!t.items)return;const r=null==(i=null==(e=this._cart)?void 0:e.items)?void 0:i.findIndex((t=>{var e;return t.variant_id===(null==(e=this._store)?void 0:e.productVariantNumericId)})),o=null==(s=this._cart)?void 0:s.items[r];this._hasProtectionInCart=!!o,o&&(this._protectionProduct=M(k({},o),{index:r,position:r+1}))}),[this._store,this._cart]);const i=I`
51
150
  <div class="shipaid-prompt">
52
151
  <p class="prompt-title">${this._hasProtectionInCart?"Active":"Inactive"}</p>
53
152
  <div class="prompt-product">
@@ -76,4 +175,4 @@ var Y,tt;null==X||X(W,q),(null!==(m=globalThis.litHtmlVersions)&&void 0!==m?m:gl
76
175
  </div>
77
176
  `;return I`
78
177
  ${function(t,e,i){return t?e():null==i?void 0:i()}(this._hasFinishedSetup&&this._store,(()=>i),(()=>I`<p>Loading...</p>`))}
79
- `}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){try{if(!this._storeDomain)throw new Error("Missing store domain - cannot continue.");const t={store:this._storeDomain},e="query StoreByDomain($store: String!) {\n store(store: $store) {\n store\n productId\n productVariantId\n productVariantNumericId\n productPrice\n }\n }",{data:i}=await this._fetch.post("http://localhost:1337/v1/graphql",{query:e,variables:t});if(!i.store)throw new Error(`Could not find a store for ${this._storeDomain}`);if(!i.store.productVariantNumericId)throw new Error("Missing variant ID for ShipAid product.");return i.store}catch(L){throw console.error(L),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(L){throw console.error(L),new Error("Could not fetch cart for current domain.")}}hasProtection(){return this._hasProtectionInCart}async addProtection(){var t,e;try{if(null==(t=this._store)||!t.productVariantNumericId)throw new Error("Store has not been loaded.");if(null==(e=this._cart)||!e.items)throw new Error("Cart has not been loaded.");this._setState("loading");const i={id:this._store.productVariantNumericId,quantity:1},s=await this._fetch.post("/cart/add.js",i),r=k(M({},this._cart),{items:[s,...this._cart.items]});this._cart=r,this._setState("success"),this._dispatchEvent("shipaid-protection-status",{protection:!0,cart:r,lineItem:s})}catch(i){console.error(i),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}async removeProtection(){var t;try{if(null==(t=this._store)||!t.productVariantNumericId)throw new Error("Store has not been loaded.");if(!this._protectionProduct)throw new Error("Protection product not found.");this._setState("loading");const e={id:this._protectionProduct.key,quantity:0},i=await this._fetch.post("/cart/change.js",e);this._dispatchEvent("shipaid-protection-status",{protection:!1,cart:i,lineItem:this._protectionProduct}),this._cart=i,this._setState("success")}catch(e){console.error(e),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}},t.ShipAidWidget.styles='.shipaid-prompt {\n --shipaid-primary: #002bd6;\n --shipaid-secondary: #0076ff;\n --shipaid-text: #000000;\n --shipaid-text-muted: #cccccc;\n --shipaid-text-grey: #aaaaaa;\n --shipaid-light-grey: #ebecf0;\n --shipaid-font: "Lato", sans-serif;\n --shipaid-font-sm: 14px;\n --shipaid-font-base: 16px;\n --shipaid-font-lg: 18px;\n --shipaid-font-regular: 400;\n --shipaid-font-heavy: 700;\n width: 400px;\n font-family: var(--shipaid-font);\n font-size: var(--shipaid-font-base);\n color: var(--shipaid-text);\n display: flex;\n flex-direction: column;\n gap: 1rem;\n margin: 2rem 0 2rem auto;\n}\n.shipaid-prompt p, .shipaid-prompt a {\n margin: 0;\n line-height: 1;\n}\n.shipaid-prompt .prompt-title {\n text-align: center;\n font-size: var(--shipaid-font-lg);\n font-weight: var(--shipaid-font-heavy);\n}\n.shipaid-prompt .prompt-product {\n display: flex;\n flex-direction: row;\n gap: 2rem;\n height: 55px;\n margin-top: 1rem;\n}\n.shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-title {\n font-size: var(--shipaid-font-base);\n font-weight: var(--shipaid-font-heavy);\n}\n.shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-description {\n font-size: var(--shipaid-font-sm);\n margin-top: 1rem;\n}\n.shipaid-prompt .prompt-product .prompt-product-actions {\n margin-left: auto;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n text-align: right;\n}\n.shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-price {\n color: var(--shipaid-text-muted);\n font-size: var(--shipaid-font-base);\n}\n.shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-button {\n background-color: transparent;\n border: none;\n color: var(--shipaid-primary);\n text-transform: uppercase;\n font-weight: var(--shipaid-font-heavy);\n cursor: pointer;\n}\n.shipaid-prompt .prompt-footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: 1rem;\n}\n.shipaid-prompt .prompt-footer .prompt-footer-about {\n color: var(--shipaid-text-grey);\n cursor: pointer;\n text-decoration: underline;\n font-size: var(--shipaid-font-sm);\n}\n.shipaid-prompt .prompt-footer .prompt-footer-badge {\n background-color: var(--shipaid-light-grey);\n color: var(--shipaid-text);\n padding: 0.5rem 1.5rem;\n border-radius: 30px;\n cursor: pointer;\n text-decoration: none;\n font-size: var(--shipaid-font-sm);\n}\n.shipaid-prompt .prompt-footer .prompt-footer-badge .ship {\n text-transform: uppercase;\n color: var(--shipaid-secondary);\n font-weight: var(--shipaid-font-heavy);\n}\n.shipaid-prompt .prompt-footer .prompt-footer-badge .aid {\n text-transform: uppercase;\n color: var(--shipaid-text-grey);\n font-weight: var(--shipaid-font-heavy);\n}',ht([i()],t.ShipAidWidget.prototype,"_storeDomain",2),ht([i()],t.ShipAidWidget.prototype,"_store",2),ht([i()],t.ShipAidWidget.prototype,"_cart",2),ht([i()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),ht([i()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),ht([i()],t.ShipAidWidget.prototype,"_protectionProduct",2),ht([i()],t.ShipAidWidget.prototype,"_state",2),t.ShipAidWidget=ht([(t=>e=>{return"function"==typeof e?(i=t,s=e,window.customElements.define(i,s),s):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e);var i,s})("shipaid-widget")],t.ShipAidWidget),Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
178
+ `}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){try{if(!this._storeDomain)throw new Error("Missing store domain - cannot continue.");const t={store:this._storeDomain},e="query StoreByDomain($store: String!) {\n store(store: $store) {\n store\n productId\n productVariantId\n productVariantNumericId\n productPrice\n }\n }",{data:i}=await this._fetch.post("http://localhost:1337/v1/graphql",{query:e,variables:t});if(!i.store)throw new Error(`Could not find a store for ${this._storeDomain}`);if(!i.store.productVariantNumericId)throw new Error("Missing variant ID for ShipAid product.");return i.store}catch(L){throw console.error(L),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(L){throw console.error(L),new Error("Could not fetch cart for current domain.")}}hasProtection(){return this._hasProtectionInCart}async addProtection(){var t,e;try{if(null==(t=this._store)||!t.productVariantNumericId)throw new Error("Store has not been loaded.");if(null==(e=this._cart)||!e.items)throw new Error("Cart has not been loaded.");this._setState("loading");const i={id:this._store.productVariantNumericId,quantity:1},s=await this._fetch.post("/cart/add.js",i),r=M(k({},this._cart),{items:[s,...this._cart.items]});this._cart=r,this._setState("success"),this._dispatchEvent("shipaid-protection-status",{protection:!0,cart:r,lineItem:s})}catch(i){console.error(i),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}async removeProtection(){var t;try{if(null==(t=this._store)||!t.productVariantNumericId)throw new Error("Store has not been loaded.");if(!this._protectionProduct)throw new Error("Protection product not found.");this._setState("loading");const e={id:this._protectionProduct.key,quantity:0},i=await this._fetch.post("/cart/change.js",e);this._dispatchEvent("shipaid-protection-status",{protection:!1,cart:i,lineItem:this._protectionProduct}),this._cart=i,this._setState("success")}catch(e){console.error(e),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}},t.ShipAidWidget.styles=nt,ht([i()],t.ShipAidWidget.prototype,"_storeDomain",2),ht([i()],t.ShipAidWidget.prototype,"_store",2),ht([i()],t.ShipAidWidget.prototype,"_cart",2),ht([i()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),ht([i()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),ht([i()],t.ShipAidWidget.prototype,"_protectionProduct",2),ht([i()],t.ShipAidWidget.prototype,"_state",2),t.ShipAidWidget=ht([(t=>e=>{return"function"==typeof e?(i=t,s=e,window.customElements.define(i,s),s):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e);var i,s})("shipaid-widget")],t.ShipAidWidget),Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
@@ -1,9 +1,9 @@
1
- var Wt=Object.defineProperty,Vt=Object.defineProperties,Bt=Object.getOwnPropertyDescriptors,ft=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable,vt=(t,e,i)=>e in t?Wt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,M=(t,e)=>{for(var i in e||(e={}))qt.call(e,i)&&vt(t,i,e[i]);if(ft)for(var i of ft(e))Ft.call(e,i)&&vt(t,i,e[i]);return t},k=(t,e)=>Vt(t,Bt(e));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShipAidWidget={})}(this,(function(t){"use strict";
1
+ var Vt=Object.defineProperty,Bt=Object.defineProperties,qt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,Ft=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,mt=(t,e,i)=>e in t?Vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,k=(t,e)=>{for(var i in e||(e={}))Ft.call(e,i)&&mt(t,i,e[i]);if(vt)for(var i of vt(e))Jt.call(e,i)&&mt(t,i,e[i]);return t},M=(t,e)=>Bt(t,qt(e));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShipAidWidget={})}(this,(function(t){"use strict";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const e=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?k(M({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};
6
+ */const e=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?M(k({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
@@ -14,7 +14,7 @@ var Wt=Object.defineProperty,Vt=Object.defineProperties,Bt=Object.getOwnProperty
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- function i(t){return function(t){return(i,s)=>{return void 0!==s?(o=t,r=s,void i.constructor.createProperty(r,o)):e(t,i);var o,r}}(k(M({},t),{state:!0}))}
17
+ function i(t){return function(t){return(i,s)=>{return void 0!==s?(r=t,o=s,void i.constructor.createProperty(o,r)):e(t,i);var r,o}}(M(k({},t),{state:!0}))}
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2021 Google LLC
@@ -25,29 +25,128 @@ function i(t){return function(t){return(i,s)=>{return void 0!==s?(o=t,r=s,void i
25
25
  * Copyright 2019 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
27
  */
28
- const o=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new Map;class a{constructor(t,e){if(this._$cssResult$=!0,e!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=n.get(this.cssText);return o&&void 0===t&&(n.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const l=o?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new a("string"==typeof t?t:t+"",r))(e)})(t):t
28
+ const r=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),n=new Map;class a{constructor(t,e){if(this._$cssResult$=!0,e!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=n.get(this.cssText);return r&&void 0===t&&(n.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const l=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new a("string"==typeof t?t:t+"",o))(e)})(t):t
29
29
  /**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */;var h;const d=window.trustedTypes,p=d?d.emptyScript:"",c=window.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},v=(t,e)=>e!==t&&(e==e||t==t),f={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:v};class m extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Eh(i,e);void 0!==s&&(this._$Eu.set(s,i),t.push(s))})),t}static createProperty(t,e=f){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{o?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=f){var s,o;const r=this.constructor._$Eh(t,i);if(void 0!==r&&!0===i.reflect){const n=(null!==(o=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==o?o:u.toAttribute)(e,i.type);this._$Ei=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Ei=null}}_$AK(t,e){var i,s,o;const r=this.constructor,n=r._$Eu.get(t);if(void 0!==n&&this._$Ei!==n){const t=r.getPropertyOptions(n),a=t.converter,l=null!==(o=null!==(s=null===(i=a)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof a?a:null)&&void 0!==o?o:u.fromAttribute;this._$Ei=n,this[n]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
33
+ */;var h;const d=window.trustedTypes,p=d?d.emptyScript:"",c=window.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},v=(t,e)=>e!==t&&(e==e||t==t),f={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:v};class m extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Eh(i,e);void 0!==s&&(this._$Eu.set(s,i),t.push(s))})),t}static createProperty(t,e=f){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=f){var s,r;const o=this.constructor._$Eh(t,i);if(void 0!==o&&!0===i.reflect){const n=(null!==(r=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==r?r:u.toAttribute)(e,i.type);this._$Ei=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Ei=null}}_$AK(t,e){var i,s,r;const o=this.constructor,n=o._$Eu.get(t);if(void 0!==n&&this._$Ei!==n){const t=o.getPropertyOptions(n),a=t.converter,l=null!==(r=null!==(s=null===(i=a)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof a?a:null)&&void 0!==r?r:u.fromAttribute;this._$Ei=n,this[n]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
34
34
  /**
35
35
  * @license
36
36
  * Copyright 2017 Google LLC
37
37
  * SPDX-License-Identifier: BSD-3-Clause
38
38
  */
39
- var _;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:m}),(null!==(h=globalThis.reactiveElementVersions)&&void 0!==h?h:globalThis.reactiveElementVersions=[]).push("1.3.0");const g=globalThis.trustedTypes,y=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,A="?"+$,b=`<${A}>`,w=document,S=(t="")=>w.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,U=/>/g,T=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,O=/'/g,N=/"/g,H=/^(?:script|style|textarea|title)$/i,I=(L=1,(t,...e)=>({_$litType$:L,strings:t,values:e})),D=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),j=new WeakMap,z=w.createTreeWalker(w,129,null,!1);var L;class W{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const n=t.length-1,a=this.parts,[l,h]=((t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"<svg>":"",n=P;for(let l=0;l<i;l++){const e=t[l];let i,a,h=-1,d=0;for(;d<e.length&&(n.lastIndex=d,a=n.exec(e),null!==a);)d=n.lastIndex,n===P?"!--"===a[1]?n=C:void 0!==a[1]?n=U:void 0!==a[2]?(H.test(a[2])&&(o=RegExp("</"+a[2],"g")),n=T):void 0!==a[3]&&(n=T):n===T?">"===a[0]?(n=null!=o?o:P,h=-1):void 0===a[1]?h=-2:(h=n.lastIndex-a[2].length,i=a[1],n=void 0===a[3]?T:'"'===a[3]?N:O):n===N||n===O?n=T:n===C||n===U?n=P:(n=T,o=void 0);const p=n===T&&t[l+1].startsWith("/>")?" ":"";r+=n===P?e+b:h>=0?(s.push(i),e.slice(0,h)+"$lit$"+e.slice(h)+$+p):e+$+(-2===h?(s.push(void 0),l):p)}const a=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==y?y.createHTML(a):a,s]})(t,e);if(this.el=W.createElement(l,i),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=z.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith($)){const i=h[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split($),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?J:"?"===e[1]?Z:"@"===e[1]?G:F})}else a.push({type:6,index:o})}for(const e of t)s.removeAttribute(e)}if(H.test(s.tagName)){const t=s.textContent.split($),e=t.length-1;if(e>0){s.textContent=g?g.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],S()),z.nextNode(),a.push({type:2,index:++o});s.append(t[e],S())}}}else if(8===s.nodeType)if(s.data===A)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf($,t+1));)a.push({type:7,index:o}),t+=$.length-1}o++}}static createElement(t,e){const i=w.createElement("template");return i.innerHTML=t,i}}function B(t,e,i=t,s){var o,r,n,a;if(e===D)return e;let l=void 0!==s?null===(o=i._$Cl)||void 0===o?void 0:o[s]:i._$Cu;const h=E(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(r=null==l?void 0:l._$AO)||void 0===r||r.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,s)),void 0!==s?(null!==(n=(a=i)._$Cl)&&void 0!==n?n:a._$Cl=[])[s]=l:i._$Cu=l),void 0!==l&&(e=B(t,l._$AS(t,e.values),l,s)),e}class V{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:w).importNode(i,!0);z.currentNode=o;let r=z.nextNode(),n=0,a=0,l=s[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new q(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new Q(r,this,t)),this.v.push(e),l=s[++a]}n!==(null==l?void 0:l.index)&&(r=z.nextNode(),n++)}return o}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class q{constructor(t,e,i,s){var o;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=null===(o=null==s?void 0:s.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=B(this,t,e),E(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==D&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return x(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==R&&E(this._$AH)?this._$AA.nextSibling.data=t:this.k(w.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=W.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(i);else{const t=new V(o,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=j.get(t.strings);return void 0===e&&j.set(t.strings,e=new W(t)),e}S(t){x(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new q(this.A(S()),this.A(S()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class F{constructor(t,e,i,s,o){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(void 0===o)t=B(this,t,e,0),r=!E(t)||t!==this._$AH&&t!==D,r&&(this._$AH=t);else{const s=t;let n,a;for(t=o[0],n=0;n<o.length-1;n++)a=B(this,s[i+n],e,n),a===D&&(a=this._$AH[n]),r||(r=!E(a)||a!==this._$AH[n]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+o[n+1]),this._$AH[n]=a}r&&!s&&this.C(t)}C(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class J extends F{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===R?void 0:t}}const K=g?g.emptyScript:"";class Z extends F{constructor(){super(...arguments),this.type=4}C(t){t&&t!==R?this.element.setAttribute(this.name,K):this.element.removeAttribute(this.name)}}class G extends F{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=B(this,t,e,0))&&void 0!==i?i:R)===D)return;const s=this._$AH,o=t===R&&s!==R||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==R&&(s===R||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const X=window.litHtmlPolyfillSupport;
39
+ var _;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:m}),(null!==(h=globalThis.reactiveElementVersions)&&void 0!==h?h:globalThis.reactiveElementVersions=[]).push("1.3.0");const g=globalThis.trustedTypes,y=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,A="?"+$,b=`<${A}>`,w=document,S=(t="")=>w.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,U=/>/g,T=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,O=/'/g,N=/"/g,H=/^(?:script|style|textarea|title)$/i,I=(L=1,(t,...e)=>({_$litType$:L,strings:t,values:e})),R=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),j=new WeakMap,z=w.createTreeWalker(w,129,null,!1);var L;class V{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const n=t.length-1,a=this.parts,[l,h]=((t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"<svg>":"",n=C;for(let l=0;l<i;l++){const e=t[l];let i,a,h=-1,d=0;for(;d<e.length&&(n.lastIndex=d,a=n.exec(e),null!==a);)d=n.lastIndex,n===C?"!--"===a[1]?n=P:void 0!==a[1]?n=U:void 0!==a[2]?(H.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=T):void 0!==a[3]&&(n=T):n===T?">"===a[0]?(n=null!=r?r:C,h=-1):void 0===a[1]?h=-2:(h=n.lastIndex-a[2].length,i=a[1],n=void 0===a[3]?T:'"'===a[3]?N:O):n===N||n===O?n=T:n===P||n===U?n=C:(n=T,r=void 0);const p=n===T&&t[l+1].startsWith("/>")?" ":"";o+=n===C?e+b:h>=0?(s.push(i),e.slice(0,h)+"$lit$"+e.slice(h)+$+p):e+$+(-2===h?(s.push(void 0),l):p)}const a=o+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==y?y.createHTML(a):a,s]})(t,e);if(this.el=V.createElement(l,i),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=z.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith($)){const i=h[o++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split($),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?J:"?"===e[1]?Z:"@"===e[1]?G:F})}else a.push({type:6,index:r})}for(const e of t)s.removeAttribute(e)}if(H.test(s.tagName)){const t=s.textContent.split($),e=t.length-1;if(e>0){s.textContent=g?g.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],S()),z.nextNode(),a.push({type:2,index:++r});s.append(t[e],S())}}}else if(8===s.nodeType)if(s.data===A)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf($,t+1));)a.push({type:7,index:r}),t+=$.length-1}r++}}static createElement(t,e){const i=w.createElement("template");return i.innerHTML=t,i}}function W(t,e,i=t,s){var r,o,n,a;if(e===R)return e;let l=void 0!==s?null===(r=i._$Cl)||void 0===r?void 0:r[s]:i._$Cu;const h=E(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(o=null==l?void 0:l._$AO)||void 0===o||o.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,s)),void 0!==s?(null!==(n=(a=i)._$Cl)&&void 0!==n?n:a._$Cl=[])[s]=l:i._$Cu=l),void 0!==l&&(e=W(t,l._$AS(t,e.values),l,s)),e}class B{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:w).importNode(i,!0);z.currentNode=r;let o=z.nextNode(),n=0,a=0,l=s[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new q(o,o.nextSibling,this,t):1===l.type?e=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(e=new Q(o,this,t)),this.v.push(e),l=s[++a]}n!==(null==l?void 0:l.index)&&(o=z.nextNode(),n++)}return r}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class q{constructor(t,e,i,s){var r;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=null===(r=null==s?void 0:s.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=W(this,t,e),E(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==R&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return x(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==D&&E(this._$AH)?this._$AA.nextSibling.data=t:this.k(w.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,r="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=V.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.m(i);else{const t=new B(r,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=j.get(t.strings);return void 0===e&&j.set(t.strings,e=new V(t)),e}S(t){x(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new q(this.A(S()),this.A(S()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class F{constructor(t,e,i,s,r){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=W(this,t,e,0),o=!E(t)||t!==this._$AH&&t!==R,o&&(this._$AH=t);else{const s=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=W(this,s[i+n],e,n),a===R&&(a=this._$AH[n]),o||(o=!E(a)||a!==this._$AH[n]),a===D?t=D:t!==D&&(t+=(null!=a?a:"")+r[n+1]),this._$AH[n]=a}o&&!s&&this.C(t)}C(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class J extends F{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===D?void 0:t}}const K=g?g.emptyScript:"";class Z extends F{constructor(){super(...arguments),this.type=4}C(t){t&&t!==D?this.element.setAttribute(this.name,K):this.element.removeAttribute(this.name)}}class G extends F{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=W(this,t,e,0))&&void 0!==i?i:D)===R)return;const s=this._$AH,r=t===D&&s!==D||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==D&&(s===D||r);r&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){W(this,t)}}const X=window.litHtmlPolyfillSupport;
40
40
  /**
41
41
  * @license
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
44
  */
45
- var Y,tt;null==X||X(W,q),(null!==(_=globalThis.litHtmlVersions)&&void 0!==_?_:globalThis.litHtmlVersions=[]).push("2.2.0");class et extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,i)=>{var s,o;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let n=r._$litPart$;if(void 0===n){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;r._$litPart$=n=new q(e.insertBefore(S(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return D}}et.finalized=!0,et._$litElement$=!0,null===(Y=globalThis.litElementHydrateSupport)||void 0===Y||Y.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.0");const st="__registered_effects";function ot(t){const e=t;if(e[st])return e;const i=function(t){if(!t.dispatchEvent||!t.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return t}(t),s=i.updated;return e[st]={index:0,count:0,effects:[]},i.updated=t=>(e[st].index=0,s(t)),e}function rt(t,e,i){const s=function(t,e){const i=ot(t),{index:s,count:o}=i[st];return s===o?(i[st].index++,i[st].count++,i[st].effects.push(e),e):(i[st].index++,i[st].effects[s])}(t,{on:e,observe:["__initial__dirty"]});s.observe.some(((t,e)=>i[e]!==t))&&s.on(),s.observe=i}var nt=Object.defineProperty,at=Object.getOwnPropertyDescriptor,lt=(t,e,i,s)=>{for(var o,r=s>1?void 0:s?at(e,i):e,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(s?o(e,i,r):o(r))||r);return s&&r&&nt(e,i,r),r},ht=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(ht||{});const dt=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}};t.ShipAidWidget=class extends et{constructor(){var t;super(...arguments),this._storeDomain=null==(t=window.Shopify)?void 0:t.shop,this._hasFinishedSetup=!1,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._fetch={get:t=>dt(t),post:(t,e)=>dt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}render(){var t,e;((t,e)=>{rt(t,e,[]);
45
+ var Y,tt;null==X||X(V,q),(null!==(_=globalThis.litHtmlVersions)&&void 0!==_?_:globalThis.litHtmlVersions=[]).push("2.2.0");class et extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,i)=>{var s,r;const o=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let n=o._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new q(e.insertBefore(S(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return R}}et.finalized=!0,et._$litElement$=!0,null===(Y=globalThis.litElementHydrateSupport)||void 0===Y||Y.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.0");const st="__registered_effects";function rt(t){const e=t;if(e[st])return e;const i=function(t){if(!t.dispatchEvent||!t.requestUpdate)throw new Error("Element missing required functions (dispatchEvent/requestUpdate)");return t}(t),s=i.updated;return e[st]={index:0,count:0,effects:[]},i.updated=t=>(e[st].index=0,s(t)),e}function ot(t,e,i){const s=function(t,e){const i=rt(t),{index:s,count:r}=i[st];return s===r?(i[st].index++,i[st].count++,i[st].effects.push(e),e):(i[st].index++,i[st].effects[s])}(t,{on:e,observe:["__initial__dirty"]});s.observe.some(((t,e)=>i[e]!==t))&&s.on(),s.observe=i}var nt=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new a(i,o)})`
46
+ .shipaid-prompt {
47
+ --shipaid-primary: #002bd6;
48
+ --shipaid-secondary: #0076ff;
49
+ --shipaid-text: #000000;
50
+ --shipaid-text-muted: #cccccc;
51
+ --shipaid-text-grey: #aaaaaa;
52
+ --shipaid-light-grey: #ebecf0;
53
+ --shipaid-font: 'Lato', sans-serif;
54
+ --shipaid-font-sm: 14px;
55
+ --shipaid-font-base: 16px;
56
+ --shipaid-font-lg: 18px;
57
+ --shipaid-font-regular: 400;
58
+ --shipaid-font-heavy: 700;
59
+
60
+ width: 400px;
61
+ font-family: var(--shipaid-font);
62
+ font-size: var(--shipaid-font-base);
63
+ color: var(--shipaid-text);
64
+ display: flex;
65
+ flex-direction: column;
66
+ gap: 1rem;
67
+ margin: 2rem 0 2rem auto;
68
+ }
69
+ .shipaid-prompt p, .shipaid-prompt a {
70
+ margin: 0;
71
+ line-height: 1;
72
+ }
73
+ .shipaid-prompt .prompt-title {
74
+ text-align: center;
75
+ font-size: var(--shipaid-font-lg);
76
+ font-weight: var(--shipaid-font-heavy);
77
+ }
78
+ .shipaid-prompt .prompt-product {
79
+ display: flex;
80
+ flex-direction: row;
81
+ gap: 2rem;
82
+ height: 55px;
83
+ margin-top: 1rem;
84
+ }
85
+ .shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-title {
86
+ font-size: var(--shipaid-font-base);
87
+ font-weight: var(--shipaid-font-heavy);
88
+ }
89
+ .shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-description {
90
+ font-size: var(--shipaid-font-sm);
91
+ margin-top: 1rem;
92
+ }
93
+ .shipaid-prompt .prompt-product .prompt-product-actions {
94
+ margin-left: auto;
95
+ display: flex;
96
+ flex-direction: column;
97
+ justify-content: space-between;
98
+ text-align: right;
99
+ }
100
+ .shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-price {
101
+ color: var(--shipaid-text-muted);
102
+ font-size: var(--shipaid-font-base);
103
+ }
104
+ .shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-button {
105
+ background-color: transparent;
106
+ border: none;
107
+ color: var(--shipaid-primary);
108
+ text-transform: uppercase;
109
+ font-weight: var(--shipaid-font-heavy);
110
+ cursor: pointer;
111
+ }
112
+ .shipaid-prompt .prompt-footer {
113
+ display: flex;
114
+ flex-direction: row;
115
+ justify-content: space-between;
116
+ align-items: center;
117
+ margin-top: 1rem;
118
+ }
119
+ .shipaid-prompt .prompt-footer .prompt-footer-about {
120
+ color: var(--shipaid-text-grey);
121
+ cursor: pointer;
122
+ text-decoration: underline;
123
+ font-size: var(--shipaid-font-sm);
124
+ }
125
+ .shipaid-prompt .prompt-footer .prompt-footer-badge {
126
+ background-color: var(--shipaid-light-grey);
127
+ color: var(--shipaid-text);
128
+ padding: 0.5rem 1.5rem;
129
+ border-radius: 30px;
130
+ cursor: pointer;
131
+ text-decoration: none;
132
+ font-size: var(--shipaid-font-sm);
133
+ }
134
+ .shipaid-prompt .prompt-footer .prompt-footer-badge .ship {
135
+ text-transform: uppercase;
136
+ color: var(--shipaid-secondary);
137
+ font-weight: var(--shipaid-font-heavy);
138
+ }
139
+ .shipaid-prompt .prompt-footer .prompt-footer-badge .aid {
140
+ text-transform: uppercase;
141
+ color: var(--shipaid-text-grey);
142
+ font-weight: var(--shipaid-font-heavy);
143
+ }
144
+ `,at=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,ht=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?lt(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&at(e,i,o),o},dt=(t=>(t.LOADED="shipaid-loaded",t.STATUS_UPDATE="shipaid-protection-status",t))(dt||{});const pt=async(t,e)=>{try{const i=await fetch(t,e);if(!i.ok)throw new Error(await i.text());return await i.json()}catch(i){throw console.error(i),new Error("Failed to complete fetch request.")}};t.ShipAidWidget=class extends et{constructor(){var t;super(...arguments),this._storeDomain=null==(t=window.Shopify)?void 0:t.shop,this._hasFinishedSetup=!1,this._hasProtectionInCart=!1,this._state={loading:!1,success:null,error:!1},this._fetch={get:t=>pt(t),post:(t,e)=>pt(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}}render(){var t,e;((t,e)=>{ot(t,e,[]);
46
145
  /**
47
146
  * @license
48
147
  * Copyright 2021 Google LLC
49
148
  * SPDX-License-Identifier: BSD-3-Clause
50
- */})(this,(async()=>{var t,e;const[i,s]=await Promise.all([this._fetchShipAidData(),this._fetchCart()]);this._store=i,this._cart=s;const o=null!=(e=null==(t=s.items)?void 0:t.some((t=>t.variant_id===i.productVariantNumericId)))&&e;this._hasProtectionInCart=o,this._hasFinishedSetup=!0,this._dispatchEvent("shipaid-loaded",i)})),rt(this,(()=>{var t,e,i,s;if(null==(t=this._cart)||!t.items)return;const o=null==(i=null==(e=this._cart)?void 0:e.items)?void 0:i.findIndex((t=>{var e;return t.variant_id===(null==(e=this._store)?void 0:e.productVariantNumericId)})),r=null==(s=this._cart)?void 0:s.items[o];this._hasProtectionInCart=!!r,r&&(this._protectionProduct=k(M({},r),{index:o,position:o+1}))}),[this._store,this._cart]);const i=I`
149
+ */})(this,(async()=>{var t,e;const[i,s]=await Promise.all([this._fetchShipAidData(),this._fetchCart()]);this._store=i,this._cart=s;const r=null!=(e=null==(t=s.items)?void 0:t.some((t=>t.variant_id===i.productVariantNumericId)))&&e;this._hasProtectionInCart=r,this._hasFinishedSetup=!0,this._dispatchEvent("shipaid-loaded",i)})),ot(this,(()=>{var t,e,i,s;if(null==(t=this._cart)||!t.items)return;const r=null==(i=null==(e=this._cart)?void 0:e.items)?void 0:i.findIndex((t=>{var e;return t.variant_id===(null==(e=this._store)?void 0:e.productVariantNumericId)})),o=null==(s=this._cart)?void 0:s.items[r];this._hasProtectionInCart=!!o,o&&(this._protectionProduct=M(k({},o),{index:r,position:r+1}))}),[this._store,this._cart]);const i=I`
51
150
  <div class="shipaid-prompt">
52
151
  <p class="prompt-title">${this._hasProtectionInCart?"Active":"Inactive"}</p>
53
152
  <div class="prompt-product">
@@ -59,7 +158,7 @@ var Y,tt;null==X||X(W,q),(null!==(_=globalThis.litHtmlVersions)&&void 0!==_?_:gl
59
158
  <p class="prompt-product-details-description">Resolve shipping issues care-free</p>
60
159
  </div>
61
160
  <div class="prompt-product-actions">
62
- <p class="prompt-product-actions-price">${(t=>{var e,i,s,o,r;return new Intl.NumberFormat(null!=(i=null==(e=window.Shopify)?void 0:e.locale)?i:void 0,{currency:null!=(r=null==(o=null==(s=window.Shopify)?void 0:s.currency)?void 0:o.active)?r:"USD",style:"currency"}).format(t)})(null!=(e=null==(t=this._store)?void 0:t.productPrice)?e:0)}</p>
161
+ <p class="prompt-product-actions-price">${(t=>{var e,i,s,r,o;return new Intl.NumberFormat(null!=(i=null==(e=window.Shopify)?void 0:e.locale)?i:void 0,{currency:null!=(o=null==(r=null==(s=window.Shopify)?void 0:s.currency)?void 0:r.active)?o:"USD",style:"currency"}).format(t)})(null!=(e=null==(t=this._store)?void 0:t.productPrice)?e:0)}</p>
63
162
  <button class="prompt-product-actions-button" @click=${this._updateProtection} ?disabled=${this._state.loading}>
64
163
  ${this._state.loading?"Loading...":this._hasProtectionInCart?"Remove":"+ Add"}
65
164
  </button>
@@ -76,4 +175,4 @@ var Y,tt;null==X||X(W,q),(null!==(_=globalThis.litHtmlVersions)&&void 0!==_?_:gl
76
175
  </div>
77
176
  `;return I`
78
177
  ${function(t,e,i){return t?e():null==i?void 0:i()}(this._hasFinishedSetup&&this._store,(()=>i),(()=>I`<p>Loading...</p>`))}
79
- `}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){try{if(!this._storeDomain)throw new Error("Missing store domain - cannot continue.");const t={store:this._storeDomain},e="query StoreByDomain($store: String!) {\n store(store: $store) {\n store\n productId\n productVariantId\n productVariantNumericId\n productPrice\n }\n }",{data:i}=await this._fetch.post("http://localhost:1337/v1/graphql",{query:e,variables:t});if(!i.store)throw new Error(`Could not find a store for ${this._storeDomain}`);if(!i.store.productVariantNumericId)throw new Error("Missing variant ID for ShipAid product.");return i.store}catch(L){throw console.error(L),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(L){throw console.error(L),new Error("Could not fetch cart for current domain.")}}hasProtection(){return this._hasProtectionInCart}async addProtection(){var t,e;try{if(null==(t=this._store)||!t.productVariantNumericId)throw new Error("Store has not been loaded.");if(null==(e=this._cart)||!e.items)throw new Error("Cart has not been loaded.");this._setState("loading");const i={id:this._store.productVariantNumericId,quantity:1},s=await this._fetch.post("/cart/add.js",i),o=k(M({},this._cart),{items:[s,...this._cart.items]});this._cart=o,this._setState("success"),this._dispatchEvent("shipaid-protection-status",{protection:!0,cart:o,lineItem:s})}catch(i){console.error(i),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}async removeProtection(){var t;try{if(null==(t=this._store)||!t.productVariantNumericId)throw new Error("Store has not been loaded.");if(!this._protectionProduct)throw new Error("Protection product not found.");this._setState("loading");const e={id:this._protectionProduct.key,quantity:0},i=await this._fetch.post("/cart/change.js",e);this._dispatchEvent("shipaid-protection-status",{protection:!1,cart:i,lineItem:this._protectionProduct}),this._cart=i,this._setState("success")}catch(e){console.error(e),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}},t.ShipAidWidget.styles='.shipaid-prompt {\n --shipaid-primary: #002bd6;\n --shipaid-secondary: #0076ff;\n --shipaid-text: #000000;\n --shipaid-text-muted: #cccccc;\n --shipaid-text-grey: #aaaaaa;\n --shipaid-light-grey: #ebecf0;\n --shipaid-font: "Lato", sans-serif;\n --shipaid-font-sm: 14px;\n --shipaid-font-base: 16px;\n --shipaid-font-lg: 18px;\n --shipaid-font-regular: 400;\n --shipaid-font-heavy: 700;\n width: 400px;\n font-family: var(--shipaid-font);\n font-size: var(--shipaid-font-base);\n color: var(--shipaid-text);\n display: flex;\n flex-direction: column;\n gap: 1rem;\n margin: 2rem 0 2rem auto;\n}\n.shipaid-prompt p, .shipaid-prompt a {\n margin: 0;\n line-height: 1;\n}\n.shipaid-prompt .prompt-title {\n text-align: center;\n font-size: var(--shipaid-font-lg);\n font-weight: var(--shipaid-font-heavy);\n}\n.shipaid-prompt .prompt-product {\n display: flex;\n flex-direction: row;\n gap: 2rem;\n height: 55px;\n margin-top: 1rem;\n}\n.shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-title {\n font-size: var(--shipaid-font-base);\n font-weight: var(--shipaid-font-heavy);\n}\n.shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-description {\n font-size: var(--shipaid-font-sm);\n margin-top: 1rem;\n}\n.shipaid-prompt .prompt-product .prompt-product-actions {\n margin-left: auto;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n text-align: right;\n}\n.shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-price {\n color: var(--shipaid-text-muted);\n font-size: var(--shipaid-font-base);\n}\n.shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-button {\n background-color: transparent;\n border: none;\n color: var(--shipaid-primary);\n text-transform: uppercase;\n font-weight: var(--shipaid-font-heavy);\n cursor: pointer;\n}\n.shipaid-prompt .prompt-footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: 1rem;\n}\n.shipaid-prompt .prompt-footer .prompt-footer-about {\n color: var(--shipaid-text-grey);\n cursor: pointer;\n text-decoration: underline;\n font-size: var(--shipaid-font-sm);\n}\n.shipaid-prompt .prompt-footer .prompt-footer-badge {\n background-color: var(--shipaid-light-grey);\n color: var(--shipaid-text);\n padding: 0.5rem 1.5rem;\n border-radius: 30px;\n cursor: pointer;\n text-decoration: none;\n font-size: var(--shipaid-font-sm);\n}\n.shipaid-prompt .prompt-footer .prompt-footer-badge .ship {\n text-transform: uppercase;\n color: var(--shipaid-secondary);\n font-weight: var(--shipaid-font-heavy);\n}\n.shipaid-prompt .prompt-footer .prompt-footer-badge .aid {\n text-transform: uppercase;\n color: var(--shipaid-text-grey);\n font-weight: var(--shipaid-font-heavy);\n}',lt([i()],t.ShipAidWidget.prototype,"_storeDomain",2),lt([i()],t.ShipAidWidget.prototype,"_store",2),lt([i()],t.ShipAidWidget.prototype,"_cart",2),lt([i()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),lt([i()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),lt([i()],t.ShipAidWidget.prototype,"_protectionProduct",2),lt([i()],t.ShipAidWidget.prototype,"_state",2),t.ShipAidWidget=lt([(t=>e=>{return"function"==typeof e?(i=t,s=e,window.customElements.define(i,s),s):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e);var i,s})("shipaid-widget")],t.ShipAidWidget),Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
178
+ `}_dispatchEvent(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}_setState(t,e){this._state={loading:"loading"===t,success:"success"===t,error:"error"===t&&(e||!0)}}async _updateProtection(){return this._hasProtectionInCart?this.removeProtection():this.addProtection()}async _fetchShipAidData(){try{if(!this._storeDomain)throw new Error("Missing store domain - cannot continue.");const t={store:this._storeDomain},e="query StoreByDomain($store: String!) {\n store(store: $store) {\n store\n productId\n productVariantId\n productVariantNumericId\n productPrice\n }\n }",{data:i}=await this._fetch.post("http://localhost:1337/v1/graphql",{query:e,variables:t});if(!i.store)throw new Error(`Could not find a store for ${this._storeDomain}`);if(!i.store.productVariantNumericId)throw new Error("Missing variant ID for ShipAid product.");return i.store}catch(L){throw console.error(L),new Error(`Could not find a store for ${this._storeDomain}`)}}async _fetchCart(){try{return await this._fetch.get("/cart.js")}catch(L){throw console.error(L),new Error("Could not fetch cart for current domain.")}}hasProtection(){return this._hasProtectionInCart}async addProtection(){var t,e;try{if(null==(t=this._store)||!t.productVariantNumericId)throw new Error("Store has not been loaded.");if(null==(e=this._cart)||!e.items)throw new Error("Cart has not been loaded.");this._setState("loading");const i={id:this._store.productVariantNumericId,quantity:1},s=await this._fetch.post("/cart/add.js",i),r=M(k({},this._cart),{items:[s,...this._cart.items]});this._cart=r,this._setState("success"),this._dispatchEvent("shipaid-protection-status",{protection:!0,cart:r,lineItem:s})}catch(i){console.error(i),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}async removeProtection(){var t;try{if(null==(t=this._store)||!t.productVariantNumericId)throw new Error("Store has not been loaded.");if(!this._protectionProduct)throw new Error("Protection product not found.");this._setState("loading");const e={id:this._protectionProduct.key,quantity:0},i=await this._fetch.post("/cart/change.js",e);this._dispatchEvent("shipaid-protection-status",{protection:!1,cart:i,lineItem:this._protectionProduct}),this._cart=i,this._setState("success")}catch(e){console.error(e),this._setState("error","Failed to add protection to cart - please try again, or contact us for help.")}}},t.ShipAidWidget.styles=nt,ht([i()],t.ShipAidWidget.prototype,"_storeDomain",2),ht([i()],t.ShipAidWidget.prototype,"_store",2),ht([i()],t.ShipAidWidget.prototype,"_cart",2),ht([i()],t.ShipAidWidget.prototype,"_hasFinishedSetup",2),ht([i()],t.ShipAidWidget.prototype,"_hasProtectionInCart",2),ht([i()],t.ShipAidWidget.prototype,"_protectionProduct",2),ht([i()],t.ShipAidWidget.prototype,"_state",2),t.ShipAidWidget=ht([(t=>e=>{return"function"==typeof e?(i=t,s=e,window.customElements.define(i,s),s):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e);var i,s})("shipaid-widget")],t.ShipAidWidget),Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui.shipaid.com",
3
3
  "private": false,
4
- "version": "0.0.3",
4
+ "version": "0.0.6",
5
5
  "main": "dist/ui.shipaid.com.umd.js",
6
6
  "unpkg": "dist/ui.shipaid.com.iife.js",
7
7
  "module": "dist/ui.shipaid.com.es.js",
@@ -34,6 +34,7 @@
34
34
  "eslint-plugin-lit-a11y": "^2.2.0",
35
35
  "eslint-plugin-node": "^11.1.0",
36
36
  "eslint-plugin-promise": "^5.2.0",
37
+ "rollup-plugin-postcss": "^4.0.2",
37
38
  "rollup-plugin-postcss-lit": "^2.0.0",
38
39
  "sass": "^1.49.9",
39
40
  "typescript": "^4.6.2",
package/dist/style.css DELETED
@@ -1 +0,0 @@
1
- .shipaid-prompt{--shipaid-primary: #002bd6;--shipaid-secondary: #0076ff;--shipaid-text: #000000;--shipaid-text-muted: #cccccc;--shipaid-text-grey: #aaaaaa;--shipaid-light-grey: #ebecf0;--shipaid-font: "Lato", sans-serif;--shipaid-font-sm: 14px;--shipaid-font-base: 16px;--shipaid-font-lg: 18px;--shipaid-font-regular: 400;--shipaid-font-heavy: 700;width:400px;font-family:var(--shipaid-font);font-size:var(--shipaid-font-base);color:var(--shipaid-text);display:flex;flex-direction:column;gap:1rem;margin:2rem 0 2rem auto}.shipaid-prompt p,.shipaid-prompt a{margin:0;line-height:1}.shipaid-prompt .prompt-title{text-align:center;font-size:var(--shipaid-font-lg);font-weight:var(--shipaid-font-heavy)}.shipaid-prompt .prompt-product{display:flex;flex-direction:row;gap:2rem;height:55px;margin-top:1rem}.shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-title{font-size:var(--shipaid-font-base);font-weight:var(--shipaid-font-heavy)}.shipaid-prompt .prompt-product .prompt-product-details .prompt-product-details-description{font-size:var(--shipaid-font-sm);margin-top:1rem}.shipaid-prompt .prompt-product .prompt-product-actions{margin-left:auto;display:flex;flex-direction:column;justify-content:space-between;text-align:right}.shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-price{color:var(--shipaid-text-muted);font-size:var(--shipaid-font-base)}.shipaid-prompt .prompt-product .prompt-product-actions .prompt-product-actions-button{background-color:transparent;border:none;color:var(--shipaid-primary);text-transform:uppercase;font-weight:var(--shipaid-font-heavy);cursor:pointer}.shipaid-prompt .prompt-footer{display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin-top:1rem}.shipaid-prompt .prompt-footer .prompt-footer-about{color:var(--shipaid-text-grey);cursor:pointer;text-decoration:underline;font-size:var(--shipaid-font-sm)}.shipaid-prompt .prompt-footer .prompt-footer-badge{background-color:var(--shipaid-light-grey);color:var(--shipaid-text);padding:.5rem 1.5rem;border-radius:30px;cursor:pointer;text-decoration:none;font-size:var(--shipaid-font-sm)}.shipaid-prompt .prompt-footer .prompt-footer-badge .ship{text-transform:uppercase;color:var(--shipaid-secondary);font-weight:var(--shipaid-font-heavy)}.shipaid-prompt .prompt-footer .prompt-footer-badge .aid{text-transform:uppercase;color:var(--shipaid-text-grey);font-weight:var(--shipaid-font-heavy)}