@ikas/storefront 4.8.0-beta.4 → 4.8.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/analytics/facebookPixel.js +1 -1
- package/build/analytics/googleTagManager.js +1 -1
- package/build/components/checkout/components/epaykolay-button/index.js +1 -1
- package/build/components/checkout/components/epaykolay-button/style.module.scss.js +1 -1
- package/build/components/checkout/components/svg/epaykolay.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +1 -0
- package/build/components/checkout/model.js +1 -1
- package/build/components/google-captcha/index.js +1 -1
- package/build/components/link/index.js +1 -1
- package/build/components/page/head.js +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as t}from"mobx";var n="undefined"==typeof window,r=function(){function r(){t(this)}return r.productView=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewContent",(r=t,{content_name:r.name,content_category:r.categories.length>0?r.categories[0].path.map((function(t){return t.name})).join(" > "):"",content_ids:[r.selectedVariant.id],content_type:"product",value:r.selectedVariant.price.finalPrice,currency:""===r.selectedVariant.price.currency?"TRY":r.selectedVariant.price.currency})))}catch(t){console.error(t)}var r},r.addToCart=function(t,r,e){try{return void(!n&&window.fbq&&window.fbq("track","AddToCart",function(t,n){var r,e=[];t.variant.categories&&(null===(r=t.variant.categories[0].categoryPath)||void 0===r||r.map((function(t){return e.push(t.name)}))),t.variant.categories&&t.variant.categories.length>0&&e.push(t.variant.categories[0].name);var o=e.length>0?e.join(" > "):"";return{content_name:t.variant.name,content_category:o,content_ids:[t.variant.id],content_type:"product",value:t.finalPrice,currency:t.currencyCode}}(t),{eventID:e}))}catch(t){console.error(t)}},r.beginCheckout=function(t){try{return void(!n&&window.fbq&&window.fbq("track","InitiateCheckout",e(t)))}catch(t){console.error(t)}},r.purchase=function(t,r){try{return void(!n&&window.fbq&&window.fbq("track","Purchase",e(t),{eventID:r}))}catch(t){console.error(t)}},r.addToWishlist=function(t){try{return void(!n&&window.fbq&&window.fbq("track","AddToWishlist",{content_ids:[t]}))}catch(t){console.error(t)}},r.search=function(t){try{return void(!n&&window.fbq&&window.fbq("track","Search",{search_string:t}))}catch(t){console.error(t)}},r.completeRegistration=function(){try{return void(!n&&window.fbq&&window.fbq("track","CompleteRegistration",{status:!0,value:0,currency:"TRY"}))}catch(t){console.error(t)}},r.viewCart=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewCart",function(t){var n=[],r=[];return t.items.map((function(t){n.push(t.variant.id||""),r.push({id:t.variant.id,quantity:t.quantity})})),{contents:r,content_type:"product_group",content_ids:n,currency:t.items[0].currencyCode,value:t.totalPrice,num_items:t.items.length}}(t)))}catch(t){console.error(t)}},r.viewCategory=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewCategory",{content_name:t}))}catch(t){console.error(t)}},r.contactForm=function(){try{return void(!n&&window.fbq&&window.fbq("track","ContactForm",{}))}catch(t){console.error(t)}},r}();function e(t){var n=[],r=[];return t.items.map((function(t){n.push(t.variant.id||""),r.push({id:t.variant.id,quantity:t.quantity})})),{contents:r,content_category:"",content_type:"
|
|
1
|
+
import{makeAutoObservable as t}from"mobx";var n="undefined"==typeof window,r=function(){function r(){t(this)}return r.productView=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewContent",(r=t,{content_name:r.name,content_category:r.categories.length>0?r.categories[0].path.map((function(t){return t.name})).join(" > "):"",content_ids:[r.selectedVariant.id],content_type:"product",value:r.selectedVariant.price.finalPrice,currency:""===r.selectedVariant.price.currency?"TRY":r.selectedVariant.price.currency})))}catch(t){console.error(t)}var r},r.addToCart=function(t,r,e){try{return void(!n&&window.fbq&&window.fbq("track","AddToCart",function(t,n){var r,e=[];t.variant.categories&&(null===(r=t.variant.categories[0].categoryPath)||void 0===r||r.map((function(t){return e.push(t.name)}))),t.variant.categories&&t.variant.categories.length>0&&e.push(t.variant.categories[0].name);var o=e.length>0?e.join(" > "):"";return{content_name:t.variant.name,content_category:o,content_ids:[t.variant.id],content_type:"product",value:t.finalPrice,currency:t.currencyCode}}(t),{eventID:e}))}catch(t){console.error(t)}},r.beginCheckout=function(t){try{return void(!n&&window.fbq&&window.fbq("track","InitiateCheckout",e(t)))}catch(t){console.error(t)}},r.purchase=function(t,r){try{return void(!n&&window.fbq&&window.fbq("track","Purchase",e(t),{eventID:r}))}catch(t){console.error(t)}},r.addToWishlist=function(t){try{return void(!n&&window.fbq&&window.fbq("track","AddToWishlist",{content_ids:[t]}))}catch(t){console.error(t)}},r.search=function(t){try{return void(!n&&window.fbq&&window.fbq("track","Search",{search_string:t}))}catch(t){console.error(t)}},r.completeRegistration=function(){try{return void(!n&&window.fbq&&window.fbq("track","CompleteRegistration",{status:!0,value:0,currency:"TRY"}))}catch(t){console.error(t)}},r.viewCart=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewCart",function(t){var n=[],r=[];return t.items.map((function(t){n.push(t.variant.id||""),r.push({id:t.variant.id,quantity:t.quantity})})),{contents:r,content_type:"product_group",content_ids:n,currency:t.items[0].currencyCode,value:t.totalPrice,num_items:t.items.length}}(t)))}catch(t){console.error(t)}},r.viewCategory=function(t){try{return void(!n&&window.fbq&&window.fbq("track","ViewCategory",{content_name:t}))}catch(t){console.error(t)}},r.contactForm=function(){try{return void(!n&&window.fbq&&window.fbq("track","ContactForm",{}))}catch(t){console.error(t)}},r}();function e(t){var n=[],r=[];return t.items.map((function(t){n.push(t.variant.id||""),r.push({id:t.variant.id,quantity:t.quantity})})),{contents:r,content_category:"",content_type:"product",content_ids:n,currency:t.items[0].currencyCode,value:t.totalFinalPrice,num_items:t.items.length}}export{r as FacebookPixel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}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/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/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/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 t}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/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 o}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"../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 r}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";var
|
|
1
|
+
import{makeAutoObservable as e}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/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/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/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 t}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/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 o}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"../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 r}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";import a from"lodash/cloneDeep";var i="undefined"==typeof window,s=function(){function s(){e(this)}return s.pageView=function(e){try{var t={event:"page-view-GTM",page:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.productView=function(e){var t,o;try{var r={event:"view_item-GTM",ecommerce:{items:[d(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)||""}}};return!i&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},s.addToCart=function(e,o){var a=r.getInstance().cartStore.cart;try{var s={event:"add_to_cart-GTM",ecommerce:{items:[e instanceof t?d(e,o):n(e,o)],cart:a}};return!i&&window.dataLayer&&window.dataLayer.push(s),s}catch(e){console.error(e)}},s.removeFromCart=function(e,o){var a=r.getInstance().cartStore.cart;try{var s={event:"remove_from_cart-GTM",ecommerce:{items:[e instanceof t?d(e,o):n(e,o)],cart:0===(null==a?void 0:a.itemCount)?null:a}};return!i&&window.dataLayer&&window.dataLayer.push(s),s}catch(e){console.error(e)}},s.beginCheckout=function(e){try{var t={event:"begin_checkout-GTM",ecommerce:{items:e.items.map((function(e){return n(e,e.quantity)}))}};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.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 n(e,e.quantity)}))}}};return!i&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},s.checkoutStep=function(e,t){var r,s,d=a(e);null===(r=d.shippingAddress)||void 0===r||delete r.checkoutSettings,null===(s=d.billingAddress)||void 0===s||delete s.checkoutSettings;var n="";t===o.INFO?n="checkout_info-GTM":t===o.SHIPPING?n="checkout_shipping-GTM":t===o.PAYMENT?n="checkout_payment-GTM":t===o.SUCCESS&&(n="checkout_success-GTM");try{var m={event:n,ecommerce:{cart:d}};return!i&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},s.disableHTML=function(){try{!i&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},s.completeRegistration=function(e){try{var t={event:"customer_register-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.search=function(e){try{var t={event:"search-GTM",search_string:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.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!i&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},s.customerLogin=function(e){try{var t={event:"customer_login-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.customerVisit=function(e){try{var t={event:"customer_visit-GTM",customer:e};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s.viewCart=function(e){try{var t={event:"view_cart-GTM",ecommerce:{cart:e}};return!i&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},s}();function d(e,t){var o;return void 0===t&&(t=1),{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:e.categories.length?e.categories[0].name:"",item_category_2:e.categories.length>1?e.categories[1].name:"",item_category_3:e.categories.length>2?e.categories[2].name:"",item_category_4:e.categories.length>3?e.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function n(e,t){var o;return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:null===(o=e.variant.variantValues)||void 0===o?void 0:o.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{s as GoogleTagManager};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import a from"./style.module.scss.js";import
|
|
1
|
+
import*as e from"react";import a from"./style.module.scss.js";import t from"../svg/epaykolay.js";var l=function(l){return e.createElement("div",{className:a.Container},e.createElement("div",{className:a.LeftContent},e.createElement("strong",null,"Bi' tıkla gerisi e-Pay Kolay!"),e.createElement("div",{className:a.Description},"Kart ve adres bilgilerini her defasında girmeden, birden fazla ödeme seçeneğiyle alışveriş kolaylığı e-Pay Kolay ile yaşayın.")),e.createElement("div",{className:a.RightContent},e.createElement("div",{className:a.EPayKolayButton,onClick:l.onClick},e.createElement("div",{className:a.Icon},e.createElement(t,null)),e.createElement("div",{className:a.ButtonText}," ile Al")),e.createElement("div",{className:a.EPayKolayDescription},"e-Pay Kolay bir Türkiye İş Bankası markasıdır.")))};export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var
|
|
1
|
+
import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={Container:"style-module_Container__oDKWq",LeftContent:"style-module_LeftContent__97sbP",Description:"style-module_Description__XDDJ8",RightContent:"style-module_RightContent__-jdoh",EPayKolayButton:"style-module_EPayKolayButton__c8OjL",Icon:"style-module_Icon__0t3CD",ButtonText:"style-module_ButtonText__G12-2",EPayKolayDescription:"style-module_EPayKolayDescription__xxQ58"};n(".style-module_Container__oDKWq {\n width: 100%;\n padding: 20px 24px;\n background-color: rgb(237, 238, 240);\n border-radius: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.style-module_Container__oDKWq .style-module_LeftContent__97sbP {\n flex: 1 1 auto;\n}\n.style-module_Container__oDKWq .style-module_LeftContent__97sbP strong {\n font-size: 14px;\n color: #4C556C;\n font-weight: 700;\n margin-bottom: 2px;\n line-height: 20px;\n}\n.style-module_Container__oDKWq .style-module_LeftContent__97sbP .style-module_Description__XDDJ8 {\n font-size: 14px;\n color: #4C556C;\n line-height: 20px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh {\n width: 192px;\n flex: 0 0 auto;\n margin-left: 31px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayButton__c8OjL {\n height: 50px;\n width: 190px;\n display: flex;\n background-color: #013682;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.3s;\n padding: 13px 22px 13px 22px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayButton__c8OjL .style-module_Icon__0t3CD {\n margin-top: 2px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayButton__c8OjL .style-module_ButtonText__G12-2 {\n color: white;\n margin-left: 4.36px;\n font-weight: 600;\n font-size: 16px;\n line-height: 22.79px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayDescription__xxQ58 {\n color: #013682;\n font-size: 9.1px;\n margin-top: 4px;\n font-style: italic;\n letter-spacing: -0.02em;\n}\n@media only screen and (max-width: 1440px) {\n .style-module_Container__oDKWq .style-module_RightContent__-jdoh {\n margin-left: 16px;\n }\n .style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayButton__c8OjL .style-module_ButtonText__G12-2 {\n margin-top: 0px;\n }\n}\n@media only screen and (max-width: 1280px) {\n .style-module_Container__oDKWq {\n flex-direction: column;\n }\n .style-module_Container__oDKWq .style-module_RightContent__-jdoh {\n margin-left: 0;\n margin-top: 12px;\n }\n}\n@media only screen and (max-width: 1024px) {\n .style-module_Container__oDKWq {\n margin: 0 12px;\n margin-top: 20px;\n width: calc(100% - 24px);\n margin-bottom: 24px;\n }\n}");export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as C from"react";var e=function(e){return e.className,C.createElement("svg",{width:"101",height:"22",viewBox:"0 0 101 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{"clip-path":"url(#clip0_6858_149691)"},C.createElement("path",{d:"M69.4952 15.4336C69.1677 15.4343 68.8462 15.3456 68.5654 15.1771C68.2846 15.0086 68.0553 14.7666 67.9022 14.4773L66.4754 11.7834H66.4305L65.9991 14.2371C65.9405 14.5697 65.7665 14.871 65.5076 15.0882C65.2488 15.3053 64.9216 15.4245 64.5836 15.4246H63.3613L65.179 5.0981C65.2377 4.76332 65.4128 4.45999 65.6734 4.24153C65.934 4.02306 66.2634 3.90346 66.6035 3.90381H67.8438L66.5923 10.9101H66.6395L68.9627 8.42728C69.1395 8.2449 69.3516 8.10031 69.586 8.00229C69.8205 7.90428 70.0724 7.85487 70.3265 7.85708H72.5913L68.929 11.3973L71.3219 15.4381L69.4952 15.4336Z",fill:"white"}),C.createElement("path",{d:"M75.2392 15.6469C74.7198 15.6528 74.2027 15.577 73.7069 15.4224C73.2597 15.2807 72.845 15.0518 72.4869 14.749C72.1326 14.4489 71.8496 14.0739 71.6584 13.6511C71.4672 13.2282 71.3726 12.7682 71.3814 12.3043C71.379 11.6911 71.4878 11.0827 71.7027 10.5083C71.907 9.95429 72.2202 9.44671 72.6239 9.01548C73.0363 8.58147 73.5313 8.23419 74.0799 7.99406C74.6913 7.73182 75.3513 7.60177 76.0166 7.61242C76.5434 7.60625 77.068 7.68198 77.5715 7.83691C78.0221 7.97474 78.4412 8.19976 78.805 8.49916C79.1499 8.787 79.4282 9.14623 79.6206 9.55201C79.8254 9.98702 79.9277 10.4632 79.9194 10.9439C79.9227 11.5629 79.8138 12.1774 79.5981 12.7577C79.3926 13.3126 79.0761 13.8198 78.6679 14.2483C78.2517 14.6828 77.7519 15.0287 77.1985 15.2653C76.5783 15.5248 75.9116 15.6547 75.2392 15.6469ZM77.5153 11.2245C77.5296 10.8034 77.3789 10.3934 77.0951 10.0818C76.9419 9.92667 76.757 9.80629 76.5531 9.72882C76.3492 9.65135 76.131 9.61861 75.9133 9.63283C75.6076 9.62927 75.3053 9.69691 75.0303 9.83038C74.7698 9.9581 74.54 10.1403 74.3562 10.3647C74.1696 10.5967 74.0251 10.8596 73.9293 11.1414C73.8278 11.4407 73.7769 11.7548 73.7788 12.0708C73.7641 12.4876 73.9115 12.8938 74.19 13.2045C74.3416 13.3593 74.5249 13.4795 74.7273 13.557C74.9297 13.6345 75.1465 13.6674 75.3628 13.6534C75.662 13.6599 75.9588 13.5988 76.2311 13.4748C76.5034 13.3508 76.7442 13.1671 76.9356 12.9373C77.1267 12.7081 77.2738 12.4455 77.3693 12.1628C77.4699 11.8604 77.5193 11.5432 77.5153 11.2245Z",fill:"white"}),C.createElement("path",{d:"M80.2129 15.4335L82.0104 5.23495C82.075 4.86552 82.2684 4.53085 82.5562 4.29011C82.844 4.04937 83.2078 3.91807 83.5832 3.91944H84.7313L82.6844 15.4335H80.2129Z",fill:"white"}),C.createElement("path",{d:"M91.6556 10.0727C91.6556 10.2142 91.6556 10.3668 91.6331 10.5217C91.6106 10.6766 91.5949 10.8427 91.5657 10.9954L91.0467 13.9497C90.9945 14.2162 90.9563 14.4852 90.9321 14.7556C90.919 14.9381 90.8375 15.1088 90.7037 15.2337C90.57 15.3586 90.3939 15.4284 90.2108 15.4291H88.7302C88.7302 15.3168 88.7302 15.1866 88.7459 15.0407C88.7616 14.8948 88.7706 14.7534 88.7908 14.6209H88.7504C88.1932 15.2809 87.421 15.6109 86.4339 15.6109C86.1591 15.6102 85.8853 15.5771 85.6183 15.5121C85.3457 15.4493 85.0873 15.3358 84.8566 15.1776C84.6247 15.0166 84.4345 14.8026 84.3017 14.5536C84.1468 14.2606 84.0695 13.9329 84.077 13.6017C84.051 13.0673 84.2096 12.5403 84.5263 12.1089C84.8436 11.7137 85.2555 11.4049 85.7239 11.2109C86.2588 10.9835 86.823 10.8324 87.4 10.7619C88.0244 10.6811 88.6533 10.6406 89.2829 10.6407C89.3006 10.5671 89.3104 10.4919 89.3121 10.4162V10.2793C89.3208 10.1594 89.2992 10.0392 89.2494 9.92975C89.1995 9.82032 89.123 9.72515 89.0268 9.65295C88.7604 9.50201 88.4562 9.43108 88.1505 9.44866C87.7931 9.45039 87.439 9.51734 87.1057 9.64621C86.9956 9.68662 86.881 9.73152 86.7867 9.78091C86.6007 9.87334 86.3879 9.89677 86.1863 9.84702C85.9846 9.79727 85.8072 9.67757 85.6857 9.50927C85.6119 9.40852 85.5607 9.29305 85.5356 9.17074C85.5105 9.04843 85.5121 8.92214 85.5402 8.80049C85.5683 8.67884 85.6224 8.56468 85.6987 8.46579C85.775 8.3669 85.8717 8.2856 85.9823 8.22744C86.2228 8.10568 86.4722 8.00213 86.7282 7.91764C87.2947 7.72384 87.8888 7.62301 88.4875 7.61907C88.9136 7.6156 89.3384 7.66461 89.7525 7.76499C90.1114 7.84958 90.4508 8.00198 90.7523 8.21397C91.0317 8.41353 91.2621 8.67371 91.4264 8.97499C91.5916 9.31663 91.6703 9.69359 91.6556 10.0727ZM88.9594 12.1134C88.6538 12.1134 88.3437 12.1268 88.0292 12.1515C87.7415 12.1714 87.4572 12.2249 87.1821 12.3109C86.9563 12.3794 86.7468 12.4932 86.5665 12.6454C86.4861 12.7151 86.4224 12.8019 86.38 12.8994C86.3377 12.9969 86.3177 13.1026 86.3216 13.2089C86.3069 13.3311 86.3287 13.4549 86.3843 13.5647C86.4399 13.6746 86.5267 13.7655 86.6339 13.8262C86.849 13.9347 87.0872 13.9894 87.3282 13.9856C87.7606 13.9989 88.1813 13.8435 88.501 13.5523C88.8116 13.2694 89.0208 12.8924 89.0964 12.4793L89.1728 12.1134H88.9594Z",fill:"white"}),C.createElement("path",{d:"M96.0294 16.5764C95.8048 16.9715 95.5801 17.3262 95.3666 17.6404C95.1664 17.9371 94.9251 18.2039 94.6499 18.4329C94.3838 18.6506 94.0789 18.8159 93.7511 18.92C93.371 19.0387 92.9742 19.0956 92.576 19.0884C92.457 19.0884 92.3514 19.0884 92.2323 19.0884C92.1156 19.0803 92.002 19.0476 91.8989 18.9925C91.7958 18.9373 91.7056 18.8611 91.634 18.7686C91.5625 18.6762 91.5114 18.5697 91.484 18.4561C91.4566 18.3425 91.4536 18.2245 91.4751 18.1096L91.5425 17.7415C91.5832 17.5461 91.6916 17.3714 91.8486 17.2482C92.0057 17.125 92.2012 17.0612 92.4008 17.068C92.7016 17.0864 92.9984 16.9911 93.2321 16.8008C93.4622 16.5816 93.6556 16.3269 93.8051 16.0466L94.1691 15.4225L92.4322 7.85718H93.6658C94.0653 7.85746 94.4515 8.00071 94.7545 8.26097C95.0574 8.52124 95.257 8.88131 95.3172 9.27595L95.8632 12.8229H95.8924L97.9438 8.78208C98.0823 8.505 98.2952 8.27181 98.5586 8.10851C98.822 7.9452 99.1256 7.85819 99.4356 7.85718H101.008L96.0294 16.5764Z",fill:"white"}),C.createElement("path",{d:"M26.2181 12.2953C26.2079 12.3402 26.2026 12.3861 26.2024 12.4322C26.199 12.6326 26.2494 12.8303 26.3484 13.0047C26.4444 13.1713 26.5737 13.3165 26.7281 13.4312C26.8903 13.5482 27.0711 13.637 27.2629 13.6939C27.4631 13.7552 27.6713 13.7862 27.8807 13.7859C28.2335 13.7902 28.5825 13.7134 28.9008 13.5614C28.9958 13.5158 29.088 13.4648 29.1772 13.4088C29.3452 13.2972 29.5441 13.2413 29.7458 13.249C29.9474 13.2566 30.1415 13.3274 30.3006 13.4514C30.425 13.5445 30.5246 13.6667 30.5907 13.8072C30.6568 13.9477 30.6875 14.1023 30.6799 14.2574C30.6724 14.4125 30.6269 14.5634 30.5475 14.6968C30.468 14.8303 30.357 14.9422 30.2242 15.0228C30.0279 15.137 29.8228 15.2354 29.6108 15.3169C28.9926 15.5492 28.3368 15.6656 27.6763 15.6604C27.1769 15.6643 26.6801 15.5886 26.2046 15.4359C25.7709 15.2992 25.3691 15.0771 25.0228 14.7826C24.6829 14.4869 24.4129 14.1197 24.2319 13.7073C24.0317 13.2465 23.9328 12.7482 23.942 12.2459C23.9321 11.6254 24.0419 11.0087 24.2656 10.4298C24.4835 9.88353 24.8047 9.38431 25.2115 8.95937C25.62 8.53809 26.11 8.20431 26.6517 7.97835C27.2358 7.73463 27.8635 7.61241 28.4964 7.61916C28.9604 7.61661 29.4215 7.69251 29.8602 7.84365C30.2518 7.97464 30.6127 8.18392 30.9207 8.45875C31.2205 8.73678 31.4546 9.07803 31.606 9.45773C31.7754 9.89404 31.8578 10.3592 31.8487 10.8271C31.8448 11.0591 31.8275 11.2908 31.797 11.5208C31.7673 11.7343 31.6618 11.93 31.4997 12.0722C31.3376 12.2144 31.1297 12.2936 30.914 12.2953H26.2181ZM29.6782 10.8024C29.689 10.753 29.6943 10.7026 29.6939 10.652V10.4994C29.699 10.3409 29.6696 10.1832 29.608 10.0372C29.5463 9.89109 29.4538 9.76005 29.3367 9.65304C29.0501 9.41216 28.6813 9.29148 28.3076 9.3163C28.0537 9.31222 27.8017 9.36195 27.5684 9.46222C27.3603 9.55122 27.1671 9.6716 26.9955 9.81916C26.8394 9.95515 26.7059 10.115 26.6 10.2928C26.5016 10.4481 26.426 10.6167 26.3754 10.7934L29.6782 10.8024Z",fill:"white"}),C.createElement("path",{d:"M32.2402 12.4321L32.5907 10.4993H36.4328L36.0958 12.4321H32.2402Z",fill:"white"}),C.createElement("path",{d:"M37.3267 19.0815C37.1517 19.0815 36.9787 19.0432 36.8201 18.9694C36.6614 18.8955 36.5208 18.7878 36.4082 18.6539C36.2956 18.52 36.2136 18.3631 36.1682 18.1942C36.1227 18.0253 36.1147 17.8485 36.1449 17.6762L37.6345 9.22643C37.7064 8.84142 37.9109 8.49369 38.2126 8.24356C38.5142 7.99344 38.894 7.85669 39.286 7.85704H40.1959L40.014 8.90765H40.0589C40.3414 8.52827 40.7093 8.22065 41.1329 8.00969C41.5707 7.79049 42.0542 7.67817 42.5439 7.68194C43.0048 7.67385 43.4628 7.75623 43.892 7.92439C44.2715 8.07517 44.6145 8.30472 44.8986 8.59786C45.1771 8.89616 45.3898 9.24947 45.5232 9.635C45.6682 10.0537 45.7404 10.494 45.7367 10.937C45.7402 11.5619 45.6345 12.1826 45.4243 12.7711C45.2292 13.3216 44.9319 13.8303 44.5481 14.2707C44.1712 14.6876 43.7153 15.0257 43.2067 15.2652C42.6815 15.5159 42.1059 15.6434 41.5238 15.6379C41.0228 15.65 40.5261 15.543 40.0746 15.3258C39.6923 15.1409 39.3739 14.8462 39.1602 14.4795H39.1287L38.5086 18.0938C38.4594 18.371 38.3139 18.6221 38.0978 18.8028C37.8816 18.9834 37.6086 19.0822 37.3267 19.0815ZM43.2898 11.2379C43.3004 10.8238 43.1598 10.4201 42.8944 10.1019C42.7486 9.94235 42.5686 9.81769 42.3679 9.73724C42.1671 9.65678 41.9508 9.6226 41.735 9.63724C41.4389 9.63516 41.1463 9.70284 40.8812 9.8348C40.6236 9.96687 40.3945 10.1484 40.2072 10.3691C40.0122 10.5991 39.86 10.8622 39.7578 11.1458C39.645 11.4426 39.5878 11.7577 39.5893 12.0752C39.5814 12.2854 39.615 12.4951 39.6882 12.6924C39.7615 12.8896 39.8729 13.0704 40.0162 13.2246C40.1694 13.3773 40.3529 13.4961 40.5549 13.5735C40.757 13.6508 40.973 13.6849 41.1891 13.6736C41.492 13.679 41.7921 13.6137 42.0653 13.4828C42.325 13.3608 42.555 13.1839 42.7394 12.9642C42.918 12.732 43.0534 12.4697 43.1393 12.1897C43.2416 11.8852 43.2925 11.5658 43.2898 11.2446V11.2379Z",fill:"white"}),C.createElement("path",{d:"M53.5333 10.0727C53.5333 10.2142 53.5333 10.3668 53.5108 10.5217C53.4884 10.6766 53.4726 10.8427 53.4434 10.9954L52.9244 13.9497C52.8722 14.2161 52.834 14.4851 52.8098 14.7556V14.7691C52.793 14.9487 52.7099 15.1156 52.5765 15.2373C52.4431 15.3589 52.2692 15.4265 52.0886 15.4268H50.6079C50.6079 15.3146 50.6079 15.1844 50.6236 15.0384C50.6394 14.8925 50.6484 14.7511 50.6686 14.6186H50.6371C50.0799 15.2786 49.3077 15.6086 48.3206 15.6086C48.0458 15.6082 47.772 15.5751 47.505 15.5099C47.2297 15.4502 46.9683 15.339 46.7344 15.1821C46.5021 15.0208 46.3111 14.807 46.1771 14.558C46.0272 14.2637 45.9538 13.9363 45.9637 13.6062C45.9377 13.0718 46.0963 12.5447 46.4131 12.1133C46.738 11.7187 47.1577 11.4128 47.6331 11.2244C48.1689 10.9973 48.7338 10.8461 49.3115 10.7754C49.9358 10.6946 50.5648 10.6541 51.1943 10.6542C51.2121 10.5806 51.2218 10.5053 51.2235 10.4297V10.2927C51.2309 10.1675 51.2053 10.0426 51.1493 9.93037C51.0933 9.81812 51.0089 9.72247 50.9045 9.65293C50.6382 9.502 50.3339 9.43107 50.0282 9.44865C49.6697 9.45225 49.3148 9.52149 48.9812 9.65293C48.8711 9.69334 48.7565 9.73824 48.6621 9.78763C48.4758 9.87976 48.2628 9.90302 48.0609 9.85331C47.8589 9.8036 47.6811 9.68411 47.5589 9.51599C47.4844 9.4148 47.4326 9.29868 47.4072 9.17562C47.3818 9.05255 47.3834 8.92545 47.4118 8.80304C47.4401 8.68063 47.4947 8.5658 47.5717 8.46645C47.6487 8.36709 47.7463 8.28555 47.8578 8.22742C48.6361 7.83814 49.4927 7.63014 50.363 7.61906C50.7891 7.61573 51.2139 7.66473 51.628 7.76497C51.9869 7.84957 52.3262 8.00197 52.6278 8.21395C52.9071 8.41352 53.1376 8.6737 53.3019 8.97497C53.4679 9.31642 53.5473 9.69339 53.5333 10.0727ZM50.8371 12.1133C50.5315 12.1133 50.2215 12.1268 49.9069 12.1515C49.6193 12.1712 49.3349 12.2247 49.0598 12.3109C48.8335 12.3798 48.6234 12.4936 48.442 12.6454C48.3623 12.7155 48.2992 12.8024 48.2572 12.8998C48.2152 12.9973 48.1955 13.1028 48.1993 13.2089C48.1846 13.3311 48.2064 13.4549 48.262 13.5647C48.3176 13.6746 48.4044 13.7655 48.5116 13.8262C48.7266 13.9349 48.9649 13.9896 49.2059 13.9856C49.6383 13.9989 50.059 13.8435 50.3787 13.5523C50.6894 13.2694 50.8985 12.8924 50.9741 12.4793L51.0483 12.1223L50.8371 12.1133Z",fill:"white"}),C.createElement("path",{d:"M57.9079 16.5764C57.6832 16.9715 57.4585 17.3262 57.2338 17.6405C57.0336 17.9371 56.7923 18.2039 56.5171 18.4329C56.251 18.6506 55.946 18.8159 55.6183 18.9201C55.2382 19.0388 54.8414 19.0956 54.4432 19.0884C54.3241 19.0884 54.2185 19.0884 54.0995 19.0884C53.9828 19.0803 53.8692 19.0476 53.7661 18.9925C53.663 18.9374 53.5727 18.8611 53.5012 18.7687C53.4297 18.6762 53.3786 18.5697 53.3512 18.4561C53.3238 18.3426 53.3208 18.2245 53.3423 18.1096L53.4029 17.7796C53.4398 17.5773 53.5466 17.3943 53.7047 17.2626C53.8628 17.1309 54.0621 17.0589 54.268 17.059C54.5688 17.0775 54.8656 16.9821 55.0993 16.7919C55.3293 16.5726 55.5228 16.318 55.6723 16.0376L56.0362 15.4135L54.3107 7.85719H55.2094C55.7047 7.85782 56.1834 8.03533 56.5591 8.35766C56.9349 8.67999 57.183 9.12592 57.2585 9.61495L57.7438 12.8139H57.7731L59.7121 8.97964C59.8872 8.64028 60.1528 8.35586 60.4795 8.15779C60.8062 7.95972 61.1813 7.85569 61.5635 7.85719H62.8801L57.9079 16.5764Z",fill:"white"}),C.createElement("path",{d:"M20.8507 3.52221L12.0206 0.235682H11.9959C11.0979 -0.0665352 10.126 -0.0704726 9.22556 0.224458H9.19635L0.4494 3.52221C0.33726 3.56559 0.238219 3.63714 0.161859 3.72995C0.0854988 3.82276 0.0344024 3.93369 0.0135124 4.05201C0.00446901 4.09558 -4.86163e-05 4.13996 3.13281e-05 4.18446V14.8275C-0.00332389 15.7178 0.2629 16.5883 0.76374 17.3247C1.26458 18.0611 1.97662 18.629 2.80634 18.9536L10.3827 21.9461C10.5479 22.0117 10.732 22.0117 10.8972 21.9461L14.3079 20.5789C14.4371 20.5277 14.5479 20.4389 14.626 20.3241C14.7042 20.2092 14.746 20.0735 14.746 19.9347V15.7457L18.496 14.2573C19.3257 13.9326 20.0378 13.3648 20.5386 12.6284C21.0395 11.892 21.3057 11.0215 21.3023 10.1312V4.22038C21.3034 4.20243 21.3034 4.18444 21.3023 4.1665C21.3003 4.02628 21.2561 3.8899 21.1756 3.77503C21.0951 3.66016 20.9819 3.57209 20.8507 3.52221Z",fill:"white"}),C.createElement("path",{d:"M20.6088 4.17323L10.662 8.11751L0.697266 4.17323L9.43748 0.879962C10.1964 0.630833 11.0152 0.630833 11.7742 0.879962L20.6088 4.17323Z",fill:"#51C5DA"}),C.createElement("path",{d:"M10.6523 8.11758V21.3064H10.6816L14.0518 19.9594V10.6139L18.1096 8.88309V10.7172L14.8292 12.1494V14.9713L18.2399 13.6108C18.9385 13.3352 19.5379 12.8559 19.9602 12.2354C20.3826 11.6148 20.6083 10.8817 20.6081 10.1313V4.18677L10.6523 8.11758Z",fill:"#EC008C"}),C.createElement("path",{d:"M3.92373 14.0487L10.653 16.8772V8.12212H10.6261L0.697269 4.18457V14.8276C0.69626 15.5779 0.921418 16.3112 1.34342 16.9318C1.76541 17.5524 2.36469 18.0317 3.06319 18.3072L10.6261 21.2929L10.653 21.3042V17.8089L3.9125 14.8905L3.92373 14.0487ZM3.92373 9.21988L7.92311 10.8811V12.8095L3.92149 11.0764L3.92373 9.21988Z",fill:"#004385"})),C.createElement("defs",null,C.createElement("clipPath",{id:"clip0_6858_149691"},C.createElement("rect",{width:"101",height:"22",fill:"white"}))))};export{e as default};
|
|
1
|
+
import*as C from"react";var e=function(e){return e.className,C.createElement("svg",{width:"104",height:"22",viewBox:"0 0 104 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M34.1927 10.98L34.5334 9.08674H38.2822L37.9414 10.98H34.1927Z",fill:"white"}),C.createElement("path",{d:"M27.8314 11.0179C27.8314 11.0558 27.8314 11.0937 27.8314 11.1694C27.8314 11.3587 27.8693 11.5481 27.9828 11.7374C28.0586 11.8889 28.21 12.0403 28.3615 12.1539C28.513 12.2675 28.7023 12.3432 28.8916 12.419C29.081 12.4947 29.2703 12.4947 29.4975 12.4947C29.8761 12.4947 30.2169 12.419 30.482 12.3054C30.5577 12.2675 30.6713 12.2297 30.747 12.1539C31.0878 11.9267 31.5044 11.9646 31.8452 12.1918C32.3374 12.5704 32.3374 13.4035 31.7694 13.7064C31.5801 13.82 31.3908 13.9336 31.1636 14.0093C30.5956 14.2365 29.9519 14.3501 29.2703 14.3501C28.7402 14.3501 28.2858 14.2744 27.8314 14.1229C27.377 13.9715 26.9983 13.7821 26.6954 13.4792C26.3546 13.2142 26.1274 12.8355 25.9381 12.419C25.7488 12.0025 25.673 11.5102 25.673 10.9801C25.673 10.3364 25.7866 9.76838 26.0138 9.20039C26.241 8.6324 26.5439 8.17801 26.9226 7.76149C27.3013 7.34497 27.7935 7.04204 28.3236 6.81485C28.8538 6.58765 29.4596 6.47406 30.1033 6.47406C30.5956 6.47406 31.05 6.54979 31.4286 6.66339C31.8452 6.81485 32.1859 7.00418 32.451 7.26924C32.7539 7.5343 32.9433 7.83722 33.1326 8.25375C33.284 8.6324 33.3598 9.08679 33.3598 9.57905C33.3598 9.76838 33.3598 9.99557 33.3219 10.2606C33.284 10.715 32.8675 11.0179 32.451 11.0179H27.8314ZM31.2014 9.54118C31.2014 9.50331 31.2014 9.42759 31.2014 9.38972C31.2014 9.35185 31.2014 9.27612 31.2014 9.23826C31.2014 8.89747 31.0878 8.6324 30.8606 8.40521C30.6334 8.17801 30.2927 8.06442 29.8761 8.06442C29.6111 8.06442 29.3839 8.10228 29.1567 8.21588C28.9295 8.29161 28.7402 8.44308 28.5887 8.55667C28.4372 8.70814 28.2858 8.8596 28.21 9.01106C28.0964 9.16253 28.0586 9.35186 28.0207 9.50332H31.2014V9.54118Z",fill:"white"}),C.createElement("path",{d:"M44.0378 3.82358C45.2874 3.82358 46.234 4.08864 46.8778 4.58089C47.5215 5.11101 47.8623 5.83046 47.8623 6.73924C47.8623 7.34509 47.7487 7.91308 47.5215 8.36747C47.2943 8.82186 46.9914 9.20051 46.5748 9.50344C46.1583 9.80637 45.6661 9.99569 45.0981 10.1472C44.5301 10.2986 43.8864 10.3365 43.2048 10.3365H41.8416L41.3115 13.3279C41.1979 13.8959 40.7056 14.3124 40.1377 14.3124H38.8124C38.7366 14.3124 38.6988 14.2745 38.7366 14.1988L40.4406 4.54302C40.5163 4.08863 40.895 3.78571 41.3494 3.78571H44.0378V3.82358ZM43.2805 8.40533C43.9242 8.40533 44.4544 8.29174 44.833 8.10241C45.2117 7.91308 45.401 7.53442 45.401 7.0043C45.401 6.7771 45.3631 6.58777 45.2874 6.43631C45.2117 6.28485 45.0981 6.17125 44.9466 6.05765C44.7951 5.98192 44.6058 5.90619 44.4165 5.86832C44.2272 5.83046 43.9621 5.83046 43.7349 5.83046H42.7125L42.2581 8.40533H43.2805Z",fill:"white"}),C.createElement("path",{d:"M54.7539 8.8218C54.7539 8.97326 54.7539 9.12473 54.716 9.27619C54.716 9.42765 54.6782 9.57911 54.6403 9.73058L54.148 12.6084C54.1102 12.8734 54.0723 13.1385 54.0345 13.4036C53.9966 13.7822 53.6937 14.0473 53.315 14.0473H51.8761C51.8761 13.9337 51.8761 13.8201 51.8761 13.6686C51.8761 13.5172 51.914 13.4036 51.914 13.2521H51.8761C51.346 13.8958 50.5887 14.1987 49.6042 14.1987C49.3391 14.1987 49.074 14.1609 48.809 14.0851C48.5439 14.0094 48.2789 13.8958 48.0517 13.7443C47.8245 13.5929 47.6351 13.4036 47.5215 13.1385C47.3701 12.8734 47.3322 12.5705 47.3322 12.1919C47.3322 11.586 47.4837 11.1316 47.7866 10.753C48.0895 10.3743 48.4682 10.0714 48.9604 9.88204C49.4527 9.69271 49.9828 9.54125 50.5887 9.46552C51.1945 9.38979 51.8004 9.35192 52.4062 9.35192C52.4441 9.27619 52.4441 9.20046 52.4441 9.16259C52.4441 9.12472 52.4441 9.08686 52.4441 9.01113C52.4441 8.7082 52.3305 8.51888 52.1412 8.36741C51.9518 8.21595 51.6489 8.17808 51.2703 8.17808C50.9295 8.17808 50.5887 8.25382 50.2479 8.36741C50.1343 8.40528 50.0207 8.44314 49.9071 8.51887C49.5284 8.7082 49.1119 8.59461 48.8847 8.29168L48.809 8.21595C48.5439 7.83729 48.6575 7.26931 49.074 7.04211C49.3012 6.92851 49.5663 6.81491 49.8692 6.70132C50.4372 6.51199 51.0052 6.3984 51.5732 6.3984C52.0276 6.3984 52.4441 6.43626 52.8227 6.54986C53.2014 6.62559 53.5043 6.77705 53.8073 7.00424C54.0723 7.19357 54.2995 7.45863 54.451 7.76156C54.6782 8.06449 54.7539 8.40528 54.7539 8.8218ZM52.1033 10.8287C51.8004 10.8287 51.4974 10.8287 51.1945 10.8665C50.8916 10.9044 50.6265 10.9423 50.3615 11.018C50.1343 11.0937 49.9071 11.2073 49.7556 11.3588C49.6042 11.5103 49.5284 11.6617 49.5284 11.9268C49.5284 12.2297 49.642 12.419 49.8314 12.5326C50.0207 12.6462 50.2479 12.6841 50.5129 12.6841C50.9673 12.6841 51.346 12.5326 51.6489 12.2676C51.9518 12.0025 52.1412 11.6239 52.2169 11.2073L52.2926 10.8665H52.1033V10.8287Z",fill:"white"}),C.createElement("path",{d:"M59.1463 15.183C58.9191 15.5616 58.7298 15.9024 58.5026 16.2054C58.2754 16.5083 58.0482 16.7733 57.821 16.9627C57.5559 17.152 57.2909 17.3413 56.9501 17.4549C56.6093 17.5685 56.2306 17.6064 55.8141 17.6064C55.7005 17.6064 55.5491 17.6064 55.4355 17.6064C54.9811 17.5685 54.6403 17.1141 54.716 16.6597L54.7917 16.2811C54.8675 15.9024 55.2083 15.6374 55.6248 15.6374C55.9656 15.6374 56.2306 15.5616 56.42 15.3723C56.6093 15.183 56.7986 14.9558 56.988 14.6529L57.3288 14.047L55.6248 6.70105H56.8744C57.6695 6.70105 58.3133 7.26903 58.4269 8.06421L58.957 11.5479H58.9948L61.0017 7.57196C61.2668 7.04184 61.8348 6.70105 62.4028 6.70105H63.9553L59.1463 15.183Z",fill:"white"}),C.createElement("path",{d:"M78.1931 14.2756C77.6629 14.2756 77.1707 14.1999 76.7163 14.0484C76.2619 13.8969 75.8454 13.6697 75.5425 13.4047C75.2017 13.1396 74.9366 12.7988 74.7473 12.3823C74.5579 11.9658 74.4443 11.5114 74.4443 11.0191C74.4443 10.4133 74.5579 9.80743 74.7473 9.27731C74.9366 8.70932 75.2395 8.25493 75.656 7.83841C76.0347 7.42189 76.527 7.0811 77.0571 6.8539C77.6251 6.58884 78.2309 6.47525 78.9504 6.47525C79.4805 6.47525 80.0106 6.55097 80.465 6.70244C80.9194 6.8539 81.3359 7.0811 81.6767 7.34616C82.0175 7.61122 82.2826 7.95201 82.4719 8.36853C82.6612 8.78506 82.7748 9.23944 82.7748 9.7317C82.7748 10.3375 82.6612 10.9434 82.4719 11.5114C82.2826 12.0794 81.9796 12.5338 81.5631 12.9503C81.1844 13.3668 80.6922 13.7076 80.1242 13.9348C79.5562 14.162 78.9125 14.2756 78.1931 14.2756ZM80.4271 9.95889C80.4271 9.50451 80.2757 9.12585 80.0106 8.86079C79.7455 8.55786 79.3669 8.4064 78.8746 8.4064C78.5717 8.4064 78.2688 8.48213 78.0037 8.59572C77.7387 8.70932 77.5115 8.89865 77.36 9.12585C77.1707 9.35304 77.0571 9.58024 76.9435 9.88316C76.8299 10.1861 76.792 10.489 76.792 10.7919C76.792 11.2463 76.9435 11.625 77.2085 11.89C77.4736 12.193 77.8523 12.3444 78.3445 12.3444C78.6474 12.3444 78.9504 12.2687 79.2154 12.1551C79.4805 12.0415 79.7077 11.8522 79.8591 11.625C80.0485 11.3978 80.1999 11.1706 80.2757 10.8677C80.3893 10.5647 80.4271 10.2618 80.4271 9.95889Z",fill:"white"}),C.createElement("path",{d:"M83.2291 14.047L84.8573 4.7699C84.933 4.27765 85.3874 3.89899 85.8797 3.89899H87.4322L85.6525 14.047H83.2291Z",fill:"white"}),C.createElement("path",{d:"M94.3996 8.82299C94.3996 8.97445 94.3996 9.12591 94.3617 9.27738C94.3617 9.42884 94.3239 9.5803 94.286 9.73177L93.7937 12.6096C93.7559 12.8746 93.718 13.1397 93.6801 13.4047C93.6423 13.7834 93.3394 14.0485 92.9607 14.0485H91.5218C91.5218 13.9349 91.5218 13.8213 91.5218 13.6698C91.5218 13.5183 91.5597 13.4047 91.5597 13.2533H91.5218C90.9917 13.897 90.2344 14.1999 89.2499 14.1999C88.9848 14.1999 88.7197 14.1621 88.4547 14.0863C88.1896 14.0106 87.9245 13.897 87.6974 13.7455C87.4702 13.5941 87.2808 13.4047 87.1672 13.1397C87.0158 12.8746 86.9779 12.5717 86.9779 12.193C86.9779 11.5872 87.1294 11.1328 87.4323 10.7541C87.7352 10.3755 88.1139 10.0726 88.6061 9.88323C89.0984 9.6939 89.6285 9.54244 90.2344 9.46671C90.8402 9.39097 91.4461 9.35311 92.0519 9.35311C92.0898 9.27738 92.0898 9.20164 92.0898 9.16378C92.0898 9.12591 92.0898 9.08805 92.0898 9.01232C92.0898 8.70939 91.9762 8.52006 91.7869 8.3686C91.5975 8.21714 91.2946 8.17927 90.9159 8.17927C90.5751 8.17927 90.2344 8.255 89.8936 8.3686C89.78 8.40647 89.6664 8.44433 89.5528 8.52006C89.1741 8.70939 88.7576 8.5958 88.5304 8.29287L88.4547 8.21714C88.1896 7.83848 88.3032 7.27049 88.7197 7.0433C88.9469 6.9297 89.212 6.8161 89.5149 6.70251C90.0829 6.51318 90.6509 6.39958 91.2189 6.39958C91.6733 6.39958 92.0898 6.43745 92.4684 6.55104C92.8471 6.62678 93.15 6.77824 93.453 7.00543C93.718 7.19476 93.9452 7.45982 94.0967 7.76275C94.3239 8.06567 94.3996 8.40647 94.3996 8.82299ZM91.7869 10.8299C91.4839 10.8299 91.181 10.8299 90.8781 10.8677C90.5752 10.9056 90.3101 10.9435 90.045 11.0192C89.8178 11.0949 89.5906 11.2085 89.4392 11.36C89.2877 11.5115 89.212 11.6629 89.212 11.928C89.212 12.2309 89.3256 12.4202 89.5149 12.5338C89.7042 12.6474 89.9314 12.6853 90.1965 12.6853C90.6509 12.6853 91.0295 12.5338 91.3325 12.2688C91.6354 12.0037 91.8247 11.6251 91.9005 11.2085L91.9762 10.8677H91.7869V10.8299Z",fill:"white"}),C.createElement("path",{d:"M98.7919 15.2215C98.5647 15.6002 98.3753 15.941 98.1482 16.2439C97.921 16.5468 97.6938 16.8119 97.4666 17.0012C97.2015 17.1905 96.9364 17.3799 96.5957 17.4935C96.2549 17.6071 95.8762 17.6449 95.4597 17.6449C95.3461 17.6449 95.1946 17.6449 95.081 17.6449C94.6266 17.6071 94.2858 17.1527 94.3616 16.6983L94.4373 16.3196C94.513 15.941 94.8538 15.6759 95.2704 15.6759C95.6111 15.6759 95.8762 15.6002 96.0655 15.4109C96.2549 15.2215 96.4442 14.9943 96.6335 14.6914L96.9743 14.0856L95.2704 6.7396H96.8229C97.4287 6.7396 97.9588 7.19399 98.0346 7.79984L98.6025 11.5864H98.6404L100.761 7.42118C100.988 7.00466 101.405 6.7396 101.859 6.7396H103.639L98.7919 15.2215Z",fill:"white"}),C.createElement("path",{d:"M72.8159 14.1232C72.3616 14.1232 71.945 13.896 71.7178 13.5174L69.143 9.3143H69.1051L68.4614 13.063C68.3478 13.6689 67.8177 14.1232 67.2118 14.1232H65.9244L67.5526 4.95974C67.6662 4.35388 68.1963 3.89949 68.8022 3.89949H70.0896L69.3323 8.17832H69.3702L73.0431 4.27815C73.2703 4.01309 73.6111 3.86163 73.9898 3.86163H76.4889L71.4906 8.74631L75.1258 14.0854H72.8159V14.1232Z",fill:"white"}),C.createElement("path",{d:"M20.8262 3.52151L12.0034 0.227195C12.0034 0.227195 12.0034 0.227195 11.9656 0.227195C11.0568 -0.0757315 10.1102 -0.0757315 9.20138 0.227195H9.16351L0.454391 3.52151C0.227196 3.59725 0.0757315 3.82444 0 4.05163C0 4.0895 0 4.12737 0 4.2031V14.8434C0 16.6609 1.09811 18.2892 2.80207 18.9707L10.3752 21.9621C10.4509 22 10.5645 22 10.6403 22C10.716 22 10.7917 22 10.8675 21.9621L14.2754 20.599C14.5405 20.4854 14.6919 20.2203 14.6919 19.9552V15.7522L18.4406 14.2754C20.1446 13.5938 21.2427 12.0034 21.2427 10.148V4.24096V4.2031C21.2806 3.90017 21.0912 3.63511 20.8262 3.52151Z",fill:"white"}),C.createElement("path",{d:"M20.5611 4.16482L10.6403 8.10286L0.719482 4.16482L9.42861 0.8705C10.1859 0.605439 11.019 0.643305 11.7763 0.8705L20.5611 4.16482Z",fill:"#44C0E8"}),C.createElement("path",{d:"M10.6404 8.10277V21.28H10.6782L14.0483 19.9169V10.6019L18.0999 8.86009V10.6776L14.8056 12.1165V14.9186L18.2135 13.5554C19.6524 12.9875 20.5612 11.6243 20.5612 10.0718V4.12687L10.6404 8.10277Z",fill:"#E0006D"}),C.createElement("path",{d:"M3.938 14.049C3.938 14.049 10.0344 16.6239 10.6402 16.8889V8.14194H10.6024L0.681549 4.24176V14.882C0.681549 16.4345 1.62819 17.7977 3.02922 18.3657L10.5645 21.3571H10.6024V17.8734L3.90014 14.9578L3.938 14.049ZM3.938 9.20218L7.91391 10.8683V12.7994L3.938 11.0576V9.20218Z",fill:"#004385"}))};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import a from"next/link.js";import n from"react-tooltip";import s,{CheckoutStep as c}from"./model.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CouponErrorCode as h,Coupon as g,CartSummary as E}from"./components/cart-summary/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 f}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/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/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/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/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{ContactForm as y}from"../../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{StepSuccess as k}from"./steps/step-success/index.js";import{Modal as x}from"./components/modal/index.js";import j from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import b from"./components/master-pass/modal-success/index.js";import{Image as N}from"../image/index.js";import F,{Step as S}from"./components/step-container/index.js";import{StockError as T}from"./components/error/stock-error/index.js";import{FullscreenLoading as P}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as w}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as O}from"./components/button/index.js";import{IkasPageHead as I}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/svg/ikas.js";import V from"./style.module.scss.js";import{Analytics as R}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import U from"./components/epaykolay-button/index.js";var _=i((function(i){var a,m,p,u=i.checkout,v=i.checkoutSettings,h=i.customizationProps,g=i.returnPolicy,y=i.privacyPolicy,N=i.termsOfService,F=i.imprint,S=i.shippingPolicy,M=d().t,w=r(),A=o.useState((function(){return new s(u,v,w,g,y,N,F,S,M,h||{})}))[0];A.step===c.PAYMENT&&R.disableHTML();var O=function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()},body:JSON.stringify({cartId:A.checkout.id,customerNumber:o,sessionsState:Date.now()})})];case 1:return[2,t.sent().json()]}}))}))};o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&w.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),R.beginCheckout(A.checkout),R.pageView(f.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=h,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(h)}),[h]),o.useEffect((function(){if(A.isEPayKolayEnabled)var o=setInterval((function(){var i;window.setContainerService&&A.isCheckoutLoaded&&(window.setContainerService(null===(i=l.getMerchantSettings())||void 0===i?void 0:i.merchantId,O,(function(o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,_(o)];case 1:return[2,e.sent()]}}))}))}),(function(){console.log("Switching to epaykolay"),A.isEPayKolayPayment=!0}),"https://cdn-epeykolay.mncdn.com/epay/"),clearInterval(o))}),100)}),[]);var _=o.useCallback((function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/complete-payment"),{method:"POST",body:JSON.stringify({data:o,cartId:A.checkout.id}),headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()}})];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),[2,"".concat(window.location.pathname,"?id=").concat(A.checkout.id,"&step=").concat(e.success?"success":"info")]}}))}))}),[]);if(!A.isCheckoutLoaded||!A.store.customerStore.initialized)return o.createElement(P,null);if(A.checkout.hasCustomer&&(null===(a=A.store.customerStore.customer)||void 0===a?void 0:a.id)!==(null===(m=A.checkout.customer)||void 0===m?void 0:m.id))return w.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null;return o.createElement(o.Fragment,null,o.createElement(I,{pageType:f.CHECKOUT,pageTitle:((null===(p=A.merchantSettings)||void 0===p?void 0:p.merchantName)||"")+" - "+M("checkout-page:securePayment"),pageDescription:M("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:V.CheckoutPage},o.createElement(n,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:V.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[V.Left,A.isEPayKolayPayment?V.epaykolay:""].join(" ")},A.isEPayKolayEnabled&&o.createElement("div",{id:"plateau_ui_placeholder",style:{width:"100%"}}),!A.isEPayKolayPayment&&o.createElement("div",{className:V.LeftContent},o.createElement("div",null,o.createElement(D,{vm:A}),o.createElement("div",null,A.step!==c.SUCCESS&&A.isEPayKolayEnabled&&o.createElement(U,{onClick:function(){window.frictionless()}})),A.hasStockError&&o.createElement("div",{className:V.ErrorContainer},o.createElement(T,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(E,{vm:A,allowExpand:!0}),A.step===c.SUCCESS?o.createElement(k,{vm:A}):o.createElement(o.Fragment,null,A.checkoutCampaignOffer&&o.createElement(B,{vm:A,campaignOffer:A.checkoutCampaignOffer}),A.isCouponCodeRequirementOpen&&o.createElement(K,{vm:A}),o.createElement(H,{vm:A}))),o.createElement("div",{className:V.Space})),o.createElement(Y,{vm:A}))),o.createElement("div",{className:V.Right},o.createElement("div",{className:V.RightContent},o.createElement(E,{vm:A}),o.createElement("div",{className:V.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===l.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(L,null))))),!!A.policyModalText&&o.createElement(x,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(X,{vm:A,setVisible:A.setContactModalVisible}),A.mpVM.isOtpModalVisible&&o.createElement(j,{vm:A,visible:A.mpVM.isOtpModalVisible,type:A.mpVM.otpModalType,onClose:A.mpVM.hideOtpModal}),A.mpVM.isResponseModalVisible&&o.createElement(C,{visible:A.mpVM.isResponseModalVisible,text:A.mpVM.mfsResponseModalText,onClose:A.mpVM.onResponseModalClose}),A.mpVM.isSuccessModalVisible&&o.createElement(b,{visible:A.mpVM.isSuccessModalVisible,type:A.mpVM.successModalType,onClose:A.mpVM.onSuccessModalClose})))})),D=i((function(e){var t,i,r,n=e.vm,s=d().t;return o.createElement("div",{className:V.Header},o.createElement(a,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=n.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:V.Logo},o.createElement(N,{layout:"fill",image:n.merchantSettings.logo,sizes:"360px"})):(null===(i=n.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!n.checkout.hasCustomer&&o.createElement("div",{className:V.LoginText},o.createElement("span",{className:V.LoginCta},s("checkout-page:alreadyHaveAnAccount")),o.createElement(a,{href:"/account/login?redirect="+encodeURIComponent(n.checkoutUrl),passHref:!0},o.createElement("a",{className:V.LoginBtn},s("checkout-page:actions.login")))),n.checkout.hasCustomer&&o.createElement("div",{className:V.CustomerInfo},o.createElement("div",{className:V.Name},n.checkout.customerFullName),o.createElement("div",{className:V.Email},null===(r=n.checkout.customer)||void 0===r?void 0:r.email)))})),K=i((function(e){var t=e.vm,i=d().t,r=o.useState(!1),a=r[0],n=r[1],s=o.useState(null),c=s[0],l=s[1],m=o.useMemo((function(){switch(c){case h.COUPON_CODE_NOT_EXIST:return i("checkout-page:giftCodeErrorDescription");case h.COUPON_CODE_NOT_EXIST_FOR_GUESS:return i("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[c]);return o.createElement("div",{className:V.CouponContainer},a&&o.createElement("div",{className:V.NotificationContainer},o.createElement(M,{type:"warning",title:i("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){n(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:a?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:n,setCouponErrorCode:l})))})),H=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(p,{vm:t});case c.SHIPPING:return o.createElement(u,{vm:t});case c.PAYMENT:return o.createElement(v,{vm:t});case c.SUCCESS:return o.createElement(k,{vm:t})}}),[t,t.step]),a=[new S(i("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:V.AdressStepInfo},o.createElement(z,{vm:t}),o.createElement("div",{className:V.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(z,{vm:t})):void 0),new S(i("checkout-page:payment"),t.step===c.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||a.splice(1,0,new S(i("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:V.AdressStepInfo},o.createElement(G,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(G,{vm:t})):void 0)),o.createElement(F,{steps:a,stepContent:r})})),z=i((function(e){var t,i,r,a,n,s,c,l,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(a=p.checkout.shippingAddress)||void 0===a?void 0:a.lastName)||"");return o.createElement("div",{className:V.Address},o.createElement("div",{className:[V.Text,V.WithMBottom].join(" ")},(null===(n=p.checkout.customer)||void 0===n?void 0:n.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:V.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:V.Text},u("checkout-page:receiver")),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},v)),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(s=p.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=p.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[V.Text,V.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:V.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:V.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),Y=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:V.Footer},o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),X=i((function(i){var r,a,n,s=i.vm,c=i.setVisible,l=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],E=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];E.email=(null===(r=s.checkout.customer)||void 0===r?void 0:r.email)||"",E.firstName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.firstName)||"",E.lastName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.lastName)||"";var f=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,c(!1)]:(u(!0),[4,E.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(x,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(w,{type:A.TEXT_AREA,label:"",value:E.message||"",onChange:E.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(O,{style:{width:"100%",marginTop:"24px"},text:l(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!E.message,onClick:f})),onClose:function(){return c(!1)}})}));export{_ as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import n from"next/link.js";import a from"react-tooltip";import s,{CheckoutStep as c}from"./model.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CouponErrorCode as h,Coupon as g,CartSummary as E}from"./components/cart-summary/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 y}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/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/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/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/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{ContactForm as f}from"../../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{StepSuccess as k}from"./steps/step-success/index.js";import{Modal as x}from"./components/modal/index.js";import j from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import b from"./components/master-pass/modal-success/index.js";import{Image as N}from"../image/index.js";import F,{Step as P}from"./components/step-container/index.js";import{StockError as S}from"./components/error/stock-error/index.js";import{FullscreenLoading as T}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as w}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as O}from"./components/button/index.js";import{IkasPageHead as I}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/svg/ikas.js";import V from"./style.module.scss.js";import{Analytics as U}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import R from"./components/epaykolay-button/index.js";var _=i((function(i){var n,m,p,u=i.checkout,v=i.checkoutSettings,h=i.customizationProps,g=i.returnPolicy,f=i.privacyPolicy,N=i.termsOfService,F=i.imprint,P=i.shippingPolicy,M=d().t,w=r(),A=o.useState((function(){return new s(u,v,w,g,f,N,F,P,M,h||{})}))[0];A.step===c.PAYMENT&&U.disableHTML();var O=function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()},body:JSON.stringify({cartId:A.checkout.id,customerNumber:o,sessionsState:Date.now()})})];case 1:return[2,t.sent().json()]}}))}))};o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&w.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),U.beginCheckout(A.checkout),U.pageView(y.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=h,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(h)}),[h]),o.useEffect((function(){if(A.isEPayKolayEnabled)var o=setInterval((function(){var i;window.setContainerService&&A.isCheckoutLoaded&&(window.setContainerService(null===(i=l.getMerchantSettings())||void 0===i?void 0:i.merchantId,O,(function(o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,_(o)];case 1:return[2,e.sent()]}}))}))}),(function(){console.log("Switching to epaykolay"),A.isEPayKolayPayment=!0}),"https://cdn-epeykolay.mncdn.com/epay/"),clearInterval(o))}),100)}),[]);var _=o.useCallback((function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/complete-payment"),{method:"POST",body:JSON.stringify({data:o,cartId:A.checkout.id}),headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()}})];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),[2,{redirectUrl:"".concat(window.location.pathname,"?id=").concat(A.checkout.id,"&step=").concat(e.success?"success":"info"),orderId:A.checkout.id}]}}))}))}),[]);if(!A.isCheckoutLoaded||!A.store.customerStore.initialized)return o.createElement(T,null);if(A.checkout.hasCustomer&&(null===(n=A.store.customerStore.customer)||void 0===n?void 0:n.id)!==(null===(m=A.checkout.customer)||void 0===m?void 0:m.id))return w.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null;return o.createElement(o.Fragment,null,o.createElement(I,{pageType:y.CHECKOUT,pageTitle:((null===(p=A.merchantSettings)||void 0===p?void 0:p.merchantName)||"")+" - "+M("checkout-page:securePayment"),pageDescription:M("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:V.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:V.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[V.Left,A.isEPayKolayPayment?V.epaykolay:""].join(" ")},A.isEPayKolayEnabled&&o.createElement("div",{id:"plateau_ui_placeholder",style:{width:"100%"}}),!A.isEPayKolayPayment&&o.createElement("div",{className:V.LeftContent},o.createElement("div",null,o.createElement(D,{vm:A}),A.hasStockError&&o.createElement("div",{className:V.ErrorContainer},o.createElement(S,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(E,{vm:A,allowExpand:!0}),o.createElement("div",null,A.step!==c.SUCCESS&&A.isEPayKolayEnabled&&o.createElement(R,{onClick:function(){window.frictionless()}})),A.step===c.SUCCESS?o.createElement(k,{vm:A}):o.createElement(o.Fragment,null,A.checkoutCampaignOffer&&o.createElement(B,{vm:A,campaignOffer:A.checkoutCampaignOffer}),A.isCouponCodeRequirementOpen&&o.createElement(H,{vm:A}),o.createElement(K,{vm:A}))),o.createElement("div",{className:V.Space})),o.createElement(Y,{vm:A}))),o.createElement("div",{className:V.Right},o.createElement("div",{className:V.RightContent},o.createElement(E,{vm:A}),!A.isPoweredByHidden&&o.createElement("div",{className:V.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===l.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(L,null))))),!!A.policyModalText&&o.createElement(x,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(X,{vm:A,setVisible:A.setContactModalVisible}),A.mpVM.isOtpModalVisible&&o.createElement(j,{vm:A,visible:A.mpVM.isOtpModalVisible,type:A.mpVM.otpModalType,onClose:A.mpVM.hideOtpModal}),A.mpVM.isResponseModalVisible&&o.createElement(C,{visible:A.mpVM.isResponseModalVisible,text:A.mpVM.mfsResponseModalText,onClose:A.mpVM.onResponseModalClose}),A.mpVM.isSuccessModalVisible&&o.createElement(b,{visible:A.mpVM.isSuccessModalVisible,type:A.mpVM.successModalType,onClose:A.mpVM.onSuccessModalClose})))})),D=i((function(e){var t,i,r,a=e.vm,s=d().t;return o.createElement("div",{className:V.Header},o.createElement(n,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:V.Logo},o.createElement(N,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:V.LoginText},o.createElement("span",{className:V.LoginCta},s("checkout-page:alreadyHaveAnAccount")),o.createElement(n,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:V.LoginBtn},s("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:V.CustomerInfo},o.createElement("div",{className:V.Name},a.checkout.customerFullName),o.createElement("div",{className:V.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),H=i((function(e){var t=e.vm,i=d().t,r=o.useState(!1),n=r[0],a=r[1],s=o.useState(null),c=s[0],l=s[1],m=o.useMemo((function(){switch(c){case h.COUPON_CODE_NOT_EXIST:return i("checkout-page:giftCodeErrorDescription");case h.COUPON_CODE_NOT_EXIST_FOR_GUESS:return i("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[c]);return o.createElement("div",{className:V.CouponContainer},n&&o.createElement("div",{className:V.NotificationContainer},o.createElement(M,{type:"warning",title:i("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l})))})),K=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(p,{vm:t});case c.SHIPPING:return o.createElement(u,{vm:t});case c.PAYMENT:return o.createElement(v,{vm:t});case c.SUCCESS:return o.createElement(k,{vm:t})}}),[t,t.step]),n=[new P(i("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:V.AdressStepInfo},o.createElement(z,{vm:t}),o.createElement("div",{className:V.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(z,{vm:t})):void 0),new P(i("checkout-page:payment"),t.step===c.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||n.splice(1,0,new P(i("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:V.AdressStepInfo},o.createElement(G,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(G,{vm:t})):void 0)),o.createElement(F,{steps:n,stepContent:r})})),z=i((function(e){var t,i,r,n,a,s,c,l,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className:V.Address},o.createElement("div",{className:[V.Text,V.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:V.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:V.Text},u("checkout-page:receiver")),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},v)),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(s=p.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=p.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[V.Text,V.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:V.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:V.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),Y=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:V.Footer},o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),X=i((function(i){var r,n,a,s=i.vm,c=i.setVisible,l=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],E=o.useState(new f({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];E.email=(null===(r=s.checkout.customer)||void 0===r?void 0:r.email)||"",E.firstName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.firstName)||"",E.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var y=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,c(!1)]:(u(!0),[4,E.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(x,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(w,{type:A.TEXT_AREA,label:"",value:E.message||"",onChange:E.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(O,{style:{width:"100%",marginTop:"24px"},text:l(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!E.message,onClick:y})),onClose:function(){return c(!1)}})}));export{_ as default};
|
|
@@ -111,6 +111,7 @@ export default class CheckoutViewModel {
|
|
|
111
111
|
get customerAddresses(): IkasLocalizedCustomerAddress[] | undefined;
|
|
112
112
|
get isManualOrder(): boolean;
|
|
113
113
|
get isEPayKolayEnabled(): boolean;
|
|
114
|
+
get isPoweredByHidden(): boolean;
|
|
114
115
|
saveCart: () => Promise<import("../../models").IkasCart | null | undefined>;
|
|
115
116
|
inStockDeliveryInputData: (input: SaveCartInput) => Promise<SaveCartInput>;
|
|
116
117
|
checkStocks: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from"lodash/cloneDeep";import r from"lodash/sortBy";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{IkasCouponCodeRequirement as o,IkasPaymentMethodType as a,IkasPaymentGatewayType as c,IkasOrderShippingMethod as d,IkasCartCreatedBy as u,IkasTransactionStatus as l,IkasCartCampaignOfferStatus as h,IkasCampaignOfferTargetPageType as p}from"@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{IkasCheckout as m}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as g}from"../../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{IkasCustomerAddress as f}from"../../models/data/customer/address/index.js";import{IkasLocalizedCustomerAddress as v}from"../../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/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{IkasMerchantSettings as y}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import{IkasOrderCustomer as S}from"../../models/data/order/customer/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/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/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 k}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/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{LocalizedAddressModel as b}from"@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 C from"./components/credit-card-form/model.js";import P from"../../store/customer/api.js";import I from"../../store/checkout/index.js";import A from"../../store/cart/api.js";import w,{MFS_ELEMENT_ID as N,MFS_SCRIPT_URL as O}from"./modelMasterPass.js";import j from"../../store/product/index.js";import{IkasBaseStore as E}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as R}from"@ikas/storefront-config";import{Analytics as x}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{SaveCartInput as D,CheckStocksLineInput as T}from"@ikas/storefront-api";import G from"../../models/data/order/address/ikas-localized-order-address.js";import L from"../../store/location/index.js";var M,V,_=/^\d+$/,U="undefined"==typeof localStorage,K=function(){function _(d,u,v,y,_,K,B,Y,H,q){var W=this;this.storefront=null,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.isEPayKolayPayment=!1,this.step=M.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.klarnaResponse=null,this.isKlarnaPaymentCompleted=!1,this.adyenResponse=null,this.payPalClientIdResponse=null,this.paypalOrderResponse=null,this.shippingZones=null,this.policyModalTitle="",this.policyModalText="",this.error=null,this.couponError=null,this.showTestModal=!1,this.init=function(){return e(W,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,this.countrySettings.waitUntilInitialized()];case 1:return e.sent(),[4,E.getInstance().customerStore.waitUntilInitialized()];case 2:return e.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getCampaignOffer()];case 3:return e.sent(),[4,this.initStep()];case 4:return e.sent(),[2]}}))}))},this.initStep=function(){return e(W,void 0,void 0,(function(){var e,s,n,r,a,c,d;return t(this,(function(t){switch(t.label){case 0:if(R.getIsEditor())return this.step=M.INFO,this.isCheckoutLoaded=!0,[2];if(e=new URLSearchParams(window.location.search),s=e.get("step"),n=e.get("failed"),r=e.get("error"),s){if(this.step=s,this.step===M.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(M.INFO)];if(this.step!==M.PAYMENT||this.canProceedToPayment){if(this.step===M.SUCCESS&&!this.canProceedToPayment)return[2,this.changeStep(M.INFO)];if(![M.INFO,M.SUCCESS,M.SHIPPING,M.PAYMENT].includes(this.step))return[2,this.changeStep(M.INFO)]}else{if(!this.isInStoreDelivery)return this.isValidShippingSettings?[2,this.changeStep(M.INFO)]:[2,this.changeStep(M.SHIPPING)];this.deliveryMethod="in-store"}}return n&&(this.error={type:V.PAYMENT_ERROR,data:r||null}),this.step!==M.SHIPPING&&this.step!==M.PAYMENT||(this.checkoutSettings=new g(i(i({},this.checkoutSettings),{couponCodeRequirement:o.DEFAULT}))),this.step!==M.INFO?[3,6]:this.isDigitalOnly?[3,3]:[4,this.getAvailableShippingZones()];case 1:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getShippingCountries()];case 2:t.sent(),this.checkShippingCountries(),t.label=3;case 3:return[4,this.getStockLocations()];case 4:return t.sent(),[4,this.getAvailableStockLocations()];case 5:t.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),t.label=6;case 6:return this.step!==M.SHIPPING||1!==(null===(c=this.checkout.availableShippingMethods)||void 0===c?void 0:c.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=M.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==M.SHIPPING||(null===(d=this.checkout.availableShippingMethods)||void 0===d?void 0:d.length)?this.step!==M.PAYMENT&&this.step!==M.SUCCESS?[3,10]:[4,this.listPaymentGateways()]:(this.error={type:V.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 7:return t.sent(),this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,9];case 8:t.sent(),t.label=9;case 9:if(!this.paymentGateways.length)return this.error={type:V.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];t.label=10;case 10:return this.step===M.SUCCESS?[3,14]:this.checkout.isComplete?[2,this.changeStep(M.SUCCESS)]:[3,11];case 11:return[4,this.initialStockCheck()];case 12:t.sent(),t.label=13;case 13:return[3,16];case 14:return[4,this.getSuccessTransaction()];case 15:t.sent(),this.successTransaction&&(a=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(e){return e.id===a}))),t.label=16;case 16:return this.isCheckoutLoaded=!0,x.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getSuccessTransaction=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,P.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return e=t.sent(),this.successTransaction=e.isSuccess&&(null===(i=e.data)||void 0===i?void 0:i.length)?e.data[e.data.length-1]:void 0,[2]}}))}))},this.saveCart=function(){return e(W,void 0,void 0,(function(){var e,i,s,n;return t(this,(function(t){switch(t.label){case 0:return e=new D(this.checkout),"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(e)];case 1:e=t.sent(),t.label=2;case 2:return this.step!==M.INFO&&this.step!==M.SHIPPING||this.isDigitalOnly||(e.billingAddress=null),this.isDigitalOnly&&(e.shippingAddress=null),[4,A.saveCart({input:e})];case 3:if((null==(i=t.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(n=s.extensions)||void 0===n?void 0:n.code)?{type:V.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:V.API_ERROR,data:i.firstErrorMessage};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return e(W,void 0,void 0,(function(){var e,s,n=this;return t(this,(function(t){return e=i,(s=this.stockLocations.find((function(e){return e.id===n.checkout.stockLocationId})))&&e.shippingAddress&&s.address&&(e.shippingAddress.country=s.address.country,e.shippingAddress.city=s.address.city,e.shippingAddress.state=s.address.state,e.shippingAddress.district=s.address.district,e.shippingAddress.postalCode=s.address.postalCode,e.shippingAddress.addressLine1=s.address.address||"",e.shippingAddress.addressLine2=null),[2,e]}))}))},this.checkStocks=function(){return e(W,void 0,void 0,(function(){var e,i,s,n,r,o,a,c,d,u,l,h;return t(this,(function(t){switch(t.label){case 0:return this.isManualOrder?[2]:(e=this.checkout.items.map((function(e){return{quantity:e.quantity,variantId:e.variant.id,productId:e.variant.productId}})),[4,I.checkStocks({lines:e.map((function(e){return new T(e)})),stockLocationIdList:(null===(u=R.getStockLocationIds())||void 0===u?void 0:u.length)?R.getStockLocationIds():null})]);case 1:if(!(i=t.sent()).isSuccess)throw{type:V.API_ERROR,data:i.firstErrorMessage};if(null==(s=null===(h=null===(l=i.data)||void 0===l?void 0:l.lines)||void 0===h?void 0:h.filter((function(e){return!e.isAvailable})))?void 0:s.length){for(n=[],r=function(e){var t=o.checkout.items.find((function(t){return t.variant.id===e.variantId}));t&&n.push({item:t,stockCount:e.stockCount})},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:V.STOCK_ERROR,data:n}}return[2]}}))}))},this.setIsKlarnaPaymentCompleted=function(i){return e(W,void 0,void 0,(function(){return t(this,(function(e){return this.isKlarnaPaymentCompleted=i,[2]}))}))},this.removeUnavailableItems=function(i){return e(W,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:e=0,s=i,t.label=1;case 1:return e<s.length?(n=s[e],[4,E.getInstance().cartStore.changeItemQuantity(n.item,n.stockCount<0?0:n.stockCount)]):[3,4];case 2:t.sent(),t.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.getAvailableShippingCountries({salesChannelId:R.getSalesChannelId()})];case 1:return e=t.sent(),this.shippingCountryIds=e.data,[2]}}))}))},this.getStockLocations=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return R.getPickupStockLocationIds()?[4,I.listStockLocation({id:{in:R.getPickupStockLocationIds()}})]:[3,2];case 1:if(!(e=t.sent()).isSuccess||!(null===(i=e.data)||void 0===i?void 0:i.length))return this.error={type:V.API_ERROR,data:e.firstErrorMessage},[2];this.stockLocations=e.data,t.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return R.getPickupStockLocationIds()?(e=this.checkout.items.map((function(e){return{quantity:e.quantity,variantId:e.variant.id,productId:e.variant.productId}})),[4,I.getAvailableStockLocations({lines:e.map((function(e){return new T(e)})),stockLocationIdList:R.getPickupStockLocationIds()})]):[3,2];case 1:if(!(i=t.sent()).isSuccess)return this.error={type:V.API_ERROR},[2];this.availableStockLocations=i.data||[],t.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var e;(null===(e=W.shippingCountryIds)||void 0===e?void 0:e.length)||(W.error={type:V.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(e){"address"===e&&(W.checkout.stockLocationId=null),W.deliveryMethod=e,W.isErrorsVisible=!1},this.initialStockCheck=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return t.sent(),[3,3];case 2:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:V.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return e(W,void 0,void 0,(function(){var e,i,s,n,o,a,c,d,u,l,h=this;return t(this,(function(t){switch(t.label){case 0:return e="local"===process.env.NEXT_PUBLIC_ENV,i=R.getPaymentGateways().map((function(e){return e.id})),[4,I.listPaymentGateway({id:e?void 0:{in:i},locale:R.getCurrentLocale(),transactionAmount:this.checkout.totalFinalPrice})];case 1:return(s=t.sent()).isSuccess&&(null===(u=s.data)||void 0===u?void 0:u.length)?(n=s.data,this.step===M.PAYMENT&&(n=n.filter((function(e){var t;return!(null===(t=e.supportedCurrencies)||void 0===t?void 0:t.length)||e.supportedCurrencies.includes(h.checkout.currencyCode)})),(o=null===(l=this.checkout.shippingAddress)||void 0===l?void 0:l.country)&&o.iso2&&(n=n.filter((function(e){var t;return!(null===(t=e.availableCountries)||void 0===t?void 0:t.length)||e.availableCountries.includes(o.iso2||"")})))),a=[],r(R.getPaymentGateways(),"order").forEach((function(e){var t=null==n?void 0:n.find((function(t){return t.id===e.id}));t&&a.push(t)})),this.paymentGateways=e?n:a,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),this.step===M.PAYMENT&&(c=n.find((function(e){return!!e.masterPassClientId})))&&(this.checkout.masterPassPaymentGateway=c,(d=document.createElement("script")).id=N,d.src=O,d.onload=function(){h.mpVM.checkMasterPass({checkout:h.checkout,store:E.getInstance()})},document.head.appendChild(d)),[2]):(this.error={type:V.API_ERROR,data:s.firstErrorMessage},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return e(W,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:return[4,I.retrieveInstallmentInfo(i)];case 1:return e=t.sent(),s=e.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(e,t){return(e.installmentCount||-1)>(t.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var e;W.store.customerStore.customer?(null===(e=W.customerAddresses)||void 0===e||e.forEach((function(e){e.checkoutSettings=W.checkoutSettings,e.shippingZones=W.shippingZones})),W.checkout.customer=new S(W.store.customerStore.customer)):W.checkout.customer=new S(W.checkout.customer||{})},this.setCheckoutShippingAddressSettings=function(){W.checkout.shippingAddress&&(W.checkout.shippingAddress.checkoutSettings=W.checkoutSettings,W.checkout.shippingAddress.shippingZones=W.shippingZones,W.checkout.shippingAddress.countrySettings=W.countrySettings,W.checkout.shippingAddress.getValidatedCustomerAddress())},this.setCheckoutBillingAddressSettings=function(){W.checkout.billingAddress&&(W.checkout.billingAddress.checkoutSettings=W.checkoutSettings,W.checkout.billingAddress.shippingZones=W.shippingZones,W.checkout.billingAddress.countrySettings=W.countrySettings,W.checkout.billingAddress.getValidatedCustomerAddress())},this.createShippingAddress=function(){if(!W.isDigitalOnly)if(W.isInStoreDelivery)W.setCheckoutShippingAddressSettings();else if(W.checkout.shippingAddress){if(W.store.customerStore.customer){var e=null==(t=W.customerAddresses)?void 0:t.find((function(e){var t;return e.id===(null===(t=W.checkout.shippingAddress)||void 0===t?void 0:t.id)}));if(e)return W.onSelectedShippingAddressIdChange(e.id||"-1"),void W.setCheckoutShippingAddressSettings()}W.checkout.shippingAddress=new G(n(W.checkout.shippingAddress)||{}),W.setCheckoutShippingAddressSettings()}else if(W.store.customerStore.customer){var t=W.customerAddresses;W.onSelectedShippingAddressIdChange((null==t?void 0:t.length)?t[0].id:"-1")}else W.onSelectedShippingAddressIdChange("-1")},this.createBillingAddress=function(){if("undefined"!=typeof localStorage)if(W.useDifferentAddress=!!localStorage.getItem("sAddr"),W.checkout.billingAddress){if(W.store.customerStore.customer){var e=null==(t=W.customerAddresses)?void 0:t.find((function(e){var t;return e.id===(null===(t=W.checkout.billingAddress)||void 0===t?void 0:t.id)}));if(e)return W.onSelectedBillingAddressIdChange(e.id||"-1"),void W.setCheckoutBillingAddressSettings()}W.checkout.billingAddress=new G(n(W.checkout.billingAddress)||{}),W.setCheckoutBillingAddressSettings()}else if(W.store.customerStore.customer){var t=W.customerAddresses;W.onSelectedBillingAddressIdChange((null==t?void 0:t.length)?t[0].id:"-1"),(null==t?void 0:t.length)||W.useDifferentAddress||!W.checkout.shippingAddress||W.isInStoreDelivery||(W.checkout.billingAddress=new G(n(W.checkout.shippingAddress)),W.setCheckoutBillingAddressSettings())}else W.onSelectedBillingAddressIdChange("-1"),W.useDifferentAddress||!W.checkout.shippingAddress||W.isInStoreDelivery||(W.checkout.billingAddress=new G(n(W.checkout.shippingAddress)),W.setCheckoutBillingAddressSettings())},this.onShippingMethodChange=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(e=t.sent())&&(this.checkout=new m(e,this.countrySettings)),this.checkout.shippingAddress&&(this.checkout.shippingAddress.checkoutSettings=this.checkoutSettings,this.checkout.shippingAddress.shippingZones=this.shippingZones),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return e(W,void 0,void 0,(function(){return t(this,(function(e){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(){return e(W,void 0,void 0,(function(){var e,s,n,r,o,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,5,,6]),[4,A.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(e=t.sent()).isSuccess&&e.data?(s=e.data,n=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.couponError=null,this.step===M.PAYMENT&&(null==n?void 0:n.length)&&n.length>=6&&this.retrieveInstallmentInfo({input:{binNumber:n.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:s.totalFinalPrice}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:s.totalFinalPrice}})]:[3,3]):[3,4];case 2:t.sent(),t.label=3;case 3:s&&(r=this.checkout,this.checkout=new m(i(i({},s),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway}),this.countrySettings)),t.label=4;case 4:return e.isSuccess||(this.couponError=e.errorCodes[0]),[3,6];case 5:return t.sent(),[3,6];case 6:return[2]}}))}))},this.getAvailableShippingZones=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,L.getAvailableShippingZones({salesChannelId:R.getSalesChannelId()})];case 1:return e=t.sent(),this.shippingZones=e.data||null,[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(e){var t;if(W.selectedShippingAddressId=e,"-1"===e)W.checkout.shippingAddress=new G,W.checkout.shippingAddress.countrySettings=W.countrySettings;else{var i=null===(t=W.customerAddresses)||void 0===t?void 0:t.find((function(t){return t.id===e}));i&&(W.checkout.shippingAddress=new G(i),W.checkout.shippingAddress.countrySettings=W.countrySettings)}W.checkout.shippingAddress&&(W.checkout.shippingAddress.checkoutSettings=W.checkoutSettings,W.checkout.shippingAddress.shippingZones=W.shippingZones)},this.onSelectedBillingAddressIdChange=function(e){var t;if(W.selectedBillingAddressId=e,"-1"===e)W.checkout.billingAddress=new G,W.checkout.billingAddress.countrySettings=W.countrySettings;else{var i=null===(t=W.customerAddresses)||void 0===t?void 0:t.find((function(t){return t.id===e}));i&&(W.checkout.billingAddress=new G(i),W.checkout.billingAddress.countrySettings=W.countrySettings)}W.checkout.billingAddress&&(W.checkout.billingAddress.checkoutSettings=W.checkoutSettings,W.checkout.billingAddress.shippingZones=W.shippingZones)},this.onTermsAndConditionsCheckedChange=function(e){W.isTermsAndConditionsChecked=e},this.onCardNumberChange=function(e){if(W.cardData&&(!(e.length>W.cardData.cardNumber.length)||Z(e))){var t=(W.cardData.cardNumber||"").split(" ").join(""),i=e.split(" ").join("");i.length>16||(t.length<6&&i.length>=6&&!W.installmentInfo?W.retrieveInstallmentInfo({input:{binNumber:i.slice(0,6),paymentGatewayId:W.checkout.selectedPaymentGateway.id,price:W.checkout.totalFinalPrice}}):i.length<6&&t.length>i.length&&(W.cardData.installmentCount=1,W.installmentInfo=void 0),W.cardData.cardNumber=F(i,4).join(" "))}},this.onCardHolderNameChange=function(e){W.cardData&&(W.cardData.cardHolderName=e)},this.onExpirationDateChange=function(e){var t;if(W.cardData&&(!(e.length>W.cardData.expirationDate.length)||Z(e))){if(0===(null===(t=W.cardData.expirationDate)||void 0===t?void 0:t.length)){var i=e.replace(".","/").split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(W.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(W.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&2===n.length){var a=parseInt(s),c=parseInt(n);o=a<=12?a:c,r=c>12?c:a;if(!isNaN(r)&&!isNaN(o))return void(W.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var d=e.split(" / ").join("");d.length>4||(W.cardData.expirationDate=F(d,2).join(" / "))}},this.onCvcChange=function(e){W.cardData&&(e.length>W.cardData.cvv.length&&!Z(e)||e.length>4||(W.cardData.cvv=e))},this.saveAddress=function(s){return e(W,void 0,void 0,(function(){var e,r,o,a,c,d,u,l,h,p,m,g,v=this;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(e="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(h=this.customerAddresses)||void 0===h?void 0:h.find((function(t){return t.id===(null==e?void 0:e.id)})))?[2]:(r=null===(p=this.customerAddresses)||void 0===p?void 0:p.map((function(e){return e.id})),o=new f(i(i({},e),{title:this.addressTitle||this.t("checkout-page:newAddress")})),(a=n(this.store.customerStore.customer)).addresses||(a.addresses=[]),a.addresses.push(o),[4,this.store.customerStore.saveCustomer(a)])):[3,2];case 1:t.sent(),null===(m=this.customerAddresses)||void 0===m||m.forEach((function(e){e.checkoutSettings=v.checkoutSettings,e.shippingZones=v.shippingZones})),c=null===(g=this.customerAddresses)||void 0===g?void 0:g.map((function(e){return e.id})),d=null==c?void 0:c.filter((function(e){return!(null==r?void 0:r.includes(e))})),u=(null==d?void 0:d.length)?d[0]:void 0,"shipping"===s?(this.checkout.shippingAddress.id=u||"",this.selectedShippingAddressId=u||"-1"):(this.checkout.billingAddress.id=u||"",this.selectedBillingAddressId=u||"-1"),t.label=2;case 2:return[3,4];case 3:return l=t.sent(),console.error(l),[3,4];case 4:return[2]}}))}))},this.onGoToCartClick=function(){W.router.push("/cart")},this.onBackToShoppingClick=function(){W.router.push("/")},this.onGoToLoginClick=function(){W.router.push("/account/login")},this.onProceedToShippingClick=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=1;case 1:return t.trys.push([1,6,,7]),this.isStepLoading=!0,"address"!==this.deliveryMethod?[3,3]:[4,this.saveAddress("shipping")];case 2:t.sent(),t.label=3;case 3:return[4,this.checkStocks()];case 4:return t.sent(),[4,this.saveCart()];case 5:return t.sent(),"address"===this.deliveryMethod?this.changeStep(M.SHIPPING):this.changeStep(M.PAYMENT),[3,7];case 6:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:V.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToDigitalOnlyPaymentClick=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=1;case 1:return t.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return t.sent(),[4,this.saveCart()];case 3:return t.sent(),this.changeStep(M.PAYMENT),[3,5];case 4:return(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:V.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onProceedToPaymentClick=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=1;case 1:return t.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return t.sent(),[4,this.saveCart()];case 3:return t.sent(),this.error=void 0,this.changeStep(M.PAYMENT),[3,5];case 4:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:V.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.checkPaypalButtonAvailable=function(){return!!W.canPerformPayment||(W.isErrorsVisible=!0,!1)},this.onCompletePaymentClick=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return this.canPerformPayment?(this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),this.isKlarna?[4,this.saveCart()]:[3,2]):(this.isErrorsVisible=!0,[2]);case 1:return t.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:return t.trys.push([2,8,,9]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 3:return t.sent(),"address"===this.deliveryMethod&&this.useDifferentAddress?[4,this.saveAddress("billing")]:[3,5];case 4:t.sent(),t.label=5;case 5:return[4,this.saveCart()];case 6:return t.sent(),this.isCustomFlowStripe?((e=document.querySelector("#stripe-form-btn"))&&e.click(),[2]):this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):this.isPayPal?[2]:[4,this.createSaleTransaction()];case 7:return t.sent(),[3,9];case 8:return void 0!==typeof(i=t.sent()).type?this.error=i:this.error={type:V.UNKNOWN},this.isStepLoading=!1,[3,9];case 9:return[2]}}))}))},this.onCompleteDigitalOnlyPaymentClick=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return!this.canProceedToPayment||this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked?(this.isErrorsVisible=!0,[2]):this.isKlarna?[4,this.saveCart()]:[3,2];case 1:return t.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:return t.trys.push([2,6,,7]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 3:return t.sent(),[4,this.saveCart()];case 4:return t.sent(),this.isCustomFlowStripe?((e=document.querySelector("#stripe-form-btn"))&&e.click(),[2]):this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):this.isPayPal?[2]:[4,this.createSaleTransaction()];case 5:return t.sent(),[3,7];case 6:return(i=t.sent()).type?this.error=i:this.error={type:V.UNKNOWN},this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.createSaleTransaction=function(){return e(W,void 0,void 0,(function(){var e,i,s,n,r,o,d,u,h,p,m,g,f,v,y;return t(this,(function(t){switch(t.label){case 0:return i=this.mpVM.selectedCard,!this.isFree&&i&&(null===(u=this.mpVM.selectedCard)||void 0===u?void 0:u.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(e=n),void 0===(null===(h=this.cardData)||void 0===h?void 0:h.installmentCount)?[2]:[4,I.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:e,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name},paymentGatewayId:null===(m=this.mpVM.selectedCard)||void 0===m?void 0:m.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(g=this.cardData)||void 0===g?void 0:g.threeDSecure)}}})]):[3,2];case 1:return s=t.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway?[4,I.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:this.isFree?void 0:i&&e?{phoneNumber:e,savedCardName:null===(f=this.mpVM.selectedCard)||void 0===f?void 0:f.Name}:void 0,paymentGatewayId:this.checkout.selectedPaymentGateway.id,paymentMethodDetail:this.isFree||i?void 0:this.checkout.selectedPaymentGateway.paymentMethodType===a.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===c.INTERNAL&&this.cardData?this.cardData.toInput():void 0}})]:[2];case 3:s=t.sent(),t.label=4;case 4:return r=null===(v=null==s?void 0:s.data)||void 0===v?void 0:v.transactionStatus,o=r&&[l.SUCCESS,l.AUTHORIZED].includes(r),d=r===l.PENDING,o?[4,this.getSuccessTransaction()]:[3,7];case 5:return t.sent(),[4,this.onCheckoutTransactionSuccess()];case 6:return t.sent(),[3,8];case 7:if(!d||!(null===(y=null==s?void 0:s.data)||void 0===y?void 0:y.returnSlug))throw{data:s.firstErrorMessage,type:V.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,t.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return localStorage.removeItem("sAddr"),(null===(e=this.checkout.customer)||void 0===e?void 0:e.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.changeStep(M.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){W.changeStep(M.INFO)},this.onBackToShippingClick=function(){W.changeStep(M.SHIPPING)},this.setCustomerConsentGranted=function(e){W.checkout.customer&&(W.checkout.customer.notificationsAccepted=e)},this.setUseDifferentAddress=function(e){W.useDifferentAddress=e,W.useDifferentAddress?(localStorage.setItem("sAddr","1"),W.checkout.billingAddress=W.checkout.billingAddress||new G,W.checkout.billingAddress.countrySettings=W.countrySettings):(localStorage.removeItem("sAddr"),W.checkout.billingAddress=W.checkout.shippingAddress)},this.setShouldSaveAddress=function(e){W.shouldSaveAddress=e},this.setAddressTitle=function(e){W.addressTitle=e},this.reInitPaymentMethod=function(){return e(W,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return this.checkout.selectedPaymentGateway?this.isCustomFlowStripe?[4,this.createStripePaymentIntent(this.checkout.selectedPaymentGateway)]:[3,2]:[3,6];case 1:e.sent(),e.label=2;case 2:return this.isKlarna&&window.location.reload(),this.isAdyen?[4,this.createAdyenClientToken(this.checkout.selectedPaymentGateway)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.isPayPal?[4,this.getPayPalClientId(this.checkout.selectedPaymentGateway)]:[3,6];case 5:e.sent(),e.label=6;case 6:return[2]}}))}))},this.createStripePaymentIntent=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.stripeResponse=e.data),[2]}}))}))},this.createKlarnaClientToken=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.createKlarnaClientToken({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.klarnaResponse=e.data),[2]}}))}))},this.createAdyenClientToken=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.createAdyenClientToken({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.adyenResponse=e.data),[2]}}))}))},this.getPayPalClientId=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.getPayPalClientId({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.payPalClientIdResponse=e.data),[2]}}))}))},this.setPaymentGateway=function(i){return e(W,void 0,void 0,(function(){var e,s;return t(this,(function(t){switch(t.label){case 0:return this.paymentGateways.length?"STRIPE"!==(e=this.paymentGateways[i]).code||!(null===(s=e.settings)||void 0===s?void 0:s.find((function(e){return"allow_custom_flow"===e.label&&"1"===e.value})))||this.stripeResponse?[3,2]:[4,this.createStripePaymentIntent(e)]:[2];case 1:t.sent(),t.label=2;case 2:return"KLARNA"!==e.code||this.klarnaResponse?[3,4]:[4,this.createKlarnaClientToken(e)];case 3:t.sent(),t.label=4;case 4:return"ADYEN"!==e.code||this.adyenResponse?[3,6]:[4,this.createAdyenClientToken(e)];case 5:t.sent(),t.label=6;case 6:return"PAYPAL"!==e.code||this.payPalClientIdResponse?[3,8]:[4,this.getPayPalClientId(e)];case 7:t.sent(),t.label=8;case 8:return this.checkout.selectedPaymentGateway=e,this.step!==M.SUCCESS&&(e.paymentMethodType===a.CREDIT_CARD&&e.type===c.INTERNAL&&(this.cardData=new C,e.masterPassClientId&&(console.log("called 1511 ikas log"),this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store}))),this.installmentInfo=void 0),[2]}}))}))},this.setInstallmentCount=function(e){W.cardData&&(W.cardData.installmentCount=e)},this.changeStep=function(i){return e(W,void 0,void 0,(function(){return t(this,(function(e){return U||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return e(W,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return e.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(e){W.isContactModalVisible=e},this.getCampaignOfferProducts=function(i){return e(W,void 0,void 0,(function(){var e,s,n,r;return t(this,(function(o){switch(o.label){case 0:if(!this.checkout.campaignOffers||!this.checkout.campaignOffers.length)return[3,4];if(e=this.checkout.campaignOffers.filter((function(e){var t;return e.status===h.WAITING_FOR_ACTION&&(null===(t=e.campaignOffer)||void 0===t?void 0:t.targetPageTypes.some((function(e){return e===i})))})),!e.length)return[3,4];s=function(i){var s,n,r,o,a;return t(this,(function(t){switch(t.label){case 0:return(s=e[i]).campaignOffer&&(n=s.campaignOffer.offers.find((function(e){return e.id===s.campaignOfferProductId})))?[4,j.searchProducts({input:{productIdList:[n.productId]}})]:[3,2];case 1:if((r=t.sent()).isSuccess&&r.data&&r.data.data&&r.data.data.length&&(o=r.data.data[0],a=[],n.excludedVariantIdList&&n.excludedVariantIdList.length?o.variants.map((function(e){var t;e.hasStock&&!(null===(t=n.excludedVariantIdList)||void 0===t?void 0:t.some((function(t){return t===e.id})))&&a.push(e)})):a.push.apply(a,o.variants.filter((function(e){return e.hasStock}))),a.length))return[2,{value:{product:new k(o),variants:a,campaignOffer:s,offer:n}}];t.label=2;case 2:return[2]}}))},n=0,o.label=1;case 1:return n<e.length?[5,s(n)]:[3,4];case 2:if("object"==typeof(r=o.sent()))return[2,r.value];o.label=3;case 3:return n++,[3,1];case 4:return[2,void 0]}}))}))},this.getCampaignOffer=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return e=this,[4,this.getCampaignOfferProducts(p.CHECKOUT)];case 1:return e.checkoutCampaignOffer=t.sent(),i=this,[4,this.getCampaignOfferProducts(p.POST_CHECKOUT)];case 2:return i.postCheckoutCampaignOffer=t.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isCheckoutLoaded=!1,[4,A.updateCartCampaignOffer({input:i})];case 1:return(e=t.sent())&&e.isSuccess&&e.data&&(this.checkout=new m(e.data,this.countrySettings),i.accepted&&this.step===M.SUCCESS?this.changeStep(M.INFO):this.changeStep(this.step)),[2]}}))}))},this.registerCustomer=function(i){return e(W,void 0,void 0,(function(){var e,s,n,r;return t(this,(function(t){switch(t.label){case 0:return this.checkout.customer?(e=this.checkout.customer,s=e.firstName,n=e.lastName,r=e.email,s&&n&&r?[4,P.register({orderId:this.checkout.id,firstName:s,lastName:n,email:r,password:i})]:[3,2]):[3,2];case 1:return[2,t.sent()];case 2:return[2]}}))}))},this.checkout=d,this.checkoutSettings=u,this.router=v,this.returnPolicy=y,this.privacyPolicy=_,this.termsOfService=K,this.imprint=B,this.shippingPolicy=Y,this.t=H,this.customizationProps=q,this.mpVM=new w,this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.countrySettings=new b({currentLocale:R.getCurrentLocale()}),this.init(),s(this)}return Object.defineProperty(_.prototype,"merchantSettings",{get:function(){return new y(R.getMerchantSettings())},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"selectedPaymentGatewayIndex",{get:function(){var e=this;return this.paymentGateways.findIndex((function(t){var i;return t.id===(null===(i=e.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"selectedInstallmentIndex",{get:function(){var e,t,i=this;return(null===(t=null===(e=this.installmentInfo)||void 0===e?void 0:e.installmentPrices)||void 0===t?void 0:t.findIndex((function(e){var t;return e.installmentCount===(null===(t=i.cardData)||void 0===t?void 0:t.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"customerAddressOptions",{get:function(){var e,t,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(t=null===(e=E.getInstance().customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===t?void 0:t.map((function(e){return{label:e.title+" - "+e.addressText,value:e.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"installmentPrice",{get:function(){var e,t,i,s=this;if(this.installmentInfo&&(null===(e=this.cardData)||void 0===e?void 0:e.installmentCount))return null===(i=null===(t=this.installmentInfo.installmentPrices)||void 0===t?void 0:t.find((function(e){var t;return e.installmentCount===(null===(t=s.cardData)||void 0===t?void 0:t.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"finalPrice",{get:function(){return this.step===M.SUCCESS?this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"hasStockError",{get:function(){var e;return(null===(e=this.error)||void 0===e?void 0:e.type)===V.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"hasQuickRegistration",{get:function(){return this.checkoutSettings.isQuickRegistrationEnabled&&this.checkout.customer&&this.checkout.customer.isGuestCheckout},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"canProceedToShipping",{get:function(){var e,t,i;return(this.isDigitalOnly?null===(e=this.checkout.billingAddress)||void 0===e?void 0:e.isValidAddress:null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.isValidAddress)&&this.checkout.hasValidCustomerEmail&&(null===(i=this.error)||void 0===i?void 0:i.type)!==V.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"canProceedToInStoreDelivery",{get:function(){var e,t,i;return!!((null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.firstName)&&(null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping&&this.isValidShippingSettings},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isValidShippingSettings",{get:function(){var e,t=this;return!(!this.isInStoreDelivery&&!this.isDigitalOnly)||this.checkout.shippingSettingsId&&this.checkout.shippingZoneRateId&&(null===(e=this.checkout.shippingLines)||void 0===e?void 0:e.some((function(e){return e.shippingSettingsId===t.checkout.shippingSettingsId&&e.shippingZoneRateId===t.checkout.shippingZoneRateId})))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"klarnaPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"KLARNA"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"klarnaPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"KLARNA"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"adyenPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"ADYEN"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"adyenPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"ADYEN"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"payPalPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"PAYPAL"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"payPalPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"PAYPAL"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCustomFlowStripe",{get:function(){var e,t=this.checkout.selectedPaymentGateway;return t&&"STRIPE"===t.code&&(null===(e=t.settings)||void 0===e?void 0:e.find((function(e){return"allow_custom_flow"===e.label&&"1"===e.value})))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isKlarna",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"KLARNA"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isAdyen",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"ADYEN"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isPayPal",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"PAYPAL"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isFree",{get:function(){return 0===this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"store",{get:function(){return E.getInstance()},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCouponCodeRequirementDefult",{get:function(){return this.checkoutSettings.couponCodeRequirement===o.DEFAULT||null===this.checkoutSettings.couponCodeRequirement},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCouponCodeRequirementOpen",{get:function(){return this.checkoutSettings.couponCodeRequirement===o.OPEN},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCouponCodeRequirementInvisible",{get:function(){return this.checkoutSettings.couponCodeRequirement===o.INVISIBLE},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCouponCodeVisible",{get:function(){return this.isCouponCodeRequirementDefult&&!this.isCouponCodeRequirementInvisible},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"canPerformPayment",{get:function(){var e,t;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(e=this.checkout.billingAddress)||void 0===e?void 0:e.isValidAddress),r=!!this.isFree||(!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===a.CREDIT_CARD&&i.type===c.INTERNAL?!!this.isCustomFlowStripe||(!(!this.isKlarna&&!this.isPayPal)||(null===(t=this.cardData)||void 0===t?void 0:t.isValid)):!!i));return s&&n&&r},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isDigitalOnly",{get:function(){return this.checkout.shippingMethod===d.DIGITAL_DELIVERY},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"customerAddresses",{get:function(){var e,t,s=this;return null===(t=null===(e=this.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===t?void 0:t.map((function(e){var t=new v(i({countrySettings:s.countrySettings},e));return t.checkoutSettings=s.checkoutSettings,t.shippingZones=s.shippingZones,t.getValidatedCustomerAddress(),t}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isManualOrder",{get:function(){return this.checkout.createdBy===u.ADMIN},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isEPayKolayEnabled",{get:function(){var e=R.getCustom();return!!e&&!!e.isEPayKolayEnabled},enumerable:!1,configurable:!0}),_.prototype.setAdyenDropinElement=function(e){this.adyenDropinElement=e},_}();function F(e,t){return e.match(new RegExp(".{1,"+t+"}","g"))||[]}function Z(e){return e&&_.test(e.charAt(e.length-1))}!function(e){e.INFO="info",e.SHIPPING="shipping",e.PAYMENT="payment",e.SUCCESS="success"}(M||(M={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.API_ERROR=1]="API_ERROR",e[e.STOCK_ERROR=2]="STOCK_ERROR",e[e.PAYMENT_ERROR=3]="PAYMENT_ERROR",e[e.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",e[e.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(V||(V={}));export{M as CheckoutStep,V as ErrorType,K as default};
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from"lodash/cloneDeep";import r from"lodash/sortBy";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{IkasCouponCodeRequirement as o,IkasPaymentMethodType as a,IkasPaymentGatewayType as c,IkasOrderShippingMethod as d,IkasCartCreatedBy as u,IkasTransactionStatus as l,IkasCartCampaignOfferStatus as h,IkasCampaignOfferTargetPageType as p}from"@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{IkasCheckout as m}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as g}from"../../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{IkasCustomerAddress as f}from"../../models/data/customer/address/index.js";import{IkasLocalizedCustomerAddress as v}from"../../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/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{IkasMerchantSettings as y}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import{IkasOrderCustomer as S}from"../../models/data/order/customer/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/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/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 k}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/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{LocalizedAddressModel as b}from"@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 C from"./components/credit-card-form/model.js";import P from"../../store/customer/api.js";import I from"../../store/checkout/index.js";import A from"../../store/cart/api.js";import w,{MFS_ELEMENT_ID as N,MFS_SCRIPT_URL as O}from"./modelMasterPass.js";import j from"../../store/product/index.js";import{IkasBaseStore as E}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as R}from"@ikas/storefront-config";import{Analytics as x}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{SaveCartInput as D,CheckStocksLineInput as T}from"@ikas/storefront-api";import G from"../../models/data/order/address/ikas-localized-order-address.js";import L from"../../store/location/index.js";var M,V,_=/^\d+$/,U="undefined"==typeof localStorage,K=function(){function _(d,u,v,y,_,K,Z,Y,H,q){var W=this;this.storefront=null,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.isEPayKolayPayment=!1,this.step=M.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.klarnaResponse=null,this.isKlarnaPaymentCompleted=!1,this.adyenResponse=null,this.payPalClientIdResponse=null,this.paypalOrderResponse=null,this.shippingZones=null,this.policyModalTitle="",this.policyModalText="",this.error=null,this.couponError=null,this.showTestModal=!1,this.init=function(){return e(W,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,this.countrySettings.waitUntilInitialized()];case 1:return e.sent(),[4,E.getInstance().customerStore.waitUntilInitialized()];case 2:return e.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getCampaignOffer()];case 3:return e.sent(),[4,this.initStep()];case 4:return e.sent(),[2]}}))}))},this.initStep=function(){return e(W,void 0,void 0,(function(){var e,s,n,r,a,c,d;return t(this,(function(t){switch(t.label){case 0:if(R.getIsEditor())return this.step=M.INFO,this.isCheckoutLoaded=!0,[2];if(e=new URLSearchParams(window.location.search),s=e.get("step"),n=e.get("failed"),r=e.get("error"),s){if(this.step=s,this.step===M.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(M.INFO)];if(this.step!==M.PAYMENT||this.canProceedToPayment){if(this.step===M.SUCCESS&&!this.canProceedToPayment)return[2,this.changeStep(M.INFO)];if(![M.INFO,M.SUCCESS,M.SHIPPING,M.PAYMENT].includes(this.step))return[2,this.changeStep(M.INFO)]}else{if(!this.isInStoreDelivery)return this.isValidShippingSettings?[2,this.changeStep(M.INFO)]:[2,this.changeStep(M.SHIPPING)];this.deliveryMethod="in-store"}}return n&&(this.error={type:V.PAYMENT_ERROR,data:r||null}),this.step!==M.SHIPPING&&this.step!==M.PAYMENT||this.isCouponCodeRequirementInvisible||(this.checkoutSettings=new g(i(i({},this.checkoutSettings),{couponCodeRequirement:o.DEFAULT}))),this.step!==M.INFO?[3,6]:this.isDigitalOnly?[3,3]:[4,this.getAvailableShippingZones()];case 1:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getShippingCountries()];case 2:t.sent(),this.checkShippingCountries(),t.label=3;case 3:return[4,this.getStockLocations()];case 4:return t.sent(),[4,this.getAvailableStockLocations()];case 5:t.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),t.label=6;case 6:return this.step!==M.SHIPPING||1!==(null===(c=this.checkout.availableShippingMethods)||void 0===c?void 0:c.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=M.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==M.SHIPPING||(null===(d=this.checkout.availableShippingMethods)||void 0===d?void 0:d.length)?this.step!==M.PAYMENT&&this.step!==M.SUCCESS?[3,10]:[4,this.listPaymentGateways()]:(this.error={type:V.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 7:return t.sent(),this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,9];case 8:t.sent(),t.label=9;case 9:if(!this.paymentGateways.length)return this.error={type:V.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];t.label=10;case 10:return this.step===M.SUCCESS?[3,14]:this.checkout.isComplete?[2,this.changeStep(M.SUCCESS)]:[3,11];case 11:return[4,this.initialStockCheck()];case 12:t.sent(),t.label=13;case 13:return[3,16];case 14:return[4,this.getSuccessTransaction()];case 15:t.sent(),this.successTransaction&&(a=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(e){return e.id===a}))),t.label=16;case 16:return this.isCheckoutLoaded=!0,x.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getSuccessTransaction=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,P.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return e=t.sent(),this.successTransaction=e.isSuccess&&(null===(i=e.data)||void 0===i?void 0:i.length)?e.data[e.data.length-1]:void 0,[2]}}))}))},this.saveCart=function(){return e(W,void 0,void 0,(function(){var e,i,s,n;return t(this,(function(t){switch(t.label){case 0:return e=new D(this.checkout),"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(e)];case 1:e=t.sent(),t.label=2;case 2:return this.step!==M.INFO&&this.step!==M.SHIPPING||this.isDigitalOnly||(e.billingAddress=null),this.isDigitalOnly&&(e.shippingAddress=null),[4,A.saveCart({input:e})];case 3:if((null==(i=t.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(n=s.extensions)||void 0===n?void 0:n.code)?{type:V.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:V.API_ERROR,data:i.firstErrorMessage};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return e(W,void 0,void 0,(function(){var e,s,n=this;return t(this,(function(t){return e=i,(s=this.stockLocations.find((function(e){return e.id===n.checkout.stockLocationId})))&&e.shippingAddress&&s.address&&(e.shippingAddress.country=s.address.country,e.shippingAddress.city=s.address.city,e.shippingAddress.state=s.address.state,e.shippingAddress.district=s.address.district,e.shippingAddress.postalCode=s.address.postalCode,e.shippingAddress.addressLine1=s.address.address||"",e.shippingAddress.addressLine2=null),[2,e]}))}))},this.checkStocks=function(){return e(W,void 0,void 0,(function(){var e,i,s,n,r,o,a,c,d,u,l,h;return t(this,(function(t){switch(t.label){case 0:return this.isManualOrder?[2]:(e=this.checkout.items.map((function(e){return{quantity:e.quantity,variantId:e.variant.id,productId:e.variant.productId}})),[4,I.checkStocks({lines:e.map((function(e){return new T(e)})),stockLocationIdList:(null===(u=R.getStockLocationIds())||void 0===u?void 0:u.length)?R.getStockLocationIds():null})]);case 1:if(!(i=t.sent()).isSuccess)throw{type:V.API_ERROR,data:i.firstErrorMessage};if(null==(s=null===(h=null===(l=i.data)||void 0===l?void 0:l.lines)||void 0===h?void 0:h.filter((function(e){return!e.isAvailable})))?void 0:s.length){for(n=[],r=function(e){var t=o.checkout.items.find((function(t){return t.variant.id===e.variantId}));t&&n.push({item:t,stockCount:e.stockCount})},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:V.STOCK_ERROR,data:n}}return[2]}}))}))},this.setIsKlarnaPaymentCompleted=function(i){return e(W,void 0,void 0,(function(){return t(this,(function(e){return this.isKlarnaPaymentCompleted=i,[2]}))}))},this.removeUnavailableItems=function(i){return e(W,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:e=0,s=i,t.label=1;case 1:return e<s.length?(n=s[e],[4,E.getInstance().cartStore.changeItemQuantity(n.item,n.stockCount<0?0:n.stockCount)]):[3,4];case 2:t.sent(),t.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.getAvailableShippingCountries({salesChannelId:R.getSalesChannelId()})];case 1:return e=t.sent(),this.shippingCountryIds=e.data,[2]}}))}))},this.getStockLocations=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return R.getPickupStockLocationIds()?[4,I.listStockLocation({id:{in:R.getPickupStockLocationIds()}})]:[3,2];case 1:if(!(e=t.sent()).isSuccess||!(null===(i=e.data)||void 0===i?void 0:i.length))return this.error={type:V.API_ERROR,data:e.firstErrorMessage},[2];this.stockLocations=e.data,t.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return R.getPickupStockLocationIds()?(e=this.checkout.items.map((function(e){return{quantity:e.quantity,variantId:e.variant.id,productId:e.variant.productId}})),[4,I.getAvailableStockLocations({lines:e.map((function(e){return new T(e)})),stockLocationIdList:R.getPickupStockLocationIds()})]):[3,2];case 1:if(!(i=t.sent()).isSuccess)return this.error={type:V.API_ERROR},[2];this.availableStockLocations=i.data||[],t.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var e;(null===(e=W.shippingCountryIds)||void 0===e?void 0:e.length)||(W.error={type:V.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(e){"address"===e&&(W.checkout.stockLocationId=null),W.deliveryMethod=e,W.isErrorsVisible=!1},this.initialStockCheck=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return t.sent(),[3,3];case 2:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:V.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return e(W,void 0,void 0,(function(){var e,i,s,n,o,a,c,d,u,l,h=this;return t(this,(function(t){switch(t.label){case 0:return e="local"===process.env.NEXT_PUBLIC_ENV,i=R.getPaymentGateways().map((function(e){return e.id})),[4,I.listPaymentGateway({id:e?void 0:{in:i},locale:R.getCurrentLocale(),transactionAmount:this.checkout.totalFinalPrice})];case 1:return(s=t.sent()).isSuccess&&(null===(u=s.data)||void 0===u?void 0:u.length)?(n=s.data,this.step===M.PAYMENT&&(n=n.filter((function(e){var t;return!(null===(t=e.supportedCurrencies)||void 0===t?void 0:t.length)||e.supportedCurrencies.includes(h.checkout.currencyCode)})),(o=null===(l=this.checkout.shippingAddress)||void 0===l?void 0:l.country)&&o.iso2&&(n=n.filter((function(e){var t;return!(null===(t=e.availableCountries)||void 0===t?void 0:t.length)||e.availableCountries.includes(o.iso2||"")})))),a=[],r(R.getPaymentGateways(),"order").forEach((function(e){var t=null==n?void 0:n.find((function(t){return t.id===e.id}));t&&a.push(t)})),this.paymentGateways=e?n:a,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),this.step===M.PAYMENT&&(c=n.find((function(e){return!!e.masterPassClientId})))&&(this.checkout.masterPassPaymentGateway=c,(d=document.createElement("script")).id=N,d.src=O,d.onload=function(){h.mpVM.checkMasterPass({checkout:h.checkout,store:E.getInstance()})},document.head.appendChild(d)),[2]):(this.error={type:V.API_ERROR,data:s.firstErrorMessage},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return e(W,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:return[4,I.retrieveInstallmentInfo(i)];case 1:return e=t.sent(),s=e.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(e,t){return(e.installmentCount||-1)>(t.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var e;W.store.customerStore.customer?(null===(e=W.customerAddresses)||void 0===e||e.forEach((function(e){e.checkoutSettings=W.checkoutSettings,e.shippingZones=W.shippingZones})),W.checkout.customer=new S(W.store.customerStore.customer)):W.checkout.customer=new S(W.checkout.customer||{})},this.setCheckoutShippingAddressSettings=function(){W.checkout.shippingAddress&&(W.checkout.shippingAddress.checkoutSettings=W.checkoutSettings,W.checkout.shippingAddress.shippingZones=W.shippingZones,W.checkout.shippingAddress.countrySettings=W.countrySettings,W.checkout.shippingAddress.getValidatedCustomerAddress())},this.setCheckoutBillingAddressSettings=function(){W.checkout.billingAddress&&(W.checkout.billingAddress.checkoutSettings=W.checkoutSettings,W.checkout.billingAddress.shippingZones=W.shippingZones,W.checkout.billingAddress.countrySettings=W.countrySettings,W.checkout.billingAddress.getValidatedCustomerAddress())},this.createShippingAddress=function(){if(!W.isDigitalOnly)if(W.isInStoreDelivery)W.setCheckoutShippingAddressSettings();else if(W.checkout.shippingAddress){if(W.store.customerStore.customer){var e=null==(t=W.customerAddresses)?void 0:t.find((function(e){var t;return e.id===(null===(t=W.checkout.shippingAddress)||void 0===t?void 0:t.id)}));if(e)return W.onSelectedShippingAddressIdChange(e.id||"-1"),void W.setCheckoutShippingAddressSettings()}W.checkout.shippingAddress=new G(n(W.checkout.shippingAddress)||{}),W.setCheckoutShippingAddressSettings()}else if(W.store.customerStore.customer){var t=W.customerAddresses;W.onSelectedShippingAddressIdChange((null==t?void 0:t.length)?t[0].id:"-1")}else W.onSelectedShippingAddressIdChange("-1")},this.createBillingAddress=function(){if("undefined"!=typeof localStorage)if(W.useDifferentAddress=!!localStorage.getItem("sAddr"),W.checkout.billingAddress){if(W.store.customerStore.customer){var e=null==(t=W.customerAddresses)?void 0:t.find((function(e){var t;return e.id===(null===(t=W.checkout.billingAddress)||void 0===t?void 0:t.id)}));if(e)return W.onSelectedBillingAddressIdChange(e.id||"-1"),void W.setCheckoutBillingAddressSettings()}W.checkout.billingAddress=new G(n(W.checkout.billingAddress)||{}),W.setCheckoutBillingAddressSettings()}else if(W.store.customerStore.customer){var t=W.customerAddresses;W.onSelectedBillingAddressIdChange((null==t?void 0:t.length)?t[0].id:"-1"),(null==t?void 0:t.length)||W.useDifferentAddress||!W.checkout.shippingAddress||W.isInStoreDelivery||(W.checkout.billingAddress=new G(n(W.checkout.shippingAddress)),W.setCheckoutBillingAddressSettings())}else W.onSelectedBillingAddressIdChange("-1"),W.useDifferentAddress||!W.checkout.shippingAddress||W.isInStoreDelivery||(W.checkout.billingAddress=new G(n(W.checkout.shippingAddress)),W.setCheckoutBillingAddressSettings())},this.onShippingMethodChange=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(e=t.sent())&&(this.checkout=new m(e,this.countrySettings)),this.checkout.shippingAddress&&(this.checkout.shippingAddress.checkoutSettings=this.checkoutSettings,this.checkout.shippingAddress.shippingZones=this.shippingZones),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return e(W,void 0,void 0,(function(){return t(this,(function(e){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(){return e(W,void 0,void 0,(function(){var e,s,n,r,o,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,5,,6]),[4,A.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(e=t.sent()).isSuccess&&e.data?(s=e.data,n=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.couponError=null,this.step===M.PAYMENT&&(null==n?void 0:n.length)&&n.length>=6&&this.retrieveInstallmentInfo({input:{binNumber:n.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:s.totalFinalPrice}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:s.totalFinalPrice}})]:[3,3]):[3,4];case 2:t.sent(),t.label=3;case 3:s&&(r=this.checkout,this.checkout=new m(i(i({},s),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway}),this.countrySettings)),t.label=4;case 4:return e.isSuccess||(this.couponError=e.errorCodes[0]),[3,6];case 5:return t.sent(),[3,6];case 6:return[2]}}))}))},this.getAvailableShippingZones=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,L.getAvailableShippingZones({salesChannelId:R.getSalesChannelId()})];case 1:return e=t.sent(),this.shippingZones=e.data||null,[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(e){var t;if(W.selectedShippingAddressId=e,"-1"===e)W.checkout.shippingAddress=new G,W.checkout.shippingAddress.countrySettings=W.countrySettings;else{var i=null===(t=W.customerAddresses)||void 0===t?void 0:t.find((function(t){return t.id===e}));i&&(W.checkout.shippingAddress=new G(i),W.checkout.shippingAddress.countrySettings=W.countrySettings)}W.checkout.shippingAddress&&(W.checkout.shippingAddress.checkoutSettings=W.checkoutSettings,W.checkout.shippingAddress.shippingZones=W.shippingZones)},this.onSelectedBillingAddressIdChange=function(e){var t;if(W.selectedBillingAddressId=e,"-1"===e)W.checkout.billingAddress=new G,W.checkout.billingAddress.countrySettings=W.countrySettings;else{var i=null===(t=W.customerAddresses)||void 0===t?void 0:t.find((function(t){return t.id===e}));i&&(W.checkout.billingAddress=new G(i),W.checkout.billingAddress.countrySettings=W.countrySettings)}W.checkout.billingAddress&&(W.checkout.billingAddress.checkoutSettings=W.checkoutSettings,W.checkout.billingAddress.shippingZones=W.shippingZones)},this.onTermsAndConditionsCheckedChange=function(e){W.isTermsAndConditionsChecked=e},this.onCardNumberChange=function(e){if(W.cardData&&(!(e.length>W.cardData.cardNumber.length)||B(e))){var t=(W.cardData.cardNumber||"").split(" ").join(""),i=e.split(" ").join("");i.length>16||(t.length<6&&i.length>=6&&!W.installmentInfo?W.retrieveInstallmentInfo({input:{binNumber:i.slice(0,6),paymentGatewayId:W.checkout.selectedPaymentGateway.id,price:W.checkout.totalFinalPrice}}):i.length<6&&t.length>i.length&&(W.cardData.installmentCount=1,W.installmentInfo=void 0),W.cardData.cardNumber=F(i,4).join(" "))}},this.onCardHolderNameChange=function(e){W.cardData&&(W.cardData.cardHolderName=e)},this.onExpirationDateChange=function(e){var t;if(W.cardData&&(!(e.length>W.cardData.expirationDate.length)||B(e))){if(0===(null===(t=W.cardData.expirationDate)||void 0===t?void 0:t.length)){var i=e.replace(".","/").split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(W.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(W.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&2===n.length){var a=parseInt(s),c=parseInt(n);o=a<=12?a:c,r=c>12?c:a;if(!isNaN(r)&&!isNaN(o))return void(W.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var d=e.split(" / ").join("");d.length>4||(W.cardData.expirationDate=F(d,2).join(" / "))}},this.onCvcChange=function(e){W.cardData&&(e.length>W.cardData.cvv.length&&!B(e)||e.length>4||(W.cardData.cvv=e))},this.saveAddress=function(s){return e(W,void 0,void 0,(function(){var e,r,o,a,c,d,u,l,h,p,m,g,v=this;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(e="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(h=this.customerAddresses)||void 0===h?void 0:h.find((function(t){return t.id===(null==e?void 0:e.id)})))?[2]:(r=null===(p=this.customerAddresses)||void 0===p?void 0:p.map((function(e){return e.id})),o=new f(i(i({},e),{title:this.addressTitle||this.t("checkout-page:newAddress")})),(a=n(this.store.customerStore.customer)).addresses||(a.addresses=[]),a.addresses.push(o),[4,this.store.customerStore.saveCustomer(a)])):[3,2];case 1:t.sent(),null===(m=this.customerAddresses)||void 0===m||m.forEach((function(e){e.checkoutSettings=v.checkoutSettings,e.shippingZones=v.shippingZones})),c=null===(g=this.customerAddresses)||void 0===g?void 0:g.map((function(e){return e.id})),d=null==c?void 0:c.filter((function(e){return!(null==r?void 0:r.includes(e))})),u=(null==d?void 0:d.length)?d[0]:void 0,"shipping"===s?(this.checkout.shippingAddress.id=u||"",this.selectedShippingAddressId=u||"-1"):(this.checkout.billingAddress.id=u||"",this.selectedBillingAddressId=u||"-1"),t.label=2;case 2:return[3,4];case 3:return l=t.sent(),console.error(l),[3,4];case 4:return[2]}}))}))},this.onGoToCartClick=function(){W.router.push("/cart")},this.onBackToShoppingClick=function(){W.router.push("/")},this.onGoToLoginClick=function(){W.router.push("/account/login")},this.onProceedToShippingClick=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=1;case 1:return t.trys.push([1,6,,7]),this.isStepLoading=!0,"address"!==this.deliveryMethod?[3,3]:[4,this.saveAddress("shipping")];case 2:t.sent(),t.label=3;case 3:return[4,this.checkStocks()];case 4:return t.sent(),[4,this.saveCart()];case 5:return t.sent(),"address"===this.deliveryMethod?this.changeStep(M.SHIPPING):this.changeStep(M.PAYMENT),[3,7];case 6:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:V.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToDigitalOnlyPaymentClick=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=1;case 1:return t.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return t.sent(),[4,this.saveCart()];case 3:return t.sent(),this.changeStep(M.PAYMENT),[3,5];case 4:return(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:V.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onProceedToPaymentClick=function(){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=1;case 1:return t.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return t.sent(),[4,this.saveCart()];case 3:return t.sent(),this.error=void 0,this.changeStep(M.PAYMENT),[3,5];case 4:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:V.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.checkPaypalButtonAvailable=function(){return!!W.canPerformPayment||(W.isErrorsVisible=!0,!1)},this.onCompletePaymentClick=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return this.canPerformPayment?(this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),this.isKlarna?[4,this.saveCart()]:[3,2]):(this.isErrorsVisible=!0,[2]);case 1:return t.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:return t.trys.push([2,8,,9]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 3:return t.sent(),"address"===this.deliveryMethod&&this.useDifferentAddress?[4,this.saveAddress("billing")]:[3,5];case 4:t.sent(),t.label=5;case 5:return[4,this.saveCart()];case 6:return t.sent(),this.isCustomFlowStripe?((e=document.querySelector("#stripe-form-btn"))&&e.click(),[2]):this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):this.isPayPal?[2]:[4,this.createSaleTransaction()];case 7:return t.sent(),[3,9];case 8:return void 0!==typeof(i=t.sent()).type?this.error=i:this.error={type:V.UNKNOWN},this.isStepLoading=!1,[3,9];case 9:return[2]}}))}))},this.onCompleteDigitalOnlyPaymentClick=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return!this.canProceedToPayment||this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked?(this.isErrorsVisible=!0,[2]):this.isKlarna?[4,this.saveCart()]:[3,2];case 1:return t.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:return t.trys.push([2,6,,7]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 3:return t.sent(),[4,this.saveCart()];case 4:return t.sent(),this.isCustomFlowStripe?((e=document.querySelector("#stripe-form-btn"))&&e.click(),[2]):this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):this.isPayPal?[2]:[4,this.createSaleTransaction()];case 5:return t.sent(),[3,7];case 6:return(i=t.sent()).type?this.error=i:this.error={type:V.UNKNOWN},this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.createSaleTransaction=function(){return e(W,void 0,void 0,(function(){var e,i,s,n,r,o,d,u,h,p,m,g,f,v,y;return t(this,(function(t){switch(t.label){case 0:return i=this.mpVM.selectedCard,!this.isFree&&i&&(null===(u=this.mpVM.selectedCard)||void 0===u?void 0:u.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(e=n),void 0===(null===(h=this.cardData)||void 0===h?void 0:h.installmentCount)?[2]:[4,I.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:e,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name},paymentGatewayId:null===(m=this.mpVM.selectedCard)||void 0===m?void 0:m.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(g=this.cardData)||void 0===g?void 0:g.threeDSecure)}}})]):[3,2];case 1:return s=t.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway?[4,I.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:this.isFree?void 0:i&&e?{phoneNumber:e,savedCardName:null===(f=this.mpVM.selectedCard)||void 0===f?void 0:f.Name}:void 0,paymentGatewayId:this.checkout.selectedPaymentGateway.id,paymentMethodDetail:this.isFree||i?void 0:this.checkout.selectedPaymentGateway.paymentMethodType===a.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===c.INTERNAL&&this.cardData?this.cardData.toInput():void 0}})]:[2];case 3:s=t.sent(),t.label=4;case 4:return r=null===(v=null==s?void 0:s.data)||void 0===v?void 0:v.transactionStatus,o=r&&[l.SUCCESS,l.AUTHORIZED].includes(r),d=r===l.PENDING,o?[4,this.getSuccessTransaction()]:[3,7];case 5:return t.sent(),[4,this.onCheckoutTransactionSuccess()];case 6:return t.sent(),[3,8];case 7:if(!d||!(null===(y=null==s?void 0:s.data)||void 0===y?void 0:y.returnSlug))throw{data:s.firstErrorMessage,type:V.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,t.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return localStorage.removeItem("sAddr"),(null===(e=this.checkout.customer)||void 0===e?void 0:e.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.changeStep(M.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){W.changeStep(M.INFO)},this.onBackToShippingClick=function(){W.changeStep(M.SHIPPING)},this.setCustomerConsentGranted=function(e){W.checkout.customer&&(W.checkout.customer.notificationsAccepted=e)},this.setUseDifferentAddress=function(e){W.useDifferentAddress=e,W.useDifferentAddress?(localStorage.setItem("sAddr","1"),W.checkout.billingAddress=W.checkout.billingAddress||new G,W.checkout.billingAddress.countrySettings=W.countrySettings):(localStorage.removeItem("sAddr"),W.checkout.billingAddress=W.checkout.shippingAddress)},this.setShouldSaveAddress=function(e){W.shouldSaveAddress=e},this.setAddressTitle=function(e){W.addressTitle=e},this.reInitPaymentMethod=function(){return e(W,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return this.checkout.selectedPaymentGateway?this.isCustomFlowStripe?[4,this.createStripePaymentIntent(this.checkout.selectedPaymentGateway)]:[3,2]:[3,6];case 1:e.sent(),e.label=2;case 2:return this.isKlarna&&window.location.reload(),this.isAdyen?[4,this.createAdyenClientToken(this.checkout.selectedPaymentGateway)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.isPayPal?[4,this.getPayPalClientId(this.checkout.selectedPaymentGateway)]:[3,6];case 5:e.sent(),e.label=6;case 6:return[2]}}))}))},this.createStripePaymentIntent=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.stripeResponse=e.data),[2]}}))}))},this.createKlarnaClientToken=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.createKlarnaClientToken({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.klarnaResponse=e.data),[2]}}))}))},this.createAdyenClientToken=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.createAdyenClientToken({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.adyenResponse=e.data),[2]}}))}))},this.getPayPalClientId=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,I.getPayPalClientId({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.payPalClientIdResponse=e.data),[2]}}))}))},this.setPaymentGateway=function(i){return e(W,void 0,void 0,(function(){var e,s;return t(this,(function(t){switch(t.label){case 0:return this.paymentGateways.length?"STRIPE"!==(e=this.paymentGateways[i]).code||!(null===(s=e.settings)||void 0===s?void 0:s.find((function(e){return"allow_custom_flow"===e.label&&"1"===e.value})))||this.stripeResponse?[3,2]:[4,this.createStripePaymentIntent(e)]:[2];case 1:t.sent(),t.label=2;case 2:return"KLARNA"!==e.code||this.klarnaResponse?[3,4]:[4,this.createKlarnaClientToken(e)];case 3:t.sent(),t.label=4;case 4:return"ADYEN"!==e.code||this.adyenResponse?[3,6]:[4,this.createAdyenClientToken(e)];case 5:t.sent(),t.label=6;case 6:return"PAYPAL"!==e.code||this.payPalClientIdResponse?[3,8]:[4,this.getPayPalClientId(e)];case 7:t.sent(),t.label=8;case 8:return this.checkout.selectedPaymentGateway=e,this.step!==M.SUCCESS&&(e.paymentMethodType===a.CREDIT_CARD&&e.type===c.INTERNAL&&(this.cardData=new C,e.masterPassClientId&&(console.log("called 1511 ikas log"),this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store}))),this.installmentInfo=void 0),[2]}}))}))},this.setInstallmentCount=function(e){W.cardData&&(W.cardData.installmentCount=e)},this.changeStep=function(i){return e(W,void 0,void 0,(function(){return t(this,(function(e){return U||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return e(W,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return e.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(e){W.isContactModalVisible=e},this.getCampaignOfferProducts=function(i){return e(W,void 0,void 0,(function(){var e,s,n,r;return t(this,(function(o){switch(o.label){case 0:if(!this.checkout.campaignOffers||!this.checkout.campaignOffers.length)return[3,4];if(e=this.checkout.campaignOffers.filter((function(e){var t;return e.status===h.WAITING_FOR_ACTION&&(null===(t=e.campaignOffer)||void 0===t?void 0:t.targetPageTypes.some((function(e){return e===i})))})),!e.length)return[3,4];s=function(i){var s,n,r,o,a;return t(this,(function(t){switch(t.label){case 0:return(s=e[i]).campaignOffer&&(n=s.campaignOffer.offers.find((function(e){return e.id===s.campaignOfferProductId})))?[4,j.searchProducts({input:{productIdList:[n.productId]}})]:[3,2];case 1:if((r=t.sent()).isSuccess&&r.data&&r.data.data&&r.data.data.length&&(o=r.data.data[0],a=[],n.excludedVariantIdList&&n.excludedVariantIdList.length?o.variants.map((function(e){var t;e.hasStock&&!(null===(t=n.excludedVariantIdList)||void 0===t?void 0:t.some((function(t){return t===e.id})))&&a.push(e)})):a.push.apply(a,o.variants.filter((function(e){return e.hasStock}))),a.length))return[2,{value:{product:new k(o),variants:a,campaignOffer:s,offer:n}}];t.label=2;case 2:return[2]}}))},n=0,o.label=1;case 1:return n<e.length?[5,s(n)]:[3,4];case 2:if("object"==typeof(r=o.sent()))return[2,r.value];o.label=3;case 3:return n++,[3,1];case 4:return[2,void 0]}}))}))},this.getCampaignOffer=function(){return e(W,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return e=this,[4,this.getCampaignOfferProducts(p.CHECKOUT)];case 1:return e.checkoutCampaignOffer=t.sent(),i=this,[4,this.getCampaignOfferProducts(p.POST_CHECKOUT)];case 2:return i.postCheckoutCampaignOffer=t.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return e(W,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isCheckoutLoaded=!1,[4,A.updateCartCampaignOffer({input:i})];case 1:return(e=t.sent())&&e.isSuccess&&e.data&&(this.checkout=new m(e.data,this.countrySettings),i.accepted&&this.step===M.SUCCESS?this.changeStep(M.INFO):this.changeStep(this.step)),[2]}}))}))},this.registerCustomer=function(i){return e(W,void 0,void 0,(function(){var e,s,n,r;return t(this,(function(t){switch(t.label){case 0:return this.checkout.customer?(e=this.checkout.customer,s=e.firstName,n=e.lastName,r=e.email,s&&n&&r?[4,P.register({orderId:this.checkout.id,firstName:s,lastName:n,email:r,password:i})]:[3,2]):[3,2];case 1:return[2,t.sent()];case 2:return[2]}}))}))},this.checkout=d,this.checkoutSettings=u,this.router=v,this.returnPolicy=y,this.privacyPolicy=_,this.termsOfService=K,this.imprint=Z,this.shippingPolicy=Y,this.t=H,this.customizationProps=q,this.mpVM=new w,this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.countrySettings=new b({currentLocale:R.getCurrentLocale()}),this.init(),s(this)}return Object.defineProperty(_.prototype,"merchantSettings",{get:function(){return new y(R.getMerchantSettings())},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"selectedPaymentGatewayIndex",{get:function(){var e=this;return this.paymentGateways.findIndex((function(t){var i;return t.id===(null===(i=e.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"selectedInstallmentIndex",{get:function(){var e,t,i=this;return(null===(t=null===(e=this.installmentInfo)||void 0===e?void 0:e.installmentPrices)||void 0===t?void 0:t.findIndex((function(e){var t;return e.installmentCount===(null===(t=i.cardData)||void 0===t?void 0:t.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"customerAddressOptions",{get:function(){var e,t,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(t=null===(e=E.getInstance().customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===t?void 0:t.map((function(e){return{label:e.title+" - "+e.addressText,value:e.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"installmentPrice",{get:function(){var e,t,i,s=this;if(this.installmentInfo&&(null===(e=this.cardData)||void 0===e?void 0:e.installmentCount))return null===(i=null===(t=this.installmentInfo.installmentPrices)||void 0===t?void 0:t.find((function(e){var t;return e.installmentCount===(null===(t=s.cardData)||void 0===t?void 0:t.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"finalPrice",{get:function(){return this.step===M.SUCCESS?this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"hasStockError",{get:function(){var e;return(null===(e=this.error)||void 0===e?void 0:e.type)===V.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"hasQuickRegistration",{get:function(){return this.checkoutSettings.isQuickRegistrationEnabled&&this.checkout.customer&&this.checkout.customer.isGuestCheckout},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"canProceedToShipping",{get:function(){var e,t,i;return(this.isDigitalOnly?null===(e=this.checkout.billingAddress)||void 0===e?void 0:e.isValidAddress:null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.isValidAddress)&&this.checkout.hasValidCustomerEmail&&(null===(i=this.error)||void 0===i?void 0:i.type)!==V.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"canProceedToInStoreDelivery",{get:function(){var e,t,i;return!!((null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.firstName)&&(null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping&&this.isValidShippingSettings},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isValidShippingSettings",{get:function(){var e,t=this;return!(!this.isInStoreDelivery&&!this.isDigitalOnly)||this.checkout.shippingSettingsId&&this.checkout.shippingZoneRateId&&(null===(e=this.checkout.shippingLines)||void 0===e?void 0:e.some((function(e){return e.shippingSettingsId===t.checkout.shippingSettingsId&&e.shippingZoneRateId===t.checkout.shippingZoneRateId})))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"klarnaPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"KLARNA"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"klarnaPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"KLARNA"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"adyenPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"ADYEN"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"adyenPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"ADYEN"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"payPalPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"PAYPAL"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"payPalPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"PAYPAL"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCustomFlowStripe",{get:function(){var e,t=this.checkout.selectedPaymentGateway;return t&&"STRIPE"===t.code&&(null===(e=t.settings)||void 0===e?void 0:e.find((function(e){return"allow_custom_flow"===e.label&&"1"===e.value})))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isKlarna",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"KLARNA"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isAdyen",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"ADYEN"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isPayPal",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"PAYPAL"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isFree",{get:function(){return 0===this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"store",{get:function(){return E.getInstance()},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCouponCodeRequirementDefult",{get:function(){return this.checkoutSettings.couponCodeRequirement===o.DEFAULT||null===this.checkoutSettings.couponCodeRequirement},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCouponCodeRequirementOpen",{get:function(){return this.checkoutSettings.couponCodeRequirement===o.OPEN},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCouponCodeRequirementInvisible",{get:function(){return this.checkoutSettings.couponCodeRequirement===o.INVISIBLE},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isCouponCodeVisible",{get:function(){return this.isCouponCodeRequirementDefult&&!this.isCouponCodeRequirementInvisible},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"canPerformPayment",{get:function(){var e,t;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(e=this.checkout.billingAddress)||void 0===e?void 0:e.isValidAddress),r=!!this.isFree||(!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===a.CREDIT_CARD&&i.type===c.INTERNAL?!!this.isCustomFlowStripe||(!(!this.isKlarna&&!this.isPayPal)||(null===(t=this.cardData)||void 0===t?void 0:t.isValid)):!!i));return s&&n&&r},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isDigitalOnly",{get:function(){return this.checkout.shippingMethod===d.DIGITAL_DELIVERY},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"customerAddresses",{get:function(){var e,t,s=this;return null===(t=null===(e=this.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===t?void 0:t.map((function(e){var t=new v(i({countrySettings:s.countrySettings},e));return t.checkoutSettings=s.checkoutSettings,t.shippingZones=s.shippingZones,t.getValidatedCustomerAddress(),t}))},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isManualOrder",{get:function(){return this.checkout.createdBy===u.ADMIN},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isEPayKolayEnabled",{get:function(){var e=R.getCustom();return!!e&&!!e.isEPayKolayEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"isPoweredByHidden",{get:function(){var e=R.getCustom();return!!e&&!!e.hidePoweredBy},enumerable:!1,configurable:!0}),_.prototype.setAdyenDropinElement=function(e){this.adyenDropinElement=e},_}();function F(e,t){return e.match(new RegExp(".{1,"+t+"}","g"))||[]}function B(e){return e&&_.test(e.charAt(e.length-1))}!function(e){e.INFO="info",e.SHIPPING="shipping",e.PAYMENT="payment",e.SUCCESS="success"}(M||(M={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.API_ERROR=1]="API_ERROR",e[e.STOCK_ERROR=2]="STOCK_ERROR",e[e.PAYMENT_ERROR=3]="PAYMENT_ERROR",e[e.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",e[e.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(V||(V={}));export{M as CheckoutStep,V as ErrorType,K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as c}from"mobx-react-lite";import{IkasBaseStore as r}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var o=c((function(c){return a.useEffect((function(){window.captchaOnLoad=function(e){r.getInstance().customerStore.setCaptchaToken(e)}}),[]),a.useEffect((function(){try{if(document.getElementById("googleRecaptchaScript"))return;var a=document.createElement("script");a.src="https://www.google.com/recaptcha/api.js?render=6LcBVyAhAAAAAPqU6pwhCXm26KgqYAdLrwYAVjZ2",a.className="googleRecaptchaScript",a.async=!0,a.id="googleRecaptchaScript",document.body.appendChild(a);var c=document.getElementsByClassName("grecaptcha-badge");e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){if(c&&c.length>1){clearInterval(t);for(var a=0;a<c.length;a++){var r=c[a].getAttribute("style");r&&(r=r.concat("opacity: 0; visibility: hidden !important;")),c[a].setAttribute("style","".concat(r))}e(null)}else c=document.getElementsByClassName("grecaptcha-badge")}),100)}))];case 1:return[2,e.sent()]}}))}))}catch(e){console.log("Captcha Error",e)}}),[]),a.useEffect((function(){return function(){var e,t;try{var a=document.getElementsByClassName("grecaptcha-badge");if(a&&a.length)for(var c=0;c<a.length;c++)null===(e=a[c].parentNode)||void 0===e||e.removeChild(a[c]);var r=document.getElementsByClassName("googleRecaptchaScript");if(r&&r.length)for(c=0;c<r.length;c++)null===(t=r[c].parentNode)||void 0===t||t.removeChild(r[c])}catch(e){console.log("Captcha Remove Error",e)}}}),[]),a.createElement("div",{id:"recaptcha",className:"g-recaptcha","data-sitekey":"6LcBVyAhAAAAAPqU6pwhCXm26KgqYAdLrwYAVjZ2","data-callback":"captchaOnLoad","data-size":"invisible"})}));export{o as GoogleCaptcha};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import t,{useState as o}from"react";import i from"next/link";import{observer as n}from"mobx-react-lite";import{IkasBaseStore as s}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";var f=n((function(n){var f
|
|
1
|
+
import{__rest as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import t,{useState as o}from"react";import i from"next/link";import{observer as n}from"mobx-react-lite";import{IkasBaseStore as s}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";var f=n((function(n){var f;n.prefetch;var m=e(n,["prefetch"]),c=o(!1),p=c[0],l=c[1],d=s.getInstance();if(t.useEffect((function(){var e="string"==typeof m.href,r=d.spaLinksDisabled;l(r&&e)}),[d.spaLinksDisabled]),p){var u=null===(f=a.getCurrentRouting())||void 0===f?void 0:f.path,h=m.href,v=h;return u&&(v=h.replace("/","/".concat(u,"/"))),t.createElement("a",{href:v},m.children)}return t.createElement(i,r({},m),m.children)}));export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as r}from"next/router";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 i}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/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/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/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/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{IkasStorefrontConfig as n}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/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 s}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var d=o((function(o){var s=o.pageType,d=o.pageTitle,l=o.pageDescription,p=o.canonicals,u=o.disableIndex,g=o.pageSpecificData,f=o.merchantSettings,h=o.addOgpMetas,v=o.productReviewSummary,j=r(),x="undefined"!=typeof window,y="local"===process.env.NEXT_PUBLIC_ENV,b=j.asPath.split("?")[0].replace("/","");b="/"===b.charAt(b.length-1)?b.slice(0,-1):b;var C=n.getCurrentRouting(),k=(null==C?void 0:C.path)?"/"+C.path:"",T=y?"http://localhost:3333":"https://"+n.getDomain();t.useEffect((function(){document.documentElement.lang=n.getCurrentLocale()}),[s,g]);var E=t.useMemo((function(){if(g&&g.href)return"".concat(T).concat(g.href)}),[g]),D=t.useMemo((function(){var e=[];if(h){if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+n.getDomain()}),d&&e.push({property:"og:title",content:d}),l&&e.push({property:"og:description",content:l}),s===i.INDEX){var o=t.useMemo((function(){var e,t=null===(e=n.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===n.getCurrentLocale()&&e.pageType===s}));return t?c(g,s,t.titleTemplate||""):null}),[s,g]),a=t.useMemo((function(){var e,t=null===(e=n.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===n.getCurrentLocale()&&e.pageType===s}));return t?c(g,s,t.descriptionTemplate||""):null}),[s,g]);o&&e.push({property:"og:title",content:o}),a&&e.push({property:"og:description",content:a})}if(e.push({property:"og:url",content:E||(x?window.location.href:"")||"https://".concat(n.getDomain())}),g&&s===i.PRODUCT){var r=g.selectedVariant.mainImage;(null==r?void 0:r.image)&&e.push({property:"og:image",content:r.image.src})}else(null==f?void 0:f.logo)&&e.push({property:"og:image",content:f.logo.src});if(g&&s===i.CATEGORY){var m=g;m.image&&e.push({property:"og:image",content:m.image.src})}if(g&&s===i.BRAND){var p=g;p.image&&e.push({property:"og:image",content:p.image.src})}}return e}),[d,g,E,l,f,h,f]),L=t.useMemo((function(){var t=[];if(f){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+n.getDomain()},a=function(t){var o,a,r,i,s,d,m=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:m,image:m,url:"https://"+n.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(r=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===r?void 0:r.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(i=t.address)||void 0===i?void 0:i.postalCode,addressCountry:null===(d=null===(s=t.address)||void 0===s?void 0:s.country)||void 0===d?void 0:d.code})}}(f);t.push(o),t.push(a)}if(g&&s===i.PRODUCT){var r=g,d=function(t,o){var a,r,i,s;try{var d="https://".concat(n.getDomain()).concat(t.href),m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(r=m.images)||void 0===r?void 0:r.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(i=m.barcodeList)||void 0===i?void 0:i.length)?m.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(s=t.brand)||void 0===s?void 0:s.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:d,priceCurrency:m.price.currency||"TRY",price:m.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(r,v||null);if(d&&t.push(d),r.categories.length)(l=m(r.categories[0]))&&t.push(l)}if(g&&s===i.CATEGORY){var c=function(e){var t,o;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(n.getDomain()).concat(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(g),l=m(g);c&&t.push(c),l&&t.push(l)}if(g&&s===i.BLOG){var p=function(t){var o;try{var a="https://".concat(n.getDomain()).concat(t.href),r=function(e){var t=new Date(e),o=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(a,"-").concat(r)},i="".concat(t.writer.firstName," ").concat(t.writer.lastName),s=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:a,datePublished:r(t.createdAt),dateCreated:r(t.createdAt),dateModified:r(t.updatedAt),description:t.shortDescription,articleBody:s,author:{"@type":"Person",name:i}})}catch(e){}}(g);p&&t.push(p)}return t}),[g,f]),w=t.useMemo((function(){var e,t=null===(e=n.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===n.getCurrentLocale()&&e.pageType===s}));return t?c(g,s,t.titleTemplate||""):null}),[s,g]),O=t.useMemo((function(){var e,t=null===(e=n.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===n.getCurrentLocale()&&e.pageType===s}));return t?c(g,s,t.descriptionTemplate||""):null}),[s,g]),P=t.useCallback((function(){var e=n.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]),R=[];return n.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){R.push({routing:e,hrefLang:e.locale+"-"+t})})):R.push({routing:e,hrefLang:e.locale})})),t.createElement(a,null,t.createElement("title",null,d||w||""),t.createElement("meta",{name:"description",content:l||O||""}),s===i.CHECKOUT&&P()&&t.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/epay/containerServices.js"}),R.length>1&&R.map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(T+(e.routing.path?"/"+e.routing.path:""),"/").concat(b)})})),!!u&&t.createElement("meta",{name:"robots",content:"noindex"}),!!h&&D.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!p&&p.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(T).concat(k).concat(e)})})),t.createElement("link",{rel:"canonical",href:"".concat(T).concat(k,"/").concat(b)}),!!L.length&&L.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e){try{var t=s.getInstance(),o=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:"https://"+n.getDomain()+e.href}}));return t.currentPageType===i.CATEGORY&&o.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:"https://"+n.getDomain()+e.href}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:e.categoryPathItems.length?o:[{"@type":"ListItem",position:1,name:e.name,item:"https://"+n.getDomain()+e.href}]}}catch(e){}}function c(e,t,o){var a,r,n=o;try{switch(t){case i.PRODUCT:var s=e,d=s.name,m=(null===(a=s.brand)||void 0===a?void 0:a.name)||"",c=s.selectedVariant.sku||"",l=(null===(r=s.selectedVariant.barcodeList)||void 0===r?void 0:r.length)?s.selectedVariant.barcodeList[0]:"";n.includes("{{name}}")&&(n=n.replace("{{name}}",d)),n.includes("{{brand}}")&&(n=n.replace("{{brand}}",m)),n.includes("{{sku}}")&&(n=n.replace("{{sku}}",c)),n.includes("{{barcode}}")&&(n=n.replace("{{barcode}}",l));break;case i.BRAND:case i.CATEGORY:case i.BLOG_CATEGORY:var p=e.name||"";n.includes("{{name}}")&&(n=n.replace("{{name}}",p));break;case i.BLOG:var u=e.title;n.includes("{{name}}")&&(n=n.replace("{{name}}",u))}}catch(e){}return n.trimEnd()}export{d as IkasPageHead};
|
|
1
|
+
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as r}from"next/router";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 i}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/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/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/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/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{IkasStorefrontConfig as s}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/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 n}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var d=o((function(o){var n=o.pageType,d=o.pageTitle,l=o.pageDescription,p=o.canonicals,u=o.disableIndex,g=o.pageSpecificData,h=o.merchantSettings,f=o.addOgpMetas,v=o.productReviewSummary,j=r(),x="undefined"!=typeof window,y="local"===process.env.NEXT_PUBLIC_ENV,b=j.asPath.split("?")[0].replace("/","");b="/"===b.charAt(b.length-1)?b.slice(0,-1):b;var k=s.getCurrentRouting(),C=(null==k?void 0:k.path)?"/"+k.path:"",E=y?"http://localhost:3333":"https://"+s.getDomain();t.useEffect((function(){document.documentElement.lang=s.getCurrentLocale()}),[n,g]);var D=t.useMemo((function(){if(g&&g.href)return"".concat(E).concat(g.href)}),[g]),T=t.useMemo((function(){var e,t=[];if(f){if(t.push({property:"og:type",content:"website"}),t.push({property:"og:site_name",content:"https://"+s.getDomain()}),d&&t.push({property:"og:title",content:d}),l&&t.push({property:"og:description",content:l}),n===i.INDEX){var o=null,a=null,r=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));r&&(o=c(g,n,r.titleTemplate||""),a=c(g,n,r.descriptionTemplate||"")),o&&t.push({property:"og:title",content:o}),a&&t.push({property:"og:description",content:a})}if(t.push({property:"og:url",content:D||(x?window.location.href:"")||"https://".concat(s.getDomain())}),g&&n===i.PRODUCT){var m=g.selectedVariant.mainImage;(null==m?void 0:m.image)&&t.push({property:"og:image",content:m.image.src})}else(null==h?void 0:h.logo)&&t.push({property:"og:image",content:h.logo.src});if(g&&n===i.CATEGORY){var p=g;p.image&&t.push({property:"og:image",content:p.image.src})}if(g&&n===i.BRAND){var u=g;u.image&&t.push({property:"og:image",content:u.image.src})}}return t}),[d,g,D,l,h,f,h]),L=t.useMemo((function(){var t=[];if(h){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+s.getDomain()},a=function(t){var o,a,r,i,n,d,m=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:m,image:m,url:"https://"+s.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(r=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===r?void 0:r.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(i=t.address)||void 0===i?void 0:i.postalCode,addressCountry:null===(d=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===d?void 0:d.code})}}(h);t.push(o),t.push(a)}if(g&&n===i.PRODUCT){var r=g,d=function(t,o){var a,r,i,n;try{var d="https://".concat(s.getDomain()).concat(t.href),m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(r=m.images)||void 0===r?void 0:r.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(i=m.barcodeList)||void 0===i?void 0:i.length)?m.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:d,priceCurrency:m.price.currency||"TRY",price:m.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(r,v||null);if(d&&t.push(d),r.categories.length)(l=m(r.categories[0]))&&t.push(l)}if(g&&n===i.CATEGORY){var c=function(e){var t,o;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(s.getDomain()).concat(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(g),l=m(g);c&&t.push(c),l&&t.push(l)}if(g&&n===i.BLOG){var p=function(t){var o;try{var a="https://".concat(s.getDomain()).concat(t.href),r=function(e){var t=new Date(e),o=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(a,"-").concat(r)},i="".concat(t.writer.firstName," ").concat(t.writer.lastName),n=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:a,datePublished:r(t.createdAt),dateCreated:r(t.createdAt),dateModified:r(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:i}})}catch(e){}}(g);p&&t.push(p)}return t}),[g,h]),w=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));return t?c(g,n,t.titleTemplate||""):null}),[n,g]),O=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));return t?c(g,n,t.descriptionTemplate||""):null}),[n,g]),P=t.useCallback((function(){var e=s.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]),R=[];return s.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){R.push({routing:e,hrefLang:e.locale+"-"+t})})):R.push({routing:e,hrefLang:e.locale})})),t.createElement(a,null,t.createElement("title",null,d||w||""),t.createElement("meta",{name:"description",content:l||O||""}),n===i.CHECKOUT&&P()&&t.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/epay/containerServices.js"}),R.length>1&&R.map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(E+(e.routing.path?"/"+e.routing.path:""),"/").concat(b)})})),!!u&&t.createElement("meta",{name:"robots",content:"noindex"}),!!f&&T.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!p&&p.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(E).concat(C).concat(e)})})),t.createElement("link",{rel:"canonical",href:"".concat(E).concat(C,"/").concat(b)}),!!L.length&&L.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e){try{var t=n.getInstance(),o=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:"https://"+s.getDomain()+e.href}}));return t.currentPageType===i.CATEGORY&&o.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:"https://"+s.getDomain()+e.href}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:e.categoryPathItems.length?o:[{"@type":"ListItem",position:1,name:e.name,item:"https://"+s.getDomain()+e.href}]}}catch(e){}}function c(e,t,o){var a,r,s=o;try{switch(t){case i.PRODUCT:var n=e,d=n.name,m=(null===(a=n.brand)||void 0===a?void 0:a.name)||"",c=n.selectedVariant.sku||"",l=(null===(r=n.selectedVariant.barcodeList)||void 0===r?void 0:r.length)?n.selectedVariant.barcodeList[0]:"";s.includes("{{name}}")&&(s=s.replace("{{name}}",d)),s.includes("{{brand}}")&&(s=s.replace("{{brand}}",m)),s.includes("{{sku}}")&&(s=s.replace("{{sku}}",c)),s.includes("{{barcode}}")&&(s=s.replace("{{barcode}}",l));break;case i.BRAND:case i.CATEGORY:case i.BLOG_CATEGORY:var p=e.name||"";s.includes("{{name}}")&&(s=s.replace("{{name}}",p));break;case i.BLOG:var u=e.title;s.includes("{{name}}")&&(s=s.replace("{{name}}",u))}}catch(e){}return s.trimEnd()}export{d as IkasPageHead};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.8.0-beta.
|
|
3
|
+
"version": "4.8.0-beta.6",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^4.8.0-beta.
|
|
21
|
-
"@ikas/storefront-config": "^4.8.0-beta.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.8.0-beta.
|
|
23
|
-
"@ikas/storefront-models": "^4.8.0-beta.
|
|
24
|
-
"@ikas/storefront-providers": "^4.8.0-beta.
|
|
20
|
+
"@ikas/storefront-api": "^4.8.0-beta.6",
|
|
21
|
+
"@ikas/storefront-config": "^4.8.0-beta.6",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.8.0-beta.6",
|
|
23
|
+
"@ikas/storefront-models": "^4.8.0-beta.6",
|
|
24
|
+
"@ikas/storefront-providers": "^4.8.0-beta.6",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
26
26
|
"@adyen/adyen-web": "^5.28.2",
|
|
27
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
58
|
-
"@ikas/storefront-api": "^4.8.0-beta.
|
|
59
|
-
"@ikas/storefront-config": "^4.8.0-beta.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.8.0-beta.
|
|
61
|
-
"@ikas/storefront-models": "^4.8.0-beta.
|
|
62
|
-
"@ikas/storefront-providers": "^4.8.0-beta.
|
|
58
|
+
"@ikas/storefront-api": "^4.8.0-beta.6",
|
|
59
|
+
"@ikas/storefront-config": "^4.8.0-beta.6",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.8.0-beta.6",
|
|
61
|
+
"@ikas/storefront-models": "^4.8.0-beta.6",
|
|
62
|
+
"@ikas/storefront-providers": "^4.8.0-beta.6",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|