@ikas/storefront 5.0.12 → 5.0.13

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 (155) hide show
  1. package/build/analytics/analytics.js +1 -1
  2. package/build/analytics/googleAnalytics.js +1 -1
  3. package/build/analytics/googleTagManager.js +1 -1
  4. package/build/analytics/ikas.js +1 -1
  5. package/build/components/checkout/components/address-form/model.js +1 -1
  6. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  7. package/build/components/checkout/components/customer-addresses/model.js +1 -1
  8. package/build/components/checkout/components/error/argument-validation-error/index.d.ts +8 -0
  9. package/build/components/checkout/components/error/argument-validation-error/index.js +1 -0
  10. package/build/components/checkout/components/error/index.js +1 -1
  11. package/build/components/checkout/components/master-pass/credit-card-form/index.js +1 -1
  12. package/build/components/checkout/components/master-pass/modal-otp/index.js +1 -1
  13. package/build/components/checkout/components/offer-product/index.js +1 -1
  14. package/build/components/checkout/components/quick-registration/model.js +1 -1
  15. package/build/components/checkout/index.js +1 -1
  16. package/build/components/checkout/model.d.ts +2 -2
  17. package/build/components/checkout/model.js +1 -1
  18. package/build/components/checkout/modelMasterPass.js +1 -1
  19. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  20. package/build/components/checkout/steps/step-success/index.js +1 -1
  21. package/build/components/page/head.js +1 -1
  22. package/build/components/page/index.js +1 -1
  23. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  24. package/build/components/page-editor/model.js +1 -1
  25. package/build/components/popup/index.d.ts +2 -0
  26. package/build/components/popup/index.js +1 -0
  27. package/build/components/popup/renderer/index.d.ts +11 -0
  28. package/build/components/popup/renderer/index.js +1 -0
  29. package/build/components/popup/renderer/model.d.ts +21 -0
  30. package/build/components/popup/renderer/model.js +1 -0
  31. package/build/components/popup/utils/index.d.ts +8 -0
  32. package/build/components/popup/utils/index.js +1 -0
  33. package/build/ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js +1 -0
  34. package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/left-arrow.js +1 -0
  35. package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/right-arrow.js +1 -0
  36. package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/x-close.js +1 -0
  37. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -0
  38. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +1 -0
  39. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -0
  40. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/date-item-view/index.js +1 -0
  41. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/gender-item-view/index.js +1 -0
  42. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -0
  43. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -0
  44. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -0
  45. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -0
  46. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -0
  47. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -0
  48. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -0
  49. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/space-element-renderer/index.js +1 -0
  50. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +1 -0
  51. package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -0
  52. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/index.js +1 -0
  53. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js +1 -0
  54. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js +1 -0
  55. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js +1 -0
  56. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js +1 -0
  57. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +1 -0
  58. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js +1 -0
  59. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js +1 -0
  60. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js +1 -0
  61. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-birthday/index.js +1 -0
  62. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-email/index.js +1 -0
  63. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js +1 -0
  64. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-name/index.js +1 -0
  65. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-phone/index.js +1 -0
  66. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-surname/index.js +1 -0
  67. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +1 -0
  68. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +1 -0
  69. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +1 -0
  70. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +1 -0
  71. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js +1 -0
  72. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +1 -0
  73. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js +1 -0
  74. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js +1 -0
  75. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js +1 -0
  76. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js +1 -0
  77. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js +1 -0
  78. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/window-settings/index.js +1 -0
  79. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js +1 -0
  80. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js +1 -0
  81. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-time/index.js +1 -0
  82. package/build/ext/mobx-react/dist/mobxreact.esm.js +1 -0
  83. package/build/ext/swiper/modules/navigation.css.js +1 -0
  84. package/build/ext/swiper/modules/navigation.mjs.js +1 -0
  85. package/build/ext/swiper/modules/pagination.css.js +1 -0
  86. package/build/ext/swiper/modules/scrollbar.mjs.js +1 -0
  87. package/build/ext/swiper/shared/classes-to-selector.mjs.js +1 -0
  88. package/build/ext/swiper/shared/create-element-if-not-defined.mjs.js +1 -0
  89. package/build/ext/swiper/shared/ssr-window.esm.mjs.js +1 -0
  90. package/build/ext/swiper/shared/swiper-core.mjs.js +1 -0
  91. package/build/ext/swiper/shared/update-on-virtual-data.mjs.js +1 -0
  92. package/build/ext/swiper/shared/update-swiper.mjs.js +1 -0
  93. package/build/ext/swiper/shared/utils.mjs.js +1 -0
  94. package/build/ext/swiper/swiper-react.mjs.js +1 -0
  95. package/build/ext/swiper/swiper.css.js +1 -0
  96. package/build/hooks/useCustomerReviews.js +1 -1
  97. package/build/hooks/useStore.js +1 -1
  98. package/build/index.js +1 -1
  99. package/build/models/data/customer/index.d.ts +8 -1
  100. package/build/models/data/customer/index.js +1 -1
  101. package/build/models/data/customer-form-data-input/customer-register-subscription-input/index.d.ts +7 -0
  102. package/build/models/data/customer-form-data-input/customer-register-subscription-input/index.js +1 -0
  103. package/build/models/data/customer-form-data-input/index.d.ts +19 -0
  104. package/build/models/data/customer-form-data-input/index.js +1 -0
  105. package/build/models/data/index.d.ts +2 -0
  106. package/build/models/data/product/index.js +1 -1
  107. package/build/models/data/storefront-popup/index.d.ts +40 -0
  108. package/build/models/data/storefront-popup/index.js +1 -0
  109. package/build/models/data/storefront-popup/storefront-popup-analytics/index.d.ts +7 -0
  110. package/build/models/data/storefront-popup/storefront-popup-analytics/index.js +1 -0
  111. package/build/models/data/storefront-popup/storefront-popup-date-f/304/261lter/index.d.ts +6 -0
  112. package/build/models/data/storefront-popup/storefront-popup-date-f/304/261lter/index.js +1 -0
  113. package/build/models/data/storefront-popup/storefront-popup-display-filter/index.d.ts +11 -0
  114. package/build/models/data/storefront-popup/storefront-popup-display-filter/index.js +1 -0
  115. package/build/models/data/storefront-popup/storefront-popup-display-settings/index.d.ts +16 -0
  116. package/build/models/data/storefront-popup/storefront-popup-display-settings/index.js +1 -0
  117. package/build/models/data/storefront-popup/storefront-popup-page-filter/index.d.ts +16 -0
  118. package/build/models/data/storefront-popup/storefront-popup-page-filter/index.js +1 -0
  119. package/build/models/data/storefront-popup/storefront-popup-page-filter/storefront-popup-page-filter-data/index.d.ts +12 -0
  120. package/build/models/data/storefront-popup/storefront-popup-page-filter/storefront-popup-page-filter-data/index.js +1 -0
  121. package/build/models/data/storefront-popup/storefront-popup-routing/index.d.ts +6 -0
  122. package/build/models/data/storefront-popup/storefront-popup-routing/index.js +1 -0
  123. package/build/models/ui/blog-category-list/index.js +1 -1
  124. package/build/models/ui/brand-list/index.js +1 -1
  125. package/build/models/ui/category-list/index.js +1 -1
  126. package/build/models/ui/customer-review-list/index.d.ts +3 -0
  127. package/build/models/ui/customer-review-list/index.js +1 -1
  128. package/build/models/ui/customer-review-summary-list/index.js +1 -1
  129. package/build/models/ui/product-list/index.js +1 -1
  130. package/build/models/ui/raffle-list/index.js +1 -1
  131. package/build/models/ui/validator/form/account-info.js +1 -1
  132. package/build/models/ui/validator/form/address.js +1 -1
  133. package/build/models/ui/validator/form/ikas-address.js +1 -1
  134. package/build/models/ui/validator/form/register.js +1 -1
  135. package/build/page-data-init/index.js +1 -1
  136. package/build/pages/checkout.js +1 -1
  137. package/build/store/blog/index.js +1 -1
  138. package/build/store/brand/index.js +1 -1
  139. package/build/store/cart/index.js +1 -1
  140. package/build/store/category/index.js +1 -1
  141. package/build/store/checkout/index.js +1 -1
  142. package/build/store/customer/api.d.ts +2 -1
  143. package/build/store/customer/api.js +1 -1
  144. package/build/store/customer/index.d.ts +2 -0
  145. package/build/store/customer/index.js +1 -1
  146. package/build/store/html-meta-data/index.js +1 -1
  147. package/build/store/location/index.js +1 -1
  148. package/build/store/product/index.js +1 -1
  149. package/build/store/storefront-popup/index.d.ts +74 -0
  150. package/build/store/storefront-popup/index.js +1 -0
  151. package/package.json +18 -12
  152. package/build/components/checkout/components/epaykolay-button/index.d.ts +0 -5
  153. package/build/components/checkout/components/epaykolay-button/index.js +0 -1
  154. package/build/components/checkout/components/epaykolay-button/style.module.scss.js +0 -1
  155. package/build/components/checkout/components/svg/epaykolay.js +0 -1
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import{IkasBlogMetaDataTargetType as o}from"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as n}from"@ikas/storefront-models";import{reaction as a,makeAutoObservable as s,runInAction as r}from"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import{IkasHTMLMetaDataTargetType as d}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import{IkasThemeJson as p}from"../../models/data/theme-json/index.js";import{IkasStorefront as c}from"../../models/data/storefront/index.js";import{IkasThemeJsonComponent as l}from"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonSettings as u}from"../../models/data/theme-json/settings/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasPageDataProvider as g}from"@ikas/storefront-providers";import{IkasPageDataInit as h}from"../../page-data-init/index.js";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"./loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";import E from"../../store/html-meta-data/index.js";import v from"../../store/blog/index.js";import P from"../../store/raffle/index.js";import O from"../../store/product/index.js";import{setAPIClientConfig as T,listCustomerSettings as C}from"@ikas/storefront-api";var _,j=function(){function j(a){var O=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",O.onMessage,!1),O.sendMessage(_.FRAME_DID_LOAD,"5.0.0"),O.createLoadingListener()},this.onMessage=function(i){return e(O,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:switch(e=i.data.type,o=i.data.data,e){case _.UPDATE_FRAME_DATA:return[3,1];case _.UPDATE_THEME_JSON:return[3,3];case _.UPDATE_PROP_VALUE:return[3,5];case _.UPDATE_PAGE_PARAMS:return[3,7];case _.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case _.ADD_COMPONENT:return[3,11];case _.DELETE_COMPONENT:return[3,12];case _.UPDATE_COMPONENT:return[3,13];case _.ADD_PAGE_COMPONENT:return[3,14];case _.DELETE_PAGE_COMPONENT:return[3,16];case _.SET_SELECTED_COMPONENT:return[3,17];case _.SET_HOVERED_COMPONENT:return[3,18];case _.SCROLL_TO_COMPONENT:return[3,19];case _.EDITOR_RELOAD:return[3,20];case _.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(o)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(o)];case 5:return[4,this.handleUpdatePropValue(o)];case 7:return[4,this.handleUpdatePageParams(o)];case 9:return[4,this.handleUpdatePageComponentOrder(o)];case 11:return this.handleAddNewComponent(o),[3,23];case 12:return this.handleDeleteComponent(o),[3,23];case 13:return this.handleUpdateComponent(o),[3,23];case 14:return[4,this.handleAddNewPageComponent(o)];case 16:return this.handleDeletePageComponent(o),[3,23];case 17:return this.handleSetSelectedComponent(o),[3,23];case 18:return this.handleSetHoveredComponent(o),[3,23];case 19:return this.handleScrollToComponent(o),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(o),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){O.sendMessage(_.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){O.sendMessage(_.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){O.sendMessage(_.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(i){return e(O,void 0,void 0,(function(){var e,a,s,p,c,l,m,u,g,h,O,T,C,j=this;return t(this,(function(t){switch(t.label){case 0:return e=i.slice(1),a=e.split("?"),e=a[0],s=a[1],this.pageParams={},i.startsWith("/account/orders/")?p=n.ORDER_DETAIL:i.startsWith("/account/orders")?p=n.ORDERS:i.startsWith("/account/addresses")?p=n.ADDRESSES:i.startsWith("/account/favorite-products")?p=n.FAVORITE_PRODUCTS:i.startsWith("/account/forgot-password")?p=n.FORGOT_PASSWORD:i.startsWith("/account/login")?p=n.LOGIN:i.startsWith("/account/raffles")?p=n.RAFFLE_ACCOUNT:i.startsWith("/account/recover-password")?p=n.RECOVER_PASSWORD:i.startsWith("/account/activate")?p=n.ACTIVATE_CUSTOMER:i.startsWith("/account/register")?p=n.REGISTER:i.startsWith("/account")?p=n.ACCOUNT:i.startsWith("/blog/")?p=n.BLOG:i.startsWith("/blog")?p=n.BLOG_INDEX:i.startsWith("/pages")?(p=n.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=i.startsWith("/raffle/")?n.RAFFLE_DETAIL:i.startsWith("/raffle")?n.RAFFLE:i.startsWith("/404")?n.NOT_FOUND:"/cart"===i||"/cart/"===i?n.CART:i.startsWith("/checkout")?n.CHECKOUT:"/"===i?n.INDEX:i.startsWith("/search")?n.SEARCH:n.PRODUCT,p!==n.PRODUCT?[3,6]:[4,E.listHTMLMetaData({slug:{eq:e}})];case 1:return(l=t.sent()).isSuccess&&(null===(g=l.data)||void 0===g?void 0:g.length)?(m=l.data[0]).targetType!==d.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(m.targetId,s)]:[3,5];case 2:return c=t.sent(),this.pageParams={productId:m.targetId,variantId:c,slug:e},[3,4];case 3:if(m.targetType===d.CATEGORY)p=n.CATEGORY,this.pageParams={categoryId:m.targetId,slug:e};else{if(m.targetType!==d.BRAND)return[2];p=n.BRAND,this.pageParams={brandId:m.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==n.BLOG?[3,8]:[4,v.listBlogMetaData({slug:{eq:e}})];case 7:if(!(l=t.sent()).isSuccess||!(null===(O=null===(h=l.data)||void 0===h?void 0:h.data)||void 0===O?void 0:O.length))return[2];if((m=l.data.data[0]).targetType===o.BLOG)this.pageParams={blogId:m.targetId,slug:e};else{if(m.targetType!==o.BLOG_CATEGORY)return[2];p=n.BLOG_CATEGORY,this.pageParams={blogCategoryId:m.targetId,slug:e}}t.label=8;case 8:return p!==n.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData({slug:{eq:e}})];case 9:if(!(l=t.sent()).isSuccess||!(null===(T=l.data)||void 0===T?void 0:T.length))return[2];m=l.data[0],this.pageParams={raffleId:m.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return u=t.sent(),r((function(){var e,t;f.getInstance().currentPageType=p,j.pageDataProvider=u,p===n.CUSTOM?j.page=null===(e=j.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===j.pageParams.slug})):j.page=null===(t=j.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),j.setCurrentPageType(),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(_.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){O.sendMessage(_.EDITOR_LOADING_CHANGE,{isLoading:O.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(i,o,a){return e(O,void 0,void 0,(function(){var e,s,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(i,a,o),(a.blogId||a.blogCategoryId)&&(e.possiblePageTypes=[n.BLOG,n.BLOG_CATEGORY]),a.raffleId&&(e.possiblePageTypes=[n.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(h.setPageSpecificData(e.pageSpecificData,o,!0),o===n.PRODUCT&&h.pageSpecificData&&(s=h.pageSpecificData,(r=s.variants.find((function(e){return e.id===a.variantId})))&&(s.selectedVariantValues=r.variantValues))):h.pageSpecificData=void 0,this.initializedPropValues=h.initPagePropValues(e.$pageComponentPropValues,i.components,i.customData,i.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){O.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),i=t.top,o=t.bottom;return i<window.innerHeight&&o>=0&&o<window.innerHeight&&i>0},this.handleUpdateFrameData=function(o){return e(O,void 0,void 0,(function(){var e,n,a,s,r,d,l=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new p(o.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===o.selectedPage.id})),this.pageParams=o.pageParams,this.apiKey=o.apiKey,this.locale=o.locale||"en",this.translations=o.translations||void 0,this.setCurrentPageType(),this.page?((e=o.storefront?new c(o.storefront):null)&&(n=e.routings.find((function(e){return e.locale===l.locale})),i.init({storefrontId:e.id,storefrontRoutingId:null==n?void 0:n.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==n?void 0:n.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||i.getTranslations(),isEditor:!0,apiKey:o.apiKey,apiUrl:o.apiUrl,cdnUrl:o.cdnUrl,merchantSettings:o.merchantSettings}),T(),this.setCustomerSettings()),a=Date.now()+"",this.updateId=a,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return s=t.sent(),this.updateId===a&&(this.pageDataProvider=s,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(O,void 0,void 0,(function(){var e,o,n;return t(this,(function(t){switch(t.label){case 0:return i.getCustomerSettings()?[3,2]:[4,C({storefrontId:{eq:i.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.data.length)&&(o=e.data.data[0],i.init({customerSettings:o})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new p(i.theme),[2]}))}))},this.handleUpdatePropValue=function(i){return e(O,void 0,void 0,(function(){var e,o,n,a,s,r,d,p=this;return t(this,(function(t){switch(t.label){case 0:return e=i.propName,o=i.value,(n=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(a=this.initializedPropValues.find((function(e){return e.pageComponent.id===p.selectedPageComponentId})),this.pageDataProvider&&a?(this.selectedPageComponent.propValues[e]=o,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,n)]):[2]):[2];case 1:return(s=t.sent())&&JSON.stringify(s).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return a.propValues[e]=h.initPropValue(n,s,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(i){return e(O,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=i.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=i.pageComponents.map((function(e){return new m(e)})):this.page.components=i.pageComponents.map((function(e){return new m(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,i=new l(e.component);null===(t=O.theme)||void 0===t||t.components.push(i)},this.handleDeleteComponent=function(e){var t,i;(null===(t=O.theme)||void 0===t?void 0:t.components)&&(O.theme.components=O.theme.components.filter((function(t){return t.id!==e.componentId})));var o=O.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];O.specification&&O.specification.components&&(O.specification.components=o),!O.specification&&(null===(i=O.page)||void 0===i?void 0:i.components)&&(O.page.components=o)},this.handleUpdateComponent=function(e){var t=O.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(O.theme.components[t]=new l(e.component))},this.handleAddNewPageComponent=function(i){return e(O,void 0,void 0,(function(){var e,o,a,s,r,d,p;return t(this,(function(t){switch(t.label){case 0:return e=new m(i.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),a=h.initPageComponentPropValue(o,[o.component],this.theme.settings,!0),this.initializedPropValues.push(a),(null===(d=this.page)||void 0===d?void 0:d.type)===n.CHECKOUT?[2]:(s=null===(p=this.theme)||void 0===p?void 0:p.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==s?void 0:s.id)})),(null==s?void 0:s.isCommon)&&r||(i.customIndex?this.pageComponents.splice(i.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){O.specification?O.specification.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):O.page.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){O.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){O.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,i=O.componentRefs[t];i&&(O.isScrolledIntoView(i)||window.scrollTo({top:i.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;O.theme&&(O.theme.settings=new u(t))},this.router=a,s(this),this.startMessaging()}return Object.defineProperty(j.prototype,"specification",{get:function(){var e,t,i,o,a,s,r,d=this,p=this.page;return(null==p?void 0:p.type)===n.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===n.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===n.BRAND&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===n.BLOG&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===n.BLOG_CATEGORY&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===n.RAFFLE_DETAIL&&(r=null===(s=p.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var i;return e.id===(null===(i=t.selectedPageComponent)||void 0===i?void 0:i.componentId)}))},enumerable:!1,configurable:!0}),j.prototype.createLoadingListener=function(){var e=this;a((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},j.prototype.getVariantIdFromParams=function(o,n){var a,s;return e(this,void 0,void 0,(function(){var e,r,d,p,c,l,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+n),[4,O.searchProducts({input:{productIdList:[o],priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(s=null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||void 0===s?void 0:s.length)?[2]:(d=r.data.data[0],p=d.variantTypes.map((function(e){return e.variantType.slug})),c=[],p.forEach((function(t,i){var o=d.variantTypes[i],n=e.get(t);if(n){var a=o.variantType.values.find((function(e){return e.slug===n}));a&&c.push(a)}})),(l=d.variants.find((function(e){return e.variantValues.every((function(e){return c.some((function(t){return t.id===e.id}))}))})))?[2,l.id]:[3,3]);case 2:return m=t.sent(),console.error(m),[3,3];case 3:return[2]}}))}))},j.prototype.setCurrentPageType=function(){this.page&&(f.getInstance().currentPageType=this.page.type)},j}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(_||(_={}));export{_ as BridgeMessageType,j as default};
1
+ import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import{IkasBlogMetaDataTargetType as o}from"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as n}from"@ikas/storefront-models";import{reaction as a,makeAutoObservable as s,runInAction as r}from"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import{IkasHTMLMetaDataTargetType as d}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import{IkasThemeJson as p}from"../../models/data/theme-json/index.js";import{IkasStorefront as c}from"../../models/data/storefront/index.js";import{IkasThemeJsonComponent as l}from"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonSettings as u}from"../../models/data/theme-json/settings/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasPageDataProvider as g}from"@ikas/storefront-providers";import{IkasPageDataInit as h}from"../../page-data-init/index.js";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"./loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";import E from"../../store/html-meta-data/index.js";import v from"../../store/blog/index.js";import P from"../../store/raffle/index.js";import O from"../../store/product/index.js";import{setAPIClientConfig as T,listCustomerSettings as C}from"@ikas/storefront-api";var _,j=function(){function j(a){var O=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",O.onMessage,!1),O.sendMessage(_.FRAME_DID_LOAD,"5.0.0"),O.createLoadingListener()},this.onMessage=function(i){return e(O,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:switch(e=i.data.type,o=i.data.data,e){case _.UPDATE_FRAME_DATA:return[3,1];case _.UPDATE_THEME_JSON:return[3,3];case _.UPDATE_PROP_VALUE:return[3,5];case _.UPDATE_PAGE_PARAMS:return[3,7];case _.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case _.ADD_COMPONENT:return[3,11];case _.DELETE_COMPONENT:return[3,12];case _.UPDATE_COMPONENT:return[3,13];case _.ADD_PAGE_COMPONENT:return[3,14];case _.DELETE_PAGE_COMPONENT:return[3,16];case _.SET_SELECTED_COMPONENT:return[3,17];case _.SET_HOVERED_COMPONENT:return[3,18];case _.SCROLL_TO_COMPONENT:return[3,19];case _.EDITOR_RELOAD:return[3,20];case _.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(o)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(o)];case 5:return[4,this.handleUpdatePropValue(o)];case 7:return[4,this.handleUpdatePageParams(o)];case 9:return[4,this.handleUpdatePageComponentOrder(o)];case 11:return this.handleAddNewComponent(o),[3,23];case 12:return this.handleDeleteComponent(o),[3,23];case 13:return this.handleUpdateComponent(o),[3,23];case 14:return[4,this.handleAddNewPageComponent(o)];case 16:return this.handleDeletePageComponent(o),[3,23];case 17:return this.handleSetSelectedComponent(o),[3,23];case 18:return this.handleSetHoveredComponent(o),[3,23];case 19:return this.handleScrollToComponent(o),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(o),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){O.sendMessage(_.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){O.sendMessage(_.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){O.sendMessage(_.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(i){return e(O,void 0,void 0,(function(){var e,a,s,p,c,l,m,u,g,h,O,T,C,j=this;return t(this,(function(t){switch(t.label){case 0:return e=i.slice(1),a=e.split("?"),e=a[0],s=a[1],this.pageParams={},i.startsWith("/account/orders/")?p=n.ORDER_DETAIL:i.startsWith("/account/orders")?p=n.ORDERS:i.startsWith("/account/addresses")?p=n.ADDRESSES:i.startsWith("/account/favorite-products")?p=n.FAVORITE_PRODUCTS:i.startsWith("/account/forgot-password")?p=n.FORGOT_PASSWORD:i.startsWith("/account/login")?p=n.LOGIN:i.startsWith("/account/raffles")?p=n.RAFFLE_ACCOUNT:i.startsWith("/account/recover-password")?p=n.RECOVER_PASSWORD:i.startsWith("/account/activate")?p=n.ACTIVATE_CUSTOMER:i.startsWith("/account/register")?p=n.REGISTER:i.startsWith("/account")?p=n.ACCOUNT:i.startsWith("/blog/")?p=n.BLOG:i.startsWith("/blog")?p=n.BLOG_INDEX:i.startsWith("/pages")?(p=n.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=i.startsWith("/raffle/")?n.RAFFLE_DETAIL:i.startsWith("/raffle")?n.RAFFLE:i.startsWith("/404")?n.NOT_FOUND:"/cart"===i||"/cart/"===i?n.CART:i.startsWith("/checkout")?n.CHECKOUT:"/"===i?n.INDEX:i.startsWith("/search")?n.SEARCH:n.PRODUCT,p!==n.PRODUCT?[3,6]:[4,E.listHTMLMetaData({slug:{eq:e}})];case 1:return(l=t.sent()).isSuccess&&(null===(g=l.data)||void 0===g?void 0:g.length)?(m=l.data[0]).targetType!==d.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(m.targetId,s)]:[3,5];case 2:return c=t.sent(),this.pageParams={productId:m.targetId,variantId:c,slug:e},[3,4];case 3:if(m.targetType===d.CATEGORY)p=n.CATEGORY,this.pageParams={categoryId:m.targetId,slug:e};else{if(m.targetType!==d.BRAND)return[2];p=n.BRAND,this.pageParams={brandId:m.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==n.BLOG?[3,8]:[4,v.listBlogMetaData({slug:{eq:e}})];case 7:if(!(l=t.sent()).isSuccess||!(null===(O=null===(h=l.data)||void 0===h?void 0:h.data)||void 0===O?void 0:O.length))return[2];if((m=l.data.data[0]).targetType===o.BLOG)this.pageParams={blogId:m.targetId,slug:e};else{if(m.targetType!==o.BLOG_CATEGORY)return[2];p=n.BLOG_CATEGORY,this.pageParams={blogCategoryId:m.targetId,slug:e}}t.label=8;case 8:return p!==n.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData({slug:{eq:e}})];case 9:if(!(l=t.sent()).isSuccess||!(null===(T=l.data)||void 0===T?void 0:T.length))return[2];m=l.data[0],this.pageParams={raffleId:m.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return u=t.sent(),r((function(){var e,t;f.getInstance().currentPageType=p,j.pageDataProvider=u,p===n.CUSTOM?j.page=null===(e=j.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===j.pageParams.slug})):j.page=null===(t=j.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),j.setCurrentPageType(),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(_.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){O.sendMessage(_.EDITOR_LOADING_CHANGE,{isLoading:O.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(i,o,a){return e(O,void 0,void 0,(function(){var e,s,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(i,a,o),(a.blogId||a.blogCategoryId)&&(e.possiblePageTypes=[n.BLOG,n.BLOG_CATEGORY]),a.raffleId&&(e.possiblePageTypes=[n.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(h.setPageSpecificData(e.pageSpecificData,o,!0),o===n.PRODUCT&&h.pageSpecificData&&(s=h.pageSpecificData,(r=s.variants.find((function(e){return e.id===a.variantId})))&&(s.selectedVariantValues=r.variantValues))):h.pageSpecificData=void 0,this.initializedPropValues=h.initPagePropValues(e.$pageComponentPropValues,i.components,i.customData,i.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){O.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),i=t.top,o=t.bottom;return i<window.innerHeight&&o>=0&&o<window.innerHeight&&i>0},this.handleUpdateFrameData=function(o){return e(O,void 0,void 0,(function(){var e,n,a,s,r,d,l=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new p(o.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===o.selectedPage.id})),this.pageParams=o.pageParams,this.apiKey=o.apiKey,this.locale=o.locale||"en",this.translations=o.translations||void 0,this.setCurrentPageType(),this.page?((e=o.storefront?new c(o.storefront):null)&&(n=e.routings.find((function(e){return e.locale===l.locale})),i.init({storefrontId:e.id,storefrontRoutingId:null==n?void 0:n.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==n?void 0:n.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||i.getTranslations(),isEditor:!0,apiKey:o.apiKey,apiUrl:o.apiUrl,cdnUrl:o.cdnUrl,merchantSettings:o.merchantSettings}),T(),this.setCustomerSettings()),a=Date.now()+"",this.updateId=a,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return s=t.sent(),this.updateId===a&&(this.pageDataProvider=s,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(O,void 0,void 0,(function(){var e,o,n;return t(this,(function(t){switch(t.label){case 0:return i.getCustomerSettings()?[3,2]:[4,C({storefrontId:{eq:i.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.data.length)&&(o=e.data.data[0],i.init({customerSettings:o})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new p(i.theme),[2]}))}))},this.handleUpdatePropValue=function(i){return e(O,void 0,void 0,(function(){var e,o,n,a,s,r,d,p=this;return t(this,(function(t){switch(t.label){case 0:return e=i.propName,o=i.value,(n=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(a=this.initializedPropValues.find((function(e){return e.pageComponent.id===p.selectedPageComponentId})),this.pageDataProvider&&a?(this.selectedPageComponent.propValues[e]=o,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,n)]):[2]):[2];case 1:return(s=t.sent())&&JSON.stringify(s).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return a.propValues[e]=h.initPropValue(n,s,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(i){return e(O,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=i.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=i.pageComponents.map((function(e){return new m(e)})):this.page.components=i.pageComponents.map((function(e){return new m(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,i=new l(e.component);null===(t=O.theme)||void 0===t||t.components.push(i)},this.handleDeleteComponent=function(e){var t,i;(null===(t=O.theme)||void 0===t?void 0:t.components)&&(O.theme.components=O.theme.components.filter((function(t){return t.id!==e.componentId})));var o=O.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];O.specification&&O.specification.components&&(O.specification.components=o),!O.specification&&(null===(i=O.page)||void 0===i?void 0:i.components)&&(O.page.components=o)},this.handleUpdateComponent=function(e){var t=O.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(O.theme.components[t]=new l(e.component))},this.handleAddNewPageComponent=function(i){return e(O,void 0,void 0,(function(){var e,o,a,s,r,d,p;return t(this,(function(t){switch(t.label){case 0:return e=new m(i.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),a=h.initPageComponentPropValue(o,[o.component],this.theme.settings,!0),this.initializedPropValues.push(a),(null===(d=this.page)||void 0===d?void 0:d.type)===n.CHECKOUT?[2]:(s=null===(p=this.theme)||void 0===p?void 0:p.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==s?void 0:s.id)})),(null==s?void 0:s.isCommon)&&r||(i.customIndex?this.pageComponents.splice(i.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){O.specification?O.specification.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):O.page.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){O.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){O.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,i=O.componentRefs[t];i&&(O.isScrolledIntoView(i)||window.scrollTo({top:i.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;O.theme&&(O.theme.settings=new u(t))},this.router=a,s(this),this.startMessaging()}return Object.defineProperty(j.prototype,"specification",{get:function(){var e,t,i,o,a,s,r,d=this,p=this.page;return(null==p?void 0:p.type)===n.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===n.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===n.BRAND&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===n.BLOG&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===n.BLOG_CATEGORY&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===n.RAFFLE_DETAIL&&(r=null===(s=p.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var i;return e.id===(null===(i=t.selectedPageComponent)||void 0===i?void 0:i.componentId)}))},enumerable:!1,configurable:!0}),j.prototype.createLoadingListener=function(){var e=this;a((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},j.prototype.getVariantIdFromParams=function(o,n){var a,s;return e(this,void 0,void 0,(function(){var e,r,d,p,c,l,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+n),[4,O.searchProducts({input:{productIdList:[o],priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(s=null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||void 0===s?void 0:s.length)?[2]:(d=r.data.data[0],p=d.variantTypes.map((function(e){return e.variantType.slug})),c=[],p.forEach((function(t,i){var o=d.variantTypes[i],n=e.get(t);if(n){var a=o.variantType.values.find((function(e){return e.slug===n}));a&&c.push(a)}})),(l=d.variants.find((function(e){return e.variantValues.every((function(e){return c.some((function(t){return t.id===e.id}))}))})))?[2,l.id]:[3,3]);case 2:return m=t.sent(),console.error(m),[3,3];case 3:return[2]}}))}))},j.prototype.setCurrentPageType=function(){this.page&&(f.getInstance().currentPageType=this.page.type)},j}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(_||(_={}));export{_ as BridgeMessageType,j as default};
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ export declare const PopupListRendererForPage: React.FC;
@@ -0,0 +1 @@
1
+ import*as e from"react";import{observer as r}from"mobx-react-lite";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import t from"../../hooks/useDimension.js";import i from"./renderer/index.js";import{checkSavedSessionForPopups as n}from"./utils/index.js";import{IkasStorefrontPopupDeviceTypeEnum as m}from"@ikas/storefront-models";var s=r((function(){var r=t().isMobile;e.useEffect((function(){n()}),[]);var s=o.getStorefrontPopups().filter((function(e){return r?[m.ALL,m.MOBILE].includes(e.visibleDevice):[m.ALL,m.DESKTOP].includes(e.visibleDevice)}));return e.createElement(e.Fragment,null,s.map((function(r,o){return e.createElement(i,{storefrontPopup:r,key:r.id})})))}));export{s as PopupListRendererForPage};
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { IkasStorefrontPopup } from "../../../models/data/storefront-popup";
3
+ import "swiper/css";
4
+ import "swiper/css/navigation";
5
+ import "swiper/css/pagination";
6
+ import "react-date-picker/dist/DatePicker.css";
7
+ declare type IkasStorefrontPopupRendererProps = {
8
+ storefrontPopup: IkasStorefrontPopup;
9
+ };
10
+ declare const _default: React.FunctionComponent<IkasStorefrontPopupRendererProps>;
11
+ export default _default;
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as o}from'./../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as p}from"mobx-react-lite";import d from"../../../hooks/useDimension.js";import{IkasStorefrontPopupDisplayTriggerTypeEnum as s}from"../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import{exitIntent as n}from"../utils/index.js";import{IkasStorefrontPopupRendererViewModel as i}from"./model.js";import'./../../../ext/swiper/swiper.css.js';import'./../../../ext/swiper/modules/navigation.css.js';import'./../../../ext/swiper/modules/pagination.css.js';import"react-date-picker/dist/DatePicker.css";import t from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/components/index.js';import'./../../../ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js';import"mobx";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js';var m=p((function(p){var m=p.storefrontPopup,l=r.useState((function(){return new i({},m)}))[0],u=d().isMobile;return r.useEffect((function(){e(void 0,void 0,void 0,(function(){var e,r;return o(this,(function(o){switch(o.label){case 0:return[4,l.init()];case 1:if(o.sent(),!l.isModalClosedByUser){if((e=l.storefrontPopupData.displaySettings.triggerType)===s.SCROLL_DOWN)return window.addEventListener("scroll",l.handleScroll),[2,function(){window.removeEventListener("scroll",l.handleScroll)}];if(e===s.EXIT_INTENT)return r=n({onExitIntent:function(){l.openModal()}}),[2,function(){r()}]}return[2]}}))}))}),[]),l.storefrontPopupData&&l.storefrontPopupData.contentJson&&!l.isLoading?r.createElement(t,{key:l.storefrontPopupData.id,popup:l.storefrontPopupData.contentJson,dynamicData:{products:l.popupProducts},sfProps:{onModalClose:l.onModalClose,onCustomerSave:l.onCustomerFormDataSave,isCustomerLoggedIn:l.isCustomerLoggedIn},isMobile:u}):null}));export{m as default};
@@ -0,0 +1,21 @@
1
+ import { PopupProductDictionary, PopupRendererSaveCustomerInput } from "@ikas/popup-renderer";
2
+ import { IkasStorefrontPopup } from "../../../models/data/storefront-popup";
3
+ export declare class IkasStorefrontPopupRendererViewModel {
4
+ isLoading: boolean;
5
+ storefrontPopup: IkasStorefrontPopup;
6
+ storefrontPopupData: IkasStorefrontPopup | null;
7
+ popupProducts: PopupProductDictionary;
8
+ isModalClosedByUser: boolean;
9
+ constructor(data: Partial<IkasStorefrontPopupRendererViewModel>, storefrontPopup: IkasStorefrontPopup);
10
+ init(): Promise<void>;
11
+ getStorefrontPopup(): Promise<void>;
12
+ getStorefrontPopupProducts(): Promise<void>;
13
+ openModal(): void;
14
+ onModalClose(): void;
15
+ onCustomerFormDataSave(customer: PopupRendererSaveCustomerInput): Promise<void>;
16
+ initTeaser(): void;
17
+ checkDeviceType(): void;
18
+ initTriggerType(): void;
19
+ handleScroll(): void;
20
+ get isCustomerLoggedIn(): boolean;
21
+ }
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as o}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{makeObservable as r,observable as s,action as i,computed as n}from"mobx";import a from"../../../store/storefront-popup/index.js";import{IkasStorefrontPopup as p}from"../../../models/data/storefront-popup/index.js";import{addPopupToLocalStorage as u,getPopupsFromLocalStorage as d,getPopupProducts as l}from"../utils/index.js";import{IkasStorefrontPopupDisplayFrequencyEnum as c,IkasStorefrontPopupDisplayTriggerTypeEnum as f}from"../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import{IkasBaseStore as h}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";var m=function(){function m(t,o){this.isLoading=t.isLoading||!0,this.storefrontPopup=o,this.storefrontPopupData=t.storefrontPopupData||null,this.popupProducts=t.popupProducts||{},this.isModalClosedByUser=t.isModalClosedByUser||!1,r(this,{isLoading:s,storefrontPopup:s,storefrontPopupData:s,popupProducts:s,isModalClosedByUser:s,getStorefrontPopup:i.bound,getStorefrontPopupProducts:i.bound,openModal:i.bound,onModalClose:i.bound,init:i.bound,initTeaser:i.bound,checkDeviceType:i.bound,initTriggerType:i.bound,handleScroll:i.bound,onCustomerFormDataSave:i.bound,isCustomerLoggedIn:n})}return m.prototype.init=function(){return t(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.getStorefrontPopup()];case 1:return t.sent(),[4,this.getStorefrontPopupProducts()];case 2:return t.sent(),this.initTeaser(),this.checkDeviceType(),this.initTriggerType(),this.isLoading=!1,[2]}}))}))},m.prototype.getStorefrontPopup=function(){var r,s;return t(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(o){switch(o.label){case 0:return[4,a.listStorefrontPopup({idList:[this.storefrontPopup.id]})];case 1:return t=o.sent(),(null===(s=null===(r=t.data)||void 0===r?void 0:r.data)||void 0===s?void 0:s.length)&&(this.storefrontPopupData=new p(t.data.data[0]),i=d(),n=e.getSessionId(),i&&n&&i[n]&&this.storefrontPopupData.displaySettings.frequency===c.ONCE_PER_SESSION&&i[n].includes(this.storefrontPopup.id)&&(this.isModalClosedByUser=!0)),[2]}}))}))},m.prototype.getStorefrontPopupProducts=function(){var r,s;return t(this,void 0,void 0,(function(){var t;return o(this,(function(o){switch(o.label){case 0:return(null===(r=this.storefrontPopupData)||void 0===r?void 0:r.contentJson)?[4,l(this.storefrontPopupData.contentJson,e.getCdnUrl()||"",(null===(s=e.getMerchantSettings())||void 0===s?void 0:s.merchantId)||"",e.getPriceListId())]:[2];case 1:return t=o.sent(),this.popupProducts=t,[2]}}))}))},m.prototype.openModal=function(){var t;(null===(t=this.storefrontPopupData)||void 0===t?void 0:t.contentJson)&&(this.isModalClosedByUser||(this.storefrontPopupData.contentJson.modal.isVisible=!0))},m.prototype.onModalClose=function(){(this.isModalClosedByUser=!0,this.storefrontPopupData)&&(this.storefrontPopupData.displaySettings.frequency===c.ONCE_PER_SESSION&&u(this.storefrontPopup.id))},m.prototype.onCustomerFormDataSave=function(e){return t(this,void 0,void 0,(function(){var t,r,s,i;return o(this,(function(o){switch(o.label){case 0:return t=h.getInstance(),r=t.customerStore,s=r.customer,i="",i=s&&s.email?s.email:e.email?e.email:e.firstName+e.lastName,[4,r.saveCustomerFormData({email:i,firstName:e.firstName||(null==s?void 0:s.firstName)||"",lastName:e.lastName||(null==s?void 0:s.lastName)||"",birthDate:e.birthday||(null==s?void 0:s.birthDate)||"",phone:e.phone||(null==s?void 0:s.phone)||"",storefrontPopupId:this.storefrontPopup.id,subscriptions:{email:!!e.hasPermission,phone:!!e.hasPermission,sms:!!e.hasPermission}})];case 1:return o.sent(),[2]}}))}))},m.prototype.initTeaser=function(){var t;(null===(t=this.storefrontPopupData)||void 0===t?void 0:t.contentJson)&&this.storefrontPopupData.contentJson.modal.teaser.isActive&&(this.storefrontPopupData.contentJson.modal.selectedStep=this.storefrontPopupData.contentJson.modal.teaser.step)},m.prototype.checkDeviceType=function(){this.storefrontPopupData&&this.storefrontPopupData.visibleDevice},m.prototype.initTriggerType=function(){var t=this;if(this.storefrontPopupData){var o=this.storefrontPopupData.displaySettings.triggerType,e=this.storefrontPopupData.displaySettings.triggerValue||0;if(o===f.ON_PAGE_LOAD)setTimeout((function(){t.openModal()}),1e3*e)}},m.prototype.handleScroll=function(){if(this.storefrontPopupData){var t=this.storefrontPopupData.displaySettings.triggerType,o=this.storefrontPopupData.displaySettings.triggerValue||0;if(f.SCROLL_DOWN===t&&this.storefrontPopupData&&!this.isModalClosedByUser){var e=o,r=window.innerHeight,s=document.documentElement.scrollHeight;window.scrollY/(s-r)*100>=e&&this.openModal()}}},Object.defineProperty(m.prototype,"isCustomerLoggedIn",{get:function(){return!!h.getInstance().customerStore.customer},enumerable:!1,configurable:!0}),m}();export{m as IkasStorefrontPopupRendererViewModel};
@@ -0,0 +1,8 @@
1
+ import { Popup, PopupProduct } from "@ikas/popup-renderer";
2
+ export declare type SessionStorefrontPopups = Record<string, string[]>;
3
+ export declare const SESSION_POPUPS_KEY = "ikas-storefront-popups";
4
+ export declare const getPopupsFromLocalStorage: () => SessionStorefrontPopups | null;
5
+ export declare const addPopupToLocalStorage: (popupId: string) => void;
6
+ export declare const checkSavedSessionForPopups: () => void;
7
+ export declare function getPopupProducts(model: Popup, cdnURL: string, merchantId: string, priceListId?: string): Promise<Record<string, PopupProduct[]>>;
8
+ export declare const exitIntent: (options?: {}) => () => void;
@@ -0,0 +1 @@
1
+ import{__spreadArray as e,__awaiter as r,__generator as o,__assign as n}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as d}from"@ikas/storefront-config";import t from"lodash/throttle";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/components/index.js';import{getPopupDynamicData as p}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js';import"mobx";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js';import{PopupElementTypeEnum as s}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js';import{ProductListTypeEnum as i,PopupProduct as u,MAX_PRODUCT_COUNT as l}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js';import{SortByDirectionEnum as a}from"@ikas/storefront-api";import m from"../../../store/product/index.js";var c="ikas-storefront-popups",f=function(){var e=localStorage.getItem("ikas-storefront-popups");return e?JSON.parse(e):null},v=function(r){var o=f()||{},n=d.getSessionId();if(n){var t=o[n]?o[n]:[],p=r;o[n]=e(e([],t,!0),[p],!1),localStorage.setItem("ikas-storefront-popups",JSON.stringify(o))}},g=function(){var e=d.getSessionId(),r=f();r&&e&&!Object.keys(r).includes(e)&&localStorage.removeItem("ikas-storefront-popups")};function b(e,t,c,f){var v,g,b;return r(this,void 0,void 0,(function(){var r,f,k,x,h,_,I;return o(this,(function(j){switch(j.label){case 0:r={},f=[],e.modal.steps.forEach((function(e){e.elements.forEach((function(e){e.type===s.PRODUCT_LIST&&f.push(e)}))})),k=p(e),x=function(p){var s,f,x,h,_,I,j,P,E,y;return o(this,(function(o){switch(o.label){case 0:switch(s={input:{}},f=p.sortType.includes("ASC")?a.ASC:a.DESC,x=p.sortType.replace("ASC_","").replace("DESC_",""),h={direction:f,type:x},p.listType){case i.ALL:case i.LAST_VIEWED:s.input={page:1,perPage:l,order:h?[h]:void 0};break;case i.SPECIFIC:(_=p.variantPairs||[]).length&&(I=_.map((function(e){return e.productId})),s.input={productIdList:I,page:1,perPage:l,order:h?[h]:void 0});break;case i.CATEGORY:j=p.categoryId,s.input={categoryIdList:j?[j]:void 0,page:1,perPage:l,order:h?[h]:void 0}}return p.listType!==i.CATEGORY||s.input.categoryIdList?[4,m.searchProducts({input:n(n({},s.input),{priceListId:d.getPriceListId(),salesChannelId:d.getSalesChannelId()})})]:[2,"continue"];case 1:return(P=o.sent())&&P.isSuccess&&(null===(g=null===(v=P.data)||void 0===v?void 0:v.data)||void 0===g?void 0:g.length)&&(null==(E=null===(b=P.data)||void 0===b?void 0:b.data)?void 0:E.length)&&(y=[],E.forEach((function(r){var o,n,d;if(p.listType===i.SPECIFIC){var s=k.variantPairs.filter((function(e){return e.productListElementId===p.id}));(m=r.variants.find((function(e){return s.some((function(o){return o.productId===r.id&&o.variantId===e.id}))})))&&(d=[m])}else d=(null==r?void 0:r.variants[0])?[r.variants[0]]:[];for(var l=0,a=d||[];l<a.length;l++){var m;if((m=a[l])&&r){var f=(null===(o=m.images)||void 0===o?void 0:o.length)?m.images[0]:null;y.push(new u({productId:r.id,variantId:m.id,name:r.name,price:m.formattedSellPrice,discountPrice:m.formattedDiscountPrice,discountRatio:m.discountPercentage?m.discountPercentage:null,imageURL:f?"".concat(t,"images/").concat(c,"/").concat(f.imageId):null,url:"".concat(e.storeUrl,"/").concat(null===(n=r.metaData)||void 0===n?void 0:n.slug)}))}}})),r[p.id]=y),[2]}}))},h=0,_=f,j.label=1;case 1:return h<_.length?(I=_[h],[5,x(I)]):[3,4];case 2:j.sent(),j.label=3;case 3:return h++,[3,1];case 4:return[2,r]}}))}))}var k=function(e){var r,o,d,p,s,i;return void 0===e&&(e={}),d=n(n({},{threshold:20,maxDisplays:1,eventThrottle:200,onExitIntent:function(){}}),e),p=new Map,s=0,i=function(){p.forEach((function(e,r,o){return function(e){var r=p.get(e),o=r.eventName,n=r.callback;document.removeEventListener(o,n),p.delete(e)}(r)}))},r="mousemove",o=t((function(e){e.clientY<=d.threshold&&s<d.maxDisplays&&(s++,1)&&(d.onExitIntent(),s>=d.maxDisplays&&i())}),d.eventThrottle),document.addEventListener(r,o,!1),p.set("document:".concat(r),{eventName:r,callback:o}),i};export{c as SESSION_POPUPS_KEY,v as addPopupToLocalStorage,g as checkSavedSessionForPopups,k as exitIntent,b as getPopupProducts,f as getPopupsFromLocalStorage};
@@ -0,0 +1 @@
1
+ var t=function(r,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},t(r,n)};function r(r,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=r}t(r,n),r.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var n=function(){return n=Object.assign||function(t){for(var r,n=1,e=arguments.length;n<e;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},n.apply(this,arguments)};function e(t,r,n,e){return new(n||(n=Promise))((function(o,a){function c(t){try{u(e.next(t))}catch(t){a(t)}}function i(t){try{u(e.throw(t))}catch(t){a(t)}}function u(t){var r;t.done?o(t.value):(r=t.value,r instanceof n?r:new n((function(t){t(r)}))).then(c,i)}u((e=e.apply(t,r||[])).next())}))}function o(t,r){var n,e,o,a,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(c=0)),c;)try{if(n=1,e&&(o=2&i[0]?e.return:i[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,i[1])).done)return o;switch(e=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,e=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=r.call(t,c)}catch(t){i=[6,t],e=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function a(t,r,n){if(n||2===arguments.length)for(var e,o=0,a=r.length;o<a;o++)!e&&o in r||(e||(e=Array.prototype.slice.call(r,0,o)),e[o]=r[o]);return t.concat(e||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;export{n as __assign,e as __awaiter,r as __extends,o as __generator,a as __spreadArray};
@@ -0,0 +1 @@
1
+ import e from"react";var t=function(t){var r=t.className,o=t.style;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:o,className:"icon "+(r||"")},e.createElement("path",{d:"M11.25 13.5L6.75 9L11.25 4.5",stroke:"#697586","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
@@ -0,0 +1 @@
1
+ import e from"react";var t=function(t){var r=t.className,o=t.style;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:o,className:"icon "+(r||"")},e.createElement("path",{d:"M6.75 13.5L11.25 9L6.75 4.5",stroke:"#697586","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
@@ -0,0 +1 @@
1
+ import e from"react";var t=function(t){var r=t.className,o=t.style;return e.createElement("svg",{className:"icon "+(r||""),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:o},e.createElement("path",{d:"M15 4.99998L5 15M5 4.99998L15 15",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}))};export{t as default};
@@ -0,0 +1 @@
1
+ import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import o from"react";import{observer as e}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r,injectFontScript as n}from"../../helpers/index.js";var i=e((function(e){var i=e.element,a={display:"flex",alignItems:"center",justifyContent:r(i.horizontalAlignment),padding:"".concat(i.outerVerticalPadding,"px ").concat(i.outerHorizontalPadding,"px"),backgroundColor:i.bgColor},l={color:i.color,backgroundColor:i.buttonBgColor,fontSize:i.fontSize,fontWeight:i.fontWeight,fontFamily:n(i.fontFamily),textAlign:"center",border:"".concat(i.borderWidth,"px ").concat(i.borderStyle," ").concat(i.borderColor),borderRadius:i.borderRadius,padding:"".concat(i.verticalPadding,"px ").concat(i.horizontalPadding,"px")},c={width:"".concat(i.width,"%"),minWidth:"fit-content",cursor:"pointer"};return o.createElement("div",{style:a},o.createElement("a",{href:i.link||void 0,style:c},o.createElement("div",{dangerouslySetInnerHTML:{__html:i.text},style:t({},l)})))}));export{i as default};
@@ -0,0 +1 @@
1
+ import t from"react";import{observer as e}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as o}from"../../helpers/index.js";var r=e((function(e){var r=e.element,a={display:"flex",alignItems:"center",justifyContent:o(r.horizontalAlignment),padding:"".concat(r.verticalPadding,"px ").concat(r.horizontalPadding,"px"),backgroundColor:r.bgColor,width:"100%"},n={backgroundColor:r.borderColor,width:"".concat(r.width,"%"),height:"".concat(r.borderWidth,"px"),borderRadius:"".concat(r.borderRadius,"px")};return t.createElement("div",{style:a},t.createElement("div",{style:n}))}));export{r as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";var r=t((function(t){var r=t.checkboxItem;e.useEffect((function(){r.showInCheckedStatus?r.isChecked=!0:r.isChecked=!1}),[r.showInCheckedStatus]);var c=r.requiredToBeChecked;return e.createElement("div",{style:{width:"100%",display:"flex",gap:6,flexDirection:"column"}},e.createElement("div",{style:{width:"100%",display:"flex",gap:8,flexDirection:"row",alignItems:"center"}},e.createElement("input",{style:{width:"16px",height:"16px",cursor:"pointer"},type:"checkbox",checked:r.isChecked,onChange:function(){r.isChecked=!r.isChecked,c&&c.hasError&&r.isChecked&&(c.hasError=!1)}}),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:4}},e.createElement("div",{dangerouslySetInnerHTML:{__html:r.text}}),!!c&&e.createElement("span",null,"*"))),!!c&&c.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},c.validationErrorMessage))}));export{r as CheckboxItemView};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as r}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";import t from"react-date-picker";var a=r((function(r){var a=e.useState(!1),o=a[0],l=a[1],n=e.useRef(null);r.placeholder;var c=r.isRequired,i=r.inputLabel;r.updateCurrentInfo;var s=r.formInputSettings,u=r.value,d=r.onValueChange;return e.useEffect((function(){if(n.current){var e=n.current.getElementsByClassName("react-date-picker__wrapper");if(e.length>0){var r=e[0];r.style.backgroundColor=s.bgColor,r.style.border="".concat(s.borderWidth,"px solid ").concat(o?s.focusBorderColor:s.borderColor),r.style.borderRadius="".concat(s.borderRadius,"px"),r.style.fontSize="14px",r.style.padding="10px 12px",r.style.height="".concat(s.height,"px")}}}),[n.current]),e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"},ref:n},(i||c)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},i.text),c&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),c&&c.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},c.validationErrorMessage)),e.createElement(t,{onChange:function(e){return function(e){var r=e?e.valueOf().toString():"";d(r),c&&c.hasError&&r.length>0&&(c.hasError=!1)}(e)},value:u?new Date(Number(u)):null,className:"ikas-popup-datepicker",disableCalendar:!0,format:"dd / MM / yyyy",maxDate:new Date,clearIcon:null,onFocus:function(){return l(!0)},onBlur:function(){return function(){if(l(!1),n.current){var e=n.current.getElementsByClassName("react-date-picker__wrapper");e.length>0&&(e[0].style.border="".concat(s.borderWidth,"px solid ").concat(s.borderColor))}}()}}))}));export{a as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as r}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";var t=r((function(r){var t,o=e.useState(!1),n=o[0],i=o[1],l=r.genderFormItem,a=r.formInputSettings;r.onValueChange;var d={width:"100%",backgroundColor:a.bgColor,border:"".concat(a.borderWidth,"px solid ").concat(n?a.focusBorderColor:a.borderColor),color:l.genders.find((function(e){return e.isSelected}))?"black":"#697586",borderRadius:"".concat(a.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(a.height,"px"),appearance:"none",backgroundImage:"url(\"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' %3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 12px center",backgroundSize:"20px",cursor:"pointer"};return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(l.inputLabel||l.required)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},l.inputLabel&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},l.inputLabel.text),l.required&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),l.required&&l.required.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},l.required.validationErrorMessage)),e.createElement("select",{value:(null===(t=l.genders.find((function(e){return e.isSelected})))||void 0===t?void 0:t.type)||void 0,onChange:function(e){return r=e.target.value,l.genders.forEach((function(e){e.isSelected=e.type===r})),void(l.required&&l.required.hasError&&(l.required.hasError=!1));var r},style:d,onFocus:function(){return i(!0)},onBlur:function(){return i(!1)}},!!l.placeholder&&e.createElement("option",{value:"",disabled:!0,selected:!0,hidden:!0},l.placeholder.text),l.genders.filter((function(e){return!!e.label})).map((function(r){return e.createElement("option",{key:r.type,value:r.type},r.label)}))))}));export{t as default};
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.mjs.js";import r from"react";import{observer as n}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as o,injectFontScript as a}from"../../helpers/index.js";import{FormItemTypeEnum as i}from"../../models/modal/step/elements/form/index.js";import s from"../button-element-renderer/index.js";import l from"./input-item-view/index.js";import{CheckboxItemView as m}from"./checkbox-item-view/index.js";import u from"./date-item-view/index.js";import c from"./gender-item-view/index.js";var d=n((function(n){var d=n.element,f=n.popup,p=n.isPreviewMode,E=n.sfProps,I=r.useState(!1);I[0];var C=I[1],v=d,h=v.rows.slice().sort((function(e,t){return e.order-t.order})),S=v.formSettings,M=v.buttonSettings,g=v.bgColor,R={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:o(v.horizontalAlignment),gap:"".concat(S.gapBetweenItems,"px"),padding:"".concat(v.verticalPadding,"px ").concat(v.horizontalPadding,"px"),backgroundColor:g,width:"100%"},_={display:"flex",flexDirection:"row",width:"100%",gap:"".concat(S.gapBetweenItems,"px")},O={flex:1,display:"flex",alignItems:"flex-end",fontFamily:a(S.fontFamily),fontSize:S.fontSize},T=function(){return e(void 0,void 0,void 0,(function(){var e,r,n;return t(this,(function(t){switch(t.label){case 0:return e=f.modal.steps.findIndex((function(e){return e.id===f.modal.selectedStep.id})),r=e===f.modal.steps.length-2,!p&&E&&r?(C(!0),function(){var e=!1;return v.rows.forEach((function(t){t.columns.forEach((function(t){switch(t.type){case i.CUSTOMER_BIRTHDAY:var r=t.formItem;r.required&&!r.value&&(r.required.hasError=!0,e=!0);break;case i.CUSTOMER_EMAIL:case i.CUSTOMER_PHONE:case i.CUSTOMER_NAME:case i.CUSTOMER_SURNAME:case i.CHECKBOX_FORM_ITEM:var n=t.formItem;if(n.required&&!n.value){if(n.type===i.CUSTOMER_EMAIL&&(null==E?void 0:E.isCustomerLoggedIn))return;n.required.hasError=!0,e=!0}break;case i.CUSTOMER_GENDER:var o=t.formItem,a=o.genders.find((function(e){return e.isSelected}));o.required&&!a&&(o.required.hasError=!0,e=!0);case i.CHECKBOX_FORM_ITEM:var s=t.formItem;s.requiredToBeChecked&&!s.isChecked&&(s.requiredToBeChecked.hasError=!0,e=!0)}}))})),e}()?(C(!1),[2]):(n={},v.rows.forEach((function(e){e.columns.forEach((function(e){var t;switch(e.type){case i.CUSTOMER_BIRTHDAY:n.birthday=e.formItem.value;break;case i.CUSTOMER_EMAIL:n.email=e.formItem.value;break;case i.CUSTOMER_GENDER:n.gender=(null===(t=e.formItem.genders.find((function(e){return e.isSelected})))||void 0===t?void 0:t.type)||"";break;case i.CUSTOMER_PHONE:n.phone=e.formItem.value;break;case i.CUSTOMER_NAME:n.firstName=e.formItem.value||"";break;case i.CUSTOMER_SURNAME:n.lastName=e.formItem.value||"";break;case i.CHECKBOX_FORM_ITEM:n.hasPermission=e.formItem.isChecked}}))})),[4,E.onCustomerSave(n)])):[3,2];case 1:t.sent(),C(!1),t.label=2;case 2:return-1!==e&&e<f.modal.steps.length&&(f.modal.selectedStep=f.modal.steps[e+1]),[2]}}))}))},b={width:"".concat(M.width,"%"),minWidth:"fit-content"};return r.createElement("div",{style:R},h.map((function(e,t){return r.createElement("div",{style:_,key:t},e.columns.slice().sort((function(e,t){return e.order-t.order})).map((function(e,t){return r.createElement("div",{style:O,key:t},function(e){switch(e.type){case i.CUSTOMER_EMAIL:case i.CUSTOMER_PHONE:case i.CUSTOMER_NAME:case i.CUSTOMER_SURNAME:var t=e.formItem;return t.type===i.CUSTOMER_EMAIL&&(null==E?void 0:E.isCustomerLoggedIn)&&!p?null:r.createElement(l,{formInputSettings:S.formInputSettings,inputLabel:t.inputLabel,isRequired:t.required,onValueChange:function(e){return p?null:t.value=e},placeholder:t.placeholder,updateCurrentInfo:t.updateCurrentInfo,value:t.value||""});case i.CUSTOMER_BIRTHDAY:var n=e.formItem;return r.createElement(u,{formInputSettings:S.formInputSettings,inputLabel:n.inputLabel,isRequired:n.required,onValueChange:function(e){return p?null:n.value=e},placeholder:n.placeholder,updateCurrentInfo:n.updateCurrentInfo,value:n.value||""});case i.CUSTOMER_GENDER:var o=e.formItem;return r.createElement(c,{genderFormItem:o,formInputSettings:S.formInputSettings,onValueChange:function(e){return p?null:o.genders.forEach((function(t){t.isSelected=t.label===e}))}});case i.CHECKBOX_FORM_ITEM:return r.createElement(m,{checkboxItem:e.formItem})}}(e))})))})),r.createElement("div",{style:b,onClick:function(e){T(),e.preventDefault(),e.stopPropagation()}},r.createElement(s,{element:M})," "))}));export{d as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";var r=t((function(t){var r=e.useState(!1),o=r[0],l=r[1],n=t.placeholder,a=t.isRequired,i=t.inputLabel;t.updateCurrentInfo;var c=t.formInputSettings,d=t.value,u=t.onValueChange,p={width:"100%",backgroundColor:c.bgColor,border:"".concat(c.borderWidth,"px solid ").concat(o?c.focusBorderColor:c.borderColor),borderRadius:"".concat(c.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(c.height,"px")};return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(i||a)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},i.text),a&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),a&&a.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},a.validationErrorMessage)),e.createElement("input",{type:"text",placeholder:(null==n?void 0:n.text)||"",value:d||"",onChange:function(e){return function(e){u(e),a&&a.hasError&&e.length>0&&(a.hasError=!1)}(e.target.value)},style:p,onFocus:function(){return l(!0)},onBlur:function(){return l(!1)}}))}));export{r as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{ImageFitEnum as r}from"../../models/modal/step/elements/image/index.js";var i=t((function(t){var i=t.element,a=t.popup,d=t.editModeChildren,o=i;o.cdnURL||(o.cdnURL=a.cdnURL),o.merchantId||(o.merchantId=a.merchantId);var n=a.modal.windowSettings,c={width:n.takeFullWidth?"100%":n.maxWidth,backgroundColor:o.bgColor,padding:"".concat(o.verticalPadding,"px ").concat(o.horizontalPadding,"px"),borderRadius:o.borderRadius};if(!o.src&&a.isPreviewMode&&d)return e.createElement("div",{style:c},d);var m={objectFit:o.objectFit===r.CONTAIN?"contain":"cover",height:"100%"};return e.createElement("a",{href:o.link||void 0,style:c},o.src&&e.createElement("img",{src:o.src||void 0,width:"100% !important",style:m}))}));export{i as default};
@@ -0,0 +1 @@
1
+ import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import i from"react";import{observer as e}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as o}from"../../helpers/index.js";import{ImageFitEnum as n,ImagePositionEnum as a}from"../../models/modal/step/elements/image/index.js";var r=e((function(e){var r=e.element,d=e.popup,m=e.editModeChildren,c=r;if(c.cdnURL||(c.cdnURL=d.cdnURL),c.merchantId||(c.merchantId=d.merchantId),!c.src&&d.isPreviewMode&&m)return m;var s={display:"flex",alignItems:"center",justifyContent:o(c.horizontalAlignment),padding:"".concat(c.verticalPadding,"px ").concat(c.horizontalPadding,"px"),backgroundColor:c.bgColor,maxWidth:"100%"},l={borderRadius:"".concat(c.borderRadius,"px"),objectFit:c.objectFit===n.CONTAIN?"contain":"cover",width:"".concat(c.maxWidth,"%")};return c.imagePosition===a.DISABLE_FLOAT?i.createElement("a",{href:c.link||void 0,style:s},i.createElement("img",{src:c.src||void 0,width:100===c.maxWidth?"100% !important":void 0,style:l})):i.createElement("img",{src:c.src||void 0,width:100===c.maxWidth?"100% !important":void 0,style:t(t({},l),{padding:"".concat(c.verticalPadding,"px ").concat(c.horizontalPadding,"px"),backgroundColor:c.bgColor,float:c.imagePosition===a.FLOAT_LEFT?"left":"right"}),onClick:function(){c.link&&window.open(c.link,"_blank")}})}));export{r as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from"../../../../../mobx-react/dist/mobxreact.esm.js";import{PopupTypeEnum as o,PopupPositonEnum as n}from"../models/modal/index.js";import i from"../assets/x-close.js";import{CloseButtonPositionTypeEnum as r,CloseIconTypeEnum as l,CloseButtonDisplayTypeEnum as s}from"../models/modal/close-settings/index.js";import{PopupElementTypeEnum as a,ComponentVerticalAlignmentEnum as d}from"../models/modal/step/elements/base/index.js";import c from"./text-element-renderer/index.js";import m from"./button-element-renderer/index.js";import p from"./space-element-renderer/index.js";import u from"./divider-element-renderer/index.js";import f from"./social-element-renderer/index.js";import P from"./image-element-renderer/index.js";import E from"./image-column-element-renderer/index.js";import x from"./product-list-renderer/index.js";import g from"./form-element-renderer/index.js";import{ImageColumnPositionEnum as T,MobileImageColumnPositionEnum as v}from"../models/modal/step/elements/image-column/index.js";var y=t((function(t){var y,b,O,I,C=t.popup,_=t.dynamicData,h=t.dashboardComponents,M=t.previewMode,A=t.sfProps,w=t.isMobile,D=C.modal,R=D.teaser,S=!!D.selectedStep.isTeaser,k=D.selectedStep.elements.find((function(e){return e.type===a.IMAGE_COLUMN})),N=S?R.backgroundSettings:D.backgroundSettings,j=S?R.windowSettings:D.windowSettings,L=S?R.closeSettings:D.closeSettings,B=N.allowScrollingWhenPopupOpen,U=C.isPreviewMode||M,H=!!U||D.isVisible;document.body.style.overflow=H&&!B?"hidden":"auto";var W=N.overlay,F=N.border,V="center",G="center";switch(S?o.POPUP:D.type){case o.POPUP:var z=S?R.position:D.position;z===n.POPUP_TOP_LEFT?(V="flex-start",G="flex-start"):z===n.POPUP_TOP_CENTER?(V="center",G="flex-start"):z===n.POPUP_TOP_RIGHT?(V="flex-end",G="flex-start"):z===n.POPUP_MIDDLE_LEFT?(V="flex-start",G="center"):z===n.POPUP_MIDDLE_CENTER?(V="center",G="center"):z===n.POPUP_MIDDLE_RIGHT?(V="flex-end",G="center"):z===n.POPUP_BOTTOM_LEFT?(V="flex-start",G="flex-end"):z===n.POPUP_BOTTOM_CENTER?(V="center",G="flex-end"):z===n.POPUP_BOTTOM_RIGHT&&(V="flex-end",G="flex-end");break;case o.DRAWER:D.position===n.DRAWER_LEFT?(V="flex-start",G="center"):D.position===n.DRAWER_RIGHT&&(V="flex-end",G="center");break;case o.NOTIFICATION_BAR:D.position===n.NOTIFICATION_BAR_UP?(V="center",G="flex-start"):D.position===n.NOTIFICATION_BAR_DOWN&&(V="center",G="flex-end")}var K={position:"fixed",display:"flex",justifyContent:V,alignItems:G,top:0,left:0,right:0,bottom:0,zIndex:9995,overflow:"hidden",padding:"".concat(j.outerVerticalPadding,"px ").concat(j.outerHorizontalPadding,"px"),opacity:H?1:0,visibility:H?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},X={position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9996,backgroundColor:W?W.bgColor:"",opacity:W?(W.bgOpacity||100)/100:void 0},Y={position:"relative",zIndex:9997,backgroundColor:N.bgColor,border:F?"".concat(F.borderWidth,"px ").concat(F.borderStyle," ").concat(F.borderColor):"",borderRadius:"".concat(j.borderRadius,"px"),maxWidth:"100%",maxHeight:"100%",width:j.takeFullWidth?"100%":void 0,minHeight:j.minHeight,height:j.takeFullHeight?"100%":void 0,boxShadow:N.shadow?"0 0 10px ".concat(N.shadow.color):"",overflow:"hidden",opacity:H?1:0,visibility:H?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},q="";switch(null==k?void 0:k.verticalAlignment){case d.BOTTOM:q="flex-end";break;case d.MIDDLE:q="center";break;case d.TOP:q="flex-start"}var J=k?k.imagePosition===T.LEFT_ALIGN?"row-reverse":"row":"",Q=k?k.mobilePosition===v.TOP?"column-reverse":"column":"",Z={display:"flex",flexDirection:k?w?Q:J:"column"},$={width:j.takeFullWidth?"100%":j.maxWidth,maxWidth:"100%",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:q,padding:"".concat(j.innerVerticalPadding,"px ").concat(j.innerHorizontalPadding,"px")},ee={position:L.closeButtonPositionType===r.TAKE_SPACE?"relative":"absolute",float:L.closeButtonPositionType===r.TAKE_SPACE?"right":"none",top:8,right:8,zIndex:9998},te={position:"sticky",padding:"6px",marginLeft:L.closeButtonPositionType===r.TAKE_SPACE?"14px":void 0,display:"flex",justifyContent:"center",alignItems:"center",border:(null===(y=L.iconSettings)||void 0===y?void 0:y.type)===l.WITH_BORDER?"1px solid ".concat(null===(b=L.iconSettings)||void 0===b?void 0:b.color):"",borderRadius:"50%",backgroundColor:null===(O=L.iconSettings)||void 0===O?void 0:O.backgroundColor},oe={color:null===(I=L.iconSettings)||void 0===I?void 0:I.color,cursor:"pointer"},ne=function(t){var o=t.type,n=h&&h[o]&&h[o].length?h[o][0]:null,i=n&&C.marketingPopupViewModel?e.createElement(n,{element:t,marketingPopupViewModel:C.marketingPopupViewModel}):void 0;switch(o){case a.TEXT:return e.createElement(c,{element:t});case a.IMAGE:return e.createElement(P,{element:t,popup:C,editModeChildren:i});case a.IMAGE_COLUMN:return w&&k.mobilePosition===v.HIDE?null:e.createElement(E,{element:t,popup:C,editModeChildren:i});case a.BUTTON:return e.createElement(m,{element:t});case a.DIVIDER:return e.createElement(u,{element:t});case a.FORM:return e.createElement(g,{element:t,popup:C,isPreviewMode:!!U,sfProps:A});case a.PRODUCT_LIST:return e.createElement(x,{element:t,products:_.products[t.id],popup:C,editModeChildren:i,isPreviewMode:!!U});case a.SOCIAL_MEDIA:return e.createElement(f,{element:t,popup:C,editModeChildren:i});case a.SPACE:return e.createElement(p,{element:t})}},ie=function(){U||D.isVisible&&(D.isVisible=!1,A&&A.onModalClose())};return e.createElement("div",{className:"ikas-popup-default-styles",id:"ikas-popup-container",style:K},e.createElement("div",{style:Y},L.closeButtonDisplayType!==s.ALWAYS_HIDDEN&&e.createElement("div",{style:ee,onClick:function(){return ie()}},e.createElement("div",{style:te,className:L.closeButtonDisplayType===s.VISIBLE_ON_HOVER?"visible-on-hover":""},e.createElement(i,{style:oe}))),e.createElement("div",{style:Z,onClick:function(e){S&&(D.selectedStep=D.steps[0])}},e.createElement("div",{style:$},D.selectedStep.elements.filter((function(e){return e.type!==a.IMAGE_COLUMN})).slice().sort((function(e,t){return e.order-t.order})).map((function(e){return ne(e)}))),k&&ne(k))),e.createElement("div",{style:X,onClick:function(){return ie()}}))}));export{y as default};
@@ -0,0 +1 @@
1
+ import{__spreadArray as t,__assign as e}from"../../../ext/tslib/tslib.es6.mjs.js";import o from"react";import{observer as i}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as n,injectFontScript as l}from"../../helpers/index.js";import{ProductListTypeEnum as r,ProductListLayoutEnum as d}from"../../models/modal/step/elements/product/index.js";import a from"../button-element-renderer/index.js";import c from"../../../../../../swiper/modules/navigation.mjs.js";import u from"../../../../../../swiper/modules/scrollbar.mjs.js";import{Swiper as s,SwiperSlide as m}from"../../../../../../swiper/swiper-react.mjs.js";import v from"../../assets/left-arrow.js";import g from"../../assets/right-arrow.js";var p=i((function(i){var p,f=i.element,b=i.products,h=i.popup,x=i.editModeChildren,y=i.isPreviewMode,E=o.useState(null),w=E[0],C=E[1],P=o.useState(!1),S=P[0],j=P[1],z=o.useState(!1),R=z[0],W=z[1],I=f,F=[];if(b&&(F=I.listType===r.SPECIFIC?(null===(p=I.variantPairs)||void 0===p?void 0:p.length)?b.slice().sort((function(t,e){return I.variantPairs.findIndex((function(e){return e.variantId===t.variantId}))-I.variantPairs.findIndex((function(t){return t.variantId===e.variantId}))})):[]:t([],b,!0)),F.length>I.maxProductsToShow&&(F.length=I.maxProductsToShow),!(F&&F.length||!h.isPreviewMode)&&x)return x;if(!F||!F.length)return null;I.gapBetweenProductElements;var k=I.productDetailSettings.image,A=I.productDetailSettings.button,D=I.buttonSettings,L=I.productDetailSettings.discountRatio,_=I.productDetailSettings.finalPrice,N=I.productDetailSettings.originalPrice,B=I.productDetailSettings.name,M=n(I.horizontalAlignment),T=1;I.layout===d.ONE_COLUMN?T=1:I.layout===d.TWO_COLUMN?T=2:I.layout===d.THREE_COLUMN&&(T=3);var O={padding:"".concat(I.verticalPadding,"px ").concat(I.horizontalPadding,"px"),backgroundColor:I.productBgColor,width:"100%",height:"max-content"},U={display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",height:"100%"},H={display:"flex",justifyContent:M,alignItems:"center",width:"100%",backgroundColor:null==k?void 0:k.bgColor,borderRadius:(null==k?void 0:k.borderRadius)?"".concat(k.borderRadius,"px"):void 0},V={width:"".concat(null==k?void 0:k.maxWidth,"%"),objectFit:"contain",borderRadius:(null==k?void 0:k.borderRadius)?"".concat(k.borderRadius,"px"):void 0},$={display:"flex",flexDirection:"column",width:"100%"},q={display:"flex",flexDirection:"column"},G={backgroundColor:null==B?void 0:B.bgColor,color:null==B?void 0:B.color,fontFamily:B?l(B.fontFamily):void 0,fontSize:null==B?void 0:B.fontSize,fontWeight:null==B?void 0:B.fontWeight,padding:"".concat(null==B?void 0:B.verticalPadding,"px ").concat(null==B?void 0:B.horizontalPadding,"px"),width:"100%",textAlign:null==B?void 0:B.horizontalAlignment,border:"".concat(null==B?void 0:B.borderWidth,"px ").concat(null==B?void 0:B.borderStyle," ").concat(null==B?void 0:B.borderColor),borderRadius:null==B?void 0:B.borderRadius},J={backgroundColor:null==L?void 0:L.bgColor,color:null==L?void 0:L.color,fontFamily:L?l(L.fontFamily):void 0,fontSize:null==L?void 0:L.fontSize,fontWeight:null==L?void 0:L.fontWeight,padding:"".concat(null==L?void 0:L.verticalPadding,"px ").concat(null==L?void 0:L.horizontalPadding,"px"),width:"100%",textAlign:null==L?void 0:L.horizontalAlignment,border:"".concat(null==L?void 0:L.borderWidth,"px ").concat(null==L?void 0:L.borderStyle," ").concat(null==L?void 0:L.borderColor),borderRadius:null==L?void 0:L.borderRadius},K={textDecoration:"line-through",backgroundColor:null==N?void 0:N.bgColor,color:null==N?void 0:N.color,fontFamily:N?l(N.fontFamily):void 0,fontSize:null==N?void 0:N.fontSize,fontWeight:null==N?void 0:N.fontWeight,padding:"".concat(null==N?void 0:N.verticalPadding,"px ").concat(null==N?void 0:N.horizontalPadding,"px"),width:"100%",textAlign:null==N?void 0:N.horizontalAlignment,border:"".concat(null==N?void 0:N.borderWidth,"px ").concat(null==N?void 0:N.borderStyle," ").concat(null==N?void 0:N.borderColor),borderRadius:null==N?void 0:N.borderRadius},Q={backgroundColor:null==_?void 0:_.bgColor,color:null==_?void 0:_.color,fontFamily:_?l(_.fontFamily):void 0,fontSize:null==_?void 0:_.fontSize,fontWeight:null==_?void 0:_.fontWeight,padding:"".concat(null==_?void 0:_.verticalPadding,"px ").concat(null==_?void 0:_.horizontalPadding,"px"),width:"100%",textAlign:null==_?void 0:_.horizontalAlignment,border:"".concat(null==_?void 0:_.borderWidth,"px ").concat(null==_?void 0:_.borderStyle," ").concat(null==_?void 0:_.borderColor),borderRadius:null==_?void 0:_.borderRadius},X={width:"".concat(D.width,"%"),minWidth:"fit-content"},Y=e({display:"flex",justifyContent:"center",width:"100%",gap:"10px"},1===T?{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"space-between",zIndex:10}:void 0),Z={padding:10,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",border:"1px solid #EEF2F6",cursor:"pointer"};return o.createElement("div",{style:O},o.createElement(s,{onSwiper:C,modules:[c,u],spaceBetween:I.gapBetweenProducts,slidesPerView:T,navigation:{nextEl:".custom-next-button",prevEl:".custom-prev-button"},scrollbar:void 0},F.map((function(t,e){return o.createElement(m,{style:{height:"auto"},key:t.variantId},o.createElement("div",{style:U,onClick:function(){return function(t){if(!y&&t.url){var e=document.createElement("a");e.href=t.url,e.target="_blank",e.click()}}(t)}},o.createElement("div",{style:$},!!k&&t.imageURL&&o.createElement("div",{style:H},o.createElement("img",{src:t.imageURL||void 0,alt:t.name||void 0,style:V})),(!!B||!!L)&&o.createElement("div",{style:q},!!B&&o.createElement("div",{style:G},t.name),!!L&&!!t.discountPrice&&o.createElement("div",{style:J},t.$discountRatio)),(!!N||!!_)&&o.createElement("div",null,!!N&&!!t.discountPrice&&o.createElement("div",{style:K},t.price),!!_&&o.createElement("div",{style:Q},t.discountPrice||t.price))),!!A&&o.createElement("div",{style:X}," ",o.createElement(a,{element:D})," ")))})),o.createElement("div",{style:Y},o.createElement("div",{className:"custom-prev-button",style:e(e({},Z),S?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){w&&(w.slidePrev(),W(w.isEnd),j(w.isBeginning))}},o.createElement(v,null)),o.createElement("div",{className:"custom-next-button",style:e(e({},Z),R?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){w&&(w.slideNext(),W(w.isEnd),j(w.isBeginning))}},o.createElement(g,null)))))}));export{p as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r}from"../../helpers/index.js";var n=t((function(t){var n=t.element,i=n.socialMediaLinks.filter((function(e){return!!e.link})).sort((function(e,t){return e.order-t.order}));if(!i.length&&t.editModeChildren&&t.popup.isPreviewMode)return t.editModeChildren;var o={display:"flex",alignItems:"center",justifyContent:r(n.horizontalAlignment),padding:"".concat(n.verticalPadding,"px ").concat(n.horizontalPadding,"px"),backgroundColor:n.bgColor,width:"100%"},a={display:"flex",alignItems:"center",gap:"".concat(n.gapBetweenLogos,"px")};return e.createElement("div",{style:o},e.createElement("div",{style:a},i.map((function(t,r){return e.createElement("a",{href:t.link||"",key:r},e.createElement("img",{src:t.iconUrlWithoutHash||"",width:24,height:24}))}))))}));export{n as default};
@@ -0,0 +1 @@
1
+ import t from"react";import{observer as e}from"../../../../../../mobx-react/dist/mobxreact.esm.js";var r=e((function(e){var r=e.element,o={backgroundColor:r.bgColor,padding:"".concat(r.verticalPadding,"px ").concat(r.horizontalPadding,"px"),height:r.height,width:"100%"};return t.createElement("div",{style:o})}));export{r as default};
@@ -0,0 +1 @@
1
+ import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import o from"react";import{observer as e}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{injectFontScript as r}from"../../helpers/index.js";var n=e((function(e){var n=e.element,a=n,i={backgroundColor:a.bgColor,border:"".concat(a.borderWidth,"px ").concat(a.borderStyle," ").concat(a.borderColor),borderRadius:a.borderRadius,padding:"".concat(a.outerVerticalPadding,"px ").concat(a.outerHorizontalPadding,"px")},d={color:a.color,fontSize:a.fontSize,fontWeight:a.fontWeight,fontFamily:r(a.fontFamily),textAlign:a.horizontalAlignment,padding:"".concat(a.verticalPadding,"px ").concat(a.horizontalPadding,"px")};return o.createElement("div",{style:i},o.createElement("div",{dangerouslySetInnerHTML:{__html:n.text},style:t({},d)}))}));export{n as default};
@@ -0,0 +1 @@
1
+ import{__spreadArray as e}from"../../ext/tslib/tslib.es6.mjs.js";import{ComponentHorizontalAlignmentEnum as t,PopupElementTypeEnum as a}from"../models/modal/step/elements/base/index.js";var n=function(t){var n=[];return t.modal.steps.forEach((function(t){t.elements.forEach((function(t){if(t.type===a.PRODUCT_LIST){var r=t.variantPairs;r&&(n=e(e([],n,!0),r,!0))}}))})),{variantPairs:n}},r=function(e){var a="";switch(e){case t.LEFT:a="flex-start";break;case t.CENTER:a="center";break;case t.RIGHT:a="flex-end"}return a},i=function(e){if(e.name){var t=e.name.replace(/ /g,"+"),a="";if(e.variants){a+=":";var n=e.variants.some((function(e){return"italic"===e}));if(n&&(a+="ital,"),a+="wght@",n){var r=new RegExp("italic","i");a+=e.variants.reduce((function(e,t){return r.test(t)?e:e+"0,".concat(t.replace("regular","400"),";")}),""),a+=e.variants.reduce((function(e,t){return r.test(t)?e+"1,".concat("italic"===t?"400":t.replace("italic",""),";"):e}),"")}else a+=e.variants.reduce((function(e,t){return e+"".concat(t.replace("regular","400"),";")}),"");a=a.substring(0,a.length-1),a+="&display=swap"}return"https://fonts.googleapis.com/css2?family=".concat(t).concat(a)}},s=function(e){var t="'".concat(e.name,'\', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif');if(document.getElementById("ikas-popup-font-".concat(e.name)))return t;var a=i(e);if(a){var n=document.createElement("link");return n.setAttribute("id","ikas-popup-font-".concat(e.name)),n.setAttribute("rel","stylesheet"),n.setAttribute("href",a),document.getElementsByTagName("head")[0].appendChild(n),t}};export{i as getGoogleFontHref,r as getHorizontalAlignment,n as getPopupDynamicData,s as injectFontScript};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as a,computed as t}from"mobx";import{PopupSettings as i}from"./settings/index.js";import{Modal as o}from"./modal/index.js";var r,l;(l=r||(r={})).DESKTOP="DESKTOP",l.MOBILE="MOBILE";var n=function(){function l(n,u,s){var p;this.marketingPopupViewModel=n.marketingPopupViewModel||void 0,l.t=(null===(p=this.marketingPopupViewModel)||void 0===p?void 0:p.t)||function(){return""},this.id=n.id||Date.now().toString(),this.settings=new i(n.settings||{}),this.modal=new o(n.modal||{}),this.pagePreviewType=n.pagePreviewType||r.DESKTOP,this.cdnURL=u,this.merchantId=s,this.storeUrl=n.storeUrl||"",this.products=[],e(this,{id:a,settings:a,modal:a,pagePreviewType:a,cdnURL:a,merchantId:a,storeUrl:a,products:a,marketingPopupViewModel:a,isPreviewMode:t})}return Object.defineProperty(l.prototype,"$products",{get:function(){return this.products},set:function(e){this.products=e},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isPreviewMode",{get:function(){return!!this.marketingPopupViewModel},enumerable:!1,configurable:!0}),l.fontFamilyOptions=function(){return[{value:"Arial",label:"Arial"},{value:"Helvetica",label:"Helvetica"},{value:"Times New Roman",label:"Times New Roman"},{value:"Courier",label:"Courier"},{value:"Verdana",label:"Verdana"},{value:"Georgia",label:"Georgia"},{value:"Palatino",label:"Palatino"},{value:"Garamond",label:"Garamond"},{value:"Bookman",label:"Bookman"},{value:"Comic Sans MS",label:"Comic Sans MS"},{value:"Trebuchet MS",label:"Trebuchet MS"},{value:"Arial Black",label:"Arial Black"},{value:"Impact",label:"Impact"}]},l}();export{n as Popup,r as PreviewType};
@@ -0,0 +1 @@
1
+ import{makeObservable as o,observable as r}from"mobx";var t,l,e=function(t){this.bgColor=t.bgColor||"#FFFFFF",this.overlay=t.overlay?new i(t.overlay):new i({bgColor:"#364152",bgOpacity:40}),this.shadow=t.shadow?new a(t.shadow):null,this.border=t.border?new d(t.border):null,this.allowScrollingWhenPopupOpen=t.allowScrollingWhenPopupOpen||!1,o(this,{bgColor:r,overlay:r,shadow:r,border:r,allowScrollingWhenPopupOpen:r})},i=function(t){this.bgColor=t.bgColor||"",this.bgOpacity=t.bgOpacity||0,o(this,{bgOpacity:r,bgColor:r})},a=function(t){this.color=t.color||"",this.bgOpacity=t.bgOpacity||0,o(this,{bgOpacity:r,color:r})};(l=t||(t={})).SOLID="solid",l.DASHED="dashed",l.DOTTED="dotted";var d=function(l){this.borderColor=l.borderColor||"",this.borderWidth=l.borderWidth||0,this.borderStyle=l.borderStyle||t.SOLID,o(this,{borderColor:r,borderWidth:r,borderStyle:r})};export{e as BackgroundSettings,d as Border,t as ButtonBorderStyle,i as Overlay,a as Shadow};
@@ -0,0 +1 @@
1
+ import{makeObservable as o,observable as t}from"mobx";var n,s,i;(i=n||(n={})).ALWAYS_VISIBLE="ALWAYS_VISIBLE",i.ALWAYS_HIDDEN="ALWAYS_HIDDEN",i.VISIBLE_ON_HOVER="VISIBLE_ON_HOVER",function(o){o.SHOW_ON_CONTENT="SHOW_ON_CONTENT",o.TAKE_SPACE="TAKE_SPACE"}(s||(s={}));var e,T=function(i){this.closeButtonPositionType=i.closeButtonPositionType||s.SHOW_ON_CONTENT,this.closeButtonDisplayType=i.closeButtonDisplayType||n.ALWAYS_VISIBLE,this.iconSettings=i.iconSettings?new E(i.iconSettings):new E({}),o(this,{closeButtonPositionType:t,closeButtonDisplayType:t,iconSettings:t})};!function(o){o.WITH_BORDER="WITH_BORDER",o.WITHOUT_BORDER="WITHOUT_BORDER"}(e||(e={}));var E=function(n){this.type=n.type||e.WITHOUT_BORDER,this.color=n.color||"#697586",this.backgroundColor=n.backgroundColor||"#FFFFFF",o(this,{type:t,color:t,backgroundColor:t})};export{n as CloseButtonDisplayTypeEnum,s as CloseButtonPositionTypeEnum,E as CloseIconSettings,e as CloseIconTypeEnum,T as CloseSettings};
@@ -0,0 +1 @@
1
+ import{makeObservable as t,observable as i,computed as e,action as s}from"mobx";import{PopupStep as P}from"./step/index.js";import{Teaser as n}from"./teaser/index.js";import{WindowSettings as o}from"./window-settings/index.js";import{Border as O,BackgroundSettings as T}from"./background-settings/index.js";import{CloseSettings as r}from"./close-settings/index.js";import{Popup as a}from"../index.js";var _,I,d;(d=_||(_={})).POPUP="POPUP",d.NOTIFICATION_BAR="NOTIFICATION_BAR",d.DRAWER="DRAWER",function(t){t.POPUP_TOP_LEFT="POPUP_TOP_LEFT",t.POPUP_TOP_CENTER="POPUP_TOP_CENTER",t.POPUP_TOP_RIGHT="POPUP_TOP_RIGHT",t.POPUP_MIDDLE_LEFT="POPUP_MIDDLE_LEFT",t.POPUP_MIDDLE_CENTER="POPUP_MIDDLE_CENTER",t.POPUP_MIDDLE_RIGHT="POPUP_MIDDLE_RIGHT",t.POPUP_BOTTOM_LEFT="POPUP_BOTTOM_LEFT",t.POPUP_BOTTOM_CENTER="POPUP_BOTTOM_CENTER",t.POPUP_BOTTOM_RIGHT="POPUP_BOTTOM_RIGHT",t.NOTIFICATION_BAR_UP="NOTIFICATION_BAR_UP",t.NOTIFICATION_BAR_DOWN="NOTIFICATION_BAR_DOWN",t.DRAWER_RIGHT="DRAWER_RIGHT",t.DRAWER_LEFT="DRAWER_LEFT"}(I||(I={}));var R=function(){function d(O){this.type=O.type||_.POPUP,this.teaser=O.teaser?new n(O.teaser):new n({backgroundSettings:new T({allowScrollingWhenPopupOpen:!0})}),this.windowSettings=O.windowSettings?new o(O.windowSettings):new o({borderRadius:4,outerVerticalPadding:12,outerHorizontalPadding:12}),this.backgroundSettings=new T(O.backgroundSettings||{}),this.closeSettings=new r(O.closeSettings||{}),this.steps=O.steps&&O.steps.length?O.steps.map((function(t){return new P(t)})):[new P({stepNumber:1,name:a.t("popup:initialClassTranslations.welcome"),isThankYouStep:!1})],this.isVisible=!1,this.selectedStep=this.steps[0],this.position=O.position?O.position:I.POPUP_MIDDLE_CENTER,t(this,{isVisible:i,type:i,position:i,teaser:i,windowSettings:i,backgroundSettings:i,closeSettings:i,steps:i,selectedStep:i,availablePositions:e,setInitialSettings:s.bound,setInitialPosition:s.bound,setInitialWindowSettings:s.bound})}return d.prototype.setInitialSettings=function(t){void 0===t&&(t=!1),this.setInitialPosition(t),this.setInitialWindowSettings(t)},d.prototype.setInitialPosition=function(t){switch(this.type){case _.POPUP:this.position=t?I.POPUP_BOTTOM_RIGHT:I.POPUP_MIDDLE_CENTER;break;case _.NOTIFICATION_BAR:this.position=I.NOTIFICATION_BAR_UP;break;case _.DRAWER:this.position=I.DRAWER_RIGHT}},d.prototype.setInitialWindowSettings=function(t){switch(this.type){case _.POPUP:this.windowSettings=new o({borderRadius:4,outerVerticalPadding:12,outerHorizontalPadding:12}),t&&(this.backgroundSettings.allowScrollingWhenPopupOpen=!0,this.backgroundSettings.overlay=null,this.backgroundSettings.border=new O({borderWidth:1,borderColor:"#E3E8EF"}));break;case _.NOTIFICATION_BAR:this.windowSettings=new o({outerHorizontalPadding:0,outerVerticalPadding:0,borderRadius:4,takeFullWidth:!0});break;case _.DRAWER:this.windowSettings=new o({borderRadius:4,outerHorizontalPadding:0,outerVerticalPadding:0,takeFullHeight:!0})}},Object.defineProperty(d.prototype,"availablePositions",{get:function(){var t;return(t={})[_.POPUP]=[I.POPUP_TOP_LEFT,I.POPUP_TOP_CENTER,I.POPUP_TOP_RIGHT,I.POPUP_MIDDLE_LEFT,I.POPUP_MIDDLE_CENTER,I.POPUP_MIDDLE_RIGHT,I.POPUP_BOTTOM_LEFT,I.POPUP_BOTTOM_CENTER,I.POPUP_BOTTOM_RIGHT],t[_.NOTIFICATION_BAR]=[I.NOTIFICATION_BAR_UP,I.NOTIFICATION_BAR_DOWN],t[_.DRAWER]=[I.DRAWER_RIGHT,I.DRAWER_LEFT],t},enumerable:!1,configurable:!0}),d}();export{R as Modal,I as PopupPositonEnum,_ as PopupTypeEnum};
@@ -0,0 +1 @@
1
+ import{makeObservable as i,observable as t}from"mobx";var n,a,o,l;(l=n||(n={})).LEFT="LEFT",l.CENTER="CENTER",l.RIGHT="RIGHT",function(i){i.TOP="TOP",i.MIDDLE="MIDDLE",i.BOTTOM="BOTTOM"}(a||(a={})),function(i){i.TEXT="TEXT",i.FORM="FORM",i.IMAGE="IMAGE",i.IMAGE_COLUMN="IMAGE_COLUMN",i.PRODUCT_LIST="PRODUCT_LIST",i.BUTTON="BUTTON",i.SOCIAL_MEDIA="SOCIAL_MEDIA",i.DIVIDER="DIVIDER",i.SPACE="SPACE"}(o||(o={}));var r=function(n){void 0===n&&(n={}),this.name=n.name||"Poppins",this.variants=n.variants||["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"],i(this,{name:t,variants:t})},e=function(o){var l,r,e,d,E;void 0===o&&(o={}),this.id=o.id||Date.now().toString(),this.order=o.order||0,this.width=null!==(l=o.width)&&void 0!==l?l:"100",this.verticalPadding=null!==(r=o.verticalPadding)&&void 0!==r?r:24,this.horizontalPadding=null!==(e=o.horizontalPadding)&&void 0!==e?e:24,this.outerVerticalPadding=null!==(d=o.outerVerticalPadding)&&void 0!==d?d:0,this.outerHorizontalPadding=null!==(E=o.outerHorizontalPadding)&&void 0!==E?E:0,this.horizontalAlignment=o.horizontalAlignment||n.CENTER,this.verticalAlignment=o.verticalAlignment||a.TOP,i(this,{id:t,order:t,width:t,verticalPadding:t,horizontalPadding:t,outerVerticalPadding:t,outerHorizontalPadding:t,horizontalAlignment:t,verticalAlignment:t})};export{e as BaseElement,n as ComponentHorizontalAlignmentEnum,a as ComponentVerticalAlignmentEnum,r as IkasPopupRendererFontFamily,o as PopupElementTypeEnum};
@@ -0,0 +1 @@
1
+ import{__extends as o}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as r}from"mobx";import{PopupElementTypeEnum as i,IkasPopupRendererFontFamily as n,BaseElement as e}from"../base/index.js";import{ButtonBorderStyle as l}from"../../../background-settings/index.js";import{Popup as d}from"../../../../index.js";var a=function(e){function a(o){var a,u,s,b,m,g,p,f,v=this;return(v=e.call(this,o)||this).text=o.text||d.t("popup:initialClassTranslations.buttonText"),v.type=i.BUTTON,v.color=o.color||"#FFFFFF",v.buttonBgColor=o.buttonBgColor||"",v.bgColor=o.bgColor||"",v.fontFamily=new n(o.fontFamily),v.fontSize=null!==(a=o.fontSize)&&void 0!==a?a:16,v.fontWeight=null!==(u=o.fontWeight)&&void 0!==u?u:400,v.borderRadius=null!==(s=o.borderRadius)&&void 0!==s?s:4,v.borderColor=o.borderColor||"",v.borderStyle=o.borderStyle||l.SOLID,v.borderWidth=null!==(b=o.borderWidth)&&void 0!==b?b:0,v.link=o.link||null,v.verticalPadding=null!==(m=o.verticalPadding)&&void 0!==m?m:12,v.horizontalPadding=null!==(g=o.horizontalPadding)&&void 0!==g?g:12,v.outerVerticalPadding=null!==(p=o.outerVerticalPadding)&&void 0!==p?p:12,v.outerHorizontalPadding=null!==(f=o.outerHorizontalPadding)&&void 0!==f?f:12,t(v,{text:r,color:r,buttonBgColor:r,bgColor:r,fontFamily:r,fontSize:r,fontWeight:r,borderRadius:r,borderColor:r,borderStyle:r,borderWidth:r,link:r}),v}return o(a,e),a}(e);export{a as ButtonElement};
@@ -0,0 +1 @@
1
+ import{__extends as r}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as o,observable as e}from"mobx";import{PopupElementTypeEnum as d,BaseElement as i}from"../base/index.js";import{ButtonBorderStyle as t}from"../../../background-settings/index.js";var l=function(i){function l(r){void 0===r&&(r={});var l,n,s,a,b=this;return(b=i.call(this,r)||this).type=d.DIVIDER,b.bgColor=r.bgColor||"",b.borderWidth=null!==(l=r.borderWidth)&&void 0!==l?l:1,b.borderRadius=null!==(n=r.borderRadius)&&void 0!==n?n:0,b.borderColor=r.borderColor||"",b.borderStyle=r.borderStyle||t.SOLID,b.verticalPadding=null!==(s=r.verticalPadding)&&void 0!==s?s:24,b.horizontalPadding=null!==(a=r.horizontalPadding)&&void 0!==a?a:24,o(b,{bgColor:e,borderWidth:e,borderRadius:e,borderColor:e,borderStyle:e}),b}return r(l,i),l}(i);export{l as DividerElement};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as t}from"mobx";import{FormItemTypeEnum as s}from"../index.js";import{Popup as i}from"../../../../../index.js";var o,n,r=function(o){void 0===o&&(o={}),this.type=s.CHECKBOX_FORM_ITEM,this.isChecked=o.isChecked||!1,this.text=o.text||i.t("popup:initialClassTranslations.agreeTermsAndConditions"),this.contactPermission=o.contactPermission?new c(o.contactPermission):null,this.showInCheckedStatus=o.showInCheckedStatus||!1,this.requiredToBeChecked=o.requiredToBeChecked||null,e(this,{type:t,text:t,isChecked:t,contactPermission:t,showInCheckedStatus:t,requiredToBeChecked:t})};(n=o||(o={})).SMS="SMS",n.EMAIL="EMAIL",n.GENERAL="GENERAL";var c=function(s){void 0===s&&(s={}),this.type=s.type||o.GENERAL,e(this,{type:t})};export{r as CheckboxFormItem,c as ContactPermission,o as ContactPermissionTypeEnum};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as t}from"mobx";import{FormItemTypeEnum as r,InputPlaceholder as u,InputLabel as i,RequiredInput as n}from"../index.js";var o,I;(I=o||(o={})).BOOLEAN="BOOLEAN",I.CHOICE="CHOICE",I.DATETIME="DATETIME",I.MULTIPLE_CHOICE="MULTIPLE_CHOICE",I.NUMERIC="NUMERIC",I.TEXT="TEXT";var a=function(o){void 0===o&&(o={}),this.type=r.CUSTOMER_ATTRIBUTE,this.placeholder=o.placeholder?new u(o.placeholder):null,this.inputLabel=o.inputLabel?new i(o.inputLabel):null,this.required=o.required?new n(o.required):null,this.updateCurrentInfo=o.updateCurrentInfo||!1,this.customerAttributeId=o.customerAttributeId||"",e(this,{type:t,placeholder:t,inputLabel:t,required:t,updateCurrentInfo:t,customerAttributeId:t})};export{a as CustomerAttributeFormItem,o as CustomerAttributeTypeEnum};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as r}from"mobx";import{FormItemTypeEnum as t,InputPlaceholder as u,InputLabel as l,RequiredInput as n}from"../index.js";var a=function(a){void 0===a&&(a={}),this.type=t.CUSTOMER_BIRTHDAY,this.value=a.value||null,this.placeholder=a.placeholder?new u(a.placeholder):null,this.inputLabel=a.inputLabel?new l(a.inputLabel):null,this.required=a.required?new n(a.required):null,this.updateCurrentInfo=a.updateCurrentInfo||!1,e(this,{value:r,type:r,placeholder:r,inputLabel:r,required:r,updateCurrentInfo:r})};export{a as CustomerBirthdayFormItem};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as r}from"mobx";import{FormItemTypeEnum as t,InputPlaceholder as u,InputLabel as l,RequiredInput as n}from"../index.js";var a=function(a){void 0===a&&(a={}),this.type=t.CUSTOMER_EMAIL,this.value=a.value||null,this.placeholder=a.placeholder?new u(a.placeholder):null,this.inputLabel=a.inputLabel?new l(a.inputLabel):null,this.required=a.required?new n(a.required):new n,this.updateCurrentInfo=a.updateCurrentInfo||!1,e(this,{value:r,type:r,placeholder:r,inputLabel:r,required:r,updateCurrentInfo:r})};export{a as CustomerEmailFormItem};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as t}from"mobx";import{FormItemTypeEnum as r,InputPlaceholder as n,InputLabel as l,RequiredInput as i}from"../index.js";var u,s,d=function(u){void 0===u&&(u={}),this.type=r.CUSTOMER_GENDER,this.placeholder=u.placeholder?new n(u.placeholder):null,this.inputLabel=u.inputLabel?new l(u.inputLabel):null,this.required=u.required?new i(u.required):null,this.updateCurrentInfo=u.updateCurrentInfo||!1,this.genders=u.genders?u.genders.map((function(e){return new p(e)})):[],e(this,{type:t,placeholder:t,inputLabel:t,required:t,updateCurrentInfo:t,genders:t})},p=function(r){void 0===r&&(r={}),this.type=r.type||u.FEMALE,this.label=r.label||null,this.isSelected=r.isSelected||!1,e(this,{type:t,label:t,isSelected:t})};(s=u||(u={})).FEMALE="FEMALE",s.MALE="MALE",s.OTHER="OTHER";export{d as CustomerGenderFormItem,u as CustomerGenderTypeEnum,p as GenderType};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as r}from"mobx";import{FormItemTypeEnum as t,InputPlaceholder as u,InputLabel as l,RequiredInput as n}from"../index.js";var a=function(a){void 0===a&&(a={}),this.type=t.CUSTOMER_NAME,this.value=a.value||null,this.placeholder=a.placeholder?new u(a.placeholder):null,this.inputLabel=a.inputLabel?new l(a.inputLabel):null,this.required=a.required?new n(a.required):null,this.updateCurrentInfo=a.updateCurrentInfo||!1,e(this,{value:r,type:r,placeholder:r,inputLabel:r,required:r,updateCurrentInfo:r})};export{a as CustomerNameFormItem};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as t}from"mobx";import{FormItemTypeEnum as r,InputPlaceholder as u,InputLabel as n,RequiredInput as l}from"../index.js";var o=function(o){void 0===o&&(o={}),this.type=r.CUSTOMER_PHONE,this.value=o.value||null,this.placeholder=o.placeholder?new u(o.placeholder):null,this.inputLabel=o.inputLabel?new n(o.inputLabel):null,this.required=o.required?new l(o.required):null,this.addCountryCode=o.addCountryCode||!1,this.updateCurrentInfo=o.updateCurrentInfo||!1,e(this,{value:t,type:t,placeholder:t,inputLabel:t,required:t,addCountryCode:t,updateCurrentInfo:t})};export{o as CustomerPhoneFormItem};
@@ -0,0 +1 @@
1
+ import{makeObservable as e,observable as r}from"mobx";import{FormItemTypeEnum as t,InputPlaceholder as u,InputLabel as l,RequiredInput as n}from"../index.js";var a=function(a){void 0===a&&(a={}),this.type=t.CUSTOMER_SURNAME,this.value=a.value||null,this.placeholder=a.placeholder?new u(a.placeholder):null,this.inputLabel=a.inputLabel?new l(a.inputLabel):null,this.required=a.required?new n(a.required):null,this.updateCurrentInfo=a.updateCurrentInfo||!1,e(this,{value:r,type:r,placeholder:r,inputLabel:r,required:r,updateCurrentInfo:r})};export{a as CustomerSurnameFormItem};
@@ -0,0 +1 @@
1
+ import{makeObservable as o,observable as r}from"mobx";import{IkasPopupRendererFontFamily as t}from"../../base/index.js";var e=function(e){var n,s;void 0===e&&(e={}),this.formInputSettings=e.formInputSettings?new i(e.formInputSettings):new i({borderColor:"#E3E8EF",focusBorderColor:"#000000"}),this.gapBetweenItems=null!==(n=e.gapBetweenItems)&&void 0!==n?n:12,this.fontFamily=new t(e.fontFamily),this.fontSize=null!==(s=e.fontSize)&&void 0!==s?s:14,o(this,{formInputSettings:r,gapBetweenItems:r,fontFamily:r,fontSize:r})},i=function(t){var e,i,n;void 0===t&&(t={}),this.bgColor=t.bgColor||"",this.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:1,this.borderRadius=null!==(i=t.borderRadius)&&void 0!==i?i:4,this.borderColor=t.borderColor||"",this.focusBorderColor=t.focusBorderColor||"",this.height=null!==(n=t.height)&&void 0!==n?n:40,o(this,{bgColor:r,borderWidth:r,borderRadius:r,borderColor:r,focusBorderColor:r,height:r})};export{i as FormInputSettings,e as FormSettings};
@@ -0,0 +1 @@
1
+ import{__extends as t,__assign as e}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as o,observable as r,action as n}from"mobx";import{PopupElementTypeEnum as s,BaseElement as i}from"../base/index.js";import{ButtonElement as a}from"../button/index.js";import{FormSettings as m}from"./form-settings/index.js";import{CustomerNameFormItem as u}from"./customer-name/index.js";import{CustomerSurnameFormItem as l}from"./customer-surname/index.js";import{CustomerEmailFormItem as d}from"./customer-email/index.js";import{CustomerPhoneFormItem as p}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as E}from"./customer-birthday/index.js";import{CustomerGenderFormItem as c}from"./customer-gender/index.js";import{CheckboxFormItem as C}from"./checkbox/index.js";import{CustomerAttributeFormItem as h}from"./customer-attribute/index.js";import{Popup as T}from"../../../../index.js";var M,R;(R=M||(M={})).CUSTOMER_NAME="CUSTOMER_NAME",R.CUSTOMER_SURNAME="CUSTOMER_SURNAME",R.CUSTOMER_EMAIL="CUSTOMER_EMAIL",R.CUSTOMER_PHONE="CUSTOMER_PHONE",R.CUSTOMER_BIRTHDAY="CUSTOMER_BIRTHDAY",R.CUSTOMER_GENDER="CUSTOMER_GENDER",R.CHECKBOX_FORM_ITEM="CHECKBOX_FORM_ITEM",R.CUSTOMER_ATTRIBUTE="CUSTOMER_ATTRIBUTE";var f=function(e){function i(t,i){void 0===t&&(t={});var u,l,d=this;return(d=e.call(this,t)||this).type=s.FORM,d.rows=t.rows?t.rows.map((function(t){return new S(t)})):[],d.formSettings=t.formSettings||new m,d.buttonSettings=t.buttonSettings||new a({outerHorizontalPadding:0,outerVerticalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),d.bgColor=t.bgColor||"",d.verticalPadding=null!==(u=t.verticalPadding)&&void 0!==u?u:12,d.horizontalPadding=null!==(l=t.horizontalPadding)&&void 0!==l?l:12,o(d,{rows:r,formSettings:r,buttonSettings:r,bgColor:r,addNewElement:n.bound}),0===d.rows.length&&1===i&&d.addNewElement(M.CUSTOMER_EMAIL),d}return t(i,e),i.prototype.addNewElement=function(t){var e=new S({order:this.rows.length,columns:[new w({type:t,order:0})]});this.rows.push(e)},i}(i),S=function(){function t(t){var e;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(e=t.order)&&void 0!==e?e:0,this.columns=t.columns?t.columns.map((function(t){return new w(t)})):[],o(this,{id:r,order:r,columns:r,addNewElement:n.bound,changeColumnSort:n.bound})}return t.prototype.addNewElement=function(t){this.columns.push(new w({type:t,order:this.columns.length}))},t.prototype.changeColumnSort=function(){this.columns.forEach((function(t,e){0===e?t.order=t.order+1:1===e&&(t.order=t.order-1)})),this.columns=this.columns.sort((function(t,e){return t.order-e.order}))},t}(),w=function(){function t(t){var e;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(e=t.order)&&void 0!==e?e:0,this.type=t.type||M.CUSTOMER_NAME,this.formItem=this.setFormItems(t.formItem),o(this,{id:r,order:r,type:r,formItem:r,setFormItems:n.bound})}return t.prototype.setFormItems=function(t){switch(this.type){case M.CUSTOMER_NAME:return new u(t?e({},t):{inputLabel:new O({text:T.t("popup:initialClassTranslations.firstName")})});case M.CUSTOMER_SURNAME:return new l(t?e({},t):{inputLabel:new O({text:T.t("popup:initialClassTranslations.lastName")})});case M.CUSTOMER_EMAIL:return new d(t?e({},t):{inputLabel:new O({text:T.t("popup:initialClassTranslations.email")})});case M.CUSTOMER_PHONE:return new p(t?e({},t):{inputLabel:new O({text:T.t("popup:initialClassTranslations.phone")})});case M.CUSTOMER_BIRTHDAY:return new E(t?e({},t):{inputLabel:new O({text:T.t("popup:initialClassTranslations.birthday")})});case M.CUSTOMER_GENDER:return new c(t?e({},t):{inputLabel:new O({text:T.t("popup:initialClassTranslations.gender")})});case M.CHECKBOX_FORM_ITEM:return new C(e({},t));case M.CUSTOMER_ATTRIBUTE:return new h(e({},t))}},t}(),O=function(t){void 0===t&&(t={}),this.text=t.text||T.t("popup:initialClassTranslations.inputLabel"),o(this,{text:r})},_=function(t){void 0===t&&(t={}),this.validationErrorMessage=t.validationErrorMessage||T.t("popup:initialClassTranslations.requiredFieldErrorMessage"),this.hasError=t.hasError||!1,o(this,{validationErrorMessage:r,hasError:r})},g=function(t){void 0===t&&(t={}),this.text=t.text||T.t("popup:initialClassTranslations.placeholder"),o(this,{text:r})};export{w as FormColumn,f as FormElement,M as FormItemTypeEnum,S as FormRow,O as InputLabel,g as InputPlaceholder,_ as RequiredInput};
@@ -0,0 +1 @@
1
+ import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as e,computed as n}from"mobx";import{PopupElementTypeEnum as a,BaseElement as o}from"../base/index.js";var r,d,l,m=1080;(l=r||(r={})).FLOAT_LEFT="FLOAT_LEFT",l.FLOAT_RIGHT="FLOAT_RIGHT",l.DISABLE_FLOAT="DISABLE_FLOAT",function(i){i.CONTAIN="CONTAIN",i.COVER="COVER"}(d||(d={}));var s=function(o){function l(i){var l,m,s,c,u=this;return(u=o.call(this,i)||this).type=a.IMAGE,u.imagePosition=i.imagePosition||r.DISABLE_FLOAT,u.imageId=i.imageId||null,u.bgColor=i.bgColor||"",u.cdnURL=null,u.merchantId=null,u.objectFit=i.objectFit||d.CONTAIN,u.link=i.link||null,u.maxWidth=null!==(l=i.maxWidth)&&void 0!==l?l:100,u.verticalPadding=null!==(m=i.verticalPadding)&&void 0!==m?m:24,u.horizontalPadding=null!==(s=i.horizontalPadding)&&void 0!==s?s:24,u.borderRadius=null!==(c=i.borderRadius)&&void 0!==c?c:0,t(u,{imagePosition:e,imageId:e,bgColor:e,cdnURL:e,merchantId:e,objectFit:e,link:e,maxWidth:e,borderRadius:e,src:n}),u}return i(l,o),Object.defineProperty(l.prototype,"src",{get:function(){if(this.imageId)return this.imageId.includes("/")?"".concat(this.cdnURL,"images/").concat(this.merchantId,"/").concat(this.imageId,"/image_").concat(1080,".jpeg"):void 0},enumerable:!1,configurable:!0}),l}(o);export{m as IMAGE_SIZE,s as ImageElement,d as ImageFitEnum,r as ImagePositionEnum};
@@ -0,0 +1 @@
1
+ import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as o,observable as e,computed as n}from"mobx";import{PopupElementTypeEnum as t,BaseElement as a}from"../base/index.js";import{IMAGE_SIZE as m,ImageFitEnum as l}from"../image/index.js";var r,s,d;(d=r||(r={})).LEFT_ALIGN="LEFT_ALIGN",d.RIGTH_ALIGN="RIGTH_ALIGN",function(i){i.TOP="TOP",i.BOTTOM="BOTTOM",i.HIDE="HIDE"}(s||(s={}));var c=function(a){function d(i){var m,d,c,u=this;return(u=a.call(this,i)||this).type=t.IMAGE_COLUMN,u.imagePosition=i.imagePosition||r.RIGTH_ALIGN,u.mobilePosition=i.mobilePosition||s.HIDE,u.imageId=i.imageId||null,u.bgColor=i.bgColor||"",u.cdnURL=null,u.merchantId=null,u.objectFit=i.objectFit||l.COVER,u.link=i.link||null,u.verticalPadding=null!==(m=i.verticalPadding)&&void 0!==m?m:0,u.horizontalPadding=null!==(d=i.horizontalPadding)&&void 0!==d?d:0,u.borderRadius=null!==(c=i.borderRadius)&&void 0!==c?c:0,o(u,{imagePosition:e,mobilePosition:e,imageId:e,bgColor:e,cdnURL:e,merchantId:e,objectFit:e,link:e,borderRadius:e,src:n}),u}return i(d,a),Object.defineProperty(d.prototype,"src",{get:function(){if(this.imageId)return this.imageId.includes("/")?"".concat(this.cdnURL,"images/").concat(this.merchantId,"/").concat(this.imageId,"/image_").concat(m,".jpeg"):void 0},enumerable:!1,configurable:!0}),d}(a);export{c as ImageColumnElement,r as ImageColumnPositionEnum,s as MobileImageColumnPositionEnum};
@@ -0,0 +1 @@
1
+ import{makeObservable as i,observable as t}from"mobx";import{TextElement as n}from"../../text/index.js";import"../../base/index.js";import{Popup as o}from"../../../../../index.js";var a,e,r=function(o){void 0===o&&(o={}),this.image=o.image?new d(o.image):new d({}),this.name=o.name?new n(o.name):new n({horizontalPadding:0,verticalPadding:6}),this.discountRatio=o.discountRatio?new n(o.discountRatio):new n({horizontalPadding:0,verticalPadding:8}),this.originalPrice=o.originalPrice?new n(o.originalPrice):new n({horizontalPadding:0,verticalPadding:2,fontSize:14,color:"#697586"}),this.finalPrice=o.finalPrice?new n(o.finalPrice):new n({horizontalPadding:0,verticalPadding:2}),this.button=o.button?new s(o.button):new s({}),i(this,{image:t,name:t,discountRatio:t,originalPrice:t,finalPrice:t,button:t})},d=function(n){var o,a;this.bgColor=n.bgColor||"",this.maxWidth=null!==(o=n.maxWidth)&&void 0!==o?o:100,this.borderRadius=null!==(a=n.borderRadius)&&void 0!==a?a:0,i(this,{bgColor:t,maxWidth:t,borderRadius:t})};(e=a||(a={})).ADD_TO_CART="ADD_TO_CART",e.NAVIGATE_TO_PRODUCT_DETAIL="NAVIGATE_TO_PRODUCT_DETAIL";var s=function(n){void 0===n&&(n={}),this.text=n.text||o.t("popup:initialClassTranslations.productButtonText"),this.action=n.action||a.ADD_TO_CART,i(this,{text:t,action:t})};export{a as ProductActionTypeEnum,s as ProductButtonSettings,r as ProductDetailSettings,d as ProductImageSettings};
@@ -0,0 +1 @@
1
+ import{__extends as t}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as o,observable as i}from"mobx";import{PopupElementTypeEnum as e,BaseElement as n}from"../base/index.js";import{ProductDetailSettings as r}from"./detail-settings/index.js";import{ButtonElement as a}from"../button/index.js";var u,s,E,C;(C=u||(u={})).ASC_AVERAGE_RATING="ASC_AVERAGE_RATING",C.DESC_AVERAGE_RATING="DESC_AVERAGE_RATING",C.ASC_CREATED_AT="ASC_CREATED_AT",C.DESC_CREATED_AT="DESC_CREATED_AT",C.ASC_DISCOUNT_RATIO="ASC_DISCOUNT_RATIO",C.DESC_DISCOUNT_RATIO="DESC_DISCOUNT_RATIO",C.ASC_NAME="ASC_NAME",C.DESC_NAME="DESC_NAME",C.ASC_PRICE="ASC_PRICE",C.DESC_PRICE="DESC_PRICE",C.ASC_REVIEW_COUNT="ASC_REVIEW_COUNT",C.DESC_REVIEW_COUNT="DESC_REVIEW_COUNT",C.ASC_SALE_COUNT="ASC_SALE_COUNT",C.DESC_SALE_COUNT="DESC_SALE_COUNT",function(t){t.ALL="ALL",t.SPECIFIC="SPECIFIC",t.CATEGORY="CATEGORY",t.LAST_VIEWED="LAST_VIEWED"}(s||(s={})),function(t){t.ONE_COLUMN="ONE_COLUMN",t.TWO_COLUMN="TWO_COLUMN",t.THREE_COLUMN="THREE_COLUMN"}(E||(E={}));var d=10,l=function(n){function C(t){void 0===t&&(t={});var C,d,l,_,c,A,S,T,p=this;return(p=n.call(this,t)||this).type=e.PRODUCT_LIST,p.listType=t.listType||s.ALL,p.sortType=t.sortType||u.ASC_CREATED_AT,p.maxProductsToShow=null!==(C=t.maxProductsToShow)&&void 0!==C?C:10,p.categoryId=null!==(d=t.categoryId)&&void 0!==d?d:null,p.variantPairs=null!==(l=t.variantPairs)&&void 0!==l?l:null,p.layout=null!==(_=t.layout)&&void 0!==_?_:E.TWO_COLUMN,p.productDetailSettings=t.productDetailSettings?new r(t.productDetailSettings):new r,p.buttonSettings=t.buttonSettings?new a(t.buttonSettings):new a({outerHorizontalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),p.productBgColor=t.productBgColor||"",p.gapBetweenProductElements=null!==(c=t.gapBetweenProductElements)&&void 0!==c?c:12,p.gapBetweenProducts=null!==(A=t.gapBetweenProducts)&&void 0!==A?A:12,p.verticalPadding=null!==(S=t.verticalPadding)&&void 0!==S?S:12,p.horizontalPadding=null!==(T=t.horizontalPadding)&&void 0!==T?T:12,o(p,{type:i,listType:i,sortType:i,maxProductsToShow:i,categoryId:i,variantPairs:i,layout:i,productDetailSettings:i,buttonSettings:i,productBgColor:i,gapBetweenProductElements:i,gapBetweenProducts:i}),p}return t(C,n),C}(n),_=function(){function t(t){void 0===t&&(t={}),this.productId=t.productId||Date.now().toString(),this.variantId=t.variantId||Date.now().toString(),this.name=t.name||"",this.price=t.price||"",this.discountPrice=t.discountPrice||null,this.discountRatio=t.discountRatio||null,this.imageURL=t.imageURL?"".concat(t.imageURL,"/image_").concat(1080,".jpeg"):null,this.url=t.url||null,o(this,{productId:i,variantId:i,name:i,price:i,discountPrice:i,discountRatio:i,imageURL:i,url:i})}return Object.defineProperty(t.prototype,"$discountRatio",{get:function(){return this.discountRatio?"%"+this.discountRatio:null},enumerable:!1,configurable:!0}),t}();export{d as MAX_PRODUCT_COUNT,_ as PopupProduct,l as ProductListElement,E as ProductListLayoutEnum,u as ProductListSortTypeEnum,s as ProductListTypeEnum};
@@ -0,0 +1 @@
1
+ import{__extends as o}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as i,observable as n,action as t,computed as e}from"mobx";import{PopupElementTypeEnum as a,BaseElement as c}from"../base/index.js";var r,l=function(e){function c(o){void 0===o&&(o={});var c,l,s,u,p,g=this;return(g=e.call(this,o)||this).type=a.SOCIAL_MEDIA,g.logoColor=o.logoColor||"#000000",g.borderRadius=null!==(c=o.borderRadius)&&void 0!==c?c:0,g.bgColor=o.bgColor||"",g.gapBetweenLogos=null!==(l=o.gapBetweenLogos)&&void 0!==l?l:8,g.verticalPadding=null!==(s=o.verticalPadding)&&void 0!==s?s:24,g.horizontalPadding=null!==(u=o.horizontalPadding)&&void 0!==u?u:24,g.socialMediaLinks=(null===(p=o.socialMediaLinks)||void 0===p?void 0:p.length)?o.socialMediaLinks.map((function(o){return new d(o)})):[new d({type:r.FACEBOOK,order:0,icon:"https://cdn.myikas.dev/social/facebook/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new d({type:r.TWITTER,order:1,icon:"https://cdn.myikas.dev/social/x/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new d({type:r.INSTAGRAM,order:2,icon:"https://cdn.myikas.dev/social/instagram/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new d({type:r.YOUTUBE,order:3,icon:"https://cdn.myikas.dev/social/youtube/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new d({type:r.TIKTOK,order:4,icon:"https://cdn.myikas.dev/social/tiktok/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new d({type:r.LINKEDIN,order:4,icon:"https://cdn.myikas.dev/social/linkedin/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)})],i(g,{logoColor:n,borderRadius:n,bgColor:n,socialMediaLinks:n,gapBetweenLogos:n,updateIconLinks:t.bound}),g}return o(c,e),c.prototype.updateIconLinks=function(){var o=this;this.socialMediaLinks.forEach((function(i){i.icon="https://cdn.myikas.dev/social/".concat(i.type.toLowerCase(),"/1080/").concat(o.borderRadius,"/").concat(o.bgColor,"/").concat(o.logoColor)}))},c}(c),d=function(){function o(o){var t;void 0===o&&(o={}),this.id=o.id||Date.now().toString(),this.icon=o.icon||null,this.link=o.link||null,this.order=null!==(t=o.order)&&void 0!==t?t:0,this.type=o.type||r.FACEBOOK,i(this,{icon:n,link:n,order:n,type:n,iconUrlWithoutHash:e})}return Object.defineProperty(o.prototype,"iconUrlWithoutHash",{get:function(){var o;return null===(o=this.icon)||void 0===o?void 0:o.replace(/#/g,"")},enumerable:!1,configurable:!0}),o}();!function(o){o.FACEBOOK="FACEBOOK",o.TWITTER="TWITTER",o.INSTAGRAM="INSTAGRAM",o.YOUTUBE="YOUTUBE",o.TIKTOK="TIKTOK",o.LINKEDIN="LINKEDIN"}(r||(r={}));export{l as SocialMediaElement,d as SocialMediaLink,r as SocialMediaTypeEnum};
@@ -0,0 +1 @@
1
+ import{__extends as t}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as i,observable as e}from"mobx";import{PopupElementTypeEnum as o,BaseElement as n}from"../base/index.js";var l=function(n){function l(t){var l,r,a,s=this;return(s=n.call(this,t)||this).type=o.SPACE,s.bgColor=t.bgColor||"",s.height=null!==(l=t.height)&&void 0!==l?l:24,s.horizontalPadding=null!==(r=t.horizontalPadding)&&void 0!==r?r:0,s.verticalPadding=null!==(a=t.verticalPadding)&&void 0!==a?a:0,i(s,{bgColor:e,height:e}),s}return t(l,n),l}(n);export{l as SpaceElement};
@@ -0,0 +1 @@
1
+ import{__extends as o}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as r}from"mobx";import{PopupElementTypeEnum as i,IkasPopupRendererFontFamily as e,ComponentHorizontalAlignmentEnum as n,BaseElement as l}from"../base/index.js";import{ButtonBorderStyle as d}from"../../../background-settings/index.js";import{Popup as a}from"../../../../index.js";var s=function(l){function s(o){var s,u,m,b,g,p,f,h,v=this;return(v=l.call(this,o)||this).type=i.TEXT,v.text=o.text||a.t("popup:initialClassTranslations.text"),v.color=o.color||"#000000",v.bgColor=o.bgColor||"",v.fontFamily=new e(o.fontFamily),v.fontSize=null!==(s=o.fontSize)&&void 0!==s?s:16,v.fontWeight=null!==(u=o.fontWeight)&&void 0!==u?u:400,v.borderRadius=null!==(m=o.borderRadius)&&void 0!==m?m:4,v.borderColor=o.borderColor||"#000000",v.borderStyle=o.borderStyle||d.SOLID,v.borderWidth=null!==(b=o.borderWidth)&&void 0!==b?b:0,v.verticalPadding=null!==(g=o.verticalPadding)&&void 0!==g?g:12,v.horizontalPadding=null!==(p=o.horizontalPadding)&&void 0!==p?p:12,v.outerHorizontalPadding=null!==(f=o.outerHorizontalPadding)&&void 0!==f?f:0,v.outerVerticalPadding=null!==(h=o.outerVerticalPadding)&&void 0!==h?h:0,v.horizontalAlignment=o.horizontalAlignment||n.LEFT,t(v,{text:r,color:r,bgColor:r,fontFamily:r,fontSize:r,fontWeight:r,borderRadius:r,borderColor:r,borderStyle:r,borderWidth:r}),v}return o(s,l),s}(l);export{s as TextElement};
@@ -0,0 +1 @@
1
+ import{__assign as e}from"../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as s,action as n}from"mobx";import{TextElement as r}from"./elements/text/index.js";import{FormElement as i}from"./elements/form/index.js";import{ImageElement as o}from"./elements/image/index.js";import{ProductListElement as m}from"./elements/product/index.js";import{ButtonElement as a}from"./elements/button/index.js";import{SocialMediaElement as l}from"./elements/social/index.js";import{DividerElement as d}from"./elements/divider/index.js";import{SpaceElement as p}from"./elements/space/index.js";import{PopupElementTypeEnum as u}from"./elements/base/index.js";import{ImageColumnElement as h}from"./elements/image-column/index.js";var w=function(){function w(e){var i=this;this.id=e.id||Date.now().toString(),this.stepNumber=e.stepNumber||0,this.name=e.name||"",this.isThankYouStep=e.isThankYouStep||!1,this.isTeaser=e.isTeaser||!1,this.elements=e.elements&&e.elements.length?e.elements.map((function(e){return i.setContent(e)})):[],this.isTeaser&&(this.id=this.id+"-teaser"),this.isTeaser&&!this.elements.length&&this.elements.push(new r({order:0})),t(this,{stepNumber:s,name:s,isThankYouStep:s,isTeaser:s,elements:s,setContent:n.bound,addNewElement:n.bound})}return w.prototype.setContent=function(e){switch(e.type){case u.TEXT:return new r(e||{});case u.FORM:return new i(e||{},this.stepNumber);case u.IMAGE:return new o(e||{});case u.IMAGE_COLUMN:return new h(e||{});case u.PRODUCT_LIST:return new m(e||{});case u.BUTTON:return new a(e||{});case u.SOCIAL_MEDIA:return new l(e||{});case u.DIVIDER:return new d(e||{});case u.SPACE:return new p(e||{})}},w.prototype.addNewElement=function(t,s){var n=this.elements.length;switch(t){case u.TEXT:this.elements.push(new r(e(e({},s),{order:n,id:Date.now().toString()})));break;case u.FORM:this.elements.push(new i(e(e({},s),{order:n,id:Date.now().toString()}),this.stepNumber));break;case u.IMAGE:this.elements.push(new o(e(e({},s),{order:n,id:Date.now().toString()})));break;case u.IMAGE_COLUMN:this.elements.push(new h(e(e({},s),{order:n,id:Date.now().toString()})));break;case u.PRODUCT_LIST:this.elements.push(new m(e(e({},s),{order:n,id:Date.now().toString()})));break;case u.BUTTON:this.elements.push(new a(e(e({},s),{order:n,buttonBgColor:"#000000",borderColor:"#000000",id:Date.now().toString()})));break;case u.SOCIAL_MEDIA:this.elements.push(new l(e(e({},s),{order:n,id:Date.now().toString()})));break;case u.DIVIDER:this.elements.push(new d(e(e({},s),{order:n,id:Date.now().toString(),borderColor:"#E3E8EF"})));break;case u.SPACE:this.elements.push(new p(e(e({},s),{order:n,id:Date.now().toString()})))}},w}();export{w as PopupStep};