ui.shipaid.com 0.3.175 → 0.3.176

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
@@ -4668,7 +4668,8 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
4668
4668
  * @private
4669
4669
  */
4670
4670
  _renderDefaultCheckoutButton(originalClasses, protectionPrice, cartTotal, isGreenProtectionEnabled, isFreeGiftEnabled, impactActive, loading2) {
4671
- var _a, _b, _c, _d, _e, _f;
4671
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4672
+ const { logo, title: title2 = "", linkContinueText } = ((_b = (_a = this._store) == null ? void 0 : _a.widgetConfigurations) == null ? void 0 : _b.checkoutPlus) || { logo: null, title: null, linkContinueText: null };
4672
4673
  return x`
4673
4674
  <style>
4674
4675
  :host {
@@ -4842,11 +4843,11 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
4842
4843
  <div class="protection-info">
4843
4844
  <div class="protection-text">
4844
4845
  <img
4845
- src="${impactActive ? ShipAidImpactIcon : ShipAidBlueIcon}"
4846
+ src="${logo || (impactActive ? ShipAidImpactIcon : ShipAidBlueIcon)}"
4846
4847
  style="width: 20px;"
4847
4848
  />
4848
4849
  ${n(
4849
- !this.widgetTitle,
4850
+ !(this.widgetTitle || title2),
4850
4851
  () => x`<strong
4851
4852
  >${translate("checkout-plus.checkout-title")}+</strong
4852
4853
  >`
@@ -4854,8 +4855,8 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
4854
4855
  <div class="protection-value">
4855
4856
  <slot name="checkout-plus-heading">
4856
4857
  ${n(
4857
- this.widgetTitle,
4858
- () => o$4(this.widgetTitle),
4858
+ this.widgetTitle || title2,
4859
+ () => o$4(this.widgetTitle || title2 || ""),
4859
4860
  () => impactActive ? this.renderImpactTitle(isGreenProtectionEnabled, isFreeGiftEnabled) : translate("checkout-plus.title")
4860
4861
  )}
4861
4862
  </slot>
@@ -4879,7 +4880,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
4879
4880
  ${this._sellingPlanId ? x`
4880
4881
  <button
4881
4882
  id="${this.buttonId || "shipaid-checkout-button"}"
4882
- variant="${(_a = this._protectionVariant) == null ? void 0 : _a.id}"
4883
+ variant="${(_c = this._protectionVariant) == null ? void 0 : _c.id}"
4883
4884
  class="${this.buttonClasses || originalClasses}"
4884
4885
  @click=${async () => {
4885
4886
  var _a2, _b2;
@@ -4896,8 +4897,8 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
4896
4897
  </button>
4897
4898
  ` : x`
4898
4899
  <a
4899
- variant="${(_b = this._protectionVariant) == null ? void 0 : _b.id}"
4900
- href="/checkout${((_c = this._protectionVariant) == null ? void 0 : _c.id) ? `?attributes[_shipaid-internal]=1&updates[${(_d = this._protectionVariant) == null ? void 0 : _d.id}]=1` : ""}"
4900
+ variant="${(_d = this._protectionVariant) == null ? void 0 : _d.id}"
4901
+ href="/checkout${((_e = this._protectionVariant) == null ? void 0 : _e.id) ? `?attributes[_shipaid-internal]=1&updates[${(_f = this._protectionVariant) == null ? void 0 : _f.id}]=1` : ""}"
4901
4902
  id="${this.buttonId || "shipaid-checkout-button"}"
4902
4903
  class="${this.buttonClasses || originalClasses}"
4903
4904
  @click=${() => {
@@ -4919,12 +4920,13 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
4919
4920
  </a>
4920
4921
  `}
4921
4922
  <a
4922
- href="/checkout${((_e = this._protectionVariant) == null ? void 0 : _e.id) ? `?attributes[_shipaid-internal]=1&updates[${(_f = this._protectionVariant) == null ? void 0 : _f.id}]=0` : ""}"
4923
+ href="/checkout${((_g = this._protectionVariant) == null ? void 0 : _g.id) ? `?attributes[_shipaid-internal]=1&updates[${(_h = this._protectionVariant) == null ? void 0 : _h.id}]=0` : ""}"
4923
4924
  class="continue-link"
4924
- >
4925
- <slot name="link-continue"
4926
- >${translate("checkout-plus.continue")}${isFreeGiftEnabled ? translate("plus.suffix.no-gift") : ""}</slot
4927
- >
4925
+ > ${n(
4926
+ linkContinueText,
4927
+ () => o$4(linkContinueText),
4928
+ () => `${translate("checkout-plus.continue")}${isFreeGiftEnabled ? translate("plus.suffix.no-gift") : ""}`
4929
+ )}
4928
4930
  </a>
4929
4931
  </div>
4930
4932
  `;
@@ -1001,7 +1001,7 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1001
1001
  Checkout without package protection
1002
1002
  </a>
1003
1003
  </div>
1004
- `}_renderDefaultCheckoutButton(A,e,t,d,n,r,a){var o,g,v,u,f,D;return E`
1004
+ `}_renderDefaultCheckoutButton(A,e,t,d,n,r,a){var o,g,v,u,f,D,B,Q;const{logo:p,title:s="",linkContinueText:c}=(null==(g=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:g.checkoutPlus)||{logo:null,title:null,linkContinueText:null};return E`
1005
1005
  <style>
1006
1006
  :host {
1007
1007
  display: inline-block;
@@ -1174,15 +1174,15 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1174
1174
  <div class="protection-info">
1175
1175
  <div class="protection-text">
1176
1176
  <img
1177
- src="${r?oe:ge}"
1177
+ src="${p||(r?oe:ge)}"
1178
1178
  style="width: 20px;"
1179
1179
  />
1180
- ${GA(!this.widgetTitle,(()=>E`<strong
1180
+ ${GA(!(this.widgetTitle||s),(()=>E`<strong
1181
1181
  >${LA("checkout-plus.checkout-title")}+</strong
1182
1182
  >`))}
1183
1183
  <div class="protection-value">
1184
1184
  <slot name="checkout-plus-heading">
1185
- ${GA(this.widgetTitle,(()=>AA(this.widgetTitle)),(()=>r?this.renderImpactTitle(d,n):LA("checkout-plus.title")))}
1185
+ ${GA(this.widgetTitle||s,(()=>AA(this.widgetTitle||s||"")),(()=>r?this.renderImpactTitle(d,n):LA("checkout-plus.title")))}
1186
1186
  </slot>
1187
1187
  -
1188
1188
  ${e?this._currencyFormat(e):a}
@@ -1204,7 +1204,7 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1204
1204
  ${this._sellingPlanId?E`
1205
1205
  <button
1206
1206
  id="${this.buttonId||"shipaid-checkout-button"}"
1207
- variant="${null==(o=this._protectionVariant)?void 0:o.id}"
1207
+ variant="${null==(v=this._protectionVariant)?void 0:v.id}"
1208
1208
  class="${this.buttonClasses||A}"
1209
1209
  @click=${async()=>{var A,e;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(A=this._protectionVariant)?void 0:A.id)),await this.addCartProtectionVariant(),window.location.href=`/checkout?attributes[_shipaid-internal]=1&updates[${null==(e=this._protectionVariant)?void 0:e.id}]=1`}}
1210
1210
  >
@@ -1213,8 +1213,8 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1213
1213
  </button>
1214
1214
  `:E`
1215
1215
  <a
1216
- variant="${null==(g=this._protectionVariant)?void 0:g.id}"
1217
- href="/checkout${(null==(v=this._protectionVariant)?void 0:v.id)?`?attributes[_shipaid-internal]=1&updates[${null==(u=this._protectionVariant)?void 0:u.id}]=1`:""}"
1216
+ variant="${null==(u=this._protectionVariant)?void 0:u.id}"
1217
+ href="/checkout${(null==(f=this._protectionVariant)?void 0:f.id)?`?attributes[_shipaid-internal]=1&updates[${null==(D=this._protectionVariant)?void 0:D.id}]=1`:""}"
1218
1218
  id="${this.buttonId||"shipaid-checkout-button"}"
1219
1219
  class="${this.buttonClasses||A}"
1220
1220
  @click=${()=>{var A;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(A=this._protectionVariant)?void 0:A.id))}}
@@ -1230,12 +1230,9 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1230
1230
  </a>
1231
1231
  `}
1232
1232
  <a
1233
- href="/checkout${(null==(f=this._protectionVariant)?void 0:f.id)?`?attributes[_shipaid-internal]=1&updates[${null==(D=this._protectionVariant)?void 0:D.id}]=0`:""}"
1233
+ href="/checkout${(null==(B=this._protectionVariant)?void 0:B.id)?`?attributes[_shipaid-internal]=1&updates[${null==(Q=this._protectionVariant)?void 0:Q.id}]=0`:""}"
1234
1234
  class="continue-link"
1235
- >
1236
- <slot name="link-continue"
1237
- >${LA("checkout-plus.continue")}${n?LA("plus.suffix.no-gift"):""}</slot
1238
- >
1235
+ > ${GA(c,(()=>AA(c)),(()=>`${LA("checkout-plus.continue")}${n?LA("plus.suffix.no-gift"):""}`))}
1239
1236
  </a>
1240
1237
  </div>
1241
1238
  `}checkoutButtonTemplate(){var A,e;this._injectCheckoutButtonGlobalStyles();const t=this._findAndCacheCheckoutButton();if(!t)return;t.setAttribute("shipaid-hidden","");const d=this._cachedCheckoutButtonClasses||t.className,{protectionPrice:n,cartTotal:r}=this._calculateCheckoutCartTotals(),{isGreenProtectionEnabled:a,isFreeGiftEnabled:o,impactActive:g}=this._getCheckoutImpactFeatures(),v=E`
@@ -1001,7 +1001,7 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1001
1001
  Checkout without package protection
1002
1002
  </a>
1003
1003
  </div>
1004
- `}_renderDefaultCheckoutButton(A,e,t,d,n,r,a){var o,g,v,u,f,D;return E`
1004
+ `}_renderDefaultCheckoutButton(A,e,t,d,n,r,a){var o,g,v,u,f,D,B,Q;const{logo:p,title:s="",linkContinueText:c}=(null==(g=null==(o=this._store)?void 0:o.widgetConfigurations)?void 0:g.checkoutPlus)||{logo:null,title:null,linkContinueText:null};return E`
1005
1005
  <style>
1006
1006
  :host {
1007
1007
  display: inline-block;
@@ -1174,15 +1174,15 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1174
1174
  <div class="protection-info">
1175
1175
  <div class="protection-text">
1176
1176
  <img
1177
- src="${r?oe:ge}"
1177
+ src="${p||(r?oe:ge)}"
1178
1178
  style="width: 20px;"
1179
1179
  />
1180
- ${GA(!this.widgetTitle,(()=>E`<strong
1180
+ ${GA(!(this.widgetTitle||s),(()=>E`<strong
1181
1181
  >${LA("checkout-plus.checkout-title")}+</strong
1182
1182
  >`))}
1183
1183
  <div class="protection-value">
1184
1184
  <slot name="checkout-plus-heading">
1185
- ${GA(this.widgetTitle,(()=>AA(this.widgetTitle)),(()=>r?this.renderImpactTitle(d,n):LA("checkout-plus.title")))}
1185
+ ${GA(this.widgetTitle||s,(()=>AA(this.widgetTitle||s||"")),(()=>r?this.renderImpactTitle(d,n):LA("checkout-plus.title")))}
1186
1186
  </slot>
1187
1187
  -
1188
1188
  ${e?this._currencyFormat(e):a}
@@ -1204,7 +1204,7 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1204
1204
  ${this._sellingPlanId?E`
1205
1205
  <button
1206
1206
  id="${this.buttonId||"shipaid-checkout-button"}"
1207
- variant="${null==(o=this._protectionVariant)?void 0:o.id}"
1207
+ variant="${null==(v=this._protectionVariant)?void 0:v.id}"
1208
1208
  class="${this.buttonClasses||A}"
1209
1209
  @click=${async()=>{var A,e;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(A=this._protectionVariant)?void 0:A.id)),await this.addCartProtectionVariant(),window.location.href=`/checkout?attributes[_shipaid-internal]=1&updates[${null==(e=this._protectionVariant)?void 0:e.id}]=1`}}
1210
1210
  >
@@ -1213,8 +1213,8 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1213
1213
  </button>
1214
1214
  `:E`
1215
1215
  <a
1216
- variant="${null==(g=this._protectionVariant)?void 0:g.id}"
1217
- href="/checkout${(null==(v=this._protectionVariant)?void 0:v.id)?`?attributes[_shipaid-internal]=1&updates[${null==(u=this._protectionVariant)?void 0:u.id}]=1`:""}"
1216
+ variant="${null==(u=this._protectionVariant)?void 0:u.id}"
1217
+ href="/checkout${(null==(f=this._protectionVariant)?void 0:f.id)?`?attributes[_shipaid-internal]=1&updates[${null==(D=this._protectionVariant)?void 0:D.id}]=1`:""}"
1218
1218
  id="${this.buttonId||"shipaid-checkout-button"}"
1219
1219
  class="${this.buttonClasses||A}"
1220
1220
  @click=${()=>{var A;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(A=this._protectionVariant)?void 0:A.id))}}
@@ -1230,12 +1230,9 @@ function GA(A,e,t){return A?e():null==t?void 0:t()}const JA=aA`
1230
1230
  </a>
1231
1231
  `}
1232
1232
  <a
1233
- href="/checkout${(null==(f=this._protectionVariant)?void 0:f.id)?`?attributes[_shipaid-internal]=1&updates[${null==(D=this._protectionVariant)?void 0:D.id}]=0`:""}"
1233
+ href="/checkout${(null==(B=this._protectionVariant)?void 0:B.id)?`?attributes[_shipaid-internal]=1&updates[${null==(Q=this._protectionVariant)?void 0:Q.id}]=0`:""}"
1234
1234
  class="continue-link"
1235
- >
1236
- <slot name="link-continue"
1237
- >${LA("checkout-plus.continue")}${n?LA("plus.suffix.no-gift"):""}</slot
1238
- >
1235
+ > ${GA(c,(()=>AA(c)),(()=>`${LA("checkout-plus.continue")}${n?LA("plus.suffix.no-gift"):""}`))}
1239
1236
  </a>
1240
1237
  </div>
1241
1238
  `}checkoutButtonTemplate(){var A,e;this._injectCheckoutButtonGlobalStyles();const t=this._findAndCacheCheckoutButton();if(!t)return;t.setAttribute("shipaid-hidden","");const d=this._cachedCheckoutButtonClasses||t.className,{protectionPrice:n,cartTotal:r}=this._calculateCheckoutCartTotals(),{isGreenProtectionEnabled:a,isFreeGiftEnabled:o,impactActive:g}=this._getCheckoutImpactFeatures(),v=E`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui.shipaid.com",
3
3
  "private": false,
4
- "version": "0.3.175",
4
+ "version": "0.3.176",
5
5
  "type": "module",
6
6
  "main": "dist/widget.umd.js",
7
7
  "unpkg": "dist/widget.iife.js",