@ikas/storefront 6.1.0-beta.75 → 6.1.0-beta.77
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/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/ikasV3.js +1 -1
- package/build/components/image/index.d.ts +1 -0
- package/build/components/image/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -1
- package/build/hooks/useStore.js +1 -1
- package/build/models/data/product/variant/index.d.ts +1 -0
- package/build/models/data/product/variant/index.js +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../ext/tslib/tslib.es6.js';import{makeAutoObservable as t}from"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as o}from"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import{CheckoutStep as r}from"../components/checkout/model.js";import"./analytics.js";import"./head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import"../pages/home.js";import"../pages/_slug_/index.js";import"../pages/pages/_slug_.js";import"../pages/checkout.js";import"../pages/account/index.js";import"../pages/account/addresses.js";import"../pages/account/orders/index.js";import"../pages/account/orders/_id_.js";import"../pages/account/login.js";import"../pages/account/register.js";import"../pages/account/forgot-password.js";import"../pages/account/recover-password.js";import"../pages/cart.js";import"../pages/editor.js";import"../pages/account/favorite-products.js";import"../pages/search.js";import"next/error.js";import"../pages/blog/index.js";import"../pages/blog/_slug_.js";import"../pages/raffle/_slug_.js";import"../pages/raffle/index.js";import"../pages/account/raffles.js";import"../pages/account/activate.js";import{IkasBaseStore as a}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";import i from"lodash/cloneDeep";var s="undefined"==typeof window,d=function(){function e(){t(this)}return e.pageView=function(e){try{var t={event:"page-view-GTM",page:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.productView=function(e){var t,o;try{var r={event:"view_item-GTM",ecommerce:{items:[n(e)],extraParams:{parent_id:e.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(o=null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.image)||void 0===o?void 0:o.src)||"",barcode:e.selectedVariant.barcodeList&&e.selectedVariant.barcodeList.length?e.selectedVariant.barcodeList[0]:"",sellPrice:e.selectedVariant.sellPrice,discountPrice:e.selectedVariant.discountPrice||0}}};return!s&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},e.addToCart=function(e,t,r){var i=a.getInstance().cartStore.cart;try{var d={event:"add_to_cart-GTM",ecommerce:{items:[e instanceof o?n(e,t):m(e,t,r)],cart:i}};return!s&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},e.removeFromCart=function(e,t){var r=a.getInstance().cartStore.cart;try{var i={event:"remove_from_cart-GTM",ecommerce:{items:[e instanceof o?n(e,t):m(e,t)],cart:0===(null==r?void 0:r.itemCount)?null:r}};return!s&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},e.beginCheckout=function(e){try{var t={event:"begin_checkout-GTM",ecommerce:{items:e.items.map((function(e){return m(e,e.quantity)}))}};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.purchase=function(e,t){try{var o={event:"purchase-GTM",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+e.totalTax,shipping:""+e.shippingTotal,currency:e.currencyCode,coupon:e.couponCode,items:e.items.map((function(e){return m(e,e.quantity)})),customer:e.customer}}};return!s&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},e.checkoutStep=function(e,t,o){var a,d,n;if(!(o&&t===r.INFO&&o.isAccountRequired&&(null===(a=e.customer)||void 0===a?void 0:a.isGuestCheckout))){var m=i(e);null===(d=m.shippingAddress)||void 0===d||delete d.checkoutSettings,null===(n=m.billingAddress)||void 0===n||delete n.checkoutSettings;var c="";t===r.INFO?c="checkout_info-GTM":t===r.SHIPPING?c="checkout_shipping-GTM":t===r.PAYMENT?c="checkout_payment-GTM":t===r.SUCCESS&&(c="checkout_success-GTM");try{var p={event:c,ecommerce:{cart:m}};return!s&&window.dataLayer&&window.dataLayer.push(p),p}catch(e){console.error(e)}}},e.disableHTML=function(){try{!s&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},e.completeRegistration=function(e){try{var t={event:"customer_register-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.search=function(e){try{var t={event:"search-GTM",search_string:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.viewCategory=function(e,t){try{var o={event:"view_category-GTM",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!s&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},e.customerLogin=function(e){try{var t={event:"customer_login-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.customerLogout=function(){try{var e={event:"customer_logout-GTM"};return!s&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},e.customerVisit=function(e){try{var t={event:"customer_visit-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.viewCart=function(e){try{var t={event:"view_cart-GTM",ecommerce:{cart:e}};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e}();function n(e,t){var o;void 0===t&&(t=1);var r=[],a=e.categories;return a&&a.length&&(a[0].categoryPath&&a[0].categoryPath.map((function(e){return r.push(e)})),r.push(a[0].name)),{item_name:e.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(o=e.brand)||void 0===o?void 0:o.name)||"",item_category:r.length?r[0]:"",item_category_2:r.length>1?r[1]:"",item_category_3:r.length>2?r[2]:"",item_category_4:r.length>3?r.slice(3,r.length).join(" > "):"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function m(t,o,r){var a,i;void 0===o&&(o=1);var s=[],d=null==r?void 0:r.categories;return d&&d.length&&(d[0].categoryPath&&d[0].categoryPath.map((function(e){return s.push(e)})),s.push(d[0].name)),e(e({item_name:t.variant.name,item_id:t.variant.id,price:t.finalPrice||""},r?{item_brand:(null===(a=r.brand)||void 0===a?void 0:a.name)||"",item_category:s.length?s[0]:"",item_category_2:s.length>1?s[1]:"",item_category_3:s.length>2?s[2]:"",item_category_4:s.length>3?s.slice(3,s.length).join(" > "):""}:{item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:""}),{item_variant:null===(i=t.variant.variantValues)||void 0===i?void 0:i.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:o})}export{d as GoogleTagManager};
|
|
1
|
+
import{__assign as e}from'./../ext/tslib/tslib.es6.js';import{makeAutoObservable as t}from"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as o}from"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import{CheckoutStep as r}from"../components/checkout/model.js";import"./analytics.js";import"./head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"@ikas/storefront-config";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import"../pages/home.js";import"../pages/_slug_/index.js";import"../pages/pages/_slug_.js";import"../pages/checkout.js";import"../pages/account/index.js";import"../pages/account/addresses.js";import"../pages/account/orders/index.js";import"../pages/account/orders/_id_.js";import"../pages/account/login.js";import"../pages/account/register.js";import"../pages/account/forgot-password.js";import"../pages/account/recover-password.js";import"../pages/cart.js";import"../pages/editor.js";import"../pages/account/favorite-products.js";import"../pages/search.js";import"next/error.js";import"../pages/blog/index.js";import"../pages/blog/_slug_.js";import"../pages/raffle/_slug_.js";import"../pages/raffle/index.js";import"../pages/account/raffles.js";import"../pages/account/activate.js";import{IkasBaseStore as a}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import i from"lodash/cloneDeep";var s="undefined"==typeof window,d=function(){function e(){t(this)}return e.pageView=function(e){try{var t={event:"page-view-GTM",page:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.productView=function(e){var t,o;try{var r={event:"view_item-GTM",ecommerce:{items:[n(e)],extraParams:{parent_id:e.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(o=null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.image)||void 0===o?void 0:o.src)||"",barcode:e.selectedVariant.barcodeList&&e.selectedVariant.barcodeList.length?e.selectedVariant.barcodeList[0]:"",sellPrice:e.selectedVariant.sellPrice,discountPrice:e.selectedVariant.discountPrice||0}}};return!s&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},e.addToCart=function(e,t,r){var i=a.getInstance().cartStore.cart;try{var d={event:"add_to_cart-GTM",ecommerce:{items:[e instanceof o?n(e,t):m(e,t,r)],cart:i}};return!s&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},e.removeFromCart=function(e,t){var r=a.getInstance().cartStore.cart;try{var i={event:"remove_from_cart-GTM",ecommerce:{items:[e instanceof o?n(e,t):m(e,t)],cart:0===(null==r?void 0:r.itemCount)?null:r}};return!s&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},e.beginCheckout=function(e){try{var t={event:"begin_checkout-GTM",ecommerce:{items:e.items.map((function(e){return m(e,e.quantity)}))}};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.purchase=function(e,t){try{var o={event:"purchase-GTM",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+e.totalTax,shipping:""+e.shippingTotal,currency:e.currencyCode,coupon:e.couponCode,items:e.items.map((function(e){return m(e,e.quantity)})),customer:e.customer}}};return!s&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},e.checkoutStep=function(e,t,o){var a,d,n;if(!(o&&t===r.INFO&&o.isAccountRequired&&(null===(a=e.customer)||void 0===a?void 0:a.isGuestCheckout))){var m=i(e);null===(d=m.shippingAddress)||void 0===d||delete d.checkoutSettings,null===(n=m.billingAddress)||void 0===n||delete n.checkoutSettings;var c="";t===r.INFO?c="checkout_info-GTM":t===r.SHIPPING?c="checkout_shipping-GTM":t===r.PAYMENT?c="checkout_payment-GTM":t===r.SUCCESS&&(c="checkout_success-GTM");try{var p={event:c,ecommerce:{cart:m}};return!s&&window.dataLayer&&window.dataLayer.push(p),p}catch(e){console.error(e)}}},e.disableHTML=function(){try{!s&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},e.completeRegistration=function(e){try{var t={event:"customer_register-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.search=function(e){try{var t={event:"search-GTM",search_string:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.viewCategory=function(e,t){try{var o={event:"view_category-GTM",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!s&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},e.customerLogin=function(e){try{var t={event:"customer_login-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.customerLogout=function(){try{var e={event:"customer_logout-GTM"};return!s&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},e.customerVisit=function(e){try{var t={event:"customer_visit-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.viewCart=function(e){try{var t={event:"view_cart-GTM",ecommerce:{cart:e}};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e}();function n(e,t){var o;void 0===t&&(t=1);var r=[],a=e.categories;return a&&a.length&&(a[0].categoryPath&&a[0].categoryPath.map((function(e){return r.push(e)})),r.push(a[0].name)),{item_name:e.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(o=e.brand)||void 0===o?void 0:o.name)||"",item_category:r.length?r[0]:"",item_category_2:r.length>1?r[1]:"",item_category_3:r.length>2?r[2]:"",item_category_4:r.length>3?r.slice(3,r.length).join(" > "):"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function m(t,o,r){var a,i;void 0===o&&(o=1);var s=[],d=null==r?void 0:r.categories;return d&&d.length&&(d[0].categoryPath&&d[0].categoryPath.map((function(e){return s.push(e)})),s.push(d[0].name)),e(e({item_name:t.variant.name,item_id:t.variant.id,price:t.finalPrice||""},r?{item_brand:(null===(a=r.brand)||void 0===a?void 0:a.name)||"",item_category:s.length?s[0]:"",item_category_2:s.length>1?s[1]:"",item_category_3:s.length>2?s[2]:"",item_category_4:s.length>3?s.slice(3,s.length).join(" > "):""}:{item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:""}),{item_variant:null===(i=t.variant.variantValues)||void 0===i?void 0:i.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:o})}export{d as GoogleTagManager};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as r}from'./../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{IkasBaseStore as s}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import{IkasThemeJsonPageType as n}from"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import{getCookieValue as o}from"../utils/helper.js";var a,d;!function(t){t[t.SESSION_START=1]="SESSION_START",t[t.PAGE_VIEW=2]="PAGE_VIEW",t[t.PRODUCT_VIEW=3]="PRODUCT_VIEW",t[t.ADD_TO_CART=4]="ADD_TO_CART",t[t.VIEW_CART=5]="VIEW_CART",t[t.ORDER_SUCCESS=6]="ORDER_SUCCESS",t[t.BEGIN_CHECKOUT=7]="BEGIN_CHECKOUT",t[t.CHECKOUT_STEP=8]="CHECKOUT_STEP",t[t.CUSTOMER_REGISTER=9]="CUSTOMER_REGISTER",t[t.CUSTOMER_VISIT=10]="CUSTOMER_VISIT",t[t.CUSTOMER_LOGIN=11]="CUSTOMER_LOGIN",t[t.BRAND_VIEW=12]="BRAND_VIEW",t[t.CATEGORY_VIEW=13]="CATEGORY_VIEW",t[t.POPUP_VIEW=14]="POPUP_VIEW",t[t.SEARCH=15]="SEARCH",t[t.FAVORITE_PRODUCT=16]="FAVORITE_PRODUCT",t[t.CONTACT_FORM=17]="CONTACT_FORM",t[t.CONTACT_FORM_BACKEND=205]="CONTACT_FORM_BACKEND"}(a||(a={})),function(t){t[t.INDEX=1]="INDEX",t[t.CATEGORY=2]="CATEGORY",t[t.BRAND=3]="BRAND",t[t.PRODUCT=4]="PRODUCT",t[t.CUSTOM=5]="CUSTOM",t[t.ACCOUNT=6]="ACCOUNT",t[t.ADDRESSES=7]="ADDRESSES",t[t.ORDERS=8]="ORDERS",t[t.ORDER_DETAIL=9]="ORDER_DETAIL",t[t.LOGIN=10]="LOGIN",t[t.REGISTER=11]="REGISTER",t[t.FORGOT_PASSWORD=12]="FORGOT_PASSWORD",t[t.RECOVER_PASSWORD=13]="RECOVER_PASSWORD",t[t.CART=14]="CART",t[t.FAVORITE_PRODUCTS=15]="FAVORITE_PRODUCTS",t[t.SEARCH=16]="SEARCH",t[t.NOT_FOUND=17]="NOT_FOUND",t[t.BLOG=18]="BLOG",t[t.BLOG_INDEX=19]="BLOG_INDEX",t[t.BLOG_CATEGORY=20]="BLOG_CATEGORY",t[t.CHECKOUT=21]="CHECKOUT",t[t.ACTIVATE_CUSTOMER=21]="ACTIVATE_CUSTOMER"}(d||(d={}));var c=process.env.NEXT_PUBLIC_ANALYTICS_URL?"".concat(process.env.NEXT_PUBLIC_ANALYTICS_URL,"/sendEventV2"):"https://0.myikas.com/sendEventV2",u=function(){function u(){}return u.createUUID=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){return[2,"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))]}))}))},u.createSessionId=function(){return t(this,void 0,void 0,(function(){var t,r,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),i={},[4,this.createUUID()];case 1:return i.id=e.sent(),i.expiry=Date.now()+this.EXPIRY_LENGTH,t=i,localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(t)),this.sessionId=t.id,[4,this.sessionStart()];case 2:return e.sent(),[3,4];case 3:return r=e.sent(),console.error(r),[3,4];case 4:return[2]}}))}))},u.createJourneyId=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.createUUID()];case 1:return t=e.sent(),localStorage.setItem(this.JOURNEY_ID_KEY,t),this.journeyId=t,[2]}}))}))},u.checkSessionId=function(){return t(this,void 0,void 0,(function(){var t,r,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,7,,8]),(t=localStorage.getItem(this.SESSION_ID_KEY))?(r=JSON.parse(t)).expiry<Date.now()||r.id.length<=13?[4,this.createSessionId()]:[3,2]:[3,4];case 1:return e.sent(),[3,3];case 2:this.sessionId=r.id,e.label=3;case 3:return[3,6];case 4:return[4,this.createSessionId()];case 5:e.sent(),e.label=6;case 6:return i.init({sessionId:this.sessionId||""}),[3,8];case 7:return s=e.sent(),console.error(s),[3,8];case 8:return[2]}}))}))},u.checkJourneyId=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(t=localStorage.getItem(this.JOURNEY_ID_KEY))?(this.journeyId=t,[3,3]):[3,1];case 1:return[4,this.createJourneyId()];case 2:e.sent(),e.label=3;case 3:return i.init({journeyId:this.journeyId||""}),[3,5];case 4:return r=e.sent(),console.error(r),[3,5];case 5:return[2]}}))}))},u.checkVisitorId=function(){return t(this,void 0,void 0,(function(){var t,r,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(t=localStorage.getItem(this.VISITOR_ID_KEY))&&t.length>13?(this.visitorId=t,[3,3]):[3,1];case 1:return r=this,[4,this.createUUID()];case 2:r.visitorId=e.sent(),localStorage.setItem(this.VISITOR_ID_KEY,this.visitorId),e.label=3;case 3:return i.init({visitorId:this.visitorId}),[3,5];case 4:return s=e.sent(),console.error(s),[3,5];case 5:return[2]}}))}))},u.refreshJourneyId=function(){localStorage.removeItem(this.JOURNEY_ID_KEY),this.journeyId=void 0,this.checkJourneyId()},u.getPageType=function(t){switch(t){case n.INDEX:return d.INDEX;case n.CATEGORY:return d.CATEGORY;case n.BRAND:return d.BRAND;case n.PRODUCT:return d.PRODUCT;case n.CUSTOM:return d.CUSTOM;case n.ACCOUNT:return d.ACCOUNT;case n.ADDRESSES:return d.ADDRESSES;case n.ORDERS:return d.ORDERS;case n.ORDER_DETAIL:return d.ORDER_DETAIL;case n.LOGIN:return d.LOGIN;case n.REGISTER:return d.REGISTER;case n.FORGOT_PASSWORD:return d.FORGOT_PASSWORD;case n.RECOVER_PASSWORD:return d.RECOVER_PASSWORD;case n.ACTIVATE_CUSTOMER:return d.ACTIVATE_CUSTOMER;case n.CART:return d.CART;case n.FAVORITE_PRODUCTS:return d.FAVORITE_PRODUCTS;case n.SEARCH:return d.SEARCH;case n.NOT_FOUND:return d.NOT_FOUND;case n.BLOG:return d.BLOG;case n.BLOG_INDEX:return d.BLOG_INDEX;case n.BLOG_CATEGORY:return d.BLOG_CATEGORY;case n.CHECKOUT:return d.CHECKOUT}},u.getCustomerData=function(){var t=s.getInstance(),e=t.customerStore.customer;return{id:(null==e?void 0:e.id)||void 0,e:(null==e?void 0:e.email)||void 0,c:t.customerStore.customerConsentGranted}},u.getCommonEventData=function(){var t=s.getInstance();return{u:window.location.href,r:document.referrer,pt:t.currentPageType?this.getPageType(t.currentPageType):void 0,m:{fbp:o("_fbp"),fbc:o("_fbc")}}},u.getOrderLineItem=function(t){return t.orderLineItems.map((function(t){return r(r(r(r({},t.variant.productId?{pid:t.variant.productId}:{}),t.variant.id?{vid:t.variant.id}:{}),{c:t.quantity}),t.finalPrice?{p:t.finalPrice}:{})}))},u.getCartItem=function(t){return r(r(r(r({},t.variant.productId?{pid:t.variant.productId}:{}),t.variant.id?{vid:t.variant.id}:{}),{c:t.quantity}),t.finalPrice?{p:t.finalPrice}:{})},u.sendEvents=function(n){var o,a,d,u,m,l,p,E,h;return t(this,void 0,void 0,(function(){var t,v,O;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,6,,7]),[4,(t=s.getInstance()).customerStore.waitUntilInitialized()];case 1:return e.sent(),[4,this.checkSessionId()];case 2:return e.sent(),[4,this.checkVisitorId()];case 3:return e.sent(),[4,this.checkJourneyId()];case 4:return e.sent(),v={e:n,scid:i.getSalesChannelId(),sfid:i.getStorefrontId(),sid:this.sessionId,jid:this.journeyId,vid:this.visitorId,sfrid:i.getStorefrontRoutingId()||"",ud:r(r(r(r({id:null===(o=t.customerStore.customer)||void 0===o?void 0:o.id},(null===(a=t.customerStore.customer)||void 0===a?void 0:a.email)?{em:null===(d=t.customerStore.customer)||void 0===d?void 0:d.email}:{}),(null===(u=t.customerStore.customer)||void 0===u?void 0:u.phone)?{ph:null===(m=t.customerStore.customer)||void 0===m?void 0:m.phone}:{}),(null===(l=t.customerStore.customer)||void 0===l?void 0:l.lastName)?{ln:null===(p=t.customerStore.customer)||void 0===p?void 0:p.lastName}:{}),(null===(E=t.customerStore.customer)||void 0===E?void 0:E.firstName)?{fn:null===(h=t.customerStore.customer)||void 0===h?void 0:h.firstName}:{}),v:3},[4,fetch(c,{method:"POST",body:JSON.stringify(v),headers:{"Content-Type":"application/json","x-api-key":i.getApiKey()}})];case 5:return e.sent(),[3,7];case 6:return O=e.sent(),console.error(O),[3,7];case 7:return[2]}}))}))},u.sessionStart=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.SESSION_START,ts:Date.now(),d:r({},this.getCommonEventData())},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.pageView=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.PAGE_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{pt:this.getPageType(i)})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.productView=function(i,s){return t(this,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return t=i.categories&&i.categories.length>0?i.categories[0].path.map((function(t){return t.name})):[],n={id:s,t:a.PRODUCT_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{pr:r({id:i.id,vid:i.selectedVariant.id,cp:t,n:i.name,pr:i.selectedVariant.finalPrice},i.selectedVariant.price.currency?{c:i.selectedVariant.price.currency}:{})}})},[4,this.sendEvents([n])];case 1:return e.sent(),[2]}}))}))},u.addToCart=function(i,s,n,o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:o,t:a.ADD_TO_CART,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{crt:{id:n.id,c:n.currencyCode,pr:n.totalFinalPrice,il:this.getOrderLineItem(n)},crtItm:this.getCartItem(i)}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewCart=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.VIEW_CART,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{crt:{id:i.id,c:i.currencyCode,pr:i.totalFinalPrice,il:this.getOrderLineItem(i)}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.orderSuccess=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.ORDER_SUCCESS,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{chk:{id:i.id,s:"success",p:i.totalFinalPrice,c:i.currencyCode,il:this.getOrderLineItem(i)}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[4,this.createSessionId()];case 2:return e.sent(),[2]}}))}))},u.beginCheckout=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.BEGIN_CHECKOUT,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{chk:{id:i.id,p:i.totalFinalPrice,c:i.currencyCode,il:this.getOrderLineItem(i)}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.checkoutStep=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.CHECKOUT_STEP,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{chk:{id:i.id,s:s,p:i.totalFinalPrice,c:i.currencyCode,il:this.getOrderLineItem(i)}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerRegister=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:i,t:a.CUSTOMER_REGISTER,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerLogin=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.CUSTOMER_LOGIN,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerVisit=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.CUSTOMER_VISIT,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewBrand=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.BRAND_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),br:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewCategory=function(i,s,n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:n,t:a.CATEGORY_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),ctg:{id:i.id,cp:s}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewPopup=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.POPUP_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData()},m:{sfpid:i}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.search=function(i,s,n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.SEARCH,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{src:r({s:i},n?{r:n}:{})}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.contactForm=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:i,t:a.CONTACT_FORM,ts:Date.now(),d:r({},this.getCommonEventData())},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.addToWishlist=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.FAVORITE_PRODUCT,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{pr:{id:i}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.SESSION_ID_KEY="ikas_session_id",u.VISITOR_ID_KEY="ikas_visitor_id",u.JOURNEY_ID_KEY="ikas_journey_id",u.EXPIRY_LENGTH=18e5,u}();export{u as default};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{IkasBaseStore as s}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import{IkasThemeJsonPageType as n}from"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import{getCookieValue as o}from"../utils/helper.js";var a,d;!function(t){t[t.SESSION_START=1]="SESSION_START",t[t.PAGE_VIEW=2]="PAGE_VIEW",t[t.PRODUCT_VIEW=3]="PRODUCT_VIEW",t[t.ADD_TO_CART=4]="ADD_TO_CART",t[t.VIEW_CART=5]="VIEW_CART",t[t.ORDER_SUCCESS=6]="ORDER_SUCCESS",t[t.BEGIN_CHECKOUT=7]="BEGIN_CHECKOUT",t[t.CHECKOUT_STEP=8]="CHECKOUT_STEP",t[t.CUSTOMER_REGISTER=9]="CUSTOMER_REGISTER",t[t.CUSTOMER_VISIT=10]="CUSTOMER_VISIT",t[t.CUSTOMER_LOGIN=11]="CUSTOMER_LOGIN",t[t.BRAND_VIEW=12]="BRAND_VIEW",t[t.CATEGORY_VIEW=13]="CATEGORY_VIEW",t[t.POPUP_VIEW=14]="POPUP_VIEW",t[t.SEARCH=15]="SEARCH",t[t.FAVORITE_PRODUCT=16]="FAVORITE_PRODUCT",t[t.CONTACT_FORM=17]="CONTACT_FORM",t[t.CONTACT_FORM_BACKEND=205]="CONTACT_FORM_BACKEND"}(a||(a={})),function(t){t[t.INDEX=1]="INDEX",t[t.CATEGORY=2]="CATEGORY",t[t.BRAND=3]="BRAND",t[t.PRODUCT=4]="PRODUCT",t[t.CUSTOM=5]="CUSTOM",t[t.ACCOUNT=6]="ACCOUNT",t[t.ADDRESSES=7]="ADDRESSES",t[t.ORDERS=8]="ORDERS",t[t.ORDER_DETAIL=9]="ORDER_DETAIL",t[t.LOGIN=10]="LOGIN",t[t.REGISTER=11]="REGISTER",t[t.FORGOT_PASSWORD=12]="FORGOT_PASSWORD",t[t.RECOVER_PASSWORD=13]="RECOVER_PASSWORD",t[t.CART=14]="CART",t[t.FAVORITE_PRODUCTS=15]="FAVORITE_PRODUCTS",t[t.SEARCH=16]="SEARCH",t[t.NOT_FOUND=17]="NOT_FOUND",t[t.BLOG=18]="BLOG",t[t.BLOG_INDEX=19]="BLOG_INDEX",t[t.BLOG_CATEGORY=20]="BLOG_CATEGORY",t[t.CHECKOUT=21]="CHECKOUT",t[t.ACTIVATE_CUSTOMER=21]="ACTIVATE_CUSTOMER"}(d||(d={}));var c=process.env.NEXT_PUBLIC_ANALYTICS_URL?"".concat(process.env.NEXT_PUBLIC_ANALYTICS_URL,"/sendEventV2"):"https://0.myikas.com/sendEventV2",u=function(){function u(){}return u.createUUID=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){return[2,"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))]}))}))},u.createSessionId=function(){return t(this,void 0,void 0,(function(){var t,r,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),i={},[4,this.createUUID()];case 1:return i.id=e.sent(),i.expiry=Date.now()+this.EXPIRY_LENGTH,t=i,localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(t)),this.sessionId=t.id,[4,this.sessionStart()];case 2:return e.sent(),[3,4];case 3:return r=e.sent(),console.error(r),[3,4];case 4:return[2]}}))}))},u.createJourneyId=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.createUUID()];case 1:return t=e.sent(),localStorage.setItem(this.JOURNEY_ID_KEY,t),this.journeyId=t,[2]}}))}))},u.checkSessionId=function(){return t(this,void 0,void 0,(function(){var t,r,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,7,,8]),(t=localStorage.getItem(this.SESSION_ID_KEY))?(r=JSON.parse(t)).expiry<Date.now()||r.id.length<=13?[4,this.createSessionId()]:[3,2]:[3,4];case 1:return e.sent(),[3,3];case 2:this.sessionId=r.id,e.label=3;case 3:return[3,6];case 4:return[4,this.createSessionId()];case 5:e.sent(),e.label=6;case 6:return i.init({sessionId:this.sessionId||""}),[3,8];case 7:return s=e.sent(),console.error(s),[3,8];case 8:return[2]}}))}))},u.checkJourneyId=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(t=localStorage.getItem(this.JOURNEY_ID_KEY))?(this.journeyId=t,[3,3]):[3,1];case 1:return[4,this.createJourneyId()];case 2:e.sent(),e.label=3;case 3:return i.init({journeyId:this.journeyId||""}),[3,5];case 4:return r=e.sent(),console.error(r),[3,5];case 5:return[2]}}))}))},u.checkVisitorId=function(){return t(this,void 0,void 0,(function(){var t,r,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(t=localStorage.getItem(this.VISITOR_ID_KEY))&&t.length>13?(this.visitorId=t,[3,3]):[3,1];case 1:return r=this,[4,this.createUUID()];case 2:r.visitorId=e.sent(),localStorage.setItem(this.VISITOR_ID_KEY,this.visitorId),e.label=3;case 3:return i.init({visitorId:this.visitorId}),[3,5];case 4:return s=e.sent(),console.error(s),[3,5];case 5:return[2]}}))}))},u.refreshJourneyId=function(){localStorage.removeItem(this.JOURNEY_ID_KEY),this.journeyId=void 0,this.checkJourneyId()},u.getPageType=function(t){switch(t){case n.INDEX:return d.INDEX;case n.CATEGORY:return d.CATEGORY;case n.BRAND:return d.BRAND;case n.PRODUCT:return d.PRODUCT;case n.CUSTOM:return d.CUSTOM;case n.ACCOUNT:return d.ACCOUNT;case n.ADDRESSES:return d.ADDRESSES;case n.ORDERS:return d.ORDERS;case n.ORDER_DETAIL:return d.ORDER_DETAIL;case n.LOGIN:return d.LOGIN;case n.REGISTER:return d.REGISTER;case n.FORGOT_PASSWORD:return d.FORGOT_PASSWORD;case n.RECOVER_PASSWORD:return d.RECOVER_PASSWORD;case n.ACTIVATE_CUSTOMER:return d.ACTIVATE_CUSTOMER;case n.CART:return d.CART;case n.FAVORITE_PRODUCTS:return d.FAVORITE_PRODUCTS;case n.SEARCH:return d.SEARCH;case n.NOT_FOUND:return d.NOT_FOUND;case n.BLOG:return d.BLOG;case n.BLOG_INDEX:return d.BLOG_INDEX;case n.BLOG_CATEGORY:return d.BLOG_CATEGORY;case n.CHECKOUT:return d.CHECKOUT}},u.getCustomerData=function(){var t=s.getInstance(),e=t.customerStore.customer;return{id:(null==e?void 0:e.id)||void 0,e:(null==e?void 0:e.email)||void 0,c:t.customerStore.customerConsentGranted}},u.getCommonEventData=function(){var t=s.getInstance();return{u:window.location.href,r:document.referrer,pt:t.currentPageType?this.getPageType(t.currentPageType):void 0,m:{fbp:o("_fbp"),fbc:o("_fbc")}}},u.getOrderLineItem=function(t){return t.orderLineItems.map((function(t){return r(r(r(r({},t.variant.productId?{pid:t.variant.productId}:{}),t.variant.id?{vid:t.variant.id}:{}),{c:t.quantity}),t.finalPrice?{p:t.finalPrice}:{})}))},u.getCartItem=function(t){return r(r(r(r({},t.variant.productId?{pid:t.variant.productId}:{}),t.variant.id?{vid:t.variant.id}:{}),{c:t.quantity}),t.finalPrice?{p:t.finalPrice}:{})},u.sendEvents=function(n){var o,a,d,u,m,l,p,E,h;return t(this,void 0,void 0,(function(){var t,v,O;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,6,,7]),[4,(t=s.getInstance()).customerStore.waitUntilInitialized()];case 1:return e.sent(),[4,this.checkSessionId()];case 2:return e.sent(),[4,this.checkVisitorId()];case 3:return e.sent(),[4,this.checkJourneyId()];case 4:return e.sent(),v={e:n,scid:i.getSalesChannelId(),sfid:i.getStorefrontId(),sid:this.sessionId,jid:this.journeyId,vid:this.visitorId,sfrid:i.getStorefrontRoutingId()||"",ud:r(r(r(r({id:null===(o=t.customerStore.customer)||void 0===o?void 0:o.id},(null===(a=t.customerStore.customer)||void 0===a?void 0:a.email)?{em:null===(d=t.customerStore.customer)||void 0===d?void 0:d.email}:{}),(null===(u=t.customerStore.customer)||void 0===u?void 0:u.phone)?{ph:null===(m=t.customerStore.customer)||void 0===m?void 0:m.phone}:{}),(null===(l=t.customerStore.customer)||void 0===l?void 0:l.lastName)?{ln:null===(p=t.customerStore.customer)||void 0===p?void 0:p.lastName}:{}),(null===(E=t.customerStore.customer)||void 0===E?void 0:E.firstName)?{fn:null===(h=t.customerStore.customer)||void 0===h?void 0:h.firstName}:{}),v:3},[4,fetch(c,{method:"POST",body:JSON.stringify(v),headers:{"Content-Type":"application/json","x-api-key":i.getApiKey()}})];case 5:return e.sent(),[3,7];case 6:return O=e.sent(),console.error(O),[3,7];case 7:return[2]}}))}))},u.sessionStart=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.SESSION_START,ts:Date.now(),d:r({},this.getCommonEventData())},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.pageView=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.PAGE_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{pt:this.getPageType(i)})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.productView=function(i,s){return t(this,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return t=i.categories&&i.categories.length>0?i.categories[0].path.map((function(t){return t.name})):[],n={id:s,t:a.PRODUCT_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{pr:r({id:i.id,vid:i.selectedVariant.id,cp:t,n:i.name,pr:i.selectedVariant.finalPrice},i.selectedVariant.price.currency?{c:i.selectedVariant.price.currency}:{})}})},[4,this.sendEvents([n])];case 1:return e.sent(),[2]}}))}))},u.addToCart=function(i,s,n,o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:o,t:a.ADD_TO_CART,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{crt:{id:n.id,c:n.currencyCode,pr:n.totalFinalPrice,il:this.getOrderLineItem(n)},crtItm:this.getCartItem(i)}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewCart=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.VIEW_CART,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{crt:{id:i.id,c:i.currencyCode,pr:i.totalFinalPrice,il:this.getOrderLineItem(i)}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.orderSuccess=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.ORDER_SUCCESS,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{chk:{id:i.id,s:"success",p:i.totalFinalPrice,c:i.currencyCode,il:this.getOrderLineItem(i)}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.beginCheckout=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.BEGIN_CHECKOUT,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{chk:{id:i.id,p:i.totalFinalPrice,c:i.currencyCode,il:this.getOrderLineItem(i)}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.checkoutStep=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.CHECKOUT_STEP,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{chk:{id:i.id,s:s,p:i.totalFinalPrice,c:i.currencyCode,il:this.getOrderLineItem(i)}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerRegister=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:i,t:a.CUSTOMER_REGISTER,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerLogin=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.CUSTOMER_LOGIN,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerVisit=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.CUSTOMER_VISIT,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewBrand=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.BRAND_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),br:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewCategory=function(i,s,n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:n,t:a.CATEGORY_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),ctg:{id:i.id,cp:s}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewPopup=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:a.POPUP_VIEW,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{cst:this.getCustomerData()},m:{sfpid:i}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.search=function(i,s,n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.SEARCH,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{src:r({s:i},n?{r:n}:{})}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.contactForm=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:i,t:a.CONTACT_FORM,ts:Date.now(),d:r({},this.getCommonEventData())},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.addToWishlist=function(i,s){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={id:s,t:a.FAVORITE_PRODUCT,ts:Date.now(),d:r(r({},this.getCommonEventData()),{d:{pr:{id:i}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.SESSION_ID_KEY="ikas_session_id",u.VISITOR_ID_KEY="ikas_visitor_id",u.JOURNEY_ID_KEY="ikas_journey_id",u.EXPIRY_LENGTH=18e5,u}();export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import s from"next/image.js";import{IkasImageFunctions as o}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";var l=[180,360,540,720,900,1080,1296,1512,1728,1950,2560,3840],i=function(i){var m=i.image,n=i.useBlur,u=i.lossless,f=e(i,["image","useBlur","lossless"]),c=o.getDefaultSrc,d=o.getSrc;return m?t.createElement(s,r({},f,{loader:function(e){var r=e.width,t=l.reduce((function(e,t){return Math.abs(t-r)<Math.abs(e-r)?t:e})),s=u||a.getIsLosslessImageEnabled();return d(m,t,s)},quality:100,src:c(m),alt:f.alt||"Image",placeholder:n?"blur":"empty",blurDataURL:n?d(m,10):void 0})):null};export{i as Image};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as r}from"../../../ext/tslib/tslib.es6.mjs.js";import t from"react";import{observer as n}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as a,injectFontScript as o,validateEmail as i,validatePhoneNumber as
|
|
1
|
+
import{__awaiter as e,__generator as r}from"../../../ext/tslib/tslib.es6.mjs.js";import t from"react";import{observer as n}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as a,injectFontScript as o,validateEmail as i,validatePhoneNumber as s}from"../../helpers/index.js";import{FormItemTypeEnum as l}from"../../models/modal/step/elements/form/index.js";import u from"../button-element-renderer/index.js";import m from"./input-item-view/index.js";import{CheckboxItemView as d}from"./checkbox-item-view/index.js";import c from"./date-item-view/index.js";import f from"./gender-item-view/index.js";var E=n((function(n){var E=n.element,p=n.popup,v=n.isPreviewMode,C=n.sfProps,I=t.useState(!1);I[0];var h=I[1],M=E,S=M.rows.slice().sort((function(e,r){return e.order-r.order})),g=M.formSettings,R=M.buttonSettings,O=M.bgColor,_={display:"flex",flexDirection:"column",justifyContent:a(M.horizontalAlignment),gap:"".concat(g.gapBetweenItems,"px"),padding:"".concat(M.outerVerticalPadding,"px ").concat(M.outerHorizontalPadding,"px"),backgroundColor:O,width:"100%"},T={display:"flex",flexDirection:"row",width:"100%",gap:"".concat(g.gapBetweenItems,"px")},b={flex:1,display:"flex",alignItems:"flex-end",fontFamily:o(g.fontFamily),fontSize:g.fontSize},U=function(){return e(void 0,void 0,void 0,(function(){var e,t,a;return r(this,(function(r){switch(r.label){case 0:return e=p.modal.steps.findIndex((function(e){return e.id===p.modal.selectedStep.id})),t=e===p.modal.steps.length-2,!v&&C&&t?(h(!0),o=0,M.rows.forEach((function(e){e.columns.forEach((function(e){switch(e.type){case l.CUSTOMER_BIRTHDAY:var r=e.formItem;r.required&&!r.value&&(r.required.hasError=!0,o++);break;case l.CUSTOMER_EMAIL:case l.CUSTOMER_PHONE:case l.CUSTOMER_NAME:case l.CUSTOMER_SURNAME:var t=e.formItem;if(t.required&&!t.value){if(t.type===l.CUSTOMER_EMAIL&&(null==C?void 0:C.isCustomerLoggedIn))return;t.required.hasError=!0,o++}else if(e.type===l.CUSTOMER_EMAIL){var n=i(t.value||"");t.validEmailError.hasError=!n,n||o++}else if(e.type===l.CUSTOMER_PHONE&&t.required){var a=s(t.value||"",null==C?void 0:C.currentCountryCode);t.validPhoneError.hasError=!a,a||o++}break;case l.CUSTOMER_GENDER:var u=e.formItem,m=u.genders.find((function(e){return e.isSelected}));u.required&&!m&&(u.required.hasError=!0,o++);break;case l.CHECKBOX_FORM_ITEM:var d=e.formItem;d.requiredToBeChecked&&!d.isChecked&&(d.requiredToBeChecked.hasError=!0,o++)}}))})),o>0?(h(!1),[2]):(a={},M.rows.forEach((function(e){e.columns.forEach((function(e){var r;switch(e.type){case l.CUSTOMER_BIRTHDAY:a.birthday=e.formItem.value;break;case l.CUSTOMER_EMAIL:a.email=e.formItem.value;break;case l.CUSTOMER_GENDER:a.gender=(null===(r=e.formItem.genders.find((function(e){return e.isSelected})))||void 0===r?void 0:r.type)||"";break;case l.CUSTOMER_PHONE:a.phone=e.formItem.value;break;case l.CUSTOMER_NAME:a.firstName=e.formItem.value||"";break;case l.CUSTOMER_SURNAME:a.lastName=e.formItem.value||"";break;case l.CHECKBOX_FORM_ITEM:a.hasPermission=e.formItem.isChecked}}))})),[4,C.onCustomerSave(a)])):[3,2];case 1:r.sent(),n.setIsCustomerSaved(!0),h(!1),r.label=2;case 2:return-1!==e&&e<p.modal.steps.length&&(p.modal.selectedStep=p.modal.steps[e+1]),[2]}var o}))}))};return t.createElement("div",{style:_},S.map((function(e,r){return t.createElement("div",{style:T,key:r},e.columns.slice().sort((function(e,r){return e.order-r.order})).map((function(e,r){return t.createElement("div",{style:b,key:r},function(e){switch(e.type){case l.CUSTOMER_EMAIL:case l.CUSTOMER_PHONE:case l.CUSTOMER_NAME:case l.CUSTOMER_SURNAME:var r=e.formItem;if(r.type===l.CUSTOMER_EMAIL&&(null==C?void 0:C.isCustomerLoggedIn)&&!v)return null;var n=null;if(e.type===l.CUSTOMER_EMAIL){var a=r;a.validEmailError.hasError&&(n=a.validEmailError.validationErrorMessage)}else if(e.type===l.CUSTOMER_PHONE){var o=r;o.validPhoneError.hasError&&(n=o.validPhoneError.validationErrorMessage)}return t.createElement(m,{formInputSettings:g.formInputSettings,inputLabel:r.inputLabel,isRequired:r.required,onValueChange:function(e){return v?null:r.value=e},placeholder:r.placeholder,updateCurrentInfo:r.updateCurrentInfo,value:r.value||"",validationErrorMessage:n});case l.CUSTOMER_BIRTHDAY:var i=e.formItem;return t.createElement(c,{formInputSettings:g.formInputSettings,inputLabel:i.inputLabel,isRequired:i.required,onValueChange:function(e){return v?null:i.value=e},placeholder:i.placeholder,updateCurrentInfo:i.updateCurrentInfo,value:i.value||""});case l.CUSTOMER_GENDER:var s=e.formItem;return t.createElement(f,{genderFormItem:s,formInputSettings:g.formInputSettings,onValueChange:function(e){return v?null:s.genders.forEach((function(r){r.isSelected=r.label===e}))}});case l.CHECKBOX_FORM_ITEM:return t.createElement(d,{checkboxItem:e.formItem})}}(e))})))})),t.createElement("div",{style:{width:"100%",minWidth:"fit-content"},onClick:function(e){U(),e.preventDefault(),e.stopPropagation()}},t.createElement(u,{element:R})," "))}));export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from"../../../../../mobx-react/dist/mobxreact.esm.js";import{PopupTypeEnum as o,PopupPositonEnum as n}from"../models/modal/index.js";import i from"../assets/x-close.js";import{CloseButtonPositionTypeEnum as r,CloseIconTypeEnum as
|
|
1
|
+
import e from"react";import{observer as t}from"../../../../../mobx-react/dist/mobxreact.esm.js";import{PopupTypeEnum as o,PopupPositonEnum as n}from"../models/modal/index.js";import i from"../assets/x-close.js";import{CloseButtonPositionTypeEnum as r,CloseIconTypeEnum as s,CloseButtonDisplayTypeEnum as l}from"../models/modal/close-settings/index.js";import{PopupElementTypeEnum as a,ComponentVerticalAlignmentEnum as d}from"../models/modal/step/elements/base/index.js";import c from"./text-element-renderer/index.js";import m from"./button-element-renderer/index.js";import p from"./space-element-renderer/index.js";import u from"./divider-element-renderer/index.js";import f from"./social-element-renderer/index.js";import P from"./image-element-renderer/index.js";import E from"./image-column-element-renderer/index.js";import x from"./product-list-renderer/index.js";import v from"./form-element-renderer/index.js";import{ImageColumnPositionEnum as g,MobileImageColumnPositionEnum as T}from"../models/modal/step/elements/image-column/index.js";var y=t((function(t){var y,b,C,O,I=t.popup,_=t.dynamicData,h=t.dashboardComponents,M=t.previewMode,S=t.sfProps,w=t.isMobile,A=e.useState(!1),D=A[0],R=A[1],k=I.modal,N=k.teaser,j=!!k.selectedStep.isTeaser,B=k.selectedStep.elements.find((function(e){return e.type===a.IMAGE_COLUMN})),L=j?N.backgroundSettings:k.backgroundSettings,U=j?N.windowSettings:k.windowSettings,H=j?N.closeSettings:k.closeSettings,W=L.allowScrollingWhenPopupOpen,F=I.isPreviewMode||M,V=!!F||k.isVisible;document.body.style.overflow=V&&!W?"hidden":"auto";var G=L.overlay,z=L.border,K="center",X="center";switch(j?o.POPUP:k.type){case o.POPUP:var Y=j?N.position:k.position;Y===n.POPUP_TOP_LEFT?(K="flex-start",X="flex-start"):Y===n.POPUP_TOP_CENTER?(K="center",X="flex-start"):Y===n.POPUP_TOP_RIGHT?(K="flex-end",X="flex-start"):Y===n.POPUP_MIDDLE_LEFT?(K="flex-start",X="center"):Y===n.POPUP_MIDDLE_CENTER?(K="center",X="center"):Y===n.POPUP_MIDDLE_RIGHT?(K="flex-end",X="center"):Y===n.POPUP_BOTTOM_LEFT?(K="flex-start",X="flex-end"):Y===n.POPUP_BOTTOM_CENTER?(K="center",X="flex-end"):Y===n.POPUP_BOTTOM_RIGHT&&(K="flex-end",X="flex-end");break;case o.DRAWER:k.position===n.DRAWER_LEFT?(K="flex-start",X="center"):k.position===n.DRAWER_RIGHT&&(K="flex-end",X="center");break;case o.NOTIFICATION_BAR:k.position===n.NOTIFICATION_BAR_UP?(K="center",X="flex-start"):k.position===n.NOTIFICATION_BAR_DOWN&&(K="center",X="flex-end")}var q=e.useMemo((function(){return 2147483644}),[]),J=e.useMemo((function(){return q+1}),[]),Q=e.useMemo((function(){return J+1}),[]),Z=e.useMemo((function(){return Q+1}),[]),$={position:"fixed",display:"flex",justifyContent:K,alignItems:X,top:0,left:0,right:0,bottom:0,zIndex:q,overflow:"hidden",padding:"".concat(U.outerVerticalPadding,"px ").concat(U.outerHorizontalPadding,"px"),opacity:V?1:0,visibility:V?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},ee={position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:J,backgroundColor:G?G.bgColor:"",opacity:G?(G.bgOpacity||100)/100:void 0},te={position:"relative",zIndex:Q,backgroundColor:L.bgColor,border:z?"".concat(z.borderWidth,"px ").concat(z.borderStyle," ").concat(z.borderColor):"",borderRadius:"".concat(U.borderRadius,"px"),maxWidth:"100%",maxHeight:"100%",width:U.takeFullWidth?"100%":void 0,minHeight:U.minHeight,height:U.takeFullHeight?"100%":void 0,boxShadow:L.shadow?"0 0 10px ".concat(L.shadow.color):"",overflow:"auto",opacity:V?1:0,visibility:V?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},oe="";switch(null==B?void 0:B.verticalAlignment){case d.BOTTOM:oe="flex-end";break;case d.MIDDLE:oe="center";break;case d.TOP:oe="flex-start"}var ne=B?B.imagePosition===g.LEFT_ALIGN?"row-reverse":"row":"",ie=B?B.mobilePosition===T.TOP?"column-reverse":"column":"",re={display:"flex",flexDirection:B?w?ie:ne:"column",overflow:"hidden"},se={width:U.takeFullWidth?"100%":U.maxWidth,maxWidth:"100%",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:oe,padding:"".concat(U.innerVerticalPadding,"px ").concat(U.innerHorizontalPadding,"px")},le={position:H.closeButtonPositionType===r.TAKE_SPACE?"relative":"absolute",float:H.closeButtonPositionType===r.TAKE_SPACE?"right":"none",top:8,right:8,zIndex:Z},ae={position:"sticky",padding:"6px",marginLeft:H.closeButtonPositionType===r.TAKE_SPACE?"14px":void 0,display:"flex",justifyContent:"center",alignItems:"center",border:(null===(y=H.iconSettings)||void 0===y?void 0:y.type)===s.WITH_BORDER?"1px solid ".concat(null===(b=H.iconSettings)||void 0===b?void 0:b.color):"",borderRadius:"50%",backgroundColor:null===(C=H.iconSettings)||void 0===C?void 0:C.backgroundColor},de={color:null===(O=H.iconSettings)||void 0===O?void 0:O.color,cursor:"pointer"},ce=function(t){var o=t.type,n=h&&h[o]&&h[o].length?h[o][0]:null,i=n&&I.marketingPopupViewModel?e.createElement(n,{element:t,marketingPopupViewModel:I.marketingPopupViewModel}):void 0;switch(o){case a.TEXT:return e.createElement(c,{element:t});case a.IMAGE:return e.createElement(P,{element:t,popup:I,editModeChildren:i});case a.IMAGE_COLUMN:return w&&B.mobilePosition===T.HIDE?null:e.createElement(E,{element:t,popup:I,editModeChildren:i,isMobile:w});case a.BUTTON:return e.createElement(m,{element:t,onClose:me,isStandaloneButtonComponent:!0});case a.DIVIDER:return e.createElement(u,{element:t});case a.FORM:return e.createElement(v,{element:t,popup:I,isPreviewMode:!!F,sfProps:S,setIsCustomerSaved:R});case a.PRODUCT_LIST:return e.createElement(x,{element:t,products:_.products[t.id],popup:I,editModeChildren:i,isPreviewMode:!!F,sfProps:S,onClose:me});case a.SOCIAL_MEDIA:return e.createElement(f,{element:t,popup:I,editModeChildren:i});case a.SPACE:return e.createElement(p,{element:t})}},me=function(e){if(!F&&k.isVisible){var t=D||e;k.isVisible=!1,S&&S.onModalClose(t),R(!1)}};return e.createElement("div",{className:"ikas-popup-default-styles",id:"ikas-popup-container",style:$},e.createElement("div",{style:te},H.closeButtonDisplayType!==l.ALWAYS_HIDDEN&&e.createElement("div",{style:le,onClick:function(){return me()}},e.createElement("div",{style:ae,className:H.closeButtonDisplayType===l.VISIBLE_ON_HOVER?"visible-on-hover":""},e.createElement(i,{style:de}))),e.createElement("div",{style:re,onClick:function(e){j&&(k.selectedStep=k.steps[0])}},e.createElement("div",{style:se},k.selectedStep.elements.filter((function(e){return e.type!==a.IMAGE_COLUMN})).slice().sort((function(e,t){return e.order-t.order})).map((function(e){return ce(e)}))),B&&ce(B))),e.createElement("div",{style:ee,onClick:function(){return me()}}))}));export{y as default};
|
package/build/hooks/useStore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../pages/home.js";import"../pages/_slug_/index.js";import"../pages/pages/_slug_.js";import"../pages/checkout.js";import"../pages/account/index.js";import"../pages/account/addresses.js";import"../pages/account/orders/index.js";import"../pages/account/orders/_id_.js";import"../pages/account/login.js";import"../pages/account/register.js";import"../pages/account/forgot-password.js";import"../pages/account/recover-password.js";import"../pages/cart.js";import"../pages/editor.js";import"../pages/account/favorite-products.js";import"../pages/search.js";import"next/error.js";import"../pages/blog/index.js";import"../pages/blog/_slug_.js";import"../pages/raffle/_slug_.js";import"../pages/raffle/index.js";import"../pages/account/raffles.js";import"../pages/account/activate.js";import{IkasBaseStore as o}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"
|
|
1
|
+
import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"@ikas/storefront-config";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../pages/home.js";import"../pages/_slug_/index.js";import"../pages/pages/_slug_.js";import"../pages/checkout.js";import"../pages/account/index.js";import"../pages/account/addresses.js";import"../pages/account/orders/index.js";import"../pages/account/orders/_id_.js";import"../pages/account/login.js";import"../pages/account/register.js";import"../pages/account/forgot-password.js";import"../pages/account/recover-password.js";import"../pages/cart.js";import"../pages/editor.js";import"../pages/account/favorite-products.js";import"../pages/search.js";import"next/error.js";import"../pages/blog/index.js";import"../pages/blog/_slug_.js";import"../pages/raffle/_slug_.js";import"../pages/raffle/index.js";import"../pages/account/raffles.js";import"../pages/account/activate.js";import{IkasBaseStore as o}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";function t(){return o.getInstance()}export{t as useStore};
|
|
@@ -68,6 +68,7 @@ export declare class IkasProductVariant implements IProductVariant {
|
|
|
68
68
|
formattedSellPriceWithQuantity: string;
|
|
69
69
|
formattedFinalPrice: string;
|
|
70
70
|
formattedFinalPriceWithQuantity: string;
|
|
71
|
+
salesChannelIds: string[] | null;
|
|
71
72
|
}[];
|
|
72
73
|
saveBackInStockReminder(email: string): Promise<boolean>;
|
|
73
74
|
toJSON(): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{IkasProductPrice as r}from"./price/index.js";import{IkasVariantValue as n}from"../../variant-type/variant-value/index.js";import{IkasProductAttributeValue as o}from"../attribute-value/index.js";import{IkasProductImage as u}from"../image/index.js";import{IkasBundleSettings as c}from"./bundle-settings/index.js";import{IkasCustomerPriceListRuleValueType as l,IkasCampaignType as a,IkasCampaignFilterType as s,IkasCampaignApplicablePrice as d,IkasCustomerPriceListRuleFilterType as p}from"@ikas/storefront-models";import{IkasProductVariantFunctions as f,IkasProductPriceFunctions as m}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as b}from"@ikas/storefront-config";import{saveProductBackInStockRemind as v,listProductBackInStockRemind as g}from"@ikas/storefront-api";import h from"lodash/groupBy";import y from"lodash/sortBy";import{IkasProductVariantUnit as P}from"./unit/index.js";import{formatCurrency as I}from"../../../../utils/currency.js";import{makeAutoObservable as S}from"mobx";import{IkasBaseStore as O}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var j=function(){function j(e){void 0===e&&(e={}),this._backInStockReminderSaved=!1,this.product=null,this.id=e.id||Date.now()+"",this.productId=e.productId||"",this.sku=e.sku||null,this.barcodeList=e.barcodeList||[],this.baseBundlePrices=e.baseBundlePrices?e.baseBundlePrices.map((function(e){return new r(e)})):[],this.bundleSettings=e.bundleSettings?new c(e.bundleSettings):null,this.variantValues=e.variantValues?e.variantValues.map((function(e){return new n(e)})):[],this.images=e.images?e.images.map((function(e){return new u(e)})):[],this.attributes=e.attributes?e.attributes.map((function(e){return new o(e)})):[],this.prices=e.prices?e.prices.map((function(e){return new r(e)})):[],this.stock=e.stock||0,this.isActive=void 0===e.isActive||e.isActive,this.campaigns=e.campaigns||[],this.unit=e.unit?new P(e.unit):null,this.sellIfOutOfStock=e.sellIfOutOfStock||!1,this.images=y(this.images,"order"),S(this)}return Object.defineProperty(j.prototype,"mainImage",{get:function(){var e=f.getMainImage(this);return e?new u(e):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasStock",{get:function(){return f.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockEnabled",{get:function(){return b.isBackInStockEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockCustomerLoginRequired",{get:function(){return b.isCustomerLoginRequiredForBackInStock()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockReminderSaved",{get:function(){return this._backInStockReminderSaved},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"groupedAttributeValues",{get:function(){var e,t=h(this.attributes,"productAttributeId");return(null===(e=this.attributes)||void 0===e?void 0:e.map((function(e){var i=e.productAttributeId;if(i){var r=t[i];return(null==r?void 0:r.length)&&r[0].productAttribute?{attribute:r[0].productAttribute,values:r}:void 0}})).filter((function(e){return!!e})))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"b2bPriceRule",{get:function(){var e,t,i=this,r=O.getInstance().customerStore.customer,n=null==r?void 0:r.priceListRules,o=function(e){var t,r,n,o;if(e.type===p.CATEGORY)return u=null===(t=e.valueList)||void 0===t?void 0:t.some((function(e){var t;return null===(t=i.product)||void 0===t?void 0:t.categories.find((function(t){return t.id===e}))}));if(e.type===p.PRODUCT)return u=null===(r=e.valueList)||void 0===r?void 0:r.some((function(e){return i.id===e}));if(e.type===p.PRODUCT_BRAND){var u=null===(n=e.valueList)||void 0===n?void 0:n.some((function(e){var t,r;return(null===(r=null===(t=i.product)||void 0===t?void 0:t.brand)||void 0===r?void 0:r.id)===e}));return u}if(e.type===p.PRODUCT_TAG){u=null===(o=e.valueList)||void 0===o?void 0:o.some((function(e){var t,r;return null===(r=null===(t=i.product)||void 0===t?void 0:t.tags)||void 0===r?void 0:r.find((function(t){return t.id===e}))}));return u}};if(n){for(var u=0,c=n;u<c.length;u++){var l=c[u];if(l.shouldMatchAllFilters?null===(e=l.filters)||void 0===e?void 0:e.every(o):null===(t=l.filters)||void 0===t?void 0:t.some(o))return l}return null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"price",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.prices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return null===(t=this.prices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"bundlePrice",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.baseBundlePrices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return(null===(t=this.baseBundlePrices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId})))||this.price},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPrice",{get:function(){var e=0;this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?e=m.getFinalPrice(this.bundlePrice)+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.finalPriceWithQuantity:0)}),0):e=m.getFinalPrice(this.price);if(!this.b2bPriceRule)return e;switch(this.b2bPriceRule.valueType){case l.DISCOUNT_RATE:return e*((100-this.b2bPriceRule.value)/100);case l.DISCOUNT_AMOUNT:return e-this.b2bPriceRule.value;case l.FIXED_PRICE:return this.b2bPriceRule.value;default:return e}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPrice",{get:function(){return I(this.finalPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPrice",{get:function(){return this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?this.bundlePrice.sellPrice+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.sellPriceWithQuantity:0)}),0):this.price.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPrice",{get:function(){return I(this.sellPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedBuyPrice",{get:function(){return I(this.price.buyPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"appliedCampaignAmount",{get:function(){var e,t,i,r,n,o,u=this;if(!(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignId))return null;var c=(null===(r=null===(i=null===(t=this.product)||void 0===t?void 0:t.campaigns)||void 0===i?void 0:i.find((function(e){var t;return e.campaign.id===(null===(t=u.price.campaignPrice)||void 0===t?void 0:t.campaignId)})))||void 0===r?void 0:r.campaign)||null;if(!c)return null;var l={type:c.type,formattedPrice:null,discountPercentage:null},s=c.tieredDiscount&&c.tieredDiscount.rules&&c.tieredDiscount.rules.length>0&&c.tieredDiscount.rules[0].amount;return c.type===a.FIXED_AMOUNT&&(l.formattedPrice=I(c.fixedDiscount?(null===(n=c.fixedDiscount)||void 0===n?void 0:n.amount)||0:s||0,this.price.currency||"",this.price.currencySymbol||"")),c.type===a.RATIO&&(l.discountPercentage=c.fixedDiscount?(null===(o=c.fixedDiscount.amount)||void 0===o?void 0:o.toString())||null:s?s.toString():null),l},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignPrice",{get:function(){var e;return(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignPrice)||null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedCampaignPrice",{get:function(){return I(this.campaignPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPrice",{get:function(){return this.finalPrice===this.sellPrice?null:this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedDiscountPrice",{get:function(){return I(this.discountPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasDiscount",{get:function(){return this.finalPrice!==this.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountAmount",{get:function(){return this.hasDiscount?this.sellPrice-this.finalPrice:0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPercentage",{get:function(){return this.hasDiscount?(100-100*this.finalPrice/this.sellPrice).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPriceWithCampaignOffers",{get:function(){var e,t;return this.finalPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.finalPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPriceWithCampaignOffers",{get:function(){return I(this.finalPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPriceWithCampaignOffers",{get:function(){var e,t;return this.sellPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.sellPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPriceWithCampaignOffers",{get:function(){return I(this.sellPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignOffersDiscountPercentage",{get:function(){return this.finalPriceWithCampaignOffers!==this.sellPriceWithCampaignOffers?(100-100*this.finalPriceWithCampaignOffers/this.sellPriceWithCampaignOffers).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"tieredDiscountProducts",{get:function(){var e,t,i,r,n=this,o=null===(i=null===(t=null===(e=this.product)||void 0===e?void 0:e.campaigns)||void 0===t?void 0:t.find((function(e){return!!e.campaign.tieredDiscount})))||void 0===i?void 0:i.campaign,u=null===(r=null==o?void 0:o.tieredDiscount)||void 0===r?void 0:r.filters;if(u){var c=u.find((function(e){return e.type===s.PRODUCT_AND_VARIANT}));if(c){var l=[];if(c.idList.map((function(e){l.push(e.replace("p:","").replace("v:",""))})),!l.some((function(e){return n.id===e||n.productId===e})))return[]}}return o&&o.tieredDiscount?o.tieredDiscount.rules.every((function(e){return!e.lineItemQuantityRange}))?[]:o.tieredDiscount.rules.map((function(e){var t,i,r,u,c=o.applicablePrice===d.SELL_PRICE?n.sellPrice:n.finalPrice,l=c*((null===(t=e.lineItemQuantityRange)||void 0===t?void 0:t.min)||1),s=I(c,n.price.currency||"",n.price.currencySymbol||""),p=I(l,n.price.currency||"",n.price.currencySymbol||""),f=o.type===a.RATIO?c-c*(e.amount||1)/100:c,m=f*((null===(i=e.lineItemQuantityRange)||void 0===i?void 0:i.min)||1)-(o.type===a.FIXED_AMOUNT&&e.amount||0),b=I(f,n.price.currency||"",n.price.currencySymbol||""),v=I(m,n.price.currency||"",n.price.currencySymbol||"");return{amount:e.amount,lineItemQuantityRange:{min:(null===(r=e.lineItemQuantityRange)||void 0===r?void 0:r.min)||0,max:(null===(u=e.lineItemQuantityRange)||void 0===u?void 0:u.max)||0},type:o.type,sellPrice:c,finalPrice:f,sellPriceWithQuantity:l,finalPriceWithQuantity:m,formattedSellPrice:s,formattedSellPriceWithQuantity:p,formattedFinalPrice:b,formattedFinalPriceWithQuantity:v}})):[]},enumerable:!1,configurable:!0}),j.prototype.saveBackInStockReminder=function(i){var r;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,g({email:{eq:i},productId:{eq:this.productId},variantId:{eq:this.id}})];case 1:return(e=t.sent())&&(null===(r=e.data)||void 0===r?void 0:r.length)?(this._backInStockReminderSaved=!0,[2,!1]):[3,2];case 2:return[4,v({input:{email:i,productId:this.productId,variantId:this.id}})];case 3:return t.sent().isSuccess?(this._backInStockReminderSaved=!0,[2,!0]):(this._backInStockReminderSaved=!1,[2,!1]);case 4:return[2]}}))}))},j.prototype.toJSON=function(){var e=i({},this);return delete e.product,e},j}();export{j as IkasProductVariant};
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{IkasProductPrice as r}from"./price/index.js";import{IkasVariantValue as n}from"../../variant-type/variant-value/index.js";import{IkasProductAttributeValue as o}from"../attribute-value/index.js";import{IkasProductImage as u}from"../image/index.js";import{IkasBundleSettings as c}from"./bundle-settings/index.js";import{IkasCustomerPriceListRuleValueType as l,IkasCampaignType as a,IkasCampaignFilterType as s,IkasCampaignApplicablePrice as d,IkasCustomerPriceListRuleFilterType as p}from"@ikas/storefront-models";import{IkasProductVariantFunctions as f,IkasProductPriceFunctions as m}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as b}from"@ikas/storefront-config";import{saveProductBackInStockRemind as v,listProductBackInStockRemind as h}from"@ikas/storefront-api";import g from"lodash/groupBy";import y from"lodash/sortBy";import{IkasProductVariantUnit as P}from"./unit/index.js";import{formatCurrency as I}from"../../../../utils/currency.js";import{makeAutoObservable as S}from"mobx";import{IkasBaseStore as O}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var j=function(){function j(e){void 0===e&&(e={}),this._backInStockReminderSaved=!1,this.product=null,this.id=e.id||Date.now()+"",this.productId=e.productId||"",this.sku=e.sku||null,this.barcodeList=e.barcodeList||[],this.baseBundlePrices=e.baseBundlePrices?e.baseBundlePrices.map((function(e){return new r(e)})):[],this.bundleSettings=e.bundleSettings?new c(e.bundleSettings):null,this.variantValues=e.variantValues?e.variantValues.map((function(e){return new n(e)})):[],this.images=e.images?e.images.map((function(e){return new u(e)})):[],this.attributes=e.attributes?e.attributes.map((function(e){return new o(e)})):[],this.prices=e.prices?e.prices.map((function(e){return new r(e)})):[],this.stock=e.stock||0,this.isActive=void 0===e.isActive||e.isActive,this.campaigns=e.campaigns||[],this.unit=e.unit?new P(e.unit):null,this.sellIfOutOfStock=e.sellIfOutOfStock||!1,this.images=y(this.images,"order"),S(this)}return Object.defineProperty(j.prototype,"mainImage",{get:function(){var e=f.getMainImage(this);return e?new u(e):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasStock",{get:function(){return f.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockEnabled",{get:function(){return b.isBackInStockEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockCustomerLoginRequired",{get:function(){return b.isCustomerLoginRequiredForBackInStock()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockReminderSaved",{get:function(){return this._backInStockReminderSaved},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"groupedAttributeValues",{get:function(){var e,t=g(this.attributes,"productAttributeId");return(null===(e=this.attributes)||void 0===e?void 0:e.map((function(e){var i=e.productAttributeId;if(i){var r=t[i];return(null==r?void 0:r.length)&&r[0].productAttribute?{attribute:r[0].productAttribute,values:r}:void 0}})).filter((function(e){return!!e})))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"b2bPriceRule",{get:function(){var e,t,i=this,r=O.getInstance().customerStore.customer,n=null==r?void 0:r.priceListRules,o=function(e){var t,r,n,o;if(e.type===p.CATEGORY)return u=null===(t=e.valueList)||void 0===t?void 0:t.some((function(e){var t;return null===(t=i.product)||void 0===t?void 0:t.categories.find((function(t){return t.id===e}))}));if(e.type===p.PRODUCT)return u=null===(r=e.valueList)||void 0===r?void 0:r.some((function(e){return i.id===e}));if(e.type===p.PRODUCT_BRAND){var u=null===(n=e.valueList)||void 0===n?void 0:n.some((function(e){var t,r;return(null===(r=null===(t=i.product)||void 0===t?void 0:t.brand)||void 0===r?void 0:r.id)===e}));return u}if(e.type===p.PRODUCT_TAG){u=null===(o=e.valueList)||void 0===o?void 0:o.some((function(e){var t,r;return null===(r=null===(t=i.product)||void 0===t?void 0:t.tags)||void 0===r?void 0:r.find((function(t){return t.id===e}))}));return u}};if(n){for(var u=0,c=n;u<c.length;u++){var l=c[u];if(l.shouldMatchAllFilters?null===(e=l.filters)||void 0===e?void 0:e.every(o):null===(t=l.filters)||void 0===t?void 0:t.some(o))return l}return null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"price",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.prices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return null===(t=this.prices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"bundlePrice",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.baseBundlePrices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return(null===(t=this.baseBundlePrices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId})))||this.price},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPrice",{get:function(){var e=0;this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?e=m.getFinalPrice(this.bundlePrice)+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.finalPriceWithQuantity:0)}),0):e=m.getFinalPrice(this.price);if(!this.b2bPriceRule)return e;switch(this.b2bPriceRule.valueType){case l.DISCOUNT_RATE:return e*((100-this.b2bPriceRule.value)/100);case l.DISCOUNT_AMOUNT:return e-this.b2bPriceRule.value;case l.FIXED_PRICE:return this.b2bPriceRule.value;default:return e}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPrice",{get:function(){return I(this.finalPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPrice",{get:function(){return this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?this.bundlePrice.sellPrice+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.sellPriceWithQuantity:0)}),0):this.price.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPrice",{get:function(){return I(this.sellPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedBuyPrice",{get:function(){return I(this.price.buyPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"appliedCampaignAmount",{get:function(){var e,t,i,r,n,o,u=this;if(!(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignId))return null;var c=(null===(r=null===(i=null===(t=this.product)||void 0===t?void 0:t.campaigns)||void 0===i?void 0:i.find((function(e){var t;return e.campaign.id===(null===(t=u.price.campaignPrice)||void 0===t?void 0:t.campaignId)})))||void 0===r?void 0:r.campaign)||null;if(!c)return null;var l={type:c.type,formattedPrice:null,discountPercentage:null},s=c.tieredDiscount&&c.tieredDiscount.rules&&c.tieredDiscount.rules.length>0&&c.tieredDiscount.rules[0].amount;return c.type===a.FIXED_AMOUNT&&(l.formattedPrice=I(c.fixedDiscount?(null===(n=c.fixedDiscount)||void 0===n?void 0:n.amount)||0:s||0,this.price.currency||"",this.price.currencySymbol||"")),c.type===a.RATIO&&(l.discountPercentage=c.fixedDiscount?(null===(o=c.fixedDiscount.amount)||void 0===o?void 0:o.toString())||null:s?s.toString():null),l},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignPrice",{get:function(){var e;return(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignPrice)||null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedCampaignPrice",{get:function(){return I(this.campaignPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPrice",{get:function(){return this.finalPrice===this.sellPrice?null:this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedDiscountPrice",{get:function(){return I(this.discountPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasDiscount",{get:function(){return this.finalPrice!==this.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountAmount",{get:function(){return this.hasDiscount?this.sellPrice-this.finalPrice:0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPercentage",{get:function(){return this.hasDiscount?(100-100*this.finalPrice/this.sellPrice).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPriceWithCampaignOffers",{get:function(){var e,t;return this.finalPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.finalPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPriceWithCampaignOffers",{get:function(){return I(this.finalPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPriceWithCampaignOffers",{get:function(){var e,t;return this.sellPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.sellPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPriceWithCampaignOffers",{get:function(){return I(this.sellPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignOffersDiscountPercentage",{get:function(){return this.finalPriceWithCampaignOffers!==this.sellPriceWithCampaignOffers?(100-100*this.finalPriceWithCampaignOffers/this.sellPriceWithCampaignOffers).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"tieredDiscountProducts",{get:function(){var e,t,i,r,n=this,o=null===(i=null===(t=null===(e=this.product)||void 0===e?void 0:e.campaigns)||void 0===t?void 0:t.find((function(e){return!!e.campaign.tieredDiscount})))||void 0===i?void 0:i.campaign,u=null===(r=null==o?void 0:o.tieredDiscount)||void 0===r?void 0:r.filters;if(u){var c=u.find((function(e){return e.type===s.PRODUCT_AND_VARIANT}));if(c){var l=[];if(c.idList.map((function(e){l.push(e.replace("p:","").replace("v:",""))})),!l.some((function(e){return n.id===e||n.productId===e})))return[]}}return o&&o.tieredDiscount?o.tieredDiscount.rules.every((function(e){return!e.lineItemQuantityRange}))?[]:o.tieredDiscount.rules.map((function(e){var t,i,r,u,c=o.applicablePrice===d.SELL_PRICE?n.sellPrice:n.finalPrice,l=c*((null===(t=e.lineItemQuantityRange)||void 0===t?void 0:t.min)||1),s=I(c,n.price.currency||"",n.price.currencySymbol||""),p=I(l,n.price.currency||"",n.price.currencySymbol||""),f=o.type===a.RATIO?c-c*(e.amount||1)/100:c,m=f*((null===(i=e.lineItemQuantityRange)||void 0===i?void 0:i.min)||1)-(o.type===a.FIXED_AMOUNT&&e.amount||0),b=I(f,n.price.currency||"",n.price.currencySymbol||""),v=I(m,n.price.currency||"",n.price.currencySymbol||"");return{amount:e.amount,lineItemQuantityRange:{min:(null===(r=e.lineItemQuantityRange)||void 0===r?void 0:r.min)||0,max:(null===(u=e.lineItemQuantityRange)||void 0===u?void 0:u.max)||0},type:o.type,sellPrice:c,finalPrice:f,sellPriceWithQuantity:l,finalPriceWithQuantity:m,formattedSellPrice:s,formattedSellPriceWithQuantity:p,formattedFinalPrice:b,formattedFinalPriceWithQuantity:v,salesChannelIds:o.salesChannelIds}})):[]},enumerable:!1,configurable:!0}),j.prototype.saveBackInStockReminder=function(i){var r;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,h({email:{eq:i},productId:{eq:this.productId},variantId:{eq:this.id}})];case 1:return(e=t.sent())&&(null===(r=e.data)||void 0===r?void 0:r.length)?(this._backInStockReminderSaved=!0,[2,!1]):[3,2];case 2:return[4,v({input:{email:i,productId:this.productId,variantId:this.id}})];case 3:return t.sent().isSuccess?(this._backInStockReminderSaved=!0,[2,!0]):(this._backInStockReminderSaved=!1,[2,!1]);case 4:return[2]}}))}))},j.prototype.toJSON=function(){var e=i({},this);return delete e.product,e},j}();export{j as IkasProductVariant};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "6.1.0-beta.
|
|
3
|
+
"version": "6.1.0-beta.77",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ikas/popup-renderer": "^1.0.
|
|
20
|
+
"@ikas/popup-renderer": "^1.0.190",
|
|
21
21
|
"swiper": "11.0.6"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
25
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
26
|
-
"@ikas/storefront-model-functions": "^6.1.0-beta.
|
|
27
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
28
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
24
|
+
"@ikas/storefront-api": "^6.1.0-beta.77",
|
|
25
|
+
"@ikas/storefront-config": "^6.1.0-beta.77",
|
|
26
|
+
"@ikas/storefront-model-functions": "^6.1.0-beta.77",
|
|
27
|
+
"@ikas/storefront-models": "^6.1.0-beta.77",
|
|
28
|
+
"@ikas/storefront-providers": "^6.1.0-beta.77",
|
|
29
29
|
"@ikas/localized-address": "1.0.0-beta.6",
|
|
30
30
|
"@adyen/adyen-web": "^5.57.0",
|
|
31
31
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@ikas/localized-address": "1.0.0-beta.6",
|
|
63
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
64
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
65
|
-
"@ikas/storefront-model-functions": "^6.1.0-beta.
|
|
66
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
67
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
63
|
+
"@ikas/storefront-api": "^6.1.0-beta.77",
|
|
64
|
+
"@ikas/storefront-config": "^6.1.0-beta.77",
|
|
65
|
+
"@ikas/storefront-model-functions": "^6.1.0-beta.77",
|
|
66
|
+
"@ikas/storefront-models": "^6.1.0-beta.77",
|
|
67
|
+
"@ikas/storefront-providers": "^6.1.0-beta.77",
|
|
68
68
|
"mobx": "^6.1.3",
|
|
69
69
|
"mobx-react-lite": "^3.1.5",
|
|
70
70
|
"next": "12.2.0",
|