@travelswitchhq/curated-search-react 1.0.0

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/dist/index.cjs ADDED
@@ -0,0 +1,1928 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ CuratedSearchWidget: () => Curated_default
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/Curated.tsx
28
+ var import_react = require("react");
29
+ var import_jsencrypt = require("jsencrypt");
30
+ var import_button = require("primereact/button");
31
+ var import_dropdown = require("primereact/dropdown");
32
+ var import_calendar = require("primereact/calendar");
33
+
34
+ // src/curated-search-widget.styles.ts
35
+ var curatedSearchWidgetStyles = `
36
+ :root{
37
+ --sw-font-family: Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
38
+ --sw-en-font-family: Arial, sans-serif;
39
+ --sw-label-color: #66797F;
40
+ --sw-body-text: #0B1215;
41
+ --sw-btn-radius: 8px;
42
+ --sw-radius: var(--sw-size-md-1);
43
+ --sw-primary-btn: #2C0A82;
44
+ --sw-primary-button-text: #ffffff;
45
+ --sw-button-primary-border: #2C0A82;
46
+ --sw-form-border: #d8dcde;
47
+ --sw-white: #ffffff;
48
+ --sw-gray: #999;
49
+ --sw-error: #f60b0b;
50
+ --sw-widget-bg: #f5f5f8;
51
+ --sw-widget-font-size: 1.4rem;
52
+ --sw-widget-z-index-base: 1000;
53
+ --sw-widget-transition: all 0.2s ease;
54
+ --sw-widget-shadow: 0 var(--sw-size-sm) 8px rgba(0, 0, 0, 0.1);
55
+ --sw-widget-shadow-hover: 0 4px var(--sw-size-md-1) rgba(0, 0, 0, 0.15);
56
+ --sw-space-sm: 2px;
57
+ --sw-space-md: 10px;
58
+ --sw-space-lg: 20px;
59
+ --sw-size-sm: 2px;
60
+ --sw-size-md: 10px;
61
+ --sw-size-md-1: 12px;
62
+ --sw-size-md-2: 14px;
63
+ --sw-size-md-3: 16px;
64
+ --sw-size-md-4: 18px;
65
+ --sw-size-lg: 20px;
66
+ }
67
+ .sw-container {
68
+ contain: layout;
69
+ position: relative;
70
+ display: block;
71
+ width: 100%;
72
+ min-width: 1240px;
73
+ margin: 0;
74
+ padding: 0;
75
+ box-sizing: border-box;
76
+ color: var(--sw-body-text);
77
+ font-family: var(--sw-font-family);
78
+ font-size: var(--sw-widget-font-size);
79
+ font-weight: 400;
80
+ line-height: 1.5;
81
+ -webkit-font-smoothing: antialiased;
82
+ -moz-osx-font-smoothing: grayscale;
83
+ -webkit-tap-highlight-color: transparent;
84
+ background: var(--sw-widget-bg);
85
+ *,
86
+ *::before,
87
+ *::after {
88
+ box-sizing: border-box;
89
+ }
90
+ }
91
+ .sw-container button,
92
+ .sw-container input {
93
+ font-family: var(--sw-font-family);
94
+ }
95
+ .sw-container h1,
96
+ .sw-container h2,
97
+ .sw-container h3,
98
+ .sw-container h4,
99
+ .sw-container h5,
100
+ .sw-container h6,
101
+ .sw-container p {
102
+ display: block;
103
+ margin: 0;
104
+ color: inherit;
105
+ font-family: var(--sw-font-family);
106
+ font-weight: normal;
107
+ line-height: 1.4;
108
+ }
109
+ .sw-container h1 {
110
+ font-size: 22px;
111
+ }
112
+ .sw-container h2 {
113
+ font-size: 20px;
114
+ }
115
+ .sw-container h3 {
116
+ font-size: 18px;
117
+ }
118
+ .sw-container h4 {
119
+ font-size: 16px;
120
+ }
121
+ .sw-container h5 {
122
+ font-size: 14px;
123
+ }
124
+ .sw-container h6,
125
+ .sw-container small {
126
+ font-size: 12px;
127
+ }
128
+ .sw-container .sw-fw500 {
129
+ font-weight: 500 !important;
130
+ }
131
+ .sw-container .sw-flex {
132
+ display: flex;
133
+ }
134
+ .sw-container .sw-align-center {
135
+ display: flex;
136
+ align-items: center;
137
+ }
138
+ .sw-container .sw-gap-5 {
139
+ gap: 5px;
140
+ }
141
+ .sw-container .sw-gap-15 {
142
+ gap: 15px;
143
+ }
144
+ .sw-container .sw-justify-between {
145
+ justify-content: space-between;
146
+ }
147
+ .sw-container .enFont{
148
+ font-family: var(--sw-en-font-family);
149
+ }
150
+ .sw-container .sw-text-ellipsis {
151
+ display: -webkit-box;
152
+ overflow: hidden;
153
+ -webkit-box-orient: vertical;
154
+ text-overflow: ellipsis;
155
+ }
156
+ .sw-container .sw-text-label {
157
+ color: var(--sw-label-color);
158
+ }
159
+ .sw-booking-form {
160
+ position: relative;
161
+ display: grid;
162
+ grid-template-columns: 1fr repeat(4, minmax(0, 1fr)) minmax(80px, 0.8fr);
163
+ gap: var(--sw-space-sm);
164
+ min-height: 55px;
165
+ min-width: 0;
166
+ border-radius: var(--sw-radius);
167
+ overflow: visible;
168
+ }
169
+ .sw-card-box {
170
+ position: relative;
171
+ display: block;
172
+ padding: 20px;
173
+ background-color: var(--sw-white);
174
+ border-radius: var(--sw-radius);
175
+ }
176
+ .sw-card-box .br-right{
177
+ border-top-right-radius: var(--sw-radius);
178
+ border-bottom-right-radius: var(--sw-radius);
179
+ }
180
+ .sw-card-box .br-left{
181
+ border-top-left-radius: var(--sw-radius);
182
+ border-bottom-left-radius: var(--sw-radius);
183
+ }
184
+ .sw-com-cal .p-disabled{
185
+ opacity: 0.3;
186
+ }
187
+ .sw-form-field {
188
+ display: flex;
189
+ flex-direction: column;
190
+ flex: 1 1 auto;
191
+ gap: 3px;
192
+ padding: 10px 15px;
193
+ background-color: #f8f8f8;
194
+ min-width: 0;
195
+ overflow: visible;
196
+ }
197
+ .sw-form-field .p-calendar {
198
+ position: unset;
199
+ }
200
+ .sw-form-field label {
201
+ display: block;
202
+ width: 100%;
203
+ margin: 0;
204
+ padding: 0;
205
+ overflow: hidden;
206
+ white-space: nowrap;
207
+ color: var(--sw-label-color);
208
+ font-size: 12px;
209
+ font-weight: 500;
210
+ -webkit-box-orient: vertical;
211
+ text-overflow: ellipsis;
212
+ text-align: initial;
213
+ }
214
+ .p-button-label {
215
+ flex: unset;
216
+ }
217
+ .sw-form-field input,
218
+ .sw-form-field .p-inputtext {
219
+ display: block;
220
+ width: 100%;
221
+ margin: 0;
222
+ padding: 0;
223
+ border: 0;
224
+ border-radius: 0;
225
+ outline: none;
226
+ background: transparent;
227
+ box-shadow: none;
228
+ color: var(--sw-body-text);
229
+ font-size: 14px;
230
+ font-weight: 500;
231
+ }
232
+ .sw-form-field input::placeholder,
233
+ .sw-form-field .p-inputtext::placeholder {
234
+ color: var(--sw-label-color) !important;
235
+ }
236
+ .sw-form-swap {
237
+ position: absolute;
238
+ top: 50%;
239
+ left: 50%;
240
+ z-index: 2;
241
+ display: flex;
242
+ align-items: center;
243
+ justify-content: center;
244
+ padding: 3px;
245
+ border: 1px solid var(--sw-form-border);
246
+ border-radius: 50%;
247
+ background-color: #fff;
248
+ cursor: pointer;
249
+ transform: translate(-50%, -50%);
250
+ }
251
+ .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-form-field.sw-pos-rel:last-child {
252
+ padding-inline-start: 25px;
253
+ }
254
+ .sw-custom-dropdown {
255
+ display: block;
256
+ width: 100%;
257
+ }
258
+ .sw-dropdown-text{
259
+ margin: 0 20px;
260
+ padding: 10px 0;
261
+ cursor: pointer;
262
+ font-family: var(--sw-font-family);
263
+ font-weight: 500;
264
+ }
265
+ .sw-custom-dropdown-trigger {
266
+ display: flex;
267
+ align-items: center;
268
+ justify-content: space-between;
269
+ flex: 1 1 auto;
270
+ width: 100%;
271
+ min-width: 0;
272
+ margin: 0;
273
+ padding: 0;
274
+ border: 0;
275
+ outline: none;
276
+ background: transparent;
277
+ cursor: pointer;
278
+ color: var(--sw-body-text);
279
+ font-size: 14px;
280
+ font-weight: 500;
281
+ }
282
+ .sw-custom-dropdown-trigger .sw-placeholder {
283
+ color: var(--sw-label-color);
284
+ }
285
+ .sw-dropdown-arrow {
286
+ margin-left: 8px;
287
+ color: var(--sw-label-color);
288
+ font-size: 10px;
289
+ transition: transform 0.2s ease;
290
+ }
291
+ .sw-dropdown{
292
+ position: absolute;
293
+ top: calc(100% + 5px);
294
+ left: 0;
295
+ right: 0;
296
+ z-index: calc(var(--sw-widget-z-index-base) + 5);
297
+ display: block;
298
+ visibility: visible;
299
+ opacity: 1;
300
+ }
301
+ .sw-dropdown,
302
+ .p-autocomplete-panel {
303
+ width: 380px;
304
+ max-height: 310px;
305
+ margin: 0;
306
+ padding: 0;
307
+ overflow: auto;
308
+ overflow-x: hidden;
309
+ background: var(--sw-white);
310
+ border: 1px solid var(--sw-form-border);
311
+ border-radius: var(--sw-radius);
312
+ box-shadow: var(--sw-widget-shadow);
313
+ }
314
+ .sw-dropdown::-webkit-scrollbar {
315
+ display: none;
316
+ }
317
+ .sw-dropdown-list-card,
318
+ .sw-dropdown-list-box,
319
+ .p-autocomplete-item {
320
+ display: flex;
321
+ align-items: center;
322
+ gap: 15px;
323
+ margin: 0 20px;
324
+ padding: 10px 0;
325
+ cursor: pointer;
326
+ font-family: var(--sw-font-family);
327
+ }
328
+ .p-autocomplete-item{
329
+ font-size: 14px;
330
+ font-weight: 400;
331
+ }
332
+ .p-autocomplete-item:hover{
333
+ background-color: var(--primary-light);
334
+ }
335
+ .sw-dropdown-list-box {
336
+ display: flex;
337
+ justify-content: space-between;
338
+ }
339
+ .sw-dropdown-list-card {
340
+ display: grid;
341
+ grid-template-columns: 45px auto;
342
+ }
343
+ .sw-dropdown-item-badge {
344
+ display: grid;
345
+ place-items: center;
346
+ width: fit-content;
347
+ height: unset;
348
+ margin: 0;
349
+ padding: 4px 8px;
350
+ background-color: #eaeaea;
351
+ border-radius: 4px;
352
+ font-weight: 500;
353
+ }
354
+ .sw-dropdown-listBox{
355
+ display: flex;
356
+ justify-content: space-between;
357
+ align-items: center;
358
+ gap: 10px;
359
+ margin: 0 20px;
360
+ padding: 10px 0;
361
+ }
362
+ .sw-dropdown-list {
363
+ display: block;
364
+ margin: 0;
365
+ padding: 0;
366
+ list-style: none;
367
+ }
368
+ .sw-dropdown-list-item {
369
+ display: block;
370
+ margin: 0;
371
+ padding: 0;
372
+ cursor: pointer;
373
+ color: var(--sw-body-text);
374
+ font-size: 14px;
375
+ transition: background-color 0.2s ease;
376
+ }
377
+ .sw-current {
378
+ font-weight: 500;
379
+ }
380
+ .sw-en-font {
381
+ font-family: Arial, sans-serif;
382
+ }
383
+ .sw-bg-color-loc {
384
+ color: var(--primary);
385
+ }
386
+ .sw-scale-rotate {
387
+ transition: transform 0.2s ease;
388
+ }
389
+ .sw-custom-dropdown-item:hover {
390
+ background-color: var(--secondary-light);
391
+ }
392
+ .sw-custom-dropdown-item:first-child {
393
+ border-top-left-radius: var(--sw-btn-radius);
394
+ border-top-right-radius: var(--sw-btn-radius);
395
+ }
396
+ .sw-custom-dropdown-item:last-child {
397
+ border-bottom-left-radius: var(--sw-btn-radius);
398
+ border-bottom-right-radius: var(--sw-btn-radius);
399
+ }
400
+ .sw-rooms-guests-menu {
401
+ position: absolute;
402
+ top: 100%;
403
+ right: 0;
404
+ z-index: var(--sw-widget-z-index-base);
405
+ display: block;
406
+ width: 75%;
407
+ margin-top: 4px;
408
+ padding: 20px;
409
+ background: var(--sw-white);
410
+ border: 1px solid var(--sw-form-border);
411
+ border-radius: var(--sw-radius);
412
+ box-shadow: var(--sw-widget-shadow);
413
+ }
414
+ .sw-pos-rel {
415
+ position: relative;
416
+ }
417
+ .sw-rooms-guests-title {
418
+ margin: 0 0 15px 0 !important;
419
+ font-size: 16px !important;
420
+ font-weight: 500 !important;
421
+ }
422
+ .sw-room-section {
423
+ display: grid;
424
+ grid-template-columns: 1.2fr 3fr 4fr 50px;
425
+ align-items: center;
426
+ padding: 10px 0;
427
+ }
428
+ .sw-pb0 {
429
+ padding-bottom: 0;
430
+ }
431
+ .sw-room-section:last-of-type {
432
+ margin-bottom: 15px;
433
+ }
434
+ .sw-room-header {
435
+ display: flex;
436
+ align-items: center;
437
+ gap: 5px;
438
+ color: var(--primary);
439
+ font-size: 14px;
440
+ font-weight: 500;
441
+ }
442
+ .sw-room-controls-child {
443
+ display: grid;
444
+ grid-template-columns: repeat(4, minmax(0, 1fr));
445
+ gap: var(--sw-space-lg);
446
+ min-width: 0;
447
+ }
448
+ .sw-room-controls-child .p-dropdown {
449
+ padding: 10px;
450
+ border: 1px solid var(--sw-form-border);
451
+ border-radius: var(--sw-radius);
452
+ }
453
+ .sw-room-controls-child .p-dropdown-item {
454
+ padding: 10px;
455
+ font-size: 14px;
456
+ }
457
+ .sw-room-controls-child .p-dropdown-panel {
458
+ background: var(--sw-white);
459
+ border: 1px solid var(--sw-form-border);
460
+ border-radius: var(--sw-btn-radius);
461
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
462
+ }
463
+ .sw-room-controls-group {
464
+ display: grid;
465
+ grid-template-columns: repeat(2, minmax(0, 1fr));
466
+ justify-content: center;
467
+ gap: var(--sw-space-md);
468
+ min-width: 0;
469
+ }
470
+ .sw-room-control-item {
471
+ display: flex;
472
+ flex-direction: column;
473
+ flex: 1 1 auto;
474
+ justify-content: space-between;
475
+ gap: var(--sw-space-sm);
476
+ min-width: 0;
477
+ }
478
+ .sw-room-control-label {
479
+ color: var(--sw-body-text);
480
+ font-size: 14px;
481
+ font-weight: 400;
482
+ }
483
+ .sw-room-control-buttons {
484
+ display: grid;
485
+ grid-template-columns: 36px 40px 36px;
486
+ align-items: center;
487
+ overflow: hidden;
488
+ }
489
+ .sw-count-button {
490
+ display: flex;
491
+ align-items: center;
492
+ justify-content: center;
493
+ width: 36px;
494
+ height: 36px;
495
+ margin: 0;
496
+ padding: 0;
497
+ border: none;
498
+ border-radius: 50%;
499
+ background: var(--primary);
500
+ cursor: pointer;
501
+ color: var(--sw-white);
502
+ font-size: 20px;
503
+ font-weight: 500;
504
+ transition: var(--sw-widget-transition);
505
+ }
506
+ .sw-count-button:focus-visible {
507
+ outline: none;
508
+ }
509
+ .sw-count-button.sw-disabled {
510
+ opacity: 0.6;
511
+ cursor: not-allowed;
512
+ }
513
+ .sw-count-button:disabled {
514
+ cursor: not-allowed;
515
+ }
516
+ .sw-count-value {
517
+ min-width: 30px;
518
+ text-align: center;
519
+ color: var(--sw-body-text);
520
+ font-size: 16px;
521
+ font-weight: 500;
522
+ }
523
+ .sw-add-room-button {
524
+ display: flex;
525
+ align-items: center;
526
+ gap: 8px;
527
+ width: auto;
528
+ height: 40px;
529
+ margin: 0 !important;
530
+ padding: 1rem;
531
+ border: 1px solid var(--primary);
532
+ border-radius: var(--sw-radius);
533
+ background-color: transparent;
534
+ cursor: pointer;
535
+ color: var(--primary);
536
+ font-size: 14px;
537
+ font-weight: 500;
538
+ svg{
539
+ fill: var(--primary);
540
+ }
541
+ }
542
+ .sw-rooms-guests-cta {
543
+ display: flex;
544
+ gap: 10px;
545
+ }
546
+ .sw-rooms-guests-footer {
547
+ display: flex;
548
+ justify-content: space-between;
549
+ gap: 10px;
550
+ margin-top: 15px;
551
+ padding-top: 15px;
552
+ border-top: 1px solid var(--sw-form-border);
553
+ }
554
+ .sw-reset-button {
555
+ padding: 10px 20px;
556
+ border: 1px solid var(--primary);
557
+ border-radius: var(--sw-btn-radius);
558
+ background: transparent;
559
+ cursor: pointer;
560
+ color: var(--primary);
561
+ font-size: 14px;
562
+ font-weight: 500;
563
+ transition: all 0.2s ease;
564
+ }
565
+ .sw-apply-button {
566
+ padding: 10px 20px;
567
+ border: 1px solid var(--sw-button-primary-border);
568
+ border-radius: var(--sw-btn-radius);
569
+ background: var(--sw-primary-btn);
570
+ cursor: pointer;
571
+ color: var(--sw-primary-button-text);
572
+ font-size: 14px;
573
+ font-weight: 500;
574
+ transition: all 0.2s ease;
575
+ }
576
+ .sw-search-button,
577
+ .sw-search-button.p-button {
578
+ display: flex;
579
+ align-items: center;
580
+ justify-content: center;
581
+ gap: 10px;
582
+ width: auto;
583
+ height: 100%;
584
+ min-height: 56px;
585
+ margin: 0;
586
+ padding: 0 15px;
587
+ border: 1px solid var(--sw-button-primary-border);
588
+ background-color: var(--sw-primary-btn);
589
+ cursor: pointer;
590
+ color: var(--sw-primary-button-text);
591
+ font-size: 16px;
592
+ font-weight: 400;
593
+ transition: var(--sw-widget-transition);
594
+ }
595
+ .sw-search-button:focus-visible,
596
+ .sw-search-button.p-button:focus-visible {
597
+ outline: 2px solid var(--primary);
598
+ outline-offset: 2px;
599
+ }
600
+ .sw-search-button .p-button-icon-left {
601
+ margin: 0;
602
+ }
603
+ .sw-search-button svg,
604
+ .sw-search-button .p-button-icon {
605
+ flex-shrink: 0;
606
+ }
607
+ .p-calendar .p-datepicker {
608
+ top: 100% !important;
609
+ display: block;
610
+ min-width: 100%;
611
+ margin-top: 5px !important;
612
+ padding: 15px;
613
+ background-color: var(--sw-white);
614
+ border: 1px solid var(--sw-form-border);
615
+ border-radius: var(--sw-radius);
616
+ box-shadow: var(--sw-widget-shadow);
617
+ }
618
+ .sw-srh-wrap {
619
+ display: flex;
620
+ gap: 2px;
621
+ }
622
+ .sw-com-cal p{
623
+ color: var(--sw-body-text);
624
+ font-size: 14px;
625
+ font-weight: 500;
626
+ }
627
+ .sw-com-cal .p-inputtext{
628
+ visibility: hidden;
629
+ height: 0;
630
+ width: 0;
631
+ ;
632
+ }
633
+ .sw-calendar .p-inputtext{
634
+ visibility: visible;
635
+ height: auto;
636
+ width: auto;
637
+ }
638
+ .p-datepicker-header {
639
+ padding-bottom: 15px;
640
+ }
641
+ .p-datepicker-prev[style="visibility: hidden;"]::after,
642
+ .p-datepicker-next[style="visibility: hidden;"]::after {
643
+ visibility: hidden !important;
644
+ }
645
+ .p-datepicker-prev,
646
+ .p-datepicker-next {
647
+ cursor: pointer;
648
+
649
+ }
650
+ .p-datepicker-prev::after,
651
+ .p-datepicker-next::after {
652
+ content: "";
653
+ display: block;
654
+ width: 14px;
655
+ height: 14px;
656
+ visibility: visible;
657
+ background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'><path fill='%231b1a1f' d='m222.927 580.115 301.354 328.512c24.354 28.708 20.825 71.724-7.883 96.078s-71.724 20.825-96.078-7.883L19.576 559.963a67.9 67.9 0 0 1-13.784-20.022 68 68 0 0 1-5.977-29.488l.001-.063a68.34 68.34 0 0 1 7.265-29.134 68 68 0 0 1 1.384-2.6 67.6 67.6 0 0 1 10.102-13.687L429.966 21.113c25.592-27.611 68.721-29.247 96.331-3.656s29.247 68.721 3.656 96.331L224.088 443.784h730.46c37.647 0 68.166 30.519 68.166 68.166s-30.519 68.166-68.166 68.166z'/></svg>");
658
+ }
659
+ .p-datepicker-header button {
660
+ margin: 0;
661
+ padding: 0 5px;
662
+ border: 0;
663
+ border-color: var(--sw-white);
664
+ outline: none;
665
+ background: transparent;
666
+ color: var(--sw-body-text);
667
+ font-size: 16px;
668
+ font-weight: 500;
669
+ line-height: 20px;
670
+ }
671
+ .p-datepicker-header button .p-icon {
672
+ display: none;
673
+ }
674
+ .p-datepicker .p-datepicker-next {
675
+ transform: rotate(180deg);
676
+ }
677
+ .p-datepicker .p-datepicker-header button {
678
+ border: 0;
679
+ border-color: var(--sw-white);
680
+ outline: none;
681
+ box-shadow: none !important;
682
+ background: transparent;
683
+ color: var(--sw-body-text);
684
+ font-size: 16px;
685
+ font-weight: 500;
686
+ line-height: 20px;
687
+ }
688
+ .p-datepicker .p-datepicker-calendar-container th {
689
+ padding: 10px 0;
690
+ color: var(--sw-body-text);
691
+ font-size: 14px;
692
+ font-weight: 400;
693
+ line-height: 1.4;
694
+ }
695
+ .p-datepicker .p-datepicker-calendar-container td {
696
+ padding: 0;
697
+ }
698
+ .p-datepicker .p-datepicker-calendar-container td span {
699
+ padding: 10px 0;
700
+ border-radius: 0;
701
+ font-size: 14px;
702
+ width: 45px;
703
+ height: 45px;
704
+ }
705
+ .p-datepicker-group-container .p-datepicker-group:not(:last-child) {
706
+ border-inline-end: 1px solid var(--sw-form-border);
707
+ padding-inline-end: 10px;
708
+ margin-inline-end: 10px;
709
+ }
710
+ .p-datepicker-other-month span{
711
+ opacity: 0;
712
+ }
713
+ .p-datepicker .p-highlight {
714
+ position: relative;
715
+ background: var(--primary) !important;
716
+ color: var(--sw-white) !important;
717
+ }
718
+ .sw-product-tabs {
719
+ position: relative;
720
+ z-index: 1;
721
+ }
722
+ .sw-product-tabs .p-tabview-nav {
723
+ display: flex;
724
+ flex-wrap: wrap;
725
+ gap: 10px;
726
+ margin: 0;
727
+ padding: 0;
728
+ list-style: none;
729
+ }
730
+ .sw-product-tabs .sw-product-list {
731
+ position: relative;
732
+ gap: 10px;
733
+ padding: 0 10px 10px;
734
+ border: 0 !important;
735
+ border-radius: 0;
736
+ cursor: pointer;
737
+ }
738
+ .p-tabview-selected .sw-product-list:before {
739
+ content: "";
740
+ position: absolute;
741
+ bottom: 0;
742
+ left: 0;
743
+ inset-inline-start: 0;
744
+ width: 100%;
745
+ border: 2px solid var(--primary) !important;
746
+ border-radius: 40px;
747
+ }
748
+ .p-tabview-ink-bar {
749
+ display: none;
750
+ }
751
+ .sw-advanced-search-options .p-accordion-header-link {
752
+ display: flex;
753
+ flex-direction: row-reverse;
754
+ gap: 10px;
755
+ width: fit-content;
756
+ margin-top: 15px;
757
+ color: var(--sw-body-text);
758
+ font-size: 14px;
759
+ }
760
+ .sw-advanced-search-options .p-toggleable-content {
761
+ margin-top: 20px;
762
+ }
763
+ .sw-advanced-search-options .p-accordion-content .sw-hsrh-advan-cont:not(:last-child) {
764
+ margin-bottom: 16px;
765
+ }
766
+ .sw-advanced-search-options .p-accordion-header-link svg {
767
+ transform: rotate(90deg);
768
+ }
769
+ .sw-advanced-search-options .p-accordion-header-link[aria-expanded="true"] svg {
770
+ transform: scale(-1);
771
+ }
772
+ .sw-material-checkbox {
773
+ position: relative;
774
+ display: inline-flex;
775
+ gap: 10px;
776
+ cursor: pointer;
777
+ user-select: none;
778
+ color: var(--sw-body-text);
779
+ font-size: 14px;
780
+ }
781
+ .sw-material-checkbox input {
782
+ display: none;
783
+ }
784
+ .sw-material-checkbox input:checked + .sw-checkmark {
785
+ background-color: var(--primary);
786
+ border-color: var(--primary);
787
+ }
788
+ .sw-material-checkbox input:checked + .sw-checkmark::after {
789
+ content: "";
790
+ position: absolute;
791
+ top: 2px;
792
+ left: 6px;
793
+ display: block;
794
+ width: 6px;
795
+ height: 11px;
796
+ border: solid #fff;
797
+ border-width: 0 2px 2px 0;
798
+ transform: rotate(45deg);
799
+ }
800
+ .sw-material-checkbox .sw-checkmark {
801
+ position: relative;
802
+ display: inline-block;
803
+ width: 20px;
804
+ min-width: 20px;
805
+ height: 20px;
806
+ background-color: #fff;
807
+ border: 1px solid var(--sw-form-border);
808
+ border-radius: 4px;
809
+ transition: background-color 0.3s, border-color 0.3s;
810
+ }
811
+ .sw-material-checkbox .sw-checkmark::after {
812
+ content: "";
813
+ position: absolute;
814
+ display: none;
815
+ }
816
+ .sw-tab-checkbox {
817
+ display: flex;
818
+ cursor: pointer;
819
+ -webkit-user-select: none;
820
+ user-select: none;
821
+ }
822
+ .sw-tab-checkbox input {
823
+ display: none;
824
+ }
825
+ .sw-tab-checkbox input:checked + .sw-tab-content,
826
+ .sw-tab-checkbox input[type=radio]:checked + .sw-tab-content {
827
+ border: 1px solid var(--primary);
828
+ background-color: var(--primary-light);
829
+ color: var(--primary);
830
+ }
831
+ .sw-tab-content {
832
+ height: 40px;
833
+ padding: 6px 15px;
834
+ border: 1px solid var(--sw-form-border);
835
+ border-radius: var(--sw-radius);
836
+ align-content: center;
837
+ }
838
+ @media print {
839
+ .sw-container {
840
+ display: none;
841
+ }
842
+ }
843
+ .sw-dropdown,
844
+ .sw-rooms-guests-menu,
845
+ .p-calendar .p-datepicker {
846
+ will-change: transform, opacity;
847
+ transform: translateZ(0);
848
+ }
849
+ .sw-dropdown {
850
+ -webkit-overflow-scrolling: touch;
851
+ scroll-behavior: smooth;
852
+ }
853
+ .sw-container img {
854
+ max-width: 100%;
855
+ height: auto;
856
+ }
857
+ .sw-container svg {
858
+ max-width: 100%;
859
+ height: auto;
860
+ }
861
+ .sw-container {
862
+ isolation: isolate;
863
+ }
864
+ .sw-srh-grid {
865
+ display: grid;
866
+ grid-template-columns: minmax(200px, 2fr) minmax(100px, 1fr) minmax(80px, 0.6fr) minmax(60px, 0.4fr);
867
+ gap: var(--sw-space-sm, 2px);
868
+ margin-top: 15px;
869
+ border-radius: var(--sw-radius);
870
+ min-width: 0;
871
+ overflow: visible;
872
+ }
873
+ .sw-srh-wrap .sw-form-field {
874
+ flex: 1 1 50%;
875
+ min-width: 0;
876
+ justify-content: center;
877
+ }
878
+ .sw-add-return-label label {
879
+ color: var(--primary) !important;
880
+ }
881
+ .sw-srh-main-head {
882
+ display: flex;
883
+ align-items: center;
884
+ justify-content: space-between;
885
+ margin-bottom: 15px;
886
+ }
887
+ .sw-srh-head {
888
+ display: flex;
889
+ align-items: center;
890
+ gap: 10px;
891
+ }
892
+ .sw-srh-round-text {
893
+ display: flex;
894
+ align-items: center;
895
+ gap: 8px;
896
+ height: 40px;
897
+ }
898
+ .sw-remove-segment{
899
+ fill: var(--primary);
900
+ cursor: pointer;
901
+ display: grid;
902
+ place-content: center;
903
+ position: absolute;
904
+ z-index: 2;
905
+ border-radius: 50%;
906
+ inset-inline-end: 12px;
907
+ border: 1px solid var(--primary);
908
+ width: 22px;
909
+ height: 22px;
910
+ top: 19px;
911
+ svg{
912
+ width: 22px;
913
+ height: 22px;
914
+ }
915
+ }
916
+ .sw-srh-mc .sw-srh-wrap.sw-srh-box{
917
+ position: relative;
918
+ }
919
+ .sw-srh-mc {
920
+ grid-template-columns: 6.3fr 2.5fr 1.15fr !important;
921
+ min-width: 0;
922
+ }
923
+ .sw-srh-mc .sw-com-cal .p-inputtext{
924
+ visibility: visible !important;
925
+ height: auto !important;
926
+ width: auto !important;
927
+ }
928
+ .sw-srh-mc .sw-srh-wrap.sw-pos-rel:nth-child(3){
929
+ flex-basis: 30%;
930
+ }
931
+ .sw-srh-mc .sw-srh-mc-foot {
932
+ display: flex;
933
+ align-items: flex-end;
934
+ width: fit-content;
935
+ grid-column-start: 2;
936
+ }
937
+ .sw-srh-mc .sw-srh-mc-foot button {
938
+ display: flex;
939
+ align-items: center;
940
+ gap: 7px;
941
+ margin-inline-start: 5px;
942
+ padding: 8px 10px;
943
+ border: 1px solid var(--primary);
944
+ border-radius: 30px;
945
+ background-color: transparent;
946
+ color: var(--primary);
947
+ font-size: 14px;
948
+ }
949
+ .sw-srh-mc .sw-srh-mc-foot button svg {
950
+ fill: var(--primary);
951
+ }
952
+ .sw-srh-mc .sw-srh-add-btn {
953
+ display: flex;
954
+ align-items: center;
955
+ gap: 7px;
956
+ margin-inline-start: 5px;
957
+ padding: 0.8rem 1rem;
958
+ border-radius: 30px;
959
+ color: var(--primary);
960
+ font-size: 1.4rem;
961
+ }
962
+ .sw-srh-mc .sw-traveller {
963
+ grid-row-start: 1;
964
+ grid-column-start: 2;
965
+ }
966
+ .sw-srh-mc button {
967
+ grid-row-start: 1;
968
+ grid-column-start: 3;
969
+ }
970
+ .sw-srh-box {
971
+ grid-column-start: 1;
972
+ }
973
+ .p-autocomplete-multiple-container {
974
+ width: 100%;
975
+ min-width: 270px;
976
+ padding: 10px;
977
+ padding-inline-end: 2rem;
978
+ border: 1px solid var(--sw-form-border);
979
+ border-radius: var(--sw-radius);
980
+ gap: 0.5rem;
981
+ font-size: 14px;
982
+ }
983
+ .p-autocomplete-multiple-container .p-autocomplete-token {
984
+ padding: 5px 8px;
985
+ border-radius: 5px;
986
+ background: var(--primary-light);
987
+ gap: 5px;
988
+ color: var(--primary);
989
+ }
990
+ .p-autocomplete-token .p-autocomplete-token-label{
991
+ font-size: 12px;
992
+ font-weight: 400;
993
+ }
994
+ .sw-fsrh-adv-cont {
995
+ display: flex;
996
+ align-items: center;
997
+ gap: 20px;
998
+ }
999
+ .sw-fsrh-chk-main {
1000
+ display: flex;
1001
+ gap: 20px;
1002
+ font-size: 1.4rem;
1003
+ font-weight: 400;
1004
+ }
1005
+ .sw-srh-pax {
1006
+ display: flex;
1007
+ align-items: center;
1008
+ gap: 10px;
1009
+ }
1010
+ .sw-srh-pax:not(:last-child) {
1011
+ margin-bottom: 15px;
1012
+ }
1013
+ .sw-srh-common-adult {
1014
+ width: 92px;
1015
+ }
1016
+ .sw-srh-pax h3 {
1017
+ font-size: 14px;
1018
+ }
1019
+ .sw-srh-pax p {
1020
+ color: var(--sw-label-color);
1021
+ font-size: 12px;
1022
+ }
1023
+ .sw-srh-button-wrapper button {
1024
+ width: 32px;
1025
+ height: 30px;
1026
+ margin: 0;
1027
+ padding: 0;
1028
+ border: 0;
1029
+ border-radius: 8px;
1030
+ background-color: transparent;
1031
+ font-size: 14px;
1032
+ font-weight: 400;
1033
+ }
1034
+ .sw-srh-button-wrapper button.sw-active-button {
1035
+ background-color: var(--secondary);
1036
+ color: var(--sw-white);
1037
+ }
1038
+ .sw-traveller .sw-rooms-guests-menu {
1039
+ width: 500px;
1040
+ }
1041
+ .sw-srh-class {
1042
+ display: flex;
1043
+ flex-wrap: wrap;
1044
+ gap: var(--sw-space-md, 10px);
1045
+ align-items: stretch;
1046
+ }
1047
+ .sw-srh-class .sw-tab-content {
1048
+ min-width: fit-content;
1049
+ display: block;
1050
+ }
1051
+ .sw-srh-class label {
1052
+ width: fit-content !important;
1053
+ }
1054
+ .sw-srh-class .sw-tab-checkbox input:checked + .sw-tab-content,
1055
+ .sw-srh-class .sw-tab-checkbox input[type=radio]:checked + .sw-tab-content {
1056
+ background-color: var(--primary);
1057
+ color: var(--sw-white);
1058
+ }
1059
+ .sw-srh-h-grid {
1060
+ position: relative;
1061
+ display: grid;
1062
+ grid-template-columns: 2.2fr 1.8fr 3fr 1.8fr 1.15fr;
1063
+ gap: var(--sw-space-sm, 2px);
1064
+ min-height: 55px;
1065
+ min-width: 0;
1066
+ overflow: visible;
1067
+ border-radius: var(--sw-radius);
1068
+ }
1069
+ .sw-srh-loc {
1070
+ display: block !important;
1071
+ padding: 15px 0 12px;
1072
+ border-bottom: 1px solid var(--sw-form-border);
1073
+ }
1074
+ .sw-srh-count-wrapper,
1075
+ .sw-srh-loc {
1076
+ display: flex;
1077
+ align-items: center;
1078
+ gap: 15px;
1079
+ margin: 0 20px;
1080
+ cursor: pointer;
1081
+ }
1082
+ .sw-hotel-search-form-icon {
1083
+ display: grid;
1084
+ place-content: center;
1085
+ width: 40px;
1086
+ height: 40px;
1087
+ background: #f4f5f5;
1088
+ border-radius: var(--sw-radius);
1089
+ }
1090
+ .sw-hotel-search-form-icon.sw-fill {
1091
+ background: var(--primary-light);
1092
+ }
1093
+ .sw-hsrh-advan-cont {
1094
+ display: flex;
1095
+ align-items: center;
1096
+ gap: 10px;
1097
+ }
1098
+ .sw-checkbox-wrap {
1099
+ cursor: pointer;
1100
+ }
1101
+ .sw-checkbox-wrap input {
1102
+ display: none;
1103
+ }
1104
+ .sw-checkbox-wrap input:checked + .sw-star-checkbox {
1105
+ padding: 8px 12px;
1106
+ border: 1px solid var(--primary-light);
1107
+ border-radius: 20px;
1108
+ background: var(--primary-light);
1109
+ gap: 5px;
1110
+ color: var(--primary);
1111
+ font-size: 14px;
1112
+ line-height: 1;
1113
+ }
1114
+ .sw-checkbox-wrap .sw-star-checkbox {
1115
+ display: flex;
1116
+ align-items: center;
1117
+ gap: 5px;
1118
+ padding: 8px 12px;
1119
+ border: 1px solid var(--sw-form-border);
1120
+ border-radius: 20px;
1121
+ font-size: 14px;
1122
+ line-height: 1;
1123
+ }
1124
+ .sw-star-checkbox-wrap input:checked + .sw-star-checkbox {
1125
+ padding: 7px 12px;
1126
+ border: 1px solid #fcf2e8;
1127
+ border-radius: 20px;
1128
+ background: #fcf2e8;
1129
+ color: #ffae43;
1130
+ }
1131
+ .sw-star-checkbox-wrap input:checked + .sw-star-checkbox svg path {
1132
+ fill: #ffae43;
1133
+ }
1134
+ .sw-hsrh-chk-main {
1135
+ display: flex;
1136
+ gap: var(--sw-space-md, 10px);
1137
+ font-size: 1.4rem;
1138
+ font-weight: 400;
1139
+ flex-wrap: wrap;
1140
+ }
1141
+ .sw-srh-class {
1142
+ display: flex;
1143
+ flex-wrap: wrap;
1144
+ gap: var(--sw-space-md, 10px);
1145
+ align-items: stretch;
1146
+ }
1147
+ .sw-srh-class .sw-tab-content {
1148
+ flex: 0 1 auto;
1149
+ min-width: fit-content;
1150
+ }`;
1151
+
1152
+ // src/Curated.tsx
1153
+ var import_jsx_runtime = require("react/jsx-runtime");
1154
+ var MIN_SEARCH_CHARS = 3;
1155
+ var MAX_ADULTS_PER_ROOM = 6;
1156
+ var MAX_CHILDREN_PER_ROOM = 4;
1157
+ var MAX_ROOMS = 6;
1158
+ var AIRPORT_SEARCH_URL = "https://adminapi-go.dev.futuretravelplatform.com/api/Airport/GetList/EN";
1159
+ var DESTINATION_SEARCH_URL = "https://hybridpackageapi.dev.futuretravelplatform.com/HybridPackage/GetSearchForm";
1160
+ var RSA_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
1161
+ MIICITANBgkqhkiG9w0BAQEFAAOCAg4AMIICCQKCAgB0rRSHGZK/FtK15IRfQxtl
1162
+ dN5ToPtfXGzTNBe1vGhow5xqp6BLubMKKPwCj3zOJiAm1Ip1VNqqYxWnaL8ZErBF
1163
+ rErtE0r7kn50QgGgJCpdrWJ4unhaoe1su207d9oY6D6OBH90v1aXA6ZjN7zTJmiq
1164
+ FJZOOTQE6t/XwNAOphq/B6Lcr1iQSQmSqaMozy4OQ4NvIzNTQn5tcs9qJBMsKFeU
1165
+ cSp8VK76JBNEqSuEHNmbV2d/IQ5XAqVUiAs34kH2xWRSbBmy0WK3c3QKGzC1MRWM
1166
+ 9JauLN56TKUFOmUSjfWY3caJru6HxsiMTGKnvflXHfgA2aLAPxu72pIHoCTy5Hxj
1167
+ AUoKM7qXUn/kQj4Ci0M/0LRF4boqd37wpbyVNeXNvqm+dLjxklf/+NHMfNL2Wvb4
1168
+ ekHUVI8nMVPgswIcQ7q/Njf9DC+LA+/duf8m9JDjI3J6r9y1gQugdkLETGzF2Gj1
1169
+ ToU0Pocrg6CFHImqq2z+cOeWnURrV0f0I1UWWGCb79OZxZ5oDjM9uCLRsoe8+Npg
1170
+ ACZNf4AbnM7OUNj5TEYs6t/tUYouvTB7gH452I3EH6KWBl+ZTgCg0RFkOMazNOjn
1171
+ 4J0yfbaPvpVgKzF2WRyn63mTO2tdLRl5s9uqMFhXmCs6IzEqBpxMKL1aS6ONZLDG
1172
+ 5qPtpCPJnUFQEBTVlSO15QIDAQAB
1173
+ -----END PUBLIC KEY-----`;
1174
+ var RSA_PUBLIC_KEY_SSO = `-----BEGIN PUBLIC KEY-----
1175
+ MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAv+PThexweK9V8axQRaB3
1176
+ JrhYm/y2JAhED2o7V4Kpi4PpwdkcsVuACwxPt8M51idar/lBNnm12yJAvMnSRAYP
1177
+ Gv+iYCE5VV+XPzUZuu/ho3sARxO3bCSRx9Xk0JZkd0Q7Muvy3Z74N9lML+g4DAHH
1178
+ 1SA+tQnvk2hLwna7vd6pHfmVDROEkTTqv0EF+0cVCUhwrXcEZ7NLrs3BPWLbxzus
1179
+ jlYsutTU0oaCeeag+xX6vbb+LFjDBvxngdlPzApUU0z9T4r/Mqbdb73e2FMrPSHO
1180
+ rJo+bRQ1+GE0EoFxYTyYVyOrd9bpfUhcc/ziK8Bu2M8lQk9pFs+1DGb1wC1TWklf
1181
+ ZCHX79BPP+tyLFugqmCLm+WprtNl+Cv93VQuwue6m9UATeiWHYrA9uZ0mWHvRPuD
1182
+ EaXCAvT3JUDqTnuV/mTu8cAr+HWMfB7wQ+XWyi6TVAfQovMawV89Gtk5q7Ep2L89
1183
+ MShfennamuIRODd7IuDLN24h8laBEKz0lPATsvyS3ITHG+DdwUjU+ptGYGzGI+ps
1184
+ YadkX8g5DSjQs8JZvCN22ktjGRLCudvS8e0IfgzRe6QQ90NmQ3dmtC4AsatHBeM5
1185
+ S7wetGyB9NHx52liu+AwZqiiLk8Yf/Y2/4394Z+kE/CYVFnCMEOxRhx/Fs3QRCm2
1186
+ piJcd0xNaTlQZ4IcB08NBMECAwEAAQ==
1187
+ -----END PUBLIC KEY-----`;
1188
+ var DEFAULT_ORIGIN_OPTIONS = [
1189
+ { ac: "AUH", an: "Abu Dhabi International Airport", cc: "AE", cn: "United Arab Emirates", ct: "Abu Dhabi" },
1190
+ { ac: "CAI", an: "Cairo International Airport", cc: "EG", cn: "Egypt", ct: "Cairo" },
1191
+ { ac: "DXB", an: "Dubai International Airport", cc: "AE", cn: "United Arab Emirates", ct: "Dubai" },
1192
+ { ac: "RUH", an: "King Khalid International Airport", cc: "SA", cn: "Saudi Arabia", ct: "Riyadh" },
1193
+ { ac: "LOS", an: "Murtala Muhammed International Airport", cc: "NG", cn: "Nigeria", ct: "Lagos" },
1194
+ { ac: "LON", an: "London All Airports", cc: "GB", cn: "United Kingdom", ct: "London" },
1195
+ { ac: "PAR", an: "All Airports", cc: "FR", cn: "France", ct: "Paris" },
1196
+ { ac: "NYC", an: "All airports", cc: "US", cn: "United States Of America", ct: "New York" }
1197
+ ];
1198
+ var SEARCH_CONTEXT = {
1199
+ orgId: "",
1200
+ affiliateId: "",
1201
+ langCode: "EN",
1202
+ tokenDomain: ""
1203
+ };
1204
+ var STYLE_ELEMENT_ID = "thsw-curated-styles";
1205
+ var PRIMEICONS_LINK_ID = "thsw-primeicons";
1206
+ var ensureStylesInjected = () => {
1207
+ if (typeof document === "undefined") {
1208
+ return;
1209
+ }
1210
+ if (document.getElementById(STYLE_ELEMENT_ID)) {
1211
+ return;
1212
+ }
1213
+ const style = document.createElement("style");
1214
+ style.id = STYLE_ELEMENT_ID;
1215
+ style.textContent = curatedSearchWidgetStyles;
1216
+ document.head.appendChild(style);
1217
+ };
1218
+ var ensurePrimeIconsLoaded = () => {
1219
+ if (typeof document === "undefined") {
1220
+ return;
1221
+ }
1222
+ if (document.getElementById(PRIMEICONS_LINK_ID)) {
1223
+ return;
1224
+ }
1225
+ const link = document.createElement("link");
1226
+ link.id = PRIMEICONS_LINK_ID;
1227
+ link.rel = "stylesheet";
1228
+ link.href = "https://unpkg.com/primeicons@7.0.0/primeicons.css";
1229
+ document.head.appendChild(link);
1230
+ };
1231
+ var CuratedSearchWidget = ({ config, ssoUser, minWidth }) => {
1232
+ const theme = config?.theme;
1233
+ const primaryColor = theme?.primary ?? "#2c0a82";
1234
+ const secondaryColor = theme?.secondary ?? "#2c0a82";
1235
+ const primaryLightColor = theme?.primaryLight ?? "#f3e2ff";
1236
+ const fontName = config?.fontName;
1237
+ const redirectionDomain = config?.redirectionDomain;
1238
+ const [formData, setFormData] = (0, import_react.useState)({
1239
+ origin: "",
1240
+ destination: "",
1241
+ nationality: "",
1242
+ departureDate: /* @__PURE__ */ new Date(),
1243
+ roomsGuests: "1 Room, 2 Adult"
1244
+ });
1245
+ const [isOriginDropdownOpen, setIsOriginDropdownOpen] = (0, import_react.useState)(false);
1246
+ const [isDestinationDropdownOpen, setIsDestinationDropdownOpen] = (0, import_react.useState)(false);
1247
+ const [isNationalityDropdownOpen, setIsNationalityDropdownOpen] = (0, import_react.useState)(false);
1248
+ const [originQuery, setOriginQuery] = (0, import_react.useState)("");
1249
+ const [destinationQuery, setDestinationQuery] = (0, import_react.useState)("");
1250
+ const [nationalityQuery, setNationalityQuery] = (0, import_react.useState)("");
1251
+ const [isRoomsGuestsMenuOpen, setIsRoomsGuestsMenuOpen] = (0, import_react.useState)(false);
1252
+ const [fieldErrors, setFieldErrors] = (0, import_react.useState)({
1253
+ origin: false,
1254
+ destination: false,
1255
+ nationality: false
1256
+ });
1257
+ const originDropdownRef = (0, import_react.useRef)(null);
1258
+ const destinationDropdownRef = (0, import_react.useRef)(null);
1259
+ const nationalityDropdownRef = (0, import_react.useRef)(null);
1260
+ const roomsGuestsMenuRef = (0, import_react.useRef)(null);
1261
+ const [rooms, setRooms] = (0, import_react.useState)([{ adults: 2, children: 0, childAges: [] }]);
1262
+ const [originResults, setOriginResults] = (0, import_react.useState)([]);
1263
+ const [isOriginLoading, setIsOriginLoading] = (0, import_react.useState)(false);
1264
+ const [destinationResults, setDestinationResults] = (0, import_react.useState)([]);
1265
+ const [isDestinationLoading, setIsDestinationLoading] = (0, import_react.useState)(false);
1266
+ const [selectedOrigin, setSelectedOrigin] = (0, import_react.useState)(null);
1267
+ const [selectedDestination, setSelectedDestination] = (0, import_react.useState)(null);
1268
+ const [selectedNationality, setSelectedNationality] = (0, import_react.useState)(null);
1269
+ const childAgeOptions = [
1270
+ { label: "Under 1", value: 0 },
1271
+ ...Array.from({ length: 17 }, (_, i) => ({
1272
+ label: `${i + 1}`,
1273
+ value: i + 1
1274
+ }))
1275
+ ];
1276
+ const getAirportDisplayText = (option) => {
1277
+ const code = option.ac ?? "";
1278
+ const name = option.an ?? "";
1279
+ const city = option.ct ?? "";
1280
+ const country = option.cn ?? "";
1281
+ const labelParts = [city, country].filter(Boolean).join(", ");
1282
+ if (name && code) {
1283
+ return `${name} (${code})`;
1284
+ }
1285
+ if (labelParts && code) {
1286
+ return `${labelParts} (${code})`;
1287
+ }
1288
+ return name || labelParts || code || "";
1289
+ };
1290
+ const getDestinationDisplayText = (option) => {
1291
+ return option.search_keyword ?? "";
1292
+ };
1293
+ const sortedDestinationResults = (0, import_react.useMemo)(() => {
1294
+ return [...destinationResults].sort((a, b) => (b.package_count ?? 0) - (a.package_count ?? 0));
1295
+ }, [destinationResults]);
1296
+ const today = /* @__PURE__ */ new Date();
1297
+ today.setHours(0, 0, 0, 0);
1298
+ const formatQueryDate = (date) => {
1299
+ if (!date) {
1300
+ return "";
1301
+ }
1302
+ return date.toLocaleDateString("en-GB", {
1303
+ day: "2-digit",
1304
+ month: "short",
1305
+ year: "numeric"
1306
+ });
1307
+ };
1308
+ const nationalityOptions = [
1309
+ { country_code: "AE", country_name: "United Arab Emirates", country_id: "AE" },
1310
+ { country_code: "US", country_name: "United States", country_id: "US" },
1311
+ { country_code: "GB", country_name: "United Kingdom", country_id: "GB" },
1312
+ { country_code: "IN", country_name: "India", country_id: "IN" },
1313
+ { country_code: "PK", country_name: "Pakistan", country_id: "PK" },
1314
+ { country_code: "BD", country_name: "Bangladesh", country_id: "BD" },
1315
+ { country_code: "EG", country_name: "Egypt", country_id: "EG" },
1316
+ { country_code: "SA", country_name: "Saudi Arabia", country_id: "SA" },
1317
+ { country_code: "KW", country_name: "Kuwait", country_id: "KW" },
1318
+ { country_code: "QA", country_name: "Qatar", country_id: "QA" },
1319
+ { country_code: "BH", country_name: "Bahrain", country_id: "BH" },
1320
+ { country_code: "OM", country_name: "Oman", country_id: "OM" },
1321
+ { country_code: "JO", country_name: "Jordan", country_id: "JO" },
1322
+ { country_code: "LB", country_name: "Lebanon", country_id: "LB" }
1323
+ ];
1324
+ const themeStyle = (0, import_react.useMemo)(() => {
1325
+ const style = {
1326
+ ["--primary"]: primaryColor,
1327
+ ["--secondary"]: secondaryColor,
1328
+ ["--primary-light"]: primaryLightColor
1329
+ };
1330
+ if (fontName) {
1331
+ style["--font-family"] = fontName;
1332
+ }
1333
+ if (minWidth !== void 0) {
1334
+ style.minWidth = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
1335
+ }
1336
+ return style;
1337
+ }, [primaryColor, secondaryColor, primaryLightColor, fontName, minWidth]);
1338
+ (0, import_react.useEffect)(() => {
1339
+ ensureStylesInjected();
1340
+ ensurePrimeIconsLoaded();
1341
+ }, []);
1342
+ const filteredNationalityOptions = nationalityQuery.trim().length < MIN_SEARCH_CHARS ? nationalityOptions : nationalityOptions.filter(
1343
+ (option) => option.country_name.toLowerCase().includes(nationalityQuery.trim().toLowerCase())
1344
+ );
1345
+ const buildRequestToken = () => {
1346
+ if (!redirectionDomain) {
1347
+ return "";
1348
+ }
1349
+ const domainKey = `${redirectionDomain}~${(/* @__PURE__ */ new Date()).getTime()}`;
1350
+ const encryptor = new import_jsencrypt.JSEncrypt();
1351
+ encryptor.setPublicKey(RSA_PUBLIC_KEY);
1352
+ return encryptor.encrypt(domainKey) || "";
1353
+ };
1354
+ const buildEncryptedSSOUser = () => {
1355
+ if (!ssoUser || !ssoUser.email?.trim()) {
1356
+ return "";
1357
+ }
1358
+ try {
1359
+ const payload = {
1360
+ ...ssoUser,
1361
+ ts: (/* @__PURE__ */ new Date()).toISOString()
1362
+ };
1363
+ const encryptor = new import_jsencrypt.JSEncrypt();
1364
+ encryptor.setPublicKey(RSA_PUBLIC_KEY_SSO);
1365
+ return encryptor.encrypt(JSON.stringify(payload)) || "";
1366
+ } catch {
1367
+ return "";
1368
+ }
1369
+ };
1370
+ (0, import_react.useEffect)(() => {
1371
+ const handleClickOutside = (event) => {
1372
+ const target = event.target;
1373
+ const isInsidePrimeDropdown = target.closest(".p-sw-dropdown-panel") !== null || target.closest(".p-sw-dropdown-items-wrapper") !== null || target.closest(".p-sw-dropdown-item") !== null || target.closest(".p-component")?.classList.contains("p-sw-dropdown") !== false || target.closest('[data-pc-section="panel"]') !== null || target.closest('[data-pc-name="sw-dropdown"]') !== null;
1374
+ if (originDropdownRef.current && !originDropdownRef.current.contains(target)) {
1375
+ setIsOriginDropdownOpen(false);
1376
+ }
1377
+ if (destinationDropdownRef.current && !destinationDropdownRef.current.contains(target)) {
1378
+ setIsDestinationDropdownOpen(false);
1379
+ }
1380
+ if (nationalityDropdownRef.current && !nationalityDropdownRef.current.contains(target)) {
1381
+ setIsNationalityDropdownOpen(false);
1382
+ }
1383
+ if (!isInsidePrimeDropdown && roomsGuestsMenuRef.current && !roomsGuestsMenuRef.current.contains(target)) {
1384
+ setIsRoomsGuestsMenuOpen(false);
1385
+ }
1386
+ };
1387
+ document.addEventListener("mousedown", handleClickOutside);
1388
+ return () => {
1389
+ document.removeEventListener("mousedown", handleClickOutside);
1390
+ };
1391
+ }, []);
1392
+ (0, import_react.useEffect)(() => {
1393
+ const totalAdults = rooms.reduce((sum, room) => sum + room.adults, 0);
1394
+ const totalChildren = rooms.reduce((sum, room) => sum + room.children, 0);
1395
+ const roomsText = rooms.length === 1 ? "Room" : "Rooms";
1396
+ const adultsText = totalAdults === 1 ? "Adult" : "Adults";
1397
+ const childrenText = totalChildren === 0 ? "" : totalChildren === 1 ? `, ${totalChildren} Child` : `, ${totalChildren} Children`;
1398
+ const displayText = `${rooms.length} ${roomsText}, ${totalAdults} ${adultsText}${childrenText}`;
1399
+ handleInputChange("roomsGuests", displayText);
1400
+ }, [rooms]);
1401
+ (0, import_react.useEffect)(() => {
1402
+ const query = originQuery.trim();
1403
+ if (query.length < MIN_SEARCH_CHARS) {
1404
+ setOriginResults([]);
1405
+ return;
1406
+ }
1407
+ const controller = new AbortController();
1408
+ const runSearch = async () => {
1409
+ try {
1410
+ setIsOriginLoading(true);
1411
+ const headers = {};
1412
+ const token = buildRequestToken();
1413
+ if (token) {
1414
+ headers.token = token;
1415
+ }
1416
+ const response = await fetch(`${AIRPORT_SEARCH_URL}/${encodeURIComponent(query)}`, {
1417
+ method: "GET",
1418
+ headers,
1419
+ signal: controller.signal
1420
+ });
1421
+ if (!response.ok) {
1422
+ throw new Error("Origin search failed");
1423
+ }
1424
+ const data = await response.json();
1425
+ const results = Array.isArray(data) ? data : Array.isArray(data?.data) ? data.data : Array.isArray(data?.result) ? data.result : [];
1426
+ setOriginResults(results);
1427
+ } catch (error) {
1428
+ if (!(error instanceof DOMException && error.name === "AbortError")) {
1429
+ setOriginResults([]);
1430
+ }
1431
+ } finally {
1432
+ setIsOriginLoading(false);
1433
+ }
1434
+ };
1435
+ const timeoutId = window.setTimeout(runSearch, 300);
1436
+ return () => {
1437
+ controller.abort();
1438
+ window.clearTimeout(timeoutId);
1439
+ };
1440
+ }, [originQuery]);
1441
+ (0, import_react.useEffect)(() => {
1442
+ const query = destinationQuery.trim();
1443
+ const shouldFetchOnOpen = isDestinationDropdownOpen && query.length === 0;
1444
+ if (query.length < MIN_SEARCH_CHARS && !shouldFetchOnOpen) {
1445
+ setDestinationResults([]);
1446
+ return;
1447
+ }
1448
+ const controller = new AbortController();
1449
+ const runSearch = async () => {
1450
+ try {
1451
+ setIsDestinationLoading(true);
1452
+ const fromAirport = selectedOrigin?.ac ?? "";
1453
+ const fromCountry = selectedOrigin?.cc ?? "";
1454
+ const headers = {
1455
+ "Content-Type": "application/json"
1456
+ };
1457
+ const token = buildRequestToken();
1458
+ if (token) {
1459
+ headers.token = token;
1460
+ }
1461
+ const response = await fetch(DESTINATION_SEARCH_URL, {
1462
+ method: "POST",
1463
+ headers,
1464
+ body: JSON.stringify({
1465
+ org_id: SEARCH_CONTEXT.orgId,
1466
+ affiliate_id: SEARCH_CONTEXT.affiliateId,
1467
+ lang_code: SEARCH_CONTEXT.langCode,
1468
+ from_airport: fromAirport,
1469
+ from_country: fromCountry,
1470
+ search_key: shouldFetchOnOpen ? "" : query
1471
+ }),
1472
+ signal: controller.signal
1473
+ });
1474
+ if (!response.ok) {
1475
+ throw new Error("Destination search failed");
1476
+ }
1477
+ const data = await response.json();
1478
+ const results = Array.isArray(data?.Result) ? data.Result : Array.isArray(data?.result) ? data.result : Array.isArray(data?.data) ? data.data : Array.isArray(data) ? data : [];
1479
+ setDestinationResults(results);
1480
+ } catch (error) {
1481
+ if (!(error instanceof DOMException && error.name === "AbortError")) {
1482
+ setDestinationResults([]);
1483
+ }
1484
+ } finally {
1485
+ setIsDestinationLoading(false);
1486
+ }
1487
+ };
1488
+ const timeoutId = window.setTimeout(runSearch, 300);
1489
+ return () => {
1490
+ controller.abort();
1491
+ window.clearTimeout(timeoutId);
1492
+ };
1493
+ }, [destinationQuery, selectedOrigin, isDestinationDropdownOpen]);
1494
+ const handleRemoveRoom = (roomIndex) => {
1495
+ if (rooms.length <= 1) {
1496
+ return;
1497
+ }
1498
+ const updatedRooms = rooms.filter((_, index) => index !== roomIndex);
1499
+ setRooms(updatedRooms);
1500
+ };
1501
+ const handleAddRoom = () => {
1502
+ if (rooms.length >= MAX_ROOMS) {
1503
+ return;
1504
+ }
1505
+ setRooms([...rooms, { adults: 1, children: 0, childAges: [] }]);
1506
+ };
1507
+ const handleOriginQueryChange = (event) => {
1508
+ const value = event.target.value;
1509
+ setOriginQuery(value);
1510
+ setSelectedOrigin(null);
1511
+ handleInputChange("origin", "");
1512
+ if (value.trim().length > 0) {
1513
+ setFieldErrors((prev) => ({ ...prev, origin: false }));
1514
+ }
1515
+ };
1516
+ const handleDestinationQueryChange = (event) => {
1517
+ const value = event.target.value;
1518
+ setDestinationQuery(value);
1519
+ setSelectedDestination(null);
1520
+ handleInputChange("destination", "");
1521
+ if (value.trim().length > 0) {
1522
+ setFieldErrors((prev) => ({ ...prev, destination: false }));
1523
+ }
1524
+ };
1525
+ const handleNationalityQueryChange = (event) => {
1526
+ const value = event.target.value;
1527
+ setNationalityQuery(value);
1528
+ setSelectedNationality(null);
1529
+ if (value.trim().length > 0) {
1530
+ setFieldErrors((prev) => ({ ...prev, nationality: false }));
1531
+ }
1532
+ };
1533
+ const handleOriginSelect = (option) => {
1534
+ const displayText = getAirportDisplayText(option);
1535
+ handleInputChange("origin", displayText);
1536
+ setOriginQuery(displayText);
1537
+ setSelectedOrigin(option);
1538
+ setIsOriginDropdownOpen(false);
1539
+ setFieldErrors((prev) => ({ ...prev, origin: false }));
1540
+ };
1541
+ const handleDestinationSelect = (option) => {
1542
+ const displayText = getDestinationDisplayText(option);
1543
+ handleInputChange("destination", displayText);
1544
+ setDestinationQuery(displayText);
1545
+ setSelectedDestination(option);
1546
+ setIsDestinationDropdownOpen(false);
1547
+ setFieldErrors((prev) => ({ ...prev, destination: false }));
1548
+ };
1549
+ const handleNationalitySelect = (option) => {
1550
+ handleInputChange("nationality", option.country_name);
1551
+ setNationalityQuery(option.country_name);
1552
+ setSelectedNationality(option);
1553
+ setIsNationalityDropdownOpen(false);
1554
+ setFieldErrors((prev) => ({ ...prev, nationality: false }));
1555
+ };
1556
+ const handleInputChange = (field, value) => {
1557
+ setFormData((prev) => ({
1558
+ ...prev,
1559
+ [field]: value
1560
+ }));
1561
+ };
1562
+ const handleSearch = () => {
1563
+ const params = new URLSearchParams();
1564
+ params.set("trip", "hybrid-package");
1565
+ params.set("nc", selectedNationality?.country_code ?? "");
1566
+ params.set("nn", selectedNationality?.country_name ?? nationalityQuery.trim());
1567
+ params.set("fc", selectedOrigin?.cc ?? "");
1568
+ params.set("fa", selectedOrigin?.ac ?? "");
1569
+ params.set("lc", SEARCH_CONTEXT.langCode);
1570
+ params.set("curr", "AED");
1571
+ params.set("time", Date.now().toString());
1572
+ params.set("mgcc", selectedOrigin?.cc ?? "");
1573
+ params.set("tskId", selectedDestination?.hybrid_package_keyword_id ?? "");
1574
+ params.set("tskName", selectedDestination?.search_keyword ?? "");
1575
+ params.set("tskCatId", "");
1576
+ params.set("tskCatName", "");
1577
+ params.set("dd", formData.departureDate ? formatQueryDate(formData.departureDate) : "");
1578
+ params.set("hypid", "");
1579
+ params.set("hbdUrl", "");
1580
+ params.set("type", "");
1581
+ params.set("psid", "");
1582
+ params.set("room1", rooms[0]?.adults?.toString() ?? "2");
1583
+ if (ssoUser) {
1584
+ const encryptedTo = buildEncryptedSSOUser();
1585
+ if (encryptedTo) {
1586
+ params.set("to", encryptedTo);
1587
+ }
1588
+ }
1589
+ const queryString = `packages/listing?${params.toString()}`;
1590
+ if (redirectionDomain) {
1591
+ const domainOnly = redirectionDomain.replace(/^https?:\/\//i, "").split("/")[0];
1592
+ const normalizedDomain = `https://${domainOnly}`;
1593
+ const redirectUrl = `${normalizedDomain}/${queryString}`;
1594
+ window.open(redirectUrl, "_blank", "noopener,noreferrer");
1595
+ }
1596
+ };
1597
+ const handleSubmit = (e) => {
1598
+ e.preventDefault();
1599
+ const originValid = originQuery.trim().length > 0;
1600
+ const destinationValid = destinationQuery.trim().length > 0;
1601
+ const nationalityValid = nationalityQuery.trim().length > 0 && !!selectedNationality;
1602
+ setFieldErrors({
1603
+ origin: !originValid,
1604
+ destination: !destinationValid,
1605
+ nationality: !nationalityValid
1606
+ });
1607
+ if (!originValid || !destinationValid || !nationalityValid) {
1608
+ return;
1609
+ }
1610
+ handleSearch();
1611
+ };
1612
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-container", style: themeStyle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-card-box", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { className: "sw-booking-form", onSubmit: handleSubmit, children: [
1613
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `sw-form-field sw-pos-rel br-left ${fieldErrors.origin ? "sw-field-error" : ""}`, children: [
1614
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "origin", children: "Flying from" }),
1615
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-custom-dropdown", ref: originDropdownRef, children: [
1616
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-custom-dropdown-trigger", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1617
+ "input",
1618
+ {
1619
+ value: originQuery,
1620
+ onChange: handleOriginQueryChange,
1621
+ onFocus: () => setIsOriginDropdownOpen(true),
1622
+ onClick: (event) => event.currentTarget.select(),
1623
+ onFocusCapture: (event) => event.currentTarget.select(),
1624
+ placeholder: "Origin"
1625
+ }
1626
+ ) }),
1627
+ isOriginDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", { className: "sw-dropdown-list", children: [
1628
+ isOriginLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "sw-dropdown-list-item", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown-listBox", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: "Searching..." }) }) }),
1629
+ !isOriginLoading && originQuery.trim().length >= MIN_SEARCH_CHARS && originResults.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "sw-dropdown-list-item", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown-listBox", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: "No results found" }) }) }),
1630
+ !isOriginLoading && (originQuery.trim().length < MIN_SEARCH_CHARS ? DEFAULT_ORIGIN_OPTIONS : originResults).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1631
+ "li",
1632
+ {
1633
+ className: "sw-dropdown-list-item ",
1634
+ onClick: () => handleOriginSelect(option),
1635
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-dropdown-list-card", children: [
1636
+ (option.ac || option.an) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { className: "sw-dropdown-item-badge sw-en-font", children: option.ac ?? option.an }),
1637
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
1638
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h5", { className: "sw-fw500 sw-text-ellipsis", children: getAirportDisplayText(option) }),
1639
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { className: "sw-text-label sw-text-ellipsis", children: [option.ct ?? option.cn].filter(Boolean).join(", ") })
1640
+ ] })
1641
+ ] })
1642
+ },
1643
+ `${option.ac ?? option.an ?? ""}-${index}`
1644
+ ))
1645
+ ] }) })
1646
+ ] })
1647
+ ] }),
1648
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `sw-form-field sw-pos-rel ${fieldErrors.destination ? "sw-field-error" : ""}`, children: [
1649
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "destination", children: "To City/Country/Category" }),
1650
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-custom-dropdown", ref: destinationDropdownRef, children: [
1651
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-custom-dropdown-trigger", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1652
+ "input",
1653
+ {
1654
+ value: destinationQuery,
1655
+ onChange: handleDestinationQueryChange,
1656
+ onFocus: () => setIsDestinationDropdownOpen(true),
1657
+ onClick: (event) => event.currentTarget.select(),
1658
+ onFocusCapture: (event) => event.currentTarget.select(),
1659
+ placeholder: "Destination"
1660
+ }
1661
+ ) }),
1662
+ isDestinationDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", { className: "sw-dropdown-list", children: [
1663
+ isDestinationLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "sw-dropdown-list-item", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown-listBox", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown-text", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: "Searching..." }) }) }) }),
1664
+ !isDestinationLoading && destinationQuery.trim().length >= MIN_SEARCH_CHARS && destinationResults.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "sw-dropdown-list-item", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown-listBox", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown-text", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: "No results found" }) }) }) }),
1665
+ !isDestinationLoading && sortedDestinationResults.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1666
+ "li",
1667
+ {
1668
+ className: "sw-dropdown-list-item ",
1669
+ onClick: () => handleDestinationSelect(option),
1670
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-dropdown-listBox", children: [
1671
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
1672
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h5", { className: "sw-fw500 sw-text-ellipsis", children: getDestinationDisplayText(option) }),
1673
+ option.package_count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h6", { className: "sw-text-label sw-text-ellipsis", children: [
1674
+ option.package_count,
1675
+ " Curated Packages"
1676
+ ] })
1677
+ ] }),
1678
+ option.search_keyword_type && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { className: "sw-dropdown-item-badge sw-en-font", children: option.search_keyword_type })
1679
+ ] })
1680
+ },
1681
+ `${option.hybrid_package_keyword_id ?? option.search_keyword ?? index}`
1682
+ ))
1683
+ ] }) })
1684
+ ] })
1685
+ ] }),
1686
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `sw-form-field sw-pos-rel ${fieldErrors.nationality ? "sw-field-error" : ""}`, children: [
1687
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "nationality", children: "Nationality" }),
1688
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-custom-dropdown", ref: nationalityDropdownRef, children: [
1689
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1690
+ "div",
1691
+ {
1692
+ className: "sw-custom-dropdown-trigger",
1693
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1694
+ "input",
1695
+ {
1696
+ value: nationalityQuery,
1697
+ onChange: handleNationalityQueryChange,
1698
+ onFocus: () => setIsNationalityDropdownOpen(true),
1699
+ onClick: (event) => event.currentTarget.select(),
1700
+ onFocusCapture: (event) => event.currentTarget.select(),
1701
+ placeholder: "Type to search"
1702
+ }
1703
+ )
1704
+ }
1705
+ ),
1706
+ isNationalityDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", { className: "sw-dropdown-list", children: [
1707
+ filteredNationalityOptions.length === 0 && nationalityQuery.trim().length >= MIN_SEARCH_CHARS && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "sw-dropdown-list-item", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-dropdown-listBox", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h5", { className: "sw-fw500 sw-text-ellipsis", children: "No results found" }) }) }) }),
1708
+ filteredNationalityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1709
+ "li",
1710
+ {
1711
+ className: "sw-dropdown-list-item ",
1712
+ onClick: () => handleNationalitySelect(option),
1713
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-dropdown-listBox", children: [
1714
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h5", { className: "sw-fw500 sw-text-ellipsis", children: option.country_name }) }),
1715
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h6", { className: "sw-dropdown-item-badge sw-en-font", children: option.country_code })
1716
+ ] })
1717
+ },
1718
+ option.country_id
1719
+ ))
1720
+ ] }) })
1721
+ ] })
1722
+ ] }),
1723
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-form-field sw-pos-rel sw-com-cal sw-calendar", children: [
1724
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "departure", children: "Departure Date" }),
1725
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1726
+ import_calendar.Calendar,
1727
+ {
1728
+ id: "departure",
1729
+ appendTo: "self",
1730
+ value: formData.departureDate,
1731
+ onChange: (e) => handleInputChange("departureDate", e.value),
1732
+ dateFormat: "dd M yy",
1733
+ minDate: today,
1734
+ "sw-placeholder": "29 Jan 2026",
1735
+ className: "p-inputtext-sm"
1736
+ }
1737
+ )
1738
+ ] }),
1739
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-form-field", children: [
1740
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "rooms", children: "Rooms & Guests" }),
1741
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-custom-dropdown", ref: roomsGuestsMenuRef, children: [
1742
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1743
+ "div",
1744
+ {
1745
+ className: "sw-custom-dropdown-trigger",
1746
+ onClick: () => setIsRoomsGuestsMenuOpen(!isRoomsGuestsMenuOpen),
1747
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: formData.roomsGuests })
1748
+ }
1749
+ ),
1750
+ isRoomsGuestsMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-rooms-guests-menu", children: [
1751
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "sw-rooms-guests-title", children: "Number of Travellers" }),
1752
+ rooms.map((room, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-room-section", children: [
1753
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-room-header", children: [
1754
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { transform: "translate(-4092.000000, -824.000000)", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { transform: "translate(4092.000000, 824.000000)", children: [
1755
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { fill: "#FFFFFF", opacity: "0", x: "0", y: "0", width: "24", height: "24" }),
1756
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { transform: "translate(3.000000, 6.000000)", fill: "var(--primary)", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M18.011072,5.62815523 L18.011072,1.13048375 C18.011072,0.514180505 17.4892314,0.012765343 16.8478226,0.012765343 L2.14333676,0.012765343 C1.50192802,0.012765343 0.980087404,0.514180505 0.980087404,1.13048375 L0.980087404,5.62820217 C0.42596144,5.70920578 0,6.17002527 0,6.72475451 L0,9.50863177 C0,9.70302166 0.164015424,9.86061733 0.366323907,9.86061733 L0.75877892,9.86061733 L0.75877892,11.5970794 C0.75877892,11.7914693 0.922794344,11.949065 1.12510283,11.949065 L1.78639075,11.949065 L1.78639075,12.6268014 C1.78639075,12.8211913 1.95040617,12.978787 2.15271465,12.978787 C2.35502314,12.978787 2.51903856,12.8211913 2.51903856,12.6268014 L2.51903856,11.949065 L16.4721697,11.949065 L16.4721697,12.6268014 C16.4721697,12.8211913 16.6361362,12.978787 16.8384936,12.978787 C17.0408509,12.978787 17.2048175,12.8211913 17.2048175,12.6268014 L17.2048175,11.949065 L17.8661054,11.949065 C18.0684627,11.949065 18.2324293,11.7914693 18.2324293,11.5970794 L18.2324293,9.86061733 L18.6248355,9.86061733 C18.8271928,9.86061733 18.9911594,9.70302166 18.9911594,9.50863177 L18.9911594,6.72475451 C18.9911594,6.17002527 18.5651979,5.70915884 18.011072,5.62815523 Z M1.71268638,1.13048375 C1.71268638,0.902350181 1.90586118,0.716736462 2.14328792,0.716736462 L16.8477738,0.716736462 C17.0852005,0.716736462 17.2783753,0.902350181 17.2783753,1.13048375 L17.2783753,5.61553069 L15.99209,5.61553069 C16.2480283,5.35079061 16.5083625,5.0723935 16.7779769,4.77451986 C16.8978869,4.64203249 16.897838,4.44492058 16.777928,4.31248014 C15.7181285,3.14210469 14.8307943,2.28950181 13.6130848,1.27151264 C13.4752494,1.1562491 13.2700591,1.1562491 13.1321748,1.27151264 C11.9144165,2.28954874 11.0271311,3.14215162 9.96738046,4.31248014 C9.84747044,4.44492058 9.84742159,4.64203249 9.96733162,4.77451986 C10.2369949,5.07244043 10.4972802,5.35083755 10.7532185,5.61553069 L8.23764781,5.61553069 C8.49358612,5.35079061 8.75396915,5.0723935 9.02358355,4.77451986 C9.14349357,4.64203249 9.14349357,4.44492058 9.0235347,4.31248014 C7.96388175,3.14229242 7.07654756,2.28968953 5.85869152,1.27151264 C5.72085604,1.1562491 5.51566581,1.1562491 5.37778149,1.27151264 C4.15992545,2.28968953 3.27259126,3.14229242 2.2129383,4.31248014 C2.09297943,4.44492058 2.09297943,4.64203249 2.21288946,4.77451986 C2.4825527,5.0723935 2.74288689,5.35079061 2.99882519,5.61553069 L1.71268638,5.61553069 L1.71268638,1.13048375 Z M11.7640283,5.61553069 C11.4269614,5.28306859 11.0864756,4.92981588 10.7309949,4.54352347 C11.6067044,3.59142599 12.3820411,2.84643682 13.3726787,2.00519134 C14.3633162,2.84638989 15.138653,3.59142599 16.0144113,4.54352347 C15.6589794,4.92981588 15.3184447,5.28306859 14.9813779,5.61553069 L11.7640283,5.61553069 Z M4.0096838,5.61553069 C3.67261697,5.28302166 3.33208226,4.92981588 2.97660154,4.54352347 C3.85216452,3.59161372 4.62764781,2.84648375 5.61833419,2.00519134 C6.60902057,2.84648375 7.38450386,3.59161372 8.26006684,4.54352347 C7.90463496,4.92981588 7.56410026,5.28302166 7.22698458,5.61553069 L4.0096838,5.61553069 Z M17.4997815,11.2450939 L1.49142674,11.2450939 L1.49142674,9.86061733 L17.4997815,9.86061733 L17.4997815,11.2450939 Z M18.2585116,9.15664621 L0.732647815,9.15664621 L0.732647815,6.72475451 C0.732647815,6.50131408 0.921866324,6.31950181 1.15445758,6.31950181 L17.8367018,6.31950181 C18.0692931,6.31950181 18.2585116,6.50131408 18.2585116,6.72475451 L18.2585116,9.15664621 Z" }) })
1757
+ ] }) }) }) }),
1758
+ "Room ",
1759
+ index + 1
1760
+ ] }),
1761
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-room-controls-group", children: [
1762
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-room-control-item", children: [
1763
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-room-control-label", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Adult (18+ years)" }) }),
1764
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-room-control-buttons", children: [
1765
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1766
+ "button",
1767
+ {
1768
+ type: "button",
1769
+ className: `sw-count-button ${room.adults === 1 ? "sw-disabled" : "active"}`,
1770
+ onClick: () => {
1771
+ const newRooms = [...rooms];
1772
+ newRooms[index].adults = Math.max(1, newRooms[index].adults - 1);
1773
+ setRooms(newRooms);
1774
+ },
1775
+ disabled: room.adults === 1,
1776
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "20", fill: "var(--sw-white)", viewBox: "0 -960 960 960", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M200-440v-80h560v80H200Z" }) })
1777
+ }
1778
+ ),
1779
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sw-count-value", children: room.adults }),
1780
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1781
+ "button",
1782
+ {
1783
+ type: "button",
1784
+ className: `sw-count-button ${room.adults >= MAX_ADULTS_PER_ROOM ? "sw-disabled" : "sw-active"}`,
1785
+ onClick: () => {
1786
+ if (room.adults >= MAX_ADULTS_PER_ROOM) {
1787
+ return;
1788
+ }
1789
+ const newRooms = [...rooms];
1790
+ newRooms[index].adults += 1;
1791
+ setRooms(newRooms);
1792
+ },
1793
+ disabled: room.adults >= MAX_ADULTS_PER_ROOM,
1794
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "20", fill: "var(--sw-white)", viewBox: "0 -960 960 960", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z" }) })
1795
+ }
1796
+ )
1797
+ ] })
1798
+ ] }),
1799
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-room-control-item", children: [
1800
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-room-control-label", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Child (0-17 years)" }) }),
1801
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-room-control-buttons", children: [
1802
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1803
+ "button",
1804
+ {
1805
+ type: "button",
1806
+ className: `sw-count-button ${room.children === 0 ? "sw-disabled" : "active"}`,
1807
+ onClick: () => {
1808
+ const newRooms = [...rooms];
1809
+ newRooms[index].children = Math.max(0, newRooms[index].children - 1);
1810
+ newRooms[index].childAges = newRooms[index].childAges.slice(0, -1);
1811
+ setRooms(newRooms);
1812
+ },
1813
+ disabled: room.children === 0,
1814
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "20", fill: "var(--sw-white)", viewBox: "0 -960 960 960", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M200-440v-80h560v80H200Z" }) })
1815
+ }
1816
+ ),
1817
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sw-count-value", children: room.children }),
1818
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1819
+ "button",
1820
+ {
1821
+ type: "button",
1822
+ className: `sw-count-button ${room.children >= MAX_CHILDREN_PER_ROOM ? "sw-disabled" : ""}`,
1823
+ onClick: () => {
1824
+ if (room.children >= MAX_CHILDREN_PER_ROOM) {
1825
+ return;
1826
+ }
1827
+ const newRooms = [...rooms];
1828
+ newRooms[index].children += 1;
1829
+ newRooms[index].childAges = [...newRooms[index].childAges, 0];
1830
+ setRooms(newRooms);
1831
+ },
1832
+ disabled: room.children >= MAX_CHILDREN_PER_ROOM,
1833
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "20", fill: "var(--sw-white)", viewBox: "0 -960 960 960", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z" }) })
1834
+ }
1835
+ )
1836
+ ] })
1837
+ ] })
1838
+ ] }),
1839
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
1840
+ room.children > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-room-controls-child", children: Array.from({ length: room.children }).map((_, childIndex) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "sw-room-control-label", children: [
1841
+ "Child ",
1842
+ childIndex + 1
1843
+ ] }, childIndex)) }),
1844
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-room-controls-child", children: Array.from({ length: room.children }).map((_, childIndex) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1845
+ import_dropdown.Dropdown,
1846
+ {
1847
+ value: room.childAges[childIndex] ?? 0,
1848
+ options: childAgeOptions,
1849
+ onChange: (e) => {
1850
+ const newRooms = [...rooms];
1851
+ newRooms[index].childAges[childIndex] = e.value;
1852
+ setRooms(newRooms);
1853
+ },
1854
+ "sw-placeholder": "Age",
1855
+ className: "child-age-sw-dropdown",
1856
+ appendTo: "self"
1857
+ },
1858
+ childIndex
1859
+ )) })
1860
+ ] }),
1861
+ rooms.length > 1 && index > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1862
+ "button",
1863
+ {
1864
+ type: "button",
1865
+ className: "sw-remove-room-button",
1866
+ onClick: () => handleRemoveRoom(index),
1867
+ "aria-label": `Remove Room ${index + 1}`,
1868
+ children: "\xD7"
1869
+ }
1870
+ )
1871
+ ] }, index)),
1872
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-rooms-guests-footer", children: [
1873
+ rooms.length < MAX_ROOMS && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1874
+ "button",
1875
+ {
1876
+ type: "button",
1877
+ className: "sw-add-room-button",
1878
+ onClick: handleAddRoom,
1879
+ children: [
1880
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", children: [
1881
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", d: "M0 0h16v16H0z" }),
1882
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 7H9V1H7v6H1v2h6v6h2V9h6z" })
1883
+ ] }),
1884
+ "Add another room"
1885
+ ]
1886
+ }
1887
+ ),
1888
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-rooms-guests-cta", children: [
1889
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1890
+ "button",
1891
+ {
1892
+ type: "button",
1893
+ className: "sw-reset-button",
1894
+ onClick: () => setRooms([{ adults: 2, children: 0, childAges: [] }]),
1895
+ children: "Reset"
1896
+ }
1897
+ ),
1898
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1899
+ "button",
1900
+ {
1901
+ type: "button",
1902
+ className: "sw-apply-button",
1903
+ onClick: () => setIsRoomsGuestsMenuOpen(false),
1904
+ children: "Apply"
1905
+ }
1906
+ )
1907
+ ] })
1908
+ ] })
1909
+ ] })
1910
+ ] })
1911
+ ] }),
1912
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1913
+ import_button.Button,
1914
+ {
1915
+ type: "submit",
1916
+ label: "Search",
1917
+ icon: "pi pi-search",
1918
+ className: "sw-search-button br-right"
1919
+ }
1920
+ )
1921
+ ] }) }) });
1922
+ };
1923
+ var Curated_default = CuratedSearchWidget;
1924
+ // Annotate the CommonJS export names for ESM import in node:
1925
+ 0 && (module.exports = {
1926
+ CuratedSearchWidget
1927
+ });
1928
+ //# sourceMappingURL=index.cjs.map