@ikas/storefront 2.0.38 → 2.0.39-alpha.1
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/_virtual/index.js_commonjs-proxy2.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy4.js +1 -1
- package/build/api/product-search/index.js +1 -1
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/page/head.d.ts +1 -1
- package/build/components/page/head.js +1 -1
- package/build/ikas.js +2 -2
- package/build/models/data/image/index.d.ts +2 -1
- package/build/models/data/image/index.js +1 -1
- package/build/models/data/simple-product/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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 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{__awaiter as t,__generator as e,__assign as n,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import r from'../../ext/graphql-tag/src/index.js';import{apollo as o}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as d,IkasCategoryPath as s,IkasFilterCategory as l}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"mobx";import{IkasHTMLMetaData as u}from"../../models/data/html-meta-data/index.js";import{IkasImage as c}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"../product-option-file/index.js";import{IkasProduct as m}from"../../models/data/product/index.js";import{IkasProductVariantType as p}from"../../models/data/product/variant-type/index.js";import{IkasProductVariant as v}from"../../models/data/product/variant/index.js";import{IkasProductPrice as g}from"../../models/data/product/variant/price/index.js";import{IkasProductAttribute as y}from"../../models/data/product-attribute/index.js";import{IkasProductAttributeValue as f}from"../../models/data/product/attribute-value/index.js";import{IkasProductFilter as I,IkasApplicableProductFilterValue as b,IkasProductFilterSettings as j}from"../../models/data/product-filter/index.js";import{IkasVariantType as h}from"../../models/data/variant-type/index.js";import{IkasVariantValue as x}from"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/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{IkasThemeStockPreference as $}from"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasProductTag as C}from"../../models/data/product-tag/index.js";import{IkasStorefrontConfig as w}from"../../storefront/index.js";import{IkasProductAttributeTableTemplate as S}from"../../models/data/product-attribute/product-attribute-table-template/index.js";var T,A,P,D=function(){function a(){}return a.searchProducts=function(a,d){var s;return void 0===d&&(d=!1),t(this,void 0,void 0,(function(){var t,l,u,c,m;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(T||(T=i(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "],["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{input:n(n({},a),{showStockOption:d?w.stockPreference:$.SHOW_ALL,locale:w.getCurrentLocale(),dynamicCurrencySettings:(null===(s=w.getCurrentRouting())||void 0===s?void 0:s.dynamicCurrencySettings)||null})}})];case 1:return l=e.sent(),u=l.data,(c=l.errors)&&c.length?(console.log(c),[2]):[2,n(n({},u.searchProducts),{data:u.searchProducts.data.map((function(t){return L(t)}))})];case 2:return m=e.sent(),console.log(m),[3,3];case 3:return[2]}}))}))},a.getProductFilterData=function(a){return t(this,void 0,void 0,(function(){var t,d,s,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(A||(A=i(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{categoryId:a||null,locale:w.getCurrentLocale()}})];case 1:return d=e.sent(),s=d.data,(u=d.errors)&&u.length?(console.log(u),[2]):[2,{filters:s.getProductFilterData.filters.map((function(t){var e;return new I(n(n({},t),{displayType:t.displayType,type:t.type,values:null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new b(t)})),settings:t.settings?new j(n(n({},t.settings),{sortType:t.settings.sortType})):null}))})),categories:s.getProductFilterData.categories?s.getProductFilterData.categories.map((function(t){var e;return new l({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})):null}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a.getRelatedProducts=function(a){var d;return t(this,void 0,void 0,(function(){var t,s,l,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(P||(P=i(["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "],["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "]))),[4,o.getClient().query({query:t,variables:n(n({},a),{limit:a.limit?a.limit:20,tagIds:a.tagIds?a.tagIds:null,dynamicCurrencySettings:(null===(d=w.getCurrentRouting())||void 0===d?void 0:d.dynamicCurrencySettings)||null})})];case 1:return s=e.sent(),l=s.data,(u=s.errors)&&u.length?(console.log(u),[2]):[2,{data:l.getRelatedProducts.map((function(t){return L(t)})),count:l.getRelatedProducts.length,facets:null,limit:20,page:1,totalCount:l.getRelatedProducts.length}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a}();function L(t){var e,n,i,r,o,l,I="local"===process.env.NEXT_PUBLIC_ENV;return new m({id:t.id,attributes:null===(e=t.attributes)||void 0===e?void 0:e.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),brand:new a({id:null===(n=t.brand)||void 0===n?void 0:n.id,name:null===(i=t.brand)||void 0===i?void 0:i.name,metaData:new u({slug:(null===(r=t.brand)||void 0===r?void 0:r.slug)||""})}),categories:null===(o=t.categories)||void 0===o?void 0:o.map((function(t){return new d({id:t.id,name:t.name,path:t.path.map((function(t){return new s(t)})),metaData:new u({slug:t.slug||""})})})),tags:null===(l=t.tags)||void 0===l?void 0:l.map((function(t){return new C({id:t.id,name:t.name})})),description:t.description||void 0,metaData:new u(t.metaData||void 0),name:t.name,shortDescription:t.shortDescription||void 0,productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map((function(t){return new p({variantType:new h({id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map((function(e){return new x({id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id})})).filter((function(e){return t.variantValueIds.includes(e.id)}))}),variantValueIds:t.variantValueIds})})),variants:t.variants.map((function(e){var n,i,r,o;return new v({id:e.id,productId:t.id,attributes:null===(n=e.attributes)||void 0===n?void 0:n.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),sku:e.sku,barcodeList:e.barcodeList||void 0,images:null===(i=e.images)||void 0===i?void 0:i.map((function(t){return new c(t.id)})),price:new g(null===(r=e.prices)||void 0===r?void 0:r.find((function(t){return w.priceListId?t.priceListId===w.priceListId:null===t.priceListId}))),stock:e.stocks.filter((function(t){var e;return I||w.isEditor||(null===(e=w.stockLocationIds)||void 0===e?void 0:e.includes(t.stockLocationId))})).reduce((function(t,e){return e.stockCount+t}),0)||0,variantValues:null===(o=e.variantValues)||void 0===o?void 0:o.map((function(e){var n=t.productVariantTypes.find((function(t){return t.variantType.id===e.variantTypeId})),i=null==n?void 0:n.variantType.values.find((function(t){return t.id===e.variantValueId}));return new x({id:e.variantValueId,name:null==i?void 0:i.name,colorCode:null==i?void 0:i.colorCode,thumbnailImageId:null==i?void 0:i.thumbnailImageId,variantTypeId:null==n?void 0:n.variantType.id})})),isActive:e.isActive})}))})}export{D as IkasProductSearchAPI};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as n,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import r from'../../ext/graphql-tag/src/index.js';import{apollo as o}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as d,IkasCategoryPath as s,IkasFilterCategory as l}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"mobx";import{IkasHTMLMetaData as u}from"../../models/data/html-meta-data/index.js";import{IkasImage as c}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"../product-option-file/index.js";import{IkasProduct as m}from"../../models/data/product/index.js";import{IkasProductVariantType as p}from"../../models/data/product/variant-type/index.js";import{IkasProductVariant as v}from"../../models/data/product/variant/index.js";import{IkasProductPrice as g}from"../../models/data/product/variant/price/index.js";import{IkasProductAttribute as y}from"../../models/data/product-attribute/index.js";import{IkasProductAttributeValue as f}from"../../models/data/product/attribute-value/index.js";import{IkasProductFilter as I,IkasApplicableProductFilterValue as b,IkasProductFilterSettings as j}from"../../models/data/product-filter/index.js";import{IkasVariantType as h}from"../../models/data/variant-type/index.js";import{IkasVariantValue as x}from"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/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{IkasThemeStockPreference as $}from"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasProductTag as C}from"../../models/data/product-tag/index.js";import{IkasStorefrontConfig as w}from"../../storefront/index.js";import{IkasProductAttributeTableTemplate as S}from"../../models/data/product-attribute/product-attribute-table-template/index.js";var T,A,P,D=function(){function a(){}return a.searchProducts=function(a,d){var s;return void 0===d&&(d=!1),t(this,void 0,void 0,(function(){var t,l,u,c,m;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(T||(T=i(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "],["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{input:n(n({},a),{showStockOption:d?w.stockPreference:$.SHOW_ALL,locale:w.getCurrentLocale(),dynamicCurrencySettings:(null===(s=w.getCurrentRouting())||void 0===s?void 0:s.dynamicCurrencySettings)||null})}})];case 1:return l=e.sent(),u=l.data,(c=l.errors)&&c.length?(console.log(c),[2]):[2,n(n({},u.searchProducts),{data:u.searchProducts.data.map((function(t){return L(t)}))})];case 2:return m=e.sent(),console.log(m),[3,3];case 3:return[2]}}))}))},a.getProductFilterData=function(a){return t(this,void 0,void 0,(function(){var t,d,s,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(A||(A=i(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),[4,o.getClient().query({query:t,variables:{categoryId:a||null,locale:w.getCurrentLocale()}})];case 1:return d=e.sent(),s=d.data,(u=d.errors)&&u.length?(console.log(u),[2]):[2,{filters:s.getProductFilterData.filters.map((function(t){var e;return new I(n(n({},t),{displayType:t.displayType,type:t.type,values:null===(e=t.values)||void 0===e?void 0:e.map((function(t){return new b(t)})),settings:t.settings?new j(n(n({},t.settings),{sortType:t.settings.sortType})):null}))})),categories:s.getProductFilterData.categories?s.getProductFilterData.categories.map((function(t){var e;return new l({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})):null}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a.getRelatedProducts=function(a){var d;return t(this,void 0,void 0,(function(){var t,s,l,u,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=r(P||(P=i(["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "],["\n query getRelatedProducts(\n $brandIds: [String!]\n $categoryIds: [String!]\n $dynamicCurrencySettings: SearchDynamicCurrencySettings\n $limit: Float\n $priceListId: String\n $productId: String!\n $salesChannelId: String\n $tagIds: [String!]\n ) {\n getRelatedProducts(\n brandIds: $brandIds\n categoryIds: $categoryIds\n dynamicCurrencySettings: $dynamicCurrencySettings\n limit: $limit\n priceListId: $priceListId\n productId: $productId\n salesChannelId: $salesChannelId\n tagIds: $tagIds\n )\n }\n "]))),[4,o.getClient().query({query:t,variables:n(n({},a),{limit:a.limit?a.limit:20,tagIds:a.tagIds?a.tagIds:null,dynamicCurrencySettings:(null===(d=w.getCurrentRouting())||void 0===d?void 0:d.dynamicCurrencySettings)||null})})];case 1:return s=e.sent(),l=s.data,(u=s.errors)&&u.length?(console.log(u),[2]):[2,{data:l.getRelatedProducts.map((function(t){return L(t)})),count:l.getRelatedProducts.length,facets:null,limit:20,page:1,totalCount:l.getRelatedProducts.length}];case 2:return c=e.sent(),console.log(c),[3,3];case 3:return[2]}}))}))},a}();function L(t){var e,n,i,r,o,l,I="local"===process.env.NEXT_PUBLIC_ENV;return new m({id:t.id,attributes:null===(e=t.attributes)||void 0===e?void 0:e.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),brand:new a({id:null===(n=t.brand)||void 0===n?void 0:n.id,name:null===(i=t.brand)||void 0===i?void 0:i.name,metaData:new u({slug:(null===(r=t.brand)||void 0===r?void 0:r.slug)||""})}),categories:null===(o=t.categories)||void 0===o?void 0:o.map((function(t){return new d({id:t.id,name:t.name,path:t.path.map((function(t){return new s(t)})),metaData:new u({slug:t.slug||""})})})),tags:null===(l=t.tags)||void 0===l?void 0:l.map((function(t){return new C({id:t.id,name:t.name})})),description:t.description||void 0,metaData:new u(t.metaData||void 0),name:t.name,shortDescription:t.shortDescription||void 0,productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map((function(t){return new p({variantType:new h({id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map((function(e){return new x({id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id})})).filter((function(e){return t.variantValueIds.includes(e.id)}))}),variantValueIds:t.variantValueIds})})),variants:t.variants.map((function(e){var n,i,r,o;return new v({id:e.id,productId:t.id,attributes:null===(n=e.attributes)||void 0===n?void 0:n.map((function(t){var e,n,i,r,o,a;return new f({value:t.value,productAttributeId:null===(e=t.productAttribute)||void 0===e?void 0:e.id,productAttributeOptionId:null===(n=t.productAttributeOption)||void 0===n?void 0:n.id,productAttribute:new y({id:null===(i=t.productAttribute)||void 0===i?void 0:i.id,name:null===(r=t.productAttribute)||void 0===r?void 0:r.name,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(a=t.productAttribute)||void 0===a?void 0:a.tableTemplate)?new S(t.productAttribute.tableTemplate):null}),productAttributeOption:t.productAttributeOption})})),sku:e.sku,barcodeList:e.barcodeList||void 0,images:null===(i=e.images)||void 0===i?void 0:i.map((function(t){return new c(t.id,t.isVideo)})),price:new g(null===(r=e.prices)||void 0===r?void 0:r.find((function(t){return w.priceListId?t.priceListId===w.priceListId:null===t.priceListId}))),stock:e.stocks.filter((function(t){var e;return I||w.isEditor||(null===(e=w.stockLocationIds)||void 0===e?void 0:e.includes(t.stockLocationId))})).reduce((function(t,e){return e.stockCount+t}),0)||0,variantValues:null===(o=e.variantValues)||void 0===o?void 0:o.map((function(e){var n=t.productVariantTypes.find((function(t){return t.variantType.id===e.variantTypeId})),i=null==n?void 0:n.variantType.values.find((function(t){return t.id===e.variantValueId}));return new x({id:e.variantValueId,name:null==i?void 0:i.name,colorCode:null==i?void 0:i.colorCode,thumbnailImageId:null==i?void 0:i.thumbnailImageId,variantTypeId:null==n?void 0:n.variantType.id})})),isActive:e.isActive})}))})}export{D as IkasProductSearchAPI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'../../../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as n}from"mobx-react-lite";import o from'../../../../ext/lodash/sortBy.js';import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as s}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import v from"../svg/arrow-down.js";import C from"../svg/cross.js";import h from"../svg/gift.js";import f from"./style.module.scss.js";import g from"../svg/ikas.js";var k=n((function(e){var t,n,o=e.vm,c=e.allowExpand,d=o.cart,p=o.checkout,E=u().t,C=a.useState(!c),h=C[0],k=C[1],x=a.useState(!1),j=x[0],A=x[1],w=a.useState(0),P=w[0],L=w[1],R=a.useState(null),I=R[0],D=R[1],_=a.useState(!1),B=_[0],U=_[1],V=a.useState(!1),F=V[0],G=V[1];a.useEffect((function(){c&&(h?I&&L(I.getBoundingClientRect().height):L(0))}),[h,I,c,B,F,j]);var M=[f.CartSummary,h?f.Visible:"",c?f.AllowExpand:""].join(" "),O=c?{height:P+"px"}:{},z=[f.ArrowDown,h?f.Rotated:""].join(" ");return d?a.createElement("div",{className:M},!!c&&a.createElement("div",{className:f.ExpandHeader,onClick:function(){return k(!h)}},a.createElement("div",{className:f.Left},E("checkout-page:summary")),a.createElement("div",{className:f.Price},a.createElement("span",{className:f.PriceText},"".concat(s(o.finalPrice,d.currencyCode)," (").concat(null===(t=o.cart)||void 0===t?void 0:t.items.length," ").concat(E("checkout-page:cartItemProduct"),")")),a.createElement("span",{className:z},a.createElement(v,null)))),a.createElement("div",{className:f.DetailsContainer,style:O},a.createElement("div",{className:f.Details,ref:D},null==d?void 0:d.items.map((function(e,t){return a.createElement("div",{key:t},a.createElement(m,{vm:o,cartItem:e,currencyCode:d.currencyCode}))})),a.createElement("div",{className:f.Divider}),a.createElement("div",{className:f.SubTotalInfo},j&&a.createElement("div",{className:f.NotificationContainer},a.createElement(l,{type:"warning",title:E("checkout-page:giftCodeErrorTitle"),content:E("checkout-page:giftCodeErrorDescription"),onClose:function(){return A(!1)}})),a.createElement(N,{label:E("checkout-page:subtotal"),value:s(d.totalPrice,d.currencyCode),tooltipText:E("checkout-page:subtotalTooltip")}),!!(null===(n=p.shippingLines)||void 0===n?void 0:n.length)&&a.createElement(N,{label:E("checkout-page:cartShippingTitle"),value:p.shippingTotal?s(p.shippingTotal,d.currencyCode):E("checkout-page:free")}),!!o.checkout.totalTax&&a.createElement(N,{label:E("checkout-page:cartTaxTitle"),value:s(o.checkout.totalTax,d.currencyCode)}),!!o.installmentExtraPrice&&a.createElement(N,{label:E("checkout-page:cartInterest"),value:s(o.installmentExtraPrice,d.currencyCode)}),a.createElement(y,{vm:o}),a.createElement(S,{vm:o}),(o.step===r.SUCCESS&&(!!o.checkout.note||!!o.checkout.appliedCouponCode)||o.step!==r.SUCCESS)&&a.createElement("div",{className:f.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),a.createElement(T,{vm:o,isAddingCoupon:F,setAddingCoupon:G,setCouponError:A}),a.createElement(b,{vm:o,isAddingNote:B,setAddingNote:U})),a.createElement("div",{className:f.TotalContainer},a.createElement("div",{className:f.TitleContainer},a.createElement("div",{className:f.Title},E("checkout-page:total"))),a.createElement("div",{className:f.TotalPrice},s(o.finalPrice,d.currencyCode))),a.createElement("div",{className:f.PoweredBy},a.createElement("span",null,"powered by"),a.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},a.createElement(g,null)))))):null})),N=n((function(e){var t=e.label,n=e.value,o=e.tooltipText;return a.createElement("div",{className:f.InfoRow},a.createElement("div",{className:f.Label},a.createElement("span",null,t),!!o&&a.createElement(E,{text:o,style:{marginLeft:"8px"}})),a.createElement("div",{className:f.Value},n))})),y=n((function(e){var t=e.vm,n=u().t;return t.cart?a.createElement(a.Fragment,null,o(t.checkout.nonCouponAdjustments||[],"order").map((function(e,o){return a.createElement("div",{className:f.InfoRow,key:o},a.createElement("div",{className:f.Label},"INTEREST"===e.name?n("checkout-page:cartInterest"):e.name),a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",a.createElement("span",null,s(e.amount,t.cart.currencyCode))))}))):null})),S=n((function(e){var t,n,o=e.vm,c=u().t;return o.cart?a.createElement(a.Fragment,null,o.step!==r.SUCCESS&&((null===(t=o.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(o.checkout.totalFinalPrice||0,o.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return a.createElement("div",{className:f.InfoRow,key:t},a.createElement("div",{className:f.Label},e.name),a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",a.createElement("span",null,s(e.amount,o.cart.currencyCode))))})),null===(n=o.checkout.giftPackageLines)||void 0===n?void 0:n.map((function(e,t){return a.createElement("div",{className:f.InfoRow,key:t},a.createElement("div",{className:f.Label},a.createElement("div",{className:f.GiftLabel},a.createElement(h,{style:{position:"relative",top:"-1px"}}),a.createElement("span",null,c("checkout-page:giftPackage")))),a.createElement("div",{className:f.Value},a.createElement("span",null,s(e.price,o.cart.currencyCode))))}))):null})),T=n((function(n){var o=n.vm,l=n.isAddingCoupon,i=n.setAddingCoupon,m=n.setCouponError,d=u().t,p=a.useState(""),E=p[0],v=p[1],h=a.useState(!1),g=h[0],k=h[1];if(o.step===r.SUCCESS&&!o.checkout.appliedCouponCode)return null;var N=o.checkout.couponAdjustment;return a.createElement("div",{className:f.InfoRow},!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:f.ActionTextBtn,onClick:function(){return i(!0)}},d("checkout-page:addCouponCode")),l&&a.createElement(c,{value:E,placeholder:d("checkout-page:couponCode"),buttonLabel:d("checkout-page:actions.apply"),onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return o.checkout.couponCode=E,k(!0),[4,o.onCouponCodeApply()];case 1:return e.sent(),k(!1),v(""),o.checkout.appliedCouponCode?(i(!1),m(!1)):(m(!0),o.checkout.couponCode=null),[2]}}))}))},isLoading:g,onChange:v}),!!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:[f.ActionTextBtn,f.NoUnderline,f.Light].join(" ")},d("checkout-page:couponCode"),a.createElement("span",{className:f.AppliedCoupon},a.createElement("span",{className:f.CouponCode},o.checkout.appliedCouponCode),o.step!==r.SUCCESS&&a.createElement("span",{className:f.ClearCoupon,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return o.checkout.couponCode=null,k(!0),[4,o.onCouponCodeDelete()];case 1:return e.sent(),k(!1),[2]}}))}))}},a.createElement(C,null)))),!!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===(null==N?void 0:N.type)?"- ":"")," ",a.createElement("span",null,s((null==N?void 0:N.amount)||0,o.cart.currencyCode))))})),b=n((function(e){var t=e.vm,n=e.isAddingNote,o=e.setAddingNote,c=u().t,l=a.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=a.useCallback((function(){o(!0)}),[]),s=a.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:a.createElement("div",{className:f.InfoRow},!n&&!m&&a.createElement("div",{className:f.ActionTextBtn,onClick:i},l),(n||m)&&a.createElement("div",{className:[f.CheckoutNoteContainer,m?f.Success:""].join(" ")},a.createElement("div",{className:f.Title},c("checkout-page:orderNote")),m?a.createElement("div",{className:f.CheckoutNoteDisplay},t.checkout.note):a.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:s})))}));export{k as CartSummary};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'../../../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as n}from"mobx-react-lite";import o from'../../../../ext/lodash/sortBy.js';import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as s}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import v from"../svg/arrow-down.js";import C from"../svg/cross.js";import h from"../svg/gift.js";import f from"./style.module.scss.js";import g from"../svg/ikas.js";var k=n((function(e){var t,n,o=e.vm,c=e.allowExpand,d=o.cart,p=o.checkout,E=u().t,C=a.useState(!c),h=C[0],k=C[1],x=a.useState(!1),j=x[0],A=x[1],w=a.useState(0),P=w[0],L=w[1],R=a.useState(null),I=R[0],D=R[1],_=a.useState(!1),B=_[0],U=_[1],V=a.useState(!1),F=V[0],G=V[1];a.useEffect((function(){c&&(h?I&&L(I.getBoundingClientRect().height):L(0))}),[h,I,c,B,F,j]);var M=[f.CartSummary,h?f.Visible:"",c?f.AllowExpand:""].join(" "),O=c?{height:P+"px"}:{},z=[f.ArrowDown,h?f.Rotated:""].join(" ");return d?a.createElement("div",{className:M},!!c&&a.createElement("div",{className:f.ExpandHeader,onClick:function(){return k(!h)}},a.createElement("div",{className:f.Left},E("checkout-page:summary")),a.createElement("div",{className:f.Price},a.createElement("span",{className:f.PriceText},"".concat(s(o.finalPrice||0,d.currencyCode)," (").concat(null===(t=o.cart)||void 0===t?void 0:t.items.length," ").concat(E("checkout-page:cartItemProduct"),")")),a.createElement("span",{className:z},a.createElement(v,null)))),a.createElement("div",{className:f.DetailsContainer,style:O},a.createElement("div",{className:f.Details,ref:D},null==d?void 0:d.items.map((function(e,t){return a.createElement("div",{key:t},a.createElement(m,{vm:o,cartItem:e,currencyCode:d.currencyCode}))})),a.createElement("div",{className:f.Divider}),a.createElement("div",{className:f.SubTotalInfo},j&&a.createElement("div",{className:f.NotificationContainer},a.createElement(l,{type:"warning",title:E("checkout-page:giftCodeErrorTitle"),content:E("checkout-page:giftCodeErrorDescription"),onClose:function(){return A(!1)}})),a.createElement(N,{label:E("checkout-page:subtotal"),value:s(d.totalPrice,d.currencyCode),tooltipText:E("checkout-page:subtotalTooltip")}),!!(null===(n=p.shippingLines)||void 0===n?void 0:n.length)&&a.createElement(N,{label:E("checkout-page:cartShippingTitle"),value:p.shippingTotal?s(p.shippingTotal,d.currencyCode):E("checkout-page:free")}),!!o.checkout.totalTax&&a.createElement(N,{label:E("checkout-page:cartTaxTitle"),value:s(o.checkout.totalTax,d.currencyCode)}),!!o.installmentExtraPrice&&a.createElement(N,{label:E("checkout-page:cartInterest"),value:s(o.installmentExtraPrice,d.currencyCode)}),a.createElement(y,{vm:o}),a.createElement(S,{vm:o}),(o.step===r.SUCCESS&&(!!o.checkout.note||!!o.checkout.appliedCouponCode)||o.step!==r.SUCCESS)&&a.createElement("div",{className:f.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),a.createElement(T,{vm:o,isAddingCoupon:F,setAddingCoupon:G,setCouponError:A}),a.createElement(b,{vm:o,isAddingNote:B,setAddingNote:U})),a.createElement("div",{className:f.TotalContainer},a.createElement("div",{className:f.TitleContainer},a.createElement("div",{className:f.Title},E("checkout-page:total"))),a.createElement("div",{className:f.TotalPrice},s(o.finalPrice||0,d.currencyCode))),a.createElement("div",{className:f.PoweredBy},a.createElement("span",null,"powered by"),a.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},a.createElement(g,null)))))):null})),N=n((function(e){var t=e.label,n=e.value,o=e.tooltipText;return a.createElement("div",{className:f.InfoRow},a.createElement("div",{className:f.Label},a.createElement("span",null,t),!!o&&a.createElement(E,{text:o,style:{marginLeft:"8px"}})),a.createElement("div",{className:f.Value},n))})),y=n((function(e){var t=e.vm,n=u().t;return t.cart?a.createElement(a.Fragment,null,o(t.checkout.nonCouponAdjustments||[],"order").map((function(e,o){return a.createElement("div",{className:f.InfoRow,key:o},a.createElement("div",{className:f.Label},"INTEREST"===e.name?n("checkout-page:cartInterest"):e.name),a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",a.createElement("span",null,s(e.amount,t.cart.currencyCode))))}))):null})),S=n((function(e){var t,n,o=e.vm,c=u().t;return o.cart?a.createElement(a.Fragment,null,o.step!==r.SUCCESS&&((null===(t=o.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(o.checkout.totalFinalPrice||0,o.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return a.createElement("div",{className:f.InfoRow,key:t},a.createElement("div",{className:f.Label},e.name),a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",a.createElement("span",null,s(e.amount,o.cart.currencyCode))))})),null===(n=o.checkout.giftPackageLines)||void 0===n?void 0:n.map((function(e,t){return a.createElement("div",{className:f.InfoRow,key:t},a.createElement("div",{className:f.Label},a.createElement("div",{className:f.GiftLabel},a.createElement(h,{style:{position:"relative",top:"-1px"}}),a.createElement("span",null,c("checkout-page:giftPackage")))),a.createElement("div",{className:f.Value},a.createElement("span",null,s(e.price,o.cart.currencyCode))))}))):null})),T=n((function(n){var o=n.vm,l=n.isAddingCoupon,i=n.setAddingCoupon,m=n.setCouponError,d=u().t,p=a.useState(""),E=p[0],v=p[1],h=a.useState(!1),g=h[0],k=h[1];if(o.step===r.SUCCESS&&!o.checkout.appliedCouponCode)return null;var N=o.checkout.couponAdjustment;return a.createElement("div",{className:f.InfoRow},!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:f.ActionTextBtn,onClick:function(){return i(!0)}},d("checkout-page:addCouponCode")),l&&a.createElement(c,{value:E,placeholder:d("checkout-page:couponCode"),buttonLabel:d("checkout-page:actions.apply"),onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return o.checkout.couponCode=E,k(!0),[4,o.onCouponCodeApply()];case 1:return e.sent(),k(!1),v(""),o.checkout.appliedCouponCode?(i(!1),m(!1)):(m(!0),o.checkout.couponCode=null),[2]}}))}))},isLoading:g,onChange:v}),!!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:[f.ActionTextBtn,f.NoUnderline,f.Light].join(" ")},d("checkout-page:couponCode"),a.createElement("span",{className:f.AppliedCoupon},a.createElement("span",{className:f.CouponCode},o.checkout.appliedCouponCode),o.step!==r.SUCCESS&&a.createElement("span",{className:f.ClearCoupon,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return o.checkout.couponCode=null,k(!0),[4,o.onCouponCodeDelete()];case 1:return e.sent(),k(!1),[2]}}))}))}},a.createElement(C,null)))),!!o.checkout.appliedCouponCode&&!l&&a.createElement("div",{className:f.Value},a.createElement("span",null,"DECREMENT"===(null==N?void 0:N.type)?"- ":"")," ",a.createElement("span",null,s((null==N?void 0:N.amount)||0,o.cart.currencyCode))))})),b=n((function(e){var t=e.vm,n=e.isAddingNote,o=e.setAddingNote,c=u().t,l=a.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=a.useCallback((function(){o(!0)}),[]),s=a.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:a.createElement("div",{className:f.InfoRow},!n&&!m&&a.createElement("div",{className:f.ActionTextBtn,onClick:i},l),(n||m)&&a.createElement("div",{className:[f.CheckoutNoteContainer,m?f.Success:""].join(" ")},a.createElement("div",{className:f.Title},c("checkout-page:orderNote")),m?a.createElement("div",{className:f.CheckoutNoteDisplay},t.checkout.note):a.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:s})))}));export{k as CartSummary};
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
pageSpecificDataStr?: string;
|
|
8
8
|
merchantSettingsStr?: string;
|
|
9
9
|
addOgpMetas?: boolean;
|
|
10
|
-
productReviewSummary
|
|
10
|
+
productReviewSummary?: string | null;
|
|
11
11
|
};
|
|
12
12
|
export declare const IkasPageHead: React.FC<Props>;
|
|
13
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__spreadArray as e}from'../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import r from"next/head.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as n}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"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasMerchantSettings as s}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../../api/product-option-file/index.js";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"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as d}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductDetail as m}from"../../models/ui/product-detail/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/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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as p}from"../../storefront/index.js";import{IkasPageDataInit as l}from"../../providers/page-data-init.js";var c=i((function(i){var c=i.pageType,u=i.pageTitle,f=i.pageDescription,g=i.pageSpecificDataStr,h=i.merchantSettingsStr,v=i.addOgpMetas,j=i.productReviewSummary,x="undefined"!=typeof window
|
|
1
|
+
import{__assign as t,__spreadArray as e}from'../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import r from"next/head.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as n}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"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasMerchantSettings as s}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../../api/product-option-file/index.js";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"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as d}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductDetail as m}from"../../models/ui/product-detail/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/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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as p}from"../../storefront/index.js";import{IkasPageDataInit as l}from"../../providers/page-data-init.js";var c=i((function(i){var c=i.pageType,u=i.pageTitle,f=i.pageDescription,g=i.pageSpecificDataStr,h=i.merchantSettingsStr,v=i.addOgpMetas,j=i.productReviewSummary,x="undefined"!=typeof window;o.useEffect((function(){var t;document.documentElement.lang=(null===(t=p.routings.find((function(t){return t.id===p.storefrontRoutingId})))||void 0===t?void 0:t.locale)||"tr"}),[c]);var y=o.useMemo((function(){if(h)return new s(JSON.parse(h))}),[h]),b=o.useMemo((function(){if(!g)return g;var t=JSON.parse(g);switch(c){case d.PRODUCT:return new m(t.product,t.selectedVariantValues);case d.CATEGORY:return new n(t);case d.BRAND:return new a(t);default:return g}}),[g]),w=o.useMemo((function(){if(b&&b.href)return"https://".concat(p.domain).concat(b.href)}),[b]),O=o.useMemo((function(){var t,e=[];if(v)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+p.domain}),u&&e.push({property:"og:title",content:u}),f&&e.push({property:"og:description",content:f}),e.push({property:"og:url",content:w||(x?window.location.href:"")||"https://".concat(p.domain)}),b&&c===d.PRODUCT){var o=b;o.selectedVariant.mainImage&&e.push({property:"og:image",content:null===(t=o.selectedVariant.mainImage)||void 0===t?void 0:t.src})}else y&&e.push({property:"og:image",content:y.logo.src});return e}),[u,b,w,f,y,v,y]),S=o.useMemo((function(){var o=[];if(y){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+p.domain},r=function(t){var e,o;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:null===(e=null==t?void 0:t.logo)||void 0===e?void 0:e.src,image:null===(o=null==t?void 0:t.logo)||void 0===o?void 0:o.src,url:"https://"+p.domain}}(y);o.push(i),o.push(r)}if(b&&c===d.PRODUCT){var a=function(e,o){var i,r;try{"undefined"!=typeof window&&l._initProductDetailOnBrowser(e);var a="https://".concat(p.domain).concat(e.href);return t(t({"@context":"https://schema.org/","@type":"Product",name:e.product.name,description:null===(i=e.product.metaData)||void 0===i?void 0:i.description,image:e.selectedVariant.images.map((function(t){return t.src})),productId:e.selectedVariant.id,sku:e.selectedVariant.sku,mpn:e.selectedVariant.barcodeList.length?e.selectedVariant.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(r=e.product.brand)||void 0===r?void 0:r.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:a,priceCurrency:e.selectedVariant.price.currency||"TRY",price:e.selectedVariant.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:e.selectedVariant.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(t){}}(b,j?JSON.parse(j):null);a&&o.push(a)}if(b&&c===d.CATEGORY){var n=function(t){var e,o,i;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(p.domain).concat(t.href),name:null===(e=t.metaData)||void 0===e?void 0:e.pageTitle,description:null===(o=t.metaData)||void 0===o?void 0:o.description,image:null===(i=t.image)||void 0===i?void 0:i.src}}catch(t){}}(b),s=function(t){try{return{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:t.path.length?e(e([],t.path.map((function(t,e){return{"@type":"ListItem",position:e+1,name:t.name,item:"https://"+p.domain+t.href}})),!0),[{"@type":"ListItem",position:t.path.length+1,name:t.name,item:"https://"+p.domain+t.href}],!1):[{"@type":"ListItem",position:1,name:t.name,item:"https://"+p.domain+t.href}]}}catch(t){}}(b);n&&o.push(n),s&&o.push(s)}return o}),[b,y]);return o.createElement(r,null,o.createElement("title",null,u||""),o.createElement("meta",{name:"description",content:f||""}),!!v&&O.map((function(t,e){return o.createElement("meta",{key:"".concat(t.content,"-").concat(e),property:t.property,content:t.content})})),!!S.length&&S.map((function(t,e){return o.createElement("script",{key:e,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}})})))}));export{c as IkasPageHead};
|