ui.shipaid.com 0.3.61 → 0.3.62

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
@@ -3104,7 +3104,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
3104
3104
  if (!originalCheckoutButton) return;
3105
3105
  const originalClasses = originalCheckoutButton.className;
3106
3106
  const protectionPrice = Number((_a = this._protectionVariant) == null ? void 0 : _a.price) || 0;
3107
- const cartPrice = Number((_b = this._cart) == null ? void 0 : _b.total_price) || 0;
3107
+ const cartPrice = (Number((_b = this._cart) == null ? void 0 : _b.total_price) || 0) / 100;
3108
3108
  const cartTotal = !this._hasProtectionInCart ? protectionPrice + cartPrice : cartPrice;
3109
3109
  const loading2 = x`
3110
3110
  <svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
@@ -1274,7 +1274,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1274
1274
  @shipaid-add-protection=${()=>{var t,e;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(t=this._protectionVariant)?void 0:t.id)),window.location.href=`/checkout?attributes[_shipaid-internal]=1&updates[${null==(e=this._protectionVariant)?void 0:e.id}]=1`}}
1275
1275
  @shipaid-remove-protection=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}
1276
1276
  ></checkout-package-protection>
1277
- `,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return;const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=Number(null==(e=this._cart)?void 0:e.total_price)||0,s=this._hasProtectionInCart?n:r+n,a=H`
1277
+ `,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return;const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,s=this._hasProtectionInCart?n:r+n,a=H`
1278
1278
  <svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
1279
1279
  <circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
1280
1280
  <path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
@@ -1274,7 +1274,7 @@ function qt(t,e,i){return t?e():null==i?void 0:i()}const jt=u`
1274
1274
  @shipaid-add-protection=${()=>{var t,e;sessionStorage.setItem("shipaid_variant",JSON.stringify(null==(t=this._protectionVariant)?void 0:t.id)),window.location.href=`/checkout?attributes[_shipaid-internal]=1&updates[${null==(e=this._protectionVariant)?void 0:e.id}]=1`}}
1275
1275
  @shipaid-remove-protection=${async()=>{await this.removeProtection(),window.location.href="/checkout"}}
1276
1276
  ></checkout-package-protection>
1277
- `,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return;const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=Number(null==(e=this._cart)?void 0:e.total_price)||0,s=this._hasProtectionInCart?n:r+n,a=H`
1277
+ `,s)})),Z}createRenderRoot(){return this.useShipAidCheckout?this:super.createRenderRoot()}checkoutButtonTemplate(){var t,e;if(!document.getElementById("shipaid-styles")){const t=document.createElement("style");t.id="shipaid-styles",t.textContent="\n [shipaid-hidden] {\n display: none !important;\n }\n shipaid-widget {\n width: 100%;\n }\n ",document.head.appendChild(t)}const i=document.querySelector(`${this.dataSelector}:not(#shipaid-checkout-button)`);if(!i)return;const o=i.className,r=Number(null==(t=this._protectionVariant)?void 0:t.price)||0,n=(Number(null==(e=this._cart)?void 0:e.total_price)||0)/100,s=this._hasProtectionInCart?n:r+n,a=H`
1278
1278
  <svg width="1.5rem" height="1.5rem" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="4" class="shipaid-loader">
1279
1279
  <circle cx="25" cy="25" r="20" stroke-opacity="0.5"/>
1280
1280
  <path d="M45 25a20 20 0 0 1-40 0" stroke="currentColor">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui.shipaid.com",
3
3
  "private": false,
4
- "version": "0.3.61",
4
+ "version": "0.3.62",
5
5
  "type": "module",
6
6
  "main": "dist/widget.umd.js",
7
7
  "unpkg": "dist/widget.iife.js",