@ikas/storefront 0.1.24-alpha.8 → 0.2.0-alpha.10

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.
Files changed (49) hide show
  1. package/build/__generated__/global-types.d.ts +45 -0
  2. package/build/analytics/analytics.d.ts +3 -2
  3. package/build/analytics/events.d.ts +1 -0
  4. package/build/analytics/ikas.d.ts +133 -0
  5. package/build/api/back-in-stock-reminder/__generated__/listProductBackInStockRemind.d.ts +24 -0
  6. package/build/api/back-in-stock-reminder/__generated__/saveProductBackInStockRemind.d.ts +19 -0
  7. package/build/api/back-in-stock-reminder/index.d.ts +23 -0
  8. package/build/api/checkout/__generated__/getCheckoutById.d.ts +0 -4
  9. package/build/api/checkout/__generated__/listPaymentGateway.d.ts +1 -3
  10. package/build/api/customer/__generated__/customerForgotPassword.d.ts +0 -1
  11. package/build/api/customer/__generated__/registerCustomer.d.ts +0 -1
  12. package/build/api/customer-review/__generated__/createCustomerReview.d.ts +11 -0
  13. package/build/api/customer-review/__generated__/listCustomerReviews.d.ts +25 -0
  14. package/build/api/customer-review/index.d.ts +24 -0
  15. package/build/api/index.d.ts +3 -0
  16. package/build/api/merchant/__generated__/listMerchantSettings.d.ts +0 -4
  17. package/build/api/merchant/index.d.ts +1 -1
  18. package/build/api/product-option-set/__generated__/ListProductOptionSet.d.ts +90 -0
  19. package/build/api/product-option-set/index.d.ts +6 -0
  20. package/build/components/page/index.d.ts +1 -0
  21. package/build/index.es.js +1569 -293
  22. package/build/index.js +1584 -293
  23. package/build/models/data/cart/index.d.ts +0 -1
  24. package/build/models/data/customer-review/index.d.ts +23 -0
  25. package/build/models/data/customer-review-settings/index.d.ts +4 -0
  26. package/build/models/data/index.d.ts +4 -1
  27. package/build/models/data/order/index.d.ts +0 -1
  28. package/build/models/data/order/line-item/index.d.ts +0 -1
  29. package/build/models/data/order-transaction/index.d.ts +0 -1
  30. package/build/models/data/product/index.d.ts +4 -0
  31. package/build/models/data/product/variant/index.d.ts +7 -0
  32. package/build/models/data/product/variant/price/index.d.ts +0 -1
  33. package/build/models/data/product-back-in-stock-settings/index.d.ts +3 -0
  34. package/build/models/data/product-option-set/index.d.ts +85 -0
  35. package/build/models/data/simple-product/index.d.ts +1 -0
  36. package/build/models/ui/customer-review-list/index.d.ts +43 -0
  37. package/build/models/ui/index.d.ts +2 -0
  38. package/build/models/ui/product-detail/index.d.ts +4 -1
  39. package/build/models/ui/validator/form/customer-review.d.ts +37 -0
  40. package/build/pages/editor.d.ts +1 -0
  41. package/build/pages/index.d.ts +19 -20
  42. package/build/providers/page-data-get.d.ts +2 -0
  43. package/build/providers/page-data-init.d.ts +1 -1
  44. package/build/providers/page-data-next.d.ts +18 -2
  45. package/build/store/customer.d.ts +7 -0
  46. package/build/storefront/index.d.ts +8 -2
  47. package/build/utils/currency.d.ts +0 -6
  48. package/package.json +5 -2
  49. package/build/providers/prop-value/checkout.d.ts +0 -4
