@ikas/storefront 6.1.0-beta.23 → 6.1.0-beta.231

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 (197) hide show
  1. package/build/analytics/analytics.d.ts +6 -3
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/events.d.ts +4 -1
  4. package/build/analytics/events.js +1 -1
  5. package/build/analytics/googleAnalytics.d.ts +2 -2
  6. package/build/analytics/googleAnalytics.js +1 -1
  7. package/build/analytics/googleTagManager.d.ts +3 -2
  8. package/build/analytics/googleTagManager.js +1 -1
  9. package/build/analytics/ikasV3.d.ts +6 -0
  10. package/build/analytics/ikasV3.js +1 -1
  11. package/build/components/checkout/components/address-form/index.js +1 -1
  12. package/build/components/checkout/components/address-form/model.d.ts +5 -0
  13. package/build/components/checkout/components/address-form/model.js +1 -1
  14. package/build/components/checkout/components/adyen/index.js +1 -1
  15. package/build/components/checkout/components/button/index.d.ts +1 -0
  16. package/build/components/checkout/components/button/index.js +1 -1
  17. package/build/components/checkout/components/button/style.module.scss.js +1 -1
  18. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  19. package/build/components/checkout/components/cart-summary/cart-item/style.module.scss.js +1 -1
  20. package/build/components/checkout/components/cart-summary/index.d.ts +2 -1
  21. package/build/components/checkout/components/cart-summary/index.js +1 -1
  22. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  23. package/build/components/checkout/components/customer-addresses/index.d.ts +1 -0
  24. package/build/components/checkout/components/customer-addresses/index.js +1 -1
  25. package/build/components/checkout/components/error/stock-error/index.js +1 -1
  26. package/build/components/checkout/components/form-item/index.js +1 -1
  27. package/build/components/checkout/components/form-item/model.d.ts +5 -3
  28. package/build/components/checkout/components/form-item/model.js +1 -1
  29. package/build/components/checkout/components/form-item/style.module.scss.js +1 -1
  30. package/build/components/checkout/components/hepsipay/index.d.ts +9 -0
  31. package/build/components/checkout/components/hepsipay/index.js +1 -0
  32. package/build/components/checkout/components/input-with-button/style.module.scss.js +1 -1
  33. package/build/components/checkout/components/modal/index.d.ts +1 -0
  34. package/build/components/checkout/components/modal/index.js +1 -1
  35. package/build/components/checkout/components/modal/style.module.scss.js +1 -1
  36. package/build/components/checkout/components/offer-product/index.js +1 -1
  37. package/build/components/checkout/components/offer-product/style.module.scss.js +1 -1
  38. package/build/components/checkout/components/phone-number-input/index.d.ts +1 -1
  39. package/build/components/checkout/components/phone-number-input/index.js +1 -1
  40. package/build/components/checkout/components/quick-registration/completed.js +1 -1
  41. package/build/components/checkout/components/quick-registration/index.js +1 -1
  42. package/build/components/checkout/components/stripe/checkout-form.js +1 -1
  43. package/build/components/checkout/components/svg/coupon-code-tag.d.ts +6 -0
  44. package/build/components/checkout/components/svg/coupon-code-tag.js +1 -0
  45. package/build/components/checkout/components/svg/credit-balance.d.ts +6 -0
  46. package/build/components/checkout/components/svg/credit-balance.js +1 -0
  47. package/build/components/checkout/components/svg/gift-cart-tag.d.ts +6 -0
  48. package/build/components/checkout/components/svg/gift-cart-tag.js +1 -0
  49. package/build/components/checkout/components/svg/store-credit-tag.d.ts +6 -0
  50. package/build/components/checkout/components/svg/store-credit-tag.js +1 -0
  51. package/build/components/checkout/components/svg/subscription.d.ts +6 -0
  52. package/build/components/checkout/components/svg/subscription.js +1 -0
  53. package/build/components/checkout/index.js +1 -1
  54. package/build/components/checkout/model.d.ts +29 -7
  55. package/build/components/checkout/model.js +1 -1
  56. package/build/components/checkout/steps/step-info/index.js +1 -1
  57. package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
  58. package/build/components/checkout/steps/step-payment/index.js +1 -1
  59. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  60. package/build/components/checkout/steps/step-payment/payment-gateways/store-credit/index.d.ts +7 -0
  61. package/build/components/checkout/steps/step-payment/payment-gateways/store-credit/index.js +1 -0
  62. package/build/components/checkout/steps/step-payment/payment-gateways/store-credit/style.module.scss.js +1 -0
  63. package/build/components/checkout/steps/step-shipping/index.js +1 -1
  64. package/build/components/checkout/steps/step-success/index.js +1 -1
  65. package/build/components/image/index.d.ts +1 -0
  66. package/build/components/image/index.js +1 -1
  67. package/build/components/index.d.ts +3 -0
  68. package/build/components/page/head.js +1 -1
  69. package/build/components/page/index.d.ts +1 -1
  70. package/build/components/page/index.js +1 -1
  71. package/build/components/page/widgets/common.d.ts +2 -0
  72. package/build/components/page/widgets/common.js +1 -0
  73. package/build/components/page/widgets/loyaltyWidget.d.ts +8 -0
  74. package/build/components/page/widgets/loyaltyWidget.js +1 -0
  75. package/build/components/page/widgets/popupWidget.d.ts +13 -0
  76. package/build/components/page/widgets/popupWidget.js +1 -0
  77. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  78. package/build/components/page-editor/model.js +1 -1
  79. package/build/components/pay-with-ikas/index.d.ts +8 -0
  80. package/build/components/pay-with-ikas/index.js +1 -0
  81. package/build/components/paypal-express-checkout/index.d.ts +9 -0
  82. package/build/components/paypal-express-checkout/index.js +1 -0
  83. package/build/components/plain-image/index.d.ts +13 -0
  84. package/build/components/plain-image/index.js +1 -0
  85. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/formatIncompletePhoneNumber.js +1 -0
  86. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/getCountries.js +1 -0
  87. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/formatIncompletePhoneNumber.js +1 -0
  88. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/getCountries.js +1 -0
  89. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/getCountryCallingCode.js +1 -0
  90. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/isSupportedCountry.js +1 -0
  91. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/parsePhoneNumber.js +1 -0
  92. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/ObserverComponent.js +1 -0
  93. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/index.js +1 -0
  94. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/observer.js +1 -0
  95. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/useObserver.js +1 -0
  96. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/UniversalFinalizationRegistry.js +1 -0
  97. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/assertEnvironment.js +1 -0
  98. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/observerBatching.js +1 -0
  99. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/observerFinalizationRegistry.js +1 -0
  100. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/printDebugValue.js +1 -0
  101. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -1
  102. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -1
  103. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -1
  104. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -1
  105. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/phone-input-item-view/get-countries.js +1 -0
  106. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/phone-input-item-view/index.js +1 -0
  107. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -1
  108. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -1
  109. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -1
  110. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -1
  111. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -1
  112. package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -1
  113. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +1 -1
  114. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +1 -1
  115. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +1 -1
  116. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +1 -1
  117. package/build/hooks/useCustomerReviews.d.ts +2 -0
  118. package/build/hooks/useCustomerReviews.js +1 -1
  119. package/build/hooks/useStore.js +1 -1
  120. package/build/index.js +1 -1
  121. package/build/models/data/checkout-settings/index.d.ts +1 -0
  122. package/build/models/data/checkout-settings/index.js +1 -1
  123. package/build/models/data/customer/review/index.d.ts +4 -1
  124. package/build/models/data/customer/review/index.js +1 -1
  125. package/build/models/data/index.d.ts +1 -0
  126. package/build/models/data/order/adjustment/index.d.ts +3 -1
  127. package/build/models/data/order/adjustment/index.js +1 -1
  128. package/build/models/data/order/gift-card-line/index.d.ts +2 -1
  129. package/build/models/data/order/gift-card-line/index.js +1 -1
  130. package/build/models/data/order/index.d.ts +4 -0
  131. package/build/models/data/order/index.js +1 -1
  132. package/build/models/data/order/line-item/bundle-product-settings/index.d.ts +7 -0
  133. package/build/models/data/order/line-item/bundle-product-settings/index.js +1 -0
  134. package/build/models/data/order/line-item/index.d.ts +4 -0
  135. package/build/models/data/order/line-item/index.js +1 -1
  136. package/build/models/data/order/line-item/order-line-item-subscription-plan/index.d.ts +8 -0
  137. package/build/models/data/order/line-item/order-line-item-subscription-plan/index.js +1 -0
  138. package/build/models/data/order/line-item/order-line-item-subscription-plan/order-line-item-subscription-plan-discount/index.d.ts +6 -0
  139. package/build/models/data/order/line-item/order-line-item-subscription-plan/order-line-item-subscription-plan-discount/index.js +1 -0
  140. package/build/models/data/order/line-item/order-line-item-subscription-plan/order-line-item-subscription-plan-period/index.d.ts +14 -0
  141. package/build/models/data/order/line-item/order-line-item-subscription-plan/order-line-item-subscription-plan-period/index.js +1 -0
  142. package/build/models/data/order/loyalty-line/index.d.ts +9 -0
  143. package/build/models/data/order/loyalty-line/index.js +1 -0
  144. package/build/models/data/order/order-transaction-with-prices/index.d.ts +1 -0
  145. package/build/models/data/order/order-transaction-with-prices/index.js +1 -1
  146. package/build/models/data/product/campaign-offer/index.d.ts +2 -0
  147. package/build/models/data/product/campaign-offer/index.js +1 -1
  148. package/build/models/data/product/filter/index.d.ts +2 -0
  149. package/build/models/data/product/filter/index.js +1 -1
  150. package/build/models/data/product/index.d.ts +8 -0
  151. package/build/models/data/product/index.js +1 -1
  152. package/build/models/data/product/translations/index.d.ts +7 -0
  153. package/build/models/data/product/translations/index.js +1 -0
  154. package/build/models/data/product/variant/bundle-settings/bundle-product/index.js +1 -1
  155. package/build/models/data/product/variant/index.d.ts +3 -0
  156. package/build/models/data/product/variant/index.js +1 -1
  157. package/build/models/data/product/variant/subscription-plan/index.d.ts +12 -0
  158. package/build/models/data/product/variant/subscription-plan/index.js +1 -0
  159. package/build/models/data/product/variant/subscription-plan/product-subscription-plan-discount/index.d.ts +6 -0
  160. package/build/models/data/product/variant/subscription-plan/product-subscription-plan-period/index.d.ts +23 -0
  161. package/build/models/data/product/variant/subscription-plan/product-subscription-plan-period/index.js +1 -0
  162. package/build/models/data/store-credit-balance/index.d.ts +26 -0
  163. package/build/models/data/store-credit-balance/index.js +1 -0
  164. package/build/models/data/theme-json/component/prop/index.d.ts +1 -0
  165. package/build/models/data/theme-json/component/prop/index.js +1 -1
  166. package/build/models/data/theme-json/custom-data/index.d.ts +1 -0
  167. package/build/models/data/theme-json/custom-data/index.js +1 -1
  168. package/build/models/ui/customer-review-list/index.d.ts +8 -0
  169. package/build/models/ui/customer-review-list/index.js +1 -1
  170. package/build/models/ui/product-list/index.d.ts +17 -0
  171. package/build/models/ui/product-list/index.js +1 -1
  172. package/build/models/ui/validator/form/login.d.ts +20 -6
  173. package/build/models/ui/validator/form/login.js +1 -1
  174. package/build/models/ui/validator/form/register.d.ts +15 -6
  175. package/build/models/ui/validator/form/register.js +1 -1
  176. package/build/pages/checkout.js +1 -1
  177. package/build/store/cart/api.d.ts +3 -1
  178. package/build/store/cart/api.js +1 -1
  179. package/build/store/cart/index.d.ts +25 -1
  180. package/build/store/cart/index.js +1 -1
  181. package/build/store/checkout/index.d.ts +4 -1
  182. package/build/store/checkout/index.js +1 -1
  183. package/build/store/customer/api.d.ts +16 -3
  184. package/build/store/customer/api.js +1 -1
  185. package/build/store/customer/index.d.ts +40 -5
  186. package/build/store/customer/index.js +1 -1
  187. package/build/store/index.d.ts +1 -0
  188. package/build/store/product/index.d.ts +2 -1
  189. package/build/store/product/index.js +1 -1
  190. package/build/utils/helper.d.ts +1 -0
  191. package/build/utils/helper.js +1 -1
  192. package/package.json +14 -12
  193. package/build/components/popup/index.js +0 -1
  194. package/build/components/popup/renderer/index.js +0 -1
  195. package/build/components/popup/renderer/model.js +0 -1
  196. package/build/components/popup/utils/index.js +0 -1
  197. package/build/store/storefront-popup/index.js +0 -1
