kupos-ui-components-lib 1.1.8 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/components/FilterBar/FilterBarDesktop.d.ts +1 -1
  2. package/dist/components/FilterBar/FilterBarDesktop.js +288 -154
  3. package/dist/components/FilterBar/FilterBarMobile.js +2 -5
  4. package/dist/components/FilterBar/ServiceFilter.d.ts +1 -0
  5. package/dist/components/FilterBar/ServiceFilter.js +50 -16
  6. package/dist/components/FilterBar/tyoes.d.ts +1 -0
  7. package/dist/components/PaymentSideBar/PaymentSideBarDesktop.js +17 -13
  8. package/dist/components/PaymentSideBar/PaymentSideBarMobile.js +5 -5
  9. package/dist/components/PaymentSideBar/types.d.ts +6 -0
  10. package/dist/components/ServiceItem/ServiceItemDesktop.js +3 -1
  11. package/dist/components/ServiceItem/ServiceItemMobile.js +1 -1
  12. package/dist/components/ServiceItem/mobileTypes.d.ts +1 -0
  13. package/dist/components/ServiceItem/types.d.ts +1 -0
  14. package/dist/styles.css +6 -19
  15. package/package.json +1 -1
  16. package/src/components/FilterBar/FilterBarDesktop.tsx +318 -165
  17. package/src/components/FilterBar/FilterBarMobile.tsx +2 -7
  18. package/src/components/FilterBar/ServiceFilter.tsx +66 -24
  19. package/src/components/FilterBar/tyoes.ts +2 -0
  20. package/src/components/PaymentSideBar/PaymentSideBarDesktop.tsx +29 -7
  21. package/src/components/PaymentSideBar/PaymentSideBarMobile.tsx +6 -3
  22. package/src/components/PaymentSideBar/types.ts +8 -0
  23. package/src/components/ServiceItem/ServiceItemDesktop.tsx +3 -1
  24. package/src/components/ServiceItem/ServiceItemMobile.tsx +1 -1
  25. package/src/components/ServiceItem/mobileTypes.ts +2 -0
  26. package/src/components/ServiceItem/types.ts +2 -0
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { FilterBarProps } from "./tyoes";
3
- declare const FilterBarDesktop: ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, }: FilterBarProps) => React.JSX.Element;
3
+ declare const FilterBarDesktop: ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, isPeru, }: FilterBarProps) => React.JSX.Element;
4
4
  export default FilterBarDesktop;
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
2
  import commonService from "../../utils/CommonService";
3
3
  import ServiceFilter from "./ServiceFilter";
4
- const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, }) => {
4
+ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, isPeru, }) => {
5
5
  const filterBy = (filters) => {
6
+ console.log("🚀 ~ filterBy ~ filters:", filters);
6
7
  try {
7
8
  let routes = allSchedules;
8
9
  let filteredRoutes = commonService.copyObject(routes);
@@ -134,192 +135,325 @@ const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showRe
134
135
  });
135
136
  // }
136
137
  }