package/build/index.js CHANGED
@@ -10969,9 +10969,8 @@ function setContext(setter) {
10969
10969
  var IkasStorefrontConfig = /** @class */ (function () {
10970
10970
  function IkasStorefrontConfig() {
10971
10971
  }
10972
- IkasStorefrontConfig.init = function (store, components, config, apiUrlOverride) {
10972
+ IkasStorefrontConfig.init = function (store, config, apiUrlOverride) {
10973
10973
  IkasStorefrontConfig.store = store;
10974
- IkasStorefrontConfig.components = components;
10975
10974
  IkasStorefrontConfig.config = config;
10976
10975
  IkasStorefrontConfig.apiUrlOverride = apiUrlOverride || null;
10977
10976
  if (process.env.NEXT_PUBLIC_ENV === "local") {
@@ -11012,9 +11011,12 @@ var IkasStorefrontConfig = /** @class */ (function () {
11012
11011
  stockPreference: IkasStorefrontConfig.stockPreference || null,
11013
11012
  storefrontJSScripts: IkasStorefrontConfig.storefrontJSScripts || [],
11014
11013
  translations: this.translations,
11014
+ customerReviewSettings: IkasStorefrontConfig.customerReviewSettings,
11015
+ productBackInStockSettings: IkasStorefrontConfig.productBackInStockSettings
11016
+ ? JSON.parse(JSON.stringify(IkasStorefrontConfig.productBackInStockSettings))
11017
+ : null,
11015
11018
  };
11016
11019
  };
11017
- IkasStorefrontConfig.components = {};
11018
11020
  IkasStorefrontConfig.config = {};
11019
11021
  IkasStorefrontConfig.apiUrlOverride = null;
11020
11022
  IkasStorefrontConfig.routings = [];
@@ -12107,194 +12109,15 @@ function tryForEach(items, callback, printErrors) {
12107
12109
  });
12108
12110
  }
12109
12111
 
12110
- /**
12111
- *
12112
- * @param price Price to format
12113
- * @param currency Code for the currency, USD, EUR, TRY, etc..
12114
- */
12115
12112
  var formatMoney = function (price, currency) {
12116
- var formatter = new Intl.NumberFormat(IkasStorefrontConfig.getCurrentLocale(), {
12113
+ var locale = typeof navigator !== "undefined"
12114
+ ? navigator.languages
12115
+ : "en-GB";
12116
+ var formatter = new Intl.NumberFormat(locale, {
12117
12117
  style: "currency",
12118
12118
  currency: currency || "TRY",
12119
12119
  });
12120
12120
  return formatter.format(price);
12121
- };
12122
- function getCurrencySymbol(currencyCode) {
12123
- return CURRENCIES[currencyCode] || currencyCode;
12124
- }
12125
- var CURRENCIES = {
12126
- TRY: "₺",
12127
- USD: "$",
12128
- EUR: "€",
12129
- AZN: "₼",
12130
- AED: "د.إ.",
12131
- AFN: "؋",
12132
- ALL: "L",
12133
- AMD: "դր",
12134
- ANG: "ƒ",
12135
- AOA: "Kz",
12136
- ARS: "$",
12137
- AUD: "$",
12138
- AWG: "ƒ",
12139
- BAM: "КМ",
12140
- BBD: "$",
12141
- BDT: "৳",
12142
- BGN: "лв.",
12143
- BHD: "د.ب.",
12144
- BIF: "FBu",
12145
- BMD: "$",
12146
- BND: "$",
12147
- BOB: "Bs.",
12148
- BRL: "R$",
12149
- BSD: "$",
12150
- BTN: "Nu.",
12151
- BWP: "P",
12152
- BYN: "руб.",
12153
- BZD: "$",
12154
- CAD: "$",
12155
- CDF: "₣",
12156
- CHF: "₣",
12157
- CKD: "$",
12158
- CLP: "$",
12159
- CNY: "¥元",
12160
- COP: "$",
12161
- CRC: "₡",
12162
- CUC: "$",
12163
- CUP: "₱",
12164
- CVE: "$",
12165
- CZK: "Kč",
12166
- DJF: "ف.ج.",
12167
- DKK: "kr.",
12168
- DOP: "$",
12169
- DZD: "د.ج.",
12170
- EGP: "ج.م.",
12171
- EHP: "Ptas.",
12172
- ERN: "ناكفا",
12173
- ETB: "ብር",
12174
- FJD: "$",
12175
- FKP: "£",
12176
- FOK: "kr",
12177
- GBP: "£",
12178
- GEL: "₾",
12179
- GGP: "£",
12180
- GHS: "₵",
12181
- GIP: "£",
12182
- GMD: "D",
12183
- GNF: "FG",
12184
- GTQ: "$",
12185
- GYD: "$",
12186
- HKD: "$",
12187
- HNL: "L",
12188
- HRK: "kn",
12189
- HTG: "G",
12190
- HUF: "Ft",
12191
- IDR: "Rp",
12192
- ILS: "₪",
12193
- IMP: "£",
12194
- INR: "₹",
12195
- IQD: "د.ع.",
12196
- IRR: "﷼",
12197
- ISK: "kr",
12198
- JEP: "£",
12199
- JMD: "$",
12200
- JOD: "د.أ.",
12201
- JPY: "¥",
12202
- KES: "KSh",
12203
- KGS: "с",
12204
- KHR: "៛",
12205
- KID: "$",
12206
- KMF: "CF",
12207
- KPW: "₩",
12208
- KRW: "₩",
12209
- KWD: "د.ك.",
12210
- KYD: "$",
12211
- KZT: "₸",
12212
- LAK: "₭",
12213
- LBP: "ل.ل.",
12214
- LKR: "රු or ரூ",
12215
- LRD: "$",
12216
- LSL: "L",
12217
- LYD: "ل.د.",
12218
- MAD: "د.م.",
12219
- MDL: "L",
12220
- MGA: "Ar",
12221
- MKD: "ден",
12222
- MMK: "Ks",
12223
- MNT: "₮",
12224
- MOP: "MOP$",
12225
- MRU: "أ.م.",
12226
- MUR: "रु ",
12227
- MVR: ".ރ",
12228
- MWK: "MK",
12229
- MXN: "$",
12230
- MYR: "RM",
12231
- MZN: "MT",
12232
- NAD: "$",
12233
- NGN: "₦",
12234
- NIO: "C$",
12235
- NOK: "kr",
12236
- NPR: "रू",
12237
- NZD: "$",
12238
- OMR: "ر.ع.",
12239
- PAB: "B/.",
12240
- PEN: "S/.",
12241
- PGK: "K",
12242
- PHP: "₱",
12243
- PKR: "Rs",
12244
- PLN: "zł",
12245
- PND: "$",
12246
- PRB: "р.",
12247
- PYG: "₲",
12248
- QAR: "ر.ق.",
12249
- RON: "L",
12250
- RSD: "дин",
12251
- RUB: "₽",
12252
- RWF: "R₣",
12253
- SAR: "ر.س.",
12254
- SBD: "$",
12255
- SCR: "Rs",
12256
- SDG: "ج.س.",
12257
- SEK: "kr",
12258
- SGD: "$",
12259
- SHP: "£",
12260
- SLL: "Le",
12261
- SLS: "Sl",
12262
- SOS: "Ssh",
12263
- SRD: "$",
12264
- SSP: "SS£",
12265
- STN: "Db",
12266
- SVC: "₡",
12267
- SYP: "ل.س.",
12268
- SZL: "L",
12269
- THB: "฿",
12270
- TJS: "SM",
12271
- TMT: "T",
12272
- TND: "د.ت.",
12273
- TOP: "PT",
12274
- TTD: "$",
12275
- TVD: "$",
12276
- TWD: "圓",
12277
- TZS: "TSh",
12278
- UAH: "грн",
12279
- UGX: "Sh",
12280
- UYU: "$",
12281
- UZS: "сум",
12282
- VED: "Bs.",
12283
- VES: "Bs.F",
12284
- VND: "₫",
12285
- VUV: "VT",
12286
- WST: "ST",
12287
- XAF: "Fr.",
12288
- XCD: "$",
12289
- XOF: "₣",
12290
- XPF: "₣",
12291
- YER: "ر.ي.",
12292
- ZAR: "R",
12293
- ZMW: "ZK",
12294
- ZWB: "",
12295
- ZWL: "$",
12296
- Abkhazia: "",
12297
- Artsakh: "դր.",
12298
12121
  };
12299
12122
 
12300
12123
  /** `Object#toString` result references. */
@@ -19874,7 +19697,6 @@ var IkasOrderLineItem = /** @class */ (function () {
19874
19697
  this.orderedAt = data.orderedAt || 0;
19875
19698
  this.deleted = data.deleted || false;
19876
19699
  this.currencyCode = data.currencyCode || "";
19877
- this.currencySymbol = getCurrencySymbol(this.currencyCode);
19878
19700
  this.discount = data.discount
19879
19701
  ? new IkasOrderLineDiscount(data.discount)
19880
19702
  : undefined;
@@ -19985,7 +19807,6 @@ var IkasCart = /** @class */ (function () {
19985
19807
  this.updatedAt = data.updatedAt || "";
19986
19808
  this.dueDate = data.dueDate;
19987
19809
  this.currencyCode = data.currencyCode || "";
19988
- this.currencySymbol = getCurrencySymbol(this.currencyCode);
19989
19810
  this.customerId = data.customerId;
19990
19811
  this.itemCount = data.itemCount || 0;
19991
19812
  this.items = data.items
@@ -20006,6 +19827,7 @@ var IkasCart = /** @class */ (function () {
20006
19827
  get: function () {
20007
19828
  var _a;
20008
19829
  return (((_a = this.taxLines) === null || _a === void 0 ? void 0 : _a.reduce(function (total, current) { return total + current.price; }, 0)) || 0);
19830
+ // return this.items.reduce((total, current) => total + current.tax, 0);
20009
19831
  },
20010
19832
  enumerable: false,
20011
19833
  configurable: true
@@ -20485,6 +20307,33 @@ var IkasCustomerEmailSubscriptionStatus;
20485
20307
  IkasCustomerEmailSubscriptionStatus["SUBSCRIBED"] = "SUBSCRIBED";
20486
20308
  })(IkasCustomerEmailSubscriptionStatus || (IkasCustomerEmailSubscriptionStatus = {}));
20487
20309
 
20310
+ var IkasCustomerReview = /** @class */ (function () {
20311
+ function IkasCustomerReview(data) {
20312
+ this.comment = data.comment || "";
20313
+ this.createdAt = data.createdAt || "";
20314
+ this.customerId = data.customerId || "";
20315
+ this.deleted = data.deleted || false;
20316
+ this.id = data.id || "";
20317
+ this.orderId = data.orderId || "";
20318
+ this.orderNumber = data.orderNumber || "";
20319
+ this.productId = data.productId || "";
20320
+ this.salesChannelId = data.salesChannelId || "";
20321
+ this.star = data.star || 0;
20322
+ this.status = data.status || CustomerReviewStatusEnum.APPROVED;
20323
+ this.storefrontId = data.storefrontId || "";
20324
+ this.title = data.title || "";
20325
+ this.updatedAt = data.updatedAt || "";
20326
+ mobx.makeAutoObservable(this);
20327
+ }
20328
+ return IkasCustomerReview;
20329
+ }());
20330
+ var CustomerReviewStatusEnum;
20331
+ (function (CustomerReviewStatusEnum) {
20332
+ CustomerReviewStatusEnum["APPROVED"] = "APPROVED";
20333
+ CustomerReviewStatusEnum["REJECTED"] = "REJECTED";
20334
+ CustomerReviewStatusEnum["WAITING"] = "WAITING";
20335
+ })(CustomerReviewStatusEnum || (CustomerReviewStatusEnum = {}));
20336
+
20488
20337
  (function (IkasCardAssociation) {
20489
20338
  IkasCardAssociation["AMERICAN_EXPRESS"] = "AMERICAN_EXPRESS";
20490
20339
  IkasCardAssociation["MASTER_CARD"] = "MASTER_CARD";
@@ -20559,7 +20408,6 @@ var IkasOrder = /** @class */ (function () {
20559
20408
  // this.totalDiscountPrice = data.totalDiscountPrice;
20560
20409
  // this.totalWeight = data.totalWeight;
20561
20410
  this.currencyCode = data.currencyCode;
20562
- this.currencySymbol = getCurrencySymbol(this.currencyCode);
20563
20411
  this.orderedAt = data.orderedAt;
20564
20412
  this.cancelledAt = data.cancelledAt;
20565
20413
  this.status = data.status;
@@ -20721,7 +20569,6 @@ var IkasProductPrice = /** @class */ (function () {
20721
20569
  this.discountPrice =
20722
20570
  data.discountPrice !== undefined ? data.discountPrice : null;
20723
20571
  this.currency = data.currency || "";
20724
- this.currencySymbol = getCurrencySymbol(this.currency);
20725
20572
  mobx.makeAutoObservable(this);
20726
20573
  }
20727
20574
  Object.defineProperty(IkasProductPrice.prototype, "finalPrice", {
@@ -20868,7 +20715,9 @@ var IkasProductAttributeValue = /** @class */ (function () {
20868
20715
  var IkasProductVariant = /** @class */ (function () {
20869
20716
  function IkasProductVariant(data) {
20870
20717
  if (data === void 0) { data = {}; }
20718
+ this._backInStockReminderSaved = false;
20871
20719
  this.id = data.id || Date.now() + "";
20720
+ this.productId = data.productId || "";
20872
20721
  this.sku = data.sku || null;
20873
20722
  this.barcodeList = data.barcodeList || [];
20874
20723
  this.variantValues = data.variantValues
@@ -20894,6 +20743,70 @@ var IkasProductVariant = /** @class */ (function () {
20894
20743
  enumerable: false,
20895
20744
  configurable: true
20896
20745
  });
20746
+ Object.defineProperty(IkasProductVariant.prototype, "hasStock", {
20747
+ get: function () {
20748
+ return this.stock > 0;
20749
+ },
20750
+ enumerable: false,
20751
+ configurable: true
20752
+ });
20753
+ Object.defineProperty(IkasProductVariant.prototype, "isBackInStockEnabled", {
20754
+ get: function () {
20755
+ return IkasStorefrontConfig.productBackInStockSettings !== null;
20756
+ },
20757
+ enumerable: false,
20758
+ configurable: true
20759
+ });
20760
+ Object.defineProperty(IkasProductVariant.prototype, "isBackInStockCustomerLoginRequired", {
20761
+ get: function () {
20762
+ return (IkasStorefrontConfig.productBackInStockSettings &&
20763
+ IkasStorefrontConfig.productBackInStockSettings.customerLoginRequired);
20764
+ },
20765
+ enumerable: false,
20766
+ configurable: true
20767
+ });
20768
+ Object.defineProperty(IkasProductVariant.prototype, "isBackInStockReminderSaved", {
20769
+ get: function () {
20770
+ return this._backInStockReminderSaved;
20771
+ },
20772
+ enumerable: false,
20773
+ configurable: true
20774
+ });
20775
+ IkasProductVariant.prototype.saveBackInStockReminder = function (email) {
20776
+ return __awaiter(this, void 0, void 0, function () {
20777
+ var listResponse, saveResponseSuccess;
20778
+ return __generator(this, function (_a) {
20779
+ switch (_a.label) {
20780
+ case 0: return [4 /*yield*/, IkasProductBackInStockReminderAPI.list({
20781
+ email: email,
20782
+ productId: this.productId,
20783
+ variantId: this.id,
20784
+ })];
20785
+ case 1:
20786
+ listResponse = _a.sent();
20787
+ if (!(listResponse && listResponse.data.length)) return [3 /*break*/, 2];
20788
+ this._backInStockReminderSaved = true;
20789
+ return [2 /*return*/, false];
20790
+ case 2: return [4 /*yield*/, IkasProductBackInStockReminderAPI.save({
20791
+ email: email,
20792
+ productId: this.productId,
20793
+ variantId: this.id,
20794
+ })];
20795
+ case 3:
20796
+ saveResponseSuccess = _a.sent();
20797
+ if (saveResponseSuccess) {
20798
+ this._backInStockReminderSaved = true;
20799
+ return [2 /*return*/, true];
20800
+ }
20801
+ else {
20802
+ this._backInStockReminderSaved = false;
20803
+ return [2 /*return*/, false];
20804
+ }
20805
+ case 4: return [2 /*return*/];
20806
+ }
20807
+ });
20808
+ });
20809
+ };
20897
20810
  return IkasProductVariant;
20898
20811
  }());
20899
20812
 
@@ -21005,6 +20918,8 @@ var IkasProduct = /** @class */ (function () {
21005
20918
  this.variantTypes = data.variantTypes
21006
20919
  ? data.variantTypes.map(function (v) { return new IkasProductVariantType(v); })
21007
20920
  : [];
20921
+ this.productOptionSetId = data.productOptionSetId || null;
20922
+ this.productOptionSet = data.productOptionSet || null;
21008
20923
  mobx.makeAutoObservable(this);
21009
20924
  }
21010
20925
  Object.defineProperty(IkasProduct.prototype, "hasVariant", {
@@ -21014,6 +20929,13 @@ var IkasProduct = /** @class */ (function () {
21014
20929
  enumerable: false,
21015
20930
  configurable: true
21016
20931
  });
20932
+ Object.defineProperty(IkasProduct.prototype, "hasStock", {
20933
+ get: function () {
20934
+ return this.variants.some(function (v) { return v.stock > 0; });
20935
+ },
20936
+ enumerable: false,
20937
+ configurable: true
20938
+ });
21017
20939
  Object.defineProperty(IkasProduct.prototype, "mainVariantType", {
21018
20940
  get: function () {
21019
20941
  if (!this.hasVariant)
@@ -23823,9 +23745,6 @@ var IkasOrderTransaction = /** @class */ (function () {
23823
23745
  this.checkoutId = data.checkoutId || null;
23824
23746
  this.createdAt = data.createdAt || null;
23825
23747
  this.currencyCode = data.currencyCode || null;
23826
- this.currencySymbol = this.currencyCode
23827
- ? getCurrencySymbol(this.currencyCode)
23828
- : null;
23829
23748
  this.customerId = data.customerId || null;
23830
23749
  this.error = data.error || null;
23831
23750
  this.id = data.id || null;
@@ -23878,6 +23797,145 @@ var IkasTransactionCardTypeEnum;
23878
23797
  IkasTransactionTypeEnum["VOID"] = "VOID";
23879
23798
  })(exports.IkasTransactionTypeEnum || (exports.IkasTransactionTypeEnum = {}));
23880
23799
 
23800
+ (function (IkasProductOptionType) {
23801
+ IkasProductOptionType["CHOICE"] = "CHOICE";
23802
+ IkasProductOptionType["TEXT"] = "TEXT";
23803
+ IkasProductOptionType["TEXT_AREA"] = "TEXT_AREA";
23804
+ IkasProductOptionType["IMAGE"] = "IMAGE";
23805
+ IkasProductOptionType["FILE"] = "FILE";
23806
+ IkasProductOptionType["COLOR_PICKER"] = "COLOR_PICKER";
23807
+ // DATE_PICKER = "DATE_PICKER",
23808
+ IkasProductOptionType["CHECKBOX"] = "CHECKBOX";
23809
+ })(exports.IkasProductOptionType || (exports.IkasProductOptionType = {}));
23810
+ (function (IkasProductOptionSelectType) {
23811
+ IkasProductOptionSelectType["SELECT"] = "SELECT";
23812
+ IkasProductOptionSelectType["BOX"] = "BOX";
23813
+ IkasProductOptionSelectType["SWATCH"] = "SWATCH";
23814
+ })(exports.IkasProductOptionSelectType || (exports.IkasProductOptionSelectType = {}));
23815
+ var IkasProductOptionSelectValueTranslations = /** @class */ (function () {
23816
+ function IkasProductOptionSelectValueTranslations(data) {
23817
+ this.id = data.id || "";
23818
+ this.value = data.value || null;
23819
+ mobx.makeAutoObservable(this);
23820
+ }
23821
+ return IkasProductOptionSelectValueTranslations;
23822
+ }());
23823
+ var IkasProductOptionTranslations = /** @class */ (function () {
23824
+ function IkasProductOptionTranslations(data) {
23825
+ var _a;
23826
+ this.id = data.id || "";
23827
+ this.name = data.name || null;
23828
+ this.optionalText = data.optionalText || null;
23829
+ this.values =
23830
+ ((_a = data.values) === null || _a === void 0 ? void 0 : _a.map(function (o) { return new IkasProductOptionSelectValueTranslations(o); })) || [];
23831
+ mobx.makeAutoObservable(this);
23832
+ }
23833
+ return IkasProductOptionTranslations;
23834
+ }());
23835
+ var IkasProductOptionSetTranslations = /** @class */ (function () {
23836
+ function IkasProductOptionSetTranslations(data) {
23837
+ var _a;
23838
+ this.locale = data.locale || "";
23839
+ this.options =
23840
+ ((_a = data.options) === null || _a === void 0 ? void 0 : _a.map(function (o) { return new IkasProductOptionTranslations(o); })) || [];
23841
+ mobx.makeAutoObservable(this);
23842
+ }
23843
+ return IkasProductOptionSetTranslations;
23844
+ }());
23845
+ var IkasProductOptionSelectValue = /** @class */ (function () {
23846
+ function IkasProductOptionSelectValue(data) {
23847
+ if (data === void 0) { data = {}; }
23848
+ this.order = data.order || 0;
23849
+ this.value = data.value || "";
23850
+ this.price = data.price || null;
23851
+ this.thumbnailImageId = data.thumbnailImageId || null;
23852
+ this.colorCode = data.colorCode || null;
23853
+ this.thumbnailImage =
23854
+ data.thumbnailImage ||
23855
+ (this.thumbnailImageId
23856
+ ? new IkasImage(this.thumbnailImageId)
23857
+ : undefined);
23858
+ mobx.makeAutoObservable(this);
23859
+ }
23860
+ return IkasProductOptionSelectValue;
23861
+ }());
23862
+ var IkasProductOptionSelectSettings = /** @class */ (function () {
23863
+ function IkasProductOptionSelectSettings(data) {
23864
+ if (data === void 0) { data = {}; }
23865
+ var _a;
23866
+ this.type = data.type || exports.IkasProductOptionSelectType.BOX;
23867
+ this.minSelect = data.minSelect || null;
23868
+ this.maxSelect = data.maxSelect || null;
23869
+ this.values =
23870
+ ((_a = data.values) === null || _a === void 0 ? void 0 : _a.map(function (o) { return new IkasProductOptionSelectValue(o); })) || [];
23871
+ mobx.makeAutoObservable(this);
23872
+ }
23873
+ return IkasProductOptionSelectSettings;
23874
+ }());
23875
+ var IkasProductOptionDateSettings = /** @class */ (function () {
23876
+ function IkasProductOptionDateSettings(data) {
23877
+ this.min = data.min || null;
23878
+ this.max = data.max || null;
23879
+ mobx.makeAutoObservable(this);
23880
+ }
23881
+ return IkasProductOptionDateSettings;
23882
+ }());
23883
+ var IkasProductOptionTextSettings = /** @class */ (function () {
23884
+ function IkasProductOptionTextSettings(data) {
23885
+ if (data === void 0) { data = {}; }
23886
+ this.min = data.min || null;
23887
+ this.max = data.max || null;
23888
+ mobx.makeAutoObservable(this);
23889
+ }
23890
+ return IkasProductOptionTextSettings;
23891
+ }());
23892
+ var IkasProductOptionFileSettings = /** @class */ (function () {
23893
+ function IkasProductOptionFileSettings(data) {
23894
+ this.allowedExtensions = data.allowedExtensions || null;
23895
+ this.minQuantity = data.minQuantity || null;
23896
+ this.maxQuantity = data.maxQuantity || null;
23897
+ mobx.makeAutoObservable(this);
23898
+ }
23899
+ return IkasProductOptionFileSettings;
23900
+ }());
23901
+ var IkasProductOption = /** @class */ (function () {
23902
+ function IkasProductOption(data) {
23903
+ this.name = data.name || "";
23904
+ this.order = data.order || 0;
23905
+ this.type = data.type || exports.IkasProductOptionType.CHOICE;
23906
+ this.selectSettings = data.selectSettings
23907
+ ? new IkasProductOptionSelectSettings(data.selectSettings || {})
23908
+ : null;
23909
+ this.textSettings = data.textSettings
23910
+ ? new IkasProductOptionTextSettings(data.textSettings || {})
23911
+ : null;
23912
+ this.fileSettings = data.fileSettings
23913
+ ? new IkasProductOptionFileSettings(data.fileSettings || {})
23914
+ : null;
23915
+ this.dateSettings = data.dateSettings
23916
+ ? new IkasProductOptionDateSettings(data.dateSettings || {})
23917
+ : null;
23918
+ this.price = data.price || null;
23919
+ this.isOptional = data.isOptional || null;
23920
+ this.optionalText = data.optionalText || null;
23921
+ this.requiredOptionId = data.requiredOptionId || null;
23922
+ this.requiredOptionValueIds = data.requiredOptionValueIds || null;
23923
+ mobx.makeAutoObservable(this);
23924
+ }
23925
+ return IkasProductOption;
23926
+ }());
23927
+ var IkasProductOptionSet = /** @class */ (function () {
23928
+ function IkasProductOptionSet(data) {
23929
+ var _a, _b;
23930
+ this.name = data.name || "";
23931
+ this.options = ((_a = data.options) === null || _a === void 0 ? void 0 : _a.map(function (o) { return new IkasProductOption(o); })) || [];
23932
+ this.translations = data.translations
23933
+ ? (_b = data.translations) === null || _b === void 0 ? void 0 : _b.map(function (o) { return new IkasProductOptionSetTranslations(o); }) : null;
23934
+ mobx.makeAutoObservable(this);
23935
+ }
23936
+ return IkasProductOptionSet;
23937
+ }());
23938
+
23881
23939
  var IkasThemeComponentProp = /** @class */ (function () {
23882
23940
  function IkasThemeComponentProp(data) {
23883
23941
  this.id = data.id || Date.now() + "";
@@ -25922,14 +25980,13 @@ var CheckoutViewModel = /** @class */ (function () {
25922
25980
  });
25923
25981
  }); };
25924
25982
  this.getMerchantSettings = function () { return __awaiter(_this, void 0, void 0, function () {
25925
- var merchantId, _a;
25983
+ var _a;
25926
25984
  return __generator(this, function (_b) {
25927
25985
  switch (_b.label) {
25928
25986
  case 0:
25929
25987
  if (!!this.merchantSettings) return [3 /*break*/, 2];
25930
- merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
25931
25988
  _a = this;
25932
- return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
25989
+ return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings()];
25933
25990
  case 1:
25934
25991
  _a.merchantSettings = _b.sent();
25935
25992
  _b.label = 2;
@@ -27203,11 +27260,512 @@ var IkasEventType;
27203
27260
  IkasEventType["CUSTOMER_VISIT"] = "CUSTOMER_VISIT";
27204
27261
  IkasEventType["VIEW_CART"] = "VIEW_CART";
27205
27262
  IkasEventType["VIEW_CATEGORY"] = "VIEW_CATEGORY";
27263
+ IkasEventType["VIEW_BRAND"] = "VIEW_BRAND";
27206
27264
  IkasEventType["VIEW_SEARCH_RESULTS"] = "VIEW_SEARCH_RESULTS";
27207
27265
  IkasEventType["VIEW_LISTING"] = "VIEW_LISTING";
27208
27266
  IkasEventType["CONTACT_FORM"] = "CONTACT_FORM";
27209
27267
  })(IkasEventType || (IkasEventType = {}));
27210
27268
 
27269
+ var StorefrontEventType;
27270
+ (function (StorefrontEventType) {
27271
+ StorefrontEventType[StorefrontEventType["SESSION_START"] = 1] = "SESSION_START";
27272
+ StorefrontEventType[StorefrontEventType["PAGE_VIEW"] = 2] = "PAGE_VIEW";
27273
+ StorefrontEventType[StorefrontEventType["PRODUCT_VIEW"] = 3] = "PRODUCT_VIEW";
27274
+ StorefrontEventType[StorefrontEventType["ADD_TO_CART"] = 4] = "ADD_TO_CART";
27275
+ StorefrontEventType[StorefrontEventType["VIEW_CART"] = 5] = "VIEW_CART";
27276
+ StorefrontEventType[StorefrontEventType["ORDER_SUCCESS"] = 6] = "ORDER_SUCCESS";
27277
+ StorefrontEventType[StorefrontEventType["BEGIN_CHECKOUT"] = 7] = "BEGIN_CHECKOUT";
27278
+ StorefrontEventType[StorefrontEventType["CHECKOUT_STEP"] = 8] = "CHECKOUT_STEP";
27279
+ StorefrontEventType[StorefrontEventType["CUSTOMER_REGISTER"] = 9] = "CUSTOMER_REGISTER";
27280
+ StorefrontEventType[StorefrontEventType["CUSTOMER_VISIT"] = 10] = "CUSTOMER_VISIT";
27281
+ StorefrontEventType[StorefrontEventType["CUSTOMER_LOGIN"] = 11] = "CUSTOMER_LOGIN";
27282
+ StorefrontEventType[StorefrontEventType["BRAND_VIEW"] = 12] = "BRAND_VIEW";
27283
+ StorefrontEventType[StorefrontEventType["CATEGORY_VIEW"] = 13] = "CATEGORY_VIEW";
27284
+ })(StorefrontEventType || (StorefrontEventType = {}));
27285
+ var StorefrontEventPageType;
27286
+ (function (StorefrontEventPageType) {
27287
+ StorefrontEventPageType[StorefrontEventPageType["INDEX"] = 1] = "INDEX";
27288
+ StorefrontEventPageType[StorefrontEventPageType["CATEGORY"] = 2] = "CATEGORY";
27289
+ StorefrontEventPageType[StorefrontEventPageType["BRAND"] = 3] = "BRAND";
27290
+ StorefrontEventPageType[StorefrontEventPageType["PRODUCT"] = 4] = "PRODUCT";
27291
+ StorefrontEventPageType[StorefrontEventPageType["CUSTOM"] = 5] = "CUSTOM";
27292
+ StorefrontEventPageType[StorefrontEventPageType["ACCOUNT"] = 6] = "ACCOUNT";
27293
+ StorefrontEventPageType[StorefrontEventPageType["ADDRESSES"] = 7] = "ADDRESSES";
27294
+ StorefrontEventPageType[StorefrontEventPageType["ORDERS"] = 8] = "ORDERS";
27295
+ StorefrontEventPageType[StorefrontEventPageType["ORDER_DETAIL"] = 9] = "ORDER_DETAIL";
27296
+ StorefrontEventPageType[StorefrontEventPageType["LOGIN"] = 10] = "LOGIN";
27297
+ StorefrontEventPageType[StorefrontEventPageType["REGISTER"] = 11] = "REGISTER";
27298
+ StorefrontEventPageType[StorefrontEventPageType["FORGOT_PASSWORD"] = 12] = "FORGOT_PASSWORD";
27299
+ StorefrontEventPageType[StorefrontEventPageType["RECOVER_PASSWORD"] = 13] = "RECOVER_PASSWORD";
27300
+ StorefrontEventPageType[StorefrontEventPageType["CART"] = 14] = "CART";
27301
+ StorefrontEventPageType[StorefrontEventPageType["FAVORITE_PRODUCTS"] = 15] = "FAVORITE_PRODUCTS";
27302
+ StorefrontEventPageType[StorefrontEventPageType["SEARCH"] = 16] = "SEARCH";
27303
+ StorefrontEventPageType[StorefrontEventPageType["NOT_FOUND"] = 17] = "NOT_FOUND";
27304
+ StorefrontEventPageType[StorefrontEventPageType["BLOG"] = 18] = "BLOG";
27305
+ StorefrontEventPageType[StorefrontEventPageType["BLOG_INDEX"] = 19] = "BLOG_INDEX";
27306
+ StorefrontEventPageType[StorefrontEventPageType["BLOG_CATEGORY"] = 20] = "BLOG_CATEGORY";
27307
+ StorefrontEventPageType[StorefrontEventPageType["CHECKOUT"] = 21] = "CHECKOUT";
27308
+ })(StorefrontEventPageType || (StorefrontEventPageType = {}));
27309
+ var ANALYTICS_URL = "https://0.myikas.dev/sendEvent";
27310
+ var IkasAnalytics = /** @class */ (function () {
27311
+ function IkasAnalytics() {
27312
+ }
27313
+ IkasAnalytics.createSessionId = function () {
27314
+ try {
27315
+ var idWithExpiry = {
27316
+ id: v4(),
27317
+ expiry: Date.now() + this.EXPIRY_LENGTH,
27318
+ };
27319
+ localStorage.setItem(this.SESSION_ID_KEY, JSON.stringify(idWithExpiry));
27320
+ this.sessionId = idWithExpiry.id;
27321
+ this.sessionStart();
27322
+ }
27323
+ catch (err) {
27324
+ console.error(err);
27325
+ }
27326
+ };
27327
+ IkasAnalytics.checkSessionId = function () {
27328
+ try {
27329
+ var existingSessionIdData = localStorage.getItem(this.SESSION_ID_KEY);
27330
+ if (existingSessionIdData) {
27331
+ var idWithExpiry = JSON.parse(existingSessionIdData);
27332
+ if (idWithExpiry.expiry < Date.now()) {
27333
+ this.createSessionId();
27334
+ }
27335
+ else {
27336
+ // Extend the duration of the sessionId
27337
+ idWithExpiry.expiry = Date.now() + this.EXPIRY_LENGTH;
27338
+ localStorage.setItem(this.SESSION_ID_KEY, JSON.stringify(idWithExpiry));
27339
+ this.sessionId = idWithExpiry.id;
27340
+ }
27341
+ }
27342
+ else {
27343
+ this.createSessionId();
27344
+ }
27345
+ }
27346
+ catch (err) {
27347
+ console.error(err);
27348
+ }
27349
+ };
27350
+ IkasAnalytics.checkVisitorId = function () {
27351
+ try {
27352
+ var existingVisitorId = localStorage.getItem(this.VISITOR_ID_KEY);
27353
+ if (existingVisitorId) {
27354
+ this.visitorId = existingVisitorId;
27355
+ }
27356
+ else {
27357
+ this.visitorId = v4();
27358
+ localStorage.setItem(this.VISITOR_ID_KEY, this.visitorId);
27359
+ }
27360
+ }
27361
+ catch (err) {
27362
+ console.error(err);
27363
+ }
27364
+ };
27365
+ IkasAnalytics.getPageType = function (pageType) {
27366
+ switch (pageType) {
27367
+ case exports.IkasThemePageType.INDEX:
27368
+ return StorefrontEventPageType.INDEX;
27369
+ case exports.IkasThemePageType.CATEGORY:
27370
+ return StorefrontEventPageType.CATEGORY;
27371
+ case exports.IkasThemePageType.BRAND:
27372
+ return StorefrontEventPageType.BRAND;
27373
+ case exports.IkasThemePageType.PRODUCT:
27374
+ return StorefrontEventPageType.PRODUCT;
27375
+ case exports.IkasThemePageType.CUSTOM:
27376
+ return StorefrontEventPageType.CUSTOM;
27377
+ case exports.IkasThemePageType.ACCOUNT:
27378
+ return StorefrontEventPageType.ACCOUNT;
27379
+ case exports.IkasThemePageType.ADDRESSES:
27380
+ return StorefrontEventPageType.ADDRESSES;
27381
+ case exports.IkasThemePageType.ORDERS:
27382
+ return StorefrontEventPageType.ORDERS;
27383
+ case exports.IkasThemePageType.ORDER_DETAIL:
27384
+ return StorefrontEventPageType.ORDER_DETAIL;
27385
+ case exports.IkasThemePageType.LOGIN:
27386
+ return StorefrontEventPageType.LOGIN;
27387
+ case exports.IkasThemePageType.REGISTER:
27388
+ return StorefrontEventPageType.REGISTER;
27389
+ case exports.IkasThemePageType.FORGOT_PASSWORD:
27390
+ return StorefrontEventPageType.FORGOT_PASSWORD;
27391
+ case exports.IkasThemePageType.RECOVER_PASSWORD:
27392
+ return StorefrontEventPageType.RECOVER_PASSWORD;
27393
+ case exports.IkasThemePageType.CART:
27394
+ return StorefrontEventPageType.CART;
27395
+ case exports.IkasThemePageType.FAVORITE_PRODUCTS:
27396
+ return StorefrontEventPageType.FAVORITE_PRODUCTS;
27397
+ case exports.IkasThemePageType.SEARCH:
27398
+ return StorefrontEventPageType.SEARCH;
27399
+ case exports.IkasThemePageType.NOT_FOUND:
27400
+ return StorefrontEventPageType.NOT_FOUND;
27401
+ case exports.IkasThemePageType.BLOG:
27402
+ return StorefrontEventPageType.BLOG;
27403
+ case exports.IkasThemePageType.BLOG_INDEX:
27404
+ return StorefrontEventPageType.BLOG_INDEX;
27405
+ case exports.IkasThemePageType.BLOG_CATEGORY:
27406
+ return StorefrontEventPageType.BLOG_CATEGORY;
27407
+ case exports.IkasThemePageType.CHECKOUT:
27408
+ return StorefrontEventPageType.CHECKOUT;
27409
+ }
27410
+ };
27411
+ IkasAnalytics.getCustomerData = function () {
27412
+ var customer = IkasStorefrontConfig.store.customerStore.customer;
27413
+ return {
27414
+ id: customer === null || customer === void 0 ? void 0 : customer.id,
27415
+ e: customer === null || customer === void 0 ? void 0 : customer.email,
27416
+ c: IkasStorefrontConfig.store.customerStore.customerConsentGranted,
27417
+ };
27418
+ };
27419
+ IkasAnalytics.getCommonEventData = function () {
27420
+ return {
27421
+ u: window.location.href,
27422
+ r: document.referrer,
27423
+ pt: IkasStorefrontConfig.store.currentPageType
27424
+ ? this.getPageType(IkasStorefrontConfig.store.currentPageType)
27425
+ : undefined,
27426
+ };
27427
+ };
27428
+ IkasAnalytics.sendEvents = function (events) {
27429
+ var _a;
27430
+ return __awaiter(this, void 0, void 0, function () {
27431
+ var cloudFrontEvent, err_1;
27432
+ return __generator(this, function (_b) {
27433
+ switch (_b.label) {
27434
+ case 0:
27435
+ _b.trys.push([0, 2, , 3]);
27436
+ this.checkSessionId();
27437
+ this.checkVisitorId();
27438
+ cloudFrontEvent = {
27439
+ e: events,
27440
+ scid: IkasStorefrontConfig.salesChannelId,
27441
+ sfid: IkasStorefrontConfig.storefrontId,
27442
+ sid: this.sessionId,
27443
+ vid: this.visitorId,
27444
+ cid: (_a = IkasStorefrontConfig.store.customerStore.customer) === null || _a === void 0 ? void 0 : _a.id,
27445
+ };
27446
+ return [4 /*yield*/, fetch(ANALYTICS_URL, {
27447
+ method: "POST",
27448
+ body: JSON.stringify(cloudFrontEvent),
27449
+ headers: {
27450
+ "Content-Type": "application/json",
27451
+ "x-api-key": IkasStorefrontConfig.config.apiKey,
27452
+ },
27453
+ })];
27454
+ case 1:
27455
+ _b.sent();
27456
+ return [3 /*break*/, 3];
27457
+ case 2:
27458
+ err_1 = _b.sent();
27459
+ console.error(err_1);
27460
+ return [3 /*break*/, 3];
27461
+ case 3: return [2 /*return*/];
27462
+ }
27463
+ });
27464
+ });
27465
+ };
27466
+ // EVENTS
27467
+ IkasAnalytics.sessionStart = function () {
27468
+ return __awaiter(this, void 0, void 0, function () {
27469
+ var event;
27470
+ return __generator(this, function (_a) {
27471
+ switch (_a.label) {
27472
+ case 0:
27473
+ event = {
27474
+ t: StorefrontEventType.SESSION_START,
27475
+ ts: Date.now(),
27476
+ d: __assign({}, this.getCommonEventData()),
27477
+ };
27478
+ return [4 /*yield*/, this.sendEvents([event])];
27479
+ case 1:
27480
+ _a.sent();
27481
+ return [2 /*return*/];
27482
+ }
27483
+ });
27484
+ });
27485
+ };
27486
+ IkasAnalytics.pageView = function (pageType) {
27487
+ return __awaiter(this, void 0, void 0, function () {
27488
+ var event;
27489
+ return __generator(this, function (_a) {
27490
+ switch (_a.label) {
27491
+ case 0:
27492
+ event = {
27493
+ t: StorefrontEventType.PAGE_VIEW,
27494
+ ts: Date.now(),
27495
+ d: __assign(__assign({}, this.getCommonEventData()), { pt: this.getPageType(pageType) }),
27496
+ };
27497
+ return [4 /*yield*/, this.sendEvents([event])];
27498
+ case 1:
27499
+ _a.sent();
27500
+ return [2 /*return*/];
27501
+ }
27502
+ });
27503
+ });
27504
+ };
27505
+ IkasAnalytics.productView = function (productDetail) {
27506
+ return __awaiter(this, void 0, void 0, function () {
27507
+ var event;
27508
+ return __generator(this, function (_a) {
27509
+ switch (_a.label) {
27510
+ case 0:
27511
+ event = {
27512
+ t: StorefrontEventType.PRODUCT_VIEW,
27513
+ ts: Date.now(),
27514
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27515
+ pr: {
27516
+ id: productDetail.product.id,
27517
+ vid: productDetail.selectedVariant.id,
27518
+ },
27519
+ } }),
27520
+ };
27521
+ return [4 /*yield*/, this.sendEvents([event])];
27522
+ case 1:
27523
+ _a.sent();
27524
+ return [2 /*return*/];
27525
+ }
27526
+ });
27527
+ });
27528
+ };
27529
+ IkasAnalytics.addToCart = function (item, quantity, cart) {
27530
+ return __awaiter(this, void 0, void 0, function () {
27531
+ var event;
27532
+ return __generator(this, function (_a) {
27533
+ switch (_a.label) {
27534
+ case 0:
27535
+ event = {
27536
+ t: StorefrontEventType.ADD_TO_CART,
27537
+ ts: Date.now(),
27538
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27539
+ crt: {
27540
+ id: cart.id,
27541
+ c: cart.itemCount,
27542
+ },
27543
+ crtItm: {
27544
+ id: item.id,
27545
+ c: quantity,
27546
+ },
27547
+ } }),
27548
+ };
27549
+ return [4 /*yield*/, this.sendEvents([event])];
27550
+ case 1:
27551
+ _a.sent();
27552
+ return [2 /*return*/];
27553
+ }
27554
+ });
27555
+ });
27556
+ };
27557
+ IkasAnalytics.viewCart = function (cart) {
27558
+ return __awaiter(this, void 0, void 0, function () {
27559
+ var event;
27560
+ return __generator(this, function (_a) {
27561
+ switch (_a.label) {
27562
+ case 0:
27563
+ event = {
27564
+ t: StorefrontEventType.VIEW_CART,
27565
+ ts: Date.now(),
27566
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27567
+ crt: {
27568
+ id: cart.id,
27569
+ c: cart.itemCount,
27570
+ },
27571
+ } }),
27572
+ };
27573
+ return [4 /*yield*/, this.sendEvents([event])];
27574
+ case 1:
27575
+ _a.sent();
27576
+ return [2 /*return*/];
27577
+ }
27578
+ });
27579
+ });
27580
+ };
27581
+ IkasAnalytics.orderSuccess = function (checkout) {
27582
+ return __awaiter(this, void 0, void 0, function () {
27583
+ var event;
27584
+ return __generator(this, function (_a) {
27585
+ switch (_a.label) {
27586
+ case 0:
27587
+ event = {
27588
+ t: StorefrontEventType.ORDER_SUCCESS,
27589
+ ts: Date.now(),
27590
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27591
+ chk: {
27592
+ id: checkout.id,
27593
+ s: "success",
27594
+ },
27595
+ } }),
27596
+ };
27597
+ return [4 /*yield*/, this.sendEvents([event])];
27598
+ case 1:
27599
+ _a.sent();
27600
+ return [2 /*return*/];
27601
+ }
27602
+ });
27603
+ });
27604
+ };
27605
+ IkasAnalytics.beginCheckout = function (checkout) {
27606
+ return __awaiter(this, void 0, void 0, function () {
27607
+ var event;
27608
+ return __generator(this, function (_a) {
27609
+ switch (_a.label) {
27610
+ case 0:
27611
+ event = {
27612
+ t: StorefrontEventType.BEGIN_CHECKOUT,
27613
+ ts: Date.now(),
27614
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27615
+ chk: {
27616
+ id: checkout.id,
27617
+ },
27618
+ } }),
27619
+ };
27620
+ return [4 /*yield*/, this.sendEvents([event])];
27621
+ case 1:
27622
+ _a.sent();
27623
+ return [2 /*return*/];
27624
+ }
27625
+ });
27626
+ });
27627
+ };
27628
+ IkasAnalytics.checkoutStep = function (checkout, step) {
27629
+ return __awaiter(this, void 0, void 0, function () {
27630
+ var event;
27631
+ return __generator(this, function (_a) {
27632
+ switch (_a.label) {
27633
+ case 0:
27634
+ event = {
27635
+ t: StorefrontEventType.CHECKOUT_STEP,
27636
+ ts: Date.now(),
27637
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27638
+ chk: {
27639
+ id: checkout.id,
27640
+ s: step,
27641
+ },
27642
+ } }),
27643
+ };
27644
+ return [4 /*yield*/, this.sendEvents([event])];
27645
+ case 1:
27646
+ _a.sent();
27647
+ return [2 /*return*/];
27648
+ }
27649
+ });
27650
+ });
27651
+ };
27652
+ IkasAnalytics.customerRegister = function () {
27653
+ return __awaiter(this, void 0, void 0, function () {
27654
+ var event;
27655
+ return __generator(this, function (_a) {
27656
+ switch (_a.label) {
27657
+ case 0:
27658
+ event = {
27659
+ t: StorefrontEventType.CUSTOMER_REGISTER,
27660
+ ts: Date.now(),
27661
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27662
+ cst: this.getCustomerData(),
27663
+ } }),
27664
+ };
27665
+ return [4 /*yield*/, this.sendEvents([event])];
27666
+ case 1:
27667
+ _a.sent();
27668
+ return [2 /*return*/];
27669
+ }
27670
+ });
27671
+ });
27672
+ };
27673
+ IkasAnalytics.customerLogin = function () {
27674
+ return __awaiter(this, void 0, void 0, function () {
27675
+ var event;
27676
+ return __generator(this, function (_a) {
27677
+ switch (_a.label) {
27678
+ case 0:
27679
+ event = {
27680
+ t: StorefrontEventType.CUSTOMER_LOGIN,
27681
+ ts: Date.now(),
27682
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27683
+ cst: this.getCustomerData(),
27684
+ } }),
27685
+ };
27686
+ return [4 /*yield*/, this.sendEvents([event])];
27687
+ case 1:
27688
+ _a.sent();
27689
+ return [2 /*return*/];
27690
+ }
27691
+ });
27692
+ });
27693
+ };
27694
+ IkasAnalytics.customerVisit = function () {
27695
+ return __awaiter(this, void 0, void 0, function () {
27696
+ var event;
27697
+ return __generator(this, function (_a) {
27698
+ switch (_a.label) {
27699
+ case 0:
27700
+ event = {
27701
+ t: StorefrontEventType.CUSTOMER_VISIT,
27702
+ ts: Date.now(),
27703
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27704
+ cst: this.getCustomerData(),
27705
+ } }),
27706
+ };
27707
+ return [4 /*yield*/, this.sendEvents([event])];
27708
+ case 1:
27709
+ _a.sent();
27710
+ return [2 /*return*/];
27711
+ }
27712
+ });
27713
+ });
27714
+ };
27715
+ IkasAnalytics.viewBrand = function (brand) {
27716
+ return __awaiter(this, void 0, void 0, function () {
27717
+ var event;
27718
+ return __generator(this, function (_a) {
27719
+ switch (_a.label) {
27720
+ case 0:
27721
+ event = {
27722
+ t: StorefrontEventType.BRAND_VIEW,
27723
+ ts: Date.now(),
27724
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27725
+ cst: this.getCustomerData(),
27726
+ br: {
27727
+ id: brand.id,
27728
+ },
27729
+ } }),
27730
+ };
27731
+ return [4 /*yield*/, this.sendEvents([event])];
27732
+ case 1:
27733
+ _a.sent();
27734
+ return [2 /*return*/];
27735
+ }
27736
+ });
27737
+ });
27738
+ };
27739
+ IkasAnalytics.viewCategory = function (category) {
27740
+ return __awaiter(this, void 0, void 0, function () {
27741
+ var event;
27742
+ return __generator(this, function (_a) {
27743
+ switch (_a.label) {
27744
+ case 0:
27745
+ event = {
27746
+ t: StorefrontEventType.CATEGORY_VIEW,
27747
+ ts: Date.now(),
27748
+ d: __assign(__assign({}, this.getCommonEventData()), { d: {
27749
+ cst: this.getCustomerData(),
27750
+ ctg: {
27751
+ id: category.id,
27752
+ },
27753
+ } }),
27754
+ };
27755
+ return [4 /*yield*/, this.sendEvents([event])];
27756
+ case 1:
27757
+ _a.sent();
27758
+ return [2 /*return*/];
27759
+ }
27760
+ });
27761
+ });
27762
+ };
27763
+ IkasAnalytics.SESSION_ID_KEY = "ikas_session_id";
27764
+ IkasAnalytics.VISITOR_ID_KEY = "ikas_visitor_id";
27765
+ IkasAnalytics.EXPIRY_LENGTH = 1000 * 60 * 30; // ms - 30mins
27766
+ return IkasAnalytics;
27767
+ }());
27768
+
27211
27769
  var LS_BEGIN_CHECKOUT_KEY = "gtmBeginCheckout";
