@ikas/storefront 4.15.0-beta.86 → 4.15.0-beta.88

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 (52) hide show
  1. package/build/components/popup/renderer/index.js +1 -1
  2. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -1
  3. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +1 -1
  4. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -1
  5. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/date-item-view/index.js +1 -1
  6. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/gender-item-view/index.js +1 -1
  7. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -1
  8. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -1
  9. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -1
  10. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -1
  11. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -1
  12. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -1
  13. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -1
  14. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/space-element-renderer/index.js +1 -1
  15. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +1 -1
  16. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js +1 -1
  17. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js +1 -1
  18. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js +1 -1
  19. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js +1 -1
  20. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +1 -1
  21. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js +1 -1
  22. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js +1 -1
  23. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-birthday/index.js +1 -1
  24. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-email/index.js +1 -1
  25. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js +1 -1
  26. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-name/index.js +1 -1
  27. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-phone/index.js +1 -1
  28. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-surname/index.js +1 -1
  29. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +1 -1
  30. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +1 -1
  31. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +1 -1
  32. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +1 -1
  33. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +1 -1
  34. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js +1 -1
  35. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js +1 -1
  36. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js +1 -1
  37. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js +1 -1
  38. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/window-settings/index.js +1 -1
  39. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js +1 -1
  40. package/build/ext/mobx-react/dist/mobxreact.esm.js +1 -0
  41. package/build/store/customer/api.js +1 -1
  42. package/build/store/customer/index.js +1 -1
  43. package/package.json +12 -12
  44. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/ObserverComponent.js +0 -1
  45. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/index.js +0 -1
  46. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/observer.js +0 -1
  47. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/useObserver.js +0 -1
  48. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/UniversalFinalizationRegistry.js +0 -1
  49. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/assertEnvironment.js +0 -1
  50. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/observerBatching.js +0 -1
  51. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/observerFinalizationRegistry.js +0 -1
  52. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/printDebugValue.js +0 -1
