@singi-labs/sifa-sdk 0.1.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,919 @@
1
+ // src/taxonomy/continents.ts
2
+ var CONTINENTS = [
3
+ { code: "AF", name: "Africa" },
4
+ { code: "AN", name: "Antarctica" },
5
+ { code: "AS", name: "Asia" },
6
+ { code: "EU", name: "Europe" },
7
+ { code: "NA", name: "North America" },
8
+ { code: "OC", name: "Oceania" },
9
+ { code: "SA", name: "South America" }
10
+ ];
11
+ var COUNTRY_TO_CONTINENT = {
12
+ AD: "EU",
13
+ AE: "AS",
14
+ AF: "AS",
15
+ AG: "NA",
16
+ AL: "EU",
17
+ AM: "AS",
18
+ AO: "AF",
19
+ AR: "SA",
20
+ AT: "EU",
21
+ AU: "OC",
22
+ AZ: "AS",
23
+ BA: "EU",
24
+ BB: "NA",
25
+ BD: "AS",
26
+ BE: "EU",
27
+ BF: "AF",
28
+ BG: "EU",
29
+ BH: "AS",
30
+ BI: "AF",
31
+ BJ: "AF",
32
+ BN: "AS",
33
+ BO: "SA",
34
+ BR: "SA",
35
+ BS: "NA",
36
+ BT: "AS",
37
+ BW: "AF",
38
+ BY: "EU",
39
+ BZ: "NA",
40
+ CA: "NA",
41
+ CD: "AF",
42
+ CF: "AF",
43
+ CG: "AF",
44
+ CH: "EU",
45
+ CI: "AF",
46
+ CL: "SA",
47
+ CM: "AF",
48
+ CN: "AS",
49
+ CO: "SA",
50
+ CR: "NA",
51
+ CU: "NA",
52
+ CV: "AF",
53
+ CY: "AS",
54
+ CZ: "EU",
55
+ DE: "EU",
56
+ DJ: "AF",
57
+ DK: "EU",
58
+ DM: "NA",
59
+ DO: "NA",
60
+ DZ: "AF",
61
+ EC: "SA",
62
+ EE: "EU",
63
+ EG: "AF",
64
+ ER: "AF",
65
+ ES: "EU",
66
+ ET: "AF",
67
+ FI: "EU",
68
+ FJ: "OC",
69
+ FR: "EU",
70
+ GA: "AF",
71
+ GB: "EU",
72
+ GD: "NA",
73
+ GE: "AS",
74
+ GH: "AF",
75
+ GM: "AF",
76
+ GN: "AF",
77
+ GQ: "AF",
78
+ GR: "EU",
79
+ GT: "NA",
80
+ GW: "AF",
81
+ GY: "SA",
82
+ HK: "AS",
83
+ HN: "NA",
84
+ HR: "EU",
85
+ HT: "NA",
86
+ HU: "EU",
87
+ ID: "AS",
88
+ IE: "EU",
89
+ IL: "AS",
90
+ IN: "AS",
91
+ IQ: "AS",
92
+ IR: "AS",
93
+ IS: "EU",
94
+ IT: "EU",
95
+ JM: "NA",
96
+ JO: "AS",
97
+ JP: "AS",
98
+ KE: "AF",
99
+ KG: "AS",
100
+ KH: "AS",
101
+ KM: "AF",
102
+ KN: "NA",
103
+ KP: "AS",
104
+ KR: "AS",
105
+ KW: "AS",
106
+ KZ: "AS",
107
+ LA: "AS",
108
+ LB: "AS",
109
+ LC: "NA",
110
+ LI: "EU",
111
+ LK: "AS",
112
+ LR: "AF",
113
+ LS: "AF",
114
+ LT: "EU",
115
+ LU: "EU",
116
+ LV: "EU",
117
+ LY: "AF",
118
+ MA: "AF",
119
+ MC: "EU",
120
+ MD: "EU",
121
+ ME: "EU",
122
+ MG: "AF",
123
+ MK: "EU",
124
+ ML: "AF",
125
+ MM: "AS",
126
+ MN: "AS",
127
+ MO: "AS",
128
+ MR: "AF",
129
+ MT: "EU",
130
+ MU: "AF",
131
+ MV: "AS",
132
+ MW: "AF",
133
+ MX: "NA",
134
+ MY: "AS",
135
+ MZ: "AF",
136
+ NA: "AF",
137
+ NE: "AF",
138
+ NG: "AF",
139
+ NI: "NA",
140
+ NL: "EU",
141
+ NO: "EU",
142
+ NP: "AS",
143
+ NZ: "OC",
144
+ OM: "AS",
145
+ PA: "NA",
146
+ PE: "SA",
147
+ PG: "OC",
148
+ PH: "AS",
149
+ PK: "AS",
150
+ PL: "EU",
151
+ PR: "NA",
152
+ PS: "AS",
153
+ PT: "EU",
154
+ PY: "SA",
155
+ QA: "AS",
156
+ RO: "EU",
157
+ RS: "EU",
158
+ RU: "EU",
159
+ RW: "AF",
160
+ SA: "AS",
161
+ SB: "OC",
162
+ SC: "AF",
163
+ SD: "AF",
164
+ SE: "EU",
165
+ SG: "AS",
166
+ SI: "EU",
167
+ SK: "EU",
168
+ SL: "AF",
169
+ SM: "EU",
170
+ SN: "AF",
171
+ SO: "AF",
172
+ SR: "SA",
173
+ SS: "AF",
174
+ ST: "AF",
175
+ SV: "NA",
176
+ SY: "AS",
177
+ SZ: "AF",
178
+ TD: "AF",
179
+ TG: "AF",
180
+ TH: "AS",
181
+ TJ: "AS",
182
+ TL: "AS",
183
+ TM: "AS",
184
+ TN: "AF",
185
+ TO: "OC",
186
+ TR: "AS",
187
+ TT: "NA",
188
+ TW: "AS",
189
+ TZ: "AF",
190
+ UA: "EU",
191
+ UG: "AF",
192
+ US: "NA",
193
+ UY: "SA",
194
+ UZ: "AS",
195
+ VA: "EU",
196
+ VC: "NA",
197
+ VE: "SA",
198
+ VN: "AS",
199
+ VU: "OC",
200
+ WS: "OC",
201
+ XK: "EU",
202
+ YE: "AS",
203
+ ZA: "AF",
204
+ ZM: "AF",
205
+ ZW: "AF"
206
+ };
207
+ function getContinent(countryCode) {
208
+ if (!countryCode) return null;
209
+ return COUNTRY_TO_CONTINENT[countryCode.toUpperCase()] ?? null;
210
+ }
211
+
212
+ // src/taxonomy/countries.ts
213
+ var COUNTRIES = [
214
+ { code: "AF", name: "Afghanistan" },
215
+ { code: "AL", name: "Albania" },
216
+ { code: "DZ", name: "Algeria" },
217
+ { code: "AD", name: "Andorra" },
218
+ { code: "AO", name: "Angola" },
219
+ { code: "AG", name: "Antigua and Barbuda" },
220
+ { code: "AR", name: "Argentina" },
221
+ { code: "AM", name: "Armenia" },
222
+ { code: "AU", name: "Australia" },
223
+ { code: "AT", name: "Austria" },
224
+ { code: "AZ", name: "Azerbaijan" },
225
+ { code: "BS", name: "Bahamas" },
226
+ { code: "BH", name: "Bahrain" },
227
+ { code: "BD", name: "Bangladesh" },
228
+ { code: "BB", name: "Barbados" },
229
+ { code: "BY", name: "Belarus" },
230
+ { code: "BE", name: "Belgium" },
231
+ { code: "BZ", name: "Belize" },
232
+ { code: "BJ", name: "Benin" },
233
+ { code: "BT", name: "Bhutan" },
234
+ { code: "BO", name: "Bolivia" },
235
+ { code: "BA", name: "Bosnia and Herzegovina" },
236
+ { code: "BW", name: "Botswana" },
237
+ { code: "BR", name: "Brazil" },
238
+ { code: "BN", name: "Brunei" },
239
+ { code: "BG", name: "Bulgaria" },
240
+ { code: "BF", name: "Burkina Faso" },
241
+ { code: "BI", name: "Burundi" },
242
+ { code: "CV", name: "Cabo Verde" },
243
+ { code: "KH", name: "Cambodia" },
244
+ { code: "CM", name: "Cameroon" },
245
+ { code: "CA", name: "Canada" },
246
+ { code: "CF", name: "Central African Republic" },
247
+ { code: "TD", name: "Chad" },
248
+ { code: "CL", name: "Chile" },
249
+ { code: "CN", name: "China" },
250
+ { code: "CO", name: "Colombia" },
251
+ { code: "KM", name: "Comoros" },
252
+ { code: "CG", name: "Congo" },
253
+ { code: "CD", name: "Congo (DRC)" },
254
+ { code: "CR", name: "Costa Rica" },
255
+ { code: "CI", name: "Cote d'Ivoire" },
256
+ { code: "HR", name: "Croatia" },
257
+ { code: "CU", name: "Cuba" },
258
+ { code: "CY", name: "Cyprus" },
259
+ { code: "CZ", name: "Czechia" },
260
+ { code: "DK", name: "Denmark" },
261
+ { code: "DJ", name: "Djibouti" },
262
+ { code: "DM", name: "Dominica" },
263
+ { code: "DO", name: "Dominican Republic" },
264
+ { code: "EC", name: "Ecuador" },
265
+ { code: "EG", name: "Egypt" },
266
+ { code: "SV", name: "El Salvador" },
267
+ { code: "GQ", name: "Equatorial Guinea" },
268
+ { code: "ER", name: "Eritrea" },
269
+ { code: "EE", name: "Estonia" },
270
+ { code: "SZ", name: "Eswatini" },
271
+ { code: "ET", name: "Ethiopia" },
272
+ { code: "FJ", name: "Fiji" },
273
+ { code: "FI", name: "Finland" },
274
+ { code: "FR", name: "France" },
275
+ { code: "GA", name: "Gabon" },
276
+ { code: "GM", name: "Gambia" },
277
+ { code: "GE", name: "Georgia" },
278
+ { code: "DE", name: "Germany" },
279
+ { code: "GH", name: "Ghana" },
280
+ { code: "GR", name: "Greece" },
281
+ { code: "GD", name: "Grenada" },
282
+ { code: "GT", name: "Guatemala" },
283
+ { code: "GN", name: "Guinea" },
284
+ { code: "GW", name: "Guinea-Bissau" },
285
+ { code: "GY", name: "Guyana" },
286
+ { code: "HT", name: "Haiti" },
287
+ { code: "HN", name: "Honduras" },
288
+ { code: "HU", name: "Hungary" },
289
+ { code: "IS", name: "Iceland" },
290
+ { code: "IN", name: "India" },
291
+ { code: "ID", name: "Indonesia" },
292
+ { code: "IR", name: "Iran" },
293
+ { code: "IQ", name: "Iraq" },
294
+ { code: "IE", name: "Ireland" },
295
+ { code: "IL", name: "Israel" },
296
+ { code: "IT", name: "Italy" },
297
+ { code: "JM", name: "Jamaica" },
298
+ { code: "JP", name: "Japan" },
299
+ { code: "JO", name: "Jordan" },
300
+ { code: "KZ", name: "Kazakhstan" },
301
+ { code: "KE", name: "Kenya" },
302
+ { code: "KI", name: "Kiribati" },
303
+ { code: "KP", name: "North Korea" },
304
+ { code: "KR", name: "South Korea" },
305
+ { code: "KW", name: "Kuwait" },
306
+ { code: "KG", name: "Kyrgyzstan" },
307
+ { code: "LA", name: "Laos" },
308
+ { code: "LV", name: "Latvia" },
309
+ { code: "LB", name: "Lebanon" },
310
+ { code: "LS", name: "Lesotho" },
311
+ { code: "LR", name: "Liberia" },
312
+ { code: "LY", name: "Libya" },
313
+ { code: "LI", name: "Liechtenstein" },
314
+ { code: "LT", name: "Lithuania" },
315
+ { code: "LU", name: "Luxembourg" },
316
+ { code: "MG", name: "Madagascar" },
317
+ { code: "MW", name: "Malawi" },
318
+ { code: "MY", name: "Malaysia" },
319
+ { code: "MV", name: "Maldives" },
320
+ { code: "ML", name: "Mali" },
321
+ { code: "MT", name: "Malta" },
322
+ { code: "MH", name: "Marshall Islands" },
323
+ { code: "MR", name: "Mauritania" },
324
+ { code: "MU", name: "Mauritius" },
325
+ { code: "MX", name: "Mexico" },
326
+ { code: "FM", name: "Micronesia" },
327
+ { code: "MD", name: "Moldova" },
328
+ { code: "MC", name: "Monaco" },
329
+ { code: "MN", name: "Mongolia" },
330
+ { code: "ME", name: "Montenegro" },
331
+ { code: "MA", name: "Morocco" },
332
+ { code: "MZ", name: "Mozambique" },
333
+ { code: "MM", name: "Myanmar" },
334
+ { code: "NA", name: "Namibia" },
335
+ { code: "NR", name: "Nauru" },
336
+ { code: "NP", name: "Nepal" },
337
+ { code: "NL", name: "Netherlands" },
338
+ { code: "NZ", name: "New Zealand" },
339
+ { code: "NI", name: "Nicaragua" },
340
+ { code: "NE", name: "Niger" },
341
+ { code: "NG", name: "Nigeria" },
342
+ { code: "MK", name: "North Macedonia" },
343
+ { code: "NO", name: "Norway" },
344
+ { code: "OM", name: "Oman" },
345
+ { code: "PK", name: "Pakistan" },
346
+ { code: "PW", name: "Palau" },
347
+ { code: "PS", name: "Palestine" },
348
+ { code: "PA", name: "Panama" },
349
+ { code: "PG", name: "Papua New Guinea" },
350
+ { code: "PY", name: "Paraguay" },
351
+ { code: "PE", name: "Peru" },
352
+ { code: "PH", name: "Philippines" },
353
+ { code: "PL", name: "Poland" },
354
+ { code: "PT", name: "Portugal" },
355
+ { code: "QA", name: "Qatar" },
356
+ { code: "RO", name: "Romania" },
357
+ { code: "RU", name: "Russia" },
358
+ { code: "RW", name: "Rwanda" },
359
+ { code: "KN", name: "Saint Kitts and Nevis" },
360
+ { code: "LC", name: "Saint Lucia" },
361
+ { code: "VC", name: "Saint Vincent and the Grenadines" },
362
+ { code: "WS", name: "Samoa" },
363
+ { code: "SM", name: "San Marino" },
364
+ { code: "ST", name: "Sao Tome and Principe" },
365
+ { code: "SA", name: "Saudi Arabia" },
366
+ { code: "SN", name: "Senegal" },
367
+ { code: "RS", name: "Serbia" },
368
+ { code: "SC", name: "Seychelles" },
369
+ { code: "SL", name: "Sierra Leone" },
370
+ { code: "SG", name: "Singapore" },
371
+ { code: "SK", name: "Slovakia" },
372
+ { code: "SI", name: "Slovenia" },
373
+ { code: "SB", name: "Solomon Islands" },
374
+ { code: "SO", name: "Somalia" },
375
+ { code: "ZA", name: "South Africa" },
376
+ { code: "SS", name: "South Sudan" },
377
+ { code: "ES", name: "Spain" },
378
+ { code: "LK", name: "Sri Lanka" },
379
+ { code: "SD", name: "Sudan" },
380
+ { code: "SR", name: "Suriname" },
381
+ { code: "SE", name: "Sweden" },
382
+ { code: "CH", name: "Switzerland" },
383
+ { code: "SY", name: "Syria" },
384
+ { code: "TW", name: "Taiwan" },
385
+ { code: "TJ", name: "Tajikistan" },
386
+ { code: "TZ", name: "Tanzania" },
387
+ { code: "TH", name: "Thailand" },
388
+ { code: "TL", name: "Timor-Leste" },
389
+ { code: "TG", name: "Togo" },
390
+ { code: "TO", name: "Tonga" },
391
+ { code: "TT", name: "Trinidad and Tobago" },
392
+ { code: "TN", name: "Tunisia" },
393
+ { code: "TR", name: "Turkey" },
394
+ { code: "TM", name: "Turkmenistan" },
395
+ { code: "TV", name: "Tuvalu" },
396
+ { code: "UG", name: "Uganda" },
397
+ { code: "UA", name: "Ukraine" },
398
+ { code: "AE", name: "United Arab Emirates" },
399
+ { code: "GB", name: "United Kingdom" },
400
+ { code: "US", name: "United States" },
401
+ { code: "UY", name: "Uruguay" },
402
+ { code: "UZ", name: "Uzbekistan" },
403
+ { code: "VU", name: "Vanuatu" },
404
+ { code: "VA", name: "Vatican City" },
405
+ { code: "VE", name: "Venezuela" },
406
+ { code: "VN", name: "Vietnam" },
407
+ { code: "YE", name: "Yemen" },
408
+ { code: "ZM", name: "Zambia" },
409
+ { code: "ZW", name: "Zimbabwe" }
410
+ ];
411
+
412
+ // src/taxonomy/industry-taxonomy.ts
413
+ var INDUSTRY_OPTIONS = [
414
+ {
415
+ value: "id.sifa.defs#industryTechnology",
416
+ labelKey: "industryTechnology",
417
+ domains: [
418
+ { value: "id.sifa.defs#domainSoftwareEngineering", labelKey: "domainSoftwareEngineering" },
419
+ { value: "id.sifa.defs#domainDataScience", labelKey: "domainDataScience" },
420
+ { value: "id.sifa.defs#domainCybersecurity", labelKey: "domainCybersecurity" },
421
+ { value: "id.sifa.defs#domainDevops", labelKey: "domainDevops" },
422
+ { value: "id.sifa.defs#domainProductDesign", labelKey: "domainProductDesign" },
423
+ { value: "id.sifa.defs#domainGameDev", labelKey: "domainGameDev" }
424
+ ]
425
+ },
426
+ {
427
+ value: "id.sifa.defs#industryFinance",
428
+ labelKey: "industryFinance",
429
+ domains: [
430
+ { value: "id.sifa.defs#domainBanking", labelKey: "domainBanking" },
431
+ { value: "id.sifa.defs#domainFintech", labelKey: "domainFintech" },
432
+ { value: "id.sifa.defs#domainInsurance", labelKey: "domainInsurance" },
433
+ { value: "id.sifa.defs#domainInvestmentMgmt", labelKey: "domainInvestmentMgmt" }
434
+ ]
435
+ },
436
+ {
437
+ value: "id.sifa.defs#industryHealthcare",
438
+ labelKey: "industryHealthcare",
439
+ domains: [
440
+ { value: "id.sifa.defs#domainClinicalResearch", labelKey: "domainClinicalResearch" },
441
+ { value: "id.sifa.defs#domainHealthtech", labelKey: "domainHealthtech" },
442
+ { value: "id.sifa.defs#domainPharma", labelKey: "domainPharma" }
443
+ ]
444
+ },
445
+ {
446
+ value: "id.sifa.defs#industryEducation",
447
+ labelKey: "industryEducation",
448
+ domains: [
449
+ { value: "id.sifa.defs#domainHigherEd", labelKey: "domainHigherEd" },
450
+ { value: "id.sifa.defs#domainEdtech", labelKey: "domainEdtech" },
451
+ { value: "id.sifa.defs#domainPrimarySecondary", labelKey: "domainPrimarySecondary" }
452
+ ]
453
+ },
454
+ {
455
+ value: "id.sifa.defs#industryMedia",
456
+ labelKey: "industryMedia",
457
+ domains: [
458
+ { value: "id.sifa.defs#domainJournalism", labelKey: "domainJournalism" },
459
+ { value: "id.sifa.defs#domainFilmVideo", labelKey: "domainFilmVideo" },
460
+ { value: "id.sifa.defs#domainGaming", labelKey: "domainGaming" },
461
+ { value: "id.sifa.defs#domainAdvertising", labelKey: "domainAdvertising" }
462
+ ]
463
+ },
464
+ {
465
+ value: "id.sifa.defs#industryRetail",
466
+ labelKey: "industryRetail",
467
+ domains: [
468
+ { value: "id.sifa.defs#domainEcommerce", labelKey: "domainEcommerce" },
469
+ { value: "id.sifa.defs#domainSupplyChain", labelKey: "domainSupplyChain" }
470
+ ]
471
+ },
472
+ {
473
+ value: "id.sifa.defs#industryManufacturing",
474
+ labelKey: "industryManufacturing",
475
+ domains: [
476
+ { value: "id.sifa.defs#domainAutomotive", labelKey: "domainAutomotive" },
477
+ { value: "id.sifa.defs#domainAerospace", labelKey: "domainAerospace" },
478
+ { value: "id.sifa.defs#domainHardware", labelKey: "domainHardware" }
479
+ ]
480
+ },
481
+ {
482
+ value: "id.sifa.defs#industryEnergy",
483
+ labelKey: "industryEnergy",
484
+ domains: [
485
+ { value: "id.sifa.defs#domainRenewables", labelKey: "domainRenewables" },
486
+ { value: "id.sifa.defs#domainOilGas", labelKey: "domainOilGas" },
487
+ { value: "id.sifa.defs#domainClimateTech", labelKey: "domainClimateTech" }
488
+ ]
489
+ },
490
+ {
491
+ value: "id.sifa.defs#industryGovernment",
492
+ labelKey: "industryGovernment",
493
+ domains: [
494
+ { value: "id.sifa.defs#domainPublicPolicy", labelKey: "domainPublicPolicy" },
495
+ { value: "id.sifa.defs#domainDefense", labelKey: "domainDefense" }
496
+ ]
497
+ },
498
+ {
499
+ value: "id.sifa.defs#industryLegal",
500
+ labelKey: "industryLegal",
501
+ domains: [
502
+ { value: "id.sifa.defs#domainIpLaw", labelKey: "domainIpLaw" },
503
+ { value: "id.sifa.defs#domainCompliance", labelKey: "domainCompliance" }
504
+ ]
505
+ },
506
+ {
507
+ value: "id.sifa.defs#industryConsulting",
508
+ labelKey: "industryConsulting",
509
+ domains: [
510
+ { value: "id.sifa.defs#domainManagementConsulting", labelKey: "domainManagementConsulting" },
511
+ { value: "id.sifa.defs#domainDevrel", labelKey: "domainDevrel" },
512
+ { value: "id.sifa.defs#domainHrRecruitment", labelKey: "domainHrRecruitment" }
513
+ ]
514
+ },
515
+ {
516
+ value: "id.sifa.defs#industryNonprofit",
517
+ labelKey: "industryNonprofit",
518
+ domains: [
519
+ { value: "id.sifa.defs#domainHumanRights", labelKey: "domainHumanRights" },
520
+ { value: "id.sifa.defs#domainOpenSource", labelKey: "domainOpenSource" }
521
+ ]
522
+ },
523
+ {
524
+ value: "id.sifa.defs#industryRealEstate",
525
+ labelKey: "industryRealEstate",
526
+ domains: [{ value: "id.sifa.defs#domainProptech", labelKey: "domainProptech" }]
527
+ },
528
+ {
529
+ value: "id.sifa.defs#industryTransport",
530
+ labelKey: "industryTransport",
531
+ domains: [
532
+ { value: "id.sifa.defs#domainAutonomousVehicles", labelKey: "domainAutonomousVehicles" },
533
+ { value: "id.sifa.defs#domainLogistics", labelKey: "domainLogistics" }
534
+ ]
535
+ },
536
+ {
537
+ value: "id.sifa.defs#industryAgriculture",
538
+ labelKey: "industryAgriculture",
539
+ domains: [
540
+ { value: "id.sifa.defs#domainAgritech", labelKey: "domainAgritech" },
541
+ { value: "id.sifa.defs#domainFoodTech", labelKey: "domainFoodTech" }
542
+ ]
543
+ },
544
+ {
545
+ value: "id.sifa.defs#industryHospitality",
546
+ labelKey: "industryHospitality",
547
+ domains: [
548
+ { value: "id.sifa.defs#domainHotels", labelKey: "domainHotels" },
549
+ { value: "id.sifa.defs#domainTravelTourism", labelKey: "domainTravelTourism" },
550
+ { value: "id.sifa.defs#domainFoodBeverage", labelKey: "domainFoodBeverage" }
551
+ ]
552
+ },
553
+ {
554
+ value: "id.sifa.defs#industryTelecom",
555
+ labelKey: "industryTelecom",
556
+ domains: [
557
+ { value: "id.sifa.defs#domainNetworkInfra", labelKey: "domainNetworkInfra" },
558
+ { value: "id.sifa.defs#domainMobileServices", labelKey: "domainMobileServices" }
559
+ ]
560
+ },
561
+ {
562
+ value: "id.sifa.defs#industryMining",
563
+ labelKey: "industryMining",
564
+ domains: [
565
+ { value: "id.sifa.defs#domainExtraction", labelKey: "domainExtraction" },
566
+ { value: "id.sifa.defs#domainGeological", labelKey: "domainGeological" }
567
+ ]
568
+ },
569
+ {
570
+ value: "id.sifa.defs#industryFashion",
571
+ labelKey: "industryFashion",
572
+ domains: [
573
+ { value: "id.sifa.defs#domainFashionDesign", labelKey: "domainFashionDesign" },
574
+ { value: "id.sifa.defs#domainTextileManufacturing", labelKey: "domainTextileManufacturing" }
575
+ ]
576
+ },
577
+ {
578
+ value: "id.sifa.defs#industryMaritime",
579
+ labelKey: "industryMaritime",
580
+ domains: [
581
+ { value: "id.sifa.defs#domainShipping", labelKey: "domainShipping" },
582
+ { value: "id.sifa.defs#domainPortOperations", labelKey: "domainPortOperations" },
583
+ { value: "id.sifa.defs#domainNavalArchitecture", labelKey: "domainNavalArchitecture" }
584
+ ]
585
+ },
586
+ {
587
+ value: "id.sifa.defs#industryOther",
588
+ labelKey: "industryOther",
589
+ domains: []
590
+ }
591
+ ];
592
+
593
+ // src/taxonomy/platforms.ts
594
+ var PLATFORM_LABELS = {
595
+ bluesky: "Bluesky",
596
+ github: "GitHub",
597
+ linkedin: "LinkedIn",
598
+ youtube: "YouTube",
599
+ twitter: "X (Twitter)",
600
+ instagram: "Instagram",
601
+ substack: "Substack",
602
+ tangled: "Tangled",
603
+ dns: "Domain",
604
+ website: "Website",
605
+ rss: "RSS",
606
+ fediverse: "Fediverse",
607
+ orcid: "ORCID",
608
+ keyoxide: "Keyoxide"
609
+ };
610
+ function isKnownPlatform(platform) {
611
+ return platform in PLATFORM_LABELS;
612
+ }
613
+ function getPlatformLabel(platform) {
614
+ return isKnownPlatform(platform) ? PLATFORM_LABELS[platform] : PLATFORM_LABELS.website;
615
+ }
616
+ var EXCLUDED_FROM_DROPDOWN = /* @__PURE__ */ new Set(["bluesky", "dns", "tangled"]);
617
+ var PLATFORM_OPTIONS = Object.entries(PLATFORM_LABELS).filter(([value]) => !EXCLUDED_FROM_DROPDOWN.has(value)).map(([value, label]) => ({ value, label }));
618
+ function getFaviconUrl(siteUrl) {
619
+ try {
620
+ const { hostname } = new URL(siteUrl);
621
+ return `https://www.google.com/s2/favicons?domain=${encodeURIComponent(hostname)}&sz=32`;
622
+ } catch {
623
+ return null;
624
+ }
625
+ }
626
+
627
+ // src/taxonomy/skill-categories.ts
628
+ var SKILL_CATEGORIES = [
629
+ { value: "technical", label: "Technical" },
630
+ { value: "business", label: "Business" },
631
+ { value: "creative", label: "Creative" },
632
+ { value: "interpersonal", label: "Interpersonal" },
633
+ { value: "industry", label: "Industry" },
634
+ { value: "community", label: "Community" },
635
+ { value: "security", label: "Security" }
636
+ ];
637
+ var CATEGORY_ORDER = SKILL_CATEGORIES.map((c) => c.value);
638
+ var CATEGORY_LABELS = {
639
+ ...Object.fromEntries(SKILL_CATEGORIES.map((c) => [c.value, c.label])),
640
+ other: "Other"
641
+ };
642
+
643
+ // src/taxonomy/skill-grouping.ts
644
+ function dedupeSkills(skills) {
645
+ const groups = /* @__PURE__ */ new Map();
646
+ for (const skill of skills) {
647
+ const key = skill.name.trim().toLowerCase();
648
+ const existing = groups.get(key);
649
+ const positions = skill.positionRkeys ?? [];
650
+ if (!existing) {
651
+ groups.set(key, {
652
+ ...skill,
653
+ mergedRkeys: [skill.rkey],
654
+ positionRkeys: [...positions]
655
+ });
656
+ continue;
657
+ }
658
+ existing.mergedRkeys.push(skill.rkey);
659
+ if (!existing.category && skill.category) existing.category = skill.category;
660
+ if ((skill.endorsementCount ?? 0) > (existing.endorsementCount ?? 0)) {
661
+ existing.endorsementCount = skill.endorsementCount;
662
+ }
663
+ if (skill.endorsed) existing.endorsed = true;
664
+ if (skill.activityBacked) existing.activityBacked = true;
665
+ const merged = /* @__PURE__ */ new Set([...existing.positionRkeys ?? [], ...positions]);
666
+ existing.positionRkeys = Array.from(merged);
667
+ }
668
+ return Array.from(groups.values());
669
+ }
670
+ function groupSkillsByCategory(skills) {
671
+ const grouped = /* @__PURE__ */ new Map();
672
+ for (const skill of skills) {
673
+ const normalised = skill.category?.toLowerCase().trim() ?? "";
674
+ const key = CATEGORY_ORDER.includes(normalised) ? normalised : "other";
675
+ const bucket = grouped.get(key) ?? [];
676
+ bucket.push(skill);
677
+ grouped.set(key, bucket);
678
+ }
679
+ for (const [, groupSkills] of grouped) {
680
+ groupSkills.sort((a, b) => {
681
+ const countDiff = (b.endorsementCount ?? 0) - (a.endorsementCount ?? 0);
682
+ if (countDiff !== 0) return countDiff;
683
+ return a.name.localeCompare(b.name);
684
+ });
685
+ }
686
+ const ordered = [];
687
+ for (const cat of CATEGORY_ORDER) {
688
+ const group = grouped.get(cat);
689
+ if (group?.length) ordered.push([cat, group]);
690
+ }
691
+ const otherGroup = grouped.get("other");
692
+ if (otherGroup?.length) ordered.push(["other", otherGroup]);
693
+ return ordered;
694
+ }
695
+
696
+ // src/format/format-time.ts
697
+ function formatRelativeTime(dateString) {
698
+ const date = new Date(dateString);
699
+ if (isNaN(date.getTime())) return "";
700
+ const now = Date.now();
701
+ const diffMs = now - date.getTime();
702
+ if (diffMs < 0) return "";
703
+ const seconds = Math.floor(diffMs / 1e3);
704
+ if (seconds < 60) return `${seconds}s ago`;
705
+ const minutes = Math.floor(seconds / 60);
706
+ if (minutes < 60) return `${minutes}m ago`;
707
+ const hours = Math.floor(minutes / 60);
708
+ if (hours < 24) return `${hours}h ago`;
709
+ const days = Math.floor(hours / 24);
710
+ if (days < 30) return `${days}d ago`;
711
+ const months = Math.floor(days / 30);
712
+ if (months < 12) return `${months}mo ago`;
713
+ const years = Math.floor(months / 12);
714
+ return `${years}y ago`;
715
+ }
716
+
717
+ // src/format/sort-by-date.ts
718
+ var FAR_FUTURE = "9999-12-31";
719
+ var FAR_PAST = "0000-01-01";
720
+ function sortByDateDesc(items, extract) {
721
+ return [...items].sort((a, b) => {
722
+ const da = extract(a);
723
+ const db = extract(b);
724
+ const endA = da.current ? FAR_FUTURE : da.endDate ?? "";
725
+ const endB = db.current ? FAR_FUTURE : db.endDate ?? "";
726
+ const hasDateA = endA || da.startDate;
727
+ const hasDateB = endB || db.startDate;
728
+ if (hasDateA && !hasDateB) return -1;
729
+ if (!hasDateA && hasDateB) return 1;
730
+ if (endA !== endB) return endB.localeCompare(endA);
731
+ const startA = da.startDate ?? FAR_PAST;
732
+ const startB = db.startDate ?? FAR_PAST;
733
+ return startB.localeCompare(startA);
734
+ });
735
+ }
736
+ function dateRangeExtractor(item) {
737
+ return { startDate: item.startDate, endDate: item.endDate, current: item.current };
738
+ }
739
+ function lexiconDateExtractor(item) {
740
+ return { startDate: item.startedAt, endDate: item.endedAt, current: !item.endedAt };
741
+ }
742
+ function singleDateExtractor(item) {
743
+ return { endDate: item.date };
744
+ }
745
+ function certDateExtractor(item) {
746
+ return { startDate: item.issueDate, endDate: item.expiryDate ?? item.issueDate };
747
+ }
748
+
749
+ // src/format/handle-utils.ts
750
+ function sanitizeHandleInput(raw) {
751
+ let identifier = raw.trim().replace(/^https?:\/\/bsky\.app\/profile\//i, "").replace(/^at:\/\//i, "").replace(/^@/, "").replace(/^https?:\/\//i, "");
752
+ if (!identifier.startsWith("did:")) {
753
+ identifier = identifier.split("/")[0] ?? identifier;
754
+ }
755
+ identifier = identifier.replace(/\.$/, "");
756
+ if (!identifier.startsWith("did:")) {
757
+ identifier = identifier.toLowerCase();
758
+ }
759
+ if (identifier && !identifier.startsWith("did:") && !identifier.includes(".")) {
760
+ identifier = `${identifier}.bsky.social`;
761
+ }
762
+ return identifier;
763
+ }
764
+
765
+ // src/format/location-utils.ts
766
+ function formatLocation(loc) {
767
+ if (!loc) return "";
768
+ const parts = [loc.city, loc.region, loc.country].filter(Boolean);
769
+ if (loc.postalCode && !loc.city) {
770
+ return `${loc.postalCode}, ${loc.country}`;
771
+ }
772
+ return parts.join(", ");
773
+ }
774
+ function parseLocationString(str) {
775
+ if (!str.trim()) return null;
776
+ const parts = str.split(",").map((p) => p.trim()).filter(Boolean);
777
+ if (parts.length >= 3) {
778
+ return {
779
+ city: parts[0],
780
+ region: parts[1],
781
+ country: parts[parts.length - 1]
782
+ };
783
+ }
784
+ if (parts.length === 2) {
785
+ return {
786
+ city: parts[0],
787
+ country: parts[1]
788
+ };
789
+ }
790
+ return { country: parts[0] };
791
+ }
792
+ function countryCodeToFlag(code) {
793
+ if (!code || code.length !== 2) return "";
794
+ const upper = code.toUpperCase();
795
+ const a = upper.codePointAt(0);
796
+ const b = upper.codePointAt(1);
797
+ if (a === void 0 || b === void 0) return "";
798
+ return String.fromCodePoint(a - 65 + 127462, b - 65 + 127462);
799
+ }
800
+
801
+ // src/format/pds-utils.ts
802
+ var BSKY_PROFILE_BASE = "https://bsky.app/profile/";
803
+ var PDS_PROVIDERS = [
804
+ { suffix: ".bsky.social", name: "bluesky" },
805
+ { suffix: ".blacksky.app", name: "blacksky" },
806
+ { suffix: ".eurosky.social", name: "eurosky" },
807
+ { suffix: ".northsky.social", name: "northsky" }
808
+ ];
809
+ var KNOWN_PROVIDER_NAMES = new Set(PDS_PROVIDERS.map((p) => p.name));
810
+ var ICON_ONLY_PROVIDERS = /* @__PURE__ */ new Set(["selfhosted-social", "selfhosted"]);
811
+ function pdsProviderFromApi(apiProvider, handle) {
812
+ if (!apiProvider) return null;
813
+ if (ICON_ONLY_PROVIDERS.has(apiProvider.name)) {
814
+ return { name: apiProvider.name, profileUrl: "", host: apiProvider.host };
815
+ }
816
+ if (!KNOWN_PROVIDER_NAMES.has(apiProvider.name)) return null;
817
+ return {
818
+ name: apiProvider.name,
819
+ profileUrl: `${BSKY_PROFILE_BASE}${handle}`,
820
+ host: apiProvider.host
821
+ };
822
+ }
823
+ function getHandleStem(handle) {
824
+ const lower = handle.toLowerCase();
825
+ for (const provider of PDS_PROVIDERS) {
826
+ if (lower.endsWith(provider.suffix) && lower.length > provider.suffix.length) {
827
+ return handle.slice(0, -provider.suffix.length);
828
+ }
829
+ }
830
+ return handle;
831
+ }
832
+ function getDisplayLabel(displayName, handle) {
833
+ if (displayName) return displayName;
834
+ return getHandleStem(handle);
835
+ }
836
+ var PDS_DISPLAY_NAMES = {
837
+ bluesky: "Bluesky",
838
+ blacksky: "BlackSky",
839
+ eurosky: "EuroSky",
840
+ northsky: "NorthSky",
841
+ "selfhosted-social": "Self-hosted",
842
+ selfhosted: "Self-hosted"
843
+ };
844
+ function getPdsDisplayName(providerName) {
845
+ return PDS_DISPLAY_NAMES[providerName] ?? providerName;
846
+ }
847
+ function detectPdsProvider(handle) {
848
+ const lower = handle.toLowerCase();
849
+ for (const provider of PDS_PROVIDERS) {
850
+ if (lower.endsWith(provider.suffix)) {
851
+ return {
852
+ name: provider.name,
853
+ profileUrl: `${BSKY_PROFILE_BASE}${handle}`
854
+ };
855
+ }
856
+ }
857
+ return null;
858
+ }
859
+
860
+ // src/format/text-truncate.ts
861
+ var ELLIPSIS = "\u2026";
862
+ function truncateGraphemes(value, maxLen) {
863
+ if (maxLen <= 0) return "";
864
+ const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
865
+ const graphemes = Array.from(segmenter.segment(value), (s) => s.segment);
866
+ if (graphemes.length <= maxLen) return value;
867
+ if (maxLen === 1) return ELLIPSIS;
868
+ return graphemes.slice(0, maxLen - 1).join("") + ELLIPSIS;
869
+ }
870
+
871
+ // src/format/time-utils.ts
872
+ function formatDistanceToNow(date) {
873
+ const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
874
+ if (seconds < 60) return "just now";
875
+ const minutes = Math.floor(seconds / 60);
876
+ if (minutes < 60) return `${minutes}m ago`;
877
+ const hours = Math.floor(minutes / 60);
878
+ if (hours < 24) return `${hours}h ago`;
879
+ const days = Math.floor(hours / 24);
880
+ if (days < 7) return `${days}d ago`;
881
+ const weeks = Math.floor(days / 7);
882
+ if (weeks < 5) return `${weeks}w ago`;
883
+ const months = Math.floor(days / 30);
884
+ return `${months}mo ago`;
885
+ }
886
+
887
+ // src/format/wcag-contrast.ts
888
+ function isValidRgbColor(value) {
889
+ if (value == null || typeof value !== "object") return false;
890
+ const { r, g, b } = value;
891
+ return typeof r === "number" && typeof g === "number" && typeof b === "number" && Number.isFinite(r) && Number.isFinite(g) && Number.isFinite(b) && r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255;
892
+ }
893
+ function rgbToString(color) {
894
+ return `rgb(${Math.floor(color.r)}, ${Math.floor(color.g)}, ${Math.floor(color.b)})`;
895
+ }
896
+ function relativeLuminance(color) {
897
+ const [rs, gs, bs] = [color.r / 255, color.g / 255, color.b / 255];
898
+ const r = rs <= 0.04045 ? rs / 12.92 : Math.pow((rs + 0.055) / 1.055, 2.4);
899
+ const g = gs <= 0.04045 ? gs / 12.92 : Math.pow((gs + 0.055) / 1.055, 2.4);
900
+ const b = bs <= 0.04045 ? bs / 12.92 : Math.pow((bs + 0.055) / 1.055, 2.4);
901
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
902
+ }
903
+ function contrastRatio(color1, color2) {
904
+ const l1 = relativeLuminance(color1);
905
+ const l2 = relativeLuminance(color2);
906
+ const lighter = Math.max(l1, l2);
907
+ const darker = Math.min(l1, l2);
908
+ return (lighter + 0.05) / (darker + 0.05);
909
+ }
910
+ function meetsContrastAA(foreground, background) {
911
+ return contrastRatio(foreground, background) >= 4.5;
912
+ }
913
+
914
+ // src/index.ts
915
+ var SIFA_SDK_VERSION = "0.1.0";
916
+
917
+ export { CATEGORY_LABELS, CATEGORY_ORDER, CONTINENTS, COUNTRIES, INDUSTRY_OPTIONS, PLATFORM_LABELS, PLATFORM_OPTIONS, SIFA_SDK_VERSION, SKILL_CATEGORIES, certDateExtractor, contrastRatio, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, formatDistanceToNow, formatLocation, formatRelativeTime, getContinent, getDisplayLabel, getFaviconUrl, getHandleStem, getPdsDisplayName, getPlatformLabel, groupSkillsByCategory, isKnownPlatform, isValidRgbColor, lexiconDateExtractor, meetsContrastAA, parseLocationString, pdsProviderFromApi, relativeLuminance, rgbToString, sanitizeHandleInput, singleDateExtractor, sortByDateDesc, truncateGraphemes };
918
+ //# sourceMappingURL=index.js.map
919
+ //# sourceMappingURL=index.js.map