@@ -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 l from"../../../../components/svg/credit-balance.js";var c=n((function(n){var c,d,u,m,v=n.vm,f=i().t,C=r.useState(!1),h=C[0],p=C[1],g=(null===(c=v.storeCreditBalance)||void 0===c?void 0:c.storeCredits)&&(null===(d=v.storeCreditBalance)||void 0===d?void 0:d.storeCredits.length)>0?null===(u=v.checkout.giftCardLines)||void 0===u?void 0:u.find((function(e){var t,r;return e.code===(null===(r=null===(t=v.storeCreditBalance)||void 0===t?void 0:t.storeCredits[0])||void 0===r?void 0:r.code)})):void 0;if(r.useEffect((function(){p(!!g)}),[g]),!(null===(m=v.storeCreditBalance)||void 0===m?void 0:m.amount))return null;var E=g?(null==g?void 0:g.amount)||0:v.finalPrice>v.storeCreditBalance.amount?v.storeCreditBalance.amount:v.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(l,null)),r.createElement("div",null,r.createElement("span",{className:a.StoreCreditBalanceAmount},o(E,v.checkout.currencyCode,v.checkout.currencySymbol)),r.createElement("span",null,f("checkout-page:storeCreditBalance")))),r.createElement("div",{className:a.StoreCreditBalanceRight},r.createElement("div",null,r.createElement(s,{value:h,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 p(r),r?(v.checkout.couponCode=(null===(e=v.storeCreditBalance)||void 0===e?void 0:e.storeCredits[0].code)||null,[4,v.onCouponCodeApply()]):[3,2];case 1:return t.sent(),[3,5];case 2:return[4,v.removeGiftCardLine((null==g?void 0:g.giftCardId)||"")];case 3:return t.sent(),[4,v.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{c 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*as e from"react";import{observer as t}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as i}from"../../../../utils/currency.js";import{useTranslation as c}from"../../../../utils/i18n.js";import o from"./style.module.scss.js";import{Button as n}from"../../components/button/index.js";import{Checkbox as r}from"../../components/checkbox/index.js";import{FormItemType as a}from"../../components/form-item/model.js";import{FormItem as m}from"../../components/form-item/index.js";import s from"../../components/error/index.js";import u from"../../components/select-box/index.js";import{IkasLocalDeliverySettingsDeliveryTimeType as l}from"@ikas/storefront-models";var d=t((function(t){var i=t.vm,r=c().t;return e.createElement("div",{className:[o.StepShipping].join(" ")},e.createElement(p,{vm:i}),e.createElement(g,{vm:i}),e.createElement(n,{style:{width:"100%",marginTop:"32px"},text:r("checkout-page:actions.continueWithPayment"),isLoading:i.isStepLoading,onClick:i.onProceedToPaymentClick}))})),p=t((function(t){var n,r=t.vm,a=c().t;return e.createElement("div",{className:[o.InfoBox,r.isChangingShippingMethod?o.Dimmed:""].join(" ")},e.createElement(s,{vm:r}),null===(n=r.checkout.availableShippingMethods)||void 0===n?void 0:n.map((function(t,c){return e.createElement(u,{key:t.shippingSettingsId+t.shippingZoneRateId,label:t.rateName,description:t.estimatedDeliveryTime?t.estimatedDeliveryTime.type===l.DAY?a("checkout-page:estimatedDeliveryTime.day",{value:t.estimatedDeliveryTime.value}):t.estimatedDeliveryTime.type===l.HOUR?a("checkout-page:estimatedDeliveryTime.hour",{value:t.estimatedDeliveryTime.value}):t.estimatedDeliveryTime.type===l.MINUTE?a("checkout-page:estimatedDeliveryTime.minute",{value:t.estimatedDeliveryTime.value}):void 0:void 0,isSelected:r.checkout.shippingSettingsId===t.shippingSettingsId&&r.checkout.shippingZoneRateId===t.shippingZoneRateId,rightContent:e.createElement("div",{className:o.ShippingPrice},0===t.price?a("checkout-page:free"):i(t.price,r.checkout.currencyCode,r.checkout.currencySymbol)),onClick:function(){return r.onShippingMethodChange(t)}})})))})),g=t((function(t){var n=t.vm,s=c().t,u=e.useCallback((function(e){n.checkout.isGiftPackage=e}),[n]),l=e.useCallback((function(e){n.checkout.giftPackageNote=e}),[n,n.checkout]),d=e.useMemo((function(){var e,t,i,c;return n.checkout.priceListId?(null===(t=n.checkoutSettings.giftPackagePriceList)||void 0===t?void 0:t.find((function(e){return n.checkout.priceListId?e.priceListId===n.checkout.priceListId:!!e.priceListId})))||(null===(i=n.checkoutSettings.giftPackagePriceList)||void 0===i?void 0:i.find((function(e){return e.currencyCode===n.checkout.currencyCode})))||(null===(c=n.checkoutSettings.giftPackagePriceList)||void 0===c?void 0:c.find((function(e){return!e.currencyCode}))):null===(e=n.checkoutSettings.giftPackagePriceList)||void 0===e?void 0:e.find((function(e){return n.checkout.priceListId===e.priceListId}))}),[n,n.checkoutSettings,n.checkout]),p=s("checkout-page:giftPackageCta")+(d&&d.price?" (+ ".concat(i(d.price,d.currencyCode||n.checkout.currencyCode,d.currencySymbol||n.checkout.currencySymbol),")"):"");return n.checkoutSettings.isGiftPackageEnabled?e.createElement("div",{className:o.GiftSection},e.createElement(r,{value:n.checkout.isGiftPackage||!1,label:p,onChange:u,removePadding:!0}),n.checkout.isGiftPackage&&e.createElement(m,{type:a.TEXT_AREA,label:"",value:n.checkout.giftPackageNote||"",onChange:l,style:{marginTop:"16px"},textAreaPlaceholder:s("checkout-page:giftPackageCtaPlaceholder"),maxLength:320})):null}));export{d as CheckoutStepShipping};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import"@ikas/storefront-config";import{formatCurrency as i}from"../../../../utils/currency.js";import{useTranslation as c}from"../../../../utils/i18n.js";import o from"./style.module.scss.js";import{Button as n}from"../../components/button/index.js";import{Checkbox as r}from"../../components/checkbox/index.js";import{FormItemType as a}from"../../components/form-item/model.js";import{FormItem as m}from"../../components/form-item/index.js";import s from"../../components/error/index.js";import u from"../../components/select-box/index.js";import{IkasLocalDeliverySettingsDeliveryTimeType as l}from"@ikas/storefront-models";var d=t((function(t){var i=t.vm,r=c().t;return e.createElement("div",{className:[o.StepShipping].join(" ")},e.createElement(p,{vm:i}),e.createElement(g,{vm:i}),e.createElement(n,{style:{width:"100%",marginTop:"32px"},text:r("checkout-page:actions.continueWithPayment"),isLoading:i.isStepLoading,onClick:i.onProceedToPaymentClick}))})),p=t((function(t){var n,r=t.vm,a=c().t;return e.createElement("div",{className:[o.InfoBox,r.isChangingShippingMethod?o.Dimmed:""].join(" ")},e.createElement(s,{vm:r}),null===(n=r.checkout.availableShippingMethods)||void 0===n?void 0:n.map((function(t,c){return e.createElement(u,{key:t.shippingSettingsId+t.shippingZoneRateId,label:t.rateName,description:t.estimatedDeliveryTime?t.estimatedDeliveryTime.type===l.DAY?a("checkout-page:estimatedDeliveryTime.day",{value:t.estimatedDeliveryTime.value}):t.estimatedDeliveryTime.type===l.HOUR?a("checkout-page:estimatedDeliveryTime.hour",{value:t.estimatedDeliveryTime.value}):t.estimatedDeliveryTime.type===l.MINUTE?a("checkout-page:estimatedDeliveryTime.minute",{value:t.estimatedDeliveryTime.value}):void 0:void 0,isSelected:r.checkout.shippingSettingsId===t.shippingSettingsId&&r.checkout.shippingZoneRateId===t.shippingZoneRateId,rightContent:e.createElement("div",{className:o.ShippingPrice},0===t.price?a("checkout-page:free"):i(t.price,r.checkout.currencyCode,r.checkout.currencySymbol)),onClick:function(){return r.onShippingMethodChange(t)}})})))})),g=t((function(t){var n=t.vm,s=c().t,u=e.useCallback((function(e){n.checkout.isGiftPackage=e}),[n]),l=e.useCallback((function(e){n.checkout.giftPackageNote=e}),[n,n.checkout]),d=e.useMemo((function(){var e,t,i,c;return n.checkout.priceListId?(null===(t=n.checkoutSettings.giftPackagePriceList)||void 0===t?void 0:t.find((function(e){return n.checkout.priceListId?e.priceListId===n.checkout.priceListId:!!e.priceListId})))||(null===(i=n.checkoutSettings.giftPackagePriceList)||void 0===i?void 0:i.find((function(e){return e.currencyCode===n.checkout.currencyCode})))||(null===(c=n.checkoutSettings.giftPackagePriceList)||void 0===c?void 0:c.find((function(e){return!e.currencyCode}))):null===(e=n.checkoutSettings.giftPackagePriceList)||void 0===e?void 0:e.find((function(e){return n.checkout.priceListId===e.priceListId}))}),[n,n.checkoutSettings,n.checkout]),p=s("checkout-page:giftPackageCta")+(d&&d.price?" (+ ".concat(i(d.price,d.currencyCode||n.checkout.currencyCode,d.currencySymbol||n.checkout.currencySymbol),")"):"");return n.checkoutSettings.isGiftPackageEnabled?e.createElement("div",{className:o.GiftSection},e.createElement(r,{value:n.checkout.isGiftPackage||!1,label:p,onChange:u,removePadding:!0}),n.checkout.isGiftPackage&&e.createElement(m,{name:"giftPackageNote",type:a.TEXT_AREA,label:"",value:n.checkout.giftPackageNote||"",onChange:l,style:{marginTop:"16px"},textAreaPlaceholder:s("checkout-page:giftPackageCtaPlaceholder"),maxLength:320})):null}));export{d as CheckoutStepShipping};
@@ -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 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,K=U.isActiveOverlay,H=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&&K,ie=!!(null===(O=w.customizationProps)||void 0===O?void 0:O.campaignOffersEnableMiddlePhase)&&!!(null===(_=w.customizationProps)||void 0===_?void 0:_.showCampaignIsBiggerImage)&&Q&&!K;return t.createElement(t.Fragment,null,!!(null===(F=w.customizationProps)||void 0===F?void 0:F.campaignOffersEnableMiddlePhase)&&K&&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:H,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:H})),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,{text:Y("checkout-page:actions.backToShopping"),onClick:w.onBackToShoppingClick,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};
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,9 @@
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";
9
+ export { PayWithIkas } from "./pay-with-ikas";
@@ -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{IkasBaseStore as l}from"../../store/base.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"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c,g,v=o.pageType,f=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,O=a(),L="undefined"!=typeof window,w="local"===process.env.NEXT_PUBLIC_ENV,k=O.asPath.split(/[?#]/)[0].replace("/",""),P=(k="/"===k.charAt(k.length-1)?k.slice(0,-1):k).startsWith("pages/"),R=v===r.BLOG,E=d.getCurrentRouting(),I=((null===(s=d.getMerchantSettings())||void 0===s?void 0:s.defaultLocale)||"tr")===(null==E?void 0:E.locale),S=!!y&&v===r.PRODUCT,_=!!y&&v===r.CATEGORY,V=!!y&&v===r.BRAND,A=S||_||V,M=null;(S||V||_)&&(M=y);var N=null===(c=null==M?void 0:M.translations)||void 0===c?void 0:c.find((function(e){return e.locale===(null==E?void 0:E.locale)})),B=(null==E?void 0:E.path)?"/"+E.path:"",G=w?"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()})),F=U?new n(U):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[v,y]);var Y=t.useMemo((function(){if(y&&y.href)return"".concat(G).concat(y.href)}),[y]),H=t.useMemo((function(){if(y&&y.href){var e=y.href;return B?"".concat(G).concat(B).concat(e):"".concat(G).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==F?void 0:F.pageTitle)||"https://"+d.getDomain()}),f&&i.push({property:"og:title",content:f}),h&&i.push({property:"og:description",content:h}),v===r.INDEX){var a=null,n=null;!f&&(null==F?void 0:F.pageTitle)&&(a=F.pageTitle),!h&&(null==F?void 0:F.description)&&(n=F.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v})))&&(a=u(y,v,s.titleTemplate||""),n=u(y,v,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(v===r.PRODUCT||v===r.CATEGORY||v===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===v})))&&(l=u(y,v,s.titleTemplate||""),c=u(y,v,s.descriptionTemplate||"")),!f){var p=l||A&&I&&(null==M?void 0:M.name)||A&&!I&&(null==N?void 0:N.name);p&&i.push({property:"og:title",content:p})}if(!h){var m=c||A&&!I&&(null==N?void 0:N.description);m&&i.push({property:"og:description",content:m})}}i.push({property:"og:url",content:H||(L?window.location.href:"")||"https://".concat(d.getDomain())});var g=null;if(y&&v===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&&v===r.CATEGORY){var x=y;x.image&&(g={property:"og:image",content:x.image.src.replace(".webp",".jpg")})}if(y&&v===r.BRAND){var C=y;C.image&&(g={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(y&&v===r.BLOG_CATEGORY){var D=y;D.image&&(g={property:"og:image",content:D.image.src.replace(".webp",".jpg")})}if(y&&v===r.BLOG){var O=y;O.image&&(g={property:"og:image",content:O.image.src.replace(".webp",".jpg")})}!g&&(null==F?void 0:F.icon)&&(g={property:"og:image",content:null===(o=null==F?void 0:F.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}),[f,y,Y,h,b,T,b]),X=t.useMemo((function(){var t=[],o=(null==F?void 0:F.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&&v===r.PRODUCT){var n=y,s=function(t,o){var i,a,n,s,l,c;try{var p=["c7d934c7-2d44-43c3-b023-de7aa93fe435"],m=null===(i=d.getMerchantSettings())||void 0===i?void 0:i.merchantId,g=d.getCurrentRouting(),v=null==g?void 0:g.path,f=function(e){return v?"https://".concat(d.getDomain(),"/").concat(v).concat(e):"https://".concat(d.getDomain()).concat(e)},h=t.selectedVariant,j=null,x=null===(a=d.getMetaTemplates())||void 0===a?void 0:a.find((function(e){return e.locale===d.getCurrentLocale()&&r.PRODUCT}));return x&&(j=u(t,r.PRODUCT,x.descriptionTemplate||"")),e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:(null===(n=t.metaData)||void 0===n?void 0:n.description)||j,image:null===(s=h.images)||void 0===s?void 0:s.map((function(e){return e.image?e.image.src:""})),productId:h.id,sku:h.sku,mpn:(null===(l=h.barcodeList)||void 0===l?void 0:l.length)?h.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}}),p.some((function(e){return e!==m}))?{offers:t.variants.map((function(e){var o;return{"@type":"Offer",url:f(t.productHref+"?vid="+e.id),priceCurrency:e.price.currency||"TRY",price:(null!==(o=e.campaignPrice)&&void 0!==o?o:e.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:e.stock>0||e.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&&v===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&&v===r.BRAND&&((g=m(D))&&t.push(g));if(y&&v===r.BLOG){var f=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a="".concat(t.writer.firstName," ").concat(t.writer.lastName),r=(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:new Date(t.createdAt).toISOString(),dateCreated:new Date(t.createdAt).toISOString(),dateModified:new Date(t.updatedAt).toISOString(),description:t.shortDescription,articleBody:r,author:{"@type":"Person",name:a}})}catch(e){}}(y);f&&t.push(f)}return t}),[y,b]),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===v}));return t?u(y,v,t.titleTemplate||""):null}),[v,y]),J=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===v}));return t?u(y,v,t.descriptionTemplate||""):null}),[v,y]),q=t.useMemo((function(){return!d.getFavicon()&&(null==F?void 0:F.favIcon)?F.favIcon:null}),[]),K=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){K.push({routing:e,hrefLang:e.locale+"-"+t})})):K.push({routing:e,hrefLang:e.locale})}));var Q=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=K.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)||""},Z=l.getInstance();return t.createElement(i,null,t.createElement("title",null,f||W||(A?I?(null==M?void 0:M.name)||"":(null==N?void 0:N.name)||"":(null==F?void 0:F.pageTitle)||"")),t.createElement("meta",{name:"description",content:h||J||(A?(null==N?void 0:N.description)||"":(null==F?void 0:F.description)||"")}),K.length>1&&!P&&!R&&K.filter((function(e){return!P||e.routing.id===(null==E?void 0:E.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(G+(e.routing.path?"/"+e.routing.path:""),"/").concat(Q(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(G).concat(B).concat(e)})})),q&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(q,"/image_180.webp"),type:"image/webp"}),!j&&Z.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(G).concat(B,"/").concat(k)}),!!X.length&&X.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 v=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",v))}}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,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { IkasPageComponentPropValue, IkasSimplePageComponentPropValue } from "@ikas/storefront-providers";
3
3
  import { IkasCustomerReviewSummary, IkasThemeJsonPageType, IkasThemeJsonSettings, IkasThemeJsonCustomData } from "../../models";
4
- import { IkasThemeJsonComponent } from "@ikas/storefront-models";
4
+ import type { IkasThemeJsonComponent } from "@ikas/storefront-models";
5
5
  export declare type IkasPageProps = {
6
6
  propValues: IkasSimplePageComponentPropValue[];
7
7
  themeJsonComponents: IkasThemeJsonComponent[];
@@ -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&&P.length>0?P:null,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"../../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 g}from"../../page-data-init/index.js";import{setAPIClientConfig as x}from"@ikas/storefront-api";import{usePopupWidget as v}from"./widgets/popupWidget.js";import{useLoyaltyWidget as y}from"./widgets/loyaltyWidget.js";var h=a((function(a){var u=a.propValues,h=a.themeJsonComponents,b=a.customDataList,S=a.pageType,C=a.pageTitle,D=a.pageDescription,P=a.pageSpecificData,k=a.canonicals,T=a.disableIndex,I=a.settings,E=a.configJson,R=a.reInitOnBrowser,M=a.addOgpMetas,V=a.components,O=a.productReviewSummary,z=s(),A=r.useState(),B=A[0],H=A[1];p.init(e(e({},E),{currentPageComponents:V,loginRequiredCallback:function(){z.push("/account/login")}})),f.getInstance().router=z,x();var F=f.getInstance();F.router=z,F.currentPageType=S;var U=r.useState(!1),_=U[0],J=U[1],L=r.useMemo((function(){return(null==B?void 0:B.id)===(null==P?void 0:P.id)&&g.pageSpecificData&&g.isBrowser?S===d.PRODUCT&&g._initProductOnBrowser(g.pageSpecificData):g.setPageSpecificData(P,S,_),g.initPagePropValues(u,h,b.map((function(e){return new m(e)})),I,_)}),t(t([],S!==d.SEARCH?[_]:[],!0),[u,S,I,P,h],!1));r.useEffect((function(){R&&J("undefined"!=typeof window),window.addToCart=F.cartStore._windowAddToCart,F.cartStore.getCart(),F.checkLocalization(),j()}),[]),r.useEffect((function(){P?(null==B?void 0:B.id)!==P.id&&H(P):H(null)}),[P]),r.useEffect((function(){var e=function(){F.customerStore.routeChangeInit()};return z.events.on("routeChangeStart",e),function(){z.events.off("routeChangeStart",e)}}),[]),r.useEffect((function(){!function(e,t){var r,a;o(this,void 0,void 0,(function(){var o,s,n,m,p,c;return i(this,(function(i){switch(i.label){case 0:return o=f.getInstance(),[4,l.pageView(e)];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,7,,8]),e!==d.PRODUCT?[3,4]:(s=t,[4,l.productView(s)]);case 3:i.sent(),o.customerStore.onProductView(s.id,s.selectedVariant.id),i.label=4;case 4:return e===d.CATEGORY&&(m=null===(r=(n=t).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=t,l.viewBrand(p)),e!==d.CART?[3,6]:[4,o.cartStore.waitUntilInitialized()];case 5:i.sent(),l.viewCart(o.cartStore.cart),i.label=6;case 6:return[3,8];case 7:return c=i.sent(),console.error(c),[3,8];case 8:return[2]}}))}))}(S,g.pageSpecificData)}),[S,P]),v({router:z,pageType:S,pageSpecificDataId:null==P?void 0:P.id}),y();var W=r.useMemo((function(){var e=L.find((function(e){return e.component.isHeader})),t=L.find((function(e){return e.component.isFooter})),o=L.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,I,-1),o.map((function(e,t){return w(e,I,t)}))),t&&w(t,I,-1))}),[L,I]),q=r.useMemo((function(){return p.getMerchantSettings()?new n(p.getMerchantSettings()):null}),[p.getMerchantSettings()]);return r.createElement(r.Fragment,null,r.createElement(c,{pageType:S,pageTitle:C,pageDescription:D,pageSpecificData:g.pageSpecificData,canonicals:k&&k.length>0?k:null,disableIndex:T,merchantSettings:q,addOgpMetas:M,productReviewSummary:O,pageComponentPropValues:L}),W)})),w=function(e,t,o){return r.createElement(u,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{h as IkasPage,w as renderComponent};
@@ -0,0 +1,2 @@
1
+ export declare const resolveStoreUrl: () => string;
2
+ export declare const resolveCartUrl: () => string | undefined;
@@ -0,0 +1 @@
1
+ import{IkasStorefrontConfig as t}from"@ikas/storefront-config";var n=function(){var n=t.getDomain(),o=t.getCurrentRouting();return"undefined"!=typeof window?window.location.origin+((null==o?void 0:o.path)?"/".concat(o.path):""):(null==n?void 0:n.startsWith("http"))?n:"https://".concat(n)},o=function(){var n=t.getCurrentRouting();if(n)return"".concat((null==n?void 0:n.path)?"/".concat(n.path):"","/cart")};export{o as resolveCartUrl,n as resolveStoreUrl};
@@ -0,0 +1,8 @@
1
+ import type { IkasLoyaltyWidgetConfig } from "@ikas/loyalty-widget-renderer";
2
+ declare global {
3
+ interface Window {
4
+ ikasLoyaltyWidgetConfig?: IkasLoyaltyWidgetConfig;
5
+ startIkasLoyaltyWidget?: (config?: IkasLoyaltyWidgetConfig) => void;
6
+ }
7
+ }
8
+ export declare const useLoyaltyWidget: () => void;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e}from'./../../../ext/tslib/tslib.es6.js';import*as n from"react";import{getStorefrontWidgetSettings as r,listEarningMethods as i,listLoyaltyProgramTiers as o,listSpendingMethodsByCartId as a,getLoyaltyCustomerInfo as s,listLoyaltyProgramPointHistory as c,useLoyaltyPoints as u,removeLoyaltyPointsFromCart as d}from"@ikas/storefront-api";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{IkasBaseStore as f}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import v from"../../../store/product/index.js";import g from"../../../store/category/index.js";import y from"../../../store/brand/index.js";import{resolveStoreUrl as h}from"./common.js";import{formatCurrency as m}from"../../../utils/currency.js";import"lodash/get";function p(n){var h,p=this,w=f.getInstance(),b=function(){var t;return null===(t=w.cartStore.cart)||void 0===t?void 0:t.id},I=function(t){var e,n=null!==(e=null==t?void 0:t.themeSettingsJson)&&void 0!==e?e:t;if(!n)throw new Error("Loyalty widget settings not found");if("string"==typeof n)try{return JSON.parse(n)}catch(t){throw new Error("Loyalty widget settings format is invalid")}return n};return{getLoyaltyWidget:function(){return t(p,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return n?[2,I(n)]:[4,r()];case 1:if((t=e.sent()).isSuccess&&t.data)return[2,I(t.data)];throw new Error("Loyalty widget settings not found")}}))}))},subscribeToMarketingNotifications:function(){return t(p,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f.getInstance().customerStore.createEmailSubscription((null===(t=f.getInstance().customerStore.customer)||void 0===t?void 0:t.email)||"")];case 1:return[2,e.sent()]}}))}))},listEarningMethods:function(){return t(p,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,i()];case 1:return[2,t.sent().data||[]]}}))}))},listLoyaltyProgramTier:function(n){return t(p,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,o()];case 1:return[2,t.sent().data||[]]}}))}))},listSpendingMethodsByCartId:function(n){return t(p,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,a({cartId:n||b()})];case 1:return[2,t.sent().data||[]]}}))}))},getLoyaltyCustomerInfo:function(){return t(p,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s({cartId:b()||null})];case 1:return[2,t.sent().data||null]}}))}))},listLoyaltyProgramPointHistory:function(n){return t(p,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return t={},(r=null==n?void 0:n.type)&&(t.type=Array.isArray(r)?{in:r}:{eq:r}),[4,c(t)];case 1:return[2,e.sent().data||[]]}}))}))},useLoyaltyPoints:function(n){return t(p,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,u({input:n})];case 1:return(t=e.sent()).isSuccess?(h=n.loyaltySpendingMethodId,[4,w.cartStore.getCart()]):[3,3];case 2:e.sent(),e.label=3;case 3:return[2,!!t.isSuccess]}}))}))},removeLoyaltyPointsFromCart:function(){return t(p,void 0,void 0,(function(){var t,n,r,i,o;return e(this,(function(e){switch(e.label){case 0:return t=b(),n=h||(null===(o=null===(i=null===(r=w.cartStore.cart)||void 0===r?void 0:r.loyaltyLines)||void 0===i?void 0:i[0])||void 0===o?void 0:o.loyaltySpendingMethodId),t&&n?[4,d({cartId:t,loyaltySpendingMethodId:n})]:[2];case 1:return e.sent(),[2]}}))}))},getProducts:function(n){return t(p,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?[4,v.searchProducts({input:{productIdList:n,page:1,perPage:n.length,priceListId:l.getPriceListId(),salesChannelId:l.getSalesChannelId()}},[])]:[2,[]];case 1:return t=e.sent(),[2,(null===(r=t.data)||void 0===r?void 0:r.data)||[]]}}))}))},getCategories:function(n){return t(p,void 0,void 0,(function(){var t,r,i;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?(t={id:{in:n},pagination:{limit:n.length,page:1}},[4,g.listCategory(t)]):[2,[]];case 1:return r=e.sent(),[2,(null===(i=r.data)||void 0===i?void 0:i.data)||[]]}}))}))},getBrands:function(n){return t(p,void 0,void 0,(function(){var t,r,i;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?(t={id:{in:n},pagination:{limit:n.length,page:1}},[4,y.listProductBrand(t)]):[2,[]];case 1:return r=e.sent(),[2,(null===(i=r.data)||void 0===i?void 0:i.data)||[]]}}))}))},getTags:function(n){return t(p,void 0,void 0,(function(){return e(this,(function(t){return[2,[]]}))}))},formatCurrency:function(t){return m(t,l.getDefaultCurrencyCode()||"TRY",l.getDefaultCurrencySymbol()||"TRY")}}}var w=function(){n.useEffect((function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var n=!1,i=function(t){if("function"==typeof window.startIkasLoyaltyWidget)try{window.startIkasLoyaltyWidget(t)}catch(t){console.error("[@ikas/storefront] Failed to start loyalty widget",t)}},o=function(t){var e=window.location.href.includes("http://localhost:3333/")?"http://localhost:3000/storefront-widget-script-injector.iife.js":"/sf/assets/popup/storefront-widget-script-injector.iife.js";if(e){var r=document.querySelector('script[data-ikas-loyalty-widget="true"]');if(r)"true"===r.dataset.loaded?i(t):r.addEventListener("load",(function(){return i(t)}),{once:!0});else{var o=document.createElement("script");o.src=e,o.defer=!0,o.setAttribute("data-ikas-loyalty-widget","true"),o.addEventListener("load",(function(){o.dataset.loaded="true",n||i(t)}),{once:!0}),o.addEventListener("error",(function(t){console.error("[@ikas/storefront] Failed to load loyalty widget script",e,t)}),{once:!0}),document.body.appendChild(o)}}};return t(void 0,void 0,void 0,(function(){var n,i,a;return e(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),l.getLoyaltyPrograms().length?[4,r()]:[2];case 1:return(null==(n=s.sent())?void 0:n.isSuccess)&&n.data?[4,(c=n.data,t(void 0,void 0,void 0,(function(){var t,n,r,i;return e(this,(function(e){switch(e.label){case 0:return t={cdnURL:l.getCdnUrl()||"",merchantId:(null===(r=l.getMerchantSettings())||void 0===r?void 0:r.merchantId)||"",currency:l.getDefaultCurrencySymbol()||"TRY",locale:l.getCurrentLocale()||"tr",callbacks:p(c),position:"fixed",storeURL:h()},[4,new Promise((function(t){var e=setInterval((function(){var n=l.getSessionId();n&&(clearInterval(e),t(n))}),100)}))];case 1:return e.sent(),(n=null===(i=f.getInstance().cartStore.cart)||void 0===i?void 0:i.id)&&(t.cartId=n),c&&(t.widgetSettings=c),[2,t]}}))})))]:[2];case 2:return i=s.sent(),window.ikasLoyaltyWidgetConfig=i,o(i),[3,4];case 3:return a=s.sent(),console.error("[@ikas/storefront] Failed to initialize loyalty widget",a),[3,4];case 4:return[2]}var c}))})),function(){n=!0}}}),[])};export{w as useLoyaltyWidget};
@@ -0,0 +1,13 @@
1
+ import type { NextRouter } from "next/router";
2
+ import { IkasThemeJsonPageType } from "../../../models";
3
+ declare global {
4
+ interface Window {
5
+ ikasPopupConfig?: any;
6
+ startIkasPopupWidget?: (config?: any) => void;
7
+ }
8
+ }
9
+ export declare function usePopupWidget(options: {
10
+ router: NextRouter;
11
+ pageType: IkasThemeJsonPageType;
12
+ pageSpecificDataId?: string | null;
13
+ }): void;
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.js';import*as n from"react";import{listStorefrontPopup as o,SortByDirectionEnum as i}from"@ikas/storefront-api";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{Analytics as a}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{IkasBaseStore as u}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import c from"../../../store/product/index.js";import{resolveStoreUrl as d,resolveCartUrl as l}from"./common.js";var p=function(r){return t(void 0,void 0,void 0,(function(){var n,o,i,p,v,m,h,g,w,I,P,S,y,C,L;return e(this,(function(b){switch(b.label){case 0:return n={popups:r,cartUrl:""},[4,function(){return new Promise((function(t){var e=setInterval((function(){var r=s.getSessionId();r&&(clearInterval(e),t(r))}),100)}))}()];case 1:return b.sent(),(o=s.getSessionId())&&(n.sessionId=o),(i=s.getCdnUrl())&&(n.cdnUrl=i),(p=null===(y=s.getMerchantSettings())||void 0===y?void 0:y.merchantId)&&(n.merchantId=p),(v=d())&&(n.storeUrl=v),(m=l())&&(n.cartUrl=m),(h=s.getCustomerToken())&&(n.customerToken=h),(g=s.getCurrentLocale())&&(n.locale=g),(w=null===(L=null===(C=s.getCurrentRouting())||void 0===C?void 0:C.countryCodes)||void 0===L?void 0:L[0])&&(n.countryCode=w),(I=s.getPriceListId())&&(n.priceListId=I),(P=s.getSalesChannelId())&&(n.salesChannelId=P),k=u.getInstance().customerStore.customer,(S=k?{email:k.email,firstName:k.firstName,lastName:k.lastName,birthDate:k.birthDate,phone:k.phone}:null)&&(n.customer=S),n.services=function(){var r=this,n=u.getInstance();return{searchProducts:function(n){return t(r,void 0,void 0,(function(){var t,r,o;return e(this,(function(e){switch(e.label){case 0:return[4,c.searchProducts(f(n))];case 1:return(null==(t=e.sent())?void 0:t.isSuccess)&&(null===(o=null===(r=t.data)||void 0===r?void 0:r.data)||void 0===o?void 0:o.length)?[2,t.data.data]:[2,[]]}}))}))},addItemToCart:function(o){var i=o.product,s=o.variant,a=o.quantity;return t(r,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.cartStore.addItem(s,i,null!=a?a:1)];case 1:return[2,{success:!!(null==(t=e.sent())?void 0:t.success)}]}}))}))},saveCustomerFormData:function(o){return t(r,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.customerStore.saveCustomerFormData({email:o.email,firstName:o.firstName,lastName:o.lastName,birthDate:o.birthDate||"",phone:o.phone||"",storefrontPopupId:o.popupId,subscriptions:o.subscriptions})];case 1:return t.sent(),[2]}}))}))},getLastViewedProducts:function(){return t(r,void 0,void 0,(function(){var t;return e(this,(function(e){return"function"==typeof(t=n.customerStore).getLastViewedProducts?[2,t.getLastViewedProducts()]:[2,[]]}))}))},formatVariantSellPrice:function(t){return t.formattedSellPrice||""},formatVariantDiscountPrice:function(t){return t.formattedDiscountPrice||null},hasVariantDiscount:function(t){return!!t.hasDiscount},getVariantDiscountPercentage:function(t){var e=t.discountPercentage;return null==e?null:"number"==typeof e?e.toString():e},redirectToProduct:function(t){return!!t.url&&(window.location.href=t.url,!0)},viewPopup:function(t){a.viewStorefrontPopup(t)}}}(),[2,n]}var k}))}))};function f(t){var e,r,n,o,a,u=null===(e=t.order)||void 0===e?void 0:e.map((function(t){return{direction:"ASC"===t.direction?i.ASC:i.DESC,type:t.type}}));return{input:{page:null!==(r=t.page)&&void 0!==r?r:1,perPage:null!==(n=t.perPage)&&void 0!==n?n:10,order:u,productIdList:t.productIdList,categoryIdList:t.categoryIdList,priceListId:null!==(o=t.priceListId)&&void 0!==o?o:s.getPriceListId(),salesChannelId:null!==(a=t.salesChannelId)&&void 0!==a?a:s.getSalesChannelId()}}}function v(i){var a=this,u=i.router,c=i.pageSpecificDataId,d=i.pageType;n.useEffect((function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var n,i=!1,u=function(t,e){if(function(t){t.setAttribute("data-ikas-popup-widget","true"),!t.dataset.ikasPopupWidgetUrl&&t.src&&(t.dataset.ikasPopupWidgetUrl=t.src)}(t),"true"===t.dataset.ikasPopupWidgetLoaded)return e(),function(){};var r=function(){t.dataset.ikasPopupWidgetLoaded="true",e()},n=function(e){console.error("[@ikas/storefront] Failed to load popup widget script",t.src,e)};return t.addEventListener("load",r,{once:!0}),t.addEventListener("error",n,{once:!0}),function(){t.removeEventListener("load",r),t.removeEventListener("error",n)}},c=function(t){var e=window.location.href.includes("http://localhost:3333/")?"http://localhost:9000/popup-script-injector.iife.js":"/sf/assets/popup/popup-script-injector.iife.js";if(e){var r=function(){i||function(t){if("function"==typeof window.startIkasPopupWidget)try{window.startIkasPopupWidget(t)}catch(t){console.error("[@ikas/storefront] Failed to start popup widget",t)}}(t)},o=document.querySelector('script[data-ikas-popup-widget="true"]');if(o)n=u(o,r);else{var s=document.createElement("script");s.src=e,s.defer=!0,n=u(s,r),document.body.appendChild(s)}}},d=function(t){var e=window.location.href.includes("http://localhost:3333/")?"http://localhost:9000/style.css":"/sf/assets/popup/style.css";if(e&&!document.querySelector('link[href="'.concat(e,'"]'))){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.setAttribute("data-ikas-popup-widget","true");r.addEventListener("error",(function(t){console.error("[@ikas/storefront] Failed to load popup widget CSS",e,t)}),{once:!0}),document.head.appendChild(r)}};return t(a,void 0,void 0,(function(){var n,u,l;return e(this,(function(f){switch(f.label){case 0:return n=s.getStorefrontPopups()||[],[4,(v=n,t(a,void 0,void 0,(function(){var t,n,i,s,a;return e(this,(function(e){switch(e.label){case 0:if(!(t=v.map((function(t){return t.id})).filter(Boolean)).length)return[2,v];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,o({idList:t})];case 2:return(null==(n=e.sent())?void 0:n.isSuccess)&&(null===(a=n.data)||void 0===a?void 0:a.length)?(i=n.data,[2,v.map((function(t){var e=i.find((function(e){return e.id===t.id}));return e?r(r({},e),{isFilteredOnServerSide:t.isFilteredOnServerSide}):t}))]):[3,4];case 3:return s=e.sent(),console.error("[@ikas/storefront] Failed to fetch popup details",s),[3,4];case 4:return[2,v]}}))})))];case 1:return u=f.sent(),i?[2]:[4,p(u)];case 2:return l=f.sent(),window.ikasPopupConfig=l,c(l),d(),[2]}var v}))})),function(){i=!0,null==n||n()}}}),[u.asPath,c,d])}export{v as usePopupWidget};