@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.js
CHANGED
|
@@ -13708,13 +13708,15 @@ var IkasBlogAPI = /** @class */ (function () {
|
|
|
13708
13708
|
});
|
|
13709
13709
|
});
|
|
13710
13710
|
};
|
|
13711
|
-
IkasBlogAPI.listBlogMetaData = function (slug,
|
|
13711
|
+
IkasBlogAPI.listBlogMetaData = function (slug, targetIds, targetType, page, limit) {
|
|
13712
|
+
if (page === void 0) { page = 1; }
|
|
13713
|
+
if (limit === void 0) { limit = 200; }
|
|
13712
13714
|
return __awaiter(this, void 0, void 0, function () {
|
|
13713
13715
|
var LIST_QUERY, _a, data, errors, err_3;
|
|
13714
13716
|
return __generator(this, function (_b) {
|
|
13715
13717
|
switch (_b.label) {
|
|
13716
13718
|
case 0:
|
|
13717
|
-
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 "])));
|
|
13719
|
+
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 "])));
|
|
13718
13720
|
_b.label = 1;
|
|
13719
13721
|
case 1:
|
|
13720
13722
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -13728,9 +13730,9 @@ var IkasBlogAPI = /** @class */ (function () {
|
|
|
13728
13730
|
eq: slug,
|
|
13729
13731
|
}
|
|
13730
13732
|
: undefined,
|
|
13731
|
-
targetId:
|
|
13733
|
+
targetId: targetIds
|
|
13732
13734
|
? {
|
|
13733
|
-
|
|
13735
|
+
in: targetIds,
|
|
13734
13736
|
}
|
|
13735
13737
|
: undefined,
|
|
13736
13738
|
targetType: targetType
|
|
@@ -13738,6 +13740,10 @@ var IkasBlogAPI = /** @class */ (function () {
|
|
|
13738
13740
|
in: targetType,
|
|
13739
13741
|
}
|
|
13740
13742
|
: undefined,
|
|
13743
|
+
pagination: {
|
|
13744
|
+
page: page,
|
|
13745
|
+
limit: limit,
|
|
13746
|
+
},
|
|
13741
13747
|
},
|
|
13742
13748
|
})];
|
|
13743
13749
|
case 2:
|
|
@@ -36772,26 +36778,30 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
36772
36778
|
Object.defineProperty(IkasProductDetail.prototype, "displayedVariantTypes", {
|
|
36773
36779
|
get: function () {
|
|
36774
36780
|
var _this = this;
|
|
36775
|
-
var displayedVariantTypes = this.product.variantTypes.map(function (productVariantType) {
|
|
36781
|
+
var displayedVariantTypes = this.product.variantTypes.map(function (productVariantType, index) {
|
|
36776
36782
|
var variantType = productVariantType.variantType;
|
|
36777
36783
|
var displayedVariantValues = [];
|
|
36784
|
+
var parentProductVariantTypes = index > 0 ? _this.product.variantTypes.slice(0, index) : null;
|
|
36785
|
+
var parentSelectedVariantValues = [];
|
|
36786
|
+
if (parentProductVariantTypes) {
|
|
36787
|
+
parentSelectedVariantValues = _this.selectedVariantValues.filter(function (vv) {
|
|
36788
|
+
return parentProductVariantTypes.some(function (pvt) { return pvt.variantType.id === vv.variantTypeId; });
|
|
36789
|
+
});
|
|
36790
|
+
}
|
|
36778
36791
|
variantType.values.forEach(function (variantValue) {
|
|
36779
|
-
var
|
|
36780
|
-
var
|
|
36781
|
-
|
|
36782
|
-
|
|
36783
|
-
|
|
36784
|
-
|
|
36792
|
+
var variantValues = __spreadArrays(parentSelectedVariantValues, [variantValue]);
|
|
36793
|
+
var variant = _this.product.variants.find(function (variant) {
|
|
36794
|
+
return variant.isActive &&
|
|
36795
|
+
variantValues.every(function (vv) {
|
|
36796
|
+
return variant.variantValues.some(function (vvv) { return vvv.id === vv.id; });
|
|
36797
|
+
});
|
|
36785
36798
|
});
|
|
36786
36799
|
var isSelected = _this.selectedVariant.variantValues.some(function (vv) { return vv.id === variantValue.id; });
|
|
36787
|
-
var hasStock = variant
|
|
36788
|
-
? variant.stock > 0 && variant.isActive
|
|
36789
|
-
: true;
|
|
36790
36800
|
if (variant) {
|
|
36791
36801
|
displayedVariantValues.push({
|
|
36792
36802
|
variant: variant,
|
|
36793
36803
|
variantValue: variantValue,
|
|
36794
|
-
hasStock: hasStock,
|
|
36804
|
+
hasStock: variant.hasStock,
|
|
36795
36805
|
isSelected: isSelected,
|
|
36796
36806
|
});
|
|
36797
36807
|
}
|
|
@@ -36855,15 +36865,59 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
36855
36865
|
return variantValue;
|
|
36856
36866
|
return vv;
|
|
36857
36867
|
});
|
|
36858
|
-
this.
|
|
36868
|
+
var selectedVariant = this.product.variants.find(function (variant) {
|
|
36869
|
+
return variant.isActive &&
|
|
36870
|
+
selectedVariantValues.every(function (selectedVariantValue) {
|
|
36871
|
+
return variant.variantValues.some(function (vvv) { return vvv.id === selectedVariantValue.id; });
|
|
36872
|
+
});
|
|
36873
|
+
});
|
|
36874
|
+
if (selectedVariant) {
|
|
36875
|
+
this.selectedVariantValues = selectedVariantValues;
|
|
36876
|
+
}
|
|
36877
|
+
else {
|
|
36878
|
+
var variantTypeIndex = this.product.variantTypes.findIndex(function (pvt) { return pvt.variantType.id === variantValue.variantTypeId; });
|
|
36879
|
+
if (variantTypeIndex > 0) {
|
|
36880
|
+
var parentVariantTypes_1 = this.product.variantTypes.slice(0, variantTypeIndex);
|
|
36881
|
+
var selectedParentVariantValues = this.selectedVariantValues.filter(function (vv) {
|
|
36882
|
+
return parentVariantTypes_1.some(function (pvt) { return pvt.variantType.id === vv.variantTypeId; });
|
|
36883
|
+
});
|
|
36884
|
+
var allVariantValues_1 = __spreadArrays(selectedParentVariantValues, [variantValue]);
|
|
36885
|
+
selectedVariant = this.product.variants.find(function (variant) {
|
|
36886
|
+
return variant.isActive &&
|
|
36887
|
+
allVariantValues_1.every(function (avv) {
|
|
36888
|
+
return variant.variantValues.some(function (vv) { return vv.id === avv.id; });
|
|
36889
|
+
});
|
|
36890
|
+
});
|
|
36891
|
+
}
|
|
36892
|
+
else {
|
|
36893
|
+
// Try to find a variant by only changing the last variant value
|
|
36894
|
+
// This helps with UX
|
|
36895
|
+
var notLastVariantValues_1 = selectedVariantValues.slice(0, selectedVariantValues.length - 1);
|
|
36896
|
+
selectedVariant = this.product.variants.find(function (variant) {
|
|
36897
|
+
return variant.isActive &&
|
|
36898
|
+
notLastVariantValues_1.every(function (nlvv) {
|
|
36899
|
+
return variant.variantValues.some(function (vv) { return vv.id === nlvv.id; });
|
|
36900
|
+
});
|
|
36901
|
+
});
|
|
36902
|
+
if (!selectedVariant)
|
|
36903
|
+
selectedVariant = this.product.variants.find(function (variant) {
|
|
36904
|
+
return variant.isActive &&
|
|
36905
|
+
variant.variantValues.some(function (vv) { return vv.id === variantValue.id; });
|
|
36906
|
+
});
|
|
36907
|
+
}
|
|
36908
|
+
if (selectedVariant)
|
|
36909
|
+
this.selectedVariantValues = selectedVariant.variantValues;
|
|
36910
|
+
else
|
|
36911
|
+
return; // This case should not happen
|
|
36912
|
+
}
|
|
36859
36913
|
var variantParams = this.product.variantTypes
|
|
36860
36914
|
.map(function (pvt) {
|
|
36861
36915
|
var vt = pvt.variantType;
|
|
36862
|
-
var
|
|
36916
|
+
var selectedVariantValue = vt.values.find(function (vv) {
|
|
36863
36917
|
return _this.selectedVariantValues.some(function (svv) { return svv.id === vv.id; });
|
|
36864
36918
|
});
|
|
36865
|
-
if (
|
|
36866
|
-
return vt.slug + "=" +
|
|
36919
|
+
if (selectedVariantValue)
|
|
36920
|
+
return vt.slug + "=" + selectedVariantValue.slug;
|
|
36867
36921
|
})
|
|
36868
36922
|
.filter(function (param) { return !!param; })
|
|
36869
36923
|
.join("&");
|
|
@@ -38162,7 +38216,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38162
38216
|
}
|
|
38163
38217
|
else {
|
|
38164
38218
|
data = response_1.data.map(function (product) {
|
|
38165
|
-
|
|
38219
|
+
var selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
38220
|
+
var productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
38221
|
+
return productDetail;
|
|
38166
38222
|
});
|
|
38167
38223
|
}
|
|
38168
38224
|
this.applyFacets(response_1.facets);
|
|
@@ -38210,7 +38266,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38210
38266
|
if (!response)
|
|
38211
38267
|
return [2 /*return*/];
|
|
38212
38268
|
data = response.data.map(function (product) {
|
|
38213
|
-
|
|
38269
|
+
var selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
38270
|
+
var productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
38271
|
+
return productDetail;
|
|
38214
38272
|
});
|
|
38215
38273
|
this.data = data.concat(this.data);
|
|
38216
38274
|
this._count = response.count;
|
|
@@ -38249,7 +38307,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38249
38307
|
if (!response)
|
|
38250
38308
|
return [2 /*return*/];
|
|
38251
38309
|
data = response.data.map(function (product) {
|
|
38252
|
-
|
|
38310
|
+
var selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
38311
|
+
var productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
38312
|
+
return productDetail;
|
|
38253
38313
|
});
|
|
38254
38314
|
this.data = this.data.concat(data);
|
|
38255
38315
|
this._count = response.count;
|
|
@@ -38287,7 +38347,9 @@ var IkasProductList = /** @class */ (function () {
|
|
|
38287
38347
|
if (!response)
|
|
38288
38348
|
return [2 /*return*/];
|
|
38289
38349
|
data = response.data.map(function (product) {
|
|
38290
|
-
|
|
38350
|
+
var selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
38351
|
+
var productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
38352
|
+
return productDetail;
|
|
38291
38353
|
});
|
|
38292
38354
|
this.data = data;
|
|
38293
38355
|
this._count = response.count;
|
|
@@ -42977,13 +43039,15 @@ var templateObject_1$9;
|
|
|
42977
43039
|
var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
42978
43040
|
function IkasHTMLMetaDataAPI() {
|
|
42979
43041
|
}
|
|
42980
|
-
IkasHTMLMetaDataAPI.listHTMLMetaData = function (slug,
|
|
43042
|
+
IkasHTMLMetaDataAPI.listHTMLMetaData = function (slug, targetIds, targetType, page, limit) {
|
|
43043
|
+
if (page === void 0) { page = 1; }
|
|
43044
|
+
if (limit === void 0) { limit = 200; }
|
|
42981
43045
|
return __awaiter(this, void 0, void 0, function () {
|
|
42982
43046
|
var LIST_QUERY, _a, data, errors, err_1;
|
|
42983
43047
|
return __generator(this, function (_b) {
|
|
42984
43048
|
switch (_b.label) {
|
|
42985
43049
|
case 0:
|
|
42986
|
-
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 "])));
|
|
43050
|
+
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 "])));
|
|
42987
43051
|
_b.label = 1;
|
|
42988
43052
|
case 1:
|
|
42989
43053
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42997,9 +43061,9 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
|
42997
43061
|
eq: slug,
|
|
42998
43062
|
}
|
|
42999
43063
|
: undefined,
|
|
43000
|
-
targetId:
|
|
43064
|
+
targetId: targetIds
|
|
43001
43065
|
? {
|
|
43002
|
-
|
|
43066
|
+
in: targetIds,
|
|
43003
43067
|
}
|
|
43004
43068
|
: undefined,
|
|
43005
43069
|
targetType: targetType
|
|
@@ -43007,6 +43071,10 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
|
|
|
43007
43071
|
in: targetType,
|
|
43008
43072
|
}
|
|
43009
43073
|
: undefined,
|
|
43074
|
+
pagination: {
|
|
43075
|
+
page: page,
|
|
43076
|
+
limit: limit,
|
|
43077
|
+
},
|
|
43010
43078
|
},
|
|
43011
43079
|
})];
|
|
43012
43080
|
case 2:
|
|
@@ -43719,6 +43787,248 @@ var IkasProductBackInStockReminderAPI = /** @class */ (function () {
|
|
|
43719
43787
|
}());
|
|
43720
43788
|
var templateObject_1$j, templateObject_2$9;
|
|
43721
43789
|
|
|
43790
|
+
/**
|
|
43791
|
+
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
43792
|
+
* support for iteratee shorthands.
|
|
43793
|
+
*
|
|
43794
|
+
* @private
|
|
43795
|
+
* @param {Array} array The array to inspect.
|
|
43796
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
43797
|
+
* @param {number} fromIndex The index to search from.
|
|
43798
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
43799
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
43800
|
+
*/
|
|
43801
|
+
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
43802
|
+
var length = array.length,
|
|
43803
|
+
index = fromIndex + (fromRight ? 1 : -1);
|
|
43804
|
+
|
|
43805
|
+
while ((fromRight ? index-- : ++index < length)) {
|
|
43806
|
+
if (predicate(array[index], index, array)) {
|
|
43807
|
+
return index;
|
|
43808
|
+
}
|
|
43809
|
+
}
|
|
43810
|
+
return -1;
|
|
43811
|
+
}
|
|
43812
|
+
|
|
43813
|
+
var _baseFindIndex = baseFindIndex;
|
|
43814
|
+
|
|
43815
|
+
/**
|
|
43816
|
+
* The base implementation of `_.isNaN` without support for number objects.
|
|
43817
|
+
*
|
|
43818
|
+
* @private
|
|
43819
|
+
* @param {*} value The value to check.
|
|
43820
|
+
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
|
43821
|
+
*/
|
|
43822
|
+
function baseIsNaN(value) {
|
|
43823
|
+
return value !== value;
|
|
43824
|
+
}
|
|
43825
|
+
|
|
43826
|
+
var _baseIsNaN = baseIsNaN;
|
|
43827
|
+
|
|
43828
|
+
/**
|
|
43829
|
+
* A specialized version of `_.indexOf` which performs strict equality
|
|
43830
|
+
* comparisons of values, i.e. `===`.
|
|
43831
|
+
*
|
|
43832
|
+
* @private
|
|
43833
|
+
* @param {Array} array The array to inspect.
|
|
43834
|
+
* @param {*} value The value to search for.
|
|
43835
|
+
* @param {number} fromIndex The index to search from.
|
|
43836
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
43837
|
+
*/
|
|
43838
|
+
function strictIndexOf(array, value, fromIndex) {
|
|
43839
|
+
var index = fromIndex - 1,
|
|
43840
|
+
length = array.length;
|
|
43841
|
+
|
|
43842
|
+
while (++index < length) {
|
|
43843
|
+
if (array[index] === value) {
|
|
43844
|
+
return index;
|
|
43845
|
+
}
|
|
43846
|
+
}
|
|
43847
|
+
return -1;
|
|
43848
|
+
}
|
|
43849
|
+
|
|
43850
|
+
var _strictIndexOf = strictIndexOf;
|
|
43851
|
+
|
|
43852
|
+
/**
|
|
43853
|
+
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
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 baseIndexOf(array, value, fromIndex) {
|
|
43862
|
+
return value === value
|
|
43863
|
+
? _strictIndexOf(array, value, fromIndex)
|
|
43864
|
+
: _baseFindIndex(array, _baseIsNaN, fromIndex);
|
|
43865
|
+
}
|
|
43866
|
+
|
|
43867
|
+
var _baseIndexOf = baseIndexOf;
|
|
43868
|
+
|
|
43869
|
+
/**
|
|
43870
|
+
* A specialized version of `_.includes` for arrays without support for
|
|
43871
|
+
* specifying an index to search from.
|
|
43872
|
+
*
|
|
43873
|
+
* @private
|
|
43874
|
+
* @param {Array} [array] The array to inspect.
|
|
43875
|
+
* @param {*} target The value to search for.
|
|
43876
|
+
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
43877
|
+
*/
|
|
43878
|
+
function arrayIncludes(array, value) {
|
|
43879
|
+
var length = array == null ? 0 : array.length;
|
|
43880
|
+
return !!length && _baseIndexOf(array, value, 0) > -1;
|
|
43881
|
+
}
|
|
43882
|
+
|
|
43883
|
+
var _arrayIncludes = arrayIncludes;
|
|
43884
|
+
|
|
43885
|
+
/**
|
|
43886
|
+
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
43887
|
+
*
|
|
43888
|
+
* @private
|
|
43889
|
+
* @param {Array} [array] The array to inspect.
|
|
43890
|
+
* @param {*} target The value to search for.
|
|
43891
|
+
* @param {Function} comparator The comparator invoked per element.
|
|
43892
|
+
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
43893
|
+
*/
|
|
43894
|
+
function arrayIncludesWith(array, value, comparator) {
|
|
43895
|
+
var index = -1,
|
|
43896
|
+
length = array == null ? 0 : array.length;
|
|
43897
|
+
|
|
43898
|
+
while (++index < length) {
|
|
43899
|
+
if (comparator(value, array[index])) {
|
|
43900
|
+
return true;
|
|
43901
|
+
}
|
|
43902
|
+
}
|
|
43903
|
+
return false;
|
|
43904
|
+
}
|
|
43905
|
+
|
|
43906
|
+
var _arrayIncludesWith = arrayIncludesWith;
|
|
43907
|
+
|
|
43908
|
+
/**
|
|
43909
|
+
* This method returns `undefined`.
|
|
43910
|
+
*
|
|
43911
|
+
* @static
|
|
43912
|
+
* @memberOf _
|
|
43913
|
+
* @since 2.3.0
|
|
43914
|
+
* @category Util
|
|
43915
|
+
* @example
|
|
43916
|
+
*
|
|
43917
|
+
* _.times(2, _.noop);
|
|
43918
|
+
* // => [undefined, undefined]
|
|
43919
|
+
*/
|
|
43920
|
+
function noop() {
|
|
43921
|
+
// No operation performed.
|
|
43922
|
+
}
|
|
43923
|
+
|
|
43924
|
+
var noop_1 = noop;
|
|
43925
|
+
|
|
43926
|
+
/** Used as references for various `Number` constants. */
|
|
43927
|
+
var INFINITY$2 = 1 / 0;
|
|
43928
|
+
|
|
43929
|
+
/**
|
|
43930
|
+
* Creates a set object of `values`.
|
|
43931
|
+
*
|
|
43932
|
+
* @private
|
|
43933
|
+
* @param {Array} values The values to add to the set.
|
|
43934
|
+
* @returns {Object} Returns the new set.
|
|
43935
|
+
*/
|
|
43936
|
+
var createSet = !(_Set && (1 / _setToArray(new _Set([,-0]))[1]) == INFINITY$2) ? noop_1 : function(values) {
|
|
43937
|
+
return new _Set(values);
|
|
43938
|
+
};
|
|
43939
|
+
|
|
43940
|
+
var _createSet = createSet;
|
|
43941
|
+
|
|
43942
|
+
/** Used as the size to enable large array optimizations. */
|
|
43943
|
+
var LARGE_ARRAY_SIZE$1 = 200;
|
|
43944
|
+
|
|
43945
|
+
/**
|
|
43946
|
+
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
|
|
43947
|
+
*
|
|
43948
|
+
* @private
|
|
43949
|
+
* @param {Array} array The array to inspect.
|
|
43950
|
+
* @param {Function} [iteratee] The iteratee invoked per element.
|
|
43951
|
+
* @param {Function} [comparator] The comparator invoked per element.
|
|
43952
|
+
* @returns {Array} Returns the new duplicate free array.
|
|
43953
|
+
*/
|
|
43954
|
+
function baseUniq(array, iteratee, comparator) {
|
|
43955
|
+
var index = -1,
|
|
43956
|
+
includes = _arrayIncludes,
|
|
43957
|
+
length = array.length,
|
|
43958
|
+
isCommon = true,
|
|
43959
|
+
result = [],
|
|
43960
|
+
seen = result;
|
|
43961
|
+
|
|
43962
|
+
if (comparator) {
|
|
43963
|
+
isCommon = false;
|
|
43964
|
+
includes = _arrayIncludesWith;
|
|
43965
|
+
}
|
|
43966
|
+
else if (length >= LARGE_ARRAY_SIZE$1) {
|
|
43967
|
+
var set = iteratee ? null : _createSet(array);
|
|
43968
|
+
if (set) {
|
|
43969
|
+
return _setToArray(set);
|
|
43970
|
+
}
|
|
43971
|
+
isCommon = false;
|
|
43972
|
+
includes = _cacheHas;
|
|
43973
|
+
seen = new _SetCache;
|
|
43974
|
+
}
|
|
43975
|
+
else {
|
|
43976
|
+
seen = iteratee ? [] : result;
|
|
43977
|
+
}
|
|
43978
|
+
outer:
|
|
43979
|
+
while (++index < length) {
|
|
43980
|
+
var value = array[index],
|
|
43981
|
+
computed = iteratee ? iteratee(value) : value;
|
|
43982
|
+
|
|
43983
|
+
value = (comparator || value !== 0) ? value : 0;
|
|
43984
|
+
if (isCommon && computed === computed) {
|
|
43985
|
+
var seenIndex = seen.length;
|
|
43986
|
+
while (seenIndex--) {
|
|
43987
|
+
if (seen[seenIndex] === computed) {
|
|
43988
|
+
continue outer;
|
|
43989
|
+
}
|
|
43990
|
+
}
|
|
43991
|
+
if (iteratee) {
|
|
43992
|
+
seen.push(computed);
|
|
43993
|
+
}
|
|
43994
|
+
result.push(value);
|
|
43995
|
+
}
|
|
43996
|
+
else if (!includes(seen, computed, comparator)) {
|
|
43997
|
+
if (seen !== result) {
|
|
43998
|
+
seen.push(computed);
|
|
43999
|
+
}
|
|
44000
|
+
result.push(value);
|
|
44001
|
+
}
|
|
44002
|
+
}
|
|
44003
|
+
return result;
|
|
44004
|
+
}
|
|
44005
|
+
|
|
44006
|
+
var _baseUniq = baseUniq;
|
|
44007
|
+
|
|
44008
|
+
/**
|
|
44009
|
+
* Creates a duplicate-free version of an array, using
|
|
44010
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
44011
|
+
* for equality comparisons, in which only the first occurrence of each element
|
|
44012
|
+
* is kept. The order of result values is determined by the order they occur
|
|
44013
|
+
* in the array.
|
|
44014
|
+
*
|
|
44015
|
+
* @static
|
|
44016
|
+
* @memberOf _
|
|
44017
|
+
* @since 0.1.0
|
|
44018
|
+
* @category Array
|
|
44019
|
+
* @param {Array} array The array to inspect.
|
|
44020
|
+
* @returns {Array} Returns the new duplicate free array.
|
|
44021
|
+
* @example
|
|
44022
|
+
*
|
|
44023
|
+
* _.uniq([2, 1, 2]);
|
|
44024
|
+
* // => [2, 1]
|
|
44025
|
+
*/
|
|
44026
|
+
function uniq(array) {
|
|
44027
|
+
return (array && array.length) ? _baseUniq(array) : [];
|
|
44028
|
+
}
|
|
44029
|
+
|
|
44030
|
+
var uniq_1 = uniq;
|
|
44031
|
+
|
|
43722
44032
|
var IkasProductListPropValueProvider = /** @class */ (function () {
|
|
43723
44033
|
function IkasProductListPropValueProvider(pageType, productListPropValue, pageSpecificData) {
|
|
43724
44034
|
this.pageType = pageType;
|
|
@@ -43798,7 +44108,7 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
43798
44108
|
IkasProductDetailPropValueProvider.prototype.getValue = function () {
|
|
43799
44109
|
var _a;
|
|
43800
44110
|
return __awaiter(this, void 0, void 0, function () {
|
|
43801
|
-
var productSearchResponse, productList, product, optionSetResponse, variant;
|
|
44111
|
+
var productSearchResponse, productList, product, optionSetResponse, variant, selectedVariant;
|
|
43802
44112
|
var _this = this;
|
|
43803
44113
|
return __generator(this, function (_b) {
|
|
43804
44114
|
switch (_b.label) {
|
|
@@ -43843,9 +44153,10 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
43843
44153
|
return [2 /*return*/, null];
|
|
43844
44154
|
}
|
|
43845
44155
|
else {
|
|
44156
|
+
selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
43846
44157
|
return [2 /*return*/, {
|
|
43847
44158
|
productDetailPropValue: this.productDetailPropValue,
|
|
43848
|
-
productDetail: new IkasProductDetail(product, product.variants[0].variantValues),
|
|
44159
|
+
productDetail: new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues),
|
|
43849
44160
|
}];
|
|
43850
44161
|
}
|
|
43851
44162
|
case 4: return [2 /*return*/, {
|
|
@@ -43930,106 +44241,114 @@ var IkasBrandPropValueProvider = /** @class */ (function () {
|
|
|
43930
44241
|
}());
|
|
43931
44242
|
|
|
43932
44243
|
var IkasLinkPropValueProvider = /** @class */ (function () {
|
|
43933
|
-
function IkasLinkPropValueProvider(linkPropValue, theme) {
|
|
44244
|
+
function IkasLinkPropValueProvider(linkPropValue, theme, linkMetaDataTargetIds) {
|
|
43934
44245
|
this.linkPropValue = linkPropValue;
|
|
43935
44246
|
this.theme = theme;
|
|
44247
|
+
this.linkMetaDataTargetIds = linkMetaDataTargetIds;
|
|
43936
44248
|
}
|
|
43937
44249
|
IkasLinkPropValueProvider.prototype.getNavigationLink = function (linkPropValue) {
|
|
43938
44250
|
var _a, _b;
|
|
43939
44251
|
return __awaiter(this, void 0, void 0, function () {
|
|
43940
|
-
var navigationLink, themePage,
|
|
44252
|
+
var navigationLink, themePage, _c, page, headerComponentId_1, footerComponentId_1, pageComponents, componentIndex;
|
|
43941
44253
|
var _this = this;
|
|
43942
44254
|
return __generator(this, function (_d) {
|
|
43943
44255
|
switch (_d.label) {
|
|
43944
44256
|
case 0:
|
|
43945
|
-
if (
|
|
43946
|
-
|
|
43947
|
-
|
|
43948
|
-
|
|
43949
|
-
|
|
43950
|
-
|
|
43951
|
-
|
|
43952
|
-
|
|
43953
|
-
|
|
43954
|
-
|
|
43955
|
-
|
|
43956
|
-
|
|
43957
|
-
|
|
43958
|
-
|
|
43959
|
-
|
|
43960
|
-
|
|
43961
|
-
|
|
43962
|
-
|
|
43963
|
-
|
|
43964
|
-
|
|
43965
|
-
|
|
43966
|
-
|
|
43967
|
-
|
|
43968
|
-
|
|
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
|
-
navigationLink = new IkasNavigationLink(
|
|
44257
|
+
if (linkPropValue.linkType === exports.IkasLinkType.PAGE) {
|
|
44258
|
+
// INDEX PAGE
|
|
44259
|
+
if (linkPropValue.pageType === exports.IkasThemePageType.INDEX) {
|
|
44260
|
+
navigationLink = new IkasNavigationLink("/", linkPropValue.label || "", []);
|
|
44261
|
+
}
|
|
44262
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.ACCOUNT) {
|
|
44263
|
+
navigationLink = new IkasNavigationLink("/account/info", linkPropValue.label || "", []);
|
|
44264
|
+
}
|
|
44265
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.ADDRESSES) {
|
|
44266
|
+
navigationLink = new IkasNavigationLink("/account/addresses", linkPropValue.label || "", []);
|
|
44267
|
+
}
|
|
44268
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.ORDERS) {
|
|
44269
|
+
navigationLink = new IkasNavigationLink("/account/orders", linkPropValue.label || "", []);
|
|
44270
|
+
}
|
|
44271
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.FAVORITE_PRODUCTS) {
|
|
44272
|
+
navigationLink = new IkasNavigationLink("/account/favorite-products", linkPropValue.label || "", []);
|
|
44273
|
+
}
|
|
44274
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.LOGIN) {
|
|
44275
|
+
navigationLink = new IkasNavigationLink("/account/login", linkPropValue.label || "", []);
|
|
44276
|
+
}
|
|
44277
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.REGISTER) {
|
|
44278
|
+
navigationLink = new IkasNavigationLink("/account/register", linkPropValue.label || "", []);
|
|
44279
|
+
}
|
|
44280
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.FORGOT_PASSWORD) {
|
|
44281
|
+
navigationLink = new IkasNavigationLink("/account/forgot-password", linkPropValue.label || "", []);
|
|
44282
|
+
}
|
|
44283
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.RECOVER_PASSWORD) {
|
|
44284
|
+
navigationLink = new IkasNavigationLink("/account/recover-password", linkPropValue.label || "", []);
|
|
44285
|
+
}
|
|
44286
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.BLOG_INDEX) {
|
|
44287
|
+
navigationLink = new IkasNavigationLink("/blog", linkPropValue.label || "", []);
|
|
44288
|
+
}
|
|
44289
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.CART) {
|
|
44290
|
+
navigationLink = new IkasNavigationLink("/cart", linkPropValue.label || "", []);
|
|
44291
|
+
}
|
|
44292
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.SEARCH) {
|
|
44293
|
+
navigationLink = new IkasNavigationLink("/search", linkPropValue.label || "", []);
|
|
44294
|
+
}
|
|
44295
|
+
// CUSTOM PAGE
|
|
44296
|
+
else if (linkPropValue.pageType === exports.IkasThemePageType.CUSTOM) {
|
|
44297
|
+
themePage = this.theme.pages.find(function (p) { return p.id === linkPropValue.pageId; });
|
|
44298
|
+
if (themePage) {
|
|
44299
|
+
navigationLink = new IkasNavigationLink("/pages/" + themePage.slug, linkPropValue.label || "", []);
|
|
44300
|
+
}
|
|
44301
|
+
}
|
|
44302
|
+
// ITEM PAGES
|
|
44303
|
+
else if ([
|
|
44304
|
+
exports.IkasThemePageType.PRODUCT,
|
|
44305
|
+
exports.IkasThemePageType.BRAND,
|
|
44306
|
+
exports.IkasThemePageType.CATEGORY,
|
|
44307
|
+
].includes(linkPropValue.pageType)) {
|
|
44308
|
+
if (linkPropValue.itemId) {
|
|
44309
|
+
navigationLink = new IkasNavigationLink("/", linkPropValue.label || "", []);
|
|
44310
|
+
this.linkMetaDataTargetIds.push({
|
|
44311
|
+
type: "DEFAULT",
|
|
44312
|
+
id: linkPropValue.itemId,
|
|
44313
|
+
navigationLink: navigationLink,
|
|
44314
|
+
});
|
|
44315
|
+
}
|
|
44316
|
+
}
|
|
44317
|
+
// BLOG ITEM PAGES
|
|
44318
|
+
else if ([exports.IkasThemePageType.BLOG, exports.IkasThemePageType.BLOG_CATEGORY].includes(linkPropValue.pageType)) {
|
|
44319
|
+
if (linkPropValue.itemId) {
|
|
44320
|
+
navigationLink = new IkasNavigationLink("/blog/", linkPropValue.label || "", []);
|
|
44321
|
+
this.linkMetaDataTargetIds.push({
|
|
44322
|
+
type: "BLOG",
|
|
44323
|
+
id: linkPropValue.itemId,
|
|
44324
|
+
navigationLink: navigationLink,
|
|
44325
|
+
});
|
|
44326
|
+
}
|
|
44327
|
+
}
|
|
44328
|
+
// RAFFLE ITEM PAGE
|
|
44329
|
+
// else if (linkPropValue.pageType === IkasThemePageType.RAFFLE_DETAIL) {
|
|
44330
|
+
// if (linkPropValue.itemId) {
|
|
44331
|
+
// navigationLink = new IkasNavigationLink(
|
|
44332
|
+
// "/raffle/",
|
|
44333
|
+
// linkPropValue.label || "",
|
|
44334
|
+
// []
|
|
44335
|
+
// );
|
|
44336
|
+
// this.linkMetaDataTargetIds.push({
|
|
44337
|
+
// type: "RAFFLE",
|
|
44338
|
+
// id: linkPropValue.itemId,
|
|
44339
|
+
// navigationLink,
|
|
44340
|
+
// });
|
|
44341
|
+
// }
|
|
44342
|
+
// }
|
|
44020
44343
|
}
|
|
44021
|
-
|
|
44022
|
-
|
|
44023
|
-
case 18:
|
|
44024
|
-
if (linkPropValue.linkType === exports.IkasLinkType.EXTERNAL) {
|
|
44344
|
+
// EXTERNAL LINK
|
|
44345
|
+
else if (linkPropValue.linkType === exports.IkasLinkType.EXTERNAL) {
|
|
44025
44346
|
navigationLink = new IkasNavigationLink(linkPropValue.externalLink || "", linkPropValue.label || "", [], true);
|
|
44026
44347
|
}
|
|
44027
|
-
|
|
44028
|
-
case 19:
|
|
44029
|
-
if (!navigationLink) return [3 /*break*/, 21];
|
|
44348
|
+
if (!navigationLink) return [3 /*break*/, 2];
|
|
44030
44349
|
_c = navigationLink;
|
|
44031
44350
|
return [4 /*yield*/, Promise.all(linkPropValue.subLinks.map(function (sl) { return _this.getNavigationLink(sl); }))];
|
|
44032
|
-
case
|
|
44351
|
+
case 1:
|
|
44033
44352
|
_c.subLinks = _d.sent();
|
|
44034
44353
|
// ADD HASH LINK
|
|
44035
44354
|
if (linkPropValue.pageComponentId && linkPropValue.pageId) {
|
|
@@ -44046,7 +44365,7 @@ var IkasLinkPropValueProvider = /** @class */ (function () {
|
|
|
44046
44365
|
}
|
|
44047
44366
|
}
|
|
44048
44367
|
return [2 /*return*/, navigationLink];
|
|
44049
|
-
case
|
|
44368
|
+
case 2: return [2 /*return*/, new IkasNavigationLink("", "", [])];
|
|
44050
44369
|
}
|
|
44051
44370
|
});
|
|
44052
44371
|
});
|
|
@@ -44305,7 +44624,7 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
|
44305
44624
|
IkasAttributePropValueProvider.prototype.getValue = function () {
|
|
44306
44625
|
var _a;
|
|
44307
44626
|
return __awaiter(this, void 0, void 0, function () {
|
|
44308
|
-
var productDetail, productSearchResponse, productList, product, variant;
|
|
44627
|
+
var productDetail, productSearchResponse, productList, product, variant, selectedVariant;
|
|
44309
44628
|
var _this = this;
|
|
44310
44629
|
return __generator(this, function (_b) {
|
|
44311
44630
|
switch (_b.label) {
|
|
@@ -44336,7 +44655,8 @@ var IkasAttributePropValueProvider = /** @class */ (function () {
|
|
|
44336
44655
|
}
|
|
44337
44656
|
}
|
|
44338
44657
|
else {
|
|
44339
|
-
|
|
44658
|
+
selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
44659
|
+
productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
44340
44660
|
}
|
|
44341
44661
|
}
|
|
44342
44662
|
}
|
|
@@ -44358,7 +44678,7 @@ var IkasAttributeListPropValueProvider = /** @class */ (function () {
|
|
|
44358
44678
|
IkasAttributeListPropValueProvider.prototype.getValue = function () {
|
|
44359
44679
|
var _a;
|
|
44360
44680
|
return __awaiter(this, void 0, void 0, function () {
|
|
44361
|
-
var productDetail, productSearchResponse, productList, product, variant;
|
|
44681
|
+
var productDetail, productSearchResponse, productList, product, variant, selectedVariant;
|
|
44362
44682
|
var _this = this;
|
|
44363
44683
|
return __generator(this, function (_b) {
|
|
44364
44684
|
switch (_b.label) {
|
|
@@ -44390,7 +44710,8 @@ var IkasAttributeListPropValueProvider = /** @class */ (function () {
|
|
|
44390
44710
|
}
|
|
44391
44711
|
}
|
|
44392
44712
|
else {
|
|
44393
|
-
|
|
44713
|
+
selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
44714
|
+
productDetail = new IkasProductDetail(product, (selectedVariant || product.variants[0]).variantValues);
|
|
44394
44715
|
}
|
|
44395
44716
|
}
|
|
44396
44717
|
}
|
|
@@ -44798,7 +45119,7 @@ var IkasCustomPropValueProvider = /** @class */ (function () {
|
|
|
44798
45119
|
return __generator(this, function (_a) {
|
|
44799
45120
|
switch (_a.label) {
|
|
44800
45121
|
case 0:
|
|
44801
|
-
provider = new IkasLinkPropValueProvider(this.value, this.theme);
|
|
45122
|
+
provider = new IkasLinkPropValueProvider(this.value, this.theme, this.pageDataProvider.linkMetaDataTargetIds);
|
|
44802
45123
|
return [4 /*yield*/, provider.getValue()];
|
|
44803
45124
|
case 1:
|
|
44804
45125
|
value = _a.sent();
|
|
@@ -45116,6 +45437,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45116
45437
|
this.pageSpecificData = null;
|
|
45117
45438
|
this.merchantSettings = null;
|
|
45118
45439
|
this.possiblePageTypes = []; // Used for distinguishing blog slug page from main slug page
|
|
45440
|
+
this.linkMetaDataTargetIds = []; // Used for bulk fetching of link slugs
|
|
45119
45441
|
this.theme = new IkasTheme(theme);
|
|
45120
45442
|
this.pageParams = pageParams || {};
|
|
45121
45443
|
this.pageType = pageType;
|
|
@@ -45226,6 +45548,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45226
45548
|
}))];
|
|
45227
45549
|
case 4:
|
|
45228
45550
|
_a.pageComponentPropValues = _b.sent();
|
|
45551
|
+
return [4 /*yield*/, this.setLinkSlugs()];
|
|
45552
|
+
case 5:
|
|
45553
|
+
_b.sent();
|
|
45229
45554
|
return [2 /*return*/];
|
|
45230
45555
|
}
|
|
45231
45556
|
});
|
|
@@ -45271,7 +45596,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45271
45596
|
if (!metaData.targetId)
|
|
45272
45597
|
return [2 /*return*/];
|
|
45273
45598
|
handleProductPage = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
45274
|
-
var productsResponse, product, optionSetResponse, displayedVariantType, inStockVariant;
|
|
45599
|
+
var productsResponse, product, optionSetResponse, selectedVariant, displayedVariantType, inStockVariant;
|
|
45275
45600
|
return __generator(this, function (_a) {
|
|
45276
45601
|
switch (_a.label) {
|
|
45277
45602
|
case 0: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
@@ -45294,7 +45619,10 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45294
45619
|
}
|
|
45295
45620
|
_a.label = 3;
|
|
45296
45621
|
case 3:
|
|
45297
|
-
|
|
45622
|
+
selectedVariant = product.variants.find(function (v) { return v.isActive; });
|
|
45623
|
+
if (!selectedVariant)
|
|
45624
|
+
return [2 /*return*/];
|
|
45625
|
+
this.pageSpecificData = new IkasProductDetail(product, selectedVariant.variantValues);
|
|
45298
45626
|
// Select the first displayed in stock variant
|
|
45299
45627
|
if (this.pageSpecificData.displayedVariantTypes.length) {
|
|
45300
45628
|
displayedVariantType = this
|
|
@@ -45528,7 +45856,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45528
45856
|
propValueProvider = new IkasCategoryListPropValueProvider(propValue);
|
|
45529
45857
|
return [3 /*break*/, 24];
|
|
45530
45858
|
case 14:
|
|
45531
|
-
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme);
|
|
45859
|
+
propValueProvider = new IkasLinkPropValueProvider(propValue, this.theme, this.linkMetaDataTargetIds);
|
|
45532
45860
|
return [3 /*break*/, 24];
|
|
45533
45861
|
case 15:
|
|
45534
45862
|
propValueProvider = new IkasColorPropValueProvider(propValue);
|
|
@@ -45568,6 +45896,104 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
45568
45896
|
this.page.description = metaData.description;
|
|
45569
45897
|
}
|
|
45570
45898
|
};
|
|
45899
|
+
IkasPageDataProvider.prototype.setLinkSlugs = function () {
|
|
45900
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45901
|
+
var defaultLinks, blogLinks, raffleLinks;
|
|
45902
|
+
return __generator(this, function (_a) {
|
|
45903
|
+
switch (_a.label) {
|
|
45904
|
+
case 0:
|
|
45905
|
+
defaultLinks = [];
|
|
45906
|
+
blogLinks = [];
|
|
45907
|
+
raffleLinks = [];
|
|
45908
|
+
this.linkMetaDataTargetIds.forEach(function (target) {
|
|
45909
|
+
switch (target.type) {
|
|
45910
|
+
case "DEFAULT":
|
|
45911
|
+
defaultLinks.push(target);
|
|
45912
|
+
break;
|
|
45913
|
+
case "BLOG":
|
|
45914
|
+
blogLinks.push(target);
|
|
45915
|
+
break;
|
|
45916
|
+
case "RAFFLE":
|
|
45917
|
+
raffleLinks.push(target);
|
|
45918
|
+
break;
|
|
45919
|
+
}
|
|
45920
|
+
});
|
|
45921
|
+
return [4 /*yield*/, Promise.all([
|
|
45922
|
+
this.getLinkSlugs(defaultLinks, "DEFAULT"),
|
|
45923
|
+
this.getLinkSlugs(blogLinks, "BLOG"),
|
|
45924
|
+
this.getLinkSlugs(raffleLinks, "RAFFLE"),
|
|
45925
|
+
])];
|
|
45926
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
45927
|
+
}
|
|
45928
|
+
});
|
|
45929
|
+
});
|
|
45930
|
+
};
|
|
45931
|
+
IkasPageDataProvider.prototype.getLinkSlugs = function (targets, type) {
|
|
45932
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45933
|
+
var idList, page, limit, metaDataList, fetchComplete, getPage;
|
|
45934
|
+
var _this = this;
|
|
45935
|
+
return __generator(this, function (_a) {
|
|
45936
|
+
switch (_a.label) {
|
|
45937
|
+
case 0:
|
|
45938
|
+
idList = uniq_1(targets.map(function (t) { return t.id; }));
|
|
45939
|
+
page = 1;
|
|
45940
|
+
limit = 200;
|
|
45941
|
+
metaDataList = [];
|
|
45942
|
+
fetchComplete = false;
|
|
45943
|
+
getPage = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
45944
|
+
var results, _a;
|
|
45945
|
+
return __generator(this, function (_b) {
|
|
45946
|
+
switch (_b.label) {
|
|
45947
|
+
case 0:
|
|
45948
|
+
results = [];
|
|
45949
|
+
_a = type;
|
|
45950
|
+
switch (_a) {
|
|
45951
|
+
case "DEFAULT": return [3 /*break*/, 1];
|
|
45952
|
+
case "BLOG": return [3 /*break*/, 3];
|
|
45953
|
+
}
|
|
45954
|
+
return [3 /*break*/, 5];
|
|
45955
|
+
case 1: return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, idList, undefined, page, limit)];
|
|
45956
|
+
case 2:
|
|
45957
|
+
results = _b.sent();
|
|
45958
|
+
return [3 /*break*/, 6];
|
|
45959
|
+
case 3: return [4 /*yield*/, IkasBlogAPI.listBlogMetaData(undefined, idList, undefined, page, limit)];
|
|
45960
|
+
case 4:
|
|
45961
|
+
results = _b.sent();
|
|
45962
|
+
return [3 /*break*/, 6];
|
|
45963
|
+
case 5: return [3 /*break*/, 6];
|
|
45964
|
+
case 6:
|
|
45965
|
+
if (results.length) {
|
|
45966
|
+
metaDataList = metaDataList.concat(results);
|
|
45967
|
+
if (results.length < 200)
|
|
45968
|
+
fetchComplete = true;
|
|
45969
|
+
}
|
|
45970
|
+
else
|
|
45971
|
+
fetchComplete = true;
|
|
45972
|
+
page++;
|
|
45973
|
+
return [2 /*return*/];
|
|
45974
|
+
}
|
|
45975
|
+
});
|
|
45976
|
+
}); };
|
|
45977
|
+
_a.label = 1;
|
|
45978
|
+
case 1:
|
|
45979
|
+
if (!(!fetchComplete && metaDataList.length < idList.length)) return [3 /*break*/, 3];
|
|
45980
|
+
return [4 /*yield*/, getPage()];
|
|
45981
|
+
case 2:
|
|
45982
|
+
_a.sent();
|
|
45983
|
+
return [3 /*break*/, 1];
|
|
45984
|
+
case 3:
|
|
45985
|
+
metaDataList.forEach(function (metaData) {
|
|
45986
|
+
targets
|
|
45987
|
+
.filter(function (t) { return t.id === metaData.targetId; })
|
|
45988
|
+
.forEach(function (t) {
|
|
45989
|
+
t.navigationLink.href += metaData.slug;
|
|
45990
|
+
});
|
|
45991
|
+
});
|
|
45992
|
+
return [2 /*return*/];
|
|
45993
|
+
}
|
|
45994
|
+
});
|
|
45995
|
+
});
|
|
45996
|
+
};
|
|
45571
45997
|
return IkasPageDataProvider;
|
|
45572
45998
|
}());
|
|
45573
45999
|
var IkasPageComponentPropValue = /** @class */ (function () {
|
|
@@ -67865,7 +68291,7 @@ var createMethod = function (IS_INCLUDES) {
|
|
|
67865
68291
|
};
|
|
67866
68292
|
};
|
|
67867
68293
|
|
|
67868
|
-
var arrayIncludes = {
|
|
68294
|
+
var arrayIncludes$1 = {
|
|
67869
68295
|
// `Array.prototype.includes` method
|
|
67870
68296
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
67871
68297
|
includes: createMethod(true),
|
|
@@ -67874,7 +68300,7 @@ var arrayIncludes = {
|
|
|
67874
68300
|
indexOf: createMethod(false)
|
|
67875
68301
|
};
|
|
67876
68302
|
|
|
67877
|
-
var indexOf = arrayIncludes.indexOf;
|
|
68303
|
+
var indexOf = arrayIncludes$1.indexOf;
|
|
67878
68304
|
|
|
67879
68305
|
|
|
67880
68306
|
var objectKeysInternal = function (object, names) {
|
|
@@ -72755,224 +73181,6 @@ function flatten(array) {
|
|
|
72755
73181
|
|
|
72756
73182
|
var flatten_1 = flatten;
|
|
72757
73183
|
|
|
72758
|
-
/**
|
|
72759
|
-
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
72760
|
-
* support for iteratee shorthands.
|
|
72761
|
-
*
|
|
72762
|
-
* @private
|
|
72763
|
-
* @param {Array} array The array to inspect.
|
|
72764
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
72765
|
-
* @param {number} fromIndex The index to search from.
|
|
72766
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
72767
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
72768
|
-
*/
|
|
72769
|
-
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
72770
|
-
var length = array.length,
|
|
72771
|
-
index = fromIndex + (fromRight ? 1 : -1);
|
|
72772
|
-
|
|
72773
|
-
while ((fromRight ? index-- : ++index < length)) {
|
|
72774
|
-
if (predicate(array[index], index, array)) {
|
|
72775
|
-
return index;
|
|
72776
|
-
}
|
|
72777
|
-
}
|
|
72778
|
-
return -1;
|
|
72779
|
-
}
|
|
72780
|
-
|
|
72781
|
-
var _baseFindIndex = baseFindIndex;
|
|
72782
|
-
|
|
72783
|
-
/**
|
|
72784
|
-
* The base implementation of `_.isNaN` without support for number objects.
|
|
72785
|
-
*
|
|
72786
|
-
* @private
|
|
72787
|
-
* @param {*} value The value to check.
|
|
72788
|
-
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
|
72789
|
-
*/
|
|
72790
|
-
function baseIsNaN(value) {
|
|
72791
|
-
return value !== value;
|
|
72792
|
-
}
|
|
72793
|
-
|
|
72794
|
-
var _baseIsNaN = baseIsNaN;
|
|
72795
|
-
|
|
72796
|
-
/**
|
|
72797
|
-
* A specialized version of `_.indexOf` which performs strict equality
|
|
72798
|
-
* comparisons of values, i.e. `===`.
|
|
72799
|
-
*
|
|
72800
|
-
* @private
|
|
72801
|
-
* @param {Array} array The array to inspect.
|
|
72802
|
-
* @param {*} value The value to search for.
|
|
72803
|
-
* @param {number} fromIndex The index to search from.
|
|
72804
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
72805
|
-
*/
|
|
72806
|
-
function strictIndexOf(array, value, fromIndex) {
|
|
72807
|
-
var index = fromIndex - 1,
|
|
72808
|
-
length = array.length;
|
|
72809
|
-
|
|
72810
|
-
while (++index < length) {
|
|
72811
|
-
if (array[index] === value) {
|
|
72812
|
-
return index;
|
|
72813
|
-
}
|
|
72814
|
-
}
|
|
72815
|
-
return -1;
|
|
72816
|
-
}
|
|
72817
|
-
|
|
72818
|
-
var _strictIndexOf = strictIndexOf;
|
|
72819
|
-
|
|
72820
|
-
/**
|
|
72821
|
-
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
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 baseIndexOf(array, value, fromIndex) {
|
|
72830
|
-
return value === value
|
|
72831
|
-
? _strictIndexOf(array, value, fromIndex)
|
|
72832
|
-
: _baseFindIndex(array, _baseIsNaN, fromIndex);
|
|
72833
|
-
}
|
|
72834
|
-
|
|
72835
|
-
var _baseIndexOf = baseIndexOf;
|
|
72836
|
-
|
|
72837
|
-
/**
|
|
72838
|
-
* A specialized version of `_.includes` for arrays without support for
|
|
72839
|
-
* specifying an index to search from.
|
|
72840
|
-
*
|
|
72841
|
-
* @private
|
|
72842
|
-
* @param {Array} [array] The array to inspect.
|
|
72843
|
-
* @param {*} target The value to search for.
|
|
72844
|
-
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
72845
|
-
*/
|
|
72846
|
-
function arrayIncludes$1(array, value) {
|
|
72847
|
-
var length = array == null ? 0 : array.length;
|
|
72848
|
-
return !!length && _baseIndexOf(array, value, 0) > -1;
|
|
72849
|
-
}
|
|
72850
|
-
|
|
72851
|
-
var _arrayIncludes = arrayIncludes$1;
|
|
72852
|
-
|
|
72853
|
-
/**
|
|
72854
|
-
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
72855
|
-
*
|
|
72856
|
-
* @private
|
|
72857
|
-
* @param {Array} [array] The array to inspect.
|
|
72858
|
-
* @param {*} target The value to search for.
|
|
72859
|
-
* @param {Function} comparator The comparator invoked per element.
|
|
72860
|
-
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
72861
|
-
*/
|
|
72862
|
-
function arrayIncludesWith(array, value, comparator) {
|
|
72863
|
-
var index = -1,
|
|
72864
|
-
length = array == null ? 0 : array.length;
|
|
72865
|
-
|
|
72866
|
-
while (++index < length) {
|
|
72867
|
-
if (comparator(value, array[index])) {
|
|
72868
|
-
return true;
|
|
72869
|
-
}
|
|
72870
|
-
}
|
|
72871
|
-
return false;
|
|
72872
|
-
}
|
|
72873
|
-
|
|
72874
|
-
var _arrayIncludesWith = arrayIncludesWith;
|
|
72875
|
-
|
|
72876
|
-
/**
|
|
72877
|
-
* This method returns `undefined`.
|
|
72878
|
-
*
|
|
72879
|
-
* @static
|
|
72880
|
-
* @memberOf _
|
|
72881
|
-
* @since 2.3.0
|
|
72882
|
-
* @category Util
|
|
72883
|
-
* @example
|
|
72884
|
-
*
|
|
72885
|
-
* _.times(2, _.noop);
|
|
72886
|
-
* // => [undefined, undefined]
|
|
72887
|
-
*/
|
|
72888
|
-
function noop() {
|
|
72889
|
-
// No operation performed.
|
|
72890
|
-
}
|
|
72891
|
-
|
|
72892
|
-
var noop_1 = noop;
|
|
72893
|
-
|
|
72894
|
-
/** Used as references for various `Number` constants. */
|
|
72895
|
-
var INFINITY$2 = 1 / 0;
|
|
72896
|
-
|
|
72897
|
-
/**
|
|
72898
|
-
* Creates a set object of `values`.
|
|
72899
|
-
*
|
|
72900
|
-
* @private
|
|
72901
|
-
* @param {Array} values The values to add to the set.
|
|
72902
|
-
* @returns {Object} Returns the new set.
|
|
72903
|
-
*/
|
|
72904
|
-
var createSet = !(_Set && (1 / _setToArray(new _Set([,-0]))[1]) == INFINITY$2) ? noop_1 : function(values) {
|
|
72905
|
-
return new _Set(values);
|
|
72906
|
-
};
|
|
72907
|
-
|
|
72908
|
-
var _createSet = createSet;
|
|
72909
|
-
|
|
72910
|
-
/** Used as the size to enable large array optimizations. */
|
|
72911
|
-
var LARGE_ARRAY_SIZE$1 = 200;
|
|
72912
|
-
|
|
72913
|
-
/**
|
|
72914
|
-
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
|
|
72915
|
-
*
|
|
72916
|
-
* @private
|
|
72917
|
-
* @param {Array} array The array to inspect.
|
|
72918
|
-
* @param {Function} [iteratee] The iteratee invoked per element.
|
|
72919
|
-
* @param {Function} [comparator] The comparator invoked per element.
|
|
72920
|
-
* @returns {Array} Returns the new duplicate free array.
|
|
72921
|
-
*/
|
|
72922
|
-
function baseUniq(array, iteratee, comparator) {
|
|
72923
|
-
var index = -1,
|
|
72924
|
-
includes = _arrayIncludes,
|
|
72925
|
-
length = array.length,
|
|
72926
|
-
isCommon = true,
|
|
72927
|
-
result = [],
|
|
72928
|
-
seen = result;
|
|
72929
|
-
|
|
72930
|
-
if (comparator) {
|
|
72931
|
-
isCommon = false;
|
|
72932
|
-
includes = _arrayIncludesWith;
|
|
72933
|
-
}
|
|
72934
|
-
else if (length >= LARGE_ARRAY_SIZE$1) {
|
|
72935
|
-
var set = iteratee ? null : _createSet(array);
|
|
72936
|
-
if (set) {
|
|
72937
|
-
return _setToArray(set);
|
|
72938
|
-
}
|
|
72939
|
-
isCommon = false;
|
|
72940
|
-
includes = _cacheHas;
|
|
72941
|
-
seen = new _SetCache;
|
|
72942
|
-
}
|
|
72943
|
-
else {
|
|
72944
|
-
seen = iteratee ? [] : result;
|
|
72945
|
-
}
|
|
72946
|
-
outer:
|
|
72947
|
-
while (++index < length) {
|
|
72948
|
-
var value = array[index],
|
|
72949
|
-
computed = iteratee ? iteratee(value) : value;
|
|
72950
|
-
|
|
72951
|
-
value = (comparator || value !== 0) ? value : 0;
|
|
72952
|
-
if (isCommon && computed === computed) {
|
|
72953
|
-
var seenIndex = seen.length;
|
|
72954
|
-
while (seenIndex--) {
|
|
72955
|
-
if (seen[seenIndex] === computed) {
|
|
72956
|
-
continue outer;
|
|
72957
|
-
}
|
|
72958
|
-
}
|
|
72959
|
-
if (iteratee) {
|
|
72960
|
-
seen.push(computed);
|
|
72961
|
-
}
|
|
72962
|
-
result.push(value);
|
|
72963
|
-
}
|
|
72964
|
-
else if (!includes(seen, computed, comparator)) {
|
|
72965
|
-
if (seen !== result) {
|
|
72966
|
-
seen.push(computed);
|
|
72967
|
-
}
|
|
72968
|
-
result.push(value);
|
|
72969
|
-
}
|
|
72970
|
-
}
|
|
72971
|
-
return result;
|
|
72972
|
-
}
|
|
72973
|
-
|
|
72974
|
-
var _baseUniq = baseUniq;
|
|
72975
|
-
|
|
72976
73184
|
/**
|
|
72977
73185
|
* This method is like `_.uniq` except that it accepts `iteratee` which is
|
|
72978
73186
|
* invoked for each element in `array` to generate the criterion by which
|