@ikas/storefront 5.0.23 → 5.0.25

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 (234) hide show
  1. package/build/analytics/analytics.d.ts +2 -2
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/facebookPixel.d.ts +9 -8
  4. package/build/analytics/facebookPixel.js +1 -1
  5. package/build/analytics/googleAnalytics.js +1 -1
  6. package/build/analytics/googleTagManager.js +1 -1
  7. package/build/analytics/head/index.js +1 -1
  8. package/build/analytics/ikasV3.d.ts +180 -0
  9. package/build/analytics/ikasV3.js +1 -0
  10. package/build/components/checkout/components/address-form/index.js +1 -1
  11. package/build/components/checkout/components/address-form/model.js +1 -1
  12. package/build/components/checkout/components/adyen/index.js +1 -1
  13. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  14. package/build/components/checkout/components/cart-summary/cart-item/style.module.scss.js +1 -1
  15. package/build/components/checkout/components/customer-addresses/model.js +1 -1
  16. package/build/components/checkout/components/customer-addresses/style.module.scss.js +1 -1
  17. package/build/components/checkout/components/form-item/index.js +1 -1
  18. package/build/components/checkout/components/form-item/model.d.ts +5 -0
  19. package/build/components/checkout/components/form-item/model.js +1 -1
  20. package/build/components/checkout/components/offer-product/select/style.module.scss.js +1 -1
  21. package/build/components/checkout/components/offer-product/style.module.scss.js +1 -1
  22. package/build/components/checkout/components/quick-registration/model.js +1 -1
  23. package/build/components/checkout/index.d.ts +1 -0
  24. package/build/components/checkout/index.js +1 -1
  25. package/build/components/checkout/model.d.ts +1 -1
  26. package/build/components/checkout/model.js +1 -1
  27. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  28. package/build/components/checkout/steps/step-success/index.js +1 -1
  29. package/build/components/checkout/steps/step-success/style.module.scss.js +1 -1
  30. package/build/components/checkout/style.module.scss.js +1 -1
  31. package/build/components/page/head.js +1 -1
  32. package/build/components/page/index.js +1 -1
  33. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  34. package/build/components/page-editor/model.js +1 -1
  35. package/build/components/popup/renderer/index.js +1 -1
  36. package/build/components/popup/utils/index.js +1 -1
  37. package/build/hooks/useCustomerReviews.js +1 -1
  38. package/build/hooks/useStore.js +1 -1
  39. package/build/index.js +1 -1
  40. package/build/models/data/customer/address/ikas-localized-customer-address.js +1 -1
  41. package/build/models/data/index.d.ts +1 -0
  42. package/build/models/data/order/address/ikas-localized-order-address.js +1 -1
  43. package/build/models/data/order/line-item/option/value/index.d.ts +2 -1
  44. package/build/models/data/order/line-item/option/value/index.js +1 -1
  45. package/build/models/data/order/order-transaction-with-prices/index.d.ts +16 -0
  46. package/build/models/data/order/order-transaction-with-prices/index.js +1 -0
  47. package/build/models/data/order/order-transaction-with-prices/list-order-transaction-refundable-transaction/index.d.ts +6 -0
  48. package/build/models/data/order/order-transaction-with-prices/list-order-transaction-refundable-transaction/index.js +1 -0
  49. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/error/index.d.ts +7 -0
  50. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/error/index.js +1 -0
  51. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/index.d.ts +54 -0
  52. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/index.js +1 -0
  53. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-currency-rate-with-prices/index.d.ts +6 -0
  54. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-currency-rate-with-prices/index.js +1 -0
  55. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-fee-with-prices/index.d.ts +7 -0
  56. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-fee-with-prices/index.js +1 -0
  57. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-gift-package-line-item-with-prices/index.d.ts +7 -0
  58. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-gift-package-line-item-with-prices/index.js +1 -0
  59. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-order-line-item-with-prices/index.d.ts +11 -0
  60. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-order-line-item-with-prices/index.js +1 -0
  61. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-order-line-item-with-prices/transaction-order-line-variant-with-prices/index.d.ts +11 -0
  62. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-order-line-item-with-prices/transaction-order-line-variant-with-prices/index.js +1 -0
  63. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-payment-method-detail-with-prices/index.d.ts +14 -0
  64. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-payment-method-detail-with-prices/index.js +1 -0
  65. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-payment-method-detail-with-prices/transaction-installment-price-with-prices/index.d.ts +9 -0
  66. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-payment-method-detail-with-prices/transaction-installment-price-with-prices/index.js +1 -0
  67. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-sales-channel-with-prices/index.d.ts +6 -0
  68. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-sales-channel-with-prices/index.js +1 -0
  69. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-shipping-line-item-with-prices/index.d.ts +9 -0
  70. package/build/models/data/order/order-transaction-with-prices/transaction-with-prices/transaction-shipping-line-item-with-prices/index.js +1 -0
  71. package/build/models/data/product/attribute-value/index.d.ts +3 -1
  72. package/build/models/data/product/attribute-value/index.js +1 -1
  73. package/build/models/data/product/index.d.ts +4 -5
  74. package/build/models/data/product/index.js +1 -1
  75. package/build/models/data/product/option-set/option/index.d.ts +11 -1
  76. package/build/models/data/product/option-set/option/index.js +1 -1
  77. package/build/models/data/product/variant/index.js +1 -1
  78. package/build/models/data/storefront-popup/index.js +1 -1
  79. package/build/models/data/theme-json/index.js +1 -1
  80. package/build/models/ui/blog-category-list/index.js +1 -1
  81. package/build/models/ui/brand-list/index.js +1 -1
  82. package/build/models/ui/category-list/index.js +1 -1
  83. package/build/models/ui/customer-review-list/index.js +1 -1
  84. package/build/models/ui/customer-review-summary-list/index.js +1 -1
  85. package/build/models/ui/product-list/index.d.ts +6 -2
  86. package/build/models/ui/product-list/index.js +1 -1
  87. package/build/models/ui/raffle-list/index.js +1 -1
  88. package/build/models/ui/validator/form/account-info.js +1 -1
  89. package/build/models/ui/validator/form/address.js +1 -1
  90. package/build/models/ui/validator/form/ikas-address.js +1 -1
  91. package/build/models/ui/validator/form/register.js +1 -1
  92. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -0
  93. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +1 -0
  94. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -0
  95. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/date-item-view/index.js +1 -0
  96. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/gender-item-view/index.js +1 -0
  97. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -0
  98. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -0
  99. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -0
  100. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -0
  101. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -0
  102. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -0
  103. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -0
  104. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/space-element-renderer/index.js +1 -0
  105. package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +1 -0
  106. package/build/page-data-init/index.js +1 -1
  107. package/build/pages/checkout.js +1 -1
  108. package/build/store/blog/index.js +1 -1
  109. package/build/store/brand/index.js +1 -1
  110. package/build/store/cart/index.js +1 -1
  111. package/build/store/category/index.js +1 -1
  112. package/build/store/checkout/index.js +1 -1
  113. package/build/store/customer/api.d.ts +3 -2
  114. package/build/store/customer/api.js +1 -1
  115. package/build/store/customer/index.d.ts +4 -1
  116. package/build/store/customer/index.js +1 -1
  117. package/build/store/html-meta-data/index.js +1 -1
  118. package/build/store/location/index.js +1 -1
  119. package/build/store/product/index.js +1 -1
  120. package/package.json +12 -12
  121. package/build/analytics/ikas.js +0 -1
  122. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +0 -1
  123. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +0 -1
  124. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +0 -1
  125. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/date-item-view/index.js +0 -1
  126. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/gender-item-view/index.js +0 -1
  127. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +0 -1
  128. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +0 -1
  129. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +0 -1
  130. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +0 -1
  131. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +0 -1
  132. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +0 -1
  133. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +0 -1
  134. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/space-element-renderer/index.js +0 -1
  135. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +0 -1
  136. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouType.js +0 -0
  137. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +0 -0
  138. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +0 -0
  139. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +0 -0
  140. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.js +0 -0
  141. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.util.js +0 -0
  142. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeParser.js +0 -0
  143. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeState.js +0 -0
  144. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/ParseError.js +0 -0
  145. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumber.js +0 -0
  146. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumberMatcher.js +0 -0
  147. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/constants.js +0 -0
  148. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/LRUCache.js +0 -0
  149. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/Leniency.js +0 -0
  150. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/RegExpCache.js +0 -0
  151. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js +0 -0
  152. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidPreCandidate.js +0 -0
  153. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +0 -0
  154. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/parsePreCandidate.js +0 -0
  155. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/utf-8.js +0 -0
  156. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/util.js +0 -0
  157. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/format.js +0 -0
  158. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
  159. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
  160. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -0
  161. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
  162. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
  163. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -0
  164. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -0
  165. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
  166. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -0
  167. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
  168. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
  169. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
  170. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
  171. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -0
  172. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
  173. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
  174. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
  175. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/isObject.js +0 -0
  176. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
  177. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
  178. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/mergeArrays.js +0 -0
  179. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
  180. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
  181. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isPossible.js +0 -0
  182. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isValid.js +0 -0
  183. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isValidPhoneNumber.js +0 -0
  184. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/legacy/findPhoneNumbersInitialImplementation.js +0 -0
  185. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/metadata.js +0 -0
  186. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/normalizeArguments.js +0 -0
  187. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parse.js +0 -0
  188. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -0
  189. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
  190. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
  191. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
  192. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/tools/semver-compare.js +0 -0
  193. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js +0 -0
  194. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/metadata.min.json.js +0 -0
  195. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/AsYouType.js +0 -0
  196. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/Metadata.js +0 -0
  197. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js +0 -0
  198. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/isValidPhoneNumber.js +0 -0
  199. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
  200. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js +0 -0
  201. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/assets/left-arrow.js +0 -0
  202. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/assets/right-arrow.js +0 -0
  203. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/assets/x-close.js +0 -0
  204. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +0 -0
  205. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/index.js +0 -0
  206. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js +0 -0
  207. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js +0 -0
  208. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js +0 -0
  209. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js +0 -0
  210. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +0 -0
  211. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js +0 -0
  212. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js +0 -0
  213. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js +0 -0
  214. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-birthday/index.js +0 -0
  215. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-email/index.js +0 -0
  216. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js +0 -0
  217. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-name/index.js +0 -0
  218. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-phone/index.js +0 -0
  219. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-surname/index.js +0 -0
  220. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +0 -0
  221. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +0 -0
  222. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +0 -0
  223. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +0 -0
  224. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js +0 -0
  225. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +0 -0
  226. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js +0 -0
  227. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js +0 -0
  228. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js +0 -0
  229. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js +0 -0
  230. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js +0 -0
  231. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/window-settings/index.js +0 -0
  232. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js +0 -0
  233. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js +0 -0
  234. /package/build/{ext → packages/storefront/ext}/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-time/index.js +0 -0