@@ -1 +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{IkasStorefrontPopupDisplayTriggerTypeEnum as d}from"../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import{exitIntent as s}from"../utils/index.js";import{IkasStorefrontPopupRendererViewModel as n}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 i=p((function(p){var i=p.storefrontPopup,m=r.useState((function(){return new n({},i)}))[0];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,m.init()];case 1:if(o.sent(),!m.isModalClosedByUser){if((e=m.storefrontPopupData.displaySettings.triggerType)===d.SCROLL_DOWN)return window.addEventListener("scroll",m.handleScroll),[2,function(){window.removeEventListener("scroll",m.handleScroll)}];if(e===d.EXIT_INTENT)return r=s({onExitIntent:function(){m.openModal()}}),[2,function(){r()}]}return[2]}}))}))}),[]),console.log("IkasStorefrontPopupRenderer",m.storefrontPopupData),m.storefrontPopupData&&m.storefrontPopupData.contentJson&&!m.isLoading?r.createElement(t,{key:m.storefrontPopupData.id,popup:m.storefrontPopupData.contentJson,dynamicData:{products:m.popupProducts},sfProps:{onModalClose:m.onModalClose,onCustomerSave:m.onCustomerFormDataSave,isCustomerLoggedIn:m.isCustomerLoggedIn}}):null}));export{i as default};
1
+ import{__awaiter as e,__generator as o}from'./../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as d}from"mobx-react-lite";import{IkasStorefrontPopupDisplayTriggerTypeEnum as p}from"../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import{exitIntent as s}from"../utils/index.js";import{IkasStorefrontPopupRendererViewModel as n}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 i 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 t=d((function(d){var t=d.storefrontPopup,m=r.useState((function(){return new n({},t)}))[0];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,m.init()];case 1:if(o.sent(),!m.isModalClosedByUser){if((e=m.storefrontPopupData.displaySettings.triggerType)===p.SCROLL_DOWN)return window.addEventListener("scroll",m.handleScroll),[2,function(){window.removeEventListener("scroll",m.handleScroll)}];if(e===p.EXIT_INTENT)return r=s({onExitIntent:function(){m.openModal()}}),[2,function(){r()}]}return[2]}}))}))}),[]),m.storefrontPopupData&&m.storefrontPopupData.contentJson&&!m.isLoading?r.createElement(i,{key:m.storefrontPopupData.id,popup:m.storefrontPopupData.contentJson,dynamicData:{products:m.popupProducts},sfProps:{onModalClose:m.onModalClose,onCustomerSave:m.onCustomerFormDataSave,isCustomerLoggedIn:m.isCustomerLoggedIn}}):null}));export{t as default};
@@ -1 +1 @@
1
- import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import e from"react";import"../../../ext/mobx-react-lite/es/index.js";import{getHorizontalAlignment as o,injectFontScript as r}from"../../helpers/index.js";import{observer as n}from"../../../ext/mobx-react-lite/es/observer.js";var i=n((function(n){var i=n.element,a={display:"flex",alignItems:"center",justifyContent:o(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:r(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 e.createElement("div",{style:a},e.createElement("a",{href:i.link||void 0,style:c},e.createElement("div",{dangerouslySetInnerHTML:{__html:i.text},style:t({},l)})))}));export{i as default};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../../ext/mobx-react-lite/es/index.js";import{getHorizontalAlignment as t}from"../../helpers/index.js";import{observer as r}from"../../../ext/mobx-react-lite/es/observer.js";var o=r((function(r){var o=r.element,i={display:"flex",alignItems:"center",justifyContent:t(o.horizontalAlignment),padding:"".concat(o.verticalPadding,"px ").concat(o.horizontalPadding,"px"),backgroundColor:o.bgColor,width:"100%"},a={backgroundColor:o.borderColor,width:"".concat(o.width,"%"),height:"".concat(o.borderWidth,"px"),borderRadius:"".concat(o.borderRadius,"px")};return e.createElement("div",{style:i},e.createElement("div",{style:a}))}));export{o as default};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../../../ext/mobx-react-lite/es/index.js";import{observer as t}from"../../../../ext/mobx-react-lite/es/observer.js";var r=t((function(t){var r=t.checkboxItem;e.useEffect((function(){r.showInCheckedStatus?r.isChecked=!0:r.isChecked=!1}),[r.showInCheckedStatus]);var i=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,i&&i.hasError&&r.isChecked&&(i.hasError=!1)}}),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:4}},e.createElement("div",{dangerouslySetInnerHTML:{__html:r.text}}),!!i&&e.createElement("span",null,"*"))),!!i&&i.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},i.validationErrorMessage))}));export{r as CheckboxItemView};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../../../ext/mobx-react-lite/es/index.js";import t from"react-date-picker";import{observer as r}from"../../../../ext/mobx-react-lite/es/observer.js";var a=r((function(r){var a=e.useState(!1),o=a[0],n=a[1],l=e.useRef(null);r.placeholder;var i=r.isRequired,c=r.inputLabel;r.updateCurrentInfo;var s=r.formInputSettings,u=r.value,p=r.onValueChange;return e.useEffect((function(){if(l.current){var e=l.current.getElementsByClassName("react-date-picker__wrapper");if(e.length>0){var t=e[0];t.style.backgroundColor=s.bgColor,t.style.border="".concat(s.borderWidth,"px solid ").concat(o?s.focusBorderColor:s.borderColor),t.style.borderRadius="".concat(s.borderRadius,"px"),t.style.fontSize="14px",t.style.padding="10px 12px",t.style.height="".concat(s.height,"px");for(var r=t.getElementsByTagName("input"),a=0;a<r.length;a++){var n=r[a];n.style.outline="none !important",n.style.border="none !important"}}}}),[l.current]),e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"},ref:l},(c||i)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},c&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},c.text),i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),i&&i.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},i.validationErrorMessage)),e.createElement(t,{onChange:function(e){return function(e){var t=e?e.valueOf().toString():"";p(t),i&&i.hasError&&t.length>0&&(i.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 n(!0)},onBlur:function(){return n(!1)}}))}));export{a as default};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../../../ext/mobx-react-lite/es/index.js";import{observer as r}from"../../../../ext/mobx-react-lite/es/observer.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)},"aria-placeholder":l.placeholder},e.createElement("option",{value:"",disabled:!0,selected:!0,hidden:!0},l.placeholder),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};
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};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.mjs.js";import r from"react";import"../../../ext/mobx-react-lite/es/index.js";import{getHorizontalAlignment as n}from"../../helpers/index.js";import{FormItemTypeEnum as o}from"../../models/modal/step/elements/form/index.js";import a from"../button-element-renderer/index.js";import i from"./input-item-view/index.js";import{CheckboxItemView as s}from"./checkbox-item-view/index.js";import l from"./date-item-view/index.js";import m from"./gender-item-view/index.js";import{observer as u}from"../../../ext/mobx-react-lite/es/observer.js";var c=u((function(u){var c=u.element,d=u.popup,f=u.isPreviewMode,p=u.sfProps,E=r.useState(!1);E[0];var I=E[1],v=c,C=v.rows.slice().sort((function(e,t){return e.order-t.order})),h=v.formSettings,M=v.buttonSettings,g=v.bgColor,S={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:n(v.horizontalAlignment),gap:"".concat(h.gapBetweenItems,"px"),padding:"".concat(v.verticalPadding,"px ").concat(v.horizontalPadding,"px"),backgroundColor:g,width:"100%"},R={display:"flex",flexDirection:"row",width:"100%",gap:"".concat(h.gapBetweenItems,"px")},_={flex:1,display:"flex",alignItems:"flex-end"},O=function(){return e(void 0,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return e=d.modal.steps.findIndex((function(e){return e.id===d.modal.selectedStep.id})),f||!p?[3,2]:(I(!0),function(){var e=!1;return v.rows.forEach((function(t){t.columns.forEach((function(t){switch(t.type){case o.CUSTOMER_BIRTHDAY:var r=t.formItem;r.required&&!r.value&&(r.required.hasError=!0,e=!0);break;case o.CUSTOMER_EMAIL:case o.CUSTOMER_PHONE:case o.CUSTOMER_NAME:case o.CUSTOMER_SURNAME:case o.CHECKBOX_FORM_ITEM:var n=t.formItem;if(n.required&&!n.value){if(n.type===o.CUSTOMER_EMAIL&&(null==p?void 0:p.isCustomerLoggedIn))return;n.required.hasError=!0,e=!0}break;case o.CUSTOMER_GENDER:var a=t.formItem,i=a.genders.find((function(e){return e.isSelected}));a.required&&!i&&(a.required.hasError=!0,e=!0);case o.CHECKBOX_FORM_ITEM:var s=t.formItem;s.requiredToBeChecked&&!s.isChecked&&(s.requiredToBeChecked.hasError=!0,e=!0)}}))})),e}()?(I(!1),[2]):(r={},v.rows.forEach((function(e){e.columns.forEach((function(e){var t;switch(e.type){case o.CUSTOMER_BIRTHDAY:r.birthday=e.formItem.value;break;case o.CUSTOMER_EMAIL:r.email=e.formItem.value;break;case o.CUSTOMER_GENDER:r.gender=(null===(t=e.formItem.genders.find((function(e){return e.isSelected})))||void 0===t?void 0:t.type)||"";break;case o.CUSTOMER_PHONE:r.phone=e.formItem.value;break;case o.CUSTOMER_NAME:r.firstName=e.formItem.value||"";break;case o.CUSTOMER_SURNAME:r.lastName=e.formItem.value||"";break;case o.CHECKBOX_FORM_ITEM:r.hasPermission=e.formItem.isChecked}}))})),[4,p.onCustomerSave(r)]));case 1:t.sent(),I(!1),t.label=2;case 2:return-1!==e&&e<d.modal.steps.length&&(d.modal.selectedStep=d.modal.steps[e+1]),[2]}}))}))},T={width:"".concat(M.width,"%"),minWidth:"fit-content"};return r.createElement("div",{style:S},C.map((function(e,t){return r.createElement("div",{style:R,key:t},e.columns.slice().sort((function(e,t){return e.order-t.order})).map((function(e,t){return r.createElement("div",{style:_,key:t},function(e){switch(e.type){case o.CUSTOMER_EMAIL:case o.CUSTOMER_PHONE:case o.CUSTOMER_NAME:case o.CUSTOMER_SURNAME:var t=e.formItem;return t.type===o.CUSTOMER_EMAIL&&(null==p?void 0:p.isCustomerLoggedIn)&&!f?null:r.createElement(i,{formInputSettings:h.formInputSettings,inputLabel:t.inputLabel,isRequired:t.required,onValueChange:function(e){return f?null:t.value=e},placeholder:t.placeholder,updateCurrentInfo:t.updateCurrentInfo,value:t.value||""});case o.CUSTOMER_BIRTHDAY:var n=e.formItem;return r.createElement(l,{formInputSettings:h.formInputSettings,inputLabel:n.inputLabel,isRequired:n.required,onValueChange:function(e){return f?null:n.value=e},placeholder:n.placeholder,updateCurrentInfo:n.updateCurrentInfo,value:n.value||""});case o.CUSTOMER_GENDER:var a=e.formItem;return r.createElement(m,{genderFormItem:a,formInputSettings:h.formInputSettings,onValueChange:function(e){return f?null:a.genders.forEach((function(t){t.isSelected=t.label===e}))}});case o.CHECKBOX_FORM_ITEM:return r.createElement(s,{checkboxItem:e.formItem})}}(e))})))})),r.createElement("div",{style:T,onClick:function(e){O(),e.preventDefault(),e.stopPropagation()}},r.createElement(a,{element:M})," "))}));export{c as default};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../../../ext/mobx-react-lite/es/index.js";import{observer as t}from"../../../../ext/mobx-react-lite/es/observer.js";var r=t((function(t){var r=e.useState(!1),o=r[0],l=r[1],a=t.placeholder,n=t.isRequired,i=t.inputLabel;t.updateCurrentInfo;var c=t.formInputSettings,s=t.value,d=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||n)&&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),n&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),n&&n.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},n.validationErrorMessage)),e.createElement("input",{type:"text",placeholder:a,value:s||"",onChange:function(e){return function(e){d(e),n&&n.hasError&&e.length>0&&(n.hasError=!1)}(e.target.value)},style:p,onFocus:function(){return l(!0)},onBlur:function(){return l(!1)}}))}));export{r as default};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../../ext/mobx-react-lite/es/index.js";import{ImageColumnPositionEnum as t}from"../../models/modal/step/elements/image-column/index.js";import{observer as o}from"../../../ext/mobx-react-lite/es/observer.js";var i=o((function(o){var i=o.element,r=o.popup,d=o.editModeChildren,a=i;a.cdnURL||(a.cdnURL=r.cdnURL),a.merchantId||(a.merchantId=r.merchantId);var n=r.modal.windowSettings,s={width:n.takeFullWidth?"100%":n.maxWidth,height:"100%"};if(!a.src&&r.isPreviewMode&&d)return e.createElement("div",{style:s},d);var m=a.imagePosition===t.LEFT_ALIGN,c={objectFit:"cover",height:"100%",borderTopRightRadius:m?void 0:"".concat(r.modal.windowSettings.borderRadius,"px"),borderBottomRightRadius:m?void 0:"".concat(r.modal.windowSettings.borderRadius,"px"),borderTopLeftRadius:m?"".concat(r.modal.windowSettings.borderRadius,"px"):void 0,borderBottomLeftRadius:m?"".concat(r.modal.windowSettings.borderRadius,"px"):void 0};return e.createElement("a",{href:a.link||void 0,style:s},a.src&&e.createElement("img",{src:a.src||void 0,width:"100% !important",style:c}))}));export{i as default};
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,m=t.popup,a=t.editModeChildren,d=i;d.cdnURL||(d.cdnURL=m.cdnURL),d.merchantId||(d.merchantId=m.merchantId);var n=m.modal.windowSettings,o={width:n.takeFullWidth?"100%":n.maxWidth,height:"100%"};if(!d.src&&m.isPreviewMode&&a)return e.createElement("div",{style:o},a);var c={objectFit:d.objectFit===r.CONTAIN?"contain":"cover",height:"100%"};return e.createElement("a",{href:d.link||void 0,style:o},d.src&&e.createElement("img",{src:d.src||void 0,width:"100% !important",style:c}))}));export{i as default};
@@ -1 +1 @@
1
- import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import e from"react";import"../../../ext/mobx-react-lite/es/index.js";import{getHorizontalAlignment as i}from"../../helpers/index.js";import{ImagePositionEnum as o}from"../../models/modal/step/elements/image/index.js";import{observer as n}from"../../../ext/mobx-react-lite/es/observer.js";var r=n((function(n){var r=n.element,a=n.popup,d=n.editModeChildren,s=r;if(s.cdnURL||(s.cdnURL=a.cdnURL),s.merchantId||(s.merchantId=a.merchantId),!s.src&&a.isPreviewMode&&d)return d;var m={display:"flex",alignItems:"center",justifyContent:i(s.horizontalAlignment),padding:"".concat(s.verticalPadding,"px ").concat(s.horizontalPadding,"px"),backgroundColor:s.bgColor,maxWidth:"100%"},c={borderRadius:"".concat(s.borderRadius,"px"),objectFit:"contain",width:"".concat(s.maxWidth,"%")};return s.imagePosition===o.DISABLE_FLOAT?e.createElement("a",{href:s.link||void 0,style:m},e.createElement("img",{src:s.src||void 0,width:100===s.maxWidth?"100% !important":void 0,style:c})):e.createElement("img",{src:s.src||void 0,width:100===s.maxWidth?"100% !important":void 0,style:t(t({},c),{padding:"".concat(s.verticalPadding,"px ").concat(s.horizontalPadding,"px"),backgroundColor:s.bgColor,float:s.imagePosition===o.FLOAT_LEFT?"left":"right"}),onClick:function(){s.link&&window.open(s.link,"_blank")}})}));export{r as default};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../ext/mobx-react-lite/es/index.js";import{PopupTypeEnum as t,PopupPositonEnum as o}from"../models/modal/index.js";import n from"../assets/x-close.js";import{CloseButtonPositionTypeEnum as i,CloseIconTypeEnum as r,CloseButtonDisplayTypeEnum as s}from"../models/modal/close-settings/index.js";import{PopupElementTypeEnum as l,ComponentVerticalAlignmentEnum as a}from"../models/modal/step/elements/base/index.js";import d from"./text-element-renderer/index.js";import c from"./button-element-renderer/index.js";import p from"./space-element-renderer/index.js";import m from"./divider-element-renderer/index.js";import u from"./social-element-renderer/index.js";import f from"./image-element-renderer/index.js";import x from"./image-column-element-renderer/index.js";import P from"./product-list-renderer/index.js";import E from"./form-element-renderer/index.js";import{ImageColumnPositionEnum as T}from"../models/modal/step/elements/image-column/index.js";import{observer as y}from"../../ext/mobx-react-lite/es/observer.js";var v=y((function(y){var v,g,b,O,C=y.popup,I=y.dynamicData,_=y.dashboardComponents,h=y.previewMode,M=y.sfProps,A=C.modal,R=A.teaser,D=!!A.selectedStep.isTeaser,S=A.selectedStep.elements.find((function(e){return e.type===l.IMAGE_COLUMN})),w=D?R.backgroundSettings:A.backgroundSettings,k=D?R.windowSettings:A.windowSettings,j=D?R.closeSettings:A.closeSettings,N=w.allowScrollingWhenPopupOpen,L=C.isPreviewMode||h,B=!!L||A.isVisible;document.body.style.overflow=B&&!N?"hidden":"auto";var U=w.overlay,W=w.border,F="center",H="center";switch(D?t.POPUP:A.type){case t.POPUP:var V=D?R.position:A.position;V===o.POPUP_TOP_LEFT?(F="flex-start",H="flex-start"):V===o.POPUP_TOP_CENTER?(F="center",H="flex-start"):V===o.POPUP_TOP_RIGHT?(F="flex-end",H="flex-start"):V===o.POPUP_MIDDLE_LEFT?(F="flex-start",H="center"):V===o.POPUP_MIDDLE_CENTER?(F="center",H="center"):V===o.POPUP_MIDDLE_RIGHT?(F="flex-end",H="center"):V===o.POPUP_BOTTOM_LEFT?(F="flex-start",H="flex-end"):V===o.POPUP_BOTTOM_CENTER?(F="center",H="flex-end"):V===o.POPUP_BOTTOM_RIGHT&&(F="flex-end",H="flex-end");break;case t.DRAWER:A.position===o.DRAWER_LEFT?(F="flex-start",H="center"):A.position===o.DRAWER_RIGHT&&(F="flex-end",H="center");break;case t.NOTIFICATION_BAR:A.position===o.NOTIFICATION_BAR_UP?(F="center",H="flex-start"):A.position===o.NOTIFICATION_BAR_DOWN&&(F="center",H="flex-end")}var G={position:"fixed",display:"flex",justifyContent:F,alignItems:H,top:0,left:0,right:0,bottom:0,zIndex:9995,overflow:"hidden",padding:"".concat(k.outerVerticalPadding,"px ").concat(k.outerHorizontalPadding,"px"),opacity:B?1:0,visibility:B?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},z={position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9996,backgroundColor:U?U.bgColor:"",opacity:U?(U.bgOpacity||100)/100:void 0},K={position:"relative",zIndex:9997,display:"flex",flexDirection:S?S.imagePosition===T.LEFT_ALIGN?"row-reverse":"row":"column",backgroundColor:w.bgColor,border:W?"".concat(W.borderWidth,"px ").concat(W.borderStyle," ").concat(W.borderColor):"",borderRadius:"".concat(k.borderRadius,"px"),width:k.takeFullWidth?"100%":void 0,maxWidth:"100%",maxHeight:"100%",height:k.takeFullHeight?"100%":k.maxHeight,boxShadow:w.shadow?"0 0 10px ".concat(w.shadow.color):"",opacity:B?1:0,visibility:B?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},X="";switch(null==S?void 0:S.verticalAlignment){case a.BOTTOM:X="flex-end";break;case a.MIDDLE:X="center";break;case a.TOP:X="flex-start"}var Y={width:k.takeFullWidth?"100%":k.maxWidth,maxWidth:"100%",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:X,borderRadius:"".concat(k.borderRadius,"px")},q={position:j.closeButtonPositionType===i.TAKE_SPACE?"relative":"absolute",float:j.closeButtonPositionType===i.TAKE_SPACE?"right":"none",top:8,right:8,zIndex:9998},J={position:"sticky",padding:"6px",marginLeft:j.closeButtonPositionType===i.TAKE_SPACE?"14px":void 0,display:"flex",justifyContent:"center",alignItems:"center",border:(null===(v=j.iconSettings)||void 0===v?void 0:v.type)===r.WITH_BORDER?"1px solid ".concat(null===(g=j.iconSettings)||void 0===g?void 0:g.color):"",borderRadius:"50%",backgroundColor:null===(b=j.iconSettings)||void 0===b?void 0:b.backgroundColor},Q={color:null===(O=j.iconSettings)||void 0===O?void 0:O.color,cursor:"pointer"},Z=function(t){var o=t.type,n=_&&_[o]&&_[o].length?_[o][0]:null,i=n&&C.marketingPopupViewModel?e.createElement(n,{element:t,marketingPopupViewModel:C.marketingPopupViewModel}):void 0;switch(o){case l.TEXT:return e.createElement(d,{element:t});case l.IMAGE:return e.createElement(f,{element:t,popup:C,editModeChildren:i});case l.IMAGE_COLUMN:return e.createElement(x,{element:t,popup:C,editModeChildren:i});case l.BUTTON:return e.createElement(c,{element:t});case l.DIVIDER:return e.createElement(m,{element:t});case l.FORM:return e.createElement(E,{element:t,popup:C,isPreviewMode:!!L,sfProps:M});case l.PRODUCT_LIST:return e.createElement(P,{element:t,products:I.products[t.id],popup:C,editModeChildren:i});case l.SOCIAL_MEDIA:return e.createElement(u,{element:t,popup:C,editModeChildren:i});case l.SPACE:return e.createElement(p,{element:t})}},$=function(){L||A.isVisible&&(A.isVisible=!1,M&&M.onModalClose())};return e.createElement("div",{className:"ikas-popup-default-styles",id:"ikas-popup-container",style:G},e.createElement("div",{style:K,onClick:function(e){D&&(A.selectedStep=A.steps[0])}},j.closeButtonDisplayType!==s.ALWAYS_HIDDEN&&e.createElement("div",{style:q,onClick:function(){return $()}},e.createElement("div",{style:J,className:j.closeButtonDisplayType===s.VISIBLE_ON_HOVER?"visible-on-hover":""},e.createElement(n,{style:Q}))),e.createElement("div",{style:Y},A.selectedStep.elements.filter((function(e){return e.type!==l.IMAGE_COLUMN})).slice().sort((function(e,t){return e.order-t.order})).map((function(e){return Z(e)}))),S&&Z(S)),e.createElement("div",{style:z,onClick:function(){return $()}}))}));export{v as default};
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 p from"./button-element-renderer/index.js";import m 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 x from"./image-column-element-renderer/index.js";import E from"./product-list-renderer/index.js";import g from"./form-element-renderer/index.js";import{ImageColumnPositionEnum as T}from"../models/modal/step/elements/image-column/index.js";var v=t((function(t){var v,y,b,O,C=t.popup,I=t.dynamicData,_=t.dashboardComponents,h=t.previewMode,M=t.sfProps,A=C.modal,w=A.teaser,D=!!A.selectedStep.isTeaser,R=A.selectedStep.elements.find((function(e){return e.type===a.IMAGE_COLUMN})),S=D?w.backgroundSettings:A.backgroundSettings,k=D?w.windowSettings:A.windowSettings,N=D?w.closeSettings:A.closeSettings,j=S.allowScrollingWhenPopupOpen,L=C.isPreviewMode||h,B=!!L||A.isVisible;document.body.style.overflow=B&&!j?"hidden":"auto";var U=S.overlay,H=S.border,W="center",F="center";switch(D?o.POPUP:A.type){case o.POPUP:var V=D?w.position:A.position;V===n.POPUP_TOP_LEFT?(W="flex-start",F="flex-start"):V===n.POPUP_TOP_CENTER?(W="center",F="flex-start"):V===n.POPUP_TOP_RIGHT?(W="flex-end",F="flex-start"):V===n.POPUP_MIDDLE_LEFT?(W="flex-start",F="center"):V===n.POPUP_MIDDLE_CENTER?(W="center",F="center"):V===n.POPUP_MIDDLE_RIGHT?(W="flex-end",F="center"):V===n.POPUP_BOTTOM_LEFT?(W="flex-start",F="flex-end"):V===n.POPUP_BOTTOM_CENTER?(W="center",F="flex-end"):V===n.POPUP_BOTTOM_RIGHT&&(W="flex-end",F="flex-end");break;case o.DRAWER:A.position===n.DRAWER_LEFT?(W="flex-start",F="center"):A.position===n.DRAWER_RIGHT&&(W="flex-end",F="center");break;case o.NOTIFICATION_BAR:A.position===n.NOTIFICATION_BAR_UP?(W="center",F="flex-start"):A.position===n.NOTIFICATION_BAR_DOWN&&(W="center",F="flex-end")}var G={position:"fixed",display:"flex",justifyContent:W,alignItems:F,top:0,left:0,right:0,bottom:0,zIndex:9995,overflow:"hidden",padding:"".concat(k.outerVerticalPadding,"px ").concat(k.outerHorizontalPadding,"px"),opacity:B?1:0,visibility:B?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},z={position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9996,backgroundColor:U?U.bgColor:"",opacity:U?(U.bgOpacity||100)/100:void 0},K={position:"relative",zIndex:9997,backgroundColor:S.bgColor,border:H?"".concat(H.borderWidth,"px ").concat(H.borderStyle," ").concat(H.borderColor):"",borderRadius:"".concat(k.borderRadius,"px"),width:k.takeFullWidth?"100%":void 0,maxWidth:"100%",maxHeight:"100%",minHeight:k.minHeight,height:k.takeFullHeight?"100%":void 0,boxShadow:S.shadow?"0 0 10px ".concat(S.shadow.color):"",overflow:"hidden",opacity:B?1:0,visibility:B?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease",padding:"".concat(k.innerVerticalPadding,"px ").concat(k.innerHorizontalPadding,"px")},X="";switch(null==R?void 0:R.verticalAlignment){case d.BOTTOM:X="flex-end";break;case d.MIDDLE:X="center";break;case d.TOP:X="flex-start"}var Y={width:k.takeFullWidth?"100%":k.maxWidth,maxWidth:"100%",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:X},q={position:N.closeButtonPositionType===r.TAKE_SPACE?"relative":"absolute",float:N.closeButtonPositionType===r.TAKE_SPACE?"right":"none",top:8,right:8,zIndex:9998},J={position:"sticky",padding:"6px",marginLeft:N.closeButtonPositionType===r.TAKE_SPACE?"14px":void 0,display:"flex",justifyContent:"center",alignItems:"center",border:(null===(v=N.iconSettings)||void 0===v?void 0:v.type)===l.WITH_BORDER?"1px solid ".concat(null===(y=N.iconSettings)||void 0===y?void 0:y.color):"",borderRadius:"50%",backgroundColor:null===(b=N.iconSettings)||void 0===b?void 0:b.backgroundColor},Q={color:null===(O=N.iconSettings)||void 0===O?void 0:O.color,cursor:"pointer"},Z=function(t){var o=t.type,n=_&&_[o]&&_[o].length?_[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 e.createElement(x,{element:t,popup:C,editModeChildren:i});case a.BUTTON:return e.createElement(p,{element:t});case a.DIVIDER:return e.createElement(u,{element:t});case a.FORM:return e.createElement(g,{element:t,popup:C,isPreviewMode:!!L,sfProps:M});case a.PRODUCT_LIST:return e.createElement(E,{element:t,products:I.products[t.id],popup:C,editModeChildren:i,isPreviewMode:!!L});case a.SOCIAL_MEDIA:return e.createElement(f,{element:t,popup:C,editModeChildren:i});case a.SPACE:return e.createElement(m,{element:t})}},$=function(){L||A.isVisible&&(A.isVisible=!1,M&&M.onModalClose())};return e.createElement("div",{className:"ikas-popup-default-styles",id:"ikas-popup-container",style:G},e.createElement("div",{style:K},N.closeButtonDisplayType!==s.ALWAYS_HIDDEN&&e.createElement("div",{style:q,onClick:function(){return $()}},e.createElement("div",{style:J,className:N.closeButtonDisplayType===s.VISIBLE_ON_HOVER?"visible-on-hover":""},e.createElement(i,{style:Q}))),e.createElement("div",{style:{display:"flex",flexDirection:R?R.imagePosition===T.LEFT_ALIGN?"row-reverse":"row":"column"},onClick:function(e){D&&(A.selectedStep=A.steps[0])}},e.createElement("div",{style:Y},A.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 Z(e)}))),R&&Z(R))),e.createElement("div",{style:z,onClick:function(){return $()}}))}));export{v as default};
@@ -1 +1 @@
1
- import{__spreadArray as t,__assign as e}from"../../../ext/tslib/tslib.es6.mjs.js";import o from"react";import"../../../ext/mobx-react-lite/es/index.js";import{getHorizontalAlignment as i,injectFontScript as n}from"../../helpers/index.js";import{ProductListTypeEnum as l,ProductListLayoutEnum as r}from"../../models/modal/step/elements/product/index.js";import d from"../button-element-renderer/index.js";import a from"../../../../../../swiper/modules/navigation.mjs.js";import c from"../../../../../../swiper/modules/scrollbar.mjs.js";import{Swiper as s,SwiperSlide as u}from"../../../../../../swiper/swiper-react.mjs.js";import m from"../../assets/left-arrow.js";import v from"../../assets/right-arrow.js";import{observer as g}from"../../../ext/mobx-react-lite/es/observer.js";var p=g((function(g){var p,f=g.element,b=g.products,h=g.popup,x=g.editModeChildren,y=o.useState(null),E=y[0],C=y[1],w=o.useState(!1),P=w[0],S=w[1],j=o.useState(!1),z=j[0],R=j[1],W=f,I=[];if(b&&(I=W.listType===l.SPECIFIC?(null===(p=W.variantPairs)||void 0===p?void 0:p.length)?b.slice().sort((function(t,e){return W.variantPairs.findIndex((function(e){return e.variantId===t.variantId}))-W.variantPairs.findIndex((function(t){return t.variantId===e.variantId}))})):[]:t([],b,!0)),I.length>W.maxProductsToShow&&(I.length=W.maxProductsToShow),!(I&&I.length||!h.isPreviewMode)&&x)return x;if(!I||!I.length)return null;W.gapBetweenProductElements;var F=W.productDetailSettings.image,A=W.productDetailSettings.button,k=W.buttonSettings,D=W.productDetailSettings.discountRatio,L=W.productDetailSettings.finalPrice,N=W.productDetailSettings.originalPrice,_=W.productDetailSettings.name,B=i(W.horizontalAlignment),T=1;W.layout===r.ONE_COLUMN?T=1:W.layout===r.TWO_COLUMN?T=2:W.layout===r.THREE_COLUMN&&(T=3);var M={padding:"".concat(W.verticalPadding,"px ").concat(W.horizontalPadding,"px"),backgroundColor:W.productBgColor,width:"100%",height:"max-content"},O={display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",height:"100%"},U={display:"flex",justifyContent:B,alignItems:"center",width:"100%",backgroundColor:null==F?void 0:F.bgColor,borderRadius:(null==F?void 0:F.borderRadius)?"".concat(F.borderRadius,"px"):void 0},H={width:"".concat(null==F?void 0:F.maxWidth,"%"),objectFit:"contain",borderRadius:(null==F?void 0:F.borderRadius)?"".concat(F.borderRadius,"px"):void 0},V={display:"flex",flexDirection:"column",width:"100%"},$={display:"flex",flexDirection:"column"},q={backgroundColor:null==_?void 0:_.bgColor,color:null==_?void 0:_.color,fontFamily:_?n(_.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},G={backgroundColor:null==D?void 0:D.bgColor,color:null==D?void 0:D.color,fontFamily:D?n(D.fontFamily):void 0,fontSize:null==D?void 0:D.fontSize,fontWeight:null==D?void 0:D.fontWeight,padding:"".concat(null==D?void 0:D.verticalPadding,"px ").concat(null==D?void 0:D.horizontalPadding,"px"),width:"100%",textAlign:null==D?void 0:D.horizontalAlignment,border:"".concat(null==D?void 0:D.borderWidth,"px ").concat(null==D?void 0:D.borderStyle," ").concat(null==D?void 0:D.borderColor),borderRadius:null==D?void 0:D.borderRadius},J={textDecoration:"line-through",backgroundColor:null==N?void 0:N.bgColor,color:null==N?void 0:N.color,fontFamily:N?n(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},K={backgroundColor:null==L?void 0:L.bgColor,color:null==L?void 0:L.color,fontFamily:L?n(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},Q={width:"".concat(k.width,"%"),minWidth:"fit-content"},X=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),Y={padding:10,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",border:"1px solid #EEF2F6",cursor:"pointer"};return o.createElement("div",{style:M},o.createElement(s,{onSwiper:C,modules:[a,c],spaceBetween:W.gapBetweenProducts,slidesPerView:T,navigation:{nextEl:".custom-next-button",prevEl:".custom-prev-button"},scrollbar:void 0},I.map((function(t,e){return o.createElement(u,{style:{height:"auto"},key:t.variantId},o.createElement("div",{style:O},o.createElement("div",{style:V},!!F&&t.imageURL&&o.createElement("div",{style:U},o.createElement("img",{src:t.imageURL||void 0,alt:t.name||void 0,style:H})),(!!_||!!D)&&o.createElement("div",{style:$},!!_&&o.createElement("div",{style:q},t.name),!!D&&!!t.discountPrice&&o.createElement("div",{style:G},t.$discountRatio)),(!!N||!!L)&&o.createElement("div",null,!!N&&!!t.discountPrice&&o.createElement("div",{style:J},t.price),!!L&&o.createElement("div",{style:K},t.discountPrice||t.price))),!!A&&o.createElement("div",{style:Q,onClick:function(){}}," ",o.createElement(d,{element:k})," ")))})),o.createElement("div",{style:X},o.createElement("div",{className:"custom-prev-button",style:e(e({},Y),P?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){E&&(E.slidePrev(),R(E.isEnd),S(E.isBeginning))}},o.createElement(m,null)),o.createElement("div",{className:"custom-next-button",style:e(e({},Y),z?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){E&&(E.slideNext(),R(E.isEnd),S(E.isBeginning))}},o.createElement(v,null)))))}));export{p as default};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../../ext/mobx-react-lite/es/index.js";import{getHorizontalAlignment as t}from"../../helpers/index.js";import{observer as r}from"../../../ext/mobx-react-lite/es/observer.js";var n=r((function(r){var n=r.element,i=n.socialMediaLinks.filter((function(e){return!!e.link})).sort((function(e,t){return e.order-t.order}));if(!i.length&&r.editModeChildren&&r.popup.isPreviewMode)return r.editModeChildren;var o={display:"flex",alignItems:"center",justifyContent:t(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};
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};
@@ -1 +1 @@
1
- import e from"react";import"../../../ext/mobx-react-lite/es/index.js";import{observer as t}from"../../../ext/mobx-react-lite/es/observer.js";var r=t((function(t){var r=t.element,o={backgroundColor:r.bgColor,padding:"".concat(r.verticalPadding,"px ").concat(r.horizontalPadding,"px"),height:r.height,width:"100%"};return e.createElement("div",{style:o})}));export{r as default};
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};
@@ -1 +1 @@
1
- import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import e from"react";import"../../../ext/mobx-react-lite/es/index.js";import{injectFontScript as o}from"../../helpers/index.js";import{observer as r}from"../../../ext/mobx-react-lite/es/observer.js";var n=r((function(r){var n=r.element,i=n,a={backgroundColor:i.bgColor,border:"".concat(i.borderWidth,"px ").concat(i.borderStyle," ").concat(i.borderColor),borderRadius:i.borderRadius,padding:"".concat(i.outerVerticalPadding,"px ").concat(i.outerHorizontalPadding,"px")},d={color:i.color,fontSize:i.fontSize,fontWeight:i.fontWeight,fontFamily:o(i.fontFamily),textAlign:i.horizontalAlignment,padding:"".concat(i.verticalPadding,"px ").concat(i.horizontalPadding,"px")};return e.createElement("div",{style:a},e.createElement("div",{dangerouslySetInnerHTML:{__html:n.text},style:t({},d)}))}));export{n as default};
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};
@@ -1 +1 @@
1
- import{makeObservable as o,observable as r}from"mobx";var t,e,l=function(t){this.bgColor=t.bgColor||"#FFFFFF",this.overlay=t.overlay?new i(t.overlay):new i({}),this.shadow=t.shadow?new d(t.shadow):null,this.border=t.border?new a(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||"#364152",this.bgOpacity=t.bgOpacity||40,o(this,{bgOpacity:r,bgColor:r})},d=function(t){this.color=t.color||"#364152",this.bgOpacity=t.bgOpacity||100,o(this,{bgOpacity:r,color:r})};(e=t||(t={})).SOLID="solid",e.DASHED="dashed",e.DOTTED="dotted";var a=function(e){this.borderColor=e.borderColor||"#E3E8EF",this.borderWidth=e.borderWidth||1,this.borderStyle=e.borderStyle||t.SOLID,o(this,{borderColor:r,borderWidth:r,borderStyle:r})};export{l as BackgroundSettings,a as Border,t as ButtonBorderStyle,i as Overlay,d as Shadow};
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};
@@ -1 +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||"",o(this,{type:t,color:t,backgroundColor:t})};export{n as CloseButtonDisplayTypeEnum,s as CloseButtonPositionTypeEnum,E as CloseIconSettings,e as CloseIconTypeEnum,T as CloseSettings};
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};
@@ -1 +1 @@
1
- import{makeObservable as t,observable as i,computed as e,action as P}from"mobx";import{PopupStep as s}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 _}from"./close-settings/index.js";var a,I,r;(r=a||(a={})).POPUP="POPUP",r.NOTIFICATION_BAR="NOTIFICATION_BAR",r.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 r(O){this.type=O.type||a.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({}),this.backgroundSettings=new T(O.backgroundSettings||{}),this.closeSettings=new _(O.closeSettings||{}),this.steps=O.steps&&O.steps.length?O.steps.map((function(t){return new s(t)})):[new s({stepNumber:1,name:"TODO",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:P,setInitialPosition:P,setInitialWindowSettings:P})}return r.prototype.setInitialSettings=function(t){void 0===t&&(t=!1),this.setInitialPosition(t),this.setInitialWindowSettings(t)},r.prototype.setInitialPosition=function(t){switch(this.type){case a.POPUP:this.position=t?I.POPUP_BOTTOM_RIGHT:I.POPUP_MIDDLE_CENTER;break;case a.NOTIFICATION_BAR:this.position=I.NOTIFICATION_BAR_UP;break;case a.DRAWER:this.position=I.DRAWER_RIGHT}},r.prototype.setInitialWindowSettings=function(t){switch(this.type){case a.POPUP:this.windowSettings=new o({}),t&&(this.backgroundSettings.allowScrollingWhenPopupOpen=!0,this.backgroundSettings.overlay=null,this.backgroundSettings.border=new O({}));break;case a.NOTIFICATION_BAR:this.windowSettings=new o({outerHorizontalPadding:0,outerVerticalPadding:0,takeFullWidth:!0});break;case a.DRAWER:this.windowSettings=new o({outerHorizontalPadding:0,outerVerticalPadding:0,takeFullHeight:!0})}},Object.defineProperty(r.prototype,"availablePositions",{get:function(){var t;return(t={})[a.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[a.NOTIFICATION_BAR]=[I.NOTIFICATION_BAR_UP,I.NOTIFICATION_BAR_DOWN],t[a.DRAWER]=[I.DRAWER_RIGHT,I.DRAWER_LEFT],t},enumerable:!1,configurable:!0}),r}();export{R as Modal,I as PopupPositonEnum,a as PopupTypeEnum};
1
+ import{makeObservable as t,observable as i,computed as e,action as P}from"mobx";import{PopupStep as n}from"./step/index.js";import{Teaser as s}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";var _,a,I;(I=_||(_={})).POPUP="POPUP",I.NOTIFICATION_BAR="NOTIFICATION_BAR",I.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"}(a||(a={}));var R=function(){function I(O){this.type=O.type||_.POPUP,this.teaser=O.teaser?new s(O.teaser):new s({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 n(t)})):[new n({stepNumber:1,name:"TODO",isThankYouStep:!1})],this.isVisible=!1,this.selectedStep=this.steps[0],this.position=O.position?O.position:a.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:P.bound,setInitialPosition:P.bound,setInitialWindowSettings:P.bound})}return I.prototype.setInitialSettings=function(t){void 0===t&&(t=!1),this.setInitialPosition(t),this.setInitialWindowSettings(t)},I.prototype.setInitialPosition=function(t){switch(this.type){case _.POPUP:this.position=t?a.POPUP_BOTTOM_RIGHT:a.POPUP_MIDDLE_CENTER;break;case _.NOTIFICATION_BAR:this.position=a.NOTIFICATION_BAR_UP;break;case _.DRAWER:this.position=a.DRAWER_RIGHT}},I.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(I.prototype,"availablePositions",{get:function(){var t;return(t={})[_.POPUP]=[a.POPUP_TOP_LEFT,a.POPUP_TOP_CENTER,a.POPUP_TOP_RIGHT,a.POPUP_MIDDLE_LEFT,a.POPUP_MIDDLE_CENTER,a.POPUP_MIDDLE_RIGHT,a.POPUP_BOTTOM_LEFT,a.POPUP_BOTTOM_CENTER,a.POPUP_BOTTOM_RIGHT],t[_.NOTIFICATION_BAR]=[a.NOTIFICATION_BAR_UP,a.NOTIFICATION_BAR_DOWN],t[_.DRAWER]=[a.DRAWER_RIGHT,a.DRAWER_LEFT],t},enumerable:!1,configurable:!0}),I}();export{R as Modal,a as PopupPositonEnum,_ as PopupTypeEnum};
@@ -1 +1 @@
1
- import{makeObservable as i,observable as n}from"mobx";var t,a,o,r;(r=t||(t={})).LEFT="LEFT",r.CENTER="CENTER",r.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 l=function(t){void 0===t&&(t={}),this.name=t.name||"Arial",this.variants=t.variants||null,i(this,{name:n,variants:n})},e=function(o){var r,l,e,d,E;void 0===o&&(o={}),this.id=o.id||Date.now().toString(),this.order=o.order||0,this.width=null!==(r=o.width)&&void 0!==r?r:"100",this.verticalPadding=null!==(l=o.verticalPadding)&&void 0!==l?l: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||t.CENTER,this.verticalAlignment=o.verticalAlignment||a.TOP,i(this,{id:n,order:n,width:n,verticalPadding:n,horizontalPadding:n,outerVerticalPadding:n,outerHorizontalPadding:n,horizontalAlignment:n,verticalAlignment:n})};export{e as BaseElement,t as ComponentHorizontalAlignmentEnum,a as ComponentVerticalAlignmentEnum,l as IkasPopupRendererFontFamily,o as PopupElementTypeEnum};
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};
@@ -1 +1 @@
1
- import{__extends as o}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as i}from"mobx";import{PopupElementTypeEnum as r,IkasPopupRendererFontFamily as l,BaseElement as e}from"../base/index.js";import{ButtonBorderStyle as n}from"../../../background-settings/index.js";var a=function(e){function a(o){var a,d,u,s,b,c,g,m,f=this;return(f=e.call(this,o)||this).text=o.text||"Button Text",f.type=r.BUTTON,f.color=o.color||"#FFFFFF",f.buttonBgColor=o.buttonBgColor||"",f.bgColor=o.bgColor||"",f.fontFamily=new l(o.fontFamily||{name:"Poppins",variants:["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]}),f.fontSize=null!==(a=o.fontSize)&&void 0!==a?a:16,f.fontWeight=null!==(d=o.fontWeight)&&void 0!==d?d:400,f.borderRadius=null!==(u=o.borderRadius)&&void 0!==u?u:4,f.borderColor=o.borderColor||"#000000",f.borderStyle=o.borderStyle||n.SOLID,f.borderWidth=null!==(s=o.borderWidth)&&void 0!==s?s:0,f.link=o.link||null,f.verticalPadding=null!==(b=o.verticalPadding)&&void 0!==b?b:12,f.horizontalPadding=null!==(c=o.horizontalPadding)&&void 0!==c?c:12,f.outerVerticalPadding=null!==(g=o.outerVerticalPadding)&&void 0!==g?g:12,f.outerHorizontalPadding=null!==(m=o.outerHorizontalPadding)&&void 0!==m?m:12,t(f,{text:i,color:i,buttonBgColor:i,bgColor:i,fontFamily:i,fontSize:i,fontWeight:i,borderRadius:i,borderColor:i,borderStyle:i,borderWidth:i,link:i}),f}return o(a,e),a}(e);export{a as ButtonElement};
1
+ import{__extends as o}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as r}from"mobx";import{PopupElementTypeEnum as e,IkasPopupRendererFontFamily as i,BaseElement as n}from"../base/index.js";import{ButtonBorderStyle as l}from"../../../background-settings/index.js";var d=function(n){function d(o){var d,a,u,s,b,g,m,f,v=this;return(v=n.call(this,o)||this).text=o.text||"Button Text",v.type=e.BUTTON,v.color=o.color||"#FFFFFF",v.buttonBgColor=o.buttonBgColor||"",v.bgColor=o.bgColor||"",v.fontFamily=new i(o.fontFamily),v.fontSize=null!==(d=o.fontSize)&&void 0!==d?d:16,v.fontWeight=null!==(a=o.fontWeight)&&void 0!==a?a:400,v.borderRadius=null!==(u=o.borderRadius)&&void 0!==u?u:4,v.borderColor=o.borderColor||"",v.borderStyle=o.borderStyle||l.SOLID,v.borderWidth=null!==(s=o.borderWidth)&&void 0!==s?s:0,v.link=o.link||null,v.verticalPadding=null!==(b=o.verticalPadding)&&void 0!==b?b:12,v.horizontalPadding=null!==(g=o.horizontalPadding)&&void 0!==g?g:12,v.outerVerticalPadding=null!==(m=o.outerVerticalPadding)&&void 0!==m?m: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(d,n),d}(n);export{d as ButtonElement};
@@ -1 +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||"#E3E8EF",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};
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};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as t}from"mobx";import{FormItemTypeEnum as r,InputLabel as u,RequiredInput as i}from"../index.js";var n,o;(o=n||(n={})).BOOLEAN="BOOLEAN",o.CHOICE="CHOICE",o.DATETIME="DATETIME",o.MULTIPLE_CHOICE="MULTIPLE_CHOICE",o.NUMERIC="NUMERIC",o.TEXT="TEXT";var I=function(n){void 0===n&&(n={}),this.type=r.CUSTOMER_ATTRIBUTE,this.placeholder=n.placeholder||"",this.inputLabel=n.inputLabel?new u(n.inputLabel):null,this.required=n.required?new i(n.required):null,this.updateCurrentInfo=n.updateCurrentInfo||!1,this.customerAttributeId=n.customerAttributeId||"",e(this,{type:t,placeholder:t,inputLabel:t,required:t,updateCurrentInfo:t,customerAttributeId:t})};export{I as CustomerAttributeFormItem,n as CustomerAttributeTypeEnum};
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};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as r}from"mobx";import{FormItemTypeEnum as t,InputLabel as u,RequiredInput as i}from"../index.js";var n=function(n){void 0===n&&(n={}),this.type=t.CUSTOMER_BIRTHDAY,this.value=n.value||null,this.placeholder=n.placeholder||"Enter your birthday",this.inputLabel=n.inputLabel?new u(n.inputLabel):null,this.required=n.required?new i(n.required):null,this.updateCurrentInfo=n.updateCurrentInfo||!1,e(this,{value:r,type:r,placeholder:r,inputLabel:r,required:r,updateCurrentInfo:r})};export{n as CustomerBirthdayFormItem};
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};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as r}from"mobx";import{FormItemTypeEnum as t,InputLabel as u,RequiredInput as i}from"../index.js";var l=function(l){void 0===l&&(l={}),this.type=t.CUSTOMER_EMAIL,this.value=l.value||null,this.placeholder=l.placeholder||"Enter your email",this.inputLabel=l.inputLabel?new u(l.inputLabel):null,this.required=l.required?new i(l.required):null,this.updateCurrentInfo=l.updateCurrentInfo||!1,e(this,{value:r,type:r,placeholder:r,inputLabel:r,required:r,updateCurrentInfo:r})};export{l as CustomerEmailFormItem};
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};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as t}from"mobx";import{FormItemTypeEnum as r,InputLabel as n,RequiredInput as i}from"../index.js";var u,s,l=function(u){void 0===u&&(u={}),this.type=r.CUSTOMER_GENDER,this.placeholder=u.placeholder||"Enter your gender",this.inputLabel=u.inputLabel?new n(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 d(e)})):[],e(this,{type:t,placeholder:t,inputLabel:t,required:t,updateCurrentInfo:t,genders:t})},d=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{l as CustomerGenderFormItem,u as CustomerGenderTypeEnum,d as GenderType};
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};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as r}from"mobx";import{FormItemTypeEnum as t,InputLabel as u,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||"Enter your name",this.inputLabel=a.inputLabel?new u(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};
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};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as t}from"mobx";import{FormItemTypeEnum as r,InputLabel as u,RequiredInput as n}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||"Enter your phone",this.inputLabel=o.inputLabel?new u(o.inputLabel):null,this.required=o.required?new n(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};
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};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as r}from"mobx";import{FormItemTypeEnum as t,InputLabel as u,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||"Enter your surname",this.inputLabel=a.inputLabel?new u(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};
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};
@@ -1 +1 @@
1
- import{makeObservable as i,observable as o}from"mobx";import{IkasPopupRendererFontFamily as t}from"../../base/index.js";var r=function(r){var n,s;void 0===r&&(r={}),this.formInputSettings=r.formInputSettings?new e(r.formInputSettings):new e,this.gapBetweenItems=null!==(n=r.gapBetweenItems)&&void 0!==n?n:12,this.fontFamily=new t(r.fontFamily||{name:"Poppins",variants:["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]}),this.fontSize=null!==(s=r.fontSize)&&void 0!==s?s:14,i(this,{formInputSettings:o,gapBetweenItems:o,fontFamily:o,fontSize:o})},e=function(t){var r,e,n;void 0===t&&(t={}),this.bgColor=t.bgColor||"",this.borderWidth=null!==(r=t.borderWidth)&&void 0!==r?r:1,this.borderRadius=null!==(e=t.borderRadius)&&void 0!==e?e:4,this.borderColor=t.borderColor||"#E3E8EF",this.focusBorderColor=t.focusBorderColor||"#000000",this.height=null!==(n=t.height)&&void 0!==n?n:40,i(this,{bgColor:o,borderWidth:o,borderRadius:o,borderColor:o,focusBorderColor:o,height:o})};export{e as FormInputSettings,r as FormSettings};
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};
@@ -1 +1 @@
1
- import{__extends as t,__assign as e}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as r,observable as o,action as n}from"mobx";import{PopupElementTypeEnum as s,BaseElement as i}from"../base/index.js";import{ButtonElement as m}from"../button/index.js";import{FormSettings as u}from"./form-settings/index.js";import{CustomerNameFormItem as a}from"./customer-name/index.js";import{CustomerSurnameFormItem as d}from"./customer-surname/index.js";import{CustomerEmailFormItem as E}from"./customer-email/index.js";import{CustomerPhoneFormItem as l}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as c}from"./customer-birthday/index.js";import{CustomerGenderFormItem as h}from"./customer-gender/index.js";import{CheckboxFormItem as C}from"./checkbox/index.js";import{CustomerAttributeFormItem as M}from"./customer-attribute/index.js";var p,R;(R=p||(p={})).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 T=function(e){function i(t){void 0===t&&(t={});var i,a,d=this;return(d=e.call(this,t)||this).type=s.FORM,d.rows=t.rows?t.rows.map((function(t){return new f(t)})):[],d.formSettings=t.formSettings||new u,d.buttonSettings=t.buttonSettings||new m({outerHorizontalPadding:0,outerVerticalPadding:0,buttonBgColor:"#000000"}),d.bgColor=t.bgColor||"",d.verticalPadding=null!==(i=t.verticalPadding)&&void 0!==i?i:12,d.horizontalPadding=null!==(a=t.horizontalPadding)&&void 0!==a?a:12,r(d,{rows:o,formSettings:o,buttonSettings:o,bgColor:o,addNewElement:n.bound}),0===d.rows.length&&d.addNewElement(p.CUSTOMER_EMAIL),d}return t(i,e),i.prototype.addNewElement=function(t){var e=new f({order:this.rows.length,columns:[new S({type:t,order:0})]});this.rows.push(e)},i}(i),f=function(){function t(t){void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=t.order||0,this.columns=t.columns?t.columns.map((function(t){return new S(t)})):[],r(this,{id:o,order:o,columns:o,addNewElement:n.bound,changeColumnSort:n.bound})}return t.prototype.addNewElement=function(t){this.columns.push(new S({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}(),S=function(){function t(t){void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=t.order||0,this.type=t.type||p.CUSTOMER_NAME,this.formItem=this.setFormItems(t.formItem),r(this,{id:o,order:o,type:o,formItem:o,setFormItems:n.bound})}return t.prototype.setFormItems=function(t){switch(this.type){case p.CUSTOMER_NAME:return new a(e({},t));case p.CUSTOMER_SURNAME:return new d(e({},t));case p.CUSTOMER_EMAIL:return new E(e({},t));case p.CUSTOMER_PHONE:return new l(e({},t));case p.CUSTOMER_BIRTHDAY:return new c(e({},t));case p.CUSTOMER_GENDER:return new h(e({},t));case p.CHECKBOX_FORM_ITEM:return new C(e({},t));case p.CUSTOMER_ATTRIBUTE:return new M(e({},t))}},t}(),O=function(t){void 0===t&&(t={}),this.text=t.text||"Input Label",r(this,{text:o})},_=function(t){void 0===t&&(t={}),this.validationErrorMessage=t.validationErrorMessage||"It's required to fill this field",this.hasError=t.hasError||!1,r(this,{validationErrorMessage:o,hasError:o})};export{S as FormColumn,T as FormElement,p as FormItemTypeEnum,f as FormRow,O as InputLabel,_ as RequiredInput};
1
+ import{__extends as t,__assign as e}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as r,observable as o,action as n}from"mobx";import{PopupElementTypeEnum as s,BaseElement as i}from"../base/index.js";import{ButtonElement as m}from"../button/index.js";import{FormSettings as a}from"./form-settings/index.js";import{CustomerNameFormItem as u}from"./customer-name/index.js";import{CustomerSurnameFormItem as d}from"./customer-surname/index.js";import{CustomerEmailFormItem as E}from"./customer-email/index.js";import{CustomerPhoneFormItem as l}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as c}from"./customer-birthday/index.js";import{CustomerGenderFormItem as h}from"./customer-gender/index.js";import{CheckboxFormItem as p}from"./checkbox/index.js";import{CustomerAttributeFormItem as C}from"./customer-attribute/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,d,E=this;return(E=e.call(this,t)||this).type=s.FORM,E.rows=t.rows?t.rows.map((function(t){return new T(t)})):[],E.formSettings=t.formSettings||new a,E.buttonSettings=t.buttonSettings||new m({outerHorizontalPadding:0,outerVerticalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),E.bgColor=t.bgColor||"",E.verticalPadding=null!==(u=t.verticalPadding)&&void 0!==u?u:12,E.horizontalPadding=null!==(d=t.horizontalPadding)&&void 0!==d?d:12,r(E,{rows:o,formSettings:o,buttonSettings:o,bgColor:o,addNewElement:n.bound}),0===E.rows.length&&1===i&&E.addNewElement(M.CUSTOMER_EMAIL),E}return t(i,e),i.prototype.addNewElement=function(t){var e=new T({order:this.rows.length,columns:[new S({type:t,order:0})]});this.rows.push(e)},i}(i),T=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 S(t)})):[],r(this,{id:o,order:o,columns:o,addNewElement:n.bound,changeColumnSort:n.bound})}return t.prototype.addNewElement=function(t){this.columns.push(new S({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}(),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.type=t.type||M.CUSTOMER_NAME,this.formItem=this.setFormItems(t.formItem),r(this,{id:o,order:o,type:o,formItem:o,setFormItems:n.bound})}return t.prototype.setFormItems=function(t){switch(this.type){case M.CUSTOMER_NAME:return new u(t?e({},t):{inputLabel:new w({text:"First Name"})});case M.CUSTOMER_SURNAME:return new d(t?e({},t):{inputLabel:new w({text:"Surname"})});case M.CUSTOMER_EMAIL:return new E(t?e({},t):{inputLabel:new w({text:"Email"})});case M.CUSTOMER_PHONE:return new l(t?e({},t):{inputLabel:new w({text:"Phone"})});case M.CUSTOMER_BIRTHDAY:return new c(t?e({},t):{inputLabel:new w({text:"Birthday"})});case M.CUSTOMER_GENDER:return new h(t?e({},t):{inputLabel:new w({text:"Gender"})});case M.CHECKBOX_FORM_ITEM:return new p(e({},t));case M.CUSTOMER_ATTRIBUTE:return new C(e({},t))}},t}(),w=function(t){void 0===t&&(t={}),this.text=t.text||"Label",r(this,{text:o})},O=function(t){void 0===t&&(t={}),this.validationErrorMessage=t.validationErrorMessage||"It's required to fill this field",this.hasError=t.hasError||!1,r(this,{validationErrorMessage:o,hasError:o})},_=function(t){void 0===t&&(t={}),this.text=t.text||"Placeholder",r(this,{text:o})};export{S as FormColumn,f as FormElement,M as FormItemTypeEnum,T as FormRow,w as InputLabel,_ as InputPlaceholder,O as RequiredInput};
@@ -1 +1 @@
1
- import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as e,observable as n,computed as t}from"mobx";import{PopupElementTypeEnum as a,BaseElement as o}from"../base/index.js";var r,d,l=1080;(d=r||(r={})).FLOAT_LEFT="FLOAT_LEFT",d.FLOAT_RIGHT="FLOAT_RIGHT",d.DISABLE_FLOAT="DISABLE_FLOAT";var s=function(o){function d(i){var d,l,s,m,c=this;return(c=o.call(this,i)||this).type=a.IMAGE,c.imagePosition=i.imagePosition||r.DISABLE_FLOAT,c.imageId=i.imageId||null,c.bgColor=i.bgColor||"",c.cdnURL=null,c.merchantId=null,c.link=i.link||null,c.maxWidth=null!==(d=i.maxWidth)&&void 0!==d?d:100,c.verticalPadding=null!==(l=i.verticalPadding)&&void 0!==l?l:24,c.horizontalPadding=null!==(s=i.horizontalPadding)&&void 0!==s?s:24,c.borderRadius=null!==(m=i.borderRadius)&&void 0!==m?m:0,e(c,{imagePosition:n,imageId:n,bgColor:n,cdnURL:n,merchantId:n,link:n,maxWidth:n,borderRadius:n,src:t}),c}return i(d,o),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(1080,".jpeg"):void 0},enumerable:!1,configurable:!0}),d}(o);export{l as IMAGE_SIZE,s as ImageElement,r as ImagePositionEnum};
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};
@@ -1 +1 @@
1
- import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as n,observable as e,computed as t}from"mobx";import{PopupElementTypeEnum as a,BaseElement as o}from"../base/index.js";import{IMAGE_SIZE as m}from"../image/index.js";var r,s;(s=r||(r={})).LEFT_ALIGN="LEFT_ALIGN",s.RIGTH_ALIGN="RIGTH_ALIGN";var l=function(o){function s(i){var m,s,l=this;return(l=o.call(this,i)||this).type=a.IMAGE_COLUMN,l.imagePosition=i.imagePosition||r.RIGTH_ALIGN,l.imageId=i.imageId||null,l.cdnURL=null,l.merchantId=null,l.link=i.link||null,l.verticalPadding=null!==(m=i.verticalPadding)&&void 0!==m?m:24,l.horizontalPadding=null!==(s=i.horizontalPadding)&&void 0!==s?s:24,n(l,{imagePosition:e,imageId:e,cdnURL:e,merchantId:e,link:e,src:t}),l}return i(s,o),Object.defineProperty(s.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}),s}(o);export{l as ImageColumnElement,r as ImageColumnPositionEnum};
1
+ import{__extends as i}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as e,observable as t,computed as n}from"mobx";import{PopupElementTypeEnum as o,BaseElement as a}from"../base/index.js";import{IMAGE_SIZE as m,ImageFitEnum as r}from"../image/index.js";var l,s;(s=l||(l={})).LEFT_ALIGN="LEFT_ALIGN",s.RIGTH_ALIGN="RIGTH_ALIGN";var c=function(a){function s(i){var m,s,c=this;return(c=a.call(this,i)||this).type=o.IMAGE_COLUMN,c.imagePosition=i.imagePosition||l.RIGTH_ALIGN,c.imageId=i.imageId||null,c.bgColor=i.bgColor||"",c.cdnURL=null,c.merchantId=null,c.objectFit=i.objectFit||r.CONTAIN,c.link=i.link||null,c.verticalPadding=null!==(m=i.verticalPadding)&&void 0!==m?m:24,c.horizontalPadding=null!==(s=i.horizontalPadding)&&void 0!==s?s:24,e(c,{imagePosition:t,imageId:t,cdnURL:t,merchantId:t,objectFit:t,link:t,src:n}),c}return i(s,a),Object.defineProperty(s.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}),s}(a);export{c as ImageColumnElement,l as ImageColumnPositionEnum};
@@ -1 +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"}),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};
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};
@@ -1 +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,d=function(e){function c(o){void 0===o&&(o={});var c,l,d,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!==(d=o.verticalPadding)&&void 0!==d?d: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 s(o)})):[new s({type:r.FACEBOOK,order:0,icon:"https://cdn.myikas.dev/social/facebook/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new s({type:r.TWITTER,order:1,icon:"https://cdn.myikas.dev/social/x/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new s({type:r.INSTAGRAM,order:2,icon:"https://cdn.myikas.dev/social/instagram/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new s({type:r.YOUTUBE,order:3,icon:"https://cdn.myikas.dev/social/youtube/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new s({type:r.TIKTOK,order:4,icon:"https://cdn.myikas.dev/social/tiktok/1080/".concat(g.borderRadius,"/").concat(g.bgColor,"/").concat(g.logoColor)}),new s({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),s=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}();(l=r||(r={})).FACEBOOK="FACEBOOK",l.TWITTER="TWITTER",l.INSTAGRAM="INSTAGRAM",l.YOUTUBE="YOUTUBE",l.TIKTOK="TIKTOK",l.LINKEDIN="LINKEDIN";export{d as SocialMediaElement,s as SocialMediaLink,r as SocialMediaTypeEnum};
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};
@@ -1 +1 @@
1
- import{__extends as o}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as i,observable as t}from"mobx";import{PopupElementTypeEnum as r,IkasPopupRendererFontFamily as e,ComponentHorizontalAlignmentEnum as l,BaseElement as n}from"../base/index.js";import{ButtonBorderStyle as a}from"../../../background-settings/index.js";var d=function(n){function d(o){var d,s,u,m,b,c,g,f,h=this;return(h=n.call(this,o)||this).type=r.TEXT,h.text=o.text||"This is a text",h.color=o.color||"#000000",h.bgColor=o.bgColor||"",h.fontFamily=new e(o.fontFamily||{name:"Poppins",variants:["100","100italic","200","200italic","300","300italic","regular","italic","500","500italic","600","600italic","700","700italic","800","800italic","900","900italic"]}),h.fontSize=null!==(d=o.fontSize)&&void 0!==d?d:16,h.fontWeight=null!==(s=o.fontWeight)&&void 0!==s?s:400,h.borderRadius=null!==(u=o.borderRadius)&&void 0!==u?u:4,h.borderColor=o.borderColor||"#000000",h.borderStyle=o.borderStyle||a.SOLID,h.borderWidth=null!==(m=o.borderWidth)&&void 0!==m?m:0,h.verticalPadding=null!==(b=o.verticalPadding)&&void 0!==b?b:12,h.horizontalPadding=null!==(c=o.horizontalPadding)&&void 0!==c?c:12,h.outerHorizontalPadding=null!==(g=o.outerHorizontalPadding)&&void 0!==g?g:0,h.outerVerticalPadding=null!==(f=o.outerVerticalPadding)&&void 0!==f?f:0,h.horizontalAlignment=o.horizontalAlignment||l.LEFT,i(h,{text:t,color:t,bgColor:t,fontFamily:t,fontSize:t,fontWeight:t,borderRadius:t,borderColor:t,borderStyle:t,borderWidth:t}),h}return o(d,n),d}(n);export{d as TextElement};
1
+ import{__extends as o}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as r}from"mobx";import{PopupElementTypeEnum as e,IkasPopupRendererFontFamily as i,ComponentHorizontalAlignmentEnum as n,BaseElement as l}from"../base/index.js";import{ButtonBorderStyle as d}from"../../../background-settings/index.js";var a=function(l){function a(o){var a,s,u,m,b,g,f,h,p=this;return(p=l.call(this,o)||this).type=e.TEXT,p.text=o.text||"This is a text",p.color=o.color||"#000000",p.bgColor=o.bgColor||"",p.fontFamily=new i(o.fontFamily),p.fontSize=null!==(a=o.fontSize)&&void 0!==a?a:16,p.fontWeight=null!==(s=o.fontWeight)&&void 0!==s?s:400,p.borderRadius=null!==(u=o.borderRadius)&&void 0!==u?u:4,p.borderColor=o.borderColor||"#000000",p.borderStyle=o.borderStyle||d.SOLID,p.borderWidth=null!==(m=o.borderWidth)&&void 0!==m?m:0,p.verticalPadding=null!==(b=o.verticalPadding)&&void 0!==b?b:12,p.horizontalPadding=null!==(g=o.horizontalPadding)&&void 0!==g?g:12,p.outerHorizontalPadding=null!==(f=o.outerHorizontalPadding)&&void 0!==f?f:0,p.outerVerticalPadding=null!==(h=o.outerVerticalPadding)&&void 0!==h?h:0,p.horizontalAlignment=o.horizontalAlignment||n.LEFT,t(p,{text:r,color:r,bgColor:r,fontFamily:r,fontSize:r,fontWeight:r,borderRadius:r,borderColor:r,borderStyle:r,borderWidth:r}),p}return o(a,l),a}(l);export{a as TextElement};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as t,action as s}from"mobx";import{TextElement as n}from"./elements/text/index.js";import{FormElement as r}from"./elements/form/index.js";import{ImageElement as m}from"./elements/image/index.js";import{ProductListElement as i}from"./elements/product/index.js";import{ButtonElement as o}from"./elements/button/index.js";import{SocialMediaElement as a}from"./elements/social/index.js";import{DividerElement as l}from"./elements/divider/index.js";import{SpaceElement as u}from"./elements/space/index.js";import{PopupElementTypeEnum as p}from"./elements/base/index.js";import{ImageColumnElement as h}from"./elements/image-column/index.js";var d=function(){function d(r){var m=this;this.id=r.id||Date.now().toString(),this.stepNumber=r.stepNumber||0,this.name=r.name||"",this.isThankYouStep=r.isThankYouStep||!1,this.isTeaser=r.isTeaser||!1,this.elements=r.elements&&r.elements.length?r.elements.map((function(e){return m.setContent(e)})):[],this.isTeaser&&(this.id=this.id+"-teaser"),this.isTeaser&&!this.elements.length&&this.elements.push(new n({order:0})),e(this,{stepNumber:t,name:t,isThankYouStep:t,isTeaser:t,elements:t,setContent:s.bound,addNewElement:s.bound})}return d.prototype.setContent=function(e){switch(e.type){case p.TEXT:return new n(e||{});case p.FORM:return new r(e||{});case p.IMAGE:return new m(e||{});case p.IMAGE_COLUMN:return new h(e||{});case p.PRODUCT_LIST:return new i(e||{});case p.BUTTON:return new o(e||{});case p.SOCIAL_MEDIA:return new a(e||{});case p.DIVIDER:return new l(e||{});case p.SPACE:return new u(e||{})}},d.prototype.addNewElement=function(e){var t=this.elements.length;switch(e){case p.TEXT:this.elements.push(new n({order:t}));break;case p.FORM:this.elements.push(new r({order:t}));break;case p.IMAGE:this.elements.push(new m({order:t}));break;case p.IMAGE_COLUMN:this.elements.push(new h({order:t}));break;case p.PRODUCT_LIST:this.elements.push(new i({order:t}));break;case p.BUTTON:this.elements.push(new o({order:t,buttonBgColor:"#000000"}));break;case p.SOCIAL_MEDIA:this.elements.push(new a({order:t}));break;case p.DIVIDER:this.elements.push(new l({order:t}));break;case p.SPACE:this.elements.push(new u({order:t}))}},d}();export{d as PopupStep};
1
+ import{makeObservable as e,observable as t,action as s}from"mobx";import{TextElement as n}from"./elements/text/index.js";import{FormElement as r}from"./elements/form/index.js";import{ImageElement as m}from"./elements/image/index.js";import{ProductListElement as i}from"./elements/product/index.js";import{ButtonElement as o}from"./elements/button/index.js";import{SocialMediaElement as a}from"./elements/social/index.js";import{DividerElement as l}from"./elements/divider/index.js";import{SpaceElement as u}from"./elements/space/index.js";import{PopupElementTypeEnum as p}from"./elements/base/index.js";import{ImageColumnElement as h}from"./elements/image-column/index.js";var d=function(){function d(r){var m=this;this.id=r.id||Date.now().toString(),this.stepNumber=r.stepNumber||0,this.name=r.name||"",this.isThankYouStep=r.isThankYouStep||!1,this.isTeaser=r.isTeaser||!1,this.elements=r.elements&&r.elements.length?r.elements.map((function(e){return m.setContent(e)})):[],this.isTeaser&&(this.id=this.id+"-teaser"),this.isTeaser&&!this.elements.length&&this.elements.push(new n({order:0})),e(this,{stepNumber:t,name:t,isThankYouStep:t,isTeaser:t,elements:t,setContent:s.bound,addNewElement:s.bound})}return d.prototype.setContent=function(e){switch(e.type){case p.TEXT:return new n(e||{});case p.FORM:return new r(e||{},this.stepNumber);case p.IMAGE:return new m(e||{});case p.IMAGE_COLUMN:return new h(e||{});case p.PRODUCT_LIST:return new i(e||{});case p.BUTTON:return new o(e||{});case p.SOCIAL_MEDIA:return new a(e||{});case p.DIVIDER:return new l(e||{});case p.SPACE:return new u(e||{})}},d.prototype.addNewElement=function(e){var t=this.elements.length;switch(e){case p.TEXT:this.elements.push(new n({order:t}));break;case p.FORM:this.elements.push(new r({order:t},this.stepNumber));break;case p.IMAGE:this.elements.push(new m({order:t}));break;case p.IMAGE_COLUMN:this.elements.push(new h({order:t}));break;case p.PRODUCT_LIST:this.elements.push(new i({order:t}));break;case p.BUTTON:this.elements.push(new o({order:t,buttonBgColor:"#000000",borderColor:"#000000"}));break;case p.SOCIAL_MEDIA:this.elements.push(new a({order:t}));break;case p.DIVIDER:this.elements.push(new l({order:t,borderColor:"#E3E8EF"}));break;case p.SPACE:this.elements.push(new u({order:t}))}},d}();export{d as PopupStep};
@@ -1 +1 @@
1
- import{makeObservable as i,observable as t}from"mobx";import{WindowSettings as s}from"../window-settings/index.js";import{BackgroundSettings as e}from"../background-settings/index.js";import{CloseSettings as n}from"../close-settings/index.js";import{PopupStep as o}from"../step/index.js";import{PopupPositonEnum as _}from"../index.js";var T,S;(S=T||(T={})).VISIBLE_AT_FIRST_AND_AT_THE_END="VISIBLE_AT_FIRST_AND_AT_THE_END",S.VISIBLE_AT_FIRST="VISIBLE_AT_FIRST",S.VISIBLE_AT_THE_END="VISIBLE_AT_THE_END";var r=function(S){this.isActive=S.isActive||null,this.step=S.step?new o(S.step):new o({isTeaser:!0,stepNumber:1,name:"Teaser"}),this.windowSettings=new s(S.windowSettings||{maxHeight:150,maxWidth:350}),this.backgroundSettings=new e(S.backgroundSettings||{}),this.closeSettings=new n(S.closeSettings||{}),this.visibleCondition=S.visibleCondition||T.VISIBLE_AT_FIRST_AND_AT_THE_END,this.position=S.position||_.POPUP_BOTTOM_RIGHT,i(this,{isActive:t,step:t,windowSettings:t,backgroundSettings:t,closeSettings:t,visibleCondition:t,position:t})};export{r as Teaser,T as VisibilityConditionEnum};
1
+ import{makeObservable as i,observable as t}from"mobx";import{WindowSettings as s}from"../window-settings/index.js";import{BackgroundSettings as e}from"../background-settings/index.js";import{CloseSettings as n}from"../close-settings/index.js";import{PopupStep as o}from"../step/index.js";import{PopupPositonEnum as r}from"../index.js";var _,d;(d=_||(_={})).VISIBLE_AT_FIRST_AND_AT_THE_END="VISIBLE_AT_FIRST_AND_AT_THE_END",d.VISIBLE_AT_FIRST="VISIBLE_AT_FIRST",d.VISIBLE_AT_THE_END="VISIBLE_AT_THE_END";var T=function(d){this.isActive=d.isActive||null,this.step=d.step?new o(d.step):new o({isTeaser:!0,stepNumber:1,name:"Teaser"}),this.windowSettings=new s(d.windowSettings||{maxHeight:150,maxWidth:350,borderRadius:4,outerVerticalPadding:12,outerHorizontalPadding:12}),this.backgroundSettings=new e(d.backgroundSettings||{}),this.closeSettings=new n(d.closeSettings||{}),this.visibleCondition=d.visibleCondition||_.VISIBLE_AT_FIRST_AND_AT_THE_END,this.position=d.position||r.POPUP_BOTTOM_RIGHT,i(this,{isActive:t,step:t,windowSettings:t,backgroundSettings:t,closeSettings:t,visibleCondition:t,position:t})};export{T as Teaser,_ as VisibilityConditionEnum};
@@ -1 +1 @@
1
- import{makeObservable as t,observable as i}from"mobx";var a=function(a){this.maxHeight=a.maxHeight||435,this.maxWidth=a.maxWidth||400,this.borderRadius=a.borderRadius||4,this.outerVerticalPadding=a.outerVerticalPadding||12,this.outerHorizontalPadding=a.outerHorizontalPadding||12,this.takeFullHeight=a.takeFullHeight||!1,this.takeFullWidth=a.takeFullWidth||!1,t(this,{maxHeight:i,maxWidth:i,borderRadius:i,outerVerticalPadding:i,outerHorizontalPadding:i,takeFullHeight:i,takeFullWidth:i})};export{a as WindowSettings};
1
+ import{makeObservable as i,observable as t}from"mobx";var d=function(d){var n,a,e,r,l;this.minHeight=d.minHeight||435,this.maxWidth=d.maxWidth||400,this.borderRadius=null!==(n=d.borderRadius)&&void 0!==n?n:0,this.outerVerticalPadding=null!==(a=d.outerVerticalPadding)&&void 0!==a?a:0,this.outerHorizontalPadding=null!==(e=d.outerHorizontalPadding)&&void 0!==e?e:0,this.innerVerticalPadding=null!==(r=d.innerVerticalPadding)&&void 0!==r?r:8,this.innerHorizontalPadding=null!==(l=d.innerHorizontalPadding)&&void 0!==l?l:0,this.takeFullHeight=d.takeFullHeight||!1,this.takeFullWidth=d.takeFullWidth||!1,i(this,{minHeight:t,maxWidth:t,borderRadius:t,outerVerticalPadding:t,outerHorizontalPadding:t,innerVerticalPadding:t,innerHorizontalPadding:t,takeFullHeight:t,takeFullWidth:t})};export{d as WindowSettings};
@@ -1 +1 @@
1
- import{makeObservable as e,observable as o}from"mobx";var t,i;(i=t||(t={})).ON_PAGE_LOAD="ON_PAGE_LOAD",i.ON_PAGE_SCROLL="ON_PAGE_SCROLL",i.BEFORE_PAGE_CLOSE="BEFORE_PAGE_CLOSE";var r=function(i){this.type=i.type||t.ON_PAGE_LOAD,this.afterSeconds=i.afterSeconds||0,this.afterScroll=i.afterScroll||0,this.beforePageClose=i.beforePageClose||0,e(this,{type:o,afterSeconds:o,afterScroll:o,beforePageClose:o})};export{r as VisibilityCondition,t as VisibilityConditionTypeEnum};
1
+ import{makeObservable as e,observable as o}from"mobx";var i,t;(t=i||(i={})).ON_PAGE_LOAD="ON_PAGE_LOAD",t.ON_PAGE_SCROLL="ON_PAGE_SCROLL",t.BEFORE_PAGE_CLOSE="BEFORE_PAGE_CLOSE";var r=function(t){var r,l,s;this.type=t.type||i.ON_PAGE_LOAD,this.afterSeconds=null!==(r=t.afterSeconds)&&void 0!==r?r:0,this.afterScroll=null!==(l=t.afterScroll)&&void 0!==l?l:0,this.beforePageClose=null!==(s=t.beforePageClose)&&void 0!==s?s:0,e(this,{type:o,afterSeconds:o,afterScroll:o,beforePageClose:o})};export{r as VisibilityCondition,i as VisibilityConditionTypeEnum};
@@ -0,0 +1 @@
1
+ import{observable as e,_allowStateReadsStart as r,_allowStateReadsEnd as t,_allowStateChanges as n,createAtom as o,$mobx as i,Reaction as a}from"mobx";import{Component as s,PureComponent as c}from"react";import{observer as l,isUsingStaticRendering as u}from"mobx-react-lite";export{Observer,enableStaticRendering,isUsingStaticRendering,observerBatching,useAsObservableSource,useLocalObservable,useLocalStore,useObserver,useStaticRendering}from"mobx-react-lite";var p=0;var f={};function d(e){return f[e]||(f[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var r="__$mobx-react "+e+" ("+p+")";return p++,r}(e)),f[e]}function h(e,r){if(b(e,r))return!0;if("object"!=typeof e||null===e||"object"!=typeof r||null===r)return!1;var t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(var o=0;o<t.length;o++)if(!Object.hasOwnProperty.call(r,t[o])||!b(e[t[o]],r[t[o]]))return!1;return!0}function b(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function m(e,r,t){Object.hasOwnProperty.call(e,r)?e[r]=t:Object.defineProperty(e,r,{enumerable:!1,configurable:!0,writable:!0,value:t})}var v=d("patchMixins"),y=d("patchedDefinition");function g(e,r){for(var t=this,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];r.locks++;try{var a;return null!=e&&(a=e.apply(this,o)),a}finally{r.locks--,0===r.locks&&r.methods.forEach((function(e){e.apply(t,o)}))}}function w(e,r){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];g.call.apply(g,[this,e,r].concat(n))}}function O(e,r,t){var n=function(e,r){var t=e[v]=e[v]||{},n=t[r]=t[r]||{};return n.locks=n.locks||0,n.methods=n.methods||[],n}(e,r);n.methods.indexOf(t)<0&&n.methods.push(t);var o=Object.getOwnPropertyDescriptor(e,r);if(!o||!o[y]){var i=e[r],a=x(e,r,o?o.enumerable:void 0,n,i);Object.defineProperty(e,r,a)}}function x(e,r,t,n,o){var i,a=w(o,n);return(i={})[y]=!0,i.get=function(){return a},i.set=function(o){if(this===e)a=w(o,n);else{var i=x(this,r,t,n,o);Object.defineProperty(this,r,i)}},i.configurable=!0,i.enumerable=t,i}var j=i||"$mobx",P=d("isMobXReactObserver"),k=d("isUnmounted"),U=d("skipRender"),_=d("isForcingUpdate");function R(e){var r=e.prototype;if(e[P]){var t=S(r);console.warn("The provided component class ("+t+")\n has already been declared as an observer component.")}else e[P]=!0;if(r.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==c)if(r.shouldComponentUpdate){if(r.shouldComponentUpdate!==E)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else r.shouldComponentUpdate=E;M(r,"props"),M(r,"state"),e.contextType&&M(r,"context");var n=r.render;if("function"!=typeof n){var o=S(r);throw new Error("[mobx-react] class component ("+o+") is missing `render` method.\n`observer` requires `render` being a function defined on prototype.\n`render = () => {}` or `render = function() {}` is not supported.")}return r.render=function(){return this.render=u()?n:C.call(this,n),this.render()},O(r,"componentDidMount",(function(){this[k]=!1,this.render[j]||s.prototype.forceUpdate.call(this)})),O(r,"componentWillUnmount",(function(){if(!u()){var e=this.render[j];if(e)e.dispose(),this.render[j]=null;else{var r=S(this);console.warn("The reactive render of an observer class component ("+r+")\n was overridden after MobX attached. This may result in a memory leak if the\n overridden reactive render was not properly disposed.")}this[k]=!0}})),e}function S(e){return e.displayName||e.name||e.constructor&&(e.constructor.displayName||e.constructor.name)||"<component>"}function C(e){var r=this;m(this,U,!1),m(this,_,!1);var t=S(this),o=e.bind(this),i=!1;return function e(){var c;i=!1;var l=null!=(c=e[j])?c:e[j]=function(){var e=new a(t+".render()",(function(){if(!i&&(i=!0,!0!==r[k])){var t=!0;try{m(r,_,!0),r[U]||s.prototype.forceUpdate.call(r),t=!1}finally{m(r,_,!1),t&&(e.dispose(),r.render[j]=null)}}}));return e.reactComponent=r,e}(),u=void 0,p=void 0;if(l.track((function(){try{p=n(!1,o)}catch(e){u=e}})),u)throw u;return p}}function E(e,r){return u()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==r||!h(this.props,e)}function M(e,n){var i=d("reactProp_"+n+"_valueHolder"),a=d("reactProp_"+n+"_atomHolder");function s(){return this[a]||m(this,a,o("reactive "+n)),this[a]}Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){var e=!1;return r&&t&&(e=r(!0)),s.call(this).reportObserved(),r&&t&&t(e),this[i]},set:function(e){this[_]||h(this[i],e)?m(this,i,e):(m(this,i,e),m(this,U,!0),s.call(this).reportChanged(),m(this,U,!1))}})}function T(e){return!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use `observer` on a component that already has `inject`. Please apply `observer` before applying `inject`"),Object.prototype.isPrototypeOf.call(s,e)||Object.prototype.isPrototypeOf.call(c,e)?R(e):l(e)}if(!s)throw new Error("mobx-react requires React to be available");if(!e)throw new Error("mobx-react requires mobx to be available");export{T as observer};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{login as i,socialLogin as o,register as a,refreshToken as s,forgotPassword as d,recoverPassword as u,checkEmail as c,getCustomer as l,saveCustomer as m,getOrders as f,getOrderByEmail as p,listOrderTransactions as v,createOrderRefundRequest as h,subscribeToMarketingNotifications as w,getLastViewedProducts as j,saveLastViewedProducts as x,listOrderRefundSettings as b,sendContactFormToMerchant as g,listFavoriteProducts as L,saveFavoriteProduct as E,isFavoriteProduct as k,createCustomerReview as Q,listCustomerReviews as y,listCustomerReviewSummary as C,listCustomerAttribute as P,activateCustomer as _,resendCustomerActivationMail as R,resendCustomerPhoneVerificationCode as T,validateCustomerPhoneVerificationCode as F,saveCustomerFormData as O}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../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{IkasCustomerAttribute as V}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as z}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as A}from"../../models/data/customer/review/index.js";import{IkasCustomer as I}from"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as M}from"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasLastViewedProduct as S}from"../../models/data/last-viewed-product/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{IkasOrderRefundSettings as q}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as B}from"../../models/data/order/transaction/index.js";import{IkasOrder as D}from"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";var G=function(){function G(){}return G.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s(r)];case 1:return[2,t.sent()]}}))}))},G.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},G.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},G.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},G.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l()];case 1:return t=e.sent(),[2,new n(t.data?new I(t.data):null,t.graphQLErrors)]}}))}))},G.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(r)];case 1:return t=e.sent(),[2,new n(t.data?new I(t.data):null,t.graphQLErrors)]}}))}))},G.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new D(t)})),t.graphQLErrors)]}}))}))},G.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(t.data?new D(t.data):null,t.graphQLErrors)]}}))}))},G.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new B(t)})),t.graphQLErrors)]}}))}))},G.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new D(t.data):null,t.graphQLErrors)]}}))}))},G.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,w(r)];case 1:return[2,t.sent()]}}))}))},G.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new S(t)})),t.graphQLErrors)]}}))}))},G.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,x(r)];case 1:return[2,t.sent()]}}))}))},G.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,b(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new q(t)})),t.graphQLErrors)]}}))}))},G.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,g(r)];case 1:return[2,t.sent()]}}))}))},G.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new M(t)})),t.graphQLErrors)]}}))}))},G.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},G.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,k({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},G.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q(r)];case 1:return t=e.sent(),[2,new n(t.data?new A(t.data):null,t.graphQLErrors)]}}))}))},G.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,y(r({},i))];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new A(t)}))}):null,t.graphQLErrors)]}}))}))},G.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,C(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new z(t)}))}),t.graphQLErrors)]}}))}))},G.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,P()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new V(t)}),t.graphQLErrors))]}}))}))},G.activateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,_(r)];case 1:return[2,t.sent()]}}))}))},G.resendCustomerActivationMail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,R(r)];case 1:return[2,t.sent()]}}))}))},G.resendCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,T(r)];case 1:return[2,t.sent()]}}))}))},G.validateCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,F(r)];case 1:return[2,t.sent()]}}))}))},G.saveCustomerFormData=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,O(r)];case 1:return[2,t.sent()]}}))}))},G}();export{G as default};
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{login as i,socialLogin as o,register as a,refreshToken as s,forgotPassword as d,recoverPassword as u,checkEmail as c,getCustomer as l,saveCustomer as m,getOrders as f,getOrderByEmail as p,listOrderTransactions as v,createOrderRefundRequest as h,subscribeToMarketingNotifications as w,getLastViewedProducts as j,saveLastViewedProducts as x,listOrderRefundSettings as g,sendContactFormToMerchant as b,listFavoriteProducts as L,saveFavoriteProduct as E,isFavoriteProduct as k,createCustomerReview as Q,listCustomerReviews as y,listCustomerReviewSummary as C,listCustomerAttribute as P,activateCustomer as _,resendCustomerActivationMail as R,resendCustomerPhoneVerificationCode as T,validateCustomerPhoneVerificationCode as F,saveCustomerFormData as O}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../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{IkasCustomerAttribute as V}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as z}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as A}from"../../models/data/customer/review/index.js";import{IkasCustomer as I}from"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as M}from"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasLastViewedProduct as S}from"../../models/data/last-viewed-product/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{IkasOrderRefundSettings as q}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as B}from"../../models/data/order/transaction/index.js";import{IkasOrder as D}from"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";var G=function(){function G(){}return G.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(i)];case 1:return t=e.sent(),console.log("res 107",t),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s(r)];case 1:return[2,t.sent()]}}))}))},G.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},G.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},G.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},G.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l()];case 1:return t=e.sent(),[2,new n(t.data?new I(t.data):null,t.graphQLErrors)]}}))}))},G.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(r)];case 1:return t=e.sent(),[2,new n(t.data?new I(t.data):null,t.graphQLErrors)]}}))}))},G.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new D(t)})),t.graphQLErrors)]}}))}))},G.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(t.data?new D(t.data):null,t.graphQLErrors)]}}))}))},G.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new B(t)})),t.graphQLErrors)]}}))}))},G.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new D(t.data):null,t.graphQLErrors)]}}))}))},G.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,w(r)];case 1:return[2,t.sent()]}}))}))},G.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new S(t)})),t.graphQLErrors)]}}))}))},G.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,x(r)];case 1:return[2,t.sent()]}}))}))},G.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new q(t)})),t.graphQLErrors)]}}))}))},G.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,b(r)];case 1:return[2,t.sent()]}}))}))},G.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new M(t)})),t.graphQLErrors)]}}))}))},G.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},G.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,k({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},G.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q(r)];case 1:return t=e.sent(),[2,new n(t.data?new A(t.data):null,t.graphQLErrors)]}}))}))},G.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,y(r({},i))];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new A(t)}))}):null,t.graphQLErrors)]}}))}))},G.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,C(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new z(t)}))}),t.graphQLErrors)]}}))}))},G.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,P()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new V(t)}),t.graphQLErrors))]}}))}))},G.activateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,_(r)];case 1:return[2,t.sent()]}}))}))},G.resendCustomerActivationMail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,R(r)];case 1:return[2,t.sent()]}}))}))},G.resendCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,T(r)];case 1:return[2,t.sent()]}}))}))},G.validateCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,F(r)];case 1:return[2,t.sent()]}}))}))},G.saveCustomerFormData=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,O(r)];case 1:return[2,t.sent()]}}))}))},G}();export{G as default};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as i}from"mobx";import s from"lodash/xorBy";import o from"lodash/cloneDeep";import n from"./api.js";import{IkasCustomer as a}from"../../models/data/customer/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCustomerEmailSubscriptionStatus as c}from"@ikas/storefront-models";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-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import{IkasRaffleParticipant as u}from"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import d from"../raffle/index.js";import'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import l from"../product/index.js";import{Analytics as h}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{IkasLoginError as p,IkasRegisterError as f,SaveMyCustomerInput as v}from"@ikas/storefront-api";import{populateRaffleParticipantProducts as g}from"@ikas/storefront-providers";import w from"../checkout/index.js";var k="undefined"==typeof localStorage,b=function(){function b(s){var a=this;this.customer=null,this.token=null,this.tokenExpiry=null,this.baseStore=null,this._initialized=!1,this._visitorSubscribedEmail=!1,this._lastViewedProducts=[],this._customerConsentGranted=!1,this._refundSettings=null,this._captchaToken=null,this._savedLastViewedProducts=[],this._savedLastViewedProductsResponse=null,this.toAnalyticsCustomer=function(t){return r(r({},t),{consentGranted:a._customerConsentGranted})},this.login=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:r,password:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(s=t.data,this.setToken(s.token,s.tokenExpiry),s.customer&&this.setCustomer(s.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,!0]):[2,!1]}}))}))},this.customerLogin=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:r,password:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(s=t.data,this.setToken(s.token,s.tokenExpiry),s.customer&&this.setCustomer(s.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:t.errorCodes.map((function(t){return Object.values(p).includes(t)?t:p.UNKOWN}))}]}}))}))},this.logout=function(){var t;a.clearLocalData(),null===(t=a.baseStore)||void 0===t||t.cartStore.removeCart(),h.customerLogout()},this.register=function(r,i,s,o,c,u,d){return t(a,void 0,void 0,(function(){var t,a;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.register({email:s,password:o,firstName:r,lastName:i,isAcceptMarketing:c,attributes:u,captchaToken:this._captchaToken,phone:d})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&(null===(a=t.data)||void 0===a?void 0:a.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.saveLocalLastViewedProducts(),h.completeRegistration(this.toAnalyticsCustomer(this.customer)),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:t.errorCodes.map((function(t){return Object.values(f).includes(t)?t:f.UNKOWN}))}]}}))}))},this.activateCustomer=function(){return t(a,void 0,void 0,(function(){var t,r,i;return e(this,(function(e){switch(e.label){case 0:return t=new URLSearchParams(window.location.search),(r=t.get("token"))?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.activateCustomer({token:r,captchaToken:this._captchaToken})];case 2:return i=e.sent(),this.clearCaptchaToken(),[2,i.isSuccess];case 3:return[2,!1]}}))}))},this.resendCustomerActivationMail=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.resendCustomerActivationMail({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess];case 3:return[2,!1]}}))}))},this.validateCustomerPhoneVerificationCode=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.validateCustomerPhoneVerificationCode({verificationCode:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!(!t.isSuccess||!t.data)&&t.data];case 3:return[2,!1]}}))}))},this.resendCustomerPhoneVerificationCode=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.resendCustomerPhoneVerificationCode({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!(!t.isSuccess||!t.data)&&t.data];case 3:return[2,!1]}}))}))},this.saveContactForm=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return h.contactForm(i),[4,this.getCaptcha()];case 1:return e.sent(),[4,n.sendContactFormToMerchant(r(r({},i),{captchaToken:this._captchaToken}))];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.checkEmail=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.checkEmail({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&!!(null===(i=t.data)||void 0===i?void 0:i.exists)]}}))}))},this.forgotPassword=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.forgotPassword({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&t.data]}}))}))},this.recoverPassword=function(r,i,s){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.recoverPassword({password:r,passwordAgain:i,token:s,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.saveCustomer=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.saveCustomer({input:new v(r)})];case 1:return(t=e.sent()).isSuccess&&t.data?(this.setCustomer(t.data),[2,!0]):[2,!1]}}))}))},this.getOrders=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.getOrders({})];case 1:return[2,t.sent().data||[]]}}))}))},this.getOrder=function(r){return t(a,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrders({orderId:r})];case 1:return(t=e.sent()).isSuccess&&(null===(s=t.data)||void 0===s?void 0:s.length)?(i=t.data[0],[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),i.refundSettings=this._refundSettings,[2,i]}}))}))},this.getOrderByEmail=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrderByEmail({email:r,orderNumber:i})];case 1:return(t=e.sent()).isSuccess&&t.data?(s=t.data,[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),s.refundSettings=this._refundSettings,[2,s]}}))}))},this.getOrderTransactions=function(r){return void 0===r&&(r={}),t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.listOrderTransactions({checkoutId:{eq:r.checkoutId},id:{eq:r.checkoutId},orderId:{eq:r.orderId}})];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProductsIds=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProducts=function(){return t(a,void 0,void 0,(function(){var t,r,i,s,o,a;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return(t=e.sent()).isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?[4,l.searchProducts({input:{productIdList:t.data.map((function(t){return t.productId})),priceListId:m.getPriceListId(),salesChannelId:m.getSalesChannelId()}})]:[2,[]];case 2:return r=e.sent(),null===(o=null===(s=r.data)||void 0===s?void 0:s.data)||void 0===o||o.forEach((function(t){t.selectedVariantValues=t.variants[0].variantValues})),[2,(null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||[]]}}))}))},this.addProductToFavorites=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!0,productId:r})];case 1:return t=e.sent(),h.addToWishlist(r),[2,t.data||!1]}}))}))},this.removeProductFromFavorites=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!1,productId:r})];case 1:return t=e.sent(),h.addToWishlist(r,!0),[2,t.data||!1]}}))}))},this.isProductFavorite=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(t=this.customer)||void 0===t?void 0:t.id))throw Error("Unauthorized");return[4,n.isFavoriteProduct({productId:r})];case 1:return[2,e.sent().data||!1]}}))}))},this.createEmailSubscription=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.subscribeToMarketingNotifications({input:{email:r,captchaToken:this._captchaToken}})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(r)),[2,t.isSuccess]}}))}))},this.saveCustomerFormData=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.saveCustomerFormData({input:r(r({},i),{captchaToken:this._captchaToken})})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(i.email)),[2,t.isSuccess]}}))}))},this.sendReview=function(i){return t(a,void 0,void 0,(function(){var t,s,o,a,c;return e(this,(function(e){switch(e.label){case 0:if(t=m.getCustomerReviewSettings(),s=m.getSalesChannelId(),o=m.getCurrentLocale(),!t)return[2];if(!(a=null===(c=this.customer)||void 0===c?void 0:c.id)&&t.customerLoginRequired)throw Error("Unauthorized");return[4,n.createCustomerReview({input:r(r({},i),{customerId:t.customerLoginRequired?a:void 0,salesChannelId:s||"",locale:o})})];case 1:return[2,e.sent().data]}}))}))},this.onCustomerConsentGrant=function(){a.saveCustomerConsent()},this.waitUntilInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a.initialized&&(clearInterval(e),t(null))}),100)}))},this.waitUntilCaptchaTokenInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a._captchaToken&&(clearInterval(e),t(null))}),100)}))},this.getRaffles=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,d.listRaffleParticipants()];case 1:return(t=e.sent())&&t.data?[4,g(t.data)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2,null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new u(t)}))]}}))}))},this.getCustomerAttributes=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,n.listCustomerAttribute()];case 1:return t=e.sent(),this.customer&&(null===(r=this.customer.attributes)||void 0===r||r.forEach((function(e){var r,i,s;e.customerAttribute=(null===(r=t.data)||void 0===r?void 0:r.find((function(t){return t.id===e.customerAttributeId})))||null,e.customerAttributeOptionId&&(e.customerAttributeOption=(null===(s=null===(i=e.customerAttribute)||void 0===i?void 0:i.options)||void 0===s?void 0:s.find((function(t){return t.id===e.customerAttributeOptionId})))||null)}))),[2,t.data||[]]}}))}))},this.getOrderProductFiles=function(r){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return r.length?[4,w.listProductFile({id:{in:r}})]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getDigitalProductFileDownloadUrl=function(r,i){return t(a,void 0,void 0,(function(){var t,s,o,n,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),(t=r.orderLineItems.find((function(t){return t.variant.id===i.variantId})))?[4,w.getDigitalProductFileDownloadUrl({orderId:r.id,orderLineItemId:t.id})]:[3,2];case 1:s=e.sent(),(o=s.data)&&((n=document.createElement("a")).href=o,n.download=decodeURIComponent(i.name.split("/")[i.name.split("/").length-1])||"",n.click(),n.remove()),e.label=2;case 2:return[3,4];case 3:return a=e.sent(),console.error(a),[3,4];case 4:return[2]}}))}))},this.getOrderRefundSettings=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return this._refundSettings?[3,2]:[4,n.listOrderRefundSettings({})];case 1:(t=e.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)&&(this._refundSettings=t.data[0]),e.label=2;case 2:return[2]}}))}))},this.setSavedLastViewedProductsResponse=function(t){a._savedLastViewedProducts=o(a._lastViewedProducts),a._savedLastViewedProductsResponse=t},this.setCaptchaToken=function(t){a._captchaToken=t},this.baseStore=s,i(this)}return Object.defineProperty(b.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"canCreateEmailSubscription",{get:function(){var t;return!((null===(t=this.customer)||void 0===t?void 0:t.isSubscribed)||k||this._visitorSubscribedEmail)&&!window.localStorage.getItem("customerEmailSubscription")},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"customerConsentGranted",{get:function(){return this._customerConsentGranted},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isCaptchaRequired",{get:function(){var t;return(null===(t=m.getCustomerSettings())||void 0===t?void 0:t.requireCaptchaValidation)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"useLastViewedProductResponse",{get:function(){var t;return(null===(t=this._savedLastViewedProducts)||void 0===t?void 0:t.length)&&this._savedLastViewedProductsResponse&&0===s(this._lastViewedProducts,this._savedLastViewedProducts,"productId").length},enumerable:!1,configurable:!0}),b.prototype.socialLogin=function(r){return t(this,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return"undefined"==typeof window?[2]:(t=new URLSearchParams(window.location.search).get("redirect")||"",i="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/ms/").concat(r,"/login/authenticate?redirect=").concat(t),[4,fetch(i,{headers:{"x-api-key":m.getApiKey()||"","x-sfid":m.getStorefrontId()||"","x-sfrid":m.getStorefrontRoutingId()||""}})]);case 1:return[4,e.sent().json()];case 2:return s=e.sent(),window.location.href=s.redirectUrl,[2]}}))}))},b.prototype.socialLoginToken=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.socialLogin({code:r})];case 1:return(null==(t=e.sent())?void 0:t.isSuccess)&&(null===(i=t.data)||void 0===i?void 0:i.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.customer&&h.customerLogin(),[2,!0]):[2,!1]}}))}))},b.prototype.refundOrder=function(r,i){return t(this,void 0,void 0,(function(){var t,s,o=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=[],r.orderLineItems.map((function(e){null!==e.refundQuantity&&(null==t||t.push({orderLineItemId:e.id,quantity:e.refundQuantity?e.refundQuantity:0}))})),[4,n.createOrderRefundRequest({input:{email:i,orderId:r.id,orderLineItems:t}})];case 1:return(s=e.sent()).isSuccess&&s.data?(Object.entries(s.data).forEach((function(t){var e=t[0],r=t[1];o[e]=r})),[2,!0]):[3,3];case 2:return e.sent(),[3,3];case 3:return[2,!1]}}))}))},b.prototype.init=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.loadToken(),this.loadLastViewedProducts(),this.loadCustomerConsent(),[4,this.refreshToken()];case 1:return t.sent(),[4,this.getCustomer()];case 2:return t.sent(),this._initialized=!0,this.customer&&h.customerVisit(),[2]}}))}))},b.prototype.routeChangeInit=function(){this.loadToken(),!this.token&&this.customer&&this.clearLocalData(),this.token&&!this.customer&&this.getCustomer()},b.prototype.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return k||!this.token?[2]:[4,n.getCustomer()];case 1:return(t=e.sent()).data&&this.setCustomer(t.data),[2]}}))}))},b.prototype.refreshToken=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.token?[4,n.refreshToken({token:this.token})]:[2];case 1:return(t=e.sent()).isSuccess&&t.data?this.setToken(t.data.token,t.data.tokenExpiry):(this.token=null,this.tokenExpiry=null,this.clearLocalData()),[2]}}))}))},b.prototype.setCustomer=function(t){this.customer=new a(t)},b.prototype.getLastViewedProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.getLastViewedProducts({customerId:this.customer.id})]:[3,2];case 1:return t=e.sent(),this._lastViewedProducts=(null===(r=o(t.data))||void 0===r?void 0:r.reverse())||[],[3,3];case 2:this.loadLastViewedProducts(),e.label=3;case 3:return[2,this._lastViewedProducts]}}))}))},b.prototype.saveLastViewedProducts=function(){k||window.localStorage.setItem("lastViewedProducts",JSON.stringify(this._lastViewedProducts))},b.prototype.loadLastViewedProducts=function(){k||(this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=o(this._lastViewedProducts).reverse())},b.prototype.getLocalLastViewedProducts=function(){if(k)return[];try{var t=window.localStorage.getItem("lastViewedProducts");if(t)return JSON.parse(t)}catch(t){}return[]},b.prototype.removeLastViewedProducts=function(){k||window.localStorage.removeItem("lastViewedProducts")},b.prototype.onProductView=function(r,i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?this._lastViewedProducts.find((function(t){return t.productId===r}))?[2]:[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:[{productId:r,variantId:i}]}})]:[3,2];case 1:return t.sent()&&this._lastViewedProducts.push({productId:r,variantId:i}),[3,3];case 2:this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=this._lastViewedProducts.filter((function(t){return t.productId!==r})),this._lastViewedProducts.push({productId:r,variantId:i}),this._lastViewedProducts=this._lastViewedProducts.slice(-20),this.saveLastViewedProducts(),t.label=3;case 3:return[2]}}))}))},b.prototype.saveLocalLastViewedProducts=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(k)return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),(t=this.getLocalLastViewedProducts()).length?[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:t}})]:[3,3];case 2:e.sent()&&this.removeLastViewedProducts(),e.label=3;case 3:return[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},b.prototype.saveCustomerConsent=function(){k||(this._customerConsentGranted=!0,window.localStorage.setItem("customerConsent","true"))},b.prototype.loadCustomerConsent=function(){k||(this._customerConsentGranted=!!window.localStorage.getItem("customerConsent"))},b.prototype.removeCustomerConsent=function(){k||window.localStorage.removeItem("customerConsent")},b.prototype.setToken=function(t,e){k||(this.token=t,this.tokenExpiry=e,localStorage.setItem("customerToken",t),localStorage.setItem("customerTokenExpiry",e+""),m.init({customerToken:t}))},b.prototype.loadToken=function(){if(!k){var t=localStorage.getItem("customerToken"),e=localStorage.getItem("customerTokenExpiry");t&&e?this.setToken(t,parseInt(e)):this.clearLocalTokenData()}},b.prototype.clearLocalTokenData=function(){localStorage.removeItem("customerToken"),localStorage.removeItem("customerTokenExpiry"),this.token=void 0,this.tokenExpiry=void 0},b.prototype.clearLocalData=function(){this.clearLocalTokenData(),this.customer=void 0,m.init({customerToken:""}),this.clearCaptchaToken()},b.prototype.clearCaptchaToken=function(){this._captchaToken=null},b.prototype.getCaptcha=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.isCaptchaRequired?(window.grecaptcha.execute(),[4,this.waitUntilCaptchaTokenInitialized()]):[3,2];case 1:e.sent(),window.grecaptcha.reset(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.log("Get captcha error",t),[3,4];case 4:return[2]}}))}))},b}();export{b as IkasCustomerStore};
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as i}from"mobx";import s from"lodash/xorBy";import o from"lodash/cloneDeep";import n from"./api.js";import{IkasCustomer as a}from"../../models/data/customer/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCustomerEmailSubscriptionStatus as c}from"@ikas/storefront-models";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-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import{IkasRaffleParticipant as u}from"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import d from"../raffle/index.js";import'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import l from"../product/index.js";import{Analytics as h}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{IkasLoginError as p,IkasRegisterError as f,SaveMyCustomerInput as v}from"@ikas/storefront-api";import{populateRaffleParticipantProducts as g}from"@ikas/storefront-providers";import w from"../checkout/index.js";var k="undefined"==typeof localStorage,b=function(){function b(s){var a=this;this.customer=null,this.token=null,this.tokenExpiry=null,this.baseStore=null,this._initialized=!1,this._visitorSubscribedEmail=!1,this._lastViewedProducts=[],this._customerConsentGranted=!1,this._refundSettings=null,this._captchaToken=null,this._savedLastViewedProducts=[],this._savedLastViewedProductsResponse=null,this.toAnalyticsCustomer=function(t){return r(r({},t),{consentGranted:a._customerConsentGranted})},this.login=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:r,password:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(s=t.data,this.setToken(s.token,s.tokenExpiry),s.customer&&this.setCustomer(s.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,!0]):[2,!1]}}))}))},this.customerLogin=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:r,password:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(s=t.data,this.setToken(s.token,s.tokenExpiry),s.customer&&this.setCustomer(s.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:t.errorCodes.map((function(t){return Object.values(p).includes(t)?t:p.UNKOWN}))}]}}))}))},this.logout=function(){var t;a.clearLocalData(),null===(t=a.baseStore)||void 0===t||t.cartStore.removeCart(),h.customerLogout()},this.register=function(r,i,s,o,c,u,d){return t(a,void 0,void 0,(function(){var t,a;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.register({email:s,password:o,firstName:r,lastName:i,isAcceptMarketing:c,attributes:u,captchaToken:this._captchaToken,phone:d})];case 2:return t=e.sent(),console.log("response 1",t),this.clearCaptchaToken(),console.log("response 2",t),t&&t.isSuccess&&(null===(a=t.data)||void 0===a?void 0:a.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.saveLocalLastViewedProducts(),h.completeRegistration(this.toAnalyticsCustomer(this.customer)),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:t.errorCodes.map((function(t){return Object.values(f).includes(t)?t:f.UNKOWN}))}]}}))}))},this.activateCustomer=function(){return t(a,void 0,void 0,(function(){var t,r,i;return e(this,(function(e){switch(e.label){case 0:return t=new URLSearchParams(window.location.search),(r=t.get("token"))?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.activateCustomer({token:r,captchaToken:this._captchaToken})];case 2:return i=e.sent(),this.clearCaptchaToken(),[2,i.isSuccess];case 3:return[2,!1]}}))}))},this.resendCustomerActivationMail=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.resendCustomerActivationMail({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess];case 3:return[2,!1]}}))}))},this.validateCustomerPhoneVerificationCode=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.validateCustomerPhoneVerificationCode({verificationCode:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!(!t.isSuccess||!t.data)&&t.data];case 3:return[2,!1]}}))}))},this.resendCustomerPhoneVerificationCode=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.resendCustomerPhoneVerificationCode({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!(!t.isSuccess||!t.data)&&t.data];case 3:return[2,!1]}}))}))},this.saveContactForm=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return h.contactForm(i),[4,this.getCaptcha()];case 1:return e.sent(),[4,n.sendContactFormToMerchant(r(r({},i),{captchaToken:this._captchaToken}))];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.checkEmail=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.checkEmail({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&!!(null===(i=t.data)||void 0===i?void 0:i.exists)]}}))}))},this.forgotPassword=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.forgotPassword({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&t.data]}}))}))},this.recoverPassword=function(r,i,s){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.recoverPassword({password:r,passwordAgain:i,token:s,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.saveCustomer=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.saveCustomer({input:new v(r)})];case 1:return(t=e.sent()).isSuccess&&t.data?(this.setCustomer(t.data),[2,!0]):[2,!1]}}))}))},this.getOrders=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.getOrders({})];case 1:return[2,t.sent().data||[]]}}))}))},this.getOrder=function(r){return t(a,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrders({orderId:r})];case 1:return(t=e.sent()).isSuccess&&(null===(s=t.data)||void 0===s?void 0:s.length)?(i=t.data[0],[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),i.refundSettings=this._refundSettings,[2,i]}}))}))},this.getOrderByEmail=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrderByEmail({email:r,orderNumber:i})];case 1:return(t=e.sent()).isSuccess&&t.data?(s=t.data,[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),s.refundSettings=this._refundSettings,[2,s]}}))}))},this.getOrderTransactions=function(r){return void 0===r&&(r={}),t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.listOrderTransactions({checkoutId:{eq:r.checkoutId},id:{eq:r.checkoutId},orderId:{eq:r.orderId}})];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProductsIds=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProducts=function(){return t(a,void 0,void 0,(function(){var t,r,i,s,o,a;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return(t=e.sent()).isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?[4,l.searchProducts({input:{productIdList:t.data.map((function(t){return t.productId})),priceListId:m.getPriceListId(),salesChannelId:m.getSalesChannelId()}})]:[2,[]];case 2:return r=e.sent(),null===(o=null===(s=r.data)||void 0===s?void 0:s.data)||void 0===o||o.forEach((function(t){t.selectedVariantValues=t.variants[0].variantValues})),[2,(null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||[]]}}))}))},this.addProductToFavorites=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!0,productId:r})];case 1:return t=e.sent(),h.addToWishlist(r),[2,t.data||!1]}}))}))},this.removeProductFromFavorites=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!1,productId:r})];case 1:return t=e.sent(),h.addToWishlist(r,!0),[2,t.data||!1]}}))}))},this.isProductFavorite=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(t=this.customer)||void 0===t?void 0:t.id))throw Error("Unauthorized");return[4,n.isFavoriteProduct({productId:r})];case 1:return[2,e.sent().data||!1]}}))}))},this.createEmailSubscription=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.subscribeToMarketingNotifications({input:{email:r,captchaToken:this._captchaToken}})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(r)),[2,t.isSuccess]}}))}))},this.saveCustomerFormData=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.saveCustomerFormData({input:r(r({},i),{captchaToken:this._captchaToken})})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(i.email)),[2,t.isSuccess]}}))}))},this.sendReview=function(i){return t(a,void 0,void 0,(function(){var t,s,o,a,c;return e(this,(function(e){switch(e.label){case 0:if(t=m.getCustomerReviewSettings(),s=m.getSalesChannelId(),o=m.getCurrentLocale(),!t)return[2];if(!(a=null===(c=this.customer)||void 0===c?void 0:c.id)&&t.customerLoginRequired)throw Error("Unauthorized");return[4,n.createCustomerReview({input:r(r({},i),{customerId:t.customerLoginRequired?a:void 0,salesChannelId:s||"",locale:o})})];case 1:return[2,e.sent().data]}}))}))},this.onCustomerConsentGrant=function(){a.saveCustomerConsent()},this.waitUntilInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a.initialized&&(clearInterval(e),t(null))}),100)}))},this.waitUntilCaptchaTokenInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a._captchaToken&&(clearInterval(e),t(null))}),100)}))},this.getRaffles=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,d.listRaffleParticipants()];case 1:return(t=e.sent())&&t.data?[4,g(t.data)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2,null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new u(t)}))]}}))}))},this.getCustomerAttributes=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,n.listCustomerAttribute()];case 1:return t=e.sent(),this.customer&&(null===(r=this.customer.attributes)||void 0===r||r.forEach((function(e){var r,i,s;e.customerAttribute=(null===(r=t.data)||void 0===r?void 0:r.find((function(t){return t.id===e.customerAttributeId})))||null,e.customerAttributeOptionId&&(e.customerAttributeOption=(null===(s=null===(i=e.customerAttribute)||void 0===i?void 0:i.options)||void 0===s?void 0:s.find((function(t){return t.id===e.customerAttributeOptionId})))||null)}))),[2,t.data||[]]}}))}))},this.getOrderProductFiles=function(r){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return r.length?[4,w.listProductFile({id:{in:r}})]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getDigitalProductFileDownloadUrl=function(r,i){return t(a,void 0,void 0,(function(){var t,s,o,n,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),(t=r.orderLineItems.find((function(t){return t.variant.id===i.variantId})))?[4,w.getDigitalProductFileDownloadUrl({orderId:r.id,orderLineItemId:t.id})]:[3,2];case 1:s=e.sent(),(o=s.data)&&((n=document.createElement("a")).href=o,n.download=decodeURIComponent(i.name.split("/")[i.name.split("/").length-1])||"",n.click(),n.remove()),e.label=2;case 2:return[3,4];case 3:return a=e.sent(),console.error(a),[3,4];case 4:return[2]}}))}))},this.getOrderRefundSettings=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return this._refundSettings?[3,2]:[4,n.listOrderRefundSettings({})];case 1:(t=e.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)&&(this._refundSettings=t.data[0]),e.label=2;case 2:return[2]}}))}))},this.setSavedLastViewedProductsResponse=function(t){a._savedLastViewedProducts=o(a._lastViewedProducts),a._savedLastViewedProductsResponse=t},this.setCaptchaToken=function(t){a._captchaToken=t},this.baseStore=s,i(this)}return Object.defineProperty(b.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"canCreateEmailSubscription",{get:function(){var t;return!((null===(t=this.customer)||void 0===t?void 0:t.isSubscribed)||k||this._visitorSubscribedEmail)&&!window.localStorage.getItem("customerEmailSubscription")},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"customerConsentGranted",{get:function(){return this._customerConsentGranted},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isCaptchaRequired",{get:function(){var t;return(null===(t=m.getCustomerSettings())||void 0===t?void 0:t.requireCaptchaValidation)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"useLastViewedProductResponse",{get:function(){var t;return(null===(t=this._savedLastViewedProducts)||void 0===t?void 0:t.length)&&this._savedLastViewedProductsResponse&&0===s(this._lastViewedProducts,this._savedLastViewedProducts,"productId").length},enumerable:!1,configurable:!0}),b.prototype.socialLogin=function(r){return t(this,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return"undefined"==typeof window?[2]:(t=new URLSearchParams(window.location.search).get("redirect")||"",i="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/ms/").concat(r,"/login/authenticate?redirect=").concat(t),[4,fetch(i,{headers:{"x-api-key":m.getApiKey()||"","x-sfid":m.getStorefrontId()||"","x-sfrid":m.getStorefrontRoutingId()||""}})]);case 1:return[4,e.sent().json()];case 2:return s=e.sent(),window.location.href=s.redirectUrl,[2]}}))}))},b.prototype.socialLoginToken=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.socialLogin({code:r})];case 1:return(null==(t=e.sent())?void 0:t.isSuccess)&&(null===(i=t.data)||void 0===i?void 0:i.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.customer&&h.customerLogin(),[2,!0]):[2,!1]}}))}))},b.prototype.refundOrder=function(r,i){return t(this,void 0,void 0,(function(){var t,s,o=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=[],r.orderLineItems.map((function(e){null!==e.refundQuantity&&(null==t||t.push({orderLineItemId:e.id,quantity:e.refundQuantity?e.refundQuantity:0}))})),[4,n.createOrderRefundRequest({input:{email:i,orderId:r.id,orderLineItems:t}})];case 1:return(s=e.sent()).isSuccess&&s.data?(Object.entries(s.data).forEach((function(t){var e=t[0],r=t[1];o[e]=r})),[2,!0]):[3,3];case 2:return e.sent(),[3,3];case 3:return[2,!1]}}))}))},b.prototype.init=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.loadToken(),this.loadLastViewedProducts(),this.loadCustomerConsent(),[4,this.refreshToken()];case 1:return t.sent(),[4,this.getCustomer()];case 2:return t.sent(),this._initialized=!0,this.customer&&h.customerVisit(),[2]}}))}))},b.prototype.routeChangeInit=function(){this.loadToken(),!this.token&&this.customer&&this.clearLocalData(),this.token&&!this.customer&&this.getCustomer()},b.prototype.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return k||!this.token?[2]:[4,n.getCustomer()];case 1:return(t=e.sent()).data&&this.setCustomer(t.data),[2]}}))}))},b.prototype.refreshToken=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.token?[4,n.refreshToken({token:this.token})]:[2];case 1:return(t=e.sent()).isSuccess&&t.data?this.setToken(t.data.token,t.data.tokenExpiry):(this.token=null,this.tokenExpiry=null,this.clearLocalData()),[2]}}))}))},b.prototype.setCustomer=function(t){this.customer=new a(t)},b.prototype.getLastViewedProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.getLastViewedProducts({customerId:this.customer.id})]:[3,2];case 1:return t=e.sent(),this._lastViewedProducts=(null===(r=o(t.data))||void 0===r?void 0:r.reverse())||[],[3,3];case 2:this.loadLastViewedProducts(),e.label=3;case 3:return[2,this._lastViewedProducts]}}))}))},b.prototype.saveLastViewedProducts=function(){k||window.localStorage.setItem("lastViewedProducts",JSON.stringify(this._lastViewedProducts))},b.prototype.loadLastViewedProducts=function(){k||(this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=o(this._lastViewedProducts).reverse())},b.prototype.getLocalLastViewedProducts=function(){if(k)return[];try{var t=window.localStorage.getItem("lastViewedProducts");if(t)return JSON.parse(t)}catch(t){}return[]},b.prototype.removeLastViewedProducts=function(){k||window.localStorage.removeItem("lastViewedProducts")},b.prototype.onProductView=function(r,i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?this._lastViewedProducts.find((function(t){return t.productId===r}))?[2]:[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:[{productId:r,variantId:i}]}})]:[3,2];case 1:return t.sent()&&this._lastViewedProducts.push({productId:r,variantId:i}),[3,3];case 2:this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=this._lastViewedProducts.filter((function(t){return t.productId!==r})),this._lastViewedProducts.push({productId:r,variantId:i}),this._lastViewedProducts=this._lastViewedProducts.slice(-20),this.saveLastViewedProducts(),t.label=3;case 3:return[2]}}))}))},b.prototype.saveLocalLastViewedProducts=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(k)return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),(t=this.getLocalLastViewedProducts()).length?[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:t}})]:[3,3];case 2:e.sent()&&this.removeLastViewedProducts(),e.label=3;case 3:return[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},b.prototype.saveCustomerConsent=function(){k||(this._customerConsentGranted=!0,window.localStorage.setItem("customerConsent","true"))},b.prototype.loadCustomerConsent=function(){k||(this._customerConsentGranted=!!window.localStorage.getItem("customerConsent"))},b.prototype.removeCustomerConsent=function(){k||window.localStorage.removeItem("customerConsent")},b.prototype.setToken=function(t,e){k||(this.token=t,this.tokenExpiry=e,localStorage.setItem("customerToken",t),localStorage.setItem("customerTokenExpiry",e+""),m.init({customerToken:t}))},b.prototype.loadToken=function(){if(!k){var t=localStorage.getItem("customerToken"),e=localStorage.getItem("customerTokenExpiry");t&&e?this.setToken(t,parseInt(e)):this.clearLocalTokenData()}},b.prototype.clearLocalTokenData=function(){localStorage.removeItem("customerToken"),localStorage.removeItem("customerTokenExpiry"),this.token=void 0,this.tokenExpiry=void 0},b.prototype.clearLocalData=function(){this.clearLocalTokenData(),this.customer=void 0,m.init({customerToken:""}),this.clearCaptchaToken()},b.prototype.clearCaptchaToken=function(){this._captchaToken=null},b.prototype.getCaptcha=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.isCaptchaRequired?(window.grecaptcha.execute(),[4,this.waitUntilCaptchaTokenInitialized()]):[3,2];case 1:e.sent(),window.grecaptcha.reset(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.log("Get captcha error",t),[3,4];case 4:return[2]}}))}))},b}();export{b as IkasCustomerStore};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.15.0-beta.86",
3
+ "version": "4.15.0-beta.88",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -17,15 +17,15 @@
17
17
  "build": "rm -rf build && rollup -c"
