@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
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";var n=function(n){this.amount=n.amount||null,this.transactionId=n.transactionId||null,t(this)};export{n as IkasListOrderTransactionWithPricesRefundableTransaction};
@@ -0,0 +1,7 @@
1
+ import { IkasTransactionErrorWithPrices as ITransactionErrorWithPrices } from "@ikas/storefront-models";
2
+ export declare class IkasTransactionErrorWithPrices implements ITransactionErrorWithPrices {
3
+ code: string | null;
4
+ declineCode: string | null;
5
+ message: string | null;
6
+ constructor(data: ITransactionErrorWithPrices);
7
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as e}from"mobx";var o=function(o){this.code=o.code||null,this.declineCode=o.declineCode||null,this.message=o.message||null,e(this)};export{o as IkasTransactionErrorWithPrices};
@@ -0,0 +1,54 @@
1
+ import { IkasPaymentMethodTypeWithPrices, IkasTransactionSourceWithPrices, IkasTransactionStatusWithPrices, IkasTransactionTypeWithPrices, IkasTransactionWithPrices as ITransactionWithPrices } from "@ikas/storefront-models";
2
+ import { IkasTransactionErrorWithPrices } from "./error";
3
+ import { IkasTransactionCurrencyRateWithPrices } from "./transaction-currency-rate-with-prices";
4
+ import { IkasTransactionFeeWithPrices } from "./transaction-fee-with-prices";
5
+ import { IkasTransactionGiftPackageLineItemWithPrices } from "./transaction-gift-package-line-item-with-prices";
6
+ import { IkasTransactionOrderLineItemWithPrices } from "./transaction-order-line-item-with-prices";
7
+ import { IkasTransactionPaymentMethodDetailWithPrices } from "./transaction-payment-method-detail-with-prices";
8
+ import { IkasTransactionSalesChannelWithPrices } from "./transaction-sales-channel-with-prices";
9
+ import { IkasTransactionShippingLineItemWithPrices } from "./transaction-shipping-line-item-with-prices";
10
+ export declare class IkasTransactionWithPrices implements ITransactionWithPrices {
11
+ amount: number | null;
12
+ authCode: string | null;
13
+ checkoutId: string | null;
14
+ createdAt: any | null;
15
+ createdWithMasterPass: boolean | null;
16
+ currencyCode: string | null;
17
+ currencyRates: IkasTransactionCurrencyRateWithPrices[] | null;
18
+ currencySymbol: string | null;
19
+ customerId: string | null;
20
+ deleted: boolean;
21
+ error: IkasTransactionErrorWithPrices | null;
22
+ fees: IkasTransactionFeeWithPrices[] | null;
23
+ forceRefund: boolean | null;
24
+ gatewayReferenceId: string | null;
25
+ giftPackageLineItems: IkasTransactionGiftPackageLineItemWithPrices[] | null;
26
+ id: string | null;
27
+ ipAddress: string | null;
28
+ isAdditionalPayment: boolean | null;
29
+ isManuelAddedTransaction: boolean | null;
30
+ isTrackingInfoSent: boolean | null;
31
+ lineItems: IkasTransactionOrderLineItemWithPrices[] | null;
32
+ merchantId: string | null;
33
+ orderId: string | null;
34
+ orderNumber: string | null;
35
+ paymentGatewayCode: string | null;
36
+ paymentGatewayId: string | null;
37
+ paymentGatewayName: string | null;
38
+ paymentMethod: IkasPaymentMethodTypeWithPrices | null;
39
+ paymentMethodDetail: IkasTransactionPaymentMethodDetailWithPrices | null;
40
+ payoutAmount: number | null;
41
+ processedAt: any | null;
42
+ refundReason: string | null;
43
+ salesChannel: IkasTransactionSalesChannelWithPrices | null;
44
+ sessionToken: string | null;
45
+ shippingLineItems: IkasTransactionShippingLineItemWithPrices[] | null;
46
+ source: IkasTransactionSourceWithPrices | null;
47
+ sourceTransactionId: string | null;
48
+ status: IkasTransactionStatusWithPrices;
49
+ test: boolean | null;
50
+ type: IkasTransactionTypeWithPrices;
51
+ updatedAt: any | null;
52
+ useCustomTransactionVerification: boolean | null;
53
+ constructor(data: ITransactionWithPrices);
54
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as e}from"mobx";import{IkasTransactionErrorWithPrices as t}from"./error/index.js";import{IkasTransactionCurrencyRateWithPrices as n}from"./transaction-currency-rate-with-prices/index.js";import{IkasTransactionFeeWithPrices as i}from"./transaction-fee-with-prices/index.js";import{IkasTransactionGiftPackageLineItemWithPrices as s}from"./transaction-gift-package-line-item-with-prices/index.js";import{IkasTransactionOrderLineItemWithPrices as r}from"./transaction-order-line-item-with-prices/index.js";import{IkasTransactionPaymentMethodDetailWithPrices as a}from"./transaction-payment-method-detail-with-prices/index.js";import{IkasTransactionSalesChannelWithPrices as l}from"./transaction-sales-channel-with-prices/index.js";import{IkasTransactionShippingLineItemWithPrices as o}from"./transaction-shipping-line-item-with-prices/index.js";var u=function(u){this.amount=u.amount||null,this.authCode=u.authCode||null,this.checkoutId=u.checkoutId||null,this.createdAt=u.createdAt||null,this.createdWithMasterPass=u.createdWithMasterPass||null,this.currencyCode=u.currencyCode||null,this.currencyRates=u.currencyRates?u.currencyRates.map((function(e){return new n(e)})):null,this.currencySymbol=u.currencySymbol||null,this.customerId=u.customerId||null,this.deleted=u.deleted,this.error=u.error?new t(u.error):null,this.fees=u.fees?u.fees.map((function(e){return new i(e)})):[],this.forceRefund=u.forceRefund||null,this.gatewayReferenceId=u.gatewayReferenceId||null,this.giftPackageLineItems=u.giftPackageLineItems?u.giftPackageLineItems.map((function(e){return new s(e)})):[],this.id=u.id||null,this.ipAddress=u.ipAddress||null,this.isAdditionalPayment=u.isAdditionalPayment||null,this.isManuelAddedTransaction=u.isManuelAddedTransaction||null,this.isTrackingInfoSent=u.isTrackingInfoSent||null,this.lineItems=u.lineItems?u.lineItems.map((function(e){return new r(e)})):null,this.merchantId=u.merchantId||null,this.orderId=u.orderId||null,this.orderNumber=u.orderNumber||null,this.paymentGatewayCode=u.paymentGatewayCode||null,this.paymentGatewayId=u.paymentGatewayId||null,this.paymentGatewayName=u.paymentGatewayName||null,this.paymentMethod=u.paymentMethod||null,this.paymentMethodDetail=u.paymentMethodDetail?new a(u.paymentMethodDetail):null,this.payoutAmount=u.payoutAmount||null,this.processedAt=u.processedAt||null,this.refundReason=u.refundReason||null,this.salesChannel=u.salesChannel?new l(u.salesChannel):null,this.sessionToken=u.sessionToken||null,this.shippingLineItems=u.shippingLineItems?u.shippingLineItems.map((function(e){return new o(e)})):null,this.source=u.source||null,this.sourceTransactionId=u.sourceTransactionId||null,this.status=u.status,this.test=u.test||null,this.type=u.type,this.updatedAt=u.updatedAt||null,this.useCustomTransactionVerification=u.useCustomTransactionVerification||null,e(this)};export{u as IkasTransactionWithPrices};
@@ -0,0 +1,6 @@
1
+ import { IkasTransactionCurrencyRateWithPrices as ITransactionCurrencyRateWithPrices } from "@ikas/storefront-models";
2
+ export declare class IkasTransactionCurrencyRateWithPrices implements ITransactionCurrencyRateWithPrices {
3
+ amount: number | null;
4
+ transactionId: string | null;
5
+ constructor(data: ITransactionCurrencyRateWithPrices);
6
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";var n=function(n){this.amount=n.amount||null,this.transactionId=n.transactionId||null,t(this)};export{n as IkasTransactionCurrencyRateWithPrices};
@@ -0,0 +1,7 @@
1
+ import { IkasTransactionFeeSourceWithPrices, IkasTransactionFeeWithPrices as ITransactionFeeWithPrices } from "@ikas/storefront-models";
2
+ export declare class IkasTransactionFeeWithPrices implements ITransactionFeeWithPrices {
3
+ feeAmount: number | null;
4
+ isAddedAmount: boolean | null;
5
+ source: IkasTransactionFeeSourceWithPrices;
6
+ constructor(data: ITransactionFeeWithPrices);
7
+ }
@@ -0,0 +1 @@
1
+ import{IkasTransactionFeeSourceWithPrices as o}from"@ikas/storefront-models";import{makeAutoObservable as t}from"mobx";var e=function(e){this.feeAmount=e.feeAmount||null,this.isAddedAmount=e.isAddedAmount||null,this.source=e.source||o.GATEWAY,t(this)};export{e as IkasTransactionFeeWithPrices};
@@ -0,0 +1,7 @@
1
+ import { IkasTransactionGiftPackageLineItemWithPrices as ITransactionGiftPackageLineItemWithPrices } from "@ikas/storefront-models";
2
+ export declare class IkasTransactionGiftPackageLineItemWithPrices implements ITransactionGiftPackageLineItemWithPrices {
3
+ finalPrice: number | null;
4
+ isRefunded: boolean | null;
5
+ taxValue: number | null;
6
+ constructor(data: ITransactionGiftPackageLineItemWithPrices);
7
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as i}from"mobx";var l=function(l){this.finalPrice=l.finalPrice||null,this.isRefunded=l.isRefunded||null,this.taxValue=l.taxValue||null,i(this)};export{l as IkasTransactionGiftPackageLineItemWithPrices};
@@ -0,0 +1,11 @@
1
+ import { IkasTransactionOrderLineItemWithPrices as ITransactionOrderLineItemWithPrices } from "@ikas/storefront-models";
2
+ import { IkasTransactionOrderLineVariantWithPrices } from "./transaction-order-line-variant-with-prices";
3
+ export declare class IkasTransactionOrderLineItemWithPrices implements ITransactionOrderLineItemWithPrices {
4
+ finalPrice: number | null;
5
+ id: string | null;
6
+ price: number | null;
7
+ quantity: number;
8
+ taxValue: number | null;
9
+ variant: IkasTransactionOrderLineVariantWithPrices | null;
10
+ constructor(data: ITransactionOrderLineItemWithPrices);
11
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as i}from"mobx";import{IkasTransactionOrderLineVariantWithPrices as t}from"./transaction-order-line-variant-with-prices/index.js";var n=function(n){this.finalPrice=n.finalPrice||null,this.id=n.id||null,this.price=n.price||null,this.quantity=n.quantity,this.taxValue=n.taxValue||null,this.variant=n.variant?new t(n.variant):null,i(this)};export{n as IkasTransactionOrderLineItemWithPrices};
@@ -0,0 +1,11 @@
1
+ import { IkasTransactionOrderLineVariantWithPrices as ITransactionOrderLineVariantWithPrices } from "@ikas/storefront-models";
2
+ export declare class IkasTransactionOrderLineVariantWithPrices implements ITransactionOrderLineVariantWithPrices {
3
+ id: string | null;
4
+ mainImageId: string | null;
5
+ name: string | null;
6
+ productId: string | null;
7
+ sku: string | null;
8
+ slug: string | null;
9
+ type: string | null;
10
+ constructor(data: ITransactionOrderLineVariantWithPrices);
11
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as l}from"mobx";var t=function(t){this.id=t.id||null,this.mainImageId=t.mainImageId||null,this.name=t.name||null,this.productId=t.productId||null,this.sku=t.sku||null,this.slug=t.slug||null,this.type=t.type||null,l(this)};export{t as IkasTransactionOrderLineVariantWithPrices};
@@ -0,0 +1,14 @@
1
+ import { IkasTransactionCardAssociationWithPrices, IkasTransactionCardTypeWithPrices, IkasTransactionPaymentMethodDetailWithPrices as ITransactionPaymentMethodDetailWithPrices } from "@ikas/storefront-models";
2
+ import { IkasTransactionInstallmentPriceWithPrices } from "./transaction-installment-price-with-prices";
3
+ export declare class IkasTransactionPaymentMethodDetailWithPrices implements ITransactionPaymentMethodDetailWithPrices {
4
+ bankName: string | null;
5
+ binNumber: string | null;
6
+ cardAssociation: IkasTransactionCardAssociationWithPrices | null;
7
+ cardFamily: string | null;
8
+ cardType: IkasTransactionCardTypeWithPrices | null;
9
+ installment: IkasTransactionInstallmentPriceWithPrices | null;
10
+ lastFourDigits: string | null;
11
+ paymentMethodName: string | null;
12
+ threeDSecure: boolean | null;
13
+ constructor(data: ITransactionPaymentMethodDetailWithPrices);
14
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";import{IkasTransactionInstallmentPriceWithPrices as i}from"./transaction-installment-price-with-prices/index.js";var n=function(n){this.bankName=n.bankName||null,this.binNumber=n.binNumber||null,this.cardAssociation=n.cardAssociation||null,this.cardFamily=n.cardFamily||null,this.cardType=n.cardType||null,this.installment=n.installment?new i(n.installment):null,this.lastFourDigits=n.lastFourDigits||null,this.paymentMethodName=n.paymentMethodName||null,this.threeDSecure=n.threeDSecure||null,t(this)};export{n as IkasTransactionPaymentMethodDetailWithPrices};
@@ -0,0 +1,9 @@
1
+ import { IkasTransactionInstallmentPriceWithPrices as ITransactionInstallmentPriceWithPrices } from "@ikas/storefront-models";
2
+ export declare class IkasTransactionInstallmentPriceWithPrices implements ITransactionInstallmentPriceWithPrices {
3
+ installmentCount: number | null;
4
+ installmentPrice: number | null;
5
+ originalRate: number | null;
6
+ rate: number | null;
7
+ totalPrice: number | null;
8
+ constructor(data: ITransactionInstallmentPriceWithPrices);
9
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";var l=function(l){this.installmentCount=l.installmentCount||null,this.installmentPrice=l.installmentPrice||null,this.originalRate=l.originalRate||null,this.rate=l.rate||null,this.totalPrice=l.totalPrice||null,t(this)};export{l as IkasTransactionInstallmentPriceWithPrices};
@@ -0,0 +1,6 @@
1
+ import { IkasTransactionSalesChannelWithPrices as ITransactionSalesChannelWithPrices } from "@ikas/storefront-models";
2
+ export declare class IkasTransactionSalesChannelWithPrices implements ITransactionSalesChannelWithPrices {
3
+ id: string | null;
4
+ name: string | null;
5
+ constructor(data: ITransactionSalesChannelWithPrices);
6
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as i}from"mobx";var n=function(n){this.id=n.id||null,this.name=n.name||null,i(this)};export{n as IkasTransactionSalesChannelWithPrices};
@@ -0,0 +1,9 @@
1
+ import { IkasTransactionShippingLineItemWithPrices as ITransactionShippingLineItemWithPrices } from "@ikas/storefront-models";
2
+ export declare class IkasTransactionShippingLineItemWithPrices implements ITransactionShippingLineItemWithPrices {
3
+ finalPrice: number | null;
4
+ isRefunded: boolean | null;
5
+ taxValue: number | null;
6
+ title: string | null;
7
+ transactionId: string | null;
8
+ constructor(data: ITransactionShippingLineItemWithPrices);
9
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";var i=function(i){this.finalPrice=i.finalPrice||null,this.isRefunded=i.isRefunded||null,this.taxValue=i.taxValue||null,this.title=i.title||null,this.transactionId=i.transactionId||null,t(this)};export{i as IkasTransactionShippingLineItemWithPrices};
@@ -2,6 +2,7 @@ import { IkasImage } from "../../image";
2
2
  import { IkasProductAttribute } from "../attribute";
3
3
  import { IkasProductAttributeOption } from "../attribute/option";
4
4
  import { IkasProductAttributeValue as IProductAttributeValue, IkasAttributeTableCellValue as IAttributeTableCellValue, IkasProductAttributeMap as IProductAttributeMap } from "@ikas/storefront-models";
5
+ import { IkasProduct } from "..";
5
6
  export declare class IkasProductAttributeValue implements IProductAttributeValue {
6
7
  imageIds: string[] | null;
7
8
  productAttributeId: string | null;
@@ -10,10 +11,11 @@ export declare class IkasProductAttributeValue implements IProductAttributeValue
10
11
  images?: IkasImage[];
11
12
  productAttribute?: IkasProductAttribute | null;
12
13
  productAttributeOption?: IkasProductAttributeOption | null;
14
+ products?: IkasProduct[];
13
15
  constructor(data: IProductAttributeValue);
14
16
  get tableValue(): IAttributeTableCellValue[] | undefined;
15
17
  get productIds(): string[];
16
- getProducts(): Promise<import("..").IkasProduct[]>;
18
+ getProducts(): Promise<never[] | undefined>;
17
19
  }
18
20
  export declare class IkasAttributeTableCellValue implements IAttributeTableCellValue {
19
21
  colId: string;
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{IkasImage as e}from"../../image/index.js";import{IkasProductAttribute as i}from"../attribute/index.js";import{IkasProductAttributeOption as u}from"../attribute/option/index.js";import{IkasProductAttributeType as o}from"@ikas/storefront-models";import{makeAutoObservable as n}from"mobx";import{IkasProductAttributeValueFunctions as s}from"@ikas/storefront-model-functions";import d from"../../../../store/product/index.js";var l=function(){function l(t){var r;this.imageIds=null,this.productAttributeId=null,this.productAttributeOptionId=null,this.value=null,this.productAttribute=null,this.productAttributeOption=null,this.imageIds=t.imageIds,this.productAttributeId=t.productAttributeId,this.productAttributeOptionId=t.productAttributeOptionId,this.value=t.value||null,this.images=null===(r=t.images)||void 0===r?void 0:r.map((function(t){return new e(t)})),this.productAttribute=t.productAttribute?new i(t.productAttribute):null,this.productAttributeOption=t.productAttributeOption?new u(t.productAttributeOption):null,n(this)}return Object.defineProperty(l.prototype,"tableValue",{get:function(){return s.getTableValue(this.value)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"productIds",{get:function(){var t;if((null===(t=this.productAttribute)||void 0===t?void 0:t.type)!==o.PRODUCT||!this.value)return[];try{return JSON.parse(this.value)}catch(t){return console.error(t),[]}},enumerable:!1,configurable:!0}),l.prototype.getProducts=function(){var e,i;return t(this,void 0,void 0,(function(){var t,u;return r(this,(function(r){switch(r.label){case 0:if((null===(e=this.productAttribute)||void 0===e?void 0:e.type)!==o.PRODUCT||!this.value)return[2,[]];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,d.searchProducts({input:{productIdList:this.productIds}})];case 2:return t=r.sent(),[2,(null===(i=t.data)||void 0===i?void 0:i.data)||[]];case 3:return u=r.sent(),console.error(u),[2,[]];case 4:return[2]}}))}))},l}(),a=function(t){this.colId=t.colId,this.rowId=t.rowId,this.value=t.value},p=function(t){this.attribute=t.attribute,this.values=t.values.map((function(t){return new l(t)}))};export{a as IkasAttributeTableCellValue,p as IkasProductAttributeMap,l as IkasProductAttributeValue};
1
+ import{__awaiter as t,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{IkasImage as i}from"../../image/index.js";import{IkasProductAttribute as e}from"../attribute/index.js";import{IkasProductAttributeOption as o}from"../attribute/option/index.js";import{IkasProductAttributeType as u}from"@ikas/storefront-models";import{makeAutoObservable as n}from"mobx";import{IkasProductAttributeValueFunctions as s}from"@ikas/storefront-model-functions";import d from"../../../../store/product/index.js";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";var l=function(){function l(t){var r;this.imageIds=null,this.productAttributeId=null,this.productAttributeOptionId=null,this.value=null,this.productAttribute=null,this.productAttributeOption=null,this.products=[],this.imageIds=t.imageIds,this.productAttributeId=t.productAttributeId,this.productAttributeOptionId=t.productAttributeOptionId,this.value=t.value||null,this.images=null===(r=t.images)||void 0===r?void 0:r.map((function(t){return new i(t)})),this.productAttribute=t.productAttribute?new e(t.productAttribute):null,this.productAttributeOption=t.productAttributeOption?new o(t.productAttributeOption):null,this.getProducts(),n(this)}return Object.defineProperty(l.prototype,"tableValue",{get:function(){return s.getTableValue(this.value)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"productIds",{get:function(){var t;if((null===(t=this.productAttribute)||void 0===t?void 0:t.type)!==u.PRODUCT||!this.value)return[];try{return JSON.parse(this.value)}catch(t){return console.error(t),[]}},enumerable:!1,configurable:!0}),l.prototype.getProducts=function(){var i,e,o,n;return t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:if((null===(i=this.productAttribute)||void 0===i?void 0:i.type)!==u.PRODUCT||!this.value)return[2,[]];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,d.searchProducts({input:{productIdList:this.productIds,priceListId:a.getPriceListId(),salesChannelId:a.getSalesChannelId()}})];case 2:return t=r.sent(),null===(o=null===(e=t.data)||void 0===e?void 0:e.data)||void 0===o||o.forEach((function(t){t.selectedVariantValues=t.variants[0].variantValues})),this.products=(null===(n=t.data)||void 0===n?void 0:n.data)||[],[3,4];case 3:return r.sent(),[2,[]];case 4:return[2]}}))}))},l}(),c=function(t){this.colId=t.colId,this.rowId=t.rowId,this.value=t.value},p=function(t){this.attribute=t.attribute,this.values=t.values.map((function(t){return new l(t)}))};export{c as IkasAttributeTableCellValue,p as IkasProductAttributeMap,l as IkasProductAttributeValue};
@@ -1,21 +1,19 @@
1
1
  import { IkasCategory } from "../category";
2
2
  import { IkasProductVariant } from "./variant";
3
- import { IkasProductAttributeValue } from "./attribute-value";
3
+ import { IkasProductAttributeMap, IkasProductAttributeValue } from "./attribute-value";
4
4
  import { IkasProductVariantType } from "./variant-type";
5
5
  import { IkasBrand } from "../brand";
6
6
  import { IkasHTMLMetaData } from "../html-meta-data";
7
7
  import { IkasProductTag } from "./tag";
8
- import { IkasProduct as IProduct, IkasAppliedCampaignOffer, IkasProductType } from "@ikas/storefront-models";
8
+ import { IkasAppliedCampaignOffer, IkasProduct as IProduct, IkasProductType } from "@ikas/storefront-models";
9
9
  import { IkasProductOptionSet } from "./option-set";
10
10
  import { IkasVariantValue } from "../variant-type/variant-value";
11
11
  import { IkasProductCampaign } from "./campaign";
12
12
  import { IkasVariantType } from "../variant-type";
13
- import { IkasProductAttributeMap } from "./attribute-value";
14
13
  import { IkasProductBaseUnit } from "./base-unit";
15
14
  import { IkasCustomerReviewList } from "../../ui/customer-review-list";
16
15
  import { IkasProductStar } from "./star";
17
- import { IkasProductCampaignOffer } from "./campaign-offer";
18
- import { IkasProductOffer } from "./campaign-offer";
16
+ import { IkasProductCampaignOffer, IkasProductOffer } from "./campaign-offer";
19
17
  import { IkasProductGroup } from "./group";
20
18
  import { IkasProductGroupValue } from "./group/value";
21
19
  import { IkasProductGroupOrder } from "./group/order";
@@ -86,6 +84,7 @@ export declare class IkasProduct implements IProduct {
86
84
  initBundleProducts: () => Promise<void>;
87
85
  setShowVariantsInGroup: (value: boolean) => void;
88
86
  getBundleProductsOfVariant: (variant: IkasProductVariant) => Promise<void>;
87
+ setOptionRealPrices: () => void;
89
88
  private setOptionPrices;
90
89
  }
91
90
  export { IkasProductType };
@@ -1 +1 @@
1
- import{__spreadArray as t,__assign as e,__awaiter as n,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import r from"lodash/sortBy";import a from"lodash/cloneDeep";import{IkasCategory as o}from"../category/index.js";import{IkasProductVariant as u}from"./variant/index.js";import{IkasProductAttributeValue as s}from"./attribute-value/index.js";import{IkasProductVariantType as c}from"./variant-type/index.js";import{IkasBrand as d}from"../brand/index.js";import{IkasHTMLMetaData as l}from"../html-meta-data/index.js";import{IkasProductTag as p}from"./tag/index.js";import{IkasProductType as f}from"@ikas/storefront-models";export{IkasProductType}from"@ikas/storefront-models";import{IkasProductOptionSet as h}from"./option-set/index.js";import{makeObservable as v,observable as m,computed as g}from"mobx";import{IkasProductFunctions as b}from"@ikas/storefront-model-functions";import{IkasProductCampaign as V}from"./campaign/index.js";import{IkasStorefrontConfig as y}from"@ikas/storefront-config";import{IkasBaseStore as I}from"../../../store/base.js";import P from"lodash/groupBy";import{IkasProductBaseUnit as w}from"./base-unit/index.js";import{formatCurrency as O}from"../../../utils/currency.js";import"lodash/get";import S from"../../../store/product/index.js";import{IkasCustomerReviewList as j}from"../../ui/customer-review-list/index.js";import{IkasProductStar as T}from"./star/index.js";import{IkasProductCampaignOffer as C,IkasProductOffer as x}from"./campaign-offer/index.js";import{IkasProductGroup as G}from"./group/index.js";import{IkasImage as E}from"../image/index.js";import{IkasProductSalesChannel as k}from"./sales-channel/index.js";var L=function(){function L(b){void 0===b&&(b={});var P,E,R,A=this;this.metaData=null,this.brand=null,this.tags=null,this.productOptionSetId=null,this.productOptionSet=null,this.campaigns=null,this.selectedVariantValues=[],this.isFiltered=!1,this.isStatic=!1,this.bundleProductCache={},this.productGroupItems=[],this.showVariantsInGroup=!1,this.selectVariantValue=function(n,i){var r,a=A.metaData,o=A.selectedVariantValues.map((function(t){return t.variantTypeId===n.variantTypeId?n:t})),u=A.variants.find((function(t){return t.isActive&&o.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))}));if(u)A.selectedVariantValues=o;else{var s=A.variantTypes.findIndex((function(t){return t.variantType.id===n.variantTypeId}));if(s>0){var c=A.variantTypes.slice(0,s),d=A.selectedVariantValues.filter((function(t){return c.some((function(e){return e.variantType.id===t.variantTypeId}))})),l=t(t([],d,!0),[n],!1);u=A.variants.find((function(t){return t.isActive&&l.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))}))}else{var p=o.slice(0,o.length-1);(u=A.variants.find((function(t){return t.isActive&&p.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))})))||(u=A.variants.find((function(t){return t.isActive&&t.variantValues.some((function(t){return t.id===n.id}))})))}if(!u)return;A.selectedVariantValues=u.variantValues}var f={};new URLSearchParams(window.location.search).forEach((function(t,n){var i;"vid"!==n&&(f=e(e({},f),((i={})[n]=t,i)))})),A.variantTypes.map((function(t){delete f[t.variantType.slug]}));var h=t(t([],A.variantTypes.map((function(t){var e=t.variantType,n=e.values.find((function(t){return A.selectedVariantValues.some((function(e){return e.id===t.id}))}));if(n)return"".concat(e.slug,"=").concat(n.slug)})),!0),Object.entries(f).map((function(t){var e=t[0],n=t[1];return"".concat(e,"=").concat(n)})),!0).filter((function(t){return!!t})).join("&");if(!i){var v="/".concat(a.slug);if(h&&(v="/".concat(a.slug,"?").concat(h)),v===window.location.pathname)return;null===(r=I.getInstance().router)||void 0===r||r.replace(v,void 0,{shallow:!1,scroll:!1})}},this.getVariantUnitPriceText=function(t){var e,n,i=t.price;if(i.unitPrice&&A.baseUnit){var r=A.baseUnit.baseAmount,a=(null===(n=null===(e=A.baseUnit)||void 0===e?void 0:e.unit)||void 0===n?void 0:n.name)||"";return"".concat(O(i.unitPrice,i.currency||"",i.currencySymbol||"")," / ").concat(r&&1!==r?r:"").concat(a)}},this.getCampaigns=function(){return n(A,void 0,void 0,(function(){var t,e,n,r,a,o=this;return i(this,(function(i){switch(i.label){case 0:return t=I.getInstance(),e=t.customerStore.customer,n=e?e.customerGroupIds:null,r=this.variants.map((function(t){return t.id})),[4,S.getProductCampaigns({input:{customerGroupIds:n,salesChannelId:y.getSalesChannelId()||"",variantIds:r}})];case 1:return a=i.sent(),this.campaigns=a.data,this.campaigns?(this.campaigns.map((function(t){o.variants.map((function(e){var n;t.variantIds.some((function(t){return t===e.id}))&&(null===(n=e.campaigns)||void 0===n||n.push(t))}))})),[2,this.campaigns]):[2]}}))}))},this.getAvailableStockLocations=function(){return n(A,void 0,void 0,(function(){var t,e;return i(this,(function(n){switch(n.label){case 0:return t=this.variants.map((function(t){return t.id})),e=y.getPickupStockLocationIds(),[4,S.getVariantStockLocations({stockLocationIdList:e,variantIds:t})];case 1:return[2,n.sent().data||[]]}}))}))},this.getCustomerReviews=function(t){return n(A,void 0,void 0,(function(){var n,r,a,o,u;return i(this,(function(i){switch(i.label){case 0:return n=!!(null===(o=this.selectedVariant.bundleSettings)||void 0===o?void 0:o.products.length),r=[this.id],n&&(null===(u=this.selectedVariant.bundleSettings)||void 0===u||u.products.forEach((function(t){r.push(t.productId)}))),[4,(a=new j(e(e(e({},n?{}:{productId:this.id}),{limit:null==t?void 0:t.limit,page:null==t?void 0:t.page,hasImage:null==t?void 0:t.hasImage}),n?{productIds:r}:{}))).getInitial()];case 1:return i.sent(),[2,a]}}))}))},this.getProductOptionSet=function(){return n(A,void 0,void 0,(function(){var t,e;return i(this,(function(n){switch(n.label){case 0:return this.productOptionSet?[2,!0]:this.productOptionSetId?[4,S.listProductOptionSet({id:{eq:this.productOptionSetId}})]:[2,!1];case 1:return(t=n.sent()).isSuccess&&(null===(e=t.data)||void 0===e?void 0:e.length)?(this.productOptionSet=t.data[0],this.setOptionPrices(),[2,!0]):[2,!1]}}))}))},this.initBundleProducts=function(){return n(A,void 0,void 0,(function(){var t,e,n,r,a,o;return i(this,(function(i){switch(i.label){case 0:return t="","undefined"!=typeof window&&(e=new URLSearchParams(window.location.search),t=e.get("editLineID")||""),t?(n=null===(a=I.getInstance().cartStore.cart)||void 0===a?void 0:a.items.find((function(e){return e.id===t})))&&(r=this.variants.find((function(t){return t.id===n.variant.id})))?(this.selectedVariantValues=r.variantValues,[4,this.getBundleProductsOfVariant(r)]):[3,2]:[3,3];case 1:i.sent(),null===(o=r.bundleSettings)||void 0===o||o.products.forEach((function(t){var e,i,r;try{var a=null===(e=n.variant.bundleProducts)||void 0===e?void 0:e.find((function(e){return e.id===t.id})),o=t.product.variants.find((function(t){return t.id===(null==a?void 0:a.variant.id)}));t.product.selectedVariantValues=o.variantValues,t.quantity=(null===(r=null===(i=n.variant.bundleProducts)||void 0===i?void 0:i.find((function(t){return t.variant.id===o.id})))||void 0===r?void 0:r.quantity)||0}catch(t){console.error(t)}})),i.label=2;case 2:return[3,5];case 3:return[4,this.getBundleProductsOfVariant(this.selectedVariant)];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))},this.setShowVariantsInGroup=function(t){A.showVariantsInGroup=t},this.getBundleProductsOfVariant=function(t){return n(A,void 0,void 0,(function(){var e,n,r,o,u,s,c=this;return i(this,(function(i){switch(i.label){case 0:return(null==(e=null===(r=t.bundleSettings)||void 0===r?void 0:r.products.map((function(t){return t.productId})).filter((function(t){return-1===Object.keys(c.bundleProductCache).indexOf(t)})))?void 0:e.length)?[4,S.searchProducts({input:{productIdList:e,perPage:200,priceListId:y.getPriceListId(),salesChannelId:y.getSalesChannelId()}})]:[3,2];case 1:(n=i.sent()).isSuccess&&(null===(u=null===(o=n.data)||void 0===o?void 0:o.data)||void 0===u||u.forEach((function(t){c.bundleProductCache[t.id]=t}))),i.label=2;case 2:return null===(s=t.bundleSettings)||void 0===s||s.products.forEach((function(t){var e=c.bundleProductCache[t.productId];t.setProduct(new L(a(e)))})),[2]}}))}))},this.setOptionPrices=function(){var t,e=A.variants[0];if(e){var n=e.price.currency;null===(t=A.productOptionSet)||void 0===t||t.options.forEach((function(t){var e;t.selectSettings&&t.selectSettings.values.forEach((function(t){var e;t.otherPrices&&(t.price=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===n})))||void 0===e?void 0:e.price)||t.price)})),t.otherPrices&&(t.price=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===n})))||void 0===e?void 0:e.price)||t.price)}))}},this.id=b.id||Date.now()+"",this.name=b.name||"",this.type=b.type||f.PHYSICAL,this.description=b.description||"",this.shortDescription=b.shortDescription||"",this.metaData=b.metaData?new l(b.metaData):null,this.brand=b.brand?new d(b.brand):null,this.categories=b.categories?b.categories.map((function(t){return new o(t)})):[],this.deleted=b.deleted||null,this.tags=b.tags?b.tags.map((function(t){return new p(t)})):[],this.variants=b.variants?b.variants.map((function(t){return new u(t)})):[],this.attributes=b.attributes?b.attributes.map((function(t){return new s(t)})):[],this.variantTypes=b.variantTypes?b.variantTypes.map((function(t){return new c(t)})):[],this.productOptionSetId=b.productOptionSetId||null,this.averageRating=null!==(P=b.averageRating)&&void 0!==P?P:null,this.reviewCount=null!==(E=b.reviewCount)&&void 0!==E?E:null,this.stars=b.stars?b.stars.map((function(t){return new T(t)})):null,this.baseUnit=b.baseUnit?new w(b.baseUnit):null,this.productOptionSet=b.productOptionSet?new h(b.productOptionSet):null,this.campaigns=(null===(R=b.campaigns)||void 0===R?void 0:R.map((function(t){return new V(t)})))||null,this.selectedVariantValues=b.selectedVariantValues||[],this.variantTypes=r(this.variantTypes,"order"),this.groupVariantsByVariantTypeId=b.groupVariantsByVariantTypeId||null,this.dynamicPriceListIds=b.dynamicPriceListIds||null,this.productVolumeDiscountId=b.productVolumeDiscountId||null,this.campaignOffers=b.campaignOffers?b.campaignOffers.map((function(t){return new C(t)})):null,this.appliedCampaignOffer=b.appliedCampaignOffer,this.offers=b.offers?b.offers.map((function(t){return new x(t)})):void 0,this.productGroup=b.productGroup?new G(b.productGroup):null,this.salesChannels=b.salesChannels?b.salesChannels.map((function(t){return new k(t)})):null,this.productGroupItems=b.productGroupItems,this.setOptionPrices(),this.variants.forEach((function(t){return t.product=A})),this.customerReviews=b.customerReviews?new j(b.customerReviews):null,v(this,{selectedVariantValues:m,isFiltered:m,isStatic:m,showVariantsInGroup:m,hasVariant:g,hasStock:g,hasValidProductOptionValues:g,href:g,productHref:g,mainVariantType:g,mainVariantValue:g,selectedVariant:g,displayedVariantTypes:g,isCustomerReviewEnabled:g,isCustomerReviewLoginRequired:g,isAddToCartEnabled:g,groupedAttributeValues:g,selectedVariantUnitPriceText:g,displayedProductGroups:g})}return Object.defineProperty(L.prototype,"hasVariant",{get:function(){return b.hasVariant(this,this.showVariantsInGroup)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"hasStock",{get:function(){return this.isStatic?this.selectedVariant.hasStock:b.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"hasValidProductOptionValues",{get:function(){return!this.productOptionSet||this.productOptionSet.hasValidValues},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"href",{get:function(){return b.getSelectedVariantHref(this,this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"productHref",{get:function(){return this.groupVariantsByVariantTypeId||this.isFiltered?this.href:b.getProductHref(this)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"mainVariantType",{get:function(){return b.getMainVariantType(this)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"mainVariantValue",{get:function(){return b.getMainVariantValue(this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"selectedVariant",{get:function(){if(!this.hasVariant)return this.variants[0];var t=this.selectedVariantValues.map((function(t){return t.id}));return this.variants.find((function(e){return e.variantValues.every((function(e){return t.includes(e.id)}))}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"displayedVariantTypes",{get:function(){return this.hasVariant?b.getDisplayedVariantTypes(this,this.selectedVariantValues):[]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isCustomerReviewEnabled",{get:function(){return y.isCustomerReviewEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isCustomerReviewLoginRequired",{get:function(){return y.isCustomerReviewLoginRequired()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isAddToCartEnabled",{get:function(){var t,e=!0;return null===(t=this.selectedVariant.bundleSettings)||void 0===t||t.products.forEach((function(t){0===t.quantity&&null!==t.minQuantity&&0!==t.minQuantity&&(e=!1)})),e&&this.hasValidProductOptionValues&&(this.selectedVariant.hasStock||this.selectedVariant.sellIfOutOfStock)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"groupedAttributeValues",{get:function(){var t,e=P(this.attributes,"productAttributeId");return(null===(t=this.attributes)||void 0===t?void 0:t.map((function(t){var n=t.productAttributeId;if(n){var i=e[n];return(null==i?void 0:i.length)&&i[0].productAttribute?{attribute:i[0].productAttribute,values:i}:void 0}})).filter((function(t){return!!t})))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"selectedVariantUnitPriceText",{get:function(){return this.getVariantUnitPriceText(this.selectedVariant)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"displayedProductGroups",{get:function(){var e,n=this,i=[],a=[];return null===(e=this.productGroupItems)||void 0===e||e.forEach((function(t){t.groupValues.forEach((function(t){i.includes(t.name)||i.push(t.name)}))})),i.forEach((function(e){var i,o={name:e,items:[]};n.productGroupItems=r(n.productGroupItems,(function(t){var e;return parseInt((null===(e=t.order)||void 0===e?void 0:e.value)||"999",10)})),null===(i=n.productGroupItems)||void 0===i||i.forEach((function(i){var r,a,u,s=i.groupValues.find((function(t){return t.name===e}));if(s&&!o.items.some((function(t){return t.value===s.value}))){var c="";if(i.productId===n.id)c=n.href;else{var d=(null===(r=n.productGroup)||void 0===r?void 0:r.values.filter((function(t){return t.name!==e})))||[],l=t(t([],d,!0),[s],!1),p=null===(a=n.productGroupItems)||void 0===a?void 0:a.find((function(t){return l.every((function(e){return t.groupValues.some((function(t){return e.name===t.name&&e.value===t.value}))}))}));c=p?p.href:i.href}o.items.push({image:i.image?new E(i.image):null,href:c,value:s.value,isSelected:(null===(u=n.productGroupItems)||void 0===u?void 0:u.some((function(t){return t.groupValues.some((function(t){return t.value===s.value}))&&t.productId===n.id})))||!1})}})),a.push(o)})),a},enumerable:!1,configurable:!0}),L}();export{L as IkasProduct};
1
+ import{__spreadArray as t,__assign as e,__awaiter as i,__generator as n}from'./../../../ext/tslib/tslib.es6.js';import r from"lodash/sortBy";import a from"lodash/cloneDeep";import{IkasCategory as o}from"../category/index.js";import{IkasProductVariant as s}from"./variant/index.js";import{IkasProductAttributeValue as u}from"./attribute-value/index.js";import{IkasProductVariantType as c}from"./variant-type/index.js";import{IkasBrand as d}from"../brand/index.js";import{IkasHTMLMetaData as l}from"../html-meta-data/index.js";import{IkasProductTag as p}from"./tag/index.js";import{IkasProductOptionPriceTypeEnum as f,IkasProductType as v}from"@ikas/storefront-models";export{IkasProductType}from"@ikas/storefront-models";import{IkasProductOptionSet as h}from"./option-set/index.js";import{makeObservable as m,observable as g,computed as V}from"mobx";import{IkasProductFunctions as b}from"@ikas/storefront-model-functions";import{IkasProductCampaign as y}from"./campaign/index.js";import{IkasStorefrontConfig as P}from"@ikas/storefront-config";import{IkasBaseStore as I}from"../../../store/base.js";import O from"lodash/groupBy";import{IkasProductBaseUnit as w}from"./base-unit/index.js";import{formatCurrency as S}from"../../../utils/currency.js";import"lodash/get";import T from"../../../store/product/index.js";import{IkasCustomerReviewList as j}from"../../ui/customer-review-list/index.js";import{IkasProductStar as C}from"./star/index.js";import{IkasProductCampaignOffer as x,IkasProductOffer as R}from"./campaign-offer/index.js";import{IkasProductGroup as G}from"./group/index.js";import{IkasImage as E}from"../image/index.js";import{IkasProductSalesChannel as A}from"./sales-channel/index.js";var k=function(){function k(b){void 0===b&&(b={});var O,E,L,D=this;this.metaData=null,this.brand=null,this.tags=null,this.productOptionSetId=null,this.productOptionSet=null,this.campaigns=null,this.selectedVariantValues=[],this.isFiltered=!1,this.isStatic=!1,this.bundleProductCache={},this.productGroupItems=[],this.showVariantsInGroup=!1,this.selectVariantValue=function(i,n){var r,a=D.metaData,o=D.selectedVariantValues.map((function(t){return t.variantTypeId===i.variantTypeId?i:t})),s=D.variants.find((function(t){return t.isActive&&o.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))}));if(s)D.selectedVariantValues=o;else{var u=D.variantTypes.findIndex((function(t){return t.variantType.id===i.variantTypeId}));if(u>0){var c=D.variantTypes.slice(0,u),d=D.selectedVariantValues.filter((function(t){return c.some((function(e){return e.variantType.id===t.variantTypeId}))})),l=t(t([],d,!0),[i],!1);s=D.variants.find((function(t){return t.isActive&&l.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))}))}else{var p=o.slice(0,o.length-1);(s=D.variants.find((function(t){return t.isActive&&p.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))})))||(s=D.variants.find((function(t){return t.isActive&&t.variantValues.some((function(t){return t.id===i.id}))})))}if(!s)return;D.selectedVariantValues=s.variantValues}var f={};new URLSearchParams(window.location.search).forEach((function(t,i){var n;"vid"!==i&&(f=e(e({},f),((n={})[i]=t,n)))})),D.variantTypes.map((function(t){delete f[t.variantType.slug]}));var v=t(t([],D.variantTypes.map((function(t){var e=t.variantType,i=e.values.find((function(t){return D.selectedVariantValues.some((function(e){return e.id===t.id}))}));if(i)return"".concat(e.slug,"=").concat(i.slug)})),!0),Object.entries(f).map((function(t){var e=t[0],i=t[1];return"".concat(e,"=").concat(i)})),!0).filter((function(t){return!!t})).join("&");if(D.setOptionRealPrices(),!n){var h="/".concat(a.slug);if(v&&(h="/".concat(a.slug,"?").concat(v)),h===window.location.pathname)return;null===(r=I.getInstance().router)||void 0===r||r.replace(h,void 0,{shallow:!1,scroll:!1})}},this.getVariantUnitPriceText=function(t){var e,i,n=t.price;if(n.unitPrice&&D.baseUnit){var r=D.baseUnit.baseAmount,a=(null===(i=null===(e=D.baseUnit)||void 0===e?void 0:e.unit)||void 0===i?void 0:i.name)||"";return"".concat(S(n.unitPrice,n.currency||"",n.currencySymbol||"")," / ").concat(r&&1!==r?r:"").concat(a)}},this.getCampaigns=function(){return i(D,void 0,void 0,(function(){var t,e,i,r,a,o=this;return n(this,(function(n){switch(n.label){case 0:return t=I.getInstance(),e=t.customerStore.customer,i=e?e.customerGroupIds:null,r=this.variants.map((function(t){return t.id})),[4,T.getProductCampaigns({input:{customerGroupIds:i,salesChannelId:P.getSalesChannelId()||"",variantIds:r}})];case 1:return a=n.sent(),this.campaigns=a.data,this.campaigns?(this.campaigns.map((function(t){o.variants.map((function(e){var i;t.variantIds.some((function(t){return t===e.id}))&&(null===(i=e.campaigns)||void 0===i||i.push(t))}))})),[2,this.campaigns]):[2]}}))}))},this.getAvailableStockLocations=function(){return i(D,void 0,void 0,(function(){var t,e;return n(this,(function(i){switch(i.label){case 0:return t=this.variants.map((function(t){return t.id})),e=P.getPickupStockLocationIds(),[4,T.getVariantStockLocations({stockLocationIdList:e,variantIds:t})];case 1:return[2,i.sent().data||[]]}}))}))},this.getCustomerReviews=function(t){return i(D,void 0,void 0,(function(){var i,r,a,o,s;return n(this,(function(n){switch(n.label){case 0:return i=!!(null===(o=this.selectedVariant.bundleSettings)||void 0===o?void 0:o.products.length),r=[this.id],i&&(null===(s=this.selectedVariant.bundleSettings)||void 0===s||s.products.forEach((function(t){r.push(t.productId)}))),[4,(a=new j(e(e(e({},i?{}:{productId:this.id}),{limit:null==t?void 0:t.limit,page:null==t?void 0:t.page,hasImage:null==t?void 0:t.hasImage}),i?{productIds:r}:{}))).getInitial()];case 1:return n.sent(),[2,a]}}))}))},this.getProductOptionSet=function(){return i(D,void 0,void 0,(function(){var t,e;return n(this,(function(i){switch(i.label){case 0:return this.productOptionSet?[2,!0]:this.productOptionSetId?[4,T.listProductOptionSet({id:{eq:this.productOptionSetId}})]:[2,!1];case 1:return(t=i.sent()).isSuccess&&(null===(e=t.data)||void 0===e?void 0:e.length)?(this.productOptionSet=t.data[0],this.setOptionPrices(),this.setOptionRealPrices(),[2,!0]):[2,!1]}}))}))},this.initBundleProducts=function(){return i(D,void 0,void 0,(function(){var t,e,i,r,a,o;return n(this,(function(n){switch(n.label){case 0:return t="","undefined"!=typeof window&&(e=new URLSearchParams(window.location.search),t=e.get("editLineID")||""),t?(i=null===(a=I.getInstance().cartStore.cart)||void 0===a?void 0:a.items.find((function(e){return e.id===t})))&&(r=this.variants.find((function(t){return t.id===i.variant.id})))?(this.selectedVariantValues=r.variantValues,[4,this.getBundleProductsOfVariant(r)]):[3,2]:[3,3];case 1:n.sent(),null===(o=r.bundleSettings)||void 0===o||o.products.forEach((function(t){var e,n,r;try{var a=null===(e=i.variant.bundleProducts)||void 0===e?void 0:e.find((function(e){return e.id===t.id})),o=t.product.variants.find((function(t){return t.id===(null==a?void 0:a.variant.id)}));t.product.selectedVariantValues=o.variantValues,t.quantity=(null===(r=null===(n=i.variant.bundleProducts)||void 0===n?void 0:n.find((function(t){return t.variant.id===o.id})))||void 0===r?void 0:r.quantity)||0}catch(t){console.error(t)}})),n.label=2;case 2:return[3,5];case 3:return[4,this.getBundleProductsOfVariant(this.selectedVariant)];case 4:n.sent(),n.label=5;case 5:return[2]}}))}))},this.setShowVariantsInGroup=function(t){D.showVariantsInGroup=t},this.getBundleProductsOfVariant=function(t){return i(D,void 0,void 0,(function(){var e,i,r,o,s,u,c=this;return n(this,(function(n){switch(n.label){case 0:return(null==(e=null===(r=t.bundleSettings)||void 0===r?void 0:r.products.map((function(t){return t.productId})).filter((function(t){return-1===Object.keys(c.bundleProductCache).indexOf(t)})))?void 0:e.length)?[4,T.searchProducts({input:{productIdList:e,perPage:200,priceListId:P.getPriceListId(),salesChannelId:P.getSalesChannelId()}})]:[3,2];case 1:(i=n.sent()).isSuccess&&(null===(s=null===(o=i.data)||void 0===o?void 0:o.data)||void 0===s||s.forEach((function(t){c.bundleProductCache[t.id]=t}))),n.label=2;case 2:return null===(u=t.bundleSettings)||void 0===u||u.products.forEach((function(t){var e=c.bundleProductCache[t.productId];t.setProduct(new k(a(e)))})),[2]}}))}))},this.setOptionRealPrices=function(){var t,e=D.selectedVariant||D.variants[0];if(e){var i=e.price.currency;i&&(null===(t=D.productOptionSet)||void 0===t||t.options.forEach((function(t){var e;if(t.selectSettings)t.selectSettings.values.forEach((function(t){var e;if(t.priceType===f.RATIO&&t.initPrice)if(t.otherPrices){var n=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===i})))||void 0===e?void 0:e.price)||t.initPrice||1;t.price=D.selectedVariant.price.finalPrice*n/100}else t.price=D.selectedVariant.price.finalPrice*t.initPrice/100}));else if(t.priceType===f.RATIO&&t.initPrice)if(t.otherPrices){var n=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===i})))||void 0===e?void 0:e.price)||t.initPrice||1;t.price=D.selectedVariant.price.finalPrice*n/100}else t.price=D.selectedVariant.price.finalPrice*t.initPrice/100})))}},this.setOptionPrices=function(){var t,e=D.variants[0];if(e){var i=e.price.currency;null===(t=D.productOptionSet)||void 0===t||t.options.forEach((function(t){var n,r;if(t.selectSettings&&t.selectSettings.values.forEach((function(t){var n,r;if(t.otherPrices)if(t.priceType===f.RATIO){var a=(null===(n=t.otherPrices.find((function(t){return t.currencyCode===i})))||void 0===n?void 0:n.price)||t.price||1;t.price=e.price.finalPrice*a}else t.price=(null===(r=t.otherPrices.find((function(t){return t.currencyCode===i})))||void 0===r?void 0:r.price)||t.price})),t.otherPrices)if(t.priceType===f.RATIO){var a=(null===(n=t.otherPrices.find((function(t){return t.currencyCode===i})))||void 0===n?void 0:n.price)||t.price||1;t.price=e.price.finalPrice*a}else t.price=(null===(r=t.otherPrices.find((function(t){return t.currencyCode===i})))||void 0===r?void 0:r.price)||t.price}))}},this.id=b.id||Date.now()+"",this.name=b.name||"",this.type=b.type||v.PHYSICAL,this.description=b.description||"",this.shortDescription=b.shortDescription||"",this.metaData=b.metaData?new l(b.metaData):null,this.brand=b.brand?new d(b.brand):null,this.categories=b.categories?b.categories.map((function(t){return new o(t)})):[],this.deleted=b.deleted||null,this.tags=b.tags?b.tags.map((function(t){return new p(t)})):[],this.variants=b.variants?b.variants.map((function(t){return new s(t)})):[],this.attributes=b.attributes?b.attributes.map((function(t){return new u(t)})):[],this.variantTypes=b.variantTypes?b.variantTypes.map((function(t){return new c(t)})):[],this.productOptionSetId=b.productOptionSetId||null,this.averageRating=null!==(O=b.averageRating)&&void 0!==O?O:null,this.reviewCount=null!==(E=b.reviewCount)&&void 0!==E?E:null,this.stars=b.stars?b.stars.map((function(t){return new C(t)})):null,this.baseUnit=b.baseUnit?new w(b.baseUnit):null,this.campaigns=(null===(L=b.campaigns)||void 0===L?void 0:L.map((function(t){return new y(t)})))||null,this.selectedVariantValues=b.selectedVariantValues||[],this.productOptionSet=b.productOptionSet?new h(b.productOptionSet):null,this.variantTypes=r(this.variantTypes,"order"),this.groupVariantsByVariantTypeId=b.groupVariantsByVariantTypeId||null,this.dynamicPriceListIds=b.dynamicPriceListIds||null,this.productVolumeDiscountId=b.productVolumeDiscountId||null,this.campaignOffers=b.campaignOffers?b.campaignOffers.map((function(t){return new x(t)})):null,this.appliedCampaignOffer=b.appliedCampaignOffer,this.offers=b.offers?b.offers.map((function(t){return new R(t)})):void 0,this.productGroup=b.productGroup?new G(b.productGroup):null,this.salesChannels=b.salesChannels?b.salesChannels.map((function(t){return new A(t)})):null,this.productGroupItems=b.productGroupItems,this.variants.forEach((function(t){return t.product=D})),this.setOptionPrices(),this.setOptionRealPrices(),this.customerReviews=b.customerReviews?new j(b.customerReviews):null,m(this,{selectedVariantValues:g,isFiltered:g,isStatic:g,showVariantsInGroup:g,hasVariant:V,hasStock:V,hasValidProductOptionValues:V,href:V,productHref:V,mainVariantType:V,mainVariantValue:V,selectedVariant:V,displayedVariantTypes:V,isCustomerReviewEnabled:V,isCustomerReviewLoginRequired:V,isAddToCartEnabled:V,groupedAttributeValues:V,selectedVariantUnitPriceText:V,displayedProductGroups:V})}return Object.defineProperty(k.prototype,"hasVariant",{get:function(){return b.hasVariant(this,this.showVariantsInGroup)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"hasStock",{get:function(){return this.isStatic?this.selectedVariant.hasStock:b.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"hasValidProductOptionValues",{get:function(){return!this.productOptionSet||this.productOptionSet.hasValidValues},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"href",{get:function(){return b.getSelectedVariantHref(this,this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"productHref",{get:function(){return this.groupVariantsByVariantTypeId||this.isFiltered?this.href:b.getProductHref(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"mainVariantType",{get:function(){return b.getMainVariantType(this)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"mainVariantValue",{get:function(){return b.getMainVariantValue(this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"selectedVariant",{get:function(){if(!this.hasVariant)return this.variants[0];var t=this.selectedVariantValues.map((function(t){return t.id}));return this.variants.find((function(e){return e.variantValues.every((function(e){return t.includes(e.id)}))}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"displayedVariantTypes",{get:function(){return this.hasVariant?b.getDisplayedVariantTypes(this,this.selectedVariantValues):[]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isCustomerReviewEnabled",{get:function(){return P.isCustomerReviewEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isCustomerReviewLoginRequired",{get:function(){return P.isCustomerReviewLoginRequired()},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isAddToCartEnabled",{get:function(){var t,e=!0;return null===(t=this.selectedVariant.bundleSettings)||void 0===t||t.products.forEach((function(t){0===t.quantity&&null!==t.minQuantity&&0!==t.minQuantity&&(e=!1)})),e&&this.hasValidProductOptionValues&&(this.selectedVariant.hasStock||this.selectedVariant.sellIfOutOfStock)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"groupedAttributeValues",{get:function(){var t,e=O(this.attributes,"productAttributeId");return(null===(t=this.attributes)||void 0===t?void 0:t.map((function(t){var i=t.productAttributeId;if(i){var n=e[i];return(null==n?void 0:n.length)&&n[0].productAttribute?{attribute:n[0].productAttribute,values:n}:void 0}})).filter((function(t){return!!t})))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"selectedVariantUnitPriceText",{get:function(){return this.getVariantUnitPriceText(this.selectedVariant)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"displayedProductGroups",{get:function(){var e,i=this,n=[],a=[];return null===(e=this.productGroupItems)||void 0===e||e.forEach((function(t){t.groupValues.forEach((function(t){n.includes(t.name)||n.push(t.name)}))})),n.forEach((function(e){var n,o={name:e,items:[]};i.productGroupItems=r(i.productGroupItems,(function(t){var e;return parseInt((null===(e=t.order)||void 0===e?void 0:e.value)||"999",10)})),null===(n=i.productGroupItems)||void 0===n||n.forEach((function(n){var r,a,s,u=n.groupValues.find((function(t){return t.name===e}));if(u&&!o.items.some((function(t){return t.value===u.value}))){var c="";if(n.productId===i.id)c=i.href;else{var d=(null===(r=i.productGroup)||void 0===r?void 0:r.values.filter((function(t){return t.name!==e})))||[],l=t(t([],d,!0),[u],!1),p=null===(a=i.productGroupItems)||void 0===a?void 0:a.find((function(t){return l.every((function(e){return t.groupValues.some((function(t){return e.name===t.name&&e.value===t.value}))}))}));c=p?p.href:n.href}o.items.push({image:n.image?new E(n.image):null,href:c,value:u.value,isSelected:(null===(s=i.productGroupItems)||void 0===s?void 0:s.some((function(t){return t.groupValues.some((function(t){return t.value===u.value}))&&t.productId===i.id})))||!1})}})),a.push(o)})),a},enumerable:!1,configurable:!0}),k}();export{k as IkasProduct};
@@ -1,8 +1,12 @@
1
- import { IkasProductOptionSelectType, IkasProductOptionType, IkasProductOptionOtherPrice as IProductOptionOtherPrice, IkasProductOptionSelectValue as IProductOptionSelectValue, IkasProductOptionSelectSettings as IProductOptionSelectSettings, IkasProductOptionDateSettings as IProductOptionDateSettings, IkasProductOptionTextSettings as IProductOptionTextSettings, IkasProductOptionFileSettings as IProductOptionFileSettings, IkasProductOption as IProductOption } from "@ikas/storefront-models";
1
+ import { IkasProductOption as IProductOption, IkasProductOptionDateSettings as IProductOptionDateSettings, IkasProductOptionFileSettings as IProductOptionFileSettings, IkasProductOptionOtherPrice as IProductOptionOtherPrice, IkasProductOptionPriceTypeEnum, IkasProductOptionSelectSettings as IProductOptionSelectSettings, IkasProductOptionSelectType, IkasProductOptionSelectValue as IProductOptionSelectValue, IkasProductOptionTextSettings as IProductOptionTextSettings, IkasProductOptionType } from "@ikas/storefront-models";
2
2
  import { IkasImage } from "../../../image";
3
3
  export declare class IkasProductOptionOtherPrice implements IProductOptionOtherPrice {
4
4
  currencyCode: string;
5
5
  price: number;
6
+ priceType: IkasProductOptionPriceTypeEnum | null;
7
+ currencySymbol: string | null;
8
+ priceListId: string | null;
9
+ initPrice?: number | null;
6
10
  constructor(data: IProductOptionOtherPrice);
7
11
  }
8
12
  export declare class IkasProductOptionSelectValue implements IProductOptionSelectValue {
@@ -10,11 +14,14 @@ export declare class IkasProductOptionSelectValue implements IProductOptionSelec
10
14
  order: number;
11
15
  value: string;
12
16
  price: number | null;
17
+ priceType: IkasProductOptionPriceTypeEnum | null;
13
18
  otherPrices: IkasProductOptionOtherPrice[] | null;
14
19
  thumbnailImageId: string | null;
15
20
  colorCode: string | null;
16
21
  thumbnailImage: IkasImage | null;
22
+ initPrice: number | null;
17
23
  constructor(data?: Partial<IProductOptionSelectValue>);
24
+ get $initPrice(): number | null;
18
25
  }
19
26
  export declare class IkasProductOptionSelectSettings implements IProductOptionSelectSettings {
20
27
  type: IkasProductOptionSelectType;
@@ -52,6 +59,7 @@ export declare class IkasProductOption implements IProductOption {
52
59
  fileSettings: IkasProductOptionFileSettings | null;
53
60
  dateSettings: IkasProductOptionDateSettings | null;
54
61
  price: number | null;
62
+ priceType: IkasProductOptionPriceTypeEnum | null;
55
63
  otherPrices: IkasProductOptionOtherPrice[] | null;
56
64
  isOptional: boolean;
57
65
  optionalText: string | null;
@@ -59,12 +67,14 @@ export declare class IkasProductOption implements IProductOption {
59
67
  requiredOptionValueIds: string[] | null;
60
68
  childOptions: IkasProductOption[];
61
69
  private pValues;
70
+ initPrice: number | null;
62
71
  constructor(data: Partial<IProductOption>);
63
72
  get displayedChildOptions(): IkasProductOption[];
64
73
  productOptionFileUpload: (files: File[]) => Promise<string[]>;
65
74
  get hasValidValues(): boolean;
66
75
  get values(): string[];
67
76
  set values(values: string[]);
77
+ get $initPrice(): number | null;
68
78
  initValues: () => void;
69
79
  }
70
80
  export { IkasProductOptionSelectType, IkasProductOptionType };
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../../../../ext/tslib/tslib.es6.js';import{IkasProductOptionSelectType as e,IkasProductOptionType as n}from"@ikas/storefront-models";export{IkasProductOptionSelectType,IkasProductOptionType}from"@ikas/storefront-models";import{makeAutoObservable as l}from"mobx";import{IkasImage as s}from"../../../image/index.js";import o from"lodash/sortBy";import{IkasProductOptionFunctions as a}from"@ikas/storefront-model-functions";import{uploadFile as r,getProductOptionFileUrl as u}from"@ikas/storefront-api";var d=function(t){this.currencyCode=t.currencyCode,this.price=t.price},h=function(t){void 0===t&&(t={}),this.id=t.id||"",this.order=t.order||0,this.value=t.value||"",this.price=t.price||null,this.otherPrices=t.otherPrices||null,this.thumbnailImageId=t.thumbnailImageId||null,this.colorCode=t.colorCode||null,this.thumbnailImage=t.thumbnailImage?new s(t.thumbnailImage):t.thumbnailImageId?new s({id:t.thumbnailImageId,isVideo:!1}):null},m=function(t){var i;void 0===t&&(t={}),this.type=t.type||e.BOX,this.minSelect=null!==t.minSelect&&void 0!==t.minSelect?t.minSelect:null,this.maxSelect=null!==t.maxSelect&&void 0!==t.maxSelect?t.maxSelect:null,this.values=o((null===(i=t.values)||void 0===i?void 0:i.map((function(t){return new h(t)})))||[],"order")},c=function(t){this.min=t.min||null,this.max=t.max||null,this.minRelativeNextDate=void 0!==t.minRelativeNextDate?t.minRelativeNextDate:null,this.maxRelativeNextDate=void 0!==t.maxRelativeNextDate?t.maxRelativeNextDate:null},p=function(t){void 0===t&&(t={}),this.min=null!==t.min&&void 0!==t.min?t.min:null,this.max=null!==t.max&&void 0!==t.max?t.max:null},f=function(t){this.allowedExtensions=t.allowedExtensions||null,this.minQuantity=null!==t.minQuantity&&void 0!==t.minQuantity?t.minQuantity:null,this.maxQuantity=null!==t.maxQuantity&&void 0!==t.maxQuantity?t.maxQuantity:null},v=function(){function e(e){var s=this;this.childOptions=[],this.pValues=[],this.productOptionFileUpload=function(e){return t(s,void 0,void 0,(function(){var t,n,l,s,o,a=this;return i(this,(function(i){switch(i.label){case 0:return 0===e.length||this.fileSettings&&this.fileSettings.maxQuantity&&this.fileSettings.maxQuantity<e.length?[2,[]]:[4,Promise.all(e.map((function(t){return u({fileName:t.name,productOptionSetId:a.productOptionSetId,productOptionId:a.id},t)})))];case 1:t=i.sent().filter((function(t){return t.data})),n=[],l=0,s=t,i.label=2;case 2:return l<s.length?(o=s[l],[4,r(o.data,o.data.file)]):[3,5];case 3:i.sent()&&n.push(o.data.optionUrl),i.label=4;case 4:return l++,[3,2];case 5:return[2,n]}}))}))},this.initValues=function(){s.values=[],s.childOptions&&s.childOptions.forEach((function(t){return t.initValues()}))},this.id=e.id||"",this.productOptionSetId=e.productOptionSetId||"",this.name=e.name||"",this.order=e.order||0,this.type=e.type||n.CHOICE,this.selectSettings=e.selectSettings?new m(e.selectSettings||{}):null,this.textSettings=e.textSettings?new p(e.textSettings||{}):null,this.fileSettings=e.fileSettings?new f(e.fileSettings||{}):null,this.dateSettings=e.dateSettings?new c(e.dateSettings||{}):null,this.price=e.price||null,this.otherPrices=e.otherPrices||null,this.isOptional=e.isOptional||!1,this.optionalText=e.optionalText||null,this.requiredOptionId=e.requiredOptionId||null,this.requiredOptionValueIds=e.requiredOptionValueIds||null,this.values=e.values||[],l(this)}return Object.defineProperty(e.prototype,"displayedChildOptions",{get:function(){var t=a.getDisplayedChildOptions(this);return t.map((function(t){return t.displayedChildOptions})),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasValidValues",{get:function(){return a.hasValidValues(this)&&this.displayedChildOptions.every((function(t){return t.hasValidValues}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this.pValues},set:function(t){this.pValues=t,t.length||this.childOptions.forEach((function(t){return t.values=[]}))},enumerable:!1,configurable:!0}),e}();export{v as IkasProductOption,c as IkasProductOptionDateSettings,f as IkasProductOptionFileSettings,d as IkasProductOptionOtherPrice,m as IkasProductOptionSelectSettings,h as IkasProductOptionSelectValue,p as IkasProductOptionTextSettings};
1
+ import{__awaiter as t,__generator as i}from'./../../../../../ext/tslib/tslib.es6.js';import{IkasProductOptionPriceTypeEnum as e,IkasProductOptionSelectType as n,IkasProductOptionType as l}from"@ikas/storefront-models";export{IkasProductOptionSelectType,IkasProductOptionType}from"@ikas/storefront-models";import{makeAutoObservable as r}from"mobx";import{IkasImage as s}from"../../../image/index.js";import o from"lodash/sortBy";import{IkasProductOptionFunctions as u}from"@ikas/storefront-model-functions";import{uploadFile as a,getProductOptionFileUrl as c}from"@ikas/storefront-api";var h=function(t){this.initPrice=null,this.currencyCode=t.currencyCode,this.price=t.price,this.priceType=t.priceType,this.currencySymbol=t.currencySymbol,this.priceListId=t.priceListId,this.initPrice=this.price||null},d=function(){function t(t){void 0===t&&(t={}),this.initPrice=null,this.id=t.id||"",this.order=t.order||0,this.value=t.value||"",this.price=t.price||null,this.priceType=t.priceType||e.AMOUNT,this.otherPrices=t.otherPrices||null,this.thumbnailImageId=t.thumbnailImageId||null,this.colorCode=t.colorCode||null,this.thumbnailImage=t.thumbnailImage?new s(t.thumbnailImage):t.thumbnailImageId?new s({id:t.thumbnailImageId,isVideo:!1}):null,this.initPrice=this.price}return Object.defineProperty(t.prototype,"$initPrice",{get:function(){return this.initPrice},enumerable:!1,configurable:!0}),t}(),p=function(t){var i;void 0===t&&(t={}),this.type=t.type||n.BOX,this.minSelect=null!==t.minSelect&&void 0!==t.minSelect?t.minSelect:null,this.maxSelect=null!==t.maxSelect&&void 0!==t.maxSelect?t.maxSelect:null,this.values=o((null===(i=t.values)||void 0===i?void 0:i.map((function(t){return new d(t)})))||[],"order")},m=function(t){this.min=t.min||null,this.max=t.max||null,this.minRelativeNextDate=void 0!==t.minRelativeNextDate?t.minRelativeNextDate:null,this.maxRelativeNextDate=void 0!==t.maxRelativeNextDate?t.maxRelativeNextDate:null},f=function(t){void 0===t&&(t={}),this.min=null!==t.min&&void 0!==t.min?t.min:null,this.max=null!==t.max&&void 0!==t.max?t.max:null},y=function(t){this.allowedExtensions=t.allowedExtensions||null,this.minQuantity=null!==t.minQuantity&&void 0!==t.minQuantity?t.minQuantity:null,this.maxQuantity=null!==t.maxQuantity&&void 0!==t.maxQuantity?t.maxQuantity:null},g=function(){function n(n){var s=this;this.childOptions=[],this.pValues=[],this.initPrice=null,this.productOptionFileUpload=function(e){return t(s,void 0,void 0,(function(){var t,n,l,r,s,o=this;return i(this,(function(i){switch(i.label){case 0:return 0===e.length||this.fileSettings&&this.fileSettings.maxQuantity&&this.fileSettings.maxQuantity<e.length?[2,[]]:[4,Promise.all(e.map((function(t){return c({fileName:t.name,productOptionSetId:o.productOptionSetId,productOptionId:o.id},t)})))];case 1:t=i.sent().filter((function(t){return t.data})),n=[],l=0,r=t,i.label=2;case 2:return l<r.length?(s=r[l],[4,a(s.data,s.data.file)]):[3,5];case 3:i.sent()&&n.push(s.data.optionUrl),i.label=4;case 4:return l++,[3,2];case 5:return[2,n]}}))}))},this.initValues=function(){s.values=[],s.childOptions&&s.childOptions.forEach((function(t){return t.initValues()}))},this.id=n.id||"",this.productOptionSetId=n.productOptionSetId||"",this.name=n.name||"",this.order=n.order||0,this.type=n.type||l.CHOICE,this.selectSettings=n.selectSettings?new p(n.selectSettings||{}):null,this.textSettings=n.textSettings?new f(n.textSettings||{}):null,this.fileSettings=n.fileSettings?new y(n.fileSettings||{}):null,this.dateSettings=n.dateSettings?new m(n.dateSettings||{}):null,this.price=n.price||null,this.priceType=n.priceType||e.AMOUNT,this.otherPrices=n.otherPrices||null,this.isOptional=n.isOptional||!1,this.optionalText=n.optionalText||null,this.requiredOptionId=n.requiredOptionId||null,this.requiredOptionValueIds=n.requiredOptionValueIds||null,this.values=n.values||[],this.initPrice=this.price,r(this)}return Object.defineProperty(n.prototype,"displayedChildOptions",{get:function(){var t=u.getDisplayedChildOptions(this);return t.map((function(t){return t.displayedChildOptions})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasValidValues",{get:function(){return u.hasValidValues(this)&&this.displayedChildOptions.every((function(t){return t.hasValidValues}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.pValues},set:function(t){this.pValues=t,t.length||this.childOptions.forEach((function(t){return t.values=[]}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"$initPrice",{get:function(){return this.initPrice},enumerable:!1,configurable:!0}),n}();export{g as IkasProductOption,m as IkasProductOptionDateSettings,y as IkasProductOptionFileSettings,h as IkasProductOptionOtherPrice,p as IkasProductOptionSelectSettings,d as IkasProductOptionSelectValue,f as IkasProductOptionTextSettings};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{IkasProductPrice as r}from"./price/index.js";import{IkasVariantValue as n}from"../../variant-type/variant-value/index.js";import{IkasProductAttributeValue as o}from"../attribute-value/index.js";import{IkasProductImage as u}from"../image/index.js";import{IkasBundleSettings as c}from"./bundle-settings/index.js";import{IkasCustomerPriceListRuleValueType as l,IkasCampaignType as a,IkasCampaignFilterType as s,IkasCampaignApplicablePrice as d,IkasCustomerPriceListRuleFilterType as p}from"@ikas/storefront-models";import{IkasProductVariantFunctions as f,IkasProductPriceFunctions as m}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as b}from"@ikas/storefront-config";import{saveProductBackInStockRemind as v,listProductBackInStockRemind as h}from"@ikas/storefront-api";import g from"lodash/groupBy";import y from"lodash/sortBy";import{IkasProductVariantUnit as P}from"./unit/index.js";import{formatCurrency as I}from"../../../../utils/currency.js";import{makeAutoObservable as S}from"mobx";import{IkasBaseStore as O}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var j=function(){function j(e){void 0===e&&(e={}),this._backInStockReminderSaved=!1,this.product=null,this.id=e.id||Date.now()+"",this.productId=e.productId||"",this.sku=e.sku||null,this.barcodeList=e.barcodeList||[],this.baseBundlePrices=e.baseBundlePrices?e.baseBundlePrices.map((function(e){return new r(e)})):[],this.bundleSettings=e.bundleSettings?new c(e.bundleSettings):null,this.variantValues=e.variantValues?e.variantValues.map((function(e){return new n(e)})):[],this.images=e.images?e.images.map((function(e){return new u(e)})):[],this.attributes=e.attributes?e.attributes.map((function(e){return new o(e)})):[],this.prices=e.prices?e.prices.map((function(e){return new r(e)})):[],this.stock=e.stock||0,this.isActive=void 0===e.isActive||e.isActive,this.campaigns=e.campaigns||[],this.unit=e.unit?new P(e.unit):null,this.sellIfOutOfStock=e.sellIfOutOfStock||!1,this.images=y(this.images,"order"),S(this)}return Object.defineProperty(j.prototype,"mainImage",{get:function(){var e=f.getMainImage(this);return e?new u(e):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasStock",{get:function(){return f.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockEnabled",{get:function(){return b.isBackInStockEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockCustomerLoginRequired",{get:function(){return b.isCustomerLoginRequiredForBackInStock()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockReminderSaved",{get:function(){return this._backInStockReminderSaved},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"groupedAttributeValues",{get:function(){var e,t=g(this.attributes,"productAttributeId");return(null===(e=this.attributes)||void 0===e?void 0:e.map((function(e){var i=e.productAttributeId;if(i){var r=t[i];return(null==r?void 0:r.length)&&r[0].productAttribute?{attribute:r[0].productAttribute,values:r}:void 0}})).filter((function(e){return!!e})))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"b2bPriceRule",{get:function(){var e,t,i=this,r=O.getInstance().customerStore.customer,n=null==r?void 0:r.priceListRules,o=function(e){var t,r,n,o;if(e.type===p.CATEGORY)return u=null===(t=e.valueList)||void 0===t?void 0:t.some((function(e){var t;return null===(t=i.product)||void 0===t?void 0:t.categories.find((function(t){return t.id===e}))}));if(e.type===p.PRODUCT)return u=null===(r=e.valueList)||void 0===r?void 0:r.some((function(e){return i.id===e}));if(e.type===p.PRODUCT_BRAND){var u=null===(n=e.valueList)||void 0===n?void 0:n.some((function(e){var t,r;return(null===(r=null===(t=i.product)||void 0===t?void 0:t.brand)||void 0===r?void 0:r.id)===e}));return u}if(e.type===p.PRODUCT_TAG){u=null===(o=e.valueList)||void 0===o?void 0:o.some((function(e){var t,r;return null===(r=null===(t=i.product)||void 0===t?void 0:t.tags)||void 0===r?void 0:r.find((function(t){return t.id===e}))}));return u}};if(n){for(var u=0,c=n;u<c.length;u++){var l=c[u];if(l.shouldMatchAllFilters?null===(e=l.filters)||void 0===e?void 0:e.every(o):null===(t=l.filters)||void 0===t?void 0:t.some(o))return l}return null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"price",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.prices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return null===(t=this.prices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"bundlePrice",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.baseBundlePrices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return(null===(t=this.baseBundlePrices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId})))||this.price},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPrice",{get:function(){var e=0;this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?e=m.getFinalPrice(this.bundlePrice)+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.finalPriceWithQuantity:0)}),0):e=m.getFinalPrice(this.price);if(!this.b2bPriceRule)return e;switch(this.b2bPriceRule.valueType){case l.DISCOUNT_RATE:return e*((100-this.b2bPriceRule.value)/100);case l.DISCOUNT_AMOUNT:return e-this.b2bPriceRule.value;case l.FIXED_PRICE:return this.b2bPriceRule.value;default:return e}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPrice",{get:function(){return I(this.finalPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPrice",{get:function(){return this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?this.bundlePrice.sellPrice+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.sellPriceWithQuantity:0)}),0):this.price.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPrice",{get:function(){return I(this.sellPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedBuyPrice",{get:function(){return I(this.price.buyPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"appliedCampaignAmount",{get:function(){var e,t,i,r,n,o,u,c=this;if(!(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignId))return null;var l=(null===(r=null===(i=null===(t=this.product)||void 0===t?void 0:t.campaigns)||void 0===i?void 0:i.find((function(e){var t;return e.campaign.id===(null===(t=c.price.campaignPrice)||void 0===t?void 0:t.campaignId)})))||void 0===r?void 0:r.campaign)||null;if(!l)return null;var s={type:l.type,formattedPrice:null,discountPercentage:null};return l.type===a.FIXED_AMOUNT&&(s.formattedPrice=I((null===(n=l.fixedDiscount)||void 0===n?void 0:n.amount)||0,this.price.currency||"",this.price.currencySymbol||"")),l.type===a.RATIO&&(s.discountPercentage=(null===(u=null===(o=l.fixedDiscount)||void 0===o?void 0:o.amount)||void 0===u?void 0:u.toString())||null),s},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignPrice",{get:function(){var e;return(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignPrice)||null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedCampaignPrice",{get:function(){return I(this.campaignPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPrice",{get:function(){return this.finalPrice===this.sellPrice?null:this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedDiscountPrice",{get:function(){return I(this.discountPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasDiscount",{get:function(){return this.finalPrice!==this.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountAmount",{get:function(){return this.hasDiscount?this.sellPrice-this.finalPrice:0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPercentage",{get:function(){return this.hasDiscount?(100-100*this.finalPrice/this.sellPrice).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPriceWithCampaignOffers",{get:function(){var e,t;return this.finalPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.finalPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPriceWithCampaignOffers",{get:function(){return I(this.finalPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPriceWithCampaignOffers",{get:function(){var e,t;return this.sellPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.sellPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPriceWithCampaignOffers",{get:function(){return I(this.sellPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignOffersDiscountPercentage",{get:function(){return this.finalPriceWithCampaignOffers!==this.sellPriceWithCampaignOffers?(100-100*this.finalPriceWithCampaignOffers/this.sellPriceWithCampaignOffers).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"tieredDiscountProducts",{get:function(){var e,t,i,r,n=this,o=null===(i=null===(t=null===(e=this.product)||void 0===e?void 0:e.campaigns)||void 0===t?void 0:t.find((function(e){return!!e.campaign.tieredDiscount})))||void 0===i?void 0:i.campaign,u=null===(r=null==o?void 0:o.tieredDiscount)||void 0===r?void 0:r.filters;if(u){var c=u.find((function(e){return e.type===s.PRODUCT_AND_VARIANT}));if(c){var l=[];if(c.idList.map((function(e){l.push(e.replace("p:","").replace("v:",""))})),!l.some((function(e){return n.id===e||n.productId===e})))return[]}}return o&&o.tieredDiscount?o.tieredDiscount.rules.every((function(e){return!e.lineItemQuantityRange}))?[]:o.tieredDiscount.rules.map((function(e){var t,i,r,u,c=o.applicablePrice===d.SELL_PRICE?n.sellPrice:n.finalPrice,l=c*((null===(t=e.lineItemQuantityRange)||void 0===t?void 0:t.min)||1),s=I(c,n.price.currency||"",n.price.currencySymbol||""),p=I(l,n.price.currency||"",n.price.currencySymbol||""),f=o.type===a.RATIO?c-c*(e.amount||1)/100:c,m=f*((null===(i=e.lineItemQuantityRange)||void 0===i?void 0:i.min)||1)-(o.type===a.FIXED_AMOUNT&&e.amount||0),b=I(f,n.price.currency||"",n.price.currencySymbol||""),v=I(m,n.price.currency||"",n.price.currencySymbol||"");return{amount:e.amount,lineItemQuantityRange:{min:(null===(r=e.lineItemQuantityRange)||void 0===r?void 0:r.min)||0,max:(null===(u=e.lineItemQuantityRange)||void 0===u?void 0:u.max)||0},type:o.type,sellPrice:c,finalPrice:f,sellPriceWithQuantity:l,finalPriceWithQuantity:m,formattedSellPrice:s,formattedSellPriceWithQuantity:p,formattedFinalPrice:b,formattedFinalPriceWithQuantity:v}})):[]},enumerable:!1,configurable:!0}),j.prototype.saveBackInStockReminder=function(i){var r;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,h({email:{eq:i},productId:{eq:this.productId},variantId:{eq:this.id}})];case 1:return(e=t.sent())&&(null===(r=e.data)||void 0===r?void 0:r.length)?(this._backInStockReminderSaved=!0,[2,!1]):[3,2];case 2:return[4,v({input:{email:i,productId:this.productId,variantId:this.id}})];case 3:return t.sent().isSuccess?(this._backInStockReminderSaved=!0,[2,!0]):(this._backInStockReminderSaved=!1,[2,!1]);case 4:return[2]}}))}))},j.prototype.toJSON=function(){var e=i({},this);return delete e.product,e},j}();export{j as IkasProductVariant};
1
+ import{__awaiter as e,__generator as t,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{IkasProductPrice as r}from"./price/index.js";import{IkasVariantValue as n}from"../../variant-type/variant-value/index.js";import{IkasProductAttributeValue as o}from"../attribute-value/index.js";import{IkasProductImage as u}from"../image/index.js";import{IkasBundleSettings as c}from"./bundle-settings/index.js";import{IkasCustomerPriceListRuleValueType as l,IkasCampaignType as a,IkasCampaignFilterType as s,IkasCampaignApplicablePrice as d,IkasCustomerPriceListRuleFilterType as p}from"@ikas/storefront-models";import{IkasProductVariantFunctions as f,IkasProductPriceFunctions as m}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as b}from"@ikas/storefront-config";import{saveProductBackInStockRemind as v,listProductBackInStockRemind as g}from"@ikas/storefront-api";import h from"lodash/groupBy";import y from"lodash/sortBy";import{IkasProductVariantUnit as P}from"./unit/index.js";import{formatCurrency as I}from"../../../../utils/currency.js";import{makeAutoObservable as S}from"mobx";import{IkasBaseStore as O}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var j=function(){function j(e){void 0===e&&(e={}),this._backInStockReminderSaved=!1,this.product=null,this.id=e.id||Date.now()+"",this.productId=e.productId||"",this.sku=e.sku||null,this.barcodeList=e.barcodeList||[],this.baseBundlePrices=e.baseBundlePrices?e.baseBundlePrices.map((function(e){return new r(e)})):[],this.bundleSettings=e.bundleSettings?new c(e.bundleSettings):null,this.variantValues=e.variantValues?e.variantValues.map((function(e){return new n(e)})):[],this.images=e.images?e.images.map((function(e){return new u(e)})):[],this.attributes=e.attributes?e.attributes.map((function(e){return new o(e)})):[],this.prices=e.prices?e.prices.map((function(e){return new r(e)})):[],this.stock=e.stock||0,this.isActive=void 0===e.isActive||e.isActive,this.campaigns=e.campaigns||[],this.unit=e.unit?new P(e.unit):null,this.sellIfOutOfStock=e.sellIfOutOfStock||!1,this.images=y(this.images,"order"),S(this)}return Object.defineProperty(j.prototype,"mainImage",{get:function(){var e=f.getMainImage(this);return e?new u(e):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasStock",{get:function(){return f.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockEnabled",{get:function(){return b.isBackInStockEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockCustomerLoginRequired",{get:function(){return b.isCustomerLoginRequiredForBackInStock()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockReminderSaved",{get:function(){return this._backInStockReminderSaved},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"groupedAttributeValues",{get:function(){var e,t=h(this.attributes,"productAttributeId");return(null===(e=this.attributes)||void 0===e?void 0:e.map((function(e){var i=e.productAttributeId;if(i){var r=t[i];return(null==r?void 0:r.length)&&r[0].productAttribute?{attribute:r[0].productAttribute,values:r}:void 0}})).filter((function(e){return!!e})))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"b2bPriceRule",{get:function(){var e,t,i=this,r=O.getInstance().customerStore.customer,n=null==r?void 0:r.priceListRules,o=function(e){var t,r,n,o;if(e.type===p.CATEGORY)return u=null===(t=e.valueList)||void 0===t?void 0:t.some((function(e){var t;return null===(t=i.product)||void 0===t?void 0:t.categories.find((function(t){return t.id===e}))}));if(e.type===p.PRODUCT)return u=null===(r=e.valueList)||void 0===r?void 0:r.some((function(e){return i.id===e}));if(e.type===p.PRODUCT_BRAND){var u=null===(n=e.valueList)||void 0===n?void 0:n.some((function(e){var t,r;return(null===(r=null===(t=i.product)||void 0===t?void 0:t.brand)||void 0===r?void 0:r.id)===e}));return u}if(e.type===p.PRODUCT_TAG){u=null===(o=e.valueList)||void 0===o?void 0:o.some((function(e){var t,r;return null===(r=null===(t=i.product)||void 0===t?void 0:t.tags)||void 0===r?void 0:r.find((function(t){return t.id===e}))}));return u}};if(n){for(var u=0,c=n;u<c.length;u++){var l=c[u];if(l.shouldMatchAllFilters?null===(e=l.filters)||void 0===e?void 0:e.every(o):null===(t=l.filters)||void 0===t?void 0:t.some(o))return l}return null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"price",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.prices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return null===(t=this.prices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"bundlePrice",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.baseBundlePrices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return(null===(t=this.baseBundlePrices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId})))||this.price},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPrice",{get:function(){var e=0;this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?e=m.getFinalPrice(this.bundlePrice)+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.finalPriceWithQuantity:0)}),0):e=m.getFinalPrice(this.price);if(!this.b2bPriceRule)return e;switch(this.b2bPriceRule.valueType){case l.DISCOUNT_RATE:return e*((100-this.b2bPriceRule.value)/100);case l.DISCOUNT_AMOUNT:return e-this.b2bPriceRule.value;case l.FIXED_PRICE:return this.b2bPriceRule.value;default:return e}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPrice",{get:function(){return I(this.finalPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPrice",{get:function(){return this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?this.bundlePrice.sellPrice+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.sellPriceWithQuantity:0)}),0):this.price.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPrice",{get:function(){return I(this.sellPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedBuyPrice",{get:function(){return I(this.price.buyPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"appliedCampaignAmount",{get:function(){var e,t,i,r,n,o,u=this;if(!(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignId))return null;var c=(null===(r=null===(i=null===(t=this.product)||void 0===t?void 0:t.campaigns)||void 0===i?void 0:i.find((function(e){var t;return e.campaign.id===(null===(t=u.price.campaignPrice)||void 0===t?void 0:t.campaignId)})))||void 0===r?void 0:r.campaign)||null;if(!c)return null;var l={type:c.type,formattedPrice:null,discountPercentage:null},s=c.tieredDiscount&&c.tieredDiscount.rules&&c.tieredDiscount.rules.length>0&&c.tieredDiscount.rules[0].amount;return c.type===a.FIXED_AMOUNT&&(l.formattedPrice=I(c.fixedDiscount?(null===(n=c.fixedDiscount)||void 0===n?void 0:n.amount)||0:s||0,this.price.currency||"",this.price.currencySymbol||"")),c.type===a.RATIO&&(l.discountPercentage=c.fixedDiscount?(null===(o=c.fixedDiscount.amount)||void 0===o?void 0:o.toString())||null:s?s.toString():null),l},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignPrice",{get:function(){var e;return(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignPrice)||null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedCampaignPrice",{get:function(){return I(this.campaignPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPrice",{get:function(){return this.finalPrice===this.sellPrice?null:this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedDiscountPrice",{get:function(){return I(this.discountPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasDiscount",{get:function(){return this.finalPrice!==this.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountAmount",{get:function(){return this.hasDiscount?this.sellPrice-this.finalPrice:0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPercentage",{get:function(){return this.hasDiscount?(100-100*this.finalPrice/this.sellPrice).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPriceWithCampaignOffers",{get:function(){var e,t;return this.finalPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.finalPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPriceWithCampaignOffers",{get:function(){return I(this.finalPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPriceWithCampaignOffers",{get:function(){var e,t;return this.sellPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.sellPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPriceWithCampaignOffers",{get:function(){return I(this.sellPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignOffersDiscountPercentage",{get:function(){return this.finalPriceWithCampaignOffers!==this.sellPriceWithCampaignOffers?(100-100*this.finalPriceWithCampaignOffers/this.sellPriceWithCampaignOffers).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"tieredDiscountProducts",{get:function(){var e,t,i,r,n=this,o=null===(i=null===(t=null===(e=this.product)||void 0===e?void 0:e.campaigns)||void 0===t?void 0:t.find((function(e){return!!e.campaign.tieredDiscount})))||void 0===i?void 0:i.campaign,u=null===(r=null==o?void 0:o.tieredDiscount)||void 0===r?void 0:r.filters;if(u){var c=u.find((function(e){return e.type===s.PRODUCT_AND_VARIANT}));if(c){var l=[];if(c.idList.map((function(e){l.push(e.replace("p:","").replace("v:",""))})),!l.some((function(e){return n.id===e||n.productId===e})))return[]}}return o&&o.tieredDiscount?o.tieredDiscount.rules.every((function(e){return!e.lineItemQuantityRange}))?[]:o.tieredDiscount.rules.map((function(e){var t,i,r,u,c=o.applicablePrice===d.SELL_PRICE?n.sellPrice:n.finalPrice,l=c*((null===(t=e.lineItemQuantityRange)||void 0===t?void 0:t.min)||1),s=I(c,n.price.currency||"",n.price.currencySymbol||""),p=I(l,n.price.currency||"",n.price.currencySymbol||""),f=o.type===a.RATIO?c-c*(e.amount||1)/100:c,m=f*((null===(i=e.lineItemQuantityRange)||void 0===i?void 0:i.min)||1)-(o.type===a.FIXED_AMOUNT&&e.amount||0),b=I(f,n.price.currency||"",n.price.currencySymbol||""),v=I(m,n.price.currency||"",n.price.currencySymbol||"");return{amount:e.amount,lineItemQuantityRange:{min:(null===(r=e.lineItemQuantityRange)||void 0===r?void 0:r.min)||0,max:(null===(u=e.lineItemQuantityRange)||void 0===u?void 0:u.max)||0},type:o.type,sellPrice:c,finalPrice:f,sellPriceWithQuantity:l,finalPriceWithQuantity:m,formattedSellPrice:s,formattedSellPriceWithQuantity:p,formattedFinalPrice:b,formattedFinalPriceWithQuantity:v}})):[]},enumerable:!1,configurable:!0}),j.prototype.saveBackInStockReminder=function(i){var r;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,g({email:{eq:i},productId:{eq:this.productId},variantId:{eq:this.id}})];case 1:return(e=t.sent())&&(null===(r=e.data)||void 0===r?void 0:r.length)?(this._backInStockReminderSaved=!0,[2,!1]):[3,2];case 2:return[4,v({input:{email:i,productId:this.productId,variantId:this.id}})];case 3:return t.sent().isSuccess?(this._backInStockReminderSaved=!0,[2,!0]):(this._backInStockReminderSaved=!1,[2,!1]);case 4:return[2]}}))}))},j.prototype.toJSON=function(){var e=i({},this);return delete e.product,e},j}();export{j as IkasProductVariant};
@@ -1 +1 @@
1
- import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as r}from"../base/index.js";import{IkasStorefrontPopupAnalytics as o}from"./storefront-popup-analytics/index.js";import{IkasStorefrontPopupDateFilter as p}from"./storefront-popup-date-filter/index.js";import{IkasStorefrontPopupDisplayFilter as s}from"./storefront-popup-display-filter/index.js";import{IkasStorefrontPopupDisplaySettings as d}from"./storefront-popup-display-settings/index.js";import{IkasStorefrontPopupPageFilter as n}from"./storefront-popup-page-filter/index.js";import{IkasStorefrontPopupRouting as i}from"./storefront-popup-routing/index.js";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/components/index.js';import'./../../../ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumberMatcher.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/ParseError.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/metadata.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumber.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/AsYouType.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/Metadata.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js';import{Popup as t}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js';import"mobx";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js';import{IkasStorefrontConfig as l}from"@ikas/storefront-config";var u,m,a,b=function(r){function b(e){var b,j=this;(j=r.call(this,e)||this).analytics=e.analytics?new o(e.analytics):null,j.dateFilter=e.dateFilter?new p(e.dateFilter):null,j.displayFilters=e.displayFilters?e.displayFilters.map((function(e){return new s(e)})):null,j.displaySettings=e.displaySettings?new d(e.displaySettings):new d,j.name=e.name||"",j.pageFilters=e.pageFilters?e.pageFilters.map((function(e){return new n(e)})):null,j.status=e.status||u.ACTIVE,j.storefrontRoutings=e.storefrontRoutings?e.storefrontRoutings.map((function(e){return new i(e)})):[],j.type=e.type||m.FORM,j.visibleDevice=e.visibleDevice||a.ALL,j.isFilteredOnServerSide=e.isFilteredOnServerSide||null;var x=(null===(b=l.getMerchantSettings())||void 0===b?void 0:b.merchantId)||"",_=l.getCdnUrl()||"";return j.contentJson=e.contentJson?new t(e.contentJson,_,x):null,j}return e(b,r),b}(r);!function(e){e.ACTIVE="ACTIVE",e.DRAFT="DRAFT",e.PASSIVE="PASSIVE"}(u||(u={})),function(e){e.FORM="FORM",e.NOTIFICATION="NOTIFICATION",e.NOTIFICATION_BAR="NOTIFICATION_BAR",e.PAGE_OVERLAY="PAGE_OVERLAY",e.POPUP="POPUP"}(m||(m={})),function(e){e.ALL="ALL",e.DESKTOP="DESKTOP",e.MOBILE="MOBILE"}(a||(a={}));export{b as IkasStorefrontPopup,a as IkasStorefrontPopupDeviceTypeEnum,u as IkasStorefrontPopupStatusEnum,m as IkasStorefrontPopupTypeEnum};
1
+ import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as r}from"../base/index.js";import{IkasStorefrontPopupAnalytics as o}from"./storefront-popup-analytics/index.js";import{IkasStorefrontPopupDateFilter as s}from"./storefront-popup-date-filter/index.js";import{IkasStorefrontPopupDisplayFilter as p}from"./storefront-popup-display-filter/index.js";import{IkasStorefrontPopupDisplaySettings as n}from"./storefront-popup-display-settings/index.js";import{IkasStorefrontPopupPageFilter as t}from"./storefront-popup-page-filter/index.js";import{IkasStorefrontPopupRouting as d}from"./storefront-popup-routing/index.js";import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumberMatcher.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/ParseError.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/metadata.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumber.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/AsYouType.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/Metadata.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js';import{Popup as i}from'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js';import"mobx";import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js';import'./../../../packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js';import{IkasStorefrontConfig as l}from"@ikas/storefront-config";var a,u,m,b=function(r){function b(e){var b,c=this;(c=r.call(this,e)||this).analytics=e.analytics?new o(e.analytics):null,c.dateFilter=e.dateFilter?new s(e.dateFilter):null,c.displayFilters=e.displayFilters?e.displayFilters.map((function(e){return new p(e)})):null,c.displaySettings=e.displaySettings?new n(e.displaySettings):new n,c.name=e.name||"",c.pageFilters=e.pageFilters?e.pageFilters.map((function(e){return new t(e)})):null,c.status=e.status||a.ACTIVE,c.storefrontRoutings=e.storefrontRoutings?e.storefrontRoutings.map((function(e){return new d(e)})):[],c.type=e.type||u.FORM,c.visibleDevice=e.visibleDevice||m.ALL,c.isFilteredOnServerSide=e.isFilteredOnServerSide||null;var f=(null===(b=l.getMerchantSettings())||void 0===b?void 0:b.merchantId)||"",k=l.getCdnUrl()||"";return c.contentJson=e.contentJson?new i(e.contentJson,k,f):null,c}return e(b,r),b}(r);!function(e){e.ACTIVE="ACTIVE",e.DRAFT="DRAFT",e.PASSIVE="PASSIVE"}(a||(a={})),function(e){e.FORM="FORM",e.NOTIFICATION="NOTIFICATION",e.NOTIFICATION_BAR="NOTIFICATION_BAR",e.PAGE_OVERLAY="PAGE_OVERLAY",e.POPUP="POPUP"}(u||(u={})),function(e){e.ALL="ALL",e.DESKTOP="DESKTOP",e.MOBILE="MOBILE"}(m||(m={}));export{b as IkasStorefrontPopup,m as IkasStorefrontPopupDeviceTypeEnum,a as IkasStorefrontPopupStatusEnum,u as IkasStorefrontPopupTypeEnum};
@@ -1 +1 @@
1
- import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as n}from"./component/index.js";import{IkasThemeJsonComponentProp as o}from"./component/prop/index.js";import{IkasThemeJsonCustomData as r}from"./custom-data/index.js";import{IkasThemeJsonPage as i}from"./page/index.js";import{IkasThemeJsonPageComponent as t}from"./page/component/index.js";import{IkasThemeJsonSettings as a}from"./settings/index.js";import{IkasThemeJsonComponentPropType as s,IkasThemeJsonPageType as p}from"@ikas/storefront-models";var m="checkout",u=function(){function m(o){var t;void 0===o&&(o={}),this.name=o.name||"",this.components=o.components?o.components.map((function(e){return new n(e)})):[],this.pages=o.pages?o.pages.map((function(e){return new i(e)})):[],this.settings=o.settings?new a(o.settings):new a,this.customData=o.customData?null===(t=o.customData)||void 0===t?void 0:t.map((function(e){return new r(e)})):[],this.createCheckoutData(),e(this)}return Object.defineProperty(m.prototype,"headerComponent",{get:function(){return this.components.find((function(e){return e.isHeader}))},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"footerComponent",{get:function(){return this.components.find((function(e){return e.isFooter}))},enumerable:!1,configurable:!0}),m.prototype.createCheckoutData=function(){var e=this.components.find((function(e){return"checkout"===e.id})),r=this.pages.find((function(e){return"checkout"===e.id}));e||(e=new n({id:"checkout",dir:"",displayName:"",props:[new o({name:"logo",isRequired:!1,type:s.IMAGE}),new o({name:"showTax",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignOffersDesign",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignIsBiggerImage",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOfferIsSmallDesign",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersTitleColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersDescriptionColor",isRequired:!1,type:s.COLOR}),new o({name:"showCampaignShowDiscountSettings",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignHideDiscountBadge",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOfferCountdownStyleIsLine",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersDiscountPercentageColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersDiscountPercentageBgColor",isRequired:!1,type:s.COLOR}),new o({name:"showCampaignShowCountdownSettings",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersCountdownTextColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersCountdownTimeColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersCountdownBgColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersEnableMiddlePhase",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersMiddlePhaseOverlayColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOfferCountdownStyleIsLineSuccessPage",isRequired:!1,type:s.BOOLEAN}),new o({name:"buttonBgColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonTextColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonDisabledBgColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonDisabledTextColor",isRequired:!1,type:s.COLOR}),new o({name:"primaryTextColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryTextColor",isRequired:!1,type:s.COLOR}),new o({name:"primaryBgColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryBgColor",isRequired:!1,type:s.COLOR}),new o({name:"borderColor",isRequired:!1,type:s.COLOR}),new o({name:"cardBgColor",isRequired:!1,type:s.COLOR}),new o({name:"errorColor",isRequired:!1,type:s.COLOR}),new o({name:"errorLightColor",isRequired:!1,type:s.COLOR}),new o({name:"warningColor",isRequired:!1,type:s.COLOR}),new o({name:"warningLightColor",isRequired:!1,type:s.COLOR}),new o({name:"successColor",isRequired:!1,type:s.COLOR}),new o({name:"successLightColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonBgColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonTextColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonBorderColor",isRequired:!1,type:s.COLOR})]}),this.components.push(e)),r||this.pages.push(new i({id:"checkout",type:p.CHECKOUT,components:[new t({componentId:e.id,propValues:{logo:null,showTax:!0,showCampaignOffersDesign:!1,showCampaignIsBiggerImage:!1,campaignOfferIsSmallDesign:!1,showCampaignShowDiscountSettings:!1,showCampaignHideDiscountBadge:!1,campaignOfferCountdownStyleIsLine:!1,campaignOfferCountdownStyleIsLineSuccessPage:!1,showCampaignShowCountdownSettings:!1,campaignOffersEnableMiddlePhase:!1,campaignOffersTitleColor:c,campaignOffersDescriptionColor:O,campaignOffersDiscountPercentageColor:l,campaignOffersDiscountPercentageBgColor:g,campaignOffersCountdownTextColor:f,campaignOffersCountdownTimeColor:w,campaignOffersCountdownBgColor:y,campaignOffersMiddlePhaseOverlayColor:R,buttonBgColor:C,buttonTextColor:d,buttonDisabledBgColor:h,buttonDisabledTextColor:L,primaryTextColor:B,secondaryTextColor:F,primaryBgColor:q,secondaryBgColor:E,borderColor:D,cardBgColor:b,errorColor:x,errorLightColor:T,warningColor:S,warningLightColor:A,successColor:I,successLightColor:P,secondaryButtonBgColor:N,secondaryButtonTextColor:j,secondaryButtonBorderColor:k}})]}))},m}(),C="#272727",d="#FFFFFF",c="#272727",O="#272727",g="#FFF1BD",l="#272727",f="#272727",w="#FB4E4E",y="#FFF5F6",R="#27272799",h="#F7F7F9",L="#8A8B94",B="#272727",F="#8A8B94",q="#FFFFFF",E="#F7F7F9",D="#E5E4E9",b="#F7F7F9",x="#FB4E4E",T="#FCF3F4",S="#FFBC1F",A="#FFFAEE",I="#2DCA73",P="#F6FFED",N="#ffffff0",j="#272727",k="#E5E4E9";export{m as CHECKOUT_ID,u as IkasThemeJson};
1
+ import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as n}from"./component/index.js";import{IkasThemeJsonComponentProp as o}from"./component/prop/index.js";import{IkasThemeJsonCustomData as r}from"./custom-data/index.js";import{IkasThemeJsonPage as i}from"./page/index.js";import{IkasThemeJsonPageComponent as t}from"./page/component/index.js";import{IkasThemeJsonSettings as a}from"./settings/index.js";import{IkasThemeJsonComponentPropType as s,IkasThemeJsonPageType as p}from"@ikas/storefront-models";var m="checkout",u=function(){function m(o){var t;void 0===o&&(o={}),this.name=o.name||"",this.components=o.components?o.components.map((function(e){return new n(e)})):[],this.pages=o.pages?o.pages.map((function(e){return new i(e)})):[],this.settings=o.settings?new a(o.settings):new a,this.customData=o.customData?null===(t=o.customData)||void 0===t?void 0:t.map((function(e){return new r(e)})):[],this.createCheckoutData(),e(this)}return Object.defineProperty(m.prototype,"headerComponent",{get:function(){return this.components.find((function(e){return e.isHeader}))},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"footerComponent",{get:function(){return this.components.find((function(e){return e.isFooter}))},enumerable:!1,configurable:!0}),m.prototype.createCheckoutData=function(){var e=this.components.find((function(e){return"checkout"===e.id})),r=this.pages.find((function(e){return"checkout"===e.id}));e||(e=new n({id:"checkout",dir:"",displayName:"",props:[new o({name:"logo",isRequired:!1,type:s.IMAGE}),new o({name:"showTax",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignOffersDesign",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignIsBiggerImage",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOfferIsSmallDesign",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersTitleColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersDescriptionColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersContainerBgColor",isRequired:!1,type:s.COLOR}),new o({name:"showCampaignShowDiscountSettings",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignHideDiscountBadge",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOfferCountdownStyleIsLine",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersDiscountPercentageColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersDiscountPercentageBgColor",isRequired:!1,type:s.COLOR}),new o({name:"showCampaignShowCountdownSettings",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersCountdownTextColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersCountdownTimeColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersCountdownBgColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersEnableMiddlePhase",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersMiddlePhaseOverlayColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOfferCountdownStyleIsLineSuccessPage",isRequired:!1,type:s.BOOLEAN}),new o({name:"buttonBgColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonTextColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonDisabledBgColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonDisabledTextColor",isRequired:!1,type:s.COLOR}),new o({name:"primaryTextColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryTextColor",isRequired:!1,type:s.COLOR}),new o({name:"primaryBgColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryBgColor",isRequired:!1,type:s.COLOR}),new o({name:"borderColor",isRequired:!1,type:s.COLOR}),new o({name:"cardBgColor",isRequired:!1,type:s.COLOR}),new o({name:"errorColor",isRequired:!1,type:s.COLOR}),new o({name:"errorLightColor",isRequired:!1,type:s.COLOR}),new o({name:"warningColor",isRequired:!1,type:s.COLOR}),new o({name:"warningLightColor",isRequired:!1,type:s.COLOR}),new o({name:"successColor",isRequired:!1,type:s.COLOR}),new o({name:"successLightColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonBgColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonTextColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonBorderColor",isRequired:!1,type:s.COLOR})]}),this.components.push(e)),r||this.pages.push(new i({id:"checkout",type:p.CHECKOUT,components:[new t({componentId:e.id,propValues:{logo:null,showTax:!0,showCampaignOffersDesign:!1,showCampaignIsBiggerImage:!1,campaignOfferIsSmallDesign:!1,showCampaignShowDiscountSettings:!1,showCampaignHideDiscountBadge:!1,campaignOfferCountdownStyleIsLine:!1,campaignOfferCountdownStyleIsLineSuccessPage:!1,showCampaignShowCountdownSettings:!1,campaignOffersEnableMiddlePhase:!1,campaignOffersTitleColor:d,campaignOffersDescriptionColor:O,campaignOffersContainerBgColor:g,campaignOffersDiscountPercentageColor:l,campaignOffersDiscountPercentageBgColor:f,campaignOffersCountdownTextColor:w,campaignOffersCountdownTimeColor:R,campaignOffersCountdownBgColor:y,campaignOffersMiddlePhaseOverlayColor:h,buttonBgColor:C,buttonTextColor:c,buttonDisabledBgColor:L,buttonDisabledTextColor:B,primaryTextColor:F,secondaryTextColor:q,primaryBgColor:E,secondaryBgColor:D,borderColor:b,cardBgColor:x,errorColor:T,errorLightColor:S,warningColor:A,warningLightColor:I,successColor:P,successLightColor:N,secondaryButtonBgColor:j,secondaryButtonTextColor:k,secondaryButtonBorderColor:v}})]}))},m}(),C="#272727",c="#FFFFFF",d="#272727",O="#272727",g="#ffffff",f="#FFF1BD",l="#272727",w="#272727",R="#FB4E4E",y="#FFF5F6",h="#27272799",L="#F7F7F9",B="#8A8B94",F="#272727",q="#8A8B94",E="#FFFFFF",D="#F7F7F9",b="#E5E4E9",x="#F7F7F9",T="#FB4E4E",S="#FCF3F4",A="#FFBC1F",I="#FFFAEE",P="#2DCA73",N="#F6FFED",j="#ffffff0",k="#272727",v="#E5E4E9";export{m as CHECKOUT_ID,u as IkasThemeJson};