@ikas/storefront 0.0.93 → 0.0.95
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 +7 -1
- package/build/analytics/analytics.d.ts +1 -0
- package/build/analytics/facebookPixel.d.ts +1 -0
- package/build/api/cart/__generated__/getCart.d.ts +4 -0
- package/build/api/cart/__generated__/saveItemToCart.d.ts +4 -0
- package/build/api/checkout/__generated__/checkStocks.d.ts +3 -3
- package/build/api/checkout/index.d.ts +1 -1
- package/build/api/country/__generated__/getAvailableShippingCountries.d.ts +3 -0
- package/build/api/country/index.d.ts +1 -1
- package/build/api/index.d.ts +0 -2
- package/build/components/checkout/index.d.ts +3 -0
- package/build/components/checkout/model.d.ts +4 -3
- package/build/index.es.js +474 -438
- package/build/index.js +475 -441
- package/build/models/data/cart/index.d.ts +9 -0
- package/build/models/data/product/index.d.ts +2 -0
- package/build/models/data/product-tag/index.d.ts +5 -0
- package/build/models/data/storefront/{storefront-domain → domain}/index.d.ts +1 -0
- package/build/models/data/storefront/index.d.ts +19 -6
- package/build/models/data/storefront/localization/index.d.ts +7 -0
- package/build/models/data/storefront/routing/index.d.ts +9 -0
- package/build/models/data/storefront/theme/index.d.ts +13 -0
- package/build/models/data/storefront/theme-localization/index.d.ts +11 -0
- package/build/models/ui/product-list/index.d.ts +1 -1
- package/build/pages/checkout/[id].d.ts +3 -0
- package/build/storefront/index.d.ts +5 -0
- package/build/utils/settings.d.ts +80 -0
- package/package.json +1 -1
- package/build/api/product-stock-location/__generated__/listProductStockLocation.d.ts +0 -13
- package/build/api/product-stock-location/index.d.ts +0 -4
- package/build/api/storefront/__generated__/getStorefront.d.ts +0 -23
- package/build/api/storefront/index.d.ts +0 -4
- package/build/api/theme/index.d.ts +0 -4
- package/build/models/data/storefront/stockfront-location/index.d.ts +0 -5
- package/build/models/data/storefront/stockfront-route/index.d.ts +0 -5
- package/build/models/data/storefront/storefront-region/index.d.ts +0 -18
package/build/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { makeAutoObservable, toJS, runInAction, reaction, makeObservable, computed, observable, action, configure } from 'mobx';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import getConfig from 'next/config';
|
|
4
2
|
import React, { createElement, Fragment, useState, useEffect, useCallback, useRef, useMemo } from 'react';
|
|
3
|
+
import getConfig from 'next/config';
|
|
5
4
|
import { observer } from 'mobx-react-lite';
|
|
6
5
|
import { useRouter } from 'next/router';
|
|
7
6
|
import Image$1 from 'next/image';
|
|
8
7
|
import Link from 'next/link';
|
|
9
8
|
import Head from 'next/head';
|
|
9
|
+
import fs from 'fs';
|
|
10
10
|
import dynamic from 'next/dynamic';
|
|
11
11
|
|
|
12
12
|
/*! *****************************************************************************
|
|
@@ -11003,6 +11003,7 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
11003
11003
|
return [2 /*return*/, null];
|
|
11004
11004
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
11005
11005
|
productIdList: [this.productDetailPropValue.productId],
|
|
11006
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
11006
11007
|
})];
|
|
11007
11008
|
case 1:
|
|
11008
11009
|
productSearchResponse = _b.sent();
|
|
@@ -12032,6 +12033,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12032
12033
|
return [2 /*return*/];
|
|
12033
12034
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
12034
12035
|
productIdList: [metaDataResponse.metaData.targetId],
|
|
12036
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
12035
12037
|
})];
|
|
12036
12038
|
case 2:
|
|
12037
12039
|
productsResponse = _b.sent();
|
|
@@ -12790,6 +12792,10 @@ var IkasCart = /** @class */ (function () {
|
|
|
12790
12792
|
: [];
|
|
12791
12793
|
this.merchantId = data.merchantId || "";
|
|
12792
12794
|
this.totalPrice = data.totalPrice || 0;
|
|
12795
|
+
this.salesChannelId = data.salesChannelId || "";
|
|
12796
|
+
this.storefrontId = data.storefrontId || null;
|
|
12797
|
+
this.storefrontRoutingId = data.storefrontRoutingId || null;
|
|
12798
|
+
this.storefrontThemeId = data.storefrontThemeId || null;
|
|
12793
12799
|
makeAutoObservable(this);
|
|
12794
12800
|
}
|
|
12795
12801
|
Object.defineProperty(IkasCart.prototype, "totalTax", {
|
|
@@ -13194,6 +13200,17 @@ var FacebookPixel = /** @class */ (function () {
|
|
|
13194
13200
|
console.error(err);
|
|
13195
13201
|
}
|
|
13196
13202
|
};
|
|
13203
|
+
FacebookPixel.contactForm = function () {
|
|
13204
|
+
try {
|
|
13205
|
+
!isServer &&
|
|
13206
|
+
window.fbq &&
|
|
13207
|
+
window.fbq("track", "ContactForm", {});
|
|
13208
|
+
return;
|
|
13209
|
+
}
|
|
13210
|
+
catch (err) {
|
|
13211
|
+
console.error(err);
|
|
13212
|
+
}
|
|
13213
|
+
};
|
|
13197
13214
|
return FacebookPixel;
|
|
13198
13215
|
}());
|
|
13199
13216
|
function productToFBPItem(productDetail, quantity) {
|
|
@@ -15806,7 +15823,7 @@ var MAX_CVC_LENGTH = 4;
|
|
|
15806
15823
|
var USE_DIFFERENT_ADDRESS_KEY = "sAddr";
|
|
15807
15824
|
var isServer$1 = typeof localStorage === "undefined";
|
|
15808
15825
|
var CheckoutViewModel = /** @class */ (function () {
|
|
15809
|
-
function CheckoutViewModel(checkout, queryParams, router) {
|
|
15826
|
+
function CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
|
|
15810
15827
|
var _this = this;
|
|
15811
15828
|
this.checkout = new IkasCheckout();
|
|
15812
15829
|
this.storefront = null;
|
|
@@ -15912,7 +15929,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15912
15929
|
variantId: i.variant.id,
|
|
15913
15930
|
productId: i.variant.productId,
|
|
15914
15931
|
}); });
|
|
15915
|
-
return [4 /*yield*/, IkasCheckoutAPI.checkStocks(lines)];
|
|
15932
|
+
return [4 /*yield*/, IkasCheckoutAPI.checkStocks(lines, [])];
|
|
15916
15933
|
case 1:
|
|
15917
15934
|
result = _b.sent();
|
|
15918
15935
|
if (!result) {
|
|
@@ -15925,7 +15942,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15925
15942
|
data = unavailableItems.map(function (item) { return ({
|
|
15926
15943
|
variant: _this.cart.items.find(function (i) { return i.variant.id === item.variantId; })
|
|
15927
15944
|
.variant,
|
|
15928
|
-
availableQuantity: item.
|
|
15945
|
+
availableQuantity: item.stockCount,
|
|
15929
15946
|
}); });
|
|
15930
15947
|
throw {
|
|
15931
15948
|
type: ErrorType.STOCK_ERROR,
|
|
@@ -15942,7 +15959,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15942
15959
|
switch (_b.label) {
|
|
15943
15960
|
case 0:
|
|
15944
15961
|
_a = this;
|
|
15945
|
-
return [4 /*yield*/, IkasCountryAPI.listShippingCountries()];
|
|
15962
|
+
return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.storefrontId)];
|
|
15946
15963
|
case 1:
|
|
15947
15964
|
_a.shippingCountryIds = _b.sent();
|
|
15948
15965
|
return [2 /*return*/];
|
|
@@ -16018,30 +16035,6 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16018
16035
|
}
|
|
16019
16036
|
});
|
|
16020
16037
|
}); };
|
|
16021
|
-
this.getStorefront = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16022
|
-
var storefront;
|
|
16023
|
-
return __generator(this, function (_a) {
|
|
16024
|
-
switch (_a.label) {
|
|
16025
|
-
case 0:
|
|
16026
|
-
if (!IkasStorefrontConfig.config.storefrontId || !!this.storefront)
|
|
16027
|
-
return [2 /*return*/];
|
|
16028
|
-
_a.label = 1;
|
|
16029
|
-
case 1:
|
|
16030
|
-
_a.trys.push([1, 3, , 4]);
|
|
16031
|
-
return [4 /*yield*/, IkasStorefrontAPI.getStorefront(IkasStorefrontConfig.config.storefrontId)];
|
|
16032
|
-
case 2:
|
|
16033
|
-
storefront = _a.sent();
|
|
16034
|
-
if (storefront) {
|
|
16035
|
-
this.storefront = storefront;
|
|
16036
|
-
}
|
|
16037
|
-
return [3 /*break*/, 4];
|
|
16038
|
-
case 3:
|
|
16039
|
-
_a.sent();
|
|
16040
|
-
return [3 /*break*/, 4];
|
|
16041
|
-
case 4: return [2 /*return*/];
|
|
16042
|
-
}
|
|
16043
|
-
});
|
|
16044
|
-
}); };
|
|
16045
16038
|
this.createCustomer = function () {
|
|
16046
16039
|
if (_this.customerStore.customer) {
|
|
16047
16040
|
_this.checkout.customer = _this.customerStore.customer;
|
|
@@ -16173,7 +16166,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16173
16166
|
_this.router.push("/");
|
|
16174
16167
|
};
|
|
16175
16168
|
this.onProceedToShippingClick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16176
|
-
var newAddress, customer,
|
|
16169
|
+
var newAddress, customer, err_2;
|
|
16177
16170
|
return __generator(this, function (_a) {
|
|
16178
16171
|
switch (_a.label) {
|
|
16179
16172
|
case 0:
|
|
@@ -16203,12 +16196,12 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16203
16196
|
this.changeStep(CheckoutStep.SHIPPING);
|
|
16204
16197
|
return [3 /*break*/, 7];
|
|
16205
16198
|
case 6:
|
|
16206
|
-
|
|
16207
|
-
if (
|
|
16208
|
-
this.error =
|
|
16199
|
+
err_2 = _a.sent();
|
|
16200
|
+
if (err_2.type) {
|
|
16201
|
+
this.error = err_2;
|
|
16209
16202
|
}
|
|
16210
16203
|
else {
|
|
16211
|
-
console.log(
|
|
16204
|
+
console.log(err_2);
|
|
16212
16205
|
this.error = {
|
|
16213
16206
|
type: ErrorType.UNKNOWN,
|
|
16214
16207
|
};
|
|
@@ -16220,7 +16213,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16220
16213
|
});
|
|
16221
16214
|
}); };
|
|
16222
16215
|
this.onProceedToPaymentClick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16223
|
-
var
|
|
16216
|
+
var err_3;
|
|
16224
16217
|
return __generator(this, function (_a) {
|
|
16225
16218
|
switch (_a.label) {
|
|
16226
16219
|
case 0:
|
|
@@ -16240,12 +16233,12 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16240
16233
|
this.changeStep(CheckoutStep.PAYMENT);
|
|
16241
16234
|
return [3 /*break*/, 4];
|
|
16242
16235
|
case 3:
|
|
16243
|
-
|
|
16244
|
-
if (
|
|
16245
|
-
this.error =
|
|
16236
|
+
err_3 = _a.sent();
|
|
16237
|
+
if (err_3.type) {
|
|
16238
|
+
this.error = err_3;
|
|
16246
16239
|
}
|
|
16247
16240
|
else {
|
|
16248
|
-
console.log(
|
|
16241
|
+
console.log(err_3);
|
|
16249
16242
|
this.error = {
|
|
16250
16243
|
type: ErrorType.UNKNOWN,
|
|
16251
16244
|
};
|
|
@@ -16257,7 +16250,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16257
16250
|
});
|
|
16258
16251
|
}); };
|
|
16259
16252
|
this.performPayment = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16260
|
-
var response, transactionStatus,
|
|
16253
|
+
var response, transactionStatus, err_4;
|
|
16261
16254
|
return __generator(this, function (_a) {
|
|
16262
16255
|
switch (_a.label) {
|
|
16263
16256
|
case 0:
|
|
@@ -16303,10 +16296,10 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16303
16296
|
}
|
|
16304
16297
|
return [3 /*break*/, 6];
|
|
16305
16298
|
case 5:
|
|
16306
|
-
|
|
16307
|
-
if (
|
|
16308
|
-
console.log(
|
|
16309
|
-
this.error =
|
|
16299
|
+
err_4 = _a.sent();
|
|
16300
|
+
if (err_4.type) {
|
|
16301
|
+
console.log(err_4);
|
|
16302
|
+
this.error = err_4;
|
|
16310
16303
|
}
|
|
16311
16304
|
else {
|
|
16312
16305
|
this.error = {
|
|
@@ -16385,6 +16378,9 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16385
16378
|
}); };
|
|
16386
16379
|
this.checkout = checkout;
|
|
16387
16380
|
this.router = router;
|
|
16381
|
+
this.returnPolicy = returnPolicy;
|
|
16382
|
+
this.privacyPolicy = privacyPolicy;
|
|
16383
|
+
this.termsOfService = termsOfService;
|
|
16388
16384
|
this.init(queryParams);
|
|
16389
16385
|
makeAutoObservable(this);
|
|
16390
16386
|
}
|
|
@@ -16395,15 +16391,6 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16395
16391
|
enumerable: false,
|
|
16396
16392
|
configurable: true
|
|
16397
16393
|
});
|
|
16398
|
-
Object.defineProperty(CheckoutViewModel.prototype, "storefrontRegion", {
|
|
16399
|
-
get: function () {
|
|
16400
|
-
var _a;
|
|
16401
|
-
return ((_a = this.storefront) === null || _a === void 0 ? void 0 : _a.regions.length) ? this.storefront.regions[0]
|
|
16402
|
-
: undefined;
|
|
16403
|
-
},
|
|
16404
|
-
enumerable: false,
|
|
16405
|
-
configurable: true
|
|
16406
|
-
});
|
|
16407
16394
|
Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGatewayIndex", {
|
|
16408
16395
|
get: function () {
|
|
16409
16396
|
var _this = this;
|
|
@@ -16856,6 +16843,14 @@ var Analytics = /** @class */ (function () {
|
|
|
16856
16843
|
console.error(err);
|
|
16857
16844
|
}
|
|
16858
16845
|
};
|
|
16846
|
+
Analytics.contactForm = function () {
|
|
16847
|
+
try {
|
|
16848
|
+
FacebookPixel.contactForm();
|
|
16849
|
+
}
|
|
16850
|
+
catch (err) {
|
|
16851
|
+
console.error(err);
|
|
16852
|
+
}
|
|
16853
|
+
};
|
|
16859
16854
|
return Analytics;
|
|
16860
16855
|
}());
|
|
16861
16856
|
|
|
@@ -16941,7 +16936,9 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
16941
16936
|
this.saveContactForm = function (input) { return __awaiter(_this, void 0, void 0, function () {
|
|
16942
16937
|
return __generator(this, function (_a) {
|
|
16943
16938
|
switch (_a.label) {
|
|
16944
|
-
case 0:
|
|
16939
|
+
case 0:
|
|
16940
|
+
Analytics.contactForm();
|
|
16941
|
+
return [4 /*yield*/, IkasContactFormAPI.sendContactFormToMerchant(input)];
|
|
16945
16942
|
case 1: return [2 /*return*/, _a.sent()];
|
|
16946
16943
|
}
|
|
16947
16944
|
});
|
|
@@ -17057,6 +17054,7 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
17057
17054
|
return [2 /*return*/, []];
|
|
17058
17055
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
17059
17056
|
productIdList: favoriteProductsResult.map(function (fP) { return fP.productId; }),
|
|
17057
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
17060
17058
|
})];
|
|
17061
17059
|
case 2:
|
|
17062
17060
|
productsResult = _b.sent();
|
|
@@ -17606,6 +17604,15 @@ var IkasProductVariantType = /** @class */ (function () {
|
|
|
17606
17604
|
return IkasProductVariantType;
|
|
17607
17605
|
}());
|
|
17608
17606
|
|
|
17607
|
+
var IkasProductTag = /** @class */ (function () {
|
|
17608
|
+
function IkasProductTag(data) {
|
|
17609
|
+
this.id = data.id || "";
|
|
17610
|
+
this.name = data.name || "";
|
|
17611
|
+
makeAutoObservable(this);
|
|
17612
|
+
}
|
|
17613
|
+
return IkasProductTag;
|
|
17614
|
+
}());
|
|
17615
|
+
|
|
17609
17616
|
var IkasProduct = /** @class */ (function () {
|
|
17610
17617
|
function IkasProduct(data) {
|
|
17611
17618
|
if (data === void 0) { data = {}; }
|
|
@@ -17621,6 +17628,9 @@ var IkasProduct = /** @class */ (function () {
|
|
|
17621
17628
|
this.categories = data.categories
|
|
17622
17629
|
? data.categories.map(function (c) { return new IkasCategory(c); })
|
|
17623
17630
|
: [];
|
|
17631
|
+
this.tags = data.tags
|
|
17632
|
+
? data.tags.map(function (tag) { return new IkasProductTag(tag); })
|
|
17633
|
+
: [];
|
|
17624
17634
|
this.variants = data.variants
|
|
17625
17635
|
? data.variants.map(function (v) { return new IkasProductVariant(v); })
|
|
17626
17636
|
: [];
|
|
@@ -21902,7 +21912,10 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21902
21912
|
Object.defineProperty(IkasProductList.prototype, "isFiltered", {
|
|
21903
21913
|
get: function () {
|
|
21904
21914
|
var _a;
|
|
21905
|
-
return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) ||
|
|
21915
|
+
return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) ||
|
|
21916
|
+
!!this._searchKeyword ||
|
|
21917
|
+
(this._pageType !== IkasThemePageType.CATEGORY &&
|
|
21918
|
+
!!this._filterCategoryId));
|
|
21906
21919
|
},
|
|
21907
21920
|
enumerable: false,
|
|
21908
21921
|
configurable: true
|
|
@@ -21965,13 +21978,20 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21965
21978
|
});
|
|
21966
21979
|
Object.defineProperty(IkasProductList.prototype, "filterQueryParams", {
|
|
21967
21980
|
get: function () {
|
|
21968
|
-
var
|
|
21981
|
+
var _this = this;
|
|
21982
|
+
var _a, _b, _c;
|
|
21969
21983
|
var queryParams = {};
|
|
21970
21984
|
(_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (f) {
|
|
21971
21985
|
queryParams[f.key] = f.keyList;
|
|
21972
21986
|
});
|
|
21973
21987
|
if (this._searchKeyword)
|
|
21974
21988
|
queryParams.s = this._searchKeyword;
|
|
21989
|
+
if (this._pageType !== IkasThemePageType.CATEGORY &&
|
|
21990
|
+
this._filterCategoryId) {
|
|
21991
|
+
var slug = (_c = (_b = this.filterCategories) === null || _b === void 0 ? void 0 : _b.find(function (fc) { return fc.id === _this._filterCategoryId; })) === null || _c === void 0 ? void 0 : _c.slug;
|
|
21992
|
+
if (slug)
|
|
21993
|
+
queryParams.c = slug;
|
|
21994
|
+
}
|
|
21975
21995
|
return queryString.stringify(queryParams, { arrayFormat: "comma" });
|
|
21976
21996
|
},
|
|
21977
21997
|
enumerable: false,
|
|
@@ -22026,6 +22046,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22026
22046
|
categoryIdList: this._filterCategoryId
|
|
22027
22047
|
? [this._filterCategoryId]
|
|
22028
22048
|
: undefined,
|
|
22049
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
22029
22050
|
query: this._searchKeyword,
|
|
22030
22051
|
})];
|
|
22031
22052
|
case 1: return [2 /*return*/, _c.sent()];
|
|
@@ -22053,6 +22074,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22053
22074
|
};
|
|
22054
22075
|
IkasProductList.prototype.applyQueryParamFilters = function (queryParams) {
|
|
22055
22076
|
var _this = this;
|
|
22077
|
+
var _a;
|
|
22056
22078
|
try {
|
|
22057
22079
|
queryParams === null || queryParams === void 0 ? void 0 : queryParams.forEach(function (value, key) {
|
|
22058
22080
|
var _a;
|
|
@@ -22064,6 +22086,15 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22064
22086
|
var querySearch = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get("s");
|
|
22065
22087
|
if (querySearch)
|
|
22066
22088
|
this._searchKeyword = querySearch;
|
|
22089
|
+
if (this._pageType !== IkasThemePageType.CATEGORY) {
|
|
22090
|
+
var queryCategory_1 = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get("c");
|
|
22091
|
+
if (queryCategory_1) {
|
|
22092
|
+
var filterCategory = (_a = this.filterCategories) === null || _a === void 0 ? void 0 : _a.find(function (fc) { return fc.slug === queryCategory_1; });
|
|
22093
|
+
if (filterCategory) {
|
|
22094
|
+
this._filterCategoryId = filterCategory.id;
|
|
22095
|
+
}
|
|
22096
|
+
}
|
|
22097
|
+
}
|
|
22067
22098
|
}
|
|
22068
22099
|
catch (err) {
|
|
22069
22100
|
console.log(err);
|
|
@@ -22110,12 +22141,32 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22110
22141
|
var _a;
|
|
22111
22142
|
(_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (filter) { return filter.clear(); });
|
|
22112
22143
|
this._searchKeyword = "";
|
|
22144
|
+
if (this._pageType !== IkasThemePageType.CATEGORY) {
|
|
22145
|
+
this._filterCategoryId = undefined;
|
|
22146
|
+
}
|
|
22113
22147
|
this.applyFilters();
|
|
22114
22148
|
};
|
|
22115
|
-
IkasProductList.prototype.onFilterCategoryClick = function (filterCategory) {
|
|
22149
|
+
IkasProductList.prototype.onFilterCategoryClick = function (filterCategory, disableRoute) {
|
|
22116
22150
|
var _a;
|
|
22117
|
-
(
|
|
22118
|
-
|
|
22151
|
+
if (disableRoute === void 0) { disableRoute = false; }
|
|
22152
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22153
|
+
return __generator(this, function (_b) {
|
|
22154
|
+
switch (_b.label) {
|
|
22155
|
+
case 0:
|
|
22156
|
+
if (!disableRoute) return [3 /*break*/, 2];
|
|
22157
|
+
this._filterCategoryId = filterCategory.id;
|
|
22158
|
+
return [4 /*yield*/, this.applyFilters()];
|
|
22159
|
+
case 1:
|
|
22160
|
+
_b.sent();
|
|
22161
|
+
return [3 /*break*/, 3];
|
|
22162
|
+
case 2:
|
|
22163
|
+
(_a = this.router) === null || _a === void 0 ? void 0 : _a.push(filterCategory.href +
|
|
22164
|
+
(this.filterQueryParams ? "?" + this.filterQueryParams : ""));
|
|
22165
|
+
_b.label = 3;
|
|
22166
|
+
case 3: return [2 /*return*/];
|
|
22167
|
+
}
|
|
22168
|
+
});
|
|
22169
|
+
});
|
|
22119
22170
|
};
|
|
22120
22171
|
IkasProductList.prototype.toJSON = function () {
|
|
22121
22172
|
return {
|
|
@@ -24203,7 +24254,7 @@ var IkasCartAPI = /** @class */ (function () {
|
|
|
24203
24254
|
return __generator(this, function (_b) {
|
|
24204
24255
|
switch (_b.label) {
|
|
24205
24256
|
case 0:
|
|
24206
|
-
MUTATION = src(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "], ["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "])));
|
|
24257
|
+
MUTATION = src(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "], ["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "])));
|
|
24207
24258
|
_b.label = 1;
|
|
24208
24259
|
case 1:
|
|
24209
24260
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24238,7 +24289,7 @@ var IkasCartAPI = /** @class */ (function () {
|
|
|
24238
24289
|
return __generator(this, function (_b) {
|
|
24239
24290
|
switch (_b.label) {
|
|
24240
24291
|
case 0:
|
|
24241
|
-
QUERY = src(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "], ["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "])));
|
|
24292
|
+
QUERY = src(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "], ["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "])));
|
|
24242
24293
|
_b.label = 1;
|
|
24243
24294
|
case 1:
|
|
24244
24295
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24710,13 +24761,13 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24710
24761
|
});
|
|
24711
24762
|
});
|
|
24712
24763
|
};
|
|
24713
|
-
IkasCheckoutAPI.checkStocks = function (lines) {
|
|
24764
|
+
IkasCheckoutAPI.checkStocks = function (lines, stockLocationIdList) {
|
|
24714
24765
|
return __awaiter(this, void 0, void 0, function () {
|
|
24715
24766
|
var QUERY, _a, data, errors, err_7;
|
|
24716
24767
|
return __generator(this, function (_b) {
|
|
24717
24768
|
switch (_b.label) {
|
|
24718
24769
|
case 0:
|
|
24719
|
-
QUERY = src(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n query checkStocks($lines: [CheckStocksLineInput!]!) {\n checkStocks(lines: $lines) {\n lines {\n
|
|
24770
|
+
QUERY = src(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "], ["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "])));
|
|
24720
24771
|
_b.label = 1;
|
|
24721
24772
|
case 1:
|
|
24722
24773
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24726,6 +24777,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24726
24777
|
query: QUERY,
|
|
24727
24778
|
variables: {
|
|
24728
24779
|
lines: lines,
|
|
24780
|
+
stockLocationIdList: stockLocationIdList,
|
|
24729
24781
|
},
|
|
24730
24782
|
})];
|
|
24731
24783
|
case 2:
|
|
@@ -24837,13 +24889,13 @@ var IkasCountryAPI = /** @class */ (function () {
|
|
|
24837
24889
|
});
|
|
24838
24890
|
});
|
|
24839
24891
|
};
|
|
24840
|
-
IkasCountryAPI.listShippingCountries = function () {
|
|
24892
|
+
IkasCountryAPI.listShippingCountries = function (storefrontId) {
|
|
24841
24893
|
return __awaiter(this, void 0, void 0, function () {
|
|
24842
24894
|
var QUERY, _a, data, errors, err_2;
|
|
24843
24895
|
return __generator(this, function (_b) {
|
|
24844
24896
|
switch (_b.label) {
|
|
24845
24897
|
case 0:
|
|
24846
|
-
QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries {\n getAvailableShippingCountries\n }\n "], ["\n query getAvailableShippingCountries {\n getAvailableShippingCountries\n }\n "])));
|
|
24898
|
+
QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "], ["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "])));
|
|
24847
24899
|
_b.label = 1;
|
|
24848
24900
|
case 1:
|
|
24849
24901
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24851,6 +24903,9 @@ var IkasCountryAPI = /** @class */ (function () {
|
|
|
24851
24903
|
.getClient()
|
|
24852
24904
|
.query({
|
|
24853
24905
|
query: QUERY,
|
|
24906
|
+
variables: {
|
|
24907
|
+
storefrontId: storefrontId,
|
|
24908
|
+
},
|
|
24854
24909
|
})];
|
|
24855
24910
|
case 2:
|
|
24856
24911
|
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
@@ -25507,7 +25562,7 @@ var IkasProductSearchAPI = /** @class */ (function () {
|
|
|
25507
25562
|
return IkasProductSearchAPI;
|
|
25508
25563
|
}());
|
|
25509
25564
|
function simpleToProduct(simple) {
|
|
25510
|
-
var _a, _b, _c, _d, _e;
|
|
25565
|
+
var _a, _b, _c, _d, _e, _f;
|
|
25511
25566
|
return new IkasProduct({
|
|
25512
25567
|
id: simple.id,
|
|
25513
25568
|
attributes: (_a = simple.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
|
|
@@ -25541,6 +25596,12 @@ function simpleToProduct(simple) {
|
|
|
25541
25596
|
}),
|
|
25542
25597
|
});
|
|
25543
25598
|
}),
|
|
25599
|
+
tags: (_f = simple.tags) === null || _f === void 0 ? void 0 : _f.map(function (tag) {
|
|
25600
|
+
return new IkasProductTag({
|
|
25601
|
+
id: tag.id,
|
|
25602
|
+
name: tag.name,
|
|
25603
|
+
});
|
|
25604
|
+
}),
|
|
25544
25605
|
description: simple.description || undefined,
|
|
25545
25606
|
metaData: new IkasHTMLMetaData(simple.metaData || undefined),
|
|
25546
25607
|
name: simple.name,
|
|
@@ -25838,150 +25899,6 @@ var IkasStateAPI = /** @class */ (function () {
|
|
|
25838
25899
|
}());
|
|
25839
25900
|
var templateObject_1$e;
|
|
25840
25901
|
|
|
25841
|
-
var IkasStorefrontDomain = /** @class */ (function () {
|
|
25842
|
-
function IkasStorefrontDomain(data) {
|
|
25843
|
-
if (data === void 0) { data = {}; }
|
|
25844
|
-
this.id = data.id || "";
|
|
25845
|
-
this.merchantDomainId = data.merchantDomainId || "";
|
|
25846
|
-
this.name = data.name || "";
|
|
25847
|
-
this.redirectDomainName = data.redirectDomainName || null;
|
|
25848
|
-
makeAutoObservable(this);
|
|
25849
|
-
}
|
|
25850
|
-
return IkasStorefrontDomain;
|
|
25851
|
-
}());
|
|
25852
|
-
|
|
25853
|
-
var IkasStorefrontLocation = /** @class */ (function () {
|
|
25854
|
-
function IkasStorefrontLocation(data) {
|
|
25855
|
-
if (data === void 0) { data = {}; }
|
|
25856
|
-
this.countryId = data.countryId || "";
|
|
25857
|
-
this.stateId = data.stateId || null;
|
|
25858
|
-
makeAutoObservable(this);
|
|
25859
|
-
}
|
|
25860
|
-
return IkasStorefrontLocation;
|
|
25861
|
-
}());
|
|
25862
|
-
|
|
25863
|
-
var IkasStorefrontRoute = /** @class */ (function () {
|
|
25864
|
-
function IkasStorefrontRoute(data) {
|
|
25865
|
-
if (data === void 0) { data = {}; }
|
|
25866
|
-
this.domainId = data.domainId || "";
|
|
25867
|
-
this.useSubPath = data.useSubPath || false;
|
|
25868
|
-
makeAutoObservable(this);
|
|
25869
|
-
}
|
|
25870
|
-
return IkasStorefrontRoute;
|
|
25871
|
-
}());
|
|
25872
|
-
|
|
25873
|
-
var IkasStorefrontRegion = /** @class */ (function () {
|
|
25874
|
-
function IkasStorefrontRegion(data) {
|
|
25875
|
-
if (data === void 0) { data = {}; }
|
|
25876
|
-
// Extra
|
|
25877
|
-
this.theme = new IkasTheme();
|
|
25878
|
-
this.id = data.id || "";
|
|
25879
|
-
this.locale = data.locale || "";
|
|
25880
|
-
this.themeJSON = data.themeJSON || "";
|
|
25881
|
-
this.shipping = data.shipping || null;
|
|
25882
|
-
this.paymentSettingsId = data.paymentSettingsId || null;
|
|
25883
|
-
this.priceListId = data.priceListId || null;
|
|
25884
|
-
this.locations = data.locations
|
|
25885
|
-
? data.locations.map(function (o) { return new IkasStorefrontLocation(o); })
|
|
25886
|
-
: [];
|
|
25887
|
-
this.routes = data.routes
|
|
25888
|
-
? data.routes.map(function (o) { return new IkasStorefrontRoute(o); })
|
|
25889
|
-
: null;
|
|
25890
|
-
this.termsOfService = data.termsOfService || "";
|
|
25891
|
-
this.privacyPolicy = data.privacyPolicy || "";
|
|
25892
|
-
this.returnPolicy = data.returnPolicy || "";
|
|
25893
|
-
try {
|
|
25894
|
-
this.theme = this.themeJSON
|
|
25895
|
-
? new IkasTheme(JSON.parse(this.themeJSON))
|
|
25896
|
-
: new IkasTheme();
|
|
25897
|
-
}
|
|
25898
|
-
catch (err) { }
|
|
25899
|
-
makeAutoObservable(this);
|
|
25900
|
-
}
|
|
25901
|
-
return IkasStorefrontRegion;
|
|
25902
|
-
}());
|
|
25903
|
-
|
|
25904
|
-
var IkasStorefront = /** @class */ (function () {
|
|
25905
|
-
function IkasStorefront(data) {
|
|
25906
|
-
if (data === void 0) { data = {}; }
|
|
25907
|
-
this.id = data.id || "";
|
|
25908
|
-
this.name = data.name || "";
|
|
25909
|
-
this.themeId = data.themeId || "";
|
|
25910
|
-
this.themeVersionId = data.themeVersionId || "";
|
|
25911
|
-
this.userId = data.userId || "";
|
|
25912
|
-
this.domains = data.domains
|
|
25913
|
-
? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
|
|
25914
|
-
: [];
|
|
25915
|
-
this.regions = data.regions
|
|
25916
|
-
? data.regions.map(function (o) { return new IkasStorefrontRegion(o); })
|
|
25917
|
-
: [];
|
|
25918
|
-
makeAutoObservable(this);
|
|
25919
|
-
}
|
|
25920
|
-
return IkasStorefront;
|
|
25921
|
-
}());
|
|
25922
|
-
|
|
25923
|
-
var IkasStorefrontAPI = /** @class */ (function () {
|
|
25924
|
-
function IkasStorefrontAPI() {
|
|
25925
|
-
}
|
|
25926
|
-
IkasStorefrontAPI.getStorefront = function (storefrontId) {
|
|
25927
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25928
|
-
var QUERY, _a, data, errors;
|
|
25929
|
-
return __generator(this, function (_b) {
|
|
25930
|
-
switch (_b.label) {
|
|
25931
|
-
case 0:
|
|
25932
|
-
QUERY = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n query getStorefront($storefrontId: String!) {\n getStorefront(id: $storefrontId) {\n id\n name\n themeId\n themeVersionId\n userId\n # domains {\n # id\n # merchantDomainId\n # name\n # redirectDomainName\n # }\n regions {\n id\n locale\n # themeJSON\n privacyPolicy\n returnPolicy\n termsOfService\n }\n }\n }\n "], ["\n query getStorefront($storefrontId: String!) {\n getStorefront(id: $storefrontId) {\n id\n name\n themeId\n themeVersionId\n userId\n # domains {\n # id\n # merchantDomainId\n # name\n # redirectDomainName\n # }\n regions {\n id\n locale\n # themeJSON\n privacyPolicy\n returnPolicy\n termsOfService\n }\n }\n }\n "])));
|
|
25933
|
-
_b.label = 1;
|
|
25934
|
-
case 1:
|
|
25935
|
-
_b.trys.push([1, 3, , 4]);
|
|
25936
|
-
return [4 /*yield*/, apollo
|
|
25937
|
-
.getClient()
|
|
25938
|
-
.query({
|
|
25939
|
-
query: QUERY,
|
|
25940
|
-
variables: {
|
|
25941
|
-
storefrontId: storefrontId,
|
|
25942
|
-
},
|
|
25943
|
-
})];
|
|
25944
|
-
case 2:
|
|
25945
|
-
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
25946
|
-
if (errors && errors.length) {
|
|
25947
|
-
console.log(errors);
|
|
25948
|
-
}
|
|
25949
|
-
if (data)
|
|
25950
|
-
return [2 /*return*/, new IkasStorefront(data.getStorefront)];
|
|
25951
|
-
return [3 /*break*/, 4];
|
|
25952
|
-
case 3:
|
|
25953
|
-
_b.sent();
|
|
25954
|
-
return [3 /*break*/, 4];
|
|
25955
|
-
case 4: return [2 /*return*/, new IkasStorefront()];
|
|
25956
|
-
}
|
|
25957
|
-
});
|
|
25958
|
-
});
|
|
25959
|
-
};
|
|
25960
|
-
return IkasStorefrontAPI;
|
|
25961
|
-
}());
|
|
25962
|
-
var templateObject_1$f;
|
|
25963
|
-
|
|
25964
|
-
var IkasThemeAPI = /** @class */ (function () {
|
|
25965
|
-
function IkasThemeAPI() {
|
|
25966
|
-
}
|
|
25967
|
-
IkasThemeAPI.fetchTheme = function () {
|
|
25968
|
-
return new Promise(function (resolve, reject) {
|
|
25969
|
-
var serverRuntimeConfig = getConfig().serverRuntimeConfig;
|
|
25970
|
-
var themeJSONPath = serverRuntimeConfig.THEME_JSON_PATH || "./src/theme.json";
|
|
25971
|
-
fs.readFile(themeJSONPath, {
|
|
25972
|
-
flag: "a+",
|
|
25973
|
-
}, function (err, file) {
|
|
25974
|
-
if (err) {
|
|
25975
|
-
return reject(err);
|
|
25976
|
-
}
|
|
25977
|
-
var result = file.length ? JSON.parse(file.toString()) : {};
|
|
25978
|
-
resolve(new IkasTheme(result));
|
|
25979
|
-
});
|
|
25980
|
-
});
|
|
25981
|
-
};
|
|
25982
|
-
return IkasThemeAPI;
|
|
25983
|
-
}());
|
|
25984
|
-
|
|
25985
25902
|
var IkasVariantTypeAPI = /** @class */ (function () {
|
|
25986
25903
|
function IkasVariantTypeAPI() {
|
|
25987
25904
|
}
|
|
@@ -25991,7 +25908,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
|
|
|
25991
25908
|
return __generator(this, function (_b) {
|
|
25992
25909
|
switch (_b.label) {
|
|
25993
25910
|
case 0:
|
|
25994
|
-
LIST_VARIANT_TYPE = src(templateObject_1$
|
|
25911
|
+
LIST_VARIANT_TYPE = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n query listVariantType($id: StringFilterInput!) {\n listVariantType(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n selectionType\n values {\n id\n createdAt\n updatedAt\n deleted\n name\n thumbnailImageId\n colorCode\n }\n }\n }\n "], ["\n query listVariantType($id: StringFilterInput!) {\n listVariantType(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n selectionType\n values {\n id\n createdAt\n updatedAt\n deleted\n name\n thumbnailImageId\n colorCode\n }\n }\n }\n "])));
|
|
25995
25912
|
_b.label = 1;
|
|
25996
25913
|
case 1:
|
|
25997
25914
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -26037,7 +25954,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
|
|
|
26037
25954
|
};
|
|
26038
25955
|
return IkasVariantTypeAPI;
|
|
26039
25956
|
}());
|
|
26040
|
-
var templateObject_1$
|
|
25957
|
+
var templateObject_1$f;
|
|
26041
25958
|
|
|
26042
25959
|
function styleInject(css, ref) {
|
|
26043
25960
|
if ( ref === void 0 ) ref = {};
|
|
@@ -27227,6 +27144,11 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
27227
27144
|
name: product.name,
|
|
27228
27145
|
},
|
|
27229
27146
|
},
|
|
27147
|
+
priceListId: IkasStorefrontConfig.priceListId || null,
|
|
27148
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
27149
|
+
storefrontId: IkasStorefrontConfig.storefrontId,
|
|
27150
|
+
storefrontRoutingId: IkasStorefrontConfig.storefrontRoutingId,
|
|
27151
|
+
storefrontThemeId: IkasStorefrontConfig.storefrontThemeId,
|
|
27230
27152
|
};
|
|
27231
27153
|
return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
|
|
27232
27154
|
case 1:
|
|
@@ -27267,6 +27189,11 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
27267
27189
|
name: item.variant.name,
|
|
27268
27190
|
},
|
|
27269
27191
|
},
|
|
27192
|
+
priceListId: IkasStorefrontConfig.priceListId || null,
|
|
27193
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
27194
|
+
storefrontId: IkasStorefrontConfig.storefrontId,
|
|
27195
|
+
storefrontRoutingId: IkasStorefrontConfig.storefrontRoutingId,
|
|
27196
|
+
storefrontThemeId: IkasStorefrontConfig.storefrontThemeId,
|
|
27270
27197
|
};
|
|
27271
27198
|
return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
|
|
27272
27199
|
case 1:
|
|
@@ -27500,11 +27427,9 @@ var IkasPageHead = observer(function (_a) {
|
|
|
27500
27427
|
var categorySchema = createCategorySchema(pageSpecificDataStr);
|
|
27501
27428
|
if (categorySchema)
|
|
27502
27429
|
schemas.push(categorySchema);
|
|
27503
|
-
|
|
27504
|
-
|
|
27505
|
-
|
|
27506
|
-
// );
|
|
27507
|
-
// if (categoryBreadcrumbSchema) schemas.push(categoryBreadcrumbSchema);
|
|
27430
|
+
var categoryBreadcrumbSchema = createCategoryBreadcrumbSchema(pageSpecificDataStr);
|
|
27431
|
+
if (categoryBreadcrumbSchema)
|
|
27432
|
+
schemas.push(categoryBreadcrumbSchema);
|
|
27508
27433
|
}
|
|
27509
27434
|
return (createElement(Head, null,
|
|
27510
27435
|
createElement("title", null, pageTitle || ""),
|
|
@@ -27557,12 +27482,16 @@ function createProductSchema(productDetail) {
|
|
|
27557
27482
|
}
|
|
27558
27483
|
}
|
|
27559
27484
|
}
|
|
27485
|
+
var productUrl = isBrowser
|
|
27486
|
+
? "https://" + window.location.hostname + productDetail.href
|
|
27487
|
+
: "";
|
|
27560
27488
|
return {
|
|
27561
27489
|
"@context": "https://schema.org/",
|
|
27562
27490
|
"@type": "Product",
|
|
27563
27491
|
name: productDetail.product.name,
|
|
27564
27492
|
description: (_a = productDetail.product.metaData) === null || _a === void 0 ? void 0 : _a.description,
|
|
27565
27493
|
image: productDetail.selectedVariant.images.map(function (i) { return i.src; }),
|
|
27494
|
+
productId: productDetail.selectedVariant.id,
|
|
27566
27495
|
sku: productDetail.selectedVariant.sku,
|
|
27567
27496
|
mpn: productDetail.selectedVariant.barcodeList.length
|
|
27568
27497
|
? productDetail.selectedVariant.barcodeList[0]
|
|
@@ -27573,7 +27502,7 @@ function createProductSchema(productDetail) {
|
|
|
27573
27502
|
},
|
|
27574
27503
|
offers: {
|
|
27575
27504
|
"@type": "Offer",
|
|
27576
|
-
url:
|
|
27505
|
+
url: productUrl,
|
|
27577
27506
|
priceCurrency: productDetail.selectedVariant.price.currency || "TRY",
|
|
27578
27507
|
price: productDetail.selectedVariant.price.finalPrice,
|
|
27579
27508
|
priceValidUntil: "",
|
|
@@ -27591,10 +27520,13 @@ function createCategorySchema(pageSpecificDataStr) {
|
|
|
27591
27520
|
try {
|
|
27592
27521
|
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
27593
27522
|
var category = new IkasCategory(categoryParsed);
|
|
27523
|
+
var categoryUrl = typeof window !== undefined
|
|
27524
|
+
? "https://" + window.location.hostname + category.href
|
|
27525
|
+
: "";
|
|
27594
27526
|
return {
|
|
27595
27527
|
"@context": "http://schema.org",
|
|
27596
27528
|
"@type": "CollectionPage",
|
|
27597
|
-
url:
|
|
27529
|
+
url: categoryUrl,
|
|
27598
27530
|
name: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.pageTitle,
|
|
27599
27531
|
description: (_b = category.metaData) === null || _b === void 0 ? void 0 : _b.description,
|
|
27600
27532
|
image: (_c = category.image) === null || _c === void 0 ? void 0 : _c.src,
|
|
@@ -27602,32 +27534,33 @@ function createCategorySchema(pageSpecificDataStr) {
|
|
|
27602
27534
|
}
|
|
27603
27535
|
catch (_d) { }
|
|
27604
27536
|
}
|
|
27605
|
-
|
|
27606
|
-
|
|
27607
|
-
|
|
27608
|
-
|
|
27609
|
-
|
|
27610
|
-
|
|
27611
|
-
|
|
27612
|
-
|
|
27613
|
-
|
|
27614
|
-
|
|
27615
|
-
|
|
27616
|
-
|
|
27617
|
-
|
|
27618
|
-
|
|
27619
|
-
|
|
27620
|
-
|
|
27621
|
-
|
|
27622
|
-
|
|
27623
|
-
|
|
27624
|
-
// }
|
|
27537
|
+
function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
|
|
27538
|
+
try {
|
|
27539
|
+
var categoryParsed = JSON.parse(pageSpecificDataStr);
|
|
27540
|
+
var category = new IkasCategory(categoryParsed);
|
|
27541
|
+
return {
|
|
27542
|
+
"@context": "http://schema.org",
|
|
27543
|
+
"@type": "BreadcrumbList",
|
|
27544
|
+
itemListElement: category.path.map(function (categoryPath, index) { return ({
|
|
27545
|
+
"@type": "ListItem",
|
|
27546
|
+
position: index + 1,
|
|
27547
|
+
name: categoryPath.name,
|
|
27548
|
+
item: typeof window !== undefined
|
|
27549
|
+
? "https://" + window.location.hostname + categoryPath.href
|
|
27550
|
+
: "",
|
|
27551
|
+
}); }),
|
|
27552
|
+
};
|
|
27553
|
+
}
|
|
27554
|
+
catch (_a) { }
|
|
27555
|
+
}
|
|
27625
27556
|
|
|
27626
27557
|
var IkasCheckoutPage = observer(function (_a) {
|
|
27627
27558
|
var _b, _c, _d;
|
|
27628
|
-
var checkout = _a.checkout, queryParams = _a.queryParams;
|
|
27559
|
+
var checkout = _a.checkout, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
|
|
27629
27560
|
var router = useRouter();
|
|
27630
|
-
var vm = useState(function () {
|
|
27561
|
+
var vm = useState(function () {
|
|
27562
|
+
return new CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService);
|
|
27563
|
+
})[0];
|
|
27631
27564
|
useEffect(function () {
|
|
27632
27565
|
Analytics.beginCheckout(vm.checkout);
|
|
27633
27566
|
Analytics.checkoutStep(vm.checkout, vm.step);
|
|
@@ -27652,46 +27585,18 @@ var IkasCheckoutPage = observer(function (_a) {
|
|
|
27652
27585
|
var onPolicyModalClose = function () {
|
|
27653
27586
|
setPolicyModalText("");
|
|
27654
27587
|
};
|
|
27655
|
-
var onReturnPolicyClick = function () {
|
|
27656
|
-
|
|
27657
|
-
|
|
27658
|
-
|
|
27659
|
-
|
|
27660
|
-
|
|
27661
|
-
|
|
27662
|
-
|
|
27663
|
-
|
|
27664
|
-
|
|
27665
|
-
|
|
27666
|
-
|
|
27667
|
-
});
|
|
27668
|
-
}); };
|
|
27669
|
-
var onPrivacyPolicyClick = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
27670
|
-
var _a;
|
|
27671
|
-
return __generator(this, function (_b) {
|
|
27672
|
-
switch (_b.label) {
|
|
27673
|
-
case 0: return [4 /*yield*/, vm.getStorefront()];
|
|
27674
|
-
case 1:
|
|
27675
|
-
_b.sent();
|
|
27676
|
-
setPolicyModalTitle("Gizlilik Politikası");
|
|
27677
|
-
setPolicyModalText(((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.privacyPolicy) || "");
|
|
27678
|
-
return [2 /*return*/];
|
|
27679
|
-
}
|
|
27680
|
-
});
|
|
27681
|
-
}); };
|
|
27682
|
-
var onTermsOfServiceClick = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
27683
|
-
var _a;
|
|
27684
|
-
return __generator(this, function (_b) {
|
|
27685
|
-
switch (_b.label) {
|
|
27686
|
-
case 0: return [4 /*yield*/, vm.getStorefront()];
|
|
27687
|
-
case 1:
|
|
27688
|
-
_b.sent();
|
|
27689
|
-
setPolicyModalTitle("Hizmet Şartları");
|
|
27690
|
-
setPolicyModalText(((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.termsOfService) || "");
|
|
27691
|
-
return [2 /*return*/];
|
|
27692
|
-
}
|
|
27693
|
-
});
|
|
27694
|
-
}); };
|
|
27588
|
+
var onReturnPolicyClick = function () {
|
|
27589
|
+
setPolicyModalTitle("Para İade Politikası");
|
|
27590
|
+
setPolicyModalText(vm.returnPolicy);
|
|
27591
|
+
};
|
|
27592
|
+
var onPrivacyPolicyClick = function () {
|
|
27593
|
+
setPolicyModalTitle("Gizlilik Politikası");
|
|
27594
|
+
setPolicyModalText(vm.privacyPolicy);
|
|
27595
|
+
};
|
|
27596
|
+
var onTermsOfServiceClick = function () {
|
|
27597
|
+
setPolicyModalTitle("Hizmet Şartları");
|
|
27598
|
+
setPolicyModalText(vm.termsOfService);
|
|
27599
|
+
};
|
|
27695
27600
|
var onErrorClose = function () {
|
|
27696
27601
|
vm.error = undefined;
|
|
27697
27602
|
};
|
|
@@ -28311,6 +28216,206 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
28311
28216
|
Image: Image
|
|
28312
28217
|
});
|
|
28313
28218
|
|
|
28219
|
+
var IkasStorefrontLocalization = /** @class */ (function () {
|
|
28220
|
+
function IkasStorefrontLocalization(data) {
|
|
28221
|
+
this.id = data.id || "";
|
|
28222
|
+
this.isDefault = data.isDefault || false;
|
|
28223
|
+
this.locale = data.locale || "";
|
|
28224
|
+
this.name = data.name || "";
|
|
28225
|
+
}
|
|
28226
|
+
return IkasStorefrontLocalization;
|
|
28227
|
+
}());
|
|
28228
|
+
|
|
28229
|
+
var IkasStorefrontDomain = /** @class */ (function () {
|
|
28230
|
+
function IkasStorefrontDomain(data) {
|
|
28231
|
+
if (data === void 0) { data = {}; }
|
|
28232
|
+
this.id = data.id || "";
|
|
28233
|
+
this.merchantDomainId = data.merchantDomainId || "";
|
|
28234
|
+
this.name = data.name || "";
|
|
28235
|
+
this.redirectDomainName = data.redirectDomainName || null;
|
|
28236
|
+
this.isDefault = data.isDefault || false;
|
|
28237
|
+
makeAutoObservable(this);
|
|
28238
|
+
}
|
|
28239
|
+
return IkasStorefrontDomain;
|
|
28240
|
+
}());
|
|
28241
|
+
|
|
28242
|
+
var IkasStorefrontRouting = /** @class */ (function () {
|
|
28243
|
+
function IkasStorefrontRouting(data) {
|
|
28244
|
+
this.id = data.id || "";
|
|
28245
|
+
this.countryCodes = data.countryCodes || null;
|
|
28246
|
+
this.domain = data.domain || null;
|
|
28247
|
+
this.locale = data.locale || "";
|
|
28248
|
+
this.path = data.path || null;
|
|
28249
|
+
this.priceListId = data.priceListId || null;
|
|
28250
|
+
}
|
|
28251
|
+
return IkasStorefrontRouting;
|
|
28252
|
+
}());
|
|
28253
|
+
|
|
28254
|
+
var IkasStorefrontThemeStatus;
|
|
28255
|
+
(function (IkasStorefrontThemeStatus) {
|
|
28256
|
+
IkasStorefrontThemeStatus["WAITING"] = "WAITING";
|
|
28257
|
+
IkasStorefrontThemeStatus["READY"] = "READY";
|
|
28258
|
+
})(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
|
|
28259
|
+
var IkasStorefrontTheme = /** @class */ (function () {
|
|
28260
|
+
function IkasStorefrontTheme(data) {
|
|
28261
|
+
this.id = data.id || "";
|
|
28262
|
+
this.isMainTheme = data.isMainTheme || false;
|
|
28263
|
+
this.name = data.name || "";
|
|
28264
|
+
this.status = data.status || IkasStorefrontThemeStatus.WAITING;
|
|
28265
|
+
this.themeId = data.themeId || "";
|
|
28266
|
+
this.themeVersionId = data.themeVersionId || "";
|
|
28267
|
+
}
|
|
28268
|
+
return IkasStorefrontTheme;
|
|
28269
|
+
}());
|
|
28270
|
+
|
|
28271
|
+
var IkasStorefrontThemeLocalization = /** @class */ (function () {
|
|
28272
|
+
function IkasStorefrontThemeLocalization(data) {
|
|
28273
|
+
this.id = data.id || "";
|
|
28274
|
+
this.locale = data.locale || "";
|
|
28275
|
+
this.storefrontId = data.storefrontId || "";
|
|
28276
|
+
this.storefrontThemeId = data.storefrontThemeId || "";
|
|
28277
|
+
this.themeJson = data.themeJson || "";
|
|
28278
|
+
this.privacyPolicy = data.privacyPolicy || null;
|
|
28279
|
+
this.returnPolicy = data.returnPolicy || null;
|
|
28280
|
+
this.termsOfService = data.termsOfService || null;
|
|
28281
|
+
}
|
|
28282
|
+
return IkasStorefrontThemeLocalization;
|
|
28283
|
+
}());
|
|
28284
|
+
|
|
28285
|
+
var StorefrontStatus;
|
|
28286
|
+
(function (StorefrontStatus) {
|
|
28287
|
+
StorefrontStatus["WAITING"] = "WAITING";
|
|
28288
|
+
StorefrontStatus["READY"] = "READY";
|
|
28289
|
+
})(StorefrontStatus || (StorefrontStatus = {}));
|
|
28290
|
+
var IkasStorefront = /** @class */ (function () {
|
|
28291
|
+
function IkasStorefront(data) {
|
|
28292
|
+
if (data === void 0) { data = {}; }
|
|
28293
|
+
this.id = data.id || "";
|
|
28294
|
+
this.name = data.name || "";
|
|
28295
|
+
this.status = data.status || StorefrontStatus.WAITING;
|
|
28296
|
+
this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
|
|
28297
|
+
this.emailSettingsId = data.emailSettingsId || null;
|
|
28298
|
+
this.salesChannelId = data.salesChannelId || null;
|
|
28299
|
+
this.gtmId = data.gtmId || null;
|
|
28300
|
+
this.fbpId = data.fbpId || null;
|
|
28301
|
+
// Sub Models
|
|
28302
|
+
this.localizations = data.localizations
|
|
28303
|
+
? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
|
|
28304
|
+
: [];
|
|
28305
|
+
this.routings = data.routings
|
|
28306
|
+
? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
|
|
28307
|
+
: [];
|
|
28308
|
+
this.domains = data.domains
|
|
28309
|
+
? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
|
|
28310
|
+
: [];
|
|
28311
|
+
this.themes = data.themes
|
|
28312
|
+
? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
|
|
28313
|
+
: [];
|
|
28314
|
+
this.regions = data.regions
|
|
28315
|
+
? data.regions.map(function (r) { return new IkasStorefrontThemeLocalization(r); })
|
|
28316
|
+
: [];
|
|
28317
|
+
}
|
|
28318
|
+
return IkasStorefront;
|
|
28319
|
+
}());
|
|
28320
|
+
|
|
28321
|
+
var SettingsHelper = /** @class */ (function () {
|
|
28322
|
+
function SettingsHelper() {
|
|
28323
|
+
}
|
|
28324
|
+
SettingsHelper.getSettings = function (locale) {
|
|
28325
|
+
return new Promise(function (resolve) {
|
|
28326
|
+
var serverRuntimeConfig = getConfig().serverRuntimeConfig;
|
|
28327
|
+
var settings = serverRuntimeConfig.SETTINGS;
|
|
28328
|
+
var storefront = new IkasStorefront(settings.storefront);
|
|
28329
|
+
var localizationMap = settings.localizationMap;
|
|
28330
|
+
var themeJSONPath = localizationMap[locale];
|
|
28331
|
+
var routing = storefront.routings.find(function (r) { return r.id === locale || r.path === locale; });
|
|
28332
|
+
if (!themeJSONPath || !routing) {
|
|
28333
|
+
return resolve(null);
|
|
28334
|
+
}
|
|
28335
|
+
fs.readFile(themeJSONPath, {
|
|
28336
|
+
flag: "a+",
|
|
28337
|
+
}, function (err, file) {
|
|
28338
|
+
if (err) {
|
|
28339
|
+
return resolve(null);
|
|
28340
|
+
}
|
|
28341
|
+
var result = file.length ? JSON.parse(file.toString()) : {};
|
|
28342
|
+
resolve({
|
|
28343
|
+
storefront: storefront,
|
|
28344
|
+
theme: new IkasTheme(result),
|
|
28345
|
+
routing: routing,
|
|
28346
|
+
});
|
|
28347
|
+
});
|
|
28348
|
+
});
|
|
28349
|
+
};
|
|
28350
|
+
SettingsHelper.getPageData = function (context, isServer, pageType) {
|
|
28351
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28352
|
+
var locale, settings, storefront, theme, routing, provider;
|
|
28353
|
+
return __generator(this, function (_a) {
|
|
28354
|
+
switch (_a.label) {
|
|
28355
|
+
case 0:
|
|
28356
|
+
locale = context.locale || context.defaultLocale || "en";
|
|
28357
|
+
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
28358
|
+
case 1:
|
|
28359
|
+
settings = _a.sent();
|
|
28360
|
+
if (!settings ||
|
|
28361
|
+
!settings.storefront.mainStorefrontThemeId ||
|
|
28362
|
+
!settings.storefront.salesChannelId ||
|
|
28363
|
+
!settings.routing.priceListId) {
|
|
28364
|
+
return [2 /*return*/, {
|
|
28365
|
+
props: {},
|
|
28366
|
+
notFound: true,
|
|
28367
|
+
}];
|
|
28368
|
+
}
|
|
28369
|
+
storefront = settings.storefront, theme = settings.theme, routing = settings.routing;
|
|
28370
|
+
IkasStorefrontConfig.storefrontId = storefront.id;
|
|
28371
|
+
IkasStorefrontConfig.storefrontRoutingId = routing.id;
|
|
28372
|
+
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
28373
|
+
IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
|
|
28374
|
+
IkasStorefrontConfig.priceListId = routing.priceListId;
|
|
28375
|
+
provider = new IkasPageDataProvider(theme, context.params, pageType);
|
|
28376
|
+
return [4 /*yield*/, provider.getPageData()];
|
|
28377
|
+
case 2:
|
|
28378
|
+
_a.sent();
|
|
28379
|
+
if (!provider.page) {
|
|
28380
|
+
return [2 /*return*/, {
|
|
28381
|
+
props: {},
|
|
28382
|
+
notFound: true,
|
|
28383
|
+
}];
|
|
28384
|
+
}
|
|
28385
|
+
if (isServer)
|
|
28386
|
+
return [2 /*return*/, provider.nextPageData];
|
|
28387
|
+
else
|
|
28388
|
+
return [2 /*return*/, {
|
|
28389
|
+
props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {}) }),
|
|
28390
|
+
revalidate: 60,
|
|
28391
|
+
}];
|
|
28392
|
+
}
|
|
28393
|
+
});
|
|
28394
|
+
});
|
|
28395
|
+
};
|
|
28396
|
+
SettingsHelper.getStaticProps = function (context, pageType) {
|
|
28397
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28398
|
+
return __generator(this, function (_a) {
|
|
28399
|
+
switch (_a.label) {
|
|
28400
|
+
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType)];
|
|
28401
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28402
|
+
}
|
|
28403
|
+
});
|
|
28404
|
+
});
|
|
28405
|
+
};
|
|
28406
|
+
SettingsHelper.getServerSideProps = function (context, pageType) {
|
|
28407
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28408
|
+
return __generator(this, function (_a) {
|
|
28409
|
+
switch (_a.label) {
|
|
28410
|
+
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType)];
|
|
28411
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28412
|
+
}
|
|
28413
|
+
});
|
|
28414
|
+
});
|
|
28415
|
+
};
|
|
28416
|
+
return SettingsHelper;
|
|
28417
|
+
}());
|
|
28418
|
+
|
|
28314
28419
|
var Page = function (_a) {
|
|
28315
28420
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
|
|
28316
28421
|
var router = useRouter();
|
|
@@ -28318,17 +28423,10 @@ var Page = function (_a) {
|
|
|
28318
28423
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
28319
28424
|
};
|
|
28320
28425
|
var getStaticProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28321
|
-
var theme, provider;
|
|
28322
28426
|
return __generator(this, function (_a) {
|
|
28323
28427
|
switch (_a.label) {
|
|
28324
|
-
case 0: return [4 /*yield*/,
|
|
28325
|
-
case 1:
|
|
28326
|
-
theme = _a.sent();
|
|
28327
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.INDEX);
|
|
28328
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28329
|
-
case 2:
|
|
28330
|
-
_a.sent();
|
|
28331
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28428
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.INDEX)];
|
|
28429
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28332
28430
|
}
|
|
28333
28431
|
});
|
|
28334
28432
|
}); };
|
|
@@ -28370,6 +28468,7 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
|
|
|
28370
28468
|
productMetaData = metaData.filter(function (m) { return m.targetType && m.targetType === IkasHTMLMetaDataTargetType.PRODUCT; });
|
|
28371
28469
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
28372
28470
|
productIdList: productMetaData.map(function (p) { return p.targetId; }),
|
|
28471
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
28373
28472
|
})];
|
|
28374
28473
|
case 2:
|
|
28375
28474
|
productsResponse = _b.sent();
|
|
@@ -28416,25 +28515,10 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
|
|
|
28416
28515
|
});
|
|
28417
28516
|
}); };
|
|
28418
28517
|
var getStaticProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28419
|
-
var theme, provider;
|
|
28420
28518
|
return __generator(this, function (_a) {
|
|
28421
28519
|
switch (_a.label) {
|
|
28422
|
-
case 0: return [4 /*yield*/,
|
|
28423
|
-
case 1:
|
|
28424
|
-
theme = _a.sent();
|
|
28425
|
-
provider = new IkasPageDataProvider(theme, context.params, undefined);
|
|
28426
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28427
|
-
case 2:
|
|
28428
|
-
_a.sent();
|
|
28429
|
-
if (!provider.page) {
|
|
28430
|
-
return [2 /*return*/, {
|
|
28431
|
-
notFound: true,
|
|
28432
|
-
}];
|
|
28433
|
-
}
|
|
28434
|
-
return [2 /*return*/, {
|
|
28435
|
-
props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {}) }),
|
|
28436
|
-
revalidate: 60,
|
|
28437
|
-
}];
|
|
28520
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context)];
|
|
28521
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28438
28522
|
}
|
|
28439
28523
|
});
|
|
28440
28524
|
}); };
|
|
@@ -28479,19 +28563,38 @@ var Page$2 = function (_a) {
|
|
|
28479
28563
|
return (createElement(IkasPage, { page: page, settingsStr: settingsStr, propValues: propValues }));
|
|
28480
28564
|
};
|
|
28481
28565
|
var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28482
|
-
var
|
|
28566
|
+
var allSettings, customPagePaths;
|
|
28483
28567
|
return __generator(this, function (_a) {
|
|
28484
28568
|
switch (_a.label) {
|
|
28485
|
-
case 0:
|
|
28569
|
+
case 0:
|
|
28570
|
+
if (!context.locales)
|
|
28571
|
+
return [2 /*return*/, {
|
|
28572
|
+
paths: [],
|
|
28573
|
+
fallback: "blocking",
|
|
28574
|
+
}];
|
|
28575
|
+
return [4 /*yield*/, Promise.all(context.locales.map(function (locale) { return SettingsHelper.getSettings(locale); }))];
|
|
28486
28576
|
case 1:
|
|
28487
|
-
|
|
28488
|
-
|
|
28489
|
-
|
|
28490
|
-
|
|
28491
|
-
|
|
28577
|
+
allSettings = (_a.sent());
|
|
28578
|
+
customPagePaths = [];
|
|
28579
|
+
allSettings.forEach(function (_a) {
|
|
28580
|
+
var theme = _a.theme, routing = _a.routing;
|
|
28581
|
+
if (!theme)
|
|
28582
|
+
return;
|
|
28583
|
+
var customPages = theme.pages.filter(function (p) { return p.type === IkasThemePageType.CUSTOM; });
|
|
28584
|
+
customPages.forEach(function (customPage) {
|
|
28585
|
+
if (customPage.slug &&
|
|
28586
|
+
!customPagePaths.some(function (p) { return p.params.slug === customPage.slug; })) {
|
|
28587
|
+
customPagePaths.push({
|
|
28588
|
+
params: { slug: customPage.slug },
|
|
28589
|
+
locale: routing.locale,
|
|
28590
|
+
});
|
|
28591
|
+
}
|
|
28592
|
+
});
|
|
28593
|
+
});
|
|
28492
28594
|
return [2 /*return*/, {
|
|
28493
28595
|
paths: customPagePaths.map(function (p) { return ({
|
|
28494
|
-
params: p,
|
|
28596
|
+
params: p.params,
|
|
28597
|
+
locale: p.locale,
|
|
28495
28598
|
}); }),
|
|
28496
28599
|
fallback: "blocking",
|
|
28497
28600
|
}];
|
|
@@ -28499,17 +28602,10 @@ var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
28499
28602
|
});
|
|
28500
28603
|
}); };
|
|
28501
28604
|
var getStaticProps$2 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28502
|
-
var theme, provider;
|
|
28503
28605
|
return __generator(this, function (_a) {
|
|
28504
28606
|
switch (_a.label) {
|
|
28505
|
-
case 0: return [4 /*yield*/,
|
|
28506
|
-
case 1:
|
|
28507
|
-
theme = _a.sent();
|
|
28508
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.CUSTOM);
|
|
28509
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28510
|
-
case 2:
|
|
28511
|
-
_a.sent();
|
|
28512
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28607
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.CUSTOM)];
|
|
28608
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28513
28609
|
}
|
|
28514
28610
|
});
|
|
28515
28611
|
}); };
|
|
@@ -28522,18 +28618,38 @@ var _slug_ = /*#__PURE__*/Object.freeze({
|
|
|
28522
28618
|
});
|
|
28523
28619
|
|
|
28524
28620
|
var CheckoutPage = function (_a) {
|
|
28525
|
-
var checkoutStr = _a.checkoutStr,
|
|
28621
|
+
var checkoutStr = _a.checkoutStr, others = __rest(_a, ["checkoutStr"]);
|
|
28526
28622
|
Analytics.disableHTML();
|
|
28527
28623
|
var checkout = new IkasCheckout(JSON.parse(checkoutStr));
|
|
28528
|
-
return createElement(IkasCheckoutPage, { checkout: checkout,
|
|
28624
|
+
return createElement(IkasCheckoutPage, __assign({ checkout: checkout }, others));
|
|
28529
28625
|
};
|
|
28530
28626
|
var _id_ = observer(CheckoutPage);
|
|
28531
28627
|
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28532
|
-
var id, redirect, checkout;
|
|
28628
|
+
var id, locale, settings, storefront, routing, redirect, checkout, region;
|
|
28533
28629
|
return __generator(this, function (_a) {
|
|
28534
28630
|
switch (_a.label) {
|
|
28535
28631
|
case 0:
|
|
28536
28632
|
id = context.query.id;
|
|
28633
|
+
locale = context.locale || context.defaultLocale || "en";
|
|
28634
|
+
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
28635
|
+
case 1:
|
|
28636
|
+
settings = _a.sent();
|
|
28637
|
+
// TODO maybe remove this and convert this page to static
|
|
28638
|
+
if (!settings ||
|
|
28639
|
+
!settings.storefront.mainStorefrontThemeId ||
|
|
28640
|
+
!settings.storefront.salesChannelId ||
|
|
28641
|
+
!settings.routing.priceListId) {
|
|
28642
|
+
return [2 /*return*/, {
|
|
28643
|
+
props: {},
|
|
28644
|
+
notFound: true,
|
|
28645
|
+
}];
|
|
28646
|
+
}
|
|
28647
|
+
storefront = settings.storefront, routing = settings.routing;
|
|
28648
|
+
IkasStorefrontConfig.storefrontId = storefront.id;
|
|
28649
|
+
IkasStorefrontConfig.storefrontRoutingId = routing.id;
|
|
28650
|
+
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
28651
|
+
IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
|
|
28652
|
+
IkasStorefrontConfig.priceListId = routing.priceListId;
|
|
28537
28653
|
redirect = function () {
|
|
28538
28654
|
context.res.writeHead(302, { Location: "/" });
|
|
28539
28655
|
context.res.end();
|
|
@@ -28543,12 +28659,16 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
28543
28659
|
return [2 /*return*/, redirect()];
|
|
28544
28660
|
}
|
|
28545
28661
|
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
|
|
28546
|
-
case
|
|
28662
|
+
case 2:
|
|
28547
28663
|
checkout = _a.sent();
|
|
28548
28664
|
if (checkout) {
|
|
28665
|
+
region = settings.storefront.regions.find(function (r) { return r.id === storefront.mainStorefrontThemeId; });
|
|
28549
28666
|
return [2 /*return*/, {
|
|
28550
28667
|
props: {
|
|
28551
28668
|
checkoutStr: JSON.stringify(checkout),
|
|
28669
|
+
returnPolicy: (region === null || region === void 0 ? void 0 : region.returnPolicy) || "",
|
|
28670
|
+
privacyPolicy: (region === null || region === void 0 ? void 0 : region.privacyPolicy) || "",
|
|
28671
|
+
termsOfService: (region === null || region === void 0 ? void 0 : region.termsOfService) || "",
|
|
28552
28672
|
queryParams: context.query,
|
|
28553
28673
|
},
|
|
28554
28674
|
}];
|
|
@@ -28573,17 +28693,10 @@ var Page$3 = function (_a) {
|
|
|
28573
28693
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28574
28694
|
};
|
|
28575
28695
|
var getStaticProps$3 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28576
|
-
var theme, provider;
|
|
28577
28696
|
return __generator(this, function (_a) {
|
|
28578
28697
|
switch (_a.label) {
|
|
28579
|
-
case 0: return [4 /*yield*/,
|
|
28580
|
-
case 1:
|
|
28581
|
-
theme = _a.sent();
|
|
28582
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.ACCOUNT);
|
|
28583
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28584
|
-
case 2:
|
|
28585
|
-
_a.sent();
|
|
28586
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28698
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.ACCOUNT)];
|
|
28699
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28587
28700
|
}
|
|
28588
28701
|
});
|
|
28589
28702
|
}); };
|
|
@@ -28601,17 +28714,10 @@ var Page$4 = function (_a) {
|
|
|
28601
28714
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28602
28715
|
};
|
|
28603
28716
|
var getStaticProps$4 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28604
|
-
var theme, provider;
|
|
28605
28717
|
return __generator(this, function (_a) {
|
|
28606
28718
|
switch (_a.label) {
|
|
28607
|
-
case 0: return [4 /*yield*/,
|
|
28608
|
-
case 1:
|
|
28609
|
-
theme = _a.sent();
|
|
28610
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.ADDRESSES);
|
|
28611
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28612
|
-
case 2:
|
|
28613
|
-
_a.sent();
|
|
28614
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28719
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.ADDRESSES)];
|
|
28720
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28615
28721
|
}
|
|
28616
28722
|
});
|
|
28617
28723
|
}); };
|
|
@@ -28629,17 +28735,10 @@ var Page$5 = function (_a) {
|
|
|
28629
28735
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28630
28736
|
};
|
|
28631
28737
|
var getStaticProps$5 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28632
|
-
var theme, provider;
|
|
28633
28738
|
return __generator(this, function (_a) {
|
|
28634
28739
|
switch (_a.label) {
|
|
28635
|
-
case 0: return [4 /*yield*/,
|
|
28636
|
-
case 1:
|
|
28637
|
-
theme = _a.sent();
|
|
28638
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.ORDERS);
|
|
28639
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28640
|
-
case 2:
|
|
28641
|
-
_a.sent();
|
|
28642
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28740
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.ORDERS)];
|
|
28741
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28643
28742
|
}
|
|
28644
28743
|
});
|
|
28645
28744
|
}); };
|
|
@@ -28657,17 +28756,10 @@ var Page$6 = function (_a) {
|
|
|
28657
28756
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28658
28757
|
};
|
|
28659
28758
|
var getServerSideProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28660
|
-
var theme, provider;
|
|
28661
28759
|
return __generator(this, function (_a) {
|
|
28662
28760
|
switch (_a.label) {
|
|
28663
|
-
case 0: return [4 /*yield*/,
|
|
28664
|
-
case 1:
|
|
28665
|
-
theme = _a.sent();
|
|
28666
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.ORDER_DETAIL);
|
|
28667
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28668
|
-
case 2:
|
|
28669
|
-
_a.sent();
|
|
28670
|
-
return [2 /*return*/, provider.nextPageData];
|
|
28761
|
+
case 0: return [4 /*yield*/, SettingsHelper.getServerSideProps(context, IkasThemePageType.ORDER_DETAIL)];
|
|
28762
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28671
28763
|
}
|
|
28672
28764
|
});
|
|
28673
28765
|
}); };
|
|
@@ -28685,17 +28777,10 @@ var Page$7 = function (_a) {
|
|
|
28685
28777
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28686
28778
|
};
|
|
28687
28779
|
var getStaticProps$6 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28688
|
-
var theme, provider;
|
|
28689
28780
|
return __generator(this, function (_a) {
|
|
28690
28781
|
switch (_a.label) {
|
|
28691
|
-
case 0: return [4 /*yield*/,
|
|
28692
|
-
case 1:
|
|
28693
|
-
theme = _a.sent();
|
|
28694
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.LOGIN);
|
|
28695
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28696
|
-
case 2:
|
|
28697
|
-
_a.sent();
|
|
28698
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28782
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.LOGIN)];
|
|
28783
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28699
28784
|
}
|
|
28700
28785
|
});
|
|
28701
28786
|
}); };
|
|
@@ -28713,17 +28798,10 @@ var Page$8 = function (_a) {
|
|
|
28713
28798
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28714
28799
|
};
|
|
28715
28800
|
var getStaticProps$7 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28716
|
-
var theme, provider;
|
|
28717
28801
|
return __generator(this, function (_a) {
|
|
28718
28802
|
switch (_a.label) {
|
|
28719
|
-
case 0: return [4 /*yield*/,
|
|
28720
|
-
case 1:
|
|
28721
|
-
theme = _a.sent();
|
|
28722
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.REGISTER);
|
|
28723
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28724
|
-
case 2:
|
|
28725
|
-
_a.sent();
|
|
28726
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28803
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.REGISTER)];
|
|
28804
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28727
28805
|
}
|
|
28728
28806
|
});
|
|
28729
28807
|
}); };
|
|
@@ -28741,17 +28819,10 @@ var Page$9 = function (_a) {
|
|
|
28741
28819
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28742
28820
|
};
|
|
28743
28821
|
var getStaticProps$8 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28744
|
-
var theme, provider;
|
|
28745
28822
|
return __generator(this, function (_a) {
|
|
28746
28823
|
switch (_a.label) {
|
|
28747
|
-
case 0: return [4 /*yield*/,
|
|
28748
|
-
case 1:
|
|
28749
|
-
theme = _a.sent();
|
|
28750
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.FORGOT_PASSWORD);
|
|
28751
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28752
|
-
case 2:
|
|
28753
|
-
_a.sent();
|
|
28754
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28824
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.FORGOT_PASSWORD)];
|
|
28825
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28755
28826
|
}
|
|
28756
28827
|
});
|
|
28757
28828
|
}); };
|
|
@@ -28769,17 +28840,10 @@ var Page$a = function (_a) {
|
|
|
28769
28840
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28770
28841
|
};
|
|
28771
28842
|
var getStaticProps$9 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28772
|
-
var theme, provider;
|
|
28773
28843
|
return __generator(this, function (_a) {
|
|
28774
28844
|
switch (_a.label) {
|
|
28775
|
-
case 0: return [4 /*yield*/,
|
|
28776
|
-
case 1:
|
|
28777
|
-
theme = _a.sent();
|
|
28778
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.RECOVER_PASSWORD);
|
|
28779
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28780
|
-
case 2:
|
|
28781
|
-
_a.sent();
|
|
28782
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28845
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.RECOVER_PASSWORD)];
|
|
28846
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28783
28847
|
}
|
|
28784
28848
|
});
|
|
28785
28849
|
}); };
|
|
@@ -28801,17 +28865,10 @@ var Page$b = function (_a) {
|
|
|
28801
28865
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28802
28866
|
};
|
|
28803
28867
|
var getStaticProps$a = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28804
|
-
var theme, provider;
|
|
28805
28868
|
return __generator(this, function (_a) {
|
|
28806
28869
|
switch (_a.label) {
|
|
28807
|
-
case 0: return [4 /*yield*/,
|
|
28808
|
-
case 1:
|
|
28809
|
-
theme = _a.sent();
|
|
28810
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.CART);
|
|
28811
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28812
|
-
case 2:
|
|
28813
|
-
_a.sent();
|
|
28814
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28870
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.CART)];
|
|
28871
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28815
28872
|
}
|
|
28816
28873
|
});
|
|
28817
28874
|
}); };
|
|
@@ -28840,17 +28897,10 @@ var Page$d = function (_a) {
|
|
|
28840
28897
|
return (createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28841
28898
|
};
|
|
28842
28899
|
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28843
|
-
var theme, provider;
|
|
28844
28900
|
return __generator(this, function (_a) {
|
|
28845
28901
|
switch (_a.label) {
|
|
28846
|
-
case 0: return [4 /*yield*/,
|
|
28847
|
-
case 1:
|
|
28848
|
-
theme = _a.sent();
|
|
28849
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.FAVORITE_PRODUCTS);
|
|
28850
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28851
|
-
case 2:
|
|
28852
|
-
_a.sent();
|
|
28853
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28902
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.FAVORITE_PRODUCTS)];
|
|
28903
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28854
28904
|
}
|
|
28855
28905
|
});
|
|
28856
28906
|
}); };
|
|
@@ -28876,17 +28926,10 @@ var Page$e = function (_a) {
|
|
|
28876
28926
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
28877
28927
|
};
|
|
28878
28928
|
var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28879
|
-
var theme, provider;
|
|
28880
28929
|
return __generator(this, function (_a) {
|
|
28881
28930
|
switch (_a.label) {
|
|
28882
|
-
case 0: return [4 /*yield*/,
|
|
28883
|
-
case 1:
|
|
28884
|
-
theme = _a.sent();
|
|
28885
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.SEARCH);
|
|
28886
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28887
|
-
case 2:
|
|
28888
|
-
_a.sent();
|
|
28889
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28931
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.SEARCH)];
|
|
28932
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28890
28933
|
}
|
|
28891
28934
|
});
|
|
28892
28935
|
}); };
|
|
@@ -28904,17 +28947,10 @@ var Page$f = function (_a) {
|
|
|
28904
28947
|
return (createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28905
28948
|
};
|
|
28906
28949
|
var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28907
|
-
var theme, provider;
|
|
28908
28950
|
return __generator(this, function (_a) {
|
|
28909
28951
|
switch (_a.label) {
|
|
28910
|
-
case 0: return [4 /*yield*/,
|
|
28911
|
-
case 1:
|
|
28912
|
-
theme = _a.sent();
|
|
28913
|
-
provider = new IkasPageDataProvider(theme, context.params, IkasThemePageType.NOT_FOUND);
|
|
28914
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28915
|
-
case 2:
|
|
28916
|
-
_a.sent();
|
|
28917
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28952
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, IkasThemePageType.NOT_FOUND)];
|
|
28953
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28918
28954
|
}
|
|
28919
28955
|
});
|
|
28920
28956
|
}); };
|
|
@@ -28940,4 +28976,4 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
28940
28976
|
return IkasBaseStore;
|
|
28941
28977
|
}());
|
|
28942
28978
|
|
|
28943
|
-
export { AccountInfoForm, index$3 as AccountPage, AddressForm, addresses as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, cart as CartPage, _id_$1 as CheckoutPage, ContactForm, _slug_ as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts as FavoriteProductsPage, ForgotPasswordForm, forgotPassword as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasBaseStore, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageComponentPropValue, IkasPageDataProvider, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI,
|
|
28979
|
+
export { AccountInfoForm, index$3 as AccountPage, AddressForm, addresses as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, cart as CartPage, _id_$1 as CheckoutPage, ContactForm, _slug_ as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts as FavoriteProductsPage, ForgotPasswordForm, forgotPassword as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasBaseStore, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageComponentPropValue, IkasPageDataProvider, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemeCustomDataType, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home as IndexPage, LessThanRule, LoginForm, login as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$2 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$4 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword as RecoverPasswordPage, RegisterForm, register as RegisterPage, RequiredRule, search as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, decodeBase64, formatMoney, parseRangeStr, pascalCase, stringToSlug, validatePhoneNumber };
|