@ikas/storefront 0.0.108 → 0.0.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.es.js CHANGED
@@ -12562,6 +12562,32 @@ var IkasFilterCategory = /** @class */ (function () {
12562
12562
  return IkasFilterCategory;
12563
12563
  }());
12564
12564
 
12565
+ var IkasCheckoutSettings = /** @class */ (function () {
12566
+ function IkasCheckoutSettings(data) {
12567
+ if (data === void 0) { data = {}; }
12568
+ this.id = data.id || "";
12569
+ this.createdAt = data.createdAt || 0;
12570
+ this.updatedAt = data.updatedAt || 0;
12571
+ this.phoneRequirement =
12572
+ data.phoneRequirement || IkasCheckoutRequirementEnum.OPTIONAL;
12573
+ this.identityNumberRequirement =
12574
+ data.identityNumberRequirement || IkasCheckoutRequirementEnum.INVISIBLE;
12575
+ this.isAccountRequired = data.isAccountRequired || false;
12576
+ this.isTermsAndConditionsDefaultChecked =
12577
+ data.isTermsAndConditionsDefaultChecked || false;
12578
+ this.showTermsAndConditionsCheckbox =
12579
+ data.showTermsAndConditionsCheckbox || false;
12580
+ this.storefrontId = data.storefrontId || "";
12581
+ }
12582
+ return IkasCheckoutSettings;
12583
+ }());
12584
+ var IkasCheckoutRequirementEnum;
12585
+ (function (IkasCheckoutRequirementEnum) {
12586
+ IkasCheckoutRequirementEnum["INVISIBLE"] = "INVISIBLE";
12587
+ IkasCheckoutRequirementEnum["MANDATORY"] = "MANDATORY";
12588
+ IkasCheckoutRequirementEnum["OPTIONAL"] = "OPTIONAL";
12589
+ })(IkasCheckoutRequirementEnum || (IkasCheckoutRequirementEnum = {}));
12590
+
12565
12591
  var IkasOrderAddress = /** @class */ (function () {
12566
12592
  function IkasOrderAddress(data) {
12567
12593
  if (data === void 0) { data = {}; }
@@ -12621,6 +12647,10 @@ var IkasOrderAddress = /** @class */ (function () {
12621
12647
  });
12622
12648
  Object.defineProperty(IkasOrderAddress.prototype, "validationResult", {
12623
12649
  get: function () {
12650
+ var _a, _b, _c, _d;
12651
+ var isValidPhone = !!this.phone &&
12652
+ this.phone.length >= 10 &&
12653
+ validatePhoneNumber(this.phone);
12624
12654
  var results = {
12625
12655
  firstName: !!this.firstName,
12626
12656
  lastName: !!this.lastName,
@@ -12629,8 +12659,19 @@ var IkasOrderAddress = /** @class */ (function () {
12629
12659
  country: !!this.country,
12630
12660
  state: !!this.state,
12631
12661
  city: !!this.city,
12632
- phone: this.phone
12633
- ? this.phone.length >= 10 && validatePhoneNumber(this.phone)
12662
+ phone: ((_a = this.checkoutSettings) === null || _a === void 0 ? void 0 : _a.phoneRequirement) ===
12663
+ IkasCheckoutRequirementEnum.MANDATORY ||
12664
+ (((_b = this.checkoutSettings) === null || _b === void 0 ? void 0 : _b.phoneRequirement) ===
12665
+ IkasCheckoutRequirementEnum.OPTIONAL &&
12666
+ this.phone)
12667
+ ? isValidPhone
12668
+ : true,
12669
+ identityNumber: ((_c = this.checkoutSettings) === null || _c === void 0 ? void 0 : _c.identityNumberRequirement) ===
12670
+ IkasCheckoutRequirementEnum.MANDATORY ||
12671
+ (((_d = this.checkoutSettings) === null || _d === void 0 ? void 0 : _d.identityNumberRequirement) ===
12672
+ IkasCheckoutRequirementEnum.OPTIONAL &&
12673
+ this.phone)
12674
+ ? !!this.identityNumber
12634
12675
  : true,
12635
12676
  };
12636
12677
  return results;
@@ -12645,6 +12686,11 @@ var IkasOrderAddress = /** @class */ (function () {
12645
12686
  enumerable: false,
12646
12687
  configurable: true
12647
12688
  });
12689
+ IkasOrderAddress.prototype.toJSON = function () {
12690
+ var obj = __assign({}, this);
12691
+ delete obj.checkoutSettings;
12692
+ return obj;
12693
+ };
12648
12694
  return IkasOrderAddress;
12649
12695
  }());
12650
12696
 
@@ -15857,14 +15903,16 @@ var MAX_CVC_LENGTH = 4;
15857
15903
  var USE_DIFFERENT_ADDRESS_KEY = "sAddr";
15858
15904
  var isServer$1 = typeof localStorage === "undefined";
15859
15905
  var CheckoutViewModel = /** @class */ (function () {
15860
- function CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
15906
+ function CheckoutViewModel(checkout, checkoutSettings, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
15861
15907
  var _this = this;
15862
15908
  this.checkout = new IkasCheckout();
15909
+ this.checkoutSettings = new IkasCheckoutSettings();
15863
15910
  this.storefront = null;
15864
15911
  this.customerStore = new IkasCustomerStore();
15865
15912
  this.isCheckoutLoaded = false;
15866
15913
  this.isErrorsVisible = false;
15867
15914
  this.isStepLoading = false;
15915
+ this.isTermsAndConditionsChecked = false;
15868
15916
  this.step = CheckoutStep.INFO;
15869
15917
  this.cardData = null;
15870
15918
  this.paymentGatewayId = null;
@@ -15876,6 +15924,8 @@ var CheckoutViewModel = /** @class */ (function () {
15876
15924
  this.shippingCountryIds = null;
15877
15925
  this.selectedShippingAddressId = "-1";
15878
15926
  this.selectedBillingAddressId = "-1";
15927
+ this.policyModalTitle = "";
15928
+ this.policyModalText = "";
15879
15929
  this.error = null;
15880
15930
  this.init = function (queryParams) { return __awaiter(_this, void 0, void 0, function () {
15881
15931
  var merchantId, _a;
@@ -15993,7 +16043,7 @@ var CheckoutViewModel = /** @class */ (function () {
15993
16043
  switch (_b.label) {
15994
16044
  case 0:
15995
16045
  _a = this;
15996
- return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.storefrontId)];
16046
+ return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.salesChannelId)];
15997
16047
  case 1:
15998
16048
  _a.shippingCountryIds = _b.sent();
15999
16049
  return [2 /*return*/];
@@ -16079,6 +16129,7 @@ var CheckoutViewModel = /** @class */ (function () {
16079
16129
  this.createShippingAddress = function () {
16080
16130
  if (!_this.checkout.shippingAddress)
16081
16131
  _this.checkout.shippingAddress = new IkasOrderAddress();
16132
+ _this.checkout.shippingAddress.checkoutSettings = _this.checkoutSettings;
16082
16133
  };
16083
16134
  this.createBillingAddress = function () {
16084
16135
  if (typeof localStorage !== "undefined") {
@@ -16141,6 +16192,9 @@ var CheckoutViewModel = /** @class */ (function () {
16141
16192
  _this.checkout.billingAddress = new IkasOrderAddress(address);
16142
16193
  }
16143
16194
  };
16195
+ this.onTermsAndConditionsCheckedChange = function (value) {
16196
+ _this.isTermsAndConditionsChecked = value;
16197
+ };
16144
16198
  // CREDIT CARD START
16145
16199
  this.onCardNumberChange = function (value) {
16146
16200
  if (!_this.cardData)
@@ -16412,10 +16466,12 @@ var CheckoutViewModel = /** @class */ (function () {
16412
16466
  });
16413
16467
  }); };
16414
16468
  this.checkout = checkout;
16469
+ this.checkoutSettings = checkoutSettings;
16415
16470
  this.router = router;
16416
16471
  this.returnPolicy = returnPolicy;
16417
16472
  this.privacyPolicy = privacyPolicy;
16418
16473
  this.termsOfService = termsOfService;
16474
+ this.isTermsAndConditionsChecked = this.checkoutSettings.isTermsAndConditionsDefaultChecked;
16419
16475
  this.init(queryParams);
16420
16476
  makeAutoObservable(this);
16421
16477
  }
@@ -16434,6 +16490,14 @@ var CheckoutViewModel = /** @class */ (function () {
16434
16490
  enumerable: false,
16435
16491
  configurable: true
16436
16492
  });
16493
+ Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGateway", {
16494
+ get: function () {
16495
+ var _this = this;
16496
+ return this.paymentGateways.find(function (pg) { return pg.id === _this.paymentGatewayId; });
16497
+ },
16498
+ enumerable: false,
16499
+ configurable: true
16500
+ });
16437
16501
  Object.defineProperty(CheckoutViewModel.prototype, "selectedInstallmentIndex", {
16438
16502
  get: function () {
16439
16503
  var _this = this;
@@ -16507,10 +16571,15 @@ var CheckoutViewModel = /** @class */ (function () {
16507
16571
  });
16508
16572
  Object.defineProperty(CheckoutViewModel.prototype, "canPerformPayment", {
16509
16573
  get: function () {
16510
- var _a, _b;
16574
+ var _a, _b, _c;
16575
+ if (this.checkoutSettings.showTermsAndConditionsCheckbox &&
16576
+ !this.isTermsAndConditionsChecked)
16577
+ return false;
16511
16578
  return (this.canProceedToShipping &&
16512
16579
  !!((_a = this.checkout.billingAddress) === null || _a === void 0 ? void 0 : _a.isValid) &&
16513
- (!!this.cardData ? (_b = this.cardData) === null || _b === void 0 ? void 0 : _b.isValid : true));
16580
+ (((_b = this.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.paymentMethodType) ===
16581
+ IkasPaymentMethodType.CREDIT_CARD
16582
+ ? (_c = this.cardData) === null || _c === void 0 ? void 0 : _c.isValid : true));
16514
16583
  },
16515
16584
  enumerable: false,
16516
16585
  configurable: true
@@ -24637,6 +24706,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
24637
24706
  taxNumber: checkout.billingAddress.taxNumber || null,
24638
24707
  taxOffice: checkout.billingAddress.taxOffice || null,
24639
24708
  isDefault: checkout.billingAddress.isDefault || false,
24709
+ identityNumber: checkout.billingAddress.identityNumber || null,
24640
24710
  }
24641
24711
  : null,
24642
24712
  shippingAddress: checkout.shippingAddress &&
@@ -24656,6 +24726,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
24656
24726
  taxNumber: checkout.shippingAddress.taxNumber || null,
24657
24727
  taxOffice: checkout.shippingAddress.taxOffice || null,
24658
24728
  isDefault: checkout.shippingAddress.isDefault || false,
24729
+ identityNumber: checkout.shippingAddress.identityNumber || null,
24659
24730
  }
24660
24731
  : null,
24661
24732
  couponCode: checkout.couponCode || null,
@@ -24733,7 +24804,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
24733
24804
  return __generator(this, function (_b) {
24734
24805
  switch (_b.label) {
24735
24806
  case 0:
24736
- QUERY = src(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query listPaymentGateway {\n listPaymentGateway {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n testMode\n }\n }\n "], ["\n query listPaymentGateway {\n listPaymentGateway {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n testMode\n }\n }\n "])));
24807
+ QUERY = src(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query listPaymentGateway {\n listPaymentGateway {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n }\n }\n "], ["\n query listPaymentGateway {\n listPaymentGateway {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n }\n }\n "])));
24737
24808
  _b.label = 1;
24738
24809
  case 1:
24739
24810
  _b.trys.push([1, 3, , 4]);
@@ -24810,7 +24881,9 @@ var IkasCheckoutAPI = /** @class */ (function () {
24810
24881
  query: QUERY,
24811
24882
  variables: {
24812
24883
  lines: lines,
24813
- stockLocationIdList: stockLocationIdList,
24884
+ stockLocationIdList: stockLocationIdList.length
24885
+ ? stockLocationIdList
24886
+ : null,
24814
24887
  },
24815
24888
  })];
24816
24889
  case 2:
@@ -24830,9 +24903,44 @@ var IkasCheckoutAPI = /** @class */ (function () {
24830
24903
  });
24831
24904
  });
24832
24905
  };
24906
+ IkasCheckoutAPI.listCheckoutSettings = function () {
24907
+ return __awaiter(this, void 0, void 0, function () {
24908
+ var QUERY, _a, data, errors, err_8;
24909
+ return __generator(this, function (_b) {
24910
+ switch (_b.label) {
24911
+ case 0:
24912
+ QUERY = src(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n }\n }\n "], ["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n }\n }\n "])));
24913
+ _b.label = 1;
24914
+ case 1:
24915
+ _b.trys.push([1, 3, , 4]);
24916
+ return [4 /*yield*/, apollo
24917
+ .getClient()
24918
+ .query({
24919
+ query: QUERY,
24920
+ variables: {
24921
+ storefrontId: { eq: IkasStorefrontConfig.storefrontId },
24922
+ },
24923
+ })];
24924
+ case 2:
24925
+ _a = _b.sent(), data = _a.data, errors = _a.errors;
24926
+ if (errors && errors.length) {
24927
+ console.log(errors);
24928
+ }
24929
+ if (data)
24930
+ return [2 /*return*/, data.listCheckoutSettings.map(function (cs) { return new IkasCheckoutSettings(cs); })];
24931
+ return [3 /*break*/, 4];
24932
+ case 3:
24933
+ err_8 = _b.sent();
24934
+ console.log(err_8);
24935
+ return [3 /*break*/, 4];
24936
+ case 4: return [2 /*return*/];
24937
+ }
24938
+ });
24939
+ });
24940
+ };
24833
24941
  return IkasCheckoutAPI;
24834
24942
  }());
24835
- var templateObject_1$3, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
24943
+ var templateObject_1$3, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
24836
24944
 
24837
24945
  var IkasCityAPI = /** @class */ (function () {
24838
24946
  function IkasCityAPI() {
@@ -24924,13 +25032,13 @@ var IkasCountryAPI = /** @class */ (function () {
24924
25032
  });
24925
25033
  });
24926
25034
  };
24927
- IkasCountryAPI.listShippingCountries = function (storefrontId) {
25035
+ IkasCountryAPI.listShippingCountries = function (salesChannelId) {
24928
25036
  return __awaiter(this, void 0, void 0, function () {
24929
25037
  var QUERY, _a, data, errors, err_2;
24930
25038
  return __generator(this, function (_b) {
24931
25039
  switch (_b.label) {
24932
25040
  case 0:
24933
- QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "], ["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "])));
25041
+ QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($salesChannelId: String!) {\n getAvailableShippingCountries(salesChannelId: $salesChannelId)\n }\n "], ["\n query getAvailableShippingCountries($salesChannelId: String!) {\n getAvailableShippingCountries(salesChannelId: $salesChannelId)\n }\n "])));
24934
25042
  _b.label = 1;
24935
25043
  case 1:
24936
25044
  _b.trys.push([1, 3, , 4]);
@@ -24939,7 +25047,7 @@ var IkasCountryAPI = /** @class */ (function () {
24939
25047
  .query({
24940
25048
  query: QUERY,
24941
25049
  variables: {
24942
- storefrontId: storefrontId,
25050
+ salesChannelId: salesChannelId,
24943
25051
  },
24944
25052
  })];
24945
25053
  case 2:
@@ -25241,7 +25349,7 @@ var IkasCustomerAPI = /** @class */ (function () {
25241
25349
  return __generator(this, function (_b) {
25242
25350
  switch (_b.label) {
25243
25351
  case 0:
25244
- MUTATION = src(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\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 phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "], ["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\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 phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "])));
25352
+ MUTATION = src(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\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 phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "], ["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\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 phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "])));
25245
25353
  _b.label = 1;
25246
25354
  case 1:
25247
25355
  _b.trys.push([1, 3, , 4]);
@@ -25387,7 +25495,7 @@ var IkasCustomerAPI = /** @class */ (function () {
25387
25495
  };
25388
25496
  return IkasCustomerAPI;
25389
25497
  }());
25390
- var templateObject_1$6, templateObject_2$4, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
25498
+ var templateObject_1$6, templateObject_2$4, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9, templateObject_10, templateObject_11;
25391
25499
 
25392
25500
  var IkasDistrictAPI = /** @class */ (function () {
25393
25501
  function IkasDistrictAPI() {
@@ -26352,6 +26460,9 @@ var AddressFormViewModel = /** @class */ (function () {
26352
26460
  this.onPhoneChange = function (value) {
26353
26461
  _this.address.phone = value;
26354
26462
  };
26463
+ this.onIdentityNumberChange = function (value) {
26464
+ _this.address.identityNumber = value;
26465
+ };
26355
26466
  this.onAddressLine1Change = function (value) {
26356
26467
  _this.address.addressLine1 = value;
26357
26468
  };
@@ -26456,6 +26567,13 @@ var AddressFormViewModel = /** @class */ (function () {
26456
26567
  enumerable: false,
26457
26568
  configurable: true
26458
26569
  });
26570
+ Object.defineProperty(AddressFormViewModel.prototype, "identityNumber", {
26571
+ get: function () {
26572
+ return this.address.identityNumber;
26573
+ },
26574
+ enumerable: false,
26575
+ configurable: true
26576
+ });
26459
26577
  Object.defineProperty(AddressFormViewModel.prototype, "country", {
26460
26578
  get: function () {
26461
26579
  return this.address.country;
@@ -26531,7 +26649,7 @@ var css_248z$2 = ".common-module_FormSectionTitle___Mykh {\n width: 100%;\n di
26531
26649
  var commonStyles = {"FormSectionTitle":"common-module_FormSectionTitle___Mykh","Title":"common-module_Title__3JTHt","WithSubTitle":"common-module_WithSubTitle__1VHWv","SubTitle":"common-module_SubTitle__1H4kH","Grid":"common-module_Grid__2CuvH","Grid2":"common-module_Grid2__9CCag","Grid3":"common-module_Grid3__3p0jJ","FormContainer":"common-module_FormContainer__2I_Lj","mtFormRow":"common-module_mtFormRow__2tsDn","mt1":"common-module_mt1__3tpC1","mt2":"common-module_mt2__2bl5q","fadeInFromRight":"common-module_fadeInFromRight__3RYk5"};
26532
26650
  styleInject(css_248z$2);
26533
26651
 
26534
- var css_248z$3 = ".style-module_CheckoutPage__A_f2V {\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 16px;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n justify-content: flex-end;\n padding-left: 20px;\n padding-right: 40px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Space__1e2de {\n width: 100%;\n height: 100px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n flex: 0 0 auto;\n height: 50px;\n background-color: white;\n width: calc(100% - 1em);\n display: flex;\n align-items: center;\n border-top: 1px solid #d9d9d9; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc {\n font-size: 0.7em;\n margin-right: 1.4em;\n color: #737373;\n cursor: pointer;\n user-select: none; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc:hover {\n color: #111111; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n width: 100%;\n padding-left: 0.7em; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 {\n width: 100%;\n height: 96px;\n display: flex;\n align-items: center;\n font-weight: 500;\n font-size: 1.5em;\n padding-left: 0.4em; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 a {\n width: 100%; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do {\n width: 100%;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do img {\n object-fit: contain;\n object-position: left;\n pointer-events: none; }\n @media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_MobileCartSummary__3NrcP {\n display: none; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_RowPB__3M7Tz {\n padding-bottom: 0.7em; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: auto;\n max-width: 100%; } }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: #FAFAFA;\n border-left: 1px solid #d9d9d9;\n display: flex;\n padding-left: 40px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto; }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f .style-module_RightContent__1TcO5 {\n width: 100%;\n max-width: 600px;\n padding-top: 80px; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n display: none; } }\n";
26652
+ var css_248z$3 = ".style-module_CheckoutPage__A_f2V {\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 16px;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex; }\n .style-module_CheckoutPage__A_f2V * {\n box-sizing: border-box !important; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n justify-content: flex-end;\n padding-left: 20px;\n padding-right: 40px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Space__1e2de {\n width: 100%;\n height: 100px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n flex: 0 0 auto;\n height: 50px;\n background-color: white;\n width: calc(100% - 1em);\n display: flex;\n align-items: center;\n border-top: 1px solid #d9d9d9; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc {\n font-size: 0.7em;\n margin-right: 1.4em;\n color: #737373;\n cursor: pointer;\n user-select: none; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc:hover {\n color: #111111; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n width: 100%;\n padding-left: 0.7em; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 {\n width: 100%;\n height: 96px;\n display: flex;\n align-items: center;\n font-weight: 500;\n font-size: 1.5em;\n padding-left: 0.4em; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 a {\n width: 100%; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do {\n width: 100%;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do img {\n object-fit: contain;\n object-position: left;\n pointer-events: none; }\n @media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_MobileCartSummary__3NrcP {\n display: none; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_RowPB__3M7Tz {\n padding-bottom: 0.7em; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: auto;\n max-width: 100%; } }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: #FAFAFA;\n border-left: 1px solid #d9d9d9;\n display: flex;\n padding-left: 40px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto; }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f .style-module_RightContent__1TcO5 {\n width: 100%;\n max-width: 600px;\n padding-top: 80px; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n display: none; } }\n";
26535
26653
  var styles$2 = {"CheckoutPage":"style-module_CheckoutPage__A_f2V","Left":"style-module_Left__2dWz6","LeftContent":"style-module_LeftContent__1Tyb7","Space":"style-module_Space__1e2de","Footer":"style-module_Footer__ebdyg","FooterItem":"style-module_FooterItem__1ofBc","Header":"style-module_Header__1vfF1","Logo":"style-module_Logo__2E8Do","MobileCartSummary":"style-module_MobileCartSummary__3NrcP","RowPB":"style-module_RowPB__3M7Tz","Right":"style-module_Right__3AN4f","RightContent":"style-module_RightContent__1TcO5"};
26536
26654
  styleInject(css_248z$3);
26537
26655
 
@@ -26564,9 +26682,12 @@ var AddressForm$1 = observer(function (_a) {
26564
26682
  vm.hasState && (createElement(FormItem, { type: FormItemType.SELECT, label: "Eyalet", value: ((_c = vm.state) === null || _c === void 0 ? void 0 : _c.id) || "", onChange: vm.onStateChange, options: vm.stateOptions, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.state), errorText: "Eyalet seçin" })),
26565
26683
  createElement(FormItem, { type: FormItemType.SELECT, label: "\u0130l", value: ((_d = vm.city) === null || _d === void 0 ? void 0 : _d.id) || "", onChange: vm.onCityChange, options: vm.cityOptions, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.city), errorText: "Şehir seçin" }),
26566
26684
  vm.districtOptions.length ? (createElement(FormItem, { type: FormItemType.SELECT, label: "\u0130l\u00E7e", value: ((_e = vm.district) === null || _e === void 0 ? void 0 : _e.id) || "", onChange: vm.onDistrictChange, options: vm.districtOptions, errorText: "İlçe seçin" })) : (createElement(FormItem, { type: FormItemType.TEXT, label: "\u0130l\u00E7e", value: ((_f = vm.district) === null || _f === void 0 ? void 0 : _f.name) || "", onChange: vm.onDistrictInputChange })),
26567
- !vm.hasState && (createElement(FormItem, { type: FormItemType.TEXT, label: "Telefon", autocomplete: "tel", value: vm.phone || "", onChange: vm.onPhoneChange, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.phone), errorText: "Geçerli bir telefon girin" }))),
26568
- vm.hasState && (createElement("div", { className: [styles$2.RowPB, commonStyles.mtFormRow].join(" ") },
26569
- createElement(FormItem, { type: FormItemType.TEXT, label: "Telefon", autocomplete: "tel", value: vm.phone || "", onChange: vm.onPhoneChange, hasError: isErrorsVisible && (validationResult === null || validationResult === void 0 ? void 0 : validationResult.phone), errorText: "Geçerli bir telefon girin" })))));
26685
+ !!vm.address.checkoutSettings &&
26686
+ vm.address.checkoutSettings.phoneRequirement !==
26687
+ IkasCheckoutRequirementEnum.INVISIBLE && (createElement(FormItem, { type: FormItemType.TEXT, label: "Telefon", autocomplete: "tel", value: vm.phone || "", onChange: vm.onPhoneChange, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.phone), errorText: "Geçerli bir telefon girin" })),
26688
+ !!vm.address.checkoutSettings &&
26689
+ vm.address.checkoutSettings.identityNumberRequirement !==
26690
+ IkasCheckoutRequirementEnum.INVISIBLE && (createElement(FormItem, { type: FormItemType.TEXT, label: "TC Kimlik No", value: vm.identityNumber || "", onChange: vm.onIdentityNumberChange, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.identityNumber), errorText: "TC kimlik no girin" })))));
26570
26691
  });
26571
26692
 
26572
26693
  var css_248z$4 = ".style-module_Button__1UPMN {\n cursor: pointer;\n border: 1px transparent solid;\n border-radius: 6px;\n font-weight: 500;\n text-align: center;\n position: relative;\n transition: all .2s;\n display: flex;\n justify-content: center;\n align-items: center; }\n .style-module_Button__1UPMN.style-module_Large__2wPlw {\n height: 64px;\n padding: 0 1.7em; }\n .style-module_Button__1UPMN.style-module_Dark__1Z_hs {\n background-color: #111111;\n color: white; }\n .style-module_Button__1UPMN.style-module_Disabled__3HYF_ {\n background-color: #c8c8c8;\n color: #545454;\n pointer-events: none; }\n @media only screen and (max-width: 1000px) {\n .style-module_Button__1UPMN.style-module_FullWidthMobile__3MTFv {\n width: 100%; } }\n .style-module_Button__1UPMN .style-module_loader__3v6kq,\n .style-module_Button__1UPMN .style-module_loader__3v6kq:after {\n border-radius: 50%;\n width: 5em;\n height: 5em; }\n .style-module_Button__1UPMN .style-module_loader__3v6kq {\n font-size: 6px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.5em solid rgba(255, 255, 255, 0.2);\n border-right: 0.5em solid rgba(255, 255, 255, 0.2);\n border-bottom: 0.5em solid rgba(255, 255, 255, 0.2);\n border-left: 0.5em solid #ffffff;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: style-module_load8__2z7nj 1.1s infinite linear;\n animation: style-module_load8__2z7nj 1.1s infinite linear; }\n\n@-webkit-keyframes style-module_load8__2z7nj {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n@keyframes style-module_load8__2z7nj {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n";
@@ -26833,7 +26954,7 @@ var PaymentGateways = observer(function (_a) {
26833
26954
  : pg.name)),
26834
26955
  expandContent: pg.paymentMethodType === IkasPaymentMethodType.CREDIT_CARD ? (createElement("div", null,
26835
26956
  createElement(CreditCardForm, { vm: vm }),
26836
- vm.installmentInfo && createElement(Installments, { vm: vm }))) : undefined,
26957
+ vm.installmentInfo && createElement(Installments, { vm: vm }))) : pg.description ? (createElement("div", null, pg.description)) : undefined,
26837
26958
  rightContent: (createElement(PaymentMethodLogos, null, pg.paymentMethods.map(function (pm, index) {
26838
26959
  return pm.logoUrl ? (createElement("div", { className: styles$b.PaymentLogoContainer, key: index },
26839
26960
  createElement("img", { src: pm.logoUrl }))) : (createElement("div", { className: styles$b.PaymentLogoContainer, key: index }, pm.name));
@@ -26880,16 +27001,25 @@ var BillingAddress = observer(function (_a) {
26880
27001
  createElement(ExpandableList, { options: expandableListOptionsBilling.get(), selectedIndex: selectedBillingRowIndex, onRowSelect: onSelectedBillingRowIndexChange })));
26881
27002
  });
26882
27003
 
26883
- var css_248z$e = ".style-module_StepPayment__3STxe {\n margin-top: 1em; }\n";
26884
- var styles$d = {"StepPayment":"style-module_StepPayment__3STxe"};
27004
+ var css_248z$e = ".style-module_StepPayment__3STxe {\n margin-top: 1em; }\n .style-module_StepPayment__3STxe .style-module_TermsLabelSpan__35xVC {\n text-decoration: underline; }\n";
27005
+ var styles$d = {"StepPayment":"style-module_StepPayment__3STxe","TermsLabelSpan":"style-module_TermsLabelSpan__35xVC"};
26885
27006
  styleInject(css_248z$e);
26886
27007
 
26887
27008
  var CheckoutStepPayment = observer(function (_a) {
26888
27009
  var vm = _a.vm;
27010
+ var onShowTermsClick = function (e) {
27011
+ e.stopPropagation();
27012
+ vm.policyModalText = vm.termsOfService;
27013
+ };
26889
27014
  return (createElement("div", { className: [styles$d.StepPayment, commonStyles.FormContainer].join(" ") },
26890
27015
  createElement(InfoBox, { vm: vm, showShipping: true }),
26891
27016
  createElement(PaymentGateways, { vm: vm }),
26892
27017
  createElement(BillingAddress, { vm: vm }),
27018
+ createElement("div", { style: { marginTop: "12px" } },
27019
+ createElement(Checkbox, { value: vm.isTermsAndConditionsChecked, label: createElement(Fragment, null,
27020
+ createElement("span", { className: styles$d.TermsLabelSpan, onClick: onShowTermsClick }, "Mesafeli sat\u0131\u015F s\u00F6zle\u015Fmesini"),
27021
+ " ",
27022
+ "okudum ve onayl\u0131yorum"), onChange: vm.onTermsAndConditionsCheckedChange })),
26893
27023
  createElement(StepActionButtons, { mainBtnText: "Şimdi öde", mainBtnOnClick: vm.performPayment, backBtnText: "Kargoya Geri Dön", backBtnOnClick: vm.onBackToShippingClick, isLoading: vm.isStepLoading })));
26894
27024
  });
26895
27025
 
@@ -27620,17 +27750,18 @@ function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
27620
27750
 
27621
27751
  var IkasCheckoutPage = observer(function (_a) {
27622
27752
  var _b, _c, _d;
27623
- var checkout = _a.checkout, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
27753
+ var checkout = _a.checkout, checkoutSettings = _a.checkoutSettings, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
27624
27754
  var router = useRouter();
27625
27755
  var vm = useState(function () {
27626
- return new CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService);
27756
+ return new CheckoutViewModel(checkout, checkoutSettings, queryParams, router, returnPolicy, privacyPolicy, termsOfService);
27627
27757
  })[0];
27628
27758
  useEffect(function () {
27759
+ if (vm.checkoutSettings.isAccountRequired && !vm.checkout.hasCustomer) {
27760
+ router.push("/account/login?redirect=" + encodeURIComponent(vm.checkoutUrl));
27761
+ }
27629
27762
  Analytics.beginCheckout(vm.checkout);
27630
27763
  Analytics.checkoutStep(vm.checkout, vm.step);
27631
27764
  }, []);
27632
- var _e = useState(""), policyModalTitle = _e[0], setPolicyModalTitle = _e[1];
27633
- var _f = useState(""), policyModalText = _f[0], setPolicyModalText = _f[1];
27634
27765
  var step;
27635
27766
  switch (vm.step) {
27636
27767
  case CheckoutStep.INFO:
@@ -27647,19 +27778,19 @@ var IkasCheckoutPage = observer(function (_a) {
27647
27778
  break;
27648
27779
  }
27649
27780
  var onPolicyModalClose = function () {
27650
- setPolicyModalText("");
27781
+ vm.policyModalText = "";
27651
27782
  };
27652
27783
  var onReturnPolicyClick = function () {
27653
- setPolicyModalTitle("Para İade Politikası");
27654
- setPolicyModalText(vm.returnPolicy);
27784
+ vm.policyModalTitle = "Para İade Politikası";
27785
+ vm.policyModalText = vm.returnPolicy;
27655
27786
  };
27656
27787
  var onPrivacyPolicyClick = function () {
27657
- setPolicyModalTitle("Gizlilik Politikası");
27658
- setPolicyModalText(vm.privacyPolicy);
27788
+ vm.policyModalTitle = "Gizlilik Politikası";
27789
+ vm.policyModalText = vm.returnPolicy;
27659
27790
  };
27660
27791
  var onTermsOfServiceClick = function () {
27661
- setPolicyModalTitle("Hizmet Şartları");
27662
- setPolicyModalText(vm.termsOfService);
27792
+ vm.policyModalTitle = "Hizmet Şartları";
27793
+ vm.policyModalText = vm.returnPolicy;
27663
27794
  };
27664
27795
  var onErrorClose = function () {
27665
27796
  vm.error = undefined;
@@ -27716,7 +27847,7 @@ var IkasCheckoutPage = observer(function (_a) {
27716
27847
  createElement("div", { className: styles$2.Right },
27717
27848
  createElement("div", { className: styles$2.RightContent },
27718
27849
  createElement(CartSummary, { vm: vm }))),
27719
- !!policyModalText && (createElement(PolicyModal, { title: policyModalTitle, modalContent: policyModalText, onClose: onPolicyModalClose })))));
27850
+ !!vm.policyModalText && (createElement(PolicyModal, { title: vm.policyModalTitle, modalContent: vm.policyModalText, onClose: onPolicyModalClose })))));
27720
27851
  });
27721
27852
 
27722
27853
  function ErrorComponent(_a) {
@@ -28555,11 +28686,12 @@ var SettingsHelper = /** @class */ (function () {
28555
28686
  SettingsHelper.getPageData = function (context, isServer, pageType) {
28556
28687
  var _a;
28557
28688
  return __awaiter(this, void 0, void 0, function () {
28558
- var locale, settings, storefront, themeLocalization, salesChannel, routing, provider;
28689
+ var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, provider;
28559
28690
  return __generator(this, function (_b) {
28560
28691
  switch (_b.label) {
28561
28692
  case 0:
28562
- locale = context.locale;
28693
+ isLocal = process.env.NEXT_PUBLIC_ENV === "local";
28694
+ locale = isLocal ? "en" : context.locale;
28563
28695
  if (!locale) {
28564
28696
  return [2 /*return*/, {
28565
28697
  props: {},
@@ -28843,15 +28975,18 @@ var _slug_ = /*#__PURE__*/Object.freeze({
28843
28975
  });
28844
28976
 
28845
28977
  var CheckoutPage = function (_a) {
28846
- var checkoutStr = _a.checkoutStr, configJson = _a.configJson, others = __rest(_a, ["checkoutStr", "configJson"]);
28978
+ var checkoutStr = _a.checkoutStr, checkoutSettingsStr = _a.checkoutSettingsStr, configJson = _a.configJson, others = __rest(_a, ["checkoutStr", "checkoutSettingsStr", "configJson"]);
28847
28979
  IkasStorefrontConfig.initWithJson(configJson);
28848
28980
  Analytics.disableHTML();
28849
28981
  var checkout = new IkasCheckout(JSON.parse(checkoutStr));
28850
- return createElement(IkasCheckoutPage, __assign({ checkout: checkout }, others));
28982
+ var checkoutSettings = checkoutSettingsStr
28983
+ ? new IkasCheckoutSettings(JSON.parse(checkoutSettingsStr))
28984
+ : new IkasCheckoutSettings();
28985
+ return (createElement(IkasCheckoutPage, __assign({ checkout: checkout, checkoutSettings: checkoutSettings }, others)));
28851
28986
  };
28852
28987
  var _id_ = observer(CheckoutPage);
28853
28988
  var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28854
- var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout;
28989
+ var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout, checkoutSettings;
28855
28990
  return __generator(this, function (_a) {
28856
28991
  switch (_a.label) {
28857
28992
  case 0:
@@ -28885,20 +29020,23 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
28885
29020
  return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
28886
29021
  case 2:
28887
29022
  checkout = _a.sent();
28888
- if (checkout) {
28889
- return [2 /*return*/, {
28890
- props: {
28891
- checkoutStr: JSON.stringify(checkout),
28892
- returnPolicy: themeLocalization.returnPolicy || "",
28893
- privacyPolicy: themeLocalization.privacyPolicy || "",
28894
- termsOfService: themeLocalization.termsOfService || "",
28895
- queryParams: context.query,
28896
- },
28897
- }];
28898
- }
28899
- else {
28900
- return [2 /*return*/, redirect()];
28901
- }
29023
+ if (!checkout) return [3 /*break*/, 4];
29024
+ return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
29025
+ case 3:
29026
+ checkoutSettings = _a.sent();
29027
+ return [2 /*return*/, {
29028
+ props: {
29029
+ checkoutStr: JSON.stringify(checkout),
29030
+ checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
29031
+ : null,
29032
+ configJson: IkasStorefrontConfig.getJson(),
29033
+ returnPolicy: themeLocalization.returnPolicy || "",
29034
+ privacyPolicy: themeLocalization.privacyPolicy || "",
29035
+ termsOfService: themeLocalization.termsOfService || "",
29036
+ queryParams: context.query,
29037
+ },
29038
+ }];
29039
+ case 4: return [2 /*return*/, redirect()];
28902
29040
  }
28903
29041
  });
28904
29042
  }); };