@ikas/storefront 2.0.6 → 2.0.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'../ext/
|
|
1
|
+
import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'../ext/
|
|
1
|
+
import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderComponent as e}from"../components/page/index.js";import{IkasBlogCategory as t,IkasBlog as i}from"../models/data/blog/index.js";import{IkasBrand as a}from"../models/data/brand/index.js";import{IkasCategory as r}from"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import{IkasImage as o}from"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import{observable as n}from"mobx";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import{IkasRaffle as u}from"../models/data/raffle/index.js";import{IkasSlider as s}from"../models/data/slider/index.js";import"../models/theme/theme.js";import{IkasThemePageType as l}from"../models/theme/page/index.js";import{IkasThemePageComponent as p}from"../models/theme/page/component/index.js";import{IkasThemeComponent as c}from"../models/theme/component/index.js";import{IkasThemeComponentPropType as m}from"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import{IkasBrandList as d}from"../models/ui/brand-list/index.js";import{IkasBlogList as f}from"../models/ui/blog-list/index.js";import{IkasBlogCategoryList as V}from"../models/ui/blog-category-list/index.js";import{IkasCategoryList as P}from"../models/ui/category-list/index.js";import{IkasNavigationLink as g}from"../models/ui/navigation-link/index.js";import{IkasProductDetail as _}from"../models/ui/product-detail/index.js";import{IkasProductList as L}from"../models/ui/product-list/index.js";import{IkasAttributeDetail as h}from"../models/ui/product-attribute-detail/index.js";import{IkasAttributeList as D}from"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-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/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{IkasComponentRenderer as v}from"../models/ui/component-renderer/index.js";import{IkasRaffleList as C}from"../models/ui/raffle-list/index.js";import{IkasThemeSettings as T}from"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import b from'../ext/lzutf8/build/production/lzutf8.js';import{IkasPageComponentPropValue as j}from"./page-data-get.js";import{getPlaceholderBrand as S,getPlaceholderCategory as B,getPlaceholderProduct as I,getPlaceholderBlog as w,getPlaceholderBlogCategory as x,getPlaceholderRaffle as O}from"./placeholders.js";var y=function(){function y(){}return y.setPageSpecificData=function(e,a,o){if(e){var n=JSON.parse(e);switch(a){case l.PRODUCT:var s=n;y.pageSpecificData=new _(s.product,s.selectedVariantValues),o&&this._initProductDetailOnBrowser(y.pageSpecificData);break;case l.CATEGORY:var p=n;y.pageSpecificData=new r(p);break;case l.BRAND:var c=n;y.pageSpecificData=new r(c);break;case l.BLOG:var m=n;y.pageSpecificData=new i(m);break;case l.BLOG_CATEGORY:var d=n;y.pageSpecificData=new t(d);break;case l.RAFFLE_DETAIL:var f=n;y.pageSpecificData=new u(f)}}else this.pageSpecificData=void 0},y.isServer=function(){return"undefined"==typeof window},y.initPropValues=function(e,t,i,a,r){var o=new T(JSON.parse(i)),n=a?b.decompress(e,{inputEncoding:"Base64"}):e,u=JSON.parse(n).map((function(e){return{pageComponent:new p(e.pageComponent),component:new c(e.component),propValues:e.propValues}}));return u.forEach((function(e){e.component.props.forEach((function(i){var a=e.propValues[i.name];if(null!=a)switch(i.type){case m.IMAGE:y.initImagePropValue(i,a,e);break;case m.IMAGE_LIST:y.initImageListPropValue(i,a,e);break;case m.BRAND:y.initBrandPropValue(i,a,e);break;case m.BRAND_LIST:y.initBrandListPropValue(i,a,e);break;case m.CATEGORY:y.initCategoryPropValue(i,a,e);break;case m.CATEGORY_LIST:y.initCategoryListPropValue(i,a,e);break;case m.PRODUCT_LIST:y.initProductListPropValue(i,a,e,t);break;case m.PRODUCT_DETAIL:y.initProductDetailPropValue(i,a,e,t);break;case m.PRODUCT_ATTRIBUTE:y.initAttributePropValue(i,a,e);break;case m.PRODUCT_ATTRIBUTE_LIST:y.initAttributeListPropValue(i,a,e);break;case m.LINK:case m.LIST_OF_LINK:y.initLinkPropValue(i,a,e);break;case m.COMPONENT:y.initComponentPropValue(i,a,e,t,o,r);break;case m.COMPONENT_LIST:y.initComponentListPropValue(i,a,e,t,o,r);break;case m.CUSTOM:y.initCustomDataPropValue(i,a,e,t,o,r);break;case m.BLOG:y.initBlogPropValue(i,a,e);break;case m.BLOG_LIST:y.initBlogListPropValue(i,a,e);break;case m.BLOG_CATEGORY:y.initBlogCategoryPropValue(i,a,e);break;case m.BLOG_LIST:y.initBlogCategoryListPropValue(i,a,e);break;case m.RAFFLE:y.initRafflePropValue(i,a,e);break;case m.RAFFLE_LIST:y.initRaffleListPropValue(i,a,e);break;case m.SLIDER:y.initSliderPropValue(i,a,e)}}))})),u},y.initBrandPropValue=function(e,t,i){i.propValues[e.name]=y._initBrandPropValue(t)},y._initBrandPropValue=function(e){return e.brandPropValue.usePageData?this.pageSpecificData:e.brand?new a(e.brand):S()},y.initBrandListPropValue=function(e,t,i){i.propValues[e.name]=y._initBrandListPropValue(t)},y._initBrandListPropValue=function(e){return new d(e)},y.initCategoryPropValue=function(e,t,i){i.propValues[e.name]=y._initCategoryPropValue(t)},y._initCategoryPropValue=function(e){return e.categoryPropValue.usePageData?this.pageSpecificData:e.category?new r(e.category):B()},y.initCategoryListPropValue=function(e,t,i){var a=new P(t);i.propValues[e.name]=a},y._initCategoryListPropValue=function(e){return new P(e)},y.initProductListPropValue=function(e,t,i,a){i.propValues[e.name]=this._initProductListPropValue(t,a)},y._initProductListPropValue=function(e,t){return new L(e,t)},y.initProductDetailPropValue=function(e,t,i,a){i.propValues[e.name]=this._initProductDetailPropValue(t,a)},y._initProductDetailPropValue=function(e,t){var i=I();return e.productDetailPropValue.usePageData?i=this.pageSpecificData:e.productDetail&&(i=new _(e.productDetail.product,e.productDetail.selectedVariantValues)),i.router=t,i},y._initProductDetailOnBrowser=function(e){var t=new URLSearchParams(window.location.search),i=t.get("vid");if(i){var a=e.product.variants.find((function(e){return e.id===i}));a&&(e.selectedVariantValues=a.variantValues)}else{var r=e.product.variantTypes.map((function(e){return e.variantType.slug})),o=[];r.forEach((function(i,a){var r=e.product.variantTypes[a],n=t.get(i);if(n){var u=r.variantType.values.find((function(e){return e.slug===n}));u&&o.push(u)}})),o.length===e.selectedVariantValues.length&&(e.selectedVariantValues=o)}},y.initAttributePropValue=function(e,t,i){i.propValues[e.name]=y._initAttributePropValue(t)},y._initAttributePropValue=function(e){var t=null;return e.attributePropValue.usePageData?t=this.pageSpecificData:e.productDetail&&(t=new _(e.productDetail.product,e.productDetail.selectedVariantValues)),new h(t,e.attributePropValue)},y.initAttributeListPropValue=function(e,t,i){i.propValues[e.name]=y._initAttributeListPropValue(t)},y._initAttributeListPropValue=function(e){var t=null;return e.attributeListPropValue.usePageData?t=this.pageSpecificData:e.productDetail&&(t=new _(e.productDetail.product,e.productDetail.selectedVariantValues)),new D(t,e.attributeListPropValue)},y.initLinkPropValue=function(e,t,i){i.propValues[e.name]=this._initLinkPropValue(t)},y._initLinkPropValue=function(e){return Array.isArray(e)?e.map((function(e){return new g(e.href,e.label,e.subLinks,e.isExternal||void 0)})):e?new g(e.href,e.label,e.subLinks,e.isExternal):void 0},y.initImagePropValue=function(e,t,i){i.propValues[e.name]=this._initImagePropValue(t)},y._initImagePropValue=function(e){return new o(e.id)},y.initImageListPropValue=function(e,t,i){i.propValues[e.name]=this._initImageListPropValue(t)},y._initImageListPropValue=function(e){return e.map((function(e){return new o(e.id)}))},y.initCustomDataPropValue=function(e,t,i,a,r,o){t&&t.value&&t.customData&&(i.propValues[e.name]=this._initCustomDataPropValue(t,t.customData,a,r,o))},y._initCustomDataPropValue=function(e,t,i,a,r){var o=this;if(!e)return null;var n=e.value;if(null==n)return null;switch(t.type){case m.BRAND:return this._initBrandPropValue(n);case m.BRAND_LIST:return this._initBrandListPropValue(n);case m.CATEGORY_LIST:return this._initCategoryListPropValue(n);case m.CATEGORY:return this._initCategoryPropValue(n);case m.IMAGE_LIST:return this._initImageListPropValue(n);case m.IMAGE:return this._initImagePropValue(n);case m.LINK:return this._initLinkPropValue(n);case m.PRODUCT_DETAIL:return this._initProductDetailPropValue(n,i);case m.PRODUCT_LIST:return this._initProductListPropValue(n,i);case m.PRODUCT_ATTRIBUTE:return this._initAttributePropValue(n);case m.PRODUCT_ATTRIBUTE_LIST:return this._initAttributeListPropValue(n);case m.BLOG:return this._initBlogPropValue(n);case m.BLOG_LIST:return this._initBlogListPropValue(n);case m.BLOG_CATEGORY:return this._initBlogCategoryPropValue(n);case m.BLOG_CATEGORY_LIST:return this._initBlogCategoryListPropValue(n);case m.RAFFLE:return this._initRafflePropValue(n);case m.RAFFLE_LIST:return this._initRaffleListPropValue(n);case m.SLIDER:return this._initSliderPropValue(n);case m.OBJECT:for(var u={},s=0,l=t.nestedData||[];s<l.length;s++){var p=l[s],c=n[p.key],d=void 0;p.customDataId&&(d=c.customData),u[p.key]=this._initCustomDataPropValue(c,d||p,i,a,r)}return u;case m.DYNAMIC_LIST:case m.STATIC_LIST:try{if(!n||!n.length)return null;var f=[],V=t.nestedData[0];return n.forEach((function(e){var t;V.customDataId&&(t=e.customData),f.push(o._initCustomDataPropValue(e,t||V,i,a,r))})),f}catch(e){return[]}case m.COMPONENT:return this._initComponentPropValue(n,i,a,r);case m.COMPONENT_LIST:return this._initComponentListPropValue(n,i,a,r);default:return n}},y.initComponentPropValue=function(e,t,i,a,r,o){i.propValues[e.name]=this._initComponentPropValue(t,a,r,o)},y._initComponentPropValue=function(t,i,a,r){var o=t.length?t[0]:void 0;if(o){var n=new j(o),u=this.initPropValues(JSON.stringify([n]),i,JSON.stringify(a),!1,r);if(u.length)return new v((function(){return e(u[0],a,-10)}))}},y.initComponentListPropValue=function(e,t,i,a,r,o){i.propValues[e.name]=this._initComponentListPropValue(t,a,r,o)},y._initComponentListPropValue=function(t,i,a,r){var o=this;return t&&t.length?t.map((function(t){var n=new j(t),u=o.initPropValues(JSON.stringify([n]),i,JSON.stringify(a),!1,r);return new v((function(){return e(u[0],a,-1)}))})):[]},y.initBlogPropValue=function(e,t,i){i.propValues[e.name]=y._initBlogPropValue(t)},y._initBlogPropValue=function(e){return e.blogPropValue.usePageData?this.pageSpecificData:e.blog?new i(e.blog):w()},y.initBlogListPropValue=function(e,t,i){i.propValues[e.name]=this._initBlogListPropValue(t)},y._initBlogListPropValue=function(e){return new f(e)},y.initBlogCategoryPropValue=function(e,t,i){i.propValues[e.name]=y._initBlogCategoryPropValue(t)},y._initBlogCategoryPropValue=function(e){return e.blogCategoryPropValue.usePageData?this.pageSpecificData:e.blogCategory?new t(e.blogCategory):x()},y.initBlogCategoryListPropValue=function(e,t,i){i.propValues[e.name]=this._initBlogCategoryListPropValue(t)},y._initBlogCategoryListPropValue=function(e){return new V(e)},y.initRafflePropValue=function(e,t,i){i.propValues[e.name]=y._initRafflePropValue(t)},y._initRafflePropValue=function(e){return e.rafflePropValue.usePageData?this.pageSpecificData:e.raffle?new u(e.raffle):O()},y.initRaffleListPropValue=function(e,t,i){i.propValues[e.name]=this._initRaffleListPropValue(t)},y._initRaffleListPropValue=function(e){return new C(e)},y.initSliderPropValue=function(e,t,i){i.propValues[e.name]=this._initSliderPropValue(t)},y._initSliderPropValue=function(e){return new s(e)},y.pageSpecificData=n({}),y}();export{y as IkasPageDataInit};
|
|
1
|
+
import{renderComponent as e}from"../components/page/index.js";import{IkasBlogCategory as t,IkasBlog as i}from"../models/data/blog/index.js";import{IkasBrand as a}from"../models/data/brand/index.js";import{IkasCategory as r}from"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import{IkasImage as o}from"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import{observable as n}from"mobx";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import{IkasRaffle as u}from"../models/data/raffle/index.js";import{IkasSlider as s}from"../models/data/slider/index.js";import"../models/theme/theme.js";import{IkasThemePageType as p}from"../models/theme/page/index.js";import{IkasThemePageComponent as l}from"../models/theme/page/component/index.js";import{IkasThemeComponent as c}from"../models/theme/component/index.js";import{IkasThemeComponentPropType as m}from"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import{IkasBrandList as d}from"../models/ui/brand-list/index.js";import{IkasBlogList as f}from"../models/ui/blog-list/index.js";import{IkasBlogCategoryList as V}from"../models/ui/blog-category-list/index.js";import{IkasCategoryList as P}from"../models/ui/category-list/index.js";import{IkasNavigationLink as g}from"../models/ui/navigation-link/index.js";import{IkasProductDetail as _}from"../models/ui/product-detail/index.js";import{IkasProductList as L}from"../models/ui/product-list/index.js";import{IkasAttributeDetail as h}from"../models/ui/product-attribute-detail/index.js";import{IkasAttributeList as D}from"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-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/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{IkasComponentRenderer as v}from"../models/ui/component-renderer/index.js";import{IkasRaffleList as C}from"../models/ui/raffle-list/index.js";import{IkasThemeSettings as T}from"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import S from'../ext/lzutf8/build/production/lzutf8.js';import{IkasPageComponentPropValue as b}from"./page-data-get.js";import{getPlaceholderBrand as j,getPlaceholderCategory as B,getPlaceholderProduct as I,getPlaceholderBlog as w,getPlaceholderBlogCategory as x,getPlaceholderRaffle as O}from"./placeholders.js";var y=function(){function y(){}return y.setPageSpecificData=function(e,a,o){if(e){var n=JSON.parse(e);switch(a){case p.PRODUCT:var s=n;y.pageSpecificData=new _(s.product,s.selectedVariantValues),o&&this._initProductDetailOnBrowser(y.pageSpecificData);break;case p.CATEGORY:var l=n;y.pageSpecificData=new r(l);break;case p.BRAND:var c=n;y.pageSpecificData=new r(c);break;case p.BLOG:var m=n;y.pageSpecificData=new i(m);break;case p.BLOG_CATEGORY:var d=n;y.pageSpecificData=new t(d);break;case p.RAFFLE_DETAIL:var f=n;y.pageSpecificData=new u(f)}}else this.pageSpecificData=void 0},y.isServer=function(){return"undefined"==typeof window},y.initPropValues=function(e,t,i,a,r){var o=new T(JSON.parse(i)),n=a?S.decompress(e,{inputEncoding:"Base64"}):e,u=JSON.parse(n).map((function(e){return{pageComponent:new l(e.pageComponent),component:new c(e.component),propValues:e.propValues}}));return u.forEach((function(e){e.component.props.forEach((function(i){var a=e.propValues[i.name];if(null!=a)switch(i.type){case m.IMAGE:y.initImagePropValue(i,a,e);break;case m.IMAGE_LIST:y.initImageListPropValue(i,a,e);break;case m.BRAND:y.initBrandPropValue(i,a,e);break;case m.BRAND_LIST:y.initBrandListPropValue(i,a,e);break;case m.CATEGORY:y.initCategoryPropValue(i,a,e);break;case m.CATEGORY_LIST:y.initCategoryListPropValue(i,a,e);break;case m.PRODUCT_LIST:y.initProductListPropValue(i,a,e,t);break;case m.PRODUCT_DETAIL:y.initProductDetailPropValue(i,a,e,t);break;case m.PRODUCT_ATTRIBUTE:y.initAttributePropValue(i,a,e);break;case m.PRODUCT_ATTRIBUTE_LIST:y.initAttributeListPropValue(i,a,e);break;case m.LINK:case m.LIST_OF_LINK:y.initLinkPropValue(i,a,e);break;case m.COMPONENT:y.initComponentPropValue(i,a,e,t,o,r);break;case m.COMPONENT_LIST:y.initComponentListPropValue(i,a,e,t,o,r);break;case m.CUSTOM:y.initCustomDataPropValue(i,a,e,t,o,r);break;case m.BLOG:y.initBlogPropValue(i,a,e);break;case m.BLOG_LIST:y.initBlogListPropValue(i,a,e);break;case m.BLOG_CATEGORY:y.initBlogCategoryPropValue(i,a,e);break;case m.BLOG_LIST:y.initBlogCategoryListPropValue(i,a,e);break;case m.RAFFLE:y.initRafflePropValue(i,a,e);break;case m.RAFFLE_LIST:y.initRaffleListPropValue(i,a,e);break;case m.SLIDER:y.initSliderPropValue(i,a,e)}}))})),u},y.initBrandPropValue=function(e,t,i){i.propValues[e.name]=y._initBrandPropValue(t)},y._initBrandPropValue=function(e){return e.brandPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.brand?new a(e.brand):j()},y.initBrandListPropValue=function(e,t,i){i.propValues[e.name]=y._initBrandListPropValue(t)},y._initBrandListPropValue=function(e){return new d(e)},y.initCategoryPropValue=function(e,t,i){i.propValues[e.name]=y._initCategoryPropValue(t)},y._initCategoryPropValue=function(e){return e.categoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.category?new r(e.category):B()},y.initCategoryListPropValue=function(e,t,i){var a=new P(t);i.propValues[e.name]=a},y._initCategoryListPropValue=function(e){return new P(e)},y.initProductListPropValue=function(e,t,i,a){i.propValues[e.name]=this._initProductListPropValue(t,a)},y._initProductListPropValue=function(e,t){return new L(e,t)},y.initProductDetailPropValue=function(e,t,i,a){i.propValues[e.name]=this._initProductDetailPropValue(t,a)},y._initProductDetailPropValue=function(e,t){var i=I();return e.productDetailPropValue.usePageData&&this.pageSpecificData?i=this.pageSpecificData:e.productDetail&&(i=new _(e.productDetail.product,e.productDetail.selectedVariantValues)),i.router=t,i},y._initProductDetailOnBrowser=function(e){var t=new URLSearchParams(window.location.search),i=t.get("vid");if(i){var a=e.product.variants.find((function(e){return e.id===i}));a&&(e.selectedVariantValues=a.variantValues)}else{var r=e.product.variantTypes.map((function(e){return e.variantType.slug})),o=[];r.forEach((function(i,a){var r=e.product.variantTypes[a],n=t.get(i);if(n){var u=r.variantType.values.find((function(e){return e.slug===n}));u&&o.push(u)}})),o.length===e.selectedVariantValues.length&&(e.selectedVariantValues=o)}},y.initAttributePropValue=function(e,t,i){i.propValues[e.name]=y._initAttributePropValue(t)},y._initAttributePropValue=function(e){var t=null;return e.attributePropValue.usePageData&&this.pageSpecificData?t=this.pageSpecificData:e.productDetail&&(t=new _(e.productDetail.product,e.productDetail.selectedVariantValues)),new h(t,e.attributePropValue)},y.initAttributeListPropValue=function(e,t,i){i.propValues[e.name]=y._initAttributeListPropValue(t)},y._initAttributeListPropValue=function(e){var t=null;return e.attributeListPropValue.usePageData&&this.pageSpecificData?t=this.pageSpecificData:e.productDetail&&(t=new _(e.productDetail.product,e.productDetail.selectedVariantValues)),new D(t,e.attributeListPropValue)},y.initLinkPropValue=function(e,t,i){i.propValues[e.name]=this._initLinkPropValue(t)},y._initLinkPropValue=function(e){return Array.isArray(e)?e.map((function(e){return new g(e.href,e.label,e.subLinks,e.isExternal||void 0)})):e?new g(e.href,e.label,e.subLinks,e.isExternal):void 0},y.initImagePropValue=function(e,t,i){i.propValues[e.name]=this._initImagePropValue(t)},y._initImagePropValue=function(e){return new o(e.id)},y.initImageListPropValue=function(e,t,i){i.propValues[e.name]=this._initImageListPropValue(t)},y._initImageListPropValue=function(e){return e.map((function(e){return new o(e.id)}))},y.initCustomDataPropValue=function(e,t,i,a,r,o){t&&t.value&&t.customData&&(i.propValues[e.name]=this._initCustomDataPropValue(t,t.customData,a,r,o))},y._initCustomDataPropValue=function(e,t,i,a,r){var o=this;if(!e)return null;var n=e.value;if(null==n)return null;switch(t.type){case m.BRAND:return this._initBrandPropValue(n);case m.BRAND_LIST:return this._initBrandListPropValue(n);case m.CATEGORY_LIST:return this._initCategoryListPropValue(n);case m.CATEGORY:return this._initCategoryPropValue(n);case m.IMAGE_LIST:return this._initImageListPropValue(n);case m.IMAGE:return this._initImagePropValue(n);case m.LINK:return this._initLinkPropValue(n);case m.PRODUCT_DETAIL:return this._initProductDetailPropValue(n,i);case m.PRODUCT_LIST:return this._initProductListPropValue(n,i);case m.PRODUCT_ATTRIBUTE:return this._initAttributePropValue(n);case m.PRODUCT_ATTRIBUTE_LIST:return this._initAttributeListPropValue(n);case m.BLOG:return this._initBlogPropValue(n);case m.BLOG_LIST:return this._initBlogListPropValue(n);case m.BLOG_CATEGORY:return this._initBlogCategoryPropValue(n);case m.BLOG_CATEGORY_LIST:return this._initBlogCategoryListPropValue(n);case m.RAFFLE:return this._initRafflePropValue(n);case m.RAFFLE_LIST:return this._initRaffleListPropValue(n);case m.SLIDER:return this._initSliderPropValue(n);case m.OBJECT:for(var u={},s=0,p=t.nestedData||[];s<p.length;s++){var l=p[s],c=n[l.key],d=void 0;l.customDataId&&(d=c.customData),u[l.key]=this._initCustomDataPropValue(c,d||l,i,a,r)}return u;case m.DYNAMIC_LIST:case m.STATIC_LIST:try{if(!n||!n.length)return null;var f=[],V=t.nestedData[0];return n.forEach((function(e){var t;V.customDataId&&(t=e.customData),f.push(o._initCustomDataPropValue(e,t||V,i,a,r))})),f}catch(e){return[]}case m.COMPONENT:return this._initComponentPropValue(n,i,a,r);case m.COMPONENT_LIST:return this._initComponentListPropValue(n,i,a,r);default:return n}},y.initComponentPropValue=function(e,t,i,a,r,o){i.propValues[e.name]=this._initComponentPropValue(t,a,r,o)},y._initComponentPropValue=function(t,i,a,r){var o=t.length?t[0]:void 0;if(o){var n=new b(o),u=this.initPropValues(JSON.stringify([n]),i,JSON.stringify(a),!1,r);if(u.length)return new v((function(){return e(u[0],a,-10)}))}},y.initComponentListPropValue=function(e,t,i,a,r,o){i.propValues[e.name]=this._initComponentListPropValue(t,a,r,o)},y._initComponentListPropValue=function(t,i,a,r){var o=this;return t&&t.length?t.map((function(t){var n=new b(t),u=o.initPropValues(JSON.stringify([n]),i,JSON.stringify(a),!1,r);return new v((function(){return e(u[0],a,-1)}))})):[]},y.initBlogPropValue=function(e,t,i){i.propValues[e.name]=y._initBlogPropValue(t)},y._initBlogPropValue=function(e){return e.blogPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.blog?new i(e.blog):w()},y.initBlogListPropValue=function(e,t,i){i.propValues[e.name]=this._initBlogListPropValue(t)},y._initBlogListPropValue=function(e){return new f(e)},y.initBlogCategoryPropValue=function(e,t,i){i.propValues[e.name]=y._initBlogCategoryPropValue(t)},y._initBlogCategoryPropValue=function(e){return e.blogCategoryPropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.blogCategory?new t(e.blogCategory):x()},y.initBlogCategoryListPropValue=function(e,t,i){i.propValues[e.name]=this._initBlogCategoryListPropValue(t)},y._initBlogCategoryListPropValue=function(e){return new V(e)},y.initRafflePropValue=function(e,t,i){i.propValues[e.name]=y._initRafflePropValue(t)},y._initRafflePropValue=function(e){return e.rafflePropValue.usePageData&&this.pageSpecificData?this.pageSpecificData:e.raffle?new u(e.raffle):O()},y.initRaffleListPropValue=function(e,t,i){i.propValues[e.name]=this._initRaffleListPropValue(t)},y._initRaffleListPropValue=function(e){return new C(e)},y.initSliderPropValue=function(e,t,i){i.propValues[e.name]=this._initSliderPropValue(t)},y._initSliderPropValue=function(e){return new s(e)},y.pageSpecificData=n({}),y}();export{y as IkasPageDataInit};
|