@ikas/storefront 5.0.0-beta.8 → 5.0.0

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 (244) hide show
  1. package/build/analytics/analytics.d.ts +4 -0
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/facebookPixel.d.ts +1 -0
  4. package/build/analytics/facebookPixel.js +1 -1
  5. package/build/analytics/googleAnalytics.d.ts +1 -0
  6. package/build/analytics/googleAnalytics.js +1 -1
  7. package/build/analytics/googleTagManager.d.ts +12 -21
  8. package/build/analytics/googleTagManager.js +1 -1
  9. package/build/analytics/head/index.js +1 -1
  10. package/build/analytics/ikas.d.ts +2 -1
  11. package/build/analytics/ikas.js +1 -1
  12. package/build/analytics/tiktokPixel.d.ts +1 -0
  13. package/build/analytics/tiktokPixel.js +1 -1
  14. package/build/components/checkout/components/address-form/index.js +1 -1
  15. package/build/components/checkout/components/address-form/model.d.ts +13 -2
  16. package/build/components/checkout/components/address-form/model.js +1 -1
  17. package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/index.d.ts +7 -0
  18. package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/index.js +1 -0
  19. package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/style.module.scss.js +1 -0
  20. package/build/components/checkout/components/cart-summary/cart-item/index.d.ts +1 -0
  21. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  22. package/build/components/checkout/components/cart-summary/cart-item/style.module.scss.js +1 -1
  23. package/build/components/checkout/components/cart-summary/cart-item/svg/arrow-down.d.ts +2 -0
  24. package/build/components/checkout/components/cart-summary/cart-item/svg/arrow-down.js +1 -0
  25. package/build/components/checkout/components/cart-summary/index.d.ts +11 -0
  26. package/build/components/checkout/components/cart-summary/index.js +1 -1
  27. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  28. package/build/components/checkout/components/credit-card-form/model.js +1 -1
  29. package/build/components/checkout/components/customer-addresses/index.js +1 -1
  30. package/build/components/checkout/components/customer-addresses/model.js +1 -1
  31. package/build/components/checkout/components/customer-addresses/style.module.scss.js +1 -1
  32. package/build/components/checkout/components/epaykolay-button/index.d.ts +5 -0
  33. package/build/components/checkout/components/epaykolay-button/index.js +1 -0
  34. package/build/components/checkout/components/epaykolay-button/style.module.scss.js +1 -0
  35. package/build/components/checkout/components/error/customer-account-disabled-error/index.d.ts +8 -0
  36. package/build/components/checkout/components/error/customer-account-disabled-error/index.js +1 -0
  37. package/build/components/checkout/components/error/customer-login-required-error/index.js +1 -1
  38. package/build/components/checkout/components/error/index.js +1 -1
  39. package/build/components/checkout/components/form-item/index.js +1 -1
  40. package/build/components/checkout/components/form-item/model.js +1 -1
  41. package/build/components/checkout/components/notification-box/index.d.ts +2 -0
  42. package/build/components/checkout/components/notification-box/index.js +1 -1
  43. package/build/components/checkout/components/offer-product/index.js +1 -1
  44. package/build/components/checkout/components/paypal/index.d.ts +7 -0
  45. package/build/components/checkout/components/paypal/index.js +1 -0
  46. package/build/components/checkout/components/paypal/style.module.scss.js +1 -0
  47. package/build/components/checkout/components/product-files/index.d.ts +7 -0
  48. package/build/components/checkout/components/product-files/index.js +1 -0
  49. package/build/components/checkout/components/product-files/style.module.scss.js +1 -0
  50. package/build/components/checkout/components/quick-registration/model.js +1 -1
  51. package/build/components/checkout/components/select-box/index.d.ts +1 -0
  52. package/build/components/checkout/components/select-box/index.js +1 -1
  53. package/build/components/checkout/components/stripe/index.js +1 -1
  54. package/build/components/checkout/components/svg/epaykolay.d.ts +6 -0
  55. package/build/components/checkout/components/svg/epaykolay.js +1 -0
  56. package/build/components/checkout/components/toggle/index.d.ts +1 -0
  57. package/build/components/checkout/components/toggle/index.js +1 -1
  58. package/build/components/checkout/components/toggle/style.module.scss.js +1 -1
  59. package/build/components/checkout/index.d.ts +2 -0
  60. package/build/components/checkout/index.js +1 -1
  61. package/build/components/checkout/model.d.ts +44 -17
  62. package/build/components/checkout/model.js +1 -1
  63. package/build/components/checkout/steps/step-payment/index.js +1 -1
  64. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  65. package/build/components/checkout/steps/step-payment/style.module.scss.js +1 -1
  66. package/build/components/checkout/steps/step-shipping/index.js +1 -1
  67. package/build/components/checkout/steps/step-success/index.js +1 -1
  68. package/build/components/checkout/steps/step-success/style.module.scss.js +1 -1
  69. package/build/components/checkout/style.module.scss.js +1 -1
  70. package/build/components/google-captcha/index.js +1 -1
  71. package/build/components/link/index.js +1 -1
  72. package/build/components/page/head.js +1 -1
  73. package/build/components/page/index.js +1 -1
  74. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  75. package/build/components/page-editor/model.d.ts +1 -0
  76. package/build/components/page-editor/model.js +1 -1
  77. package/build/hooks/useCustomerReviews.js +1 -1
  78. package/build/hooks/useStore.js +1 -1
  79. package/build/index.js +1 -1
  80. package/build/models/data/cart/available-shipping-method/estimated-delivery-time/index.d.ts +6 -0
  81. package/build/models/data/cart/available-shipping-method/estimated-delivery-time/index.js +1 -0
  82. package/build/models/data/cart/available-shipping-method/index.d.ts +2 -0
  83. package/build/models/data/cart/available-shipping-method/index.js +1 -1
  84. package/build/models/data/category/conditions/index.d.ts +21 -0
  85. package/build/models/data/category/conditions/index.js +1 -0
  86. package/build/models/data/category/index.d.ts +3 -0
  87. package/build/models/data/category/index.js +1 -1
  88. package/build/models/data/checkout/index.d.ts +2 -2
  89. package/build/models/data/checkout-settings/index.d.ts +2 -1
  90. package/build/models/data/checkout-settings/index.js +1 -1
  91. package/build/models/data/checkout-settings/price/index.d.ts +2 -1
  92. package/build/models/data/checkout-settings/price/index.js +1 -1
  93. package/build/models/data/contact-form/index.d.ts +1 -0
  94. package/build/models/data/contact-form/index.js +1 -1
  95. package/build/models/data/customer/address/ikas-localized-customer-address.d.ts +26 -12
  96. package/build/models/data/customer/address/ikas-localized-customer-address.js +1 -1
  97. package/build/models/data/customer/address/index.d.ts +5 -0
  98. package/build/models/data/customer/address/index.js +1 -1
  99. package/build/models/data/customer/address/region/index.d.ts +6 -0
  100. package/build/models/data/customer/address/region/index.js +1 -0
  101. package/build/models/data/customer/index.d.ts +7 -0
  102. package/build/models/data/customer/index.js +1 -1
  103. package/build/models/data/customer/price-list-rule/filter/index.d.ts +7 -0
  104. package/build/models/data/customer/price-list-rule/filter/index.js +1 -0
  105. package/build/models/data/customer/price-list-rule/index.d.ts +10 -0
  106. package/build/models/data/customer/price-list-rule/index.js +1 -0
  107. package/build/models/data/customer/review/index.d.ts +1 -0
  108. package/build/models/data/customer/review/index.js +1 -1
  109. package/build/models/data/favorite-product/index.d.ts +2 -0
  110. package/build/models/data/favorite-product/index.js +1 -1
  111. package/build/models/data/filter-category/index.d.ts +4 -0
  112. package/build/models/data/filter-category/index.js +1 -1
  113. package/build/models/data/html-meta-data/translations/index.d.ts +1 -0
  114. package/build/models/data/html-meta-data/translations/index.js +1 -1
  115. package/build/models/data/image/index.d.ts +1 -0
  116. package/build/models/data/image/index.js +1 -1
  117. package/build/models/data/index.d.ts +15 -1
  118. package/build/models/data/order/address/ikas-localized-order-address.d.ts +48 -18
  119. package/build/models/data/order/address/ikas-localized-order-address.js +1 -1
  120. package/build/models/data/order/address/index.d.ts +5 -0
  121. package/build/models/data/order/address/index.js +1 -1
  122. package/build/models/data/order/address/region/index.d.ts +6 -0
  123. package/build/models/data/order/address/region/index.js +1 -0
  124. package/build/models/data/order/index.d.ts +3 -0
  125. package/build/models/data/order/index.js +1 -1
  126. package/build/models/data/order/line-item/index.d.ts +5 -0
  127. package/build/models/data/order/line-item/index.js +1 -1
  128. package/build/models/data/order/line-item/variant/bundle-product/bundle-variant/index.d.ts +33 -0
  129. package/build/models/data/order/line-item/variant/bundle-product/bundle-variant/index.js +1 -0
  130. package/build/models/data/order/line-item/variant/bundle-product/index.d.ts +15 -0
  131. package/build/models/data/order/line-item/variant/bundle-product/index.js +1 -0
  132. package/build/models/data/order/line-item/variant/index.d.ts +4 -0
  133. package/build/models/data/order/line-item/variant/index.js +1 -1
  134. package/build/models/data/order/transaction/index.d.ts +1 -0
  135. package/build/models/data/order/transaction/index.js +1 -1
  136. package/build/models/data/order/transaction/payment-method-detail/index.d.ts +1 -0
  137. package/build/models/data/order/transaction/payment-method-detail/index.js +1 -1
  138. package/build/models/data/product/campaign-offer/index.d.ts +15 -0
  139. package/build/models/data/product/campaign-offer/index.js +1 -0
  140. package/build/models/data/product/filter/index.d.ts +2 -0
  141. package/build/models/data/product/filter/index.js +1 -1
  142. package/build/models/data/product/group/index.d.ts +11 -0
  143. package/build/models/data/product/group/index.js +1 -0
  144. package/build/models/data/product/group/translation/index.d.ts +13 -0
  145. package/build/models/data/product/group/translation/index.js +1 -0
  146. package/build/models/data/product/group/value/index.d.ts +7 -0
  147. package/build/models/data/product/group/value/index.js +1 -0
  148. package/build/models/data/product/image/index.d.ts +1 -0
  149. package/build/models/data/product/image/index.js +1 -1
  150. package/build/models/data/product/index.d.ts +34 -1
  151. package/build/models/data/product/index.js +1 -1
  152. package/build/models/data/product/variant/bundle-settings/bundle-product/index.d.ts +28 -0
  153. package/build/models/data/product/variant/bundle-settings/bundle-product/index.js +1 -0
  154. package/build/models/data/product/variant/bundle-settings/index.d.ts +8 -0
  155. package/build/models/data/product/variant/bundle-settings/index.js +1 -0
  156. package/build/models/data/product/variant/index.d.ts +35 -3
  157. package/build/models/data/product/variant/index.js +1 -1
  158. package/build/models/data/product/variant/price/index.d.ts +26 -0
  159. package/build/models/data/product/variant/price/index.js +1 -1
  160. package/build/models/data/product/variant/price/product-campaign-price/index.d.ts +6 -0
  161. package/build/models/data/product/variant/price/product-campaign-price/index.js +1 -0
  162. package/build/models/data/product-file/index.d.ts +8 -0
  163. package/build/models/data/product-file/index.js +1 -0
  164. package/build/models/data/shipping-zone/index.d.ts +9 -0
  165. package/build/models/data/shipping-zone/index.js +1 -0
  166. package/build/models/data/shipping-zone/state/city/district/index.d.ts +7 -0
  167. package/build/models/data/shipping-zone/state/city/district/index.js +1 -0
  168. package/build/models/data/shipping-zone/state/city/district/region/index.d.ts +6 -0
  169. package/build/models/data/shipping-zone/state/city/district/region/index.js +1 -0
  170. package/build/models/data/shipping-zone/state/city/index.d.ts +8 -0
  171. package/build/models/data/shipping-zone/state/city/index.js +1 -0
  172. package/build/models/data/shipping-zone/state/index.d.ts +9 -0
  173. package/build/models/data/shipping-zone/state/index.js +1 -0
  174. package/build/models/data/storefront/b2b-settings/index.d.ts +8 -0
  175. package/build/models/data/storefront/b2b-settings/index.js +1 -0
  176. package/build/models/data/storefront/index-page-seo-setting/index.d.ts +17 -0
  177. package/build/models/data/storefront/index-page-seo-setting/index.js +1 -0
  178. package/build/models/data/storefront/index.d.ts +6 -1
  179. package/build/models/data/storefront/index.js +1 -1
  180. package/build/models/data/theme-json/component/index.d.ts +2 -0
  181. package/build/models/data/theme-json/component/index.js +1 -1
  182. package/build/models/data/theme-json/component/prop/index.d.ts +2 -0
  183. package/build/models/data/theme-json/component/prop/index.js +1 -1
  184. package/build/models/data/theme-json/custom-data/index.d.ts +2 -0
  185. package/build/models/data/theme-json/custom-data/index.js +1 -1
  186. package/build/models/data/theme-json/index.js +1 -1
  187. package/build/models/data/video/index.d.ts +11 -0
  188. package/build/models/data/video/index.js +1 -0
  189. package/build/models/ui/blog-category-list/index.js +1 -1
  190. package/build/models/ui/brand-list/index.js +1 -1
  191. package/build/models/ui/category-list/index.js +1 -1
  192. package/build/models/ui/customer-review-list/index.js +1 -1
  193. package/build/models/ui/customer-review-summary-list/index.js +1 -1
  194. package/build/models/ui/index.d.ts +1 -1
  195. package/build/models/ui/product-attribute-list/index.js +1 -1
  196. package/build/models/ui/product-list/index.d.ts +25 -3
  197. package/build/models/ui/product-list/index.js +1 -1
  198. package/build/models/ui/raffle-list/index.js +1 -1
  199. package/build/models/ui/validator/form/account-info.js +1 -1
  200. package/build/models/ui/validator/form/address.js +1 -1
  201. package/build/models/ui/validator/form/contact-form.d.ts +6 -0
  202. package/build/models/ui/validator/form/contact-form.js +1 -1
  203. package/build/models/ui/validator/form/ikas-address.d.ts +46 -20
  204. package/build/models/ui/validator/form/ikas-address.js +1 -1
  205. package/build/models/ui/validator/form/login.d.ts +7 -4
  206. package/build/models/ui/validator/form/login.js +1 -1
  207. package/build/models/ui/validator/form/register.d.ts +10 -1
  208. package/build/models/ui/validator/form/register.js +1 -1
  209. package/build/page-data-init/index.d.ts +9 -1
  210. package/build/page-data-init/index.js +1 -1
  211. package/build/pages/account/activate.d.ts +4 -0
  212. package/build/pages/account/activate.js +1 -0
  213. package/build/pages/checkout.js +1 -1
  214. package/build/pages/home.js +1 -1
  215. package/build/pages/index.d.ts +1 -0
  216. package/build/store/base.d.ts +1 -0
  217. package/build/store/base.js +1 -1
  218. package/build/store/blog/index.js +1 -1
  219. package/build/store/brand/index.js +1 -1
  220. package/build/store/cart/index.d.ts +6 -2
  221. package/build/store/cart/index.js +1 -1
  222. package/build/store/category/index.js +1 -1
  223. package/build/store/checkout/index.d.ts +7 -2
  224. package/build/store/checkout/index.js +1 -1
  225. package/build/store/customer/api.d.ts +5 -1
  226. package/build/store/customer/api.js +1 -1
  227. package/build/store/customer/index.d.ts +25 -5
  228. package/build/store/customer/index.js +1 -1
  229. package/build/store/html-meta-data/index.js +1 -1
  230. package/build/store/index.d.ts +1 -1
  231. package/build/store/location/index.d.ts +2 -1
  232. package/build/store/location/index.js +1 -1
  233. package/build/store/product/index.d.ts +4 -1
  234. package/build/store/product/index.js +1 -1
  235. package/build/utils/constants.js +1 -1
  236. package/build/utils/helper.d.ts +1 -0
  237. package/build/utils/helper.js +1 -1
  238. package/package.json +18 -14
  239. package/build/analytics/googleUniversal.d.ts +0 -9
  240. package/build/analytics/googleUniversal.js +0 -1
  241. package/build/ext/@builder.io/partytown/integration/index.mjs.js +0 -1
  242. package/build/ext/@builder.io/partytown/react/index.mjs.js +0 -1
  243. package/build/models/data/checkout/country-settings-model.d.ts +0 -141
  244. package/build/models/data/checkout/country-settings-model.js +0 -1
