regions-config 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1570 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __export = (target, all) => {
24
+ for (var name in all)
25
+ __defProp(target, name, { get: all[name], enumerable: true });
26
+ };
27
+ var __copyProps = (to, from, except, desc) => {
28
+ if (from && typeof from === "object" || typeof from === "function") {
29
+ for (let key of __getOwnPropNames(from))
30
+ if (!__hasOwnProp.call(to, key) && key !== except)
31
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
32
+ }
33
+ return to;
34
+ };
35
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
+
37
+ // src/index.ts
38
+ var index_exports = {};
39
+ __export(index_exports, {
40
+ EUROPE_COUNTRIES: () => EUROPE_COUNTRIES,
41
+ GROUP_REGIONS: () => GROUP_REGIONS,
42
+ RegionConfigSchema: () => RegionConfigSchema,
43
+ US_CANADA_COUNTRIES: () => US_CANADA_COUNTRIES,
44
+ US_CANADA_JAPAN_COUNTRIES: () => US_CANADA_JAPAN_COUNTRIES,
45
+ WORLD_COUNTRIES: () => WORLD_COUNTRIES,
46
+ getRegionConfig: () => getRegionConfig,
47
+ getRegionConfigById: () => getRegionConfigById,
48
+ getRegionConfigByRegionCode: () => getRegionConfigByRegionCode,
49
+ regionsConfig: () => regionsConfig_default,
50
+ resolveDocumentTypeOptions: () => resolveDocumentTypeOptions,
51
+ validateRegion: () => validateRegion
52
+ });
53
+ module.exports = __toCommonJS(index_exports);
54
+
55
+ // src/const.ts
56
+ var GROUP_REGIONS = {
57
+ WORLD: 254,
58
+ EUROPE: 259,
59
+ US_CANADA_JAPAN: 272,
60
+ REST_OF_THE_WORLD: 273,
61
+ US_CANADA: 274
62
+ };
63
+ var EUROPE_COUNTRIES = [
64
+ 4,
65
+ 5,
66
+ 6,
67
+ 14,
68
+ 21,
69
+ 22,
70
+ 31,
71
+ 34,
72
+ 38,
73
+ 49,
74
+ 50,
75
+ 60,
76
+ 63,
77
+ 66,
78
+ 70,
79
+ 71,
80
+ 1,
81
+ 73,
82
+ 76,
83
+ 78,
84
+ 82,
85
+ 86,
86
+ 98,
87
+ 104,
88
+ 262,
89
+ 112,
90
+ 108,
91
+ 124,
92
+ 129,
93
+ 130,
94
+ 134,
95
+ 138,
96
+ 139,
97
+ 142,
98
+ 143,
99
+ 144,
100
+ 146,
101
+ 152,
102
+ 154,
103
+ 160,
104
+ 161,
105
+ 163,
106
+ 174,
107
+ 179,
108
+ 189,
109
+ 190,
110
+ 193,
111
+ 195,
112
+ 196,
113
+ 200,
114
+ 202,
115
+ 207,
116
+ 225,
117
+ 226,
118
+ 240,
119
+ 242
120
+ ];
121
+ var US_CANADA_JAPAN_COUNTRIES = [72, 45, 127];
122
+ var US_CANADA_COUNTRIES = [72, 45];
123
+ var WORLD_COUNTRIES = [
124
+ 3,
125
+ 8,
126
+ 10,
127
+ 12,
128
+ 15,
129
+ 16,
130
+ 17,
131
+ 20,
132
+ 23,
133
+ 25,
134
+ 26,
135
+ 24,
136
+ 28,
137
+ 29,
138
+ 30,
139
+ 32,
140
+ 33,
141
+ 270,
142
+ 35,
143
+ 36,
144
+ 37,
145
+ 41,
146
+ 42,
147
+ 43,
148
+ 44,
149
+ 45,
150
+ 47,
151
+ 48,
152
+ 52,
153
+ 253,
154
+ 53,
155
+ 54,
156
+ 57,
157
+ 58,
158
+ 59,
159
+ 61,
160
+ 269,
161
+ 62,
162
+ 64,
163
+ 65,
164
+ 67,
165
+ 68,
166
+ 69,
167
+ 72,
168
+ 74,
169
+ 75,
170
+ 77,
171
+ 79,
172
+ 80,
173
+ 83,
174
+ 84,
175
+ 85,
176
+ 87,
177
+ 265,
178
+ 88,
179
+ 89,
180
+ 266,
181
+ 90,
182
+ 91,
183
+ 92,
184
+ 94,
185
+ 96,
186
+ 97,
187
+ 99,
188
+ 101,
189
+ 105,
190
+ 51,
191
+ 153,
192
+ 168,
193
+ 106,
194
+ 263,
195
+ 107,
196
+ 251,
197
+ 18,
198
+ 109,
199
+ 110,
200
+ 111,
201
+ 113,
202
+ 114,
203
+ 115,
204
+ 116,
205
+ 122,
206
+ 127,
207
+ 180,
208
+ 185,
209
+ 117,
210
+ 118,
211
+ 220,
212
+ 119,
213
+ 264,
214
+ 121,
215
+ 120,
216
+ 125,
217
+ 126,
218
+ 128,
219
+ 131,
220
+ 132,
221
+ 133,
222
+ 135,
223
+ 136,
224
+ 137,
225
+ 145,
226
+ 147,
227
+ 148,
228
+ 149,
229
+ 150,
230
+ 155,
231
+ 157,
232
+ 158,
233
+ 159,
234
+ 162,
235
+ 164,
236
+ 165,
237
+ 166,
238
+ 167,
239
+ 169,
240
+ 170,
241
+ 173,
242
+ 175,
243
+ 176,
244
+ 177,
245
+ 181,
246
+ 183,
247
+ 186,
248
+ 187,
249
+ 188,
250
+ 191,
251
+ 192,
252
+ 197,
253
+ 198,
254
+ 268,
255
+ 199,
256
+ 203,
257
+ 204,
258
+ 205,
259
+ 271,
260
+ 206,
261
+ 208,
262
+ 209,
263
+ 210,
264
+ 211,
265
+ 212,
266
+ 213,
267
+ 214,
268
+ 215,
269
+ 216,
270
+ 221,
271
+ 222,
272
+ 223,
273
+ 224,
274
+ 227,
275
+ 228,
276
+ 229,
277
+ 230,
278
+ 231,
279
+ 232,
280
+ 233,
281
+ 55,
282
+ 234,
283
+ 235,
284
+ 236,
285
+ 237,
286
+ 238,
287
+ 239,
288
+ 241,
289
+ 243,
290
+ 245,
291
+ 246,
292
+ 247,
293
+ 248,
294
+ 249,
295
+ 250,
296
+ 252,
297
+ 256,
298
+ 257,
299
+ 258
300
+ ];
301
+
302
+ // src/domain/RegionConfigSchema.ts
303
+ var import_zod = require("zod");
304
+ var RegionConfigSchema = import_zod.z.object({
305
+ id: import_zod.z.number(),
306
+ gtmId: import_zod.z.string().regex(/^GTM-[A-Z0-9]+$/, "Invalid GTM ID format"),
307
+ countriesToRedirect: import_zod.z.record(
308
+ import_zod.z.string(),
309
+ import_zod.z.object({
310
+ label: import_zod.z.string(),
311
+ countries: import_zod.z.array(
312
+ import_zod.z.object({
313
+ countryId: import_zod.z.string(),
314
+ name: import_zod.z.string().optional()
315
+ })
316
+ )
317
+ })
318
+ ).optional(),
319
+ regionUrls: import_zod.z.object({
320
+ staging: import_zod.z.string().url(),
321
+ production: import_zod.z.string().url()
322
+ }).optional(),
323
+ timeZone: import_zod.z.string(),
324
+ regionsToGroup: import_zod.z.array(
325
+ import_zod.z.object({
326
+ priority: import_zod.z.enum(["high", "medium", "low"]),
327
+ countries: import_zod.z.array(import_zod.z.number()),
328
+ regionId: import_zod.z.number()
329
+ })
330
+ ).optional(),
331
+ footer: import_zod.z.array(
332
+ import_zod.z.object({
333
+ href: import_zod.z.string().url(),
334
+ label: import_zod.z.string()
335
+ })
336
+ ),
337
+ documentTypeOptions: import_zod.z.array(
338
+ import_zod.z.object({
339
+ label: import_zod.z.string(),
340
+ value: import_zod.z.string()
341
+ })
342
+ ),
343
+ documentTypeOptionsByOrigin: import_zod.z.object({
344
+ local: import_zod.z.array(import_zod.z.object({ label: import_zod.z.string(), value: import_zod.z.string() })),
345
+ foreign: import_zod.z.array(import_zod.z.object({ label: import_zod.z.string(), value: import_zod.z.string() }))
346
+ }).optional(),
347
+ dateFormat: import_zod.z.string(),
348
+ regionCode: import_zod.z.enum(["es-ES", "es-MX", "en-EU", "en-ROW", "it-IT", "pt-PT", "es-CO", "es-PE"]),
349
+ paymentCardTypes: import_zod.z.array(
350
+ import_zod.z.object({
351
+ id: import_zod.z.number(),
352
+ name: import_zod.z.string(),
353
+ imagePath: import_zod.z.string()
354
+ })
355
+ ),
356
+ webSitePath: import_zod.z.string().optional()
357
+ }).strict();
358
+
359
+ // src/regions/index.ts
360
+ var regions_exports = {};
361
+ __export(regions_exports, {
362
+ comco: () => comco_default,
363
+ comen: () => comen_default,
364
+ comeneu: () => comeneu_default,
365
+ commx: () => commx_default,
366
+ compe: () => compe_default,
367
+ es: () => es_default,
368
+ it: () => it_default,
369
+ pt: () => pt_default
370
+ });
371
+
372
+ // src/regions/comco.json
373
+ var comco_default = {
374
+ id: 9,
375
+ countriesToRedirect: {
376
+ es: {
377
+ label: "Espa\xF1a",
378
+ countries: [
379
+ {
380
+ countryId: "1",
381
+ name: "Espa\xF1a"
382
+ }
383
+ ]
384
+ },
385
+ pt: {
386
+ label: "Portugal",
387
+ countries: [
388
+ {
389
+ countryId: "190",
390
+ name: "Portugal"
391
+ }
392
+ ]
393
+ },
394
+ commx: {
395
+ label: "M\xE9xico",
396
+ countries: [
397
+ {
398
+ countryId: "158",
399
+ name: "M\xE9xico"
400
+ }
401
+ ]
402
+ },
403
+ compe: {
404
+ label: "Per\xFA",
405
+ countries: [
406
+ {
407
+ countryId: "187",
408
+ name: "Per\xFA"
409
+ }
410
+ ]
411
+ },
412
+ it: {
413
+ label: "Italia",
414
+ countries: [
415
+ {
416
+ countryId: "124",
417
+ name: "Italia"
418
+ }
419
+ ]
420
+ }
421
+ },
422
+ regionUrls: {
423
+ staging: "https://iatiglobal.iatidev.link/co/",
424
+ production: "https://www.iatiglobal.com/co/"
425
+ },
426
+ timeZone: "America/Bogota",
427
+ regionsToGroup: [
428
+ {
429
+ priority: "high",
430
+ countries: "US_CANADA_COUNTRIES",
431
+ regionId: "US_CANADA"
432
+ },
433
+ {
434
+ priority: "medium",
435
+ countries: "WORLD_COUNTRIES",
436
+ regionId: "WORLD"
437
+ },
438
+ {
439
+ priority: "low",
440
+ countries: "EUROPE_COUNTRIES",
441
+ regionId: "EUROPE"
442
+ }
443
+ ],
444
+ footer: [
445
+ {
446
+ href: "https://www.iatiglobal.com/co/politica-de-privacidad/",
447
+ label: "footer.privacyPolicy"
448
+ },
449
+ {
450
+ href: "https://www.iatiglobal.com/co/aviso-legal/",
451
+ label: "footer.legalNotice"
452
+ },
453
+ {
454
+ href: "https://www.iatiglobal.com/co/politica-de-cookies/",
455
+ label: "footer.cookiePolicy"
456
+ },
457
+ {
458
+ href: "https://www.iatiglobal.com/co/condiciones-generales/",
459
+ label: "footer.generalTerms"
460
+ },
461
+ {
462
+ href: "https://app.kenjo.io/whistleblower/3ee7e1d5ee59c6fe8b84b8fc9e02ee0284eb54213b4a4dd4c3914fba04c4ae4b",
463
+ label: "footer.ethicsChannel"
464
+ }
465
+ ],
466
+ documentTypeOptions: [
467
+ {
468
+ label: "Pasaporte",
469
+ value: "passport"
470
+ }
471
+ ],
472
+ dateFormat: "dd/MM/yyyy",
473
+ regionCode: "es-CO",
474
+ gtmId: "GTM-MWBFQB27",
475
+ paymentCardTypes: [
476
+ {
477
+ id: 1,
478
+ name: "Visa",
479
+ imagePath: "/assets/images/payments/visa.svg"
480
+ },
481
+ {
482
+ id: 2,
483
+ name: "Mastercard",
484
+ imagePath: "/assets/images/payments/mastercard.svg"
485
+ },
486
+ {
487
+ id: 3,
488
+ name: "Maestro",
489
+ imagePath: "/assets/images/payments/maestro.svg"
490
+ }
491
+ ],
492
+ webSitePath: "/co"
493
+ };
494
+
495
+ // src/regions/comen.json
496
+ var comen_default = {
497
+ id: 5,
498
+ countriesToRedirect: {
499
+ es: {
500
+ label: "Spain",
501
+ countries: [
502
+ {
503
+ countryId: "1",
504
+ name: "Espa\xF1a"
505
+ }
506
+ ]
507
+ },
508
+ comco: {
509
+ label: "Colombia",
510
+ countries: [
511
+ {
512
+ countryId: "52",
513
+ name: "Colombia"
514
+ }
515
+ ]
516
+ },
517
+ commx: {
518
+ label: "Mexico",
519
+ countries: [
520
+ {
521
+ countryId: "158",
522
+ name: "M\xE9xico"
523
+ }
524
+ ]
525
+ },
526
+ compe: {
527
+ label: "Peru",
528
+ countries: [
529
+ {
530
+ countryId: "187",
531
+ name: "Per\xFA"
532
+ }
533
+ ]
534
+ },
535
+ pt: {
536
+ label: "Portugal",
537
+ countries: [
538
+ {
539
+ countryId: "190",
540
+ name: "Portugal"
541
+ },
542
+ {
543
+ countryId: "7",
544
+ name: "Angola"
545
+ },
546
+ {
547
+ countryId: "36",
548
+ name: "Brasil"
549
+ },
550
+ {
551
+ countryId: "42",
552
+ name: "Cabo Verde"
553
+ },
554
+ {
555
+ countryId: "93",
556
+ name: "Guin\xE9-Bissau"
557
+ },
558
+ {
559
+ countryId: "92",
560
+ name: "Guin\xE9 Equatorial"
561
+ },
562
+ {
563
+ countryId: "165",
564
+ name: "Mo\xE7ambique"
565
+ },
566
+ {
567
+ countryId: "212",
568
+ name: "S\xE3o Tom\xE9 e Pr\xEDncipe"
569
+ }
570
+ ]
571
+ },
572
+ it: {
573
+ label: "Italy",
574
+ countries: [
575
+ {
576
+ countryId: "124",
577
+ name: "Italia"
578
+ }
579
+ ]
580
+ }
581
+ },
582
+ regionUrls: {
583
+ staging: "https://stg.iatiglobal.com/co/",
584
+ production: "https://www.iatiglobal.com/co/"
585
+ },
586
+ timeZone: "Europe/Madrid",
587
+ regionsToGroup: [
588
+ {
589
+ priority: "high",
590
+ countries: "US_CANADA_JAPAN_COUNTRIES",
591
+ regionId: "US_CANADA_JAPAN"
592
+ },
593
+ {
594
+ priority: "medium",
595
+ countries: "WORLD_COUNTRIES",
596
+ regionId: "REST_OF_THE_WORLD"
597
+ },
598
+ {
599
+ priority: "low",
600
+ countries: "EUROPE_COUNTRIES",
601
+ regionId: "EUROPE"
602
+ }
603
+ ],
604
+ footer: [
605
+ {
606
+ href: "https://www.iatiglobal.com/en/privacy-policy/",
607
+ label: "footer.privacyPolicy"
608
+ },
609
+ {
610
+ href: "https://www.iatiglobal.com/en/legal-disclaimer/",
611
+ label: "footer.legalNotice"
612
+ },
613
+ {
614
+ href: "https://www.iatiglobal.com/en/cookies-policy/",
615
+ label: "footer.cookiePolicy"
616
+ },
617
+ {
618
+ href: "https://www.iatiglobal.com/en/terms-and-conditons/",
619
+ label: "footer.generalTerms"
620
+ },
621
+ {
622
+ href: "https://app.kenjo.io/whistleblower/3ee7e1d5ee59c6fe8b84b8fc9e02ee0284eb54213b4a4dd4c3914fba04c4ae4b",
623
+ label: "footer.ethicsChannel"
624
+ }
625
+ ],
626
+ documentTypeOptions: [
627
+ {
628
+ label: "Passport",
629
+ value: "passport"
630
+ }
631
+ ],
632
+ dateFormat: "dd/MM/yyyy",
633
+ regionCode: "en-ROW",
634
+ gtmId: "GTM-NZVPZBPD",
635
+ paymentCardTypes: [
636
+ {
637
+ id: 1,
638
+ name: "Visa",
639
+ imagePath: "/assets/images/payments/visa.svg"
640
+ },
641
+ {
642
+ id: 2,
643
+ name: "Mastercard",
644
+ imagePath: "/assets/images/payments/mastercard.svg"
645
+ },
646
+ {
647
+ id: 3,
648
+ name: "Maestro",
649
+ imagePath: "/assets/images/payments/maestro.svg"
650
+ },
651
+ {
652
+ id: 4,
653
+ name: "American Express",
654
+ imagePath: "/assets/images/payments/american-express.svg"
655
+ },
656
+ {
657
+ id: 5,
658
+ name: "JCB",
659
+ imagePath: "/assets/images/payments/jcb.svg"
660
+ },
661
+ {
662
+ id: 6,
663
+ name: "Diners Club",
664
+ imagePath: "/assets/images/payments/diners-club.svg"
665
+ }
666
+ ],
667
+ webSitePath: "/en"
668
+ };
669
+
670
+ // src/regions/comeneu.json
671
+ var comeneu_default = {
672
+ id: 6,
673
+ countriesToRedirect: {
674
+ es: {
675
+ label: "Spain",
676
+ countries: [
677
+ {
678
+ countryId: "1",
679
+ name: "Espa\xF1a"
680
+ }
681
+ ]
682
+ },
683
+ comco: {
684
+ label: "Colombia",
685
+ countries: [
686
+ {
687
+ countryId: "52",
688
+ name: "Colombia"
689
+ }
690
+ ]
691
+ },
692
+ commx: {
693
+ label: "Mexico",
694
+ countries: [
695
+ {
696
+ countryId: "158",
697
+ name: "M\xE9xico"
698
+ }
699
+ ]
700
+ },
701
+ compe: {
702
+ label: "Peru",
703
+ countries: [
704
+ {
705
+ countryId: "187",
706
+ name: "Per\xFA"
707
+ }
708
+ ]
709
+ },
710
+ pt: {
711
+ label: "Portugal",
712
+ countries: [
713
+ {
714
+ countryId: "190",
715
+ name: "Portugal"
716
+ }
717
+ ]
718
+ },
719
+ it: {
720
+ label: "Italy",
721
+ countries: [
722
+ {
723
+ countryId: "124",
724
+ name: "Italia"
725
+ }
726
+ ]
727
+ }
728
+ },
729
+ regionUrls: {
730
+ staging: "https://stg.iatiglobal.com/en-eu/",
731
+ production: "https://www.iatiglobal.com/en-eu/"
732
+ },
733
+ timeZone: "Europe/Madrid",
734
+ regionsToGroup: [
735
+ {
736
+ priority: "high",
737
+ countries: "US_CANADA_JAPAN_COUNTRIES",
738
+ regionId: "US_CANADA_JAPAN"
739
+ },
740
+ {
741
+ priority: "medium",
742
+ countries: "WORLD_COUNTRIES",
743
+ regionId: "REST_OF_THE_WORLD"
744
+ },
745
+ {
746
+ priority: "low",
747
+ countries: "EUROPE_COUNTRIES",
748
+ regionId: "EUROPE"
749
+ }
750
+ ],
751
+ footer: [
752
+ {
753
+ href: "https://www.iatiglobal.com/en-eu/privacy-policy/",
754
+ label: "footer.privacyPolicy"
755
+ },
756
+ {
757
+ href: "https://www.iatiglobal.com/en-eu/legal-disclaimer/",
758
+ label: "footer.legalNotice"
759
+ },
760
+ {
761
+ href: "https://www.iatiglobal.com/en-eu/cookies-policy/",
762
+ label: "footer.cookiePolicy"
763
+ },
764
+ {
765
+ href: "https://www.iatiglobal.com/en-eu/terms-and-conditons/",
766
+ label: "footer.generalTerms"
767
+ },
768
+ {
769
+ href: "https://app.kenjo.io/whistleblower/3ee7e1d5ee59c6fe8b84b8fc9e02ee0284eb54213b4a4dd4c3914fba04c4ae4b",
770
+ label: "footer.ethicsChannel"
771
+ }
772
+ ],
773
+ documentTypeOptions: [
774
+ {
775
+ label: "Passport",
776
+ value: "passport"
777
+ }
778
+ ],
779
+ dateFormat: "dd/MM/yyyy",
780
+ regionCode: "en-EU",
781
+ gtmId: "GTM-WMGW2FPD",
782
+ paymentCardTypes: [
783
+ {
784
+ id: 1,
785
+ name: "Visa",
786
+ imagePath: "/assets/images/payments/visa.svg"
787
+ },
788
+ {
789
+ id: 2,
790
+ name: "Mastercard",
791
+ imagePath: "/assets/images/payments/mastercard.svg"
792
+ },
793
+ {
794
+ id: 3,
795
+ name: "Maestro",
796
+ imagePath: "/assets/images/payments/maestro.svg"
797
+ },
798
+ {
799
+ id: 4,
800
+ name: "American Express",
801
+ imagePath: "/assets/images/payments/american-express.svg"
802
+ },
803
+ {
804
+ id: 5,
805
+ name: "JCB",
806
+ imagePath: "/assets/images/payments/jcb.svg"
807
+ },
808
+ {
809
+ id: 6,
810
+ name: "Diners Club",
811
+ imagePath: "/assets/images/payments/diners-club.svg"
812
+ }
813
+ ],
814
+ webSitePath: "/en-eu"
815
+ };
816
+
817
+ // src/regions/commx.json
818
+ var commx_default = {
819
+ id: 7,
820
+ countriesToRedirect: {
821
+ es: {
822
+ label: "Espa\xF1a",
823
+ countries: [
824
+ {
825
+ countryId: "1",
826
+ name: "Espa\xF1a"
827
+ }
828
+ ]
829
+ },
830
+ pt: {
831
+ label: "Portugal",
832
+ countries: [
833
+ {
834
+ countryId: "190",
835
+ name: "Portugal"
836
+ }
837
+ ]
838
+ },
839
+ comco: {
840
+ label: "Colombia",
841
+ countries: [
842
+ {
843
+ countryId: "52",
844
+ name: "Colombia"
845
+ }
846
+ ]
847
+ },
848
+ compe: {
849
+ label: "Per\xFA",
850
+ countries: [
851
+ {
852
+ countryId: "187",
853
+ name: "Per\xFA"
854
+ }
855
+ ]
856
+ },
857
+ it: {
858
+ label: "Italia",
859
+ countries: [
860
+ {
861
+ countryId: "124",
862
+ name: "Italia"
863
+ }
864
+ ]
865
+ }
866
+ },
867
+ regionUrls: {
868
+ staging: "https://stg.iatiglobal.com/mx/",
869
+ production: "https://www.iatiglobal.com/mx/"
870
+ },
871
+ timeZone: "America/Mexico_City",
872
+ regionsToGroup: [
873
+ {
874
+ priority: "high",
875
+ countries: "US_CANADA_COUNTRIES",
876
+ regionId: "US_CANADA"
877
+ },
878
+ {
879
+ priority: "medium",
880
+ countries: "WORLD_COUNTRIES",
881
+ regionId: "WORLD"
882
+ },
883
+ {
884
+ priority: "low",
885
+ countries: "EUROPE_COUNTRIES",
886
+ regionId: "EUROPE"
887
+ }
888
+ ],
889
+ footer: [
890
+ {
891
+ href: "https://www.iatiglobal.com/mx/politica-de-privacidad",
892
+ label: "footer.privacyPolicy"
893
+ },
894
+ {
895
+ href: "https://www.iatiglobal.com/mx/aviso-legal/",
896
+ label: "footer.legalNotice"
897
+ },
898
+ {
899
+ href: "https://www.iatiglobal.com/mx/politica-de-cookies",
900
+ label: "footer.cookiePolicy"
901
+ },
902
+ {
903
+ href: "https://www.iatiglobal.com/mx/condiciones-generales/",
904
+ label: "footer.generalTerms"
905
+ },
906
+ {
907
+ href: "https://app.kenjo.io/whistleblower/3ee7e1d5ee59c6fe8b84b8fc9e02ee0284eb54213b4a4dd4c3914fba04c4ae4b",
908
+ label: "footer.ethicsChannel"
909
+ }
910
+ ],
911
+ documentTypeOptions: [
912
+ {
913
+ label: "Pasaporte",
914
+ value: "passport"
915
+ }
916
+ ],
917
+ dateFormat: "dd/MM/yyyy",
918
+ regionCode: "es-MX",
919
+ gtmId: "GTM-T2RSHCJ9",
920
+ paymentCardTypes: [
921
+ {
922
+ id: 1,
923
+ name: "Visa",
924
+ imagePath: "/assets/images/payments/visa.svg"
925
+ },
926
+ {
927
+ id: 2,
928
+ name: "Mastercard",
929
+ imagePath: "/assets/images/payments/mastercard.svg"
930
+ },
931
+ {
932
+ id: 3,
933
+ name: "Maestro",
934
+ imagePath: "/assets/images/payments/maestro.svg"
935
+ }
936
+ ],
937
+ webSitePath: "/mx"
938
+ };
939
+
940
+ // src/regions/compe.json
941
+ var compe_default = {
942
+ id: 8,
943
+ countriesToRedirect: {
944
+ es: {
945
+ label: "Espa\xF1a",
946
+ countries: [
947
+ {
948
+ countryId: "1",
949
+ name: "Espa\xF1a"
950
+ }
951
+ ]
952
+ },
953
+ pt: {
954
+ label: "Portugal",
955
+ countries: [
956
+ {
957
+ countryId: "190",
958
+ name: "Portugal"
959
+ }
960
+ ]
961
+ },
962
+ comco: {
963
+ label: "Colombia",
964
+ countries: [
965
+ {
966
+ countryId: "52",
967
+ name: "Colombia"
968
+ }
969
+ ]
970
+ },
971
+ commx: {
972
+ label: "M\xE9xico",
973
+ countries: [
974
+ {
975
+ countryId: "158",
976
+ name: "M\xE9xico"
977
+ }
978
+ ]
979
+ },
980
+ it: {
981
+ label: "Italia",
982
+ countries: [
983
+ {
984
+ countryId: "124",
985
+ name: "Italia"
986
+ }
987
+ ]
988
+ }
989
+ },
990
+ regionUrls: {
991
+ staging: "https://stg.iatiglobal.com/pe/",
992
+ production: "https://www.iatiglobal.com/pe/"
993
+ },
994
+ timeZone: "America/Lima",
995
+ regionsToGroup: [
996
+ {
997
+ priority: "high",
998
+ countries: "US_CANADA_COUNTRIES",
999
+ regionId: "US_CANADA"
1000
+ },
1001
+ {
1002
+ priority: "medium",
1003
+ countries: "WORLD_COUNTRIES",
1004
+ regionId: "WORLD"
1005
+ },
1006
+ {
1007
+ priority: "low",
1008
+ countries: "EUROPE_COUNTRIES",
1009
+ regionId: "EUROPE"
1010
+ }
1011
+ ],
1012
+ footer: [
1013
+ {
1014
+ href: "https://www.iatiglobal.com/pe/politica-de-privacidad",
1015
+ label: "footer.privacyPolicy"
1016
+ },
1017
+ {
1018
+ href: "https://www.iatiglobal.com/pe/aviso-legal/",
1019
+ label: "footer.legalNotice"
1020
+ },
1021
+ {
1022
+ href: "https://www.iatiglobal.com/pe/politica-de-cookies",
1023
+ label: "footer.cookiePolicy"
1024
+ },
1025
+ {
1026
+ href: "https://www.iatiglobal.com/pe/condiciones-generales/",
1027
+ label: "footer.generalTerms"
1028
+ },
1029
+ {
1030
+ href: "https://app.kenjo.io/whistleblower/3ee7e1d5ee59c6fe8b84b8fc9e02ee0284eb54213b4a4dd4c3914fba04c4ae4b",
1031
+ label: "footer.ethicsChannel"
1032
+ }
1033
+ ],
1034
+ documentTypeOptions: [
1035
+ {
1036
+ label: "Pasaporte",
1037
+ value: "passport"
1038
+ }
1039
+ ],
1040
+ dateFormat: "dd/MM/yyyy",
1041
+ regionCode: "es-PE",
1042
+ gtmId: "GTM-KLWFKMS7",
1043
+ paymentCardTypes: [
1044
+ {
1045
+ id: 1,
1046
+ name: "Visa",
1047
+ imagePath: "/assets/images/payments/visa.svg"
1048
+ },
1049
+ {
1050
+ id: 2,
1051
+ name: "Mastercard",
1052
+ imagePath: "/assets/images/payments/mastercard.svg"
1053
+ },
1054
+ {
1055
+ id: 3,
1056
+ name: "Maestro",
1057
+ imagePath: "/assets/images/payments/maestro.svg"
1058
+ }
1059
+ ],
1060
+ webSitePath: "/pe"
1061
+ };
1062
+
1063
+ // src/regions/es.json
1064
+ var es_default = {
1065
+ id: 1,
1066
+ countriesToRedirect: {
1067
+ comco: {
1068
+ label: "Colombia",
1069
+ countries: [
1070
+ {
1071
+ countryId: "52",
1072
+ name: "Colombia"
1073
+ }
1074
+ ]
1075
+ },
1076
+ commx: {
1077
+ label: "M\xE9xico",
1078
+ countries: [
1079
+ {
1080
+ countryId: "158",
1081
+ name: "M\xE9xico"
1082
+ }
1083
+ ]
1084
+ },
1085
+ compe: {
1086
+ label: "Per\xFA",
1087
+ countries: [
1088
+ {
1089
+ countryId: "187",
1090
+ name: "Per\xFA"
1091
+ }
1092
+ ]
1093
+ },
1094
+ pt: {
1095
+ label: "Portugal",
1096
+ countries: [
1097
+ {
1098
+ countryId: "190",
1099
+ name: "Portugal"
1100
+ }
1101
+ ]
1102
+ },
1103
+ it: {
1104
+ label: "Italia",
1105
+ countries: [
1106
+ {
1107
+ countryId: "124",
1108
+ name: "Italia"
1109
+ }
1110
+ ]
1111
+ }
1112
+ },
1113
+ regionUrls: {
1114
+ staging: "https://stg.iatiseguros.com",
1115
+ production: "https://www.iatiseguros.com"
1116
+ },
1117
+ timeZone: "Europe/Madrid",
1118
+ regionsToGroup: [
1119
+ {
1120
+ priority: "high",
1121
+ countries: "US_CANADA_JAPAN_COUNTRIES",
1122
+ regionId: "US_CANADA_JAPAN"
1123
+ },
1124
+ {
1125
+ priority: "medium",
1126
+ countries: "WORLD_COUNTRIES",
1127
+ regionId: "REST_OF_THE_WORLD"
1128
+ },
1129
+ {
1130
+ priority: "low",
1131
+ countries: "EUROPE_COUNTRIES",
1132
+ regionId: "EUROPE"
1133
+ }
1134
+ ],
1135
+ footer: [
1136
+ {
1137
+ href: "https://www.iatiseguros.com/es/politica-de-privacidad",
1138
+ label: "footer.privacyPolicy"
1139
+ },
1140
+ {
1141
+ href: "https://www.iatiseguros.com/es/aviso-legal",
1142
+ label: "footer.legalNotice"
1143
+ },
1144
+ {
1145
+ href: "https://www.iatiseguros.com/es/politica-de-cookies",
1146
+ label: "footer.cookiePolicy"
1147
+ },
1148
+ {
1149
+ href: "https://www.iatiseguros.com/es/condiciones-generales",
1150
+ label: "footer.generalTerms"
1151
+ },
1152
+ {
1153
+ href: "https://www.iatiseguros.com/es/canal-etico",
1154
+ label: "footer.ethicsChannel"
1155
+ }
1156
+ ],
1157
+ documentTypeOptions: [
1158
+ {
1159
+ label: "DNI",
1160
+ value: "nif"
1161
+ },
1162
+ {
1163
+ label: "NIE",
1164
+ value: "nie"
1165
+ },
1166
+ {
1167
+ label: "Pasaporte",
1168
+ value: "passport"
1169
+ }
1170
+ ],
1171
+ dateFormat: "dd/MM/yyyy",
1172
+ regionCode: "es-ES",
1173
+ gtmId: "GTM-TZF83VD",
1174
+ paymentCardTypes: [
1175
+ {
1176
+ id: 1,
1177
+ name: "Visa",
1178
+ imagePath: "/assets/images/payments/visa.svg"
1179
+ },
1180
+ {
1181
+ id: 2,
1182
+ name: "Mastercard",
1183
+ imagePath: "/assets/images/payments/mastercard.svg"
1184
+ },
1185
+ {
1186
+ id: 3,
1187
+ name: "Maestro",
1188
+ imagePath: "/assets/images/payments/maestro.svg"
1189
+ },
1190
+ {
1191
+ id: 4,
1192
+ name: "American Express",
1193
+ imagePath: "/assets/images/payments/american-express.svg"
1194
+ },
1195
+ {
1196
+ id: 5,
1197
+ name: "JCB",
1198
+ imagePath: "/assets/images/payments/jcb.svg"
1199
+ },
1200
+ {
1201
+ id: 6,
1202
+ name: "Diners Club",
1203
+ imagePath: "/assets/images/payments/diners-club.svg"
1204
+ }
1205
+ ]
1206
+ };
1207
+
1208
+ // src/regions/it.json
1209
+ var it_default = {
1210
+ id: 10,
1211
+ countriesToRedirect: {
1212
+ es: {
1213
+ label: "Spagna",
1214
+ countries: [
1215
+ {
1216
+ countryId: "1",
1217
+ name: "Espa\xF1a"
1218
+ }
1219
+ ]
1220
+ },
1221
+ pt: {
1222
+ label: "Portogallo",
1223
+ countries: [
1224
+ {
1225
+ countryId: "190",
1226
+ name: "Portugal"
1227
+ }
1228
+ ]
1229
+ },
1230
+ commx: {
1231
+ label: "Messico",
1232
+ countries: [
1233
+ {
1234
+ countryId: "158",
1235
+ name: "M\xE9xico"
1236
+ }
1237
+ ]
1238
+ },
1239
+ compe: {
1240
+ label: "Per\xF9",
1241
+ countries: [
1242
+ {
1243
+ countryId: "187",
1244
+ name: "Per\xFA"
1245
+ }
1246
+ ]
1247
+ },
1248
+ comco: {
1249
+ label: "Colombia",
1250
+ countries: [
1251
+ {
1252
+ countryId: "52",
1253
+ name: "Colombia"
1254
+ }
1255
+ ]
1256
+ }
1257
+ },
1258
+ regionUrls: {
1259
+ staging: "https://stg.iatiassicurazioni.it",
1260
+ production: "https://www.iatiassicurazioni.it"
1261
+ },
1262
+ timeZone: "Europe/Rome",
1263
+ regionsToGroup: [
1264
+ {
1265
+ priority: "high",
1266
+ countries: "US_CANADA_JAPAN_COUNTRIES",
1267
+ regionId: "US_CANADA_JAPAN"
1268
+ },
1269
+ {
1270
+ priority: "medium",
1271
+ countries: "WORLD_COUNTRIES",
1272
+ regionId: "REST_OF_THE_WORLD"
1273
+ },
1274
+ {
1275
+ priority: "low",
1276
+ countries: "EUROPE_COUNTRIES",
1277
+ regionId: "EUROPE"
1278
+ }
1279
+ ],
1280
+ footer: [
1281
+ {
1282
+ href: "https://www.iatiassicurazioni.it/privacy-sul-trattamento-di-dati-personali/",
1283
+ label: "footer.privacyPolicy"
1284
+ },
1285
+ {
1286
+ href: "https://www.iatiassicurazioni.it/note-legali/",
1287
+ label: "footer.legalNotice"
1288
+ },
1289
+ {
1290
+ href: "https://www.iatiassicurazioni.it/politica-sui-cookie/",
1291
+ label: "footer.cookiePolicy"
1292
+ },
1293
+ {
1294
+ href: "https://www.iatiassicurazioni.it/CONDIZIONI-GENERALI/",
1295
+ label: "footer.generalTerms"
1296
+ }
1297
+ ],
1298
+ documentTypeOptions: [
1299
+ {
1300
+ label: "Codice Fiscale",
1301
+ value: "fiscal_code"
1302
+ }
1303
+ ],
1304
+ dateFormat: "dd/MM/yyyy",
1305
+ regionCode: "it-IT",
1306
+ gtmId: "GTM-WL7HZFZF",
1307
+ paymentCardTypes: [
1308
+ {
1309
+ id: 1,
1310
+ name: "Visa",
1311
+ imagePath: "/assets/images/payments/visa.svg"
1312
+ },
1313
+ {
1314
+ id: 2,
1315
+ name: "Mastercard",
1316
+ imagePath: "/assets/images/payments/mastercard.svg"
1317
+ },
1318
+ {
1319
+ id: 3,
1320
+ name: "Maestro",
1321
+ imagePath: "/assets/images/payments/maestro.svg"
1322
+ },
1323
+ {
1324
+ id: 4,
1325
+ name: "American Express",
1326
+ imagePath: "/assets/images/payments/american-express.svg"
1327
+ },
1328
+ {
1329
+ id: 5,
1330
+ name: "JCB",
1331
+ imagePath: "/assets/images/payments/jcb.svg"
1332
+ },
1333
+ {
1334
+ id: 6,
1335
+ name: "Diners Club",
1336
+ imagePath: "/assets/images/payments/diners-club.svg"
1337
+ }
1338
+ ]
1339
+ };
1340
+
1341
+ // src/regions/pt.json
1342
+ var pt_default = {
1343
+ id: 2,
1344
+ countriesToRedirect: {
1345
+ es: {
1346
+ label: "Espanha",
1347
+ countries: [
1348
+ {
1349
+ countryId: "1",
1350
+ name: "Espa\xF1a"
1351
+ }
1352
+ ]
1353
+ },
1354
+ comco: {
1355
+ label: "Col\xF4mbia",
1356
+ countries: [
1357
+ {
1358
+ countryId: "52",
1359
+ name: "Colombia"
1360
+ }
1361
+ ]
1362
+ },
1363
+ commx: {
1364
+ label: "M\xE9xico",
1365
+ countries: [
1366
+ {
1367
+ countryId: "158",
1368
+ name: "M\xE9xico"
1369
+ }
1370
+ ]
1371
+ },
1372
+ compe: {
1373
+ label: "Peru",
1374
+ countries: [
1375
+ {
1376
+ countryId: "187",
1377
+ name: "Per\xFA"
1378
+ }
1379
+ ]
1380
+ },
1381
+ it: {
1382
+ label: "It\xE1lia",
1383
+ countries: [
1384
+ {
1385
+ countryId: "124",
1386
+ name: "Italia"
1387
+ }
1388
+ ]
1389
+ }
1390
+ },
1391
+ regionUrls: {
1392
+ staging: "https://stg.iatiseguros.pt",
1393
+ production: "https://www.iatiseguros.pt"
1394
+ },
1395
+ timeZone: "Europe/Lisbon",
1396
+ regionsToGroup: [
1397
+ {
1398
+ priority: "high",
1399
+ countries: "US_CANADA_JAPAN_COUNTRIES",
1400
+ regionId: "US_CANADA_JAPAN"
1401
+ },
1402
+ {
1403
+ priority: "medium",
1404
+ countries: "WORLD_COUNTRIES",
1405
+ regionId: "REST_OF_THE_WORLD"
1406
+ },
1407
+ {
1408
+ priority: "low",
1409
+ countries: "EUROPE_COUNTRIES",
1410
+ regionId: "EUROPE"
1411
+ }
1412
+ ],
1413
+ footer: [
1414
+ {
1415
+ href: "https://static.iatiseguros.pt/pt/documentos/politica-de-privacidade-PT.pdf?_gl=1*152nifg*_gcl_au*MTMxNDE5MDAxNC4xNzcwNzE5MjY5LjQyMjM3NC4xNzcwNzIzMzg2LjE3NzA3MjM0NDE",
1416
+ label: "footer.privacyPolicy"
1417
+ },
1418
+ {
1419
+ href: "https://www.iatiseguros.pt/aviso-legal/",
1420
+ label: "footer.legalNotice"
1421
+ },
1422
+ {
1423
+ href: "https://www.iatiseguros.pt/politica-de-cookies/",
1424
+ label: "footer.cookiePolicy"
1425
+ },
1426
+ {
1427
+ href: "https://static.iatiseguros.pt/pt/documentos/Condic\u0327o\u0303es+Gerais.pdf",
1428
+ label: "footer.generalTerms"
1429
+ },
1430
+ {
1431
+ href: "https://app.kenjo.io/whistleblower/3ee7e1d5ee59c6fe8b84b8fc9e02ee0284eb54213b4a4dd4c3914fba04c4ae4b?lang=en",
1432
+ label: "footer.ethicsChannel"
1433
+ }
1434
+ ],
1435
+ documentTypeOptions: [
1436
+ {
1437
+ label: "NIF",
1438
+ value: "nif"
1439
+ }
1440
+ ],
1441
+ documentTypeOptionsByOrigin: {
1442
+ local: [
1443
+ {
1444
+ label: "NIF",
1445
+ value: "nif"
1446
+ }
1447
+ ],
1448
+ foreign: [
1449
+ {
1450
+ label: "Passaporte",
1451
+ value: "passport"
1452
+ }
1453
+ ]
1454
+ },
1455
+ dateFormat: "dd/MM/yyyy",
1456
+ regionCode: "pt-PT",
1457
+ gtmId: "GTM-MWBFX7X",
1458
+ paymentCardTypes: [
1459
+ {
1460
+ id: 1,
1461
+ name: "Visa",
1462
+ imagePath: "/assets/images/payments/visa.svg"
1463
+ },
1464
+ {
1465
+ id: 2,
1466
+ name: "Mastercard",
1467
+ imagePath: "/assets/images/payments/mastercard.svg"
1468
+ },
1469
+ {
1470
+ id: 3,
1471
+ name: "Maestro",
1472
+ imagePath: "/assets/images/payments/maestro.svg"
1473
+ },
1474
+ {
1475
+ id: 4,
1476
+ name: "American Express",
1477
+ imagePath: "/assets/images/payments/american-express.svg"
1478
+ },
1479
+ {
1480
+ id: 5,
1481
+ name: "JCB",
1482
+ imagePath: "/assets/images/payments/jcb.svg"
1483
+ },
1484
+ {
1485
+ id: 6,
1486
+ name: "Diners Club",
1487
+ imagePath: "/assets/images/payments/diners-club.svg"
1488
+ }
1489
+ ]
1490
+ };
1491
+
1492
+ // src/regionsConfig.ts
1493
+ var resolveRegion = (region) => {
1494
+ var _a;
1495
+ const resolved = __spreadProps(__spreadValues({}, region), {
1496
+ regionsToGroup: (_a = region.regionsToGroup) == null ? void 0 : _a.map((group) => __spreadProps(__spreadValues({}, group), {
1497
+ countries: (() => {
1498
+ switch (group.countries) {
1499
+ case "US_CANADA_JAPAN_COUNTRIES":
1500
+ return US_CANADA_JAPAN_COUNTRIES;
1501
+ case "WORLD_COUNTRIES":
1502
+ return WORLD_COUNTRIES;
1503
+ case "EUROPE_COUNTRIES":
1504
+ return EUROPE_COUNTRIES;
1505
+ case "US_CANADA_COUNTRIES":
1506
+ return US_CANADA_COUNTRIES;
1507
+ default:
1508
+ return [];
1509
+ }
1510
+ })(),
1511
+ regionId: GROUP_REGIONS[group.regionId]
1512
+ }))
1513
+ });
1514
+ return RegionConfigSchema.parse(resolved);
1515
+ };
1516
+ var regionsConfig = Object.entries(regions_exports).reduce((acc, [key, value]) => {
1517
+ acc[key] = resolveRegion(value);
1518
+ return acc;
1519
+ }, {});
1520
+ var regionsConfig_default = regionsConfig;
1521
+
1522
+ // src/utils/getRegionConfig.ts
1523
+ var getRegionConfig = (name) => {
1524
+ const key = name.replace(/[/-]/g, "").toLowerCase();
1525
+ return regionsConfig_default[key];
1526
+ };
1527
+
1528
+ // src/utils/getRegionConfigById.ts
1529
+ var getRegionConfigById = (id) => {
1530
+ const region = Object.values(regionsConfig_default).find((region2) => region2.id === id);
1531
+ if (!region) throw new Error(`Region with id ${id} not found`);
1532
+ return region;
1533
+ };
1534
+
1535
+ // src/utils/getRegionConfigByRegionCode.ts
1536
+ var getRegionConfigByRegionCode = (regionCode) => {
1537
+ const region = Object.values(regionsConfig_default).find((region2) => region2.regionCode === regionCode);
1538
+ if (!region) throw new Error(`Region with code ${regionCode} not found`);
1539
+ return region;
1540
+ };
1541
+
1542
+ // src/utils/resolveDocumentTypeOptions.ts
1543
+ var resolveDocumentTypeOptions = (documentTypeOptions, documentTypeOptionsByOrigin, originCountryId, siteCountryId) => {
1544
+ if (!documentTypeOptionsByOrigin) return documentTypeOptions;
1545
+ if (!originCountryId || !siteCountryId) return documentTypeOptions;
1546
+ const isLocal = String(originCountryId) === String(siteCountryId);
1547
+ return isLocal ? documentTypeOptionsByOrigin.local : documentTypeOptionsByOrigin.foreign;
1548
+ };
1549
+
1550
+ // src/validators/validateRegion.ts
1551
+ var validateRegion = (region) => {
1552
+ if (!Object.values(regionsConfig_default).some((regionConfig) => regionConfig.regionCode === region)) {
1553
+ throw new Error(`Invalid region: ${region}`);
1554
+ }
1555
+ };
1556
+ // Annotate the CommonJS export names for ESM import in node:
1557
+ 0 && (module.exports = {
1558
+ EUROPE_COUNTRIES,
1559
+ GROUP_REGIONS,
1560
+ RegionConfigSchema,
1561
+ US_CANADA_COUNTRIES,
1562
+ US_CANADA_JAPAN_COUNTRIES,
1563
+ WORLD_COUNTRIES,
1564
+ getRegionConfig,
1565
+ getRegionConfigById,
1566
+ getRegionConfigByRegionCode,
1567
+ regionsConfig,
1568
+ resolveDocumentTypeOptions,
1569
+ validateRegion
1570
+ });