kupos-ui-components-lib 9.1.2 → 9.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README copy.md +67 -223
- package/dist/assets/images/anims/service_list/directo.json +1 -1
- package/dist/components/FilterBar/FilterBarDesktop.d.ts +1 -1
- package/dist/components/FilterBar/FilterBarDesktop.js +38 -3
- package/dist/components/FilterBar/tyoes.d.ts +1 -0
- package/dist/components/ServiceItem/PeruServiceItemDesktop.js +1 -1
- package/dist/components/ServiceItem/RatingHover.js +33 -32
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +267 -147
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +278 -87
- package/dist/components/ServiceItem/mobileTypes.d.ts +0 -5
- package/dist/components/ServiceItem/types.d.ts +0 -7
- package/dist/styles.css +32 -131
- package/dist/ui/AmenitiesBlock.js +30 -23
- package/dist/ui/DurationBlock.js +4 -4
- package/dist/ui/FlexibleBlock.js +6 -5
- package/dist/ui/PetBlock.js +3 -1
- package/dist/ui/RatingBlock.d.ts +1 -9
- package/dist/ui/RatingBlock.js +3 -7
- package/dist/utils/CommonService.d.ts +1 -1
- package/dist/utils/CommonService.js +0 -2
- package/package.json +1 -2
- package/src/assets/images/anims/service_list/directo.json +1 -1
- package/src/components/FilterBar/FilterBarDesktop.tsx +46 -3
- package/src/components/FilterBar/tyoes.ts +1 -0
- package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +0 -1
- package/src/components/ServiceItem/RatingHover.tsx +45 -44
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +537 -313
- package/src/components/ServiceItem/ServiceItemMobile.tsx +530 -213
- package/src/components/ServiceItem/mobileTypes.ts +0 -5
- package/src/components/ServiceItem/types.ts +0 -7
- package/src/ui/AmenitiesBlock.tsx +29 -50
- package/src/ui/DurationBlock.tsx +4 -4
- package/src/ui/FlexibleBlock.tsx +5 -6
- package/src/ui/PetBlock.tsx +2 -2
- package/src/ui/RatingBlock.tsx +6 -18
- package/src/utils/CommonService.ts +0 -2
- package/src/assets/images/anims/service_list/bomb.json +0 -1
- package/src/ui/BottomAmenities/BottomAmenities.tsx +0 -110
- package/src/ui/DateTimeSection/DateTimeSection.tsx +0 -207
- package/src/ui/DirectoBlock.tsx +0 -31
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +0 -103
- package/src/ui/KuposButton/KuposButton.tsx +0 -48
- package/src/ui/SeatSection/SeatSection.tsx +0 -207
- package/src/ui/TopAmenities/TopAmenities.tsx +0 -127
- package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +0 -169
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +0 -192
- package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +0 -56
- package/src/ui/mobileweb/SeatSectionMobile.tsx +0 -256
- package/src/ui/mobileweb/TopAmenitieMobile.tsx +0 -126
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
|
+
import DateService from "../../utils/DateService";
|
|
3
4
|
import commonService from "../../utils/CommonService";
|
|
4
|
-
import BottomAmenitiesMobile from "../../ui/mobileweb/BottomAmenitiesMobile";
|
|
5
|
-
import DateTimeSectionMobile from "../../ui/mobileweb/DateTimeSectionMobile";
|
|
6
|
-
import ExpandedDropdownMobile from "../../ui/mobileweb/ExpandedDropdownMobile";
|
|
7
5
|
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
8
6
|
const exceptions = [
|
|
9
7
|
"gy",
|
|
@@ -16,37 +14,10 @@ const exceptions = [
|
|
|
16
14
|
"blanco",
|
|
17
15
|
"asiento_mascota",
|
|
18
16
|
];
|
|
19
|
-
function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown,
|
|
17
|
+
function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, }) {
|
|
20
18
|
var _a, _b, _c;
|
|
21
|
-
const isItemExpanded = serviceItem.id === isExpanded;
|
|
22
19
|
const isPetSeat = (Object.keys(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.pet_seat_info) || []).length > 0;
|
|
23
20
|
let isSoldOut = serviceItem.available_seats <= 0;
|
|
24
|
-
const showPromo = Math.random() > 0.5;
|
|
25
|
-
const countdownSeconds = 7830;
|
|
26
|
-
const startCountdown = (node) => {
|
|
27
|
-
if (!node)
|
|
28
|
-
return;
|
|
29
|
-
const prevId = node.dataset.countdownId;
|
|
30
|
-
if (prevId)
|
|
31
|
-
clearInterval(Number(prevId));
|
|
32
|
-
let remaining = countdownSeconds;
|
|
33
|
-
const formatTime = (totalSecs) => {
|
|
34
|
-
const h = Math.floor(totalSecs / 3600);
|
|
35
|
-
const m = Math.floor((totalSecs % 3600) / 60);
|
|
36
|
-
const s = totalSecs % 60;
|
|
37
|
-
return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
38
|
-
};
|
|
39
|
-
node.textContent = formatTime(remaining);
|
|
40
|
-
const id = setInterval(() => {
|
|
41
|
-
remaining -= 1;
|
|
42
|
-
if (remaining <= 0) {
|
|
43
|
-
remaining = 0;
|
|
44
|
-
clearInterval(id);
|
|
45
|
-
}
|
|
46
|
-
node.textContent = formatTime(remaining);
|
|
47
|
-
}, 1000);
|
|
48
|
-
node.dataset.countdownId = String(id);
|
|
49
|
-
};
|
|
50
21
|
const labelId = typeof serviceItem.boarding_stages === "string"
|
|
51
22
|
? serviceItem.boarding_stages.split("|")[0]
|
|
52
23
|
: "";
|
|
@@ -64,6 +35,146 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
64
35
|
return "";
|
|
65
36
|
}
|
|
66
37
|
};
|
|
38
|
+
const seatTypes = () => {
|
|
39
|
+
var _a, _b, _c, _d;
|
|
40
|
+
let seatTypes = (_d = (_c = (_b = (_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.filter((item) => getFilteredSeats(item.label))) === null || _b === void 0 ? void 0 : _b.sort((a, b) => a.fare - b.fare) // Add this line to sort by fare
|
|
41
|
+
) === null || _c === void 0 ? void 0 : _c.slice(0, 2)) === null || _d === void 0 ? void 0 : _d.map((type, i) => {
|
|
42
|
+
var _a;
|
|
43
|
+
return exceptions.includes(type.label) ? null : (React.createElement("div", { className: ((_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length) > 2
|
|
44
|
+
? "w-[100%] flex flex-row justify-between "
|
|
45
|
+
: "w-[100%] flex flex-row justify-between items-center", key: i },
|
|
46
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] ", style: {
|
|
47
|
+
// marginLeft: "10px",
|
|
48
|
+
color: isSoldOut ? "#bbb" : "#464647",
|
|
49
|
+
} }, type.label),
|
|
50
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text", style: { color: isSoldOut ? "#bbb" : colors.seatPriceColor } }, commonService.currency(type.fare, currencySign))));
|
|
51
|
+
});
|
|
52
|
+
return seatTypes;
|
|
53
|
+
};
|
|
54
|
+
const seatTypesWithRemoveDuplicateSeats = () => {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
const seatMap = new Map();
|
|
57
|
+
(_b = (_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.filter((item) => getFilteredSeats(item.label))) === null || _b === void 0 ? void 0 : _b.forEach((item) => {
|
|
58
|
+
if (exceptions.includes(item.key))
|
|
59
|
+
return;
|
|
60
|
+
const existing = seatMap.get(item.label);
|
|
61
|
+
if (!existing ||
|
|
62
|
+
parseFloat(item.fare) < parseFloat(existing.fare)) {
|
|
63
|
+
seatMap.set(item.label, item);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const uniqueSeats = Array.from(seatMap.values())
|
|
67
|
+
.sort((a, b) => a.fare - b.fare)
|
|
68
|
+
.slice(0, 3);
|
|
69
|
+
return uniqueSeats.map((type, i) => {
|
|
70
|
+
var _a;
|
|
71
|
+
return exceptions.includes(type.label) ? null : (React.createElement("div", { className: ((_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length) > 2
|
|
72
|
+
? "w-[100%] flex flex-row justify-between "
|
|
73
|
+
: "w-[100%] flex flex-row justify-between items-center", key: i },
|
|
74
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[11px] ", style: {
|
|
75
|
+
// marginLeft: "10px",
|
|
76
|
+
color: isSoldOut ? "#bbb" : "#464647",
|
|
77
|
+
} }, commonService.truncateSeatLabel(type.label)),
|
|
78
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[11px] bold-text", style: { color: isSoldOut ? "#bbb" : colors.seatPriceColor } }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0 && !isPeru
|
|
79
|
+
? commonService.currency(0, currencySign)
|
|
80
|
+
: commonService.currency(type.fare, currencySign))));
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
const getFilteredSeats = (item) => {
|
|
84
|
+
return item;
|
|
85
|
+
};
|
|
86
|
+
const getAmenitiesImage = (name) => {
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
88
|
+
switch (name) {
|
|
89
|
+
case "air_condtion.png": {
|
|
90
|
+
return (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.airConditionIcon;
|
|
91
|
+
}
|
|
92
|
+
case "baggage.png": {
|
|
93
|
+
return (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.baggageIcon;
|
|
94
|
+
}
|
|
95
|
+
case "charging_plug.png": {
|
|
96
|
+
return (_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _c === void 0 ? void 0 : _c.chargingIcon;
|
|
97
|
+
}
|
|
98
|
+
case "coffee.png": {
|
|
99
|
+
return (_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _d === void 0 ? void 0 : _d.coffeeIcon;
|
|
100
|
+
}
|
|
101
|
+
case "food_new_icon.png": {
|
|
102
|
+
return (_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _e === void 0 ? void 0 : _e.foodIcon;
|
|
103
|
+
}
|
|
104
|
+
case "gaming.png": {
|
|
105
|
+
return (_f = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _f === void 0 ? void 0 : _f.gamingIcon;
|
|
106
|
+
}
|
|
107
|
+
case "handicap.png": {
|
|
108
|
+
return (_g = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _g === void 0 ? void 0 : _g.handicapIcon;
|
|
109
|
+
}
|
|
110
|
+
case "mobile_ticket.png": {
|
|
111
|
+
return (_h = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _h === void 0 ? void 0 : _h.mobileTicketIcon;
|
|
112
|
+
}
|
|
113
|
+
case "movie.png": {
|
|
114
|
+
return (_j = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _j === void 0 ? void 0 : _j.movieIcon;
|
|
115
|
+
}
|
|
116
|
+
case "restrooms.png": {
|
|
117
|
+
return (_k = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _k === void 0 ? void 0 : _k.restroomsIcon;
|
|
118
|
+
}
|
|
119
|
+
case "snacks_new.png": {
|
|
120
|
+
return (_l = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _l === void 0 ? void 0 : _l.snackIcon;
|
|
121
|
+
}
|
|
122
|
+
case "wifi.png": {
|
|
123
|
+
return (_m = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _m === void 0 ? void 0 : _m.wifiIcon;
|
|
124
|
+
}
|
|
125
|
+
case "cortina_divisoria.png": {
|
|
126
|
+
return (_o = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _o === void 0 ? void 0 : _o.cortinaIcon;
|
|
127
|
+
}
|
|
128
|
+
case "frazada.png": {
|
|
129
|
+
return (_p = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _p === void 0 ? void 0 : _p.frazaIcon;
|
|
130
|
+
}
|
|
131
|
+
case "blanket.png": {
|
|
132
|
+
return (_q = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _q === void 0 ? void 0 : _q.blankketIcon;
|
|
133
|
+
}
|
|
134
|
+
case "cctv.png": {
|
|
135
|
+
return (_r = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _r === void 0 ? void 0 : _r.cctvIcon;
|
|
136
|
+
}
|
|
137
|
+
case "cup_holder.png": {
|
|
138
|
+
return (_s = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _s === void 0 ? void 0 : _s.cupHolderIcon;
|
|
139
|
+
}
|
|
140
|
+
case "emergency_contact.png": {
|
|
141
|
+
return (_t = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _t === void 0 ? void 0 : _t.emergencyContactIcon;
|
|
142
|
+
}
|
|
143
|
+
case "emergency_exit.png": {
|
|
144
|
+
return (_u = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _u === void 0 ? void 0 : _u.emergencyExitIcon;
|
|
145
|
+
}
|
|
146
|
+
case "fire_extinguisher.png": {
|
|
147
|
+
return (_v = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _v === void 0 ? void 0 : _v.fireExtinguisherIcon;
|
|
148
|
+
}
|
|
149
|
+
case "reading_light.png": {
|
|
150
|
+
return (_w = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _w === void 0 ? void 0 : _w.readingLIghtIcon;
|
|
151
|
+
}
|
|
152
|
+
case "seat_belt.png": {
|
|
153
|
+
return (_x = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _x === void 0 ? void 0 : _x.sercurityBeltIcon;
|
|
154
|
+
}
|
|
155
|
+
case "service_on_board.png": {
|
|
156
|
+
return (_y = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _y === void 0 ? void 0 : _y.serviceOnBoardIcon;
|
|
157
|
+
}
|
|
158
|
+
case "personal_tv.png": {
|
|
159
|
+
return (_z = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _z === void 0 ? void 0 : _z.personalTVIcon;
|
|
160
|
+
}
|
|
161
|
+
case "pet_admission.png": {
|
|
162
|
+
return (_0 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _0 === void 0 ? void 0 : _0.petAdmissionIcon;
|
|
163
|
+
}
|
|
164
|
+
case "music.png": {
|
|
165
|
+
return (_1 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _1 === void 0 ? void 0 : _1.musicIcon;
|
|
166
|
+
}
|
|
167
|
+
case "headset.png": {
|
|
168
|
+
return (_2 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _2 === void 0 ? void 0 : _2.headPhoneIcon;
|
|
169
|
+
}
|
|
170
|
+
case "allows_cancellation.png": {
|
|
171
|
+
return (_3 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _3 === void 0 ? void 0 : _3.allowCancellationIcon;
|
|
172
|
+
}
|
|
173
|
+
default: {
|
|
174
|
+
return "";
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
67
178
|
const amenities = () => {
|
|
68
179
|
var _a;
|
|
69
180
|
const raw = (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[3];
|
|
@@ -74,7 +185,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
74
185
|
: [];
|
|
75
186
|
const nodes = list.slice(0, 2).map((am, i) => {
|
|
76
187
|
var _a;
|
|
77
|
-
return (React.createElement("img", { key: i, className: "amenity", height:
|
|
188
|
+
return (React.createElement("img", { key: i, className: "amenity", height: 14, width: 14,
|
|
78
189
|
// src={getAmenitiesImage(amenitiesData?.[am]?.toLowerCase())}
|
|
79
190
|
src: commonService.getAmenitiesImage((_a = amenitiesData === null || amenitiesData === void 0 ? void 0 : amenitiesData[am]) === null || _a === void 0 ? void 0 : _a.toLowerCase(), serviceItem), alt: "icon" }));
|
|
80
191
|
});
|
|
@@ -94,46 +205,140 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
94
205
|
if (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo) {
|
|
95
206
|
isConexion = true;
|
|
96
207
|
}
|
|
208
|
+
const depTime = serviceItem.dep_time || "";
|
|
209
|
+
// Extract hours and minutes and check for AM/PM
|
|
210
|
+
const hasAM = depTime.includes("AM");
|
|
211
|
+
const hasPM = depTime.includes("PM");
|
|
212
|
+
const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
|
|
213
|
+
const [hour, minute] = timePart.split(":").map(Number);
|
|
214
|
+
// Convert to 24-hour format
|
|
215
|
+
let cleanedDepTime;
|
|
216
|
+
if (hasAM) {
|
|
217
|
+
cleanedDepTime =
|
|
218
|
+
hour === 12
|
|
219
|
+
? `00:${minute < 10 ? "0" + minute : minute}`
|
|
220
|
+
: `${hour < 10 ? "0" + hour : hour}:${minute < 10 ? "0" + minute : minute}`;
|
|
221
|
+
}
|
|
222
|
+
else if (hasPM) {
|
|
223
|
+
cleanedDepTime =
|
|
224
|
+
hour === 12
|
|
225
|
+
? `${hour}:${minute < 10 ? "0" + minute : minute}`
|
|
226
|
+
: `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
cleanedDepTime = timePart;
|
|
230
|
+
}
|
|
97
231
|
return (React.createElement("div", { className: `relative ${serviceItem.offer_text ? "mb-[55px]" : "mb-[14px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
|
|
98
232
|
isConexion ||
|
|
99
233
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
|
|
100
234
|
showTopLabel
|
|
101
235
|
? "mt-[20px]"
|
|
102
236
|
: "mt-[10px]"} `, style: { backgroundColor: "#fff", zIndex: 1 } },
|
|
103
|
-
React.createElement("div", { className: " rounded-[20px]", style: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
React.createElement("div", { className: "flex items-center justify-between" },
|
|
237
|
+
React.createElement("div", { className: "border border-[#E6E6E6] rounded-[20px]", style: { backgroundColor: "#fff", zIndex: 1 } },
|
|
238
|
+
React.createElement("div", { className: `p-[12px] ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
|
|
239
|
+
showTopLabel ||
|
|
240
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
|
|
241
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo)
|
|
242
|
+
? "mt-[10px]"
|
|
243
|
+
: ""}` },
|
|
244
|
+
React.createElement("div", { className: "flex justify-between mb-[8px]" },
|
|
245
|
+
React.createElement("div", { className: "flex items-center w-[50%] justify-between" },
|
|
113
246
|
React.createElement("div", { className: "w-[120px] overflow-y-hidden" },
|
|
114
247
|
React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: `w-[100px] h-auto object-contain ${isSoldOut ? "grayscale" : ""}` })),
|
|
115
|
-
isCiva ? (React.createElement("div", { className: "black-text min-[420]:text-[12px] text-[12px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details[2])) : showRating ? (React.createElement("div", { className: "flex min-[420]:text-[13px] text-[12px]
|
|
116
|
-
React.createElement("
|
|
248
|
+
isCiva ? (React.createElement("div", { className: "black-text min-[420]:text-[12px] text-[12px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details[2])) : showRating ? (React.createElement("div", { className: "flex min-[420]:text-[13px] text-[12px] bold-text items-center" },
|
|
249
|
+
React.createElement("img", { src: serviceItem.icons.rating, alt: "origin", className: `w-[12px] h-[12px] mr-[4px] object-contain ${isSoldOut ? "grayscale" : ""}` }),
|
|
250
|
+
React.createElement("span", { style: { lineHeight: "normal" } }, getServiceStars(serviceItem)))) : null),
|
|
251
|
+
showLastSeats ? (React.createElement("div", { className: "flex justify-end -mt-[5px] -mb-[5px] items-center pt-[5px] pb-[5px] text-center " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
252
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("span", { className: "text-[12px] text-[red] mt-1 flex justify-end pt-[5px] pb-[5px] pl-[15px] pr-[15px] rounded-[8px] ", style: {
|
|
253
|
+
backgroundColor: colors.lastSeatBg,
|
|
254
|
+
color: colors.lastSeatText,
|
|
255
|
+
} }, "\u00A1 \u00DAltimos Asientos!")))) : null),
|
|
256
|
+
React.createElement("div", { className: "flex justify-between gap-[5px] w-full", onClick: onBookButtonPress },
|
|
257
|
+
React.createElement("div", { className: "min-h-[2.5rem] flex flex-col justify-between gap-[4px] w-[50%] ", style: { justifyContent: isCiva && "center" } },
|
|
258
|
+
React.createElement("div", { className: `flex items-center min-[420]:text-[13px] text-[12px] justify-between ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
|
|
259
|
+
React.createElement("div", { className: "flex items-center", style: { flex: 1 } },
|
|
260
|
+
React.createElement("div", null,
|
|
261
|
+
" ",
|
|
262
|
+
orignLabel ? (React.createElement("div", { className: "w-[60px]" }, orignLabel)) : (React.createElement("div", { className: "w-[14px] h-auto mr-[5px]" },
|
|
263
|
+
React.createElement("img", { src: (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.origin, alt: "origin", className: `w-[14px] h-auto mr-[5px] ${isSoldOut ? "grayscale" : ""}` })))),
|
|
264
|
+
React.createElement("div", { className: "flex items-center relative capitalize justify-between ", style: { flex: 1 } },
|
|
265
|
+
React.createElement("span", { className: "cursor-pointer black-text" }, DateService.getServiceItemDate(serviceItem.travel_date)),
|
|
266
|
+
React.createElement("div", { className: "absolute left-[50%]" }, "\u2022"),
|
|
267
|
+
React.createElement("div", { className: "font-[900] relative black-text" }, isLinatal ? (React.createElement("div", null,
|
|
268
|
+
React.createElement("span", null,
|
|
269
|
+
" ",
|
|
270
|
+
cleanedDepTime,
|
|
271
|
+
" ",
|
|
272
|
+
React.createElement("span", null, hasPM ? "PM" : hasAM ? "AM" : "")),
|
|
273
|
+
React.createElement("span", null, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dep_time.includes("AM")) ||
|
|
274
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dep_time.includes("PM"))
|
|
275
|
+
? null
|
|
276
|
+
: DateService.ampmOnly(serviceItem.dep_time)))) : (DateService.formatTime(serviceItem.dep_time)))))),
|
|
277
|
+
isCiva ? null : (React.createElement("div", { className: `flex items-center min-[420]:text-[13px] text-[12px] justify-between ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
|
|
278
|
+
React.createElement("div", { className: "flex items-center", style: { flex: 1 } },
|
|
279
|
+
React.createElement("div", null,
|
|
280
|
+
" ",
|
|
281
|
+
destinationLabel ? (React.createElement("div", { className: "w-[60px]" }, destinationLabel)) : (React.createElement("div", { className: "w-[14px] h-auto mr-[5px]" },
|
|
282
|
+
React.createElement("img", { src: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.destination, alt: "destination", className: `w-[14px] h-auto mr-[5px] ${isSoldOut ? "grayscale" : ""}` })))),
|
|
283
|
+
React.createElement("div", { className: "flex items-center relative capitalize justify-between ", style: { flex: 1 } },
|
|
284
|
+
React.createElement("span", { className: "cursor-pointer black-text" }, DateService.getServiceItemDate(serviceItem.arrival_date)),
|
|
285
|
+
React.createElement("div", { className: "absolute left-[50%]" }, "\u2022"),
|
|
286
|
+
React.createElement("div", { className: "font-[900] relative black-text" }, DateService.formatTime(serviceItem.arr_time))))))),
|
|
287
|
+
React.createElement("div", { style: {
|
|
288
|
+
width: "1px",
|
|
289
|
+
height: "2.5rem",
|
|
290
|
+
backgroundColor: "#ccc",
|
|
291
|
+
margin: "auto",
|
|
292
|
+
} }),
|
|
293
|
+
React.createElement("div", { className: "content-center", style: {
|
|
294
|
+
width: isPeru ? "40%" : "40%",
|
|
295
|
+
} },
|
|
296
|
+
React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem] ", style: {
|
|
297
|
+
gap: isSoldOut ? "0px" : "5px",
|
|
298
|
+
justifyContent: ((_c = serviceItem.seat_types) === null || _c === void 0 ? void 0 : _c.length) > 2
|
|
299
|
+
? "space-between"
|
|
300
|
+
: "center",
|
|
301
|
+
} },
|
|
302
|
+
removeDuplicateSeats
|
|
303
|
+
? seatTypesWithRemoveDuplicateSeats()
|
|
304
|
+
: seatTypes(),
|
|
305
|
+
isSoldOut ? (React.createElement("div", { className: "flex justify-end" },
|
|
306
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] text-[#ccc]" }, "Agotado"))) : null))),
|
|
307
|
+
React.createElement("div", { className: "bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]" }),
|
|
308
|
+
React.createElement("div", { className: `${"flex justify-between items-center items-center "}` },
|
|
309
|
+
React.createElement("div", null,
|
|
310
|
+
React.createElement("div", { className: "flex items-center " },
|
|
311
|
+
React.createElement("div", { className: "flex items-center cursor-pointer ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
|
|
312
|
+
React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px] bold-text" }, serviceItem.operator_details[2])))),
|
|
313
|
+
React.createElement("div", { className: "flex relative ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
|
|
314
|
+
React.createElement("div", { className: `w-[12px] h-auto mr-[2px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("hours", "14px")),
|
|
315
|
+
"\u00A0",
|
|
316
|
+
React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } },
|
|
317
|
+
serviceItem.duration,
|
|
318
|
+
"hrs")),
|
|
319
|
+
React.createElement("div", { style: { opacity: isSoldOut ? 0.5 : 1 } }, amenities()),
|
|
320
|
+
(serviceItem.is_change_ticket || isPetSeat) && (React.createElement("div", { onClick: () => {
|
|
321
|
+
setShowDropdown(!showDropdown);
|
|
322
|
+
setAmenetiesAtomValue({
|
|
323
|
+
service: serviceItem,
|
|
324
|
+
showTopLabel: showTopLabel,
|
|
325
|
+
});
|
|
326
|
+
}, className: "flex items-center" },
|
|
327
|
+
serviceItem.pet_seat_info &&
|
|
328
|
+
Object.keys(serviceItem.pet_seat_info).length > 0 ? (React.createElement("div", { className: "flex items-center" },
|
|
329
|
+
React.createElement("div", { className: `relative group cursor-default ` },
|
|
117
330
|
React.createElement("div", { className: "flex items-center" },
|
|
118
|
-
React.createElement("
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
// setAmenetiesAtomValue({
|
|
130
|
-
// service: serviceItem,
|
|
131
|
-
// showTopLabel: showTopLabel,
|
|
132
|
-
// });
|
|
133
|
-
// }}
|
|
134
|
-
onDropdownToggle: () => {
|
|
135
|
-
setIsExpanded(isItemExpanded ? null : serviceItem.id);
|
|
136
|
-
} })),
|
|
331
|
+
React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
|
|
332
|
+
React.createElement(LottiePlayer, { animationData: serviceItem.icons.petFriendlyAnim, width: "20px", height: "20px" })))))) : null,
|
|
333
|
+
serviceItem.is_change_ticket === true && (React.createElement("div", { className: "flex items-center" },
|
|
334
|
+
React.createElement("div", { className: "relative group cursor-default" },
|
|
335
|
+
React.createElement("div", { className: "flex items-center" },
|
|
336
|
+
React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
|
|
337
|
+
React.createElement(LottiePlayer, { animationData: serviceItem.icons.flexibleAnim, width: "20px", height: "20px" })))))),
|
|
338
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) === true && (React.createElement("div", { className: "flex items-center mr-[10px]" },
|
|
339
|
+
React.createElement("div", { className: `h-auto mr-[4px] min-[420]:text-[13px] text-[11px] text-[#464647] ${isSoldOut ? "grayscale" : ""}` },
|
|
340
|
+
React.createElement(LottiePlayer, { animationData: serviceItem.icons.locationAnim, width: "20px", height: "20px" })))),
|
|
341
|
+
(serviceItem.is_change_ticket || isPetSeat) && (React.createElement("img", { src: serviceItem.icons.plus, alt: "icon", width: 11 })))))),
|
|
137
342
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) && (React.createElement("div", { className: ` text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[35px] pt-[50px] z-10 rounded-b-[14px] min-[420]:text-[14px] text-[12px]`, style: {
|
|
138
343
|
backgroundColor: isSoldOut ? "#ccc" : colors === null || colors === void 0 ? void 0 : colors.bottomStripColor,
|
|
139
344
|
zIndex: -1,
|
|
@@ -142,19 +347,9 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
142
347
|
opacity: isSoldOut ? 0.5 : 1,
|
|
143
348
|
} },
|
|
144
349
|
React.createElement(LottiePlayer, { animationData: serviceItem.icons.promoAnim, width: "18px", height: "18px" }),
|
|
145
|
-
React.createElement("
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"\u00A0"),
|
|
149
|
-
" ",
|
|
150
|
-
"| Termina en\u00A0",
|
|
151
|
-
React.createElement("span", { className: "bold-text", ref: startCountdown, style: {
|
|
152
|
-
fontVariantNumeric: "tabular-nums",
|
|
153
|
-
display: "inline-block",
|
|
154
|
-
// minWidth: "70px",
|
|
155
|
-
} })))),
|
|
156
|
-
React.createElement("div", { className: "absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[13px] z-10 " },
|
|
157
|
-
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2px] py-[4px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
|
|
350
|
+
React.createElement("span", { className: "ml-[10px] text-[#fff] min-[380px]:text-[11px] text-[10px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text))),
|
|
351
|
+
React.createElement("div", { className: "absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[20px] z-10 " },
|
|
352
|
+
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
|
|
158
353
|
backgroundColor: isSoldOut ? "#ccc" : colors.ratingBottomColor,
|
|
159
354
|
} },
|
|
160
355
|
React.createElement("div", { className: isSoldOut ? "grayscale" : "" },
|
|
@@ -165,20 +360,16 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
165
360
|
} },
|
|
166
361
|
renderIcon("airportIcon", "14px"),
|
|
167
362
|
React.createElement("div", null, "Conexi\u00F3n"))),
|
|
363
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
|
|
364
|
+
backgroundColor: isSoldOut ? "#ddd" : colors.tooltipBgColor,
|
|
365
|
+
color: isSoldOut ? "#bbb" : colors.directoColor,
|
|
366
|
+
} },
|
|
367
|
+
React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "16px", height: "16px" }),
|
|
368
|
+
React.createElement("div", { className: "ml-[5px]" }, "Directo"))),
|
|
168
369
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
|
|
169
370
|
backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
|
|
170
371
|
} },
|
|
171
372
|
React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "20px", height: "20px" }),
|
|
172
|
-
React.createElement("div", null, "Tren Express")))))
|
|
173
|
-
React.createElement("div", { style: {
|
|
174
|
-
display: "grid",
|
|
175
|
-
gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
|
|
176
|
-
opacity: isItemExpanded ? 1 : 0,
|
|
177
|
-
transition: "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
178
|
-
position: "relative",
|
|
179
|
-
zIndex: -1,
|
|
180
|
-
} },
|
|
181
|
-
React.createElement("div", { style: { overflow: "hidden", minHeight: 0, marginTop: "-10px" } },
|
|
182
|
-
React.createElement(ExpandedDropdownMobile, { serviceItem: serviceItem })))));
|
|
373
|
+
React.createElement("div", null, "Tren Express")))))));
|
|
183
374
|
}
|
|
184
375
|
export default ServiceItemMobile;
|
|
@@ -110,9 +110,6 @@ export interface MobileServiceItemProps {
|
|
|
110
110
|
seatFallBackIcon: string;
|
|
111
111
|
headPhoneIcon?: string;
|
|
112
112
|
allowCancellationIcon?: string;
|
|
113
|
-
bombAnim?: string;
|
|
114
|
-
whiteBoardingIcon?: string;
|
|
115
|
-
downArrow?: string;
|
|
116
113
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
117
114
|
};
|
|
118
115
|
useLottieFor?: string[];
|
|
@@ -121,8 +118,6 @@ export interface MobileServiceItemProps {
|
|
|
121
118
|
terminals?: any[];
|
|
122
119
|
showDropdown?: boolean;
|
|
123
120
|
setShowDropdown?: (value: boolean) => void;
|
|
124
|
-
isExpanded?: string | null;
|
|
125
|
-
setIsExpanded?: (value: string | null) => void;
|
|
126
121
|
setAmenetiesAtomValue?: (value: {
|
|
127
122
|
service: MobileServiceItemProps["serviceItem"];
|
|
128
123
|
showTopLabel: string | boolean;
|
|
@@ -115,9 +115,6 @@ export interface ServiceItemProps {
|
|
|
115
115
|
seatFallBackIcon: string;
|
|
116
116
|
headPhoneIcon?: string;
|
|
117
117
|
allowCancellationIcon?: string;
|
|
118
|
-
whiteBoardingIcon?: string;
|
|
119
|
-
bombJson?: string;
|
|
120
|
-
downArrow?: string;
|
|
121
118
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
122
119
|
};
|
|
123
120
|
useLottieFor?: string[];
|
|
@@ -193,11 +190,7 @@ export interface ServiceItemProps {
|
|
|
193
190
|
petFriendlyAnim?: string;
|
|
194
191
|
priorityStageAnim?: string;
|
|
195
192
|
promoAnim?: string;
|
|
196
|
-
bombAnimation?: string;
|
|
197
193
|
isPeru?: boolean;
|
|
198
194
|
siteType?: "kupos" | "pullman" | "opsites" | "linatal";
|
|
199
195
|
isAllinBus?: boolean;
|
|
200
|
-
isExpand?: any;
|
|
201
|
-
setIsExpand?: (value: any) => void;
|
|
202
|
-
coachKey?: number;
|
|
203
196
|
}
|