@@ -1 +1 @@
1
- import{__spreadArray as t,__awaiter as e,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import n from"lodash/sortBy";import{IkasCategory as r}from"../category/index.js";import{IkasProductVariant as a}from"./variant/index.js";import{IkasProductAttributeValue as o}from"./attribute-value/index.js";import{IkasProductVariantType as s}from"./variant-type/index.js";import{IkasBrand as u}from"../brand/index.js";import{IkasHTMLMetaData as c}from"../html-meta-data/index.js";import{IkasProductTag as l}from"./tag/index.js";import{IkasProductType as d}from"@ikas/storefront-models";export{IkasProductType}from"@ikas/storefront-models";import{IkasProductOptionSet as p}from"./option-set/index.js";import{makeObservable as f,observable as m,computed as h}from"mobx";import{IkasProductFunctions as v}from"@ikas/storefront-model-functions";import{IkasProductCampaign as g}from"./campaign/index.js";import{IkasStorefrontConfig as b}from"@ikas/storefront-config";import{Analytics as y}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{IkasBaseStore as V}from"../../../store/base.js";import O from"lodash/groupBy";import{IkasProductBaseUnit as P}from"./base-unit/index.js";import{formatCurrency as j}from"../../../utils/currency.js";import"lodash/get";import S from"../../../store/product/index.js";import{IkasCustomerReviewList as w}from"../../ui/customer-review-list/index.js";import{IkasProductStar as I}from"./star/index.js";var T=function(){function T(v){void 0===v&&(v={});var O,T,x,C=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.selectVariantValue=function(e,i){var n,r=C.metaData,a=C.selectedVariantValues.map((function(t){return t.variantTypeId===e.variantTypeId?e:t})),o=C.variants.find((function(t){return t.isActive&&a.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))}));if(o)C.selectedVariantValues=a;else{var s=C.variantTypes.findIndex((function(t){return t.variantType.id===e.variantTypeId}));if(s>0){var u=C.variantTypes.slice(0,s),c=C.selectedVariantValues.filter((function(t){return u.some((function(e){return e.variantType.id===t.variantTypeId}))})),l=t(t([],c,!0),[e],!1);o=C.variants.find((function(t){return t.isActive&&l.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))}))}else{var d=a.slice(0,a.length-1);(o=C.variants.find((function(t){return t.isActive&&d.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))})))||(o=C.variants.find((function(t){return t.isActive&&t.variantValues.some((function(t){return t.id===e.id}))})))}if(!o)return;C.selectedVariantValues=o.variantValues}var p=C.variantTypes.map((function(t){var e=t.variantType,i=e.values.find((function(t){return C.selectedVariantValues.some((function(e){return e.id===t.id}))}));if(i)return"".concat(e.slug,"=").concat(i.slug)})).filter((function(t){return!!t})).join("&");if(!i){var f="/".concat(r.slug);if(p&&(f="/".concat(r.slug,"?").concat(p)),f===window.location.pathname)return;null===(n=V.getInstance().router)||void 0===n||n.replace(f,void 0,{shallow:!1,scroll:!1})}y.productView(C)},this.getVariantUnitPriceText=function(t){var e,i,n=t.price;if(n.unitPrice&&C.baseUnit){var r=C.baseUnit.baseAmount,a=(null===(i=null===(e=C.baseUnit)||void 0===e?void 0:e.unit)||void 0===i?void 0:i.name)||"";return"".concat(j(n.unitPrice,n.currency||"",n.currencySymbol||"")," / ").concat(r&&1!==r?r:"").concat(a)}},this.getCampaigns=function(){return e(C,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=V.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:b.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 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 e(C,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:return t=this.variants.map((function(t){return t.id})),e=b.getPickupStockLocationIds(),[4,S.getVariantStockLocations({stockLocationIdList:e,variantIds:t})];case 1:return[2,i.sent().data||[]]}}))}))},this.getCustomerReviews=function(t){return e(C,void 0,void 0,(function(){var e;return i(this,(function(i){switch(i.label){case 0:return[4,(e=new w({productId:this.id,limit:null==t?void 0:t.limit,page:null==t?void 0:t.page})).getInitial()];case 1:return i.sent(),[2,e]}}))}))},this.getProductOptionSet=function(){return e(C,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:return this.productOptionSet?[2,!0]:this.productOptionSetId?[4,S.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(),[2,!0]):[2,!1]}}))}))},this.setOptionPrices=function(){var t,e=C.variants[0];if(e){var i=e.price.currency;null===(t=C.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===i})))||void 0===e?void 0:e.price)||t.price)})),t.otherPrices&&(t.price=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===i})))||void 0===e?void 0:e.price)||t.price)}))}},this.id=v.id||Date.now()+"",this.name=v.name||"",this.type=v.type||d.PHYSICAL,this.description=v.description||"",this.shortDescription=v.shortDescription||"",this.metaData=v.metaData?new c(v.metaData):null,this.brand=v.brand?new u(v.brand):null,this.categories=v.categories?v.categories.map((function(t){return new r(t)})):[],this.deleted=v.deleted||null,this.tags=v.tags?v.tags.map((function(t){return new l(t)})):[],this.variants=v.variants?v.variants.map((function(t){return new a(t)})):[],this.attributes=v.attributes?v.attributes.map((function(t){return new o(t)})):[],this.variantTypes=v.variantTypes?v.variantTypes.map((function(t){return new s(t)})):[],this.productOptionSetId=v.productOptionSetId||null,this.averageRating=null!==(O=v.averageRating)&&void 0!==O?O:null,this.reviewCount=null!==(T=v.reviewCount)&&void 0!==T?T:null,this.stars=v.stars?v.stars.map((function(t){return new I(t)})):null,this.baseUnit=v.baseUnit?new P(v.baseUnit):null,this.productOptionSet=v.productOptionSet?new p(v.productOptionSet):null,this.campaigns=(null===(x=v.campaigns)||void 0===x?void 0:x.map((function(t){return new g(t)})))||null,this.selectedVariantValues=v.selectedVariantValues||[],this.variantTypes=n(this.variantTypes,"order"),this.groupVariantsByVariantTypeId=v.groupVariantsByVariantTypeId||null,this.setOptionPrices(),f(this,{selectedVariantValues:m,isFiltered:m,hasVariant:h,hasStock:h,hasValidProductOptionValues:h,href:h,productHref:h,mainVariantType:h,mainVariantValue:h,selectedVariant:h,displayedVariantTypes:h,isCustomerReviewEnabled:h,isCustomerReviewLoginRequired:h,isAddToCartEnabled:h,groupedAttributeValues:h,selectedVariantUnitPriceText:h})}return Object.defineProperty(T.prototype,"hasVariant",{get:function(){return v.hasVariant(this)},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"hasStock",{get:function(){return v.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"hasValidProductOptionValues",{get:function(){return!this.productOptionSet||this.productOptionSet.hasValidValues},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"href",{get:function(){return v.getSelectedVariantHref(this,this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"productHref",{get:function(){return this.groupVariantsByVariantTypeId||this.isFiltered?this.href:v.getProductHref(this)},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"mainVariantType",{get:function(){return v.getMainVariantType(this)},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"mainVariantValue",{get:function(){return v.getMainVariantValue(this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(T.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(T.prototype,"displayedVariantTypes",{get:function(){return v.getDisplayedVariantTypes(this,this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"isCustomerReviewEnabled",{get:function(){return b.isCustomerReviewEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"isCustomerReviewLoginRequired",{get:function(){return b.isCustomerReviewLoginRequired()},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"isAddToCartEnabled",{get:function(){return this.hasValidProductOptionValues&&(this.selectedVariant.hasStock||this.selectedVariant.sellIfOutOfStock)},enumerable:!1,configurable:!0}),Object.defineProperty(T.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(T.prototype,"selectedVariantUnitPriceText",{get:function(){return this.getVariantUnitPriceText(this.selectedVariant)},enumerable:!1,configurable:!0}),T}();export{T 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 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 v}from"./option-set/index.js";import{makeObservable as h,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 P}from"../../../store/base.js";import O from"lodash/groupBy";import{IkasProductBaseUnit as I}from"./base-unit/index.js";import{formatCurrency as w}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 x,IkasProductOffer as C}from"./campaign-offer/index.js";import{IkasProductGroup as k}from"./group/index.js";import{IkasImage as E}from"../image/index.js";var A=function(){function A(b){void 0===b&&(b={});var O,E,G,L=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.selectVariantValue=function(i,n){var r,a=L.metaData,o=L.selectedVariantValues.map((function(t){return t.variantTypeId===i.variantTypeId?i:t})),u=L.variants.find((function(t){return t.isActive&&o.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))}));if(u)L.selectedVariantValues=o;else{var s=L.variantTypes.findIndex((function(t){return t.variantType.id===i.variantTypeId}));if(s>0){var c=L.variantTypes.slice(0,s),d=L.selectedVariantValues.filter((function(t){return c.some((function(e){return e.variantType.id===t.variantTypeId}))})),l=t(t([],d,!0),[i],!1);u=L.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=L.variants.find((function(t){return t.isActive&&p.every((function(e){return t.variantValues.some((function(t){return t.id===e.id}))}))})))||(u=L.variants.find((function(t){return t.isActive&&t.variantValues.some((function(t){return t.id===i.id}))})))}if(!u)return;L.selectedVariantValues=u.variantValues}var f={};new URLSearchParams(window.location.search).forEach((function(t,i){var n;"vid"!==i&&(f=e(e({},f),((n={})[i]=t,n)))})),L.variantTypes.map((function(t){delete f[t.variantType.slug]}));var v=t(t([],L.variantTypes.map((function(t){var e=t.variantType,i=e.values.find((function(t){return L.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(!n){var h="/".concat(a.slug);if(v&&(h="/".concat(a.slug,"?").concat(v)),h===window.location.pathname)return;null===(r=P.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&&L.baseUnit){var r=L.baseUnit.baseAmount,a=(null===(i=null===(e=L.baseUnit)||void 0===e?void 0:e.unit)||void 0===i?void 0:i.name)||"";return"".concat(w(n.unitPrice,n.currency||"",n.currencySymbol||"")," / ").concat(r&&1!==r?r:"").concat(a)}},this.getCampaigns=function(){return i(L,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=P.getInstance(),e=t.customerStore.customer,i=e?e.customerGroupIds:null,r=this.variants.map((function(t){return t.id})),[4,S.getProductCampaigns({input:{customerGroupIds:i,salesChannelId:y.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(L,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=y.getPickupStockLocationIds(),[4,S.getVariantStockLocations({stockLocationIdList:e,variantIds:t})];case 1:return[2,i.sent().data||[]]}}))}))},this.getCustomerReviews=function(t){return i(L,void 0,void 0,(function(){var e;return n(this,(function(i){switch(i.label){case 0:return[4,(e=new j({productId:this.id,limit:null==t?void 0:t.limit,page:null==t?void 0:t.page})).getInitial()];case 1:return i.sent(),[2,e]}}))}))},this.getProductOptionSet=function(){return i(L,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,S.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(),[2,!0]):[2,!1]}}))}))},this.initBundleProducts=function(){return i(L,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=P.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.getBundleProductsOfVariant=function(t){return i(L,void 0,void 0,(function(){var e,i,r,o,u,s,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,S.searchProducts({input:{productIdList:e,perPage:200}})]:[3,2];case 1:(i=n.sent()).isSuccess&&(null===(u=null===(o=i.data)||void 0===o?void 0:o.data)||void 0===u||u.forEach((function(t){c.bundleProductCache[t.id]=t}))),n.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 A(a(e)))})),[2]}}))}))},this.setOptionPrices=function(){var t,e=L.variants[0];if(e){var i=e.price.currency;null===(t=L.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===i})))||void 0===e?void 0:e.price)||t.price)})),t.otherPrices&&(t.price=(null===(e=t.otherPrices.find((function(t){return t.currencyCode===i})))||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!==(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 T(t)})):null,this.baseUnit=b.baseUnit?new I(b.baseUnit):null,this.productOptionSet=b.productOptionSet?new v(b.productOptionSet):null,this.campaigns=(null===(G=b.campaigns)||void 0===G?void 0:G.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 x(t)})):null,this.appliedCampaignOffer=b.appliedCampaignOffer,this.offers=b.offers?b.offers.map((function(t){return new C(t)})):void 0,this.productGroup=b.productGroup?new k(b.productGroup):null,this.productGroupItems=b.productGroupItems,this.setOptionPrices(),this.variants.forEach((function(t){return t.product=L})),h(this,{selectedVariantValues:m,isFiltered:m,isStatic: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(A.prototype,"hasVariant",{get:function(){return b.hasVariant(this)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"hasStock",{get:function(){return this.isStatic?this.selectedVariant.hasStock:b.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"hasValidProductOptionValues",{get:function(){return!this.productOptionSet||this.productOptionSet.hasValidValues},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"href",{get:function(){return b.getSelectedVariantHref(this,this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"productHref",{get:function(){return this.groupVariantsByVariantTypeId||this.isFiltered?this.href:b.getProductHref(this)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"mainVariantType",{get:function(){return b.getMainVariantType(this)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"mainVariantValue",{get:function(){return b.getMainVariantValue(this.selectedVariantValues)},enumerable:!1,configurable:!0}),Object.defineProperty(A.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(A.prototype,"displayedVariantTypes",{get:function(){return this.hasVariant?b.getDisplayedVariantTypes(this,this.selectedVariantValues):[]},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"isCustomerReviewEnabled",{get:function(){return y.isCustomerReviewEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"isCustomerReviewLoginRequired",{get:function(){return y.isCustomerReviewLoginRequired()},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"isAddToCartEnabled",{get:function(){return this.hasValidProductOptionValues&&(this.selectedVariant.hasStock||this.selectedVariant.sellIfOutOfStock)},enumerable:!1,configurable:!0}),Object.defineProperty(A.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(A.prototype,"selectedVariantUnitPriceText",{get:function(){return this.getVariantUnitPriceText(this.selectedVariant)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"displayedProductGroups",{get:function(){var e,i=this,n=[],r=[];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,a={name:e,items:[]};null===(n=i.productGroupItems)||void 0===n||n.forEach((function(n){var r,o,u,s=n.groupValues.find((function(t){return t.name===e}));if(s&&!a.items.some((function(t){return t.value===s.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),[s],!1),p=null===(o=i.productGroupItems)||void 0===o?void 0:o.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}a.items.push({image:n.image?new E(n.image):null,href:c,value:s.value,isSelected:(null===(u=i.productGroupItems)||void 0===u?void 0:u.some((function(t){return t.groupValues.some((function(t){return t.value===s.value}))&&t.productId===i.id})))||!1})}})),r.push(a)})),r},enumerable:!1,configurable:!0}),A}();export{A as IkasProduct};
@@ -0,0 +1,28 @@
1
+ import { IkasBundleProduct as IBundleProduct } from "@ikas/storefront-models";
2
+ import { IkasProduct } from "../../../";
3
+ export declare class IkasBundleProduct implements IBundleProduct {
4
+ id: string;
5
+ addToBundleBasePrice: boolean | null;
6
+ discountRatio: number | null;
7
+ filteredVariantIds: string[];
8
+ maxQuantity: number | null;
9
+ minQuantity: number | null;
10
+ order: number;
11
+ productId: string;
12
+ quantity: number;
13
+ product: IkasProduct | null;
14
+ private _initialQuantity;
15
+ constructor(data?: Partial<IBundleProduct>);
16
+ get isQuantityEditable(): boolean;
17
+ get shouldDisplayPrice(): boolean;
18
+ get finalPrice(): number;
19
+ get finalPriceWithQuantity(): number;
20
+ get formattedFinalPrice(): string;
21
+ get formattedFinalPriceWithQuantity(): string;
22
+ get sellPrice(): number;
23
+ get sellPriceWithQuantity(): number;
24
+ get formattedSellPrice(): string;
25
+ get formattedSellPriceWithQuantity(): string;
26
+ setProduct: (product: IkasProduct) => void;
27
+ setQuantity: (quantity: number) => void;
28
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";import{formatCurrency as i}from"../../../../../../utils/currency.js";var e=function(){function e(i){void 0===i&&(i={});var e=this;this.product=null,this._initialQuantity=null,this.setProduct=function(t){t.variants=t.variants.filter((function(t){return e.filteredVariantIds.includes(t.id)})),e.product=t,e.product.selectedVariantValues=e.product.variants[0].variantValues,e.quantity=e._initialQuantity||0},this.setQuantity=function(t){t<0||(null!==e.minQuantity&&t<e.minQuantity?e.quantity=e.minQuantity:null!==e.maxQuantity&&t>e.maxQuantity?e.quantity=e.maxQuantity:e.quantity=t)},this.id=i.id||"",this.addToBundleBasePrice=i.addToBundleBasePrice||null,this.discountRatio=i.discountRatio||null,this.filteredVariantIds=i.filteredVariantIds||[],this.maxQuantity=i.maxQuantity||null,this.minQuantity=i.minQuantity||null,this.order=i.order||0,this.productId=i.productId||"",this.quantity=i.quantity||0,this._initialQuantity=this.quantity,t(this)}return Object.defineProperty(e.prototype,"isQuantityEditable",{get:function(){return null!==this.maxQuantity||null!==this.minQuantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldDisplayPrice",{get:function(){return!0===this.addToBundleBasePrice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"finalPrice",{get:function(){var t,i=(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.finalPrice)||0;return this.addToBundleBasePrice&&this.discountRatio&&(i-=i*(this.discountRatio/100)),i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"finalPriceWithQuantity",{get:function(){return this.finalPrice*this.quantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedFinalPrice",{get:function(){var t,e;return i(this.finalPrice,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedFinalPriceWithQuantity",{get:function(){var t,e;return i(this.finalPriceWithQuantity,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sellPrice",{get:function(){var t;return(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.sellPrice)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sellPriceWithQuantity",{get:function(){return this.sellPrice*this.quantity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedSellPrice",{get:function(){var t,e;return i(this.sellPrice,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"formattedSellPriceWithQuantity",{get:function(){var t,e;return i(this.sellPriceWithQuantity,(null===(t=this.product)||void 0===t?void 0:t.selectedVariant.price.currency)||"",(null===(e=this.product)||void 0===e?void 0:e.selectedVariant.price.currencySymbol)||"")},enumerable:!1,configurable:!0}),e}();export{e as IkasBundleProduct};
@@ -0,0 +1,8 @@
1
+ import { IkasBundleSettings as IBundleSettings } from "@ikas/storefront-models";
2
+ import { IkasBundleProduct } from "./bundle-product";
3
+ export declare class IkasBundleSettings implements IBundleSettings {
4
+ maxBundleQuantity: number | null;
5
+ minBundleQuantity: number | null;
6
+ products: IkasBundleProduct[];
7
+ constructor(data?: Partial<IBundleSettings>);
8
+ }
@@ -0,0 +1 @@
1
+ import{IkasBundleProduct as n}from"./bundle-product/index.js";var t=function(t){void 0===t&&(t={}),this.maxBundleQuantity=t.maxBundleQuantity||null,this.minBundleQuantity=t.minBundleQuantity||null,this.products=t.products?t.products.map((function(t){return new n(t)})):[]};export{t as IkasBundleSettings};
@@ -3,15 +3,19 @@ import { IkasVariantValue } from "../../variant-type/variant-value";
3
3
  import { IkasProductAttributeMap, IkasProductAttributeValue } from "../attribute-value";
4
4
  import { IkasProductCampaign } from "../campaign";
5
5
  import { IkasProductImage } from "../image";
6
- import { IkasProductVariant as IProductVariant } from "@ikas/storefront-models";
6
+ import { IkasBundleSettings } from "./bundle-settings";
7
+ import { IkasCampaignType, IkasProductVariant as IProductVariant } from "@ikas/storefront-models";
7
8
  import { IkasProductVariantUnit } from "./unit";
9
+ import { IkasProduct } from "..";
8
10
  export declare class IkasProductVariant implements IProductVariant {
9
11
  id: string;
10
12
  sku: string | null;
11
13
  barcodeList: string[] | null;
14
+ baseBundlePrices: IkasProductPrice[] | null;
15
+ bundleSettings: IkasBundleSettings | null;
12
16
  variantValues: IkasVariantValue[];
13
17
  attributes: IkasProductAttributeValue[];
14
- price: IkasProductPrice;
18
+ prices: IkasProductPrice[];
15
19
  stock: number;
16
20
  isActive: boolean;
17
21
  productId: string;
@@ -20,12 +24,40 @@ export declare class IkasProductVariant implements IProductVariant {
20
24
  campaigns?: IkasProductCampaign[];
21
25
  unit: IkasProductVariantUnit | null;
22
26
  private _backInStockReminderSaved;
23
- constructor(data?: Partial<IProductVariant>);
27
+ product?: IkasProduct | null;
28
+ constructor(data?: Partial<IkasProductVariant>);
24
29
  get mainImage(): IkasProductImage | undefined;
25
30
  get hasStock(): boolean;
26
31
  get isBackInStockEnabled(): boolean;
27
32
  get isBackInStockCustomerLoginRequired(): boolean | null | undefined;
28
33
  get isBackInStockReminderSaved(): boolean;
29
34
  get groupedAttributeValues(): IkasProductAttributeMap[];
35
+ get b2bPriceRule(): import("../..").IkasCustomerPriceListRule | null;
36
+ get price(): IkasProductPrice;
37
+ get bundlePrice(): IkasProductPrice;
38
+ get finalPrice(): number;
39
+ get formattedFinalPrice(): string;
40
+ get sellPrice(): number;
41
+ get formattedSellPrice(): string;
42
+ get formattedBuyPrice(): string;
43
+ get appliedCampaignAmount(): AppliedCampaignAmount | null;
44
+ get campaignPrice(): number | null;
45
+ get formattedCampaignPrice(): string;
46
+ get discountPrice(): number | null;
47
+ get formattedDiscountPrice(): string;
48
+ get hasDiscount(): boolean;
49
+ get discountAmount(): number;
50
+ get discountPercentage(): string | 0;
51
+ get finalPriceWithCampaignOffers(): number;
52
+ get formattedFinalPriceWithCampaignOffers(): string;
53
+ get sellPriceWithCampaignOffers(): number;
54
+ get formattedSellPriceWithCampaignOffers(): string;
55
+ get campaignOffersDiscountPercentage(): string | 0;
30
56
  saveBackInStockReminder(email: string): Promise<boolean>;
57
+ toJSON(): this;
31
58
  }
59
+ export declare type AppliedCampaignAmount = {
60
+ type: IkasCampaignType;
61
+ formattedPrice: string | null;
62
+ discountPercentage: string | null;
63
+ };
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e}from'./../../../../ext/tslib/tslib.es6.js';import{IkasProductPrice as i}from"./price/index.js";import{IkasVariantValue as r}from"../../variant-type/variant-value/index.js";import{IkasProductAttributeValue as n}from"../attribute-value/index.js";import{IkasProductImage as o}from"../image/index.js";import{IkasProductVariantFunctions as a}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{saveProductBackInStockRemind as u,listProductBackInStockRemind as c}from"@ikas/storefront-api";import d from"lodash/groupBy";import p from"lodash/sortBy";import{IkasProductVariantUnit as m}from"./unit/index.js";var f=function(){function f(t){void 0===t&&(t={}),this._backInStockReminderSaved=!1,this.id=t.id||Date.now()+"",this.productId=t.productId||"",this.sku=t.sku||null,this.barcodeList=t.barcodeList||[],this.variantValues=t.variantValues?t.variantValues.map((function(t){return new r(t)})):[],this.images=t.images?t.images.map((function(t){return new o(t)})):[],this.attributes=t.attributes?t.attributes.map((function(t){return new n(t)})):[],this.price=t.price?new i(t.price):new i,this.stock=t.stock||0,this.isActive=void 0===t.isActive||t.isActive,this.campaigns=t.campaigns||[],this.unit=t.unit?new m(t.unit):null,this.sellIfOutOfStock=t.sellIfOutOfStock||!1,this.images=p(this.images,"order")}return Object.defineProperty(f.prototype,"mainImage",{get:function(){var t=a.getMainImage(this);return t?new o(t):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"hasStock",{get:function(){return a.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"isBackInStockEnabled",{get:function(){return s.isBackInStockEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"isBackInStockCustomerLoginRequired",{get:function(){return s.isCustomerLoginRequiredForBackInStock()},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"isBackInStockReminderSaved",{get:function(){return this._backInStockReminderSaved},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"groupedAttributeValues",{get:function(){var t,e=d(this.attributes,"productAttributeId");return(null===(t=this.attributes)||void 0===t?void 0:t.map((function(t){var i=t.productAttributeId;if(i){var r=e[i];return(null==r?void 0:r.length)&&r[0].productAttribute?{attribute:r[0].productAttribute,values:r}:void 0}})).filter((function(t){return!!t})))||[]},enumerable:!1,configurable:!0}),f.prototype.saveBackInStockReminder=function(i){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,c({email:{eq:i},productId:{eq:this.productId},variantId:{eq:this.id}})];case 1:return(t=e.sent())&&(null===(r=t.data)||void 0===r?void 0:r.length)?(this._backInStockReminderSaved=!0,[2,!1]):[3,2];case 2:return[4,u({input:{email:i,productId:this.productId,variantId:this.id}})];case 3:return e.sent().isSuccess?(this._backInStockReminderSaved=!0,[2,!0]):(this._backInStockReminderSaved=!1,[2,!1]);case 4:return[2]}}))}))},f}();export{f 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 s,IkasCampaignType as a,IkasCustomerPriceListRuleFilterType as l}from"@ikas/storefront-models";import{IkasProductVariantFunctions as d,IkasProductPriceFunctions as f}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{saveProductBackInStockRemind as m,listProductBackInStockRemind as b}from"@ikas/storefront-api";import v from"lodash/groupBy";import h from"lodash/sortBy";import{IkasProductVariantUnit as g}from"./unit/index.js";import{formatCurrency as P}from"../../../../utils/currency.js";import{makeAutoObservable as y}from"mobx";import{IkasBaseStore as O}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var S=function(){function S(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 g(e.unit):null,this.sellIfOutOfStock=e.sellIfOutOfStock||!1,this.images=h(this.images,"order"),y(this)}return Object.defineProperty(S.prototype,"mainImage",{get:function(){var e=d.getMainImage(this);return e?new u(e):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasStock",{get:function(){return d.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isBackInStockEnabled",{get:function(){return p.isBackInStockEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isBackInStockCustomerLoginRequired",{get:function(){return p.isCustomerLoginRequiredForBackInStock()},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isBackInStockReminderSaved",{get:function(){return this._backInStockReminderSaved},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"groupedAttributeValues",{get:function(){var e,t=v(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(S.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===l.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===l.PRODUCT)return u=null===(r=e.valueList)||void 0===r?void 0:r.some((function(e){return i.id===e}));if(e.type===l.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===l.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 s=c[u];if(s.shouldMatchAllFilters?null===(e=s.filters)||void 0===e?void 0:e.every(o):null===(t=s.filters)||void 0===t?void 0:t.some(o))return s}return null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"price",{get:function(){var e,t;if(p.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 p.getPriceListId()?e.priceListId===p.getPriceListId():null===e.priceListId}))},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"bundlePrice",{get:function(){var e,t;if(p.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 p.getPriceListId()?e.priceListId===p.getPriceListId():null===e.priceListId})))||this.price},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"finalPrice",{get:function(){var e=0;this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?e=f.getFinalPrice(this.bundlePrice)+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.finalPriceWithQuantity:0)}),0):e=f.getFinalPrice(this.price);if(!this.b2bPriceRule)return e;switch(this.b2bPriceRule.valueType){case s.DISCOUNT_RATE:return e*((100-this.b2bPriceRule.value)/100);case s.DISCOUNT_AMOUNT:return e-this.b2bPriceRule.value;case s.FIXED_PRICE:return this.b2bPriceRule.value;default:return e}},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedFinalPrice",{get:function(){return P(this.finalPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.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(S.prototype,"formattedSellPrice",{get:function(){return P(this.sellPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedBuyPrice",{get:function(){return P(this.price.buyPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.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 s=(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(!s)return null;var l={type:s.type,formattedPrice:null,discountPercentage:null};return s.type===a.FIXED_AMOUNT&&(l.formattedPrice=P((null===(n=s.fixedDiscount)||void 0===n?void 0:n.amount)||0,this.price.currency||"",this.price.currencySymbol||"")),s.type===a.RATIO&&(l.discountPercentage=(null===(u=null===(o=s.fixedDiscount)||void 0===o?void 0:o.amount)||void 0===u?void 0:u.toString())||null),l},enumerable:!1,configurable:!0}),Object.defineProperty(S.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(S.prototype,"formattedCampaignPrice",{get:function(){return P(this.campaignPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"discountPrice",{get:function(){return this.finalPrice===this.sellPrice?null:this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedDiscountPrice",{get:function(){return P(this.discountPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasDiscount",{get:function(){return this.finalPrice!==this.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"discountAmount",{get:function(){return this.hasDiscount?this.sellPrice-this.finalPrice:0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"discountPercentage",{get:function(){return this.hasDiscount?(100-100*this.finalPrice/this.sellPrice).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(S.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(S.prototype,"formattedFinalPriceWithCampaignOffers",{get:function(){return P(this.finalPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.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(S.prototype,"formattedSellPriceWithCampaignOffers",{get:function(){return P(this.sellPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"campaignOffersDiscountPercentage",{get:function(){return this.finalPriceWithCampaignOffers!==this.sellPriceWithCampaignOffers?(100-100*this.finalPriceWithCampaignOffers/this.sellPriceWithCampaignOffers).toFixed(0):0},enumerable:!1,configurable:!0}),S.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,b({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,m({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]}}))}))},S.prototype.toJSON=function(){var e=i({},this);return delete e.product,e},S}();export{S as IkasProductVariant};
@@ -1,6 +1,8 @@
1
1
  import { IkasProductPrice as IProductPrice } from "@ikas/storefront-models";
2
+ import { IkasProductCampaignPrice } from "./product-campaign-price";
2
3
  export declare class IkasProductPrice implements IProductPrice {
3
4
  buyPrice: number | null;
5
+ campaignPrice: IkasProductCampaignPrice | null;
4
6
  currency: string | null;
5
7
  currencySymbol: string | null;
6
8
  discountPrice: number | null;
@@ -8,12 +10,36 @@ export declare class IkasProductPrice implements IProductPrice {
8
10
  sellPrice: number;
9
11
  unitPrice: number | null;
10
12
  constructor(data?: IProductPrice);
13
+ /**
14
+ * @deprecated Use variant.finalPrice instead.
15
+ */
11
16
  get finalPrice(): number;
17
+ /**
18
+ * @deprecated Use variant.formattedFinalPrice instead.
19
+ */
12
20
  get formattedFinalPrice(): string;
21
+ /**
22
+ * @deprecated Use variant.formattedBuyPrice instead.
23
+ */
13
24
  get formattedBuyPrice(): string;
25
+ /**
26
+ * @deprecated Use variant.formattedDiscountPrice instead.
27
+ */
14
28
  get formattedDiscountPrice(): string;
29
+ /**
30
+ * @deprecated Use variant.formattedSellPrice instead.
31
+ */
15
32
  get formattedSellPrice(): string;
33
+ /**
34
+ * @deprecated Use variant.hasDiscount instead.
35
+ */
16
36
  get hasDiscount(): boolean;
37
+ /**
38
+ * @deprecated Use variant.discountAmount instead.
39
+ */
17
40
  get discountAmount(): number;
41
+ /**
42
+ * @deprecated Use variant.discountPercentage instead.
43
+ */
18
44
  get discountPercentage(): string | 0;
19
45
  }
@@ -1 +1 @@
1
- import{IkasProductPriceFunctions as e}from"@ikas/storefront-model-functions";import{formatCurrency as r}from"../../../../../utils/currency.js";var t=function(){function t(e){var r,t,i,n,u,c,o;this.buyPrice=null,this.currency=null,this.currencySymbol=null,this.discountPrice=null,this.priceListId=null,this.unitPrice=null,this.buyPrice=null!==(r=null==e?void 0:e.buyPrice)&&void 0!==r?r:null,this.currency=null!==(t=null==e?void 0:e.currency)&&void 0!==t?t:null,this.currencySymbol=null!==(i=null==e?void 0:e.currencySymbol)&&void 0!==i?i:"",this.discountPrice=null!==(n=null==e?void 0:e.discountPrice)&&void 0!==n?n:null,this.priceListId=null!==(u=null==e?void 0:e.priceListId)&&void 0!==u?u:null,this.sellPrice=null!==(c=null==e?void 0:e.sellPrice)&&void 0!==c?c:0,this.unitPrice=null!==(o=null==e?void 0:e.unitPrice)&&void 0!==o?o:null}return Object.defineProperty(t.prototype,"finalPrice",{get:function(){return e.getFinalPrice(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formattedFinalPrice",{get:function(){return r(this.finalPrice,this.currency||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formattedBuyPrice",{get:function(){return r(this.buyPrice||0,this.currency||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formattedDiscountPrice",{get:function(){return r(this.discountPrice||0,this.currency||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formattedSellPrice",{get:function(){return r(this.sellPrice||0,this.currency||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasDiscount",{get:function(){return e.hasDiscount(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"discountAmount",{get:function(){return e.getDiscountAmount(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"discountPercentage",{get:function(){return e.getDiscountPercentage(this)},enumerable:!1,configurable:!0}),t}();export{t as IkasProductPrice};
1
+ import{IkasProductPriceFunctions as e}from"@ikas/storefront-model-functions";import{formatCurrency as r}from"../../../../../utils/currency.js";import{IkasProductCampaignPrice as i}from"./product-campaign-price/index.js";var t=function(){function t(e){var r,t,n,c,u,l,o;this.buyPrice=null,this.campaignPrice=null,this.currency=null,this.currencySymbol=null,this.discountPrice=null,this.priceListId=null,this.unitPrice=null,this.buyPrice=null!==(r=null==e?void 0:e.buyPrice)&&void 0!==r?r:null,this.campaignPrice=(null==e?void 0:e.campaignPrice)?new i(e.campaignPrice):null,this.currency=null!==(t=null==e?void 0:e.currency)&&void 0!==t?t:null,this.currencySymbol=null!==(n=null==e?void 0:e.currencySymbol)&&void 0!==n?n:"",this.discountPrice=null!==(c=null==e?void 0:e.discountPrice)&&void 0!==c?c:null,this.priceListId=null!==(u=null==e?void 0:e.priceListId)&&void 0!==u?u:null,this.sellPrice=null!==(l=null==e?void 0:e.sellPrice)&&void 0!==l?l:0,this.unitPrice=null!==(o=null==e?void 0:e.unitPrice)&&void 0!==o?o:null}return Object.defineProperty(t.prototype,"finalPrice",{get:function(){return e.getFinalPrice(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formattedFinalPrice",{get:function(){return r(this.finalPrice,this.currency||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formattedBuyPrice",{get:function(){return r(this.buyPrice||0,this.currency||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formattedDiscountPrice",{get:function(){return r(this.discountPrice||0,this.currency||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formattedSellPrice",{get:function(){return r(this.sellPrice||0,this.currency||"",this.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasDiscount",{get:function(){return e.hasDiscount(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"discountAmount",{get:function(){return e.getDiscountAmount(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"discountPercentage",{get:function(){return e.getDiscountPercentage(this)},enumerable:!1,configurable:!0}),t}();export{t as IkasProductPrice};
@@ -0,0 +1,6 @@
1
+ import { IkasProductCampaignPrice as IProductCampaignPrice } from "@ikas/storefront-models";
2
+ export declare class IkasProductCampaignPrice implements IProductCampaignPrice {
3
+ campaignId: string | null;
4
+ campaignPrice: number | null;
5
+ constructor(data: IProductCampaignPrice);
6
+ }
@@ -0,0 +1 @@
1
+ var a=function(a){this.campaignId=a.campaignId,this.campaignPrice=a.campaignPrice};export{a as IkasProductCampaignPrice};
@@ -0,0 +1,8 @@
1
+ import { IkasProductFile as IProductFile } from "@ikas/storefront-models";
2
+ export declare class IkasProductFile implements IProductFile {
3
+ id: string;
4
+ name: string;
5
+ productId: string;
6
+ variantId: string;
7
+ constructor(data: IProductFile);
8
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";var i=function(i){this.id=i.id,this.name=i.name,this.productId=i.productId,this.variantId=i.variantId,t(this)};export{i as IkasProductFile};
@@ -0,0 +1,9 @@
1
+ import { IkasShippingZone as IShippingZone } from "@ikas/storefront-models";
2
+ import { IkasShippingZoneState } from "./state";
3
+ export declare class IkasShippingZone implements IShippingZone {
4
+ countryId: string;
5
+ postalCodes: string[];
6
+ showAllStates: boolean;
7
+ states: IkasShippingZoneState[] | null;
8
+ constructor(data: IShippingZone);
9
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as t}from"mobx";var s=function(s){this.countryId=s.countryId||"",this.showAllStates=s.showAllStates,this.postalCodes=s.postalCodes||[],this.states=s.states||null,t(this)};export{s as IkasShippingZone};
@@ -0,0 +1,7 @@
1
+ import { IkasShippingZoneDistrict as IShippingZoneDistrict } from "@ikas/storefront-models";
2
+ import { IkasShippingZoneRegion } from "./region";
3
+ export declare class IkasShippingZoneDistrict implements IShippingZoneDistrict {
4
+ id: string;
5
+ regions: IkasShippingZoneRegion[] | null;
6
+ constructor(data: IShippingZoneDistrict);
7
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as i}from"mobx";var o=function(o){this.id=o.id||"",this.regions=o.regions||null,i(this)};export{o as IkasShippingZoneDistrict};
@@ -0,0 +1,6 @@
1
+ import { IkasShippingZoneRegion as IShippingZoneRegion } from "@ikas/storefront-models";
2
+ import { IkasBaseModel } from "../../../../../base";
3
+ export declare class IkasShippingZoneRegion extends IkasBaseModel implements IShippingZoneRegion {
4
+ name: string;
5
+ constructor(data: IShippingZoneRegion);
6
+ }
@@ -0,0 +1 @@
1
+ import{__extends as r}from'./../../../../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import{IkasBaseModel as t}from"../../../../../base/index.js";var e=function(t){function e(r){var e=t.call(this,r)||this;return e.name=r.name||"",o(e),e}return r(e,t),e}(t);export{e as IkasShippingZoneRegion};
@@ -0,0 +1,8 @@
1
+ import { IkasShippingZoneCity as IShippingZoneCity } from "@ikas/storefront-models";
2
+ import { IkasShippingZoneDistrict } from "./district";
3
+ export declare class IkasShippingZoneCity implements IShippingZoneCity {
4
+ districts: IkasShippingZoneDistrict[] | null;
5
+ id: string;
6
+ showAllDistricts: boolean;
7
+ constructor(data: IShippingZoneCity);
8
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as i}from"mobx";var t=function(t){this.districts=t.districts||null,this.id=t.id||"",this.showAllDistricts=t.showAllDistricts,i(this)};export{t as IkasShippingZoneCity};
@@ -0,0 +1,9 @@
1
+ import { IkasShippingZoneState as IShippingZoneState } from "@ikas/storefront-models";
2
+ import { IkasShippingZoneCity } from "./city";
3
+ export declare class IkasShippingZoneState implements IShippingZoneState {
4
+ cities: IkasShippingZoneCity[] | null;
5
+ id: string;
6
+ postalCodes: string[];
7
+ showAllCities: boolean;
8
+ constructor(data: IShippingZoneState);
9
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as i}from"mobx";var s=function(s){this.cities=s.cities||null,this.id=s.id||"",this.postalCodes=s.postalCodes||[],this.showAllCities=s.showAllCities,i(this)};export{s as IkasShippingZoneState};
@@ -0,0 +1,8 @@
1
+ import { IkasStorefrontB2BShowPricesEnum, IkasStorefrontB2BShowProductsEnum } from "@ikas/storefront-models";
2
+ export declare class IkasStorefrontB2BSettings implements IkasStorefrontB2BSettings {
3
+ allowOnlyApprovedCustomersToLogin: boolean;
4
+ showPrices: IkasStorefrontB2BShowPricesEnum;
5
+ showProducts: IkasStorefrontB2BShowProductsEnum;
6
+ constructor(data?: Partial<IkasStorefrontB2BSettings>);
7
+ }
8
+ export { IkasStorefrontB2BShowPricesEnum, IkasStorefrontB2BShowProductsEnum };
@@ -0,0 +1 @@
1
+ import{IkasStorefrontB2BShowPricesEnum as o,IkasStorefrontB2BShowProductsEnum as s}from"@ikas/storefront-models";export{IkasStorefrontB2BShowPricesEnum,IkasStorefrontB2BShowProductsEnum}from"@ikas/storefront-models";var r=function(r){void 0===r&&(r={}),this.allowOnlyApprovedCustomersToLogin=r.allowOnlyApprovedCustomersToLogin||!1,this.showPrices=r.showPrices||o.ALWAYS,this.showProducts=r.showProducts||s.ALWAYS};export{r as IkasStorefrontB2BSettings};
@@ -0,0 +1,17 @@
1
+ import { IkasIndexPageSeoSetting as IIndexPageSeoSetting } from "@ikas/storefront-models";
2
+ import { IkasImage } from "../../image";
3
+ export declare class IkasIndexPageSeoSetting implements IIndexPageSeoSetting {
4
+ canonicals: string[] | null;
5
+ createdAt: any | null;
6
+ deleted: boolean;
7
+ description: string | null;
8
+ disableIndex: boolean | null;
9
+ favIcon: string | null;
10
+ id: string;
11
+ locale: string;
12
+ pageTitle: string | null;
13
+ slug: string | null;
14
+ updatedAt: number;
15
+ icon?: IkasImage | null;
16
+ constructor(data: IIndexPageSeoSetting);
17
+ }
@@ -0,0 +1 @@
1
+ import{makeAutoObservable as i}from"mobx";import{IkasImage as t}from"../../image/index.js";var e=function(e){this.canonicals=e.canonicals||null,this.createdAt=e.createdAt,this.deleted=e.deleted||!1,this.description=e.description||null,this.disableIndex=void 0!==e.disableIndex&&null!==e.disableIndex?e.disableIndex:null,this.favIcon=e.favIcon||null,this.id=e.id,this.locale=e.locale||"",this.pageTitle=e.pageTitle||null,this.slug=e.slug||null,this.updatedAt=e.updatedAt,this.icon=e.icon?new t(e.icon):null,!this.icon&&this.favIcon&&(this.icon=new t({id:this.favIcon,isVideo:!1})),i(this)};export{e as IkasIndexPageSeoSetting};
@@ -2,13 +2,16 @@ import { IkasStorefrontLocalization } from "./localization";
2
2
  import { IkasStorefrontDomain } from "./domain";
3
3
  import { IkasStorefrontRouting } from "./routing";
4
4
  import { IkasStorefrontTheme } from "./theme";
5
- import { IkasStorefrontStatus } from "@ikas/storefront-models";
5
+ import { IkasStorefrontStatus, IkasStorefrontType } from "@ikas/storefront-models";
6
6
  import { IkasStorefront as IStorefront } from "@ikas/storefront-models";
7
7
  import { IkasStorefontMetaTemplates } from "./meta-templates";
8
+ import { IkasIndexPageSeoSetting } from "./index-page-seo-setting";
9
+ import { IkasStorefrontB2BSettings } from "./b2b-settings";
8
10
  export declare class IkasStorefront implements IStorefront {
9
11
  id: string;
10
12
  name: string;
11
13
  status: IkasStorefrontStatus;
14
+ b2bSettings: IkasStorefrontB2BSettings | null;
12
15
  mainStorefrontThemeId: string | null;
13
16
  metaTemplates: IkasStorefontMetaTemplates[] | null;
14
17
  pickUpStockLocationIds: string[] | null;
@@ -20,11 +23,13 @@ export declare class IkasStorefront implements IStorefront {
20
23
  universalAnalyticsId: string | null;
21
24
  tiktokPixelId: string | null;
22
25
  token: string | null;
26
+ type: IkasStorefrontType;
23
27
  robotsTxt: string | null;
24
28
  localizations: IkasStorefrontLocalization[];
25
29
  routings: IkasStorefrontRouting[];
26
30
  domains: IkasStorefrontDomain[];
27
31
  themes: IkasStorefrontTheme[];
32
+ indexPageSeoSettings: IkasIndexPageSeoSetting[];
28
33
  constructor(data?: Partial<IkasStorefront>);
29
34
  }
30
35
  export { IkasStorefrontStatus };
@@ -1 +1 @@
1
- import{IkasStorefrontLocalization as t}from"./localization/index.js";import{IkasStorefrontDomain as i}from"./domain/index.js";import{IkasStorefrontRouting as n}from"./routing/index.js";import{IkasStorefrontTheme as s}from"./theme/index.js";import{IkasStorefrontStatus as o}from"@ikas/storefront-models";export{IkasStorefrontStatus}from"@ikas/storefront-models";import{makeAutoObservable as e}from"mobx";import{IkasStorefontMetaTemplates as a}from"./meta-templates/index.js";var l=function(l){void 0===l&&(l={}),this.id=l.id||"",this.name=l.name||"",this.status=l.status||o.WAITING,this.mainStorefrontThemeId=l.mainStorefrontThemeId||null,this.pickUpStockLocationIds=l.pickUpStockLocationIds||null,this.emailSettingsId=l.emailSettingsId||null,this.salesChannelId=l.salesChannelId||null,this.gtmId=l.gtmId||null,this.fbpId=l.fbpId||null,this.analytics4Id=l.analytics4Id||null,this.universalAnalyticsId=l.universalAnalyticsId||null,this.tiktokPixelId=l.tiktokPixelId||null,this.token=l.token||null,this.robotsTxt=l.robotsTxt||null,this.metaTemplates=l.metaTemplates?l.metaTemplates.map((function(t){return new a(t)})):null,this.localizations=l.localizations?l.localizations.map((function(i){return new t(i)})):[],this.routings=l.routings?l.routings.map((function(t){return new n(t)})):[],this.domains=l.domains?l.domains.map((function(t){return new i(t)})):[],this.themes=l.themes?l.themes.map((function(t){return new s(t)})):[],e(this)};export{l as IkasStorefront};
1
+ import{IkasStorefrontLocalization as t}from"./localization/index.js";import{IkasStorefrontDomain as i}from"./domain/index.js";import{IkasStorefrontRouting as n}from"./routing/index.js";import{IkasStorefrontTheme as e}from"./theme/index.js";import{IkasStorefrontStatus as s,IkasStorefrontType as o}from"@ikas/storefront-models";export{IkasStorefrontStatus}from"@ikas/storefront-models";import{makeAutoObservable as a}from"mobx";import{IkasStorefontMetaTemplates as l}from"./meta-templates/index.js";import{IkasIndexPageSeoSetting as m}from"./index-page-seo-setting/index.js";import{IkasStorefrontB2BSettings as r}from"./b2b-settings/index.js";var d=function(d){void 0===d&&(d={}),this.id=d.id||"",this.name=d.name||"",this.status=d.status||s.WAITING,this.b2bSettings=d.b2bSettings?new r(d.b2bSettings):null,this.mainStorefrontThemeId=d.mainStorefrontThemeId||null,this.pickUpStockLocationIds=d.pickUpStockLocationIds||null,this.emailSettingsId=d.emailSettingsId||null,this.salesChannelId=d.salesChannelId||null,this.gtmId=d.gtmId||null,this.fbpId=d.fbpId||null,this.analytics4Id=d.analytics4Id||null,this.universalAnalyticsId=d.universalAnalyticsId||null,this.tiktokPixelId=d.tiktokPixelId||null,this.token=d.token||null,this.type=d.type||o.STOREFRONT,this.robotsTxt=d.robotsTxt||null,this.metaTemplates=d.metaTemplates?d.metaTemplates.map((function(t){return new l(t)})):null,this.localizations=d.localizations?d.localizations.map((function(i){return new t(i)})):[],this.routings=d.routings?d.routings.map((function(t){return new n(t)})):[],this.domains=d.domains?d.domains.map((function(t){return new i(t)})):[],this.themes=d.themes?d.themes.map((function(t){return new e(t)})):[],this.indexPageSeoSettings=d.indexPageSeoSettings?d.indexPageSeoSettings.map((function(t){return new m(t)})):[],a(this)};export{d as IkasStorefront};
@@ -14,7 +14,9 @@ export declare class IkasThemeJsonComponent implements IThemeJsonComponent {
14
14
  defaultPropValuesTranslations: {
15
15
  [locale: string]: any;
16
16
  };
17
+ commonPropValues?: Record<string, any> | null;
17
18
  constructor(data: Partial<IkasThemeJsonComponent>);
19
+ get isCommon(): boolean;
18
20
  }
19
21
  export declare class ComponentTranslation {
20
22
  displayName: string | null;
@@ -1 +1 @@
1
- import{makeAutoObservable as i}from"mobx";import{IkasThemeJsonComponentProp as s}from"./prop/index.js";var t=function(t){this.translations={},this.defaultPropValuesTranslations={},this.id=t.id||"",this.dir=t.dir||"",this.displayName=t.displayName||"",this.description=t.description||"",this.props=t.props?t.props.map((function(i){return new s(i)})):[],this.translations=t.translations||{},this.isHeader=t.isHeader||!1,this.isFooter=t.isFooter||!1,this.defaultPropValuesTranslations=t.defaultPropValuesTranslations||{},i(this)},o=function(i){void 0===i&&(i={}),this.displayName=i.displayName||null,this.description=i.description||null};export{o as ComponentTranslation,t as IkasThemeJsonComponent};
1
+ import{makeAutoObservable as i}from"mobx";import{IkasThemeJsonComponentProp as s}from"./prop/index.js";var t=function(){function t(t){this.translations={},this.defaultPropValuesTranslations={},this.id=t.id||"",this.dir=t.dir||"",this.displayName=t.displayName||"",this.description=t.description||"",this.props=t.props?t.props.map((function(i){return new s(i)})):[],this.translations=t.translations||{},this.isHeader=t.isHeader||!1,this.isFooter=t.isFooter||!1,this.defaultPropValuesTranslations=t.defaultPropValuesTranslations||{},this.commonPropValues=t.commonPropValues||null,i(this)}return Object.defineProperty(t.prototype,"isCommon",{get:function(){return this.isHeader||this.isFooter},enumerable:!1,configurable:!0}),t}(),o=function(i){void 0===i&&(i={}),this.displayName=i.displayName||null,this.description=i.description||null};export{o as ComponentTranslation,t as IkasThemeJsonComponent};
@@ -16,6 +16,8 @@ export declare class IkasThemeJsonComponentProp implements IThemeJsonComponentPr
16
16
  translations?: {
17
17
  [locale: string]: PropTranslation;
18
18
  };
19
+ excludedFields?: string[] | null;
20
+ excludedFieldsCategory?: string[] | null;
19
21
  constructor(data: Partial<IkasThemeJsonComponentProp>);
20
22
  }
21
23
  export { IkasThemeJsonComponentPropType };
@@ -1 +1 @@
1
- import{IkasThemeJsonComponentPropType as t}from"@ikas/storefront-models";export{IkasThemeJsonComponentPropType}from"@ikas/storefront-models";import{makeAutoObservable as i}from"mobx";var e=function(e){this.translations={},this.id=e.id||Date.now()+"",this.name=e.name||"",this.displayName=e.displayName||"",this.description=e.description||"",this.type=e.type||t.TEXT,this.isRequired=e.isRequired||!1,this.customDataId=e.customDataId||null,this.requiredPropId=e.requiredPropId,this.requiredEnumOptionId=e.requiredEnumOptionId,this.requiredEnumOptionValue=e.requiredEnumOptionValue,this.attributeTypes=e.attributeTypes||null,this.sliderData=e.sliderData||{},this.translations=e.translations||{},i(this)};export{e as IkasThemeJsonComponentProp};
1
+ import{IkasThemeJsonComponentPropType as e}from"@ikas/storefront-models";export{IkasThemeJsonComponentPropType}from"@ikas/storefront-models";import{makeAutoObservable as t}from"mobx";var i=function(i){this.translations={},this.id=i.id||Date.now()+"",this.name=i.name||"",this.displayName=i.displayName||"",this.description=i.description||"",this.type=i.type||e.TEXT,this.isRequired=i.isRequired||!1,this.customDataId=i.customDataId||null,this.requiredPropId=i.requiredPropId,this.requiredEnumOptionId=i.requiredEnumOptionId,this.requiredEnumOptionValue=i.requiredEnumOptionValue,this.attributeTypes=i.attributeTypes||null,this.sliderData=i.sliderData||{},this.translations=i.translations||{},this.excludedFields=i.excludedFields||[],this.excludedFieldsCategory=i.excludedFieldsCategory||[],t(this)};export{i as IkasThemeJsonComponentProp};
@@ -19,6 +19,8 @@ export declare class IkasThemeJsonCustomData implements IThemeJsonCustomData {
19
19
  sliderData: IkasThemeJsonSliderData;
20
20
  isRoot: boolean;
21
21
  parent?: IkasThemeJsonCustomData | null;
22
+ excludedFields?: string[] | null;
23
+ excludedFieldsCategory?: string[] | null;
22
24
  constructor(data?: Partial<IkasThemeJsonCustomData>);
23
25
  get flat(): IkasThemeJsonCustomData[];
24
26
  toJSON(): this;
@@ -1 +1 @@
1
- import{__assign as t}from'./../../../../ext/tslib/tslib.es6.js';import i from"lodash/flatten";import{IkasThemeJsonComponentPropType as n}from"@ikas/storefront-models";var e=function(){function e(i){void 0===i&&(i={});var a,o=this;this.translations={},this.customDataId=null,this.id=i.id||"",this.name=i.name||null,this.description=i.description||null,this.typescriptName=i.name||null,this.type=i.type||n.TEXT,this.isRequired=void 0===i.isRequired||i.isRequired,this.translations=i.translations||{},this.key=i.key||null,this.parent=i.parent||null,this.itemCount=i.itemCount||null,this.attributeTypes=i.attributeTypes||null,this.enumOptions=(null===(a=i.enumOptions)||void 0===a?void 0:a.map((function(t){return new s(t)})))||null,this.customDataId=i.customDataId||null,this.sliderData=i.sliderData||{},this.isRoot=i.isRoot||!1,this.nestedData=i.nestedData?i.nestedData.map((function(i){return new e(t(t({},i),{parent:o}))})):null,this.type!==n.STATIC_LIST||this.itemCount||(this.itemCount=1)}return Object.defineProperty(e.prototype,"flat",{get:function(){if(!this.nestedData||!this.nestedData.length)return[this];var t=i(this.nestedData.map((function(t){return t.flat}))),n=[];return n.push(this),n=n.concat(t)},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var i=t({},this);return delete i.parent,i},e}(),s=function(t){void 0===t&&(t={}),this.translations={},this.id=t.id||"",this.displayName=t.displayName||"",this.value=t.value||"",this.translations=t.translations||{}},a=function(t){void 0===t&&(t={}),this.name=t.name||null,this.description=t.description||null},o=function(t){void 0===t&&(t={}),this.displayName=t.displayName||null};export{e as IkasThemeJsonCustomData,o as IkasThemeJsonCustomDataEnumOptionTranslation,a as IkasThemeJsonCustomDataTranslation,s as IkasThemeJsonEnumOption};
1
+ import{__assign as t}from'./../../../../ext/tslib/tslib.es6.js';import i from"lodash/flatten";import{IkasThemeJsonComponentPropType as e}from"@ikas/storefront-models";var s=function(){function s(i){void 0===i&&(i={});var a,l=this;this.translations={},this.customDataId=null,this.id=i.id||"",this.name=i.name||null,this.description=i.description||null,this.typescriptName=i.name||null,this.type=i.type||e.TEXT,this.isRequired=void 0===i.isRequired||i.isRequired,this.translations=i.translations||{},this.key=i.key||null,this.parent=i.parent||null,this.itemCount=i.itemCount||null,this.attributeTypes=i.attributeTypes||null,this.enumOptions=(null===(a=i.enumOptions)||void 0===a?void 0:a.map((function(t){return new n(t)})))||null,this.customDataId=i.customDataId||null,this.sliderData=i.sliderData||{},this.isRoot=i.isRoot||!1,this.nestedData=i.nestedData?i.nestedData.map((function(i){return new s(t(t({},i),{parent:l}))})):null,this.type!==e.STATIC_LIST||this.itemCount||(this.itemCount=1),this.excludedFields=i.excludedFields||[],this.excludedFieldsCategory=i.excludedFieldsCategory||[]}return Object.defineProperty(s.prototype,"flat",{get:function(){if(!this.nestedData||!this.nestedData.length)return[this];var t=i(this.nestedData.map((function(t){return t.flat}))),e=[];return e.push(this),e=e.concat(t)},enumerable:!1,configurable:!0}),s.prototype.toJSON=function(){var i=t({},this);return delete i.parent,i},s}(),n=function(t){void 0===t&&(t={}),this.translations={},this.id=t.id||"",this.displayName=t.displayName||"",this.value=t.value||"",this.translations=t.translations||{}},a=function(t){void 0===t&&(t={}),this.name=t.name||null,this.description=t.description||null},l=function(t){void 0===t&&(t={}),this.displayName=t.displayName||null};export{s as IkasThemeJsonCustomData,l as IkasThemeJsonCustomDataEnumOptionTranslation,a as IkasThemeJsonCustomDataTranslation,n as IkasThemeJsonEnumOption};
@@ -1 +1 @@
1
- import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as o}from"./component/index.js";import{IkasThemeJsonComponentProp as t}from"./component/prop/index.js";import{IkasThemeJsonCustomData as n}from"./custom-data/index.js";import{IkasThemeJsonPage as r}from"./page/index.js";import{IkasThemeJsonPageComponent as i}from"./page/component/index.js";import{IkasThemeJsonSettings as s}from"./settings/index.js";import{IkasThemeJsonComponentPropType as a,IkasThemeJsonPageType as p}from"@ikas/storefront-models";var u="checkout",m=function(){function u(t){var i;void 0===t&&(t={}),this.name=t.name||"",this.components=t.components?t.components.map((function(e){return new o(e)})):[],this.pages=t.pages?t.pages.map((function(e){return new r(e)})):[],this.settings=t.settings?new s(t.settings):new s,this.customData=t.customData?null===(i=t.customData)||void 0===i?void 0:i.map((function(e){return new n(e)})):[],this.createCheckoutData(),e(this)}return Object.defineProperty(u.prototype,"headerComponent",{get:function(){return this.components.find((function(e){return e.isHeader}))},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"footerComponent",{get:function(){return this.components.find((function(e){return e.isFooter}))},enumerable:!1,configurable:!0}),u.prototype.createCheckoutData=function(){var e=this.components.find((function(e){return"checkout"===e.id})),n=this.pages.find((function(e){return"checkout"===e.id}));e||(e=new o({id:"checkout",dir:"",displayName:"",props:[new t({name:"showTax",isRequired:!1,type:a.BOOLEAN}),new t({name:"buttonBgColor",isRequired:!1,type:a.COLOR}),new t({name:"buttonTextColor",isRequired:!1,type:a.COLOR}),new t({name:"buttonDisabledBgColor",isRequired:!1,type:a.COLOR}),new t({name:"buttonDisabledTextColor",isRequired:!1,type:a.COLOR}),new t({name:"primaryTextColor",isRequired:!1,type:a.COLOR}),new t({name:"secondaryTextColor",isRequired:!1,type:a.COLOR}),new t({name:"primaryBgColor",isRequired:!1,type:a.COLOR}),new t({name:"secondaryBgColor",isRequired:!1,type:a.COLOR}),new t({name:"borderColor",isRequired:!1,type:a.COLOR}),new t({name:"cardBgColor",isRequired:!1,type:a.COLOR}),new t({name:"errorColor",isRequired:!1,type:a.COLOR}),new t({name:"errorLightColor",isRequired:!1,type:a.COLOR}),new t({name:"warningColor",isRequired:!1,type:a.COLOR}),new t({name:"warningLightColor",isRequired:!1,type:a.COLOR}),new t({name:"successColor",isRequired:!1,type:a.COLOR}),new t({name:"successLightColor",isRequired:!1,type:a.COLOR})]}),this.components.push(e)),n||this.pages.push(new r({id:"checkout",type:p.CHECKOUT,components:[new i({componentId:e.id,propValues:{showTax:!0,buttonBgColor:c,buttonTextColor:C,buttonDisabledBgColor:d,buttonDisabledTextColor:l,primaryTextColor:O,secondaryTextColor:g,primaryBgColor:F,secondaryBgColor:R,borderColor:y,cardBgColor:h,errorColor:w,errorLightColor:f,warningColor:L,warningLightColor:b,successColor:x,successLightColor:q}})]}))},u}(),c="#272727",C="#FFFFFF",d="#F7F7F9",l="#8A8B94",O="#272727",g="#8A8B94",F="#FFFFFF",R="#F7F7F9",y="#E5E4E9",h="#F7F7F9",w="#FB4E4E",f="#FCF3F4",L="#FFBC1F",b="#FFFAEE",x="#2DCA73",q="#F6FFED";export{u as CHECKOUT_ID,m as IkasThemeJson};
1
+ import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as o}from"./component/index.js";import{IkasThemeJsonComponentProp as n}from"./component/prop/index.js";import{IkasThemeJsonCustomData as t}from"./custom-data/index.js";import{IkasThemeJsonPage as r}from"./page/index.js";import{IkasThemeJsonPageComponent as i}from"./page/component/index.js";import{IkasThemeJsonSettings as s}from"./settings/index.js";import{IkasThemeJsonComponentPropType as a,IkasThemeJsonPageType as p}from"@ikas/storefront-models";var u="checkout",m=function(){function u(n){var i;void 0===n&&(n={}),this.name=n.name||"",this.components=n.components?n.components.map((function(e){return new o(e)})):[],this.pages=n.pages?n.pages.map((function(e){return new r(e)})):[],this.settings=n.settings?new s(n.settings):new s,this.customData=n.customData?null===(i=n.customData)||void 0===i?void 0:i.map((function(e){return new t(e)})):[],this.createCheckoutData(),e(this)}return Object.defineProperty(u.prototype,"headerComponent",{get:function(){return this.components.find((function(e){return e.isHeader}))},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"footerComponent",{get:function(){return this.components.find((function(e){return e.isFooter}))},enumerable:!1,configurable:!0}),u.prototype.createCheckoutData=function(){var e=this.components.find((function(e){return"checkout"===e.id})),t=this.pages.find((function(e){return"checkout"===e.id}));e||(e=new o({id:"checkout",dir:"",displayName:"",props:[new n({name:"logo",isRequired:!1,type:a.IMAGE}),new n({name:"showTax",isRequired:!1,type:a.BOOLEAN}),new n({name:"buttonBgColor",isRequired:!1,type:a.COLOR}),new n({name:"buttonTextColor",isRequired:!1,type:a.COLOR}),new n({name:"buttonDisabledBgColor",isRequired:!1,type:a.COLOR}),new n({name:"buttonDisabledTextColor",isRequired:!1,type:a.COLOR}),new n({name:"primaryTextColor",isRequired:!1,type:a.COLOR}),new n({name:"secondaryTextColor",isRequired:!1,type:a.COLOR}),new n({name:"primaryBgColor",isRequired:!1,type:a.COLOR}),new n({name:"secondaryBgColor",isRequired:!1,type:a.COLOR}),new n({name:"borderColor",isRequired:!1,type:a.COLOR}),new n({name:"cardBgColor",isRequired:!1,type:a.COLOR}),new n({name:"errorColor",isRequired:!1,type:a.COLOR}),new n({name:"errorLightColor",isRequired:!1,type:a.COLOR}),new n({name:"warningColor",isRequired:!1,type:a.COLOR}),new n({name:"warningLightColor",isRequired:!1,type:a.COLOR}),new n({name:"successColor",isRequired:!1,type:a.COLOR}),new n({name:"successLightColor",isRequired:!1,type:a.COLOR})]}),this.components.push(e)),t||this.pages.push(new r({id:"checkout",type:p.CHECKOUT,components:[new i({componentId:e.id,propValues:{logo:null,showTax:!0,buttonBgColor:c,buttonTextColor:d,buttonDisabledBgColor:C,buttonDisabledTextColor:l,primaryTextColor:g,secondaryTextColor:O,primaryBgColor:F,secondaryBgColor:R,borderColor:y,cardBgColor:w,errorColor:h,errorLightColor:f,warningColor:L,warningLightColor:b,successColor:q,successLightColor:x}})]}))},u}(),c="#272727",d="#FFFFFF",C="#F7F7F9",l="#8A8B94",g="#272727",O="#8A8B94",F="#FFFFFF",R="#F7F7F9",y="#E5E4E9",w="#F7F7F9",h="#FB4E4E",f="#FCF3F4",L="#FFBC1F",b="#FFFAEE",q="#2DCA73",x="#F6FFED";export{u as CHECKOUT_ID,m as IkasThemeJson};
@@ -0,0 +1,11 @@
1
+ import { IkasVideo as IVideo } from "@ikas/storefront-models";
2
+ import { IkasImage } from "../image";
3
+ export declare class IkasVideo implements IVideo {
4
+ videoSrc: string | null;
5
+ thumbnailImage: IkasImage | null;
6
+ autoplay: boolean;
7
+ controls: boolean;
8
+ loop: boolean;
9
+ muted: boolean;
10
+ constructor(data: IVideo);
11
+ }
@@ -0,0 +1 @@
1
+ import{makeObservable as o,observable as t}from"mobx";import{IkasImage as i}from"../image/index.js";var m=function(m){this.videoSrc=m.videoSrc,this.thumbnailImage=m.thumbnailImage?new i(m.thumbnailImage):null,this.autoplay=m.autoplay||!1,this.controls=m.controls||!1,this.loop=m.loop||!1,this.muted=m.muted||!1,o(this,{videoSrc:t,thumbnailImage:t,autoplay:t,controls:t,loop:t,muted:t})};export{m as IkasVideo};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as e}from"mobx";import a from"../../../store/blog/index.js";import{IkasBlogCategory as o}from"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout/country-settings-model.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/state/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";var r,n=function(){function n(a){var n=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getPrev=function(){return t(n,void 0,void 0,(function(){var t,e,a,o,r,n;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.listBlogCategories(t,this.limit)];case 2:return e=i.sent(),this.data=(null===(r=null===(o=e.data)||void 0===o?void 0:o.data)||void 0===r?void 0:r.concat(this.data))||this.data,this._count=(null===(n=e.data)||void 0===n?void 0:n.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(n,void 0,void 0,(function(){var t,e,a,o;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listBlogCategories(this.page+1,this.limit)];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(n,void 0,void 0,(function(){var t,a,o,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||this.isStatic)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listBlogCategories(e,this.limit)];case 2:return t=i.sent(),this.data=(null===(o=t.data)||void 0===o?void 0:o.data)||[],this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=a.data?a.data.map((function(t){return new o(t)})):[],this._type=a.type||a.blogCategoryListPropValue.blogCategoryListType||r.ALL,this._limit=a.limit||a.blogCategoryListPropValue.initialLimit||20,this._page=a.page||1,this._count=a.count||0,this._initialized=a.initialized||!1,this._minPage=a.minPage,this._blogCategoryListPropValue=a.blogCategoryListPropValue,e(this)}return Object.defineProperty(n.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isStatic",{get:function(){return this._type===r.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasPrev",{get:function(){return!(this.isStatic||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasNext",{get:function(){return!this.isStatic&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),n.prototype.listBlogCategories=function(e,o){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,a.listBlogCategory({id:this.isStatic&&this._blogCategoryListPropValue.blogCategoryIds?{in:this._blogCategoryListPropValue.blogCategoryIds}:void 0,pagination:{page:e,limit:o}})];case 1:return[2,t.sent()]}}))}))},n.prototype.toJSON=function(){return{data:this.data,type:this._type,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,blogCategoryListPropValue:this._blogCategoryListPropValue}},n}();!function(t){t.ALL="ALL",t.STATIC="STATIC"}(r||(r={}));export{n as IkasBlogCategoryList,r as IkasBlogCategoryListType};
1
+ import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as e}from"mobx";import a from"../../../store/blog/index.js";import{IkasBlogCategory as o}from"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var r,n=function(){function n(a){var n=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getPrev=function(){return t(n,void 0,void 0,(function(){var t,e,a,o,r,n;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.listBlogCategories(t,this.limit)];case 2:return e=i.sent(),this.data=(null===(r=null===(o=e.data)||void 0===o?void 0:o.data)||void 0===r?void 0:r.concat(this.data))||this.data,this._count=(null===(n=e.data)||void 0===n?void 0:n.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(n,void 0,void 0,(function(){var t,e,a,o;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listBlogCategories(this.page+1,this.limit)];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(n,void 0,void 0,(function(){var t,a,o,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||this.isStatic)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listBlogCategories(e,this.limit)];case 2:return t=i.sent(),this.data=(null===(o=t.data)||void 0===o?void 0:o.data)||[],this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=a.data?a.data.map((function(t){return new o(t)})):[],this._type=a.type||a.blogCategoryListPropValue.blogCategoryListType||r.ALL,this._limit=a.limit||a.blogCategoryListPropValue.initialLimit||20,this._page=a.page||1,this._count=a.count||0,this._initialized=a.initialized||!1,this._minPage=a.minPage,this._blogCategoryListPropValue=a.blogCategoryListPropValue,e(this)}return Object.defineProperty(n.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isStatic",{get:function(){return this._type===r.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasPrev",{get:function(){return!(this.isStatic||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasNext",{get:function(){return!this.isStatic&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),n.prototype.listBlogCategories=function(e,o){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,a.listBlogCategory({id:this.isStatic&&this._blogCategoryListPropValue.blogCategoryIds?{in:this._blogCategoryListPropValue.blogCategoryIds}:void 0,pagination:{page:e,limit:o}})];case 1:return[2,t.sent()]}}))}))},n.prototype.toJSON=function(){return{data:this.data,type:this._type,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,blogCategoryListPropValue:this._blogCategoryListPropValue}},n}();!function(t){t.ALL="ALL",t.STATIC="STATIC"}(r||(r={}));export{n as IkasBlogCategoryList,r as IkasBlogCategoryListType};