@@ -1 +1 @@
1
- import{__spreadArray as t,__awaiter as e,__generator as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as r,observable as n,action as d}from"mobx";import a from"lodash/cloneDeep";import{Validator as o}from"../index.js";import{PhoneRule as u,RequiredRule as l}from"../rules/index.js";import{listCountry as c,listState as p,listCity as m,listDistrict as h}from"@ikas/storefront-api";import{IkasStorefrontConfig as f}from"@ikas/storefront-config";import{FREE_TEXT_CITY_COUNTRY_LIST as g}from"../../../../utils/constants.js";import{IkasBaseStore as v}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/region/index.js";import{IkasCustomerAddress as y}from"../../../data/customer/address/index.js";import"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/customer-form-data-input/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import"../../../data/order/address/region/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/campaign-offer/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/shipping-zone/state/city/district/region/index.js";import"../../../data/state/index.js";import"../../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../data/storefront-popup/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/component/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var j=function(t){return t.sort((function(t,e){return t.label.localeCompare(e.label)}))},x=function(t){return{label:t.name,value:t.id+""}},b=function(){function b(g){var j=this;this.countries=[],this.states=[],this.cities=[],this.districts=[],this._isCountriesPending=!0,this._isStatesPending=!1,this._isCitiesPending=!1,this._isDistrictsPending=!1,this.validatorRules=function(e){return void 0===e&&(e=!1),t([new l({model:j.address,fieldKey:"firstName",valuePath:"firstName",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"lastName",valuePath:"lastName",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"addressLine1",valuePath:"addressLine1",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"country",valuePath:"country",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"state",valuePath:"state",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"city",valuePath:"city",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"title",valuePath:"title",message:j.message.requiredRule})],e?[new u({model:j.address,fieldKey:"phone",valuePath:"phone",message:j.message.phoneRule})]:[],!0)},this.onTitleChange=function(t){j.address.title=t},this.onFirstNameChange=function(t){j.address.firstName=t},this.onLastNameChange=function(t){j.address.lastName=t},this.onPhoneChange=function(t){j.address.phone=t,t||j.validator.setRules(j.validatorRules())},this.onAddressLine1Change=function(t){j.address.addressLine1=t},this.onAddressLine2Change=function(t){j.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){j.address.postalCode=t},this.onCountryChange=function(t){var e;if((null===(e=j.address.country)||void 0===e?void 0:e.id)!==t){var i=j.countries.find((function(e){return e.id===t}));j.address.country={id:(null==i?void 0:i.id)||null,name:(null==i?void 0:i.name)||"",code:(null==i?void 0:i.iso3)||null,iso2:(null==i?void 0:i.iso2)||null,iso3:(null==i?void 0:i.iso3)||null},j.address.state=null,j.address.city=null,j.address.district=null,j.states=[],j.cities=[],j.districts=[],j.listStates()}},this.onStateChange=function(t){var e;if((null===(e=j.address.state)||void 0===e?void 0:e.id)!==t){var i=j.states.find((function(e){return e.id===t}));j.address.state={id:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.stateCode},j.address.city=null,j.address.district=null,j.cities=[],j.districts=[],j.listCities()}},this.onCityChange=function(t){var e;if((null===(e=j.address.city)||void 0===e?void 0:e.id)!==t){var i=j.cities.find((function(e){return e.id===t}));j.address.city={id:i.id,name:i.name,code:null},j.address.district=null,j.districts=[],j.listDistricts()}},this.onCityInputChange=function(t){j.districts=[],j.address.city={id:null,name:t,code:null}},this.onDistrictChange=function(t){var e;if((null===(e=j.address.district)||void 0===e?void 0:e.id)!==t){var i=j.districts.find((function(e){return e.id===t}));j.address.district={id:i.id,name:i.name,code:null}}},this.onDistrictInputChange=function(t){j.address.district={id:null,name:t,code:null}},this.listCountries=function(){return e(j,void 0,void 0,(function(){var t,e,s,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,3,4]),this._isCountriesPending=!0,[4,c({})];case 1:return t=i.sent(),e=f.getCurrentRouting(),s=t.data||[],(null===(r=null==e?void 0:e.countryCodes)||void 0===r?void 0:r.length)&&(s=s.filter((function(t){var i;return t.iso2&&(null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2))}))),this.countries=s,1!==this.countries.length||this.address.country||this.onCountryChange(this.countries[0].id),this.countries=s,[3,4];case 2:return i.sent(),[3,4];case 3:return this._isCountriesPending=!1,[7];case 4:return[2]}}))}))},this.listStates=function(){return e(j,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isStatesPending=!0,[4,p({countryId:{eq:this.address.country.id}})];case 2:return t=i.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,5];case 3:return i.sent(),[3,5];case 4:return this._isStatesPending=!1,[7];case 5:return[2]}}))}))},this.listCities=function(){return e(j,void 0,void 0,(function(){var t,e,s,r;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isCitiesPending=!0,[4,m({stateId:{eq:this.address.state.id},countryId:(null===(s=this.address.country)||void 0===s?void 0:s.id)?{eq:null===(r=this.address.country)||void 0===r?void 0:r.id}:void 0})];case 2:return t=i.sent(),this.cities=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isCitiesPending=!1,[7];case 5:return[2]}}))}))},this.listDistricts=function(){return e(j,void 0,void 0,(function(){var t,e,s,r;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isDistrictsPending=!0,[4,h({cityId:{eq:this.address.city.id},stateId:(null===(s=this.address.state)||void 0===s?void 0:s.id)?{eq:null===(r=this.address.state)||void 0===r?void 0:r.id}:void 0})];case 2:return t=i.sent(),this.districts=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isDistrictsPending=!1,[7];case 5:return[2]}}))}))},this.validateAll=function(){return j.validator.validateAll()},this.submit=function(){return e(j,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:return t={isFormError:!1,isSuccess:!1},this.address.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(i.sent())return t.isFormError=!0,[2,t];if(!(e=a(v.getInstance().customerStore.customer))||!this.address)return[2,t];(null==e?void 0:e.addresses)||(e.addresses=[]),this.isEdit?e.addresses[this.editingAddressIndex]=this.address:e.addresses.push(this.address),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,v.getInstance().customerStore.saveCustomer(e)];case 3:return i.sent()&&(t.isSuccess=!0),[2,t];case 4:return i.sent(),[2,t];case 5:return[2]}}))}))},s(this,{hasValidatorError:r,isEdit:r,results:r,editingAddressIndex:r,isFreeTextCity:r,isFreeTextDistrict:r,countries:n,states:n,cities:n,districts:n,_isCountriesPending:n,_isStatesPending:n,_isCitiesPending:n,_isDistrictsPending:n,isCountriesPending:r,isStatesPending:r,isCitiesPending:r,isDistrictsPending:r,onCountryChange:d,validateAll:d,submit:d}),this.address=g.address||new y({addressLine1:"",addressLine2:null,attributes:null,company:null,firstName:"",identityNumber:null,isDefault:null,lastName:"",phone:null,postalCode:null,taxNumber:null,taxOffice:null,title:"",country:null,state:null,city:null,district:null,id:"",createdAt:0,updatedAt:0}),this.message=g.message,this.validator=new o(this.address,this.validatorRules()),this.listCountries(),this.address.state&&this.listStates(),this.address.country&&this.listCities(),this.address.city&&this.listDistricts()}return Object.defineProperty(b.prototype,"isFreeTextCity",{get:function(){var t=this;return g.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e.toLowerCase()}))},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isFreeTextDistrict",{get:function(){return!this.districtOptions.length},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isEdit",{get:function(){return-1!==this.editingAddressIndex},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"editingAddressIndex",{get:function(){var t,e,i,s=this;return null!==(i=null===(e=null===(t=v.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.findIndex((function(t){return t.id===s.address.id})))&&void 0!==i?i:-1},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"countryOptions",{get:function(){var t=this.countries.map(x);return j(t)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"stateOptions",{get:function(){var t=this.states.map(x);return j(t)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"cityOptions",{get:function(){var t=this.cities.map(x);return j(t)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"districtOptions",{get:function(){var t=this.districts.map(x);return j(t)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isCountriesPending",{get:function(){return this._isCountriesPending},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isStatesPending",{get:function(){return this.isCountriesPending||this._isStatesPending},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isCitiesPending",{get:function(){return this.isStatesPending||this._isCitiesPending},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isDistrictsPending",{get:function(){return this.isCitiesPending||this._isDistrictsPending},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"hasValidatorError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"results",{get:function(){return this.validator.results},enumerable:!1,configurable:!0}),b}();export{b as AddressForm};
1
+ import{__spreadArray as t,__awaiter as e,__generator as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as r,observable as n,action as d}from"mobx";import a from"lodash/cloneDeep";import{Validator as o}from"../index.js";import{PhoneRule as u,RequiredRule as l}from"../rules/index.js";import{listCountry as c,listState as p,listCity as m,listDistrict as h}from"@ikas/storefront-api";import{IkasStorefrontConfig as f}from"@ikas/storefront-config";import{FREE_TEXT_CITY_COUNTRY_LIST as g}from"../../../../utils/constants.js";import{IkasBaseStore as v}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/region/index.js";import{IkasCustomerAddress as y}from"../../../data/customer/address/index.js";import"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/customer-form-data-input/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import"../../../data/order/address/region/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/order-transaction-with-prices/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/campaign-offer/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/shipping-zone/state/city/district/region/index.js";import"../../../data/state/index.js";import"../../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../data/storefront-popup/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/component/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var j=function(t){return t.sort((function(t,e){return t.label.localeCompare(e.label)}))},x=function(t){return{label:t.name,value:t.id+""}},b=function(){function b(g){var j=this;this.countries=[],this.states=[],this.cities=[],this.districts=[],this._isCountriesPending=!0,this._isStatesPending=!1,this._isCitiesPending=!1,this._isDistrictsPending=!1,this.validatorRules=function(e){return void 0===e&&(e=!1),t([new l({model:j.address,fieldKey:"firstName",valuePath:"firstName",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"lastName",valuePath:"lastName",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"addressLine1",valuePath:"addressLine1",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"country",valuePath:"country",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"state",valuePath:"state",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"city",valuePath:"city",message:j.message.requiredRule}),new l({model:j.address,fieldKey:"title",valuePath:"title",message:j.message.requiredRule})],e?[new u({model:j.address,fieldKey:"phone",valuePath:"phone",message:j.message.phoneRule})]:[],!0)},this.onTitleChange=function(t){j.address.title=t},this.onFirstNameChange=function(t){j.address.firstName=t},this.onLastNameChange=function(t){j.address.lastName=t},this.onPhoneChange=function(t){j.address.phone=t,t||j.validator.setRules(j.validatorRules())},this.onAddressLine1Change=function(t){j.address.addressLine1=t},this.onAddressLine2Change=function(t){j.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){j.address.postalCode=t},this.onCountryChange=function(t){var e;if((null===(e=j.address.country)||void 0===e?void 0:e.id)!==t){var i=j.countries.find((function(e){return e.id===t}));j.address.country={id:(null==i?void 0:i.id)||null,name:(null==i?void 0:i.name)||"",code:(null==i?void 0:i.iso3)||null,iso2:(null==i?void 0:i.iso2)||null,iso3:(null==i?void 0:i.iso3)||null},j.address.state=null,j.address.city=null,j.address.district=null,j.states=[],j.cities=[],j.districts=[],j.listStates()}},this.onStateChange=function(t){var e;if((null===(e=j.address.state)||void 0===e?void 0:e.id)!==t){var i=j.states.find((function(e){return e.id===t}));j.address.state={id:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.stateCode},j.address.city=null,j.address.district=null,j.cities=[],j.districts=[],j.listCities()}},this.onCityChange=function(t){var e;if((null===(e=j.address.city)||void 0===e?void 0:e.id)!==t){var i=j.cities.find((function(e){return e.id===t}));j.address.city={id:i.id,name:i.name,code:null},j.address.district=null,j.districts=[],j.listDistricts()}},this.onCityInputChange=function(t){j.districts=[],j.address.city={id:null,name:t,code:null}},this.onDistrictChange=function(t){var e;if((null===(e=j.address.district)||void 0===e?void 0:e.id)!==t){var i=j.districts.find((function(e){return e.id===t}));j.address.district={id:i.id,name:i.name,code:null}}},this.onDistrictInputChange=function(t){j.address.district={id:null,name:t,code:null}},this.listCountries=function(){return e(j,void 0,void 0,(function(){var t,e,s,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,3,4]),this._isCountriesPending=!0,[4,c({})];case 1:return t=i.sent(),e=f.getCurrentRouting(),s=t.data||[],(null===(r=null==e?void 0:e.countryCodes)||void 0===r?void 0:r.length)&&(s=s.filter((function(t){var i;return t.iso2&&(null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2))}))),this.countries=s,1!==this.countries.length||this.address.country||this.onCountryChange(this.countries[0].id),this.countries=s,[3,4];case 2:return i.sent(),[3,4];case 3:return this._isCountriesPending=!1,[7];case 4:return[2]}}))}))},this.listStates=function(){return e(j,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isStatesPending=!0,[4,p({countryId:{eq:this.address.country.id}})];case 2:return t=i.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,5];case 3:return i.sent(),[3,5];case 4:return this._isStatesPending=!1,[7];case 5:return[2]}}))}))},this.listCities=function(){return e(j,void 0,void 0,(function(){var t,e,s,r;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isCitiesPending=!0,[4,m({stateId:{eq:this.address.state.id},countryId:(null===(s=this.address.country)||void 0===s?void 0:s.id)?{eq:null===(r=this.address.country)||void 0===r?void 0:r.id}:void 0})];case 2:return t=i.sent(),this.cities=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isCitiesPending=!1,[7];case 5:return[2]}}))}))},this.listDistricts=function(){return e(j,void 0,void 0,(function(){var t,e,s,r;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isDistrictsPending=!0,[4,h({cityId:{eq:this.address.city.id},stateId:(null===(s=this.address.state)||void 0===s?void 0:s.id)?{eq:null===(r=this.address.state)||void 0===r?void 0:r.id}:void 0})];case 2:return t=i.sent(),this.districts=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isDistrictsPending=!1,[7];case 5:return[2]}}))}))},this.validateAll=function(){return j.validator.validateAll()},this.submit=function(){return e(j,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:return t={isFormError:!1,isSuccess:!1},this.address.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(i.sent())return t.isFormError=!0,[2,t];if(!(e=a(v.getInstance().customerStore.customer))||!this.address)return[2,t];(null==e?void 0:e.addresses)||(e.addresses=[]),this.isEdit?e.addresses[this.editingAddressIndex]=this.address:e.addresses.push(this.address),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,v.getInstance().customerStore.saveCustomer(e)];case 3:return i.sent()&&(t.isSuccess=!0),[2,t];case 4:return i.sent(),[2,t];case 5:return[2]}}))}))},s(this,{hasValidatorError:r,isEdit:r,results:r,editingAddressIndex:r,isFreeTextCity:r,isFreeTextDistrict:r,countries:n,states:n,cities:n,districts:n,_isCountriesPending:n,_isStatesPending:n,_isCitiesPending:n,_isDistrictsPending:n,isCountriesPending:r,isStatesPending:r,isCitiesPending:r,isDistrictsPending:r,onCountryChange:d,validateAll:d,submit:d}),this.address=g.address||new y({addressLine1:"",addressLine2:null,attributes:null,company:null,firstName:"",identityNumber:null,isDefault:null,lastName:"",phone:null,postalCode:null,taxNumber:null,taxOffice:null,title:"",country:null,state:null,city:null,district:null,id:"",createdAt:0,updatedAt:0}),this.message=g.message,this.validator=new o(this.address,this.validatorRules()),this.listCountries(),this.address.state&&this.listStates(),this.address.country&&this.listCities(),this.address.city&&this.listDistricts()}return Object.defineProperty(b.prototype,"isFreeTextCity",{get:function(){var t=this;return g.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e.toLowerCase()}))},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isFreeTextDistrict",{get:function(){return!this.districtOptions.length},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isEdit",{get:function(){return-1!==this.editingAddressIndex},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"editingAddressIndex",{get:function(){var t,e,i,s=this;return null!==(i=null===(e=null===(t=v.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.findIndex((function(t){return t.id===s.address.id})))&&void 0!==i?i:-1},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"countryOptions",{get:function(){var t=this.countries.map(x);return j(t)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"stateOptions",{get:function(){var t=this.states.map(x);return j(t)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"cityOptions",{get:function(){var t=this.cities.map(x);return j(t)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"districtOptions",{get:function(){var t=this.districts.map(x);return j(t)},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isCountriesPending",{get:function(){return this._isCountriesPending},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isStatesPending",{get:function(){return this.isCountriesPending||this._isStatesPending},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isCitiesPending",{get:function(){return this.isStatesPending||this._isCitiesPending},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isDistrictsPending",{get:function(){return this.isCitiesPending||this._isDistrictsPending},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"hasValidatorError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"results",{get:function(){return this.validator.results},enumerable:!1,configurable:!0}),b}();export{b as AddressForm};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as e,observable as s,computed as n,action as r}from"mobx";import d from"lodash/cloneDeep";import{listCheckoutSettings as o,listCountry as a,listState as u,listCity as l,listDistrict as c}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{IkasBaseStore as h}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/region/index.js";import"../../../data/customer/address/index.js";import{IkasLocalizedCustomerAddress as m}from"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/customer-form-data-input/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import{IkasOrderAddressRegion as f}from"../../../data/order/address/region/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/campaign-offer/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/shipping-zone/state/city/district/region/index.js";import"../../../data/state/index.js";import"../../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../data/storefront-popup/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/component/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";import{AddressFormItem as g,LocalizedAddressModel as v}from"@ikas/localized-address";import y from"lodash/mapValues";import b from"../../../../store/location/index.js";import{stringSorter as j}from"../../../../utils/helper.js";var x=function(t){return t.sort((function(t,i){return t.label.localeCompare(i.label)}))},C=function(t){return{label:t.name,value:t.id+""}},P=function(){function P(g){var y=this;this.countries=[],this.states=[],this.cities=[],this.districts=[],this.isLoaded=!1,this.isFormSubmit=!1,this._isCountriesPending=!0,this._isStatesPending=!1,this._isCitiesPending=!1,this._isDistrictsPending=!1,this.init=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:return this.address.countrySettings=new v({currentLocale:p.getCurrentLocale()}),[4,this.address.countrySettings.waitUntilInitialized()];case 1:return i.sent(),this.listCountries(),this.address.state&&this.listStates(),this.address.country&&this.listCities(),this.address.city&&this.listDistricts(),[4,o({})];case 2:return t=i.sent(),[4,b.getAvailableShippingZones({salesChannelId:p.getSalesChannelId()})];case 3:return e=i.sent(),t.isSuccess&&(null===(s=t.data)||void 0===s?void 0:s.length)&&(this.address.checkoutSettings=t.data[0]),e.isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.length)&&(this.address.shippingZones=e.data),this.address.getValidatedCustomerAddress(),this.isLoaded=!0,[2]}}))}))},this.onTitleChange=function(t){y.address.title=t},this.onFirstNameChange=function(t){y.address.firstName=t},this.onLastNameChange=function(t){y.address.lastName=t},this.onIdentityNumberChange=function(t){y.address.identityNumber=t},this.onPhoneChange=function(t){y.address.phone=t},this.onAddressLine1Change=function(t){y.address.addressLine1=t},this.onAddressLine2Change=function(t){y.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){y.address.postalCode=t},this.onCountryChange=function(t){var i;if((null===(i=y.address.country)||void 0===i?void 0:i.id)!==t){var e=y.countries.find((function(i){return i.id===t}));y.address.country={id:(null==e?void 0:e.id)||null,name:(null==e?void 0:e.name)||"",code:(null==e?void 0:e.iso3)||null,iso2:(null==e?void 0:e.iso2)||null,iso3:(null==e?void 0:e.iso3)||null},y.address.state=null,y.address.city=null,y.address.district=null,y.states=[],y.cities=[],y.districts=[],y.listStates()}},this.onStateChange=function(t){var i;if((null===(i=y.address.state)||void 0===i?void 0:i.id)!==t){var e=y.states.find((function(i){return i.id===t}));y.address.state={id:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.stateCode},y.address.isFreeTextCity||(y.address.city=null,y.cities=[],y.listCities()),y.address.isFreeTextDistrict||(y.address.district=null,y.districts=[])}},this.onCityChange=function(t){var i;if((null===(i=y.address.city)||void 0===i?void 0:i.id)!==t){var e=y.cities.find((function(i){return i.id===t}));y.address.city={id:e.id,name:e.name,code:null},y.address.isFreeTextDistrict||(y.address.district=null,y.districts=[],y.listDistricts())}},this.onCityInputChange=function(t){y.districts=[],y.address.city={id:null,name:t,code:null}},this.onDistrictChange=function(t){var i;if((null===(i=y.address.district)||void 0===i?void 0:i.id)!==t){var e=y.districts.find((function(i){return i.id===t}));y.address.district={id:e.id,name:e.name,code:null},y.address.region=null}},this.onDistrictInputChange=function(t){y.address.district={id:null,name:t,code:null}},this.onRegionChange=function(t){var i,e,s;if((null===(i=y.address.region)||void 0===i?void 0:i.id)!==t){var n=null===(s=null===(e=y.shippingZoneDistrict)||void 0===e?void 0:e.regions)||void 0===s?void 0:s.find((function(i){return i.id===t}));y.address.region=new f({id:n.id,name:n.name})}},this.listCountries=function(){return t(y,void 0,void 0,(function(){var t,e,s,n,r,d,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,6,7]),this._isCountriesPending=!0,[4,a({})];case 1:return t=i.sent(),e=p.getCurrentRouting(),s=t.data||[],(null===(o=null==e?void 0:e.countryCodes)||void 0===o?void 0:o.length)&&(s=s.filter((function(t){var i;return t.iso2&&(null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2))}))),this.countries=s,1!==this.countries.length||this.address.country?[3,2]:(this.onCountryChange(this.countries[0].id),[3,4]);case 2:return!this.countries.length||this.address.country?[3,4]:[4,b.getMyCountry()];case 3:n=i.sent(),r=n.data,(d=this.countries.find((function(t){return t.iso2===r})))?this.onCountryChange(d.id):this.onCountryChange(this.countries[0].id),i.label=4;case 4:return this.countries=s,[3,7];case 5:return i.sent(),[3,7];case 6:return this._isCountriesPending=!1,[7];case 7:return[2]}}))}))},this.listStates=function(){return t(y,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isStatesPending=!0,[4,u({countryId:{eq:this.address.country.id}})];case 2:return t=i.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,5];case 3:return i.sent(),[3,5];case 4:return this._isStatesPending=!1,[7];case 5:return[2]}}))}))},this.listCities=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isCitiesPending=!0,[4,l({stateId:{eq:this.address.state.id},countryId:(null===(s=this.address.country)||void 0===s?void 0:s.id)?{eq:null===(n=this.address.country)||void 0===n?void 0:n.id}:void 0})];case 2:return t=i.sent(),this.cities=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isCitiesPending=!1,[7];case 5:return[2]}}))}))},this.listDistricts=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isDistrictsPending=!0,[4,c({cityId:{eq:this.address.city.id},stateId:(null===(s=this.address.state)||void 0===s?void 0:s.id)?{eq:null===(n=this.address.state)||void 0===n?void 0:n.id}:void 0})];case 2:return t=i.sent(),this.districts=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isDistrictsPending=!1,[7];case 5:return[2]}}))}))},this.submit=function(){return t(y,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(t={isFormError:!1,isSuccess:!1},this.isFormSubmit=!0,!this.address.isValidAddress)return t.isFormError=!0,[2,t];if(!(e=d(h.getInstance().customerStore.customer))||!this.address)return[2,t];(null==e?void 0:e.addresses)||(e.addresses=[]),this.isEdit?e.addresses[this.editingAddressIndex]=this.address:e.addresses.push(this.address),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,h.getInstance().customerStore.saveCustomer(e)];case 2:return i.sent()&&(t.isSuccess=!0),[2,t];case 3:return i.sent(),[2,t];case 4:return[2]}}))}))},e(this,{isLoaded:s,isEdit:n,editingAddressIndex:n,isFreeTextCity:n,isFreeTextDistrict:n,countries:s,states:s,cities:s,districts:s,_isCountriesPending:s,_isStatesPending:s,_isCitiesPending:s,_isDistrictsPending:s,isCountriesPending:n,isStatesPending:n,isCitiesPending:n,isDistrictsPending:n,onCountryChange:r,submit:r}),this.address=g.address||new m({addressLine1:"",addressLine2:null,attributes:null,company:null,firstName:"",identityNumber:null,isDefault:null,lastName:"",phone:null,postalCode:null,taxNumber:null,taxOffice:null,title:"",country:null,state:null,city:null,district:null,region:null,id:"",createdAt:0,updatedAt:0}),this.message=g.message,this.init()}return Object.defineProperty(P.prototype,"shippingZone",{get:function(){var t,i=this;return null===(t=this.address.shippingZones)||void 0===t?void 0:t.find((function(t){var e;return t.countryId===(null===(e=i.address.country)||void 0===e?void 0:e.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneState",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.state)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneCity",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneState)||void 0===t?void 0:t.cities)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.city)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneDistrict",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneCity)||void 0===t?void 0:t.districts)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.district)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneRegion",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.region)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isFreeTextCity",{get:function(){return this.address.isFreeTextCity},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isFreeTextDistrict",{get:function(){return this.address.isFreeTextDistrict},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isEdit",{get:function(){return-1!==this.editingAddressIndex},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"editingAddressIndex",{get:function(){var t,i,e,s=this;return null!==(e=null===(i=null===(t=h.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===i?void 0:i.findIndex((function(t){return t.id===s.address.id})))&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"countryOptions",{get:function(){var t=this.countries.map(C);return x(t)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"stateOptions",{get:function(){var t,i,e=this,s=this.states.map(C);return this.shippingZone&&!this.shippingZone.showAllStates&&(null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.length)&&(s=s.filter((function(t){var i,s;return null===(s=null===(i=e.shippingZone)||void 0===i?void 0:i.states)||void 0===s?void 0:s.some((function(i){return i.id===t.value}))}))),x(s)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"cityOptions",{get:function(){var t,i,e,s=this,n=this.cities.map(C);return this.shippingZone&&!(null===(t=this.shippingZoneState)||void 0===t?void 0:t.showAllCities)&&(null===(e=null===(i=this.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.length)&&(n=n.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),x(n)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"districtOptions",{get:function(){var t,i,e,s=this,n=this.districts.map(C);return this.shippingZone&&!(null===(t=this.shippingZoneCity)||void 0===t?void 0:t.showAllDistricts)&&(null===(e=null===(i=this.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.length)&&(n=n.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),x(n)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"regionOptions",{get:function(){var t,i;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.map(C).sort((function(t,i){return j(t.label,i.label)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isCountriesPending",{get:function(){return this._isCountriesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isStatesPending",{get:function(){return this.isCountriesPending||this._isStatesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isCitiesPending",{get:function(){return this.isStatesPending||this._isCitiesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isDistrictsPending",{get:function(){return this.isCitiesPending||this._isDistrictsPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"fieldSettings",{get:function(){return this.address.fieldSettings},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"fieldLabels",{get:function(){return this.address.fieldLabels},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"addressFormat",{get:function(){return this.countryOptions.length<=1?this.address.addressFormatIgnoreCountry:this.address.addressFormat},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"validationResult",{get:function(){var t=this;if(this.address.validationResults)return y(this.address.validationResults,(function(i,e){return{hasError:t.isFormSubmit&&i.hasError,message:t.isFormSubmit&&i.hasError?e===g.PHONE?t.message.phoneRule?"string"==typeof t.message.phoneRule?t.message.phoneRule:t.message.phoneRule(t.address):"":i.isInvalid?"string"==typeof t.message.invalidRule?t.message.invalidRule:t.message.invalidRule(t.address):"string"==typeof t.message.requiredRule?t.message.requiredRule:t.message.requiredRule(t.address):""}}))},enumerable:!1,configurable:!0}),P}();export{P as IkasAddressForm};
1
+ import{__awaiter as t,__generator as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as e,observable as s,computed as n,action as r}from"mobx";import d from"lodash/cloneDeep";import{listCheckoutSettings as o,listCountry as a,listState as u,listCity as l,listDistrict as c}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{IkasBaseStore as h}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/region/index.js";import"../../../data/customer/address/index.js";import{IkasLocalizedCustomerAddress as m}from"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/customer-form-data-input/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import{IkasOrderAddressRegion as f}from"../../../data/order/address/region/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/order-transaction-with-prices/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/campaign-offer/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/shipping-zone/state/city/district/region/index.js";import"../../../data/state/index.js";import"../../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../data/storefront-popup/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/component/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";import{AddressFormItem as g,LocalizedAddressModel as v}from"@ikas/localized-address";import y from"lodash/mapValues";import b from"../../../../store/location/index.js";import{stringSorter as j}from"../../../../utils/helper.js";var x=function(t){return t.sort((function(t,i){return t.label.localeCompare(i.label)}))},C=function(t){return{label:t.name,value:t.id+""}},P=function(){function P(g){var y=this;this.countries=[],this.states=[],this.cities=[],this.districts=[],this.isLoaded=!1,this.isFormSubmit=!1,this._isCountriesPending=!0,this._isStatesPending=!1,this._isCitiesPending=!1,this._isDistrictsPending=!1,this.init=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:return this.address.countrySettings=new v({currentLocale:p.getCurrentLocale()}),[4,this.address.countrySettings.waitUntilInitialized()];case 1:return i.sent(),this.listCountries(),this.address.state&&this.listStates(),this.address.country&&this.listCities(),this.address.city&&this.listDistricts(),[4,o({})];case 2:return t=i.sent(),[4,b.getAvailableShippingZones({salesChannelId:p.getSalesChannelId()})];case 3:return e=i.sent(),t.isSuccess&&(null===(s=t.data)||void 0===s?void 0:s.length)&&(this.address.checkoutSettings=t.data[0]),e.isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.length)&&(this.address.shippingZones=e.data),this.address.getValidatedCustomerAddress(),this.isLoaded=!0,[2]}}))}))},this.onTitleChange=function(t){y.address.title=t},this.onFirstNameChange=function(t){y.address.firstName=t},this.onLastNameChange=function(t){y.address.lastName=t},this.onIdentityNumberChange=function(t){y.address.identityNumber=t},this.onPhoneChange=function(t){y.address.phone=t},this.onAddressLine1Change=function(t){y.address.addressLine1=t},this.onAddressLine2Change=function(t){y.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){y.address.postalCode=t},this.onCountryChange=function(t){var i;if((null===(i=y.address.country)||void 0===i?void 0:i.id)!==t){var e=y.countries.find((function(i){return i.id===t}));y.address.country={id:(null==e?void 0:e.id)||null,name:(null==e?void 0:e.name)||"",code:(null==e?void 0:e.iso3)||null,iso2:(null==e?void 0:e.iso2)||null,iso3:(null==e?void 0:e.iso3)||null},y.address.state=null,y.address.city=null,y.address.district=null,y.states=[],y.cities=[],y.districts=[],y.listStates()}},this.onStateChange=function(t){var i;if((null===(i=y.address.state)||void 0===i?void 0:i.id)!==t){var e=y.states.find((function(i){return i.id===t}));y.address.state={id:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.stateCode},y.address.isFreeTextCity||(y.address.city=null,y.cities=[],y.listCities()),y.address.isFreeTextDistrict||(y.address.district=null,y.districts=[])}},this.onCityChange=function(t){var i;if((null===(i=y.address.city)||void 0===i?void 0:i.id)!==t){var e=y.cities.find((function(i){return i.id===t}));y.address.city={id:e.id,name:e.name,code:null},y.address.isFreeTextDistrict||(y.address.district=null,y.districts=[],y.listDistricts())}},this.onCityInputChange=function(t){y.districts=[],y.address.city={id:null,name:t,code:null}},this.onDistrictChange=function(t){var i;if((null===(i=y.address.district)||void 0===i?void 0:i.id)!==t){var e=y.districts.find((function(i){return i.id===t}));y.address.district={id:e.id,name:e.name,code:null},y.address.region=null}},this.onDistrictInputChange=function(t){y.address.district={id:null,name:t,code:null}},this.onRegionChange=function(t){var i,e,s;if((null===(i=y.address.region)||void 0===i?void 0:i.id)!==t){var n=null===(s=null===(e=y.shippingZoneDistrict)||void 0===e?void 0:e.regions)||void 0===s?void 0:s.find((function(i){return i.id===t}));y.address.region=new f({id:n.id,name:n.name})}},this.listCountries=function(){return t(y,void 0,void 0,(function(){var t,e,s,n,r,d,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,6,7]),this._isCountriesPending=!0,[4,a({})];case 1:return t=i.sent(),e=p.getCurrentRouting(),s=t.data||[],(null===(o=null==e?void 0:e.countryCodes)||void 0===o?void 0:o.length)&&(s=s.filter((function(t){var i;return t.iso2&&(null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2))}))),this.countries=s,1!==this.countries.length||this.address.country?[3,2]:(this.onCountryChange(this.countries[0].id),[3,4]);case 2:return!this.countries.length||this.address.country?[3,4]:[4,b.getMyCountry()];case 3:n=i.sent(),r=n.data,(d=this.countries.find((function(t){return t.iso2===r})))?this.onCountryChange(d.id):this.onCountryChange(this.countries[0].id),i.label=4;case 4:return this.countries=s,[3,7];case 5:return i.sent(),[3,7];case 6:return this._isCountriesPending=!1,[7];case 7:return[2]}}))}))},this.listStates=function(){return t(y,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isStatesPending=!0,[4,u({countryId:{eq:this.address.country.id}})];case 2:return t=i.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,5];case 3:return i.sent(),[3,5];case 4:return this._isStatesPending=!1,[7];case 5:return[2]}}))}))},this.listCities=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isCitiesPending=!0,[4,l({stateId:{eq:this.address.state.id},countryId:(null===(s=this.address.country)||void 0===s?void 0:s.id)?{eq:null===(n=this.address.country)||void 0===n?void 0:n.id}:void 0})];case 2:return t=i.sent(),this.cities=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isCitiesPending=!1,[7];case 5:return[2]}}))}))},this.listDistricts=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isDistrictsPending=!0,[4,c({cityId:{eq:this.address.city.id},stateId:(null===(s=this.address.state)||void 0===s?void 0:s.id)?{eq:null===(n=this.address.state)||void 0===n?void 0:n.id}:void 0})];case 2:return t=i.sent(),this.districts=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isDistrictsPending=!1,[7];case 5:return[2]}}))}))},this.submit=function(){return t(y,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(t={isFormError:!1,isSuccess:!1},this.isFormSubmit=!0,!this.address.isValidAddress)return t.isFormError=!0,[2,t];if(!(e=d(h.getInstance().customerStore.customer))||!this.address)return[2,t];(null==e?void 0:e.addresses)||(e.addresses=[]),this.isEdit?e.addresses[this.editingAddressIndex]=this.address:e.addresses.push(this.address),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,h.getInstance().customerStore.saveCustomer(e)];case 2:return i.sent()&&(t.isSuccess=!0),[2,t];case 3:return i.sent(),[2,t];case 4:return[2]}}))}))},e(this,{isLoaded:s,isEdit:n,editingAddressIndex:n,isFreeTextCity:n,isFreeTextDistrict:n,countries:s,states:s,cities:s,districts:s,_isCountriesPending:s,_isStatesPending:s,_isCitiesPending:s,_isDistrictsPending:s,isCountriesPending:n,isStatesPending:n,isCitiesPending:n,isDistrictsPending:n,onCountryChange:r,submit:r}),this.address=g.address||new m({addressLine1:"",addressLine2:null,attributes:null,company:null,firstName:"",identityNumber:null,isDefault:null,lastName:"",phone:null,postalCode:null,taxNumber:null,taxOffice:null,title:"",country:null,state:null,city:null,district:null,region:null,id:"",createdAt:0,updatedAt:0}),this.message=g.message,this.init()}return Object.defineProperty(P.prototype,"shippingZone",{get:function(){var t,i=this;return null===(t=this.address.shippingZones)||void 0===t?void 0:t.find((function(t){var e;return t.countryId===(null===(e=i.address.country)||void 0===e?void 0:e.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneState",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.state)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneCity",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneState)||void 0===t?void 0:t.cities)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.city)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneDistrict",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneCity)||void 0===t?void 0:t.districts)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.district)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneRegion",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.region)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isFreeTextCity",{get:function(){return this.address.isFreeTextCity},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isFreeTextDistrict",{get:function(){return this.address.isFreeTextDistrict},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isEdit",{get:function(){return-1!==this.editingAddressIndex},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"editingAddressIndex",{get:function(){var t,i,e,s=this;return null!==(e=null===(i=null===(t=h.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===i?void 0:i.findIndex((function(t){return t.id===s.address.id})))&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"countryOptions",{get:function(){var t=this.countries.map(C);return x(t)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"stateOptions",{get:function(){var t,i,e=this,s=this.states.map(C);return this.shippingZone&&!this.shippingZone.showAllStates&&(null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.length)&&(s=s.filter((function(t){var i,s;return null===(s=null===(i=e.shippingZone)||void 0===i?void 0:i.states)||void 0===s?void 0:s.some((function(i){return i.id===t.value}))}))),x(s)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"cityOptions",{get:function(){var t,i,e,s=this,n=this.cities.map(C);return this.shippingZone&&!(null===(t=this.shippingZoneState)||void 0===t?void 0:t.showAllCities)&&(null===(e=null===(i=this.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.length)&&(n=n.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),x(n)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"districtOptions",{get:function(){var t,i,e,s=this,n=this.districts.map(C);return this.shippingZone&&!(null===(t=this.shippingZoneCity)||void 0===t?void 0:t.showAllDistricts)&&(null===(e=null===(i=this.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.length)&&(n=n.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),x(n)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"regionOptions",{get:function(){var t,i;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.map(C).sort((function(t,i){return j(t.label,i.label)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isCountriesPending",{get:function(){return this._isCountriesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isStatesPending",{get:function(){return this.isCountriesPending||this._isStatesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isCitiesPending",{get:function(){return this.isStatesPending||this._isCitiesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isDistrictsPending",{get:function(){return this.isCitiesPending||this._isDistrictsPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"fieldSettings",{get:function(){return this.address.fieldSettings},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"fieldLabels",{get:function(){return this.address.fieldLabels},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"addressFormat",{get:function(){return this.countryOptions.length<=1?this.address.addressFormatIgnoreCountry:this.address.addressFormat},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"validationResult",{get:function(){var t=this;if(this.address.validationResults)return y(this.address.validationResults,(function(i,e){return{hasError:t.isFormSubmit&&i.hasError,message:t.isFormSubmit&&i.hasError?e===g.PHONE?t.message.phoneRule?"string"==typeof t.message.phoneRule?t.message.phoneRule:t.message.phoneRule(t.address):"":i.isInvalid?"string"==typeof t.message.invalidRule?t.message.invalidRule:t.message.invalidRule(t.address):"string"==typeof t.message.requiredRule?t.message.requiredRule:t.message.requiredRule(t.address):""}}))},enumerable:!1,configurable:!0}),P}();export{P as IkasAddressForm};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__spreadArray as r,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as a,computed as o,observable as s,action as n}from"mobx";import d from"lodash/toNumber";import{Validator as u}from"../index.js";import{IkasBaseStore as m}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import{PhoneRule as l,RequiredRule as p,EmailRule as c,MinRule as f}from"../rules/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import{IkasCustomerAttributeType as b,IkasCustomerAttributeRegisterPageRequirement as h}from"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/region/index.js";import"../../../data/customer/address/index.js";import"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/customer-form-data-input/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import"../../../data/order/address/region/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/campaign-offer/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/shipping-zone/state/city/district/region/index.js";import"../../../data/state/index.js";import"../../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../data/storefront-popup/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/component/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var g=function(){function g(t){var e=this;this.model={firstName:"",lastName:"",email:"",password:"",attributes:void 0,isMarketingAccepted:!1,phone:null},this.isFormSubmit=!1,this._customerAttributes=void 0,this.validatorRules=function(t){return void 0===t&&(t=!1),r([new p({fieldKey:"firstName",valuePath:"firstName",message:e.message.requiredRule}),new p({fieldKey:"lastName",valuePath:"lastName",message:e.message.requiredRule}),new p({fieldKey:"email",valuePath:"email",message:e.message.requiredRule}),new p({fieldKey:"password",valuePath:"password",message:e.message.requiredRule}),new c({fieldKey:"email",valuePath:"email",message:e.message.emailRule}),new f({fieldKey:"password",valuePath:"password",minValue:6,message:e.message.minRule})],t?[new l({fieldKey:"phone",valuePath:"phone",message:e.message.phoneRule})]:[],!0)},this.onFirstNameChange=function(t){e.firstName=t},this.onLastNameChange=function(t){e.lastName=t},this.onEmailChange=function(t){e.email=t},this.onPasswordChange=function(t){e.password=t},this.onPhoneChange=function(t){e.phone=t},this.setCustomerAttributes=function(t){e._customerAttributes=(null==t?void 0:t.filter((function(t){return t.registerPageRequirement!==h.INVISIBLE})).map((function(t){return{attribute:t,attributeValue:{isChecked:void 0,value:void 0,selectedIdList:void 0},validator:{isRequired:t.registerPageRequirement===h.MANDATORY,hasError:!1,message:""}}})))||[]},this.onAttributeChange=function(t,r){var i;if(e._customerAttributes){var a=e._customerAttributes.find((function(e){return e.attribute.id===t}));if(a){var o=null===(i=e._customerAttributes)||void 0===i?void 0:i.findIndex((function(e){return e.attribute.id===t}));void 0!==o&&-1!==o&&(e._customerAttributes[o].attributeValue=e.getAttributeValue(a.attribute,r),e.validateCustomerAttribute())}}},a(this,{emailErrorMessage:o,passwordErrorMessage:o,firstNameErrorMessage:o,lastNameErrorMessage:o,phoneErrorMessage:o,hasError:o,redirect:o,model:s,validateAll:n,register:n,customerAttributes:o,_customerAttributes:s}),this.message=t.message,this.validator=new u(this.model,this.validatorRules())}return Object.defineProperty(g.prototype,"firstName",{get:function(){return this.model.firstName},set:function(t){this.model.firstName=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"lastName",{get:function(){return this.model.lastName},set:function(t){this.model.lastName=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"email",{get:function(){return this.model.email},set:function(t){this.model.email=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"password",{get:function(){return this.model.password},set:function(t){this.model.password=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"isMarketingAccepted",{get:function(){return this.model.isMarketingAccepted},set:function(t){this.model.isMarketingAccepted=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"phone",{get:function(){return this.model.phone},set:function(t){this.model.phone=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"firstNameErrorMessage",{get:function(){return this.validator.results.firstName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"lastNameErrorMessage",{get:function(){return this.validator.results.lastName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"phoneErrorMessage",{get:function(){var t;return null===(t=this.validator.results.phone)||void 0===t?void 0:t.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"attributes",{get:function(){return this.model.attributes},set:function(t){this.model.attributes=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"customerAttributes",{get:function(){return this._customerAttributes},enumerable:!1,configurable:!0}),g.prototype.getAttributeValue=function(t,e){var r={isChecked:void 0,value:void 0,selectedIdList:void 0};return"string"!=typeof e||t.type!==b.TEXT&&t.type!==b.DATETIME&&t.type!==b.DATE&&t.type!==b.CHOICE||(r.value=e),"string"==typeof e&&t.type===b.NUMERIC&&(Number.isInteger(d(e))?r.value=e:r.value=e.slice(0,-1)),"boolean"==typeof e&&t.type===b.BOOLEAN&&(r.isChecked=e),"object"==typeof e&&t.type===b.MULTIPLE_CHOICE&&(r.selectedIdList=e),r},Object.defineProperty(g.prototype,"formattedAttributesInput",{get:function(){if(!this._customerAttributes)return null;if(!this._customerAttributes.some((function(t){return void 0!==t.attributeValue.value||void 0!==t.attributeValue.isChecked||void 0!==t.attributeValue.selectedIdList})))return null;var t=[];return this._customerAttributes.map((function(e){var r=e.attributeValue,i=r.selectedIdList,a=r.isChecked,o=r.value;void 0!==i&&b.MULTIPLE_CHOICE&&i.map((function(r){t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:r,value:null})})),e.attribute.type===b.BOOLEAN&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:a?a.toString():"false"}),void 0!==o&&(e.attribute.type!==b.TEXT&&e.attribute.type!==b.NUMERIC||t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:o.toString()}),e.attribute.type===b.CHOICE&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:o,value:null}),e.attribute.type!==b.DATETIME&&e.attribute.type!==b.DATE||t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:new Date(o).getTime().toString()}))})),t},enumerable:!1,configurable:!0}),g.prototype.validateCustomerAttribute=function(){var t,e=this;this._customerAttributes=null===(t=this._customerAttributes)||void 0===t?void 0:t.map((function(t){var r;return t.validator.isRequired&&e.isFormSubmit&&(t.attribute.type===b.BOOLEAN||t.attributeValue.value||(null===(r=t.attributeValue.selectedIdList)||void 0===r?void 0:r.length)?(t.validator.hasError=!1,t.validator.message=""):(t.validator.hasError=!0,t.validator.message="string"==typeof e.message.requiredRule?e.message.requiredRule:e.message.requiredRule(e.model))),t}))},g.prototype.validateAll=function(){var r;return t(this,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return this.validateCustomerAttribute(),[4,this.validator.validateAll()];case 1:return t=e.sent(),i=null===(r=this._customerAttributes)||void 0===r?void 0:r.some((function(t){return t.validator.hasError})),[2,t||i]}}))}))},g.prototype.register=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return this.isFormSubmit=!0,t={isFormError:!1,isSuccess:!1,errorCodes:[]},this.email&&(this.email=this.email.trim()),this.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(e.sent())return t.isFormError=!0,[2,t];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,m.getInstance().customerStore.register(this.model.firstName,this.model.lastName,this.model.email,this.model.password,this.model.isMarketingAccepted,this.model.attributes||this.formattedAttributesInput||void 0,this.model.phone)];case 3:return r=e.sent(),[2,i(i({},t),r)];case 4:return e.sent(),[2,t];case 5:return[2]}}))}))},g}();export{g as RegisterForm};
1
+ import{__awaiter as t,__generator as e,__spreadArray as r,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as a,computed as o,observable as s,action as n}from"mobx";import d from"lodash/toNumber";import{Validator as u}from"../index.js";import{IkasBaseStore as m}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import{PhoneRule as l,RequiredRule as p,EmailRule as c,MinRule as f}from"../rules/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import{IkasCustomerAttributeType as b,IkasCustomerAttributeRegisterPageRequirement as h}from"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/region/index.js";import"../../../data/customer/address/index.js";import"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/customer-form-data-input/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import"../../../data/order/address/region/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/order-transaction-with-prices/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/campaign-offer/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/shipping-zone/state/city/district/region/index.js";import"../../../data/state/index.js";import"../../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../data/storefront-popup/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/component/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var g=function(){function g(t){var e=this;this.model={firstName:"",lastName:"",email:"",password:"",attributes:void 0,isMarketingAccepted:!1,phone:null},this.isFormSubmit=!1,this._customerAttributes=void 0,this.validatorRules=function(t){return void 0===t&&(t=!1),r([new p({fieldKey:"firstName",valuePath:"firstName",message:e.message.requiredRule}),new p({fieldKey:"lastName",valuePath:"lastName",message:e.message.requiredRule}),new p({fieldKey:"email",valuePath:"email",message:e.message.requiredRule}),new p({fieldKey:"password",valuePath:"password",message:e.message.requiredRule}),new c({fieldKey:"email",valuePath:"email",message:e.message.emailRule}),new f({fieldKey:"password",valuePath:"password",minValue:6,message:e.message.minRule})],t?[new l({fieldKey:"phone",valuePath:"phone",message:e.message.phoneRule})]:[],!0)},this.onFirstNameChange=function(t){e.firstName=t},this.onLastNameChange=function(t){e.lastName=t},this.onEmailChange=function(t){e.email=t},this.onPasswordChange=function(t){e.password=t},this.onPhoneChange=function(t){e.phone=t},this.setCustomerAttributes=function(t){e._customerAttributes=(null==t?void 0:t.filter((function(t){return t.registerPageRequirement!==h.INVISIBLE})).map((function(t){return{attribute:t,attributeValue:{isChecked:void 0,value:void 0,selectedIdList:void 0},validator:{isRequired:t.registerPageRequirement===h.MANDATORY,hasError:!1,message:""}}})))||[]},this.onAttributeChange=function(t,r){var i;if(e._customerAttributes){var a=e._customerAttributes.find((function(e){return e.attribute.id===t}));if(a){var o=null===(i=e._customerAttributes)||void 0===i?void 0:i.findIndex((function(e){return e.attribute.id===t}));void 0!==o&&-1!==o&&(e._customerAttributes[o].attributeValue=e.getAttributeValue(a.attribute,r),e.validateCustomerAttribute())}}},a(this,{emailErrorMessage:o,passwordErrorMessage:o,firstNameErrorMessage:o,lastNameErrorMessage:o,phoneErrorMessage:o,hasError:o,redirect:o,model:s,validateAll:n,register:n,customerAttributes:o,_customerAttributes:s}),this.message=t.message,this.validator=new u(this.model,this.validatorRules())}return Object.defineProperty(g.prototype,"firstName",{get:function(){return this.model.firstName},set:function(t){this.model.firstName=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"lastName",{get:function(){return this.model.lastName},set:function(t){this.model.lastName=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"email",{get:function(){return this.model.email},set:function(t){this.model.email=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"password",{get:function(){return this.model.password},set:function(t){this.model.password=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"isMarketingAccepted",{get:function(){return this.model.isMarketingAccepted},set:function(t){this.model.isMarketingAccepted=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"phone",{get:function(){return this.model.phone},set:function(t){this.model.phone=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"firstNameErrorMessage",{get:function(){return this.validator.results.firstName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"lastNameErrorMessage",{get:function(){return this.validator.results.lastName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"phoneErrorMessage",{get:function(){var t;return null===(t=this.validator.results.phone)||void 0===t?void 0:t.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"attributes",{get:function(){return this.model.attributes},set:function(t){this.model.attributes=t},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"customerAttributes",{get:function(){return this._customerAttributes},enumerable:!1,configurable:!0}),g.prototype.getAttributeValue=function(t,e){var r={isChecked:void 0,value:void 0,selectedIdList:void 0};return"string"!=typeof e||t.type!==b.TEXT&&t.type!==b.DATETIME&&t.type!==b.DATE&&t.type!==b.CHOICE||(r.value=e),"string"==typeof e&&t.type===b.NUMERIC&&(Number.isInteger(d(e))?r.value=e:r.value=e.slice(0,-1)),"boolean"==typeof e&&t.type===b.BOOLEAN&&(r.isChecked=e),"object"==typeof e&&t.type===b.MULTIPLE_CHOICE&&(r.selectedIdList=e),r},Object.defineProperty(g.prototype,"formattedAttributesInput",{get:function(){if(!this._customerAttributes)return null;if(!this._customerAttributes.some((function(t){return void 0!==t.attributeValue.value||void 0!==t.attributeValue.isChecked||void 0!==t.attributeValue.selectedIdList})))return null;var t=[];return this._customerAttributes.map((function(e){var r=e.attributeValue,i=r.selectedIdList,a=r.isChecked,o=r.value;void 0!==i&&b.MULTIPLE_CHOICE&&i.map((function(r){t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:r,value:null})})),e.attribute.type===b.BOOLEAN&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:a?a.toString():"false"}),void 0!==o&&(e.attribute.type!==b.TEXT&&e.attribute.type!==b.NUMERIC||t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:o.toString()}),e.attribute.type===b.CHOICE&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:o,value:null}),e.attribute.type!==b.DATETIME&&e.attribute.type!==b.DATE||t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:new Date(o).getTime().toString()}))})),t},enumerable:!1,configurable:!0}),g.prototype.validateCustomerAttribute=function(){var t,e=this;this._customerAttributes=null===(t=this._customerAttributes)||void 0===t?void 0:t.map((function(t){var r;return t.validator.isRequired&&e.isFormSubmit&&(t.attribute.type===b.BOOLEAN||t.attributeValue.value||(null===(r=t.attributeValue.selectedIdList)||void 0===r?void 0:r.length)?(t.validator.hasError=!1,t.validator.message=""):(t.validator.hasError=!0,t.validator.message="string"==typeof e.message.requiredRule?e.message.requiredRule:e.message.requiredRule(e.model))),t}))},g.prototype.validateAll=function(){var r;return t(this,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return this.validateCustomerAttribute(),[4,this.validator.validateAll()];case 1:return t=e.sent(),i=null===(r=this._customerAttributes)||void 0===r?void 0:r.some((function(t){return t.validator.hasError})),[2,t||i]}}))}))},g.prototype.register=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return this.isFormSubmit=!0,t={isFormError:!1,isSuccess:!1,errorCodes:[]},this.email&&(this.email=this.email.trim()),this.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(e.sent())return t.isFormError=!0,[2,t];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,m.getInstance().customerStore.register(this.model.firstName,this.model.lastName,this.model.email,this.model.password,this.model.isMarketingAccepted,this.model.attributes||this.formattedAttributesInput||void 0,this.model.phone)];case 3:return r=e.sent(),[2,i(i({},t),r)];case 4:return e.sent(),[2,t];case 5:return[2]}}))}))},g}();export{g as RegisterForm};
@@ -0,0 +1 @@
1
+ import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import e from"react";import{observer as n}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{ButtonActionTypeEnum as o}from"../../models/modal/step/elements/button/index.js";import{getHorizontalAlignment as r,injectFontScript as i}from"../../helpers/index.js";var a=n((function(n){var a=n.element,c=n.isStandaloneButtonComponent,l=n.onClose,s=e.useRef(null),d=a,u={display:"flex",alignItems:"center",justifyContent:r(d.horizontalAlignment),padding:"".concat(d.outerVerticalPadding,"px ").concat(d.outerHorizontalPadding,"px"),backgroundColor:d.bgColor},m={color:d.color,backgroundColor:d.buttonBgColor,fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:i(d.fontFamily),textAlign:"center",border:"".concat(d.borderWidth,"px ").concat(d.borderStyle," ").concat(d.borderColor),borderRadius:d.borderRadius,padding:"".concat(d.verticalPadding,"px ").concat(d.horizontalPadding,"px")},f={width:"".concat(d.width,"%"),minWidth:"fit-content",cursor:"pointer"},p=e.useCallback((function(){if(s.current){var t=d.link||void 0;if(!c&&t)s.current.href=t||"",s.current.click();else switch(d.actionType){case o.NAVIGATE_TO_LINK_AND_CLOSE:s.current.href=t||"",null==l||l(!0),s.current.click();break;case o.NAVIGATE_TO_LINK:s.current.href=t||"",s.current.click();break;case o.CLOSE:null==l||l(!0)}}}),[s,s.current]);return e.createElement("div",{style:u},e.createElement("a",{onClick:p,style:f,target:d.openLinkInNewWindow?"_blank":"_self",ref:s},e.createElement("div",{dangerouslySetInnerHTML:{__html:d.text},style:t({},m)})))}));export{a as default};
@@ -0,0 +1 @@
1
+ import t from"react";import{observer as o}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as e}from"../../helpers/index.js";import{ButtonBorderStyle as r}from"../../models/modal/background-settings/index.js";var d=o((function(o){var d=o.element,n={display:"flex",alignItems:"center",justifyContent:e(d.horizontalAlignment),padding:"".concat(d.verticalPadding,"px ").concat(d.horizontalPadding,"px"),backgroundColor:d.bgColor,width:"100%"},a=d.borderStyle===r.SOLID?"solid":d.borderStyle===r.DASHED?"dashed":"dotted",i={width:"".concat(d.width,"%"),height:"".concat(d.borderWidth,"px"),borderRadius:"".concat(d.borderRadius,"px"),borderBottom:"".concat(d.borderWidth,"px ").concat(a," ").concat(d.borderColor)};return t.createElement("div",{style:n},t.createElement("div",{style:i}))}));export{d as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from'./../../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';var r=t((function(t){var r=t.checkboxItem;e.useEffect((function(){r.showInCheckedStatus?r.isChecked=!0:r.isChecked=!1}),[r.showInCheckedStatus]);var o=r.requiredToBeChecked,i=e.useCallback((function(){var e=/<pre[^>]*>([\s\S]*?)<\/pre>/.exec(r.text);return e?e[1]:r.text}),[r.text]);return e.createElement("div",{style:{width:"100%",display:"flex",gap:6,flexDirection:"column"}},e.createElement("div",{style:{width:"100%",display:"flex",gap:8,flexDirection:"row",alignItems:"baseline",wordBreak:"break-word"}},e.createElement("input",{style:{width:"16px",height:"16px",cursor:"pointer",position:"relative",top:3},type:"checkbox",checked:r.isChecked,onChange:function(){r.isChecked=!r.isChecked,o&&o.hasError&&r.isChecked&&(o.hasError=!1)}}),e.createElement("div",{dangerouslySetInnerHTML:{__html:i()}})),!!o&&o.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},o.validationErrorMessage))}));export{r as CheckboxItemView};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as r}from'./../../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import t from"react-date-picker";var a=r((function(r){var a=e.useState(!1),o=a[0],l=a[1],n=e.useRef(null);r.placeholder;var c=r.isRequired,i=r.inputLabel;r.updateCurrentInfo;var s=r.formInputSettings,d=r.value,u=r.onValueChange;return e.useEffect((function(){if(n.current){var e=n.current.getElementsByClassName("react-date-picker__wrapper");if(e.length>0){var r=e[0];r.style.backgroundColor=s.bgColor,r.style.border="".concat(s.borderWidth,"px solid ").concat(o?s.focusBorderColor:s.borderColor),r.style.borderRadius="".concat(s.borderRadius,"px"),r.style.fontSize="14px",r.style.padding="10px 12px",r.style.height="".concat(s.height,"px")}}}),[n.current]),e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"},ref:n},(i||c)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},i.text),c&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),c&&c.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},c.validationErrorMessage)),e.createElement(t,{onChange:function(e){return function(e){var r=e?e.valueOf().toString():"";u(r),c&&c.hasError&&r.length>0&&(c.hasError=!1)}(e)},value:d?new Date(Number(d)):null,className:"ikas-popup-datepicker",disableCalendar:!0,format:"dd / MM / yyyy",maxDate:new Date,clearIcon:null,onFocus:function(){return l(!0)},onBlur:function(){return function(){if(l(!1),n.current){var e=n.current.getElementsByClassName("react-date-picker__wrapper");e.length>0&&(e[0].style.border="".concat(s.borderWidth,"px solid ").concat(s.borderColor))}}()}}))}));export{a as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as r}from'./../../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';var t=r((function(r){var t,o=e.useState(!1),n=o[0],i=o[1],l=r.genderFormItem,a=r.formInputSettings;r.onValueChange;var d={width:"100%",backgroundColor:a.bgColor,border:"".concat(a.borderWidth,"px solid ").concat(n?a.focusBorderColor:a.borderColor),color:l.genders.find((function(e){return e.isSelected}))?"black":"#697586",borderRadius:"".concat(a.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(a.height,"px"),appearance:"none",backgroundImage:"url(\"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' %3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 12px center",backgroundSize:"20px",cursor:"pointer"};return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(l.inputLabel||l.required)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},l.inputLabel&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},l.inputLabel.text),l.required&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),l.required&&l.required.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},l.required.validationErrorMessage)),e.createElement("select",{value:(null===(t=l.genders.find((function(e){return e.isSelected})))||void 0===t?void 0:t.type)||void 0,onChange:function(e){return r=e.target.value,l.genders.forEach((function(e){e.isSelected=e.type===r})),void(l.required&&l.required.hasError&&(l.required.hasError=!1));var r},style:d,onFocus:function(){return i(!0)},onBlur:function(){return i(!1)}},!!l.placeholder&&e.createElement("option",{value:"",disabled:!0,selected:!0,hidden:!0},l.placeholder.text),l.genders.filter((function(e){return!!e.label})).map((function(r){return e.createElement("option",{key:r.type,value:r.type},r.label)}))))}));export{t as default};
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as r}from"../../../ext/tslib/tslib.es6.mjs.js";import t from"react";import{observer as n}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as o,injectFontScript as a,validateEmail as i,validatePhoneNumber as l}from"../../helpers/index.js";import{FormItemTypeEnum as s}from"../../models/modal/step/elements/form/index.js";import u from"../button-element-renderer/index.js";import m from"./input-item-view/index.js";import{CheckboxItemView as d}from"./checkbox-item-view/index.js";import c from"./date-item-view/index.js";import f from"./gender-item-view/index.js";var E=n((function(n){var E=n.element,p=n.popup,v=n.isPreviewMode,C=n.sfProps,I=t.useState(!1);I[0];var h=I[1],M=E,S=M.rows.slice().sort((function(e,r){return e.order-r.order})),g=M.formSettings,R=M.buttonSettings,O=M.bgColor,_={display:"flex",flexDirection:"column",justifyContent:o(M.horizontalAlignment),gap:"".concat(g.gapBetweenItems,"px"),padding:"".concat(M.outerVerticalPadding,"px ").concat(M.outerHorizontalPadding,"px"),backgroundColor:O,width:"100%"},T={display:"flex",flexDirection:"row",width:"100%",gap:"".concat(g.gapBetweenItems,"px")},b={flex:1,display:"flex",alignItems:"flex-end",fontFamily:a(g.fontFamily),fontSize:g.fontSize},U=function(){return e(void 0,void 0,void 0,(function(){var e,t,n;return r(this,(function(r){switch(r.label){case 0:return e=p.modal.steps.findIndex((function(e){return e.id===p.modal.selectedStep.id})),t=e===p.modal.steps.length-2,!v&&C&&t?(h(!0),o=0,M.rows.forEach((function(e){e.columns.forEach((function(e){switch(e.type){case s.CUSTOMER_BIRTHDAY:var r=e.formItem;r.required&&!r.value&&(r.required.hasError=!0,o++);break;case s.CUSTOMER_EMAIL:case s.CUSTOMER_PHONE:case s.CUSTOMER_NAME:case s.CUSTOMER_SURNAME:var t=e.formItem;if(t.required&&!t.value){if(t.type===s.CUSTOMER_EMAIL&&(null==C?void 0:C.isCustomerLoggedIn))return;t.required.hasError=!0,o++}else if(e.type===s.CUSTOMER_EMAIL){var n=i(t.value||"");t.validEmailError.hasError=!n,n||o++}else if(e.type===s.CUSTOMER_PHONE){var a=l(t.value||"",null==C?void 0:C.currentCountryCode);t.validPhoneError.hasError=!a,a||o++}break;case s.CUSTOMER_GENDER:var u=e.formItem,m=u.genders.find((function(e){return e.isSelected}));u.required&&!m&&(u.required.hasError=!0,o++);break;case s.CHECKBOX_FORM_ITEM:var d=e.formItem;d.requiredToBeChecked&&!d.isChecked&&(d.requiredToBeChecked.hasError=!0,o++)}}))})),o>0?(h(!1),[2]):(n={},M.rows.forEach((function(e){e.columns.forEach((function(e){var r;switch(e.type){case s.CUSTOMER_BIRTHDAY:n.birthday=e.formItem.value;break;case s.CUSTOMER_EMAIL:n.email=e.formItem.value;break;case s.CUSTOMER_GENDER:n.gender=(null===(r=e.formItem.genders.find((function(e){return e.isSelected})))||void 0===r?void 0:r.type)||"";break;case s.CUSTOMER_PHONE:n.phone=e.formItem.value;break;case s.CUSTOMER_NAME:n.firstName=e.formItem.value||"";break;case s.CUSTOMER_SURNAME:n.lastName=e.formItem.value||"";break;case s.CHECKBOX_FORM_ITEM:n.hasPermission=e.formItem.isChecked}}))})),[4,C.onCustomerSave(n)])):[3,2];case 1:r.sent(),h(!1),r.label=2;case 2:return-1!==e&&e<p.modal.steps.length&&(p.modal.selectedStep=p.modal.steps[e+1]),[2]}var o}))}))};return t.createElement("div",{style:_},S.map((function(e,r){return t.createElement("div",{style:T,key:r},e.columns.slice().sort((function(e,r){return e.order-r.order})).map((function(e,r){return t.createElement("div",{style:b,key:r},function(e){switch(e.type){case s.CUSTOMER_EMAIL:case s.CUSTOMER_PHONE:case s.CUSTOMER_NAME:case s.CUSTOMER_SURNAME:var r=e.formItem;if(r.type===s.CUSTOMER_EMAIL&&(null==C?void 0:C.isCustomerLoggedIn)&&!v)return null;var n=null;if(e.type===s.CUSTOMER_EMAIL){var o=r;o.validEmailError.hasError&&(n=o.validEmailError.validationErrorMessage)}else if(e.type===s.CUSTOMER_PHONE){var a=r;a.validPhoneError.hasError&&(n=a.validPhoneError.validationErrorMessage)}return t.createElement(m,{formInputSettings:g.formInputSettings,inputLabel:r.inputLabel,isRequired:r.required,onValueChange:function(e){return v?null:r.value=e},placeholder:r.placeholder,updateCurrentInfo:r.updateCurrentInfo,value:r.value||"",validationErrorMessage:n});case s.CUSTOMER_BIRTHDAY:var i=e.formItem;return t.createElement(c,{formInputSettings:g.formInputSettings,inputLabel:i.inputLabel,isRequired:i.required,onValueChange:function(e){return v?null:i.value=e},placeholder:i.placeholder,updateCurrentInfo:i.updateCurrentInfo,value:i.value||""});case s.CUSTOMER_GENDER:var l=e.formItem;return t.createElement(f,{genderFormItem:l,formInputSettings:g.formInputSettings,onValueChange:function(e){return v?null:l.genders.forEach((function(r){r.isSelected=r.label===e}))}});case s.CHECKBOX_FORM_ITEM:return t.createElement(d,{checkboxItem:e.formItem})}}(e))})))})),t.createElement("div",{style:{width:"100%",minWidth:"fit-content"},onClick:function(e){U(),e.preventDefault(),e.stopPropagation()}},t.createElement(u,{element:R})," "))}));export{E as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from'./../../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';var r=t((function(t){var r=e.useState(!1),o=r[0],n=r[1];e.useRef(null);var l=t.placeholder,a=t.isRequired,i=t.inputLabel;t.updateCurrentInfo;var c=t.validationErrorMessage,d=t.formInputSettings,u=t.value,s=t.onValueChange,p={width:"100%",backgroundColor:d.bgColor?"".concat(d.bgColor):"transparent",border:"".concat(d.borderWidth,"px solid ").concat(o?d.focusBorderColor:d.borderColor),borderRadius:"".concat(d.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(d.height,"px"),outline:"none"},x=a?((null==l?void 0:l.text)||"")+" *":(null==l?void 0:l.text)||"";return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(i||a)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},i.text)),a&&a.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},a.validationErrorMessage),!!c&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},c)),e.createElement("input",{type:"text",placeholder:x,value:u||"",onChange:function(e){return function(e){s(e),a&&a.hasError&&e.length>0&&(a.hasError=!1)}(e.target.value)},style:p,onFocus:function(){return n(!0)},onBlur:function(){return n(!1)}}))}));export{r as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{ImageFitEnum as r}from"../../models/modal/step/elements/image/index.js";var i=t((function(t){var i=t.element,o=t.popup,a=t.editModeChildren,d=t.isMobile,n=i;n.cdnURL||(n.cdnURL=o.cdnURL),n.merchantId||(n.merchantId=o.merchantId);var c=o.modal.windowSettings,m={width:c.takeFullWidth||d?"100%":c.maxWidth,backgroundColor:n.bgColor,padding:"".concat(n.verticalPadding,"px ").concat(n.horizontalPadding,"px"),borderRadius:n.borderRadius};if(!n.src&&o.isPreviewMode&&a)return e.createElement("div",{style:m},a);var l={objectFit:n.objectFit===r.CONTAIN?"contain":"cover",height:"100%"};return e.createElement("a",{href:n.link||void 0,style:m,target:"_blank"},n.src&&e.createElement("img",{src:n.src||void 0,width:"100% !important",style:l}))}));export{i as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{ImagePositionEnum as i,ImageFitEnum as o}from"../../models/modal/step/elements/image/index.js";var a=t((function(t){var a=t.element,r=t.popup,n=t.editModeChildren,d=a;if(d.cdnURL||(d.cdnURL=r.cdnURL),d.merchantId||(d.merchantId=r.merchantId),!d.src&&r.isPreviewMode&&n)return n;var m={display:"flex",alignItems:"center",justifyContent:d.imagePosition===i.DISABLE_FLOAT?"center":d.imagePosition===i.FLOAT_LEFT?"flex-start":"flex-end",padding:"".concat(d.verticalPadding,"px ").concat(d.horizontalPadding,"px"),backgroundColor:d.bgColor,maxWidth:"100%"},c={borderRadius:"".concat(d.borderRadius,"px"),objectFit:d.objectFit===o.CONTAIN?"contain":"cover",width:"".concat(d.maxWidth,"%")};return e.createElement("a",{href:d.link||void 0,style:m,target:"_blank"},e.createElement("img",{src:d.src||void 0,width:100===d.maxWidth?"100% !important":void 0,style:c}))}));export{a as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from'./../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{PopupTypeEnum as o,PopupPositonEnum as n}from"../models/modal/index.js";import i from"../assets/x-close.js";import{CloseButtonPositionTypeEnum as r,CloseIconTypeEnum as l,CloseButtonDisplayTypeEnum as s}from"../models/modal/close-settings/index.js";import{PopupElementTypeEnum as a,ComponentVerticalAlignmentEnum as d}from"../models/modal/step/elements/base/index.js";import c from"./text-element-renderer/index.js";import m from"./button-element-renderer/index.js";import p from"./space-element-renderer/index.js";import u from"./divider-element-renderer/index.js";import f from"./social-element-renderer/index.js";import P from"./image-element-renderer/index.js";import E from"./image-column-element-renderer/index.js";import x from"./product-list-renderer/index.js";import g from"./form-element-renderer/index.js";import{ImageColumnPositionEnum as v,MobileImageColumnPositionEnum as T}from"../models/modal/step/elements/image-column/index.js";var y=t((function(t){var y,b,C,O,I=t.popup,_=t.dynamicData,h=t.dashboardComponents,M=t.previewMode,w=t.sfProps,A=t.isMobile,D=I.modal,S=D.teaser,R=!!D.selectedStep.isTeaser,k=D.selectedStep.elements.find((function(e){return e.type===a.IMAGE_COLUMN})),N=R?S.backgroundSettings:D.backgroundSettings,j=R?S.windowSettings:D.windowSettings,B=R?S.closeSettings:D.closeSettings,L=N.allowScrollingWhenPopupOpen,U=I.isPreviewMode||M,H=!!U||D.isVisible;document.body.style.overflow=H&&!L?"hidden":"auto";var W=N.overlay,F=N.border,V="center",G="center";switch(R?o.POPUP:D.type){case o.POPUP:var z=R?S.position:D.position;z===n.POPUP_TOP_LEFT?(V="flex-start",G="flex-start"):z===n.POPUP_TOP_CENTER?(V="center",G="flex-start"):z===n.POPUP_TOP_RIGHT?(V="flex-end",G="flex-start"):z===n.POPUP_MIDDLE_LEFT?(V="flex-start",G="center"):z===n.POPUP_MIDDLE_CENTER?(V="center",G="center"):z===n.POPUP_MIDDLE_RIGHT?(V="flex-end",G="center"):z===n.POPUP_BOTTOM_LEFT?(V="flex-start",G="flex-end"):z===n.POPUP_BOTTOM_CENTER?(V="center",G="flex-end"):z===n.POPUP_BOTTOM_RIGHT&&(V="flex-end",G="flex-end");break;case o.DRAWER:D.position===n.DRAWER_LEFT?(V="flex-start",G="center"):D.position===n.DRAWER_RIGHT&&(V="flex-end",G="center");break;case o.NOTIFICATION_BAR:D.position===n.NOTIFICATION_BAR_UP?(V="center",G="flex-start"):D.position===n.NOTIFICATION_BAR_DOWN&&(V="center",G="flex-end")}var K=e.useMemo((function(){return 2147483644}),[]),X=e.useMemo((function(){return K+1}),[]),Y=e.useMemo((function(){return X+1}),[]),q=e.useMemo((function(){return Y+1}),[]),J={position:"fixed",display:"flex",justifyContent:V,alignItems:G,top:0,left:0,right:0,bottom:0,zIndex:K,overflow:"hidden",padding:"".concat(j.outerVerticalPadding,"px ").concat(j.outerHorizontalPadding,"px"),opacity:H?1:0,visibility:H?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},Q={position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:X,backgroundColor:W?W.bgColor:"",opacity:W?(W.bgOpacity||100)/100:void 0},Z={position:"relative",zIndex:Y,backgroundColor:N.bgColor,border:F?"".concat(F.borderWidth,"px ").concat(F.borderStyle," ").concat(F.borderColor):"",borderRadius:"".concat(j.borderRadius,"px"),maxWidth:"100%",maxHeight:"100%",width:j.takeFullWidth?"100%":void 0,minHeight:j.minHeight,height:j.takeFullHeight?"100%":void 0,boxShadow:N.shadow?"0 0 10px ".concat(N.shadow.color):"",overflow:"auto",opacity:H?1:0,visibility:H?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},$="";switch(null==k?void 0:k.verticalAlignment){case d.BOTTOM:$="flex-end";break;case d.MIDDLE:$="center";break;case d.TOP:$="flex-start"}var ee=k?k.imagePosition===v.LEFT_ALIGN?"row-reverse":"row":"",te=k?k.mobilePosition===T.TOP?"column-reverse":"column":"",oe={display:"flex",flexDirection:k?A?te:ee:"column",overflow:"hidden"},ne={width:j.takeFullWidth?"100%":j.maxWidth,maxWidth:"100%",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:$,padding:"".concat(j.innerVerticalPadding,"px ").concat(j.innerHorizontalPadding,"px")},ie={position:B.closeButtonPositionType===r.TAKE_SPACE?"relative":"absolute",float:B.closeButtonPositionType===r.TAKE_SPACE?"right":"none",top:8,right:8,zIndex:q},re={position:"sticky",padding:"6px",marginLeft:B.closeButtonPositionType===r.TAKE_SPACE?"14px":void 0,display:"flex",justifyContent:"center",alignItems:"center",border:(null===(y=B.iconSettings)||void 0===y?void 0:y.type)===l.WITH_BORDER?"1px solid ".concat(null===(b=B.iconSettings)||void 0===b?void 0:b.color):"",borderRadius:"50%",backgroundColor:null===(C=B.iconSettings)||void 0===C?void 0:C.backgroundColor},le={color:null===(O=B.iconSettings)||void 0===O?void 0:O.color,cursor:"pointer"},se=function(t){var o=t.type,n=h&&h[o]&&h[o].length?h[o][0]:null,i=n&&I.marketingPopupViewModel?e.createElement(n,{element:t,marketingPopupViewModel:I.marketingPopupViewModel}):void 0;switch(o){case a.TEXT:return e.createElement(c,{element:t});case a.IMAGE:return e.createElement(P,{element:t,popup:I,editModeChildren:i});case a.IMAGE_COLUMN:return A&&k.mobilePosition===T.HIDE?null:e.createElement(E,{element:t,popup:I,editModeChildren:i,isMobile:A});case a.BUTTON:return e.createElement(m,{element:t,onClose:ae,isStandaloneButtonComponent:!0});case a.DIVIDER:return e.createElement(u,{element:t});case a.FORM:return e.createElement(g,{element:t,popup:I,isPreviewMode:!!U,sfProps:w});case a.PRODUCT_LIST:return e.createElement(x,{element:t,products:_.products[t.id],popup:I,editModeChildren:i,isPreviewMode:!!U,sfProps:w,onClose:ae});case a.SOCIAL_MEDIA:return e.createElement(f,{element:t,popup:I,editModeChildren:i});case a.SPACE:return e.createElement(p,{element:t})}},ae=function(e){U||D.isVisible&&(D.isVisible=!1,w&&w.onModalClose(e))};return e.createElement("div",{className:"ikas-popup-default-styles",id:"ikas-popup-container",style:J},e.createElement("div",{style:Z},B.closeButtonDisplayType!==s.ALWAYS_HIDDEN&&e.createElement("div",{style:ie,onClick:function(){return ae()}},e.createElement("div",{style:re,className:B.closeButtonDisplayType===s.VISIBLE_ON_HOVER?"visible-on-hover":""},e.createElement(i,{style:le}))),e.createElement("div",{style:oe,onClick:function(e){R&&(D.selectedStep=D.steps[0])}},e.createElement("div",{style:ne},D.selectedStep.elements.filter((function(e){return e.type!==a.IMAGE_COLUMN})).slice().sort((function(e,t){return e.order-t.order})).map((function(e){return se(e)}))),k&&se(k))),e.createElement("div",{style:Q,onClick:function(){return ae()}}))}));export{y as default};
@@ -0,0 +1 @@
1
+ import{__spreadArray as t,__assign as e,__awaiter as o,__generator as n}from"../../../ext/tslib/tslib.es6.mjs.js";import i from"react";import{observer as l}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as r,injectFontScript as d}from"../../helpers/index.js";import{ProductListTypeEnum as a,ProductListLayoutEnum as c}from"../../models/modal/step/elements/product/index.js";import s from"../button-element-renderer/index.js";import u from'./../../../../../../../../../ext/swiper/modules/navigation.mjs.js';import m from'./../../../../../../../../../ext/swiper/modules/scrollbar.mjs.js';import{Swiper as p,SwiperSlide as v}from'./../../../../../../../../../ext/swiper/swiper-react.mjs.js';import g from"../../assets/left-arrow.js";import f from"../../assets/right-arrow.js";import{ProductActionTypeEnum as b}from"../../models/modal/step/elements/product/detail-settings/index.js";import{ComponentHorizontalAlignmentEnum as x}from"../../models/modal/step/elements/base/index.js";var h=l((function(l){var h,y=l.element,E=l.products,P=l.popup,w=l.editModeChildren,C=l.isPreviewMode,S=l.sfProps,z=l.onClose,j=i.useState(null),R=j[0],_=j[1],A=i.useState(!1),D=A[0],I=A[1],W=i.useState(!1),F=W[0],T=W[1],k=y,L=[];if(E&&(L=k.listType===a.SPECIFIC?(null===(h=k.variantPairs)||void 0===h?void 0:h.length)?E.slice().sort((function(t,e){return k.variantPairs.findIndex((function(e){return e.variantId===t.variantId}))-k.variantPairs.findIndex((function(t){return t.variantId===e.variantId}))})):[]:t([],E,!0)),L.length>k.maxProductsToShow&&(L.length=k.maxProductsToShow),!(L&&L.length||!P.isPreviewMode)&&w)return w;if(!L||!L.length)return null;k.gapBetweenProductElements;var H=k.productDetailSettings.image,B=k.productDetailSettings.button,M=k.buttonSettings,N=k.productDetailSettings.discountRatio,O=k.productDetailSettings.finalPrice,U=k.productDetailSettings.originalPrice,V=k.productDetailSettings.name,$=r(k.horizontalAlignment),q=1;k.layout===c.ONE_COLUMN?q=1:k.layout===c.TWO_COLUMN?q=2:k.layout===c.THREE_COLUMN&&(q=3);var G={padding:"".concat(k.outerVerticalPadding,"px ").concat(k.outerHorizontalPadding,"px"),backgroundColor:k.productBgColor,width:"100%",height:"max-content"},J={display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",height:"100%"},K={display:"flex",justifyContent:$,alignItems:"center",width:"100%",backgroundColor:null==H?void 0:H.bgColor,borderRadius:(null==H?void 0:H.borderRadius)?"".concat(H.borderRadius,"px"):void 0},Q={width:"".concat(null==H?void 0:H.maxWidth,"%"),objectFit:"contain",borderRadius:(null==H?void 0:H.borderRadius)?"".concat(H.borderRadius,"px"):void 0},X={display:"flex",flexDirection:"column",width:"100%"},Y={display:"flex",flexDirection:"column"},Z={backgroundColor:null==V?void 0:V.bgColor,color:null==V?void 0:V.color,fontFamily:V?d(V.fontFamily):void 0,fontSize:null==V?void 0:V.fontSize,fontWeight:null==V?void 0:V.fontWeight,padding:"".concat(null==V?void 0:V.verticalPadding,"px ").concat(null==V?void 0:V.horizontalPadding,"px"),width:"100%",textAlign:null==V?void 0:V.horizontalAlignment,border:"".concat(null==V?void 0:V.borderWidth,"px ").concat(null==V?void 0:V.borderStyle," ").concat(null==V?void 0:V.borderColor),borderRadius:null==V?void 0:V.borderRadius},tt={backgroundColor:null==N?void 0:N.bgColor,color:null==N?void 0:N.color,fontFamily:N?d(N.fontFamily):void 0,fontSize:null==N?void 0:N.fontSize,fontWeight:null==N?void 0:N.fontWeight,padding:"".concat(null==N?void 0:N.verticalPadding,"px ").concat(null==N?void 0:N.horizontalPadding,"px"),width:"fit-content !important",border:"".concat(null==N?void 0:N.borderWidth,"px ").concat(null==N?void 0:N.borderStyle," ").concat(null==N?void 0:N.borderColor),borderRadius:null==N?void 0:N.borderRadius},et={textDecoration:"line-through",backgroundColor:null==U?void 0:U.bgColor,color:null==U?void 0:U.color,fontFamily:U?d(U.fontFamily):void 0,fontSize:null==U?void 0:U.fontSize,fontWeight:null==U?void 0:U.fontWeight,padding:"".concat(null==U?void 0:U.verticalPadding,"px ").concat(null==U?void 0:U.horizontalPadding,"px"),width:"100%",textAlign:null==U?void 0:U.horizontalAlignment,border:"".concat(null==U?void 0:U.borderWidth,"px ").concat(null==U?void 0:U.borderStyle," ").concat(null==U?void 0:U.borderColor),borderRadius:null==U?void 0:U.borderRadius},ot={backgroundColor:null==O?void 0:O.bgColor,color:null==O?void 0:O.color,fontFamily:O?d(O.fontFamily):void 0,fontSize:null==O?void 0:O.fontSize,fontWeight:null==O?void 0:O.fontWeight,padding:"".concat(null==O?void 0:O.verticalPadding,"px ").concat(null==O?void 0:O.horizontalPadding,"px"),width:"100%",textAlign:null==O?void 0:O.horizontalAlignment,border:"".concat(null==O?void 0:O.borderWidth,"px ").concat(null==O?void 0:O.borderStyle," ").concat(null==O?void 0:O.borderColor),borderRadius:null==O?void 0:O.borderRadius},nt={width:"".concat(M.width,"%"),minWidth:"fit-content"},it=e({display:"flex",justifyContent:"center",width:"100%",gap:"10px"},1===q?{position:"absolute",top:"calc(50% - 25px)",alignItems:"center",justifyContent:"space-between",zIndex:10}:void 0),lt={padding:10,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",border:"1px solid #EEF2F6",cursor:"pointer"};return i.createElement("div",{style:G},i.createElement(p,{onSwiper:_,modules:[u,m],spaceBetween:k.gapBetweenProducts,slidesPerView:q,navigation:{nextEl:".custom-next-button",prevEl:".custom-prev-button"},scrollbar:void 0},L.map((function(t,e){return i.createElement(v,{style:{height:"auto"},key:t.variantId},i.createElement("div",{style:J,onClick:function(){return function(t){return o(void 0,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return C||!t.url?[3,4]:(null===(o=k.productDetailSettings.button)||void 0===o?void 0:o.action)===b.ADD_TO_CART&&S?[4,S.addProductToCart(t)]:[3,2];case 1:return n.sent()&&((e=document.createElement("a")).href="".concat(P.storeUrl,"/cart"),e.target="_self",e.click()),[3,3];case 2:(e=document.createElement("a")).href=t.url,e.target="_self",e.click(),n.label=3;case 3:z(!0),n.label=4;case 4:return[2]}}))}))}(t)}},i.createElement("div",{style:X},!!H&&t.imageURL&&i.createElement("div",{style:K},i.createElement("img",{src:t.imageURL||void 0,alt:t.name||void 0,style:Q})),!!V&&i.createElement("div",{style:Y},!!V&&i.createElement("div",{style:Z},t.name)),(!!U||!!O||!!N)&&i.createElement("div",{style:{display:"flex",flexDirection:"column",gap:2}},!!N&&!!t.discountPrice&&i.createElement("div",{style:{padding:"".concat(N.outerVerticalPadding,"px ").concat(N.outerHorizontalPadding,"px"),width:"100% !important",display:"flex",justifyContent:r(N.horizontalAlignment),alignItems:"center"}},i.createElement("div",{style:tt},function(t){return t.$discountRatio?k.productDetailSettings.discountRatioText?"".concat(t.$discountRatio," ").concat(k.productDetailSettings.discountRatioText):t.$discountRatio:null}(t))),i.createElement("div",{style:{display:"flex",gap:4,flexWrap:"wrap",overflow:"hidden",width:"100%",justifyContent:r((null==U?void 0:U.horizontalAlignment)||(null==O?void 0:O.horizontalAlignment)||x.LEFT),alignItems:"center"}},!!U&&!!t.discountPrice&&i.createElement("div",{style:{padding:"".concat(U.outerVerticalPadding,"px ").concat(U.outerHorizontalPadding,"px")}},i.createElement("div",{style:et},t.price)),!!O&&i.createElement("div",{style:{padding:"".concat(O.outerVerticalPadding,"px ").concat(O.outerHorizontalPadding,"px")}},i.createElement("div",{style:ot},t.discountPrice||t.price))))),!!B&&i.createElement("div",{style:nt}," ",i.createElement(s,{element:M})," ")))})),L.length>1&&i.createElement("div",{style:it},i.createElement("div",{className:"custom-prev-button",style:e(e({},lt),D?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){R&&(T(R.isEnd),I(R.isBeginning))}},i.createElement(g,null)),i.createElement("div",{className:"custom-next-button",style:e(e({},lt),F?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){R&&(T(R.isEnd),I(R.isBeginning))}},i.createElement(f,null)))))}));export{h as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as r}from"../../helpers/index.js";var n=t((function(t){var n=t.element,i=n.socialMediaLinks.filter((function(e){return!!e.link})).sort((function(e,t){return e.order-t.order}));if(!i.length&&t.editModeChildren&&t.popup.isPreviewMode)return t.editModeChildren;var o={display:"flex",alignItems:"center",justifyContent:r(n.horizontalAlignment),padding:"".concat(n.verticalPadding,"px ").concat(n.horizontalPadding,"px"),backgroundColor:n.bgColor,width:"100%"},a={display:"flex",alignItems:"center",gap:"".concat(n.gapBetweenLogos,"px")};return e.createElement("div",{style:o},e.createElement("div",{style:a},i.map((function(t,r){return e.createElement("a",{href:t.link||"",key:r,target:"_blank"},e.createElement("img",{src:t.iconUrlWithoutHash||"",width:24,height:24}))}))))}));export{n as default};
@@ -0,0 +1 @@
1
+ import t from"react";import{observer as e}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';var o=e((function(e){var o=e.element,r={backgroundColor:o.bgColor,padding:"".concat(o.verticalPadding,"px ").concat(o.horizontalPadding,"px"),height:o.height,width:"100%"};return t.createElement("div",{style:r})}));export{o as default};
@@ -0,0 +1 @@
1
+ import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import o from"react";import{observer as e}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{injectFontScript as r}from"../../helpers/index.js";var n=e((function(e){var n=e.element,a=n,i={border:"".concat(a.borderWidth,"px ").concat(a.borderStyle," ").concat(a.borderColor),borderRadius:a.borderRadius,padding:"".concat(a.outerVerticalPadding,"px ").concat(a.outerHorizontalPadding,"px")},d={color:a.color,fontSize:a.fontSize,fontWeight:a.fontWeight,fontFamily:r(a.fontFamily),textAlign:a.horizontalAlignment,padding:"".concat(a.verticalPadding,"px ").concat(a.horizontalPadding,"px"),backgroundColor:a.bgColor};return o.createElement("div",{style:i},o.createElement("div",{dangerouslySetInnerHTML:{__html:n.text},style:t({},d)}))}));export{n as default};
@@ -1 +1 @@
1
- import{__assign as e}from'./../ext/tslib/tslib.es6.js';import{renderComponent as t}from"../components/page/index.js";import{IkasAttributeList as i}from"../models/ui/product-attribute-list/index.js";import{IkasBlogCategory as a}from"../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{IkasBlog as r}from"../models/data/blog/index.js";import{IkasBrand as o}from"../models/data/brand/index.js";import{IkasThemeJsonPageType as n,initIkasCategory as s,IkasThemeJsonComponentPropType as u,IkasProductAttributeType as l}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{IkasCategory as d}from"../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{IkasImage as p}from"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as c}from"../models/data/product/index.js";import{IkasRaffle as m}from"../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{IkasThemeJsonPageComponent as f}from"../models/data/theme-json/page/component/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{IkasBlogList as g}from"../models/ui/blog-list/index.js";import{IkasBlogCategoryList as V}from"../models/ui/blog-category-list/index.js";import{IkasBrandList as P}from"../models/ui/brand-list/index.js";import{IkasCategoryList as v}from"../models/ui/category-list/index.js";import{IkasNavigationLink as D}from"../models/ui/navigation-link/index.js";import{IkasProductList as j}from"../models/ui/product-list/index.js";import{IkasAttributeDetail as L}from"../models/ui/product-attribute-detail/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{IkasComponentRenderer as h}from"../models/ui/component-renderer/index.js";import{IkasRaffleList as T}from"../models/ui/raffle-list/index.js";import{IkasPageComponentPropValue as C,getPlaceholderBrand as x,getPlaceholderCategory as I,getPlaceholderProduct as S,getPlaceholderBlog as b,getPlaceholderBlogCategory as E,getPlaceholderRaffle as A,ProductDataBindingFields as O,ProductVariantDataBindingFields as y,CategoryDataBindingFields as w,BrandDataBindingFields as R}from"@ikas/storefront-providers";import _ from"lodash/flatten";import{IkasBaseStore as B}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import{IkasProductVariantFunctions as k}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as G}from"@ikas/storefront-config";import N from"react";var U=function(){function U(){}return U.setPageSpecificData=function(t,i,u){var l;if(this.pageType=i,this.isBrowser=u,t)switch(i){case n.PRODUCT:var p=t;U.pageSpecificData=new c(e(e({},p),{selectedVariantValues:p.selectedVariantValues||(null===(l=p.variants.find((function(e){return k.hasStock(e)})))||void 0===l?void 0:l.variantValues)||p.variants[0].variantValues})),u&&this._initProductOnBrowser(U.pageSpecificData);break;case n.CATEGORY:var f=t;s(f,G.getCurrentLocale()),U.pageSpecificData=new d(f);break;case n.BRAND:var g=t;U.pageSpecificData=new o(g);break;case n.BLOG:var V=t;U.pageSpecificData=new r(V);break;case n.BLOG_CATEGORY:var P=t;U.pageSpecificData=new a(P);break;case n.RAFFLE_DETAIL:var v=t;U.pageSpecificData=new m(v)}else this.pageSpecificData=void 0},U.isServer=function(){return"undefined"==typeof window},U.initPagePropValues=function(e,t,i,a,r){return this.flatCustomDataList=_(i.map((function(e){return e.flat}))),e.map((function(e){return U.initPageComponentPropValue(e,t,a,r)}))},U.initPageComponentPropValue=function(t,i,a,r){var o=i.find((function(e){return e.id===t.pageComponent.componentId})),n=null==o?void 0:o.props,s={};return null==n||n.map((function(e){var i=t.propValues[e.name];s[e.name]=U.initPropValue(e,i,a,r)})),new C(e(e({},t),{pageComponent:new f(e(e({},t.pageComponent),{propValues:s,componentId:o.id})),component:o,propValues:s}))},U.initPropValue=function(e,t,i,a){if(null==t)return null;switch(e.type){case u.TEXT:return U.initTextPropValue(t);case u.IMAGE:return U.initImagePropValue(t);case u.IMAGE_LIST:return U.initImageListPropValue(t);case u.BRAND:return U.initBrandPropValue(t);case u.BRAND_LIST:return U.initBrandListPropValue(t);case u.CATEGORY:return U.initCategoryPropValue(t);case u.CATEGORY_LIST:return U.initCategoryListPropValue(t);case u.PRODUCT_LIST:return U.initProductListPropValue(t);case u.PRODUCT_DETAIL:return U.initProductPropValue(t);case u.PRODUCT_ATTRIBUTE:return U.initAttributePropValue(t);case u.PRODUCT_ATTRIBUTE_LIST:return U.initAttributeListPropValue(t);case u.LINK:case u.LIST_OF_LINK:return U.initLinkPropValue(t);case u.COMPONENT:return U.initComponentPropValue(t,i,a);case u.COMPONENT_LIST:return U.initComponentListPropValue(t,i,a);case u.CUSTOM:return U.initCustomDataPropValue(t,i,a);case u.BLOG:return U.initBlogPropValue(t);case u.BLOG_LIST:return U.initBlogListPropValue(t);case u.BLOG_CATEGORY:return U.initBlogCategoryPropValue(t);case u.BLOG_LIST:return U.initBlogCategoryListPropValue(t);case u.RAFFLE:return U.initRafflePropValue(t);case u.RAFFLE_LIST:return U.initRaffleListPropValue(t);case u.SLIDER:return U.initSliderPropValue(t);case u.VIDEO:return U.initVideoPropValue(t);default:return t}},U.initTextPropValue=function(e){var t=this;function i(e){for(var t,i=/{{(.*?)}}|([^{}]+)/g,a=[];null!==(t=i.exec(e));)t[1]?a.push({value:t[1],isVariable:!0}):t[2]&&a.push({value:t[2],isVariable:!1});return a}return i(e).filter((function(e){return e.isVariable})).length?N.createElement("div",null,function(){for(var a,r,o,s,u=i(e),d=u.filter((function(e){return e.isVariable})),p={},c=B.getInstance().currentPageType,m=function(e){var i=e.value;if(c===n.PRODUCT){var u=t.pageSpecificData;if(i.includes(O.ATTRIBUTE_VALUE)){var d=i.split(O.ATTRIBUTE_VALUE)[1].split("_")[1],m=u.groupedAttributeValues.find((function(e){return e.attribute.id===d})),f=u.selectedVariant.groupedAttributeValues.find((function(e){return e.attribute.id===d}))||m;f?f.attribute.type===l.CHOICE?p[i]=(null===(a=f.values[0].productAttributeOption)||void 0===a?void 0:a.name)||"":f.attribute.type===l.MULTIPLE_CHOICE?p[i]=f.values.map((function(e){var t;return null===(t=e.productAttributeOption)||void 0===t?void 0:t.name})).join(", ")||"":p[i]=f.values[0].value||"":p[i]=""}else i.includes(O.NAME)?p[i]=u.name:i.includes(O.DESCRIPTION)?p[i]=u.description:i.includes(O.SHORT_DESCRIPTION)?p[i]=u.shortDescription:i.includes(O.CATEGORY_NAME)?p[i]=(null===(r=u.categories[0])||void 0===r?void 0:r.name)||"":i.includes(O.TAG)?p[i]=(null===(o=u.tags)||void 0===o?void 0:o.map((function(e){return e.name})).join(", "))||"":i.includes(y.BARCODE)?p[i]=(null===(s=u.selectedVariant.barcodeList)||void 0===s?void 0:s.length)?u.selectedVariant.barcodeList[0]:"":i.includes(y.SKU)?p[i]=u.selectedVariant.sku:i.includes(y.SELL_PRICE)?p[i]=u.selectedVariant.formattedSellPrice:i.includes(y.DISCOUNT_PRICE)?p[i]=u.selectedVariant.formattedDiscountPrice:i.includes(y.STOCK)?p[i]=u.selectedVariant.stock:p[i]=""}else if(c===n.CATEGORY){var g=t.pageSpecificData;i===w.NAME?p[i]=g.name:i===w.DESCRIPTION?p[i]=g.description:p[i]=""}else if(c===n.BRAND){var V=t.pageSpecificData;i===R.NAME?p[i]=V.name:p[i]=""}else p[i]=""},f=0,g=d;f<g.length;f++){m(g[f])}for(var V="",P=0,v=u;P<v.length;P++){var D=v[P];D.isVariable?V+=p[D.value]:V+=D.value}return V}()):e},U.initBrandPropValue=function(e){return e.brandPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.brand?new o(e.brand):x()},U.initBrandListPropValue=function(e){return new P(e)},U.initCategoryPropValue=function(t){var i,a;return t.categoryPropValue.usePageData&&this.pageSpecificData?((null===(i=t.categoryPropValue.excludedFieldsCategory)||void 0===i?void 0:i.length)&&(this.pageSpecificData.description=null),this.pageSpecificData):t.category?new d(e(e({},t.category),{description:(null===(a=t.categoryPropValue.excludedFieldsCategory)||void 0===a?void 0:a.length)?null:t.category.description})):I()},U.initCategoryListPropValue=function(e){return new v(e)},U.initProductListPropValue=function(t){return new j(e(e({},t),{pageSpecificData:this.pageSpecificData}),B.getInstance().router)},U.initProductPropValue=function(t){var i=new c(S());if(t.productDetailPropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(t.productDetail){var a=t.productDetail;i=new c(e(e({},a),{selectedVariantValues:a.selectedVariantValues}))}return i},U._initProductOnBrowser=function(e){var t=new URLSearchParams(window.location.search),i=t.get("vid");if(i){var a=e.variants.find((function(e){return e.id===i}));a&&(e.selectedVariantValues=a.variantValues)}else{var r=e.variantTypes.map((function(e){return e.variantType.slug})),o=[];r.forEach((function(i,a){var r=e.variantTypes[a],n=t.get(i);if(n){var s=r.variantType.values.find((function(e){return e.slug===n}));s&&o.push(s)}})),o.length===e.selectedVariantValues.length&&(e.selectedVariantValues=o)}},U.initAttributePropValue=function(t){var i=null;if(t.attributePropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(t.productDetail){var a=t.productDetail;i=new c(e(e({},a),{selectedVariantValues:a.selectedVariantValues}))}return new L(i,t.attributePropValue)},U.initAttributeListPropValue=function(t){var a=null;if(t.attributeListPropValue.usePageData&&this.pageSpecificData)a=this.pageSpecificData;else if(t.productDetail){var r=t.productDetail;a=new c(e(e({},r),{selectedVariantValues:r.selectedVariantValues}))}return new i(a,t.attributeListPropValue)},U.initLinkPropValue=function(e){return Array.isArray(e)?e.map((function(e){return new D(e.href,e.label,e.subLinks,e.isExternal||void 0)})):e?new D(e.href,e.label,e.subLinks,e.isExternal||void 0):void 0},U.initImagePropValue=function(e){return new p(e)},U.initImageListPropValue=function(e){return e.map((function(e){return new p(e)}))},U.initCustomDataPropValue=function(e,t,i){if(e&&e.value&&e.customDataId){var a=this.flatCustomDataList.find((function(t){return t.id===e.customDataId}));if(a)return this._initCustomDataPropValue(e,a,t,i)}},U._initCustomDataPropValue=function(e,t,i,a){var r=this;if(!e)return null;var o=e.value;if(null==o)return null;switch(t.type){case u.TEXT:return this.initTextPropValue(o);case u.BRAND:return this.initBrandPropValue(o);case u.BRAND_LIST:return this.initBrandListPropValue(o);case u.CATEGORY_LIST:return this.initCategoryListPropValue(o);case u.CATEGORY:return this.initCategoryPropValue(o);case u.IMAGE_LIST:return this.initImageListPropValue(o);case u.IMAGE:return this.initImagePropValue(o);case u.LINK:return this.initLinkPropValue(o);case u.PRODUCT_DETAIL:return this.initProductPropValue(o);case u.PRODUCT_LIST:return this.initProductListPropValue(o);case u.PRODUCT_ATTRIBUTE:return this.initAttributePropValue(o);case u.PRODUCT_ATTRIBUTE_LIST:return this.initAttributeListPropValue(o);case u.BLOG:return this.initBlogPropValue(o);case u.BLOG_LIST:return this.initBlogListPropValue(o);case u.BLOG_CATEGORY:return this.initBlogCategoryPropValue(o);case u.BLOG_CATEGORY_LIST:return this.initBlogCategoryListPropValue(o);case u.RAFFLE:return this.initRafflePropValue(o);case u.RAFFLE_LIST:return this.initRaffleListPropValue(o);case u.SLIDER:return this.initSliderPropValue(o);case u.VIDEO:return U.initVideoPropValue(o);case u.OBJECT:for(var n={},s=function(e){var t=o[e.key],r=void 0;e.customDataId&&(r=l.flatCustomDataList.find((function(e){return e.id===t.customDataId}))),n[e.key]=l._initCustomDataPropValue(t,r||e,i,a)},l=this,d=0,p=t.nestedData||[];d<p.length;d++){s(p[d])}return n;case u.DYNAMIC_LIST:case u.STATIC_LIST:try{if(!o||!o.length)return null;var c=[],m=t.nestedData[0];return o.forEach((function(e){var t;m.customDataId&&(t=r.flatCustomDataList.find((function(t){return t.id===e.customDataId}))),c.push(r._initCustomDataPropValue(e,t||m,i,a))})),c}catch(e){return[]}case u.COMPONENT:return this.initComponentPropValue(o,i,a);case u.COMPONENT_LIST:return this.initComponentListPropValue(o,i,a);default:return o}},U.initComponentPropValue=function(e,t,i){return this._initComponentPropValue(e,t,i)},U._initComponentPropValue=function(e,i,a){var r=e.length?e[0]:void 0;if(r){var o=new C(r),n=U.initPageComponentPropValue(o,[o.component],i,a);if(n)return new h((function(){return t(n,i,-10)}))}},U.initComponentListPropValue=function(e,t,i){return this._initComponentListPropValue(e,t,i)},U._initComponentListPropValue=function(e,i,a){return e&&e.length?e.map((function(e){var r=new C(e),o=U.initPageComponentPropValue(r,[r.component],i,a);return new h((function(){return t(o,i,-1)}))})):[]},U.initBlogPropValue=function(e){return e.blogPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.blog?new r(e.blog):b()},U.initBlogListPropValue=function(e){return new g(e)},U.initBlogCategoryPropValue=function(e){return e.blogCategoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.blogCategory?new a(e.blogCategory):E()},U.initBlogCategoryListPropValue=function(e){return new V(e)},U.initRafflePropValue=function(e){return e.rafflePropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.raffle?new m(e.raffle):new m(A())},U.initRaffleListPropValue=function(e){return new T(e)},U.initSliderPropValue=function(e){return e},U.initVideoPropValue=function(t){return e(e({},t),{thumbnailImage:t.thumbnailImage?new p(t.thumbnailImage):null})},U.pageSpecificData={},U.flatCustomDataList=[],U.isBrowser=!1,U}();export{U as IkasPageDataInit};
1
+ import{__assign as e}from'./../ext/tslib/tslib.es6.js';import{renderComponent as t}from"../components/page/index.js";import{IkasAttributeList as i}from"../models/ui/product-attribute-list/index.js";import{IkasBlogCategory as a}from"../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{IkasBlog as r}from"../models/data/blog/index.js";import{IkasBrand as o}from"../models/data/brand/index.js";import{IkasThemeJsonPageType as n,initIkasCategory as s,IkasThemeJsonComponentPropType as u,IkasProductAttributeType as l}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{IkasCategory as d}from"../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{IkasImage as p}from"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import{IkasProduct as c}from"../models/data/product/index.js";import{IkasRaffle as m}from"../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{IkasThemeJsonPageComponent as f}from"../models/data/theme-json/page/component/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{IkasBlogList as g}from"../models/ui/blog-list/index.js";import{IkasBlogCategoryList as V}from"../models/ui/blog-category-list/index.js";import{IkasBrandList as P}from"../models/ui/brand-list/index.js";import{IkasCategoryList as v}from"../models/ui/category-list/index.js";import{IkasNavigationLink as D}from"../models/ui/navigation-link/index.js";import{IkasProductList as j}from"../models/ui/product-list/index.js";import{IkasAttributeDetail as L}from"../models/ui/product-attribute-detail/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{IkasComponentRenderer as h}from"../models/ui/component-renderer/index.js";import{IkasRaffleList as T}from"../models/ui/raffle-list/index.js";import{IkasPageComponentPropValue as x,getPlaceholderBrand as C,getPlaceholderCategory as I,getPlaceholderProduct as S,getPlaceholderBlog as b,getPlaceholderBlogCategory as E,getPlaceholderRaffle as O,ProductDataBindingFields as A,ProductVariantDataBindingFields as w,CategoryDataBindingFields as y,BrandDataBindingFields as R}from"@ikas/storefront-providers";import _ from"lodash/flatten";import{IkasBaseStore as B}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import{IkasProductVariantFunctions as k}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as G}from"@ikas/storefront-config";import N from"react";var U=function(){function U(){}return U.setPageSpecificData=function(t,i,u){var l;if(this.pageType=i,this.isBrowser=u,t)switch(i){case n.PRODUCT:var p=t;U.pageSpecificData=new c(e(e({},p),{selectedVariantValues:p.selectedVariantValues||(null===(l=p.variants.find((function(e){return k.hasStock(e)})))||void 0===l?void 0:l.variantValues)||p.variants[0].variantValues})),u&&this._initProductOnBrowser(U.pageSpecificData);break;case n.CATEGORY:var f=t;s(f,G.getCurrentLocale()),U.pageSpecificData=new d(f);break;case n.BRAND:var g=t;U.pageSpecificData=new o(g);break;case n.BLOG:var V=t;U.pageSpecificData=new r(V);break;case n.BLOG_CATEGORY:var P=t;U.pageSpecificData=new a(P);break;case n.RAFFLE_DETAIL:var v=t;U.pageSpecificData=new m(v)}else this.pageSpecificData=void 0},U.isServer=function(){return"undefined"==typeof window},U.initPagePropValues=function(e,t,i,a,r){return this.flatCustomDataList=_(i.map((function(e){return e.flat}))),e.map((function(e){return U.initPageComponentPropValue(e,t,a,r)}))},U.initPageComponentPropValue=function(t,i,a,r){var o=i.find((function(e){return e.id===t.pageComponent.componentId})),n=null==o?void 0:o.props,s={};return null==n||n.map((function(e){var i=t.propValues[e.name];s[e.name]=U.initPropValue(e,i,a,r)})),new x(e(e({},t),{pageComponent:new f(e(e({},t.pageComponent),{propValues:s,componentId:o.id})),component:o,propValues:s}))},U.initPropValue=function(e,t,i,a){if(null==t)return null;switch(e.type){case u.TEXT:return U.initTextPropValue(t);case u.IMAGE:return U.initImagePropValue(t);case u.IMAGE_LIST:return U.initImageListPropValue(t);case u.BRAND:return U.initBrandPropValue(t);case u.BRAND_LIST:return U.initBrandListPropValue(t);case u.CATEGORY:return U.initCategoryPropValue(t);case u.CATEGORY_LIST:return U.initCategoryListPropValue(t);case u.PRODUCT_LIST:return U.initProductListPropValue(t);case u.PRODUCT_DETAIL:return U.initProductPropValue(t);case u.PRODUCT_ATTRIBUTE:return U.initAttributePropValue(t);case u.PRODUCT_ATTRIBUTE_LIST:return U.initAttributeListPropValue(t);case u.LINK:case u.LIST_OF_LINK:return U.initLinkPropValue(t);case u.COMPONENT:return U.initComponentPropValue(t,i,a);case u.COMPONENT_LIST:return U.initComponentListPropValue(t,i,a);case u.CUSTOM:return U.initCustomDataPropValue(t,i,a);case u.BLOG:return U.initBlogPropValue(t);case u.BLOG_LIST:return U.initBlogListPropValue(t);case u.BLOG_CATEGORY:return U.initBlogCategoryPropValue(t);case u.BLOG_LIST:return U.initBlogCategoryListPropValue(t);case u.RAFFLE:return U.initRafflePropValue(t);case u.RAFFLE_LIST:return U.initRaffleListPropValue(t);case u.SLIDER:return U.initSliderPropValue(t);case u.VIDEO:return U.initVideoPropValue(t);default:return t}},U.initTextPropValue=function(e){var t=this;function i(e){for(var t,i=/{{(.*?)}}|([^{}]+)/g,a=[];null!==(t=i.exec(e));)t[1]?a.push({value:t[1],isVariable:!0}):t[2]&&a.push({value:t[2],isVariable:!1});return a}return i(e).filter((function(e){return e.isVariable})).length?N.createElement("div",null,function(){for(var a,r,o,s,u=i(e),d=u.filter((function(e){return e.isVariable})),p={},c=B.getInstance().currentPageType,m=function(e){var i=e.value;if(c===n.PRODUCT){var u=t.pageSpecificData;if(i.includes(A.ATTRIBUTE_VALUE)){var d=i.split(A.ATTRIBUTE_VALUE)[1].split("_")[1],m=u.groupedAttributeValues.find((function(e){return e.attribute.id===d})),f=u.selectedVariant.groupedAttributeValues.find((function(e){return e.attribute.id===d}))||m;f?f.attribute.type===l.CHOICE?p[i]=(null===(a=f.values[0].productAttributeOption)||void 0===a?void 0:a.name)||"":f.attribute.type===l.MULTIPLE_CHOICE?p[i]=f.values.map((function(e){var t;return null===(t=e.productAttributeOption)||void 0===t?void 0:t.name})).join(", ")||"":p[i]=f.values[0].value||"":p[i]=""}else i.includes(A.NAME)?p[i]=u.name:i.includes(A.DESCRIPTION)?p[i]=u.description:i.includes(A.SHORT_DESCRIPTION)?p[i]=u.shortDescription:i.includes(A.CATEGORY_NAME)?p[i]=(null===(r=u.categories[0])||void 0===r?void 0:r.name)||"":i.includes(A.TAG)?p[i]=(null===(o=u.tags)||void 0===o?void 0:o.map((function(e){return e.name})).join(", "))||"":i.includes(w.BARCODE)?p[i]=(null===(s=u.selectedVariant.barcodeList)||void 0===s?void 0:s.length)?u.selectedVariant.barcodeList[0]:"":i.includes(w.SKU)?p[i]=u.selectedVariant.sku:i.includes(w.SELL_PRICE)?p[i]=u.selectedVariant.formattedSellPrice:i.includes(w.DISCOUNT_PRICE)?p[i]=u.selectedVariant.formattedDiscountPrice:i.includes(w.STOCK)?p[i]=u.selectedVariant.stock:p[i]=""}else if(c===n.CATEGORY){var g=t.pageSpecificData;i===y.NAME?p[i]=g.name:i===y.DESCRIPTION?p[i]=g.description:p[i]=""}else if(c===n.BRAND){var V=t.pageSpecificData;i===R.NAME?p[i]=V.name:p[i]=""}else p[i]=""},f=0,g=d;f<g.length;f++){m(g[f])}for(var V="",P=0,v=u;P<v.length;P++){var D=v[P];D.isVariable?V+=p[D.value]:V+=D.value}return V}()):e},U.initBrandPropValue=function(e){return e.brandPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.brand?new o(e.brand):C()},U.initBrandListPropValue=function(e){return new P(e)},U.initCategoryPropValue=function(t){var i,a;return t.categoryPropValue.usePageData&&this.pageSpecificData?((null===(i=t.categoryPropValue.excludedFieldsCategory)||void 0===i?void 0:i.length)&&(this.pageSpecificData.description=null),this.pageSpecificData):t.category?new d(e(e({},t.category),{description:(null===(a=t.categoryPropValue.excludedFieldsCategory)||void 0===a?void 0:a.length)?null:t.category.description})):I()},U.initCategoryListPropValue=function(e){return new v(e)},U.initProductListPropValue=function(t){return new j(e(e({},t),{pageSpecificData:this.pageSpecificData}),B.getInstance().router)},U.initProductPropValue=function(t){var i=new c(S());if(t.productDetailPropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(t.productDetail){var a=t.productDetail;i=new c(e(e({},a),{selectedVariantValues:a.selectedVariantValues}))}return i},U._initProductOnBrowser=function(e){var t=new URLSearchParams(window.location.search),i=t.get("vid");if(i){var a=e.variants.find((function(e){return e.id===i}));a&&(e.selectedVariantValues=a.variantValues)}else{var r=e.variantTypes.map((function(e){return e.variantType.slug})),o=[];r.forEach((function(i,a){var r=e.variantTypes[a],n=t.get(i);if(n){var s=r.variantType.values.find((function(e){return e.slug===n}));s&&o.push(s)}})),o.length===e.selectedVariantValues.length&&(e.selectedVariantValues=o)}e.setOptionRealPrices()},U.initAttributePropValue=function(t){var i=null;if(t.attributePropValue.usePageData&&this.pageSpecificData)i=this.pageSpecificData;else if(t.productDetail){var a=t.productDetail;i=new c(e(e({},a),{selectedVariantValues:a.selectedVariantValues}))}return new L(i,t.attributePropValue)},U.initAttributeListPropValue=function(t){var a=null;if(t.attributeListPropValue.usePageData&&this.pageSpecificData)a=this.pageSpecificData;else if(t.productDetail){var r=t.productDetail;a=new c(e(e({},r),{selectedVariantValues:r.selectedVariantValues}))}return new i(a,t.attributeListPropValue)},U.initLinkPropValue=function(e){return Array.isArray(e)?e.map((function(e){return new D(e.href,e.label,e.subLinks,e.isExternal||void 0)})):e?new D(e.href,e.label,e.subLinks,e.isExternal||void 0):void 0},U.initImagePropValue=function(e){return new p(e)},U.initImageListPropValue=function(e){return e.map((function(e){return new p(e)}))},U.initCustomDataPropValue=function(e,t,i){if(e&&e.value&&e.customDataId){var a=this.flatCustomDataList.find((function(t){return t.id===e.customDataId}));if(a)return this._initCustomDataPropValue(e,a,t,i)}},U._initCustomDataPropValue=function(e,t,i,a){var r=this;if(!e)return null;var o=e.value;if(null==o)return null;switch(t.type){case u.TEXT:return this.initTextPropValue(o);case u.BRAND:return this.initBrandPropValue(o);case u.BRAND_LIST:return this.initBrandListPropValue(o);case u.CATEGORY_LIST:return this.initCategoryListPropValue(o);case u.CATEGORY:return this.initCategoryPropValue(o);case u.IMAGE_LIST:return this.initImageListPropValue(o);case u.IMAGE:return this.initImagePropValue(o);case u.LINK:return this.initLinkPropValue(o);case u.PRODUCT_DETAIL:return this.initProductPropValue(o);case u.PRODUCT_LIST:return this.initProductListPropValue(o);case u.PRODUCT_ATTRIBUTE:return this.initAttributePropValue(o);case u.PRODUCT_ATTRIBUTE_LIST:return this.initAttributeListPropValue(o);case u.BLOG:return this.initBlogPropValue(o);case u.BLOG_LIST:return this.initBlogListPropValue(o);case u.BLOG_CATEGORY:return this.initBlogCategoryPropValue(o);case u.BLOG_CATEGORY_LIST:return this.initBlogCategoryListPropValue(o);case u.RAFFLE:return this.initRafflePropValue(o);case u.RAFFLE_LIST:return this.initRaffleListPropValue(o);case u.SLIDER:return this.initSliderPropValue(o);case u.VIDEO:return U.initVideoPropValue(o);case u.OBJECT:for(var n={},s=function(e){var t=o[e.key],r=void 0;e.customDataId&&(r=l.flatCustomDataList.find((function(e){return e.id===t.customDataId}))),n[e.key]=l._initCustomDataPropValue(t,r||e,i,a)},l=this,d=0,p=t.nestedData||[];d<p.length;d++){s(p[d])}return n;case u.DYNAMIC_LIST:case u.STATIC_LIST:try{if(!o||!o.length)return null;var c=[],m=t.nestedData[0];return o.forEach((function(e){var t;m.customDataId&&(t=r.flatCustomDataList.find((function(t){return t.id===e.customDataId}))),c.push(r._initCustomDataPropValue(e,t||m,i,a))})),c}catch(e){return[]}case u.COMPONENT:return this.initComponentPropValue(o,i,a);case u.COMPONENT_LIST:return this.initComponentListPropValue(o,i,a);default:return o}},U.initComponentPropValue=function(e,t,i){return this._initComponentPropValue(e,t,i)},U._initComponentPropValue=function(e,i,a){var r=e.length?e[0]:void 0;if(r){var o=new x(r),n=U.initPageComponentPropValue(o,[o.component],i,a);if(n)return new h((function(){return t(n,i,-10)}))}},U.initComponentListPropValue=function(e,t,i){return this._initComponentListPropValue(e,t,i)},U._initComponentListPropValue=function(e,i,a){return e&&e.length?e.map((function(e){var r=new x(e),o=U.initPageComponentPropValue(r,[r.component],i,a);return new h((function(){return t(o,i,-1)}))})):[]},U.initBlogPropValue=function(e){return e.blogPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.blog?new r(e.blog):b()},U.initBlogListPropValue=function(e){return new g(e)},U.initBlogCategoryPropValue=function(e){return e.blogCategoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.blogCategory?new a(e.blogCategory):E()},U.initBlogCategoryListPropValue=function(e){return new V(e)},U.initRafflePropValue=function(e){return e.rafflePropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.raffle?new m(e.raffle):new m(O())},U.initRaffleListPropValue=function(e){return new T(e)},U.initSliderPropValue=function(e){return e},U.initVideoPropValue=function(t){return e(e({},t),{thumbnailImage:t.thumbnailImage?new p(t.thumbnailImage):null})},U.pageSpecificData={},U.flatCustomDataList=[],U.isBrowser=!1,U}();export{U as IkasPageDataInit};
@@ -1 +1 @@
1
- import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as s from"react";import{observer as i}from"mobx-react-lite";import d from"../components/checkout/index.js";import{useRouter as n}from"next/router.js";import{FullscreenLoading as m}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutStep as a}from"../components/checkout/model.js";import{setAPIClientConfig as l,getCartById as c}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as u}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as j}from"../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/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"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import{IkasBaseStore as f}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as g}from"../analytics/events.js";import{APIErrorCode as x}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import y from"../store/checkout/index.js";var v=i((function(i){var v=i.customizationProps,h=i.configJson,b=o(i,["customizationProps","configJson"]),k=n(),E=s.useState(),C=E[0],F=E[1],P=s.useState(b.checkoutSettings),w=P[0],_=P[1];p.init(h),l(),s.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(v)}),[v]),s.useEffect((function(){f.getInstance().checkLocalization(),B(),g()}),[]);var B=s.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,s,i,d,n,m;return t(this,(function(t){switch(t.label){case 0:return o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),e?(s=!1,r&&r===a.SUCCESS&&(s=!0),[4,c({id:e,getCompletedCart:s})]):[2,k.replace("/")];case 1:return i=t.sent(),w?[3,3]:[4,y.listCheckoutSettings({})];case 2:(d=t.sent()).isSuccess&&(null===(m=d.data)||void 0===m?void 0:m.length)?_(d.data[0]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(d),console.error(d.graphQLErrors),console.error(d.errorCodes)),t.label=3;case 3:return i.isSuccess&&i.data?(n=i.data,F(new j(n)),f.getInstance().cartStore.setCart(new u(n))):i.errorCodes.some((function(o){return o===x.LOGIN_REQUIRED}))?k.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):k.replace("/"),[2]}}))}))}),[]);return C&&w?s.createElement(d,r({checkout:C,customizationProps:v},b,{checkoutSettings:w})):s.createElement(m,null)}));export{v as default};
1
+ import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as s from"react";import{observer as i}from"mobx-react-lite";import d from"../components/checkout/index.js";import{useRouter as n}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutStep as m}from"../components/checkout/model.js";import{setAPIClientConfig as l,getCartById as c}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as u}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as j}from"../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"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import{IkasBaseStore as f}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as g}from"../analytics/events.js";import{APIErrorCode as x}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import y from"../store/checkout/index.js";var v=i((function(i){var v=i.customizationProps,h=i.configJson,b=o(i,["customizationProps","configJson"]),k=n(),E=s.useState(),C=E[0],F=E[1],P=s.useState(b.checkoutSettings),w=P[0],_=P[1];p.init(h),l(),s.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(v)}),[v]),s.useEffect((function(){f.getInstance().checkLocalization(),B(),g()}),[]);var B=s.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,s,i,d,n,a;return t(this,(function(t){switch(t.label){case 0:return o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),e?(s=!1,r&&r===m.SUCCESS&&(s=!0),[4,c({id:e,getCompletedCart:s})]):[2,k.replace("/")];case 1:return i=t.sent(),w?[3,3]:[4,y.listCheckoutSettings({})];case 2:(d=t.sent()).isSuccess&&(null===(a=d.data)||void 0===a?void 0:a.length)?_(d.data[0]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(d),console.error(d.graphQLErrors),console.error(d.errorCodes)),t.label=3;case 3:return i.isSuccess&&i.data?(n=i.data,F(new j(n)),f.getInstance().cartStore.setCart(new u(n))):i.errorCodes.some((function(o){return o===x.LOGIN_REQUIRED}))?k.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):k.replace("/"),[2]}}))}))}),[]);return C&&w?s.createElement(d,r({checkout:C,customizationProps:v},b,{checkoutSettings:w})):s.createElement(a,null)}));export{v as default};