@ikas/storefront 0.0.158-alpha.15 → 0.0.158-alpha.16

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.
@@ -155,6 +155,20 @@ export declare enum OrderStatusEnum {
155
155
  REFUND_REJECTED = "REFUND_REJECTED",
156
156
  REFUND_REQUESTED = "REFUND_REQUESTED"
157
157
  }
158
+ /**
159
+ * Payment Gateway Additional Price Type Enum
160
+ */
161
+ export declare enum PaymentGatewayAdditionalPriceTypeEnum {
162
+ DECREMENT = "DECREMENT",
163
+ INCREMENT = "INCREMENT"
164
+ }
165
+ /**
166
+ * Payment Gateway Transaction Fee Type Enum
167
+ */
168
+ export declare enum PaymentGatewayTransactionFeeTypeEnum {
169
+ AMOUNT = "AMOUNT",
170
+ RATIO = "RATIO"
171
+ }
158
172
  /**
159
173
  * Payment Method Enum
160
174
  */
@@ -221,6 +235,11 @@ export declare enum ProductFilterTypeEnum {
221
235
  TAG = "TAG",
222
236
  VARIANT_TYPE = "VARIANT_TYPE"
223
237
  }
238
+ export declare enum ProductSearchShowStockOptionEnum {
239
+ HIDE_OUT_OF_STOCK = "HIDE_OUT_OF_STOCK",
240
+ SHOW_ALL = "SHOW_ALL",
241
+ SHOW_OUT_OF_STOCK_AT_END = "SHOW_OUT_OF_STOCK_AT_END"
242
+ }
224
243
  /**
225
244
  * Shipping Method Enum
226
245
  */
@@ -518,6 +537,7 @@ export interface SearchInput {
518
537
  productIdList?: string[] | null;
519
538
  query?: string | null;
520
539
  salesChannelId?: string | null;
540
+ showStockOption?: ProductSearchShowStockOptionEnum | null;
521
541
  slug?: string | null;
522
542
  }