18
18
  },
19
19
  "dependencies": {
20
- "@ikas/popup-renderer": "^1.0.61",
20
+ "@ikas/popup-renderer": "^1.0.80",
21
21
  "swiper": "11.0.6"
22
22
  },
23
23
  "devDependencies": {
24
- "@ikas/storefront-api": "^4.15.0-beta.86",
25
- "@ikas/storefront-config": "^4.15.0-beta.86",
26
- "@ikas/storefront-model-functions": "^4.15.0-beta.86",
27
- "@ikas/storefront-models": "^4.15.0-beta.86",
28
- "@ikas/storefront-providers": "^4.15.0-beta.86",
24
+ "@ikas/storefront-api": "^4.15.0-beta.88",
25
+ "@ikas/storefront-config": "^4.15.0-beta.88",
26
+ "@ikas/storefront-model-functions": "^4.15.0-beta.88",
27
+ "@ikas/storefront-models": "^4.15.0-beta.88",
28
+ "@ikas/storefront-providers": "^4.15.0-beta.88",
29
29
  "@ikas/localized-address": "1.0.0-beta.3",
30
30
  "@adyen/adyen-web": "^5.57.0",
31
31
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -60,11 +60,11 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@ikas/localized-address": "1.0.0-beta.3",
63
- "@ikas/storefront-api": "^4.15.0-beta.86",
64
- "@ikas/storefront-config": "^4.15.0-beta.86",
65
- "@ikas/storefront-model-functions": "^4.15.0-beta.86",
66
- "@ikas/storefront-models": "^4.15.0-beta.86",
67
- "@ikas/storefront-providers": "^4.15.0-beta.86",
63
+ "@ikas/storefront-api": "^4.15.0-beta.88",
64
+ "@ikas/storefront-config": "^4.15.0-beta.88",
65
+ "@ikas/storefront-model-functions": "^4.15.0-beta.88",
66
+ "@ikas/storefront-models": "^4.15.0-beta.88",
67
+ "@ikas/storefront-providers": "^4.15.0-beta.88",
68
68
  "mobx": "^6.1.3",
69
69
  "mobx-react-lite": "^3.1.5",
70
70
  "next": "12.2.0",
@@ -1 +0,0 @@
1
- import"mobx";import"react";import"./utils/observerFinalizationRegistry.js";process.env.NODE_ENV;
@@ -1 +0,0 @@
1
- import"./utils/assertEnvironment.js";import{unstable_batchedUpdates as r}from"react-dom";import{observerBatching as e}from"./utils/observerBatching.js";export{observerBatching}from"./utils/observerBatching.js";import"mobx";import"react";import{observerFinalizationRegistry as o}from"./utils/observerFinalizationRegistry.js";export{observer}from"./observer.js";import"./ObserverComponent.js";e(r),o.finalizeAllImmediately;
@@ -1 +0,0 @@
1
- import{forwardRef as e,memo as r}from"react";import{useObserver as o}from"./useObserver.js";var t=!0,n="function"==typeof Symbol&&Symbol.for,a=n?Symbol.for("react.forward_ref"):"function"==typeof e&&e((function(e){return null})).$$typeof,f=n?Symbol.for("react.memo"):"function"==typeof r&&r((function(e){return null})).$$typeof;function c(n,c){var i;if("production"!==process.env.NODE_ENV&&t&&c&&(t=!1,console.warn("[mobx-react-lite] `observer(fn, { forwardRef: true })` is deprecated, use `observer(React.forwardRef(fn))`")),f&&n.$$typeof===f)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var s=null!==(i=null==c?void 0:c.forwardRef)&&void 0!==i&&i,y=n,u=n.displayName||n.name;if(a&&n.$$typeof===a&&(s=!0,"function"!=typeof(y=n.render)))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var m,l,d=function(e,r){return o((function(){return y(e,r)}),u)};return""!==u&&(d.displayName=u),n.contextTypes&&(d.contextTypes=n.contextTypes),s&&(d=e(d)),d=r(d),m=n,l=d,Object.keys(m).forEach((function(e){p[e]||Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(m,e))})),"production"!==process.env.NODE_ENV&&Object.defineProperty(d,"contextTypes",{set:function(){var e;throw new Error("[mobx-react-lite] `".concat(this.displayName||(null===(e=this.type)||void 0===e?void 0:e.displayName)||"Component",".contextTypes` must be set before applying `observer`."))}}),d}var p={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};export{c as observer};
@@ -1 +0,0 @@
1
- import{Reaction as e}from"mobx";import r from"react";import{printDebugValue as n}from"./utils/printDebugValue.js";import{observerFinalizationRegistry as t}from"./utils/observerFinalizationRegistry.js";var o=function(e,r){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var t,o,u=n.call(e),i=[];try{for(;(void 0===r||r-- >0)&&!(t=u.next()).done;)i.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}return i};function u(e){return"observer".concat(e)}var i=function(){};function a(){return new i}function c(i,c){void 0===c&&(c="observed");var f=o(r.useState(a),1)[0],s=o(r.useState(),2)[1],l=function(){return s([])},d=r.useRef(null);d.current||(d.current={reaction:null,mounted:!1,changedBeforeMount:!1});var m,v,g=d.current;if(g.reaction||(g.reaction=new e(u(c),(function(){g.mounted?l():g.changedBeforeMount=!0})),t.register(f,g,g)),r.useDebugValue(g.reaction,n),r.useEffect((function(){return t.unregister(g),g.mounted=!0,g.reaction?g.changedBeforeMount&&(g.changedBeforeMount=!1,l()):(g.reaction=new e(u(c),(function(){l()})),l()),function(){g.reaction.dispose(),g.reaction=null,g.mounted=!1,g.changedBeforeMount=!1}}),[]),g.reaction.track((function(){try{m=i()}catch(e){v=e}})),v)throw v;return m}export{c as useObserver};
@@ -1 +0,0 @@
1
- var e=function(){function e(e){var i=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=1e4),clearTimeout(i.sweepTimeout),i.sweepTimeout=void 0;var t=Date.now();i.registrations.forEach((function(r,n){t-r.registeredAt>=e&&(i.finalize(r.value),i.registrations.delete(n))})),i.registrations.size>0&&i.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){i.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,i,t){this.registrations.set(t,{value:i,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){void 0===this.sweepTimeout&&(this.sweepTimeout=setTimeout(this.sweep,1e4))}}),e}(),i="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:e;export{e as TimerBasedFinalizationRegistry,i as UniversalFinalizationRegistry};
@@ -1 +0,0 @@
1
- import{makeObservable as r}from"mobx";import{useState as o}from"react";if(!o)throw new Error("mobx-react-lite requires React with Hooks support");if(!r)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");
@@ -1 +0,0 @@
1
- import{configure as o}from"mobx";function e(o){o()}function t(t){t||(t=e,"production"!==process.env.NODE_ENV&&console.warn("[MobX] Failed to get unstable_batched updates from react-dom / react-native")),o({reactionScheduler:t})}export{e as defaultNoopBatch,t as observerBatching};
@@ -1 +0,0 @@
1
- import{UniversalFinalizationRegistry as i}from"./UniversalFinalizationRegistry.js";var n=new i((function(i){var n;null===(n=i.reaction)||void 0===n||n.dispose(),i.reaction=null}));export{n as observerFinalizationRegistry};
@@ -1 +0,0 @@
1
- import{getDependencyTree as r}from"mobx";function o(o){return r(o)}export{o as printDebugValue};