ui.shipaid.com 0.2.12 → 0.2.13-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/widget.es.js CHANGED
@@ -311,16 +311,7 @@ const i = window, s$1 = i.trustedTypes, e = s$1 ? s$1.createPolicy("lit-html", {
311
311
  \f\r](?:([^\\s"'>=/]+)([
312
312
  \f\r]*=[
313
313
  \f\r]*(?:[^
314
- \f\r"'\`<>=]|("|')|))|$)`, "g"), m = /'/g, p = /"/g, $ = /^(?:script|style|textarea|title)$/i, g = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), y = g(1), x = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), T = /* @__PURE__ */ new WeakMap(), A = (t2, i2, s2) => {
315
- var e2, o2;
316
- const n2 = null !== (e2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== e2 ? e2 : i2;
317
- let l2 = n2._$litPart$;
318
- if (void 0 === l2) {
319
- const t3 = null !== (o2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== o2 ? o2 : null;
320
- n2._$litPart$ = l2 = new S(i2.insertBefore(r(), t3), t3, void 0, null != s2 ? s2 : {});
321
- }
322
- return l2._$AI(t2), l2;
323
- }, E = h.createTreeWalker(h, 129, null, false), C = (t2, i2) => {
314
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), m = /'/g, p = /"/g, $ = /^(?:script|style|textarea|title)$/i, g = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), y = g(1), x = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), T = /* @__PURE__ */ new WeakMap(), A = h.createTreeWalker(h, 129, null, false), E = (t2, i2) => {
324
315
  const s2 = t2.length - 1, n2 = [];
325
316
  let h2, r2 = 2 === i2 ? "<svg>" : "", d2 = v;
326
317
  for (let i3 = 0; i3 < s2; i3++) {
@@ -336,17 +327,17 @@ const i = window, s$1 = i.trustedTypes, e = s$1 ? s$1.createPolicy("lit-html", {
336
327
  throw Error("invalid template strings array");
337
328
  return [void 0 !== e ? e.createHTML(u2) : u2, n2];
338
329
  };
339
- class P {
330
+ class C {
340
331
  constructor({ strings: t2, _$litType$: i2 }, e2) {
341
332
  let l2;
342
333
  this.parts = [];
343
334
  let h2 = 0, d2 = 0;
344
- const u2 = t2.length - 1, c2 = this.parts, [v2, a2] = C(t2, i2);
345
- if (this.el = P.createElement(v2, e2), E.currentNode = this.el.content, 2 === i2) {
335
+ const u2 = t2.length - 1, c2 = this.parts, [v2, a2] = E(t2, i2);
336
+ if (this.el = C.createElement(v2, e2), A.currentNode = this.el.content, 2 === i2) {
346
337
  const t3 = this.el.content, i3 = t3.firstChild;
347
338
  i3.remove(), t3.append(...i3.childNodes);
348
339
  }
349
- for (; null !== (l2 = E.nextNode()) && c2.length < u2; ) {
340
+ for (; null !== (l2 = A.nextNode()) && c2.length < u2; ) {
350
341
  if (1 === l2.nodeType) {
351
342
  if (l2.hasAttributes()) {
352
343
  const t3 = [];
@@ -355,7 +346,7 @@ class P {
355
346
  const s2 = a2[d2++];
356
347
  if (t3.push(i3), void 0 !== s2) {
357
348
  const t4 = l2.getAttribute(s2.toLowerCase() + "$lit$").split(o$1), i4 = /([.?@])?(.*)/.exec(s2);
358
- c2.push({ type: 1, index: h2, name: i4[2], strings: t4, ctor: "." === i4[1] ? R : "?" === i4[1] ? H : "@" === i4[1] ? I : M });
349
+ c2.push({ type: 1, index: h2, name: i4[2], strings: t4, ctor: "." === i4[1] ? M : "?" === i4[1] ? k : "@" === i4[1] ? H : S });
359
350
  } else
360
351
  c2.push({ type: 6, index: h2 });
361
352
  }
@@ -367,7 +358,7 @@ class P {
367
358
  if (i3 > 0) {
368
359
  l2.textContent = s$1 ? s$1.emptyScript : "";
369
360
  for (let s2 = 0; s2 < i3; s2++)
370
- l2.append(t3[s2], r()), E.nextNode(), c2.push({ type: 2, index: ++h2 });
361
+ l2.append(t3[s2], r()), A.nextNode(), c2.push({ type: 2, index: ++h2 });
371
362
  l2.append(t3[i3], r());
372
363
  }
373
364
  }
@@ -387,17 +378,17 @@ class P {
387
378
  return s2.innerHTML = t2, s2;
388
379
  }
389
380
  }
390
- function V(t2, i2, s2 = t2, e2) {
381
+ function P(t2, i2, s2 = t2, e2) {
391
382
  var o2, n2, l2, h2;
392
383
  if (i2 === x)
393
384
  return i2;
394
- let r2 = void 0 !== e2 ? null === (o2 = s2._$Cl) || void 0 === o2 ? void 0 : o2[e2] : s2._$Cu;
385
+ let r2 = void 0 !== e2 ? null === (o2 = s2._$Co) || void 0 === o2 ? void 0 : o2[e2] : s2._$Cl;
395
386
  const u2 = d(i2) ? void 0 : i2._$litDirective$;
396
- return (null == r2 ? void 0 : r2.constructor) !== u2 && (null === (n2 = null == r2 ? void 0 : r2._$AO) || void 0 === n2 || n2.call(r2, false), void 0 === u2 ? r2 = void 0 : (r2 = new u2(t2), r2._$AT(t2, s2, e2)), void 0 !== e2 ? (null !== (l2 = (h2 = s2)._$Cl) && void 0 !== l2 ? l2 : h2._$Cl = [])[e2] = r2 : s2._$Cu = r2), void 0 !== r2 && (i2 = V(t2, r2._$AS(t2, i2.values), r2, e2)), i2;
387
+ return (null == r2 ? void 0 : r2.constructor) !== u2 && (null === (n2 = null == r2 ? void 0 : r2._$AO) || void 0 === n2 || n2.call(r2, false), void 0 === u2 ? r2 = void 0 : (r2 = new u2(t2), r2._$AT(t2, s2, e2)), void 0 !== e2 ? (null !== (l2 = (h2 = s2)._$Co) && void 0 !== l2 ? l2 : h2._$Co = [])[e2] = r2 : s2._$Cl = r2), void 0 !== r2 && (i2 = P(t2, r2._$AS(t2, i2.values), r2, e2)), i2;
397
388
  }
398
- class N {
389
+ class V {
399
390
  constructor(t2, i2) {
400
- this.v = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2;
391
+ this.u = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2;
401
392
  }
402
393
  get parentNode() {
403
394
  return this._$AM.parentNode;
@@ -405,34 +396,34 @@ class N {
405
396
  get _$AU() {
406
397
  return this._$AM._$AU;
407
398
  }
408
- p(t2) {
399
+ v(t2) {
409
400
  var i2;
410
401
  const { el: { content: s2 }, parts: e2 } = this._$AD, o2 = (null !== (i2 = null == t2 ? void 0 : t2.creationScope) && void 0 !== i2 ? i2 : h).importNode(s2, true);
411
- E.currentNode = o2;
412
- let n2 = E.nextNode(), l2 = 0, r2 = 0, d2 = e2[0];
402
+ A.currentNode = o2;
403
+ let n2 = A.nextNode(), l2 = 0, r2 = 0, d2 = e2[0];
413
404
  for (; void 0 !== d2; ) {
414
405
  if (l2 === d2.index) {
415
406
  let i3;
416
- 2 === d2.type ? i3 = new S(n2, n2.nextSibling, this, t2) : 1 === d2.type ? i3 = new d2.ctor(n2, d2.name, d2.strings, this, t2) : 6 === d2.type && (i3 = new L(n2, this, t2)), this.v.push(i3), d2 = e2[++r2];
407
+ 2 === d2.type ? i3 = new N(n2, n2.nextSibling, this, t2) : 1 === d2.type ? i3 = new d2.ctor(n2, d2.name, d2.strings, this, t2) : 6 === d2.type && (i3 = new I(n2, this, t2)), this.u.push(i3), d2 = e2[++r2];
417
408
  }
418
- l2 !== (null == d2 ? void 0 : d2.index) && (n2 = E.nextNode(), l2++);
409
+ l2 !== (null == d2 ? void 0 : d2.index) && (n2 = A.nextNode(), l2++);
419
410
  }
420
411
  return o2;
421
412
  }
422
- m(t2) {
413
+ p(t2) {
423
414
  let i2 = 0;
424
- for (const s2 of this.v)
415
+ for (const s2 of this.u)
425
416
  void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++;
426
417
  }
427
418
  }
428
- class S {
419
+ class N {
429
420
  constructor(t2, i2, s2, e2) {
430
421
  var o2;
431
- this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$C_ = null === (o2 = null == e2 ? void 0 : e2.isConnected) || void 0 === o2 || o2;
422
+ this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cm = null === (o2 = null == e2 ? void 0 : e2.isConnected) || void 0 === o2 || o2;
432
423
  }
433
424
  get _$AU() {
434
425
  var t2, i2;
435
- return null !== (i2 = null === (t2 = this._$AM) || void 0 === t2 ? void 0 : t2._$AU) && void 0 !== i2 ? i2 : this._$C_;
426
+ return null !== (i2 = null === (t2 = this._$AM) || void 0 === t2 ? void 0 : t2._$AU) && void 0 !== i2 ? i2 : this._$Cm;
436
427
  }
437
428
  get parentNode() {
438
429
  let t2 = this._$AA.parentNode;
@@ -446,37 +437,37 @@ class S {
446
437
  return this._$AB;
447
438
  }
448
439
  _$AI(t2, i2 = this) {
449
- t2 = V(this, t2, i2), d(t2) ? t2 === b || null == t2 || "" === t2 ? (this._$AH !== b && this._$AR(), this._$AH = b) : t2 !== this._$AH && t2 !== x && this.$(t2) : void 0 !== t2._$litType$ ? this.T(t2) : void 0 !== t2.nodeType ? this.k(t2) : c(t2) ? this.O(t2) : this.$(t2);
440
+ t2 = P(this, t2, i2), d(t2) ? t2 === b || null == t2 || "" === t2 ? (this._$AH !== b && this._$AR(), this._$AH = b) : t2 !== this._$AH && t2 !== x && this.g(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : c(t2) ? this.k(t2) : this.g(t2);
450
441
  }
451
- S(t2, i2 = this._$AB) {
442
+ O(t2, i2 = this._$AB) {
452
443
  return this._$AA.parentNode.insertBefore(t2, i2);
453
444
  }
454
- k(t2) {
455
- this._$AH !== t2 && (this._$AR(), this._$AH = this.S(t2));
445
+ T(t2) {
446
+ this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2));
456
447
  }
457
- $(t2) {
458
- this._$AH !== b && d(this._$AH) ? this._$AA.nextSibling.data = t2 : this.k(h.createTextNode(t2)), this._$AH = t2;
448
+ g(t2) {
449
+ this._$AH !== b && d(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(h.createTextNode(t2)), this._$AH = t2;
459
450
  }
460
- T(t2) {
451
+ $(t2) {
461
452
  var i2;
462
- const { values: s2, _$litType$: e2 } = t2, o2 = "number" == typeof e2 ? this._$AC(t2) : (void 0 === e2.el && (e2.el = P.createElement(e2.h, this.options)), e2);
453
+ const { values: s2, _$litType$: e2 } = t2, o2 = "number" == typeof e2 ? this._$AC(t2) : (void 0 === e2.el && (e2.el = C.createElement(e2.h, this.options)), e2);
463
454
  if ((null === (i2 = this._$AH) || void 0 === i2 ? void 0 : i2._$AD) === o2)
464
- this._$AH.m(s2);
455
+ this._$AH.p(s2);
465
456
  else {
466
- const t3 = new N(o2, this), i3 = t3.p(this.options);
467
- t3.m(s2), this.k(i3), this._$AH = t3;
457
+ const t3 = new V(o2, this), i3 = t3.v(this.options);
458
+ t3.p(s2), this.T(i3), this._$AH = t3;
468
459
  }
469
460
  }
470
461
  _$AC(t2) {
471
462
  let i2 = T.get(t2.strings);
472
- return void 0 === i2 && T.set(t2.strings, i2 = new P(t2)), i2;
463
+ return void 0 === i2 && T.set(t2.strings, i2 = new C(t2)), i2;
473
464
  }
474
- O(t2) {
465
+ k(t2) {
475
466
  u(this._$AH) || (this._$AH = [], this._$AR());
476
467
  const i2 = this._$AH;
477
468
  let s2, e2 = 0;
478
469
  for (const o2 of t2)
479
- e2 === i2.length ? i2.push(s2 = new S(this.S(r()), this.S(r()), this, this.options)) : s2 = i2[e2], s2._$AI(o2), e2++;
470
+ e2 === i2.length ? i2.push(s2 = new N(this.O(r()), this.O(r()), this, this.options)) : s2 = i2[e2], s2._$AI(o2), e2++;
480
471
  e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2);
481
472
  }
482
473
  _$AR(t2 = this._$AA.nextSibling, i2) {
@@ -488,10 +479,10 @@ class S {
488
479
  }
489
480
  setConnected(t2) {
490
481
  var i2;
491
- void 0 === this._$AM && (this._$C_ = t2, null === (i2 = this._$AP) || void 0 === i2 || i2.call(this, t2));
482
+ void 0 === this._$AM && (this._$Cm = t2, null === (i2 = this._$AP) || void 0 === i2 || i2.call(this, t2));
492
483
  }
493
484
  }
494
- class M {
485
+ class S {
495
486
  constructor(t2, i2, s2, e2, o2) {
496
487
  this.type = 1, this._$AH = b, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = o2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = b;
497
488
  }
@@ -505,43 +496,43 @@ class M {
505
496
  const o2 = this.strings;
506
497
  let n2 = false;
507
498
  if (void 0 === o2)
508
- t2 = V(this, t2, i2, 0), n2 = !d(t2) || t2 !== this._$AH && t2 !== x, n2 && (this._$AH = t2);
499
+ t2 = P(this, t2, i2, 0), n2 = !d(t2) || t2 !== this._$AH && t2 !== x, n2 && (this._$AH = t2);
509
500
  else {
510
501
  const e3 = t2;
511
502
  let l2, h2;
512
503
  for (t2 = o2[0], l2 = 0; l2 < o2.length - 1; l2++)
513
- h2 = V(this, e3[s2 + l2], i2, l2), h2 === x && (h2 = this._$AH[l2]), n2 || (n2 = !d(h2) || h2 !== this._$AH[l2]), h2 === b ? t2 = b : t2 !== b && (t2 += (null != h2 ? h2 : "") + o2[l2 + 1]), this._$AH[l2] = h2;
504
+ h2 = P(this, e3[s2 + l2], i2, l2), h2 === x && (h2 = this._$AH[l2]), n2 || (n2 = !d(h2) || h2 !== this._$AH[l2]), h2 === b ? t2 = b : t2 !== b && (t2 += (null != h2 ? h2 : "") + o2[l2 + 1]), this._$AH[l2] = h2;
514
505
  }
515
- n2 && !e2 && this.P(t2);
506
+ n2 && !e2 && this.j(t2);
516
507
  }
517
- P(t2) {
508
+ j(t2) {
518
509
  t2 === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, null != t2 ? t2 : "");
519
510
  }
520
511
  }
521
- class R extends M {
512
+ class M extends S {
522
513
  constructor() {
523
514
  super(...arguments), this.type = 3;
524
515
  }
525
- P(t2) {
516
+ j(t2) {
526
517
  this.element[this.name] = t2 === b ? void 0 : t2;
527
518
  }
528
519
  }
529
- const k = s$1 ? s$1.emptyScript : "";
530
- class H extends M {
520
+ const R = s$1 ? s$1.emptyScript : "";
521
+ class k extends S {
531
522
  constructor() {
532
523
  super(...arguments), this.type = 4;
533
524
  }
534
- P(t2) {
535
- t2 && t2 !== b ? this.element.setAttribute(this.name, k) : this.element.removeAttribute(this.name);
525
+ j(t2) {
526
+ t2 && t2 !== b ? this.element.setAttribute(this.name, R) : this.element.removeAttribute(this.name);
536
527
  }
537
528
  }
538
- class I extends M {
529
+ class H extends S {
539
530
  constructor(t2, i2, s2, e2, o2) {
540
531
  super(t2, i2, s2, e2, o2), this.type = 5;
541
532
  }
542
533
  _$AI(t2, i2 = this) {
543
534
  var s2;
544
- if ((t2 = null !== (s2 = V(this, t2, i2, 0)) && void 0 !== s2 ? s2 : b) === x)
535
+ if ((t2 = null !== (s2 = P(this, t2, i2, 0)) && void 0 !== s2 ? s2 : b) === x)
545
536
  return;
546
537
  const e2 = this._$AH, o2 = t2 === b && e2 !== b || t2.capture !== e2.capture || t2.once !== e2.once || t2.passive !== e2.passive, n2 = t2 !== b && (e2 === b || o2);
547
538
  o2 && this.element.removeEventListener(this.name, this, e2), n2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2;
@@ -551,7 +542,7 @@ class I extends M {
551
542
  "function" == typeof this._$AH ? this._$AH.call(null !== (s2 = null === (i2 = this.options) || void 0 === i2 ? void 0 : i2.host) && void 0 !== s2 ? s2 : this.element, t2) : this._$AH.handleEvent(t2);
552
543
  }
553
544
  }
554
- class L {
545
+ class I {
555
546
  constructor(t2, i2, s2) {
556
547
  this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2;
557
548
  }
@@ -559,11 +550,21 @@ class L {
559
550
  return this._$AM._$AU;
560
551
  }
561
552
  _$AI(t2) {
562
- V(this, t2);
553
+ P(this, t2);
563
554
  }
564
555
  }
565
- const Z = i.litHtmlPolyfillSupport;
566
- null == Z || Z(P, S), (null !== (t = i.litHtmlVersions) && void 0 !== t ? t : i.litHtmlVersions = []).push("2.3.1");
556
+ const z = i.litHtmlPolyfillSupport;
557
+ null == z || z(C, N), (null !== (t = i.litHtmlVersions) && void 0 !== t ? t : i.litHtmlVersions = []).push("2.4.0");
558
+ const Z = (t2, i2, s2) => {
559
+ var e2, o2;
560
+ const n2 = null !== (e2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== e2 ? e2 : i2;
561
+ let l2 = n2._$litPart$;
562
+ if (void 0 === l2) {
563
+ const t3 = null !== (o2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== o2 ? o2 : null;
564
+ n2._$litPart$ = l2 = new N(i2.insertBefore(r(), t3), t3, void 0, null != s2 ? s2 : {});
565
+ }
566
+ return l2._$AI(t2), l2;
567
+ };
567
568
  /**
568
569
  * @license
569
570
  * Copyright 2017 Google LLC
@@ -581,7 +582,7 @@ class s extends d$1 {
581
582
  }
582
583
  update(t2) {
583
584
  const i2 = this.render();
584
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Dt = A(i2, this.renderRoot, this.renderOptions);
585
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Dt = Z(i2, this.renderRoot, this.renderOptions);
585
586
  }
586
587
  connectedCallback() {
587
588
  var t2;
@@ -653,7 +654,7 @@ const useOnce = (element, on) => useEffect(element, on, []);
653
654
  function n(n2, o2, r2) {
654
655
  return n2 ? o2() : null == r2 ? void 0 : r2();
655
656
  }
656
- const styles = i$1`
657
+ const styles$1 = i$1`
657
658
  :host {
658
659
  --shipaid-primary: #002bd6;
659
660
  --shipaid-secondary: #0076ff;
@@ -671,17 +672,13 @@ const styles = i$1`
671
672
  --shipaid-font-heavy: 700;
672
673
  }
673
674
 
674
- * {
675
+ p, a {
675
676
  font-family: var(--shipaid-font);
677
+ font-weight: var(--shipaid-font-regular);
678
+ font-size: var(--shipaid-font-base);
679
+ color: var(--shipaid-text);
676
680
  }
677
681
 
678
- .error {
679
- color: var(--shipaid-danger);
680
- font-size: var(--shipaid-font-sm);
681
- }
682
-
683
- /* Popups */
684
-
685
682
  .shipaid-popup {
686
683
  position: fixed;
687
684
  top: 0;
@@ -690,15 +687,20 @@ const styles = i$1`
690
687
  right: 0;
691
688
  margin: auto;
692
689
  max-width: 500px;
693
- max-height: 100vh;
690
+ max-height: 80vh;
694
691
  height: fit-content;
695
- border: var(--shipaid-light-grey) 1px solid;
696
- background-color: #fff;
692
+ border: var(--shipaid-popup-border, var(--shipaid-light-grey)) 1px solid;
693
+ background-color:var(--shipaid-popup-background, #fff);
697
694
  z-index: 10000;
698
695
  overflow: auto;
699
696
  visibility: hidden;
700
697
  opacity: 0;
701
698
  transition: all 250ms ease-in-out;
699
+
700
+ display: inline-flex;
701
+ flex-direction: column;
702
+ gap: 1rem;
703
+ padding: 5rem;
702
704
  }
703
705
 
704
706
  .shipaid-popup.active {
@@ -710,24 +712,11 @@ const styles = i$1`
710
712
  .shipaid-popup {
711
713
  width: 100vw;
712
714
  height: 100vh;
713
- }
714
- }
715
-
716
- .shipaid-popup .popup {
717
- display: inline-flex;
718
- flex-direction: column;
719
- gap: 1rem;
720
- padding: 5rem;
721
- height: fit-content;
722
- }
723
-
724
- @media (max-width: 600px) {
725
- .shipaid-popup .popup {
726
715
  padding: 3rem;
727
716
  }
728
717
  }
729
718
 
730
- .popup .popup-close {
719
+ .shipaid-popup .popup-close {
731
720
  width: fit-content;
732
721
  margin-left: auto;
733
722
  background-color: transparent;
@@ -738,26 +727,30 @@ const styles = i$1`
738
727
  text-transform: uppercase;
739
728
  }
740
729
 
741
- .popup .popup-title {
730
+ .shipaid-popup .popup-title {
742
731
  font-size: clamp(1rem, 2vw + 1rem, 2.2rem);
732
+ font-weight: var(--shipaid-font-regular);
743
733
  letter-spacing: 1px;
744
734
  }
745
735
 
746
- .popup .popup-top-image {
736
+ .shipaid-popup .popup-top-image {
747
737
  margin: 0 auto;
738
+ width: 90%;
739
+ height: auto;
740
+ object-fit: contain;
748
741
  }
749
742
 
750
- .popup p {
743
+ .shipaid-popup p {
751
744
  font-size: clamp(1rem, 1vw + 1rem, 1.4rem);
752
745
  margin: 0;
753
746
  }
754
747
 
755
- .popup .popup-disclaimer {
748
+ .shipaid-popup .popup-disclaimer {
756
749
  font-size: 10px;
757
750
  color: var(--shipaid-text-muted);
758
751
  }
759
752
 
760
- .popup .popup-footer {
753
+ .shipaid-popup .popup-footer {
761
754
  display: flex;
762
755
  flex-direction: row;
763
756
  justify-content: space-between;
@@ -766,38 +759,154 @@ const styles = i$1`
766
759
  }
767
760
 
768
761
  @media (max-width: 600px) {
769
- .popup .popup-footer {
762
+ .shipaid-popup .popup-footer {
770
763
  flex-direction: column;
771
764
  }
772
765
  }
773
766
 
774
- .popup .popup-footer .footer-links {
767
+ .shipaid-popup .popup-footer .footer-links {
775
768
  display: flex;
776
769
  flex-direction: row;
777
770
  gap: 2rem;
778
771
  }
779
772
 
780
- .popup .popup-footer .footer-links a {
773
+ .shipaid-popup .popup-footer .footer-links a {
781
774
  font-family: var(--shipaid-font);
782
775
  font-size: var(--shipaid-font-sm);
783
776
  color: var(--shipaid-text-muted);
784
777
  }
785
778
 
786
- .popup .popup-footer .footer-date p {
779
+ .shipaid-popup .popup-footer .footer-date p {
787
780
  font-family: var(--shipaid-font);
788
781
  font-weight: var(--shipaid-font-heavy);
789
782
  font-size: var(--shipaid-font-sm);
790
783
  color: var(--shipaid-text);
791
784
  }
785
+ `;
786
+ var __defProp$1 = Object.defineProperty;
787
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
788
+ var __decorateClass$1 = (decorators, target, key, kind) => {
789
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
790
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
791
+ if (decorator = decorators[i2])
792
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
793
+ if (kind && result)
794
+ __defProp$1(target, key, result);
795
+ return result;
796
+ };
797
+ let LearnMorePopup = class extends s {
798
+ constructor() {
799
+ super(...arguments);
800
+ this.active = false;
801
+ }
802
+ handleClosePopup() {
803
+ const event = new Event("close");
804
+ this.dispatchEvent(event);
805
+ }
806
+ render() {
807
+ return y`
808
+ <div class=${`shipaid-popup ${this.active && "active"}`}>
809
+ <button
810
+ type="button"
811
+ class="popup-close"
812
+ @click=${this.handleClosePopup}
813
+ >
814
+ Close
815
+ </button>
816
+ <p class="popup-title">Instant Package Protection</p>
817
+ <p>
818
+ We empower your favorite brands to protect their packages, because
819
+ every order is precious!
820
+ </p>
821
+ <img
822
+ src="https://res.cloudinary.com/dxyz34kfj/image/upload/v1660782754/shipaid-image_hoz6k8.jpg"
823
+ alt="shipaid protected parcel"
824
+ class="popup-top-image"
825
+ />
826
+ <p class="popup-title">Shop Worry-Free</p>
827
+ <p>
828
+ Brands and shipment carriers cannot always guarantee your order will
829
+ arrive at your doorstep safely. Things happen! We allow the brand
830
+ you are purchasing from to protect your order in the chance of an
831
+ issue in transit. If you encounter an issue, simply reach out to the
832
+ brand and they will handle your claim as soon as possible
833
+ </p>
834
+ <p class="popup-disclaimer">
835
+ By purchasing this protection, you are agreeing to our Terms Of
836
+ Service and Privacy Policy. You are not obligated to purchase this
837
+ protection. This protection is NOT insurance. The claim process and
838
+ decision for compensation are strictly decided by the brand you are
839
+ purchasing from in this transaction. Each claim will be reviewed by
840
+ their customer service team, and you'll get a response accepting
841
+ or denying the claim within 2-3 business days.
842
+ </p>
843
+ <div class="popup-footer">
844
+ <div class="footer-links">
845
+ <a
846
+ href="https://www.shipaid.com/terms-of-service"
847
+ target="_blank"
848
+ rel="noreferrer"
849
+ >Terms of Service</a
850
+ >
851
+ <a
852
+ href="https://www.shipaid.com/privacy-policy"
853
+ target="_blank"
854
+ rel="noreferrer"
855
+ >Privacy Policy</a
856
+ >
857
+ </div>
858
+ <div class="footer-date">
859
+ <p>ShipAid &copy; ${new Date().getFullYear()}</p>
860
+ </div>
861
+ </div>
862
+ </div>
863
+ `;
864
+ }
865
+ };
866
+ LearnMorePopup.styles = styles$1;
867
+ __decorateClass$1([
868
+ e$3({ type: Boolean, attribute: true })
869
+ ], LearnMorePopup.prototype, "active", 2);
870
+ LearnMorePopup = __decorateClass$1([
871
+ e$4("shipaid-popup-learn-more")
872
+ ], LearnMorePopup);
873
+ const styles = i$1`
874
+ :host {
875
+ --shipaid-primary: #002bd6;
876
+ --shipaid-secondary: #0076ff;
877
+ --shipaid-danger: #f44336;
878
+ --shipaid-text: #000000;
879
+ --shipaid-text-muted: #cccccc;
880
+ --shipaid-text-grey: #aaaaaa;
881
+ --shipaid-light-grey: #ebecf0;
882
+ --shipaid-font: "Lato", sans-serif;
883
+ --shipaid-font-xs: 12px;
884
+ --shipaid-font-sm: 14px;
885
+ --shipaid-font-base: 16px;
886
+ --shipaid-font-lg: 18px;
887
+ --shipaid-font-regular: 400;
888
+ --shipaid-font-heavy: 700;
889
+ }
890
+
891
+ * {
892
+ font-family: var(--shipaid-font);
893
+ }
894
+
895
+ p, a {
896
+ font-weight: var(--shipaid-font-regular);
897
+ font-size: var(--shipaid-font-base);
898
+ color: var(--shipaid-text);
899
+ }
792
900
 
793
- /* Widget */
901
+ .error {
902
+ color: var(--shipaid-danger);
903
+ font-size: var(--shipaid-font-sm);
904
+ }
794
905
 
906
+ /* Widget */
795
907
  .shipaid-prompt {
796
908
  width: 400px;
797
909
  max-width: 100%;
798
- font-family: var(--shipaid-font);
799
- font-size: var(--shipaid-font-base);
800
- color: var(--shipaid-text);
801
910
  display: flex;
802
911
  flex-direction: column;
803
912
  gap: 1rem;
@@ -860,7 +969,7 @@ const styles = i$1`
860
969
  .prompt-product
861
970
  .prompt-product-actions
862
971
  .prompt-product-actions-price {
863
- color: var(--shipaid-text-muted);
972
+ color: var(--prompt-actions-price-color, var(--shipaid-text-muted));
864
973
  font-size: var(--shipaid-font-base);
865
974
  }
866
975
  .shipaid-prompt
@@ -869,7 +978,7 @@ const styles = i$1`
869
978
  .prompt-product-actions-button {
870
979
  background-color: transparent;
871
980
  border: none;
872
- color: var(--shipaid-primary);
981
+ color: var(--prompt-actions-button-color, var(--shipaid-primary));
873
982
  text-transform: uppercase;
874
983
  font-weight: var(--shipaid-font-heavy);
875
984
  cursor: pointer;
@@ -893,8 +1002,8 @@ const styles = i$1`
893
1002
  margin-left: 0.5rem;
894
1003
  }
895
1004
  .shipaid-prompt .prompt-footer .prompt-footer-badge {
896
- background-color: var(--shipaid-light-grey);
897
- color: var(--shipaid-text);
1005
+ background-color: var(--shipaid-prompt-badge-background, var(--shipaid-light-grey));
1006
+ color: var(--shipaid-prompt-badge-text, var(--shipaid-text));
898
1007
  padding: 0.5rem 1.5rem;
899
1008
  border-radius: 30px;
900
1009
  cursor: pointer;
@@ -907,16 +1016,6 @@ const styles = i$1`
907
1016
  .shipaid-prompt .prompt-footer .prompt-footer-badge svg {
908
1017
  height: 9px;
909
1018
  }
910
- .shipaid-prompt .prompt-footer .prompt-footer-badge .ship {
911
- text-transform: uppercase;
912
- color: var(--shipaid-secondary);
913
- font-weight: var(--shipaid-font-heavy);
914
- }
915
- .shipaid-prompt .prompt-footer .prompt-footer-badge .aid {
916
- text-transform: uppercase;
917
- color: var(--shipaid-text-grey);
918
- font-weight: var(--shipaid-font-heavy);
919
- }
920
1019
  `;
921
1020
  const CheckmarkIcon = y`
922
1021
  <svg viewBox="0 0 453 511" version="1.1" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
@@ -1365,10 +1464,75 @@ let ShipAidWidget = class extends s {
1365
1464
  );
1366
1465
  }
1367
1466
  }
1368
- render() {
1467
+ learnMorePopupTemplate() {
1468
+ return y`
1469
+ <shipaid-popup-learn-more ?active=${this._popup === "learn-more"} @close=${() => {
1470
+ this._popup = null;
1471
+ }}></shipaid-popup-learn-more>
1472
+ `;
1473
+ }
1474
+ promptTemplate() {
1369
1475
  var _a;
1476
+ return y`
1477
+ <div class="shipaid-prompt">
1478
+ <div class="prompt-product">
1479
+ <div class="prompt-product-image">
1480
+ ${n(
1481
+ this._hasProtectionInCart,
1482
+ () => CheckmarkIcon,
1483
+ () => ShipAidLogo
1484
+ )}
1485
+ </div>
1486
+ <div class="prompt-product-details">
1487
+ <p class="prompt-product-details-title">
1488
+ <slot name="title">Package Protection</slot>
1489
+ </p>
1490
+ <p class="prompt-product-details-description">
1491
+ <slot name="subtitle">from Loss, Damage or Theft</slot>
1492
+ </p>
1493
+ </div>
1494
+ <div class="prompt-product-actions">
1495
+ <p class="prompt-product-actions-price">
1496
+ ${((_a = this._protectionVariant) == null ? void 0 : _a.price) && this._currencyFormat(this._protectionVariant.price)}
1497
+ </p>
1498
+ <button
1499
+ class="prompt-product-actions-button"
1500
+ @click=${this._updateProtection}
1501
+ ?disabled=${this._state.loading}
1502
+ >
1503
+ ${this._state.loading ? "Loading..." : this._hasProtectionInCart ? "Remove" : "+ Add"}
1504
+ </button>
1505
+ </div>
1506
+ </div>
1507
+ ${n(
1508
+ this._state.error,
1509
+ () => y`<p class="error">${this._state.error}</p>`
1510
+ )}
1511
+ <div class="prompt-footer">
1512
+ <a
1513
+ class="prompt-footer-badge"
1514
+ @click=${() => {
1515
+ this._popup = "learn-more";
1516
+ }}
1517
+ >
1518
+ <span>Powered by</span>
1519
+ ${ShipAidLogoText}
1520
+ </a>
1521
+ <button
1522
+ class="prompt-footer-about"
1523
+ @click=${() => {
1524
+ this._popup = "learn-more";
1525
+ }}
1526
+ >
1527
+ i
1528
+ </button>
1529
+ </div>
1530
+ </div>
1531
+ `;
1532
+ }
1533
+ render() {
1370
1534
  useOnce(this, async () => {
1371
- var _a2, _b;
1535
+ var _a, _b;
1372
1536
  const linkEl = document.createElement("link");
1373
1537
  linkEl.setAttribute(
1374
1538
  "href",
@@ -1404,7 +1568,7 @@ let ShipAidWidget = class extends s {
1404
1568
  this._shouldShowWidget = false;
1405
1569
  return;
1406
1570
  }
1407
- if (!((_b = (_a2 = this._store) == null ? void 0 : _a2.protectionSettings) == null ? void 0 : _b.protectionType)) {
1571
+ if (!((_b = (_a = this._store) == null ? void 0 : _a.protectionSettings) == null ? void 0 : _b.protectionType)) {
1408
1572
  logger.warn("No protection settings for this store - skipping setup.");
1409
1573
  this._hasFinishedSetup = true;
1410
1574
  this._shouldShowWidget = false;
@@ -1420,10 +1584,10 @@ let ShipAidWidget = class extends s {
1420
1584
  this._shouldShowWidget = true;
1421
1585
  this._dispatchEvent(Events.LOADED, this._store);
1422
1586
  setTimeout(async () => {
1423
- var _a3, _b2;
1587
+ var _a2, _b2;
1424
1588
  const payload = sessionStorage.getItem(LOCAL_STORAGE_KEY);
1425
1589
  const { lastAction } = payload ? JSON.parse(payload) : {};
1426
- if (lastAction !== "removed" && !this._hasProtectionInCart && ((_a3 = this._cart) == null ? void 0 : _a3.item_count) && ((_b2 = this._store) == null ? void 0 : _b2.widgetAutoOptIn) && this._store.widgetShowCart) {
1590
+ if (lastAction !== "removed" && !this._hasProtectionInCart && ((_a2 = this._cart) == null ? void 0 : _a2.item_count) && ((_b2 = this._store) == null ? void 0 : _b2.widgetAutoOptIn) && this._store.widgetShowCart) {
1427
1591
  await this.addProtection();
1428
1592
  }
1429
1593
  }, 500);
@@ -1454,13 +1618,13 @@ let ShipAidWidget = class extends s {
1454
1618
  useEffect(
1455
1619
  this,
1456
1620
  async () => {
1457
- var _a2, _b, _c;
1621
+ var _a, _b, _c;
1458
1622
  this._cartLastUpdated = new Date();
1459
- if (!((_a2 = this._cart) == null ? void 0 : _a2.items))
1623
+ if (!((_a = this._cart) == null ? void 0 : _a.items))
1460
1624
  return;
1461
1625
  const protectionCartItemIndex = (_b = this._cart.items) == null ? void 0 : _b.findIndex((item) => {
1462
- var _a3, _b2;
1463
- return (_b2 = (_a3 = this._protectionProduct) == null ? void 0 : _a3.variants) == null ? void 0 : _b2.some((variant) => variant.id === item.variant_id);
1626
+ var _a2, _b2;
1627
+ return (_b2 = (_a2 = this._protectionProduct) == null ? void 0 : _a2.variants) == null ? void 0 : _b2.some((variant) => variant.id === item.variant_id);
1464
1628
  });
1465
1629
  const protectionCartItem = (_c = this._cart) == null ? void 0 : _c.items[protectionCartItemIndex];
1466
1630
  this._hasProtectionInCart = !!protectionCartItem;
@@ -1517,134 +1681,17 @@ let ShipAidWidget = class extends s {
1517
1681
  },
1518
1682
  [this._store, this._cart]
1519
1683
  );
1520
- const learnMorePopupTemplate = y`
1521
- <div class=${`shipaid-popup ${this._popup === "learn-more" && "active"}`}>
1522
- <div class="popup">
1523
- <button
1524
- class="popup-close"
1525
- @click=${() => {
1526
- this._popup = null;
1527
- }}
1528
- >
1529
- Close
1530
- </button>
1531
- <p class="popup-title">Instant Package Protection</p>
1532
- <p>
1533
- We empower your favorite brands to protect their packages, because
1534
- every order is precious!
1535
- </p>
1536
- <img
1537
- src="https://res.cloudinary.com/dxyz34kfj/image/upload/v1660782754/shipaid-image_hoz6k8.jpg"
1538
- alt="shipaid protected parcel"
1539
- height="auto"
1540
- width="90%"
1541
- class="popup-top-image"
1542
- />
1543
- <p class="popup-title">Shop Worry-Free</p>
1544
- <p>
1545
- Brands and shipment carriers cannot always guarantee your order will
1546
- arrive at your doorstep safely. Things happen! We allow the brand
1547
- you are purchasing from to protect your order in the chance of an
1548
- issue in transit. If you encounter an issue, simply reach out to the
1549
- brand and they will handle your claim as soon as possible
1550
- </p>
1551
- <p class="popup-disclaimer">
1552
- By purchasing this protection, you are agreeing to our Terms Of
1553
- Service and Privacy Policy. You are not obligated to purchase this
1554
- protection. This protection is NOT insurance. The claim process and
1555
- decision for compensation are strictly decided by the brand you are
1556
- purchasing from in this transaction. Each claim will be reviewed by
1557
- their customer service team, and you'll get a response accepting
1558
- or denying the claim within 2-3 business days.
1559
- </p>
1560
- <div class="popup-footer">
1561
- <div class="footer-links">
1562
- <a
1563
- href="https://www.shipaid.com/terms-of-service"
1564
- target="_blank"
1565
- rel="noreferrer"
1566
- >Terms of Service</a
1567
- >
1568
- <a
1569
- href="https://www.shipaid.com/privacy-policy"
1570
- target="_blank"
1571
- rel="noreferrer"
1572
- >Privacy Policy</a
1573
- >
1574
- </div>
1575
- <div class="footer-date">
1576
- <p>ShipAid &copy; ${new Date().getFullYear()}</p>
1577
- </div>
1578
- </div>
1579
- </div>
1580
- </div>
1581
- `;
1582
- const promptTemplate = y`
1583
- <div class="shipaid-prompt">
1584
- <div class="prompt-product">
1585
- <div class="prompt-product-image">
1586
- ${n(
1587
- this._hasProtectionInCart,
1588
- () => CheckmarkIcon,
1589
- () => ShipAidLogo
1590
- )}
1591
- </div>
1592
- <div class="prompt-product-details">
1593
- <p class="prompt-product-details-title">
1594
- <slot name="title">Package Protection</slot>
1595
- </p>
1596
- <p class="prompt-product-details-description">
1597
- <slot name="subtitle">from Loss, Damage or Theft</slot>
1598
- </p>
1599
- </div>
1600
- <div class="prompt-product-actions">
1601
- <p class="prompt-product-actions-price">
1602
- ${((_a = this._protectionVariant) == null ? void 0 : _a.price) && this._currencyFormat(this._protectionVariant.price)}
1603
- </p>
1604
- <button
1605
- class="prompt-product-actions-button"
1606
- @click=${this._updateProtection}
1607
- ?disabled=${this._state.loading}
1608
- >
1609
- ${this._state.loading ? "Loading..." : this._hasProtectionInCart ? "Remove" : "+ Add"}
1610
- </button>
1611
- </div>
1612
- </div>
1613
- ${n(
1614
- this._state.error,
1615
- () => y`<p class="error">${this._state.error}</p>`
1616
- )}
1617
- <div class="prompt-footer">
1618
- <a
1619
- class="prompt-footer-badge"
1620
- @click=${() => {
1621
- this._popup = "learn-more";
1622
- }}
1623
- >
1624
- <span>Powered by</span>
1625
- ${ShipAidLogoText}
1626
- </a>
1627
- <button
1628
- class="prompt-footer-about"
1629
- @click=${() => {
1630
- this._popup = "learn-more";
1631
- }}
1632
- >
1633
- i
1634
- </button>
1635
- </div>
1636
- </div>
1637
- `;
1684
+ Z(this.learnMorePopupTemplate(), document.body);
1638
1685
  return y`
1639
1686
  <div class="shipaid">
1640
1687
  ${n(
1641
1688
  this._hasFinishedSetup,
1642
1689
  () => {
1643
- var _a2;
1690
+ var _a;
1644
1691
  return n(
1645
- this._shouldShowWidget && this.planActive && ((_a2 = this._store) == null ? void 0 : _a2.widgetShowCart),
1646
- () => [learnMorePopupTemplate, promptTemplate],
1647
- () => y``
1692
+ this._shouldShowWidget && this.planActive && ((_a = this._store) == null ? void 0 : _a.widgetShowCart),
1693
+ () => this.promptTemplate(),
1694
+ () => b
1648
1695
  );
1649
1696
  },
1650
1697
  () => y`<p><slot name="loading" default>Loading ShipAid Widget...</slot></p>`