@ikas/storefront 1.0.6 → 1.0.8
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/__generated__/global-types.d.ts +3 -0
- package/build/api/blog/__generated__/getBlog.d.ts +25 -0
- package/build/api/blog/__generated__/listBlog.d.ts +25 -0
- package/build/api/blog/__generated__/listBlogCategory.d.ts +25 -0
- package/build/api/blog/__generated__/listBlogMetaData.d.ts +27 -1
- package/build/api/blog/index.d.ts +1 -1
- package/build/api/brand/__generated__/listProductBrand.d.ts +41 -0
- package/build/api/cart/__generated__/getCart.d.ts +92 -0
- package/build/api/cart/__generated__/saveItemToCart.d.ts +114 -1
- package/build/api/category/__generated__/listCategory.d.ts +47 -0
- package/build/api/category/__generated__/listCategoryPaths.d.ts +9 -0
- package/build/api/checkout/__generated__/getCheckoutById.d.ts +339 -1
- package/build/api/checkout/__generated__/getOrder.d.ts +406 -1
- package/build/api/city/__generated__/listCity.d.ts +6 -0
- package/build/api/country/__generated__/listCountry.d.ts +18 -0
- package/build/api/customer/__generated__/createOrderRefundRequest.d.ts +375 -0
- package/build/api/customer/__generated__/customerLogin.d.ts +85 -0
- package/build/api/customer/__generated__/getCustomerOrders.d.ts +406 -1
- package/build/api/customer/__generated__/getMyCustomer.d.ts +82 -0
- package/build/api/customer/__generated__/registerCustomer.d.ts +79 -0
- package/build/api/customer/__generated__/saveMyCustomer.d.ts +85 -0
- package/build/api/customer-review/__generated__/listCustomerReviews.d.ts +25 -0
- package/build/api/district/__generated__/listDistrict.d.ts +3 -0
- package/build/api/html-meta-data/__generated__/listHTMLMetaData.d.ts +11 -1
- package/build/api/html-meta-data/index.d.ts +1 -1
- package/build/api/product-attribute/__generated__/listProductAttribute.d.ts +33 -0
- package/build/api/product-search/__generated__/getProductFilterData.d.ts +9 -0
- package/build/api/state/__generated__/listState.d.ts +6 -0
- package/build/api/variant-type/__generated__/listVariantType.d.ts +37 -0
- package/build/index.es.js +551 -343
- package/build/index.js +551 -343
- package/build/models/ui/navigation-link/index.d.ts +1 -0
- package/build/providers/page-data-get.d.ts +4 -0
- package/build/providers/prop-value/link.d.ts +8 -1
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -13692,13 +13692,15 @@ var IkasBlogAPI = /** @class */ (function () {
|
|
|
13692
13692
|
});
|
|
13693
13693
|
});
|
|
13694
13694
|
};
|
|
13695
|
-
IkasBlogAPI.listBlogMetaData = function (slug,
|
|
13695
|
+
IkasBlogAPI.listBlogMetaData = function (slug, targetIds, targetType, page, limit) {
|
|
13696
|
+
if (page === void 0) { page = 1; }
|
|
13697
|
+
if (limit === void 0) { limit = 200; }
|
|
13696
13698
|
return __awaiter(this, void 0, void 0, function () {
|
|
13697
13699
|
var LIST_QUERY, _a, data, errors, err_3;
|
|
13698
13700
|
return __generator(this, function (_b) {
|
|
13699
13701
|
switch (_b.label) {
|
|
13700
13702
|
case 0:
|
|
13701
|
-
LIST_QUERY = src(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n query listBlogMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: BlogMetadataTargetTypeEnumFilter\n ) {\n listBlogMetadata(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n count\n data {\n createdAt\n deleted\n description\n id\n pageTitle\n slug\n targetId\n targetType\n updatedAt\n }\n hasNext\n limit\n page\n }\n }\n "], ["\n query listBlogMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: BlogMetadataTargetTypeEnumFilter\n ) {\n listBlogMetadata(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n count\n data {\n createdAt\n deleted\n description\n id\n pageTitle\n slug\n targetId\n targetType\n updatedAt\n }\n hasNext\n limit\n page\n }\n }\n "])));
|
|
13703
|
+
LIST_QUERY = src(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n query listBlogMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: BlogMetadataTargetTypeEnumFilter\n $pagination: PaginationInput\n ) {\n listBlogMetadata(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n pagination: $pagination\n ) {\n count\n data {\n createdAt\n deleted\n description\n id\n pageTitle\n slug\n targetId\n targetType\n updatedAt\n }\n hasNext\n limit\n page\n }\n }\n "], ["\n query listBlogMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: BlogMetadataTargetTypeEnumFilter\n $pagination: PaginationInput\n ) {\n listBlogMetadata(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n pagination: $pagination\n ) {\n count\n data {\n createdAt\n deleted\n description\n id\n pageTitle\n slug\n targetId\n targetType\n updatedAt\n }\n hasNext\n limit\n page\n }\n }\n "])));
|
|
13702
13704
|
_b.label = 1;
|
|
13703
13705
|
case 1:
|
|
13704
13706
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -13712,9 +13714,9 @@ var IkasBlogAPI = /** @class */ (function () {
|
|
|
13712
13714
|
eq: slug,
|
|
13713
13715
|
}
|
|
13714
13716
|
: undefined,
|
|
13715
|
-
targetId:
|
|
13717
|
+
targetId: targetIds
|
|
13716
13718
|
? {
|
|
13717
|
-
|
|
13719
|
+
in: targetIds,
|
|
13718
13720
|
}
|
|
13719
13721
|
: undefined,
|
|
13720
13722
|
targetType: targetType
|
|
@@ -13722,6 +13724,10 @@ var IkasBlogAPI = /** @class */ (function () {
|
|
|
13722
13724
|
in: targetType,
|
|
13723
13725
|
}
|
|
13724
13726
|
: undefined,
|
|
13727
|
+
pagination: {
|
|
13728
|
+
page: page,
|
|
13729
|
+
limit: limit,
|
|
13730
|
+
},
|
|
13725
13731
|
},
|
|
13726
13732
|
})];
|
|
13727
13733
|
case 2:
|
|
@@ -36792,26 +36798,30 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
36792
36798
|
Object.defineProperty(IkasProductDetail.prototype, "displayedVariantTypes", {
|
|
36793
36799
|
get: function () {
|
|
36794
36800
|
var _this = this;
|
|
36795
|
-
var displayedVariantTypes = this.product.variantTypes.map(function (productVariantType) {
|
|
36801
|
+
var displayedVariantTypes = this.product.variantTypes.map(function (productVariantType, index) {
|
|
36796
36802
|
var variantType = productVariantType.variantType;
|
|
36797
36803
|
var displayedVariantValues = [];
|
|
36804
|
+
var parentProductVariantTypes = index > 0 ? _this.product.variantTypes.slice(0, index) : null;
|
|
36805
|
+
var parentSelectedVariantValues = [];
|
|
36806
|
+
if (parentProductVariantTypes) {
|
|
36807
|
+
parentSelectedVariantValues = _this.selectedVariantValues.filter(function (vv) {
|
|
36808
|
+
return parentProductVariantTypes.some(function (pvt) { return pvt.variantType.id === vv.variantTypeId; });
|
|
36809
|
+
});
|
|
36810
|
+
}
|
|
36798
36811
|
variantType.values.forEach(function (variantValue) {
|
|
36799
|
-
var
|
|
36800
|
-
var
|
|
36801
|
-
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
|
|
36812
|
+
var variantValues = __spreadArrays(parentSelectedVariantValues, [variantValue]);
|
|
36813
|
+
var variant = _this.product.variants.find(function (variant) {
|
|
36814
|
+
return variant.isActive &&
|
|
36815
|
+
variantValues.every(function (vv) {
|
|
36816
|
+
return variant.variantValues.some(function (vvv) { return vvv.id === vv.id; });
|
|
36817
|
+
});
|
|
36805
36818
|
});
|
|
36806
36819
|
var isSelected = _this.selectedVariant.variantValues.some(function (vv) { return vv.id === variantValue.id; });
|
|
36807
|
-
var hasStock = variant
|
|
36808
|
-
? variant.stock > 0 && variant.isActive
|
|
36809
|
-
: true;
|
|
36810
36820
|
if (variant) {
|
|
36811
36821
|
displayedVariantValues.push({
|
|
36812
36822
|
variant: variant,
|
|
36813
36823
|
variantValue: variantValue,
|
|
36814
|
-
hasStock: hasStock,
|
|
36824
|
+
hasStock: variant.hasStock,
|
|
36815
36825
|
isSelected: isSelected,
|
|
36816
36826
|
});
|
|
36817
36827
|
}
|
|
@@ -36875,15 +36885,59 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
36875
36885
|
return variantValue;
|
|
36876
36886
|
return vv;
|
|
36877
36887
|
});
|
|
36878
|
-
this.
|
|
36888
|
+
var selectedVariant = this.product.variants.find(function (variant) {
|
|
36889
|
+
return variant.isActive &&
|
|
36890
|
+
selectedVariantValues.every(function (selectedVariantValue) {
|
|
36891
|
+
return variant.variantValues.some(function (vvv) { return vvv.id === selectedVariantValue.id; });
|
|
36892
|
+
});
|
|
36893
|
+
});
|
|
36894
|
+
if (selectedVariant) {
|
|
36895
|
+
this.selectedVariantValues = selectedVariantValues;
|
|
36896
|
+
}
|
|
36897
|
+
else {
|
|
36898
|
+
var variantTypeIndex = this.product.variantTypes.findIndex(function (pvt) { return pvt.variantType.id === variantValue.variantTypeId; });
|
|
36899
|
+
if (variantTypeIndex > 0) {
|
|
36900
|
+
var parentVariantTypes_1 = this.product.variantTypes.slice(0, variantTypeIndex);
|
|
36901
|
+
var selectedParentVariantValues = this.selectedVariantValues.filter(function (vv) {
|
|
36902
|
+
return parentVariantTypes_1.some(function (pvt) { return pvt.variantType.id === vv.variantTypeId; });
|
|
36903
|
+
});
|
|
36904
|
+
var allVariantValues_1 = __spreadArrays(selectedParentVariantValues, [variantValue]);
|
|
36905
|
+
selectedVariant = this.product.variants.find(function (variant) {
|
|
36906
|
+
return variant.isActive &&
|
|
36907
|
+
allVariantValues_1.every(function (avv) {
|
|
36908
|
+
return variant.variantValues.some(function (vv) { return vv.id === avv.id; });
|
|
36909
|
+
});
|
|
36910
|
+
});
|
|
36911
|
+
}
|
|
36912
|
+
else {
|
|
36913
|
+
// Try to find a variant by only changing the last variant value
|
|
36914
|
+
// This helps with UX
|
|
36915
|
+
var notLastVariantValues_1 = selectedVariantValues.slice(0, selectedVariantValues.length - 1);
|
|
36916
|
+
selectedVariant = this.product.variants.find(function (variant) {
|
|
36917
|
+
return variant.isActive &&
|
|
36918
|
+
notLastVariantValues_1.every(function (nlvv) {
|
|
36919
|
+
return variant.variantValues.some(function (vv) { return vv.id === nlvv.id; });
|
|
36920
|
+
});
|
|
36921
|
+
});
|
|
36922
|
+
if (!selectedVariant)
|
|
36923
|
+
selectedVariant = this.product.variants.find(function (variant) {
|
|
36924
|
+
return variant.isActive &&
|
|
36925
|
+
variant.variantValues.some(function (vv) { return vv.id === variantValue.id; });
|
|
36926
|
+
});
|
|
36927
|
+
}
|
|
36928
|
+
if (selectedVariant)
|
|
36929
|
+
this.selectedVariantValues = selectedVariant.variantValues;
|
|
36930
|
+
else
|
|
36931
|
+
return; // This case should not happen
|
|
36932
|
+
}
|
|
36879
36933
|
var variantParams = this.product.variantTypes
|
|
36880
36934
|
.map(function (pvt) {
|
|
36881
36935
|
var vt = pvt.variantType;
|
|
36882
|
-
var
|
|
36936
|
+
var selectedVariantValue = vt.values.find(function (vv) {
|
|
36883
36937
|
return _this.selectedVariantValues.some(function (svv) { return svv.id === vv.id; });
|
|
36884
36938
|
});
|
|
36885
|
-
if (
|
|
36886
|
-
return vt.slug + "=" +
|
|
36939
|
+
if (selectedVariantValue)
|
|
36940
|
+
return vt.slug + "=" + selectedVariantValue.slug;
|
|
36887
36941
|
})
|
|
36888
36942
|
.filter(function (param) { return !!param; })
|
|
36889
36943
|
.join("&");
|
|
@@ -38182,7 +38236,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38182
38236
|
}
|
|
38183
38237
|
else {
|
|
38184
38238
|
data = response_1.data.map(function (product) {
|
|
38185
|
-
|
|
38239
|
+
var selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
38240
|
+
var productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
38241
|
+
return productDetail;
|
|
38186
38242
|
});
|
|
38187
38243
|
}
|
|
38188
38244
|
this.applyFacets(response_1.facets);
|
|
@@ -38230,7 +38286,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38230
38286
|
if (!response)
|
|
38231
38287
|
return [2 /*return*/];
|
|
38232
38288
|
data = response.data.map(function (product) {
|
|
38233
|
-
|
|
38289
|
+
var selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
38290
|
+
var productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
38291
|
+
return productDetail;
|
|
38234
38292
|
});
|
|
38235
38293
|
this.data = data.concat(this.data);
|
|
38236
38294
|
this._count = response.count;
|
|
@@ -38269,7 +38327,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38269
38327
|
if (!response)
|
|
38270
38328
|
return [2 /*return*/];
|
|
38271
38329
|
data = response.data.map(function (product) {
|
|
38272
|
-
|
|
38330
|
+
var selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
38331
|
+
var productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
38332
|
+
return productDetail;
|
|
38273
38333
|
});
|
|
38274
38334
|
this.data = this.data.concat(data);
|
|
38275
38335
|
this._count = response.count;
|
|
@@ -38307,7 +38367,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38307
38367
|
if (!response)
|
|
38308
38368
|
return [2 /*return*/];
|
|
38309
38369
|
data = response.data.map(function (product) {
|
|
38310
|
-
|
|
38370
|
+
var selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
38371
|
+
var productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
38372
|
+
return productDetail;
|
|
38311
38373
|
});
|
|
38312
38374
|
this.data = data;
|
|
38313
38375
|
this._count = response.count;
|
|
@@ -43000,13 +43062,15 @@ var templateObject_1$9;
|
|
|
43000
43062
|
var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
43001
43063
|
function IkasHTMLMetaDataAPI() {
|
|
43002
43064
|
}
|
|
43003
|
-
IkasHTMLMetaDataAPI.listHTMLMetaData = function (slug,
|
|
43065
|
+
IkasHTMLMetaDataAPI.listHTMLMetaData = function (slug, targetIds, targetType, page, limit) {
|
|
43066
|
+
if (page === void 0) { page = 1; }
|
|
43067
|
+
if (limit === void 0) { limit = 200; }
|
|
43004
43068
|
return __awaiter(this, void 0, void 0, function () {
|
|
43005
43069
|
var LIST_QUERY, _a, data, errors, err_1;
|
|
43006
43070
|
return __generator(this, function (_b) {
|
|
43007
43071
|
switch (_b.label) {
|
|
43008
43072
|
case 0:
|
|
43009
|
-
LIST_QUERY = src(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "], ["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "])));
|
|
43073
|
+
LIST_QUERY = src(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n $pagination: PaginationInput\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n pagination: $pagination\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "], ["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n $pagination: PaginationInput\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n pagination: $pagination\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "])));
|
|
43010
43074
|
_b.label = 1;
|
|
43011
43075
|
case 1:
|
|
43012
43076
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -43020,9 +43084,9 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
|
43020
43084
|
eq: slug,
|
|
43021
43085
|
}
|
|
43022
43086
|
: undefined,
|
|
43023
|
-
targetId:
|
|
43087
|
+
targetId: targetIds
|
|
43024
43088
|
? {
|
|
43025
|
-
|
|
43089
|
+
in: targetIds,
|
|
43026
43090
|
}
|
|
43027
43091
|
: undefined,
|
|
43028
43092
|
targetType: targetType
|
|
@@ -43030,6 +43094,10 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
|
43030
43094
|
in: targetType,
|
|
43031
43095
|
}
|
|
43032
43096
|
: undefined,
|
|
43097
|
+
pagination: {
|
|
43098
|
+
page: page,
|
|
43099
|
+
limit: limit,
|
|
43100
|
+
},
|
|
43033
43101
|
},
|
|
43034
43102
|
})];
|
|
43035
43103
|
case 2:
|
|
@@ -43742,6 +43810,248 @@ var IkasProductBackInStockReminderAPI = /** @class */ (function () {
|
|
|
43742
43810
|
}());
|
|
43743
43811
|
var templateObject_1$j, templateObject_2$9;
|
|
43744
43812
|
|
|
43813
|
+
/**
|
|
43814
|
+
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
43815
|
+
* support for iteratee shorthands.
|
|
43816
|
+
*
|
|
43817
|
+
* @private
|
|
43818
|
+
* @param {Array} array The array to inspect.
|
|
43819
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
43820
|
+
* @param {number} fromIndex The index to search from.
|
|
43821
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
43822
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
43823
|
+
*/
|
|
43824
|
+
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
43825
|
+
var length = array.length,
|
|
43826
|
+
index = fromIndex + (fromRight ? 1 : -1);
|
|
43827
|
+
|
|
43828
|
+
while ((fromRight ? index-- : ++index < length)) {
|
|
43829
|
+
if (predicate(array[index], index, array)) {
|
|
43830
|
+
return index;
|
|
43831
|
+
}
|
|
43832
|
+
}
|
|
43833
|
+
return -1;
|
|
43834
|
+
}
|
|
43835
|
+
|
|
43836
|
+
var _baseFindIndex = baseFindIndex;
|
|
43837
|
+
|
|
43838
|
+
/**
|
|
43839
|
+
* The base implementation of `_.isNaN` without support for number objects.
|
|
43840
|
+
*
|
|
43841
|
+
* @private
|
|
43842
|
+
* @param {*} value The value to check.
|
|
43843
|
+
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
|
43844
|
+
*/
|
|
43845
|
+
function baseIsNaN(value) {
|
|
43846
|
+
return value !== value;
|
|
43847
|
+
}
|
|
43848
|
+
|
|
43849
|
+
var _baseIsNaN = baseIsNaN;
|
|
43850
|
+
|
|
43851
|
+
/**
|
|
43852
|
+
* A specialized version of `_.indexOf` which performs strict equality
|
|
43853
|
+
* comparisons of values, i.e. `===`.
|
|
43854
|
+
*
|
|
43855
|
+
* @private
|
|
43856
|
+
* @param {Array} array The array to inspect.
|
|
43857
|
+
* @param {*} value The value to search for.
|
|
43858
|
+
* @param {number} fromIndex The index to search from.
|
|
43859
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
43860
|
+
*/
|
|
43861
|
+
function strictIndexOf(array, value, fromIndex) {
|
|
43862
|
+
var index = fromIndex - 1,
|
|
43863
|
+
length = array.length;
|
|
43864
|
+
|
|
43865
|
+
while (++index < length) {
|
|
43866
|
+
if (array[index] === value) {
|
|
43867
|
+
return index;
|
|
43868
|
+
}
|
|
43869
|
+
}
|
|
43870
|
+
return -1;
|
|
43871
|
+
}
|
|
43872
|
+
|
|
43873
|
+
var _strictIndexOf = strictIndexOf;
|
|
43874
|
+
|
|
43875
|
+
/**
|
|
43876
|
+
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
43877
|
+
*
|
|
43878
|
+
* @private
|
|
43879
|
+
* @param {Array} array The array to inspect.
|
|
43880
|
+
* @param {*} value The value to search for.
|
|
43881
|
+
* @param {number} fromIndex The index to search from.
|
|
43882
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
43883
|
+
*/
|
|
43884
|
+
function baseIndexOf(array, value, fromIndex) {
|
|
43885
|
+
return value === value
|
|
43886
|
+
? _strictIndexOf(array, value, fromIndex)
|
|
43887
|
+
: _baseFindIndex(array, _baseIsNaN, fromIndex);
|
|
43888
|
+
}
|
|
43889
|
+
|
|
43890
|
+
var _baseIndexOf = baseIndexOf;
|
|
43891
|
+
|
|
43892
|
+
/**
|
|
43893
|
+
* A specialized version of `_.includes` for arrays without support for
|
|
43894
|
+
* specifying an index to search from.
|
|
43895
|
+
*
|
|
43896
|
+
* @private
|
|
43897
|
+
* @param {Array} [array] The array to inspect.
|
|
43898
|
+
* @param {*} target The value to search for.
|
|
43899
|
+
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
43900
|
+
*/
|
|
43901
|
+
function arrayIncludes(array, value) {
|
|
43902
|
+
var length = array == null ? 0 : array.length;
|
|
43903
|
+
return !!length && _baseIndexOf(array, value, 0) > -1;
|
|
43904
|
+
}
|
|
43905
|
+
|
|
43906
|
+
var _arrayIncludes = arrayIncludes;
|
|
43907
|
+
|
|
43908
|
+
/**
|
|
43909
|
+
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
43910
|
+
*
|
|
43911
|
+
* @private
|
|
43912
|
+
* @param {Array} [array] The array to inspect.
|
|
43913
|
+
* @param {*} target The value to search for.
|
|
43914
|
+
* @param {Function} comparator The comparator invoked per element.
|
|
43915
|
+
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
43916
|
+
*/
|
|
43917
|
+
function arrayIncludesWith(array, value, comparator) {
|
|
43918
|
+
var index = -1,
|
|
43919
|
+
length = array == null ? 0 : array.length;
|
|
43920
|
+
|
|
43921
|
+
while (++index < length) {
|
|
43922
|
+
if (comparator(value, array[index])) {
|
|
43923
|
+
return true;
|
|
43924
|
+
}
|
|
43925
|
+
}
|
|
43926
|
+
return false;
|
|
43927
|
+
}
|
|
43928
|
+
|
|
43929
|
+
var _arrayIncludesWith = arrayIncludesWith;
|
|
43930
|
+
|
|
43931
|
+
/**
|
|
43932
|
+
* This method returns `undefined`.
|
|
43933
|
+
*
|
|
43934
|
+
* @static
|
|
43935
|
+
* @memberOf _
|
|
43936
|
+
* @since 2.3.0
|
|
43937
|
+
* @category Util
|
|
43938
|
+
* @example
|
|
43939
|
+
*
|
|
43940
|
+
* _.times(2, _.noop);
|
|
43941
|
+
* // => [undefined, undefined]
|
|
43942
|
+
*/
|
|
43943
|
+
function noop() {
|
|
43944
|
+
// No operation performed.
|
|
43945
|
+
}
|
|
43946
|
+
|
|
43947
|
+
var noop_1 = noop;
|
|
43948
|
+
|
|
43949
|
+
/** Used as references for various `Number` constants. */
|
|
43950
|
+
var INFINITY$2 = 1 / 0;
|
|
43951
|
+
|
|
43952
|
+
/**
|
|
43953
|
+
* Creates a set object of `values`.
|
|
43954
|
+
*
|
|
43955
|
+
* @private
|
|
43956
|
+
* @param {Array} values The values to add to the set.
|
|
43957
|
+
* @returns {Object} Returns the new set.
|
|
43958
|
+
*/
|
|
43959
|
+
var createSet = !(_Set && (1 / _setToArray(new _Set([,-0]))[1]) == INFINITY$2) ? noop_1 : function(values) {
|
|
43960
|
+
return new _Set(values);
|
|
43961
|
+
};
|
|
43962
|
+
|
|
43963
|
+
var _createSet = createSet;
|
|
43964
|
+
|
|
43965
|
+
/** Used as the size to enable large array optimizations. */
|
|
43966
|
+
var LARGE_ARRAY_SIZE$1 = 200;
|
|
43967
|
+
|
|
43968
|
+
/**
|
|
43969
|
+
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
|
|
43970
|
+
*
|
|
43971
|
+
* @private
|
|
43972
|
+
* @param {Array} array The array to inspect.
|
|
43973
|
+
* @param {Function} [iteratee] The iteratee invoked per element.
|
|
43974
|
+
* @param {Function} [comparator] The comparator invoked per element.
|
|
43975
|
+
* @returns {Array} Returns the new duplicate free array.
|
|
43976
|
+
*/
|
|
43977
|
+
function baseUniq(array, iteratee, comparator) {
|
|
43978
|
+
var index = -1,
|
|
43979
|
+
includes = _arrayIncludes,
|
|
43980
|
+
length = array.length,
|
|
43981
|
+
isCommon = true,
|
|
43982
|
+
result = [],
|
|
43983
|
+
seen = result;
|
|
43984
|
+
|
|
43985
|
+
if (comparator) {
|
|
43986
|
+
isCommon = false;
|
|
43987
|
+
includes = _arrayIncludesWith;
|
|
43988
|
+
}
|
|
43989
|
+
else if (length >= LARGE_ARRAY_SIZE$1) {
|
|
43990
|
+
var set = iteratee ? null : _createSet(array);
|
|
43991
|
+
if (set) {
|
|
43992
|
+
return _setToArray(set);
|
|
43993
|
+
}
|
|
43994
|
+
isCommon = false;
|
|
43995
|
+
includes = _cacheHas;
|
|
43996
|
+
seen = new _SetCache;
|
|
43997
|
+
}
|
|
43998
|
+
else {
|
|
43999
|
+
seen = iteratee ? [] : result;
|
|
44000
|
+
}
|
|
44001
|
+
outer:
|
|
44002
|
+
while (++index < length) {
|
|
44003
|
+
var value = array[index],
|
|
44004
|
+
computed = iteratee ? iteratee(value) : value;
|
|
44005
|
+
|
|
44006
|
+
value = (comparator || value !== 0) ? value : 0;
|
|
44007
|
+
if (isCommon && computed === computed) {
|
|
44008
|
+
var seenIndex = seen.length;
|
|
44009
|
+
while (seenIndex--) {
|
|
44010
|
+
if (seen[seenIndex] === computed) {
|
|
44011
|
+
continue outer;
|
|
44012
|
+
}
|
|
44013
|
+
}
|
|
44014
|
+
if (iteratee) {
|
|
44015
|
+
seen.push(computed);
|
|
44016
|
+
}
|
|
44017
|
+
result.push(value);
|
|
44018
|
+
}
|
|
44019
|
+
else if (!includes(seen, computed, comparator)) {
|
|
44020
|
+
if (seen !== result) {
|
|
44021
|
+
seen.push(computed);
|
|
44022
|
+
}
|
|
44023
|
+
result.push(value);
|
|
44024
|
+
}
|
|
44025
|
+
}
|
|
44026
|
+
return result;
|
|
44027
|
+
}
|
|
44028
|
+
|
|
44029
|
+
var _baseUniq = baseUniq;
|
|
44030
|
+
|
|
44031
|
+
/**
|
|
44032
|
+
* Creates a duplicate-free version of an array, using
|
|
44033
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
44034
|
+
* for equality comparisons, in which only the first occurrence of each element
|
|
44035
|
+
* is kept. The order of result values is determined by the order they occur
|
|
44036
|
+
* in the array.
|
|
44037
|
+
*
|
|
44038
|
+
* @static
|
|
44039
|
+
* @memberOf _
|
|
44040
|
+
* @since 0.1.0
|
|
44041
|
+
* @category Array
|
|
44042
|
+
* @param {Array} array The array to inspect.
|
|
44043
|
+
* @returns {Array} Returns the new duplicate free array.
|
|
44044
|
+
* @example
|
|
44045
|
+
*
|
|
44046
|
+
* _.uniq([2, 1, 2]);
|
|
44047
|
+
* // => [2, 1]
|
|
44048
|
+
*/
|
|
44049
|
+
function uniq(array) {
|
|
44050
|
+
return (array && array.length) ? _baseUniq(array) : [];
|
|
44051
|
+
}
|
|
44052
|
+
|
|
44053
|
+
var uniq_1 = uniq;
|
|
44054
|
+
|
|
43745
44055
|
var IkasProductListPropValueProvider = /** @class */ (function () {
|
|
43746
44056
|
function IkasProductListPropValueProvider(pageType, productListPropValue, pageSpecificData) {
|
|
43747
44057
|
this.pageType = pageType;
|
|
@@ -43821,7 +44131,7 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
43821
44131
|
IkasProductDetailPropValueProvider.prototype.getValue = function () {
|
|
43822
44132
|
var _a;
|
|
43823
44133
|
return __awaiter(this, void 0, void 0, function () {
|
|
43824
|
-
var productSearchResponse, productList, product, optionSetResponse, variant;
|
|
44134
|
+
var productSearchResponse, productList, product, optionSetResponse, variant, selectedVariant;
|
|
43825
44135
|
var _this = this;
|
|
43826
44136
|
return __generator(this, function (_b) {
|
|
43827
44137
|
switch (_b.label) {
|
|
@@ -43866,9 +44176,10 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
43866
44176
|
return [2 /*return*/, null];
|
|
43867
44177
|
}
|
|
43868
44178
|
else {
|
|
44179
|
+
selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
43869
44180
|
return [2 /*return*/, {
|
|
43870
44181
|
productDetailPropValue: this.productDetailPropValue,
|
|
43871
|
-
productDetail: new IkasProductDetail(product, product.variants[0].variantValues),
|
|
44182
|
+
productDetail: new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues),
|
|
43872
44183
|
}];
|
|
43873
44184
|
}
|
|
43874
44185
|
case 4: return [2 /*return*/, {
|
|
@@ -43953,106 +44264,114 @@ var IkasBrandPropValueProvider = /** @class */ (function () {
|
|
|
43953
44264
|
}());
|
|
43954
44265
|
|
|
43955
44266
|
var IkasLinkPropValueProvider = /** @class */ (function () {
|
|
43956
|
-
function IkasLinkPropValueProvider(linkPropValue, theme) {
|
|
44267
|
+
function IkasLinkPropValueProvider(linkPropValue, theme, linkMetaDataTargetIds) {
|
|
43957
44268
|
this.linkPropValue = linkPropValue;
|
|
43958
44269
|
this.theme = theme;
|
|
44270
|
+
this.linkMetaDataTargetIds = linkMetaDataTargetIds;
|
|
43959
44271
|
}
|
|
43960
44272
|
IkasLinkPropValueProvider.prototype.getNavigationLink = function (linkPropValue) {
|
|
43961
44273
|
var _a, _b;
|
|
43962
44274
|
return __awaiter(this, void 0, void 0, function () {
|
|
43963
|
-
var navigationLink, themePage,
|
|
44275
|
+
var navigationLink, themePage, _c, page, headerComponentId_1, footerComponentId_1, pageComponents, componentIndex;
|
|
43964
44276
|
var _this = this;
|
|
43965
44277
|
return __generator(this, function (_d) {
|
|
43966
44278
|
switch (_d.label) {
|
|
43967
44279
|
case 0:
|
|
43968
|
-
if (
|
|
43969
|
-
|
|
43970
|
-
|
|
43971
|
-
|
|
43972
|
-
|
|
43973
|
-
|
|
43974
|
-
|
|
43975
|
-
|
|
43976
|
-
|
|
43977
|
-
|
|
43978
|
-
|
|
43979
|
-
|
|
43980
|
-
|
|
43981
|
-
|
|
43982
|
-
|
|
43983
|
-
|
|
43984
|
-
|
|
43985
|
-
|
|
43986
|
-
|
|
43987
|
-
|
|
43988
|
-
|
|
43989
|
-
|
|
43990
|
-
|
|
43991
|
-
|
|
43992
|
-
|
|
43993
|
-
|
|
43994
|
-
|
|
43995
|
-
|
|
43996
|
-
|
|
43997
|
-
|
|
43998
|
-
|
|
43999
|
-
|
|
44000
|
-
|
|
44001
|
-
|
|
44002
|
-
|
|
44003
|
-
|
|
44004
|
-
|
|
44005
|
-
|
|
44006
|
-
|
|
44007
|
-
|
|
44008
|
-
|
|
44009
|
-
|
|
44010
|
-
|
|
44011
|
-
|
|
44012
|
-
|
|
44013
|
-
|
|
44014
|
-
|
|
44015
|
-
|
|
44016
|
-
|
|
44017
|
-
|
|
44018
|
-
|
|
44019
|
-
|
|
44020
|
-
|
|
44021
|
-
|
|
44022
|
-
|
|
44023
|
-
|
|
44024
|
-
|
|
44025
|
-
|
|
44026
|
-
|
|
44027
|
-
|
|
44028
|
-
|
|
44029
|
-
|
|
44030
|
-
|
|
44031
|
-
|
|
44032
|
-
|
|
44033
|
-
|
|
44034
|
-
|
|
44035
|
-
|
|
44036
|
-
|
|
44037
|
-
|
|
44038
|
-
|
|
44039
|
-
|
|
44040
|
-
|
|
44041
|
-
|
|
44042
|
-
navigationLink = new IkasNavigationLink(
|
|
44280
|
+
if (linkPropValue.linkType === IkasLinkType.PAGE) {
|
|
44281
|
+
// INDEX PAGE
|
|
44282
|
+
if (linkPropValue.pageType === IkasThemePageType.INDEX) {
|
|
44283
|
+
navigationLink = new IkasNavigationLink("/", linkPropValue.label || "", []);
|
|
44284
|
+
}
|
|
44285
|
+
else if (linkPropValue.pageType === IkasThemePageType.ACCOUNT) {
|
|
44286
|
+
navigationLink = new IkasNavigationLink("/account/info", linkPropValue.label || "", []);
|
|
44287
|
+
}
|
|
44288
|
+
else if (linkPropValue.pageType === IkasThemePageType.ADDRESSES) {
|
|
44289
|
+
navigationLink = new IkasNavigationLink("/account/addresses", linkPropValue.label || "", []);
|
|
44290
|
+
}
|
|
44291
|
+
else if (linkPropValue.pageType === IkasThemePageType.ORDERS) {
|
|
44292
|
+
navigationLink = new IkasNavigationLink("/account/orders", linkPropValue.label || "", []);
|
|
44293
|
+
}
|
|
44294
|
+
else if (linkPropValue.pageType === IkasThemePageType.FAVORITE_PRODUCTS) {
|
|
44295
|
+
navigationLink = new IkasNavigationLink("/account/favorite-products", linkPropValue.label || "", []);
|
|
44296
|
+
}
|
|
44297
|
+
else if (linkPropValue.pageType === IkasThemePageType.LOGIN) {
|
|
44298
|
+
navigationLink = new IkasNavigationLink("/account/login", linkPropValue.label || "", []);
|
|
44299
|
+
}
|
|
44300
|
+
else if (linkPropValue.pageType === IkasThemePageType.REGISTER) {
|
|
44301
|
+
navigationLink = new IkasNavigationLink("/account/register", linkPropValue.label || "", []);
|
|
44302
|
+
}
|
|
44303
|
+
else if (linkPropValue.pageType === IkasThemePageType.FORGOT_PASSWORD) {
|
|
44304
|
+
navigationLink = new IkasNavigationLink("/account/forgot-password", linkPropValue.label || "", []);
|
|
44305
|
+
}
|
|
44306
|
+
else if (linkPropValue.pageType === IkasThemePageType.RECOVER_PASSWORD) {
|
|
44307
|
+
navigationLink = new IkasNavigationLink("/account/recover-password", linkPropValue.label || "", []);
|
|
44308
|
+
}
|
|
44309
|
+
else if (linkPropValue.pageType === IkasThemePageType.BLOG_INDEX) {
|
|
44310
|
+
navigationLink = new IkasNavigationLink("/blog", linkPropValue.label || "", []);
|
|
44311
|
+
}
|
|
44312
|
+
else if (linkPropValue.pageType === IkasThemePageType.CART) {
|
|
44313
|
+
navigationLink = new IkasNavigationLink("/cart", linkPropValue.label || "", []);
|
|
44314
|
+
}
|
|
44315
|
+
else if (linkPropValue.pageType === IkasThemePageType.SEARCH) {
|
|
44316
|
+
navigationLink = new IkasNavigationLink("/search", linkPropValue.label || "", []);
|
|
44317
|
+
}
|
|
44318
|
+
// CUSTOM PAGE
|
|
44319
|
+
else if (linkPropValue.pageType === IkasThemePageType.CUSTOM) {
|
|
44320
|
+
themePage = this.theme.pages.find(function (p) { return p.id === linkPropValue.pageId; });
|
|
44321
|
+
if (themePage) {
|
|
44322
|
+
navigationLink = new IkasNavigationLink("/pages/" + themePage.slug, linkPropValue.label || "", []);
|
|
44323
|
+
}
|
|
44324
|
+
}
|
|
44325
|
+
// ITEM PAGES
|
|
44326
|
+
else if ([
|
|
44327
|
+
IkasThemePageType.PRODUCT,
|
|
44328
|
+
IkasThemePageType.BRAND,
|
|
44329
|
+
IkasThemePageType.CATEGORY,
|
|
44330
|
+
].includes(linkPropValue.pageType)) {
|
|
44331
|
+
if (linkPropValue.itemId) {
|
|
44332
|
+
navigationLink = new IkasNavigationLink("/", linkPropValue.label || "", []);
|
|
44333
|
+
this.linkMetaDataTargetIds.push({
|
|
44334
|
+
type: "DEFAULT",
|
|
44335
|
+
id: linkPropValue.itemId,
|
|
44336
|
+
navigationLink: navigationLink,
|
|
44337
|
+
});
|
|
44338
|
+
}
|
|
44339
|
+
}
|
|
44340
|
+
// BLOG ITEM PAGES
|
|
44341
|
+
else if ([IkasThemePageType.BLOG, IkasThemePageType.BLOG_CATEGORY].includes(linkPropValue.pageType)) {
|
|
44342
|
+
if (linkPropValue.itemId) {
|
|
44343
|
+
navigationLink = new IkasNavigationLink("/blog/", linkPropValue.label || "", []);
|
|
44344
|
+
this.linkMetaDataTargetIds.push({
|
|
44345
|
+
type: "BLOG",
|
|
44346
|
+
id: linkPropValue.itemId,
|
|
44347
|
+
navigationLink: navigationLink,
|
|
44348
|
+
});
|
|
44349
|
+
}
|
|
44350
|
+
}
|
|
44351
|
+
// RAFFLE ITEM PAGE
|
|
44352
|
+
// else if (linkPropValue.pageType === IkasThemePageType.RAFFLE_DETAIL) {
|
|
44353
|
+
// if (linkPropValue.itemId) {
|
|
44354
|
+
// navigationLink = new IkasNavigationLink(
|
|
44355
|
+
// "/raffle/",
|
|
44356
|
+
// linkPropValue.label || "",
|
|
44357
|
+
// []
|
|
44358
|
+
// );
|
|
44359
|
+
// this.linkMetaDataTargetIds.push({
|
|
44360
|
+
// type: "RAFFLE",
|
|
44361
|
+
// id: linkPropValue.itemId,
|
|
44362
|
+
// navigationLink,
|
|
44363
|
+
// });
|
|
44364
|
+
// }
|
|
44365
|
+
// }
|
|
44043
44366
|
}
|
|
44044
|
-
|
|
44045
|
-
|
|
44046
|
-
case 18:
|
|
44047
|
-
if (linkPropValue.linkType === IkasLinkType.EXTERNAL) {
|
|
44367
|
+
// EXTERNAL LINK
|
|
44368
|
+
else if (linkPropValue.linkType === IkasLinkType.EXTERNAL) {
|
|
44048
44369
|
navigationLink = new IkasNavigationLink(linkPropValue.externalLink || "", linkPropValue.label || "", [], true);
|
|
44049
44370
|
}
|
|
44050
|
-
|
|
44051
|
-
case 19:
|
|
44052
|
-
if (!navigationLink) return [3 /*break*/, 21];
|
|
44371
|
+
if (!navigationLink) return [3 /*break*/, 2];
|
|
44053
44372
|
_c = navigationLink;
|
|
44054
44373
|
return [4 /*yield*/, Promise.all(linkPropValue.subLinks.map(function (sl) { return _this.getNavigationLink(sl); }))];
|
|
44055
|
-
case
|
|
44374
|
+
case 1:
|
|
44056
44375
|
_c.subLinks = _d.sent();
|
|
44057
44376
|
// ADD HASH LINK
|
|
44058
44377
|
if (linkPropValue.pageComponentId && linkPropValue.pageId) {
|
|
@@ -44069,7 +44388,7 @@ var IkasLinkPropValueProvider = /** @class */ (function () {
|
|
|
44069
44388
|
}
|
|
44070
44389
|
}
|
|
44071
44390
|
return [2 /*return*/, navigationLink];
|
|
44072
|
-
case
|
|
44391
|
+
case 2: return [2 /*return*/, new IkasNavigationLink("", "", [])];
|
|
44073
44392
|
}
|
|
44074
44393
|
});
|
|
44075
44394
|
});
|
|
@@ -44328,7 +44647,7 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
|
44328
44647
|
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
44329
44648
|
var _a;
|
|
44330
44649
|
return __awaiter(this, void 0, void 0, function () {
|
|
44331
|
-
var productDetail, productSearchResponse, productList, product, variant;
|
|
44650
|
+
var productDetail, productSearchResponse, productList, product, variant, selectedVariant;
|
|
44332
44651
|
var _this = this;
|
|
44333
44652
|
return __generator(this, function (_b) {
|
|
44334
44653
|
switch (_b.label) {
|
|
@@ -44359,7 +44678,8 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
|
44359
44678
|
}
|
|
44360
44679
|
}
|
|
44361
44680
|
else {
|
|
44362
|
-
|
|
44681
|
+
selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
44682
|
+
productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
44363
44683
|
}
|
|
44364
44684
|
}
|
|
44365
44685
|
}
|
|
@@ -44381,7 +44701,7 @@ var IkasAttributeListPropValueProvider = /** @class */ (function () {
|
|
|
44381
44701
|
IkasAttributeListPropValueProvider.prototype.getValue = function () {
|
|
44382
44702
|
var _a;
|
|
44383
44703
|
return __awaiter(this, void 0, void 0, function () {
|
|
44384
|
-
var productDetail, productSearchResponse, productList, product, variant;
|
|
44704
|
+
var productDetail, productSearchResponse, productList, product, variant, selectedVariant;
|
|
44385
44705
|
var _this = this;
|
|
44386
44706
|
return __generator(this, function (_b) {
|
|
44387
44707
|
switch (_b.label) {
|
|
@@ -44413,7 +44733,8 @@ var IkasAttributeListPropValueProvider = /** @class */ (function () {
|
|
|
44413
44733
|
}
|
|
44414
44734
|
}
|
|
44415
44735
|
else {
|
|
44416
|
-
|
|
44736
|
+
selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
44737
|
+
productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
44417
44738
|
}
|
|
44418
44739
|
}
|
|
44419
44740
|
}
|
|
@@ -44821,7 +45142,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
44821
45142
|
return __generator(this, function (_a) {
|
|
44822
45143
|
switch (_a.label) {
|
|
44823
45144
|
case 0:
|
|
44824
|
-
provider = new IkasLinkPropValueProvider(this.value, this.theme);
|
|
45145
|
+
provider = new IkasLinkPropValueProvider(this.value, this.theme, this.pageDataProvider.linkMetaDataTargetIds);
|
|
44825
45146
|
return [4 /*yield*/, provider.getValue()];
|
|
44826
45147
|
case 1:
|
|
44827
45148
|
value = _a.sent();
|
|
@@ -45139,6 +45460,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45139
45460
|
this.pageSpecificData = null;
|
|
45140
45461
|
this.merchantSettings = null;
|
|
45141
45462
|
this.possiblePageTypes = []; // Used for distinguishing blog slug page from main slug page
|
|
45463
|
+
this.linkMetaDataTargetIds = []; // Used for bulk fetching of link slugs
|
|
45142
45464
|
this.theme = new IkasTheme(theme);
|
|
45143
45465
|
this.pageParams = pageParams || {};
|
|
45144
45466
|
this.pageType = pageType;
|
|
@@ -45249,6 +45571,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45249
45571
|
}))];
|
|
45250
45572
|
case 4:
|
|
45251
45573
|
_a.pageComponentPropValues = _b.sent();
|
|
45574
|
+
return [4 /*yield*/, this.setLinkSlugs()];
|
|
45575
|
+
case 5:
|
|
45576
|
+
_b.sent();
|
|
45252
45577
|
return [2 /*return*/];
|
|
45253
45578
|
}
|
|
45254
45579
|
});
|
|
@@ -45294,7 +45619,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45294
45619
|
if (!metaData.targetId)
|
|
45295
45620
|
return [2 /*return*/];
|
|
45296
45621
|
handleProductPage = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
45297
|
-
var productsResponse, product, optionSetResponse, displayedVariantType, inStockVariant;
|
|
45622
|
+
var productsResponse, product, optionSetResponse, selectedVariant, displayedVariantType, inStockVariant;
|
|
45298
45623
|
return __generator(this, function (_a) {
|
|
45299
45624
|
switch (_a.label) {
|
|
45300
45625
|
case 0: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
@@ -45317,7 +45642,10 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45317
45642
|
}
|
|
45318
45643
|
_a.label = 3;
|
|
45319
45644
|
case 3:
|
|
45320
|
-
|
|
45645
|
+
selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
45646
|
+
if (!selectedVariant)
|
|
45647
|
+
return [2 /*return*/];
|
|
45648
|
+
this.pageSpecificData = new IkasProductDetail(product, selectedVariant.variantValues);
|
|
45321
45649
|
// Select the first displayed in stock variant
|
|
45322
45650
|
if (this.pageSpecificData.displayedVariantTypes.length) {
|
|
45323
45651
|
displayedVariantType = this
|
|
@@ -45551,7 +45879,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45551
45879
|
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
45552
45880
|
return [3 /*break*/, 24];
|
|
45553
45881
|
case 14:
|
|
45554
|
-
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
45882
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme, this.linkMetaDataTargetIds);
|
|
45555
45883
|
return [3 /*break*/, 24];
|
|
45556
45884
|
case 15:
|
|
45557
45885
|
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
@@ -45591,6 +45919,104 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45591
45919
|
this.page.description = metaData.description;
|
|
45592
45920
|
}
|
|
45593
45921
|
};
|
|
45922
|
+
IkasPageDataProvider.prototype.setLinkSlugs = function () {
|
|
45923
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45924
|
+
var defaultLinks, blogLinks, raffleLinks;
|
|
45925
|
+
return __generator(this, function (_a) {
|
|
45926
|
+
switch (_a.label) {
|
|
45927
|
+
case 0:
|
|
45928
|
+
defaultLinks = [];
|
|
45929
|
+
blogLinks = [];
|
|
45930
|
+
raffleLinks = [];
|
|
45931
|
+
this.linkMetaDataTargetIds.forEach(function (target) {
|
|
45932
|
+
switch (target.type) {
|
|
45933
|
+
case "DEFAULT":
|
|
45934
|
+
defaultLinks.push(target);
|
|
45935
|
+
break;
|
|
45936
|
+
case "BLOG":
|
|
45937
|
+
blogLinks.push(target);
|
|
45938
|
+
break;
|
|
45939
|
+
case "RAFFLE":
|
|
45940
|
+
raffleLinks.push(target);
|
|
45941
|
+
break;
|
|
45942
|
+
}
|
|
45943
|
+
});
|
|
45944
|
+
return [4 /*yield*/, Promise.all([
|
|
45945
|
+
this.getLinkSlugs(defaultLinks, "DEFAULT"),
|
|
45946
|
+
this.getLinkSlugs(blogLinks, "BLOG"),
|
|
45947
|
+
this.getLinkSlugs(raffleLinks, "RAFFLE"),
|
|
45948
|
+
])];
|
|
45949
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
45950
|
+
}
|
|
45951
|
+
});
|
|
45952
|
+
});
|
|
45953
|
+
};
|
|
45954
|
+
IkasPageDataProvider.prototype.getLinkSlugs = function (targets, type) {
|
|
45955
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45956
|
+
var idList, page, limit, metaDataList, fetchComplete, getPage;
|
|
45957
|
+
var _this = this;
|
|
45958
|
+
return __generator(this, function (_a) {
|
|
45959
|
+
switch (_a.label) {
|
|
45960
|
+
case 0:
|
|
45961
|
+
idList = uniq_1(targets.map(function (t) { return t.id; }));
|
|
45962
|
+
page = 1;
|
|
45963
|
+
limit = 200;
|
|
45964
|
+
metaDataList = [];
|
|
45965
|
+
fetchComplete = false;
|
|
45966
|
+
getPage = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
45967
|
+
var results, _a;
|
|
45968
|
+
return __generator(this, function (_b) {
|
|
45969
|
+
switch (_b.label) {
|
|
45970
|
+
case 0:
|
|
45971
|
+
results = [];
|
|
45972
|
+
_a = type;
|
|
45973
|
+
switch (_a) {
|
|
45974
|
+
case "DEFAULT": return [3 /*break*/, 1];
|
|
45975
|
+
case "BLOG": return [3 /*break*/, 3];
|
|
45976
|
+
}
|
|
45977
|
+
return [3 /*break*/, 5];
|
|
45978
|
+
case 1: return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, idList, undefined, page, limit)];
|
|
45979
|
+
case 2:
|
|
45980
|
+
results = _b.sent();
|
|
45981
|
+
return [3 /*break*/, 6];
|
|
45982
|
+
case 3: return [4 /*yield*/, IkasBlogAPI.listBlogMetaData(undefined, idList, undefined, page, limit)];
|
|
45983
|
+
case 4:
|
|
45984
|
+
results = _b.sent();
|
|
45985
|
+
return [3 /*break*/, 6];
|
|
45986
|
+
case 5: return [3 /*break*/, 6];
|
|
45987
|
+
case 6:
|
|
45988
|
+
if (results.length) {
|
|
45989
|
+
metaDataList = metaDataList.concat(results);
|
|
45990
|
+
if (results.length < 200)
|
|
45991
|
+
fetchComplete = true;
|
|
45992
|
+
}
|
|
45993
|
+
else
|
|
45994
|
+
fetchComplete = true;
|
|
45995
|
+
page++;
|
|
45996
|
+
return [2 /*return*/];
|
|
45997
|
+
}
|
|
45998
|
+
});
|
|
45999
|
+
}); };
|
|
46000
|
+
_a.label = 1;
|
|
46001
|
+
case 1:
|
|
46002
|
+
if (!(!fetchComplete && metaDataList.length < idList.length)) return [3 /*break*/, 3];
|
|
46003
|
+
return [4 /*yield*/, getPage()];
|
|
46004
|
+
case 2:
|
|
46005
|
+
_a.sent();
|
|
46006
|
+
return [3 /*break*/, 1];
|
|
46007
|
+
case 3:
|
|
46008
|
+
metaDataList.forEach(function (metaData) {
|
|
46009
|
+
targets
|
|
46010
|
+
.filter(function (t) { return t.id === metaData.targetId; })
|
|
46011
|
+
.forEach(function (t) {
|
|
46012
|
+
t.navigationLink.href += metaData.slug;
|
|
46013
|
+
});
|
|
46014
|
+
});
|
|
46015
|
+
return [2 /*return*/];
|
|
46016
|
+
}
|
|
46017
|
+
});
|
|
46018
|
+
});
|
|
46019
|
+
};
|
|
45594
46020
|
return IkasPageDataProvider;
|
|
45595
46021
|
}());
|
|
45596
46022
|
var IkasPageComponentPropValue = /** @class */ (function () {
|
|
@@ -67888,7 +68314,7 @@ var createMethod = function (IS_INCLUDES) {
|
|
|
67888
68314
|
};
|
|
67889
68315
|
};
|
|
67890
68316
|
|
|
67891
|
-
var arrayIncludes = {
|
|
68317
|
+
var arrayIncludes$1 = {
|
|
67892
68318
|
// `Array.prototype.includes` method
|
|
67893
68319
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
67894
68320
|
includes: createMethod(true),
|
|
@@ -67897,7 +68323,7 @@ var arrayIncludes = {
|
|
|
67897
68323
|
indexOf: createMethod(false)
|
|
67898
68324
|
};
|
|
67899
68325
|
|
|
67900
|
-
var indexOf = arrayIncludes.indexOf;
|
|
68326
|
+
var indexOf = arrayIncludes$1.indexOf;
|
|
67901
68327
|
|
|
67902
68328
|
|
|
67903
68329
|
var objectKeysInternal = function (object, names) {
|
|
@@ -72778,224 +73204,6 @@ function flatten(array) {
|
|
|
72778
73204
|
|
|
72779
73205
|
var flatten_1 = flatten;
|
|
72780
73206
|
|
|
72781
|
-
/**
|
|
72782
|
-
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
72783
|
-
* support for iteratee shorthands.
|
|
72784
|
-
*
|
|
72785
|
-
* @private
|
|
72786
|
-
* @param {Array} array The array to inspect.
|
|
72787
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
72788
|
-
* @param {number} fromIndex The index to search from.
|
|
72789
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
72790
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
72791
|
-
*/
|
|
72792
|
-
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
72793
|
-
var length = array.length,
|
|
72794
|
-
index = fromIndex + (fromRight ? 1 : -1);
|
|
72795
|
-
|
|
72796
|
-
while ((fromRight ? index-- : ++index < length)) {
|
|
72797
|
-
if (predicate(array[index], index, array)) {
|
|
72798
|
-
return index;
|
|
72799
|
-
}
|
|
72800
|
-
}
|
|
72801
|
-
return -1;
|
|
72802
|
-
}
|
|
72803
|
-
|
|
72804
|
-
var _baseFindIndex = baseFindIndex;
|
|
72805
|
-
|
|
72806
|
-
/**
|
|
72807
|
-
* The base implementation of `_.isNaN` without support for number objects.
|
|
72808
|
-
*
|
|
72809
|
-
* @private
|
|
72810
|
-
* @param {*} value The value to check.
|
|
72811
|
-
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
|
72812
|
-
*/
|
|
72813
|
-
function baseIsNaN(value) {
|
|
72814
|
-
return value !== value;
|
|
72815
|
-
}
|
|
72816
|
-
|
|
72817
|
-
var _baseIsNaN = baseIsNaN;
|
|
72818
|
-
|
|
72819
|
-
/**
|
|
72820
|
-
* A specialized version of `_.indexOf` which performs strict equality
|
|
72821
|
-
* comparisons of values, i.e. `===`.
|
|
72822
|
-
*
|
|
72823
|
-
* @private
|
|
72824
|
-
* @param {Array} array The array to inspect.
|
|
72825
|
-
* @param {*} value The value to search for.
|
|
72826
|
-
* @param {number} fromIndex The index to search from.
|
|
72827
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
72828
|
-
*/
|
|
72829
|
-
function strictIndexOf(array, value, fromIndex) {
|
|
72830
|
-
var index = fromIndex - 1,
|
|
72831
|
-
length = array.length;
|
|
72832
|
-
|
|
72833
|
-
while (++index < length) {
|
|
72834
|
-
if (array[index] === value) {
|
|
72835
|
-
return index;
|
|
72836
|
-
}
|
|
72837
|
-
}
|
|
72838
|
-
return -1;
|
|
72839
|
-
}
|
|
72840
|
-
|
|
72841
|
-
var _strictIndexOf = strictIndexOf;
|
|
72842
|
-
|
|
72843
|
-
/**
|
|
72844
|
-
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
72845
|
-
*
|
|
72846
|
-
* @private
|
|
72847
|
-
* @param {Array} array The array to inspect.
|
|
72848
|
-
* @param {*} value The value to search for.
|
|
72849
|
-
* @param {number} fromIndex The index to search from.
|
|
72850
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
72851
|
-
*/
|
|
72852
|
-
function baseIndexOf(array, value, fromIndex) {
|
|
72853
|
-
return value === value
|
|
72854
|
-
? _strictIndexOf(array, value, fromIndex)
|
|
72855
|
-
: _baseFindIndex(array, _baseIsNaN, fromIndex);
|
|
72856
|
-
}
|
|
72857
|
-
|
|
72858
|
-
var _baseIndexOf = baseIndexOf;
|
|
72859
|
-
|
|
72860
|
-
/**
|
|
72861
|
-
* A specialized version of `_.includes` for arrays without support for
|
|
72862
|
-
* specifying an index to search from.
|
|
72863
|
-
*
|
|
72864
|
-
* @private
|
|
72865
|
-
* @param {Array} [array] The array to inspect.
|
|
72866
|
-
* @param {*} target The value to search for.
|
|
72867
|
-
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
72868
|
-
*/
|
|
72869
|
-
function arrayIncludes$1(array, value) {
|
|
72870
|
-
var length = array == null ? 0 : array.length;
|
|
72871
|
-
return !!length && _baseIndexOf(array, value, 0) > -1;
|
|
72872
|
-
}
|
|
72873
|
-
|
|
72874
|
-
var _arrayIncludes = arrayIncludes$1;
|
|
72875
|
-
|
|
72876
|
-
/**
|
|
72877
|
-
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
72878
|
-
*
|
|
72879
|
-
* @private
|
|
72880
|
-
* @param {Array} [array] The array to inspect.
|
|
72881
|
-
* @param {*} target The value to search for.
|
|
72882
|
-
* @param {Function} comparator The comparator invoked per element.
|
|
72883
|
-
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
72884
|
-
*/
|
|
72885
|
-
function arrayIncludesWith(array, value, comparator) {
|
|
72886
|
-
var index = -1,
|
|
72887
|
-
length = array == null ? 0 : array.length;
|
|
72888
|
-
|
|
72889
|
-
while (++index < length) {
|
|
72890
|
-
if (comparator(value, array[index])) {
|
|
72891
|
-
return true;
|
|
72892
|
-
}
|
|
72893
|
-
}
|
|
72894
|
-
return false;
|
|
72895
|
-
}
|
|
72896
|
-
|
|
72897
|
-
var _arrayIncludesWith = arrayIncludesWith;
|
|
72898
|
-
|
|
72899
|
-
/**
|
|
72900
|
-
* This method returns `undefined`.
|
|
72901
|
-
*
|
|
72902
|
-
* @static
|
|
72903
|
-
* @memberOf _
|
|
72904
|
-
* @since 2.3.0
|
|
72905
|
-
* @category Util
|
|
72906
|
-
* @example
|
|
72907
|
-
*
|
|
72908
|
-
* _.times(2, _.noop);
|
|
72909
|
-
* // => [undefined, undefined]
|
|
72910
|
-
*/
|
|
72911
|
-
function noop() {
|
|
72912
|
-
// No operation performed.
|
|
72913
|
-
}
|
|
72914
|
-
|
|
72915
|
-
var noop_1 = noop;
|
|
72916
|
-
|
|
72917
|
-
/** Used as references for various `Number` constants. */
|
|
72918
|
-
var INFINITY$2 = 1 / 0;
|
|
72919
|
-
|
|
72920
|
-
/**
|
|
72921
|
-
* Creates a set object of `values`.
|
|
72922
|
-
*
|
|
72923
|
-
* @private
|
|
72924
|
-
* @param {Array} values The values to add to the set.
|
|
72925
|
-
* @returns {Object} Returns the new set.
|
|
72926
|
-
*/
|
|
72927
|
-
var createSet = !(_Set && (1 / _setToArray(new _Set([,-0]))[1]) == INFINITY$2) ? noop_1 : function(values) {
|
|
72928
|
-
return new _Set(values);
|
|
72929
|
-
};
|
|
72930
|
-
|
|
72931
|
-
var _createSet = createSet;
|
|
72932
|
-
|
|
72933
|
-
/** Used as the size to enable large array optimizations. */
|
|
72934
|
-
var LARGE_ARRAY_SIZE$1 = 200;
|
|
72935
|
-
|
|
72936
|
-
/**
|
|
72937
|
-
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
|
|
72938
|
-
*
|
|
72939
|
-
* @private
|
|
72940
|
-
* @param {Array} array The array to inspect.
|
|
72941
|
-
* @param {Function} [iteratee] The iteratee invoked per element.
|
|
72942
|
-
* @param {Function} [comparator] The comparator invoked per element.
|
|
72943
|
-
* @returns {Array} Returns the new duplicate free array.
|
|
72944
|
-
*/
|
|
72945
|
-
function baseUniq(array, iteratee, comparator) {
|
|
72946
|
-
var index = -1,
|
|
72947
|
-
includes = _arrayIncludes,
|
|
72948
|
-
length = array.length,
|
|
72949
|
-
isCommon = true,
|
|
72950
|
-
result = [],
|
|
72951
|
-
seen = result;
|
|
72952
|
-
|
|
72953
|
-
if (comparator) {
|
|
72954
|
-
isCommon = false;
|
|
72955
|
-
includes = _arrayIncludesWith;
|
|
72956
|
-
}
|
|
72957
|
-
else if (length >= LARGE_ARRAY_SIZE$1) {
|
|
72958
|
-
var set = iteratee ? null : _createSet(array);
|
|
72959
|
-
if (set) {
|
|
72960
|
-
return _setToArray(set);
|
|
72961
|
-
}
|
|
72962
|
-
isCommon = false;
|
|
72963
|
-
includes = _cacheHas;
|
|
72964
|
-
seen = new _SetCache;
|
|
72965
|
-
}
|
|
72966
|
-
else {
|
|
72967
|
-
seen = iteratee ? [] : result;
|
|
72968
|
-
}
|
|
72969
|
-
outer:
|
|
72970
|
-
while (++index < length) {
|
|
72971
|
-
var value = array[index],
|
|
72972
|
-
computed = iteratee ? iteratee(value) : value;
|
|
72973
|
-
|
|
72974
|
-
value = (comparator || value !== 0) ? value : 0;
|
|
72975
|
-
if (isCommon && computed === computed) {
|
|
72976
|
-
var seenIndex = seen.length;
|
|
72977
|
-
while (seenIndex--) {
|
|
72978
|
-
if (seen[seenIndex] === computed) {
|
|
72979
|
-
continue outer;
|
|
72980
|
-
}
|
|
72981
|
-
}
|
|
72982
|
-
if (iteratee) {
|
|
72983
|
-
seen.push(computed);
|
|
72984
|
-
}
|
|
72985
|
-
result.push(value);
|
|
72986
|
-
}
|
|
72987
|
-
else if (!includes(seen, computed, comparator)) {
|
|
72988
|
-
if (seen !== result) {
|
|
72989
|
-
seen.push(computed);
|
|
72990
|
-
}
|
|
72991
|
-
result.push(value);
|
|
72992
|
-
}
|
|
72993
|
-
}
|
|
72994
|
-
return result;
|
|
72995
|
-
}
|
|
72996
|
-
|
|
72997
|
-
var _baseUniq = baseUniq;
|
|
72998
|
-
|
|
72999
73207
|
/**
|
|
73000
73208
|
* This method is like `_.uniq` except that it accepts `iteratee` which is
|
|
73001
73209
|
* invoked for each element in `array` to generate the criterion by which
|