@ikas/storefront 5.0.11 → 5.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/googleAnalytics.js +1 -1
- package/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/ikas.js +1 -1
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/model.js +1 -1
- package/build/components/checkout/components/error/argument-validation-error/index.d.ts +8 -0
- package/build/components/checkout/components/error/argument-validation-error/index.js +1 -0
- package/build/components/checkout/components/error/index.js +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/index.js +1 -1
- package/build/components/checkout/components/master-pass/modal-otp/index.js +1 -1
- package/build/components/checkout/components/offer-product/index.js +1 -1
- package/build/components/checkout/components/quick-registration/model.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +2 -2
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/modelMasterPass.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/index.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/components/page-editor/model.js +1 -1
- package/build/components/popup/index.d.ts +2 -0
- package/build/components/popup/index.js +1 -0
- package/build/components/popup/renderer/index.d.ts +11 -0
- package/build/components/popup/renderer/index.js +1 -0
- package/build/components/popup/renderer/model.d.ts +21 -0
- package/build/components/popup/renderer/model.js +1 -0
- package/build/components/popup/utils/index.d.ts +8 -0
- package/build/components/popup/utils/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/left-arrow.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/right-arrow.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/x-close.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/date-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/gender-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/space-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-birthday/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-email/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-name/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-phone/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-surname/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/window-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-time/index.js +1 -0
- package/build/ext/mobx-react/dist/mobxreact.esm.js +1 -0
- package/build/ext/swiper/modules/navigation.css.js +1 -0
- package/build/ext/swiper/modules/navigation.mjs.js +1 -0
- package/build/ext/swiper/modules/pagination.css.js +1 -0
- package/build/ext/swiper/modules/scrollbar.mjs.js +1 -0
- package/build/ext/swiper/shared/classes-to-selector.mjs.js +1 -0
- package/build/ext/swiper/shared/create-element-if-not-defined.mjs.js +1 -0
- package/build/ext/swiper/shared/ssr-window.esm.mjs.js +1 -0
- package/build/ext/swiper/shared/swiper-core.mjs.js +1 -0
- package/build/ext/swiper/shared/update-on-virtual-data.mjs.js +1 -0
- package/build/ext/swiper/shared/update-swiper.mjs.js +1 -0
- package/build/ext/swiper/shared/utils.mjs.js +1 -0
- package/build/ext/swiper/swiper-react.mjs.js +1 -0
- package/build/ext/swiper/swiper.css.js +1 -0
- package/build/hooks/useCustomerReviews.js +1 -1
- package/build/hooks/useStore.js +1 -1
- package/build/index.js +1 -1
- package/build/models/data/customer/index.d.ts +8 -1
- package/build/models/data/customer/index.js +1 -1
- package/build/models/data/customer-form-data-input/customer-register-subscription-input/index.d.ts +7 -0
- package/build/models/data/customer-form-data-input/customer-register-subscription-input/index.js +1 -0
- package/build/models/data/customer-form-data-input/index.d.ts +19 -0
- package/build/models/data/customer-form-data-input/index.js +1 -0
- package/build/models/data/index.d.ts +2 -0
- package/build/models/data/product/index.js +1 -1
- package/build/models/data/storefront-popup/index.d.ts +40 -0
- package/build/models/data/storefront-popup/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-analytics/index.d.ts +7 -0
- package/build/models/data/storefront-popup/storefront-popup-analytics/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-date-f/304/261lter/index.d.ts +6 -0
- package/build/models/data/storefront-popup/storefront-popup-date-f/304/261lter/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-display-filter/index.d.ts +11 -0
- package/build/models/data/storefront-popup/storefront-popup-display-filter/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-display-settings/index.d.ts +16 -0
- package/build/models/data/storefront-popup/storefront-popup-display-settings/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-page-filter/index.d.ts +16 -0
- package/build/models/data/storefront-popup/storefront-popup-page-filter/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-page-filter/storefront-popup-page-filter-data/index.d.ts +12 -0
- package/build/models/data/storefront-popup/storefront-popup-page-filter/storefront-popup-page-filter-data/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-routing/index.d.ts +6 -0
- package/build/models/data/storefront-popup/storefront-popup-routing/index.js +1 -0
- package/build/models/ui/blog-category-list/index.js +1 -1
- package/build/models/ui/brand-list/index.js +1 -1
- package/build/models/ui/category-list/index.js +1 -1
- package/build/models/ui/customer-review-list/index.d.ts +3 -0
- package/build/models/ui/customer-review-list/index.js +1 -1
- package/build/models/ui/customer-review-summary-list/index.js +1 -1
- package/build/models/ui/product-list/index.js +1 -1
- package/build/models/ui/raffle-list/index.js +1 -1
- package/build/models/ui/validator/form/account-info.js +1 -1
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/models/ui/validator/form/ikas-address.js +1 -1
- package/build/models/ui/validator/form/register.js +1 -1
- package/build/page-data-init/index.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/store/blog/index.js +1 -1
- package/build/store/brand/index.js +1 -1
- package/build/store/cart/index.js +1 -1
- package/build/store/category/index.js +1 -1
- package/build/store/checkout/index.js +1 -1
- package/build/store/customer/api.d.ts +2 -1
- package/build/store/customer/api.js +1 -1
- package/build/store/customer/index.d.ts +2 -0
- package/build/store/customer/index.js +1 -1
- package/build/store/html-meta-data/index.js +1 -1
- package/build/store/location/index.js +1 -1
- package/build/store/product/index.js +1 -1
- package/build/store/storefront-popup/index.d.ts +74 -0
- package/build/store/storefront-popup/index.js +1 -0
- package/package.json +18 -12
- package/build/components/checkout/components/epaykolay-button/index.d.ts +0 -5
- package/build/components/checkout/components/epaykolay-button/index.js +0 -1
- package/build/components/checkout/components/epaykolay-button/style.module.scss.js +0 -1
- package/build/components/checkout/components/svg/epaykolay.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as i}from"next/router";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{IkasThemeJsonPageType as r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductList as s}from"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as d}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as c}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var l=o((function(o){var s,l,g,v=o.pageType,f=o.pageTitle,h=o.pageDescription,j=o.canonicals,x=o.disableIndex,y=o.pageSpecificData,b=o.merchantSettings,C=o.addOgpMetas,k=o.productReviewSummary,D=o.pageComponentPropValues,T=i(),w="undefined"!=typeof window,L="local"===process.env.NEXT_PUBLIC_ENV,P=T.asPath.split("?")[0].replace("/",""),E=(P="/"===P.charAt(P.length-1)?P.slice(0,-1):P).startsWith("pages/"),O=d.getCurrentRouting(),R=(null==O?void 0:O.path)?"/"+O.path:"",I=L?"http://localhost:3333":"https://"+d.getDomain(),_=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),S=_?new n(_):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[v,y]);var V=t.useMemo((function(){if(y&&y.href)return"".concat(I).concat(y.href)}),[y]),A=t.useMemo((function(){var e,t,o=[];if(C){if(o.push({property:"og:type",content:"website"}),o.push({property:"og:site_name",content:"https://"+d.getDomain()}),f&&o.push({property:"og:title",content:f}),h&&o.push({property:"og:description",content:h}),v===r.INDEX){var a=null,i=null;!f&&(null==S?void 0:S.pageTitle)&&(a=S.pageTitle),!h&&(null==S?void 0:S.description)&&(i=S.description);var n=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));n&&(a=u(y,v,n.titleTemplate||""),i=u(y,v,n.descriptionTemplate||"")),a&&o.push({property:"og:title",content:a}),i&&o.push({property:"og:description",content:i})}if(o.push({property:"og:url",content:V||(w?window.location.href:"")||"https://".concat(d.getDomain())}),y&&v===r.PRODUCT){var s=y.selectedVariant.mainImage;(null==s?void 0:s.image)&&o.push({property:"og:image",content:s.image.src.replace(".webp",".jpg")})}else(null==S?void 0:S.icon)?o.push({property:"og:image",content:null===(t=null==S?void 0:S.icon)||void 0===t?void 0:t.src.replace(".webp",".jpg")}):(null==b?void 0:b.logo)&&o.push({property:"og:image",content:b.logo.src.replace(".webp",".jpg")});if(y&&v===r.CATEGORY){var c=y;c.image&&o.push({property:"og:image",content:c.image.src.replace(".webp",".jpg")})}if(y&&v===r.BRAND){var l=y;l.image&&o.push({property:"og:image",content:l.image.src.replace(".webp",".jpg")})}}return o}),[f,y,V,h,b,C,b]),N=t.useMemo((function(){var t=[];if(b){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,a,i,r,n,s,c=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:c,image:c,url:"https://"+d.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(i=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===i?void 0:i.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(b);t.push(o),t.push(a)}if(y&&v===r.PRODUCT){var i=y,n=function(t,o){var a,i,r,n,s;try{var c=d.getCurrentRouting(),l=null==c?void 0:c.path,m=function(e){return l?"https://".concat(d.getDomain(),"/").concat(l).concat(e):"https://".concat(d.getDomain()).concat(e)},p=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(i=p.images)||void 0===i?void 0:i.map((function(e){return e.image?e.image.src:""})),productId:p.id,sku:p.sku,mpn:(null===(r=p.barcodeList)||void 0===r?void 0:r.length)?p.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:m(t.href),priceCurrency:p.price.currency||"TRY",price:(null!==(s=p.campaignPrice)&&void 0!==s?s:p.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:p.stock>0||p.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(i,k||null);if(n&&t.push(n),i.categories.length)(c=m(i.categories[0],i))&&t.push(c)}if(y&&v===r.CATEGORY){var s=function(e){var t,o;try{var a=d.getCurrentRouting(),i=null==a?void 0:a.path,r=function(e){return i?"https://".concat(d.getDomain(),"/").concat(i).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(y),c=m(y),l=p(D);s&&t.push(s),c&&t.push(c),l&&t.push(l)}y&&v===r.BRAND&&((l=p(D))&&t.push(l));if(y&&v===r.BLOG){var u=function(t){var o;try{var a="https://".concat(d.getDomain()).concat(t.href),i=function(e){var t=new Date(e),o=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(a,"-").concat(i)},r="".concat(t.writer.firstName," ").concat(t.writer.lastName),n=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:a,datePublished:i(t.createdAt),dateCreated:i(t.createdAt),dateModified:i(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(y);u&&t.push(u)}return t}),[y,b]),M=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));return t?u(y,v,t.titleTemplate||""):null}),[v,y]),B=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));return t?u(y,v,t.descriptionTemplate||""):null}),[v,y]),U=t.useMemo((function(){return!d.getFavicon()&&(null==S?void 0:S.favIcon)?S.favIcon:null}),[]),F=t.useCallback((function(){var e=d.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]),G=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){G.push({routing:e,hrefLang:e.locale+"-"+t})})):G.push({routing:e,hrefLang:e.locale})}));var Y=function(e){var t,o,a,i,r,n=y,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=G.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(i=null===(a=null==n?void 0:n.metaData)||void 0===a?void 0:a.translations)||void 0===i?void 0:i.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},H=c.getInstance();return t.createElement(a,null,t.createElement("title",null,f||M||(null==S?void 0:S.pageTitle)||""),t.createElement("meta",{name:"description",content:h||B||(null==S?void 0:S.description)||""}),v===r.CHECKOUT&&F()&&t.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/".concat((null===(l=d.getApiUrl())||void 0===l?void 0:l.includes("myikas.com"))?"epay":"epay-uat","/").concat((null===(g=d.getApiUrl())||void 0===g?void 0:g.includes("myikas.com"))?"containerServices":"containerServicesTest",".js")}),G.length>1&&G.filter((function(e){return!E||e.routing.id===(null==O?void 0:O.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(I+(e.routing.path?"/"+e.routing.path:""),"/").concat(Y(e.routing))})})),!!x&&t.createElement("meta",{name:"robots",content:"noindex"}),!!C&&A.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!j&&j.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(I).concat(R).concat(e)})})),U&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(U,"/image_180.webp"),type:"image/webp"}),!j&&H.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(I).concat(R,"/").concat(P)}),!!N.length&&N.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e,t){try{var o=c.getInstance(),a=d.getCurrentRouting(),i=null==a?void 0:a.path,n=function(e){return i?"https://".concat(d.getDomain(),"/").concat(i).concat(e):"https://".concat(d.getDomain()).concat(e)},s=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:n(e.href)}}));return s.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:n(e.href)}),o.currentPageType===r.PRODUCT&&t&&s.push({"@type":"ListItem",position:s.length+1,name:t.name,item:n(t.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:s}}catch(e){}}function p(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var a=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(a){var i=Object.values(a.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(i)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(i.data||[]).slice(0,10).map((function(e,t){var a,i,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(i=null===(a=e.selectedVariant.mainImage)||void 0===a?void 0:a.image)||void 0===i?void 0:i.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var a,i,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,c=(null===(a=s.brand)||void 0===a?void 0:a.name)||"",l=s.selectedVariant.sku||"",m=(null===(i=s.selectedVariant.barcodeList)||void 0===i?void 0:i.length)?s.selectedVariant.barcodeList[0]:"",p=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",c)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",l)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",m)),n.includes("{{price}}")&&(n=g(n,"{{price}}",p.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var v=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",v))}}catch(e){}return n.trimEnd()}function g(e,t,o){var a=new RegExp(t,"g");return e.replace(a,o)}export{l as IkasPageHead};
|
|
1
|
+
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as i}from"next/router";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{IkasThemeJsonPageType as r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductList as s}from"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as d}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as c}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var l=o((function(o){var s,l,g,v=o.pageType,f=o.pageTitle,h=o.pageDescription,j=o.canonicals,x=o.disableIndex,y=o.pageSpecificData,b=o.merchantSettings,C=o.addOgpMetas,k=o.productReviewSummary,D=o.pageComponentPropValues,T=i(),w="undefined"!=typeof window,L="local"===process.env.NEXT_PUBLIC_ENV,P=T.asPath.split("?")[0].replace("/",""),E=(P="/"===P.charAt(P.length-1)?P.slice(0,-1):P).startsWith("pages/"),O=d.getCurrentRouting(),R=(null==O?void 0:O.path)?"/"+O.path:"",I=L?"http://localhost:3333":"https://"+d.getDomain(),_=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),S=_?new n(_):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[v,y]);var V=t.useMemo((function(){if(y&&y.href)return"".concat(I).concat(y.href)}),[y]),A=t.useMemo((function(){var e,t,o=[];if(C){if(o.push({property:"og:type",content:"website"}),o.push({property:"og:site_name",content:"https://"+d.getDomain()}),f&&o.push({property:"og:title",content:f}),h&&o.push({property:"og:description",content:h}),v===r.INDEX){var a=null,i=null;!f&&(null==S?void 0:S.pageTitle)&&(a=S.pageTitle),!h&&(null==S?void 0:S.description)&&(i=S.description);var n=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));n&&(a=u(y,v,n.titleTemplate||""),i=u(y,v,n.descriptionTemplate||"")),a&&o.push({property:"og:title",content:a}),i&&o.push({property:"og:description",content:i})}if(o.push({property:"og:url",content:V||(w?window.location.href:"")||"https://".concat(d.getDomain())}),y&&v===r.PRODUCT){var s=y.selectedVariant.mainImage;(null==s?void 0:s.image)&&o.push({property:"og:image",content:s.image.src.replace(".webp",".jpg")})}else(null==S?void 0:S.icon)?o.push({property:"og:image",content:null===(t=null==S?void 0:S.icon)||void 0===t?void 0:t.src.replace(".webp",".jpg")}):(null==b?void 0:b.logo)&&o.push({property:"og:image",content:b.logo.src.replace(".webp",".jpg")});if(y&&v===r.CATEGORY){var c=y;c.image&&o.push({property:"og:image",content:c.image.src.replace(".webp",".jpg")})}if(y&&v===r.BRAND){var l=y;l.image&&o.push({property:"og:image",content:l.image.src.replace(".webp",".jpg")})}}return o}),[f,y,V,h,b,C,b]),N=t.useMemo((function(){var t=[];if(b){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,a,i,r,n,s,c=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:c,image:c,url:"https://"+d.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(i=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===i?void 0:i.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(b);t.push(o),t.push(a)}if(y&&v===r.PRODUCT){var i=y,n=function(t,o){var a,i,r,n,s;try{var c=d.getCurrentRouting(),l=null==c?void 0:c.path,m=function(e){return l?"https://".concat(d.getDomain(),"/").concat(l).concat(e):"https://".concat(d.getDomain()).concat(e)},p=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(i=p.images)||void 0===i?void 0:i.map((function(e){return e.image?e.image.src:""})),productId:p.id,sku:p.sku,mpn:(null===(r=p.barcodeList)||void 0===r?void 0:r.length)?p.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:m(t.href),priceCurrency:p.price.currency||"TRY",price:(null!==(s=p.campaignPrice)&&void 0!==s?s:p.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:p.stock>0||p.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(i,k||null);if(n&&t.push(n),i.categories.length)(c=m(i.categories[0],i))&&t.push(c)}if(y&&v===r.CATEGORY){var s=function(e){var t,o;try{var a=d.getCurrentRouting(),i=null==a?void 0:a.path,r=function(e){return i?"https://".concat(d.getDomain(),"/").concat(i).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(y),c=m(y),l=p(D);s&&t.push(s),c&&t.push(c),l&&t.push(l)}y&&v===r.BRAND&&((l=p(D))&&t.push(l));if(y&&v===r.BLOG){var u=function(t){var o;try{var a="https://".concat(d.getDomain()).concat(t.href),i=function(e){var t=new Date(e),o=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(a,"-").concat(i)},r="".concat(t.writer.firstName," ").concat(t.writer.lastName),n=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:a,datePublished:i(t.createdAt),dateCreated:i(t.createdAt),dateModified:i(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(y);u&&t.push(u)}return t}),[y,b]),M=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));return t?u(y,v,t.titleTemplate||""):null}),[v,y]),B=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));return t?u(y,v,t.descriptionTemplate||""):null}),[v,y]),U=t.useMemo((function(){return!d.getFavicon()&&(null==S?void 0:S.favIcon)?S.favIcon:null}),[]),F=t.useCallback((function(){var e=d.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]),G=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){G.push({routing:e,hrefLang:e.locale+"-"+t})})):G.push({routing:e,hrefLang:e.locale})}));var Y=function(e){var t,o,a,i,r,n=y,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=G.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(i=null===(a=null==n?void 0:n.metaData)||void 0===a?void 0:a.translations)||void 0===i?void 0:i.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},H=c.getInstance();return t.createElement(a,null,t.createElement("title",null,f||M||(null==S?void 0:S.pageTitle)||""),t.createElement("meta",{name:"description",content:h||B||(null==S?void 0:S.description)||""}),v===r.CHECKOUT&&F()&&t.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/".concat((null===(l=d.getApiUrl())||void 0===l?void 0:l.includes("myikas.com"))?"epay":"epay-uat","/").concat((null===(g=d.getApiUrl())||void 0===g?void 0:g.includes("myikas.com"))?"containerServices":"containerServicesTest",".js")}),G.length>1&&G.filter((function(e){return!E||e.routing.id===(null==O?void 0:O.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(I+(e.routing.path?"/"+e.routing.path:""),"/").concat(Y(e.routing))})})),!!x&&t.createElement("meta",{name:"robots",content:"noindex"}),!!C&&A.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!j&&j.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(I).concat(R).concat(e)})})),U&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(U,"/image_180.webp"),type:"image/webp"}),!j&&H.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(I).concat(R,"/").concat(P)}),!!N.length&&N.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e,t){try{var o=c.getInstance(),a=d.getCurrentRouting(),i=null==a?void 0:a.path,n=function(e){return i?"https://".concat(d.getDomain(),"/").concat(i).concat(e):"https://".concat(d.getDomain()).concat(e)},s=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:n(e.href)}}));return s.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:n(e.href)}),o.currentPageType===r.PRODUCT&&t&&s.push({"@type":"ListItem",position:s.length+1,name:t.name,item:n(t.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:s}}catch(e){}}function p(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var a=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(a){var i=Object.values(a.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(i)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(i.data||[]).slice(0,10).map((function(e,t){var a,i,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(i=null===(a=e.selectedVariant.mainImage)||void 0===a?void 0:a.image)||void 0===i?void 0:i.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var a,i,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,c=(null===(a=s.brand)||void 0===a?void 0:a.name)||"",l=s.selectedVariant.sku||"",m=(null===(i=s.selectedVariant.barcodeList)||void 0===i?void 0:i.length)?s.selectedVariant.barcodeList[0]:"",p=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",c)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",l)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",m)),n.includes("{{price}}")&&(n=g(n,"{{price}}",p.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var v=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",v))}}catch(e){}return n.trimEnd()}function g(e,t,o){var a=new RegExp(t,"g");return e.replace(a,o)}export{l as IkasPageHead};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as r}from"mobx-react-lite";import{useRouter as a}from"next/router.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{IkasThemeJsonPageType as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as r}from"mobx-react-lite";import{useRouter as a}from"next/router.js";import s from"next/dynamic";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{IkasThemeJsonPageType as d}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as n}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as m}from"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{Analytics as p}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as c}from"./head.js";import{ThemeComponent as u}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as j}from"../../analytics/events.js";import{IkasPageDataInit as x}from"../../page-data-init/index.js";import{setAPIClientConfig as g}from"@ikas/storefront-api";var v=s((function(){return import("../popup/index.js").then((function(e){return e.PopupListRendererForPage}))}),{ssr:!1}),y=r((function(r){var s=r.propValues,u=r.themeJsonComponents,y=r.customDataList,w=r.pageType,b=r.pageTitle,S=r.pageDescription,C=r.pageSpecificData,P=r.canonicals,k=r.disableIndex,D=r.settings,T=r.configJson,E=r.reInitOnBrowser,I=r.addOgpMetas,M=r.components,R=r.productReviewSummary,V=a(),O=i.useState(),z=O[0],F=O[1];l.init(e(e({},T),{currentPageComponents:M,loginRequiredCallback:function(){V.push("/account/login")}})),f.getInstance().router=V,g();var A=f.getInstance();A.router=V,A.currentPageType=w;var B=i.useState(!1),H=B[0],L=B[1],U=i.useMemo((function(){return(null==z?void 0:z.id)===(null==C?void 0:C.id)&&x.pageSpecificData&&x.isBrowser?w===d.PRODUCT&&x._initProductOnBrowser(x.pageSpecificData):x.setPageSpecificData(C,w,H),x.initPagePropValues(s,u,y.map((function(e){return new m(e)})),D,H)}),[H,s,w,D,C,u]);i.useEffect((function(){E&&L("undefined"!=typeof window),window.addToCart=A.cartStore._windowAddToCart,A.cartStore.getCart(),A.checkLocalization(),j()}),[]),i.useEffect((function(){C?(null==z?void 0:z.id)!==C.id&&F(C):F(null)}),[C]),i.useEffect((function(){var e=function(){A.customerStore.routeChangeInit()};return V.events.on("routeChangeStart",e),function(){V.events.off("routeChangeStart",e)}}),[]),i.useEffect((function(){!function(e,i){var r,a;t(this,void 0,void 0,(function(){var t,s,n,m,l;return o(this,(function(o){switch(o.label){case 0:t=f.getInstance(),p.pageView(e),o.label=1;case 1:return o.trys.push([1,4,,5]),e===d.PRODUCT&&(s=i,p.productView(s),t.customerStore.onProductView(s.id,s.selectedVariant.id)),e===d.CATEGORY&&(m=null===(r=(n=i).categoryPathItems)||void 0===r?void 0:r.map((function(e){return e.name})).join(" > "),m=n.categoryPathItems&&(null===(a=n.categoryPathItems)||void 0===a?void 0:a.length)>0?m+" > "+n.name:n.name,p.viewCategory(m,n)),e!==d.CART?[3,3]:[4,t.cartStore.waitUntilInitialized()];case 2:o.sent(),p.viewCart(t.cartStore.cart),o.label=3;case 3:return[3,5];case 4:return l=o.sent(),console.error(l),[3,5];case 5:return[2]}}))}))}(w,x.pageSpecificData)}),[w,C]);var _=i.useMemo((function(){var e=U.find((function(e){return e.component.isHeader})),t=U.find((function(e){return e.component.isFooter})),o=U.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[];return i.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},i.createElement("div",null,e&&h(e,D,-1),o.map((function(e,t){return h(e,D,t)}))),t&&h(t,D,-1),i.createElement(v,null))}),[U,D]),J=i.useMemo((function(){return l.getMerchantSettings()?new n(l.getMerchantSettings()):null}),[l.getMerchantSettings()]);return i.createElement(i.Fragment,null,i.createElement(c,{pageType:w,pageTitle:b,pageDescription:S,pageSpecificData:x.pageSpecificData,canonicals:P,disableIndex:k,merchantSettings:J,addOgpMetas:I,productReviewSummary:R,pageComponentPropValues:U}),_)})),h=function(e,t,o){return i.createElement(u,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{y as IkasPage,h as renderComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";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{IkasThemeJsonPageType as s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as l,IkasCouponCodeRequirement as p,IkasThemeJsonComponentPropType as u}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{IkasCheckout as c}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as f}from"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../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{IkasOrderLineItem as v}from"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as j}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as x}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var y=function(y){function h(e){var o=y.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(h,y),h.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(h.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new c({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new v({id:"",createdAt:0,updatedAt:0,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,fileId:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,hsCode:null,variantValues:[],baseUnit:null,unit:null,tags:null,bundleProducts:null},orderedAt:0})]}),checkoutSettings:new f({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:l.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:l.OPTIONAL,postalCodeRequirement:l.OPTIONAL,showCheckoutNote:!0,showTermsAndConditionsCheckbox:!0,storefrontId:"",couponCodeRequirement:p.DEFAULT}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===u.BOOLEAN&&!n||i.type===u.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:x.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=j.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),h.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName})):j.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},h}(t.Component);export{y as ThemeEditorComponent};
|
|
1
|
+
import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";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{IkasThemeJsonPageType as s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as l,IkasCouponCodeRequirement as p,IkasThemeJsonComponentPropType as u}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{IkasCheckout as c}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as f}from"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import{IkasOrderLineItem as v}from"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as j}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as x}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var y=function(y){function h(e){var o=y.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(h,y),h.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(h.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new c({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new v({id:"",createdAt:0,updatedAt:0,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,fileId:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,hsCode:null,variantValues:[],baseUnit:null,unit:null,tags:null,bundleProducts:null},orderedAt:0})]}),checkoutSettings:new f({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:l.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:l.OPTIONAL,postalCodeRequirement:l.OPTIONAL,showCheckoutNote:!0,showTermsAndConditionsCheckbox:!0,storefrontId:"",couponCodeRequirement:p.DEFAULT}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===u.BOOLEAN&&!n||i.type===u.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:x.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=j.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),h.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName})):j.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},h}(t.Component);export{y as ThemeEditorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import{IkasBlogMetaDataTargetType as o}from"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as n}from"@ikas/storefront-models";import{reaction as a,makeAutoObservable as s,runInAction as r}from"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import{IkasHTMLMetaDataTargetType as d}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import{IkasThemeJson as p}from"../../models/data/theme-json/index.js";import{IkasStorefront as c}from"../../models/data/storefront/index.js";import{IkasThemeJsonComponent as l}from"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonSettings as u}from"../../models/data/theme-json/settings/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasPageDataProvider as g}from"@ikas/storefront-providers";import{IkasPageDataInit as h}from"../../page-data-init/index.js";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"./loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";import E from"../../store/html-meta-data/index.js";import v from"../../store/blog/index.js";import P from"../../store/raffle/index.js";import O from"../../store/product/index.js";import{setAPIClientConfig as T,listCustomerSettings as C}from"@ikas/storefront-api";var _,j=function(){function j(a){var O=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",O.onMessage,!1),O.sendMessage(_.FRAME_DID_LOAD,"5.0.0"),O.createLoadingListener()},this.onMessage=function(i){return e(O,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:switch(e=i.data.type,o=i.data.data,e){case _.UPDATE_FRAME_DATA:return[3,1];case _.UPDATE_THEME_JSON:return[3,3];case _.UPDATE_PROP_VALUE:return[3,5];case _.UPDATE_PAGE_PARAMS:return[3,7];case _.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case _.ADD_COMPONENT:return[3,11];case _.DELETE_COMPONENT:return[3,12];case _.UPDATE_COMPONENT:return[3,13];case _.ADD_PAGE_COMPONENT:return[3,14];case _.DELETE_PAGE_COMPONENT:return[3,16];case _.SET_SELECTED_COMPONENT:return[3,17];case _.SET_HOVERED_COMPONENT:return[3,18];case _.SCROLL_TO_COMPONENT:return[3,19];case _.EDITOR_RELOAD:return[3,20];case _.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(o)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(o)];case 5:return[4,this.handleUpdatePropValue(o)];case 7:return[4,this.handleUpdatePageParams(o)];case 9:return[4,this.handleUpdatePageComponentOrder(o)];case 11:return this.handleAddNewComponent(o),[3,23];case 12:return this.handleDeleteComponent(o),[3,23];case 13:return this.handleUpdateComponent(o),[3,23];case 14:return[4,this.handleAddNewPageComponent(o)];case 16:return this.handleDeletePageComponent(o),[3,23];case 17:return this.handleSetSelectedComponent(o),[3,23];case 18:return this.handleSetHoveredComponent(o),[3,23];case 19:return this.handleScrollToComponent(o),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(o),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){O.sendMessage(_.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){O.sendMessage(_.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){O.sendMessage(_.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(i){return e(O,void 0,void 0,(function(){var e,a,s,p,c,l,m,u,g,h,O,T,C,j=this;return t(this,(function(t){switch(t.label){case 0:return e=i.slice(1),a=e.split("?"),e=a[0],s=a[1],this.pageParams={},i.startsWith("/account/orders/")?p=n.ORDER_DETAIL:i.startsWith("/account/orders")?p=n.ORDERS:i.startsWith("/account/addresses")?p=n.ADDRESSES:i.startsWith("/account/favorite-products")?p=n.FAVORITE_PRODUCTS:i.startsWith("/account/forgot-password")?p=n.FORGOT_PASSWORD:i.startsWith("/account/login")?p=n.LOGIN:i.startsWith("/account/raffles")?p=n.RAFFLE_ACCOUNT:i.startsWith("/account/recover-password")?p=n.RECOVER_PASSWORD:i.startsWith("/account/activate")?p=n.ACTIVATE_CUSTOMER:i.startsWith("/account/register")?p=n.REGISTER:i.startsWith("/account")?p=n.ACCOUNT:i.startsWith("/blog/")?p=n.BLOG:i.startsWith("/blog")?p=n.BLOG_INDEX:i.startsWith("/pages")?(p=n.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=i.startsWith("/raffle/")?n.RAFFLE_DETAIL:i.startsWith("/raffle")?n.RAFFLE:i.startsWith("/404")?n.NOT_FOUND:"/cart"===i||"/cart/"===i?n.CART:i.startsWith("/checkout")?n.CHECKOUT:"/"===i?n.INDEX:i.startsWith("/search")?n.SEARCH:n.PRODUCT,p!==n.PRODUCT?[3,6]:[4,E.listHTMLMetaData({slug:{eq:e}})];case 1:return(l=t.sent()).isSuccess&&(null===(g=l.data)||void 0===g?void 0:g.length)?(m=l.data[0]).targetType!==d.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(m.targetId,s)]:[3,5];case 2:return c=t.sent(),this.pageParams={productId:m.targetId,variantId:c,slug:e},[3,4];case 3:if(m.targetType===d.CATEGORY)p=n.CATEGORY,this.pageParams={categoryId:m.targetId,slug:e};else{if(m.targetType!==d.BRAND)return[2];p=n.BRAND,this.pageParams={brandId:m.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==n.BLOG?[3,8]:[4,v.listBlogMetaData({slug:{eq:e}})];case 7:if(!(l=t.sent()).isSuccess||!(null===(O=null===(h=l.data)||void 0===h?void 0:h.data)||void 0===O?void 0:O.length))return[2];if((m=l.data.data[0]).targetType===o.BLOG)this.pageParams={blogId:m.targetId,slug:e};else{if(m.targetType!==o.BLOG_CATEGORY)return[2];p=n.BLOG_CATEGORY,this.pageParams={blogCategoryId:m.targetId,slug:e}}t.label=8;case 8:return p!==n.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData({slug:{eq:e}})];case 9:if(!(l=t.sent()).isSuccess||!(null===(T=l.data)||void 0===T?void 0:T.length))return[2];m=l.data[0],this.pageParams={raffleId:m.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return u=t.sent(),r((function(){var e,t;f.getInstance().currentPageType=p,j.pageDataProvider=u,p===n.CUSTOM?j.page=null===(e=j.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===j.pageParams.slug})):j.page=null===(t=j.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),j.setCurrentPageType(),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(_.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){O.sendMessage(_.EDITOR_LOADING_CHANGE,{isLoading:O.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(i,o,a){return e(O,void 0,void 0,(function(){var e,s,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(i,a,o),(a.blogId||a.blogCategoryId)&&(e.possiblePageTypes=[n.BLOG,n.BLOG_CATEGORY]),a.raffleId&&(e.possiblePageTypes=[n.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(h.setPageSpecificData(e.pageSpecificData,o,!0),o===n.PRODUCT&&h.pageSpecificData&&(s=h.pageSpecificData,(r=s.variants.find((function(e){return e.id===a.variantId})))&&(s.selectedVariantValues=r.variantValues))):h.pageSpecificData=void 0,this.initializedPropValues=h.initPagePropValues(e.$pageComponentPropValues,i.components,i.customData,i.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){O.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),i=t.top,o=t.bottom;return i<window.innerHeight&&o>=0&&o<window.innerHeight&&i>0},this.handleUpdateFrameData=function(o){return e(O,void 0,void 0,(function(){var e,n,a,s,r,d,l=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new p(o.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===o.selectedPage.id})),this.pageParams=o.pageParams,this.apiKey=o.apiKey,this.locale=o.locale||"en",this.translations=o.translations||void 0,this.setCurrentPageType(),this.page?((e=o.storefront?new c(o.storefront):null)&&(n=e.routings.find((function(e){return e.locale===l.locale})),i.init({storefrontId:e.id,storefrontRoutingId:null==n?void 0:n.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==n?void 0:n.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||i.getTranslations(),isEditor:!0,apiKey:o.apiKey,apiUrl:o.apiUrl,cdnUrl:o.cdnUrl,merchantSettings:o.merchantSettings}),T(),this.setCustomerSettings()),a=Date.now()+"",this.updateId=a,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return s=t.sent(),this.updateId===a&&(this.pageDataProvider=s,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(O,void 0,void 0,(function(){var e,o,n;return t(this,(function(t){switch(t.label){case 0:return i.getCustomerSettings()?[3,2]:[4,C({storefrontId:{eq:i.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.data.length)&&(o=e.data.data[0],i.init({customerSettings:o})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new p(i.theme),[2]}))}))},this.handleUpdatePropValue=function(i){return e(O,void 0,void 0,(function(){var e,o,n,a,s,r,d,p=this;return t(this,(function(t){switch(t.label){case 0:return e=i.propName,o=i.value,(n=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(a=this.initializedPropValues.find((function(e){return e.pageComponent.id===p.selectedPageComponentId})),this.pageDataProvider&&a?(this.selectedPageComponent.propValues[e]=o,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,n)]):[2]):[2];case 1:return(s=t.sent())&&JSON.stringify(s).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return a.propValues[e]=h.initPropValue(n,s,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(i){return e(O,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=i.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=i.pageComponents.map((function(e){return new m(e)})):this.page.components=i.pageComponents.map((function(e){return new m(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,i=new l(e.component);null===(t=O.theme)||void 0===t||t.components.push(i)},this.handleDeleteComponent=function(e){var t,i;(null===(t=O.theme)||void 0===t?void 0:t.components)&&(O.theme.components=O.theme.components.filter((function(t){return t.id!==e.componentId})));var o=O.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];O.specification&&O.specification.components&&(O.specification.components=o),!O.specification&&(null===(i=O.page)||void 0===i?void 0:i.components)&&(O.page.components=o)},this.handleUpdateComponent=function(e){var t=O.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(O.theme.components[t]=new l(e.component))},this.handleAddNewPageComponent=function(i){return e(O,void 0,void 0,(function(){var e,o,a,s,r,d,p;return t(this,(function(t){switch(t.label){case 0:return e=new m(i.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),a=h.initPageComponentPropValue(o,[o.component],this.theme.settings,!0),this.initializedPropValues.push(a),(null===(d=this.page)||void 0===d?void 0:d.type)===n.CHECKOUT?[2]:(s=null===(p=this.theme)||void 0===p?void 0:p.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==s?void 0:s.id)})),(null==s?void 0:s.isCommon)&&r||(i.customIndex?this.pageComponents.splice(i.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){O.specification?O.specification.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):O.page.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){O.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){O.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,i=O.componentRefs[t];i&&(O.isScrolledIntoView(i)||window.scrollTo({top:i.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;O.theme&&(O.theme.settings=new u(t))},this.router=a,s(this),this.startMessaging()}return Object.defineProperty(j.prototype,"specification",{get:function(){var e,t,i,o,a,s,r,d=this,p=this.page;return(null==p?void 0:p.type)===n.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===n.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===n.BRAND&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===n.BLOG&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===n.BLOG_CATEGORY&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===n.RAFFLE_DETAIL&&(r=null===(s=p.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var i;return e.id===(null===(i=t.selectedPageComponent)||void 0===i?void 0:i.componentId)}))},enumerable:!1,configurable:!0}),j.prototype.createLoadingListener=function(){var e=this;a((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},j.prototype.getVariantIdFromParams=function(o,n){var a,s;return e(this,void 0,void 0,(function(){var e,r,d,p,c,l,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+n),[4,O.searchProducts({input:{productIdList:[o],priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(s=null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||void 0===s?void 0:s.length)?[2]:(d=r.data.data[0],p=d.variantTypes.map((function(e){return e.variantType.slug})),c=[],p.forEach((function(t,i){var o=d.variantTypes[i],n=e.get(t);if(n){var a=o.variantType.values.find((function(e){return e.slug===n}));a&&c.push(a)}})),(l=d.variants.find((function(e){return e.variantValues.every((function(e){return c.some((function(t){return t.id===e.id}))}))})))?[2,l.id]:[3,3]);case 2:return m=t.sent(),console.error(m),[3,3];case 3:return[2]}}))}))},j.prototype.setCurrentPageType=function(){this.page&&(f.getInstance().currentPageType=this.page.type)},j}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(_||(_={}));export{_ as BridgeMessageType,j as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import{IkasBlogMetaDataTargetType as o}from"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as n}from"@ikas/storefront-models";import{reaction as a,makeAutoObservable as s,runInAction as r}from"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import{IkasHTMLMetaDataTargetType as d}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import{IkasThemeJson as p}from"../../models/data/theme-json/index.js";import{IkasStorefront as c}from"../../models/data/storefront/index.js";import{IkasThemeJsonComponent as l}from"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonSettings as u}from"../../models/data/theme-json/settings/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasPageDataProvider as g}from"@ikas/storefront-providers";import{IkasPageDataInit as h}from"../../page-data-init/index.js";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"./loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";import E from"../../store/html-meta-data/index.js";import v from"../../store/blog/index.js";import P from"../../store/raffle/index.js";import O from"../../store/product/index.js";import{setAPIClientConfig as T,listCustomerSettings as C}from"@ikas/storefront-api";var _,j=function(){function j(a){var O=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",O.onMessage,!1),O.sendMessage(_.FRAME_DID_LOAD,"5.0.0"),O.createLoadingListener()},this.onMessage=function(i){return e(O,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:switch(e=i.data.type,o=i.data.data,e){case _.UPDATE_FRAME_DATA:return[3,1];case _.UPDATE_THEME_JSON:return[3,3];case _.UPDATE_PROP_VALUE:return[3,5];case _.UPDATE_PAGE_PARAMS:return[3,7];case _.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case _.ADD_COMPONENT:return[3,11];case _.DELETE_COMPONENT:return[3,12];case _.UPDATE_COMPONENT:return[3,13];case _.ADD_PAGE_COMPONENT:return[3,14];case _.DELETE_PAGE_COMPONENT:return[3,16];case _.SET_SELECTED_COMPONENT:return[3,17];case _.SET_HOVERED_COMPONENT:return[3,18];case _.SCROLL_TO_COMPONENT:return[3,19];case _.EDITOR_RELOAD:return[3,20];case _.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(o)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(o)];case 5:return[4,this.handleUpdatePropValue(o)];case 7:return[4,this.handleUpdatePageParams(o)];case 9:return[4,this.handleUpdatePageComponentOrder(o)];case 11:return this.handleAddNewComponent(o),[3,23];case 12:return this.handleDeleteComponent(o),[3,23];case 13:return this.handleUpdateComponent(o),[3,23];case 14:return[4,this.handleAddNewPageComponent(o)];case 16:return this.handleDeletePageComponent(o),[3,23];case 17:return this.handleSetSelectedComponent(o),[3,23];case 18:return this.handleSetHoveredComponent(o),[3,23];case 19:return this.handleScrollToComponent(o),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(o),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){O.sendMessage(_.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){O.sendMessage(_.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){O.sendMessage(_.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(i){return e(O,void 0,void 0,(function(){var e,a,s,p,c,l,m,u,g,h,O,T,C,j=this;return t(this,(function(t){switch(t.label){case 0:return e=i.slice(1),a=e.split("?"),e=a[0],s=a[1],this.pageParams={},i.startsWith("/account/orders/")?p=n.ORDER_DETAIL:i.startsWith("/account/orders")?p=n.ORDERS:i.startsWith("/account/addresses")?p=n.ADDRESSES:i.startsWith("/account/favorite-products")?p=n.FAVORITE_PRODUCTS:i.startsWith("/account/forgot-password")?p=n.FORGOT_PASSWORD:i.startsWith("/account/login")?p=n.LOGIN:i.startsWith("/account/raffles")?p=n.RAFFLE_ACCOUNT:i.startsWith("/account/recover-password")?p=n.RECOVER_PASSWORD:i.startsWith("/account/activate")?p=n.ACTIVATE_CUSTOMER:i.startsWith("/account/register")?p=n.REGISTER:i.startsWith("/account")?p=n.ACCOUNT:i.startsWith("/blog/")?p=n.BLOG:i.startsWith("/blog")?p=n.BLOG_INDEX:i.startsWith("/pages")?(p=n.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=i.startsWith("/raffle/")?n.RAFFLE_DETAIL:i.startsWith("/raffle")?n.RAFFLE:i.startsWith("/404")?n.NOT_FOUND:"/cart"===i||"/cart/"===i?n.CART:i.startsWith("/checkout")?n.CHECKOUT:"/"===i?n.INDEX:i.startsWith("/search")?n.SEARCH:n.PRODUCT,p!==n.PRODUCT?[3,6]:[4,E.listHTMLMetaData({slug:{eq:e}})];case 1:return(l=t.sent()).isSuccess&&(null===(g=l.data)||void 0===g?void 0:g.length)?(m=l.data[0]).targetType!==d.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(m.targetId,s)]:[3,5];case 2:return c=t.sent(),this.pageParams={productId:m.targetId,variantId:c,slug:e},[3,4];case 3:if(m.targetType===d.CATEGORY)p=n.CATEGORY,this.pageParams={categoryId:m.targetId,slug:e};else{if(m.targetType!==d.BRAND)return[2];p=n.BRAND,this.pageParams={brandId:m.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==n.BLOG?[3,8]:[4,v.listBlogMetaData({slug:{eq:e}})];case 7:if(!(l=t.sent()).isSuccess||!(null===(O=null===(h=l.data)||void 0===h?void 0:h.data)||void 0===O?void 0:O.length))return[2];if((m=l.data.data[0]).targetType===o.BLOG)this.pageParams={blogId:m.targetId,slug:e};else{if(m.targetType!==o.BLOG_CATEGORY)return[2];p=n.BLOG_CATEGORY,this.pageParams={blogCategoryId:m.targetId,slug:e}}t.label=8;case 8:return p!==n.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData({slug:{eq:e}})];case 9:if(!(l=t.sent()).isSuccess||!(null===(T=l.data)||void 0===T?void 0:T.length))return[2];m=l.data[0],this.pageParams={raffleId:m.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return u=t.sent(),r((function(){var e,t;f.getInstance().currentPageType=p,j.pageDataProvider=u,p===n.CUSTOM?j.page=null===(e=j.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===j.pageParams.slug})):j.page=null===(t=j.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),j.setCurrentPageType(),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(_.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){O.sendMessage(_.EDITOR_LOADING_CHANGE,{isLoading:O.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(i,o,a){return e(O,void 0,void 0,(function(){var e,s,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(i,a,o),(a.blogId||a.blogCategoryId)&&(e.possiblePageTypes=[n.BLOG,n.BLOG_CATEGORY]),a.raffleId&&(e.possiblePageTypes=[n.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(h.setPageSpecificData(e.pageSpecificData,o,!0),o===n.PRODUCT&&h.pageSpecificData&&(s=h.pageSpecificData,(r=s.variants.find((function(e){return e.id===a.variantId})))&&(s.selectedVariantValues=r.variantValues))):h.pageSpecificData=void 0,this.initializedPropValues=h.initPagePropValues(e.$pageComponentPropValues,i.components,i.customData,i.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){O.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),i=t.top,o=t.bottom;return i<window.innerHeight&&o>=0&&o<window.innerHeight&&i>0},this.handleUpdateFrameData=function(o){return e(O,void 0,void 0,(function(){var e,n,a,s,r,d,l=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new p(o.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===o.selectedPage.id})),this.pageParams=o.pageParams,this.apiKey=o.apiKey,this.locale=o.locale||"en",this.translations=o.translations||void 0,this.setCurrentPageType(),this.page?((e=o.storefront?new c(o.storefront):null)&&(n=e.routings.find((function(e){return e.locale===l.locale})),i.init({storefrontId:e.id,storefrontRoutingId:null==n?void 0:n.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==n?void 0:n.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||i.getTranslations(),isEditor:!0,apiKey:o.apiKey,apiUrl:o.apiUrl,cdnUrl:o.cdnUrl,merchantSettings:o.merchantSettings}),T(),this.setCustomerSettings()),a=Date.now()+"",this.updateId=a,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return s=t.sent(),this.updateId===a&&(this.pageDataProvider=s,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(O,void 0,void 0,(function(){var e,o,n;return t(this,(function(t){switch(t.label){case 0:return i.getCustomerSettings()?[3,2]:[4,C({storefrontId:{eq:i.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.data.length)&&(o=e.data.data[0],i.init({customerSettings:o})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new p(i.theme),[2]}))}))},this.handleUpdatePropValue=function(i){return e(O,void 0,void 0,(function(){var e,o,n,a,s,r,d,p=this;return t(this,(function(t){switch(t.label){case 0:return e=i.propName,o=i.value,(n=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(a=this.initializedPropValues.find((function(e){return e.pageComponent.id===p.selectedPageComponentId})),this.pageDataProvider&&a?(this.selectedPageComponent.propValues[e]=o,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,n)]):[2]):[2];case 1:return(s=t.sent())&&JSON.stringify(s).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return a.propValues[e]=h.initPropValue(n,s,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(i){return e(O,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=i.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(i){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=i.pageComponents.map((function(e){return new m(e)})):this.page.components=i.pageComponents.map((function(e){return new m(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,i=new l(e.component);null===(t=O.theme)||void 0===t||t.components.push(i)},this.handleDeleteComponent=function(e){var t,i;(null===(t=O.theme)||void 0===t?void 0:t.components)&&(O.theme.components=O.theme.components.filter((function(t){return t.id!==e.componentId})));var o=O.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];O.specification&&O.specification.components&&(O.specification.components=o),!O.specification&&(null===(i=O.page)||void 0===i?void 0:i.components)&&(O.page.components=o)},this.handleUpdateComponent=function(e){var t=O.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(O.theme.components[t]=new l(e.component))},this.handleAddNewPageComponent=function(i){return e(O,void 0,void 0,(function(){var e,o,a,s,r,d,p;return t(this,(function(t){switch(t.label){case 0:return e=new m(i.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),a=h.initPageComponentPropValue(o,[o.component],this.theme.settings,!0),this.initializedPropValues.push(a),(null===(d=this.page)||void 0===d?void 0:d.type)===n.CHECKOUT?[2]:(s=null===(p=this.theme)||void 0===p?void 0:p.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==s?void 0:s.id)})),(null==s?void 0:s.isCommon)&&r||(i.customIndex?this.pageComponents.splice(i.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){O.specification?O.specification.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):O.page.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){O.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){O.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,i=O.componentRefs[t];i&&(O.isScrolledIntoView(i)||window.scrollTo({top:i.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;O.theme&&(O.theme.settings=new u(t))},this.router=a,s(this),this.startMessaging()}return Object.defineProperty(j.prototype,"specification",{get:function(){var e,t,i,o,a,s,r,d=this,p=this.page;return(null==p?void 0:p.type)===n.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===n.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===n.BRAND&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===n.BLOG&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===n.BLOG_CATEGORY&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===n.RAFFLE_DETAIL&&(r=null===(s=p.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var i;return e.id===(null===(i=t.selectedPageComponent)||void 0===i?void 0:i.componentId)}))},enumerable:!1,configurable:!0}),j.prototype.createLoadingListener=function(){var e=this;a((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},j.prototype.getVariantIdFromParams=function(o,n){var a,s;return e(this,void 0,void 0,(function(){var e,r,d,p,c,l,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+n),[4,O.searchProducts({input:{productIdList:[o],priceListId:i.getPriceListId(),salesChannelId:i.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(s=null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||void 0===s?void 0:s.length)?[2]:(d=r.data.data[0],p=d.variantTypes.map((function(e){return e.variantType.slug})),c=[],p.forEach((function(t,i){var o=d.variantTypes[i],n=e.get(t);if(n){var a=o.variantType.values.find((function(e){return e.slug===n}));a&&c.push(a)}})),(l=d.variants.find((function(e){return e.variantValues.every((function(e){return c.some((function(t){return t.id===e.id}))}))})))?[2,l.id]:[3,3]);case 2:return m=t.sent(),console.error(m),[3,3];case 3:return[2]}}))}))},j.prototype.setCurrentPageType=function(){this.page&&(f.getInstance().currentPageType=this.page.type)},j}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(_||(_={}));export{_ as BridgeMessageType,j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{observer as r}from"mobx-react-lite";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import t from"../../hooks/useDimension.js";import i from"./renderer/index.js";import{checkSavedSessionForPopups as n}from"./utils/index.js";import{IkasStorefrontPopupDeviceTypeEnum as m}from"@ikas/storefront-models";var s=r((function(){var r=t().isMobile;e.useEffect((function(){n()}),[]);var s=o.getStorefrontPopups().filter((function(e){return r?[m.ALL,m.MOBILE].includes(e.visibleDevice):[m.ALL,m.DESKTOP].includes(e.visibleDevice)}));return e.createElement(e.Fragment,null,s.map((function(r,o){return e.createElement(i,{storefrontPopup:r,key:r.id})})))}));export{s as PopupListRendererForPage};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { IkasStorefrontPopup } from "../../../models/data/storefront-popup";
|
|
3
|
+
import "swiper/css";
|
|
4
|
+
import "swiper/css/navigation";
|
|
5
|
+
import "swiper/css/pagination";
|
|
6
|
+
import "react-date-picker/dist/DatePicker.css";
|
|
7
|
+
declare type IkasStorefrontPopupRendererProps = {
|
|
8
|
+
storefrontPopup: IkasStorefrontPopup;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: React.FunctionComponent<IkasStorefrontPopupRendererProps>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e,__generator as o}from'./../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as p}from"mobx-react-lite";import d from"../../../hooks/useDimension.js";import{IkasStorefrontPopupDisplayTriggerTypeEnum as s}from"../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import{exitIntent as n}from"../utils/index.js";import{IkasStorefrontPopupRendererViewModel as i}from"./model.js";import'./../../../ext/swiper/swiper.css.js';import'./../../../ext/swiper/modules/navigation.css.js';import'./../../../ext/swiper/modules/pagination.css.js';import"react-date-picker/dist/DatePicker.css";import t from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/components/index.js';import'./../../../ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js';import"mobx";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js';var m=p((function(p){var m=p.storefrontPopup,l=r.useState((function(){return new i({},m)}))[0],u=d().isMobile;return r.useEffect((function(){e(void 0,void 0,void 0,(function(){var e,r;return o(this,(function(o){switch(o.label){case 0:return[4,l.init()];case 1:if(o.sent(),!l.isModalClosedByUser){if((e=l.storefrontPopupData.displaySettings.triggerType)===s.SCROLL_DOWN)return window.addEventListener("scroll",l.handleScroll),[2,function(){window.removeEventListener("scroll",l.handleScroll)}];if(e===s.EXIT_INTENT)return r=n({onExitIntent:function(){l.openModal()}}),[2,function(){r()}]}return[2]}}))}))}),[]),l.storefrontPopupData&&l.storefrontPopupData.contentJson&&!l.isLoading?r.createElement(t,{key:l.storefrontPopupData.id,popup:l.storefrontPopupData.contentJson,dynamicData:{products:l.popupProducts},sfProps:{onModalClose:l.onModalClose,onCustomerSave:l.onCustomerFormDataSave,isCustomerLoggedIn:l.isCustomerLoggedIn},isMobile:u}):null}));export{m as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PopupProductDictionary, PopupRendererSaveCustomerInput } from "@ikas/popup-renderer";
|
|
2
|
+
import { IkasStorefrontPopup } from "../../../models/data/storefront-popup";
|
|
3
|
+
export declare class IkasStorefrontPopupRendererViewModel {
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
storefrontPopup: IkasStorefrontPopup;
|
|
6
|
+
storefrontPopupData: IkasStorefrontPopup | null;
|
|
7
|
+
popupProducts: PopupProductDictionary;
|
|
8
|
+
isModalClosedByUser: boolean;
|
|
9
|
+
constructor(data: Partial<IkasStorefrontPopupRendererViewModel>, storefrontPopup: IkasStorefrontPopup);
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
getStorefrontPopup(): Promise<void>;
|
|
12
|
+
getStorefrontPopupProducts(): Promise<void>;
|
|
13
|
+
openModal(): void;
|
|
14
|
+
onModalClose(): void;
|
|
15
|
+
onCustomerFormDataSave(customer: PopupRendererSaveCustomerInput): Promise<void>;
|
|
16
|
+
initTeaser(): void;
|
|
17
|
+
checkDeviceType(): void;
|
|
18
|
+
initTriggerType(): void;
|
|
19
|
+
handleScroll(): void;
|
|
20
|
+
get isCustomerLoggedIn(): boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as o}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{makeObservable as r,observable as s,action as i,computed as n}from"mobx";import a from"../../../store/storefront-popup/index.js";import{IkasStorefrontPopup as p}from"../../../models/data/storefront-popup/index.js";import{addPopupToLocalStorage as u,getPopupsFromLocalStorage as d,getPopupProducts as l}from"../utils/index.js";import{IkasStorefrontPopupDisplayFrequencyEnum as c,IkasStorefrontPopupDisplayTriggerTypeEnum as f}from"../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import{IkasBaseStore as h}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";var m=function(){function m(t,o){this.isLoading=t.isLoading||!0,this.storefrontPopup=o,this.storefrontPopupData=t.storefrontPopupData||null,this.popupProducts=t.popupProducts||{},this.isModalClosedByUser=t.isModalClosedByUser||!1,r(this,{isLoading:s,storefrontPopup:s,storefrontPopupData:s,popupProducts:s,isModalClosedByUser:s,getStorefrontPopup:i.bound,getStorefrontPopupProducts:i.bound,openModal:i.bound,onModalClose:i.bound,init:i.bound,initTeaser:i.bound,checkDeviceType:i.bound,initTriggerType:i.bound,handleScroll:i.bound,onCustomerFormDataSave:i.bound,isCustomerLoggedIn:n})}return m.prototype.init=function(){return t(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.getStorefrontPopup()];case 1:return t.sent(),[4,this.getStorefrontPopupProducts()];case 2:return t.sent(),this.initTeaser(),this.checkDeviceType(),this.initTriggerType(),this.isLoading=!1,[2]}}))}))},m.prototype.getStorefrontPopup=function(){var r,s;return t(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(o){switch(o.label){case 0:return[4,a.listStorefrontPopup({idList:[this.storefrontPopup.id]})];case 1:return t=o.sent(),(null===(s=null===(r=t.data)||void 0===r?void 0:r.data)||void 0===s?void 0:s.length)&&(this.storefrontPopupData=new p(t.data.data[0]),i=d(),n=e.getSessionId(),i&&n&&i[n]&&this.storefrontPopupData.displaySettings.frequency===c.ONCE_PER_SESSION&&i[n].includes(this.storefrontPopup.id)&&(this.isModalClosedByUser=!0)),[2]}}))}))},m.prototype.getStorefrontPopupProducts=function(){var r,s;return t(this,void 0,void 0,(function(){var t;return o(this,(function(o){switch(o.label){case 0:return(null===(r=this.storefrontPopupData)||void 0===r?void 0:r.contentJson)?[4,l(this.storefrontPopupData.contentJson,e.getCdnUrl()||"",(null===(s=e.getMerchantSettings())||void 0===s?void 0:s.merchantId)||"",e.getPriceListId())]:[2];case 1:return t=o.sent(),this.popupProducts=t,[2]}}))}))},m.prototype.openModal=function(){var t;(null===(t=this.storefrontPopupData)||void 0===t?void 0:t.contentJson)&&(this.isModalClosedByUser||(this.storefrontPopupData.contentJson.modal.isVisible=!0))},m.prototype.onModalClose=function(){(this.isModalClosedByUser=!0,this.storefrontPopupData)&&(this.storefrontPopupData.displaySettings.frequency===c.ONCE_PER_SESSION&&u(this.storefrontPopup.id))},m.prototype.onCustomerFormDataSave=function(e){return t(this,void 0,void 0,(function(){var t,r,s,i;return o(this,(function(o){switch(o.label){case 0:return t=h.getInstance(),r=t.customerStore,s=r.customer,i="",i=s&&s.email?s.email:e.email?e.email:e.firstName+e.lastName,[4,r.saveCustomerFormData({email:i,firstName:e.firstName||(null==s?void 0:s.firstName)||"",lastName:e.lastName||(null==s?void 0:s.lastName)||"",birthDate:e.birthday||(null==s?void 0:s.birthDate)||"",phone:e.phone||(null==s?void 0:s.phone)||"",storefrontPopupId:this.storefrontPopup.id,subscriptions:{email:!!e.hasPermission,phone:!!e.hasPermission,sms:!!e.hasPermission}})];case 1:return o.sent(),[2]}}))}))},m.prototype.initTeaser=function(){var t;(null===(t=this.storefrontPopupData)||void 0===t?void 0:t.contentJson)&&this.storefrontPopupData.contentJson.modal.teaser.isActive&&(this.storefrontPopupData.contentJson.modal.selectedStep=this.storefrontPopupData.contentJson.modal.teaser.step)},m.prototype.checkDeviceType=function(){this.storefrontPopupData&&this.storefrontPopupData.visibleDevice},m.prototype.initTriggerType=function(){var t=this;if(this.storefrontPopupData){var o=this.storefrontPopupData.displaySettings.triggerType,e=this.storefrontPopupData.displaySettings.triggerValue||0;if(o===f.ON_PAGE_LOAD)setTimeout((function(){t.openModal()}),1e3*e)}},m.prototype.handleScroll=function(){if(this.storefrontPopupData){var t=this.storefrontPopupData.displaySettings.triggerType,o=this.storefrontPopupData.displaySettings.triggerValue||0;if(f.SCROLL_DOWN===t&&this.storefrontPopupData&&!this.isModalClosedByUser){var e=o,r=window.innerHeight,s=document.documentElement.scrollHeight;window.scrollY/(s-r)*100>=e&&this.openModal()}}},Object.defineProperty(m.prototype,"isCustomerLoggedIn",{get:function(){return!!h.getInstance().customerStore.customer},enumerable:!1,configurable:!0}),m}();export{m as IkasStorefrontPopupRendererViewModel};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Popup, PopupProduct } from "@ikas/popup-renderer";
|
|
2
|
+
export declare type SessionStorefrontPopups = Record<string, string[]>;
|
|
3
|
+
export declare const SESSION_POPUPS_KEY = "ikas-storefront-popups";
|
|
4
|
+
export declare const getPopupsFromLocalStorage: () => SessionStorefrontPopups | null;
|
|
5
|
+
export declare const addPopupToLocalStorage: (popupId: string) => void;
|
|
6
|
+
export declare const checkSavedSessionForPopups: () => void;
|
|
7
|
+
export declare function getPopupProducts(model: Popup, cdnURL: string, merchantId: string, priceListId?: string): Promise<Record<string, PopupProduct[]>>;
|
|
8
|
+
export declare const exitIntent: (options?: {}) => () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__spreadArray as e,__awaiter as r,__generator as o,__assign as n}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as d}from"@ikas/storefront-config";import t from"lodash/throttle";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/components/index.js';import{getPopupDynamicData as p}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js';import"mobx";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js';import{PopupElementTypeEnum as s}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js';import{ProductListTypeEnum as i,PopupProduct as u,MAX_PRODUCT_COUNT as l}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js';import{SortByDirectionEnum as a}from"@ikas/storefront-api";import m from"../../../store/product/index.js";var c="ikas-storefront-popups",f=function(){var e=localStorage.getItem("ikas-storefront-popups");return e?JSON.parse(e):null},v=function(r){var o=f()||{},n=d.getSessionId();if(n){var t=o[n]?o[n]:[],p=r;o[n]=e(e([],t,!0),[p],!1),localStorage.setItem("ikas-storefront-popups",JSON.stringify(o))}},g=function(){var e=d.getSessionId(),r=f();r&&e&&!Object.keys(r).includes(e)&&localStorage.removeItem("ikas-storefront-popups")};function b(e,t,c,f){var v,g,b;return r(this,void 0,void 0,(function(){var r,f,k,x,h,_,I;return o(this,(function(j){switch(j.label){case 0:r={},f=[],e.modal.steps.forEach((function(e){e.elements.forEach((function(e){e.type===s.PRODUCT_LIST&&f.push(e)}))})),k=p(e),x=function(p){var s,f,x,h,_,I,j,P,E,y;return o(this,(function(o){switch(o.label){case 0:switch(s={input:{}},f=p.sortType.includes("ASC")?a.ASC:a.DESC,x=p.sortType.replace("ASC_","").replace("DESC_",""),h={direction:f,type:x},p.listType){case i.ALL:case i.LAST_VIEWED:s.input={page:1,perPage:l,order:h?[h]:void 0};break;case i.SPECIFIC:(_=p.variantPairs||[]).length&&(I=_.map((function(e){return e.productId})),s.input={productIdList:I,page:1,perPage:l,order:h?[h]:void 0});break;case i.CATEGORY:j=p.categoryId,s.input={categoryIdList:j?[j]:void 0,page:1,perPage:l,order:h?[h]:void 0}}return p.listType!==i.CATEGORY||s.input.categoryIdList?[4,m.searchProducts({input:n(n({},s.input),{priceListId:d.getPriceListId(),salesChannelId:d.getSalesChannelId()})})]:[2,"continue"];case 1:return(P=o.sent())&&P.isSuccess&&(null===(g=null===(v=P.data)||void 0===v?void 0:v.data)||void 0===g?void 0:g.length)&&(null==(E=null===(b=P.data)||void 0===b?void 0:b.data)?void 0:E.length)&&(y=[],E.forEach((function(r){var o,n,d;if(p.listType===i.SPECIFIC){var s=k.variantPairs.filter((function(e){return e.productListElementId===p.id}));(m=r.variants.find((function(e){return s.some((function(o){return o.productId===r.id&&o.variantId===e.id}))})))&&(d=[m])}else d=(null==r?void 0:r.variants[0])?[r.variants[0]]:[];for(var l=0,a=d||[];l<a.length;l++){var m;if((m=a[l])&&r){var f=(null===(o=m.images)||void 0===o?void 0:o.length)?m.images[0]:null;y.push(new u({productId:r.id,variantId:m.id,name:r.name,price:m.formattedSellPrice,discountPrice:m.formattedDiscountPrice,discountRatio:m.discountPercentage?m.discountPercentage:null,imageURL:f?"".concat(t,"images/").concat(c,"/").concat(f.imageId):null,url:"".concat(e.storeUrl,"/").concat(null===(n=r.metaData)||void 0===n?void 0:n.slug)}))}}})),r[p.id]=y),[2]}}))},h=0,_=f,j.label=1;case 1:return h<_.length?(I=_[h],[5,x(I)]):[3,4];case 2:j.sent(),j.label=3;case 3:return h++,[3,1];case 4:return[2,r]}}))}))}var k=function(e){var r,o,d,p,s,i;return void 0===e&&(e={}),d=n(n({},{threshold:20,maxDisplays:1,eventThrottle:200,onExitIntent:function(){}}),e),p=new Map,s=0,i=function(){p.forEach((function(e,r,o){return function(e){var r=p.get(e),o=r.eventName,n=r.callback;document.removeEventListener(o,n),p.delete(e)}(r)}))},r="mousemove",o=t((function(e){e.clientY<=d.threshold&&s<d.maxDisplays&&(s++,1)&&(d.onExitIntent(),s>=d.maxDisplays&&i())}),d.eventThrottle),document.addEventListener(r,o,!1),p.set("document:".concat(r),{eventName:r,callback:o}),i};export{c as SESSION_POPUPS_KEY,v as addPopupToLocalStorage,g as checkSavedSessionForPopups,k as exitIntent,b as getPopupProducts,f as getPopupsFromLocalStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=function(r,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},t(r,n)};function r(r,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=r}t(r,n),r.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var n=function(){return n=Object.assign||function(t){for(var r,n=1,e=arguments.length;n<e;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},n.apply(this,arguments)};function e(t,r,n,e){return new(n||(n=Promise))((function(o,a){function c(t){try{u(e.next(t))}catch(t){a(t)}}function i(t){try{u(e.throw(t))}catch(t){a(t)}}function u(t){var r;t.done?o(t.value):(r=t.value,r instanceof n?r:new n((function(t){t(r)}))).then(c,i)}u((e=e.apply(t,r||[])).next())}))}function o(t,r){var n,e,o,a,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(c=0)),c;)try{if(n=1,e&&(o=2&i[0]?e.return:i[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,i[1])).done)return o;switch(e=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,e=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=r.call(t,c)}catch(t){i=[6,t],e=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function a(t,r,n){if(n||2===arguments.length)for(var e,o=0,a=r.length;o<a;o++)!e&&o in r||(e||(e=Array.prototype.slice.call(r,0,o)),e[o]=r[o]);return t.concat(e||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;export{n as __assign,e as __awaiter,r as __extends,o as __generator,a as __spreadArray};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";var t=function(t){var r=t.className,o=t.style;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:o,className:"icon "+(r||"")},e.createElement("path",{d:"M11.25 13.5L6.75 9L11.25 4.5",stroke:"#697586","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";var t=function(t){var r=t.className,o=t.style;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:o,className:"icon "+(r||"")},e.createElement("path",{d:"M6.75 13.5L11.25 9L6.75 4.5",stroke:"#697586","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";var t=function(t){var r=t.className,o=t.style;return e.createElement("svg",{className:"icon "+(r||""),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:o},e.createElement("path",{d:"M15 4.99998L5 15M5 4.99998L15 15",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import o from"react";import{observer as e}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as r,injectFontScript as n}from"../../helpers/index.js";var i=e((function(e){var i=e.element,a={display:"flex",alignItems:"center",justifyContent:r(i.horizontalAlignment),padding:"".concat(i.outerVerticalPadding,"px ").concat(i.outerHorizontalPadding,"px"),backgroundColor:i.bgColor},l={color:i.color,backgroundColor:i.buttonBgColor,fontSize:i.fontSize,fontWeight:i.fontWeight,fontFamily:n(i.fontFamily),textAlign:"center",border:"".concat(i.borderWidth,"px ").concat(i.borderStyle," ").concat(i.borderColor),borderRadius:i.borderRadius,padding:"".concat(i.verticalPadding,"px ").concat(i.horizontalPadding,"px")},c={width:"".concat(i.width,"%"),minWidth:"fit-content",cursor:"pointer"};return o.createElement("div",{style:a},o.createElement("a",{href:i.link||void 0,style:c},o.createElement("div",{dangerouslySetInnerHTML:{__html:i.text},style:t({},l)})))}));export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";import{observer as e}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as o}from"../../helpers/index.js";var r=e((function(e){var r=e.element,a={display:"flex",alignItems:"center",justifyContent:o(r.horizontalAlignment),padding:"".concat(r.verticalPadding,"px ").concat(r.horizontalPadding,"px"),backgroundColor:r.bgColor,width:"100%"},n={backgroundColor:r.borderColor,width:"".concat(r.width,"%"),height:"".concat(r.borderWidth,"px"),borderRadius:"".concat(r.borderRadius,"px")};return t.createElement("div",{style:a},t.createElement("div",{style:n}))}));export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{observer as t}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";var r=t((function(t){var r=t.checkboxItem;e.useEffect((function(){r.showInCheckedStatus?r.isChecked=!0:r.isChecked=!1}),[r.showInCheckedStatus]);var c=r.requiredToBeChecked;return e.createElement("div",{style:{width:"100%",display:"flex",gap:6,flexDirection:"column"}},e.createElement("div",{style:{width:"100%",display:"flex",gap:8,flexDirection:"row",alignItems:"center"}},e.createElement("input",{style:{width:"16px",height:"16px",cursor:"pointer"},type:"checkbox",checked:r.isChecked,onChange:function(){r.isChecked=!r.isChecked,c&&c.hasError&&r.isChecked&&(c.hasError=!1)}}),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:4}},e.createElement("div",{dangerouslySetInnerHTML:{__html:r.text}}),!!c&&e.createElement("span",null,"*"))),!!c&&c.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},c.validationErrorMessage))}));export{r as CheckboxItemView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{observer as r}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";import t from"react-date-picker";var a=r((function(r){var a=e.useState(!1),o=a[0],l=a[1],n=e.useRef(null);r.placeholder;var c=r.isRequired,i=r.inputLabel;r.updateCurrentInfo;var s=r.formInputSettings,u=r.value,d=r.onValueChange;return e.useEffect((function(){if(n.current){var e=n.current.getElementsByClassName("react-date-picker__wrapper");if(e.length>0){var r=e[0];r.style.backgroundColor=s.bgColor,r.style.border="".concat(s.borderWidth,"px solid ").concat(o?s.focusBorderColor:s.borderColor),r.style.borderRadius="".concat(s.borderRadius,"px"),r.style.fontSize="14px",r.style.padding="10px 12px",r.style.height="".concat(s.height,"px")}}}),[n.current]),e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"},ref:n},(i||c)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},i.text),c&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),c&&c.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},c.validationErrorMessage)),e.createElement(t,{onChange:function(e){return function(e){var r=e?e.valueOf().toString():"";d(r),c&&c.hasError&&r.length>0&&(c.hasError=!1)}(e)},value:u?new Date(Number(u)):null,className:"ikas-popup-datepicker",disableCalendar:!0,format:"dd / MM / yyyy",maxDate:new Date,clearIcon:null,onFocus:function(){return l(!0)},onBlur:function(){return function(){if(l(!1),n.current){var e=n.current.getElementsByClassName("react-date-picker__wrapper");e.length>0&&(e[0].style.border="".concat(s.borderWidth,"px solid ").concat(s.borderColor))}}()}}))}));export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{observer as r}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";var t=r((function(r){var t,o=e.useState(!1),n=o[0],i=o[1],l=r.genderFormItem,a=r.formInputSettings;r.onValueChange;var d={width:"100%",backgroundColor:a.bgColor,border:"".concat(a.borderWidth,"px solid ").concat(n?a.focusBorderColor:a.borderColor),color:l.genders.find((function(e){return e.isSelected}))?"black":"#697586",borderRadius:"".concat(a.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(a.height,"px"),appearance:"none",backgroundImage:"url(\"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' %3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 12px center",backgroundSize:"20px",cursor:"pointer"};return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(l.inputLabel||l.required)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},l.inputLabel&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},l.inputLabel.text),l.required&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),l.required&&l.required.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},l.required.validationErrorMessage)),e.createElement("select",{value:(null===(t=l.genders.find((function(e){return e.isSelected})))||void 0===t?void 0:t.type)||void 0,onChange:function(e){return r=e.target.value,l.genders.forEach((function(e){e.isSelected=e.type===r})),void(l.required&&l.required.hasError&&(l.required.hasError=!1));var r},style:d,onFocus:function(){return i(!0)},onBlur:function(){return i(!1)}},!!l.placeholder&&e.createElement("option",{value:"",disabled:!0,selected:!0,hidden:!0},l.placeholder.text),l.genders.filter((function(e){return!!e.label})).map((function(r){return e.createElement("option",{key:r.type,value:r.type},r.label)}))))}));export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e,__generator as t}from"../../../ext/tslib/tslib.es6.mjs.js";import r from"react";import{observer as n}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as o,injectFontScript as a}from"../../helpers/index.js";import{FormItemTypeEnum as i}from"../../models/modal/step/elements/form/index.js";import s from"../button-element-renderer/index.js";import l from"./input-item-view/index.js";import{CheckboxItemView as m}from"./checkbox-item-view/index.js";import u from"./date-item-view/index.js";import c from"./gender-item-view/index.js";var d=n((function(n){var d=n.element,f=n.popup,p=n.isPreviewMode,E=n.sfProps,I=r.useState(!1);I[0];var C=I[1],v=d,h=v.rows.slice().sort((function(e,t){return e.order-t.order})),S=v.formSettings,M=v.buttonSettings,g=v.bgColor,R={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:o(v.horizontalAlignment),gap:"".concat(S.gapBetweenItems,"px"),padding:"".concat(v.verticalPadding,"px ").concat(v.horizontalPadding,"px"),backgroundColor:g,width:"100%"},_={display:"flex",flexDirection:"row",width:"100%",gap:"".concat(S.gapBetweenItems,"px")},O={flex:1,display:"flex",alignItems:"flex-end",fontFamily:a(S.fontFamily),fontSize:S.fontSize},T=function(){return e(void 0,void 0,void 0,(function(){var e,r,n;return t(this,(function(t){switch(t.label){case 0:return e=f.modal.steps.findIndex((function(e){return e.id===f.modal.selectedStep.id})),r=e===f.modal.steps.length-2,!p&&E&&r?(C(!0),function(){var e=!1;return v.rows.forEach((function(t){t.columns.forEach((function(t){switch(t.type){case i.CUSTOMER_BIRTHDAY:var r=t.formItem;r.required&&!r.value&&(r.required.hasError=!0,e=!0);break;case i.CUSTOMER_EMAIL:case i.CUSTOMER_PHONE:case i.CUSTOMER_NAME:case i.CUSTOMER_SURNAME:case i.CHECKBOX_FORM_ITEM:var n=t.formItem;if(n.required&&!n.value){if(n.type===i.CUSTOMER_EMAIL&&(null==E?void 0:E.isCustomerLoggedIn))return;n.required.hasError=!0,e=!0}break;case i.CUSTOMER_GENDER:var o=t.formItem,a=o.genders.find((function(e){return e.isSelected}));o.required&&!a&&(o.required.hasError=!0,e=!0);case i.CHECKBOX_FORM_ITEM:var s=t.formItem;s.requiredToBeChecked&&!s.isChecked&&(s.requiredToBeChecked.hasError=!0,e=!0)}}))})),e}()?(C(!1),[2]):(n={},v.rows.forEach((function(e){e.columns.forEach((function(e){var t;switch(e.type){case i.CUSTOMER_BIRTHDAY:n.birthday=e.formItem.value;break;case i.CUSTOMER_EMAIL:n.email=e.formItem.value;break;case i.CUSTOMER_GENDER:n.gender=(null===(t=e.formItem.genders.find((function(e){return e.isSelected})))||void 0===t?void 0:t.type)||"";break;case i.CUSTOMER_PHONE:n.phone=e.formItem.value;break;case i.CUSTOMER_NAME:n.firstName=e.formItem.value||"";break;case i.CUSTOMER_SURNAME:n.lastName=e.formItem.value||"";break;case i.CHECKBOX_FORM_ITEM:n.hasPermission=e.formItem.isChecked}}))})),[4,E.onCustomerSave(n)])):[3,2];case 1:t.sent(),C(!1),t.label=2;case 2:return-1!==e&&e<f.modal.steps.length&&(f.modal.selectedStep=f.modal.steps[e+1]),[2]}}))}))},b={width:"".concat(M.width,"%"),minWidth:"fit-content"};return r.createElement("div",{style:R},h.map((function(e,t){return r.createElement("div",{style:_,key:t},e.columns.slice().sort((function(e,t){return e.order-t.order})).map((function(e,t){return r.createElement("div",{style:O,key:t},function(e){switch(e.type){case i.CUSTOMER_EMAIL:case i.CUSTOMER_PHONE:case i.CUSTOMER_NAME:case i.CUSTOMER_SURNAME:var t=e.formItem;return t.type===i.CUSTOMER_EMAIL&&(null==E?void 0:E.isCustomerLoggedIn)&&!p?null:r.createElement(l,{formInputSettings:S.formInputSettings,inputLabel:t.inputLabel,isRequired:t.required,onValueChange:function(e){return p?null:t.value=e},placeholder:t.placeholder,updateCurrentInfo:t.updateCurrentInfo,value:t.value||""});case i.CUSTOMER_BIRTHDAY:var n=e.formItem;return r.createElement(u,{formInputSettings:S.formInputSettings,inputLabel:n.inputLabel,isRequired:n.required,onValueChange:function(e){return p?null:n.value=e},placeholder:n.placeholder,updateCurrentInfo:n.updateCurrentInfo,value:n.value||""});case i.CUSTOMER_GENDER:var o=e.formItem;return r.createElement(c,{genderFormItem:o,formInputSettings:S.formInputSettings,onValueChange:function(e){return p?null:o.genders.forEach((function(t){t.isSelected=t.label===e}))}});case i.CHECKBOX_FORM_ITEM:return r.createElement(m,{checkboxItem:e.formItem})}}(e))})))})),r.createElement("div",{style:b,onClick:function(e){T(),e.preventDefault(),e.stopPropagation()}},r.createElement(s,{element:M})," "))}));export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{observer as t}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";var r=t((function(t){var r=e.useState(!1),o=r[0],l=r[1],n=t.placeholder,a=t.isRequired,i=t.inputLabel;t.updateCurrentInfo;var c=t.formInputSettings,d=t.value,u=t.onValueChange,p={width:"100%",backgroundColor:c.bgColor,border:"".concat(c.borderWidth,"px solid ").concat(o?c.focusBorderColor:c.borderColor),borderRadius:"".concat(c.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(c.height,"px")};return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(i||a)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},i.text),a&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),a&&a.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},a.validationErrorMessage)),e.createElement("input",{type:"text",placeholder:(null==n?void 0:n.text)||"",value:d||"",onChange:function(e){return function(e){u(e),a&&a.hasError&&e.length>0&&(a.hasError=!1)}(e.target.value)},style:p,onFocus:function(){return l(!0)},onBlur:function(){return l(!1)}}))}));export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{observer as t}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{ImageFitEnum as r}from"../../models/modal/step/elements/image/index.js";var i=t((function(t){var i=t.element,a=t.popup,d=t.editModeChildren,o=i;o.cdnURL||(o.cdnURL=a.cdnURL),o.merchantId||(o.merchantId=a.merchantId);var n=a.modal.windowSettings,c={width:n.takeFullWidth?"100%":n.maxWidth,backgroundColor:o.bgColor,padding:"".concat(o.verticalPadding,"px ").concat(o.horizontalPadding,"px"),borderRadius:o.borderRadius};if(!o.src&&a.isPreviewMode&&d)return e.createElement("div",{style:c},d);var m={objectFit:o.objectFit===r.CONTAIN?"contain":"cover",height:"100%"};return e.createElement("a",{href:o.link||void 0,style:c},o.src&&e.createElement("img",{src:o.src||void 0,width:"100% !important",style:m}))}));export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import i from"react";import{observer as e}from"../../../../../../mobx-react/dist/mobxreact.esm.js";import{getHorizontalAlignment as o}from"../../helpers/index.js";import{ImageFitEnum as n,ImagePositionEnum as a}from"../../models/modal/step/elements/image/index.js";var r=e((function(e){var r=e.element,d=e.popup,m=e.editModeChildren,c=r;if(c.cdnURL||(c.cdnURL=d.cdnURL),c.merchantId||(c.merchantId=d.merchantId),!c.src&&d.isPreviewMode&&m)return m;var s={display:"flex",alignItems:"center",justifyContent:o(c.horizontalAlignment),padding:"".concat(c.verticalPadding,"px ").concat(c.horizontalPadding,"px"),backgroundColor:c.bgColor,maxWidth:"100%"},l={borderRadius:"".concat(c.borderRadius,"px"),objectFit:c.objectFit===n.CONTAIN?"contain":"cover",width:"".concat(c.maxWidth,"%")};return c.imagePosition===a.DISABLE_FLOAT?i.createElement("a",{href:c.link||void 0,style:s},i.createElement("img",{src:c.src||void 0,width:100===c.maxWidth?"100% !important":void 0,style:l})):i.createElement("img",{src:c.src||void 0,width:100===c.maxWidth?"100% !important":void 0,style:t(t({},l),{padding:"".concat(c.verticalPadding,"px ").concat(c.horizontalPadding,"px"),backgroundColor:c.bgColor,float:c.imagePosition===a.FLOAT_LEFT?"left":"right"}),onClick:function(){c.link&&window.open(c.link,"_blank")}})}));export{r as default};
|