@ikas/storefront 6.1.0-beta.14 → 6.1.0-beta.141

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.
Files changed (147) hide show
  1. package/build/analytics/analytics.d.ts +3 -3
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/googleAnalytics.js +1 -1
  4. package/build/analytics/googleTagManager.d.ts +3 -2
  5. package/build/analytics/googleTagManager.js +1 -1
  6. package/build/analytics/ikasV3.d.ts +6 -0
  7. package/build/analytics/ikasV3.js +1 -1
  8. package/build/components/checkout/components/address-form/index.js +1 -1
  9. package/build/components/checkout/components/address-form/model.d.ts +3 -0
  10. package/build/components/checkout/components/address-form/model.js +1 -1
  11. package/build/components/checkout/components/adyen/index.js +1 -1
  12. package/build/components/checkout/components/button/index.d.ts +1 -0
  13. package/build/components/checkout/components/button/index.js +1 -1
  14. package/build/components/checkout/components/button/style.module.scss.js +1 -1
  15. package/build/components/checkout/components/cart-summary/index.d.ts +4 -1
  16. package/build/components/checkout/components/cart-summary/index.js +1 -1
  17. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  18. package/build/components/checkout/components/customer-addresses/index.d.ts +1 -0
  19. package/build/components/checkout/components/customer-addresses/index.js +1 -1
  20. package/build/components/checkout/components/error/stock-error/index.js +1 -1
  21. package/build/components/checkout/components/form-item/index.js +1 -1
  22. package/build/components/checkout/components/form-item/model.d.ts +5 -0
  23. package/build/components/checkout/components/form-item/model.js +1 -1
  24. package/build/components/checkout/components/form-item/style.module.scss.js +1 -1
  25. package/build/components/checkout/components/hepsipay/index.d.ts +9 -0
  26. package/build/components/checkout/components/hepsipay/index.js +1 -0
  27. package/build/components/checkout/components/input-with-button/style.module.scss.js +1 -1
  28. package/build/components/checkout/components/modal/index.d.ts +1 -0
  29. package/build/components/checkout/components/modal/index.js +1 -1
  30. package/build/components/checkout/components/modal/style.module.scss.js +1 -1
  31. package/build/components/checkout/components/offer-product/index.js +1 -1
  32. package/build/components/checkout/components/phone-number-input/index.js +1 -1
  33. package/build/components/checkout/components/quick-registration/completed.js +1 -1
  34. package/build/components/checkout/components/stripe/checkout-form.js +1 -1
  35. package/build/components/checkout/components/svg/coupon-code-tag.d.ts +6 -0
  36. package/build/components/checkout/components/svg/coupon-code-tag.js +1 -0
  37. package/build/components/checkout/components/svg/credit-balance.d.ts +6 -0
  38. package/build/components/checkout/components/svg/credit-balance.js +1 -0
  39. package/build/components/checkout/components/svg/gift-cart-tag.d.ts +6 -0
  40. package/build/components/checkout/components/svg/gift-cart-tag.js +1 -0
  41. package/build/components/checkout/components/svg/store-credit-tag.d.ts +6 -0
  42. package/build/components/checkout/components/svg/store-credit-tag.js +1 -0
  43. package/build/components/checkout/index.js +1 -1
  44. package/build/components/checkout/model.d.ts +23 -6
  45. package/build/components/checkout/model.js +1 -1
  46. package/build/components/checkout/steps/step-info/index.js +1 -1
  47. package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
  48. package/build/components/checkout/steps/step-payment/index.js +1 -1
  49. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  50. package/build/components/checkout/steps/step-payment/payment-gateways/store-credit/index.d.ts +7 -0
  51. package/build/components/checkout/steps/step-payment/payment-gateways/store-credit/index.js +1 -0
  52. package/build/components/checkout/steps/step-payment/payment-gateways/store-credit/style.module.scss.js +1 -0
  53. package/build/components/checkout/steps/step-success/index.js +1 -1
  54. package/build/components/image/index.d.ts +1 -0
  55. package/build/components/image/index.js +1 -1
  56. package/build/components/index.d.ts +2 -0
  57. package/build/components/page/head.js +1 -1
  58. package/build/components/page/index.js +1 -1
  59. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  60. package/build/components/page-editor/model.js +1 -1
  61. package/build/components/paypal-express-checkout/index.d.ts +9 -0
  62. package/build/components/paypal-express-checkout/index.js +1 -0
  63. package/build/components/plain-image/index.d.ts +13 -0
  64. package/build/components/plain-image/index.js +1 -0
  65. package/build/components/popup/index.js +1 -1
  66. package/build/components/popup/renderer/index.js +1 -1
  67. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/formatIncompletePhoneNumber.js +1 -0
  68. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/getCountries.js +1 -0
  69. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/formatIncompletePhoneNumber.js +1 -0
  70. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/getCountries.js +1 -0
  71. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/getCountryCallingCode.js +1 -0
  72. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/isSupportedCountry.js +1 -0
  73. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/parsePhoneNumber.js +1 -0
  74. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/ObserverComponent.js +1 -0
  75. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/index.js +1 -0
  76. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/observer.js +1 -0
  77. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/useObserver.js +1 -0
  78. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/UniversalFinalizationRegistry.js +1 -0
  79. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/assertEnvironment.js +1 -0
  80. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/observerBatching.js +1 -0
  81. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/observerFinalizationRegistry.js +1 -0
  82. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/printDebugValue.js +1 -0
  83. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -1
  84. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -1
  85. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -1
  86. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/phone-input-item-view/get-countries.js +1 -0
  87. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/phone-input-item-view/index.js +1 -0
  88. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -1
  89. package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -1
  90. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +1 -1
  91. package/build/hooks/useCustomerReviews.d.ts +2 -0
  92. package/build/hooks/useCustomerReviews.js +1 -1
  93. package/build/hooks/useStore.js +1 -1
  94. package/build/index.js +1 -1
  95. package/build/models/data/checkout-settings/index.d.ts +1 -0
  96. package/build/models/data/checkout-settings/index.js +1 -1
  97. package/build/models/data/customer/review/index.d.ts +4 -1
  98. package/build/models/data/customer/review/index.js +1 -1
  99. package/build/models/data/index.d.ts +1 -0
  100. package/build/models/data/order/gift-card-line/index.d.ts +9 -0
  101. package/build/models/data/order/gift-card-line/index.js +1 -0
  102. package/build/models/data/order/index.d.ts +3 -0
  103. package/build/models/data/order/index.js +1 -1
  104. package/build/models/data/order/line-item/bundle-product-settings/index.d.ts +7 -0
  105. package/build/models/data/order/line-item/bundle-product-settings/index.js +1 -0
  106. package/build/models/data/order/line-item/index.d.ts +2 -0
  107. package/build/models/data/order/line-item/index.js +1 -1
  108. package/build/models/data/product/campaign-offer/index.d.ts +2 -0
  109. package/build/models/data/product/campaign-offer/index.js +1 -1
  110. package/build/models/data/product/filter/index.d.ts +2 -0
  111. package/build/models/data/product/filter/index.js +1 -1
  112. package/build/models/data/product/index.d.ts +6 -0
  113. package/build/models/data/product/index.js +1 -1
  114. package/build/models/data/product/translations/index.d.ts +7 -0
  115. package/build/models/data/product/translations/index.js +1 -0
  116. package/build/models/data/product/variant/bundle-settings/bundle-product/index.js +1 -1
  117. package/build/models/data/product/variant/index.d.ts +1 -0
  118. package/build/models/data/product/variant/index.js +1 -1
  119. package/build/models/data/store-credit-balance/index.d.ts +26 -0
  120. package/build/models/data/store-credit-balance/index.js +1 -0
  121. package/build/models/data/theme-json/component/prop/index.d.ts +1 -0
  122. package/build/models/data/theme-json/component/prop/index.js +1 -1
  123. package/build/models/data/theme-json/custom-data/index.d.ts +1 -0
  124. package/build/models/data/theme-json/custom-data/index.js +1 -1
  125. package/build/models/ui/customer-review-list/index.d.ts +8 -0
  126. package/build/models/ui/customer-review-list/index.js +1 -1
  127. package/build/models/ui/product-list/index.d.ts +17 -0
  128. package/build/models/ui/product-list/index.js +1 -1
  129. package/build/models/ui/validator/form/login.d.ts +20 -6
  130. package/build/models/ui/validator/form/login.js +1 -1
  131. package/build/models/ui/validator/form/register.d.ts +15 -6
  132. package/build/models/ui/validator/form/register.js +1 -1
  133. package/build/pages/checkout.js +1 -1
  134. package/build/store/cart/api.d.ts +2 -1
  135. package/build/store/cart/api.js +1 -1
  136. package/build/store/cart/index.d.ts +1 -0
  137. package/build/store/cart/index.js +1 -1
  138. package/build/store/checkout/index.d.ts +4 -1
  139. package/build/store/checkout/index.js +1 -1
  140. package/build/store/customer/api.d.ts +14 -1
  141. package/build/store/customer/api.js +1 -1
  142. package/build/store/customer/index.d.ts +28 -3
  143. package/build/store/customer/index.js +1 -1
  144. package/build/store/product/index.d.ts +1 -0
  145. package/build/utils/helper.d.ts +1 -0
  146. package/build/utils/helper.js +1 -1
  147. package/package.json +12 -12
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{FormItem as o}from"../../components/form-item/index.js";import{FormItemType as i,FormItemInputMode as r}from"../../components/form-item/model.js";import{Button as n}from"../../components/button/index.js";import{Checkbox as c}from"../../components/checkbox/index.js";import m from"../../components/error/index.js";import s from"../../styles/common.module.scss.js";import a from"../../components/customer-addresses/index.js";import l from"../../components/customer-addresses/model.js";import"@ikas/storefront-config";import{useTranslation as u}from"../../../../utils/i18n.js";var p=t((function(t){var p,d,h=t.vm,g=u().t,f=e.useCallback((function(e){h.checkout.customer&&(h.checkout.customer.email=e?e.trim():e)}),[h,h.checkout,h.checkout.customer]),k=e.useMemo((function(){return h.isDigitalOnly?new l(h,"billing"):new l(h,"shipping")}),[h]);return e.createElement("div",null,e.createElement(m,{vm:h}),!h.checkout.hasCustomer&&e.createElement("div",{style:{marginTop:"8px",marginBottom:"40px"}},e.createElement("div",{className:s.FormSectionTitle},e.createElement("div",{className:s.Title},g("checkout-page:contactInfo"))),e.createElement(o,{type:i.TEXT,inputMode:r.EMAIL,label:g("checkout-page:email"),autocomplete:"email",value:(null===(p=h.checkout.customer)||void 0===p?void 0:p.email)||"",onChange:f,hasError:h.isErrorsVisible&&!h.checkout.hasValidCustomerEmail,errorText:g("checkout-page:emailError"),tooltipText:g("checkout-page:guestEmailTooltip")}),e.createElement(c,{value:(null===(d=h.checkout.customer)||void 0===d?void 0:d.notificationsAccepted)||!1,label:g("checkout-page:customerConsentCta"),onChange:h.setCustomerConsentGranted})),e.createElement(a,{vm:k}),!k.editingCustomerAddress&&e.createElement(n,{style:{width:"100%",marginTop:h.store.customerStore.customer?"0px":"32px"},text:"address"!==h.deliveryMethod||h.isDigitalOnly?g("checkout-page:actions.continueWithPayment"):g("checkout-page:actions.continueWithShipping"),isLoading:h.isStepLoading,onClick:h.isDigitalOnly?h.onProceedToDigitalOnlyPaymentClick:h.onProceedToShippingClick}))}));export{p as default};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{FormItem as o}from"../../components/form-item/index.js";import{FormItemType as i,FormItemInputMode as n}from"../../components/form-item/model.js";import{Button as r}from"../../components/button/index.js";import{Checkbox as s}from"../../components/checkbox/index.js";import c from"../../components/error/index.js";import m from"../../styles/common.module.scss.js";import l from"../../components/customer-addresses/index.js";import a from"../../components/customer-addresses/model.js";import"@ikas/storefront-config";import{useTranslation as p}from"../../../../utils/i18n.js";var d=t((function(t){var d,u,h=t.vm,g=p().t,f=e.useCallback((function(e){h.checkout.customer&&(h.checkout.customer.email=e?e.trim():e)}),[h,h.checkout,h.checkout.customer]),k=e.useMemo((function(){return h.isDigitalOnly?new a(h,"billing"):new a(h,"shipping")}),[h]);return e.createElement("div",null,e.createElement(c,{vm:h}),!h.checkout.hasCustomer&&e.createElement("div",{style:{marginTop:"8px",marginBottom:"40px"}},e.createElement("div",{className:m.FormSectionTitle},e.createElement("div",{className:m.Title},g("checkout-page:contactInfo"))),e.createElement(o,{type:i.TEXT,inputMode:n.EMAIL,label:g("checkout-page:email"),autocomplete:"email",value:(null===(d=h.checkout.customer)||void 0===d?void 0:d.email)||"",onChange:f,hasError:h.isErrorsVisible&&!h.checkout.hasValidCustomerEmail,errorText:g("checkout-page:emailError"),tooltipText:g("checkout-page:guestEmailTooltip"),autocapitalize:"off",autocorrect:"off",spellcheck:"false"}),e.createElement(s,{value:(null===(u=h.checkout.customer)||void 0===u?void 0:u.notificationsAccepted)||!1,label:g("checkout-page:customerConsentCta"),onChange:h.setCustomerConsentGranted})),e.createElement(l,{vm:k}),h.isShowBillingAddressOnShippingStep&&"address"===h.deliveryMethod&&!h.isDigitalOnly&&e.createElement(s,{value:!h.useDifferentAddress,hasError:h.isErrorsVisible&&!h.isTermsAndConditionsChecked,label:g("checkout-page:useShippingForBilling"),onChange:function(e){return h.setUseDifferentAddress(!e,!0)}}),h.isShowBillingAddressOnShippingStep&&(h.useDifferentAddress||"in-store"===h.deliveryMethod)&&e.createElement(l,{vm:new a(h,"billing"),showBillingAddressOnShippingStep:!0}),!k.editingCustomerAddress&&e.createElement(r,{style:{width:"100%",marginTop:h.store.customerStore.customer&&!h.isShowBillingAddressOnShippingStep?"0px":"32px"},text:"address"!==h.deliveryMethod||h.isDigitalOnly?g("checkout-page:actions.continueWithPayment"):g("checkout-page:actions.continueWithShipping"),isLoading:h.isStepLoading,onClick:h.isDigitalOnly?h.onProceedToDigitalOnlyPaymentClick:h.onProceedToShippingClick}))}));export{d as default};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as r}from"mobx-react-lite";import{Checkbox as t}from"../../../components/checkbox/index.js";import s from"../../../components/customer-addresses/model.js";import o from"../../../components/customer-addresses/index.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../../utils/i18n.js";var n=r((function(r){var n=r.vm,m=i().t,d=e.useMemo((function(){return new s(n,"billing")}),[n]);return e.useEffect((function(){"in-store"===n.deliveryMethod&&n.setUseDifferentAddress(!0)}),[n]),e.createElement(e.Fragment,null,e.createElement("div",{style:{marginTop:"32px",marginBottom:n.useDifferentAddress?"24px":"0px"}},"address"===n.deliveryMethod&&!n.isDigitalOnly&&n.isCorporateInvoiceVisible&&e.createElement(t,{value:!n.useDifferentAddress,hasError:n.isErrorsVisible&&!n.isTermsAndConditionsChecked,label:m("checkout-page:useShippingForBilling"),onChange:function(e){return n.setUseDifferentAddress(!e)}})),n.useDifferentAddress&&e.createElement(o,{vm:d}))}));export{n as BillingAddress};
1
+ import*as e from"react";import{observer as r}from"mobx-react-lite";import{Checkbox as s}from"../../../components/checkbox/index.js";import i from"../../../components/customer-addresses/model.js";import t from"../../../components/customer-addresses/index.js";import"@ikas/storefront-config";import{useTranslation as n}from"../../../../../utils/i18n.js";var o=r((function(r){var o=r.vm,m=n().t,d=e.useMemo((function(){return new i(o,"billing")}),[o]);return e.useEffect((function(){"in-store"===o.deliveryMethod&&o.setUseDifferentAddress(!0)}),[o]),e.createElement(e.Fragment,null,e.createElement("div",{style:{marginTop:"32px",marginBottom:o.useDifferentAddress?"24px":"0px"}},"address"===o.deliveryMethod&&!o.isDigitalOnly&&o.isCorporateInvoiceVisible&&!o.isShowBillingAddressOnShippingStep&&e.createElement(s,{value:!o.useDifferentAddress,hasError:o.isErrorsVisible&&!o.isTermsAndConditionsChecked,label:m("checkout-page:useShippingForBilling"),onChange:function(e){return o.setUseDifferentAddress(!e)}})),o.useDifferentAddress&&!o.isShowBillingAddressOnShippingStep&&e.createElement(t,{vm:d}))}));export{o as BillingAddress};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import{Checkbox as i}from"../../components/checkbox/index.js";import n from"../../components/error/index.js";import{PaymentGateways as r}from"./payment-gateways/index.js";import{BillingAddress as a}from"./billing-address/index.js";import{Button as c}from"../../components/button/index.js";import s from"../../components/master-pass/link-card-to-client/index.js";import{PayPal as l}from"../../components/paypal/index.js";import m from"../../components/notification-box/index.js";import{createTranslationInputData as p,useTranslation as d}from"../../../../utils/i18n.js";import u from"../../components/svg/lock.js";import y from"./style.module.scss.js";var k=t((function(t){var k=t.vm,f=d().t,g=e.useCallback((function(e){e.stopPropagation(),k.policyModalTitle=f("checkout-page:privacyPolicy"),k.policyModalText=k.privacyPolicy}),[k,k.privacyPolicy]),v=e.useCallback((function(e){e.stopPropagation(),k.policyModalTitle=f("checkout-page:termsOfService"),k.policyModalText=k.termsOfService}),[k,k.termsOfService]),C=o.getTranslations()["checkout-page"],P=p(C.ackPoliciesSentence).map((function(t){return t.isVariable?e.createElement("span",{className:[y.TermsLabelSpan,k.isErrorsVisible&&!k.isTermsAndConditionsChecked?y.Error:""].join(" "),onClick:"{{ ackPrivacyPolicy }}"===t.value?g:v},"{{ ackPrivacyPolicy }}"===t.value?f("checkout-page:ackPrivacyPolicy"):f("checkout-page:ackTermsOfService")):t.value}));return e.createElement("div",{className:[y.StepPayment,k.isPaymentMethodVisible?"":y.Disabled].join(" ")},e.createElement(n,{vm:k}),k.isFree&&e.createElement(m,{type:"success",content:f("checkout-page:freeOrderDescription")}),!k.isFree&&e.createElement(e.Fragment,null,k.mpVM.isLinkCardToClientVisible&&e.createElement(s,{vm:k}),e.createElement(r,{vm:k})),e.createElement(a,{vm:k}),k.checkoutSettings.showTermsAndConditionsCheckbox&&e.createElement("div",{style:{marginTop:k.useDifferentAddress?"12px":"0px"}},e.createElement(i,{value:k.isTermsAndConditionsChecked,hasError:k.isErrorsVisible&&!k.isTermsAndConditionsChecked,label:e.createElement(e.Fragment,null,P),onChange:k.onTermsAndConditionsCheckedChange})),!k.isFree&&k.isPayPal?e.createElement("div",{className:y.PayPalContainer},e.createElement(l,{vm:k})):e.createElement(c,{style:{width:"100%",marginTop:"24px"},text:f("checkout-page:actions.completeOrder"),isLoading:k.isStepLoading,onClick:k.isDigitalOnly?k.onCompleteDigitalOnlyPaymentClick:k.onCompletePaymentClick}),!!f("checkout-page:securePaymentTooltip")&&e.createElement("div",{className:y.SecurePaymentContainer},e.createElement("span",{className:y.Lock},e.createElement(u,null)),e.createElement("span",null,f("checkout-page:securePaymentTooltip"))))}));export{k as CheckoutStepPayment};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import{Checkbox as i}from"../../components/checkbox/index.js";import n from"../../components/error/index.js";import{PaymentGateways as r}from"./payment-gateways/index.js";import{BillingAddress as a}from"./billing-address/index.js";import{Button as c}from"../../components/button/index.js";import s from"../../components/master-pass/link-card-to-client/index.js";import{PayPal as m}from"../../components/paypal/index.js";import l from"../../components/notification-box/index.js";import{createTranslationInputData as p,useTranslation as d}from"../../../../utils/i18n.js";import y from"../../components/svg/lock.js";import u from"./style.module.scss.js";import{StoreCredit as k}from"./payment-gateways/store-credit/index.js";var f=t((function(t){var f=t.vm,g=d().t,v=e.useCallback((function(e){e.stopPropagation(),f.policyModalTitle=g("checkout-page:privacyPolicy"),f.policyModalText=f.privacyPolicy}),[f,f.privacyPolicy]),C=e.useCallback((function(e){e.stopPropagation(),f.policyModalTitle=g("checkout-page:termsOfService"),f.policyModalText=f.termsOfService}),[f,f.termsOfService]),E=o.getTranslations()["checkout-page"],P=p(E.ackPoliciesSentence).map((function(t){return t.isVariable?e.createElement("span",{className:[u.TermsLabelSpan,f.isErrorsVisible&&!f.isTermsAndConditionsChecked?u.Error:""].join(" "),onClick:"{{ ackPrivacyPolicy }}"===t.value?v:C},"{{ ackPrivacyPolicy }}"===t.value?g("checkout-page:ackPrivacyPolicy"):g("checkout-page:ackTermsOfService")):t.value}));return e.createElement("div",{className:[u.StepPayment,f.isPaymentMethodVisible?"":u.Disabled].join(" ")},e.createElement(n,{vm:f}),e.createElement(k,{vm:f}),f.isFree&&e.createElement(l,{type:"success",content:g("checkout-page:freeOrderDescription")}),!f.isFree&&e.createElement(e.Fragment,null,f.mpVM.isLinkCardToClientVisible&&e.createElement(s,{vm:f}),e.createElement(r,{vm:f})),e.createElement(a,{vm:f}),f.checkoutSettings.showTermsAndConditionsCheckbox&&e.createElement("div",{style:{marginTop:f.useDifferentAddress?"12px":"0px"}},e.createElement(i,{value:f.isTermsAndConditionsChecked,hasError:f.isErrorsVisible&&!f.isTermsAndConditionsChecked,label:e.createElement(e.Fragment,null,P),onChange:f.onTermsAndConditionsCheckedChange})),!f.isFree&&f.isPayPal?e.createElement("div",{className:u.PayPalContainer},e.createElement(m,{vm:f})):e.createElement(c,{style:{width:"100%",marginTop:"24px"},text:g("checkout-page:actions.completeOrder"),isLoading:f.isStepLoading,onClick:f.isDigitalOnly?f.onCompleteDigitalOnlyPaymentClick:f.onCompletePaymentClick}),!!g("checkout-page:securePaymentTooltip")&&e.createElement("div",{className:u.SecurePaymentContainer},e.createElement("span",{className:u.Lock},e.createElement(y,null)),e.createElement("span",null,g("checkout-page:securePaymentTooltip"))))}));export{f as CheckoutStepPayment};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";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{IkasPaymentMethodType as a,IkasPaymentGatewayType as n,IkasPaymentGatewayTransactionFeeType as o,IkasPaymentGatewayAdditionalPriceType as r}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/region/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/customer-form-data-input/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/region/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/order-transaction-with-prices/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/transaction/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/campaign-offer/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/stock-location/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../../models/data/storefront-popup/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/component/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{CreditCardForm as d}from"../../../components/credit-card-form/index.js";import{Installments as m}from"./installments/index.js";import i from"../../../components/select-box/index.js";import s from"./style.module.scss.js";import"@ikas/storefront-config";import{formatCurrency as l}from"../../../../../utils/currency.js";import{useTranslation as c}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";import u from"next/dynamic";import y from"../../../components/credit-card-form/model.js";import x from"../../../components/master-pass/credit-card-form/index.js";import{Toggle as f}from"../../../components/toggle/index.js";import v from"../../../components/select-box/style.module.scss.js";import j from"../../../components/master-pass/payment-gateway/svg/master-card.js";import E from"../../../components/master-pass/payment-gateway/svg/troy.js";import g from"../../../components/master-pass/payment-gateway/svg/visa.js";var P=u((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),w=u((function(){return import("../../../components/adyen/index.js").then((function(e){return e.Adyen}))})),h=u((function(){return import("../../../components/klarna/index.js").then((function(e){return e.Klarna}))})),C=t((function(t){var u=t.vm,C=c().t,k=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},G=function(t){return e.createElement("div",{className:s.AdditionalPrice},t.children)},I=function(e){return 0===e.amount?"":"".concat(e.amountType===o.AMOUNT?l(e.amount,u.checkout.currencyCode,u.checkout.currencySymbol):" %"+e.amount).concat(e.type===r.DECREMENT?" "+C("checkout-page:paymentMethodDiscount"):" "+C("checkout-page:paymentMethodAdditionalPrice"))},N=function(e){return"STRIPE"===e.code||"STRIPE_EU"===e.code},M=function(){var t,a=u.selectedPaymentGatewayIndex===u.klarnaPaymentGatewayIndex;return u.klarnaPaymentGateway?e.createElement("div",{className:v.SelectBoxContainer},e.createElement("div",{className:"".concat(v.SelectBox," ").concat(a?v.Selected:""),onClick:function(){u.setPaymentGateway(u.klarnaPaymentGatewayIndex),u.mpVM.selectedCard=void 0}},e.createElement("div",{className:v.TopContent},e.createElement(f,{value:a,label:u.klarnaPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:v.RightContent},(null===(t=u.klarnaPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(G,null,I(u.klarnaPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!u.klarnaPaymentGateway.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:u.klarnaPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?v.BottomContent:""," ").concat(a?"":s.Hidden)},e.createElement(h,{vm:u}),u.klarnaError&&e.createElement("div",{className:s.ErrorMessage},u.klarnaError.data)))):null},T=function(){var t=u.selectedPaymentGatewayIndex===u.adyenPaymentGatewayIndex;return u.adyenPaymentGateway?e.createElement("div",{className:v.SelectBoxContainer},e.createElement("div",{className:"".concat(v.SelectBox," ").concat(v.AdyenSelectBox),onClick:function(){u.setPaymentGateway(u.adyenPaymentGatewayIndex),u.mpVM.selectedCard=void 0}},e.createElement("div",{className:v.TopContent}),e.createElement("div",{className:"".concat(t?v.BottomContent:""," "),style:{paddingTop:0}},e.createElement(w,{vm:u,isSelected:t})))):null},b=function(){var t,a=u.selectedPaymentGatewayIndex===u.payPalPaymentGatewayIndex;return u.payPalPaymentGateway?e.createElement("div",{className:v.SelectBoxContainer},e.createElement("div",{className:"".concat(v.SelectBox," ").concat(a?v.Selected:""),onClick:function(){u.setPaymentGateway(u.payPalPaymentGatewayIndex),u.mpVM.selectedCard=void 0}},e.createElement("div",{className:v.TopContent},e.createElement(f,{value:a,label:u.payPalPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:v.RightContent},(null===(t=u.payPalPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(G,null,I(u.payPalPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!u.payPalPaymentGateway.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:u.payPalPaymentGateway.logoUrl}))))))):null};return e.createElement(e.Fragment,null,!!u.mpVM.cards.length&&u.mpVM.cards.map((function(t,o){var r,d=u.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),l=e.createElement("button",{className:s.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),u.mpVM.deleteCard({store:u.store,checkout:u.checkout,card:t})}},C("checkout-page:masterPass.paymentGatewaySelectBox.delete")),c=function(e){return t.Value1.startsWith(e)},p=c("4"),x=c("5")||c("6"),f=c("9"),v=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:s.MasterPassSelectBoxLabelLogo},p&&e.createElement(g,null),x&&e.createElement(j,null),f&&e.createElement(E,null)),t.Name," ",t.Value1),P=(null==d?void 0:d.id)&&d.paymentMethodType===a.CREDIT_CARD&&d.type===n.INTERNAL?u.installmentInfo&&e.createElement(m,{vm:u}):void 0;return e.createElement(i,{key:o,isSelected:(null===(r=u.mpVM.selectedCard)||void 0===r?void 0:r.UniqueId)===t.UniqueId,label:v,rightContent:l,bottomContent:P,onClick:function(){var e;(null===(e=u.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(u.checkout.selectedPaymentGateway=null,u.cardData=new y,u.installmentInfo=void 0,u.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&u.checkout.totalFinalPrice&&u.retrieveInstallmentInfo({input:{orderId:u.checkout.id,binNumber:t.Value1.slice(0,6),paymentGatewayId:t.paymentGatewayId,price:u.checkout.totalFinalPrice,currencyCode:u.checkout.currencyCode}}))}})})),u.paymentGateways.filter((function(e){return"in-store"!==u.deliveryMethod&&!u.isDigitalOnly||e.paymentMethodType!==a.CASH_ON_DELIVERY&&e.paymentMethodType!==a.CREDIT_CARD_ON_DELIVERY})).map((function(t,o){var r;if(function(e){return"KLARNA"===e.code}(t)&&u.klarnaPaymentGateway)return M();if(function(e){return"ADYEN_PLATFORM"===e.code}(t)&&u.adyenPaymentGateway)return T();if(function(e){return"PAYPAL"===e.code}(t)&&u.payPalPaymentGateway)return b();var l=t.paymentMethodType===a.CREDIT_CARD&&t.type===n.INTERNAL?e.createElement(e.Fragment,null,N(t)?e.createElement(e.Fragment,null,e.createElement(P,{vm:u,pg:t}),u.stripeError&&e.createElement("div",{className:s.ErrorMessage},u.stripeError.data)):e.createElement("div",null,e.createElement(d,{vm:u}),u.isPaymentGatewayHasMasterPass&&e.createElement(x,{vm:u}),u.installmentInfo&&e.createElement(m,{vm:u}))):t.description?e.createElement(e.Fragment,null,t.type===n.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(p,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(i,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===n.INTERNAL?N(t)?t.name:C("checkout-page:creditCard"):t.name,isSelected:u.selectedPaymentGatewayIndex===o,rightContent:(null===(r=t.additionalPrices)||void 0===r?void 0:r.length)?e.createElement(G,null,I(t.additionalPrices[0])):e.createElement(k,null,!!t.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:l,onClick:function(){u.selectedPaymentGatewayIndex!==o&&(u.setPaymentGateway(o),u.mpVM.selectedCard=void 0)}})})))}));export{C as PaymentGateways};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";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{IkasPaymentMethodType as a,IkasPaymentGatewayType as n,IkasPaymentGatewayTransactionFeeType as o,IkasPaymentGatewayAdditionalPriceType as r}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/region/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/customer-form-data-input/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/region/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/order-transaction-with-prices/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/transaction/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/campaign-offer/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/stock-location/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../../models/data/storefront-popup/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/component/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{CreditCardForm as i}from"../../../components/credit-card-form/index.js";import{Installments as m}from"./installments/index.js";import d from"../../../components/select-box/index.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{formatCurrency as s}from"../../../../../utils/currency.js";import{useTranslation as c}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";import y from"next/dynamic";import u from"../../../components/credit-card-form/model.js";import x from"../../../components/master-pass/credit-card-form/index.js";import{Toggle as v}from"../../../components/toggle/index.js";import f from"../../../components/select-box/style.module.scss.js";import E from"../../../components/master-pass/payment-gateway/svg/master-card.js";import P from"../../../components/master-pass/payment-gateway/svg/troy.js";import j from"../../../components/master-pass/payment-gateway/svg/visa.js";var g=y((function(){return import("../../../components/stripe/index.js").then((function(e){return e.default}))})),h=y((function(){return import("../../../components/adyen/index.js").then((function(e){return e.Adyen}))})),w=y((function(){return import("../../../components/klarna/index.js").then((function(e){return e.Klarna}))})),C=y((function(){return import("../../../components/hepsipay/index.js").then((function(e){return e.HepsiPay}))})),G=t((function(t){var y=t.vm,G=c().t,k=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},I=function(t){return e.createElement("div",{className:l.AdditionalPrice},t.children)},N=function(e){return 0===e.amount?"":"".concat(e.amountType===o.AMOUNT?s(e.amount,y.checkout.currencyCode,y.checkout.currencySymbol):" %"+e.amount).concat(e.type===r.DECREMENT?" "+G("checkout-page:paymentMethodDiscount"):" "+G("checkout-page:paymentMethodAdditionalPrice"))},M=function(e){return"STRIPE"===e.code||"STRIPE_EU"===e.code},T=function(){var t,a=y.selectedPaymentGatewayIndex===y.klarnaPaymentGatewayIndex;return y.klarnaPaymentGateway?e.createElement("div",{className:f.SelectBoxContainer},e.createElement("div",{className:"".concat(f.SelectBox," ").concat(a?f.Selected:""),onClick:function(){y.setPaymentGateway(y.klarnaPaymentGatewayIndex),y.mpVM.selectedCard=void 0}},e.createElement("div",{className:f.TopContent},e.createElement(v,{value:a,label:y.klarnaPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:f.RightContent},(null===(t=y.klarnaPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(I,null,N(y.klarnaPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!y.klarnaPaymentGateway.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:y.klarnaPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?f.BottomContent:""," ").concat(a?"":l.Hidden)},e.createElement(w,{vm:y}),y.klarnaError&&e.createElement("div",{className:l.ErrorMessage},y.klarnaError.data)))):null},b=function(){var t,a=y.selectedPaymentGatewayIndex===y.hepsiPayPaymentGatewayIndex;return y.hepsiPayPaymentGateway?e.createElement("div",{className:f.SelectBoxContainer},e.createElement("div",{className:"".concat(f.SelectBox," ").concat(a?f.Selected:""),onClick:function(){y.setPaymentGateway(y.hepsiPayPaymentGatewayIndex),y.mpVM.selectedCard=void 0}},e.createElement("div",{className:f.TopContent},e.createElement(v,{value:a,label:"Kredi / Banka Kartı - Hepsipay",removePadding:!0}),e.createElement("div",{className:f.RightContent},(null===(t=y.hepsiPayPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(I,null,N(y.hepsiPayPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!y.hepsiPayPaymentGateway.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:y.hepsiPayPaymentGateway.logoUrl}))))),e.createElement("div",{className:"".concat(a?f.BottomContent:""," ").concat(a?"":l.Hidden)},e.createElement(C,{vm:y})))):null},S=function(){var t=y.selectedPaymentGatewayIndex===y.adyenPaymentGatewayIndex;return y.adyenPaymentGateway?e.createElement("div",{className:f.SelectBoxContainer},e.createElement("div",{className:"".concat(f.SelectBox," ").concat(f.AdyenSelectBox),onClick:function(){y.setPaymentGateway(y.adyenPaymentGatewayIndex),y.mpVM.selectedCard=void 0}},e.createElement("div",{className:f.TopContent}),e.createElement("div",{className:"".concat(t?f.BottomContent:""," "),style:{paddingTop:0}},e.createElement(h,{vm:y,isSelected:t})))):null},R=function(){var t,a=y.selectedPaymentGatewayIndex===y.payPalPaymentGatewayIndex;return y.payPalPaymentGateway?e.createElement("div",{className:f.SelectBoxContainer},e.createElement("div",{className:"".concat(f.SelectBox," ").concat(a?f.Selected:""),onClick:function(){y.setPaymentGateway(y.payPalPaymentGatewayIndex),y.mpVM.selectedCard=void 0}},e.createElement("div",{className:f.TopContent},e.createElement(v,{value:a,label:y.payPalPaymentGateway.name,removePadding:!0}),e.createElement("div",{className:f.RightContent},(null===(t=y.payPalPaymentGateway.additionalPrices)||void 0===t?void 0:t.length)?e.createElement(I,null,N(y.payPalPaymentGateway.additionalPrices[0])):e.createElement(k,null,!!y.payPalPaymentGateway.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:y.payPalPaymentGateway.logoUrl}))))))):null};return e.createElement(e.Fragment,null,!!y.mpVM.cards.length&&y.mpVM.cards.map((function(t,o){var r,i=y.paymentGateways.find((function(e){return e.id===t.paymentGatewayId})),s=e.createElement("button",{className:l.MasterPassSelectBoxDeleteButton,onClick:function(e){e.stopPropagation(),y.mpVM.deleteCard({store:y.store,checkout:y.checkout,card:t})}},G("checkout-page:masterPass.paymentGatewaySelectBox.delete")),c=function(e){return t.Value1.startsWith(e)},p=c("4"),x=c("5")||c("6"),v=c("9"),f=e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("span",{className:l.MasterPassSelectBoxLabelLogo},p&&e.createElement(j,null),x&&e.createElement(E,null),v&&e.createElement(P,null)),t.Name," ",t.Value1),g=(null==i?void 0:i.id)&&i.paymentMethodType===a.CREDIT_CARD&&i.type===n.INTERNAL?y.installmentInfo&&e.createElement(m,{vm:y}):void 0;return e.createElement(d,{key:o,isSelected:(null===(r=y.mpVM.selectedCard)||void 0===r?void 0:r.UniqueId)===t.UniqueId,label:f,rightContent:s,bottomContent:g,onClick:function(){var e;(null===(e=y.mpVM.selectedCard)||void 0===e?void 0:e.UniqueId)!==t.UniqueId&&(y.checkout.selectedPaymentGateway=null,y.cardData=new u,y.installmentInfo=void 0,y.mpVM.selectedCard=t,t.Value1&&t.paymentGatewayId&&y.checkout.totalFinalPrice&&y.retrieveInstallmentInfo({input:{orderId:y.checkout.id,binNumber:t.Value1.slice(0,6),paymentGatewayId:t.paymentGatewayId,price:y.checkout.totalFinalPrice,currencyCode:y.checkout.currencyCode}}))}})})),y.paymentGateways.filter((function(e){return"in-store"!==y.deliveryMethod&&!y.isDigitalOnly||e.paymentMethodType!==a.CASH_ON_DELIVERY&&e.paymentMethodType!==a.CREDIT_CARD_ON_DELIVERY})).map((function(t,o){var r;if(function(e){return"KLARNA"===e.code}(t)&&y.klarnaPaymentGateway)return T();if(function(e){return"ADYEN_PLATFORM"===e.code}(t)&&y.adyenPaymentGateway)return S();if(function(e){return"PAYPAL"===e.code}(t)&&y.payPalPaymentGateway)return R();if(function(e){return"HEPSIPAY"===e.code}(t)&&y.hepsiPayPaymentGateway)return b();var s=t.paymentMethodType===a.CREDIT_CARD&&t.type===n.INTERNAL?e.createElement(e.Fragment,null,M(t)?e.createElement(e.Fragment,null,e.createElement(g,{vm:y,pg:t}),y.stripeError&&e.createElement("div",{className:l.ErrorMessage},y.stripeError.data)):e.createElement("div",null,e.createElement(i,{vm:y}),y.isPaymentGatewayHasMasterPass&&e.createElement(x,{vm:y}),y.installmentInfo&&e.createElement(m,{vm:y}))):t.description?e.createElement(e.Fragment,null,t.type===n.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(p,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0;return e.createElement(d,{key:t.id,label:t.paymentMethodType===a.CREDIT_CARD&&t.type===n.INTERNAL?M(t)?t.name:G("checkout-page:creditCard"):t.name,isSelected:y.selectedPaymentGatewayIndex===o,rightContent:(null===(r=t.additionalPrices)||void 0===r?void 0:r.length)?e.createElement(I,null,N(t.additionalPrices[0])):e.createElement(k,null,!!t.logoUrl&&e.createElement("div",{className:l.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:s,onClick:function(){y.selectedPaymentGatewayIndex!==o&&(y.setPaymentGateway(o),y.mpVM.selectedCard=void 0)}})})))}));export{G as PaymentGateways};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const StoreCredit: React.FC<Props>;
7
+ export {};
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as t}from'./../../../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as o}from"../../../../../../utils/currency.js";import{useTranslation as i}from"../../../../../../utils/i18n.js";import a from"./style.module.scss.js";import c from"../../../../components/svg/credit-balance.js";var l=n((function(n){var l,u,d=n.vm,m=i().t,v=r.useState(!1),f=v[0],C=v[1],h=null===(l=d.checkout.giftCardLines)||void 0===l?void 0:l.find((function(e){var t;return e.code===(null===(t=d.storeCreditBalance)||void 0===t?void 0:t.storeCredits[0].code)}));if(r.useEffect((function(){C(!!h)}),[h]),!(null===(u=d.storeCreditBalance)||void 0===u?void 0:u.amount))return null;var p=h?(null==h?void 0:h.amount)||0:d.finalPrice>d.storeCreditBalance.amount?d.storeCreditBalance.amount:d.finalPrice;return r.createElement("div",{className:a.StoreCredit},r.createElement("div",{className:a.StoreCreditBalance},r.createElement("div",{className:a.StoreCreditBalanceLeft},r.createElement("div",{style:{width:"24px",height:"24px"}},r.createElement(c,null)),r.createElement("div",null,r.createElement("span",{className:a.StoreCreditBalanceAmount},o(p,d.checkout.currencyCode,d.checkout.currencySymbol)),r.createElement("span",null,m("checkout-page:storeCreditBalance")))),r.createElement("div",{className:a.StoreCreditBalanceRight},r.createElement("div",null,r.createElement(s,{value:f,onChange:function(r){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return C(r),r?(d.checkout.couponCode=(null===(e=d.storeCreditBalance)||void 0===e?void 0:e.storeCredits[0].code)||null,[4,d.onCouponCodeApply()]):[3,2];case 1:return t.sent(),[3,5];case 2:return[4,d.removeGiftCardLine((null==h?void 0:h.giftCardId)||"")];case 3:return t.sent(),[4,d.reInitPaymentMethod()];case 4:t.sent(),t.label=5;case 5:return[2]}}))}))}})))))})),s=function(e){var t=e.value,n=e.onChange;return r.createElement("div",{onClick:function(){n(!t)},className:[a.ToggleSwitch,t?a.ToggleSwitchActive:""].join(" ")},r.createElement("div",{className:[a.ToggleSwitchThumb,t?a.ToggleSwitchThumbActive:""].join(" ")}))};export{l as StoreCredit};
@@ -0,0 +1 @@
1
+ import e from'./../../../../../../ext/style-inject/dist/style-inject.es.js';var t={StoreCredit:"style-module_StoreCredit__uHh7P",StoreCreditBalance:"style-module_StoreCreditBalance__kGygT",StoreCreditBalanceLeft:"style-module_StoreCreditBalanceLeft__vyYsH",StoreCreditBalanceRight:"style-module_StoreCreditBalanceRight__CLOTz",StoreCreditBalanceAmount:"style-module_StoreCreditBalanceAmount__XoXTX",ToggleSwitch:"style-module_ToggleSwitch__kDPf4",ToggleSwitchActive:"style-module_ToggleSwitchActive__aDOuc",ToggleSwitchThumb:"style-module_ToggleSwitchThumb__70mB3",ToggleSwitchThumbActive:"style-module_ToggleSwitchThumbActive__Di-kz"};e(".style-module_StoreCredit__uHh7P {\n padding: 12px;\n border-radius: 6px;\n border: 1px solid var(--checkout-border-color);\n margin-bottom: 16px;\n}\n.style-module_StoreCredit__uHh7P .style-module_StoreCreditBalance__kGygT {\n display: flex;\n justify-content: space-between;\n}\n.style-module_StoreCredit__uHh7P .style-module_StoreCreditBalance__kGygT .style-module_StoreCreditBalanceLeft__vyYsH {\n display: flex;\n gap: 6px;\n align-items: center;\n}\n.style-module_StoreCredit__uHh7P .style-module_StoreCreditBalance__kGygT .style-module_StoreCreditBalanceLeft__vyYsH span {\n font-size: 16px;\n line-height: 24px;\n}\n.style-module_StoreCredit__uHh7P .style-module_StoreCreditBalance__kGygT .style-module_StoreCreditBalanceLeft__vyYsH span:first-child {\n margin-right: 4px;\n}\n.style-module_StoreCredit__uHh7P .style-module_StoreCreditBalance__kGygT .style-module_StoreCreditBalanceRight__CLOTz {\n display: flex;\n gap: 6px;\n}\n.style-module_StoreCredit__uHh7P .style-module_StoreCreditBalance__kGygT .style-module_StoreCreditBalanceAmount__XoXTX {\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n}\n.style-module_StoreCredit__uHh7P .style-module_ToggleSwitch__kDPf4 {\n position: relative;\n width: 32px;\n height: 20px;\n background-color: #CDD5DF;\n border-radius: 12px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n display: flex;\n align-items: center;\n padding: 3px;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n.style-module_StoreCredit__uHh7P .style-module_ToggleSwitch__kDPf4.style-module_ToggleSwitchActive__aDOuc {\n background-color: var(--checkout-button-bg-color);\n}\n.style-module_StoreCredit__uHh7P .style-module_ToggleSwitchThumb__70mB3 {\n width: 14px;\n height: 14px;\n background-color: white;\n border-radius: 50%;\n transform: translateX(0px);\n transition: transform 0.2s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: absolute;\n}\n.style-module_StoreCredit__uHh7P .style-module_ToggleSwitchThumb__70mB3.style-module_ToggleSwitchThumbActive__Di-kz {\n transform: translateX(12px);\n}");export{t as default};
@@ -1 +1 @@
1
- import{__spreadArray as e}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as a}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as s}from"../../../../store/cart/index.js";import r from"./style.module.scss.js";import i from"../../components/svg/success-circle.js";import n from"../../components/expandable-section/index.js";import c from"../../components/credit-card-form/svg/amex.js";import d from"../../components/credit-card-form/svg/master-card.js";import l from"../../components/credit-card-form/svg/troy.js";import m from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as p}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.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{IkasPaymentMethodType as f,IkasPaymentGatewayType as v,IkasOrderPackageStatus as g,IkasTransactionCardAssociation as E}from"@ikas/storefront-models";import"mobx";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/region/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-form-data-input/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/order/address/region/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/order-transaction-with-prices/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../models/data/storefront-popup/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/ikas-address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import h from"../../components/offer-product/index.js";import{Analytics as x}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as k}from"../../components/quick-registration/index.js";import{ProductFiles as j}from"../../components/product-files/index.js";import y from"../../components/offer-product/offer-arrows/index.js";import N from"../../components/offer-product/offer-dots/index.js";import I from"../../components/svg/shopping-bag.js";import{CartSummary as A}from"../../components/cart-summary/index.js";import T from"../../components/offer-product/useCampaignOffer.js";var P="eventSentCartIds",S=a((function(a){var g,P,S,L,C,D,R,O,b,_,M,w=a.vm,F=u().t,Y=T(w,!0),U=Y.setActiveIndex,V=Y.setIsActiveOverlay,z=Y.handlePrev,B=Y.handleNext,K=Y.isActiveOverlay,G=Y.activeIndex,H=Y.isMobile;t.useEffect((function(){if("undefined"!=typeof localStorage){var t=localStorage.getItem(s),a=localStorage.getItem("eventSentCartIds");if(t&&t===w.checkout.id){if(w.successTransaction){var o=JSON.parse(a||"[]");if(!o.some((function(e){return e===w.checkout.id}))){var r=w.checkout.orderedAt,i=Date.now();Math.floor(Math.abs(i-r)/1e3)<30&&x.purchase(w.checkout,w.successTransaction),localStorage.setItem("eventSentCartIds",JSON.stringify(e(e([],o,!0),[w.checkout.id],!1)))}}localStorage.removeItem(s)}window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var Q=((null===(g=w.checkout.customer)||void 0===g?void 0:g.firstName)||"")+" "+((null===(P=w.checkout.customer)||void 0===P?void 0:P.lastName)||""),J=((null===(S=w.checkout.shippingAddress)||void 0===S?void 0:S.firstName)||"")+" "+((null===(L=w.checkout.shippingAddress)||void 0===L?void 0:L.lastName)||""),q=w.paymentGateways.find((function(e){var t;return e.id===(null===(t=w.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),X=function(e){switch(e){case f.APP_PAYMENT:return F("checkout-page:appPayment");case f.BANK_REDIRECT:return F("checkout-page:bankRedirect");case f.BUY_ONLINE_PAY_AT_STORE:return F("checkout-page:buyOnlinePayAtStore");case f.CASH:return F("checkout-page:cash");case f.CASH_ON_DELIVERY:return F("checkout-page:cashOnDelivery");case f.CREDIT_CARD:return F("checkout-page:creditCard");case f.CREDIT_CARD_ON_DELIVERY:return F("checkout-page:creditCardOnDelivery");case f.DIRECT_DEBIT:return F("checkout-page:directDebit");case f.GIFT_CARD:return F("checkout-page:giftCard");case f.MONEY_ORDER:return F("checkout-page:moneyOrder");case f.OTHER:return F("checkout-page:other");case f.PAY_LATER:return F("checkout-page:payLater");case f.SLICE_IT:return F("checkout-page:sliceIt");case f.WALLET:return F("checkout-page:wallet");default:return""}},W=null===(C=w.successTransaction)||void 0===C?void 0:C.paymentMethodDetail,Z=null===(D=w.successTransaction)||void 0===D?void 0:D.paymentGatewayCode,$=t.useMemo((function(){var e,a,o,s,i,n,u,g,h,x;return t.createElement("div",{className:[r.InfoGrid].join(" ")},!w.isFree&&t.createElement("div",{className:r.PaymentMethodMain},t.createElement("div",{className:r.InfoTitle},F("checkout-page:paymentMethod")),q&&t.createElement(t.Fragment,null,!!q.logoUrl&&t.createElement("div",{className:r.PaymentLogoContainer},t.createElement("img",{src:q.logoUrl})),!q.logoUrl&&t.createElement("div",{className:r.InfoText},q.paymentMethodType===f.CREDIT_CARD&&q.type===v.INTERNAL?F("checkout-page:creditCard"):q.name),"STRIPE"!==q.code&&"STRIPE_EU"!==q.code&&"PAYPAL"!==q.code&&"KLARNA"!==q.code||!(null===(e=w.successTransaction)||void 0===e?void 0:e.paymentMethod)?!!q.description&&q.type!==v.EXTERNAL&&t.createElement("div",{className:r.InfoText},t.createElement("div",{dangerouslySetInnerHTML:{__html:q.description}})):t.createElement("div",{className:r.InfoText},X(w.successTransaction.paymentMethod))),"E_PAY_KOLAY"===Z&&t.createElement(t.Fragment,null,t.createElement("div",{className:r.EPayKolayLogoContainer},t.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=w.successTransaction)||void 0===a?void 0:a.paymentMethod)&&t.createElement("div",{className:r.InfoText},X(null===(o=w.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==Z&&"STRIPE"!==Z&&"STRIPE_EU"!==Z&&"PAYPAL"!==Z&&"KLARNA"!==Z&&"CREDIT_CARD"===(null===(s=w.successTransaction)||void 0===s?void 0:s.paymentMethod)&&t.createElement(t.Fragment,null,t.createElement("div",{className:r.InfoText},t.createElement("div",{className:r.CardLogoContainer},function(){var e,a;switch(null===(a=null===(e=w.successTransaction)||void 0===e?void 0:e.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation){case E.AMERICAN_EXPRESS:return t.createElement(c,null);case E.MASTER_CARD:return t.createElement(d,null);case E.TROY:return t.createElement(l,null);case E.VISA:return t.createElement(m,null);default:return t.createElement("div",null)}}()),t.createElement("span",null,"**** ".concat((null==W?void 0:W.lastFourDigits)||""))),(null===(i=null==W?void 0:W.installment)||void 0===i?void 0:i.installmentCount)&&W.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:r.InfoText},"".concat(W.installment.installmentCount," ").concat(F("checkout-page:installments"))),null!==W.installment.installmentPrice&&t.createElement("div",{className:r.InfoText},"".concat(W.installment.installmentCount," x ").concat(p(W.installment.installmentPrice,w.checkout.currencyCode,w.checkout.currencySymbol)))))),t.createElement("div",null,t.createElement("div",{className:r.InfoTitle},F("checkout-page:billingAddress")),!!(null===(n=w.checkout.billingAddress)||void 0===n?void 0:n.firstName)&&t.createElement("div",{className:[r.InfoText,r.InfoTextPrimary].join(" ")},w.checkout.billingAddress.firstName," ",w.checkout.billingAddress.lastName),!!(null===(u=w.checkout.billingAddress)||void 0===u?void 0:u.company)&&t.createElement("div",{className:r.InfoText},w.checkout.billingAddress.company),(!!(null===(g=w.checkout.billingAddress)||void 0===g?void 0:g.taxOffice)||!!(null===(h=w.checkout.billingAddress)||void 0===h?void 0:h.taxNumber))&&t.createElement("div",{className:r.InfoText},w.checkout.billingAddress.taxOffice," ",w.checkout.billingAddress.taxNumber),t.createElement("div",{className:r.InfoText},null===(x=w.checkout.billingAddress)||void 0===x?void 0:x.addressText)))}),[]),ee=t.useMemo((function(){return t.createElement(A,{vm:w,isSuccessPageSummary:!0})}),[]),te=t.useMemo((function(){var e,a,o,s,i,n;return t.createElement("div",{className:[r.InfoGrid].join(" ")},t.createElement("div",null,t.createElement("div",{className:r.InfoTitle},F("checkout-page:contactInfo")),t.createElement("div",{className:r.InfoText},null===(e=w.checkout.customer)||void 0===e?void 0:e.email),t.createElement("div",{className:r.InfoText},Q),!!(null===(a=w.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&t.createElement("div",{className:r.InfoText},null===(o=w.checkout.shippingAddress)||void 0===o?void 0:o.phone)),t.createElement("div",null,"in-store"===w.deliveryMethod&&t.createElement(t.Fragment,null,t.createElement("div",{className:r.InfoTitle},F("checkout-page:receiver")),t.createElement("div",{className:[r.InfoText,r.withMBottom].join(" ")},J)),t.createElement("div",{className:r.InfoTitle},"address"===w.deliveryMethod?F("checkout-page:shippingAddress"):F("checkout-page:pickUpLocation")),!!(null===(s=w.checkout.shippingAddress)||void 0===s?void 0:s.firstName)&&t.createElement("div",{className:[r.InfoText,r.InfoTextPrimary].join(" ")},w.checkout.shippingAddress.firstName," ",w.checkout.shippingAddress.lastName),!!(null===(i=w.checkout.shippingAddress)||void 0===i?void 0:i.company)&&t.createElement("div",{className:r.InfoText},w.checkout.shippingAddress.company),t.createElement("div",{className:r.InfoText},null===(n=w.checkout.shippingAddress)||void 0===n?void 0:n.addressText)))}),[]),ae=!!(null===(R=w.customizationProps)||void 0===R?void 0:R.campaignOffersEnableMiddlePhase)&&!!(null===(O=w.customizationProps)||void 0===O?void 0:O.showCampaignIsBiggerImage)&&H&&K,oe=!!(null===(b=w.customizationProps)||void 0===b?void 0:b.campaignOffersEnableMiddlePhase)&&!!(null===(_=w.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&H&&!K;return t.createElement(t.Fragment,null,!!(null===(M=w.customizationProps)||void 0===M?void 0:M.campaignOffersEnableMiddlePhase)&&K&&w.campaignOffers&&w.campaignOffers.length>0&&H&&t.createElement("div",{className:[r.MiddlePhaseOverlay,ae?r.MiddlePhaseOverlayPopup:""].join(" ")}),w.campaignOffers&&!!w.campaignOffers.length&&w.isCampaignOfferLoaded&&t.createElement("div",{className:[r.CampaignOfferMain,ae?r.OverlayPopupMain:""].join(" ")},t.createElement("div",{className:r.OfferSlider},w.campaignOffers.map((function(e,a){var o;return t.createElement(h,{vm:w,campaignOffer:e,index:a,activeIndex:G,offersLength:(null===(o=w.campaignOffers)||void 0===o?void 0:o.length)||0,handlePrev:z,handleNext:B,setActiveIndex:function(e){return U(e)},isPopupShow:ae,closePopup:function(){return V(!1)},isPopupClosed:oe,showPopup:function(){return V(!0)},step:w.step})}))),w.campaignOffers.length>1&&t.createElement(y,{handlePrev:z,handleNext:B}),w.campaignOffers.length>1&&t.createElement(N,{isPopupShow:ae,vm:w,activeIndex:G})),t.createElement("div",{className:r.StepSuccess},t.createElement("div",{className:r.SuccessTitleContainer},t.createElement(i,{className:r.SuccessCircle}),t.createElement("span",{className:r.SuccessTitle},F("checkout-page:orderSuccessTitle"))),t.createElement("div",{className:r.SuccessSubTitle},F(w.isDigitalOnly?"checkout-page:orderSuccessDigitalOnlyDescription":"address"===w.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:Q})),w.productFiles.length>0&&t.createElement(j,{vm:w}),t.createElement("div",null,t.createElement("div",{className:r.OrderSummaryMain},t.createElement("div",null,t.createElement("span",{className:r.InfoTitle},F("checkout-page:orderNo")),t.createElement("span",{className:r.InfoText},"#"+(w.checkout.orderNumber||""))),t.createElement("div",null,t.createElement("span",{className:r.InfoTitle},F("checkout-page:orderDate")),t.createElement("span",{className:r.InfoText},w.checkout.dateStr)),t.createElement("div",{className:r.OrderAmountInfoMain},t.createElement("span",{className:r.InfoTitle},F("checkout-page:orderAmount")),t.createElement("span",{className:r.OrderAmountInfo},t.createElement("span",null,"".concat(p(w.finalPrice||0,w.checkout.currencyCode,w.checkout.currencySymbol))),t.createElement("span",{className:r.Slash},"/"),t.createElement("span",{className:r.OrderItemCount},t.createElement(I,null),t.createElement("span",null," ",w.checkout.itemQuantity," ",F("checkout-page:cartItemProduct"))))))),w.hasQuickRegistration&&t.createElement(k,{vm:w}),t.createElement("div",{className:r.HideOnDesktop},t.createElement(n,{title:F("checkout-page:summary")},ee)),t.createElement(n,{expanded:!0,title:F("checkout-page:paymentSummary")},$),!w.isDigitalOnly&&t.createElement(n,{title:F("checkout-page:shippingSummary")},te),t.createElement("div",{className:r.Actions},t.createElement("div",{className:r.HelpText},t.createElement("span",null,F("checkout-page:helpCtaQuestion")),t.createElement("span",{style:{marginLeft:"4px"},className:r.Cta,onClick:function(){return w.setContactModalVisible(!0)}},F("checkout-page:helpCta"))),t.createElement(o,{text:F("checkout-page:actions.backToShopping"),onClick:w.onBackToShoppingClick,style:{flex:"0 0 auto"}}))))}));a((function(e){var a,o=e.vm,s=u().t,i=r.Yellow;switch(o.checkout.orderPackageStatus){case g.FULFILLED:case g.PARTIALLY_FULFILLED:case g.DELIVERED:case g.PARTIALLY_DELIVERED:i=r.Green;break;case g.CANCELLED:case g.PARTIALLY_CANCELLED:case g.CANCEL_REJECTED:case g.CANCEL_REQUESTED:i=r.Red}return t.createElement("div",{className:[r.OrderStatus,i].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[g.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[g.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[g.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[g.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[g.DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[g.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.partiallyDelivered")},{types:[g.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[g.CANCELLED,g.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[g.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[g.REFUNDED,g.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[g.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[g.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[g.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{P as SENT_CART_IDS_LS_KEY,S as StepSuccess};
1
+ import{__spreadArray as e}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as a}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as s}from"../../../../store/cart/index.js";import n from"./style.module.scss.js";import r from"../../components/svg/success-circle.js";import i from"../../components/expandable-section/index.js";import c from"../../components/credit-card-form/svg/amex.js";import l from"../../components/credit-card-form/svg/master-card.js";import d from"../../components/credit-card-form/svg/troy.js";import m from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as p}from"../../../../utils/i18n.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{IkasPaymentMethodType as v,IkasPaymentGatewayType as f,IkasOrderPackageStatus as g,IkasTransactionCardAssociation as E}from"@ikas/storefront-models";import"mobx";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/region/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-form-data-input/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/order/address/region/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/order-transaction-with-prices/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../models/data/storefront-popup/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/ikas-address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import h from"../../components/offer-product/index.js";import{Analytics as x}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as k}from"../../components/quick-registration/index.js";import{ProductFiles as y}from"../../components/product-files/index.js";import j from"../../components/offer-product/offer-arrows/index.js";import N from"../../components/offer-product/offer-dots/index.js";import I from"../../components/svg/shopping-bag.js";import{CartSummary as T}from"../../components/cart-summary/index.js";import A from"../../components/offer-product/useCampaignOffer.js";var C="eventSentCartIds",D=a((function(a){var g,C,D,P,S,L,R,M,b,O,_,F,w=a.vm,Y=p().t,U=A(w,!0),V=U.setActiveIndex,z=U.setIsActiveOverlay,B=U.handlePrev,G=U.handleNext,H=U.isActiveOverlay,K=U.activeIndex,Q=U.isMobile;t.useEffect((function(){if("undefined"!=typeof localStorage){var t=localStorage.getItem(s),a=localStorage.getItem("eventSentCartIds");if(t&&t===w.checkout.id){if(w.successTransaction){var o=JSON.parse(a||"[]");if(!o.some((function(e){return e===w.checkout.id}))){var n=w.checkout.orderedAt,r=Date.now();Math.floor(Math.abs(r-n)/1e3)<30&&x.purchase(w.checkout,w.successTransaction),localStorage.setItem("eventSentCartIds",JSON.stringify(e(e([],o,!0),[w.checkout.id],!1)))}}localStorage.removeItem(s)}window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var J=((null===(g=w.checkout.customer)||void 0===g?void 0:g.firstName)||"")+" "+((null===(C=w.checkout.customer)||void 0===C?void 0:C.lastName)||""),q=((null===(D=w.checkout.shippingAddress)||void 0===D?void 0:D.firstName)||"")+" "+((null===(P=w.checkout.shippingAddress)||void 0===P?void 0:P.lastName)||""),X=w.paymentGateways.find((function(e){var t;return e.id===(null===(t=w.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),W=function(e){var a,o;switch(e||(null===(o=null===(a=w.successTransaction)||void 0===a?void 0:a.paymentMethodDetail)||void 0===o?void 0:o.cardAssociation)){case E.AMERICAN_EXPRESS:return t.createElement(c,null);case E.MASTER_CARD:return t.createElement(l,null);case E.TROY:return t.createElement(d,null);case E.VISA:return t.createElement(m,null);default:return t.createElement("div",null)}},Z=function(e){switch(e){case v.APP_PAYMENT:return Y("checkout-page:appPayment");case v.BANK_REDIRECT:return Y("checkout-page:bankRedirect");case v.BUY_ONLINE_PAY_AT_STORE:return Y("checkout-page:buyOnlinePayAtStore");case v.CASH:return Y("checkout-page:cash");case v.CASH_ON_DELIVERY:return Y("checkout-page:cashOnDelivery");case v.CREDIT_CARD:return Y("checkout-page:creditCard");case v.CREDIT_CARD_ON_DELIVERY:return Y("checkout-page:creditCardOnDelivery");case v.DIRECT_DEBIT:return Y("checkout-page:directDebit");case v.GIFT_CARD:return Y("checkout-page:giftCard");case v.MONEY_ORDER:return Y("checkout-page:moneyOrder");case v.OTHER:return Y("checkout-page:other");case v.PAY_LATER:return Y("checkout-page:payLater");case v.SLICE_IT:return Y("checkout-page:sliceIt");case v.WALLET:return Y("checkout-page:wallet");default:return""}},$=null===(S=w.successTransaction)||void 0===S?void 0:S.paymentMethodDetail,ee=null===(L=w.successTransaction)||void 0===L?void 0:L.paymentGatewayCode,te=null===(R=w.successTransactions)||void 0===R?void 0:R.some((function(e){return e.paymentMethod===v.GIFT_CARD})),ae=t.useMemo((function(){var e;return null===(e=w.successTransactions)||void 0===e?void 0:e.map((function(e){var a,o,s;return t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},Z(e.paymentMethod)),e.paymentMethod===v.CREDIT_CARD&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},t.createElement("div",{className:n.CardLogoContainer},W(null===(a=e.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation)),t.createElement("span",null,"**** ".concat((null==$?void 0:$.lastFourDigits)||""))),(null===(s=null===(o=e.paymentMethodDetail)||void 0===o?void 0:o.installment)||void 0===s?void 0:s.installmentCount)&&e.paymentMethodDetail.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},"".concat(e.paymentMethodDetail.installment.installmentCount," ").concat(Y("checkout-page:installments"))),null!==e.paymentMethodDetail.installment.installmentPrice&&t.createElement("div",{className:n.InfoText},"".concat(e.paymentMethodDetail.installment.installmentCount," x ").concat(u(e.paymentMethodDetail.installment.installmentPrice,w.checkout.currencyCode,w.checkout.currencySymbol))))))}))}),[]),oe=t.useMemo((function(){var e,a,o,s,r,i,c,l,d,m;return t.createElement("div",{className:[n.InfoGrid].join(" ")},!w.isFree&&t.createElement("div",{className:n.PaymentMethodMain},t.createElement("div",{className:n.InfoTitle},Y("checkout-page:paymentMethod")),te?ae:t.createElement(t.Fragment,null,X&&t.createElement(t.Fragment,null,!!X.logoUrl&&t.createElement("div",{className:n.PaymentLogoContainer},t.createElement("img",{src:X.logoUrl})),!X.logoUrl&&t.createElement("div",{className:n.InfoText},X.paymentMethodType===v.CREDIT_CARD&&X.type===f.INTERNAL?Y("checkout-page:creditCard"):X.name),"STRIPE"!==X.code&&"STRIPE_EU"!==X.code&&"PAYPAL"!==X.code&&"KLARNA"!==X.code||!(null===(e=w.successTransaction)||void 0===e?void 0:e.paymentMethod)?!!X.description&&X.type!==f.EXTERNAL&&t.createElement("div",{className:n.InfoText},t.createElement("div",{dangerouslySetInnerHTML:{__html:X.description}})):t.createElement("div",{className:n.InfoText},Z(w.successTransaction.paymentMethod))),"E_PAY_KOLAY"===ee&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.EPayKolayLogoContainer},t.createElement("img",{src:"https://cdn.myikas.com/sf/assets/payment/epaykolay.png"})),!!(null===(a=w.successTransaction)||void 0===a?void 0:a.paymentMethod)&&t.createElement("div",{className:n.InfoText},Z(null===(o=w.successTransaction)||void 0===o?void 0:o.paymentMethod))),"E_PAY_KOLAY"!==ee&&"STRIPE"!==ee&&"STRIPE_EU"!==ee&&"PAYPAL"!==ee&&"KLARNA"!==ee&&"CREDIT_CARD"===(null===(s=w.successTransaction)||void 0===s?void 0:s.paymentMethod)&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},t.createElement("div",{className:n.CardLogoContainer},W()),t.createElement("span",null,"**** ".concat((null==$?void 0:$.lastFourDigits)||""))),(null===(r=null==$?void 0:$.installment)||void 0===r?void 0:r.installmentCount)&&$.installment.installmentCount>1&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoText},"".concat($.installment.installmentCount," ").concat(Y("checkout-page:installments"))),null!==$.installment.installmentPrice&&t.createElement("div",{className:n.InfoText},"".concat($.installment.installmentCount," x ").concat(u($.installment.installmentPrice,w.checkout.currencyCode,w.checkout.currencySymbol))))))),!!w.isFree&&!!te&&t.createElement("div",{className:n.PaymentMethodMain},t.createElement("div",{className:n.InfoTitle},Y("checkout-page:paymentMethod")),ae),t.createElement("div",null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:billingAddress")),!!(null===(i=w.checkout.billingAddress)||void 0===i?void 0:i.firstName)&&t.createElement("div",{className:[n.InfoText,n.InfoTextPrimary].join(" ")},w.checkout.billingAddress.firstName," ",w.checkout.billingAddress.lastName),!!(null===(c=w.checkout.billingAddress)||void 0===c?void 0:c.company)&&t.createElement("div",{className:n.InfoText},w.checkout.billingAddress.company),(!!(null===(l=w.checkout.billingAddress)||void 0===l?void 0:l.taxOffice)||!!(null===(d=w.checkout.billingAddress)||void 0===d?void 0:d.taxNumber))&&t.createElement("div",{className:n.InfoText},w.checkout.billingAddress.taxOffice," ",w.checkout.billingAddress.taxNumber),t.createElement("div",{className:n.InfoText},null===(m=w.checkout.billingAddress)||void 0===m?void 0:m.addressText)))}),[]),se=t.useMemo((function(){return t.createElement(T,{vm:w,isSuccessPageSummary:!0})}),[]),ne=t.useMemo((function(){var e,a,o,s,r,i;return t.createElement("div",{className:[n.InfoGrid].join(" ")},t.createElement("div",null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:contactInfo")),t.createElement("div",{className:n.InfoText},null===(e=w.checkout.customer)||void 0===e?void 0:e.email),t.createElement("div",{className:n.InfoText},J),!!(null===(a=w.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&t.createElement("div",{className:n.InfoText},null===(o=w.checkout.shippingAddress)||void 0===o?void 0:o.phone)),t.createElement("div",null,"in-store"===w.deliveryMethod&&t.createElement(t.Fragment,null,t.createElement("div",{className:n.InfoTitle},Y("checkout-page:receiver")),t.createElement("div",{className:[n.InfoText,n.withMBottom].join(" ")},q)),t.createElement("div",{className:n.InfoTitle},"address"===w.deliveryMethod?Y("checkout-page:shippingAddress"):Y("checkout-page:pickUpLocation")),!!(null===(s=w.checkout.shippingAddress)||void 0===s?void 0:s.firstName)&&t.createElement("div",{className:[n.InfoText,n.InfoTextPrimary].join(" ")},w.checkout.shippingAddress.firstName," ",w.checkout.shippingAddress.lastName),!!(null===(r=w.checkout.shippingAddress)||void 0===r?void 0:r.company)&&t.createElement("div",{className:n.InfoText},w.checkout.shippingAddress.company),t.createElement("div",{className:n.InfoText},null===(i=w.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]),re=!!(null===(M=w.customizationProps)||void 0===M?void 0:M.campaignOffersEnableMiddlePhase)&&!!(null===(b=w.customizationProps)||void 0===b?void 0:b.showCampaignIsBiggerImage)&&Q&&H,ie=!!(null===(O=w.customizationProps)||void 0===O?void 0:O.campaignOffersEnableMiddlePhase)&&!!(null===(_=w.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&Q&&!H;return t.createElement(t.Fragment,null,!!(null===(F=w.customizationProps)||void 0===F?void 0:F.campaignOffersEnableMiddlePhase)&&H&&w.campaignOffers&&w.campaignOffers.length>0&&Q&&t.createElement("div",{className:[n.MiddlePhaseOverlay,re?n.MiddlePhaseOverlayPopup:""].join(" ")}),w.campaignOffers&&!!w.campaignOffers.length&&w.isCampaignOfferLoaded&&t.createElement("div",{className:[n.CampaignOfferMain,re?n.OverlayPopupMain:""].join(" ")},t.createElement("div",{className:n.OfferSlider},w.campaignOffers.map((function(e,a){var o;return t.createElement(h,{vm:w,campaignOffer:e,index:a,activeIndex:K,offersLength:(null===(o=w.campaignOffers)||void 0===o?void 0:o.length)||0,handlePrev:B,handleNext:G,setActiveIndex:function(e){return V(e)},isPopupShow:re,closePopup:function(){return z(!1)},isPopupClosed:ie,showPopup:function(){return z(!0)},step:w.step})}))),w.campaignOffers.length>1&&t.createElement(j,{handlePrev:B,handleNext:G}),w.campaignOffers.length>1&&t.createElement(N,{isPopupShow:re,vm:w,activeIndex:K})),t.createElement("div",{className:n.StepSuccess},t.createElement("div",{className:n.SuccessTitleContainer},t.createElement(r,{className:n.SuccessCircle}),t.createElement("span",{className:n.SuccessTitle},Y("checkout-page:orderSuccessTitle"))),t.createElement("div",{className:n.SuccessSubTitle},Y(w.isDigitalOnly?"checkout-page:orderSuccessDigitalOnlyDescription":"address"===w.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:J})),w.productFiles.length>0&&t.createElement(y,{vm:w}),t.createElement("div",null,t.createElement("div",{className:n.OrderSummaryMain},t.createElement("div",null,t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderNo")),t.createElement("span",{className:n.InfoText},"#"+(w.checkout.orderNumber||""))),t.createElement("div",null,t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderDate")),t.createElement("span",{className:n.InfoText},w.checkout.dateStr)),t.createElement("div",{className:n.OrderAmountInfoMain},t.createElement("span",{className:n.InfoTitle},Y("checkout-page:orderAmount")),t.createElement("span",{className:n.OrderAmountInfo},t.createElement("span",null,"".concat(u(w.finalPrice||0,w.checkout.currencyCode,w.checkout.currencySymbol))),t.createElement("span",{className:n.Slash},"/"),t.createElement("span",{className:n.OrderItemCount},t.createElement(I,null),t.createElement("span",null," ",w.checkout.itemQuantity," ",Y("checkout-page:cartItemProduct"))))))),w.hasQuickRegistration&&t.createElement(k,{vm:w}),t.createElement("div",{className:n.HideOnDesktop},t.createElement(i,{title:Y("checkout-page:summary")},se)),t.createElement(i,{expanded:!0,title:Y("checkout-page:paymentSummary")},oe),!w.isDigitalOnly&&t.createElement(i,{title:Y("checkout-page:shippingSummary")},ne),t.createElement("div",{className:n.Actions},t.createElement("div",{className:n.HelpText},t.createElement("span",null,Y("checkout-page:helpCtaQuestion")),t.createElement("span",{style:{marginLeft:"4px"},className:n.Cta,onClick:function(){return w.setContactModalVisible(!0)}},Y("checkout-page:helpCta"))),t.createElement(o,{href:w.getBackToShoppingHref(),text:Y("checkout-page:actions.backToShopping"),style:{flex:"0 0 auto"}}))))}));a((function(e){var a,o=e.vm,s=p().t,r=n.Yellow;switch(o.checkout.orderPackageStatus){case g.FULFILLED:case g.PARTIALLY_FULFILLED:case g.DELIVERED:case g.PARTIALLY_DELIVERED:r=n.Green;break;case g.CANCELLED:case g.PARTIALLY_CANCELLED:case g.CANCEL_REJECTED:case g.CANCEL_REQUESTED:r=n.Red}return t.createElement("div",{className:[n.OrderStatus,r].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[g.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[g.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[g.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[g.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[g.DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[g.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.partiallyDelivered")},{types:[g.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[g.CANCELLED,g.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[g.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[g.REFUNDED,g.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[g.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[g.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[g.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{C as SENT_CART_IDS_LS_KEY,D as StepSuccess};
@@ -6,5 +6,6 @@ declare type ImageProps = Omit<NextImageProps, "src" | "srcSet" | "blurDataURL"
6
6
  priority?: boolean;
7
7
  image: IkasImage;
8
8
  useBlur?: boolean;
9
+ lossless?: boolean;
9
10
  };
10
11
  export {};
@@ -1 +1 @@
1
- import{__rest as r,__assign as t}from'./../../ext/tslib/tslib.es6.js';import*as e from"react";import a from"next/image.js";import{IkasImageFunctions as o}from"@ikas/storefront-model-functions";var l=[180,360,540,720,900,1080,1296,1512,1728,1950,2560,3840],u=function(u){var i=u.image,m=u.useBlur,n=r(u,["image","useBlur"]),s=o.getDefaultSrc,c=o.getSrc;return i?e.createElement(a,t({},n,{loader:function(r){var t=r.width,e=l.reduce((function(r,e){return Math.abs(e-t)<Math.abs(r-t)?e:r}));return c(i,e)},quality:100,src:s(i),alt:n.alt||"Image",placeholder:m?"blur":"empty",blurDataURL:m?c(i,10):void 0})):null};export{u as Image};
1
+ import{__rest as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import s from"next/image.js";import{IkasImageFunctions as o}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";var l=[180,360,540,720,900,1080,1296,1512,1728,1950,2560,3840],i=function(i){var m=i.image,n=i.useBlur,u=i.lossless,f=e(i,["image","useBlur","lossless"]),c=o.getDefaultSrc,d=o.getSrc;return m?t.createElement(s,r({},f,{loader:function(e){var r=e.width,t=l.reduce((function(e,t){return Math.abs(t-r)<Math.abs(e-r)?t:e})),s=u||a.getIsLosslessImageEnabled();return d(m,t,s)},quality:100,src:c(m),alt:f.alt||"Image",placeholder:n?"blur":"empty",blurDataURL:n?d(m,10):void 0})):null};export{i as Image};
@@ -1,6 +1,8 @@
1
1
  export { IkasPage } from "./page";
2
2
  export { IkasPageHead } from "./page/head";
3
3
  export { Image } from "./image";
4
+ export { PlainImage } from "./plain-image";
4
5
  export { default as Link } from "./link";
5
6
  export * from "./page-editor/loader";
6
7
  export { GoogleCaptcha } from "../components/google-captcha";
8
+ export { PaypalExpressCheckout } from "../components/paypal-express-checkout";
@@ -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 i from"next/head.js";import{useRouter as a}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 r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/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{IkasProductList as s}from"../../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 d}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 l}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c=o.pageType,g=o.pageTitle,f=o.pageDescription,v=o.canonicals,h=o.disableIndex,j=o.pageSpecificData,x=o.merchantSettings,y=o.addOgpMetas,b=o.productReviewSummary,C=o.pageComponentPropValues,T=a(),D="undefined"!=typeof window,L="local"===process.env.NEXT_PUBLIC_ENV,w=T.asPath.split("?")[0].replace("/",""),k=(w="/"===w.charAt(w.length-1)?w.slice(0,-1):w).startsWith("pages/"),O=d.getCurrentRouting(),P=(null==O?void 0:O.path)?"/"+O.path:"",R=L?"http://localhost:3333":"https://"+d.getDomain(),E=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),_=E?new n(E):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[c,j]);var I=t.useMemo((function(){if(j&&j.href)return"".concat(R).concat(j.href)}),[j]),V=t.useMemo((function(){var e,t,o,i=[];if(y){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:"https://"+d.getDomain()}),g&&i.push({property:"og:title",content:g}),f&&i.push({property:"og:description",content:f}),c===r.INDEX){var a=null,n=null;!g&&(null==_?void 0:_.pageTitle)&&(a=_.pageTitle),!f&&(null==_?void 0:_.description)&&(n=_.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(a=u(j,c,s.titleTemplate||""),n=u(j,c,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(c===r.PRODUCT){var s,l=null,p=null;(s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(l=u(j,c,s.titleTemplate||""),p=u(j,c,s.descriptionTemplate||"")),l&&!g&&i.push({property:"og:title",content:l}),p&&!f&&i.push({property:"og:description",content:p})}i.push({property:"og:url",content:I||(D?window.location.href:"")||"https://".concat(d.getDomain())});var m=null;if(j&&c===r.PRODUCT){var v=j.selectedVariant.mainImage;(null==v?void 0:v.image)&&(m={property:"og:image",content:v.image.src.replace(".webp",".jpg")})}if(j&&c===r.CATEGORY){var h=j;h.image&&(m={property:"og:image",content:h.image.src.replace(".webp",".jpg")})}if(j&&c===r.BRAND){var b=j;b.image&&(m={property:"og:image",content:b.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG_CATEGORY){var C=j;C.image&&(m={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG){var T=j;T.image&&(m={property:"og:image",content:T.image.src.replace(".webp",".jpg")})}!m&&(null==_?void 0:_.icon)&&(m={property:"og:image",content:null===(o=null==_?void 0:_.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!m&&(null==x?void 0:x.logo)&&(m={property:"og:image",content:x.logo.src.replace(".webp",".jpg")}),m&&i.push(m)}return i}),[g,j,I,f,x,y,x]),S=t.useMemo((function(){var t=[],o=(null==_?void 0:_.pageTitle)||(null==x?void 0:x.merchantName)||"";if(x){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,l=(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:l,image:l,url:"https://"+d.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===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(x);t.push(i),t.push(a)}if(j&&c===r.PRODUCT){var n=j,s=function(t,o){var i,a,r,n,s;try{var l=d.getCurrentRouting(),c=null==l?void 0:l.path,p=function(e){return c?"https://".concat(d.getDomain(),"/").concat(c).concat(e):"https://".concat(d.getDomain()).concat(e)},m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(i=t.metaData)||void 0===i?void 0:i.description,image:null===(a=m.images)||void 0===a?void 0:a.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(r=m.barcodeList)||void 0===r?void 0:r.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:p(t.href),priceCurrency:m.price.currency||"TRY",price:(null!==(s=m.campaignPrice)&&void 0!==s?s:m.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0||m.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(n,b||null);if(s&&t.push(s),n.categories.length)(u=p(n.categories[0],o,n))&&t.push(u)}if(j&&c===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(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){}}(j),u=p(j,o),g=m(C);l&&t.push(l),u&&t.push(u),g&&t.push(g)}j&&c===r.BRAND&&((g=m(C))&&t.push(g));if(j&&c===r.BLOG){var f=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a=function(e){var t=new Date(e),o=t.getFullYear(),i=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(i,"-").concat(a)},r="".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:i,datePublished:a(t.createdAt),dateCreated:a(t.createdAt),dateModified:a(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(j);f&&t.push(f)}return t}),[j,x]),N=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c}));return t?u(j,c,t.titleTemplate||""):null}),[c,j]),A=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c}));return t?u(j,c,t.descriptionTemplate||""):null}),[c,j]),M=t.useMemo((function(){return!d.getFavicon()&&(null==_?void 0:_.favIcon)?_.favIcon:null}),[]),B=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){B.push({routing:e,hrefLang:e.locale+"-"+t})})):B.push({routing:e,hrefLang:e.locale})}));var F=function(e){var t,o,i,a,r,n=j,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=B.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},G=l.getInstance();return t.createElement(i,null,t.createElement("title",null,g||N||(null==_?void 0:_.pageTitle)||""),t.createElement("meta",{name:"description",content:f||A||(null==_?void 0:_.description)||""}),B.length>1&&B.filter((function(e){return!k||e.routing.id===(null==O?void 0:O.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(R+(e.routing.path?"/"+e.routing.path:""),"/").concat(F(e.routing))})})),!!h&&t.createElement("meta",{name:"robots",content:"noindex"}),!!y&&V.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!v&&v.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(R).concat(P).concat(e)})})),M&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(M,"/image_180.webp"),type:"image/webp"}),!v&&G.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(R).concat(P,"/").concat(w)}),!!S.length&&S.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function p(e,t,o){try{var i=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c 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 i from"next/head.js";import{useRouter as a}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 r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/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{IkasProductList as s}from"../../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 d}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"../paypal-express-checkout/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as l}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c,g,f=o.pageType,v=o.pageTitle,h=o.pageDescription,j=o.canonicals,x=o.disableIndex,y=o.pageSpecificData,b=o.merchantSettings,T=o.addOgpMetas,C=o.productReviewSummary,D=o.pageComponentPropValues,L=a(),O="undefined"!=typeof window,k="local"===process.env.NEXT_PUBLIC_ENV,w=L.asPath.split(/[?#]/)[0].replace("/",""),P=(w="/"===w.charAt(w.length-1)?w.slice(0,-1):w).startsWith("pages/"),R=d.getCurrentRouting(),E=((null===(s=d.getMerchantSettings())||void 0===s?void 0:s.defaultLocale)||"tr")===(null==R?void 0:R.locale),I=!!y&&f===r.PRODUCT,_=!!y&&f===r.CATEGORY,S=!!y&&f===r.BRAND,V=I||_||S,A=null;(I||S||_)&&(A=y);var M=null===(c=null==A?void 0:A.translations)||void 0===c?void 0:c.find((function(e){return e.locale===(null==R?void 0:R.locale)})),N=(null==R?void 0:R.path)?"/"+R.path:"",B=k?"http://localhost:3333":"https://"+d.getDomain(),U=null===(g=d.getIndexPageSeoSettings())||void 0===g?void 0:g.find((function(e){return e.locale===d.getCurrentLocale()})),G=U?new n(U):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[f,y]);var F=t.useMemo((function(){if(y&&y.href)return"".concat(B).concat(y.href)}),[y]),Y=t.useMemo((function(){if(y&&y.href){var e=y.href;return N?"".concat(B).concat(N).concat(e):"".concat(B).concat(e)}}),[y]),z=t.useMemo((function(){var e,t,o,i=[];if(T){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:(null==G?void 0:G.pageTitle)||"https://"+d.getDomain()}),v&&i.push({property:"og:title",content:v}),h&&i.push({property:"og:description",content:h}),f===r.INDEX){var a=null,n=null;!v&&(null==G?void 0:G.pageTitle)&&(a=G.pageTitle),!h&&(null==G?void 0:G.description)&&(n=G.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f})))&&(a=u(y,f,s.titleTemplate||""),n=u(y,f,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(f===r.PRODUCT||f===r.CATEGORY||f===r.BRAND){var s,l=null,c=null;if((s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f})))&&(l=u(y,f,s.titleTemplate||""),c=u(y,f,s.descriptionTemplate||"")),!v){var p=l||V&&E&&(null==A?void 0:A.name)||V&&!E&&(null==M?void 0:M.name);p&&i.push({property:"og:title",content:p})}if(!h){var m=c||V&&!E&&(null==M?void 0:M.description);m&&i.push({property:"og:description",content:m})}}i.push({property:"og:url",content:Y||(O?window.location.href:"")||"https://".concat(d.getDomain())});var g=null;if(y&&f===r.PRODUCT){var j=y.selectedVariant.mainImage;(null==j?void 0:j.image)&&(g={property:"og:image",content:j.image.src.replace(".webp",".jpg")})}if(y&&f===r.CATEGORY){var x=y;x.image&&(g={property:"og:image",content:x.image.src.replace(".webp",".jpg")})}if(y&&f===r.BRAND){var C=y;C.image&&(g={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(y&&f===r.BLOG_CATEGORY){var D=y;D.image&&(g={property:"og:image",content:D.image.src.replace(".webp",".jpg")})}if(y&&f===r.BLOG){var L=y;L.image&&(g={property:"og:image",content:L.image.src.replace(".webp",".jpg")})}!g&&(null==G?void 0:G.icon)&&(g={property:"og:image",content:null===(o=null==G?void 0:G.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!g&&(null==b?void 0:b.logo)&&(g={property:"og:image",content:b.logo.src.replace(".webp",".jpg")}),g&&i.push(g)}return i}),[v,y,F,h,b,T,b]),H=t.useMemo((function(){var t=[],o=(null==G?void 0:G.pageTitle)||(null==b?void 0:b.merchantName)||"";if(b){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,l=(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:l,image:l,url:"https://"+d.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===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(b);t.push(i),t.push(a)}if(y&&f===r.PRODUCT){var n=y,s=function(t,o){var i,a,n,s,l,c,p;try{var m=["c7d934c7-2d44-43c3-b023-de7aa93fe435"],g=null===(i=d.getMerchantSettings())||void 0===i?void 0:i.merchantId,f=d.getCurrentRouting(),v=null==f?void 0:f.path,h=function(e){return v?"https://".concat(d.getDomain(),"/").concat(v).concat(e):"https://".concat(d.getDomain()).concat(e)},j=t.selectedVariant,x=null,y=null===(a=d.getMetaTemplates())||void 0===a?void 0:a.find((function(e){return e.locale===d.getCurrentLocale()&&r.PRODUCT}));return y&&(x=u(t,r.PRODUCT,y.descriptionTemplate||"")),e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:(null===(n=t.metaData)||void 0===n?void 0:n.description)||x,image:null===(s=j.images)||void 0===s?void 0:s.map((function(e){return e.image?e.image.src:""})),productId:j.id,sku:j.sku,mpn:(null===(l=j.barcodeList)||void 0===l?void 0:l.length)?j.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(c=t.brand)||void 0===c?void 0:c.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),m.some((function(e){return e!==g}))?{offers:{"@type":"Offer",url:h(t.href),priceCurrency:j.price.currency||"TRY",price:(null!==(p=j.campaignPrice)&&void 0!==p?p:j.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:j.stock>0||j.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}:{})}catch(e){}}(n,C||null);if(s&&t.push(s),n.categories.length)(c=p(n.categories[0],o,n))&&t.push(c)}if(y&&f===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(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){}}(y),c=p(y,o),g=m(D);l&&t.push(l),c&&t.push(c),g&&t.push(g)}y&&f===r.BRAND&&((g=m(D))&&t.push(g));if(y&&f===r.BLOG){var v=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a=function(e){var t=new Date(e),o=t.getFullYear(),i=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(i,"-").concat(a)},r="".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:i,datePublished:a(t.createdAt),dateCreated:a(t.createdAt),dateModified:a(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(y);v&&t.push(v)}return t}),[y,b]),X=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f}));return t?u(y,f,t.titleTemplate||""):null}),[f,y]),W=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f}));return t?u(y,f,t.descriptionTemplate||""):null}),[f,y]),J=t.useMemo((function(){return!d.getFavicon()&&(null==G?void 0:G.favIcon)?G.favIcon:null}),[]),q=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){q.push({routing:e,hrefLang:e.locale+"-"+t})})):q.push({routing:e,hrefLang:e.locale})}));var K=function(e){var t,o,i,a,r,n=y,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=q.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},Q=l.getInstance();return t.createElement(i,null,t.createElement("title",null,v||X||(V?E?(null==A?void 0:A.name)||"":(null==M?void 0:M.name)||"":(null==G?void 0:G.pageTitle)||"")),t.createElement("meta",{name:"description",content:h||W||(V?(null==M?void 0:M.description)||"":(null==G?void 0:G.description)||"")}),q.length>1&&q.filter((function(e){return!P||e.routing.id===(null==R?void 0:R.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(B+(e.routing.path?"/"+e.routing.path:""),"/").concat(K(e.routing))})})),!!x&&t.createElement("meta",{name:"robots",content:"noindex"}),!!T&&z.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!j&&j.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(B).concat(N).concat(e)})})),J&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(J,"/image_180.webp"),type:"image/webp"}),!j&&Q.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(B).concat(N,"/").concat(w)}),!!H.length&&H.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function p(e,t,o){try{var i=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c as IkasPageHead};
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as r}from"mobx-react-lite";import{useRouter as a}from"next/router.js";import s from"next/dynamic";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 d}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as n}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as m}from"../../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 p}from"@ikas/storefront-config";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as c}from"./head.js";import{ThemeComponent as u}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as j}from"../../analytics/events.js";import{IkasPageDataInit as x}from"../../page-data-init/index.js";import{setAPIClientConfig as g}from"@ikas/storefront-api";var v=s((function(){return import("../popup/index.js").then((function(e){return e.PopupListRendererForPage}))}),{ssr:!1}),y=r((function(r){var s=r.propValues,u=r.themeJsonComponents,y=r.customDataList,w=r.pageType,b=r.pageTitle,S=r.pageDescription,C=r.pageSpecificData,P=r.canonicals,D=r.disableIndex,k=r.settings,T=r.configJson,E=r.reInitOnBrowser,I=r.addOgpMetas,R=r.components,M=r.productReviewSummary,V=a(),O=i.useState(),z=O[0],B=O[1];p.init(e(e({},T),{currentPageComponents:R,loginRequiredCallback:function(){V.push("/account/login")}})),f.getInstance().router=V,g();var A=f.getInstance();A.router=V,A.currentPageType=w;var F=i.useState(!1),H=F[0],L=F[1],U=i.useMemo((function(){return(null==z?void 0:z.id)===(null==C?void 0:C.id)&&x.pageSpecificData&&x.isBrowser?w===d.PRODUCT&&x._initProductOnBrowser(x.pageSpecificData):x.setPageSpecificData(C,w,H),x.initPagePropValues(s,u,y.map((function(e){return new m(e)})),k,H)}),[H,s,w,k,C,u]);i.useEffect((function(){E&&L("undefined"!=typeof window),window.addToCart=A.cartStore._windowAddToCart,A.cartStore.getCart(),A.checkLocalization(),j()}),[]),i.useEffect((function(){C?(null==z?void 0:z.id)!==C.id&&B(C):B(null)}),[C]),i.useEffect((function(){var e=function(){A.customerStore.routeChangeInit()};return V.events.on("routeChangeStart",e),function(){V.events.off("routeChangeStart",e)}}),[]),i.useEffect((function(){!function(e,i){var r,a;t(this,void 0,void 0,(function(){var t,s,n,m,p,c;return o(this,(function(o){switch(o.label){case 0:t=f.getInstance(),l.pageView(e),o.label=1;case 1:return o.trys.push([1,4,,5]),e===d.PRODUCT&&(s=i,l.productView(s),t.customerStore.onProductView(s.id,s.selectedVariant.id)),e===d.CATEGORY&&(m=null===(r=(n=i).categoryPathItems)||void 0===r?void 0:r.map((function(e){return e.name})).join(" > "),m=n.categoryPathItems&&(null===(a=n.categoryPathItems)||void 0===a?void 0:a.length)>0?m+" > "+n.name:n.name,l.viewCategory(m,n)),e===d.BRAND&&(p=i,l.viewBrand(p)),e!==d.CART?[3,3]:[4,t.cartStore.waitUntilInitialized()];case 2:o.sent(),l.viewCart(t.cartStore.cart),o.label=3;case 3:return[3,5];case 4:return c=o.sent(),console.error(c),[3,5];case 5:return[2]}}))}))}(w,x.pageSpecificData)}),[w,C]);var _=i.useMemo((function(){var e=U.find((function(e){return e.component.isHeader})),t=U.find((function(e){return e.component.isFooter})),o=U.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[];return i.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},i.createElement("div",null,e&&h(e,k,-1),o.map((function(e,t){return h(e,k,t)}))),t&&h(t,k,-1),i.createElement(v,{key:Date.now()}))}),[U,k]),J=i.useMemo((function(){return p.getMerchantSettings()?new n(p.getMerchantSettings()):null}),[p.getMerchantSettings()]);return i.createElement(i.Fragment,null,i.createElement(c,{pageType:w,pageTitle:b,pageDescription:S,pageSpecificData:x.pageSpecificData,canonicals:P,disableIndex:D,merchantSettings:J,addOgpMetas:I,productReviewSummary:M,pageComponentPropValues:U}),_)})),h=function(e,t,o){return i.createElement(u,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{y as IkasPage,h as renderComponent};
1
+ import{__assign as e,__spreadArray as t,__awaiter as o,__generator as i}from'./../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as a}from"mobx-react-lite";import{useRouter as s}from"next/router.js";import d from"next/dynamic";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as n}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as m}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as p}from"../../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 l}from"@ikas/storefront-config";import{Analytics as c}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as u}from"./head.js";import{ThemeComponent as f}from"./ThemeComponent.js";import{IkasBaseStore as j}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as x}from"../../analytics/events.js";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{setAPIClientConfig as v}from"@ikas/storefront-api";var y=d((function(){return import("../popup/index.js").then((function(e){return e.PopupListRendererForPage}))}),{ssr:!1}),h=a((function(a){var d=a.propValues,f=a.themeJsonComponents,h=a.customDataList,b=a.pageType,S=a.pageTitle,C=a.pageDescription,P=a.pageSpecificData,D=a.canonicals,k=a.disableIndex,E=a.settings,T=a.configJson,I=a.reInitOnBrowser,R=a.addOgpMetas,M=a.components,V=a.productReviewSummary,O=s(),z=r.useState(),A=z[0],B=z[1];l.init(e(e({},T),{currentPageComponents:M,loginRequiredCallback:function(){O.push("/account/login")}})),j.getInstance().router=O,v();var F=j.getInstance();F.router=O,F.currentPageType=b;var H=r.useState(!1),L=H[0],U=H[1],_=r.useMemo((function(){return(null==A?void 0:A.id)===(null==P?void 0:P.id)&&g.pageSpecificData&&g.isBrowser?b===n.PRODUCT&&g._initProductOnBrowser(g.pageSpecificData):g.setPageSpecificData(P,b,L),g.initPagePropValues(d,f,h.map((function(e){return new p(e)})),E,L)}),t(t([],b!==n.SEARCH?[L]:[],!0),[d,b,E,P,f],!1));r.useEffect((function(){I&&U("undefined"!=typeof window),window.addToCart=F.cartStore._windowAddToCart,F.cartStore.getCart(),F.checkLocalization(),x()}),[]),r.useEffect((function(){P?(null==A?void 0:A.id)!==P.id&&B(P):B(null)}),[P]),r.useEffect((function(){var e=function(){F.customerStore.routeChangeInit()};return O.events.on("routeChangeStart",e),function(){O.events.off("routeChangeStart",e)}}),[]),r.useEffect((function(){!function(e,t){var r,a;o(this,void 0,void 0,(function(){var o,s,d,m,p,l;return i(this,(function(i){switch(i.label){case 0:return o=j.getInstance(),[4,c.pageView(e)];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,7,,8]),e!==n.PRODUCT?[3,4]:(s=t,[4,c.productView(s)]);case 3:i.sent(),o.customerStore.onProductView(s.id,s.selectedVariant.id),i.label=4;case 4:return e===n.CATEGORY&&(m=null===(r=(d=t).categoryPathItems)||void 0===r?void 0:r.map((function(e){return e.name})).join(" > "),m=d.categoryPathItems&&(null===(a=d.categoryPathItems)||void 0===a?void 0:a.length)>0?m+" > "+d.name:d.name,c.viewCategory(m,d)),e===n.BRAND&&(p=t,c.viewBrand(p)),e!==n.CART?[3,6]:[4,o.cartStore.waitUntilInitialized()];case 5:i.sent(),c.viewCart(o.cartStore.cart),i.label=6;case 6:return[3,8];case 7:return l=i.sent(),console.error(l),[3,8];case 8:return[2]}}))}))}(b,g.pageSpecificData)}),[b,P]);var J=r.useMemo((function(){var e=_.find((function(e){return e.component.isHeader})),t=_.find((function(e){return e.component.isFooter})),o=_.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[];return r.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},r.createElement("div",null,e&&w(e,E,-1),o.map((function(e,t){return w(e,E,t)}))),t&&w(t,E,-1),r.createElement(y,{key:Date.now()}))}),[_,E]),q=r.useMemo((function(){return l.getMerchantSettings()?new m(l.getMerchantSettings()):null}),[l.getMerchantSettings()]);return r.createElement(r.Fragment,null,r.createElement(u,{pageType:b,pageTitle:S,pageDescription:C,pageSpecificData:g.pageSpecificData,canonicals:D&&D.length>0?D:null,disableIndex:k,merchantSettings:q,addOgpMetas:R,productReviewSummary:V,pageComponentPropValues:_}),J)})),w=function(e,t,o){return r.createElement(f,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{h as IkasPage,w as renderComponent};
@@ -1 +1 @@
1
- import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";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 s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as p,IkasCouponCodeRequirement as l,IkasThemeJsonComponentPropType as u}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 c}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as f}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"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import{IkasOrderLineItem as j}from"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as v}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as x}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var y=function(y){function h(e){var o=y.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(h,y),h.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(h.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new c({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new j({id:"",createdAt:0,updatedAt:0,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,fileId:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,hsCode:null,variantValues:[],baseUnit:null,unit:null,tags:null,bundleProducts:null},orderedAt:0})]}),checkoutSettings:new f({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:p.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:p.OPTIONAL,postalCodeRequirement:p.OPTIONAL,showCheckoutNote:!0,showCompanyInfoInShippingAddress:null,showTermsAndConditionsCheckbox:!0,storefrontId:"",couponCodeRequirement:l.DEFAULT,corporateInvoiceRequirement:null}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===u.BOOLEAN&&!n||i.type===u.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:x.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=v.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),h.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName})):v.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},h}(t.Component);export{y as ThemeEditorComponent};
1
+ import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";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 s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as l,IkasCouponCodeRequirement as p,IkasThemeJsonComponentPropType as u}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 c}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as f}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"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import{IkasOrderLineItem as j}from"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as v}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as x}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var h=function(h){function y(e){var o=h.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(y,h),y.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},y.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},y.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(y.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new c({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new j({id:"",createdAt:0,updatedAt:0,bundleProductSettings:null,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,fileId:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,hsCode:null,variantValues:[],baseUnit:null,unit:null,tags:null,bundleProducts:null},orderedAt:0})]}),checkoutSettings:new f({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:l.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:l.OPTIONAL,postalCodeRequirement:l.OPTIONAL,showCheckoutNote:!0,showCompanyInfoInShippingAddress:null,showBillingAddressOnShippingStep:null,showTermsAndConditionsCheckbox:!0,storefrontId:"",couponCodeRequirement:p.DEFAULT,corporateInvoiceRequirement:null}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===u.BOOLEAN&&!n||i.type===u.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:x.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=v.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),y.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName})):v.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},y}(t.Component);export{h as ThemeEditorComponent};