523
543
  export interface SearchInputFilterListInput {
@@ -1,9 +1,16 @@
1
- import { StringFilterInput, PaymentMethodEnum } from "../../../__generated__/global-types";
1
+ import { StringFilterInput, PaymentMethodEnum, PaymentGatewayTransactionFeeTypeEnum, PaymentGatewayAdditionalPriceTypeEnum } from "../../../__generated__/global-types";
2
2
  export interface listPaymentGateway_listPaymentGateway_paymentMethods {
3
3
  __typename: "PaymentGatewayPaymentMethod";
4
4
  name: string;
5
5
  logoUrl: string | null;
6
6
  }
7
+ export interface listPaymentGateway_listPaymentGateway_additionalPrices {
8
+ __typename: "AdditionalPrice";
9
+ amount: number;
10
+ amountType: PaymentGatewayTransactionFeeTypeEnum;
11
+ name: string;
12
+ type: PaymentGatewayAdditionalPriceTypeEnum;
13
+ }
7
14
  export interface listPaymentGateway_listPaymentGateway {
8
15
  __typename: "PaymentGateway";
9
16
  paymentMethods: listPaymentGateway_listPaymentGateway_paymentMethods[];
@@ -12,6 +19,7 @@ export interface listPaymentGateway_listPaymentGateway {
12
19
  name: string;
13
20
  description: string | null;
14
21
  testMode: boolean | null;
22
+ additionalPrices: listPaymentGateway_listPaymentGateway_additionalPrices[] | null;
15
23
  }
16
24
  export interface listPaymentGateway {
17
25
  listPaymentGateway: listPaymentGateway_listPaymentGateway[];
@@ -19,4 +19,5 @@ export interface listCountry {
19
19
  }
20
20
  export interface listCountryVariables {
21
21
  iso2?: StringFilterInput | null;
22
+ id?: StringFilterInput | null;
22
23
  }
@@ -1,6 +1,6 @@
1
1
  import { IkasCountry } from "../../models/index";
2
2
  export declare class IkasCountryAPI {
3
- static listCountries(iso2List?: string[]): Promise<IkasCountry[]>;
3
+ static listCountries(iso2List?: string[], idList?: string[]): Promise<IkasCountry[]>;
4
4
  static listShippingCountries(salesChannelId: string): Promise<string[]>;
5
5
  static getMyCountry(): Promise<string | null | undefined>;
6
6
  }
@@ -1,12 +1,15 @@
1
1
  import * as React from "react";
2
2
  import { IkasOrderAddress, IkasAddressValidationResult } from "../../../../models/data/order/address/index";
3
3
  import { IkasCheckoutCustomer } from "../../../../models/index";
4
+ import CheckoutViewModel from "../../model";
4
5
  declare type Props = {
6
+ vm: CheckoutViewModel;
5
7
  address: IkasOrderAddress;
6
8
  allowedCountryIds?: string[];
7
9
  customer?: IkasCheckoutCustomer;
8
10
  isErrorsVisible: boolean;
9
11
  validationResult: IkasAddressValidationResult;
12
+ isBilling?: boolean;
10
13
  };
11
14
  export declare const AddressForm: React.FC<Props>;
12
15
  export {};
@@ -1,6 +1,8 @@
1
1
  import { IkasOrderAddress } from "../../../../models/data/order/address/index";
2
2
  import { IkasCountry, IkasState, IkasCity, IkasDistrict, IkasCheckoutCustomer } from "../../../../models/index";
3
+ import CheckoutViewModel from "../../model";
3
4
  export default class AddressFormViewModel {
5
+ vm: CheckoutViewModel;
4
6
  address: IkasOrderAddress;
5
7
  customer?: IkasCheckoutCustomer | null;
6
8
  countries: IkasCountry[];
@@ -8,6 +10,7 @@ export default class AddressFormViewModel {
8
10
  cities: IkasCity[];
9
11
  districts: IkasDistrict[];
10
12
  allowedCountryIds?: string[] | null;
13
+ isCorporate: boolean;
11
14
  constructor(data: AddressFormViewModelParams);
12
15
  get firstName(): string | null | undefined;
13
16
  get lastName(): string | null | undefined;
@@ -71,8 +74,14 @@ export default class AddressFormViewModel {
71
74
  onCityChange: (cityId: string) => void;
72
75
  onDistrictChange: (districtId: string) => void;
73
76
  onDistrictInputChange: (value: string) => void;
77
+ onCorporateChange: (value: boolean) => void;
78
+ onCompanyChange: (value: string) => void;
79
+ onTaxNumberChange: (value: string) => void;
80
+ onTaxOfficeChange: (value: string) => void;
74
81
  }
75
82
  interface AddressFormViewModelParams extends Partial<AddressFormViewModel> {
83
+ vm: CheckoutViewModel;
76
84
  address: IkasOrderAddress;
85
+ isCorporate?: boolean;
77
86
  }
78
87
  export {};
@@ -49,6 +49,7 @@ export default class CheckoutViewModel {
49
49
  }[];
50
50
  get installmentPrice(): number | null | undefined;
51
51
  get installmentExtraPrice(): number | undefined;
52
+ get finalPrice(): number;
52
53
  get canProceedToShipping(): boolean;
53
54
  get canProceedToPayment(): boolean;
54
55
  get canPerformPayment(): boolean | undefined;
package/build/index.es.js CHANGED
@@ -11433,6 +11433,81 @@ var IkasCart = /** @class */ (function () {
11433
11433
  return IkasCart;
11434
11434
  }());
11435
11435
 
11436
+ var IkasPaymentGateway = /** @class */ (function () {
11437
+ function IkasPaymentGateway(data) {
11438
+ var _a;
11439
+ this.paymentMethods = data.paymentMethods || [];
11440
+ this.paymentMethodType =
11441
+ data.paymentMethodType || IkasPaymentMethodType.OTHER;
11442
+ this.id = data.id || null;
11443
+ this.name = data.name || "";
11444
+ this.testMode = data.testMode || null;
11445
+ this.description = data.description || null;
11446
+ this.additionalPrices =
11447
+ ((_a = data.additionalPrices) === null || _a === void 0 ? void 0 : _a.map(function (ap) { return new IkasPaymentGatewayAdditionalPrice(ap); })) || null;
11448
+ makeAutoObservable(this);
11449
+ }
11450
+ IkasPaymentGateway.prototype.getCalculatedAdditionalPrices = function (totalFinalPrice, shippingLines) {
11451
+ var _this = this;
11452
+ if (this.additionalPrices) {
11453
+ var shippingPrice = (shippingLines === null || shippingLines === void 0 ? void 0 : shippingLines.reduce(function (sum, item) { return sum + item.price; }, 0)) || 0;
11454
+ totalFinalPrice -= shippingPrice;
11455
+ return this.additionalPrices.map(function (additionalPrice) {
11456
+ var amount = 0;
11457
+ if (additionalPrice.amountType ===
11458
+ IkasPaymentGatewayAdditionalPriceAmountType.RATIO) {
11459
+ amount = ((totalFinalPrice || 0) * additionalPrice.amount) / 100;
11460
+ }
11461
+ else {
11462
+ amount = additionalPrice.amount;
11463
+ }
11464
+ if (additionalPrice.type ===
11465
+ IkasPaymentMethodAdditionalPriceType.DECREMENT)
11466
+ totalFinalPrice -= amount;
11467
+ else
11468
+ totalFinalPrice += amount;
11469
+ return {
11470
+ name: additionalPrice.name || _this.name,
11471
+ amount: amount,
11472
+ type: additionalPrice.type,
11473
+ };
11474
+ });
11475
+ }
11476
+ };
11477
+ return IkasPaymentGateway;
11478
+ }());
11479
+ var IkasPaymentGatewayAdditionalPrice = /** @class */ (function () {
11480
+ function IkasPaymentGatewayAdditionalPrice(data) {
11481
+ this.amount = data.amount || 0;
11482
+ this.amountType =
11483
+ data.amountType || IkasPaymentGatewayAdditionalPriceAmountType.AMOUNT;
11484
+ this.name = data.name || "";
11485
+ this.type = data.type || IkasPaymentMethodAdditionalPriceType.INCREMENT;
11486
+ makeAutoObservable(this);
11487
+ }
11488
+ return IkasPaymentGatewayAdditionalPrice;
11489
+ }());
11490
+ var IkasPaymentMethodType;
11491
+ (function (IkasPaymentMethodType) {
11492
+ IkasPaymentMethodType["BUY_ONLINE_PAY_AT_STORE"] = "BUY_ONLINE_PAY_AT_STORE";
11493
+ IkasPaymentMethodType["CASH"] = "CASH";
11494
+ IkasPaymentMethodType["CASH_ON_DELIVERY"] = "CASH_ON_DELIVERY";
11495
+ IkasPaymentMethodType["CREDIT_CARD"] = "CREDIT_CARD";
11496
+ IkasPaymentMethodType["GIFT_CARD"] = "GIFT_CARD";
11497
+ IkasPaymentMethodType["MONEY_ORDER"] = "MONEY_ORDER";
11498
+ IkasPaymentMethodType["OTHER"] = "OTHER";
11499
+ })(IkasPaymentMethodType || (IkasPaymentMethodType = {}));
11500
+ var IkasPaymentMethodAdditionalPriceType;
11501
+ (function (IkasPaymentMethodAdditionalPriceType) {
11502
+ IkasPaymentMethodAdditionalPriceType["DECREMENT"] = "DECREMENT";
11503
+ IkasPaymentMethodAdditionalPriceType["INCREMENT"] = "INCREMENT";
11504
+ })(IkasPaymentMethodAdditionalPriceType || (IkasPaymentMethodAdditionalPriceType = {}));
11505
+ var IkasPaymentGatewayAdditionalPriceAmountType;
11506
+ (function (IkasPaymentGatewayAdditionalPriceAmountType) {
11507
+ IkasPaymentGatewayAdditionalPriceAmountType["AMOUNT"] = "AMOUNT";
11508
+ IkasPaymentGatewayAdditionalPriceAmountType["RATIO"] = "RATIO";
11509
+ })(IkasPaymentGatewayAdditionalPriceAmountType || (IkasPaymentGatewayAdditionalPriceAmountType = {}));
11510
+
11436
11511
  var IkasCheckout = /** @class */ (function () {
11437
11512
  function IkasCheckout(data) {
11438
11513
  if (data === void 0) { data = {}; }
@@ -11460,6 +11535,7 @@ var IkasCheckout = /** @class */ (function () {
11460
11535
  this.note = null;
11461
11536
  // Extra
11462
11537
  this.appliedCouponCode = null;
11538
+ this.selectedPaymentGateway = null;
11463
11539
  this.id = data.id;
11464
11540
  this.createdAt = data.createdAt;
11465
11541
  this.updatedAt = data.updatedAt;
@@ -11531,6 +11607,22 @@ var IkasCheckout = /** @class */ (function () {
11531
11607
  enumerable: false,
11532
11608
  configurable: true
11533
11609
  });
11610
+ Object.defineProperty(IkasCheckout.prototype, "$totalFinalPrice", {
11611
+ get: function () {
11612
+ var _a;
11613
+ var calculatedAdditionalPrices = (_a = this.selectedPaymentGateway) === null || _a === void 0 ? void 0 : _a.getCalculatedAdditionalPrices(this.totalFinalPrice || 0, this.shippingLines || null);
11614
+ var total = this.totalFinalPrice || 0;
11615
+ calculatedAdditionalPrices === null || calculatedAdditionalPrices === void 0 ? void 0 : calculatedAdditionalPrices.forEach(function (additionalPrice) {
11616
+ if (additionalPrice.type === IkasPaymentMethodAdditionalPriceType.DECREMENT)
11617
+ total -= additionalPrice.amount;
11618
+ else
11619
+ total += additionalPrice.amount;
11620
+ });
11621
+ return total;
11622
+ },
11623
+ enumerable: false,
11624
+ configurable: true
11625
+ });
11534
11626
  return IkasCheckout;
11535
11627
  }());
11536
11628
  var IkasShippingMethod;
@@ -16166,17 +16258,6 @@ var sortBy = _baseRest(function(collection, iteratees) {
16166
16258
 
16167
16259
  var sortBy_1 = sortBy;
16168
16260
 
16169
- var IkasPaymentMethodType;
16170
- (function (IkasPaymentMethodType) {
16171
- IkasPaymentMethodType["BUY_ONLINE_PAY_AT_STORE"] = "BUY_ONLINE_PAY_AT_STORE";
16172
- IkasPaymentMethodType["CASH"] = "CASH";
16173
- IkasPaymentMethodType["CASH_ON_DELIVERY"] = "CASH_ON_DELIVERY";
16174
- IkasPaymentMethodType["CREDIT_CARD"] = "CREDIT_CARD";
16175
- IkasPaymentMethodType["GIFT_CARD"] = "GIFT_CARD";
16176
- IkasPaymentMethodType["MONEY_ORDER"] = "MONEY_ORDER";
16177
- IkasPaymentMethodType["OTHER"] = "OTHER";
16178
- })(IkasPaymentMethodType || (IkasPaymentMethodType = {}));
16179
-
16180
16261
  var CreditCardData = /** @class */ (function () {
16181
16262
  function CreditCardData(data) {
16182
16263
  var _this = this;
@@ -16820,6 +16901,7 @@ var CheckoutViewModel = /** @class */ (function () {
16820
16901
  if (paymentGateway.paymentMethodType === IkasPaymentMethodType.CREDIT_CARD) {
16821
16902
  _this.cardData = new CreditCardData();
16822
16903
  }
16904
+ _this.checkout.selectedPaymentGateway = paymentGateway;
16823
16905
  _this.installmentInfo = undefined;
16824
16906
  };
16825
16907
  this.setInstallmentCount = function (count) {
@@ -16940,6 +17022,13 @@ var CheckoutViewModel = /** @class */ (function () {
16940
17022
  enumerable: false,
16941
17023
  configurable: true
16942
17024
  });
17025
+ Object.defineProperty(CheckoutViewModel.prototype, "finalPrice", {
17026
+ get: function () {
17027
+ return this.installmentPrice || this.checkout.$totalFinalPrice;
17028
+ },
17029
+ enumerable: false,
17030
+ configurable: true
17031
+ });
16943
17032
  Object.defineProperty(CheckoutViewModel.prototype, "canProceedToShipping", {
16944
17033
  // VALIDATIONS
16945
17034
  get: function () {
@@ -21186,6 +21275,22 @@ var OrderStatusEnum;
21186
21275
  OrderStatusEnum["REFUND_REJECTED"] = "REFUND_REJECTED";
21187
21276
  OrderStatusEnum["REFUND_REQUESTED"] = "REFUND_REQUESTED";
21188
21277
  })(OrderStatusEnum || (OrderStatusEnum = {}));
21278
+ /**
21279
+ * Payment Gateway Additional Price Type Enum
21280
+ */
21281
+ var PaymentGatewayAdditionalPriceTypeEnum;
21282
+ (function (PaymentGatewayAdditionalPriceTypeEnum) {
21283
+ PaymentGatewayAdditionalPriceTypeEnum["DECREMENT"] = "DECREMENT";
21284
+ PaymentGatewayAdditionalPriceTypeEnum["INCREMENT"] = "INCREMENT";
21285
+ })(PaymentGatewayAdditionalPriceTypeEnum || (PaymentGatewayAdditionalPriceTypeEnum = {}));
21286
+ /**
21287
+ * Payment Gateway Transaction Fee Type Enum
21288
+ */
21289
+ var PaymentGatewayTransactionFeeTypeEnum;
21290
+ (function (PaymentGatewayTransactionFeeTypeEnum) {
21291
+ PaymentGatewayTransactionFeeTypeEnum["AMOUNT"] = "AMOUNT";
21292
+ PaymentGatewayTransactionFeeTypeEnum["RATIO"] = "RATIO";
21293
+ })(PaymentGatewayTransactionFeeTypeEnum || (PaymentGatewayTransactionFeeTypeEnum = {}));
21189
21294
  /**
21190
21295
  * Payment Method Enum
21191
21296
  */
@@ -21258,6 +21363,12 @@ var ProductFilterTypeEnum;
21258
21363
  ProductFilterTypeEnum["TAG"] = "TAG";
21259
21364
  ProductFilterTypeEnum["VARIANT_TYPE"] = "VARIANT_TYPE";
21260
21365
  })(ProductFilterTypeEnum || (ProductFilterTypeEnum = {}));
21366
+ var ProductSearchShowStockOptionEnum;
21367
+ (function (ProductSearchShowStockOptionEnum) {
21368
+ ProductSearchShowStockOptionEnum["HIDE_OUT_OF_STOCK"] = "HIDE_OUT_OF_STOCK";
21369
+ ProductSearchShowStockOptionEnum["SHOW_ALL"] = "SHOW_ALL";
21370
+ ProductSearchShowStockOptionEnum["SHOW_OUT_OF_STOCK_AT_END"] = "SHOW_OUT_OF_STOCK_AT_END";
21371
+ })(ProductSearchShowStockOptionEnum || (ProductSearchShowStockOptionEnum = {}));
21261
21372
  /**
21262
21373
  * Shipping Method Enum
21263
21374
  */
@@ -25386,7 +25497,23 @@ var pascalCase = function (str) {
25386
25497
  var decodeBase64 = function (base64) {
25387
25498
  var buffer = Buffer.from(base64, "base64");
25388
25499
  return buffer.toString("ascii");
25389
- };
25500
+ };
25501
+ function stringSorter(atitle, btitle) {
25502
+ var alphabet = "0123456789AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz";
25503
+ var _atitle = atitle || "";
25504
+ var _btitle = btitle || "";
25505
+ if (_atitle.length === 0 || _btitle.length === 0) {
25506
+ return _atitle.length - _btitle.length;
25507
+ }
25508
+ for (var i = 0; i < _atitle.length && i < _btitle.length; i++) {
25509
+ var ai = alphabet.indexOf(_atitle[i].toUpperCase());
25510
+ var bi = alphabet.indexOf(_btitle[i].toUpperCase());
25511
+ if (ai !== bi) {
25512
+ return ai - bi;
25513
+ }
25514
+ }
25515
+ return 0;
25516
+ }
25390
25517
 
25391
25518
  var ThemeComponent = observer(function (_a) {
25392
25519
  var pageComponentPropValue = _a.pageComponentPropValue, index = _a.index, settings = _a.settings;
@@ -27322,7 +27449,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
27322
27449
  return __generator(this, function (_b) {
27323
27450
  switch (_b.label) {
27324
27451
  case 0:
27325
- QUERY = src(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query listPaymentGateway($id: StringFilterInput) {\n listPaymentGateway(id: $id) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n }\n }\n "], ["\n query listPaymentGateway($id: StringFilterInput) {\n listPaymentGateway(id: $id) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n }\n }\n "])));
27452
+ QUERY = src(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query listPaymentGateway($id: StringFilterInput) {\n listPaymentGateway(id: $id) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n additionalPrices {\n amount\n amountType\n name\n type\n }\n }\n }\n "], ["\n query listPaymentGateway($id: StringFilterInput) {\n listPaymentGateway(id: $id) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n additionalPrices {\n amount\n amountType\n name\n type\n }\n }\n }\n "])));
27326
27453
  _b.label = 1;
27327
27454
  case 1:
27328
27455
  _b.trys.push([1, 3, , 4]);
@@ -27340,7 +27467,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
27340
27467
  console.log(errors);
27341
27468
  }
27342
27469
  if (data)
27343
- return [2 /*return*/, data.listPaymentGateway];
27470
+ return [2 /*return*/, data.listPaymentGateway.map(function (pg) { return new IkasPaymentGateway(pg); })];
27344
27471
  return [3 /*break*/, 4];
27345
27472
  case 3:
27346
27473
  err_5 = _b.sent();
@@ -27516,20 +27643,23 @@ var templateObject_1$5;
27516
27643
  var IkasCountryAPI = /** @class */ (function () {
27517
27644
  function IkasCountryAPI() {
27518
27645
  }
27519
- IkasCountryAPI.listCountries = function (iso2List) {
27646
+ IkasCountryAPI.listCountries = function (iso2List, idList) {
27520
27647
  return __awaiter(this, void 0, void 0, function () {
27521
27648
  var QUERY, _a, data, errors, err_1;
27522
27649
  return __generator(this, function (_b) {
27523
27650
  switch (_b.label) {
27524
27651
  case 0:
27525
- QUERY = src(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n query listCountry($iso2: StringFilterInput) {\n listCountry(iso2: $iso2) {\n id\n name\n native\n iso2\n iso3\n phoneCode\n locationTranslations {\n tr\n en\n }\n }\n }\n "], ["\n query listCountry($iso2: StringFilterInput) {\n listCountry(iso2: $iso2) {\n id\n name\n native\n iso2\n iso3\n phoneCode\n locationTranslations {\n tr\n en\n }\n }\n }\n "])));
27652
+ QUERY = src(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n query listCountry($iso2: StringFilterInput, $id: StringFilterInput) {\n listCountry(iso2: $iso2, id: $id) {\n id\n name\n native\n iso2\n iso3\n phoneCode\n locationTranslations {\n tr\n en\n }\n }\n }\n "], ["\n query listCountry($iso2: StringFilterInput, $id: StringFilterInput) {\n listCountry(iso2: $iso2, id: $id) {\n id\n name\n native\n iso2\n iso3\n phoneCode\n locationTranslations {\n tr\n en\n }\n }\n }\n "])));
27526
27653
  _b.label = 1;
27527
27654
  case 1:
27528
27655
  _b.trys.push([1, 3, , 4]);
27529
- return [4 /*yield*/, apollo.getClient().query({
27656
+ return [4 /*yield*/, apollo
27657
+ .getClient()
27658
+ .query({
27530
27659
  query: QUERY,
27531
27660
  variables: {
27532
27661
  iso2: iso2List ? { in: iso2List } : undefined,
27662
+ id: idList ? { in: idList } : undefined,
27533
27663
  },
27534
27664
  })];
27535
27665
  case 2:
@@ -28960,7 +29090,7 @@ var SVGCheck = function (_a) {
28960
29090
  createElement("path", { fill: "currentColor", d: "M12.6 8.1l-3.7-3.8 1-1.1 2.7 2.7 5.5-5.4 1 1z" })));
28961
29091
  };
28962
29092
 
28963
- var css_248z$1 = ".style-module_CheckboxWrapper__2tSbx {\n width: 100%;\n display: flex;\n padding: 0.5em;\n cursor: pointer;\n user-select: none; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxContainer__1zRvT {\n position: relative;\n width: 20px;\n height: 20px;\n margin-right: 0.75em; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxBorder__281X3 {\n flex: 0 0 auto;\n width: 20px;\n height: 20px;\n border-radius: 4px;\n border: 1px solid #d9d9d9;\n position: absolute;\n top: 0;\n left: 0;\n transition: border-width .2s ease-in-out; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxBorder__281X3.style-module_Checked__3-ZM4 {\n border: 10px solid #111111; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxTick__2LpQ- {\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n color: white;\n z-index: 2;\n transition: all 0.2s ease-in-out;\n transition-delay: .1s;\n opacity: 0;\n transform: scale(0.2); }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxTick__2LpQ-.style-module_Visible__2Ng5Q {\n opacity: 1;\n transform: scale(1.2); }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxLabel__30uMC {\n flex: 1 1 auto;\n font-weight: normal;\n font-size: 0.85em;\n color: #545454; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxLabelError__FmdxF {\n color: #ff6d6d; }\n";
29093
+ var css_248z$1 = ".style-module_CheckboxWrapper__2tSbx {\n width: 100%;\n display: flex;\n padding: 0.5em;\n cursor: pointer;\n user-select: none;\n align-items: center; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxContainer__1zRvT {\n position: relative;\n width: 20px;\n height: 20px;\n margin-right: 0.75em; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxBorder__281X3 {\n flex: 0 0 auto;\n width: 20px;\n height: 20px;\n border-radius: 4px;\n border: 1px solid #d9d9d9;\n position: absolute;\n top: 0;\n left: 0;\n transition: border-width .2s ease-in-out; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxBorder__281X3.style-module_Checked__3-ZM4 {\n border: 10px solid #111111; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxTick__2LpQ- {\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n color: white;\n z-index: 2;\n transition: all 0.2s ease-in-out;\n transition-delay: .1s;\n opacity: 0;\n transform: scale(0.2); }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxTick__2LpQ-.style-module_Visible__2Ng5Q {\n opacity: 1;\n transform: scale(1.2); }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxLabel__30uMC {\n flex: 1 1 auto;\n font-weight: normal;\n font-size: 0.85em;\n color: #545454; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxLabelError__FmdxF {\n color: #ff6d6d; }\n";
28964
29094
  var styles$1 = {"CheckboxWrapper":"style-module_CheckboxWrapper__2tSbx","CheckboxContainer":"style-module_CheckboxContainer__1zRvT","CheckboxBorder":"style-module_CheckboxBorder__281X3","Checked":"style-module_Checked__3-ZM4","CheckboxTick":"style-module_CheckboxTick__2LpQ-","Visible":"style-module_Visible__2Ng5Q","CheckboxLabel":"style-module_CheckboxLabel__30uMC","CheckboxLabelError":"style-module_CheckboxLabelError__FmdxF"};
28965
29095
  styleInject(css_248z$1);
28966
29096
 
@@ -28995,6 +29125,7 @@ var AddressFormViewModel = /** @class */ (function () {
28995
29125
  this.cities = [];
28996
29126
  this.districts = [];
28997
29127
  this.allowedCountryIds = null;
29128
+ this.isCorporate = false;
28998
29129
  this.fillDropdownOptions = function () { return __awaiter(_this, void 0, void 0, function () {
28999
29130
  return __generator(this, function (_a) {
29000
29131
  switch (_a.label) {
@@ -29015,24 +29146,25 @@ var AddressFormViewModel = /** @class */ (function () {
29015
29146
  });
29016
29147
  }); };
29017
29148
  this.listCountries = function () { return __awaiter(_this, void 0, void 0, function () {
29018
- var countries;
29019
- var _this = this;
29020
- return __generator(this, function (_a) {
29021
- switch (_a.label) {
29149
+ var countries, currentRouting_1;
29150
+ var _a, _b;
29151
+ return __generator(this, function (_c) {
29152
+ switch (_c.label) {
29022
29153
  case 0:
29023
- _a.trys.push([0, 2, , 3]);
29024
- return [4 /*yield*/, IkasCountryAPI.listCountries()];
29154
+ _c.trys.push([0, 2, , 3]);
29155
+ return [4 /*yield*/, IkasCountryAPI.listCountries(undefined, ((_a = this.allowedCountryIds) === null || _a === void 0 ? void 0 : _a.length) ? this.allowedCountryIds : undefined)];
29025
29156
  case 1:
29026
- countries = _a.sent();
29027
- if (this.allowedCountryIds) {
29028
- countries = countries.filter(function (c) { var _a; return (_a = _this.allowedCountryIds) === null || _a === void 0 ? void 0 : _a.includes(c.id); });
29157
+ countries = _c.sent();
29158
+ currentRouting_1 = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; });
29159
+ if ((_b = currentRouting_1 === null || currentRouting_1 === void 0 ? void 0 : currentRouting_1.countryCodes) === null || _b === void 0 ? void 0 : _b.length) {
29160
+ countries = countries.filter(function (c) { var _a; return c.iso2 && ((_a = currentRouting_1.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2)); });
29029
29161
  }
29030
29162
  this.countries = countries;
29031
29163
  if (this.countries.length === 1 && !this.country)
29032
29164
  this.onCountryChange(this.countries[0].id);
29033
29165
  return [3 /*break*/, 3];
29034
29166
  case 2:
29035
- _a.sent();
29167
+ _c.sent();
29036
29168
  return [3 /*break*/, 3];
29037
29169
  case 3: return [2 /*return*/];
29038
29170
  }
@@ -29213,6 +29345,24 @@ var AddressFormViewModel = /** @class */ (function () {
29213
29345
  name: value,
29214
29346
  };
29215
29347
  };
29348
+ this.onCorporateChange = function (value) {
29349
+ _this.isCorporate = value;
29350
+ if (!value) {
29351
+ _this.address.company = null;
29352
+ _this.address.taxNumber = null;
29353
+ _this.address.taxOffice = null;
29354
+ }
29355
+ };
29356
+ this.onCompanyChange = function (value) {
29357
+ _this.address.company = value;
29358
+ };
29359
+ this.onTaxNumberChange = function (value) {
29360
+ _this.address.taxNumber = value;
29361
+ };
29362
+ this.onTaxOfficeChange = function (value) {
29363
+ _this.address.taxOffice = value;
29364
+ };
29365
+ this.vm = data.vm;
29216
29366
  this.address = data.address;
29217
29367
  this.customer = data.customer;
29218
29368
  this.allowedCountryIds = data.allowedCountryIds;
@@ -29279,11 +29429,7 @@ var AddressFormViewModel = /** @class */ (function () {
29279
29429
  Object.defineProperty(AddressFormViewModel.prototype, "countryOptions", {
29280
29430
  get: function () {
29281
29431
  var list = this.countries.map(this.modelToOption);
29282
- list.sort(function (a, b) {
29283
- return a.label.toLocaleLowerCase("tr-TR") > b.label.toLocaleLowerCase("tr-TR")
29284
- ? 1
29285
- : -1;
29286
- });
29432
+ list.sort(function (a, b) { return stringSorter(a.label, b.label); });
29287
29433
  return list;
29288
29434
  },
29289
29435
  enumerable: false,
@@ -29306,11 +29452,7 @@ var AddressFormViewModel = /** @class */ (function () {
29306
29452
  Object.defineProperty(AddressFormViewModel.prototype, "districtOptions", {
29307
29453
  get: function () {
29308
29454
  var list = this.districts.map(this.modelToOption);
29309
- list.sort(function (a, b) {
29310
- return a.label.toLocaleLowerCase("tr-TR") > b.label.toLocaleLowerCase("tr-TR")
29311
- ? 1
29312
- : -1;
29313
- });
29455
+ list.sort(function (a, b) { return stringSorter(a.label, b.label); });
29314
29456
  return list;
29315
29457
  },
29316
29458
  enumerable: false,
@@ -29336,9 +29478,11 @@ var styles$2 = {"CheckoutPage":"style-module_CheckoutPage__A_f2V","Left":"style-
29336
29478
  styleInject(css_248z$3);
29337
29479
 
29338
29480
  var AddressForm$1 = observer(function (_a) {
29339
- var _b, _c, _d, _e, _f;
29340
- var isErrorsVisible = _a.isErrorsVisible, validationResult = _a.validationResult, props = __rest(_a, ["isErrorsVisible", "validationResult"]);
29341
- var vm = useState(function () { return new AddressFormViewModel(props); })[0];
29481
+ var _b, _c, _d, _e, _f, _g, _h;
29482
+ var isErrorsVisible = _a.isErrorsVisible, isBilling = _a.isBilling, validationResult = _a.validationResult, props = __rest(_a, ["isErrorsVisible", "isBilling", "validationResult"]);
29483
+ var vm = useState(function () {
29484
+ return new AddressFormViewModel(__assign({}, props));
29485
+ })[0];
29342
29486
  useEffect(function () {
29343
29487
  Object.entries(props).forEach(function (entry) {
29344
29488
  return runInAction(function () {
@@ -29369,7 +29513,13 @@ var AddressForm$1 = observer(function (_a) {
29369
29513
  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" })),
29370
29514
  !!vm.address.checkoutSettings &&
29371
29515
  vm.address.checkoutSettings.identityNumberRequirement !==
29372
- 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" })))));
29516
+ 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" }))),
29517
+ !!isBilling && (createElement("div", { style: { marginTop: "12px" } },
29518
+ createElement(Checkbox, { value: vm.isCorporate, label: "Kurumsal fatura", onChange: vm.onCorporateChange }))),
29519
+ !!vm.isCorporate && (createElement("div", { className: [commonStyles.Grid, commonStyles.Grid2].join(" "), style: { marginTop: "12px" } },
29520
+ createElement(FormItem, { type: FormItemType.TEXT, label: "\u015Eirket \u00DCnvan\u0131", value: vm.address.company || "", onChange: vm.onCompanyChange }),
29521
+ createElement(FormItem, { type: FormItemType.TEXT, label: "Vergi Numaras\u0131", value: ((_g = vm.address) === null || _g === void 0 ? void 0 : _g.taxNumber) || "", onChange: vm.onTaxNumberChange }),
29522
+ createElement(FormItem, { type: FormItemType.TEXT, label: "Vergi Dairesi", value: ((_h = vm.address) === null || _h === void 0 ? void 0 : _h.taxOffice) || "", onChange: vm.onTaxOfficeChange })))));
29373
29523
  });
29374
29524
 
29375
29525
  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:focus {\n outline: 0; }\n .style-module_Button__1UPMN.style-module_Large__2wPlw {\n height: 64px;\n padding: 0 1.7em; }\n .style-module_Button__1UPMN.style-module_Medium__3t0pu {\n height: 3em;\n padding: 0.5em 1em; }\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: #FAFAFA;\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";
@@ -29459,7 +29609,7 @@ var CheckoutStepInfo = observer(function (_a) {
29459
29609
  !!vm.customerStore.customer &&
29460
29610
  !!vm.customerStore.customer.addresses.length && (createElement("div", { className: styles$2.RowPB },
29461
29611
  createElement(FormItem, { type: FormItemType.SELECT, label: "Kaydedilen adresler", value: vm.selectedShippingAddressId, onChange: vm.onSelectedShippingAddressIdChange, options: vm.customerAddressOptions }))),
29462
- createElement(AddressForm$1, { address: vm.checkout.shippingAddress, customer: vm.checkout.customer && vm.checkout.customer.id
29612
+ createElement(AddressForm$1, { vm: vm, address: vm.checkout.shippingAddress, customer: vm.checkout.customer && vm.checkout.customer.id
29463
29613
  ? undefined
29464
29614
  : vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, allowedCountryIds: vm.shippingCountryIds || undefined, validationResult: vm.checkout.shippingAddress.validationResult }),
29465
29615
  !!vm.customerStore.customer && vm.selectedShippingAddressId === "-1" && (createElement("div", { style: { marginTop: "12px" } },
@@ -29674,7 +29824,7 @@ var BillingAddress = observer(function (_a) {
29674
29824
  !!vm.customerStore.customer &&
29675
29825
  !!vm.customerStore.customer.addresses.length && (createElement("div", { className: styles$2.RowPB },
29676
29826
  createElement(FormItem, { type: FormItemType.SELECT, label: "Kaydedilen adresler", value: vm.selectedBillingAddressId, onChange: vm.onSelectedBillingAddressIdChange, options: vm.customerAddressOptions }))),
29677
- createElement(AddressForm$1, { address: vm.checkout.billingAddress, customer: vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, validationResult: vm.checkout.billingAddress.validationResult }))),
29827
+ createElement(AddressForm$1, { vm: vm, address: vm.checkout.billingAddress, customer: vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, validationResult: vm.checkout.billingAddress.validationResult, isBilling: true }))),
29678
29828
  },
29679
29829
  ]; });
29680
29830
  return (createElement(Fragment, null,
@@ -29763,13 +29913,13 @@ var SVGCross = function (_a) {
29763
29913
  };
29764
29914
 
29765
29915
  var CartSummary = observer(function (_a) {
29766
- var _b;
29916
+ var _b, _c;
29767
29917
  var vm = _a.vm, allowExpand = _a.allowExpand;
29768
29918
  var cart = vm.cart;
29769
29919
  var checkout = vm.checkout;
29770
- var _c = useState(!allowExpand), isExpanded = _c[0], setExpanded = _c[1];
29771
- var _d = useState(0), detailsHeight = _d[0], setDetailsHeight = _d[1];
29772
- var _e = useState(null), detailsContainer = _e[0], setDetailsContainer = _e[1];
29920
+ var _d = useState(!allowExpand), isExpanded = _d[0], setExpanded = _d[1];
29921
+ var _e = useState(0), detailsHeight = _e[0], setDetailsHeight = _e[1];
29922
+ var _f = useState(null), detailsContainer = _f[0], setDetailsContainer = _f[1];
29773
29923
  useEffect(function () {
29774
29924
  if (!allowExpand)
29775
29925
  return;
@@ -29811,9 +29961,7 @@ var CartSummary = observer(function (_a) {
29811
29961
  createElement("span", { className: styles$f.Label }, expandHeaderLabel),
29812
29962
  createElement("div", { className: arrowDownClasses },
29813
29963
  createElement(SVGArrowDown, null))),
29814
- createElement("div", { className: styles$f.Price }, formatMoney(vm.installmentPrice ||
29815
- vm.checkout.totalFinalPrice ||
29816
- cart.totalPrice, cart.currencyCode)))),
29964
+ createElement("div", { className: styles$f.Price }, formatMoney(vm.finalPrice, cart.currencyCode)))),
29817
29965
  createElement("div", { className: styles$f.DetailsContainer, style: detailsContainerStyle },
29818
29966
  createElement("div", { className: styles$f.Details, ref: setDetailsContainer }, cart === null || cart === void 0 ? void 0 :
29819
29967
  cart.items.map(function (item, index) { return (createElement("div", { key: index },
@@ -29833,6 +29981,12 @@ var CartSummary = observer(function (_a) {
29833
29981
  createElement("div", { className: styles$f.Label }, "Vade Fark\u0131"),
29834
29982
  createElement("div", { className: styles$f.Value }, formatMoney(vm.installmentExtraPrice, cart.currencyCode)))),
29835
29983
  sortBy_1(vm.checkout.adjustments || [], "order").map(function (adjustment, index) { return (createElement("div", { className: styles$f.InfoRow, key: index },
29984
+ createElement("div", { className: styles$f.Label }, adjustment.name),
29985
+ createElement("div", { className: styles$f.Value },
29986
+ createElement("span", null, adjustment.type === "DECREMENT" ? "- " : ""),
29987
+ " ",
29988
+ createElement("span", null, formatMoney(adjustment.amount, cart.currencyCode))))); }),
29989
+ (((_c = vm.selectedPaymentGateway) === null || _c === void 0 ? void 0 : _c.getCalculatedAdditionalPrices(vm.checkout.totalFinalPrice || 0, vm.checkout.shippingLines || null)) || []).map(function (adjustment, index) { return (createElement("div", { className: styles$f.InfoRow, key: index },
29836
29990
  createElement("div", { className: styles$f.Label }, adjustment.name),
29837
29991
  createElement("div", { className: styles$f.Value },
29838
29992
  createElement("span", null, adjustment.type === "DECREMENT" ? "- " : ""),
@@ -29843,9 +29997,7 @@ var CartSummary = observer(function (_a) {
29843
29997
  createElement("div", { className: styles$f.Title }, "Toplam"),
29844
29998
  !!(cart === null || cart === void 0 ? void 0 : cart.totalTax) && (createElement("div", { className: styles$f.Tax }, formatMoney(cart.totalTax, cart.currencyCode) +
29845
29999
  " vergi dahil"))),
29846
- createElement("div", { className: styles$f.TotalPrice }, formatMoney(vm.installmentPrice ||
29847
- vm.checkout.totalFinalPrice ||
29848
- cart.totalPrice, cart.currencyCode)))))));
30000
+ createElement("div", { className: styles$f.TotalPrice }, formatMoney(vm.finalPrice, cart.currencyCode)))))));
29849
30001
  });
29850
30002
  var Coupon = observer(function (_a) {
29851
30003
  var vm = _a.vm;
@@ -32086,4 +32238,4 @@ var IkasBaseStore = /** @class */ (function () {
32086
32238
  return IkasBaseStore;
32087
32239
  }());
32088
32240
 
32089
- export { AccountInfoForm, index$3 as AccountPage, AddressForm, addresses as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$5 as BlogPage, _slug_$2 as BlogSlugPage, cart as CartPage, _id_$1 as CheckoutPage, ContactForm, _slug_ as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts as FavoriteProductsPage, ForgotPasswordForm, forgotPassword as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageComponentPropValue, IkasPageDataProvider, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home as IndexPage, LessThanRule, LoginForm, login as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$2 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$4 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword as RecoverPasswordPage, RegisterForm, register as RegisterPage, RequiredRule, search as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, decodeBase64, formatMoney, getPlaceholderBlog, getPlaceholderBrand, getPlaceholderCategory, getPlaceholderProduct, parseRangeStr, pascalCase, stringToSlug, validatePhoneNumber };
32241
+ export { AccountInfoForm, index$3 as AccountPage, AddressForm, addresses as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$5 as BlogPage, _slug_$2 as BlogSlugPage, cart as CartPage, _id_$1 as CheckoutPage, ContactForm, _slug_ as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts as FavoriteProductsPage, ForgotPasswordForm, forgotPassword as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutPage, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageComponentPropValue, IkasPageDataProvider, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home as IndexPage, LessThanRule, LoginForm, login as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$2 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$4 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword as RecoverPasswordPage, RegisterForm, register as RegisterPage, RequiredRule, search as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, decodeBase64, formatMoney, getPlaceholderBlog, getPlaceholderBrand, getPlaceholderCategory, getPlaceholderProduct, parseRangeStr, pascalCase, stringSorter, stringToSlug, validatePhoneNumber };
package/build/index.js CHANGED
@@ -11447,6 +11447,81 @@ var IkasCart = /** @class */ (function () {
11447
11447
  return IkasCart;
11448
11448
  }());
11449
11449
 
11450
+ var IkasPaymentGateway = /** @class */ (function () {
11451
+ function IkasPaymentGateway(data) {
11452
+ var _a;
11453
+ this.paymentMethods = data.paymentMethods || [];
11454
+ this.paymentMethodType =
11455
+ data.paymentMethodType || IkasPaymentMethodType.OTHER;
11456
+ this.id = data.id || null;
11457
+ this.name = data.name || "";
11458
+ this.testMode = data.testMode || null;
11459
+ this.description = data.description || null;
11460
+ this.additionalPrices =
11461
+ ((_a = data.additionalPrices) === null || _a === void 0 ? void 0 : _a.map(function (ap) { return new IkasPaymentGatewayAdditionalPrice(ap); })) || null;
11462
+ mobx.makeAutoObservable(this);
11463
+ }
11464
+ IkasPaymentGateway.prototype.getCalculatedAdditionalPrices = function (totalFinalPrice, shippingLines) {
11465
+ var _this = this;
11466
+ if (this.additionalPrices) {
11467
+ var shippingPrice = (shippingLines === null || shippingLines === void 0 ? void 0 : shippingLines.reduce(function (sum, item) { return sum + item.price; }, 0)) || 0;
11468
+ totalFinalPrice -= shippingPrice;
11469
+ return this.additionalPrices.map(function (additionalPrice) {
11470
+ var amount = 0;
11471
+ if (additionalPrice.amountType ===
11472
+ IkasPaymentGatewayAdditionalPriceAmountType.RATIO) {
11473
+ amount = ((totalFinalPrice || 0) * additionalPrice.amount) / 100;
11474
+ }
11475
+ else {
11476
+ amount = additionalPrice.amount;
11477
+ }
11478
+ if (additionalPrice.type ===
11479
+ IkasPaymentMethodAdditionalPriceType.DECREMENT)
11480
+ totalFinalPrice -= amount;
11481
+ else
11482
+ totalFinalPrice += amount;
11483
+ return {
11484
+ name: additionalPrice.name || _this.name,
11485
+ amount: amount,
11486
+ type: additionalPrice.type,
11487
+ };
11488
+ });
11489
+ }
11490
+ };
11491
+ return IkasPaymentGateway;
11492
+ }());
11493
+ var IkasPaymentGatewayAdditionalPrice = /** @class */ (function () {
11494
+ function IkasPaymentGatewayAdditionalPrice(data) {
11495
+ this.amount = data.amount || 0;
11496
+ this.amountType =
11497
+ data.amountType || IkasPaymentGatewayAdditionalPriceAmountType.AMOUNT;
11498
+ this.name = data.name || "";
11499
+ this.type = data.type || IkasPaymentMethodAdditionalPriceType.INCREMENT;
11500
+ mobx.makeAutoObservable(this);
11501
+ }
11502
+ return IkasPaymentGatewayAdditionalPrice;
11503
+ }());
11504
+ var IkasPaymentMethodType;
11505
+ (function (IkasPaymentMethodType) {
11506
+ IkasPaymentMethodType["BUY_ONLINE_PAY_AT_STORE"] = "BUY_ONLINE_PAY_AT_STORE";
11507
+ IkasPaymentMethodType["CASH"] = "CASH";
11508
+ IkasPaymentMethodType["CASH_ON_DELIVERY"] = "CASH_ON_DELIVERY";
11509
+ IkasPaymentMethodType["CREDIT_CARD"] = "CREDIT_CARD";
11510
+ IkasPaymentMethodType["GIFT_CARD"] = "GIFT_CARD";
11511
+ IkasPaymentMethodType["MONEY_ORDER"] = "MONEY_ORDER";
11512
+ IkasPaymentMethodType["OTHER"] = "OTHER";
11513
+ })(IkasPaymentMethodType || (IkasPaymentMethodType = {}));
11514
+ var IkasPaymentMethodAdditionalPriceType;
11515
+ (function (IkasPaymentMethodAdditionalPriceType) {
11516
+ IkasPaymentMethodAdditionalPriceType["DECREMENT"] = "DECREMENT";
11517
+ IkasPaymentMethodAdditionalPriceType["INCREMENT"] = "INCREMENT";
11518
+ })(IkasPaymentMethodAdditionalPriceType || (IkasPaymentMethodAdditionalPriceType = {}));
11519
+ var IkasPaymentGatewayAdditionalPriceAmountType;
11520
+ (function (IkasPaymentGatewayAdditionalPriceAmountType) {
11521
+ IkasPaymentGatewayAdditionalPriceAmountType["AMOUNT"] = "AMOUNT";
11522
+ IkasPaymentGatewayAdditionalPriceAmountType["RATIO"] = "RATIO";
11523
+ })(IkasPaymentGatewayAdditionalPriceAmountType || (IkasPaymentGatewayAdditionalPriceAmountType = {}));
11524
+
11450
11525
  var IkasCheckout = /** @class */ (function () {
11451
11526
  function IkasCheckout(data) {
11452
11527
  if (data === void 0) { data = {}; }
@@ -11474,6 +11549,7 @@ var IkasCheckout = /** @class */ (function () {
11474
11549
  this.note = null;
11475
11550
  // Extra
11476
11551
  this.appliedCouponCode = null;
11552
+ this.selectedPaymentGateway = null;
11477
11553
  this.id = data.id;
11478
11554
  this.createdAt = data.createdAt;
11479
11555
  this.updatedAt = data.updatedAt;
@@ -11545,6 +11621,22 @@ var IkasCheckout = /** @class */ (function () {
11545
11621
  enumerable: false,
11546
11622
  configurable: true
11547
11623
  });
11624
+ Object.defineProperty(IkasCheckout.prototype, "$totalFinalPrice", {
11625
+ get: function () {
11626
+ var _a;
11627
+ var calculatedAdditionalPrices = (_a = this.selectedPaymentGateway) === null || _a === void 0 ? void 0 : _a.getCalculatedAdditionalPrices(this.totalFinalPrice || 0, this.shippingLines || null);
11628
+ var total = this.totalFinalPrice || 0;
11629
+ calculatedAdditionalPrices === null || calculatedAdditionalPrices === void 0 ? void 0 : calculatedAdditionalPrices.forEach(function (additionalPrice) {
11630
+ if (additionalPrice.type === IkasPaymentMethodAdditionalPriceType.DECREMENT)
11631
+ total -= additionalPrice.amount;
11632
+ else
11633
+ total += additionalPrice.amount;
11634
+ });
11635
+ return total;
11636
+ },
11637
+ enumerable: false,
11638
+ configurable: true
11639
+ });
11548
11640
  return IkasCheckout;
11549
11641
  }());
11550
11642
  (function (IkasShippingMethod) {
@@ -16172,17 +16264,6 @@ var sortBy = _baseRest(function(collection, iteratees) {
16172
16264
 
16173
16265
  var sortBy_1 = sortBy;
16174
16266
 
16175
- var IkasPaymentMethodType;
16176
- (function (IkasPaymentMethodType) {
16177
- IkasPaymentMethodType["BUY_ONLINE_PAY_AT_STORE"] = "BUY_ONLINE_PAY_AT_STORE";
16178
- IkasPaymentMethodType["CASH"] = "CASH";
16179
- IkasPaymentMethodType["CASH_ON_DELIVERY"] = "CASH_ON_DELIVERY";
16180
- IkasPaymentMethodType["CREDIT_CARD"] = "CREDIT_CARD";
16181
- IkasPaymentMethodType["GIFT_CARD"] = "GIFT_CARD";
16182
- IkasPaymentMethodType["MONEY_ORDER"] = "MONEY_ORDER";
16183
- IkasPaymentMethodType["OTHER"] = "OTHER";
16184
- })(IkasPaymentMethodType || (IkasPaymentMethodType = {}));
16185
-
16186
16267
  var CreditCardData = /** @class */ (function () {
16187
16268
  function CreditCardData(data) {
16188
16269
  var _this = this;
@@ -16826,6 +16907,7 @@ var CheckoutViewModel = /** @class */ (function () {
16826
16907
  if (paymentGateway.paymentMethodType === IkasPaymentMethodType.CREDIT_CARD) {
16827
16908
  _this.cardData = new CreditCardData();
16828
16909
  }
16910
+ _this.checkout.selectedPaymentGateway = paymentGateway;
16829
16911
  _this.installmentInfo = undefined;
16830
16912
  };
16831
16913
  this.setInstallmentCount = function (count) {
@@ -16946,6 +17028,13 @@ var CheckoutViewModel = /** @class */ (function () {
16946
17028
  enumerable: false,
16947
17029
  configurable: true
16948
17030
  });
17031
+ Object.defineProperty(CheckoutViewModel.prototype, "finalPrice", {
17032
+ get: function () {
17033
+ return this.installmentPrice || this.checkout.$totalFinalPrice;
17034
+ },
17035
+ enumerable: false,
17036
+ configurable: true
17037
+ });
16949
17038
  Object.defineProperty(CheckoutViewModel.prototype, "canProceedToShipping", {
16950
17039
  // VALIDATIONS
16951
17040
  get: function () {
@@ -21169,6 +21258,22 @@ var OrderStatusEnum;
21169
21258
  OrderStatusEnum["REFUND_REJECTED"] = "REFUND_REJECTED";
21170
21259
  OrderStatusEnum["REFUND_REQUESTED"] = "REFUND_REQUESTED";
21171
21260
  })(OrderStatusEnum || (OrderStatusEnum = {}));
21261
+ /**
21262
+ * Payment Gateway Additional Price Type Enum
21263
+ */
21264
+ var PaymentGatewayAdditionalPriceTypeEnum;
21265
+ (function (PaymentGatewayAdditionalPriceTypeEnum) {
21266
+ PaymentGatewayAdditionalPriceTypeEnum["DECREMENT"] = "DECREMENT";
21267
+ PaymentGatewayAdditionalPriceTypeEnum["INCREMENT"] = "INCREMENT";
21268
+ })(PaymentGatewayAdditionalPriceTypeEnum || (PaymentGatewayAdditionalPriceTypeEnum = {}));
21269
+ /**
21270
+ * Payment Gateway Transaction Fee Type Enum
21271
+ */
21272
+ var PaymentGatewayTransactionFeeTypeEnum;
21273
+ (function (PaymentGatewayTransactionFeeTypeEnum) {
21274
+ PaymentGatewayTransactionFeeTypeEnum["AMOUNT"] = "AMOUNT";
21275
+ PaymentGatewayTransactionFeeTypeEnum["RATIO"] = "RATIO";
21276
+ })(PaymentGatewayTransactionFeeTypeEnum || (PaymentGatewayTransactionFeeTypeEnum = {}));
21172
21277
  /**
21173
21278
  * Payment Method Enum
21174
21279
  */
@@ -21241,6 +21346,12 @@ var ProductFilterTypeEnum;
21241
21346
  ProductFilterTypeEnum["TAG"] = "TAG";
21242
21347
  ProductFilterTypeEnum["VARIANT_TYPE"] = "VARIANT_TYPE";
21243
21348
  })(ProductFilterTypeEnum || (ProductFilterTypeEnum = {}));
21349
+ var ProductSearchShowStockOptionEnum;
21350
+ (function (ProductSearchShowStockOptionEnum) {
21351
+ ProductSearchShowStockOptionEnum["HIDE_OUT_OF_STOCK"] = "HIDE_OUT_OF_STOCK";
21352
+ ProductSearchShowStockOptionEnum["SHOW_ALL"] = "SHOW_ALL";
21353
+ ProductSearchShowStockOptionEnum["SHOW_OUT_OF_STOCK_AT_END"] = "SHOW_OUT_OF_STOCK_AT_END";
21354
+ })(ProductSearchShowStockOptionEnum || (ProductSearchShowStockOptionEnum = {}));
21244
21355
  /**
21245
21356
  * Shipping Method Enum
21246
21357
  */
@@ -25366,7 +25477,23 @@ var pascalCase = function (str) {
25366
25477
  var decodeBase64 = function (base64) {
25367
25478
  var buffer = Buffer.from(base64, "base64");
25368
25479
  return buffer.toString("ascii");
25369
- };
25480
+ };
25481
+ function stringSorter(atitle, btitle) {
25482
+ var alphabet = "0123456789AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz";
25483
+ var _atitle = atitle || "";
25484
+ var _btitle = btitle || "";
25485
+ if (_atitle.length === 0 || _btitle.length === 0) {
25486
+ return _atitle.length - _btitle.length;
25487
+ }
25488
+ for (var i = 0; i < _atitle.length && i < _btitle.length; i++) {
25489
+ var ai = alphabet.indexOf(_atitle[i].toUpperCase());
25490
+ var bi = alphabet.indexOf(_btitle[i].toUpperCase());
25491
+ if (ai !== bi) {
25492
+ return ai - bi;
25493
+ }
25494
+ }
25495
+ return 0;
25496
+ }
25370
25497
 
25371
25498
  var ThemeComponent = mobxReactLite.observer(function (_a) {
25372
25499
  var pageComponentPropValue = _a.pageComponentPropValue, index = _a.index, settings = _a.settings;
@@ -27301,7 +27428,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
27301
27428
  return __generator(this, function (_b) {
27302
27429
  switch (_b.label) {
27303
27430
  case 0:
27304
- QUERY = src(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query listPaymentGateway($id: StringFilterInput) {\n listPaymentGateway(id: $id) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n }\n }\n "], ["\n query listPaymentGateway($id: StringFilterInput) {\n listPaymentGateway(id: $id) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n }\n }\n "])));
27431
+ QUERY = src(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query listPaymentGateway($id: StringFilterInput) {\n listPaymentGateway(id: $id) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n additionalPrices {\n amount\n amountType\n name\n type\n }\n }\n }\n "], ["\n query listPaymentGateway($id: StringFilterInput) {\n listPaymentGateway(id: $id) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n additionalPrices {\n amount\n amountType\n name\n type\n }\n }\n }\n "])));
27305
27432
  _b.label = 1;
27306
27433
  case 1:
27307
27434
  _b.trys.push([1, 3, , 4]);
@@ -27319,7 +27446,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
27319
27446
  console.log(errors);
27320
27447
  }
27321
27448
  if (data)
27322
- return [2 /*return*/, data.listPaymentGateway];
27449
+ return [2 /*return*/, data.listPaymentGateway.map(function (pg) { return new IkasPaymentGateway(pg); })];
27323
27450
  return [3 /*break*/, 4];
27324
27451
  case 3:
27325
27452
  err_5 = _b.sent();
@@ -27495,20 +27622,23 @@ var templateObject_1$5;
27495
27622
  var IkasCountryAPI = /** @class */ (function () {
27496
27623
  function IkasCountryAPI() {
27497
27624
  }
27498
- IkasCountryAPI.listCountries = function (iso2List) {
27625
+ IkasCountryAPI.listCountries = function (iso2List, idList) {
27499
27626
  return __awaiter(this, void 0, void 0, function () {
27500
27627
  var QUERY, _a, data, errors, err_1;
27501
27628
  return __generator(this, function (_b) {
27502
27629
  switch (_b.label) {
27503
27630
  case 0:
27504
- QUERY = src(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n query listCountry($iso2: StringFilterInput) {\n listCountry(iso2: $iso2) {\n id\n name\n native\n iso2\n iso3\n phoneCode\n locationTranslations {\n tr\n en\n }\n }\n }\n "], ["\n query listCountry($iso2: StringFilterInput) {\n listCountry(iso2: $iso2) {\n id\n name\n native\n iso2\n iso3\n phoneCode\n locationTranslations {\n tr\n en\n }\n }\n }\n "])));
27631
+ QUERY = src(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n query listCountry($iso2: StringFilterInput, $id: StringFilterInput) {\n listCountry(iso2: $iso2, id: $id) {\n id\n name\n native\n iso2\n iso3\n phoneCode\n locationTranslations {\n tr\n en\n }\n }\n }\n "], ["\n query listCountry($iso2: StringFilterInput, $id: StringFilterInput) {\n listCountry(iso2: $iso2, id: $id) {\n id\n name\n native\n iso2\n iso3\n phoneCode\n locationTranslations {\n tr\n en\n }\n }\n }\n "])));
27505
27632
  _b.label = 1;
27506
27633
  case 1:
27507
27634
  _b.trys.push([1, 3, , 4]);
27508
- return [4 /*yield*/, apollo.getClient().query({
27635
+ return [4 /*yield*/, apollo
27636
+ .getClient()
27637
+ .query({
27509
27638
  query: QUERY,
27510
27639
  variables: {
27511
27640
  iso2: iso2List ? { in: iso2List } : undefined,
27641
+ id: idList ? { in: idList } : undefined,
27512
27642
  },
27513
27643
  })];
27514
27644
  case 2:
@@ -28939,7 +29069,7 @@ var SVGCheck = function (_a) {
28939
29069
  React.createElement("path", { fill: "currentColor", d: "M12.6 8.1l-3.7-3.8 1-1.1 2.7 2.7 5.5-5.4 1 1z" })));
28940
29070
  };
28941
29071
 
28942
- var css_248z$1 = ".style-module_CheckboxWrapper__2tSbx {\n width: 100%;\n display: flex;\n padding: 0.5em;\n cursor: pointer;\n user-select: none; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxContainer__1zRvT {\n position: relative;\n width: 20px;\n height: 20px;\n margin-right: 0.75em; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxBorder__281X3 {\n flex: 0 0 auto;\n width: 20px;\n height: 20px;\n border-radius: 4px;\n border: 1px solid #d9d9d9;\n position: absolute;\n top: 0;\n left: 0;\n transition: border-width .2s ease-in-out; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxBorder__281X3.style-module_Checked__3-ZM4 {\n border: 10px solid #111111; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxTick__2LpQ- {\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n color: white;\n z-index: 2;\n transition: all 0.2s ease-in-out;\n transition-delay: .1s;\n opacity: 0;\n transform: scale(0.2); }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxTick__2LpQ-.style-module_Visible__2Ng5Q {\n opacity: 1;\n transform: scale(1.2); }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxLabel__30uMC {\n flex: 1 1 auto;\n font-weight: normal;\n font-size: 0.85em;\n color: #545454; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxLabelError__FmdxF {\n color: #ff6d6d; }\n";
29072
+ var css_248z$1 = ".style-module_CheckboxWrapper__2tSbx {\n width: 100%;\n display: flex;\n padding: 0.5em;\n cursor: pointer;\n user-select: none;\n align-items: center; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxContainer__1zRvT {\n position: relative;\n width: 20px;\n height: 20px;\n margin-right: 0.75em; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxBorder__281X3 {\n flex: 0 0 auto;\n width: 20px;\n height: 20px;\n border-radius: 4px;\n border: 1px solid #d9d9d9;\n position: absolute;\n top: 0;\n left: 0;\n transition: border-width .2s ease-in-out; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxBorder__281X3.style-module_Checked__3-ZM4 {\n border: 10px solid #111111; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxTick__2LpQ- {\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n color: white;\n z-index: 2;\n transition: all 0.2s ease-in-out;\n transition-delay: .1s;\n opacity: 0;\n transform: scale(0.2); }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxTick__2LpQ-.style-module_Visible__2Ng5Q {\n opacity: 1;\n transform: scale(1.2); }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxLabel__30uMC {\n flex: 1 1 auto;\n font-weight: normal;\n font-size: 0.85em;\n color: #545454; }\n .style-module_CheckboxWrapper__2tSbx .style-module_CheckboxLabelError__FmdxF {\n color: #ff6d6d; }\n";
28943
29073
  var styles$1 = {"CheckboxWrapper":"style-module_CheckboxWrapper__2tSbx","CheckboxContainer":"style-module_CheckboxContainer__1zRvT","CheckboxBorder":"style-module_CheckboxBorder__281X3","Checked":"style-module_Checked__3-ZM4","CheckboxTick":"style-module_CheckboxTick__2LpQ-","Visible":"style-module_Visible__2Ng5Q","CheckboxLabel":"style-module_CheckboxLabel__30uMC","CheckboxLabelError":"style-module_CheckboxLabelError__FmdxF"};
28944
29074
  styleInject(css_248z$1);
28945
29075
 
@@ -28974,6 +29104,7 @@ var AddressFormViewModel = /** @class */ (function () {
28974
29104
  this.cities = [];
28975
29105
  this.districts = [];
28976
29106
  this.allowedCountryIds = null;
29107
+ this.isCorporate = false;
28977
29108
  this.fillDropdownOptions = function () { return __awaiter(_this, void 0, void 0, function () {
28978
29109
  return __generator(this, function (_a) {
28979
29110
  switch (_a.label) {
@@ -28994,24 +29125,25 @@ var AddressFormViewModel = /** @class */ (function () {
28994
29125
  });
28995
29126
  }); };
28996
29127
  this.listCountries = function () { return __awaiter(_this, void 0, void 0, function () {
28997
- var countries;
28998
- var _this = this;
28999
- return __generator(this, function (_a) {
29000
- switch (_a.label) {
29128
+ var countries, currentRouting_1;
29129
+ var _a, _b;
29130
+ return __generator(this, function (_c) {
29131
+ switch (_c.label) {
29001
29132
  case 0:
29002
- _a.trys.push([0, 2, , 3]);
29003
- return [4 /*yield*/, IkasCountryAPI.listCountries()];
29133
+ _c.trys.push([0, 2, , 3]);
29134
+ return [4 /*yield*/, IkasCountryAPI.listCountries(undefined, ((_a = this.allowedCountryIds) === null || _a === void 0 ? void 0 : _a.length) ? this.allowedCountryIds : undefined)];
29004
29135
  case 1:
29005
- countries = _a.sent();
29006
- if (this.allowedCountryIds) {
29007
- countries = countries.filter(function (c) { var _a; return (_a = _this.allowedCountryIds) === null || _a === void 0 ? void 0 : _a.includes(c.id); });
29136
+ countries = _c.sent();
29137
+ currentRouting_1 = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; });
29138
+ if ((_b = currentRouting_1 === null || currentRouting_1 === void 0 ? void 0 : currentRouting_1.countryCodes) === null || _b === void 0 ? void 0 : _b.length) {
29139
+ countries = countries.filter(function (c) { var _a; return c.iso2 && ((_a = currentRouting_1.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(c.iso2)); });
29008
29140
  }
29009
29141
  this.countries = countries;
29010
29142
  if (this.countries.length === 1 && !this.country)
29011
29143
  this.onCountryChange(this.countries[0].id);
29012
29144
  return [3 /*break*/, 3];
29013
29145
  case 2:
29014
- _a.sent();
29146
+ _c.sent();
29015
29147
  return [3 /*break*/, 3];
29016
29148
  case 3: return [2 /*return*/];
29017
29149
  }
@@ -29192,6 +29324,24 @@ var AddressFormViewModel = /** @class */ (function () {
29192
29324
  name: value,
29193
29325
  };
29194
29326
  };
29327
+ this.onCorporateChange = function (value) {
29328
+ _this.isCorporate = value;
29329
+ if (!value) {
29330
+ _this.address.company = null;
29331
+ _this.address.taxNumber = null;
29332
+ _this.address.taxOffice = null;
29333
+ }
29334
+ };
29335
+ this.onCompanyChange = function (value) {
29336
+ _this.address.company = value;
29337
+ };
29338
+ this.onTaxNumberChange = function (value) {
29339
+ _this.address.taxNumber = value;
29340
+ };
29341
+ this.onTaxOfficeChange = function (value) {
29342
+ _this.address.taxOffice = value;
29343
+ };
29344
+ this.vm = data.vm;
29195
29345
  this.address = data.address;
29196
29346
  this.customer = data.customer;
29197
29347
  this.allowedCountryIds = data.allowedCountryIds;
@@ -29258,11 +29408,7 @@ var AddressFormViewModel = /** @class */ (function () {
29258
29408
  Object.defineProperty(AddressFormViewModel.prototype, "countryOptions", {
29259
29409
  get: function () {
29260
29410
  var list = this.countries.map(this.modelToOption);
29261
- list.sort(function (a, b) {
29262
- return a.label.toLocaleLowerCase("tr-TR") > b.label.toLocaleLowerCase("tr-TR")
29263
- ? 1
29264
- : -1;
29265
- });
29411
+ list.sort(function (a, b) { return stringSorter(a.label, b.label); });
29266
29412
  return list;
29267
29413
  },
29268
29414
  enumerable: false,
@@ -29285,11 +29431,7 @@ var AddressFormViewModel = /** @class */ (function () {
29285
29431
  Object.defineProperty(AddressFormViewModel.prototype, "districtOptions", {
29286
29432
  get: function () {
29287
29433
  var list = this.districts.map(this.modelToOption);
29288
- list.sort(function (a, b) {
29289
- return a.label.toLocaleLowerCase("tr-TR") > b.label.toLocaleLowerCase("tr-TR")
29290
- ? 1
29291
- : -1;
29292
- });
29434
+ list.sort(function (a, b) { return stringSorter(a.label, b.label); });
29293
29435
  return list;
29294
29436
  },
29295
29437
  enumerable: false,
@@ -29315,9 +29457,11 @@ var styles$2 = {"CheckoutPage":"style-module_CheckoutPage__A_f2V","Left":"style-
29315
29457
  styleInject(css_248z$3);
29316
29458
 
29317
29459
  var AddressForm$1 = mobxReactLite.observer(function (_a) {
29318
- var _b, _c, _d, _e, _f;
29319
- var isErrorsVisible = _a.isErrorsVisible, validationResult = _a.validationResult, props = __rest(_a, ["isErrorsVisible", "validationResult"]);
29320
- var vm = React.useState(function () { return new AddressFormViewModel(props); })[0];
29460
+ var _b, _c, _d, _e, _f, _g, _h;
29461
+ var isErrorsVisible = _a.isErrorsVisible, isBilling = _a.isBilling, validationResult = _a.validationResult, props = __rest(_a, ["isErrorsVisible", "isBilling", "validationResult"]);
29462
+ var vm = React.useState(function () {
29463
+ return new AddressFormViewModel(__assign({}, props));
29464
+ })[0];
29321
29465
  React.useEffect(function () {
29322
29466
  Object.entries(props).forEach(function (entry) {
29323
29467
  return mobx.runInAction(function () {
@@ -29348,7 +29492,13 @@ var AddressForm$1 = mobxReactLite.observer(function (_a) {
29348
29492
  IkasCheckoutRequirementEnum.INVISIBLE && (React.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" })),
29349
29493
  !!vm.address.checkoutSettings &&
29350
29494
  vm.address.checkoutSettings.identityNumberRequirement !==
29351
- IkasCheckoutRequirementEnum.INVISIBLE && (React.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" })))));
29495
+ IkasCheckoutRequirementEnum.INVISIBLE && (React.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" }))),
29496
+ !!isBilling && (React.createElement("div", { style: { marginTop: "12px" } },
29497
+ React.createElement(Checkbox, { value: vm.isCorporate, label: "Kurumsal fatura", onChange: vm.onCorporateChange }))),
29498
+ !!vm.isCorporate && (React.createElement("div", { className: [commonStyles.Grid, commonStyles.Grid2].join(" "), style: { marginTop: "12px" } },
29499
+ React.createElement(FormItem, { type: FormItemType.TEXT, label: "\u015Eirket \u00DCnvan\u0131", value: vm.address.company || "", onChange: vm.onCompanyChange }),
29500
+ React.createElement(FormItem, { type: FormItemType.TEXT, label: "Vergi Numaras\u0131", value: ((_g = vm.address) === null || _g === void 0 ? void 0 : _g.taxNumber) || "", onChange: vm.onTaxNumberChange }),
29501
+ React.createElement(FormItem, { type: FormItemType.TEXT, label: "Vergi Dairesi", value: ((_h = vm.address) === null || _h === void 0 ? void 0 : _h.taxOffice) || "", onChange: vm.onTaxOfficeChange })))));
29352
29502
  });
29353
29503
 
29354
29504
  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:focus {\n outline: 0; }\n .style-module_Button__1UPMN.style-module_Large__2wPlw {\n height: 64px;\n padding: 0 1.7em; }\n .style-module_Button__1UPMN.style-module_Medium__3t0pu {\n height: 3em;\n padding: 0.5em 1em; }\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: #FAFAFA;\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";
@@ -29438,7 +29588,7 @@ var CheckoutStepInfo = mobxReactLite.observer(function (_a) {
29438
29588
  !!vm.customerStore.customer &&
29439
29589
  !!vm.customerStore.customer.addresses.length && (React.createElement("div", { className: styles$2.RowPB },
29440
29590
  React.createElement(FormItem, { type: FormItemType.SELECT, label: "Kaydedilen adresler", value: vm.selectedShippingAddressId, onChange: vm.onSelectedShippingAddressIdChange, options: vm.customerAddressOptions }))),
29441
- React.createElement(AddressForm$1, { address: vm.checkout.shippingAddress, customer: vm.checkout.customer && vm.checkout.customer.id
29591
+ React.createElement(AddressForm$1, { vm: vm, address: vm.checkout.shippingAddress, customer: vm.checkout.customer && vm.checkout.customer.id
29442
29592
  ? undefined
29443
29593
  : vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, allowedCountryIds: vm.shippingCountryIds || undefined, validationResult: vm.checkout.shippingAddress.validationResult }),
29444
29594
  !!vm.customerStore.customer && vm.selectedShippingAddressId === "-1" && (React.createElement("div", { style: { marginTop: "12px" } },
@@ -29653,7 +29803,7 @@ var BillingAddress = mobxReactLite.observer(function (_a) {
29653
29803
  !!vm.customerStore.customer &&
29654
29804
  !!vm.customerStore.customer.addresses.length && (React.createElement("div", { className: styles$2.RowPB },
29655
29805
  React.createElement(FormItem, { type: FormItemType.SELECT, label: "Kaydedilen adresler", value: vm.selectedBillingAddressId, onChange: vm.onSelectedBillingAddressIdChange, options: vm.customerAddressOptions }))),
29656
- React.createElement(AddressForm$1, { address: vm.checkout.billingAddress, customer: vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, validationResult: vm.checkout.billingAddress.validationResult }))),
29806
+ React.createElement(AddressForm$1, { vm: vm, address: vm.checkout.billingAddress, customer: vm.checkout.customer || undefined, isErrorsVisible: vm.isErrorsVisible, validationResult: vm.checkout.billingAddress.validationResult, isBilling: true }))),
29657
29807
  },
29658
29808
  ]; });
29659
29809
  return (React.createElement(React.Fragment, null,
@@ -29742,13 +29892,13 @@ var SVGCross = function (_a) {
29742
29892
  };
29743
29893
 
29744
29894
  var CartSummary = mobxReactLite.observer(function (_a) {
29745
- var _b;
29895
+ var _b, _c;
29746
29896
  var vm = _a.vm, allowExpand = _a.allowExpand;
29747
29897
  var cart = vm.cart;
29748
29898
  var checkout = vm.checkout;
29749
- var _c = React.useState(!allowExpand), isExpanded = _c[0], setExpanded = _c[1];
29750
- var _d = React.useState(0), detailsHeight = _d[0], setDetailsHeight = _d[1];
29751
- var _e = React.useState(null), detailsContainer = _e[0], setDetailsContainer = _e[1];
29899
+ var _d = React.useState(!allowExpand), isExpanded = _d[0], setExpanded = _d[1];
29900
+ var _e = React.useState(0), detailsHeight = _e[0], setDetailsHeight = _e[1];
29901
+ var _f = React.useState(null), detailsContainer = _f[0], setDetailsContainer = _f[1];
29752
29902
  React.useEffect(function () {
29753
29903
  if (!allowExpand)
29754
29904
  return;
@@ -29790,9 +29940,7 @@ var CartSummary = mobxReactLite.observer(function (_a) {
29790
29940
  React.createElement("span", { className: styles$f.Label }, expandHeaderLabel),
29791
29941
  React.createElement("div", { className: arrowDownClasses },
29792
29942
  React.createElement(SVGArrowDown, null))),
29793
- React.createElement("div", { className: styles$f.Price }, formatMoney(vm.installmentPrice ||
29794
- vm.checkout.totalFinalPrice ||
29795
- cart.totalPrice, cart.currencyCode)))),
29943
+ React.createElement("div", { className: styles$f.Price }, formatMoney(vm.finalPrice, cart.currencyCode)))),
29796
29944
  React.createElement("div", { className: styles$f.DetailsContainer, style: detailsContainerStyle },
29797
29945
  React.createElement("div", { className: styles$f.Details, ref: setDetailsContainer }, cart === null || cart === void 0 ? void 0 :
29798
29946
  cart.items.map(function (item, index) { return (React.createElement("div", { key: index },
@@ -29812,6 +29960,12 @@ var CartSummary = mobxReactLite.observer(function (_a) {
29812
29960
  React.createElement("div", { className: styles$f.Label }, "Vade Fark\u0131"),
29813
29961
  React.createElement("div", { className: styles$f.Value }, formatMoney(vm.installmentExtraPrice, cart.currencyCode)))),
29814
29962
  sortBy_1(vm.checkout.adjustments || [], "order").map(function (adjustment, index) { return (React.createElement("div", { className: styles$f.InfoRow, key: index },
29963
+ React.createElement("div", { className: styles$f.Label }, adjustment.name),
29964
+ React.createElement("div", { className: styles$f.Value },
29965
+ React.createElement("span", null, adjustment.type === "DECREMENT" ? "- " : ""),
29966
+ " ",
29967
+ React.createElement("span", null, formatMoney(adjustment.amount, cart.currencyCode))))); }),
29968
+ (((_c = vm.selectedPaymentGateway) === null || _c === void 0 ? void 0 : _c.getCalculatedAdditionalPrices(vm.checkout.totalFinalPrice || 0, vm.checkout.shippingLines || null)) || []).map(function (adjustment, index) { return (React.createElement("div", { className: styles$f.InfoRow, key: index },
29815
29969
  React.createElement("div", { className: styles$f.Label }, adjustment.name),
29816
29970
  React.createElement("div", { className: styles$f.Value },
29817
29971
  React.createElement("span", null, adjustment.type === "DECREMENT" ? "- " : ""),
@@ -29822,9 +29976,7 @@ var CartSummary = mobxReactLite.observer(function (_a) {
29822
29976
  React.createElement("div", { className: styles$f.Title }, "Toplam"),
29823
29977
  !!(cart === null || cart === void 0 ? void 0 : cart.totalTax) && (React.createElement("div", { className: styles$f.Tax }, formatMoney(cart.totalTax, cart.currencyCode) +
29824
29978
  " vergi dahil"))),
29825
- React.createElement("div", { className: styles$f.TotalPrice }, formatMoney(vm.installmentPrice ||
29826
- vm.checkout.totalFinalPrice ||
29827
- cart.totalPrice, cart.currencyCode)))))));
29979
+ React.createElement("div", { className: styles$f.TotalPrice }, formatMoney(vm.finalPrice, cart.currencyCode)))))));
29828
29980
  });
29829
29981
  var Coupon = mobxReactLite.observer(function (_a) {
29830
29982
  var vm = _a.vm;
@@ -32193,5 +32345,6 @@ exports.getPlaceholderCategory = getPlaceholderCategory;
32193
32345
  exports.getPlaceholderProduct = getPlaceholderProduct;
32194
32346
  exports.parseRangeStr = parseRangeStr;
32195
32347
  exports.pascalCase = pascalCase;
32348
+ exports.stringSorter = stringSorter;
32196
32349
  exports.stringToSlug = stringToSlug;
32197
32350
  exports.validatePhoneNumber = validatePhoneNumber;
@@ -2,6 +2,7 @@ import { IkasOrderAddress } from "../order/address/index";
2
2
  import { IkasOrderShippingLine } from "../order/shipping-line/index";
3
3
  import { IkasCart } from "../cart/index";
4
4
  import { IkasOrderAdjustment } from "../order/index";
5
+ import { IkasPaymentGateway } from "../payment-gateway/index";
5
6
  export declare class IkasCheckout {
6
7
  id?: string | null;
7
8
  createdAt?: string | null;
@@ -27,12 +28,14 @@ export declare class IkasCheckout {
27
28
  adjustments?: IkasOrderAdjustment[] | null;
28
29
  note: string | null;
29
30
  appliedCouponCode?: string | null;
31
+ selectedPaymentGateway?: IkasPaymentGateway | null;
30
32
  constructor(data?: Partial<IkasCheckout>);
31
33
  get shippingTotal(): number;
32
34
  get hasCustomer(): boolean;
33
35
  get hasValidCustomer(): boolean;
34
36
  get customerText(): string;
35
37
  get dateStr(): string;
38
+ get $totalFinalPrice(): number;
36
39
  }
37
40
  export declare type IkasCheckoutCustomer = {
38
41
  id?: string;
@@ -1,15 +1,30 @@
1
- export declare type IkasPaymentGateway = {
1
+ import { IkasOrderShippingLine } from "../order/shipping-line/index";
2
+ export declare class IkasPaymentGateway {
2
3
  paymentMethods: IkasPaymentMethod[];
3
4
  paymentMethodType: IkasPaymentMethodType;
4
5
  id: string | null;
5
6
  name: string;
6
7
  testMode: boolean | null;
7
8
  description: string | null;
8
- };
9
+ additionalPrices: IkasPaymentGatewayAdditionalPrice[] | null;
10
+ constructor(data: Partial<IkasPaymentGateway>);
11
+ getCalculatedAdditionalPrices(totalFinalPrice: number, shippingLines: IkasOrderShippingLine[] | null): {
12
+ name: string;
13
+ amount: number;
14
+ type: IkasPaymentMethodAdditionalPriceType;
15
+ }[] | undefined;
16
+ }
9
17
  export declare type IkasPaymentMethod = {
10
18
  name: string;
11
19
  logoUrl: string | null;
12
20
  };
21
+ export declare class IkasPaymentGatewayAdditionalPrice {
22
+ amount: number;
23
+ amountType: IkasPaymentGatewayAdditionalPriceAmountType;
24
+ name: string;
25
+ type: IkasPaymentMethodAdditionalPriceType;
26
+ constructor(data: Partial<IkasPaymentGatewayAdditionalPrice>);
27
+ }
13
28
  export declare enum IkasPaymentMethodType {
14
29
  BUY_ONLINE_PAY_AT_STORE = "BUY_ONLINE_PAY_AT_STORE",
15
30
  CASH = "CASH",
@@ -19,3 +34,11 @@ export declare enum IkasPaymentMethodType {
19
34
  MONEY_ORDER = "MONEY_ORDER",
20
35
  OTHER = "OTHER"
21
36
  }
37
+ export declare enum IkasPaymentMethodAdditionalPriceType {
38
+ DECREMENT = "DECREMENT",
39
+ INCREMENT = "INCREMENT"
40
+ }
41
+ export declare enum IkasPaymentGatewayAdditionalPriceAmountType {
42
+ AMOUNT = "AMOUNT",
43
+ RATIO = "RATIO"
44
+ }
@@ -2,3 +2,4 @@ export declare const stringToSlug: (str: string) => string;
2
2
  export declare const validatePhoneNumber: (str: string) => boolean;
3
3
  export declare const pascalCase: (str: string) => string;
4
4
  export declare const decodeBase64: (base64: string) => string;
5
+ export declare function stringSorter(atitle: string, btitle: string): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.158-alpha.15",
3
+ "version": "0.0.158-alpha.16",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",