27212
27770
  var Analytics = /** @class */ (function () {
27213
27771
  function Analytics() {
@@ -27244,6 +27802,7 @@ var Analytics = /** @class */ (function () {
27244
27802
  case 1:
27245
27803
  customerInfo_1 = _a.sent();
27246
27804
  GoogleTagManager.pageView(url_1);
27805
+ IkasAnalytics.pageView(pageType);
27247
27806
  tryForEach(Analytics.subscribers, function (s) {
27248
27807
  s.callback({
27249
27808
  type: IkasEventType.PAGE_VIEW,
@@ -27268,6 +27827,7 @@ var Analytics = /** @class */ (function () {
27268
27827
  try {
27269
27828
  FacebookPixel.productView(productDetail);
27270
27829
  GoogleTagManager.productView(productDetail);
27830
+ IkasAnalytics.productView(productDetail);
27271
27831
  if (Analytics.subscribers.length) {
27272
27832
  var clone = cloneDeep_1(productDetail);
27273
27833
  var cloneProductDetail_1 = new IkasProductDetail(clone.product, clone.selectedVariantValues);
@@ -27289,6 +27849,7 @@ var Analytics = /** @class */ (function () {
27289
27849
  try {
27290
27850
  FacebookPixel.addToCart(item, quantity, eventId);
27291
27851
  GoogleTagManager.addToCart(item, quantity);
27852
+ IkasAnalytics.addToCart(item, quantity, cart);
27292
27853
  if (Analytics.subscribers.length) {
27293
27854
  var cloneItem_1 = cloneDeep_1(item);
27294
27855
  var cloneCart_1 = new IkasCart(cloneDeep_1(cart));
@@ -27338,6 +27899,7 @@ var Analytics = /** @class */ (function () {
27338
27899
  localStorage.setItem(LS_BEGIN_CHECKOUT_KEY, checkout.id);
27339
27900
  FacebookPixel.beginCheckout(checkout);
27340
27901
  GoogleTagManager.beginCheckout(checkout);
27902
+ IkasAnalytics.beginCheckout(checkout);
27341
27903
  if (Analytics.subscribers.length) {
27342
27904
  var cloneCheckout_1 = new IkasCheckout(cloneDeep_1(checkout));
27343
27905
  tryForEach(Analytics.subscribers, function (s) {
@@ -27359,6 +27921,7 @@ var Analytics = /** @class */ (function () {
27359
27921
  localStorage.removeItem(LS_BEGIN_CHECKOUT_KEY);
27360
27922
  FacebookPixel.purchase(checkout, transaction.id || "");
27361
27923
  GoogleTagManager.purchase(checkout, transaction.id || "");
27924
+ IkasAnalytics.orderSuccess(checkout);
27362
27925
  if (Analytics.subscribers.length) {
27363
27926
  var cloneCheckout_2 = new IkasCheckout(cloneDeep_1(checkout));
27364
27927
  var cloneTransaction_1 = cloneDeep_1(transaction);
@@ -27380,6 +27943,7 @@ var Analytics = /** @class */ (function () {
27380
27943
  Analytics.checkoutStep = function (checkout, step) {
27381
27944
  try {
27382
27945
  GoogleTagManager.checkoutStep(checkout, step);
27946
+ IkasAnalytics.checkoutStep(checkout, step);
27383
27947
  if (Analytics.subscribers.length) {
27384
27948
  var cloneCheckout_3 = new IkasCheckout(cloneDeep_1(checkout));
27385
27949
  tryForEach(Analytics.subscribers, function (s) {
@@ -27442,10 +28006,11 @@ var Analytics = /** @class */ (function () {
27442
28006
  console.error(err);
27443
28007
  }
27444
28008
  };
27445
- Analytics.completeRegistration = function (email) {
28009
+ Analytics.completeRegistration = function (email, customerId) {
27446
28010
  try {
27447
28011
  FacebookPixel.completeRegistration();
27448
28012
  GoogleTagManager.completeRegistration();
28013
+ IkasAnalytics.customerRegister();
27449
28014
  if (Analytics.subscribers.length) {
27450
28015
  tryForEach(Analytics.subscribers, function (s) {
27451
28016
  s.callback({
@@ -27474,6 +28039,7 @@ var Analytics = /** @class */ (function () {
27474
28039
  if (!customerInfo_2 || !customerInfo_2.email)
27475
28040
  return [2 /*return*/];
27476
28041
  GoogleTagManager.customerLogin(customerInfo_2.email);
28042
+ IkasAnalytics.customerLogin();
27477
28043
  if (Analytics.subscribers.length) {
27478
28044
  tryForEach(Analytics.subscribers, function (s) {
27479
28045
  s.callback({
@@ -27527,6 +28093,7 @@ var Analytics = /** @class */ (function () {
27527
28093
  if (!customerInfo_3 || !customerInfo_3.email)
27528
28094
  return [2 /*return*/];
27529
28095
  GoogleTagManager.customerVisit(customerInfo_3.email);
28096
+ IkasAnalytics.customerVisit();
27530
28097
  if (Analytics.subscribers.length) {
27531
28098
  tryForEach(Analytics.subscribers, function (s) {
27532
28099
  s.callback({
@@ -27551,6 +28118,7 @@ var Analytics = /** @class */ (function () {
27551
28118
  try {
27552
28119
  if (cart) {
27553
28120
  FacebookPixel.viewCart(cart);
28121
+ IkasAnalytics.viewCart(cart);
27554
28122
  if (Analytics.subscribers.length) {
27555
28123
  var cloneCart_3 = new IkasCart(cloneDeep_1(cart));
27556
28124
  tryForEach(Analytics.subscribers, function (s) {
@@ -27572,6 +28140,7 @@ var Analytics = /** @class */ (function () {
27572
28140
  try {
27573
28141
  FacebookPixel.viewCategory(categoryPath);
27574
28142
  GoogleTagManager.viewCategory(category, categoryPath);
28143
+ IkasAnalytics.viewCategory(category);
27575
28144
  if (Analytics.subscribers.length) {
27576
28145
  var cloneCategory_1 = new IkasCategory(cloneDeep_1(category));
27577
28146
  tryForEach(Analytics.subscribers, function (s) {
@@ -27589,6 +28158,25 @@ var Analytics = /** @class */ (function () {
27589
28158
  console.error(err);
27590
28159
  }
27591
28160
  };
28161
+ Analytics.viewBrand = function (brand) {
28162
+ try {
28163
+ IkasAnalytics.viewBrand(brand);
28164
+ if (Analytics.subscribers.length) {
28165
+ var cloneBrand_1 = new IkasBrand(cloneDeep_1(brand));
28166
+ tryForEach(Analytics.subscribers, function (s) {
28167
+ s.callback({
28168
+ type: IkasEventType.VIEW_BRAND,
28169
+ data: {
28170
+ brand: cloneBrand_1,
28171
+ },
28172
+ });
28173
+ });
28174
+ }
28175
+ }
28176
+ catch (err) {
28177
+ console.error(err);
28178
+ }
28179
+ };
27592
28180
  Analytics.viewSearchResults = function (searchKeyword, productDetails) {
27593
28181
  try {
27594
28182
  if (Analytics.subscribers.length) {
@@ -35771,7 +36359,7 @@ var IkasProductDetail = /** @class */ (function () {
35771
36359
  });
35772
36360
  Object.defineProperty(IkasProductDetail.prototype, "hasStock", {
35773
36361
  get: function () {
35774
- return this.product.variants.some(function (v) { return v.stock > 0; });
36362
+ return this.product.hasStock;
35775
36363
  },
35776
36364
  enumerable: false,
35777
36365
  configurable: true
@@ -35817,6 +36405,42 @@ var IkasProductDetail = /** @class */ (function () {
35817
36405
  enumerable: false,
35818
36406
  configurable: true
35819
36407
  });
36408
+ Object.defineProperty(IkasProductDetail.prototype, "isCustomerReviewEnabled", {
36409
+ get: function () {
36410
+ return (!!IkasStorefrontConfig.customerReviewSettings &&
36411
+ !IkasStorefrontConfig.customerReviewSettings.customerPurchaseRequired);
36412
+ },
36413
+ enumerable: false,
36414
+ configurable: true
36415
+ });
36416
+ Object.defineProperty(IkasProductDetail.prototype, "isCustomerReviewLoginRequired", {
36417
+ get: function () {
36418
+ if (!IkasStorefrontConfig.customerReviewSettings)
36419
+ return true;
36420
+ return IkasStorefrontConfig.customerReviewSettings.customerLoginRequired;
36421
+ },
36422
+ enumerable: false,
36423
+ configurable: true
36424
+ });
36425
+ IkasProductDetail.prototype.getCustomerReviews = function () {
36426
+ return __awaiter(this, void 0, void 0, function () {
36427
+ var customerReviews;
36428
+ return __generator(this, function (_a) {
36429
+ switch (_a.label) {
36430
+ case 0:
36431
+ customerReviews = new IkasCustomerReviewList({
36432
+ productId: this.product.id,
36433
+ });
36434
+ //@ts-ignore
36435
+ return [4 /*yield*/, customerReviews.getInitial()];
36436
+ case 1:
36437
+ //@ts-ignore
36438
+ _a.sent();
36439
+ return [2 /*return*/, customerReviews];
36440
+ }
36441
+ });
36442
+ });
36443
+ };
35820
36444
  IkasProductDetail.prototype.selectVariantValue = function (variantValue) {
35821
36445
  var _this = this;
35822
36446
  var _a;
@@ -36909,6 +37533,23 @@ var ProductFilterTypeEnum;
36909
37533
  ProductFilterTypeEnum["TAG"] = "TAG";
36910
37534
  ProductFilterTypeEnum["VARIANT_TYPE"] = "VARIANT_TYPE";
36911
37535
  })(ProductFilterTypeEnum || (ProductFilterTypeEnum = {}));
37536
+ var ProductOptionSelectTypeEnum;
37537
+ (function (ProductOptionSelectTypeEnum) {
37538
+ ProductOptionSelectTypeEnum["BOX"] = "BOX";
37539
+ ProductOptionSelectTypeEnum["SELECT"] = "SELECT";
37540
+ ProductOptionSelectTypeEnum["SWATCH"] = "SWATCH";
37541
+ })(ProductOptionSelectTypeEnum || (ProductOptionSelectTypeEnum = {}));
37542
+ var ProductOptionTypeEnum;
37543
+ (function (ProductOptionTypeEnum) {
37544
+ ProductOptionTypeEnum["CHECKBOX"] = "CHECKBOX";
37545
+ ProductOptionTypeEnum["CHOICE"] = "CHOICE";
37546
+ ProductOptionTypeEnum["COLOR_PICKER"] = "COLOR_PICKER";
37547
+ ProductOptionTypeEnum["DATE_PICKER"] = "DATE_PICKER";
37548
+ ProductOptionTypeEnum["FILE"] = "FILE";
37549
+ ProductOptionTypeEnum["IMAGE"] = "IMAGE";
37550
+ ProductOptionTypeEnum["TEXT"] = "TEXT";
37551
+ ProductOptionTypeEnum["TEXT_AREA"] = "TEXT_AREA";
37552
+ })(ProductOptionTypeEnum || (ProductOptionTypeEnum = {}));
36912
37553
  var ProductSearchShowStockOptionEnum;
36913
37554
  (function (ProductSearchShowStockOptionEnum) {
36914
37555
  ProductSearchShowStockOptionEnum["HIDE_OUT_OF_STOCK"] = "HIDE_OUT_OF_STOCK";
@@ -38052,6 +38693,230 @@ var IkasAttributeList = /** @class */ (function () {
38052
38693
  return IkasAttributeList;
38053
38694
  }());
38054
38695
 
38696
+ var IkasCustomerReviewList = /** @class */ (function () {
38697
+ function IkasCustomerReviewList(data) {
38698
+ var _this = this;
38699
+ this._initialized = false;
38700
+ this._minPage = null;
38701
+ this._isLoading = false;
38702
+ // Used by the provider
38703
+ this.getInitial = function () { return __awaiter(_this, void 0, void 0, function () {
38704
+ var response, err_1;
38705
+ return __generator(this, function (_a) {
38706
+ switch (_a.label) {
38707
+ case 0:
38708
+ if (this._isLoading)
38709
+ return [2 /*return*/];
38710
+ this._isLoading = true;
38711
+ _a.label = 1;
38712
+ case 1:
38713
+ _a.trys.push([1, 3, 4, 5]);
38714
+ return [4 /*yield*/, this.listCustomerReviews(this.page, this.limit)];
38715
+ case 2:
38716
+ response = _a.sent();
38717
+ this.data = response.data;
38718
+ this._count = response.count;
38719
+ this._initialized = true;
38720
+ this._minPage = this.page;
38721
+ return [3 /*break*/, 5];
38722
+ case 3:
38723
+ err_1 = _a.sent();
38724
+ console.log(err_1);
38725
+ return [3 /*break*/, 5];
38726
+ case 4:
38727
+ this._isLoading = false;
38728
+ return [7 /*endfinally*/];
38729
+ case 5: return [2 /*return*/];
38730
+ }
38731
+ });
38732
+ }); };
38733
+ this.getPrev = function () { return __awaiter(_this, void 0, void 0, function () {
38734
+ var minPage, response, err_2;
38735
+ return __generator(this, function (_a) {
38736
+ switch (_a.label) {
38737
+ case 0:
38738
+ if (this._isLoading || !this.hasPrev)
38739
+ return [2 /*return*/];
38740
+ this._isLoading = true;
38741
+ _a.label = 1;
38742
+ case 1:
38743
+ _a.trys.push([1, 3, 4, 5]);
38744
+ minPage = this._minPage - 1;
38745
+ return [4 /*yield*/, this.listCustomerReviews(minPage, this.limit)];
38746
+ case 2:
38747
+ response = _a.sent();
38748
+ this.data = response.data.concat(this.data);
38749
+ this._count = response.count;
38750
+ this._minPage = minPage;
38751
+ return [3 /*break*/, 5];
38752
+ case 3:
38753
+ err_2 = _a.sent();
38754
+ console.log(err_2);
38755
+ return [3 /*break*/, 5];
38756
+ case 4:
38757
+ this._isLoading = false;
38758
+ return [7 /*endfinally*/];
38759
+ case 5: return [2 /*return*/];
38760
+ }
38761
+ });
38762
+ }); };
38763
+ this.getNext = function () { return __awaiter(_this, void 0, void 0, function () {
38764
+ var response, err_3;
38765
+ return __generator(this, function (_a) {
38766
+ switch (_a.label) {
38767
+ case 0:
38768
+ if (this._isLoading || !this.hasNext)
38769
+ return [2 /*return*/];
38770
+ this._isLoading = true;
38771
+ _a.label = 1;
38772
+ case 1:
38773
+ _a.trys.push([1, 3, 4, 5]);
38774
+ return [4 /*yield*/, this.listCustomerReviews(this.page + 1, this.limit)];
38775
+ case 2:
38776
+ response = _a.sent();
38777
+ this.data = this.data.concat(response.data);
38778
+ this._count = response.count;
38779
+ this._page = this.page + 1;
38780
+ return [3 /*break*/, 5];
38781
+ case 3:
38782
+ err_3 = _a.sent();
38783
+ console.log(err_3);
38784
+ return [3 /*break*/, 5];
38785
+ case 4:
38786
+ this._isLoading = false;
38787
+ return [7 /*endfinally*/];
38788
+ case 5: return [2 /*return*/];
38789
+ }
38790
+ });
38791
+ }); };
38792
+ this.getPage = function (page) { return __awaiter(_this, void 0, void 0, function () {
38793
+ var response, err_4;
38794
+ return __generator(this, function (_a) {
38795
+ switch (_a.label) {
38796
+ case 0:
38797
+ if (this._isLoading)
38798
+ return [2 /*return*/];
38799
+ this._isLoading = true;
38800
+ _a.label = 1;
38801
+ case 1:
38802
+ _a.trys.push([1, 3, 4, 5]);
38803
+ return [4 /*yield*/, this.listCustomerReviews(page, this.limit)];
38804
+ case 2:
38805
+ response = _a.sent();
38806
+ this.data = response.data;
38807
+ this._count = response.count;
38808
+ this._page = page;
38809
+ this._minPage = page;
38810
+ return [3 /*break*/, 5];
38811
+ case 3:
38812
+ err_4 = _a.sent();
38813
+ console.log(err_4);
38814
+ return [3 /*break*/, 5];
38815
+ case 4:
38816
+ this._isLoading = false;
38817
+ return [7 /*endfinally*/];
38818
+ case 5: return [2 /*return*/];
38819
+ }
38820
+ });
38821
+ }); };
38822
+ this.data = data.data
38823
+ ? data.data.map(function (b) { return new IkasCustomerReview(b); })
38824
+ : [];
38825
+ this._limit = data.limit || 5;
38826
+ this._page = data.page || 1;
38827
+ this._count = data.count || 0;
38828
+ this._initialized = data.initialized || false;
38829
+ this._minPage = data.minPage;
38830
+ this._productId = data.productId;
38831
+ mobx.makeAutoObservable(this);
38832
+ }
38833
+ Object.defineProperty(IkasCustomerReviewList.prototype, "limit", {
38834
+ get: function () {
38835
+ return this._limit;
38836
+ },
38837
+ enumerable: false,
38838
+ configurable: true
38839
+ });
38840
+ Object.defineProperty(IkasCustomerReviewList.prototype, "page", {
38841
+ get: function () {
38842
+ return this._page;
38843
+ },
38844
+ enumerable: false,
38845
+ configurable: true
38846
+ });
38847
+ Object.defineProperty(IkasCustomerReviewList.prototype, "count", {
38848
+ get: function () {
38849
+ return this._count;
38850
+ },
38851
+ enumerable: false,
38852
+ configurable: true
38853
+ });
38854
+ Object.defineProperty(IkasCustomerReviewList.prototype, "pageCount", {
38855
+ get: function () {
38856
+ return Math.ceil(this._count / this._limit);
38857
+ },
38858
+ enumerable: false,
38859
+ configurable: true
38860
+ });
38861
+ Object.defineProperty(IkasCustomerReviewList.prototype, "isInitialized", {
38862
+ get: function () {
38863
+ return this._initialized;
38864
+ },
38865
+ enumerable: false,
38866
+ configurable: true
38867
+ });
38868
+ Object.defineProperty(IkasCustomerReviewList.prototype, "hasPrev", {
38869
+ get: function () {
38870
+ if (!this._minPage)
38871
+ return false;
38872
+ return this._minPage > 1;
38873
+ },
38874
+ enumerable: false,
38875
+ configurable: true
38876
+ });
38877
+ Object.defineProperty(IkasCustomerReviewList.prototype, "hasNext", {
38878
+ get: function () {
38879
+ return this.page * this.limit < this.count;
38880
+ },
38881
+ enumerable: false,
38882
+ configurable: true
38883
+ });
38884
+ Object.defineProperty(IkasCustomerReviewList.prototype, "isLoading", {
38885
+ get: function () {
38886
+ return this._isLoading;
38887
+ },
38888
+ enumerable: false,
38889
+ configurable: true
38890
+ });
38891
+ IkasCustomerReviewList.prototype.listCustomerReviews = function (page, limit) {
38892
+ return __awaiter(this, void 0, void 0, function () {
38893
+ return __generator(this, function (_a) {
38894
+ switch (_a.label) {
38895
+ case 0: return [4 /*yield*/, IkasCustomerReviewAPI.listCustomerReviews({
38896
+ productId: this._productId,
38897
+ salesChannelId: IkasStorefrontConfig.salesChannelId || "",
38898
+ page: page,
38899
+ limit: limit,
38900
+ })];
38901
+ case 1: return [2 /*return*/, _a.sent()];
38902
+ }
38903
+ });
38904
+ });
38905
+ };
38906
+ IkasCustomerReviewList.prototype.toJSON = function () {
38907
+ return {
38908
+ data: this.data,
38909
+ limit: this._limit,
38910
+ page: this._page,
38911
+ count: this._count,
38912
+ initialized: this._initialized,
38913
+ minPage: this._minPage,
38914
+ productId: this._productId,
38915
+ };
38916
+ };
38917
+ return IkasCustomerReviewList;
38918
+ }());
38919
+
38055
38920
  var Validator = /** @class */ (function () {
38056
38921
  function Validator(model, rules) {
38057
38922
  var _this = this;
@@ -39215,32 +40080,33 @@ var RegisterForm = /** @class */ (function () {
39215
40080
  return this.validator.validateAll();
39216
40081
  };
39217
40082
  RegisterForm.prototype.register = function () {
40083
+ var _a;
39218
40084
  return __awaiter(this, void 0, void 0, function () {
39219
40085
  var response, hasFormError, isRegisterSuccess;
39220
- return __generator(this, function (_b) {
39221
- switch (_b.label) {
40086
+ return __generator(this, function (_c) {
40087
+ switch (_c.label) {
39222
40088
  case 0:
39223
40089
  response = { isFormError: false, isSuccess: false };
39224
40090
  return [4 /*yield*/, this.validateAll()];
39225
40091
  case 1:
39226
- hasFormError = _b.sent();
40092
+ hasFormError = _c.sent();
39227
40093
  if (hasFormError) {
39228
40094
  response.isFormError = true;
39229
40095
  return [2 /*return*/, response];
39230
40096
  }
39231
- _b.label = 2;
40097
+ _c.label = 2;
39232
40098
  case 2:
39233
- _b.trys.push([2, 4, , 5]);
40099
+ _c.trys.push([2, 4, , 5]);
39234
40100
  return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password, this.model.isMarketingAccepted)];
39235
40101
  case 3:
39236
- isRegisterSuccess = _b.sent();
40102
+ isRegisterSuccess = _c.sent();
39237
40103
  if (isRegisterSuccess) {
39238
40104
  response.isSuccess = true;
39239
- Analytics.completeRegistration(this.model.email);
40105
+ Analytics.completeRegistration(this.model.email, (_a = this.store.customerStore.customer) === null || _a === void 0 ? void 0 : _a.id);
39240
40106
  }
39241
40107
  return [2 /*return*/, response];
39242
40108
  case 4:
39243
- _b.sent();
40109
+ _c.sent();
39244
40110
  return [2 /*return*/, response];
39245
40111
  case 5: return [2 /*return*/];
39246
40112
  }
@@ -39855,6 +40721,139 @@ var AccountInfoForm = /** @class */ (function () {
39855
40721
  return AccountInfoForm;
39856
40722
  }());
39857
40723
 
40724
+ var CustomerReviewForm = /** @class */ (function () {
40725
+ function CustomerReviewForm(props) {
40726
+ var _this = this;
40727
+ this.model = {
40728
+ title: "",
40729
+ comment: "",
40730
+ star: 0,
40731
+ };
40732
+ this.onTitleChange = function (value) {
40733
+ _this.title = value;
40734
+ };
40735
+ this.onCommentChange = function (value) {
40736
+ _this.comment = value;
40737
+ };
40738
+ this.onStarChange = function (value) {
40739
+ _this.star = value;
40740
+ };
40741
+ mobx.makeObservable(this, {
40742
+ starErrorMessage: mobx.computed,
40743
+ hasError: mobx.computed,
40744
+ model: mobx.observable,
40745
+ validateAll: mobx.action,
40746
+ submit: mobx.action,
40747
+ });
40748
+ this.productId = props.productId;
40749
+ this.store = props.store;
40750
+ this.validator = new Validator(this.model, [
40751
+ new RequiredRule({
40752
+ fieldKey: "star",
40753
+ valuePath: "star",
40754
+ message: props.message.starRule,
40755
+ }),
40756
+ new MinRule({
40757
+ fieldKey: "star",
40758
+ valuePath: "star",
40759
+ minValue: 1,
40760
+ message: props.message.starRule,
40761
+ }),
40762
+ new MaxRule({
40763
+ fieldKey: "star",
40764
+ valuePath: "star",
40765
+ maxValue: 5,
40766
+ message: props.message.starRule,
40767
+ }),
40768
+ ]);
40769
+ }
40770
+ Object.defineProperty(CustomerReviewForm.prototype, "title", {
40771
+ get: function () {
40772
+ return this.model.title;
40773
+ },
40774
+ set: function (value) {
40775
+ this.model.title = value;
40776
+ },
40777
+ enumerable: false,
40778
+ configurable: true
40779
+ });
40780
+ Object.defineProperty(CustomerReviewForm.prototype, "comment", {
40781
+ get: function () {
40782
+ return this.model.comment;
40783
+ },
40784
+ set: function (value) {
40785
+ this.model.comment = value;
40786
+ },
40787
+ enumerable: false,
40788
+ configurable: true
40789
+ });
40790
+ Object.defineProperty(CustomerReviewForm.prototype, "star", {
40791
+ get: function () {
40792
+ return this.model.star;
40793
+ },
40794
+ set: function (value) {
40795
+ this.model.star = value;
40796
+ },
40797
+ enumerable: false,
40798
+ configurable: true
40799
+ });
40800
+ Object.defineProperty(CustomerReviewForm.prototype, "hasError", {
40801
+ get: function () {
40802
+ return this.validator.hasError;
40803
+ },
40804
+ enumerable: false,
40805
+ configurable: true
40806
+ });
40807
+ Object.defineProperty(CustomerReviewForm.prototype, "starErrorMessage", {
40808
+ get: function () {
40809
+ return this.validator.results.star.errorMessage;
40810
+ },
40811
+ enumerable: false,
40812
+ configurable: true
40813
+ });
40814
+ CustomerReviewForm.prototype.validateAll = function () {
40815
+ return this.validator.validateAll();
40816
+ };
40817
+ CustomerReviewForm.prototype.submit = function () {
40818
+ return __awaiter(this, void 0, void 0, function () {
40819
+ var response, hasFormError, isContactFormSuccess;
40820
+ return __generator(this, function (_b) {
40821
+ switch (_b.label) {
40822
+ case 0:
40823
+ response = { isFormError: false, isSuccess: false };
40824
+ return [4 /*yield*/, this.validateAll()];
40825
+ case 1:
40826
+ hasFormError = _b.sent();
40827
+ if (hasFormError) {
40828
+ response.isFormError = true;
40829
+ return [2 /*return*/, response];
40830
+ }
40831
+ _b.label = 2;
40832
+ case 2:
40833
+ _b.trys.push([2, 4, , 5]);
40834
+ return [4 /*yield*/, this.store.customerStore.sendReview({
40835
+ title: this.model.title,
40836
+ comment: this.model.comment,
40837
+ star: this.model.star,
40838
+ productId: this.productId,
40839
+ })];
40840
+ case 3:
40841
+ isContactFormSuccess = _b.sent();
40842
+ if (isContactFormSuccess) {
40843
+ response.isSuccess = true;
40844
+ }
40845
+ return [2 /*return*/, response];
40846
+ case 4:
40847
+ _b.sent();
40848
+ return [2 /*return*/, response];
40849
+ case 5: return [2 /*return*/];
40850
+ }
40851
+ });
40852
+ });
40853
+ };
40854
+ return CustomerReviewForm;
40855
+ }());
40856
+
39858
40857
  var IkasComponentRenderer = /** @class */ (function () {
39859
40858
  function IkasComponentRenderer(render) {
39860
40859
  this.render = render;
@@ -40938,7 +41937,7 @@ var IkasCustomerAPI = /** @class */ (function () {
40938
41937
  return __generator(this, function (_b) {
40939
41938
  switch (_b.label) {
40940
41939
  case 0:
40941
- MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
41940
+ MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
40942
41941
  _b.label = 1;
40943
41942
  case 1:
40944
41943
  _b.trys.push([1, 3, , 4]);
@@ -40952,7 +41951,6 @@ var IkasCustomerAPI = /** @class */ (function () {
40952
41951
  firstName: firstName,
40953
41952
  lastName: lastName,
40954
41953
  isAcceptMarketing: isAcceptMarketing,
40955
- locale: IkasStorefrontConfig.getCurrentLocale(),
40956
41954
  },
40957
41955
  })];
40958
41956
  case 2:
@@ -41013,7 +42011,7 @@ var IkasCustomerAPI = /** @class */ (function () {
41013
42011
  return __generator(this, function (_b) {
41014
42012
  switch (_b.label) {
41015
42013
  case 0:
41016
- MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "], ["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "])));
42014
+ MUTATION = src(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation customerForgotPassword($email: String!) {\n customerForgotPassword(email: $email)\n }\n "], ["\n mutation customerForgotPassword($email: String!) {\n customerForgotPassword(email: $email)\n }\n "])));
41017
42015
  _b.label = 1;
41018
42016
  case 1:
41019
42017
  _b.trys.push([1, 3, , 4]);
@@ -41023,7 +42021,6 @@ var IkasCustomerAPI = /** @class */ (function () {
41023
42021
  mutation: MUTATION,
41024
42022
  variables: {
41025
42023
  email: email,
41026
- locale: IkasStorefrontConfig.getCurrentLocale(),
41027
42024
  },
41028
42025
  })];
41029
42026
  case 2:
@@ -41431,6 +42428,93 @@ var IkasCustomerAPI = /** @class */ (function () {
41431
42428
  }());
41432
42429
  var templateObject_1$7, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
41433
42430
 
42431
+ var IkasCustomerReviewAPI = /** @class */ (function () {
42432
+ function IkasCustomerReviewAPI() {
42433
+ }
42434
+ IkasCustomerReviewAPI.listCustomerReviews = function (params) {
42435
+ return __awaiter(this, void 0, void 0, function () {
42436
+ var LIST_CUSTOMER_REVIEWS, _a, data, errors, err_1;
42437
+ return __generator(this, function (_b) {
42438
+ switch (_b.label) {
42439
+ case 0:
42440
+ LIST_CUSTOMER_REVIEWS = src(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n query listCustomerReviews(\n $input: ListCustomerReviewInput!\n $productId: String\n $pagination: PaginationInput\n ) {\n listCustomerReviews(\n input: $input\n productId: $productId\n pagination: $pagination\n ) {\n count\n data {\n comment\n createdAt\n id\n star\n title\n }\n hasNext\n limit\n page\n }\n }\n "], ["\n query listCustomerReviews(\n $input: ListCustomerReviewInput!\n $productId: String\n $pagination: PaginationInput\n ) {\n listCustomerReviews(\n input: $input\n productId: $productId\n pagination: $pagination\n ) {\n count\n data {\n comment\n createdAt\n id\n star\n title\n }\n hasNext\n limit\n page\n }\n }\n "])));
42441
+ _b.label = 1;
42442
+ case 1:
42443
+ _b.trys.push([1, 3, , 4]);
42444
+ return [4 /*yield*/, apollo
42445
+ .getClient()
42446
+ .query({
42447
+ query: LIST_CUSTOMER_REVIEWS,
42448
+ variables: {
42449
+ input: {
42450
+ salesChannelId: params.salesChannelId,
42451
+ },
42452
+ productId: params.productId,
42453
+ pagination: {
42454
+ page: params.page,
42455
+ limit: params.limit,
42456
+ },
42457
+ },
42458
+ })];
42459
+ case 2:
42460
+ _a = _b.sent(), data = _a.data, errors = _a.errors;
42461
+ if (errors && errors.length)
42462
+ return [2 /*return*/, {
42463
+ data: [],
42464
+ count: 0,
42465
+ }];
42466
+ return [2 /*return*/, {
42467
+ data: data.listCustomerReviews.data.map(function (fP) { return new IkasCustomerReview(fP); }),
42468
+ count: data.listCustomerReviews.count,
42469
+ }];
42470
+ case 3:
42471
+ err_1 = _b.sent();
42472
+ console.log(err_1);
42473
+ return [2 /*return*/, {
42474
+ data: [],
42475
+ count: 0,
42476
+ }];
42477
+ case 4: return [2 /*return*/];
42478
+ }
42479
+ });
42480
+ });
42481
+ };
42482
+ IkasCustomerReviewAPI.createCustomerReview = function (params) {
42483
+ return __awaiter(this, void 0, void 0, function () {
42484
+ var CREATE_CUSTOMER_REVIEW, _a, data, errors, err_2;
42485
+ return __generator(this, function (_b) {
42486
+ switch (_b.label) {
42487
+ case 0:
42488
+ CREATE_CUSTOMER_REVIEW = src(templateObject_2$6 || (templateObject_2$6 = __makeTemplateObject(["\n mutation createCustomerReview($input: CreateCustomerReviewInput!) {\n createCustomerReview(input: $input) {\n id\n }\n }\n "], ["\n mutation createCustomerReview($input: CreateCustomerReviewInput!) {\n createCustomerReview(input: $input) {\n id\n }\n }\n "])));
42489
+ _b.label = 1;
42490
+ case 1:
42491
+ _b.trys.push([1, 3, , 4]);
42492
+ return [4 /*yield*/, apollo
42493
+ .getClient()
42494
+ .mutate({
42495
+ mutation: CREATE_CUSTOMER_REVIEW,
42496
+ variables: {
42497
+ input: __assign({}, params),
42498
+ },
42499
+ })];
42500
+ case 2:
42501
+ _a = _b.sent(), data = _a.data, errors = _a.errors;
42502
+ if (errors && errors.length)
42503
+ return [2 /*return*/, false];
42504
+ return [2 /*return*/, data === null || data === void 0 ? void 0 : data.createCustomerReview];
42505
+ case 3:
42506
+ err_2 = _b.sent();
42507
+ console.log(err_2);
42508
+ return [3 /*break*/, 4];
42509
+ case 4: return [2 /*return*/];
42510
+ }
42511
+ });
42512
+ });
42513
+ };
42514
+ return IkasCustomerReviewAPI;
42515
+ }());
42516
+ var templateObject_1$8, templateObject_2$6;
42517
+
41434
42518
  var IkasDistrictAPI = /** @class */ (function () {
41435
42519
  function IkasDistrictAPI() {
41436
42520
  }
@@ -41440,7 +42524,7 @@ var IkasDistrictAPI = /** @class */ (function () {
41440
42524
  return __generator(this, function (_b) {
41441
42525
  switch (_b.label) {
41442
42526
  case 0:
41443
- QUERY = src(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n query listDistrict(\n $cityId: StringFilterInput!\n $stateId: StringFilterInput\n ) {\n listDistrict(cityId: $cityId, stateId: $stateId) {\n id\n name\n }\n }\n "], ["\n query listDistrict(\n $cityId: StringFilterInput!\n $stateId: StringFilterInput\n ) {\n listDistrict(cityId: $cityId, stateId: $stateId) {\n id\n name\n }\n }\n "])));
42527
+ QUERY = src(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n query listDistrict(\n $cityId: StringFilterInput!\n $stateId: StringFilterInput\n ) {\n listDistrict(cityId: $cityId, stateId: $stateId) {\n id\n name\n }\n }\n "], ["\n query listDistrict(\n $cityId: StringFilterInput!\n $stateId: StringFilterInput\n ) {\n listDistrict(cityId: $cityId, stateId: $stateId) {\n id\n name\n }\n }\n "])));
41444
42528
  _b.label = 1;
41445
42529
  case 1:
41446
42530
  _b.trys.push([1, 3, , 4]);
@@ -41481,7 +42565,7 @@ var IkasDistrictAPI = /** @class */ (function () {
41481
42565
  };
41482
42566
  return IkasDistrictAPI;
41483
42567
  }());
41484
- var templateObject_1$8;
42568
+ var templateObject_1$9;
41485
42569
 
41486
42570
  var IkasHTMLMetaDataAPI = /** @class */ (function () {
41487
42571
  function IkasHTMLMetaDataAPI() {
@@ -41492,7 +42576,7 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
41492
42576
  return __generator(this, function (_b) {
41493
42577
  switch (_b.label) {
41494
42578
  case 0:
41495
- LIST_QUERY = src(templateObject_1$9 || (templateObject_1$9 = __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 "])));
42579
+ 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 "])));
41496
42580
  _b.label = 1;
41497
42581
  case 1:
41498
42582
  _b.trys.push([1, 3, , 4]);
@@ -41535,18 +42619,18 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
41535
42619
  };
41536
42620
  return IkasHTMLMetaDataAPI;
41537
42621
  }());
41538
- var templateObject_1$9;
42622
+ var templateObject_1$a;
41539
42623
 
41540
42624
  var IkasMerchantAPI = /** @class */ (function () {
41541
42625
  function IkasMerchantAPI() {
41542
42626
  }
41543
- IkasMerchantAPI.listMerchantSettings = function (merchantId) {
42627
+ IkasMerchantAPI.listMerchantSettings = function () {
41544
42628
  return __awaiter(this, void 0, void 0, function () {
41545
42629
  var QUERY, _a, data, errors;
41546
42630
  return __generator(this, function (_b) {
41547
42631
  switch (_b.label) {
41548
42632
  case 0:
41549
- QUERY = src(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n query listMerchantSettings($merchantId: StringFilterInput!) {\n listMerchantSettings(merchantId: $merchantId) {\n id\n logoId\n merchantName\n }\n }\n "], ["\n query listMerchantSettings($merchantId: StringFilterInput!) {\n listMerchantSettings(merchantId: $merchantId) {\n id\n logoId\n merchantName\n }\n }\n "])));
42633
+ QUERY = src(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n query listMerchantSettings {\n listMerchantSettings {\n id\n logoId\n merchantName\n }\n }\n "], ["\n query listMerchantSettings {\n listMerchantSettings {\n id\n logoId\n merchantName\n }\n }\n "])));
41550
42634
  _b.label = 1;
41551
42635
  case 1:
41552
42636
  _b.trys.push([1, 3, , 4]);
@@ -41554,11 +42638,6 @@ var IkasMerchantAPI = /** @class */ (function () {
41554
42638
  .getClient()
41555
42639
  .query({
41556
42640
  query: QUERY,
41557
- variables: {
41558
- merchantId: {
41559
- eq: merchantId,
41560
- },
41561
- },
41562
42641
  })];
41563
42642
  case 2:
41564
42643
  _a = _b.sent(), data = _a.data, errors = _a.errors;
@@ -41578,7 +42657,7 @@ var IkasMerchantAPI = /** @class */ (function () {
41578
42657
  };
41579
42658
  return IkasMerchantAPI;
41580
42659
  }());
41581
- var templateObject_1$a;
42660
+ var templateObject_1$b;
41582
42661
 
41583
42662
  var IkasProductAttributeTableCell = /** @class */ (function () {
41584
42663
  function IkasProductAttributeTableCell(data) {
@@ -41611,7 +42690,7 @@ var IkasProductSearchAPI = /** @class */ (function () {
41611
42690
  switch (_b.label) {
41612
42691
  case 0:
41613
42692
  _b.trys.push([0, 2, , 3]);
41614
- SEARCH_PRODUCTS = src(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "], ["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "])));
42693
+ SEARCH_PRODUCTS = src(templateObject_1$c || (templateObject_1$c = __makeTemplateObject(["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "], ["\n query searchProducts($input: SearchInput!) {\n searchProducts(input: $input) {\n count\n data\n facets {\n id\n values {\n count\n id\n }\n }\n limit\n page\n totalCount\n }\n }\n "])));
41615
42694
  return [4 /*yield*/, apollo
41616
42695
  .getClient()
41617
42696
  .query({
@@ -41647,7 +42726,7 @@ var IkasProductSearchAPI = /** @class */ (function () {
41647
42726
  switch (_b.label) {
41648
42727
  case 0:
41649
42728
  _b.trys.push([0, 2, , 3]);
41650
- QUERY = src(templateObject_2$6 || (templateObject_2$6 = __makeTemplateObject(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "], ["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "])));
42729
+ QUERY = src(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "], ["\n query getProductFilterData($categoryId: String, $locale: String) {\n getProductFilterData(categoryId: $categoryId, locale: $locale) {\n filters {\n customValues\n displayType\n id\n isMultiSelect\n isFacetFilter\n key\n name\n order\n type\n values {\n colorCode\n id\n key\n name\n thumbnailImageId\n }\n settings {\n showCollapsedOnDesktop\n showCollapsedOnMobile\n sortType\n useAndFilter\n }\n }\n categories {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "])));
41651
42730
  return [4 /*yield*/, apollo
41652
42731
  .getClient()
41653
42732
  .query({
@@ -41740,6 +42819,7 @@ function simpleToProduct(simple) {
41740
42819
  metaData: new IkasHTMLMetaData(simple.metaData || undefined),
41741
42820
  name: simple.name,
41742
42821
  shortDescription: simple.shortDescription || undefined,
42822
+ productOptionSetId: simple.productOptionSetId,
41743
42823
  variantTypes: simple.productVariantTypes.map(function (pvt) {
41744
42824
  return new IkasProductVariantType({
41745
42825
  variantType: new IkasVariantType({
@@ -41765,6 +42845,7 @@ function simpleToProduct(simple) {
41765
42845
  var _a, _b, _c, _d;
41766
42846
  return new IkasProductVariant({
41767
42847
  id: v.id,
42848
+ productId: simple.id,
41768
42849
  attributes: (_a = v.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
41769
42850
  var _a, _b, _c, _d, _e, _f;
41770
42851
  return new IkasProductAttributeValue({
@@ -41812,7 +42893,7 @@ function simpleToProduct(simple) {
41812
42893
  }),
41813
42894
  });
41814
42895
  }
41815
- var templateObject_1$b, templateObject_2$6;
42896
+ var templateObject_1$c, templateObject_2$7;
41816
42897
 
41817
42898
  var IkasProductAttributeAPI = /** @class */ (function () {
41818
42899
  function IkasProductAttributeAPI() {
@@ -41823,7 +42904,7 @@ var IkasProductAttributeAPI = /** @class */ (function () {
41823
42904
  return __generator(this, function (_b) {
41824
42905
  switch (_b.label) {
41825
42906
  case 0:
41826
- LIST_PRODUCT_ATTRIBUTES = src(templateObject_1$c || (templateObject_1$c = __makeTemplateObject(["\n query listProductAttribute($id: StringFilterInput!) {\n listProductAttribute(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n type\n options {\n id\n createdAt\n updatedAt\n deleted\n name\n }\n translations {\n description\n locale\n name\n options {\n id\n name\n }\n }\n }\n }\n "], ["\n query listProductAttribute($id: StringFilterInput!) {\n listProductAttribute(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n type\n options {\n id\n createdAt\n updatedAt\n deleted\n name\n }\n translations {\n description\n locale\n name\n options {\n id\n name\n }\n }\n }\n }\n "])));
42907
+ LIST_PRODUCT_ATTRIBUTES = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listProductAttribute($id: StringFilterInput!) {\n listProductAttribute(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n type\n options {\n id\n createdAt\n updatedAt\n deleted\n name\n }\n translations {\n description\n locale\n name\n options {\n id\n name\n }\n }\n }\n }\n "], ["\n query listProductAttribute($id: StringFilterInput!) {\n listProductAttribute(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n type\n options {\n id\n createdAt\n updatedAt\n deleted\n name\n }\n translations {\n description\n locale\n name\n options {\n id\n name\n }\n }\n }\n }\n "])));
41827
42908
  _b.label = 1;
41828
42909
  case 1:
41829
42910
  _b.trys.push([1, 3, , 4]);
@@ -41856,7 +42937,7 @@ var IkasProductAttributeAPI = /** @class */ (function () {
41856
42937
  };
41857
42938
  return IkasProductAttributeAPI;
41858
42939
  }());
41859
- var templateObject_1$c;
42940
+ var templateObject_1$d;
41860
42941
 
41861
42942
  var IkasFavoriteProductAPI = /** @class */ (function () {
41862
42943
  function IkasFavoriteProductAPI() {
@@ -41867,7 +42948,7 @@ var IkasFavoriteProductAPI = /** @class */ (function () {
41867
42948
  return __generator(this, function (_b) {
41868
42949
  switch (_b.label) {
41869
42950
  case 0:
41870
- LIST_FAVORITE_PRODUCTS = src(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n query listFavoriteProducts {\n listFavoriteProducts {\n id\n createdAt\n updatedAt\n deleted\n productId\n customerId\n }\n }\n "], ["\n query listFavoriteProducts {\n listFavoriteProducts {\n id\n createdAt\n updatedAt\n deleted\n productId\n customerId\n }\n }\n "])));
42951
+ LIST_FAVORITE_PRODUCTS = src(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n query listFavoriteProducts {\n listFavoriteProducts {\n id\n createdAt\n updatedAt\n deleted\n productId\n customerId\n }\n }\n "], ["\n query listFavoriteProducts {\n listFavoriteProducts {\n id\n createdAt\n updatedAt\n deleted\n productId\n customerId\n }\n }\n "])));
41871
42952
  _b.label = 1;
41872
42953
  case 1:
41873
42954
  _b.trys.push([1, 3, , 4]);
@@ -41896,7 +42977,7 @@ var IkasFavoriteProductAPI = /** @class */ (function () {
41896
42977
  return __generator(this, function (_b) {
41897
42978
  switch (_b.label) {
41898
42979
  case 0:
41899
- IS_FAVORITE_PRODUCT = src(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n query isFavoriteProduct($productId: String!) {\n isFavoriteProduct(productId: $productId)\n }\n "], ["\n query isFavoriteProduct($productId: String!) {\n isFavoriteProduct(productId: $productId)\n }\n "])));
42980
+ IS_FAVORITE_PRODUCT = src(templateObject_2$8 || (templateObject_2$8 = __makeTemplateObject(["\n query isFavoriteProduct($productId: String!) {\n isFavoriteProduct(productId: $productId)\n }\n "], ["\n query isFavoriteProduct($productId: String!) {\n isFavoriteProduct(productId: $productId)\n }\n "])));
41900
42981
  _b.label = 1;
41901
42982
  case 1:
41902
42983
  _b.trys.push([1, 3, , 4]);
@@ -41952,7 +43033,7 @@ var IkasFavoriteProductAPI = /** @class */ (function () {
41952
43033
  };
41953
43034
  return IkasFavoriteProductAPI;
41954
43035
  }());
41955
- var templateObject_1$d, templateObject_2$7, templateObject_3$4;
43036
+ var templateObject_1$e, templateObject_2$8, templateObject_3$4;
41956
43037
 
41957
43038
  var IkasContactFormAPI = /** @class */ (function () {
41958
43039
  function IkasContactFormAPI() {
@@ -41963,7 +43044,7 @@ var IkasContactFormAPI = /** @class */ (function () {
41963
43044
  return __generator(this, function (_b) {
41964
43045
  switch (_b.label) {
41965
43046
  case 0:
41966
- MUTATION = src(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n mutation sendContactFormToMerchant(\n $email: String!\n $message: String!\n $firstName: String!\n $lastName: String!\n ) {\n sendContactFormToMerchant(\n email: $email\n message: $message\n firstName: $firstName\n lastName: $lastName\n )\n }\n "], ["\n mutation sendContactFormToMerchant(\n $email: String!\n $message: String!\n $firstName: String!\n $lastName: String!\n ) {\n sendContactFormToMerchant(\n email: $email\n message: $message\n firstName: $firstName\n lastName: $lastName\n )\n }\n "])));
43047
+ MUTATION = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n mutation sendContactFormToMerchant(\n $email: String!\n $message: String!\n $firstName: String!\n $lastName: String!\n ) {\n sendContactFormToMerchant(\n email: $email\n message: $message\n firstName: $firstName\n lastName: $lastName\n )\n }\n "], ["\n mutation sendContactFormToMerchant(\n $email: String!\n $message: String!\n $firstName: String!\n $lastName: String!\n ) {\n sendContactFormToMerchant(\n email: $email\n message: $message\n firstName: $firstName\n lastName: $lastName\n )\n }\n "])));
41967
43048
  _b.label = 1;
41968
43049
  case 1:
41969
43050
  _b.trys.push([1, 3, , 4]);
@@ -41995,7 +43076,7 @@ var IkasContactFormAPI = /** @class */ (function () {
41995
43076
  };
41996
43077
  return IkasContactFormAPI;
41997
43078
  }());
41998
- var templateObject_1$e;
43079
+ var templateObject_1$f;
41999
43080
 
42000
43081
  var IkasStateAPI = /** @class */ (function () {
42001
43082
  function IkasStateAPI() {
@@ -42006,7 +43087,7 @@ var IkasStateAPI = /** @class */ (function () {
42006
43087
  return __generator(this, function (_b) {
42007
43088
  switch (_b.label) {
42008
43089
  case 0:
42009
- QUERY = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n query listState($countryId: StringFilterInput!) {\n listState(countryId: $countryId) {\n id\n name\n stateCode\n }\n }\n "], ["\n query listState($countryId: StringFilterInput!) {\n listState(countryId: $countryId) {\n id\n name\n stateCode\n }\n }\n "])));
43090
+ QUERY = src(templateObject_1$g || (templateObject_1$g = __makeTemplateObject(["\n query listState($countryId: StringFilterInput!) {\n listState(countryId: $countryId) {\n id\n name\n stateCode\n }\n }\n "], ["\n query listState($countryId: StringFilterInput!) {\n listState(countryId: $countryId) {\n id\n name\n stateCode\n }\n }\n "])));
42010
43091
  _b.label = 1;
42011
43092
  case 1:
42012
43093
  _b.trys.push([1, 3, , 4]);
@@ -42043,7 +43124,7 @@ var IkasStateAPI = /** @class */ (function () {
42043
43124
  };
42044
43125
  return IkasStateAPI;
42045
43126
  }());
42046
- var templateObject_1$f;
43127
+ var templateObject_1$g;
42047
43128
 
42048
43129
  var IkasVariantTypeAPI = /** @class */ (function () {
42049
43130
  function IkasVariantTypeAPI() {
@@ -42054,7 +43135,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
42054
43135
  return __generator(this, function (_b) {
42055
43136
  switch (_b.label) {
42056
43137
  case 0:
42057
- LIST_VARIANT_TYPE = src(templateObject_1$g || (templateObject_1$g = __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 translations {\n locale\n name\n values {\n id\n name\n }\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 translations {\n locale\n name\n values {\n id\n name\n }\n }\n }\n }\n "])));
43138
+ LIST_VARIANT_TYPE = src(templateObject_1$h || (templateObject_1$h = __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 translations {\n locale\n name\n values {\n id\n name\n }\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 translations {\n locale\n name\n values {\n id\n name\n }\n }\n }\n }\n "])));
42058
43139
  _b.label = 1;
42059
43140
  case 1:
42060
43141
  _b.trys.push([1, 3, , 4]);
@@ -42101,7 +43182,133 @@ var IkasVariantTypeAPI = /** @class */ (function () {
42101
43182
  };
42102
43183
  return IkasVariantTypeAPI;
42103
43184
  }());
42104
- var templateObject_1$g;
43185
+ var templateObject_1$h;
43186
+
43187
+ var IkasProductOptionSetAPI = /** @class */ (function () {
43188
+ function IkasProductOptionSetAPI() {
43189
+ }
43190
+ IkasProductOptionSetAPI.list = function (searchId, updatedAt, includeDeleted) {
43191
+ if (includeDeleted === void 0) { includeDeleted = false; }
43192
+ return __awaiter(this, void 0, void 0, function () {
43193
+ var QUERY, _a, data, errors, err_1;
43194
+ return __generator(this, function (_b) {
43195
+ switch (_b.label) {
43196
+ case 0:
43197
+ _b.trys.push([0, 2, , 3]);
43198
+ QUERY = src(templateObject_1$i || (templateObject_1$i = __makeTemplateObject(["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "], ["\n query ListProductOptionSet(\n $id: StringFilterInput!\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean!\n ) {\n listProductOptionSet(\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n id: $id\n ) {\n createdAt\n deleted\n id\n name\n options {\n createdAt\n dateSettings {\n max\n min\n }\n deleted\n fileSettings {\n allowedExtensions\n maxQuantity\n minQuantity\n }\n id\n isOptional\n name\n optionalText\n requiredOptionId\n requiredOptionValueIds\n order\n price\n selectSettings {\n maxSelect\n minSelect\n type\n values {\n createdAt\n deleted\n id\n order\n price\n updatedAt\n value\n thumbnailImageId\n colorCode\n }\n }\n textSettings {\n max\n min\n }\n type\n updatedAt\n }\n translations {\n locale\n options {\n id\n name\n optionalText\n values {\n id\n value\n }\n }\n }\n updatedAt\n }\n }\n "])));
43199
+ return [4 /*yield*/, apollo
43200
+ .getClient()
43201
+ .query({
43202
+ query: QUERY,
43203
+ variables: {
43204
+ includeDeleted: includeDeleted,
43205
+ updatedAt: { gt: updatedAt },
43206
+ id: { eq: searchId },
43207
+ },
43208
+ })];
43209
+ case 1:
43210
+ _a = _b.sent(), data = _a.data, errors = _a.errors;
43211
+ if (errors && errors.length) {
43212
+ console.log(errors);
43213
+ return [2 /*return*/];
43214
+ }
43215
+ return [2 /*return*/, {
43216
+ data: data.listProductOptionSet.map(function (c) { return new IkasProductOptionSet(c); }),
43217
+ }];
43218
+ case 2:
43219
+ err_1 = _b.sent();
43220
+ console.log(err_1);
43221
+ return [3 /*break*/, 3];
43222
+ case 3: return [2 /*return*/];
43223
+ }
43224
+ });
43225
+ });
43226
+ };
43227
+ return IkasProductOptionSetAPI;
43228
+ }());
43229
+ var templateObject_1$i;
43230
+
43231
+ var IkasProductBackInStockReminderAPI = /** @class */ (function () {
43232
+ function IkasProductBackInStockReminderAPI() {
43233
+ }
43234
+ IkasProductBackInStockReminderAPI.list = function (listParams) {
43235
+ return __awaiter(this, void 0, void 0, function () {
43236
+ var QUERY, _a, data, errors, err_1;
43237
+ return __generator(this, function (_b) {
43238
+ switch (_b.label) {
43239
+ case 0:
43240
+ QUERY = src(templateObject_1$j || (templateObject_1$j = __makeTemplateObject(["\n query listProductBackInStockRemind(\n $id: StringFilterInput\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean\n $email: StringFilterInput\n $productId: StringFilterInput\n $variantId: StringFilterInput\n ) {\n listProductBackInStockRemind(\n id: $id\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n email: $email\n productId: $productId\n variantId: $variantId\n ) {\n createdAt\n customerId\n deleted\n email\n id\n productId\n storefrontId\n updatedAt\n variantId\n }\n }\n "], ["\n query listProductBackInStockRemind(\n $id: StringFilterInput\n $updatedAt: DateFilterInput\n $includeDeleted: Boolean\n $email: StringFilterInput\n $productId: StringFilterInput\n $variantId: StringFilterInput\n ) {\n listProductBackInStockRemind(\n id: $id\n updatedAt: $updatedAt\n includeDeleted: $includeDeleted\n email: $email\n productId: $productId\n variantId: $variantId\n ) {\n createdAt\n customerId\n deleted\n email\n id\n productId\n storefrontId\n updatedAt\n variantId\n }\n }\n "])));
43241
+ _b.label = 1;
43242
+ case 1:
43243
+ _b.trys.push([1, 3, , 4]);
43244
+ return [4 /*yield*/, apollo
43245
+ .getClient()
43246
+ .query({
43247
+ query: QUERY,
43248
+ variables: {
43249
+ includeDeleted: listParams.includeDeleted,
43250
+ updatedAt: { gt: listParams.updatedAt },
43251
+ id: { eq: listParams.id },
43252
+ email: { eq: listParams.email },
43253
+ productId: { eq: listParams.productId },
43254
+ variantId: { eq: listParams.variantId },
43255
+ },
43256
+ })];
43257
+ case 2:
43258
+ _a = _b.sent(), data = _a.data, errors = _a.errors;
43259
+ if (errors && errors.length) {
43260
+ return [2 /*return*/];
43261
+ }
43262
+ return [2 /*return*/, {
43263
+ data: data.listProductBackInStockRemind,
43264
+ }];
43265
+ case 3:
43266
+ err_1 = _b.sent();
43267
+ console.log(err_1);
43268
+ return [2 /*return*/];
43269
+ case 4: return [2 /*return*/];
43270
+ }
43271
+ });
43272
+ });
43273
+ };
43274
+ IkasProductBackInStockReminderAPI.save = function (input) {
43275
+ return __awaiter(this, void 0, void 0, function () {
43276
+ var MUTATION, _a, data, errors, err_2;
43277
+ return __generator(this, function (_b) {
43278
+ switch (_b.label) {
43279
+ case 0:
43280
+ MUTATION = src(templateObject_2$9 || (templateObject_2$9 = __makeTemplateObject(["\n mutation saveProductBackInStockRemind(\n $input: ProductBackInStockRemindInput!\n ) {\n saveProductBackInStockRemind(input: $input) {\n createdAt\n customerId\n deleted\n email\n id\n productId\n storefrontId\n updatedAt\n variantId\n }\n }\n "], ["\n mutation saveProductBackInStockRemind(\n $input: ProductBackInStockRemindInput!\n ) {\n saveProductBackInStockRemind(input: $input) {\n createdAt\n customerId\n deleted\n email\n id\n productId\n storefrontId\n updatedAt\n variantId\n }\n }\n "])));
43281
+ _b.label = 1;
43282
+ case 1:
43283
+ _b.trys.push([1, 3, , 4]);
43284
+ return [4 /*yield*/, apollo
43285
+ .getClient()
43286
+ .mutate({
43287
+ mutation: MUTATION,
43288
+ variables: {
43289
+ input: input,
43290
+ },
43291
+ })];
43292
+ case 2:
43293
+ _a = _b.sent(), data = _a.data, errors = _a.errors;
43294
+ if (errors && errors.length) {
43295
+ console.log(errors);
43296
+ }
43297
+ if (data && data.saveProductBackInStockRemind)
43298
+ return [2 /*return*/, data.saveProductBackInStockRemind];
43299
+ return [3 /*break*/, 4];
43300
+ case 3:
43301
+ err_2 = _b.sent();
43302
+ console.log(err_2);
43303
+ return [3 /*break*/, 4];
43304
+ case 4: return [2 /*return*/];
43305
+ }
43306
+ });
43307
+ });
43308
+ };
43309
+ return IkasProductBackInStockReminderAPI;
43310
+ }());
43311
+ var templateObject_1$j, templateObject_2$9;
42105
43312
 
42106
43313
  var IkasProductListPropValueProvider = /** @class */ (function () {
42107
43314
  function IkasProductListPropValueProvider(pageType, productListPropValue, pageSpecificData) {
@@ -42182,7 +43389,7 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
42182
43389
  IkasProductDetailPropValueProvider.prototype.getValue = function () {
42183
43390
  var _a;
42184
43391
  return __awaiter(this, void 0, void 0, function () {
42185
- var productSearchResponse, productList, product, variant;
43392
+ var productSearchResponse, productList, product, optionSetResponse, variant;
42186
43393
  var _this = this;
42187
43394
  return __generator(this, function (_b) {
42188
43395
  switch (_b.label) {
@@ -42202,36 +43409,41 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
42202
43409
  })];
42203
43410
  case 1:
42204
43411
  productSearchResponse = _b.sent();
42205
- if (productSearchResponse) {
42206
- productList = productSearchResponse.data;
42207
- if (productList.length) {
42208
- product = productList[0];
42209
- if (product === null || product === void 0 ? void 0 : product.hasVariant) {
42210
- variant = product.variants.find(function (v) { return v.id === _this.productDetailPropValue.variantId; });
42211
- if (variant) {
42212
- return [2 /*return*/, {
42213
- productDetailPropValue: this.productDetailPropValue,
42214
- productDetail: new IkasProductDetail(product, variant.variantValues),
42215
- }];
42216
- }
42217
- else
42218
- return [2 /*return*/, null];
42219
- }
42220
- else {
42221
- return [2 /*return*/, {
42222
- productDetailPropValue: this.productDetailPropValue,
42223
- productDetail: new IkasProductDetail(product, product.variants[0].variantValues),
42224
- }];
42225
- }
42226
- }
42227
- else {
43412
+ if (!productSearchResponse) return [3 /*break*/, 5];
43413
+ productList = productSearchResponse.data;
43414
+ if (!productList.length) return [3 /*break*/, 4];
43415
+ product = productList[0];
43416
+ if (!product.productOptionSetId) return [3 /*break*/, 3];
43417
+ return [4 /*yield*/, IkasProductOptionSetAPI.list(product.productOptionSetId)];
43418
+ case 2:
43419
+ optionSetResponse = _b.sent();
43420
+ if (optionSetResponse === null || optionSetResponse === void 0 ? void 0 : optionSetResponse.data.length) {
43421
+ product.productOptionSet = optionSetResponse === null || optionSetResponse === void 0 ? void 0 : optionSetResponse.data[0];
43422
+ }
43423
+ _b.label = 3;
43424
+ case 3:
43425
+ if (product === null || product === void 0 ? void 0 : product.hasVariant) {
43426
+ variant = product.variants.find(function (v) { return v.id === _this.productDetailPropValue.variantId; });
43427
+ if (variant) {
42228
43428
  return [2 /*return*/, {
42229
43429
  productDetailPropValue: this.productDetailPropValue,
42230
- productDetail: getPlaceholderProduct(),
43430
+ productDetail: new IkasProductDetail(product, variant.variantValues),
42231
43431
  }];
42232
43432
  }
43433
+ else
43434
+ return [2 /*return*/, null];
42233
43435
  }
42234
- return [2 /*return*/, null];
43436
+ else {
43437
+ return [2 /*return*/, {
43438
+ productDetailPropValue: this.productDetailPropValue,
43439
+ productDetail: new IkasProductDetail(product, product.variants[0].variantValues),
43440
+ }];
43441
+ }
43442
+ case 4: return [2 /*return*/, {
43443
+ productDetailPropValue: this.productDetailPropValue,
43444
+ productDetail: getPlaceholderProduct(),
43445
+ }];
43446
+ case 5: return [2 /*return*/, null];
42235
43447
  }
42236
43448
  });
42237
43449
  });
@@ -43563,12 +44775,10 @@ var IkasPageDataProvider = /** @class */ (function () {
43563
44775
  });
43564
44776
  IkasPageDataProvider.prototype.getMerchantSettings = function () {
43565
44777
  return __awaiter(this, void 0, void 0, function () {
43566
- var merchantId, merchantSettingsResponse;
44778
+ var merchantSettingsResponse;
43567
44779
  return __generator(this, function (_a) {
43568
44780
  switch (_a.label) {
43569
- case 0:
43570
- merchantId = decodeBase64(IkasStorefrontConfig.config.apiKey || "");
43571
- return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings(merchantId)];
44781
+ case 0: return [4 /*yield*/, IkasMerchantAPI.listMerchantSettings()];
43572
44782
  case 1:
43573
44783
  merchantSettingsResponse = _a.sent();
43574
44784
  if (merchantSettingsResponse) {
@@ -43648,7 +44858,7 @@ var IkasPageDataProvider = /** @class */ (function () {
43648
44858
  if (!metaData.targetId)
43649
44859
  return [2 /*return*/];
43650
44860
  handleProductPage = function () { return __awaiter(_this, void 0, void 0, function () {
43651
- var productsResponse, product, displayedVariantType, inStockVariant;
44861
+ var productsResponse, product, optionSetResponse, displayedVariantType, inStockVariant;
43652
44862
  return __generator(this, function (_a) {
43653
44863
  switch (_a.label) {
43654
44864
  case 0: return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
@@ -43662,6 +44872,15 @@ var IkasPageDataProvider = /** @class */ (function () {
43662
44872
  return [2 /*return*/];
43663
44873
  }
43664
44874
  product = productsResponse.data[0];
44875
+ if (!product.productOptionSetId) return [3 /*break*/, 3];
44876
+ return [4 /*yield*/, IkasProductOptionSetAPI.list(product.productOptionSetId)];
44877
+ case 2:
44878
+ optionSetResponse = _a.sent();
44879
+ if (optionSetResponse === null || optionSetResponse === void 0 ? void 0 : optionSetResponse.data.length) {
44880
+ product.productOptionSet = optionSetResponse === null || optionSetResponse === void 0 ? void 0 : optionSetResponse.data[0];
44881
+ }
44882
+ _a.label = 3;
44883
+ case 3:
43665
44884
  this.pageSpecificData = new IkasProductDetail(product, product.variants[0].variantValues);
43666
44885
  // Select the first displayed in stock variant
43667
44886
  if (this.pageSpecificData.displayedVariantTypes.length) {
@@ -44356,7 +45575,7 @@ var IkasPageDataInit = /** @class */ (function () {
44356
45575
 
44357
45576
  var ThemeComponent = mobxReactLite.observer(function (_a) {
44358
45577
  var pageComponentPropValue = _a.pageComponentPropValue, index = _a.index, settings = _a.settings;
44359
- var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
45578
+ var store = IkasStorefrontConfig.store, currentPageComponents = IkasStorefrontConfig.currentPageComponents;
44360
45579
  var pageComponent = pageComponentPropValue.pageComponent;
44361
45580
  var propValues = pageComponentPropValue.propValues;
44362
45581
  var hasNullValue = mobx.computed(function () {
@@ -44367,9 +45586,14 @@ var ThemeComponent = mobxReactLite.observer(function (_a) {
44367
45586
  }
44368
45587
  });
44369
45588
  });
44370
- var Component = components[pageComponent.componentId];
45589
+ if (!currentPageComponents) {
45590
+ console.error("Components for the page not found.");
45591
+ return null;
45592
+ }
45593
+ var Component = currentPageComponents[pageComponent.componentId];
44371
45594
  if (!Component) {
44372
- console.error("COMPONENT NOT FOUND!", pageComponent.id, pageComponent.componentId, components ? Object.keys(components) : []);
45595
+ console.error("COMPONENT NOT FOUND!", JSON.stringify(pageComponentPropValue.component, null, 2));
45596
+ return null;
44373
45597
  }
44374
45598
  return (React.createElement("div", { id: index + "" }, hasNullValue.get() ? null : (React.createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store, pageSpecificData: IkasPageDataInit.pageSpecificData })))));
44375
45599
  });
@@ -44382,7 +45606,7 @@ var IkasPageHead = mobxReactLite.observer(function (_a) {
44382
45606
  var _a;
44383
45607
  document.documentElement.lang =
44384
45608
  ((_a = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; })) === null || _a === void 0 ? void 0 : _a.locale) || "tr";
44385
- }, []);
45609
+ }, [pageType]);
44386
45610
  var merchantSettings = React.useMemo(function () {
44387
45611
  if (merchantSettingsStr)
44388
45612
  return new IkasMerchantSettings(JSON.parse(merchantSettingsStr));
@@ -44585,9 +45809,11 @@ function createCategoryBreadcrumbSchema(category) {
44585
45809
  }
44586
45810
 
44587
45811
  var IkasPage = mobxReactLite.observer(function (_a) {
44588
- var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas;
45812
+ var propValuesStr = _a.propValuesStr, pageType = _a.pageType, pageTitle = _a.pageTitle, pageDescription = _a.pageDescription, pageSpecificDataStr = _a.pageSpecificDataStr, settingsStr = _a.settingsStr, merchantSettingsStr = _a.merchantSettingsStr, configJson = _a.configJson, reInitOnBrowser = _a.reInitOnBrowser, addOgpMetas = _a.addOgpMetas, components = _a.components;
44589
45813
  IkasStorefrontConfig.initWithJson(configJson);
45814
+ IkasStorefrontConfig.currentPageComponents = components;
44590
45815
  var store = IkasStorefrontConfig.store;
45816
+ store.currentPageType = pageType;
44591
45817
  var router$1 = router.useRouter();
44592
45818
  var _b = React.useState(false), isBrowser = _b[0], setIsBrowser = _b[1];
44593
45819
  var settings = React.useState(new IkasThemeSettings(JSON.parse(settingsStr)))[0];
@@ -44595,7 +45821,6 @@ var IkasPage = mobxReactLite.observer(function (_a) {
44595
45821
  IkasPageDataInit.setPageSpecificData(pageSpecificDataStr, pageType, isBrowser);
44596
45822
  return IkasPageDataInit.initPropValues(propValuesStr, router$1, settingsStr, isBrowser);
44597
45823
  }, [isBrowser, propValuesStr, pageType, settingsStr, pageSpecificDataStr]);
44598
- store.currentPageType = pageType;
44599
45824
  React.useEffect(function () {
44600
45825
  if (reInitOnBrowser)
44601
45826
  setIsBrowser(typeof window !== "undefined");
@@ -67794,7 +69019,7 @@ var AddressFormViewModel = /** @class */ (function () {
67794
69019
  });
67795
69020
  }); };
67796
69021
  this.listCountries = function () { return __awaiter(_this, void 0, void 0, function () {
67797
- var _a, countries, currentRouting_1, otherRoutings_1, currentCountry;
69022
+ var _a, countries, currentRouting_1, currentCountry;
67798
69023
  var _this = this;
67799
69024
  var _b, _c;
67800
69025
  return __generator(this, function (_d) {
@@ -67814,13 +69039,6 @@ var AddressFormViewModel = /** @class */ (function () {
67814
69039
  if ((_c = currentRouting_1 === null || currentRouting_1 === void 0 ? void 0 : currentRouting_1.countryCodes) === null || _c === void 0 ? void 0 : _c.length) {
67815
69040
  countries = countries.filter(function (c) { var _a; return c.iso2 && ((_a = currentRouting_1.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2)); });
67816
69041
  }
67817
- else {
67818
- otherRoutings_1 = IkasStorefrontConfig.routings.filter(function (r) { return r.id !== IkasStorefrontConfig.storefrontRoutingId; });
67819
- countries = countries.filter(function (c) {
67820
- return c.iso2 &&
67821
- !otherRoutings_1.some(function (otherRouting) { var _a; return (_a = otherRouting.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2); });
67822
- });
67823
- }
67824
69042
  this.countries = countries;
67825
69043
  if (this.countries.length === 1 && !this.country)
67826
69044
  this.onCountryChange(this.countries[0].id);
@@ -69680,7 +70898,7 @@ var Image = function (_a) {
69680
70898
  });
69681
70899
  return image.getSrc(closest);
69682
70900
  };
69683
- return (React.createElement(NextImage__default['default'], __assign({}, others, { loader: loader, quality: 100, src: image.src, alt: others.alt || "Image", placeholder: useBlur ? "blur" : "empty", blurDataURL: useBlur ? image.getSrc(180) : undefined })));
70901
+ return (React.createElement(NextImage__default['default'], __assign({}, others, { loader: loader, quality: 100, src: image.src, alt: others.alt || "Image", placeholder: useBlur ? "blur" : "empty", blurDataURL: useBlur ? image.getSrc(10) : undefined })));
69684
70902
  };
69685
70903
 
69686
70904
  var styles$k = {"StepContainer":"style-module_StepContainer__1O2dD","Step":"style-module_Step__1iOYA","StepTitleContainer":"style-module_StepTitleContainer__2GUg2","First":"style-module_First__cAzdJ","StepTitleTop":"style-module_StepTitleTop__3zfsj","WithRightContent":"style-module_WithRightContent__2fqb1","StepCircle":"style-module_StepCircle__36A5q","Selected":"style-module_Selected__3j91L","StepTitle":"style-module_StepTitle__10YDP","Light":"style-module_Light__15wSX","StepTitleRightContent":"style-module_StepTitleRightContent__2Q43m","StepContent":"style-module_StepContent__20QIi"};
@@ -69953,7 +71171,7 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
69953
71171
  var _b, _c, _d;
69954
71172
  var vm = _a.vm, pageComponent = _a.pageComponent;
69955
71173
  var ref = React.useRef(null);
69956
- var store = IkasStorefrontConfig.store, components = IkasStorefrontConfig.components;
71174
+ var store = IkasStorefrontConfig.store, currentPageComponents = IkasStorefrontConfig.currentPageComponents;
69957
71175
  React.useEffect(function () {
69958
71176
  vm.setComponentRef(ref.current, pageComponent);
69959
71177
  }, []);
@@ -69969,7 +71187,11 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
69969
71187
  var propValues = (_c = pageComponentPropValue.get()) === null || _c === void 0 ? void 0 : _c.propValues;
69970
71188
  if (!propValues)
69971
71189
  return null;
69972
- var Component = components[pageComponent.componentId];
71190
+ if (!currentPageComponents) {
71191
+ console.error("Components for the page not found.");
71192
+ return null;
71193
+ }
71194
+ var Component = currentPageComponents[pageComponent.componentId];
69973
71195
  if (((_d = vm.page) === null || _d === void 0 ? void 0 : _d.type) === exports.IkasThemePageType.CHECKOUT) {
69974
71196
  //@ts-ignore
69975
71197
  Component = IkasCheckoutPage$1;
@@ -69978,7 +71200,7 @@ var ThemeEditorComponent = mobxReactLite.observer(function (_a) {
69978
71200
  cart: new IkasCart({
69979
71201
  items: [
69980
71202
  new IkasOrderLineItem({
69981
- currencyCode: "TRY",
71203
+ currencyCode: "",
69982
71204
  finalPrice: 100,
69983
71205
  finalPriceWithQuantity: 100,
69984
71206
  price: 100,
@@ -70128,7 +71350,7 @@ var IkasStorefrontAPI = /** @class */ (function () {
70128
71350
  return __generator(this, function (_b) {
70129
71351
  switch (_b.label) {
70130
71352
  case 0:
70131
- QUERY = src(templateObject_1$h || (templateObject_1$h = __makeTemplateObject(["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "], ["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "])));
71353
+ QUERY = src(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "], ["\n query getStorefront($id: String!) {\n getStorefront(id: $id) {\n createdAt\n emailSettingsId\n fbpId\n gtmId\n id\n localizations {\n createdAt\n id\n isDefault\n locale\n name\n }\n mainStorefrontThemeId\n name\n salesChannelId\n routings {\n countryCodes\n createdAt\n domain\n id\n locale\n path\n priceListId\n updatedAt\n }\n status\n themes {\n createdAt\n id\n isMainTheme\n name\n status\n themeId\n themeVersionId\n updatedAt\n }\n }\n }\n "])));
70132
71354
  _b.label = 1;
70133
71355
  case 1:
70134
71356
  _b.trys.push([1, 3, , 4]);
@@ -70159,7 +71381,7 @@ var IkasStorefrontAPI = /** @class */ (function () {
70159
71381
  };
70160
71382
  return IkasStorefrontAPI;
70161
71383
  }());
70162
- var templateObject_1$h;
71384
+ var templateObject_1$k;
70163
71385
 
70164
71386
  var IkasNextPageDataProvider = /** @class */ (function () {
70165
71387
  function IkasNextPageDataProvider() {
@@ -70198,7 +71420,7 @@ var IkasNextPageDataProvider = /** @class */ (function () {
70198
71420
  IkasNextPageDataProvider.getSettings = function (locale) {
70199
71421
  var _this = this;
70200
71422
  return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
70201
- var isLocal, storefrontResponse, storefront, localTheme, colorScript, settings, storefront_1, salesChannel_1, localizationMap, storefrontJSScripts_1, domain_1, themeLocalizationPath, routing_1;
71423
+ var isLocal, storefrontResponse, storefront, localTheme, colorScript, settings, storefront_1, salesChannel_1, localizationMap, storefrontJSScripts_1, domain_1, productBackInStockSettings_1, customerReviewSettings_1, themeLocalizationPath, routing_1;
70202
71424
  return __generator(this, function (_a) {
70203
71425
  switch (_a.label) {
70204
71426
  case 0:
@@ -70234,18 +71456,36 @@ var IkasNextPageDataProvider = /** @class */ (function () {
70234
71456
  stockPreference: localTheme.settings.stockPreference,
70235
71457
  storefrontJSScripts: colorScript ? [colorScript] : [],
70236
71458
  domain: "",
71459
+ productBackInStockSettings: {
71460
+ customerLoginRequired: true,
71461
+ },
71462
+ customerReviewSettings: {
71463
+ customerLoginRequired: true,
71464
+ customerPurchaseRequired: false,
71465
+ },
70237
71466
  });
70238
71467
  return [3 /*break*/, 5];
70239
71468
  case 3: return [4 /*yield*/, IkasNextPageDataProvider.readSettingsFile()];
70240
71469
  case 4:
70241
71470
  settings = _a.sent();
70242
- if (!settings)
71471
+ if (!settings || !settings.localizationMap)
70243
71472
  return [2 /*return*/, resolve(null)];
70244
71473
  storefront_1 = new IkasStorefront(settings.storefront);
70245
71474
  salesChannel_1 = new IkasSalesChannel(settings.salesChannel);
70246
71475
  localizationMap = settings.localizationMap;
70247
71476
  storefrontJSScripts_1 = settings.storefrontJSScripts || [];
70248
71477
  domain_1 = settings.domain;
71478
+ productBackInStockSettings_1 = settings.productBackInStockSettings
71479
+ ? {
71480
+ customerLoginRequired: settings.productBackInStockSettings.customerLoginRequired,
71481
+ }
71482
+ : null;
71483
+ customerReviewSettings_1 = settings.customerReviewSettings
71484
+ ? {
71485
+ customerLoginRequired: settings.customerReviewSettings.customerLoginRequired,
71486
+ customerPurchaseRequired: settings.customerReviewSettings.customerPurchaseRequired,
71487
+ }
71488
+ : null;
70249
71489
  themeLocalizationPath = localizationMap[locale];
70250
71490
  routing_1 = storefront_1.routings.find(function (r) { return r.id === locale || r.path === locale; });
70251
71491
  if (!themeLocalizationPath || !routing_1) {
@@ -70278,6 +71518,8 @@ var IkasNextPageDataProvider = /** @class */ (function () {
70278
71518
  stockPreference: stockPreference,
70279
71519
  storefrontJSScripts: storefrontJSScripts_1,
70280
71520
  domain: domain_1,
71521
+ productBackInStockSettings: productBackInStockSettings_1,
71522
+ customerReviewSettings: customerReviewSettings_1,
70281
71523
  });
70282
71524
  });
70283
71525
  _a.label = 5;
@@ -70289,7 +71531,7 @@ var IkasNextPageDataProvider = /** @class */ (function () {
70289
71531
  IkasNextPageDataProvider.getPageData = function (context, isServer, pageType, possiblePageTypes, isEditor) {
70290
71532
  var _a, _b;
70291
71533
  return __awaiter(this, void 0, void 0, function () {
70292
- var isLocal, isProdEditor, serverRuntimeConfig, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, storefrontJSScripts, domain, provider, componentIds_1, components, namespaces, nextI18nConf, currentLocale, i18nReader, translations, extraProps, checkoutComponent, checkoutSettings, customizationProps;
71534
+ var isLocal, isProdEditor, serverRuntimeConfig, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, storefrontJSScripts, domain, productBackInStockSettings, customerReviewSettings, provider, componentIds_1, components, namespaces, nextI18nConf, currentLocale, i18nReader, translations, extraProps, checkoutComponent, checkoutSettings, customizationProps;
70293
71535
  return __generator(this, function (_c) {
70294
71536
  switch (_c.label) {
70295
71537
  case 0:
@@ -70315,7 +71557,7 @@ var IkasNextPageDataProvider = /** @class */ (function () {
70315
71557
  notFound: true,
70316
71558
  }];
70317
71559
  }
70318
- storefront = settings.storefront, themeLocalization = settings.themeLocalization, salesChannel = settings.salesChannel, routing = settings.routing, favicon = settings.favicon, stockPreference = settings.stockPreference, storefrontJSScripts = settings.storefrontJSScripts, domain = settings.domain;
71560
+ storefront = settings.storefront, themeLocalization = settings.themeLocalization, salesChannel = settings.salesChannel, routing = settings.routing, favicon = settings.favicon, stockPreference = settings.stockPreference, storefrontJSScripts = settings.storefrontJSScripts, domain = settings.domain, productBackInStockSettings = settings.productBackInStockSettings, customerReviewSettings = settings.customerReviewSettings;
70319
71561
  IkasStorefrontConfig.storefrontId = storefront.id;
70320
71562
  IkasStorefrontConfig.storefrontRoutingId = routing.id;
70321
71563
  IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
@@ -70330,6 +71572,8 @@ var IkasNextPageDataProvider = /** @class */ (function () {
70330
71572
  IkasStorefrontConfig.stockPreference = stockPreference || null;
70331
71573
  IkasStorefrontConfig.storefrontJSScripts = storefrontJSScripts || [];
70332
71574
  IkasStorefrontConfig.domain = domain;
71575
+ IkasStorefrontConfig.productBackInStockSettings = productBackInStockSettings;
71576
+ IkasStorefrontConfig.customerReviewSettings = customerReviewSettings;
70333
71577
  provider = new IkasPageDataProvider(themeLocalization.themeJson, context.params, pageType);
70334
71578
  provider.possiblePageTypes = possiblePageTypes;
70335
71579
  if (!!isEditor) return [3 /*break*/, 3];
@@ -70815,10 +72059,13 @@ var cart$1 = /*#__PURE__*/Object.freeze({
70815
72059
 
70816
72060
  var IkasPageEditor$1 = dynamic__default['default'](function () { return Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.IkasPageEditor; }); }, { ssr: false });
70817
72061
  var Page$c = function (_a) {
70818
- var configJson = _a.configJson;
72062
+ var configJson = _a.configJson, components = _a.components;
70819
72063
  if (configJson) {
70820
72064
  IkasStorefrontConfig.initWithJson(configJson);
70821
72065
  }
72066
+ if (components) {
72067
+ IkasStorefrontConfig.currentPageComponents = components;
72068
+ }
70822
72069
  return React.createElement(IkasPageEditor$1, null);
70823
72070
  };
70824
72071
  var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -71512,6 +72759,33 @@ var IkasCustomerStore = /** @class */ (function () {
71512
72759
  }
71513
72760
  });
71514
72761
  }); };
72762
+ this.sendReview = function (input) { return __awaiter(_this, void 0, void 0, function () {
72763
+ var customerReviewSettings, salesChannelId, customerId, response, error_1;
72764
+ var _a;
72765
+ return __generator(this, function (_b) {
72766
+ switch (_b.label) {
72767
+ case 0:
72768
+ _b.trys.push([0, 2, , 3]);
72769
+ customerReviewSettings = IkasStorefrontConfig.customerReviewSettings, salesChannelId = IkasStorefrontConfig.salesChannelId;
72770
+ if (!customerReviewSettings)
72771
+ return [2 /*return*/];
72772
+ customerId = (_a = this.customer) === null || _a === void 0 ? void 0 : _a.id;
72773
+ if (!customerId && customerReviewSettings.customerLoginRequired)
72774
+ throw Error("Unauthorized");
72775
+ return [4 /*yield*/, IkasCustomerReviewAPI.createCustomerReview(__assign(__assign({}, input), { customerId: customerReviewSettings.customerLoginRequired
72776
+ ? customerId
72777
+ : undefined, salesChannelId: salesChannelId || "" }))];
72778
+ case 1:
72779
+ response = _b.sent();
72780
+ return [2 /*return*/, response];
72781
+ case 2:
72782
+ error_1 = _b.sent();
72783
+ console.log(error_1);
72784
+ return [3 /*break*/, 3];
72785
+ case 3: return [2 /*return*/];
72786
+ }
72787
+ });
72788
+ }); };
71515
72789
  this.onCustomerConsentGrant = function () {
71516
72790
  _this.saveCustomerConsent();
71517
72791
  };
@@ -72244,6 +73518,7 @@ exports.CartPage = cart$1;
72244
73518
  exports.CheckoutPage = checkout$1;
72245
73519
  exports.ContactForm = ContactForm;
72246
73520
  exports.CustomPage = _slug_$1;
73521
+ exports.CustomerReviewForm = CustomerReviewForm;
72247
73522
  exports.EditorPage = editor$1;
72248
73523
  exports.EmailRule = EmailRule;
72249
73524
  exports.EqualsRule = EqualsRule;
@@ -72277,6 +73552,7 @@ exports.IkasCategory = IkasCategory;
72277
73552
  exports.IkasCategoryAPI = IkasCategoryAPI;
72278
73553
  exports.IkasCategoryList = IkasCategoryList;
72279
73554
  exports.IkasCategoryListPropValue = IkasCategoryListPropValue;
73555
+ exports.IkasCategoryPath = IkasCategoryPath;
72280
73556
  exports.IkasCategoryPropValue = IkasCategoryPropValue;
72281
73557
  exports.IkasCheckout = IkasCheckout;
72282
73558
  exports.IkasCheckoutAPI = IkasCheckoutAPI;
@@ -72289,9 +73565,13 @@ exports.IkasCountryAPI = IkasCountryAPI;
72289
73565
  exports.IkasCustomer = IkasCustomer;
72290
73566
  exports.IkasCustomerAPI = IkasCustomerAPI;
72291
73567
  exports.IkasCustomerAddress = IkasCustomerAddress;
73568
+ exports.IkasCustomerReview = IkasCustomerReview;
73569
+ exports.IkasCustomerReviewAPI = IkasCustomerReviewAPI;
73570
+ exports.IkasCustomerReviewList = IkasCustomerReviewList;
72292
73571
  exports.IkasDistrictAPI = IkasDistrictAPI;
72293
73572
  exports.IkasFavoriteProduct = IkasFavoriteProduct;
72294
73573
  exports.IkasFavoriteProductAPI = IkasFavoriteProductAPI;
73574
+ exports.IkasFilterCategory = IkasFilterCategory;
72295
73575
  exports.IkasHTMLMetaData = IkasHTMLMetaData;
72296
73576
  exports.IkasHTMLMetaDataAPI = IkasHTMLMetaDataAPI;
72297
73577
  exports.IkasImage = IkasImage;
@@ -72310,6 +73590,7 @@ exports.IkasProduct = IkasProduct;
72310
73590
  exports.IkasProductAttribute = IkasProductAttribute;
72311
73591
  exports.IkasProductAttributeAPI = IkasProductAttributeAPI;
72312
73592
  exports.IkasProductAttributeValue = IkasProductAttributeValue;
73593
+ exports.IkasProductBackInStockReminderAPI = IkasProductBackInStockReminderAPI;
72313
73594
  exports.IkasProductDetail = IkasProductDetail;
72314
73595
  exports.IkasProductDetailPropValue = IkasProductDetailPropValue;
72315
73596
  exports.IkasProductFilter = IkasProductFilter;
@@ -72317,6 +73598,17 @@ exports.IkasProductFilterSettings = IkasProductFilterSettings;
72317
73598
  exports.IkasProductFilterValue = IkasProductFilterValue;
72318
73599
  exports.IkasProductList = IkasProductList;
72319
73600
  exports.IkasProductListPropValue = IkasProductListPropValue;
73601
+ exports.IkasProductOption = IkasProductOption;
73602
+ exports.IkasProductOptionDateSettings = IkasProductOptionDateSettings;
73603
+ exports.IkasProductOptionFileSettings = IkasProductOptionFileSettings;
73604
+ exports.IkasProductOptionSelectSettings = IkasProductOptionSelectSettings;
73605
+ exports.IkasProductOptionSelectValue = IkasProductOptionSelectValue;
73606
+ exports.IkasProductOptionSelectValueTranslations = IkasProductOptionSelectValueTranslations;
73607
+ exports.IkasProductOptionSet = IkasProductOptionSet;
73608
+ exports.IkasProductOptionSetAPI = IkasProductOptionSetAPI;
73609
+ exports.IkasProductOptionSetTranslations = IkasProductOptionSetTranslations;
73610
+ exports.IkasProductOptionTextSettings = IkasProductOptionTextSettings;
73611
+ exports.IkasProductOptionTranslations = IkasProductOptionTranslations;
72320
73612
  exports.IkasProductPrice = IkasProductPrice;
72321
73613
  exports.IkasProductSearchAPI = IkasProductSearchAPI;
72322
73614
  exports.IkasProductVariant = IkasProductVariant;
@@ -72360,7 +73652,6 @@ exports.decodeBase64 = decodeBase64;
72360
73652
  exports.findAllIndexes = findAllIndexes;
72361
73653
  exports.formatDate = formatDate;
72362
73654
  exports.formatMoney = formatMoney;
72363
- exports.getCurrencySymbol = getCurrencySymbol;
72364
73655
  exports.parseRangeStr = parseRangeStr;
72365
73656
  exports.pascalCase = pascalCase;
72366
73657
  exports.stringSorter = stringSorter;