137
- if (fil.type == "seat_types") {
138
- let activeOptions = fil.options.filter((it) => it.active);
139
- // if (activeOptions && activeOptions.length > 0) {
140
- filteredRoutes = filteredRoutes.filter((it) => {
141
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
142
- if (activeOptions && activeOptions.length)
143
- for (let f of activeOptions) {
144
- console.log("ffffffffffff", f.value.toLowerCase());
145
- if (f.active) {
146
- if (f.value.toLowerCase().indexOf("salon cama low") > -1) {
147
- for (let bt of it.seat_types) {
148
- if (((_a = bt === null || bt === void 0 ? void 0 : bt.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().indexOf("salon cama low")) > -1) {
149
- return true;
138
+ if (isPeru) {
139
+ if (fil.type == "seat_types") {
140
+ let activeOptions = fil.options.filter((it) => it.active);
141
+ // if (activeOptions && activeOptions.length > 0) {
142
+ filteredRoutes = filteredRoutes.filter((it) => {
143
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
144
+ if (activeOptions && activeOptions.length)
145
+ for (let f of activeOptions) {
146
+ if (f.active) {
147
+ // New condition for B/C 140
148
+ if (f.value.toLowerCase().indexOf("b/c 140") > -1) {
149
+ for (let bt of it.seat_types) {
150
+ if (((_a = bt === null || bt === void 0 ? void 0 : bt.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().indexOf("b/c 140")) > -1) {
151
+ return true;
152
+ }
150
153
  }
151
154
  }
152
- }
153
- else if (f.value.toLowerCase().indexOf("salón cama low") > -1) {
154
- for (let bt of it.seat_types) {
155
- if (((_b = bt === null || bt === void 0 ? void 0 : bt.label) === null || _b === void 0 ? void 0 : _b.toLowerCase().indexOf("salón cama low")) > -1) {
156
- return true;
155
+ else if (f.value.toLowerCase().indexOf("v.relax 180") > -1) {
156
+ for (let bt of it.seat_types) {
157
+ if (((_b = bt === null || bt === void 0 ? void 0 : bt.label) === null || _b === void 0 ? void 0 : _b.toLowerCase().indexOf("v.relax 180")) > -1) {
158
+ return true;
159
+ }
157
160
  }
158
161
  }
159
- }
160
- else if (f.value.toLowerCase().indexOf("semi cama low") > -1) {
161
- for (let bt of it.seat_types) {
162
- if (((_c = bt === null || bt === void 0 ? void 0 : bt.label) === null || _c === void 0 ? void 0 : _c.toLowerCase().indexOf("semi cama low")) > -1) {
163
- return true;
162
+ else if (f.value.toLowerCase().indexOf("vip 2p 160") > -1) {
163
+ for (let bt of it.seat_types) {
164
+ if (((_c = bt === null || bt === void 0 ? void 0 : bt.label) === null || _c === void 0 ? void 0 : _c.toLowerCase().indexOf("vip 2p 160")) > -1) {
165
+ return true;
166
+ }
164
167
  }
165
168
  }
166
- }
167
- else if (f.value.toLowerCase().indexOf("cama premium (i)") > -1) {
168
- for (let bt of it.seat_types) {
169
- if (((_d = bt === null || bt === void 0 ? void 0 : bt.label) === null || _d === void 0 ? void 0 : _d.toLowerCase().indexOf("cama premium (i)")) >
170
- -1) {
171
- return true;
169
+ else if (f.value.toLowerCase().indexOf("180°") > -1) {
170
+ for (let bt of it.seat_types) {
171
+ if (((_d = bt === null || bt === void 0 ? void 0 : bt.label) === null || _d === void 0 ? void 0 : _d.toLowerCase().indexOf("180°")) > -1) {
172
+ return true;
173
+ }
172
174
  }
173
175
  }
174
- }
175
- else if (f.value.toLowerCase().indexOf("ejecutivo") > -1) {
176
- // for (let bt of it.fare_str.split(",")) {
177
- // if (
178
- // bt.toLowerCase().split(":")[0].indexOf("ejecutivo") > -1
179
- // ) {
180
- // return true;
181
- // }
182
- // }
183
- for (let bt of it.seat_types) {
184
- if (((_e = bt === null || bt === void 0 ? void 0 : bt.label) === null || _e === void 0 ? void 0 : _e.toLowerCase().indexOf("ejecutivo")) > -1) {
185
- return true;
176
+ else if (f.value.toLowerCase().indexOf("160°") > -1) {
177
+ for (let bt of it.seat_types) {
178
+ if (((_e = bt === null || bt === void 0 ? void 0 : bt.label) === null || _e === void 0 ? void 0 : _e.toLowerCase().indexOf("160°")) > -1) {
179
+ return true;
180
+ }
186
181
  }
187
182
  }
188
- }
189
- else if (f.value.toLowerCase().indexOf("semi") > -1) {
190
- // for (let bt of it.fare_str.split(",")) {
191
- // if (bt.toLowerCase().split(":")[0].indexOf("semi") > -1) {
192
- // return true;
193
- // }
194
- // }
195
- for (let bt of it.seat_types) {
196
- if (((_f = bt === null || bt === void 0 ? void 0 : bt.label) === null || _f === void 0 ? void 0 : _f.toLowerCase().indexOf("semi")) > -1) {
197
- return true;
183
+ else if (f.value.toLowerCase().indexOf("140°") > -1) {
184
+ for (let bt of it.seat_types) {
185
+ if (((_f = bt === null || bt === void 0 ? void 0 : bt.label) === null || _f === void 0 ? void 0 : _f.toLowerCase().indexOf("140°")) > -1) {
186
+ return true;
187
+ }
198
188
  }
199
189
  }
200
- }
201
- else if (f.value.toLowerCase().indexOf("salon") > -1) {
202
- // for (let bt of it.fare_str.split(",")) {
203
- // if (
204
- // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
205
- // ) {
206
- // return true;
207
- // }
208
- // }
209
- for (let bt of it.seat_types) {
210
- if (((_g = bt === null || bt === void 0 ? void 0 : bt.label) === null || _g === void 0 ? void 0 : _g.toLowerCase().indexOf("salon")) > -1) {
211
- return true;
190
+ else if (f.value.toLowerCase().indexOf("salon cama low") > -1) {
191
+ for (let bt of it.seat_types) {
192
+ if (((_g = bt === null || bt === void 0 ? void 0 : bt.label) === null || _g === void 0 ? void 0 : _g.toLowerCase().indexOf("salon cama low")) >
193
+ -1) {
194
+ return true;
195
+ }
212
196
  }
213
197
  }
214
- }
215
- else if (f.value.toLowerCase().indexOf("salón") > -1) {
216
- // for (let bt of it.fare_str.split(",")) {
217
- // if (
218
- // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
219
- // ) {
220
- // return true;
221
- // }
222
- // }
223
- for (let bt of it.seat_types) {
224
- if (((_h = bt === null || bt === void 0 ? void 0 : bt.label) === null || _h === void 0 ? void 0 : _h.toLowerCase().indexOf("salón")) > -1) {
225
- return true;
198
+ else if (f.value.toLowerCase().indexOf("salón cama low") > -1) {
199
+ for (let bt of it.seat_types) {
200
+ if (((_h = bt === null || bt === void 0 ? void 0 : bt.label) === null || _h === void 0 ? void 0 : _h.toLowerCase().indexOf("salón cama low")) >
201
+ -1) {
202
+ return true;
203
+ }
226
204
  }
227
205
  }
228
- }
229
- else if (f.value.toLowerCase().indexOf("suite") > -1) {
230
- // for (let bt of it.fare_str.split(",")) {
231
- // if (
232
- // bt.toLowerCase().split(":")[0].indexOf("suite") > -1
233
- // ) {
234
- // return true;
235
- // }
236
- // }
237
- for (let bt of it.seat_types) {
238
- if (((_j = bt === null || bt === void 0 ? void 0 : bt.label) === null || _j === void 0 ? void 0 : _j.toLowerCase().indexOf("suite")) > -1) {
239
- return true;
206
+ else if (f.value.toLowerCase().indexOf("semi cama low") > -1) {
207
+ for (let bt of it.seat_types) {
208
+ if (((_j = bt === null || bt === void 0 ? void 0 : bt.label) === null || _j === void 0 ? void 0 : _j.toLowerCase().indexOf("semi cama low")) > -1) {
209
+ return true;
210
+ }
240
211
  }
241
212
  }
242
- }
243
- else if (f.value.toLowerCase().indexOf("premium") > -1) {
244
- // for (let bt of it.fare_str.split(",")) {
245
- // if (bt.toLowerCase().split(":")[0].indexOf("premium") > -1) {
246
- // return true;
247
- // }
248
- // }
249
- for (let bt of it.seat_types) {
250
- if (((_k = bt === null || bt === void 0 ? void 0 : bt.label) === null || _k === void 0 ? void 0 : _k.toLowerCase().indexOf("premium")) > -1) {
251
- return true;
213
+ else if (f.value.toLowerCase().indexOf("cama premium (i)") > -1) {
214
+ for (let bt of it.seat_types) {
215
+ if (((_k = bt === null || bt === void 0 ? void 0 : bt.label) === null || _k === void 0 ? void 0 : _k.toLowerCase().indexOf("cama premium (i)")) >
216
+ -1) {
217
+ return true;
218
+ }
252
219
  }
253
220
  }
254
- }
255
- else if (f.value.toLowerCase().indexOf("vip") > -1) {
256
- // for (let bt of it.fare_str.split(",")) {
257
- // if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
258
- // return true;
259
- // }
260
- // }
261
- for (let bt of it.seat_types) {
262
- if (((_l = bt === null || bt === void 0 ? void 0 : bt.label) === null || _l === void 0 ? void 0 : _l.toLowerCase().indexOf("vip")) > -1) {
263
- return true;
221
+ else if (f.value.toLowerCase().indexOf("ejecutivo") > -1) {
222
+ // for (let bt of it.fare_str.split(",")) {
223
+ // if (
224
+ // bt.toLowerCase().split(":")[0].indexOf("ejecutivo") > -1
225
+ // ) {
226
+ // return true;
227
+ // }
228
+ // }
229
+ for (let bt of it.seat_types) {
230
+ if (((_l = bt === null || bt === void 0 ? void 0 : bt.label) === null || _l === void 0 ? void 0 : _l.toLowerCase().indexOf("ejecutivo")) > -1) {
231
+ return true;
232
+ }
264
233
  }
265
234
  }
266
- }
267
- else if (f.value.toLowerCase() == "cama") {
268
- // for (let bt of it.fare_str.split(",")) {
269
- // if (bt.toLowerCase().split(":")[0] == "cama") {
270
- // return true;
271
- // }
272
- // }
273
- for (let bt of it.seat_types) {
274
- if (((_m = bt === null || bt === void 0 ? void 0 : bt.label) === null || _m === void 0 ? void 0 : _m.toLowerCase().indexOf("cama")) > -1) {
275
- return true;
235
+ else if (f.value.toLowerCase().indexOf("semi") > -1) {
236
+ // for (let bt of it.fare_str.split(",")) {
237
+ // if (bt.toLowerCase().split(":")[0].indexOf("semi") > -1) {
238
+ // return true;
239
+ // }
240
+ // }
241
+ for (let bt of it.seat_types) {
242
+ if (((_m = bt === null || bt === void 0 ? void 0 : bt.label) === null || _m === void 0 ? void 0 : _m.toLowerCase().indexOf("semi")) > -1) {
243
+ return true;
244
+ }
276
245
  }
277
246
  }
278
- }
279
- else if (f.value.toLowerCase() == "preferente") {
280
- // for (let bt of it.fare_str.split(",")) {
281
- // if (bt.toLowerCase().split(":")[0] == "preferente") {
282
- // return true;
283
- // }
284
- // }
285
- for (let bt of it.seat_types) {
286
- if (((_o = bt === null || bt === void 0 ? void 0 : bt.label) === null || _o === void 0 ? void 0 : _o.toLowerCase().indexOf("preferente")) > -1) {
287
- return true;
247
+ else if (f.value.toLowerCase().indexOf("salon") > -1) {
248
+ // for (let bt of it.fare_str.split(",")) {
249
+ // if (
250
+ // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
251
+ // ) {
252
+ // return true;
253
+ // }
254
+ // }
255
+ for (let bt of it.seat_types) {
256
+ if (((_o = bt === null || bt === void 0 ? void 0 : bt.label) === null || _o === void 0 ? void 0 : _o.toLowerCase().indexOf("salon")) > -1) {
257
+ return true;
258
+ }
288
259
  }
289
260
  }
290
- }
291
- else if (f.value.toLowerCase().indexOf("vent") > -1) {
292
- // for (let bt of it.fare_str.split(",")) {
293
- // if (bt.toLowerCase().split(":")[0].indexOf("vent") > -1) {
294
- // return true;
295
- // }
296
- // }
297
- for (let bt of it.seat_types) {
298
- if (((_p = bt === null || bt === void 0 ? void 0 : bt.label) === null || _p === void 0 ? void 0 : _p.toLowerCase().indexOf("vent")) > -1) {
299
- return true;
261
+ else if (f.value.toLowerCase().indexOf("salón") > -1) {
262
+ // for (let bt of it.fare_str.split(",")) {
263
+ // if (
264
+ // bt.toLowerCase().split(":")[0].indexOf("salon") > -1
265
+ // ) {
266
+ // return true;
267
+ // }
268
+ // }
269
+ for (let bt of it.seat_types) {
270
+ if (((_p = bt === null || bt === void 0 ? void 0 : bt.label) === null || _p === void 0 ? void 0 : _p.toLowerCase().indexOf("salón")) > -1) {
271
+ return true;
272
+ }
273
+ }
274
+ }
275
+ else if (f.value.toLowerCase().indexOf("suite") > -1) {
276
+ // for (let bt of it.fare_str.split(",")) {
277
+ // if (
278
+ // bt.toLowerCase().split(":")[0].indexOf("suite") > -1
279
+ // ) {
280
+ // return true;
281
+ // }
282
+ // }
283
+ for (let bt of it.seat_types) {
284
+ if (((_q = bt === null || bt === void 0 ? void 0 : bt.label) === null || _q === void 0 ? void 0 : _q.toLowerCase().indexOf("suite")) > -1) {
285
+ return true;
286
+ }
287
+ }
288
+ }
289
+ else if (f.value.toLowerCase().indexOf("premium") > -1) {
290
+ // for (let bt of it.fare_str.split(",")) {
291
+ // if (bt.toLowerCase().split(":")[0].indexOf("premium") > -1) {
292
+ // return true;
293
+ // }
294
+ // }
295
+ for (let bt of it.seat_types) {
296
+ if (((_r = bt === null || bt === void 0 ? void 0 : bt.label) === null || _r === void 0 ? void 0 : _r.toLowerCase().indexOf("premium")) > -1) {
297
+ return true;
298
+ }
299
+ }
300
+ }
301
+ else if (f.value.toLowerCase().indexOf("vip") > -1) {
302
+ // for (let bt of it.fare_str.split(",")) {
303
+ // if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
304
+ // return true;
305
+ // }
306
+ // }
307
+ for (let bt of it.seat_types) {
308
+ if (((_s = bt === null || bt === void 0 ? void 0 : bt.label) === null || _s === void 0 ? void 0 : _s.toLowerCase().indexOf("vip")) > -1) {
309
+ return true;
310
+ }
311
+ }
312
+ }
313
+ else if (f.value.toLowerCase() == "cama") {
314
+ // for (let bt of it.fare_str.split(",")) {
315
+ // if (bt.toLowerCase().split(":")[0] == "cama") {
316
+ // return true;
317
+ // }
318
+ // }
319
+ for (let bt of it.seat_types) {
320
+ if (((_t = bt === null || bt === void 0 ? void 0 : bt.label) === null || _t === void 0 ? void 0 : _t.toLowerCase().indexOf("cama")) > -1) {
321
+ return true;
322
+ }
323
+ }
324
+ }
325
+ else if (f.value.toLowerCase() == "preferente") {
326
+ // for (let bt of it.fare_str.split(",")) {
327
+ // if (bt.toLowerCase().split(":")[0] == "preferente") {
328
+ // return true;
329
+ // }
330
+ // }
331
+ for (let bt of it.seat_types) {
332
+ if (((_u = bt === null || bt === void 0 ? void 0 : bt.label) === null || _u === void 0 ? void 0 : _u.toLowerCase().indexOf("preferente")) > -1) {
333
+ return true;
334
+ }
335
+ }
336
+ }
337
+ else if (f.value.toLowerCase().indexOf("vent") > -1) {
338
+ // for (let bt of it.fare_str.split(",")) {
339
+ // if (bt.toLowerCase().split(":")[0].indexOf("vent") > -1) {
340
+ // return true;
341
+ // }
342
+ // }
343
+ for (let bt of it.seat_types) {
344
+ if (((_v = bt === null || bt === void 0 ? void 0 : bt.label) === null || _v === void 0 ? void 0 : _v.toLowerCase().indexOf("vent")) > -1) {
345
+ return true;
346
+ }
347
+ }
348
+ }
349
+ else if (f.value.toLowerCase().indexOf("clasico") > -1) {
350
+ // for (let bt of it.fare_str.split(",")) {
351
+ // if (
352
+ // bt.toLowerCase().split(":")[0].indexOf("clasico") > -1
353
+ // ) {
354
+ // return true;
355
+ // }
356
+ // }
357
+ for (let bt of it.seat_types) {
358
+ if (((_w = bt === null || bt === void 0 ? void 0 : bt.label) === null || _w === void 0 ? void 0 : _w.toLowerCase().indexOf("clasico")) > -1) {
359
+ return true;
360
+ }
300
361
  }
301
362
  }
302
363
  }
303
- else if (f.value.toLowerCase().indexOf("clasico") > -1) {
304
- // for (let bt of it.fare_str.split(",")) {
305
- // if (
306
- // bt.toLowerCase().split(":")[0].indexOf("clasico") > -1
307
- // ) {
308
- // return true;
309
- // }
310
- // }
311
- for (let bt of it.seat_types) {
312
- if (((_q = bt === null || bt === void 0 ? void 0 : bt.label) === null || _q === void 0 ? void 0 : _q.toLowerCase().indexOf("clasico")) > -1) {
313
- return true;
364
+ }
365
+ else
366
+ return true;
367
+ });
368
+ // }
369
+ }
370
+ }
371
+ else {
372
+ if (fil.type == "seat_types") {
373
+ let activeOptions = fil.options.filter((it) => it.active);
374
+ // if (activeOptions && activeOptions.length > 0) {
375
+ filteredRoutes = filteredRoutes.filter((it) => {
376
+ if (activeOptions && activeOptions.length)
377
+ for (let f of activeOptions) {
378
+ if (f.active) {
379
+ if (f.value.toLowerCase().indexOf("semi") > -1) {
380
+ for (let bt of it.fare_str.split(",")) {
381
+ if (bt.toLowerCase().split(":")[0].indexOf("semi") > -1) {
382
+ return true;
383
+ }
384
+ }
385
+ }
386
+ else if (f.value.toLowerCase().indexOf("salon") > -1) {
387
+ for (let bt of it.fare_str.split(",")) {
388
+ if (bt.toLowerCase().split(":")[0].indexOf("salon") > -1) {
389
+ return true;
390
+ }
391
+ }
392
+ }
393
+ else if (f.value.toLowerCase().indexOf("ejecutivo") > -1) {
394
+ for (let bt of it.fare_str.split(",")) {
395
+ if (bt.toLowerCase().split(":")[0].indexOf("ejecutivo") >
396
+ -1) {
397
+ return true;
398
+ }
399
+ }
400
+ }
401
+ else if (f.value.toLowerCase().indexOf("suite") > -1) {
402
+ for (let bt of it.fare_str.split(",")) {
403
+ if (bt.toLowerCase().split(":")[0].indexOf("suite") > -1) {
404
+ return true;
405
+ }
406
+ }
407
+ }
408
+ else if (f.value.toLowerCase().indexOf("premium") > -1) {
409
+ for (let bt of it.fare_str.split(",")) {
410
+ if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
411
+ return true;
412
+ }
413
+ }
414
+ }
415
+ else if (f.value.toLowerCase().indexOf("vip") > -1) {
416
+ for (let bt of it.fare_str.split(",")) {
417
+ if (bt.toLowerCase().split(":")[0].indexOf("vip") > -1) {
418
+ return true;
419
+ }
420
+ }
421
+ }
422
+ else if (f.value.toLowerCase() == "cama") {
423
+ for (let bt of it.fare_str.split(",")) {
424
+ if (bt.toLowerCase().split(":")[0] == "cama") {
425
+ return true;
426
+ }
427
+ }
428
+ }
429
+ else if (f.value.toLowerCase() == "preferente") {
430
+ for (let bt of it.fare_str.split(",")) {
431
+ if (bt.toLowerCase().split(":")[0] == "preferente") {
432
+ return true;
433
+ }
434
+ }
435
+ }
436
+ else if (f.value.toLowerCase().indexOf("vent") > -1) {
437
+ for (let bt of it.fare_str.split(",")) {
438
+ if (bt.toLowerCase().split(":")[0].indexOf("vent") > -1) {
439
+ return true;
440
+ }
441
+ }
442
+ }
443
+ else if (f.value.toLowerCase().indexOf("clasico") > -1) {
444
+ for (let bt of it.fare_str.split(",")) {
445
+ if (bt.toLowerCase().split(":")[0].indexOf("clasico") > -1) {
446
+ return true;
447
+ }
314
448
  }
315
449
  }
316
450
  }
317
451
  }
318
- }
319
- else
320
- return true;
321
- });
322
- // }
452
+ else
453
+ return true;
454
+ });
455
+ // }
456
+ }
323
457
  }
324
458
  }
325
459
  routes = filteredRoutes;
@@ -361,14 +361,13 @@ const FilterBarMobile = ({ tripStep, isOpen, setIsOpen, icons, busTerminals, myF
361
361
  } },
362
362
  React.createElement("div", { className: " h-full bg-white flex-col flex justify-between p-5" },
363
363
  React.createElement("div", null,
364
- React.createElement("div", { className: "flex items-center mb-4" },
364
+ React.createElement("div", { className: "flex items-center mb-[16px]" },
365
365
  React.createElement("img", { src: icons.crossIcon, alt: "cross", onClick: () => setIsOpen(false), className: "cursor-pointer w-[14px] h-[14px]" }),
366
366
  React.createElement("span", { className: "text-[14px] bold-text ml-[50px]" },
367
367
  " ",
368
368
  "Filtrar por")),
369
369
  Object.keys(myFilters)
370
370
  .sort((a, b) => {
371
- // sort to show service type first then special departure and then seat type
372
371
  if (a === "service_type")
373
372
  return -1;
374
373
  if (b === "service_type")
@@ -385,9 +384,7 @@ const FilterBarMobile = ({ tripStep, isOpen, setIsOpen, icons, busTerminals, myF
385
384
  })
386
385
  .map((key, index) => {
387
386
  var _a, _b, _c;
388
- return (React.createElement("div", { key: index, style: ((_a = myFilters[key]) === null || _a === void 0 ? void 0 : _a.length)
389
- ? { marginTop: 10, padding: 10 }
390
- : {} },
387
+ return (React.createElement("div", { key: index, style: ((_a = myFilters[key]) === null || _a === void 0 ? void 0 : _a.length) ? { padding: 10 } : {} },
391
388
  ((_b = myFilters[key]) === null || _b === void 0 ? void 0 : _b.length) ? (React.createElement("div", { style: {
392
389
  padding: "10px 0px 6px",
393
390
  // marginLeft: "10px",
@@ -8,6 +8,7 @@ interface ServiceFilterBarDesktopState {
8
8
  showSpecialDeparture: boolean;
9
9
  showTrainType: boolean;
10
10
  addMargin: boolean;
11
+ showAmenities: boolean;
11
12
  sortedFilters: any[];
12
13
  }
13
14
  declare class ServiceFilter extends React.Component<ServiceFilterProps, ServiceFilterBarDesktopState> {