b2m-utils 0.0.114 → 0.0.116

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.
@@ -1,256 +1,3 @@
1
- var formatDateString = function (dateString, staticTime) {
2
- if (staticTime === void 0) { staticTime = false; }
3
- if (dateString.includes('.000Z')) {
4
- var firstSplit = dateString === null || dateString === void 0 ? void 0 : dateString.split('.000Z')[0];
5
- var secondSplit = firstSplit === null || firstSplit === void 0 ? void 0 : firstSplit.split('T');
6
- if (secondSplit === null || secondSplit === void 0 ? void 0 : secondSplit.length) {
7
- if (staticTime) {
8
- return "".concat(secondSplit[0], " 12:00:00");
9
- }
10
- else {
11
- return "".concat(secondSplit[0], " ").concat(secondSplit[1]);
12
- }
13
- }
14
- }
15
- else if (dateString.includes(' ')) {
16
- if (staticTime) {
17
- return "".concat(dateString.split(' ')[0], " 12:00:00");
18
- }
19
- else {
20
- return dateString;
21
- }
22
- }
23
- return '';
24
- };
25
-
26
- function getConfigurationFromDomain(domainConfigurations, configurationName) {
27
- return domainConfigurations.find(function (i) { return i.name === configurationName; });
28
- }
29
-
30
- var getCookies = function (cookies) {
31
- if (cookies) {
32
- var data_1 = {};
33
- cookies
34
- .split(';')
35
- .map(function (item) { return item.trim().split('='); })
36
- .forEach(function (item) { return (data_1[item[0]] = item[1]); });
37
- return data_1;
38
- }
39
- else {
40
- return {};
41
- }
42
- };
43
-
44
- function getDataFromToken(token) {
45
- var jwtDataBase64 = token.split('.')[1];
46
- var data = JSON.parse(Buffer.from(jwtDataBase64, 'base64').toString());
47
- if (data.exp * 1000 < Date.now()) {
48
- throw new Error('Token expirado.');
49
- }
50
- return data;
51
- }
52
-
53
- var ApplicationColumnNameEnum;
54
- (function (ApplicationColumnNameEnum) {
55
- ApplicationColumnNameEnum["DEPARTURE_AT"] = "departureAt";
56
- ApplicationColumnNameEnum["ARRIVAL_AT"] = "arrivalAt";
57
- ApplicationColumnNameEnum["CLEARANCE_AT"] = "clearanceAt";
58
- ApplicationColumnNameEnum["DELIVERY_AT"] = "deliveryAt";
59
- ApplicationColumnNameEnum["CREATED_AT"] = "createdAt";
60
- })(ApplicationColumnNameEnum || (ApplicationColumnNameEnum = {}));
61
-
62
- var ApplicationEnum;
63
- (function (ApplicationEnum) {
64
- ApplicationEnum[ApplicationEnum["B2M_CORE"] = 1] = "B2M_CORE";
65
- ApplicationEnum[ApplicationEnum["TMS"] = 2] = "TMS";
66
- ApplicationEnum[ApplicationEnum["SPOT"] = 3] = "SPOT";
67
- ApplicationEnum[ApplicationEnum["TRACK_PROCESSES"] = 4] = "TRACK_PROCESSES";
68
- ApplicationEnum[ApplicationEnum["RATECARD_MANAGEMENT"] = 5] = "RATECARD_MANAGEMENT";
69
- ApplicationEnum[ApplicationEnum["SLA"] = 6] = "SLA";
70
- ApplicationEnum[ApplicationEnum["AUDIT"] = 7] = "AUDIT";
71
- })(ApplicationEnum || (ApplicationEnum = {}));
72
-
73
- var CountryEnum;
74
- (function (CountryEnum) {
75
- CountryEnum[CountryEnum["BRAZIL"] = 1] = "BRAZIL";
76
- })(CountryEnum || (CountryEnum = {}));
77
-
78
- var CurrencyEnum;
79
- (function (CurrencyEnum) {
80
- CurrencyEnum[CurrencyEnum["REAL"] = 1] = "REAL";
81
- CurrencyEnum[CurrencyEnum["DOLAR"] = 2] = "DOLAR";
82
- CurrencyEnum[CurrencyEnum["EURO"] = 3] = "EURO";
83
- CurrencyEnum[CurrencyEnum["IENE"] = 4] = "IENE";
84
- })(CurrencyEnum || (CurrencyEnum = {}));
85
-
86
- var DomainConfigurationEnum;
87
- (function (DomainConfigurationEnum) {
88
- DomainConfigurationEnum["CLEARANCE_DAYS"] = "CLEARANCE_DAYS";
89
- DomainConfigurationEnum["CARGO_REMOVAL_DAYS"] = "CARGO_REMOVAL_DAYS";
90
- DomainConfigurationEnum["DELIVERY_DAYS"] = "DELIVERY_DAYS";
91
- DomainConfigurationEnum["DEMURRAGE_EXPIRY_NOTIFICATION_DAYS"] = "DEMURRAGE_EXPIRY_NOTIFICATION_DAYS";
92
- DomainConfigurationEnum["INVOICE_EXPIRY_NOTIFICATION_DAYS"] = "INVOICE_EXPIRY_NOTIFICATION_DAYS";
93
- })(DomainConfigurationEnum || (DomainConfigurationEnum = {}));
94
-
95
- var DomainTypeEnum;
96
- (function (DomainTypeEnum) {
97
- DomainTypeEnum[DomainTypeEnum["TMS"] = 1] = "TMS";
98
- DomainTypeEnum[DomainTypeEnum["SPOT"] = 2] = "SPOT";
99
- DomainTypeEnum[DomainTypeEnum["PROVIDER"] = 3] = "PROVIDER";
100
- DomainTypeEnum[DomainTypeEnum["FREIGHT_FORWARDER"] = 4] = "FREIGHT_FORWARDER";
101
- DomainTypeEnum[DomainTypeEnum["DISPATCHER"] = 5] = "DISPATCHER";
102
- DomainTypeEnum[DomainTypeEnum["B2M_CLIENT"] = 6] = "B2M_CLIENT";
103
- })(DomainTypeEnum || (DomainTypeEnum = {}));
104
-
105
- var FeeCalculationTypeEnum;
106
- (function (FeeCalculationTypeEnum) {
107
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["FIXED"] = 1] = "FIXED";
108
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["TAXED_WEIGHT"] = 2] = "TAXED_WEIGHT";
109
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["INTERNATIONAL_CHARGE"] = 3] = "INTERNATIONAL_CHARGE";
110
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["CONVERSION_TAX"] = 4] = "CONVERSION_TAX";
111
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["CUBED_WEIGHT"] = 5] = "CUBED_WEIGHT";
112
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["COMMODITY_VALUE"] = 6] = "COMMODITY_VALUE";
113
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["FRACTIONED"] = 7] = "FRACTIONED";
114
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["FREIGHT"] = 8] = "FREIGHT";
115
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["TOTAL_PERCENTAGE"] = 9] = "TOTAL_PERCENTAGE";
116
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["MIN_VALUE"] = 10] = "MIN_VALUE";
117
- FeeCalculationTypeEnum[FeeCalculationTypeEnum["SUM_CONTAINERS"] = 11] = "SUM_CONTAINERS";
118
- })(FeeCalculationTypeEnum || (FeeCalculationTypeEnum = {}));
119
-
120
- var FeeCategoryEnum;
121
- (function (FeeCategoryEnum) {
122
- FeeCategoryEnum[FeeCategoryEnum["ORIGIN"] = 1] = "ORIGIN";
123
- FeeCategoryEnum[FeeCategoryEnum["INTERNATIONAL"] = 2] = "INTERNATIONAL";
124
- FeeCategoryEnum[FeeCategoryEnum["DESTINATION"] = 3] = "DESTINATION";
125
- FeeCategoryEnum[FeeCategoryEnum["DELIVERY"] = 4] = "DELIVERY";
126
- FeeCategoryEnum[FeeCategoryEnum["ADDITIONAL"] = 5] = "ADDITIONAL";
127
- FeeCategoryEnum[FeeCategoryEnum["PICKUP"] = 6] = "PICKUP";
128
- FeeCategoryEnum[FeeCategoryEnum["FREIGHT"] = 7] = "FREIGHT";
129
- FeeCategoryEnum[FeeCategoryEnum["FEES"] = 8] = "FEES";
130
- FeeCategoryEnum[FeeCategoryEnum["TAXES"] = 9] = "TAXES";
131
- })(FeeCategoryEnum || (FeeCategoryEnum = {}));
132
-
133
- var ModalEnum;
134
- (function (ModalEnum) {
135
- ModalEnum[ModalEnum["AIR"] = 1] = "AIR";
136
- ModalEnum[ModalEnum["OCEAN_FCL"] = 2] = "OCEAN_FCL";
137
- ModalEnum[ModalEnum["OCEAN_LCL"] = 3] = "OCEAN_LCL";
138
- ModalEnum[ModalEnum["ROAD_FTL"] = 4] = "ROAD_FTL";
139
- ModalEnum[ModalEnum["ROAD_LTL"] = 5] = "ROAD_LTL";
140
- })(ModalEnum || (ModalEnum = {}));
141
-
142
- var NotificationTypeEnum;
143
- (function (NotificationTypeEnum) {
144
- NotificationTypeEnum[NotificationTypeEnum["USER_NOTIFICATION"] = 1] = "USER_NOTIFICATION";
145
- NotificationTypeEnum[NotificationTypeEnum["DOMAIN_NOTIFICATION"] = 2] = "DOMAIN_NOTIFICATION";
146
- })(NotificationTypeEnum || (NotificationTypeEnum = {}));
147
-
148
- var PermissionEnum;
149
- (function (PermissionEnum) {
150
- PermissionEnum[PermissionEnum["B2M_ADMIN"] = 1] = "B2M_ADMIN";
151
- PermissionEnum[PermissionEnum["DOMAIN_ADMIN"] = 2] = "DOMAIN_ADMIN";
152
- PermissionEnum[PermissionEnum["TMS"] = 3] = "TMS";
153
- PermissionEnum[PermissionEnum["SPOT"] = 4] = "SPOT";
154
- PermissionEnum[PermissionEnum["SPOT_PROVIDER"] = 5] = "SPOT_PROVIDER";
155
- PermissionEnum[PermissionEnum["TRACK_PROCESSES"] = 6] = "TRACK_PROCESSES";
156
- PermissionEnum[PermissionEnum["DISPATCHER"] = 7] = "DISPATCHER";
157
- PermissionEnum[PermissionEnum["RATECARD_MANAGEMENT"] = 8] = "RATECARD_MANAGEMENT";
158
- PermissionEnum[PermissionEnum["SLA"] = 9] = "SLA";
159
- })(PermissionEnum || (PermissionEnum = {}));
160
-
161
- var SpotStatusEnum;
162
- (function (SpotStatusEnum) {
163
- SpotStatusEnum[SpotStatusEnum["DRAFT"] = 1] = "DRAFT";
164
- SpotStatusEnum[SpotStatusEnum["OPEN"] = 2] = "OPEN";
165
- SpotStatusEnum[SpotStatusEnum["CLOSED"] = 3] = "CLOSED";
166
- SpotStatusEnum[SpotStatusEnum["FINISHED"] = 4] = "FINISHED";
167
- })(SpotStatusEnum || (SpotStatusEnum = {}));
168
-
169
- var TrackProcessProviderTypeEnum;
170
- (function (TrackProcessProviderTypeEnum) {
171
- TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["FREIGHT_FORWARDER"] = 1] = "FREIGHT_FORWARDER";
172
- TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["DISPATCHER"] = 2] = "DISPATCHER";
173
- TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["TERMINAL"] = 3] = "TERMINAL";
174
- TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["SHIPPING_COMPANY"] = 4] = "SHIPPING_COMPANY";
175
- TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["OTHERS"] = 5] = "OTHERS";
176
- })(TrackProcessProviderTypeEnum || (TrackProcessProviderTypeEnum = {}));
177
-
178
- var getFormattedFreightPlaceName = function (freightPlace, modalId, complete, sqlVersion) {
179
- var _a, _b;
180
- if (complete === void 0) { complete = false; }
181
- if (sqlVersion === void 0) { sqlVersion = false; }
182
- if (sqlVersion) {
183
- var iataText = freightPlace.iata ? "(".concat(freightPlace.iata, ") ") : '';
184
- var locationText = freightPlace.location ? " ".concat(freightPlace.location) : '';
185
- var countryText = [ModalEnum.OCEAN_FCL, ModalEnum.OCEAN_LCL].includes(modalId) ? "".concat(freightPlace.freightPlaceCountryName, ", ") : '';
186
- return "".concat(iataText).concat(freightPlace.name).concat(locationText).concat(complete ? " - ".concat(countryText).concat(freightPlace.freightPlaceRegionName) : '');
187
- }
188
- else {
189
- var iataText = freightPlace.iata ? "(".concat(freightPlace.iata, ") ") : '';
190
- var locationText = freightPlace.location ? " ".concat(freightPlace.location) : '';
191
- var countryText = [ModalEnum.OCEAN_FCL, ModalEnum.OCEAN_LCL].includes(modalId) ? "".concat((_a = freightPlace.freightPlaceCountry) === null || _a === void 0 ? void 0 : _a.name, ", ") : '';
192
- return "".concat(iataText).concat(freightPlace.name).concat(locationText).concat(complete ? " - ".concat(countryText).concat((_b = freightPlace.freightPlaceRegion) === null || _b === void 0 ? void 0 : _b.name) : '');
193
- }
194
- };
195
-
196
- /******************************************************************************
197
- Copyright (c) Microsoft Corporation.
198
-
199
- Permission to use, copy, modify, and/or distribute this software for any
200
- purpose with or without fee is hereby granted.
201
-
202
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
203
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
204
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
205
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
206
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
207
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
208
- PERFORMANCE OF THIS SOFTWARE.
209
- ***************************************************************************** */
210
-
211
- function __awaiter(thisArg, _arguments, P, generator) {
212
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
213
- return new (P || (P = Promise))(function (resolve, reject) {
214
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
215
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
216
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
217
- step((generator = generator.apply(thisArg, _arguments || [])).next());
218
- });
219
- }
220
-
221
- function __generator(thisArg, body) {
222
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
223
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
224
- function verb(n) { return function (v) { return step([n, v]); }; }
225
- function step(op) {
226
- if (f) throw new TypeError("Generator is already executing.");
227
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
228
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
229
- if (y = 0, t) op = [op[0] & 2, t.value];
230
- switch (op[0]) {
231
- case 0: case 1: t = op; break;
232
- case 4: _.label++; return { value: op[1], done: false };
233
- case 5: _.label++; y = op[1]; op = [0]; continue;
234
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
235
- default:
236
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
237
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
238
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
239
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
240
- if (t[2]) _.ops.pop();
241
- _.trys.pop(); continue;
242
- }
243
- op = body.call(thisArg, _);
244
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
245
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
246
- }
247
- }
248
-
249
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
250
- var e = new Error(message);
251
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
252
- };
253
-
254
1
  /**
255
2
  * @name toDate
256
3
  * @category Common Helpers
@@ -765,9 +512,69 @@ function isValid(date) {
765
512
  }
766
513
 
767
514
  /**
768
- * @name startOfYear
769
- * @category Year Helpers
770
- * @summary Return the start of a year for the given date.
515
+ * The {@link eachDayOfInterval} function options.
516
+ */
517
+
518
+ /**
519
+ * @name eachDayOfInterval
520
+ * @category Interval Helpers
521
+ * @summary Return the array of dates within the specified time interval.
522
+ *
523
+ * @description
524
+ * Return the array of dates within the specified time interval.
525
+ *
526
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
527
+ *
528
+ * @param interval - The interval.
529
+ * @param options - An object with options.
530
+ *
531
+ * @returns The array with starts of days from the day of the interval start to the day of the interval end
532
+ *
533
+ * @example
534
+ * // Each day between 6 October 2014 and 10 October 2014:
535
+ * const result = eachDayOfInterval({
536
+ * start: new Date(2014, 9, 6),
537
+ * end: new Date(2014, 9, 10)
538
+ * })
539
+ * //=> [
540
+ * // Mon Oct 06 2014 00:00:00,
541
+ * // Tue Oct 07 2014 00:00:00,
542
+ * // Wed Oct 08 2014 00:00:00,
543
+ * // Thu Oct 09 2014 00:00:00,
544
+ * // Fri Oct 10 2014 00:00:00
545
+ * // ]
546
+ */
547
+ function eachDayOfInterval(interval, options) {
548
+ const startDate = toDate(interval.start);
549
+ const endDate = toDate(interval.end);
550
+
551
+ let reversed = +startDate > +endDate;
552
+ const endTime = reversed ? +startDate : +endDate;
553
+ const currentDate = reversed ? endDate : startDate;
554
+ currentDate.setHours(0, 0, 0, 0);
555
+
556
+ let step = options?.step ?? 1;
557
+ if (!step) return [];
558
+ if (step < 0) {
559
+ step = -step;
560
+ reversed = !reversed;
561
+ }
562
+
563
+ const dates = [];
564
+
565
+ while (+currentDate <= endTime) {
566
+ dates.push(toDate(currentDate));
567
+ currentDate.setDate(currentDate.getDate() + step);
568
+ currentDate.setHours(0, 0, 0, 0);
569
+ }
570
+
571
+ return reversed ? dates.reverse() : dates;
572
+ }
573
+
574
+ /**
575
+ * @name startOfYear
576
+ * @category Year Helpers
577
+ * @summary Return the start of a year for the given date.
771
578
  *
772
579
  * @description
773
580
  * Return the start of a year for the given date.
@@ -6156,6 +5963,414 @@ const ptBR = {
6156
5963
  },
6157
5964
  };
6158
5965
 
5966
+ var formatDateString = function (dateString, staticTime) {
5967
+ if (staticTime === void 0) { staticTime = false; }
5968
+ if (dateString.includes('.000Z')) {
5969
+ var firstSplit = dateString === null || dateString === void 0 ? void 0 : dateString.split('.000Z')[0];
5970
+ var secondSplit = firstSplit === null || firstSplit === void 0 ? void 0 : firstSplit.split('T');
5971
+ if (secondSplit === null || secondSplit === void 0 ? void 0 : secondSplit.length) {
5972
+ if (staticTime) {
5973
+ return "".concat(secondSplit[0], " 12:00:00");
5974
+ }
5975
+ else {
5976
+ return "".concat(secondSplit[0], " ").concat(secondSplit[1]);
5977
+ }
5978
+ }
5979
+ }
5980
+ else if (dateString.includes(' ')) {
5981
+ if (staticTime) {
5982
+ return "".concat(dateString.split(' ')[0], " 12:00:00");
5983
+ }
5984
+ else {
5985
+ return dateString;
5986
+ }
5987
+ }
5988
+ return '';
5989
+ };
5990
+
5991
+ var getContractFromFreight = function (contracts, freight) {
5992
+ return contracts.find(function (item) {
5993
+ if (item.shippingCompanyId === freight.shippingCompanyId) {
5994
+ var formattedCteAt = format(parse(formatDateString(freight.cteAt), "yyyy-MM-dd HH:mm:ss", new Date()), "yyyy-MM-dd", {
5995
+ locale: ptBR,
5996
+ });
5997
+ var formattedStartsAt = format(parse(formatDateString(item.startsAt), "yyyy-MM-dd HH:mm:ss", new Date()), "yyyy-MM-dd", {
5998
+ locale: ptBR,
5999
+ });
6000
+ var formattedEndsAt = format(parse(formatDateString(item.endsAt), "yyyy-MM-dd HH:mm:ss", new Date()), "yyyy-MM-dd", {
6001
+ locale: ptBR,
6002
+ });
6003
+ if (formattedCteAt >= formattedStartsAt && formattedCteAt <= formattedEndsAt) {
6004
+ return true;
6005
+ }
6006
+ }
6007
+ return false;
6008
+ });
6009
+ };
6010
+
6011
+ var getContractRouteFromFreight = function (contracts, freight) {
6012
+ var _a;
6013
+ var contract = getContractFromFreight(contracts, freight);
6014
+ if (contract) {
6015
+ var routesToStateDestination = (_a = contract.DomainSlaRoute) === null || _a === void 0 ? void 0 : _a.filter(function (it) { var _a; return it.stateDestinationId === ((_a = freight.cityDestination) === null || _a === void 0 ? void 0 : _a.state.id); });
6016
+ console.log({
6017
+ routesToStateDestination: routesToStateDestination,
6018
+ });
6019
+ if (routesToStateDestination === null || routesToStateDestination === void 0 ? void 0 : routesToStateDestination.length) {
6020
+ var routesToCityDestination = routesToStateDestination.filter(function (it) { return it.cityDestinationId === freight.cityDestinationId; });
6021
+ if (routesToCityDestination === null || routesToCityDestination === void 0 ? void 0 : routesToCityDestination.length) {
6022
+ console.log({
6023
+ routesToCityDestination: routesToCityDestination,
6024
+ });
6025
+ var routeFromCityOriginAndToCityDestination = routesToCityDestination.find(function (it) { return it.cityOriginId === freight.cityOriginId; });
6026
+ if (routeFromCityOriginAndToCityDestination) {
6027
+ console.log({
6028
+ routeFromCityOriginAndToCityDestination: routeFromCityOriginAndToCityDestination,
6029
+ });
6030
+ return routeFromCityOriginAndToCityDestination;
6031
+ }
6032
+ else {
6033
+ var routeFromStateOriginWithoutCity = routesToCityDestination.find(function (it) { var _a, _b; return it.stateOriginId === ((_b = (_a = freight.cityOrigin) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.id) && it.cityOriginId === null; });
6034
+ if (routeFromStateOriginWithoutCity) {
6035
+ console.log({
6036
+ routeFromStateOriginWithoutCity: routeFromStateOriginWithoutCity,
6037
+ });
6038
+ return routeFromStateOriginWithoutCity;
6039
+ }
6040
+ else {
6041
+ var routeWithoutCityAndStateOrigin = routesToCityDestination.find(function (it) { return it.stateOriginId === null && it.cityOriginId === null; });
6042
+ if (routeWithoutCityAndStateOrigin) {
6043
+ console.log({
6044
+ routeWithoutCityAndStateOrigin: routeWithoutCityAndStateOrigin,
6045
+ });
6046
+ return routeWithoutCityAndStateOrigin;
6047
+ }
6048
+ }
6049
+ }
6050
+ }
6051
+ else {
6052
+ var routesWithoutCityDestination = routesToStateDestination.filter(function (it) { return it.cityDestinationId === null; });
6053
+ var routesFromStateOrigin = routesWithoutCityDestination.filter(function (it) { var _a, _b; return it.stateOriginId === ((_b = (_a = freight.cityOrigin) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.id); });
6054
+ if (routesFromStateOrigin === null || routesFromStateOrigin === void 0 ? void 0 : routesFromStateOrigin.length) {
6055
+ var routeFromCityOrigin = routesFromStateOrigin.find(function (it) { return it.cityOriginId === freight.cityOriginId; });
6056
+ if (routeFromCityOrigin) {
6057
+ console.log({
6058
+ routeFromCityOrigin: routeFromCityOrigin,
6059
+ });
6060
+ return routeFromCityOrigin;
6061
+ }
6062
+ else {
6063
+ var routeFromStateOrigin = routesFromStateOrigin.find(function (it) { var _a, _b; return it.stateOriginId === ((_b = (_a = freight.cityOrigin) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.id) && it.cityOriginId === null; });
6064
+ if (routeFromStateOrigin) {
6065
+ console.log({
6066
+ routeFromStateOrigin: routeFromStateOrigin
6067
+ });
6068
+ return routeFromStateOrigin;
6069
+ }
6070
+ }
6071
+ }
6072
+ else {
6073
+ var routeFromStateDestination = routesToStateDestination.find(function (it) { var _a, _b; return it.stateDestinationId === ((_b = (_a = freight.cityDestination) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.id) && it.cityDestinationId === null && it.cityOriginId === null && it.stateOriginId === null; });
6074
+ if (routeFromStateDestination) {
6075
+ console.log({
6076
+ routeFromStateDestination: routeFromStateDestination,
6077
+ });
6078
+ return routeFromStateDestination;
6079
+ }
6080
+ }
6081
+ }
6082
+ }
6083
+ }
6084
+ return false;
6085
+ };
6086
+
6087
+ var getRouteDeliveryTimeFromFreight = function (freight, contracts) {
6088
+ var _a;
6089
+ var route = getContractRouteFromFreight(contracts, freight);
6090
+ if (freight.cteAt && freight.deliveredAt) {
6091
+ if (route) {
6092
+ var freightStarts = parse(formatDateString(freight.cteAt), "yyyy-MM-dd HH:mm:ss", new Date());
6093
+ var freightsEnds = parse(formatDateString(freight.deliveredAt), "yyyy-MM-dd HH:mm:ss", new Date());
6094
+ if (freightStarts < freightsEnds) {
6095
+ var daysDifference = eachDayOfInterval({
6096
+ start: freightStarts,
6097
+ end: freightsEnds,
6098
+ });
6099
+ if (daysDifference instanceof Array) {
6100
+ var daysToDeliveryArray_1 = (_a = route.daysToDelivery) === null || _a === void 0 ? void 0 : _a.split(',').map(function (it) { return +it; });
6101
+ var daysToDeliveryQtd = daysDifference.filter(function (date) {
6102
+ var dateDay = date.getDay();
6103
+ return daysToDeliveryArray_1.includes(dateDay);
6104
+ });
6105
+ if (daysToDeliveryQtd.length) {
6106
+ return daysToDeliveryQtd.length - 1;
6107
+ }
6108
+ }
6109
+ }
6110
+ }
6111
+ }
6112
+ return 'ND';
6113
+ };
6114
+
6115
+ var getRouteOnTimeFromFreight = function (freight, contracts) {
6116
+ var _a;
6117
+ var route = getContractRouteFromFreight(contracts, freight);
6118
+ if (route) {
6119
+ if (freight.cteAt && freight.deliveredAt) {
6120
+ var contract = getContractFromFreight(contracts, freight);
6121
+ if (contract) {
6122
+ var freightStarts = parse(formatDateString(freight.cteAt), "yyyy-MM-dd HH:mm:ss", new Date());
6123
+ var freightEnds = parse(formatDateString(freight.deliveredAt), "yyyy-MM-dd HH:mm:ss", new Date());
6124
+ if (freightStarts < freightEnds) {
6125
+ var daysDifference = eachDayOfInterval({
6126
+ start: freightStarts,
6127
+ end: freightEnds,
6128
+ });
6129
+ if (daysDifference instanceof Array) {
6130
+ var daysToDeliveryArray_1 = (_a = route.daysToDelivery) === null || _a === void 0 ? void 0 : _a.split(',').map(function (it) { return +it; });
6131
+ var daysToDeliveryQtd = daysDifference.filter(function (date) {
6132
+ var dateDay = date.getDay();
6133
+ return daysToDeliveryArray_1 === null || daysToDeliveryArray_1 === void 0 ? void 0 : daysToDeliveryArray_1.includes(dateDay);
6134
+ });
6135
+ if (daysToDeliveryQtd.length) {
6136
+ return (daysToDeliveryQtd.length - 1) <= route.transitTime ? 'Sim' : 'Não';
6137
+ }
6138
+ }
6139
+ }
6140
+ }
6141
+ }
6142
+ }
6143
+ return 'ND';
6144
+ };
6145
+
6146
+ function getConfigurationFromDomain(domainConfigurations, configurationName) {
6147
+ return domainConfigurations.find(function (i) { return i.name === configurationName; });
6148
+ }
6149
+
6150
+ var getCookies = function (cookies) {
6151
+ if (cookies) {
6152
+ var data_1 = {};
6153
+ cookies
6154
+ .split(';')
6155
+ .map(function (item) { return item.trim().split('='); })
6156
+ .forEach(function (item) { return (data_1[item[0]] = item[1]); });
6157
+ return data_1;
6158
+ }
6159
+ else {
6160
+ return {};
6161
+ }
6162
+ };
6163
+
6164
+ function getDataFromToken(token) {
6165
+ var jwtDataBase64 = token.split('.')[1];
6166
+ var data = JSON.parse(Buffer.from(jwtDataBase64, 'base64').toString());
6167
+ if (data.exp * 1000 < Date.now()) {
6168
+ throw new Error('Token expirado.');
6169
+ }
6170
+ return data;
6171
+ }
6172
+
6173
+ var ApplicationColumnNameEnum;
6174
+ (function (ApplicationColumnNameEnum) {
6175
+ ApplicationColumnNameEnum["DEPARTURE_AT"] = "departureAt";
6176
+ ApplicationColumnNameEnum["ARRIVAL_AT"] = "arrivalAt";
6177
+ ApplicationColumnNameEnum["CLEARANCE_AT"] = "clearanceAt";
6178
+ ApplicationColumnNameEnum["DELIVERY_AT"] = "deliveryAt";
6179
+ ApplicationColumnNameEnum["CREATED_AT"] = "createdAt";
6180
+ })(ApplicationColumnNameEnum || (ApplicationColumnNameEnum = {}));
6181
+
6182
+ var ApplicationEnum;
6183
+ (function (ApplicationEnum) {
6184
+ ApplicationEnum[ApplicationEnum["B2M_CORE"] = 1] = "B2M_CORE";
6185
+ ApplicationEnum[ApplicationEnum["TMS"] = 2] = "TMS";
6186
+ ApplicationEnum[ApplicationEnum["SPOT"] = 3] = "SPOT";
6187
+ ApplicationEnum[ApplicationEnum["TRACK_PROCESSES"] = 4] = "TRACK_PROCESSES";
6188
+ ApplicationEnum[ApplicationEnum["RATECARD_MANAGEMENT"] = 5] = "RATECARD_MANAGEMENT";
6189
+ ApplicationEnum[ApplicationEnum["SLA"] = 6] = "SLA";
6190
+ ApplicationEnum[ApplicationEnum["AUDIT"] = 7] = "AUDIT";
6191
+ })(ApplicationEnum || (ApplicationEnum = {}));
6192
+
6193
+ var CountryEnum;
6194
+ (function (CountryEnum) {
6195
+ CountryEnum[CountryEnum["BRAZIL"] = 1] = "BRAZIL";
6196
+ })(CountryEnum || (CountryEnum = {}));
6197
+
6198
+ var CurrencyEnum;
6199
+ (function (CurrencyEnum) {
6200
+ CurrencyEnum[CurrencyEnum["REAL"] = 1] = "REAL";
6201
+ CurrencyEnum[CurrencyEnum["DOLAR"] = 2] = "DOLAR";
6202
+ CurrencyEnum[CurrencyEnum["EURO"] = 3] = "EURO";
6203
+ CurrencyEnum[CurrencyEnum["IENE"] = 4] = "IENE";
6204
+ })(CurrencyEnum || (CurrencyEnum = {}));
6205
+
6206
+ var DomainConfigurationEnum;
6207
+ (function (DomainConfigurationEnum) {
6208
+ DomainConfigurationEnum["CLEARANCE_DAYS"] = "CLEARANCE_DAYS";
6209
+ DomainConfigurationEnum["CARGO_REMOVAL_DAYS"] = "CARGO_REMOVAL_DAYS";
6210
+ DomainConfigurationEnum["DELIVERY_DAYS"] = "DELIVERY_DAYS";
6211
+ DomainConfigurationEnum["DEMURRAGE_EXPIRY_NOTIFICATION_DAYS"] = "DEMURRAGE_EXPIRY_NOTIFICATION_DAYS";
6212
+ DomainConfigurationEnum["INVOICE_EXPIRY_NOTIFICATION_DAYS"] = "INVOICE_EXPIRY_NOTIFICATION_DAYS";
6213
+ })(DomainConfigurationEnum || (DomainConfigurationEnum = {}));
6214
+
6215
+ var DomainTypeEnum;
6216
+ (function (DomainTypeEnum) {
6217
+ DomainTypeEnum[DomainTypeEnum["TMS"] = 1] = "TMS";
6218
+ DomainTypeEnum[DomainTypeEnum["SPOT"] = 2] = "SPOT";
6219
+ DomainTypeEnum[DomainTypeEnum["PROVIDER"] = 3] = "PROVIDER";
6220
+ DomainTypeEnum[DomainTypeEnum["FREIGHT_FORWARDER"] = 4] = "FREIGHT_FORWARDER";
6221
+ DomainTypeEnum[DomainTypeEnum["DISPATCHER"] = 5] = "DISPATCHER";
6222
+ DomainTypeEnum[DomainTypeEnum["B2M_CLIENT"] = 6] = "B2M_CLIENT";
6223
+ })(DomainTypeEnum || (DomainTypeEnum = {}));
6224
+
6225
+ var FeeCalculationTypeEnum;
6226
+ (function (FeeCalculationTypeEnum) {
6227
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["FIXED"] = 1] = "FIXED";
6228
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["TAXED_WEIGHT"] = 2] = "TAXED_WEIGHT";
6229
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["INTERNATIONAL_CHARGE"] = 3] = "INTERNATIONAL_CHARGE";
6230
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["CONVERSION_TAX"] = 4] = "CONVERSION_TAX";
6231
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["CUBED_WEIGHT"] = 5] = "CUBED_WEIGHT";
6232
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["COMMODITY_VALUE"] = 6] = "COMMODITY_VALUE";
6233
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["FRACTIONED"] = 7] = "FRACTIONED";
6234
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["FREIGHT"] = 8] = "FREIGHT";
6235
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["TOTAL_PERCENTAGE"] = 9] = "TOTAL_PERCENTAGE";
6236
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["MIN_VALUE"] = 10] = "MIN_VALUE";
6237
+ FeeCalculationTypeEnum[FeeCalculationTypeEnum["SUM_CONTAINERS"] = 11] = "SUM_CONTAINERS";
6238
+ })(FeeCalculationTypeEnum || (FeeCalculationTypeEnum = {}));
6239
+
6240
+ var FeeCategoryEnum;
6241
+ (function (FeeCategoryEnum) {
6242
+ FeeCategoryEnum[FeeCategoryEnum["ORIGIN"] = 1] = "ORIGIN";
6243
+ FeeCategoryEnum[FeeCategoryEnum["INTERNATIONAL"] = 2] = "INTERNATIONAL";
6244
+ FeeCategoryEnum[FeeCategoryEnum["DESTINATION"] = 3] = "DESTINATION";
6245
+ FeeCategoryEnum[FeeCategoryEnum["DELIVERY"] = 4] = "DELIVERY";
6246
+ FeeCategoryEnum[FeeCategoryEnum["ADDITIONAL"] = 5] = "ADDITIONAL";
6247
+ FeeCategoryEnum[FeeCategoryEnum["PICKUP"] = 6] = "PICKUP";
6248
+ FeeCategoryEnum[FeeCategoryEnum["FREIGHT"] = 7] = "FREIGHT";
6249
+ FeeCategoryEnum[FeeCategoryEnum["FEES"] = 8] = "FEES";
6250
+ FeeCategoryEnum[FeeCategoryEnum["TAXES"] = 9] = "TAXES";
6251
+ })(FeeCategoryEnum || (FeeCategoryEnum = {}));
6252
+
6253
+ var ModalEnum;
6254
+ (function (ModalEnum) {
6255
+ ModalEnum[ModalEnum["AIR"] = 1] = "AIR";
6256
+ ModalEnum[ModalEnum["OCEAN_FCL"] = 2] = "OCEAN_FCL";
6257
+ ModalEnum[ModalEnum["OCEAN_LCL"] = 3] = "OCEAN_LCL";
6258
+ ModalEnum[ModalEnum["ROAD_FTL"] = 4] = "ROAD_FTL";
6259
+ ModalEnum[ModalEnum["ROAD_LTL"] = 5] = "ROAD_LTL";
6260
+ })(ModalEnum || (ModalEnum = {}));
6261
+
6262
+ var NotificationTypeEnum;
6263
+ (function (NotificationTypeEnum) {
6264
+ NotificationTypeEnum[NotificationTypeEnum["USER_NOTIFICATION"] = 1] = "USER_NOTIFICATION";
6265
+ NotificationTypeEnum[NotificationTypeEnum["DOMAIN_NOTIFICATION"] = 2] = "DOMAIN_NOTIFICATION";
6266
+ })(NotificationTypeEnum || (NotificationTypeEnum = {}));
6267
+
6268
+ var PermissionEnum;
6269
+ (function (PermissionEnum) {
6270
+ PermissionEnum[PermissionEnum["B2M_ADMIN"] = 1] = "B2M_ADMIN";
6271
+ PermissionEnum[PermissionEnum["DOMAIN_ADMIN"] = 2] = "DOMAIN_ADMIN";
6272
+ PermissionEnum[PermissionEnum["TMS"] = 3] = "TMS";
6273
+ PermissionEnum[PermissionEnum["SPOT"] = 4] = "SPOT";
6274
+ PermissionEnum[PermissionEnum["SPOT_PROVIDER"] = 5] = "SPOT_PROVIDER";
6275
+ PermissionEnum[PermissionEnum["TRACK_PROCESSES"] = 6] = "TRACK_PROCESSES";
6276
+ PermissionEnum[PermissionEnum["DISPATCHER"] = 7] = "DISPATCHER";
6277
+ PermissionEnum[PermissionEnum["RATECARD_MANAGEMENT"] = 8] = "RATECARD_MANAGEMENT";
6278
+ PermissionEnum[PermissionEnum["SLA"] = 9] = "SLA";
6279
+ })(PermissionEnum || (PermissionEnum = {}));
6280
+
6281
+ var SpotStatusEnum;
6282
+ (function (SpotStatusEnum) {
6283
+ SpotStatusEnum[SpotStatusEnum["DRAFT"] = 1] = "DRAFT";
6284
+ SpotStatusEnum[SpotStatusEnum["OPEN"] = 2] = "OPEN";
6285
+ SpotStatusEnum[SpotStatusEnum["CLOSED"] = 3] = "CLOSED";
6286
+ SpotStatusEnum[SpotStatusEnum["FINISHED"] = 4] = "FINISHED";
6287
+ })(SpotStatusEnum || (SpotStatusEnum = {}));
6288
+
6289
+ var TrackProcessProviderTypeEnum;
6290
+ (function (TrackProcessProviderTypeEnum) {
6291
+ TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["FREIGHT_FORWARDER"] = 1] = "FREIGHT_FORWARDER";
6292
+ TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["DISPATCHER"] = 2] = "DISPATCHER";
6293
+ TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["TERMINAL"] = 3] = "TERMINAL";
6294
+ TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["SHIPPING_COMPANY"] = 4] = "SHIPPING_COMPANY";
6295
+ TrackProcessProviderTypeEnum[TrackProcessProviderTypeEnum["OTHERS"] = 5] = "OTHERS";
6296
+ })(TrackProcessProviderTypeEnum || (TrackProcessProviderTypeEnum = {}));
6297
+
6298
+ var getFormattedFreightPlaceName = function (freightPlace, modalId, complete, sqlVersion) {
6299
+ var _a, _b;
6300
+ if (complete === void 0) { complete = false; }
6301
+ if (sqlVersion === void 0) { sqlVersion = false; }
6302
+ if (sqlVersion) {
6303
+ var iataText = freightPlace.iata ? "(".concat(freightPlace.iata, ") ") : '';
6304
+ var locationText = freightPlace.location ? " ".concat(freightPlace.location) : '';
6305
+ var countryText = [ModalEnum.OCEAN_FCL, ModalEnum.OCEAN_LCL].includes(modalId) ? "".concat(freightPlace.freightPlaceCountryName, ", ") : '';
6306
+ return "".concat(iataText).concat(freightPlace.name).concat(locationText).concat(complete ? " - ".concat(countryText).concat(freightPlace.freightPlaceRegionName) : '');
6307
+ }
6308
+ else {
6309
+ var iataText = freightPlace.iata ? "(".concat(freightPlace.iata, ") ") : '';
6310
+ var locationText = freightPlace.location ? " ".concat(freightPlace.location) : '';
6311
+ var countryText = [ModalEnum.OCEAN_FCL, ModalEnum.OCEAN_LCL].includes(modalId) ? "".concat((_a = freightPlace.freightPlaceCountry) === null || _a === void 0 ? void 0 : _a.name, ", ") : '';
6312
+ return "".concat(iataText).concat(freightPlace.name).concat(locationText).concat(complete ? " - ".concat(countryText).concat((_b = freightPlace.freightPlaceRegion) === null || _b === void 0 ? void 0 : _b.name) : '');
6313
+ }
6314
+ };
6315
+
6316
+ /******************************************************************************
6317
+ Copyright (c) Microsoft Corporation.
6318
+
6319
+ Permission to use, copy, modify, and/or distribute this software for any
6320
+ purpose with or without fee is hereby granted.
6321
+
6322
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
6323
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
6324
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
6325
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
6326
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
6327
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
6328
+ PERFORMANCE OF THIS SOFTWARE.
6329
+ ***************************************************************************** */
6330
+
6331
+ function __awaiter(thisArg, _arguments, P, generator) {
6332
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6333
+ return new (P || (P = Promise))(function (resolve, reject) {
6334
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6335
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6336
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
6337
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
6338
+ });
6339
+ }
6340
+
6341
+ function __generator(thisArg, body) {
6342
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
6343
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
6344
+ function verb(n) { return function (v) { return step([n, v]); }; }
6345
+ function step(op) {
6346
+ if (f) throw new TypeError("Generator is already executing.");
6347
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
6348
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
6349
+ if (y = 0, t) op = [op[0] & 2, t.value];
6350
+ switch (op[0]) {
6351
+ case 0: case 1: t = op; break;
6352
+ case 4: _.label++; return { value: op[1], done: false };
6353
+ case 5: _.label++; y = op[1]; op = [0]; continue;
6354
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
6355
+ default:
6356
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
6357
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
6358
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
6359
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
6360
+ if (t[2]) _.ops.pop();
6361
+ _.trys.pop(); continue;
6362
+ }
6363
+ op = body.call(thisArg, _);
6364
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
6365
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
6366
+ }
6367
+ }
6368
+
6369
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
6370
+ var e = new Error(message);
6371
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
6372
+ };
6373
+
6159
6374
  var setFormattedDatesInObjects = function (objectFormat) { return __awaiter(void 0, void 0, void 0, function () {
6160
6375
  var _a, _b, _c, _i, key, formattedDate, _d, _e, _f, _g;
6161
6376
  return __generator(this, function (_h) {
@@ -6216,5 +6431,5 @@ var setFormattedDatesInObjects = function (objectFormat) { return __awaiter(void
6216
6431
  });
6217
6432
  }); };
6218
6433
 
6219
- export { ApplicationColumnNameEnum, ApplicationEnum, CountryEnum, CurrencyEnum, DomainConfigurationEnum, DomainTypeEnum, FeeCalculationTypeEnum, FeeCategoryEnum, ModalEnum, NotificationTypeEnum, PermissionEnum, SpotStatusEnum, TrackProcessProviderTypeEnum, formatDateString, getConfigurationFromDomain, getCookies, getDataFromToken, getFormattedFreightPlaceName, setFormattedDatesInObjects };
6434
+ export { ApplicationColumnNameEnum, ApplicationEnum, CountryEnum, CurrencyEnum, DomainConfigurationEnum, DomainTypeEnum, FeeCalculationTypeEnum, FeeCategoryEnum, ModalEnum, NotificationTypeEnum, PermissionEnum, SpotStatusEnum, TrackProcessProviderTypeEnum, formatDateString, getConfigurationFromDomain, getContractFromFreight, getContractRouteFromFreight, getCookies, getDataFromToken, getFormattedFreightPlaceName, getRouteDeliveryTimeFromFreight, getRouteOnTimeFromFreight, setFormattedDatesInObjects };
6220
6435
  //# sourceMappingURL=index.esm.js.map