@asdp/ferryui 0.1.0 → 0.1.3

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.mjs CHANGED
@@ -1,7 +1,12 @@
1
- import { makeStyles, tokens, Dialog, DialogSurface, DialogBody, DialogTitle, DialogContent, Body1, Button } from '@fluentui/react-components';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { makeStyles, tokens, shorthands, Popover, PopoverTrigger, Input, PopoverSurface, Dialog, DialogSurface, DialogBody, DialogTitle, DialogContent, Body1, Button, Carousel, mergeClasses, CarouselViewport, CarouselSlider, CarouselNav, CarouselNavButton, CarouselCard, Subtitle2, Card, Tooltip, Badge, Caption1, Title2, Caption2, Divider, Title3, Caption1Strong, Field, Label, Text, Body1Strong, typographyStyles, Checkbox, RadioGroup, Radio, Switch, Textarea } from '@fluentui/react-components';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import React2, { forwardRef, useState, useCallback, useRef, useEffect } from 'react';
4
+ import { Icon } from '@iconify/react';
5
+ import { Controller } from 'react-hook-form';
6
+ import PhoneInput from 'react-phone-input-2';
7
+ import Select from 'react-select';
8
+ import { Calendar } from '@fluentui/react-calendar-compat';
3
9
 
4
- // src/components/ModalRadius/ModalRadius.tsx
5
10
  var useStyles = makeStyles({
6
11
  dialogSurface: {
7
12
  maxWidth: "600px",
@@ -20,36 +25,26 @@ var useStyles = makeStyles({
20
25
  maxWidth: "100%",
21
26
  height: "auto"
22
27
  },
23
- infoText: {
24
- marginTop: tokens.spacingVerticalM,
25
- color: tokens.colorNeutralForeground3
26
- },
27
28
  buttonContainer: {
28
29
  display: "flex",
29
- width: "100%"
30
+ width: "100%",
31
+ gap: tokens.spacingHorizontalM
30
32
  }
31
33
  });
32
- var ModalRadius = ({
34
+ var ModalIllustration = ({
33
35
  open,
34
36
  onClose,
35
- title = "Anda berada di luar area pemesanan",
36
- message = "Pemesanan tiket tidak dapat dilakukan dari lokasi Anda saat ini. Fitur pembatasan wilayah sedang aktif untuk mencegah pemesanan tidak sah.",
37
+ title,
38
+ message,
37
39
  imageSrc = "/assets/images/illustrations/radius.svg",
38
- imageAlt = "Radius Illustration",
40
+ imageAlt = "Illustration",
39
41
  imageWidth = 361,
40
42
  imageHeight = 203,
41
- buttonText = "Tutup & Coba Lagi",
42
- onButtonClick
43
+ primaryButton,
44
+ secondaryButton
43
45
  }) => {
44
46
  const styles = useStyles();
45
- const handleButtonClick = () => {
46
- if (onButtonClick) {
47
- onButtonClick();
48
- } else {
49
- onClose();
50
- }
51
- };
52
- return /* @__PURE__ */ jsx(Dialog, { open, modalType: "modal", children: /* @__PURE__ */ jsx(DialogSurface, { className: styles.dialogSurface, children: /* @__PURE__ */ jsxs(DialogBody, { children: [
47
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: (_, data) => !data.open && onClose(), modalType: "modal", children: /* @__PURE__ */ jsx(DialogSurface, { className: styles.dialogSurface, children: /* @__PURE__ */ jsxs(DialogBody, { children: [
53
48
  /* @__PURE__ */ jsx(DialogTitle, { children: title }),
54
49
  /* @__PURE__ */ jsxs(DialogContent, { children: [
55
50
  /* @__PURE__ */ jsxs("div", { className: styles.iconContainer, children: [
@@ -63,23 +58,2984 @@ var ModalRadius = ({
63
58
  className: styles.image
64
59
  }
65
60
  ),
66
- /* @__PURE__ */ jsx(Body1, { style: { textAlign: "center" }, children: message })
61
+ typeof message === "string" ? /* @__PURE__ */ jsx(Body1, { style: { textAlign: "center" }, children: message }) : message
67
62
  ] }),
68
- /* @__PURE__ */ jsx("div", { className: styles.buttonContainer, children: /* @__PURE__ */ jsx(
63
+ /* @__PURE__ */ jsxs("div", { className: styles.buttonContainer, children: [
64
+ /* @__PURE__ */ jsx(
65
+ Button,
66
+ {
67
+ style: { width: "100%" },
68
+ type: "button",
69
+ appearance: primaryButton.appearance || "primary",
70
+ onClick: primaryButton.onClick,
71
+ children: primaryButton.text
72
+ }
73
+ ),
74
+ secondaryButton && /* @__PURE__ */ jsx(
75
+ Button,
76
+ {
77
+ style: { width: "100%" },
78
+ type: "button",
79
+ appearance: secondaryButton.appearance || "outline",
80
+ onClick: secondaryButton.onClick,
81
+ children: secondaryButton.text
82
+ }
83
+ )
84
+ ] })
85
+ ] })
86
+ ] }) }) });
87
+ };
88
+
89
+ // src/components/ModalIllustration/presets.ts
90
+ var MODAL_PRESETS = {
91
+ /**
92
+ * Modal for radius/location restriction
93
+ */
94
+ RADIUS: {
95
+ title: "Anda berada di luar area pemesanan",
96
+ message: "Pemesanan tiket tidak dapat dilakukan dari lokasi Anda saat ini. Fitur pembatasan wilayah sedang aktif untuk mencegah pemesanan tidak sah.",
97
+ imageSrc: "/assets/images/illustrations/radius.svg",
98
+ imageAlt: "Radius Limitation Illustration"
99
+ },
100
+ /**
101
+ * Modal for expired session
102
+ */
103
+ SESSION_EXPIRED: {
104
+ title: "Sesi anda telah berakhir",
105
+ message: "Waktu sesi Anda telah habis untuk alasan keamanan. Silakan klik tombol dibawah untuk masuk kembali.",
106
+ imageSrc: "/assets/images/illustrations/sessionexp.svg",
107
+ imageAlt: "Session Expired Illustration"
108
+ },
109
+ /**
110
+ * Modal for purchase period expired
111
+ */
112
+ PURCHASE_PERIOD_EXPIRED: {
113
+ title: "Waktu pembelian telah berakhir",
114
+ message: "Pemesanan tiket ditutup 1 jam sebelum jadwal keberangkatan. Silakan pilih jadwal keberangkatan lain yang masih tersedia.",
115
+ imageSrc: "/assets/images/illustrations/pay.svg",
116
+ imageAlt: "Purchase Period Expired Illustration"
117
+ },
118
+ /**
119
+ * Modal for transaction limit reached
120
+ */
121
+ TRANSACTION_LIMIT: {
122
+ title: "Anda mencapai batas transaksi tertunda",
123
+ message: "Anda telah mencapai batas transaksi tertunda. Pemesanan dapat dilakukan kembali setelah transaksi sebelumnya diselesaikan.",
124
+ imageSrc: "/assets/images/illustrations/mobile-pay.svg",
125
+ imageAlt: "Transaction Limit Illustration"
126
+ }
127
+ };
128
+ var getModalPreset = (presetKey) => {
129
+ return MODAL_PRESETS[presetKey];
130
+ };
131
+ var useStyles2 = makeStyles({
132
+ carousel: {},
133
+ customCarouselNav: {
134
+ display: "flex",
135
+ gap: tokens.spacingHorizontalXS,
136
+ justifyContent: "center",
137
+ alignItems: "center",
138
+ ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingVerticalM),
139
+ borderRadius: tokens.borderRadiusCircular
140
+ },
141
+ carouselNavButton: {
142
+ "& button": {
143
+ padding: 0,
144
+ marginInline: "0px",
145
+ width: "45px",
146
+ height: "16px",
147
+ display: "flex",
148
+ alignItems: "center",
149
+ justifyContent: "center",
150
+ transition: "transform 0.4s cubic-bezier(0.4, 0, 0.2, 1)",
151
+ "@media (max-width: 425px)": {
152
+ width: "35px",
153
+ height: "10px"
154
+ }
155
+ },
156
+ "& button::after": {
157
+ content: '""',
158
+ transition: "all 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1)"
159
+ },
160
+ "& button[aria-selected='true']::after": {
161
+ backgroundImage: "linear-gradient(to right,#00B3BD, #8DC63F)",
162
+ width: "55px",
163
+ height: "16px",
164
+ borderRadius: tokens.borderRadiusCircular,
165
+ transform: "translateX(0)",
166
+ "@media (max-width: 425px)": {
167
+ width: "25px",
168
+ height: "10px"
169
+ },
170
+ "@media (max-width: 768px)": {
171
+ width: "35px",
172
+ height: "13px"
173
+ }
174
+ },
175
+ "& button[aria-selected='false']::after": {
176
+ backgroundColor: "#D1D1D1",
177
+ width: "15px",
178
+ height: "15px",
179
+ opacity: "90%",
180
+ transform: "scale(0.9)",
181
+ "@media (max-width: 425px)": {
182
+ width: "10px",
183
+ height: "10px"
184
+ }
185
+ }
186
+ }
187
+ });
188
+ var defaultAnnouncement = (index, totalSlides) => {
189
+ return `Carousel slide ${index + 1} of ${totalSlides}`;
190
+ };
191
+ var CarouselWithCustomNav = ({
192
+ children,
193
+ circular = true,
194
+ draggable = true,
195
+ align = "start",
196
+ whitespace = false,
197
+ announcement = defaultAnnouncement,
198
+ activeIndex: controlledIndex,
199
+ onActiveIndexChange,
200
+ ariaLabel = "Carousel",
201
+ darkNavBackground = true,
202
+ className,
203
+ cardFocus = false
204
+ }) => {
205
+ const styles = useStyles2();
206
+ const [internalIndex, setInternalIndex] = useState(0);
207
+ const activeIndex = controlledIndex !== void 0 ? controlledIndex : internalIndex;
208
+ const handleIndexChange = useCallback((index) => {
209
+ if (controlledIndex === void 0) {
210
+ setInternalIndex(index);
211
+ }
212
+ onActiveIndexChange?.(index);
213
+ }, [controlledIndex, onActiveIndexChange]);
214
+ return /* @__PURE__ */ jsxs(
215
+ Carousel,
216
+ {
217
+ circular,
218
+ draggable,
219
+ align,
220
+ className: mergeClasses(styles.carousel, className),
221
+ whitespace,
222
+ announcement,
223
+ activeIndex,
224
+ onActiveIndexChange: (_, data) => handleIndexChange(data.index),
225
+ children: [
226
+ /* @__PURE__ */ jsx(CarouselViewport, { children: /* @__PURE__ */ jsx(
227
+ CarouselSlider,
228
+ {
229
+ cardFocus,
230
+ "aria-label": ariaLabel,
231
+ children
232
+ }
233
+ ) }),
234
+ /* @__PURE__ */ jsx(
235
+ CarouselNav,
236
+ {
237
+ style: {
238
+ backgroundColor: darkNavBackground ? tokens.colorSubtleBackgroundInverted : tokens.colorSubtleBackground,
239
+ marginTop: tokens.spacingVerticalXL
240
+ },
241
+ appearance: "brand",
242
+ className: styles.carouselNavButton,
243
+ children: (index) => /* @__PURE__ */ jsx(CarouselNavButton, { "aria-label": `Slide ${index + 1}` })
244
+ }
245
+ )
246
+ ]
247
+ }
248
+ );
249
+ };
250
+ var useStyles3 = makeStyles({
251
+ actionCard: {
252
+ borderRadius: tokens.borderRadiusXLarge,
253
+ overflow: "hidden",
254
+ textAlign: "center",
255
+ width: "360px",
256
+ maxWidth: "360px",
257
+ margin: "0px 6px",
258
+ boxShadow: tokens.shadow4,
259
+ backgroundColor: tokens.colorNeutralForegroundInverted,
260
+ "@media (max-width: 1024px)": {
261
+ width: "200px",
262
+ maxWidth: "200px"
263
+ },
264
+ "@media (max-width: 768px)": {
265
+ width: "190px",
266
+ maxWidth: "190px"
267
+ },
268
+ "@media (max-width: 480px)": {
269
+ width: "180px",
270
+ maxWidth: "180px",
271
+ margin: "0px 4px"
272
+ }
273
+ },
274
+ imageContainer: {
275
+ position: "relative",
276
+ width: "100%",
277
+ height: "202px",
278
+ overflow: "hidden",
279
+ "@media (max-width: 1024px)": {
280
+ height: "120px"
281
+ },
282
+ "@media (max-width: 768px)": {
283
+ height: "110px"
284
+ },
285
+ "@media (max-width: 480px)": {
286
+ height: "100px"
287
+ }
288
+ },
289
+ image: {
290
+ width: "100%",
291
+ height: "100%",
292
+ objectFit: "cover",
293
+ objectPosition: "center"
294
+ },
295
+ info: {
296
+ display: "flex",
297
+ flexDirection: "column",
298
+ padding: tokens.spacingHorizontalM,
299
+ width: "100%",
300
+ alignContent: "center",
301
+ justifyContent: "space-between",
302
+ gap: tokens.spacingVerticalSNudge,
303
+ "@media (max-width: 1024px)": {
304
+ padding: tokens.spacingHorizontalSNudge,
305
+ gap: tokens.spacingVerticalSNudge
306
+ },
307
+ "@media (max-width: 768px)": {
308
+ padding: tokens.spacingVerticalS,
309
+ gap: tokens.spacingVerticalXS
310
+ },
311
+ "@media (max-width: 480px)": {
312
+ padding: tokens.spacingVerticalSNudge,
313
+ gap: tokens.spacingVerticalXS
314
+ }
315
+ }
316
+ });
317
+ var CardPromo = ({
318
+ imageUrl,
319
+ title,
320
+ description,
321
+ imageAlt = "Promo image",
322
+ index = 0,
323
+ totalCards,
324
+ onClick
325
+ }) => {
326
+ const classes = useStyles3();
327
+ const ariaLabel = totalCards ? `Card ${index + 1} of ${totalCards}` : `Promo card ${index + 1}`;
328
+ return /* @__PURE__ */ jsxs(
329
+ CarouselCard,
330
+ {
331
+ autoSize: true,
332
+ className: classes.actionCard,
333
+ "aria-label": ariaLabel,
334
+ onClick,
335
+ style: { cursor: onClick ? "pointer" : "default" },
336
+ children: [
337
+ /* @__PURE__ */ jsx("div", { className: classes.imageContainer, children: /* @__PURE__ */ jsx(
338
+ "img",
339
+ {
340
+ className: classes.image,
341
+ src: imageUrl,
342
+ role: "presentation",
343
+ alt: imageAlt
344
+ }
345
+ ) }),
346
+ /* @__PURE__ */ jsxs("div", { className: classes.info, children: [
347
+ /* @__PURE__ */ jsx(Subtitle2, { children: title }),
348
+ /* @__PURE__ */ jsx(Body1, { children: description })
349
+ ] })
350
+ ]
351
+ }
352
+ );
353
+ };
354
+ var useStyles4 = makeStyles({
355
+ bannerCard: {
356
+ overflow: "hidden",
357
+ width: "100%",
358
+ maxWidth: "100%",
359
+ margin: 0,
360
+ padding: 0,
361
+ backgroundColor: "transparent",
362
+ border: "none"
363
+ },
364
+ bannerImage: {
365
+ width: "100%",
366
+ height: "auto",
367
+ objectFit: "cover",
368
+ display: "block",
369
+ cursor: "pointer"
370
+ }
371
+ });
372
+ var CardBanner = ({
373
+ imageUrl,
374
+ alt,
375
+ index = 0,
376
+ totalBanners,
377
+ onClick
378
+ }) => {
379
+ const classes = useStyles4();
380
+ const ariaLabel = totalBanners ? `Banner ${index + 1} of ${totalBanners}` : `Banner ${index + 1}`;
381
+ return /* @__PURE__ */ jsx(
382
+ CarouselCard,
383
+ {
384
+ className: classes.bannerCard,
385
+ "aria-label": ariaLabel,
386
+ children: /* @__PURE__ */ jsx(
387
+ "img",
388
+ {
389
+ className: classes.bannerImage,
390
+ src: imageUrl,
391
+ alt,
392
+ role: "presentation",
393
+ onClick,
394
+ style: { cursor: onClick ? "pointer" : "default" }
395
+ }
396
+ )
397
+ }
398
+ );
399
+ };
400
+ var useStyles5 = makeStyles({
401
+ ticketWrapper: {
402
+ borderRadius: tokens.borderRadiusXLarge,
403
+ overflow: "visible",
404
+ boxShadow: tokens.shadow4,
405
+ display: "flex",
406
+ width: "100%",
407
+ marginBottom: "2rem",
408
+ minHeight: "323px",
409
+ padding: 0,
410
+ "@media (max-width: 1200px)": {
411
+ flexDirection: "column"
412
+ }
413
+ },
414
+ ticketLeftCard: {
415
+ display: "flex",
416
+ justifyContent: "center",
417
+ alignItems: "center",
418
+ gap: "3em",
419
+ width: "100%",
420
+ height: "100%",
421
+ boxShadow: "none",
422
+ position: "relative",
423
+ overflow: "visible",
424
+ flexDirection: "column",
425
+ "@media (min-width: 1200px)": {
426
+ borderRight: `0.7em dashed ${tokens.colorNeutralBackground1Hover}`,
427
+ borderEndEndRadius: 0,
428
+ borderEndStartRadius: 0,
429
+ borderTopLeftRadius: tokens.borderRadiusXLarge,
430
+ borderBottomLeftRadius: tokens.borderRadiusXLarge
431
+ },
432
+ "@media (max-width: 1200px)": {
433
+ borderBottom: `0.5em dashed ${tokens.colorNeutralBackground1Hover}`,
434
+ borderTopLeftRadius: tokens.borderRadiusXLarge,
435
+ borderTopRightRadius: tokens.borderRadiusXLarge,
436
+ borderEndEndRadius: 0,
437
+ borderEndStartRadius: 0,
438
+ gap: "1rem",
439
+ flexDirection: "row",
440
+ justifyContent: "space-around",
441
+ padding: "2rem"
442
+ }
443
+ },
444
+ circularLeft: {
445
+ position: "absolute",
446
+ width: "100px",
447
+ height: "50px",
448
+ borderRadius: "50%",
449
+ backgroundColor: tokens.colorNeutralBackground1Hover,
450
+ left: "-50px",
451
+ boxShadow: "inset -3px 0px 1px rgba(0, 0, 0, 0.1)"
452
+ },
453
+ circularLeftMd: {
454
+ position: "absolute",
455
+ width: "50px",
456
+ height: "30px",
457
+ borderRadius: "50%",
458
+ backgroundColor: tokens.colorNeutralBackground1Hover,
459
+ left: "-25px",
460
+ bottom: "-18px",
461
+ zIndex: 2,
462
+ boxShadow: "inset -3px 0px 1px rgba(0, 0, 0, 0.1)"
463
+ },
464
+ circularRightMd: {
465
+ position: "absolute",
466
+ width: "50px",
467
+ height: "30px",
468
+ borderRadius: "50%",
469
+ backgroundColor: tokens.colorNeutralBackground1Hover,
470
+ right: "-25px",
471
+ bottom: "-18px",
472
+ zIndex: 2,
473
+ boxShadow: "inset 3px 0px 1px rgba(0, 0, 0, 0.1)"
474
+ },
475
+ ticketMiddleCard: {
476
+ width: "100%",
477
+ height: "100%",
478
+ boxShadow: "none",
479
+ borderRadius: 0,
480
+ padding: "2rem",
481
+ display: "flex",
482
+ flexDirection: "column",
483
+ justifyContent: "space-between",
484
+ "@media (max-width: 768px)": {
485
+ padding: "1rem"
486
+ }
487
+ },
488
+ ticketInfo: {
489
+ display: "flex",
490
+ justifyContent: "space-between",
491
+ alignItems: "center",
492
+ gap: "0.5em"
493
+ },
494
+ ticketTime: {
495
+ display: "flex",
496
+ flexDirection: "column",
497
+ alignItems: "start",
498
+ gap: "0.5em"
499
+ },
500
+ ticketDuration: {
501
+ display: "flex",
502
+ flexDirection: "column",
503
+ alignItems: "center",
504
+ justifyContent: "center",
505
+ gap: "0.5rem"
506
+ },
507
+ dividerContainer: {
508
+ position: "relative",
509
+ display: "flex",
510
+ flexDirection: "column",
511
+ alignItems: "center",
512
+ justifyItems: "center",
513
+ width: "100%"
514
+ },
515
+ ticketButtons: {
516
+ display: "flex",
517
+ gap: "1rem",
518
+ marginTop: "1rem",
519
+ "@media (max-width: 768px)": {
520
+ flexDirection: "column"
521
+ }
522
+ },
523
+ ticketRightCard: {
524
+ width: "100%",
525
+ height: "100%",
526
+ boxShadow: "none",
527
+ borderRadius: 0,
528
+ borderTopLeftRadius: 0,
529
+ borderBottomLeftRadius: 0,
530
+ borderTopRightRadius: tokens.borderRadiusXLarge,
531
+ borderBottomRightRadius: tokens.borderRadiusXLarge,
532
+ position: "relative",
533
+ overflow: "visible",
534
+ background: "linear-gradient(75deg, #58C91B 0%, #1949E0 103.3%)",
535
+ padding: "5em",
536
+ display: "flex",
537
+ flexDirection: "column",
538
+ justifyContent: "space-between",
539
+ color: tokens.colorNeutralForegroundInverted,
540
+ "@media (max-width: 1200px)": {
541
+ padding: "2rem",
542
+ borderTopRightRadius: 0,
543
+ borderBottomLeftRadius: tokens.borderRadiusXLarge,
544
+ borderBottomRightRadius: tokens.borderRadiusXLarge
545
+ },
546
+ "@media (max-width: 768px)": {
547
+ padding: "1rem"
548
+ }
549
+ },
550
+ priceCard: {
551
+ border: "1px solid #FFF",
552
+ background: "rgba(255, 255, 255, 0.30)",
553
+ backdropFilter: "blur(17.5px)",
554
+ borderRadius: tokens.borderRadiusLarge,
555
+ padding: "1.2rem",
556
+ gap: "1rem",
557
+ display: "flex",
558
+ justifyContent: "space-between",
559
+ alignItems: "center",
560
+ flexWrap: "wrap",
561
+ "@media (max-width: 768px)": {
562
+ padding: "1rem"
563
+ }
564
+ },
565
+ facilitiesSection: {
566
+ display: "flex",
567
+ flexDirection: "column",
568
+ gap: "0.5rem"
569
+ },
570
+ facilitiesList: {
571
+ display: "flex",
572
+ flexWrap: "wrap",
573
+ gap: "0.75rem"
574
+ },
575
+ facilityItem: {
576
+ display: "flex",
577
+ alignItems: "center",
578
+ gap: "0.5rem",
579
+ fontSize: "14px"
580
+ },
581
+ circularRight: {
582
+ position: "absolute",
583
+ width: "100px",
584
+ height: "50px",
585
+ borderRadius: "50%",
586
+ backgroundColor: tokens.colorNeutralBackground1Hover,
587
+ right: "-50px",
588
+ boxShadow: "inset 3px 0px 1px rgba(0, 0, 0, 0.1)"
589
+ },
590
+ asdpLogo: {
591
+ width: "clamp(50px, 20vw, 150px)"
592
+ }
593
+ });
594
+ var CardTicket = ({
595
+ shipType,
596
+ logoSrc = "/assets/logo/asdp-default.svg",
597
+ shipName,
598
+ availableSeats,
599
+ departure,
600
+ arrival,
601
+ duration,
602
+ actionButtons = [],
603
+ price,
604
+ primaryButton,
605
+ facilities,
606
+ shipIcon,
607
+ facilityIcon
608
+ }) => {
609
+ const styles = useStyles5();
610
+ const threshold = availableSeats.threshold ?? 50;
611
+ const isLowSeats = availableSeats.count <= threshold;
612
+ return /* @__PURE__ */ jsxs("div", { className: styles.ticketWrapper, children: [
613
+ /* @__PURE__ */ jsxs(Card, { className: styles.ticketLeftCard, children: [
614
+ /* @__PURE__ */ jsx(
615
+ Tooltip,
616
+ {
617
+ content: shipType.tooltip || shipType.label,
618
+ relationship: "label",
619
+ appearance: "inverted",
620
+ children: /* @__PURE__ */ jsx(
621
+ Badge,
622
+ {
623
+ size: "large",
624
+ appearance: "filled",
625
+ color: shipType.color,
626
+ iconPosition: "before",
627
+ shape: "rounded",
628
+ children: shipType.label
629
+ }
630
+ )
631
+ }
632
+ ),
633
+ /* @__PURE__ */ jsx(
634
+ "img",
635
+ {
636
+ src: logoSrc,
637
+ className: styles.asdpLogo,
638
+ alt: "Logo"
639
+ }
640
+ ),
641
+ /* @__PURE__ */ jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ jsxs(
642
+ Badge,
643
+ {
644
+ size: "large",
645
+ appearance: "tint",
646
+ color: isLowSeats ? "danger" : "success",
647
+ iconPosition: "after",
648
+ shape: "rounded",
649
+ children: [
650
+ "Tersedia ",
651
+ availableSeats.count
652
+ ]
653
+ }
654
+ ) }),
655
+ /* @__PURE__ */ jsx(Subtitle2, { children: shipName }),
656
+ /* @__PURE__ */ jsx("div", { style: { display: "none" }, children: Array.from({ length: 5 }).map((_, index) => /* @__PURE__ */ jsx(
657
+ "div",
658
+ {
659
+ className: styles.circularLeft,
660
+ style: {
661
+ top: `${18 + index * 60}px`
662
+ }
663
+ },
664
+ index
665
+ )) }),
666
+ /* @__PURE__ */ jsx("div", { className: styles.circularLeftMd }),
667
+ /* @__PURE__ */ jsx("div", { className: styles.circularRightMd })
668
+ ] }),
669
+ /* @__PURE__ */ jsxs(Card, { className: styles.ticketMiddleCard, children: [
670
+ /* @__PURE__ */ jsxs(
671
+ Badge,
672
+ {
673
+ size: "extra-large",
674
+ appearance: "tint",
675
+ color: isLowSeats ? "danger" : "success",
676
+ iconPosition: "after",
677
+ shape: "rounded",
678
+ children: [
679
+ "Tersedia ",
680
+ availableSeats.count
681
+ ]
682
+ }
683
+ ),
684
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className: styles.ticketInfo, children: [
685
+ /* @__PURE__ */ jsxs("div", { className: styles.ticketTime, children: [
686
+ /* @__PURE__ */ jsx(Caption1, { children: departure.day }),
687
+ /* @__PURE__ */ jsx(Title2, { children: departure.time }),
688
+ /* @__PURE__ */ jsx(Caption1, { children: departure.location })
689
+ ] }),
690
+ /* @__PURE__ */ jsxs("div", { className: styles.ticketDuration, children: [
691
+ /* @__PURE__ */ jsxs(Caption2, { children: [
692
+ "Estimasi ",
693
+ duration
694
+ ] }),
695
+ /* @__PURE__ */ jsx("div", { className: styles.dividerContainer, children: /* @__PURE__ */ jsx(Divider, { children: shipIcon || /* @__PURE__ */ jsx("span", { children: "\u{1F6A2}" }) }) })
696
+ ] }),
697
+ /* @__PURE__ */ jsxs("div", { className: styles.ticketTime, children: [
698
+ /* @__PURE__ */ jsx(Caption1, { children: arrival.day }),
699
+ /* @__PURE__ */ jsx(Title2, { children: arrival.time }),
700
+ /* @__PURE__ */ jsx(Caption1, { children: arrival.location })
701
+ ] })
702
+ ] }) }),
703
+ actionButtons.length > 0 && /* @__PURE__ */ jsx("div", { className: styles.ticketButtons, children: actionButtons.slice(0, 2).map((button, idx) => /* @__PURE__ */ jsx(
69
704
  Button,
70
705
  {
71
- style: { width: "100%" },
72
- type: "button",
73
- appearance: "primary",
74
- onClick: handleButtonClick,
75
- children: buttonText
706
+ appearance: "outline",
707
+ shape: "circular",
708
+ style: {
709
+ flex: 1,
710
+ borderColor: tokens.colorBrandBackground,
711
+ color: tokens.colorBrandBackground
712
+ },
713
+ icon: button.icon,
714
+ size: "medium",
715
+ onClick: button.onClick,
716
+ children: button.label
717
+ },
718
+ idx
719
+ )) })
720
+ ] }),
721
+ /* @__PURE__ */ jsxs(Card, { className: styles.ticketRightCard, children: [
722
+ /* @__PURE__ */ jsxs("div", { className: styles.priceCard, children: [
723
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0.25rem" }, children: [
724
+ /* @__PURE__ */ jsx(Subtitle2, { children: "Total harga" }),
725
+ /* @__PURE__ */ jsxs(Title3, { style: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [
726
+ "IDR ",
727
+ price
728
+ ] })
729
+ ] }),
730
+ /* @__PURE__ */ jsx(
731
+ Button,
732
+ {
733
+ onClick: primaryButton.onClick,
734
+ appearance: "primary",
735
+ size: "medium",
736
+ shape: "circular",
737
+ icon: primaryButton.icon,
738
+ style: { backgroundColor: "#58C91B" },
739
+ children: primaryButton.label
740
+ }
741
+ )
742
+ ] }),
743
+ /* @__PURE__ */ jsxs("div", { className: styles.facilitiesSection, children: [
744
+ /* @__PURE__ */ jsx(Subtitle2, { children: "Fasilitas" }),
745
+ /* @__PURE__ */ jsx("div", { className: styles.facilitiesList, children: facilities.map((facility, idx) => /* @__PURE__ */ jsxs("div", { className: styles.facilityItem, children: [
746
+ facilityIcon || /* @__PURE__ */ jsx("span", { children: "\u2713" }),
747
+ /* @__PURE__ */ jsx(Caption1Strong, { children: facility })
748
+ ] }, idx)) })
749
+ ] }),
750
+ /* @__PURE__ */ jsx("div", { style: { display: "none" }, children: Array.from({ length: 5 }).map((_, index) => /* @__PURE__ */ jsx(
751
+ "div",
752
+ {
753
+ className: styles.circularRight,
754
+ style: {
755
+ top: `${18 + index * 60}px`
756
+ }
757
+ },
758
+ index
759
+ )) })
760
+ ] })
761
+ ] });
762
+ };
763
+ var BackgroundTicketCard = (props) => /* @__PURE__ */ jsxs(
764
+ "svg",
765
+ {
766
+ viewBox: "0 0 1850 465",
767
+ fill: "none",
768
+ xmlns: "http://www.w3.org/2000/svg",
769
+ preserveAspectRatio: "none",
770
+ ...props,
771
+ children: [
772
+ /* @__PURE__ */ jsx("g", { filter: "url(#filter0_dd_156_32114)", children: /* @__PURE__ */ jsx(
773
+ "path",
774
+ {
775
+ d: "M1819.6 9.85962C1815.43 8.63925 1810.75 8.00891 1806.01 8.02751H523.015C517.214 8.02224 511.553 8.98897 506.816 10.7941C502.078 12.5993 498.497 15.1537 496.568 18.1041C492.794 23.9726 485.817 29.088 476.552 32.7781C467.288 36.4682 456.169 38.5603 444.659 38.7794C443.997 38.7794 443.3 38.7794 442.604 38.7794C430.731 38.7805 419.152 36.7877 409.476 33.0776C399.799 29.3676 392.505 24.1246 388.606 18.0766C386.681 15.1284 383.106 12.5753 378.374 10.7702C373.643 8.96512 367.989 7.99718 362.193 8.00001H43.9587C40.2864 7.9988 36.6498 8.38797 33.2567 9.1453C29.8635 9.90262 26.7806 11.0133 24.184 12.4137C21.5873 13.814 19.5279 15.4767 18.1237 17.3066C16.7194 19.1365 15.9978 21.0978 16 23.0782V425.922C15.9978 427.902 16.7194 429.863 18.1237 431.693C19.5279 433.523 21.5873 435.186 24.184 436.586C26.7806 437.987 29.8635 439.097 33.2567 439.855C36.6498 440.612 40.2864 441.001 43.9587 441H362.193C367.99 441.005 373.646 440.039 378.379 438.233C383.111 436.428 386.685 433.873 388.606 430.923C392.505 424.875 399.799 419.632 409.476 415.922C419.152 412.212 430.731 410.219 442.604 410.221C443.3 410.221 443.997 410.221 444.659 410.221C456.169 410.44 467.288 412.532 476.552 416.222C485.817 419.912 492.794 425.027 496.568 430.896C498.495 433.847 502.075 436.402 506.814 438.208C511.552 440.013 517.214 440.979 523.015 440.973H1806.04C1809.71 440.974 1813.35 440.585 1816.74 439.827C1820.14 439.07 1823.22 437.959 1825.82 436.559C1828.41 435.159 1830.47 433.496 1831.88 431.666C1833.28 429.836 1834 427.875 1834 425.894V23.0599C1834 20.3673 1832.66 17.7243 1830.13 15.4037C1827.59 13.0831 1823.96 11.1692 1819.6 9.85962ZM447.343 390.645C447.352 391.126 447.104 391.599 446.628 392.007C446.152 392.415 445.469 392.74 444.659 392.944C444.032 393.133 443.322 393.228 442.604 393.219C441.977 393.22 441.355 393.154 440.775 393.025C440.195 392.896 439.668 392.707 439.224 392.467C438.78 392.228 438.429 391.944 438.19 391.631C437.951 391.318 437.829 390.983 437.831 390.645V360.818C437.831 360.135 438.334 359.48 439.229 358.998C440.124 358.515 441.338 358.244 442.604 358.244C443.317 358.24 444.022 358.328 444.659 358.5C445.145 358.623 445.587 358.791 445.967 358.995C446.856 359.484 447.351 360.142 447.343 360.827V390.645ZM447.343 339.556C447.352 340.038 447.104 340.511 446.628 340.919C446.152 341.326 445.469 341.652 444.659 341.856C444.029 342.04 443.321 342.135 442.604 342.13C441.975 342.134 441.352 342.07 440.769 341.942C440.187 341.814 439.658 341.624 439.214 341.385C438.769 341.145 438.418 340.86 438.18 340.546C437.943 340.232 437.824 339.895 437.831 339.556V309.702C437.829 309.364 437.951 309.028 438.19 308.716C438.429 308.403 438.78 308.119 439.224 307.879C439.668 307.64 440.195 307.45 440.775 307.322C441.355 307.193 441.977 307.127 442.604 307.128C443.317 307.124 444.022 307.212 444.659 307.384C445.144 307.504 445.587 307.669 445.967 307.87C446.853 308.36 447.347 309.018 447.343 309.702V339.556ZM447.343 288.468C447.35 288.949 447.101 289.422 446.625 289.829C446.149 290.237 445.467 290.562 444.659 290.767C444.029 290.952 443.321 291.047 442.604 291.042C441.971 291.043 441.345 290.975 440.761 290.843C440.178 290.711 439.649 290.517 439.207 290.273C438.761 290.033 438.409 289.747 438.173 289.432C437.937 289.117 437.82 288.78 437.831 288.441V258.614C437.829 258.275 437.951 257.94 438.19 257.627C438.429 257.314 438.78 257.03 439.224 256.791C439.668 256.552 440.195 256.362 440.775 256.233C441.355 256.104 441.977 256.039 442.604 256.04C443.317 256.036 444.022 256.123 444.659 256.296C445.148 256.413 445.591 256.577 445.967 256.782C446.853 257.272 447.347 257.929 447.343 258.614V288.468ZM447.343 237.371C447.353 237.854 447.105 238.328 446.63 238.737C446.154 239.147 445.47 239.474 444.659 239.679C444.028 239.861 443.32 239.953 442.604 239.945C441.977 239.946 441.355 239.88 440.775 239.751C440.195 239.622 439.668 239.433 439.224 239.193C438.78 238.954 438.429 238.67 438.19 238.357C437.951 238.044 437.829 237.709 437.831 237.371V207.535C437.831 207.197 437.954 206.863 438.195 206.551C438.435 206.239 438.786 205.956 439.23 205.718C439.673 205.479 440.2 205.291 440.779 205.162C441.358 205.034 441.978 204.969 442.604 204.97C443.319 204.968 444.023 205.059 444.659 205.235C445.148 205.352 445.591 205.516 445.967 205.721C446.41 205.962 446.759 206.248 446.995 206.563C447.232 206.877 447.35 207.214 447.343 207.553V237.371ZM447.343 186.282C447.354 186.764 447.107 187.238 446.63 187.646C446.154 188.054 445.47 188.379 444.659 188.582C444.032 188.771 443.322 188.866 442.604 188.856C441.335 188.859 440.115 188.592 439.207 188.114C438.327 187.622 437.834 186.966 437.831 186.282V156.456C437.831 155.773 438.334 155.118 439.229 154.635C440.124 154.153 441.338 153.881 442.604 153.881C443.875 153.883 445.095 154.152 446.001 154.633C446.887 155.122 447.381 155.78 447.377 156.465L447.343 186.282ZM447.343 135.194C447.352 135.676 447.104 136.149 446.628 136.556C446.152 136.964 445.469 137.289 444.659 137.493C444.032 137.683 443.322 137.778 442.604 137.768C441.977 137.769 441.355 137.704 440.775 137.575C440.195 137.446 439.668 137.256 439.224 137.017C438.78 136.778 438.429 136.493 438.19 136.18C437.951 135.868 437.829 135.532 437.831 135.194V105.367C437.831 104.685 438.334 104.03 439.229 103.547C440.124 103.064 441.338 102.793 442.604 102.793C443.317 102.789 444.022 102.877 444.659 103.05C445.145 103.173 445.587 103.34 445.967 103.544C446.856 104.033 447.351 104.692 447.343 105.376V135.194ZM447.343 84.1057C447.352 84.5874 447.104 85.0604 446.628 85.4681C446.152 85.8758 445.469 86.201 444.659 86.405C444.029 86.5898 443.321 86.6845 442.604 86.6798C441.975 86.6835 441.352 86.6194 440.769 86.4913C440.187 86.3632 439.658 86.1739 439.214 85.9341C438.769 85.6943 438.418 85.409 438.18 85.0951C437.943 84.7811 437.824 84.4447 437.831 84.1057V54.279C437.829 53.9407 437.951 53.6054 438.19 53.2925C438.429 52.9797 438.78 52.6954 439.224 52.4561C439.668 52.2168 440.195 52.0273 440.775 51.8983C441.355 51.7694 441.977 51.7037 442.604 51.7049C443.317 51.7007 444.022 51.7886 444.659 51.9614C445.144 52.0812 445.587 52.2455 445.967 52.4469C446.856 52.9357 447.351 53.5943 447.343 54.279V84.1057Z",
776
+ fill: "white"
777
+ }
778
+ ) }),
779
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
780
+ "filter",
781
+ {
782
+ id: "filter0_dd_156_32114",
783
+ x: "0",
784
+ y: "0",
785
+ width: "1850",
786
+ height: "465",
787
+ filterUnits: "userSpaceOnUse",
788
+ colorInterpolationFilters: "sRGB",
789
+ children: [
790
+ /* @__PURE__ */ jsx("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
791
+ /* @__PURE__ */ jsx(
792
+ "feColorMatrix",
793
+ {
794
+ in: "SourceAlpha",
795
+ type: "matrix",
796
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
797
+ result: "hardAlpha"
798
+ }
799
+ ),
800
+ /* @__PURE__ */ jsx("feOffset", {}),
801
+ /* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "1" }),
802
+ /* @__PURE__ */ jsx("feComposite", { in2: "hardAlpha", operator: "out" }),
803
+ /* @__PURE__ */ jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0" }),
804
+ /* @__PURE__ */ jsx("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_156_32114" }),
805
+ /* @__PURE__ */ jsx(
806
+ "feColorMatrix",
807
+ {
808
+ in: "SourceAlpha",
809
+ type: "matrix",
810
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
811
+ result: "hardAlpha"
812
+ }
813
+ ),
814
+ /* @__PURE__ */ jsx("feOffset", { dy: "8" }),
815
+ /* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "8" }),
816
+ /* @__PURE__ */ jsx("feComposite", { in2: "hardAlpha", operator: "out" }),
817
+ /* @__PURE__ */ jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0" }),
818
+ /* @__PURE__ */ jsx(
819
+ "feBlend",
820
+ {
821
+ mode: "normal",
822
+ in2: "effect1_dropShadow_156_32114",
823
+ result: "effect2_dropShadow_156_32114"
824
+ }
825
+ ),
826
+ /* @__PURE__ */ jsx(
827
+ "feBlend",
828
+ {
829
+ mode: "normal",
830
+ in: "SourceGraphic",
831
+ in2: "effect2_dropShadow_156_32114",
832
+ result: "shape"
833
+ }
834
+ )
835
+ ]
76
836
  }
77
837
  ) })
838
+ ]
839
+ }
840
+ );
841
+ var BackgroundTicketCard_default = BackgroundTicketCard;
842
+ var BackgroundTicketCardVertical = (props) => /* @__PURE__ */ jsxs(
843
+ "svg",
844
+ {
845
+ viewBox: "0 0 465 1750",
846
+ fill: "none",
847
+ xmlns: "http://www.w3.org/2000/svg",
848
+ preserveAspectRatio: "none",
849
+ ...props,
850
+ children: [
851
+ /* @__PURE__ */ jsx("g", { filter: "url(#filter0_dd_156_32115)", children: /* @__PURE__ */ jsx(
852
+ "path",
853
+ {
854
+ d: "M455.14 1719.6C456.36 1715.43 456.99 1710.75 456.973 1706.01V423.015C456.978 417.214 456.011 411.553 454.206 406.816C452.401 402.078 449.846 398.497 446.896 396.568C441.027 392.794 435.912 385.817 432.222 376.552C428.532 367.288 426.44 356.169 426.221 344.659C426.221 343.997 426.221 343.3 426.221 342.604C426.219 330.731 428.212 319.152 431.922 309.476C435.632 299.799 440.875 292.505 446.923 288.606C449.872 286.681 452.425 283.106 454.23 278.374C456.035 273.643 457.003 267.989 457 262.193V43.9587C457.001 40.2864 456.612 36.6498 455.855 33.2567C455.097 29.8635 453.987 26.7806 452.586 24.184C451.186 21.5873 449.523 19.5279 447.693 18.1237C445.863 16.7194 443.902 15.9978 441.922 16H23.0782C21.0978 16 19.1365 16.7194 17.3066 18.1237C15.4767 19.5279 13.814 21.5873 12.4137 24.184C11.0133 26.7806 9.90262 29.8635 9.1453 33.2567C8.38797 36.6498 7.9988 40.2864 8.00001 43.9587V262.193C7.99512 267.99 8.96103 273.646 10.7672 278.379C12.5723 283.111 15.1274 286.685 18.0766 288.606C24.1246 292.505 29.3676 299.799 33.0776 309.476C36.7877 319.152 38.7805 330.731 38.7794 342.604C38.7794 343.3 38.7794 343.997 38.7794 344.659C38.5603 356.169 36.4682 367.288 32.7781 376.552C29.088 385.817 23.9726 392.794 18.1041 396.568C15.1537 398.495 12.5993 402.075 10.7941 406.814C8.98897 411.552 8.02224 417.214 8.02751 423.015V1706.04C8.02604 1709.71 8.41503 1713.35 9.17279 1716.74C9.93055 1720.14 11.0413 1723.22 12.4414 1725.82C13.8414 1728.41 15.5041 1730.47 17.3342 1731.88C19.1643 1733.28 21.1253 1734 23.1059 1734H441.94C444.633 1734 447.276 1732.66 449.596 1730.13C451.917 1727.59 453.831 1723.96 455.14 1719.6ZM64.3552 347.343C63.8743 347.352 63.4013 347.104 62.9936 346.628C62.5859 346.152 62.261 345.469 62.0569 344.659C61.8675 344.032 61.7723 343.322 61.7814 342.604C61.7799 341.977 61.8461 341.355 61.975 340.775C62.1039 340.195 62.2932 339.668 62.5325 339.224C62.7718 338.78 63.0562 338.429 63.3691 338.19C63.682 337.951 64.0173 337.829 64.3552 337.831H94.1823C94.8653 337.831 95.5203 338.334 96.0023 339.229C96.4843 340.124 96.7557 341.338 96.7557 342.604C96.7599 343.317 96.672 344.022 96.5 344.659C96.3771 345.145 96.2092 345.587 96.0051 345.967C95.5163 346.856 94.8585 347.351 94.1733 347.343H64.3552ZM115.444 347.343C114.962 347.352 114.489 347.104 114.081 346.628C113.674 346.152 113.349 345.469 113.145 344.659C112.96 344.029 112.865 343.321 112.87 342.604C112.866 341.975 112.93 341.352 113.058 340.769C113.186 340.187 113.376 339.658 113.615 339.214C113.855 338.769 114.14 338.418 114.454 338.18C114.768 337.943 115.105 337.824 115.444 337.831H145.298C145.636 337.829 145.972 337.951 146.284 338.19C146.597 338.429 146.881 338.78 147.121 339.224C147.36 339.668 147.55 340.195 147.678 340.775C147.807 341.355 147.873 341.977 147.872 342.604C147.876 343.317 147.788 344.022 147.616 344.659C147.496 345.144 147.331 345.587 147.13 345.967C146.64 346.853 145.982 347.347 145.298 347.343H115.444ZM166.532 347.343C166.051 347.35 165.578 347.101 165.171 346.625C164.763 346.149 164.438 345.467 164.233 344.659C164.048 344.029 163.953 343.321 163.958 342.604C163.957 341.971 164.025 341.345 164.157 340.761C164.289 340.178 164.483 339.649 164.727 339.207C164.967 338.761 165.253 338.409 165.568 338.173C165.883 337.937 166.22 337.82 166.559 337.831H196.386C196.725 337.829 197.06 337.951 197.373 338.19C197.686 338.429 197.97 338.78 198.209 339.224C198.448 339.668 198.638 340.195 198.767 340.775C198.896 341.355 198.961 341.977 198.96 342.604C199.036 343.317 198.948 344.022 198.776 344.659C198.659 345.148 198.505 345.591 198.299 345.967C197.809 346.853 197.152 347.347 196.468 347.343H166.532ZM217.629 347.343C217.146 347.353 216.672 347.105 216.263 346.63C215.853 346.154 215.526 345.47 215.321 344.659C215.139 344.028 215.047 343.32 215.055 342.604C215.054 341.977 215.12 341.355 215.249 340.775C215.378 340.195 215.567 339.668 215.807 339.224C216.046 338.78 216.33 338.429 216.643 338.19C216.956 337.951 217.291 337.829 217.629 337.831H247.465C247.803 337.831 248.137 337.954 248.449 338.195C248.761 338.435 249.044 338.786 249.282 339.23C249.521 339.673 249.709 340.2 249.838 340.779C249.966 341.358 250.031 341.978 250.03 342.604C250.032 343.319 249.941 344.023 249.765 344.659C249.648 345.148 249.484 345.591 249.279 345.967C248.964 346.41 248.578 346.759 248.163 346.995C247.748 347.232 247.311 347.35 246.873 347.343H217.629ZM268.718 347.343C268.236 347.354 267.762 347.107 267.354 346.63C266.946 346.154 266.621 345.47 266.418 344.659C266.229 344.032 266.134 343.322 266.144 342.604C266.141 341.335 266.408 340.115 266.886 339.207C267.378 338.327 268.034 337.834 268.718 337.831H298.544C299.227 337.831 299.882 338.334 300.365 339.229C300.847 340.124 301.119 341.338 301.119 342.604C301.117 343.875 300.848 345.095 300.367 346.001C299.878 346.887 299.22 347.381 298.535 347.377L268.718 347.343ZM319.806 347.343C319.324 347.352 318.851 347.104 318.444 346.628C318.036 346.152 317.711 345.469 317.507 344.659C317.317 344.032 317.222 343.322 317.232 342.604C317.231 341.977 317.296 341.355 317.425 340.775C317.554 340.195 317.744 339.668 317.983 339.224C318.222 338.78 318.507 338.429 318.82 338.19C319.132 337.951 319.468 337.829 319.806 337.831H349.633C350.315 337.831 350.97 338.334 351.453 339.229C351.936 340.124 352.207 341.338 352.207 342.604C352.211 343.317 352.123 344.022 351.95 344.659C351.827 345.145 351.66 345.587 351.456 345.967C350.967 346.856 350.308 347.351 349.624 347.343H319.806ZM370.894 347.343C370.413 347.352 369.94 347.104 369.532 346.628C369.124 346.152 368.799 345.469 368.595 344.659C368.41 344.029 368.315 343.321 368.32 342.604C368.316 341.975 368.38 341.352 368.508 340.769C368.637 340.187 368.826 339.658 369.066 339.214C369.306 338.769 369.592 338.418 369.905 338.18C370.219 337.943 370.555 337.824 370.894 337.831H400.721C401.059 337.829 401.395 337.951 401.707 338.19C402.02 338.429 402.305 388.78 402.544 339.224C402.783 339.668 402.973 340.195 403.102 340.775C403.231 341.355 403.296 341.977 403.295 342.604C403.299 343.317 403.212 344.022 403.039 344.659C402.919 345.144 402.755 345.587 402.553 345.967C402.064 346.856 401.406 347.351 400.721 347.343H370.894Z",
855
+ fill: "white"
856
+ }
857
+ ) }),
858
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
859
+ "filter",
860
+ {
861
+ id: "filter0_dd_156_32115",
862
+ x: "0",
863
+ y: "0",
864
+ width: "465",
865
+ height: "1750",
866
+ filterUnits: "userSpaceOnUse",
867
+ colorInterpolationFilters: "sRGB",
868
+ children: [
869
+ /* @__PURE__ */ jsx("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
870
+ /* @__PURE__ */ jsx(
871
+ "feColorMatrix",
872
+ {
873
+ in: "SourceAlpha",
874
+ type: "matrix",
875
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
876
+ result: "hardAlpha"
877
+ }
878
+ ),
879
+ /* @__PURE__ */ jsx("feOffset", {}),
880
+ /* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "1" }),
881
+ /* @__PURE__ */ jsx("feComposite", { in2: "hardAlpha", operator: "out" }),
882
+ /* @__PURE__ */ jsx(
883
+ "feColorMatrix",
884
+ {
885
+ type: "matrix",
886
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"
887
+ }
888
+ ),
889
+ /* @__PURE__ */ jsx(
890
+ "feBlend",
891
+ {
892
+ mode: "normal",
893
+ in2: "BackgroundImageFix",
894
+ result: "effect1_dropShadow_156_32115"
895
+ }
896
+ ),
897
+ /* @__PURE__ */ jsx(
898
+ "feColorMatrix",
899
+ {
900
+ in: "SourceAlpha",
901
+ type: "matrix",
902
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
903
+ result: "hardAlpha"
904
+ }
905
+ ),
906
+ /* @__PURE__ */ jsx("feOffset", { dy: "8" }),
907
+ /* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "8" }),
908
+ /* @__PURE__ */ jsx("feComposite", { in2: "hardAlpha", operator: "out" }),
909
+ /* @__PURE__ */ jsx(
910
+ "feColorMatrix",
911
+ {
912
+ type: "matrix",
913
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0"
914
+ }
915
+ ),
916
+ /* @__PURE__ */ jsx(
917
+ "feBlend",
918
+ {
919
+ mode: "normal",
920
+ in2: "effect1_dropShadow_156_32115",
921
+ result: "effect2_dropShadow_156_32115"
922
+ }
923
+ ),
924
+ /* @__PURE__ */ jsx(
925
+ "feBlend",
926
+ {
927
+ mode: "normal",
928
+ in: "SourceGraphic",
929
+ in2: "effect2_dropShadow_156_32115",
930
+ result: "shape"
931
+ }
932
+ )
933
+ ]
934
+ }
935
+ ) })
936
+ ]
937
+ }
938
+ );
939
+ var BackgroundTicketCardVertical_default = BackgroundTicketCardVertical;
940
+ var useStyles6 = makeStyles({
941
+ card: {
942
+ width: "100%",
943
+ boxSizing: "border-box",
944
+ padding: "0px",
945
+ borderRadius: tokens.borderRadiusXLarge
946
+ },
947
+ menuList: {
948
+ display: "flex",
949
+ flexDirection: "column",
950
+ "@media (max-width: 1200px)": {
951
+ flexDirection: "row",
952
+ overflowX: "auto",
953
+ flexWrap: "nowrap",
954
+ gap: "0px",
955
+ WebkitOverflowScrolling: "touch",
956
+ scrollbarWidth: "thin",
957
+ justifyContent: "space-around"
958
+ }
959
+ },
960
+ menuItem: {
961
+ display: "flex",
962
+ flexDirection: "row",
963
+ alignItems: "center",
964
+ justifyContent: "flex-start",
965
+ padding: "12px",
966
+ borderRadius: tokens.borderRadiusMedium,
967
+ cursor: "pointer",
968
+ textAlign: "left",
969
+ transition: "background-color 0.2s ease",
970
+ textDecoration: "none",
971
+ color: tokens.colorNeutralForeground1,
972
+ backgroundColor: tokens.colorNeutralBackground1,
973
+ border: "none",
974
+ gap: "12px",
975
+ "&:hover": {
976
+ backgroundColor: tokens.colorNeutralBackground1Hover
977
+ },
978
+ "@media (max-width: 1200px)": {
979
+ padding: "10px 12px",
980
+ flexShrink: 0,
981
+ flexDirection: "column",
982
+ alignItems: "center",
983
+ textAlign: "center"
984
+ }
985
+ },
986
+ menuItemActive: {
987
+ backgroundColor: tokens.colorNeutralBackground3,
988
+ color: tokens.colorNeutralForeground1,
989
+ "&:hover": {
990
+ backgroundColor: tokens.colorNeutralBackground3Hover
991
+ }
992
+ },
993
+ logo: {
994
+ height: "32px",
995
+ width: "32px",
996
+ flexShrink: 0
997
+ },
998
+ textContent: {
999
+ display: "flex",
1000
+ flexDirection: "column",
1001
+ gap: "4px",
1002
+ "@media (max-width: 1200px)": {
1003
+ alignItems: "center"
1004
+ }
1005
+ },
1006
+ label: {
1007
+ fontSize: tokens.fontSizeBase300,
1008
+ fontWeight: tokens.fontWeightSemibold,
1009
+ lineHeight: "1.2"
1010
+ },
1011
+ description: {
1012
+ fontSize: tokens.fontSizeBase200,
1013
+ fontWeight: tokens.fontWeightRegular,
1014
+ color: tokens.colorNeutralForeground2,
1015
+ lineHeight: "1.4",
1016
+ "@media (max-width: 1200px)": {
1017
+ fontSize: tokens.fontSizeBase100,
1018
+ whiteSpace: "nowrap"
1019
+ }
1020
+ },
1021
+ dividerVertical: {
1022
+ "@media (min-width: 1200px)": {
1023
+ display: "none"
1024
+ }
1025
+ },
1026
+ dividerHorizontal: {
1027
+ "@media (max-width: 1200px)": {
1028
+ display: "none"
1029
+ }
1030
+ }
1031
+ });
1032
+ var CardServiceMenu = ({
1033
+ items,
1034
+ activeItemId,
1035
+ onItemClick,
1036
+ showDescriptions = true,
1037
+ className
1038
+ }) => {
1039
+ const styles = useStyles6();
1040
+ const getMenuItemClass = (itemId) => {
1041
+ const isActive = activeItemId === itemId;
1042
+ return mergeClasses(
1043
+ styles.menuItem,
1044
+ isActive && styles.menuItemActive
1045
+ );
1046
+ };
1047
+ return /* @__PURE__ */ jsx(Card, { className: mergeClasses(styles.card, className), children: /* @__PURE__ */ jsx("div", { className: styles.menuList, children: items.map((item, index) => /* @__PURE__ */ jsxs(React2.Fragment, { children: [
1048
+ /* @__PURE__ */ jsxs(
1049
+ Button,
1050
+ {
1051
+ className: getMenuItemClass(item.id),
1052
+ onClick: () => onItemClick?.(item.id),
1053
+ style: item.customStyle,
1054
+ children: [
1055
+ item.logo && /* @__PURE__ */ jsx(
1056
+ "img",
1057
+ {
1058
+ src: item.logo,
1059
+ alt: item.label,
1060
+ className: styles.logo
1061
+ }
1062
+ ),
1063
+ /* @__PURE__ */ jsxs("div", { className: styles.textContent, children: [
1064
+ /* @__PURE__ */ jsx("span", { className: styles.label, children: item.label }),
1065
+ showDescriptions && item.description && /* @__PURE__ */ jsx("span", { className: styles.description, children: item.description })
1066
+ ] })
1067
+ ]
1068
+ }
1069
+ ),
1070
+ index < items.length - 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
1071
+ /* @__PURE__ */ jsx(Divider, { className: styles.dividerHorizontal }),
1072
+ /* @__PURE__ */ jsx(Divider, { vertical: true, className: styles.dividerVertical })
78
1073
  ] })
79
- ] }) }) });
1074
+ ] }, item.id)) }) });
1075
+ };
1076
+ var fontWeight = {
1077
+ "Medium": 500};
1078
+ var sharedColors = {
1079
+ "Shared_Cranberry_Primary": "#c50f1f"};
1080
+ var lightModeColors = {
1081
+ "Brand_Stroke_1_Rest": "#00B3BD"};
1082
+ var tokensV2_default = {
1083
+ lightModeColors};
1084
+ var DatePickerInput = forwardRef(
1085
+ ({
1086
+ field,
1087
+ placeholder,
1088
+ disabled,
1089
+ appearance,
1090
+ size,
1091
+ contentBefore,
1092
+ onClick,
1093
+ style,
1094
+ max,
1095
+ ...restProps
1096
+ }, ref) => {
1097
+ const [isOpen, setIsOpen] = useState(false);
1098
+ const dateValue = field.value ? new Date(field.value) : void 0;
1099
+ const onSelectDate = (date) => {
1100
+ if (date) {
1101
+ const offset = date.getTimezoneOffset();
1102
+ const adjustedDate = new Date(date.getTime() - offset * 60 * 1e3);
1103
+ field.onChange(adjustedDate.toISOString().split("T")[0]);
1104
+ setIsOpen(false);
1105
+ }
1106
+ };
1107
+ const formatDate = (dateString) => {
1108
+ if (!dateString) return "";
1109
+ const date = new Date(dateString);
1110
+ return date.toLocaleDateString("id-ID", {
1111
+ day: "numeric",
1112
+ month: "long",
1113
+ year: "numeric"
1114
+ });
1115
+ };
1116
+ const handleInputClick = (e) => {
1117
+ e?.preventDefault();
1118
+ if (!disabled) {
1119
+ setIsOpen(!isOpen);
1120
+ }
1121
+ onClick?.(e);
1122
+ };
1123
+ return /* @__PURE__ */ jsxs(Popover, { open: isOpen, onOpenChange: (_, data) => setIsOpen(data.open), trapFocus: true, children: [
1124
+ /* @__PURE__ */ jsx(PopoverTrigger, { disableButtonEnhancement: true, children: /* @__PURE__ */ jsx(
1125
+ Input,
1126
+ {
1127
+ ...restProps,
1128
+ value: formatDate(field.value),
1129
+ readOnly: true,
1130
+ placeholder: placeholder || "Pilih tanggal",
1131
+ disabled,
1132
+ appearance,
1133
+ size,
1134
+ contentBefore,
1135
+ onClick: handleInputClick,
1136
+ style: {
1137
+ cursor: disabled ? "not-allowed" : "pointer",
1138
+ ...style
1139
+ },
1140
+ contentAfter: /* @__PURE__ */ jsx(
1141
+ "div",
1142
+ {
1143
+ onClick: (e) => {
1144
+ e.stopPropagation();
1145
+ if (!disabled) {
1146
+ setIsOpen(!isOpen);
1147
+ }
1148
+ },
1149
+ style: {
1150
+ cursor: disabled ? "not-allowed" : "pointer",
1151
+ display: "flex",
1152
+ alignItems: "center"
1153
+ },
1154
+ children: /* @__PURE__ */ jsx(Icon, { icon: "fluent:calendar-24-regular" })
1155
+ }
1156
+ )
1157
+ }
1158
+ ) }),
1159
+ /* @__PURE__ */ jsx(PopoverSurface, { tabIndex: -1, style: { maxWidth: "530px" }, children: /* @__PURE__ */ jsx(
1160
+ Calendar,
1161
+ {
1162
+ value: dateValue,
1163
+ onSelectDate,
1164
+ showGoToToday: true,
1165
+ highlightSelectedMonth: true,
1166
+ showMonthPickerAsOverlay: false,
1167
+ maxDate: max ? new Date(max) : void 0
1168
+ }
1169
+ ) })
1170
+ ] });
1171
+ }
1172
+ );
1173
+ DatePickerInput.displayName = "DatePickerInput";
1174
+ var DatePickerInput_default = DatePickerInput;
1175
+ var useStyles7 = makeStyles({
1176
+ field: {
1177
+ display: "flex",
1178
+ flexDirection: "column",
1179
+ gap: tokens.spacingVerticalXS,
1180
+ marginBottom: tokens.spacingVerticalM
1181
+ },
1182
+ errorText: {
1183
+ color: tokens.colorPaletteRedBackground1,
1184
+ fontSize: tokens.fontSizeBase200
1185
+ },
1186
+ helperText: {
1187
+ color: tokens.colorNeutralForeground2,
1188
+ fontSize: tokens.fontSizeBase200
1189
+ },
1190
+ disabledFilledLighter: {
1191
+ backgroundColor: tokens.colorNeutralBackground4,
1192
+ border: "none",
1193
+ "& input": {
1194
+ backgroundColor: tokens.colorNeutralBackground4,
1195
+ border: "none"
1196
+ }
1197
+ },
1198
+ fileInput: {
1199
+ padding: tokens.spacingVerticalS,
1200
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
1201
+ borderRadius: tokens.borderRadiusMedium,
1202
+ backgroundColor: tokens.colorNeutralBackground1,
1203
+ fontSize: tokens.fontSizeBase300,
1204
+ "&:focus": {
1205
+ outline: `2px solid ${tokens.colorBrandStroke1}`
1206
+ }
1207
+ },
1208
+ reactSelect: {
1209
+ // Custom styles akan dihandle via styles prop react-select
1210
+ },
1211
+ reactSelectError: {
1212
+ // Custom styles akan dihandle via styles prop react-select
1213
+ },
1214
+ phoneContainer: {
1215
+ display: "flex",
1216
+ gap: tokens.spacingHorizontalS,
1217
+ alignItems: "flex-start",
1218
+ width: "100%"
1219
+ },
1220
+ phoneCountrySelect: {
1221
+ minWidth: "120px",
1222
+ maxWidth: "120px",
1223
+ flexShrink: 0
1224
+ },
1225
+ switchWrapper: {
1226
+ "& .fui-Switch": {
1227
+ minHeight: "20px"
1228
+ },
1229
+ "& .fui-Switch__indicator": {
1230
+ height: "20px",
1231
+ width: "40px",
1232
+ borderRadius: "10px"
1233
+ },
1234
+ "& .fui-Switch__thumb": {
1235
+ height: "14px",
1236
+ width: "14px",
1237
+ borderRadius: "50%"
1238
+ }
1239
+ },
1240
+ otpInput: {
1241
+ "& input": {
1242
+ textAlign: "center"
1243
+ }
1244
+ },
1245
+ inputWithAutocomplete: {
1246
+ "& input:-webkit-autofill": {
1247
+ "-webkit-box-shadow": "0 0 0 30px white inset !important",
1248
+ "-webkit-text-fill-color": `${tokens.colorNeutralForeground1} !important`
1249
+ },
1250
+ "& input:-webkit-autofill:hover": {
1251
+ "-webkit-box-shadow": "0 0 0 30px white inset !important"
1252
+ },
1253
+ "& input:-webkit-autofill:focus": {
1254
+ "-webkit-box-shadow": "0 0 0 30px white inset !important"
1255
+ },
1256
+ "& input:-webkit-autofill:active": {
1257
+ "-webkit-box-shadow": "0 0 0 30px white inset !important"
1258
+ }
1259
+ },
1260
+ phoneInputWrapper: {
1261
+ width: "100%",
1262
+ "& .react-tel-input": {
1263
+ width: "100%"
1264
+ },
1265
+ "& .react-tel-input .form-control": {
1266
+ width: "100%",
1267
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
1268
+ borderRadius: tokens.borderRadiusMedium,
1269
+ padding: tokens.spacingVerticalS,
1270
+ paddingLeft: "48px",
1271
+ fontSize: tokens.fontSizeBase300,
1272
+ fontFamily: tokens.fontFamilyBase,
1273
+ backgroundColor: tokens.colorNeutralBackground1,
1274
+ color: tokens.colorNeutralForeground1,
1275
+ outline: "none",
1276
+ height: "auto",
1277
+ minHeight: "40px"
1278
+ },
1279
+ "& .react-tel-input .form-control::placeholder": {
1280
+ fontSize: tokens.fontSizeBase400
1281
+ },
1282
+ "& .react-tel-input .form-control:hover": {
1283
+ border: `1px solid ${tokens.colorNeutralStroke1Hover}`
1284
+ },
1285
+ "& .react-tel-input .form-control:focus": {
1286
+ borderBottom: `2px solid ${tokens.colorBrandStroke1}`
1287
+ // boxShadow: `0 0 0 1px ${tokens.colorBrandStroke1}`,
1288
+ },
1289
+ "& .react-tel-input .form-control:disabled": {
1290
+ backgroundColor: tokens.colorNeutralBackground4,
1291
+ color: tokens.colorNeutralForegroundDisabled,
1292
+ cursor: "not-allowed"
1293
+ },
1294
+ "& .react-tel-input .flag-dropdown": {
1295
+ border: "none",
1296
+ backgroundColor: "transparent",
1297
+ borderRadius: tokens.borderRadiusMedium
1298
+ },
1299
+ "& .react-tel-input .selected-flag": {
1300
+ padding: "0 0 0 8px",
1301
+ width: "40px",
1302
+ backgroundColor: "transparent"
1303
+ },
1304
+ "& .react-tel-input .selected-flag:hover": {
1305
+ backgroundColor: "transparent"
1306
+ },
1307
+ "& .react-tel-input .flag-dropdown.open .selected-flag": {
1308
+ backgroundColor: "transparent"
1309
+ }
1310
+ },
1311
+ phoneInputError: {
1312
+ "& .react-tel-input .form-control": {
1313
+ border: `2px solid ${tokens.colorPaletteRedBorder2}`
1314
+ },
1315
+ "& .react-tel-input .form-control:focus": {
1316
+ border: `2px solid ${tokens.colorPaletteRedBorder2}`,
1317
+ boxShadow: `0 0 0 1px ${tokens.colorPaletteRedBorder2}`
1318
+ }
1319
+ },
1320
+ classRadioGroup: {
1321
+ display: "flex",
1322
+ flexDirection: "row",
1323
+ gap: "12px"
1324
+ },
1325
+ classRadio: {
1326
+ "& .fui-Radio__indicator": {
1327
+ display: "none"
1328
+ },
1329
+ "& .fui-Radio__label": {
1330
+ padding: "10px 24px",
1331
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
1332
+ borderRadius: tokens.borderRadiusCircular,
1333
+ cursor: "pointer",
1334
+ transition: "all 0.2s ease",
1335
+ fontSize: tokens.fontSizeBase300,
1336
+ color: tokens.colorNeutralForeground2
1337
+ },
1338
+ "&:hover .fui-Radio__label": {
1339
+ backgroundColor: tokens.colorNeutralBackground1Hover,
1340
+ border: `1px solid ${tokensV2_default.lightModeColors.Brand_Stroke_1_Rest}`
1341
+ },
1342
+ "& .fui-Radio__input:checked ~ .fui-Radio__label": {
1343
+ borderRadius: tokens.borderRadiusXLarge,
1344
+ border: `1px solid ${tokensV2_default.lightModeColors.Brand_Stroke_1_Rest}`,
1345
+ color: tokensV2_default.lightModeColors.Brand_Stroke_1_Rest,
1346
+ backgroundColor: "transparent"
1347
+ },
1348
+ // Fallback for aria-checked if needed
1349
+ '&[aria-checked="true"] .fui-Radio__label': {
1350
+ borderRadius: tokens.borderRadiusXLarge,
1351
+ border: `1px solid ${tokensV2_default.lightModeColors.Brand_Stroke_1_Rest}`,
1352
+ color: tokensV2_default.lightModeColors.Brand_Stroke_1_Rest,
1353
+ backgroundColor: "transparent"
1354
+ }
1355
+ }
1356
+ });
1357
+ var DEFAULT_COUNTRY_CODES = [
1358
+ { code: "AF", name: "Afghanistan", dialCode: "+93", passportRegex: "^[A-Z][0-9]{7}$" },
1359
+ { code: "AL", name: "Albania", dialCode: "+355", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1360
+ { code: "DZ", name: "Algeria", dialCode: "+213", passportRegex: "^[0-9]{9}$" },
1361
+ { code: "AS", name: "American Samoa", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
1362
+ { code: "AD", name: "Andorra", dialCode: "+376", passportRegex: "^[A-Z0-9]{6,10}$" },
1363
+ { code: "AO", name: "Angola", dialCode: "+244", passportRegex: "^[A-Z0-9]{6,10}$" },
1364
+ { code: "AI", name: "Anguilla", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1365
+ { code: "AQ", name: "Antarctica", dialCode: "+672", passportRegex: "^[A-Z0-9]{6,10}$" },
1366
+ { code: "AG", name: "Antigua and Barbuda", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1367
+ { code: "AR", name: "Argentina", dialCode: "+54", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1368
+ { code: "AM", name: "Armenia", dialCode: "+374", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1369
+ { code: "AW", name: "Aruba", dialCode: "+297", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1370
+ { code: "AU", name: "Australia", dialCode: "+61", passportRegex: "^[A-Z][0-9]{7}$" },
1371
+ { code: "AT", name: "Austria", dialCode: "+43", passportRegex: "^[A-Z0-9]{8}$" },
1372
+ { code: "AZ", name: "Azerbaijan", dialCode: "+994", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1373
+ { code: "BS", name: "Bahamas", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1374
+ { code: "BH", name: "Bahrain", dialCode: "+973", passportRegex: "^[A-Z][0-9]{7}$" },
1375
+ { code: "BD", name: "Bangladesh", dialCode: "+880", passportRegex: "^[A-Z][0-9]{7}$" },
1376
+ { code: "BB", name: "Barbados", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1377
+ { code: "BY", name: "Belarus", dialCode: "+375", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1378
+ { code: "BE", name: "Belgium", dialCode: "+32", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1379
+ { code: "BZ", name: "Belize", dialCode: "+501", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1380
+ { code: "BJ", name: "Benin", dialCode: "+229", passportRegex: "^[A-Z0-9]{6,10}$" },
1381
+ { code: "BM", name: "Bermuda", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1382
+ { code: "BT", name: "Bhutan", dialCode: "+975", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1383
+ { code: "BO", name: "Bolivia", dialCode: "+591", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1384
+ {
1385
+ code: "BA",
1386
+ name: "Bosnia and Herzegovina",
1387
+ dialCode: "+387",
1388
+ passportRegex: "^[A-Z]{2}[0-9]{6}$"
1389
+ },
1390
+ { code: "BW", name: "Botswana", dialCode: "+267", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1391
+ { code: "BR", name: "Brazil", dialCode: "+55", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1392
+ { code: "BN", name: "Brunei", dialCode: "+673", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1393
+ { code: "BG", name: "Bulgaria", dialCode: "+359", passportRegex: "^[0-9]{9}$" },
1394
+ { code: "BF", name: "Burkina Faso", dialCode: "+226", passportRegex: "^[A-Z0-9]{6,10}$" },
1395
+ { code: "BI", name: "Burundi", dialCode: "+257", passportRegex: "^[A-Z0-9]{6,10}$" },
1396
+ { code: "KH", name: "Cambodia", dialCode: "+855", passportRegex: "^[A-Z][0-9]{7}$" },
1397
+ { code: "CM", name: "Cameroon", dialCode: "+237", passportRegex: "^[A-Z0-9]{6,10}$" },
1398
+ { code: "CA", name: "Canada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1399
+ { code: "CV", name: "Cape Verde", dialCode: "+238", passportRegex: "^[A-Z0-9]{6,10}$" },
1400
+ { code: "KY", name: "Cayman Islands", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1401
+ {
1402
+ code: "CF",
1403
+ name: "Central African Republic",
1404
+ dialCode: "+236",
1405
+ passportRegex: "^[A-Z0-9]{6,10}$"
1406
+ },
1407
+ { code: "TD", name: "Chad", dialCode: "+235", passportRegex: "^[A-Z0-9]{6,10}$" },
1408
+ { code: "CL", name: "Chile", dialCode: "+56", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1409
+ { code: "CN", name: "China", dialCode: "+86", passportRegex: "^[0-9]{9}$" },
1410
+ { code: "CO", name: "Colombia", dialCode: "+57", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1411
+ { code: "KM", name: "Comoros", dialCode: "+269", passportRegex: "^[A-Z0-9]{6,10}$" },
1412
+ { code: "CG", name: "Congo", dialCode: "+242", passportRegex: "^[A-Z0-9]{6,10}$" },
1413
+ { code: "CR", name: "Costa Rica", dialCode: "+506", passportRegex: "^[A-Z0-9]{6,10}$" },
1414
+ { code: "HR", name: "Croatia", dialCode: "+385", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1415
+ { code: "CU", name: "Cuba", dialCode: "+53", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1416
+ { code: "CY", name: "Cyprus", dialCode: "+357", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1417
+ { code: "CZ", name: "Czech Republic", dialCode: "+420", passportRegex: "^[0-9]{8}$" },
1418
+ { code: "DK", name: "Denmark", dialCode: "+45", passportRegex: "^[A-Z0-9]{9}$" },
1419
+ { code: "DJ", name: "Djibouti", dialCode: "+253", passportRegex: "^[A-Z0-9]{6,10}$" },
1420
+ { code: "DM", name: "Dominica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1421
+ { code: "DO", name: "Dominican Republic", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1422
+ { code: "EC", name: "Ecuador", dialCode: "+593", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1423
+ { code: "EG", name: "Egypt", dialCode: "+20", passportRegex: "^[A-Z][0-9]{7}$" },
1424
+ { code: "SV", name: "El Salvador", dialCode: "+503", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1425
+ { code: "GQ", name: "Equatorial Guinea", dialCode: "+240", passportRegex: "^[A-Z0-9]{6,10}$" },
1426
+ { code: "ER", name: "Eritrea", dialCode: "+291", passportRegex: "^[A-Z0-9]{6,10}$" },
1427
+ { code: "EE", name: "Estonia", dialCode: "+372", passportRegex: "^[A-Z0-9]{8}$" },
1428
+ { code: "SZ", name: "Eswatini", dialCode: "+268", passportRegex: "^[A-Z0-9]{6,10}$" },
1429
+ { code: "ET", name: "Ethiopia", dialCode: "+251", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1430
+ { code: "FJ", name: "Fiji", dialCode: "+679", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1431
+ { code: "FI", name: "Finland", dialCode: "+358", passportRegex: "^[A-Z0-9]{9}$" },
1432
+ { code: "FR", name: "France", dialCode: "+33", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1433
+ { code: "GA", name: "Gabon", dialCode: "+241", passportRegex: "^[A-Z0-9]{6,10}$" },
1434
+ { code: "GM", name: "Gambia", dialCode: "+220", passportRegex: "^[A-Z0-9]{6,10}$" },
1435
+ { code: "GE", name: "Georgia", dialCode: "+995", passportRegex: "^[A-Z0-9]{8}$" },
1436
+ { code: "DE", name: "Germany", dialCode: "+49", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1437
+ { code: "GH", name: "Ghana", dialCode: "+233", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1438
+ { code: "GR", name: "Greece", dialCode: "+30", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1439
+ { code: "GD", name: "Grenada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1440
+ { code: "GT", name: "Guatemala", dialCode: "+502", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1441
+ { code: "GN", name: "Guinea", dialCode: "+224", passportRegex: "^[A-Z0-9]{6,10}$" },
1442
+ { code: "GW", name: "Guinea-Bissau", dialCode: "+245", passportRegex: "^[A-Z0-9]{6,10}$" },
1443
+ { code: "GY", name: "Guyana", dialCode: "+592", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1444
+ { code: "HT", name: "Haiti", dialCode: "+509", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1445
+ { code: "HN", name: "Honduras", dialCode: "+504", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1446
+ { code: "HK", name: "Hong Kong", dialCode: "+852", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1447
+ { code: "HU", name: "Hungary", dialCode: "+36", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1448
+ { code: "IS", name: "Iceland", dialCode: "+354", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1449
+ { code: "IN", name: "India", dialCode: "+91", passportRegex: "^[A-Z][0-9]{7}$" },
1450
+ { code: "ID", name: "Indonesia", dialCode: "+62", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1451
+ { code: "IR", name: "Iran", dialCode: "+98", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1452
+ { code: "IQ", name: "Iraq", dialCode: "+964", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1453
+ { code: "IE", name: "Ireland", dialCode: "+353", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
1454
+ { code: "IL", name: "Israel", dialCode: "+972", passportRegex: "^[0-9]{8,9}$" },
1455
+ { code: "IT", name: "Italy", dialCode: "+39", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1456
+ { code: "JM", name: "Jamaica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1457
+ { code: "JP", name: "Japan", dialCode: "+81", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1458
+ { code: "JO", name: "Jordan", dialCode: "+962", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1459
+ { code: "KZ", name: "Kazakhstan", dialCode: "+7", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1460
+ { code: "KE", name: "Kenya", dialCode: "+254", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1461
+ { code: "KI", name: "Kiribati", dialCode: "+686", passportRegex: "^[A-Z0-9]{6,10}$" },
1462
+ { code: "KP", name: "North Korea", dialCode: "+850", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1463
+ { code: "KR", name: "South Korea", dialCode: "+82", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
1464
+ { code: "KW", name: "Kuwait", dialCode: "+965", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1465
+ { code: "KG", name: "Kyrgyzstan", dialCode: "+996", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1466
+ { code: "LA", name: "Laos", dialCode: "+856", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1467
+ { code: "LV", name: "Latvia", dialCode: "+371", passportRegex: "^[A-Z0-9]{8}$" },
1468
+ { code: "LB", name: "Lebanon", dialCode: "+961", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1469
+ { code: "LS", name: "Lesotho", dialCode: "+266", passportRegex: "^[A-Z0-9]{6,10}$" },
1470
+ { code: "LR", name: "Liberia", dialCode: "+231", passportRegex: "^[A-Z0-9]{6,10}$" },
1471
+ { code: "LY", name: "Libya", dialCode: "+218", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1472
+ { code: "LI", name: "Liechtenstein", dialCode: "+423", passportRegex: "^[A-Z0-9]{6,10}$" },
1473
+ { code: "LT", name: "Lithuania", dialCode: "+370", passportRegex: "^[A-Z0-9]{8}$" },
1474
+ { code: "LU", name: "Luxembourg", dialCode: "+352", passportRegex: "^[A-Z0-9]{8}$" },
1475
+ { code: "MO", name: "Macau", dialCode: "+853", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1476
+ { code: "MG", name: "Madagascar", dialCode: "+261", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1477
+ { code: "MW", name: "Malawi", dialCode: "+265", passportRegex: "^[A-Z0-9]{6,10}$" },
1478
+ { code: "MY", name: "Malaysia", dialCode: "+60", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
1479
+ { code: "MV", name: "Maldives", dialCode: "+960", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1480
+ { code: "ML", name: "Mali", dialCode: "+223", passportRegex: "^[A-Z0-9]{6,10}$" },
1481
+ { code: "MT", name: "Malta", dialCode: "+356", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1482
+ { code: "MH", name: "Marshall Islands", dialCode: "+692", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1483
+ { code: "MQ", name: "Martinique", dialCode: "+596", passportRegex: "^[A-Z0-9]{6,10}$" },
1484
+ { code: "MR", name: "Mauritania", dialCode: "+222", passportRegex: "^[A-Z0-9]{6,10}$" },
1485
+ { code: "MU", name: "Mauritius", dialCode: "+230", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1486
+ { code: "MX", name: "Mexico", dialCode: "+52", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
1487
+ { code: "FM", name: "Micronesia", dialCode: "+691", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1488
+ { code: "MD", name: "Moldova", dialCode: "+373", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1489
+ { code: "MC", name: "Monaco", dialCode: "+377", passportRegex: "^[A-Z0-9]{6,10}$" },
1490
+ { code: "MN", name: "Mongolia", dialCode: "+976", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1491
+ { code: "ME", name: "Montenegro", dialCode: "+382", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1492
+ { code: "MS", name: "Montserrat", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
1493
+ { code: "MA", name: "Morocco", dialCode: "+212", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1494
+ { code: "MZ", name: "Mozambique", dialCode: "+258", passportRegex: "^[A-Z0-9]{6,10}$" },
1495
+ { code: "MM", name: "Myanmar", dialCode: "+95", passportRegex: "^[A-Z]{1}[0-9]{6,7}$" },
1496
+ { code: "NA", name: "Namibia", dialCode: "+264", passportRegex: "^[A-Z0-9]{6,10}$" },
1497
+ { code: "NR", name: "Nauru", dialCode: "+674", passportRegex: "^[A-Z0-9]{6,10}$" },
1498
+ { code: "NP", name: "Nepal", dialCode: "+977", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1499
+ { code: "NL", name: "Netherlands", dialCode: "+31", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1500
+ { code: "NC", name: "New Caledonia", dialCode: "+687", passportRegex: "^[A-Z0-9]{6,10}$" },
1501
+ { code: "NZ", name: "New Zealand", dialCode: "+64", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1502
+ { code: "NI", name: "Nicaragua", dialCode: "+505", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1503
+ { code: "NE", name: "Niger", dialCode: "+227", passportRegex: "^[A-Z0-9]{6,10}$" },
1504
+ { code: "NG", name: "Nigeria", dialCode: "+234", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1505
+ { code: "NO", name: "Norway", dialCode: "+47", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1506
+ { code: "OM", name: "Oman", dialCode: "+968", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1507
+ { code: "PK", name: "Pakistan", dialCode: "+92", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1508
+ { code: "PW", name: "Palau", dialCode: "+680", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1509
+ { code: "PS", name: "Palestine", dialCode: "+970", passportRegex: "^[A-Z0-9]{6,10}$" },
1510
+ { code: "PA", name: "Panama", dialCode: "+507", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1511
+ { code: "PG", name: "Papua New Guinea", dialCode: "+675", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1512
+ { code: "PY", name: "Paraguay", dialCode: "+595", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1513
+ { code: "PE", name: "Peru", dialCode: "+51", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1514
+ { code: "PH", name: "Philippines", dialCode: "+63", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1515
+ { code: "PL", name: "Poland", dialCode: "+48", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
1516
+ { code: "PT", name: "Portugal", dialCode: "+351", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1517
+ { code: "RO", name: "Romania", dialCode: "+40", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1518
+ { code: "RU", name: "Russia", dialCode: "+7", passportRegex: "^[0-9]{9}$" },
1519
+ { code: "RW", name: "Rwanda", dialCode: "+250", passportRegex: "^[A-Z0-9]{6,10}$" },
1520
+ {
1521
+ code: "KN",
1522
+ name: "Saint Kitts and Nevis",
1523
+ dialCode: "+1",
1524
+ passportRegex: "^[A-Z]{2}[0-9]{7}$"
1525
+ },
1526
+ { code: "LC", name: "Saint Lucia", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1527
+ {
1528
+ code: "VC",
1529
+ name: "Saint Vincent and the Grenadines",
1530
+ dialCode: "+1",
1531
+ passportRegex: "^[A-Z]{2}[0-9]{7}$"
1532
+ },
1533
+ { code: "WS", name: "Samoa", dialCode: "+685", passportRegex: "^[A-Z0-9]{6,10}$" },
1534
+ { code: "SM", name: "San Marino", dialCode: "+378", passportRegex: "^[A-Z0-9]{6,10}$" },
1535
+ {
1536
+ code: "ST",
1537
+ name: "Sao Tome and Principe",
1538
+ dialCode: "+239",
1539
+ passportRegex: "^[A-Z0-9]{6,10}$"
1540
+ },
1541
+ { code: "SA", name: "Saudi Arabia", dialCode: "+966", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1542
+ { code: "SN", name: "Senegal", dialCode: "+221", passportRegex: "^[A-Z0-9]{6,10}$" },
1543
+ { code: "RS", name: "Serbia", dialCode: "+381", passportRegex: "^[A-Z0-9]{9}$" },
1544
+ { code: "SC", name: "Seychelles", dialCode: "+248", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1545
+ { code: "SL", name: "Sierra Leone", dialCode: "+232", passportRegex: "^[A-Z0-9]{6,10}$" },
1546
+ { code: "SG", name: "Singapore", dialCode: "+65", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1547
+ { code: "SK", name: "Slovakia", dialCode: "+421", passportRegex: "^[0-9]{9}$" },
1548
+ { code: "SI", name: "Slovenia", dialCode: "+386", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1549
+ { code: "SB", name: "Solomon Islands", dialCode: "+677", passportRegex: "^[A-Z0-9]{6,10}$" },
1550
+ { code: "SO", name: "Somalia", dialCode: "+252", passportRegex: "^[A-Z0-9]{6,10}$" },
1551
+ { code: "ZA", name: "South Africa", dialCode: "+27", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1552
+ { code: "ES", name: "Spain", dialCode: "+34", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1553
+ { code: "LK", name: "Sri Lanka", dialCode: "+94", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1554
+ { code: "SD", name: "Sudan", dialCode: "+249", passportRegex: "^[A-Z0-9]{6,10}$" },
1555
+ { code: "SR", name: "Suriname", dialCode: "+597", passportRegex: "^[A-Z0-9]{6,10}$" },
1556
+ { code: "SE", name: "Sweden", dialCode: "+46", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1557
+ { code: "CH", name: "Switzerland", dialCode: "+41", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1558
+ { code: "SY", name: "Syria", dialCode: "+963", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1559
+ { code: "TW", name: "Taiwan", dialCode: "+886", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
1560
+ { code: "TJ", name: "Tajikistan", dialCode: "+992", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1561
+ { code: "TZ", name: "Tanzania", dialCode: "+255", passportRegex: "^[A-Z0-9]{6,10}$" },
1562
+ { code: "TH", name: "Thailand", dialCode: "+66", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1563
+ { code: "TL", name: "Timor-Leste", dialCode: "+670", passportRegex: "^[A-Z0-9]{6,10}$" },
1564
+ { code: "TG", name: "Togo", dialCode: "+228", passportRegex: "^[A-Z0-9]{6,10}$" },
1565
+ { code: "TO", name: "Tonga", dialCode: "+676", passportRegex: "^[A-Z0-9]{6,10}$" },
1566
+ { code: "TT", name: "Trinidad and Tobago", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1567
+ { code: "TN", name: "Tunisia", dialCode: "+216", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1568
+ { code: "TR", name: "Turkey", dialCode: "+90", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1569
+ { code: "TM", name: "Turkmenistan", dialCode: "+993", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1570
+ {
1571
+ code: "TC",
1572
+ name: "Turks and Caicos Islands",
1573
+ dialCode: "+1",
1574
+ passportRegex: "^[A-Z0-9]{6,10}$"
1575
+ },
1576
+ { code: "TV", name: "Tuvalu", dialCode: "+688", passportRegex: "^[A-Z0-9]{6,10}$" },
1577
+ { code: "UG", name: "Uganda", dialCode: "+256", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1578
+ { code: "UA", name: "Ukraine", dialCode: "+380", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
1579
+ {
1580
+ code: "AE",
1581
+ name: "United Arab Emirates",
1582
+ dialCode: "+971",
1583
+ passportRegex: "^[A-Z]{1}[0-9]{7}$"
1584
+ },
1585
+ { code: "GB", name: "United Kingdom", dialCode: "+44", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1586
+ { code: "US", name: "United States", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
1587
+ { code: "UY", name: "Uruguay", dialCode: "+598", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
1588
+ { code: "UZ", name: "Uzbekistan", dialCode: "+998", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1589
+ { code: "VU", name: "Vanuatu", dialCode: "+678", passportRegex: "^[A-Z0-9]{6,10}$" },
1590
+ { code: "VA", name: "Vatican City", dialCode: "+379", passportRegex: "^[A-Z0-9]{6,10}$" },
1591
+ { code: "VE", name: "Venezuela", dialCode: "+58", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
1592
+ { code: "VN", name: "Vietnam", dialCode: "+84", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1593
+ { code: "YE", name: "Yemen", dialCode: "+967", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
1594
+ { code: "ZM", name: "Zambia", dialCode: "+260", passportRegex: "^[A-Z0-9]{6,10}$" },
1595
+ { code: "ZW", name: "Zimbabwe", dialCode: "+263", passportRegex: "^[A-Z0-9]{6,10}$" }
1596
+ ];
1597
+ var detectIdentityType = (value) => {
1598
+ if (!value) return "id";
1599
+ const stringValue = String(value);
1600
+ if (stringValue.includes("@")) return "email";
1601
+ if (stringValue.startsWith("+")) return "phone";
1602
+ return "id";
1603
+ };
1604
+ var detectEmailOrPhoneStrict = (value) => {
1605
+ if (!value) return "none";
1606
+ if (value.includes("@")) return "email";
1607
+ if (value.startsWith("+")) return "phone";
1608
+ if (/^0\d/.test(value)) return "phone";
1609
+ if (/^62\d/.test(value)) return "phone";
1610
+ return "none";
1611
+ };
1612
+ function InputDynamic({
1613
+ name,
1614
+ control,
1615
+ label,
1616
+ type,
1617
+ placeholder,
1618
+ required = false,
1619
+ disabled = false,
1620
+ options = [],
1621
+ multiple = false,
1622
+ accept,
1623
+ rows = 3,
1624
+ min,
1625
+ max,
1626
+ step,
1627
+ isMultiSelect = false,
1628
+ selectScrollbarColor,
1629
+ contentBefore,
1630
+ appearance = "outline",
1631
+ validationRules,
1632
+ helperText,
1633
+ className,
1634
+ layout,
1635
+ size,
1636
+ onClick,
1637
+ style,
1638
+ countryCodes = DEFAULT_COUNTRY_CODES,
1639
+ defaultCountry = "ID",
1640
+ maxLength,
1641
+ autoAdvance = false,
1642
+ otpIndex,
1643
+ hasError = false,
1644
+ autoComplete,
1645
+ onInput,
1646
+ contentAfter,
1647
+ onChange
1648
+ }) {
1649
+ const styles = useStyles7();
1650
+ const [showPassword, setShowPassword] = useState(false);
1651
+ const [isPhoneMode, setIsPhoneMode] = useState(false);
1652
+ const [emailOrPhoneType, setEmailOrPhoneType] = useState("none");
1653
+ const [identityType, setIdentityType] = useState("id");
1654
+ const [lastPhoneValue, setLastPhoneValue] = useState("");
1655
+ const [lastEmailOrPhoneValue, setLastEmailOrPhoneValue] = useState("");
1656
+ const inputRef = useRef(null);
1657
+ const phoneInputRef = useRef(null);
1658
+ const emailOrPhoneInputRef = useRef(null);
1659
+ const shouldFocusRef = useRef(false);
1660
+ const isBackspaceNavigationRef = useRef(false);
1661
+ const getSelectStyles = (hasError2) => ({
1662
+ menuPortal: (base) => ({
1663
+ ...base,
1664
+ zIndex: 9999999,
1665
+ borderRadius: tokens.borderRadiusMedium
1666
+ }),
1667
+ control: (provided, state) => ({
1668
+ ...provided,
1669
+ borderColor: hasError2 ? tokens.colorPaletteRedBorder2 : state.isFocused ? tokens.colorBrandStroke1 : tokens.colorNeutralStroke1,
1670
+ borderRadius: tokens.borderRadiusMedium,
1671
+ minHeight: "40px",
1672
+ fontSize: tokens.fontSizeBase400,
1673
+ backgroundColor: tokens.colorNeutralBackground1,
1674
+ boxShadow: state.isFocused ? `0 0 0 2px ${hasError2 ? tokens.colorPaletteRedBorder2 : tokens.colorBrandStroke1}` : "none",
1675
+ "&:hover": {
1676
+ borderColor: hasError2 ? tokens.colorPaletteRedBorder2 : tokens.colorNeutralStroke1Hover
1677
+ }
1678
+ }),
1679
+ menu: (provided) => ({
1680
+ ...provided,
1681
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
1682
+ borderRadius: tokens.borderRadiusMedium,
1683
+ zIndex: 9999
1684
+ }),
1685
+ menuList: (provided) => ({
1686
+ ...provided,
1687
+ padding: 0,
1688
+ // Opsional: bersihkan padding agar scrollbar mepet ke pinggir
1689
+ maxHeight: "300px",
1690
+ // Pastikan ada limit height agar scrollbar muncul
1691
+ /* Targetkan Webkit Scrollbar di menuList */
1692
+ "&::-webkit-scrollbar": {
1693
+ width: "8px",
1694
+ display: "block"
1695
+ // Pastikan tampil
1696
+ },
1697
+ "&::-webkit-scrollbar-track": {
1698
+ backgroundColor: tokens.colorNeutralBackground2,
1699
+ borderRadius: "4px"
1700
+ },
1701
+ "&::-webkit-scrollbar-thumb": {
1702
+ backgroundColor: selectScrollbarColor || tokens.colorNeutralStroke2,
1703
+ borderRadius: "4px"
1704
+ },
1705
+ "&::-webkit-scrollbar-thumb:hover": {
1706
+ backgroundColor: selectScrollbarColor || tokens.colorBrandBackground
1707
+ },
1708
+ "&::-webkit-scrollbar-thumb:active": {
1709
+ backgroundColor: selectScrollbarColor || tokens.colorBrandBackgroundPressed
1710
+ }
1711
+ }),
1712
+ option: (provided, state) => ({
1713
+ ...provided,
1714
+ fontSize: tokens.fontSizeBase300,
1715
+ color: state.isSelected ? tokens.colorNeutralForegroundOnBrand : tokens.colorNeutralForeground1,
1716
+ backgroundColor: state.isSelected ? tokens.colorBrandBackground : state.isFocused ? tokens.colorNeutralBackground1Hover : "transparent"
1717
+ }),
1718
+ placeholder: (provided) => ({
1719
+ ...provided,
1720
+ color: tokens.colorNeutralForeground3,
1721
+ fontSize: tokens.fontSizeBase400
1722
+ }),
1723
+ singleValue: (provided) => ({
1724
+ ...provided,
1725
+ color: tokens.colorNeutralForeground1,
1726
+ fontSize: tokens.fontSizeBase400
1727
+ })
1728
+ });
1729
+ useEffect(() => {
1730
+ if (shouldFocusRef.current) {
1731
+ setTimeout(() => {
1732
+ if (identityType === "phone" && phoneInputRef.current) {
1733
+ const phoneInput = phoneInputRef.current.querySelector("input.form-control");
1734
+ if (phoneInput) {
1735
+ phoneInput.focus();
1736
+ const len = phoneInput.value.length;
1737
+ phoneInput.setSelectionRange(len, len);
1738
+ }
1739
+ } else if (inputRef.current) {
1740
+ inputRef.current.focus();
1741
+ const inputType = inputRef.current.type;
1742
+ if (inputType === "text" || inputType === "tel" || inputType === "url" || inputType === "search") {
1743
+ const len = inputRef.current.value.length;
1744
+ inputRef.current.setSelectionRange(len, len);
1745
+ }
1746
+ }
1747
+ shouldFocusRef.current = false;
1748
+ }, 50);
1749
+ }
1750
+ }, [identityType]);
1751
+ useEffect(() => {
1752
+ if (shouldFocusRef.current && type === "emailOrPhone") {
1753
+ setTimeout(() => {
1754
+ if (emailOrPhoneType === "phone" && emailOrPhoneInputRef.current) {
1755
+ const phoneInput = emailOrPhoneInputRef.current.querySelector("input.form-control");
1756
+ if (phoneInput) {
1757
+ phoneInput.focus();
1758
+ const len = phoneInput.value.length;
1759
+ phoneInput.setSelectionRange(len, len);
1760
+ }
1761
+ } else if (inputRef.current) {
1762
+ inputRef.current.focus();
1763
+ const inputType = inputRef.current.type;
1764
+ if (inputType === "text" || inputType === "tel" || inputType === "url" || inputType === "search") {
1765
+ const len = inputRef.current.value.length;
1766
+ inputRef.current.setSelectionRange(len, len);
1767
+ }
1768
+ }
1769
+ shouldFocusRef.current = false;
1770
+ }, 50);
1771
+ }
1772
+ }, [emailOrPhoneType, type]);
1773
+ const updateIdentityType = (value) => {
1774
+ const stringValue = typeof value === "string" ? value : value?.phoneNumber || "";
1775
+ const detectedType = detectIdentityType(stringValue);
1776
+ if (detectedType !== identityType) {
1777
+ setIdentityType(detectedType);
1778
+ }
1779
+ };
1780
+ const updateEmailOrPhoneType = (value) => {
1781
+ const stringValue = typeof value === "string" ? value : "";
1782
+ const detectedType = detectEmailOrPhoneStrict(stringValue);
1783
+ if (detectedType !== emailOrPhoneType) {
1784
+ setEmailOrPhoneType(detectedType);
1785
+ }
1786
+ };
1787
+ const renderInput = (field, error) => {
1788
+ const shouldTransparentBorder = disabled && appearance !== "outline" && appearance !== "underline";
1789
+ const inputStyle = shouldTransparentBorder ? { ...style, border: "transparent" } : style;
1790
+ const handleInputChange = (e) => {
1791
+ field.onChange(e);
1792
+ if (onChange) {
1793
+ onChange(e.target?.value ?? e);
1794
+ }
1795
+ };
1796
+ const commonProps = {
1797
+ ...field,
1798
+ onChange: handleInputChange,
1799
+ value: field.value ?? "",
1800
+ placeholder,
1801
+ disabled,
1802
+ appearance: error ? "invalid" : appearance,
1803
+ size,
1804
+ contentBefore,
1805
+ onClick,
1806
+ style: inputStyle,
1807
+ maxLength,
1808
+ autoComplete: autoComplete || "off",
1809
+ contentAfter,
1810
+ max
1811
+ };
1812
+ const otpMatch = /^otp(\d+)$/.exec(String(name));
1813
+ const otpIndex2 = otpMatch ? parseInt(otpMatch[1], 10) : null;
1814
+ if (type === "emailOrPhone") {
1815
+ updateEmailOrPhoneType(field.value);
1816
+ const stringValue = typeof field.value === "string" ? field.value : "";
1817
+ let inputType = "text";
1818
+ let inputPlaceholder = placeholder || "Email atau Nomor HP";
1819
+ if (emailOrPhoneType === "email") {
1820
+ inputType = "email";
1821
+ inputPlaceholder = placeholder || "Email";
1822
+ } else if (emailOrPhoneType === "phone") {
1823
+ inputType = "tel";
1824
+ inputPlaceholder = placeholder || "Nomor HP";
1825
+ }
1826
+ const normalizePhoneNumber = (val) => {
1827
+ if (!val) return val;
1828
+ if (val.startsWith("08")) {
1829
+ return "+62" + val.substring(1);
1830
+ }
1831
+ if (val.startsWith("62") && !val.startsWith("+")) {
1832
+ return "+" + val;
1833
+ }
1834
+ return val;
1835
+ };
1836
+ const cleanPhoneValue = (val) => {
1837
+ if (!val) return val;
1838
+ const match = val.match(/^(\d{1,4})(0\d+)$/);
1839
+ if (match) {
1840
+ return match[1] + match[2].substring(1);
1841
+ }
1842
+ return val;
1843
+ };
1844
+ emailOrPhoneType === "phone" ? cleanPhoneValue(stringValue) : stringValue;
1845
+ return /* @__PURE__ */ jsx("div", { className: styles.phoneContainer, children: emailOrPhoneType === "phone" ? /* @__PURE__ */ jsx(
1846
+ "div",
1847
+ {
1848
+ ref: emailOrPhoneInputRef,
1849
+ className: `${styles.phoneInputWrapper} ${error ? styles.phoneInputError : ""}`,
1850
+ children: /* @__PURE__ */ jsx(
1851
+ PhoneInput,
1852
+ {
1853
+ country: defaultCountry.toLowerCase(),
1854
+ value: stringValue.startsWith("+") ? stringValue.substring(1) : stringValue,
1855
+ onChange: (value, data) => {
1856
+ if (!value) {
1857
+ shouldFocusRef.current = true;
1858
+ field.onChange("");
1859
+ updateEmailOrPhoneType("");
1860
+ setLastEmailOrPhoneValue("");
1861
+ return;
1862
+ }
1863
+ const countryDialCode = data?.dialCode || "";
1864
+ if (value === countryDialCode) {
1865
+ const dialCodeChanged = lastEmailOrPhoneValue && lastEmailOrPhoneValue !== countryDialCode && !lastEmailOrPhoneValue.startsWith(countryDialCode);
1866
+ const isInitial = !lastEmailOrPhoneValue;
1867
+ const wasFullNumber = lastEmailOrPhoneValue && lastEmailOrPhoneValue.length > 3;
1868
+ if (isInitial || dialCodeChanged || wasFullNumber) {
1869
+ const phoneValue2 = "+" + value;
1870
+ field.onChange(phoneValue2);
1871
+ updateEmailOrPhoneType(phoneValue2);
1872
+ setLastEmailOrPhoneValue(value);
1873
+ return;
1874
+ } else {
1875
+ shouldFocusRef.current = true;
1876
+ field.onChange("");
1877
+ updateEmailOrPhoneType("");
1878
+ setLastEmailOrPhoneValue("");
1879
+ return;
1880
+ }
1881
+ }
1882
+ const phoneValue = "+" + value;
1883
+ field.onChange(phoneValue);
1884
+ updateEmailOrPhoneType(phoneValue);
1885
+ setLastEmailOrPhoneValue(value);
1886
+ },
1887
+ placeholder: inputPlaceholder,
1888
+ disabled,
1889
+ enableSearch: true
1890
+ }
1891
+ )
1892
+ }
1893
+ ) : /* @__PURE__ */ jsx(
1894
+ Input,
1895
+ {
1896
+ ref: inputRef,
1897
+ value: stringValue,
1898
+ maxLength,
1899
+ autoComplete: autoComplete || "off",
1900
+ onChange: (e) => {
1901
+ const newValue = e.target.value;
1902
+ const willSwitchType = emailOrPhoneType !== detectEmailOrPhoneStrict(newValue);
1903
+ if (willSwitchType) shouldFocusRef.current = true;
1904
+ let normalizedValue = newValue;
1905
+ const detectedType = detectEmailOrPhoneStrict(newValue);
1906
+ if (detectedType === "phone") {
1907
+ normalizedValue = normalizePhoneNumber(newValue);
1908
+ }
1909
+ field.onChange(normalizedValue);
1910
+ updateEmailOrPhoneType(normalizedValue);
1911
+ },
1912
+ placeholder: inputPlaceholder,
1913
+ disabled,
1914
+ appearance,
1915
+ size,
1916
+ type: inputType,
1917
+ style: { width: "100%" }
1918
+ }
1919
+ ) });
1920
+ }
1921
+ if (type === "identity") {
1922
+ updateIdentityType(field.value);
1923
+ const stringValue = typeof field.value === "string" ? field.value : "";
1924
+ let inputType = "text";
1925
+ let inputPlaceholder = placeholder || "Email, KTP, SIM, Passport, atau Nomor Telepon";
1926
+ if (identityType === "email") {
1927
+ inputType = "email";
1928
+ inputPlaceholder = placeholder || "Email";
1929
+ } else if (identityType === "phone") {
1930
+ inputType = "tel";
1931
+ inputPlaceholder = placeholder || "Nomor telepon";
1932
+ } else if (identityType === "id") {
1933
+ inputType = "text";
1934
+ inputPlaceholder = placeholder || "KTP, SIM, atau Passport";
1935
+ }
1936
+ const cleanPhoneValue = (val) => {
1937
+ if (!val) return val;
1938
+ const stringVal = String(val);
1939
+ const match = stringVal.match(/^(\d{1,4})(0\d+)$/);
1940
+ if (match) {
1941
+ return match[1] + match[2].substring(1);
1942
+ }
1943
+ return stringVal;
1944
+ };
1945
+ identityType === "phone" ? cleanPhoneValue(stringValue) : stringValue;
1946
+ return /* @__PURE__ */ jsx("div", { className: styles.phoneContainer, children: identityType === "phone" ? /* @__PURE__ */ jsx(
1947
+ "div",
1948
+ {
1949
+ ref: phoneInputRef,
1950
+ className: `${styles.phoneInputWrapper} ${error ? styles.phoneInputError : ""}`,
1951
+ children: /* @__PURE__ */ jsx(
1952
+ PhoneInput,
1953
+ {
1954
+ country: defaultCountry.toLowerCase(),
1955
+ value: stringValue.startsWith("+") ? stringValue.substring(1) : stringValue,
1956
+ onChange: (value, data) => {
1957
+ if (!value) {
1958
+ shouldFocusRef.current = true;
1959
+ field.onChange("");
1960
+ updateIdentityType("");
1961
+ setLastPhoneValue("");
1962
+ return;
1963
+ }
1964
+ const countryDialCode = data?.dialCode || "";
1965
+ if (value === countryDialCode) {
1966
+ const dialCodeChanged = lastPhoneValue && lastPhoneValue !== countryDialCode && !lastPhoneValue.startsWith(countryDialCode);
1967
+ const isInitial = !lastPhoneValue;
1968
+ const wasFullNumber = lastPhoneValue && lastPhoneValue.length > 3;
1969
+ if (isInitial || dialCodeChanged || wasFullNumber) {
1970
+ const phoneValue2 = "+" + value;
1971
+ field.onChange(phoneValue2);
1972
+ updateIdentityType(phoneValue2);
1973
+ setLastPhoneValue(value);
1974
+ return;
1975
+ } else {
1976
+ shouldFocusRef.current = true;
1977
+ field.onChange("");
1978
+ updateIdentityType("");
1979
+ setLastPhoneValue("");
1980
+ return;
1981
+ }
1982
+ }
1983
+ const phoneValue = "+" + value;
1984
+ field.onChange(phoneValue);
1985
+ updateIdentityType(phoneValue);
1986
+ setLastPhoneValue(value);
1987
+ },
1988
+ placeholder: inputPlaceholder,
1989
+ disabled,
1990
+ enableSearch: true,
1991
+ disableSearchIcon: true
1992
+ }
1993
+ )
1994
+ }
1995
+ ) : /* @__PURE__ */ jsx(
1996
+ Input,
1997
+ {
1998
+ ref: inputRef,
1999
+ value: stringValue,
2000
+ maxLength,
2001
+ autoComplete: autoComplete || "off",
2002
+ onChange: (e) => {
2003
+ const newValue = e.target.value;
2004
+ const willSwitchType = identityType !== detectIdentityType(newValue);
2005
+ if (willSwitchType) shouldFocusRef.current = true;
2006
+ field.onChange(newValue);
2007
+ updateIdentityType(newValue);
2008
+ },
2009
+ placeholder: inputPlaceholder,
2010
+ disabled,
2011
+ appearance,
2012
+ size,
2013
+ type: inputType,
2014
+ style: { width: "100%" }
2015
+ }
2016
+ ) });
2017
+ }
2018
+ switch (type) {
2019
+ case "textarea":
2020
+ return /* @__PURE__ */ jsx(Textarea, { ...commonProps, rows, resize: "vertical" });
2021
+ case "select":
2022
+ return /* @__PURE__ */ jsx(
2023
+ Select,
2024
+ {
2025
+ ...field,
2026
+ name: `${String(name)}_${Math.random().toString(36).substring(7)}`,
2027
+ isDisabled: disabled,
2028
+ placeholder,
2029
+ options,
2030
+ styles: getSelectStyles(!!error),
2031
+ className: styles.reactSelect,
2032
+ classNamePrefix: "react-select",
2033
+ isMulti: isMultiSelect,
2034
+ inputProps: {
2035
+ autoComplete: "new-password",
2036
+ autoCorrect: "off",
2037
+ autoCapitalize: "off",
2038
+ spellCheck: "false"
2039
+ },
2040
+ value: isMultiSelect ? options.filter((option) => field.value?.includes(option.value)) : options.find((option) => option.value === field.value) || null,
2041
+ onChange: (selectedOption) => {
2042
+ if (isMultiSelect) {
2043
+ const values = selectedOption ? selectedOption.map((opt) => opt.value) : [];
2044
+ field.onChange(values);
2045
+ } else {
2046
+ field.onChange(selectedOption ? selectedOption.value : "");
2047
+ }
2048
+ },
2049
+ getOptionLabel: (option) => option.label,
2050
+ getOptionValue: (option) => option.value,
2051
+ isOptionDisabled: (option) => option.disabled || false
2052
+ }
2053
+ );
2054
+ case "phone": {
2055
+ const cleanPhoneValue = (val) => {
2056
+ if (!val) return val;
2057
+ const stringVal = String(val);
2058
+ const match = stringVal.match(/^(\d{1,4})(0\d+)$/);
2059
+ if (match) {
2060
+ return match[1] + match[2].substring(1);
2061
+ }
2062
+ return stringVal;
2063
+ };
2064
+ const cleanedFieldValue = cleanPhoneValue(field.value || "");
2065
+ return /* @__PURE__ */ jsx("div", { className: `${styles.phoneInputWrapper} ${error ? styles.phoneInputError : ""}`, children: /* @__PURE__ */ jsx(
2066
+ PhoneInput,
2067
+ {
2068
+ country: defaultCountry.toLowerCase(),
2069
+ value: cleanedFieldValue,
2070
+ onChange: (value, data) => {
2071
+ const cleanedValue = cleanPhoneValue(value || "");
2072
+ field.onChange(cleanedValue);
2073
+ },
2074
+ placeholder: placeholder || "Nomor telepon",
2075
+ disabled,
2076
+ enableSearch: true,
2077
+ disableSearchIcon: true
2078
+ }
2079
+ ) });
2080
+ }
2081
+ case "passport": {
2082
+ const passportValue = field.value || {
2083
+ countryCode: defaultCountry,
2084
+ phoneNumber: ""
2085
+ };
2086
+ const countryOptions = countryCodes.map((country) => ({
2087
+ value: country.code,
2088
+ label: country.name,
2089
+ code: country.code,
2090
+ passportRegex: country.passportRegex
2091
+ }));
2092
+ const formatOptionLabel = (option) => /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2093
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "18px" }, children: String.fromCodePoint(
2094
+ ...option.code.split("").map((char) => 127397 + char.charCodeAt(0))
2095
+ ) }),
2096
+ /* @__PURE__ */ jsx("span", { children: option.label })
2097
+ ] });
2098
+ const selectedCountry = countryOptions.find((opt) => opt.value === passportValue.countryCode);
2099
+ const isCountrySelected = !!selectedCountry;
2100
+ return /* @__PURE__ */ jsxs("div", { className: styles.phoneContainer, children: [
2101
+ /* @__PURE__ */ jsx("div", { className: styles.phoneCountrySelect, children: /* @__PURE__ */ jsx(
2102
+ Select,
2103
+ {
2104
+ value: selectedCountry || null,
2105
+ onChange: (selectedOption) => {
2106
+ field.onChange({
2107
+ ...passportValue,
2108
+ countryCode: selectedOption ? selectedOption.value : defaultCountry
2109
+ });
2110
+ },
2111
+ options: countryOptions,
2112
+ isDisabled: disabled,
2113
+ placeholder: "\xF0\u0178\x8F\xB3\xEF\xB8\x8F",
2114
+ styles: getSelectStyles(!!error),
2115
+ isSearchable: true,
2116
+ formatOptionLabel
2117
+ }
2118
+ ) }),
2119
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx(
2120
+ Input,
2121
+ {
2122
+ value: passportValue.phoneNumber,
2123
+ maxLength,
2124
+ autoComplete: autoComplete || "off",
2125
+ onChange: (e) => {
2126
+ field.onChange({
2127
+ ...passportValue,
2128
+ phoneNumber: e.target.value
2129
+ });
2130
+ },
2131
+ placeholder: placeholder || "Nomor paspor",
2132
+ disabled: disabled || !isCountrySelected,
2133
+ appearance,
2134
+ size,
2135
+ type: "text",
2136
+ style: { width: "100%" }
2137
+ }
2138
+ ) })
2139
+ ] });
2140
+ }
2141
+ case "file":
2142
+ return /* @__PURE__ */ jsx(
2143
+ "input",
2144
+ {
2145
+ ...field,
2146
+ type: "file",
2147
+ multiple,
2148
+ accept,
2149
+ disabled,
2150
+ className: styles.fileInput,
2151
+ value: void 0,
2152
+ onChange: (e) => {
2153
+ const files = e.target.files;
2154
+ field.onChange(multiple ? files : files?.[0]);
2155
+ }
2156
+ }
2157
+ );
2158
+ case "switch":
2159
+ return /* @__PURE__ */ jsx("div", { className: styles.switchWrapper, children: /* @__PURE__ */ jsx(
2160
+ Switch,
2161
+ {
2162
+ ...field,
2163
+ checked: field.value || false,
2164
+ disabled,
2165
+ onChange: (_, data) => field.onChange(data.checked)
2166
+ }
2167
+ ) });
2168
+ case "date":
2169
+ return /* @__PURE__ */ jsx(DatePickerInput_default, { ...commonProps, field });
2170
+ case "radio":
2171
+ return /* @__PURE__ */ jsx(RadioGroup, { ...field, disabled, layout: layout ?? "vertical", children: options.map((option) => /* @__PURE__ */ jsx(
2172
+ Radio,
2173
+ {
2174
+ value: option.value,
2175
+ label: option.label,
2176
+ disabled: option.disabled
2177
+ },
2178
+ option.value
2179
+ )) });
2180
+ case "radiobutton":
2181
+ return /* @__PURE__ */ jsx(
2182
+ RadioGroup,
2183
+ {
2184
+ ...field,
2185
+ disabled,
2186
+ layout: layout ?? "horizontal",
2187
+ className: styles.classRadioGroup,
2188
+ children: options.map((option) => /* @__PURE__ */ jsx(
2189
+ Radio,
2190
+ {
2191
+ value: option.value,
2192
+ label: option.label,
2193
+ disabled: option.disabled,
2194
+ className: styles.classRadio
2195
+ },
2196
+ option.value
2197
+ ))
2198
+ }
2199
+ );
2200
+ case "checkbox":
2201
+ return /* @__PURE__ */ jsx(
2202
+ Checkbox,
2203
+ {
2204
+ ...field,
2205
+ checked: field.value || false,
2206
+ disabled,
2207
+ onChange: (_, data) => field.onChange(data.checked),
2208
+ label
2209
+ }
2210
+ );
2211
+ case "number":
2212
+ return /* @__PURE__ */ jsx(
2213
+ Input,
2214
+ {
2215
+ ...commonProps,
2216
+ type: "number",
2217
+ min,
2218
+ max,
2219
+ step,
2220
+ className: styles.inputWithAutocomplete
2221
+ }
2222
+ );
2223
+ case "time":
2224
+ case "datetime-local":
2225
+ return /* @__PURE__ */ jsx(
2226
+ Input,
2227
+ {
2228
+ ...commonProps,
2229
+ type,
2230
+ min,
2231
+ max,
2232
+ className: styles.inputWithAutocomplete
2233
+ }
2234
+ );
2235
+ case "password":
2236
+ return /* @__PURE__ */ jsx(
2237
+ Input,
2238
+ {
2239
+ ...commonProps,
2240
+ type: showPassword ? "text" : "password",
2241
+ className: styles.inputWithAutocomplete,
2242
+ contentAfter: /* @__PURE__ */ jsx(
2243
+ Button,
2244
+ {
2245
+ appearance: "transparent",
2246
+ icon: showPassword ? /* @__PURE__ */ jsx(Icon, { icon: "fluent:eye-off-24-filled" }) : /* @__PURE__ */ jsx(Icon, { icon: "fluent:eye-24-filled" }),
2247
+ "aria-label": showPassword ? "Hide password" : "Show password",
2248
+ onClick: () => setShowPassword(!showPassword),
2249
+ tabIndex: -1,
2250
+ type: "button"
2251
+ }
2252
+ )
2253
+ }
2254
+ );
2255
+ case "otp": {
2256
+ const setRefs = (el) => {
2257
+ try {
2258
+ if (field.ref) {
2259
+ if (typeof field.ref === "function") field.ref(el);
2260
+ else field.ref.current = el;
2261
+ }
2262
+ } catch {
2263
+ }
2264
+ inputRef.current = el;
2265
+ };
2266
+ const handleChange = (e) => {
2267
+ const val = e?.target?.value ?? "";
2268
+ const numericValue = val.replace(/\D/g, "");
2269
+ if (inputRef.current) {
2270
+ inputRef.current.value = numericValue;
2271
+ }
2272
+ const numericEvent = {
2273
+ ...e,
2274
+ target: {
2275
+ ...e.target,
2276
+ value: numericValue
2277
+ }
2278
+ };
2279
+ field.onChange(numericEvent);
2280
+ if (autoAdvance && otpIndex2 && maxLength && numericValue.length >= maxLength) {
2281
+ const next = document.querySelector(
2282
+ `[data-otp-index="${otpIndex2 + 1}"]`
2283
+ );
2284
+ if (next) next.focus();
2285
+ }
2286
+ };
2287
+ const handleKeyPress = (e) => {
2288
+ const char = e.key;
2289
+ if (!/^\d$/.test(char) && char !== "Backspace" && char !== "Delete" && char !== "Tab" && char !== "ArrowLeft" && char !== "ArrowRight") {
2290
+ e.preventDefault();
2291
+ }
2292
+ };
2293
+ const handleKeyDown = (e) => {
2294
+ if (e.key === "Backspace") {
2295
+ const curVal = field.value || "";
2296
+ if (!curVal && otpIndex2 !== null && otpIndex2 !== void 0) {
2297
+ const prevIndex = otpIndex2 - 1;
2298
+ if (prevIndex >= 1) {
2299
+ isBackspaceNavigationRef.current = true;
2300
+ const prev = document.querySelector(
2301
+ `[data-otp-index="${prevIndex}"]`
2302
+ );
2303
+ if (prev) {
2304
+ prev.focus();
2305
+ }
2306
+ }
2307
+ }
2308
+ }
2309
+ };
2310
+ const handleClick = (e) => {
2311
+ if (otpIndex2) {
2312
+ let lastFilledIndex = 0;
2313
+ for (let i = 1; i <= 6; i++) {
2314
+ const input = document.querySelector(`[data-otp-index="${i}"]`);
2315
+ if (input && input.value) {
2316
+ lastFilledIndex = i;
2317
+ } else {
2318
+ break;
2319
+ }
2320
+ }
2321
+ const targetIndex = lastFilledIndex === 6 ? 6 : lastFilledIndex + 1;
2322
+ if (otpIndex2 < targetIndex) {
2323
+ e.preventDefault();
2324
+ const targetInput = document.querySelector(
2325
+ `[data-otp-index="${targetIndex}"]`
2326
+ );
2327
+ if (targetInput) {
2328
+ targetInput.focus();
2329
+ const length = targetInput.value?.length || 0;
2330
+ setTimeout(() => {
2331
+ targetInput.setSelectionRange(length, length);
2332
+ }, 0);
2333
+ }
2334
+ return;
2335
+ }
2336
+ }
2337
+ if (inputRef.current) {
2338
+ const length = inputRef.current.value?.length || 0;
2339
+ setTimeout(() => {
2340
+ inputRef.current?.setSelectionRange(length, length);
2341
+ }, 0);
2342
+ }
2343
+ };
2344
+ const handleMouseDown = (e) => {
2345
+ isBackspaceNavigationRef.current = false;
2346
+ if (field.value) {
2347
+ e.preventDefault();
2348
+ if (inputRef.current) {
2349
+ inputRef.current.focus();
2350
+ const length = inputRef.current.value.length;
2351
+ inputRef.current.setSelectionRange(length, length);
2352
+ }
2353
+ }
2354
+ };
2355
+ const handleSelect = (e) => {
2356
+ if (inputRef.current && field.value) {
2357
+ const length = inputRef.current.value.length;
2358
+ inputRef.current.setSelectionRange(length, length);
2359
+ }
2360
+ };
2361
+ const handleFocus = (e) => {
2362
+ };
2363
+ const inputAttrs = {};
2364
+ if (otpIndex2) inputAttrs["data-otp-index"] = otpIndex2;
2365
+ const otpStyles = {
2366
+ height: "57px",
2367
+ borderRadius: tokens.borderRadiusXLarge,
2368
+ textAlign: "center",
2369
+ ...typographyStyles.title2,
2370
+ fontWeight: fontWeight.Medium,
2371
+ lineHeight: tokens.lineHeightHero800,
2372
+ borderColor: hasError ? sharedColors.Shared_Cranberry_Primary : void 0,
2373
+ ...style
2374
+ // Allow override from props
2375
+ };
2376
+ return /* @__PURE__ */ jsx(
2377
+ Input,
2378
+ {
2379
+ ...commonProps,
2380
+ type: "tel",
2381
+ onChange: handleChange,
2382
+ onKeyDown: handleKeyDown,
2383
+ onKeyPress: handleKeyPress,
2384
+ onClick: handleClick,
2385
+ onMouseDown: handleMouseDown,
2386
+ onSelect: handleSelect,
2387
+ onFocus: handleFocus,
2388
+ ref: setRefs,
2389
+ style: otpStyles,
2390
+ className: styles.otpInput,
2391
+ ...inputAttrs
2392
+ }
2393
+ );
2394
+ }
2395
+ default:
2396
+ return /* @__PURE__ */ jsx(
2397
+ Input,
2398
+ {
2399
+ ...commonProps,
2400
+ type,
2401
+ onInput,
2402
+ className: styles.inputWithAutocomplete
2403
+ }
2404
+ );
2405
+ }
2406
+ };
2407
+ const getValidationRules = () => {
2408
+ const rules = {};
2409
+ if (required) {
2410
+ rules.required = validationRules?.required || "Field ini wajib diisi";
2411
+ }
2412
+ if (validationRules?.minLength) {
2413
+ rules.minLength = validationRules.minLength;
2414
+ }
2415
+ if (validationRules?.maxLength) {
2416
+ rules.maxLength = validationRules.maxLength;
2417
+ }
2418
+ if (validationRules?.pattern) {
2419
+ rules.pattern = validationRules.pattern;
2420
+ }
2421
+ if (validationRules?.min) {
2422
+ rules.min = validationRules.min;
2423
+ }
2424
+ if (validationRules?.max) {
2425
+ rules.max = validationRules.max;
2426
+ }
2427
+ if (validationRules?.validate) {
2428
+ rules.validate = validationRules.validate;
2429
+ }
2430
+ if (type === "email") {
2431
+ rules.pattern = {
2432
+ value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
2433
+ message: "Email tidak valid"
2434
+ };
2435
+ }
2436
+ if (type === "emailOrPhone") {
2437
+ rules.validate = (value) => {
2438
+ if (required && !value) {
2439
+ return "Email atau nomor HP wajib diisi";
2440
+ }
2441
+ const stringValue = typeof value === "string" ? value : "";
2442
+ if (!stringValue) return true;
2443
+ const detectedType = detectEmailOrPhoneStrict(stringValue);
2444
+ if (detectedType === "email") {
2445
+ if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(stringValue)) {
2446
+ return "Format email tidak valid";
2447
+ }
2448
+ } else if (detectedType === "phone") {
2449
+ if (!stringValue.startsWith("+")) {
2450
+ return "Nomor HP harus dalam format internasional (contoh: +628123456789)";
2451
+ }
2452
+ const phoneDigits = stringValue.substring(1);
2453
+ if (!/^\d+$/.test(phoneDigits)) {
2454
+ return "Nomor HP hanya boleh berisi angka setelah +";
2455
+ }
2456
+ if (phoneDigits.length < 10) {
2457
+ return "Nomor HP minimal 10 digit";
2458
+ }
2459
+ } else {
2460
+ return "Masukkan email atau nomor HP yang valid";
2461
+ }
2462
+ return true;
2463
+ };
2464
+ }
2465
+ if (type === "identity") {
2466
+ rules.validate = (value) => {
2467
+ if (required && !value) {
2468
+ return "Field ini wajib diisi";
2469
+ }
2470
+ const stringValue = typeof value === "string" ? value : value?.phoneNumber || "";
2471
+ if (!stringValue) return true;
2472
+ const detectedType = detectIdentityType(stringValue);
2473
+ if (detectedType === "email") {
2474
+ if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(stringValue)) {
2475
+ return "Format email tidak valid";
2476
+ }
2477
+ } else if (detectedType === "phone") {
2478
+ if (!stringValue.startsWith("+")) {
2479
+ return "Nomor telepon harus diawali dengan +";
2480
+ }
2481
+ const phoneDigits = stringValue.substring(1);
2482
+ if (!/^\d+$/.test(phoneDigits)) {
2483
+ return "Nomor telepon hanya boleh berisi angka setelah +";
2484
+ }
2485
+ }
2486
+ return true;
2487
+ };
2488
+ }
2489
+ if (type === "phone") {
2490
+ rules.validate = (value) => {
2491
+ if (required && !value) {
2492
+ return "Nomor telepon wajib diisi";
2493
+ }
2494
+ return true;
2495
+ };
2496
+ }
2497
+ if (type === "passport") {
2498
+ rules.validate = (value) => {
2499
+ if (required && !value?.phoneNumber) {
2500
+ return "Nomor paspor wajib diisi";
2501
+ }
2502
+ if (value?.phoneNumber) {
2503
+ const selectedCountry = countryCodes.find((c) => c.code === value.countryCode);
2504
+ if (selectedCountry?.passportRegex) {
2505
+ const passportRegex = new RegExp(selectedCountry.passportRegex);
2506
+ if (!passportRegex.test(value.phoneNumber)) {
2507
+ return `Format paspor ${selectedCountry.name} tidak valid`;
2508
+ }
2509
+ }
2510
+ }
2511
+ return true;
2512
+ };
2513
+ }
2514
+ return rules;
2515
+ };
2516
+ return /* @__PURE__ */ jsx(
2517
+ Controller,
2518
+ {
2519
+ name,
2520
+ control,
2521
+ rules: getValidationRules(),
2522
+ render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsxs(
2523
+ Field,
2524
+ {
2525
+ className: `${styles.field} ${className || ""}`,
2526
+ validationMessage: error?.message,
2527
+ validationState: error ? "error" : "none",
2528
+ children: [
2529
+ label && type !== "checkbox" && /* @__PURE__ */ jsx(Label, { required, children: label }),
2530
+ renderInput(field, error?.message),
2531
+ helperText && !error && /* @__PURE__ */ jsx(Text, { size: 200, style: { textAlign: "left" }, className: styles.helperText, children: helperText })
2532
+ ]
2533
+ }
2534
+ )
2535
+ }
2536
+ );
2537
+ }
2538
+ var InputDynamic_default = InputDynamic;
2539
+
2540
+ // src/components/InputDynamic/constants.ts
2541
+ var DEFAULT_COUNTRY_CODES2 = [
2542
+ { code: "AF", name: "Afghanistan", dialCode: "+93", passportRegex: "^[A-Z][0-9]{7}$" },
2543
+ { code: "AL", name: "Albania", dialCode: "+355", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2544
+ { code: "DZ", name: "Algeria", dialCode: "+213", passportRegex: "^[0-9]{9}$" },
2545
+ { code: "AS", name: "American Samoa", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
2546
+ { code: "AD", name: "Andorra", dialCode: "+376", passportRegex: "^[A-Z0-9]{6,10}$" },
2547
+ { code: "AO", name: "Angola", dialCode: "+244", passportRegex: "^[A-Z0-9]{6,10}$" },
2548
+ { code: "AI", name: "Anguilla", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2549
+ { code: "AQ", name: "Antarctica", dialCode: "+672", passportRegex: "^[A-Z0-9]{6,10}$" },
2550
+ { code: "AG", name: "Antigua and Barbuda", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2551
+ { code: "AR", name: "Argentina", dialCode: "+54", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2552
+ { code: "AM", name: "Armenia", dialCode: "+374", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2553
+ { code: "AW", name: "Aruba", dialCode: "+297", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2554
+ { code: "AU", name: "Australia", dialCode: "+61", passportRegex: "^[A-Z][0-9]{7}$" },
2555
+ { code: "AT", name: "Austria", dialCode: "+43", passportRegex: "^[A-Z0-9]{8}$" },
2556
+ { code: "AZ", name: "Azerbaijan", dialCode: "+994", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2557
+ { code: "BS", name: "Bahamas", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2558
+ { code: "BH", name: "Bahrain", dialCode: "+973", passportRegex: "^[A-Z][0-9]{7}$" },
2559
+ { code: "BD", name: "Bangladesh", dialCode: "+880", passportRegex: "^[A-Z][0-9]{7}$" },
2560
+ { code: "BB", name: "Barbados", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2561
+ { code: "BY", name: "Belarus", dialCode: "+375", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2562
+ { code: "BE", name: "Belgium", dialCode: "+32", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2563
+ { code: "BZ", name: "Belize", dialCode: "+501", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2564
+ { code: "BJ", name: "Benin", dialCode: "+229", passportRegex: "^[A-Z0-9]{6,10}$" },
2565
+ { code: "BM", name: "Bermuda", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2566
+ { code: "BT", name: "Bhutan", dialCode: "+975", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2567
+ { code: "BO", name: "Bolivia", dialCode: "+591", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2568
+ {
2569
+ code: "BA",
2570
+ name: "Bosnia and Herzegovina",
2571
+ dialCode: "+387",
2572
+ passportRegex: "^[A-Z]{2}[0-9]{6}$"
2573
+ },
2574
+ { code: "BW", name: "Botswana", dialCode: "+267", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2575
+ { code: "BR", name: "Brazil", dialCode: "+55", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2576
+ { code: "BN", name: "Brunei", dialCode: "+673", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2577
+ { code: "BG", name: "Bulgaria", dialCode: "+359", passportRegex: "^[0-9]{9}$" },
2578
+ { code: "BF", name: "Burkina Faso", dialCode: "+226", passportRegex: "^[A-Z0-9]{6,10}$" },
2579
+ { code: "BI", name: "Burundi", dialCode: "+257", passportRegex: "^[A-Z0-9]{6,10}$" },
2580
+ { code: "KH", name: "Cambodia", dialCode: "+855", passportRegex: "^[A-Z][0-9]{7}$" },
2581
+ { code: "CM", name: "Cameroon", dialCode: "+237", passportRegex: "^[A-Z0-9]{6,10}$" },
2582
+ { code: "CA", name: "Canada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2583
+ { code: "CV", name: "Cape Verde", dialCode: "+238", passportRegex: "^[A-Z0-9]{6,10}$" },
2584
+ { code: "KY", name: "Cayman Islands", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2585
+ {
2586
+ code: "CF",
2587
+ name: "Central African Republic",
2588
+ dialCode: "+236",
2589
+ passportRegex: "^[A-Z0-9]{6,10}$"
2590
+ },
2591
+ { code: "TD", name: "Chad", dialCode: "+235", passportRegex: "^[A-Z0-9]{6,10}$" },
2592
+ { code: "CL", name: "Chile", dialCode: "+56", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2593
+ { code: "CN", name: "China", dialCode: "+86", passportRegex: "^[0-9]{9}$" },
2594
+ { code: "CO", name: "Colombia", dialCode: "+57", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2595
+ { code: "KM", name: "Comoros", dialCode: "+269", passportRegex: "^[A-Z0-9]{6,10}$" },
2596
+ { code: "CG", name: "Congo", dialCode: "+242", passportRegex: "^[A-Z0-9]{6,10}$" },
2597
+ { code: "CR", name: "Costa Rica", dialCode: "+506", passportRegex: "^[A-Z0-9]{6,10}$" },
2598
+ { code: "HR", name: "Croatia", dialCode: "+385", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2599
+ { code: "CU", name: "Cuba", dialCode: "+53", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2600
+ { code: "CY", name: "Cyprus", dialCode: "+357", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2601
+ { code: "CZ", name: "Czech Republic", dialCode: "+420", passportRegex: "^[0-9]{8}$" },
2602
+ { code: "DK", name: "Denmark", dialCode: "+45", passportRegex: "^[A-Z0-9]{9}$" },
2603
+ { code: "DJ", name: "Djibouti", dialCode: "+253", passportRegex: "^[A-Z0-9]{6,10}$" },
2604
+ { code: "DM", name: "Dominica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2605
+ { code: "DO", name: "Dominican Republic", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2606
+ { code: "EC", name: "Ecuador", dialCode: "+593", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2607
+ { code: "EG", name: "Egypt", dialCode: "+20", passportRegex: "^[A-Z][0-9]{7}$" },
2608
+ { code: "SV", name: "El Salvador", dialCode: "+503", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2609
+ { code: "GQ", name: "Equatorial Guinea", dialCode: "+240", passportRegex: "^[A-Z0-9]{6,10}$" },
2610
+ { code: "ER", name: "Eritrea", dialCode: "+291", passportRegex: "^[A-Z0-9]{6,10}$" },
2611
+ { code: "EE", name: "Estonia", dialCode: "+372", passportRegex: "^[A-Z0-9]{8}$" },
2612
+ { code: "SZ", name: "Eswatini", dialCode: "+268", passportRegex: "^[A-Z0-9]{6,10}$" },
2613
+ { code: "ET", name: "Ethiopia", dialCode: "+251", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2614
+ { code: "FJ", name: "Fiji", dialCode: "+679", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2615
+ { code: "FI", name: "Finland", dialCode: "+358", passportRegex: "^[A-Z0-9]{9}$" },
2616
+ { code: "FR", name: "France", dialCode: "+33", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2617
+ { code: "GA", name: "Gabon", dialCode: "+241", passportRegex: "^[A-Z0-9]{6,10}$" },
2618
+ { code: "GM", name: "Gambia", dialCode: "+220", passportRegex: "^[A-Z0-9]{6,10}$" },
2619
+ { code: "GE", name: "Georgia", dialCode: "+995", passportRegex: "^[A-Z0-9]{8}$" },
2620
+ { code: "DE", name: "Germany", dialCode: "+49", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2621
+ { code: "GH", name: "Ghana", dialCode: "+233", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2622
+ { code: "GR", name: "Greece", dialCode: "+30", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2623
+ { code: "GD", name: "Grenada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2624
+ { code: "GT", name: "Guatemala", dialCode: "+502", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2625
+ { code: "GN", name: "Guinea", dialCode: "+224", passportRegex: "^[A-Z0-9]{6,10}$" },
2626
+ { code: "GW", name: "Guinea-Bissau", dialCode: "+245", passportRegex: "^[A-Z0-9]{6,10}$" },
2627
+ { code: "GY", name: "Guyana", dialCode: "+592", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2628
+ { code: "HT", name: "Haiti", dialCode: "+509", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2629
+ { code: "HN", name: "Honduras", dialCode: "+504", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2630
+ { code: "HK", name: "Hong Kong", dialCode: "+852", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2631
+ { code: "HU", name: "Hungary", dialCode: "+36", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2632
+ { code: "IS", name: "Iceland", dialCode: "+354", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2633
+ { code: "IN", name: "India", dialCode: "+91", passportRegex: "^[A-Z][0-9]{7}$" },
2634
+ { code: "ID", name: "Indonesia", dialCode: "+62", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2635
+ { code: "IR", name: "Iran", dialCode: "+98", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2636
+ { code: "IQ", name: "Iraq", dialCode: "+964", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2637
+ { code: "IE", name: "Ireland", dialCode: "+353", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
2638
+ { code: "IL", name: "Israel", dialCode: "+972", passportRegex: "^[0-9]{8,9}$" },
2639
+ { code: "IT", name: "Italy", dialCode: "+39", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2640
+ { code: "JM", name: "Jamaica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2641
+ { code: "JP", name: "Japan", dialCode: "+81", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2642
+ { code: "JO", name: "Jordan", dialCode: "+962", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2643
+ { code: "KZ", name: "Kazakhstan", dialCode: "+7", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2644
+ { code: "KE", name: "Kenya", dialCode: "+254", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2645
+ { code: "KI", name: "Kiribati", dialCode: "+686", passportRegex: "^[A-Z0-9]{6,10}$" },
2646
+ { code: "KP", name: "North Korea", dialCode: "+850", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2647
+ { code: "KR", name: "South Korea", dialCode: "+82", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
2648
+ { code: "KW", name: "Kuwait", dialCode: "+965", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2649
+ { code: "KG", name: "Kyrgyzstan", dialCode: "+996", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2650
+ { code: "LA", name: "Laos", dialCode: "+856", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2651
+ { code: "LV", name: "Latvia", dialCode: "+371", passportRegex: "^[A-Z0-9]{8}$" },
2652
+ { code: "LB", name: "Lebanon", dialCode: "+961", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2653
+ { code: "LS", name: "Lesotho", dialCode: "+266", passportRegex: "^[A-Z0-9]{6,10}$" },
2654
+ { code: "LR", name: "Liberia", dialCode: "+231", passportRegex: "^[A-Z0-9]{6,10}$" },
2655
+ { code: "LY", name: "Libya", dialCode: "+218", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2656
+ { code: "LI", name: "Liechtenstein", dialCode: "+423", passportRegex: "^[A-Z0-9]{6,10}$" },
2657
+ { code: "LT", name: "Lithuania", dialCode: "+370", passportRegex: "^[A-Z0-9]{8}$" },
2658
+ { code: "LU", name: "Luxembourg", dialCode: "+352", passportRegex: "^[A-Z0-9]{8}$" },
2659
+ { code: "MO", name: "Macau", dialCode: "+853", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2660
+ { code: "MG", name: "Madagascar", dialCode: "+261", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2661
+ { code: "MW", name: "Malawi", dialCode: "+265", passportRegex: "^[A-Z0-9]{6,10}$" },
2662
+ { code: "MY", name: "Malaysia", dialCode: "+60", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
2663
+ { code: "MV", name: "Maldives", dialCode: "+960", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2664
+ { code: "ML", name: "Mali", dialCode: "+223", passportRegex: "^[A-Z0-9]{6,10}$" },
2665
+ { code: "MT", name: "Malta", dialCode: "+356", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2666
+ { code: "MH", name: "Marshall Islands", dialCode: "+692", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2667
+ { code: "MQ", name: "Martinique", dialCode: "+596", passportRegex: "^[A-Z0-9]{6,10}$" },
2668
+ { code: "MR", name: "Mauritania", dialCode: "+222", passportRegex: "^[A-Z0-9]{6,10}$" },
2669
+ { code: "MU", name: "Mauritius", dialCode: "+230", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2670
+ { code: "MX", name: "Mexico", dialCode: "+52", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
2671
+ { code: "FM", name: "Micronesia", dialCode: "+691", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2672
+ { code: "MD", name: "Moldova", dialCode: "+373", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2673
+ { code: "MC", name: "Monaco", dialCode: "+377", passportRegex: "^[A-Z0-9]{6,10}$" },
2674
+ { code: "MN", name: "Mongolia", dialCode: "+976", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2675
+ { code: "ME", name: "Montenegro", dialCode: "+382", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2676
+ { code: "MS", name: "Montserrat", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2677
+ { code: "MA", name: "Morocco", dialCode: "+212", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2678
+ { code: "MZ", name: "Mozambique", dialCode: "+258", passportRegex: "^[A-Z0-9]{6,10}$" },
2679
+ { code: "MM", name: "Myanmar", dialCode: "+95", passportRegex: "^[A-Z]{1}[0-9]{6,7}$" },
2680
+ { code: "NA", name: "Namibia", dialCode: "+264", passportRegex: "^[A-Z0-9]{6,10}$" },
2681
+ { code: "NR", name: "Nauru", dialCode: "+674", passportRegex: "^[A-Z0-9]{6,10}$" },
2682
+ { code: "NP", name: "Nepal", dialCode: "+977", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2683
+ { code: "NL", name: "Netherlands", dialCode: "+31", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2684
+ { code: "NC", name: "New Caledonia", dialCode: "+687", passportRegex: "^[A-Z0-9]{6,10}$" },
2685
+ { code: "NZ", name: "New Zealand", dialCode: "+64", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2686
+ { code: "NI", name: "Nicaragua", dialCode: "+505", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2687
+ { code: "NE", name: "Niger", dialCode: "+227", passportRegex: "^[A-Z0-9]{6,10}$" },
2688
+ { code: "NG", name: "Nigeria", dialCode: "+234", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2689
+ { code: "NO", name: "Norway", dialCode: "+47", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2690
+ { code: "OM", name: "Oman", dialCode: "+968", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2691
+ { code: "PK", name: "Pakistan", dialCode: "+92", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2692
+ { code: "PW", name: "Palau", dialCode: "+680", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2693
+ { code: "PS", name: "Palestine", dialCode: "+970", passportRegex: "^[A-Z0-9]{6,10}$" },
2694
+ { code: "PA", name: "Panama", dialCode: "+507", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2695
+ { code: "PG", name: "Papua New Guinea", dialCode: "+675", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2696
+ { code: "PY", name: "Paraguay", dialCode: "+595", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2697
+ { code: "PE", name: "Peru", dialCode: "+51", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2698
+ { code: "PH", name: "Philippines", dialCode: "+63", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2699
+ { code: "PL", name: "Poland", dialCode: "+48", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
2700
+ { code: "PT", name: "Portugal", dialCode: "+351", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2701
+ { code: "RO", name: "Romania", dialCode: "+40", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2702
+ { code: "RU", name: "Russia", dialCode: "+7", passportRegex: "^[0-9]{9}$" },
2703
+ { code: "RW", name: "Rwanda", dialCode: "+250", passportRegex: "^[A-Z0-9]{6,10}$" },
2704
+ {
2705
+ code: "KN",
2706
+ name: "Saint Kitts and Nevis",
2707
+ dialCode: "+1",
2708
+ passportRegex: "^[A-Z]{2}[0-9]{7}$"
2709
+ },
2710
+ { code: "LC", name: "Saint Lucia", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2711
+ {
2712
+ code: "VC",
2713
+ name: "Saint Vincent and the Grenadines",
2714
+ dialCode: "+1",
2715
+ passportRegex: "^[A-Z]{2}[0-9]{7}$"
2716
+ },
2717
+ { code: "WS", name: "Samoa", dialCode: "+685", passportRegex: "^[A-Z0-9]{6,10}$" },
2718
+ { code: "SM", name: "San Marino", dialCode: "+378", passportRegex: "^[A-Z0-9]{6,10}$" },
2719
+ {
2720
+ code: "ST",
2721
+ name: "Sao Tome and Principe",
2722
+ dialCode: "+239",
2723
+ passportRegex: "^[A-Z0-9]{6,10}$"
2724
+ },
2725
+ { code: "SA", name: "Saudi Arabia", dialCode: "+966", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2726
+ { code: "SN", name: "Senegal", dialCode: "+221", passportRegex: "^[A-Z0-9]{6,10}$" },
2727
+ { code: "RS", name: "Serbia", dialCode: "+381", passportRegex: "^[A-Z0-9]{9}$" },
2728
+ { code: "SC", name: "Seychelles", dialCode: "+248", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2729
+ { code: "SL", name: "Sierra Leone", dialCode: "+232", passportRegex: "^[A-Z0-9]{6,10}$" },
2730
+ { code: "SG", name: "Singapore", dialCode: "+65", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2731
+ { code: "SK", name: "Slovakia", dialCode: "+421", passportRegex: "^[0-9]{9}$" },
2732
+ { code: "SI", name: "Slovenia", dialCode: "+386", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2733
+ { code: "SB", name: "Solomon Islands", dialCode: "+677", passportRegex: "^[A-Z0-9]{6,10}$" },
2734
+ { code: "SO", name: "Somalia", dialCode: "+252", passportRegex: "^[A-Z0-9]{6,10}$" },
2735
+ { code: "ZA", name: "South Africa", dialCode: "+27", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2736
+ { code: "ES", name: "Spain", dialCode: "+34", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2737
+ { code: "LK", name: "Sri Lanka", dialCode: "+94", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2738
+ { code: "SD", name: "Sudan", dialCode: "+249", passportRegex: "^[A-Z0-9]{6,10}$" },
2739
+ { code: "SR", name: "Suriname", dialCode: "+597", passportRegex: "^[A-Z0-9]{6,10}$" },
2740
+ { code: "SE", name: "Sweden", dialCode: "+46", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2741
+ { code: "CH", name: "Switzerland", dialCode: "+41", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2742
+ { code: "SY", name: "Syria", dialCode: "+963", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2743
+ { code: "TW", name: "Taiwan", dialCode: "+886", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
2744
+ { code: "TJ", name: "Tajikistan", dialCode: "+992", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2745
+ { code: "TZ", name: "Tanzania", dialCode: "+255", passportRegex: "^[A-Z0-9]{6,10}$" },
2746
+ { code: "TH", name: "Thailand", dialCode: "+66", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2747
+ { code: "TL", name: "Timor-Leste", dialCode: "+670", passportRegex: "^[A-Z0-9]{6,10}$" },
2748
+ { code: "TG", name: "Togo", dialCode: "+228", passportRegex: "^[A-Z0-9]{6,10}$" },
2749
+ { code: "TO", name: "Tonga", dialCode: "+676", passportRegex: "^[A-Z0-9]{6,10}$" },
2750
+ { code: "TT", name: "Trinidad and Tobago", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2751
+ { code: "TN", name: "Tunisia", dialCode: "+216", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2752
+ { code: "TR", name: "Turkey", dialCode: "+90", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2753
+ { code: "TM", name: "Turkmenistan", dialCode: "+993", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2754
+ {
2755
+ code: "TC",
2756
+ name: "Turks and Caicos Islands",
2757
+ dialCode: "+1",
2758
+ passportRegex: "^[A-Z0-9]{6,10}$"
2759
+ },
2760
+ { code: "TV", name: "Tuvalu", dialCode: "+688", passportRegex: "^[A-Z0-9]{6,10}$" },
2761
+ { code: "UG", name: "Uganda", dialCode: "+256", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2762
+ { code: "UA", name: "Ukraine", dialCode: "+380", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2763
+ {
2764
+ code: "AE",
2765
+ name: "United Arab Emirates",
2766
+ dialCode: "+971",
2767
+ passportRegex: "^[A-Z]{1}[0-9]{7}$"
2768
+ },
2769
+ { code: "GB", name: "United Kingdom", dialCode: "+44", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2770
+ { code: "US", name: "United States", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
2771
+ { code: "UY", name: "Uruguay", dialCode: "+598", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2772
+ { code: "UZ", name: "Uzbekistan", dialCode: "+998", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2773
+ { code: "VU", name: "Vanuatu", dialCode: "+678", passportRegex: "^[A-Z0-9]{6,10}$" },
2774
+ { code: "VA", name: "Vatican City", dialCode: "+379", passportRegex: "^[A-Z0-9]{6,10}$" },
2775
+ { code: "VE", name: "Venezuela", dialCode: "+58", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2776
+ { code: "VN", name: "Vietnam", dialCode: "+84", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2777
+ { code: "YE", name: "Yemen", dialCode: "+967", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
2778
+ { code: "ZM", name: "Zambia", dialCode: "+260", passportRegex: "^[A-Z0-9]{6,10}$" },
2779
+ { code: "ZW", name: "Zimbabwe", dialCode: "+263", passportRegex: "^[A-Z0-9]{6,10}$" }
2780
+ ];
2781
+ var useStyles8 = makeStyles({
2782
+ dialogTitle: {
2783
+ display: "flex",
2784
+ justifyContent: "space-between",
2785
+ alignItems: "center",
2786
+ paddingRight: "8px"
2787
+ },
2788
+ dialogSurface: {
2789
+ maxWidth: "600px",
2790
+ width: "100%"
2791
+ },
2792
+ closeButton: {
2793
+ minWidth: "32px",
2794
+ minHeight: "32px"
2795
+ },
2796
+ content: {
2797
+ display: "flex",
2798
+ flexDirection: "column",
2799
+ gap: "0px",
2800
+ paddingTop: "10px",
2801
+ paddingLeft: "10px",
2802
+ paddingRight: "10px"
2803
+ },
2804
+ searchInput: {
2805
+ width: "100%",
2806
+ marginBottom: "16px"
2807
+ },
2808
+ resultList: {
2809
+ display: "flex",
2810
+ flexDirection: "column",
2811
+ gap: "0px",
2812
+ maxHeight: "400px",
2813
+ overflowY: "auto",
2814
+ paddingRight: "1rem"
2815
+ },
2816
+ resultItem: {
2817
+ padding: "16px 20px",
2818
+ borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,
2819
+ cursor: "pointer",
2820
+ transition: "all 0.2s ease",
2821
+ backgroundColor: tokens.colorNeutralBackground1,
2822
+ position: "relative",
2823
+ ":hover": {
2824
+ backgroundColor: tokens.colorNeutralBackground1Hover,
2825
+ borderBottom: `1px solid ${tokens.colorBrandBackground}`
2826
+ }
2827
+ },
2828
+ resultItemSelected: {
2829
+ backgroundColor: tokens.colorNeutralBackground1,
2830
+ borderLeft: `4px solid ${tokens.colorBrandBackground}`,
2831
+ paddingLeft: "16px"
2832
+ },
2833
+ harborName: {
2834
+ fontSize: tokens.fontSizeBase300,
2835
+ fontWeight: tokens.fontWeightRegular,
2836
+ color: tokens.colorNeutralForeground1,
2837
+ marginBottom: "2px"
2838
+ },
2839
+ harborLocation: {
2840
+ fontSize: tokens.fontSizeBase200,
2841
+ color: tokens.colorNeutralForeground3
2842
+ },
2843
+ buttonContainer: {
2844
+ display: "flex",
2845
+ gap: "1rem",
2846
+ marginBottom: "1rem",
2847
+ flexWrap: "wrap"
2848
+ },
2849
+ circularButton: {
2850
+ borderRadius: tokens.borderRadiusCircular
2851
+ },
2852
+ headerRow: {
2853
+ display: "flex",
2854
+ justifyContent: "space-between",
2855
+ marginTop: "1rem",
2856
+ marginBottom: "1rem"
2857
+ },
2858
+ dangerText: {
2859
+ color: tokens.colorStatusDangerForeground1
2860
+ },
2861
+ historyItem: {
2862
+ display: "flex",
2863
+ justifyContent: "space-between",
2864
+ marginTop: "1rem",
2865
+ marginBottom: "1rem"
2866
+ },
2867
+ iconMargin: {
2868
+ marginRight: "0.5rem"
2869
+ },
2870
+ cursorPointer: {
2871
+ cursor: "pointer"
2872
+ },
2873
+ sectionTitle: {
2874
+ marginTop: "1rem",
2875
+ marginBottom: "1rem"
2876
+ },
2877
+ harborList: {
2878
+ display: "flex",
2879
+ flexDirection: "column",
2880
+ gap: "1rem",
2881
+ marginBottom: "1rem"
2882
+ },
2883
+ harborItem: {
2884
+ display: "flex",
2885
+ justifyContent: "space-between"
2886
+ },
2887
+ emptyState: {
2888
+ textAlign: "center",
2889
+ padding: "32px",
2890
+ color: tokens.colorNeutralForeground3
2891
+ }
2892
+ });
2893
+ var ModalSearchHarbor = ({
2894
+ open,
2895
+ onClose,
2896
+ title = "Pilih Pelabuhan",
2897
+ modalType = "origin",
2898
+ harbors,
2899
+ favoriteHarbors,
2900
+ lastSearchedHarbors,
2901
+ isLoading = false,
2902
+ searchQuery,
2903
+ onSearchChange,
2904
+ onSelectHarbor,
2905
+ onToggleFavorite,
2906
+ onAddLastSearched,
2907
+ onRemoveLastSearched,
2908
+ onClearLastSearched
2909
+ }) => {
2910
+ const styles = useStyles8();
2911
+ const handleSelect = (harbor) => {
2912
+ onAddLastSearched(harbor);
2913
+ onSelectHarbor(harbor);
2914
+ onSearchChange("");
2915
+ };
2916
+ const handleClose = () => {
2917
+ onClose();
2918
+ onSearchChange("");
2919
+ };
2920
+ return /* @__PURE__ */ jsx(
2921
+ Dialog,
2922
+ {
2923
+ open,
2924
+ onOpenChange: (_, data) => {
2925
+ if (!data.open) {
2926
+ onClose();
2927
+ }
2928
+ },
2929
+ children: /* @__PURE__ */ jsx(DialogSurface, { className: styles.dialogSurface, children: /* @__PURE__ */ jsxs(DialogBody, { children: [
2930
+ /* @__PURE__ */ jsx(
2931
+ DialogTitle,
2932
+ {
2933
+ action: /* @__PURE__ */ jsx(
2934
+ Button,
2935
+ {
2936
+ appearance: "subtle",
2937
+ "aria-label": "close",
2938
+ icon: /* @__PURE__ */ jsx(Icon, { icon: "fluent:dismiss-24-regular" }),
2939
+ onClick: handleClose,
2940
+ className: styles.closeButton
2941
+ }
2942
+ ),
2943
+ children: title
2944
+ }
2945
+ ),
2946
+ /* @__PURE__ */ jsxs(DialogContent, { className: styles.content, children: [
2947
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
2948
+ Input,
2949
+ {
2950
+ className: styles.searchInput,
2951
+ value: searchQuery,
2952
+ onChange: (e) => onSearchChange(e.target.value),
2953
+ placeholder: "Cari Pelabuhan...",
2954
+ contentBefore: /* @__PURE__ */ jsx(Icon, { icon: "fluent:search-24-regular", color: tokens.colorNeutralForeground3 }),
2955
+ size: "large"
2956
+ }
2957
+ ) }),
2958
+ favoriteHarbors.length > 0 && /* @__PURE__ */ jsx("div", { className: styles.buttonContainer, children: favoriteHarbors.map((harbor) => /* @__PURE__ */ jsx(
2959
+ Button,
2960
+ {
2961
+ onClick: () => handleSelect(harbor),
2962
+ size: "medium",
2963
+ appearance: "outline",
2964
+ iconPosition: "before",
2965
+ className: styles.circularButton,
2966
+ icon: /* @__PURE__ */ jsx(Icon, { icon: "fluent:ribbon-20-filled" }),
2967
+ children: /* @__PURE__ */ jsx(Body1, { children: harbor.name })
2968
+ },
2969
+ harbor.id
2970
+ )) }),
2971
+ /* @__PURE__ */ jsx(Divider, {}),
2972
+ /* @__PURE__ */ jsxs("div", { className: styles.resultList, children: [
2973
+ lastSearchedHarbors.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
2974
+ /* @__PURE__ */ jsxs("div", { className: styles.headerRow, children: [
2975
+ /* @__PURE__ */ jsx(Body1Strong, { children: "Terakhir dicari" }),
2976
+ /* @__PURE__ */ jsx(
2977
+ Caption1,
2978
+ {
2979
+ className: `${styles.dangerText} ${styles.cursorPointer}`,
2980
+ onClick: onClearLastSearched,
2981
+ children: "Hapus Semua"
2982
+ }
2983
+ )
2984
+ ] }),
2985
+ /* @__PURE__ */ jsx("div", { children: lastSearchedHarbors.map((harbor) => /* @__PURE__ */ jsxs("div", { className: styles.historyItem, children: [
2986
+ /* @__PURE__ */ jsxs(
2987
+ "div",
2988
+ {
2989
+ style: { cursor: "pointer" },
2990
+ onClick: () => handleSelect(harbor),
2991
+ children: [
2992
+ /* @__PURE__ */ jsx(Icon, { icon: "fluent:vehicle-ship-24-regular", className: styles.iconMargin }),
2993
+ harbor.name
2994
+ ]
2995
+ }
2996
+ ),
2997
+ /* @__PURE__ */ jsx(
2998
+ Icon,
2999
+ {
3000
+ onClick: () => onRemoveLastSearched(harbor.id),
3001
+ icon: "fluent:dismiss-24-regular",
3002
+ color: tokens.colorStatusDangerForeground1,
3003
+ className: styles.cursorPointer
3004
+ }
3005
+ )
3006
+ ] }, harbor.id)) }),
3007
+ /* @__PURE__ */ jsx(Divider, {})
3008
+ ] }),
3009
+ /* @__PURE__ */ jsx(Body1Strong, { className: styles.sectionTitle, children: "Semua Pelabuhan" }),
3010
+ /* @__PURE__ */ jsx("div", { className: styles.harborList, children: isLoading ? /* @__PURE__ */ jsx("div", { className: styles.emptyState, children: "Memuat data..." }) : harbors.length > 0 ? harbors.map((harbor, index) => /* @__PURE__ */ jsxs("div", { className: styles.harborItem, children: [
3011
+ /* @__PURE__ */ jsxs(
3012
+ "div",
3013
+ {
3014
+ className: styles.cursorPointer,
3015
+ onClick: () => handleSelect(harbor),
3016
+ children: [
3017
+ /* @__PURE__ */ jsx(Icon, { icon: "fluent:vehicle-ship-24-regular", className: styles.iconMargin }),
3018
+ harbor.name
3019
+ ]
3020
+ }
3021
+ ),
3022
+ /* @__PURE__ */ jsx(
3023
+ Icon,
3024
+ {
3025
+ icon: favoriteHarbors.find((fav) => fav.id === harbor.id) ? "fluent:star-24-filled" : "fluent:star-24-regular",
3026
+ color: tokens.colorBrandBackground,
3027
+ className: styles.cursorPointer,
3028
+ onClick: () => onToggleFavorite(harbor)
3029
+ }
3030
+ )
3031
+ ] }, index)) : /* @__PURE__ */ jsx("div", { className: styles.emptyState, children: "Pelabuhan tidak ditemukan" }) })
3032
+ ] })
3033
+ ] })
3034
+ ] }) })
3035
+ }
3036
+ );
80
3037
  };
81
- var ModalRadius_default = ModalRadius;
82
3038
 
83
- export { ModalRadius, ModalRadius_default as ModalRadiusDefault };
3039
+ export { BackgroundTicketCard_default as BackgroundTicketCard, BackgroundTicketCardVertical_default as BackgroundTicketCardVertical, CardBanner, CardPromo, CardServiceMenu, CardTicket, CarouselWithCustomNav, DEFAULT_COUNTRY_CODES2 as DEFAULT_COUNTRY_CODES, InputDynamic_default as InputDynamic, MODAL_PRESETS, ModalIllustration, ModalSearchHarbor, getModalPreset };
84
3040
  //# sourceMappingURL=index.mjs.map
85
3041
  //# sourceMappingURL=index.mjs.map