signalk-flags 1.0.1 → 1.0.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/app-icon.svg ADDED
@@ -0,0 +1,176 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ viewBox="0 0 128 128"
4
+ role="img"
5
+ aria-label="Course Provider"
6
+ version="1.1"
7
+ id="svg50"
8
+ sodipodi:docname="app-icon.svg"
9
+ inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
10
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
11
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12
+ xmlns:xlink="http://www.w3.org/1999/xlink"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ xmlns:svg="http://www.w3.org/2000/svg">
15
+ <sodipodi:namedview
16
+ id="namedview52"
17
+ pagecolor="#ffffff"
18
+ bordercolor="#000000"
19
+ borderopacity="0.25"
20
+ inkscape:showpageshadow="2"
21
+ inkscape:pageopacity="0.0"
22
+ inkscape:pagecheckerboard="0"
23
+ inkscape:deskcolor="#d1d1d1"
24
+ showgrid="false"
25
+ inkscape:zoom="4.6293397"
26
+ inkscape:cx="40.826557"
27
+ inkscape:cy="73.228586"
28
+ inkscape:window-width="1920"
29
+ inkscape:window-height="1012"
30
+ inkscape:window-x="0"
31
+ inkscape:window-y="0"
32
+ inkscape:window-maximized="1"
33
+ inkscape:current-layer="svg50" />
34
+ <defs
35
+ id="defs10">
36
+ <linearGradient
37
+ inkscape:collect="always"
38
+ id="linearGradient8751">
39
+ <stop
40
+ style="stop-color:#fff8df;stop-opacity:1;"
41
+ offset="0"
42
+ id="stop8747" />
43
+ <stop
44
+ style="stop-color:#469cb6;stop-opacity:0;"
45
+ offset="1"
46
+ id="stop8749" />
47
+ </linearGradient>
48
+ <linearGradient
49
+ inkscape:collect="always"
50
+ id="linearGradient5223">
51
+ <stop
52
+ style="stop-color:#ffd700;stop-opacity:1;"
53
+ offset="0"
54
+ id="stop5219" />
55
+ <stop
56
+ style="stop-color:#ffd700;stop-opacity:0;"
57
+ offset="1"
58
+ id="stop5221" />
59
+ </linearGradient>
60
+ <linearGradient
61
+ id="sea"
62
+ x1="0"
63
+ y1="0"
64
+ x2="0"
65
+ y2="1">
66
+ <stop
67
+ offset="0"
68
+ stop-color="#1b6ea8"
69
+ id="stop2" />
70
+ <stop
71
+ offset="1"
72
+ stop-color="#0b3a5e"
73
+ id="stop4" />
74
+ </linearGradient>
75
+ <clipPath
76
+ id="card">
77
+ <rect
78
+ x="0"
79
+ y="0"
80
+ width="128"
81
+ height="128"
82
+ rx="22"
83
+ id="rect7" />
84
+ </clipPath>
85
+ <clipPath
86
+ id="clip0_103_3617">
87
+ <rect
88
+ width="512"
89
+ height="512"
90
+ fill="white"
91
+ id="rect322" />
92
+ </clipPath>
93
+ <clipPath
94
+ id="clip0_103_67">
95
+ <rect
96
+ width="512"
97
+ height="512"
98
+ fill="white"
99
+ id="rect2209" />
100
+ </clipPath>
101
+ <clipPath
102
+ id="clip0_103_6250">
103
+ <rect
104
+ width="512"
105
+ height="512"
106
+ fill="white"
107
+ id="rect3689" />
108
+ </clipPath>
109
+ <linearGradient
110
+ inkscape:collect="always"
111
+ xlink:href="#linearGradient5223"
112
+ id="linearGradient5225"
113
+ x1="157.54657"
114
+ y1="436.87292"
115
+ x2="12.466357"
116
+ y2="509.12616"
117
+ gradientUnits="userSpaceOnUse" />
118
+ <linearGradient
119
+ inkscape:collect="always"
120
+ xlink:href="#linearGradient8751"
121
+ id="linearGradient8753"
122
+ x1="14.405283"
123
+ y1="15.844027"
124
+ x2="111.4273"
125
+ y2="114.77638"
126
+ gradientUnits="userSpaceOnUse" />
127
+ </defs>
128
+ <rect
129
+ style="fill:url(#linearGradient8753);fill-opacity:1;stroke:#dde1de;stroke-width:0.794;stroke-linejoin:bevel;stroke-opacity:0.83649015;paint-order:stroke fill markers;stroke-dasharray:none"
130
+ id="rect1426"
131
+ width="126.94573"
132
+ height="126.79709"
133
+ x="0.65405494"
134
+ y="1.0181499"
135
+ ry="22.476601" />
136
+ <g
137
+ id="g6858"
138
+ transform="matrix(1.2991277,0.26013653,-0.24292706,1.3911607,23.698152,-37.393372)">
139
+ <g
140
+ clip-path="url(#clip0_103_67)"
141
+ id="g2207"
142
+ transform="matrix(5.4543135e-4,0.06763596,-0.09862492,1.4275359e-4,76.15512,40.04223)"
143
+ style="stroke:#efeded;stroke-width:0;stroke-dasharray:none;stroke-opacity:0.955389">
144
+ <path
145
+ fill-rule="evenodd"
146
+ clip-rule="evenodd"
147
+ d="M 0,0 H 512 V 512 H 0 Z"
148
+ fill="#ffd700"
149
+ id="path2203"
150
+ style="fill:url(#linearGradient5225);fill-opacity:1;stroke:#efeded;stroke-width:0;stroke-dasharray:none;stroke-opacity:0.955389" />
151
+ <path
152
+ fill-rule="evenodd"
153
+ clip-rule="evenodd"
154
+ d="M 0,0 H 512 V 256 H 0 Z"
155
+ fill="#0057b8"
156
+ id="path2205"
157
+ style="stroke:#efeded;stroke-width:0;stroke-dasharray:none;stroke-opacity:0.955389" />
158
+ </g>
159
+ <rect
160
+ style="fill:#ffffff;fill-opacity:0;stroke:#9fbbf0;stroke-width:0.867972;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:0.308645;paint-order:stroke fill markers"
161
+ id="rect5472"
162
+ width="50.914845"
163
+ height="35.484547"
164
+ x="25.729317"
165
+ y="39.667011"
166
+ ry="0" />
167
+ </g>
168
+ <rect
169
+ style="fill:#bc773e;fill-opacity:0.99922448;stroke:#000000;stroke-width:1.84102;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:0.73042899;paint-order:stroke fill markers"
170
+ id="rect6977"
171
+ width="2.6408091"
172
+ height="97.130127"
173
+ x="47.656895"
174
+ y="11.841338"
175
+ transform="matrix(0.97721059,0.21227214,-0.17150529,0.9851832,0,0)" />
176
+ </svg>
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "signalk-flags",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Country Flags plugin for Signal K server.",
5
5
  "main": "plugin/index.js",
6
+ "signalk": {
7
+ "displayName": "Flag Icons",
8
+ "appIcon": "./app-icon.svg"
9
+ },
6
10
  "keywords": [
7
- "signalk-node-server-plugin"
11
+ "signalk",
12
+ "signalk-node-server-plugin",
13
+ "signalk-category-utility"
8
14
  ],
9
15
  "repository": "https://github.com/panaaj/signalk-flags",
10
16
  "author": "AdrianP",
@@ -15,16 +21,18 @@
15
21
  "watch": "npm run build -- -w",
16
22
  "test": "echo \"Error: no test specified\" && exit 1",
17
23
  "start": "npm run build -- -w",
18
- "format": "prettier --write src/*"
24
+ "format": "prettier --write src/*",
25
+ "prepublishOnly": "tsc"
19
26
  },
20
27
  "dependencies": {
21
- "@signalk/server-api": "^2.3.0",
28
+ "@signalk/server-api": "2.9",
22
29
  "flag-icons": "^7.3.2"
23
30
  },
24
31
  "devDependencies": {
25
- "@types/express": "^4.17.6",
32
+ "@types/baconjs": "^0.7.34",
33
+ "@types/express": "^5.0.6",
26
34
  "prettier": "^2.5.1",
27
- "typescript": "^4.5.4"
35
+ "typescript": "^6.0.3"
28
36
  },
29
37
  "signalk-plugin-enabled-by-default": true
30
38
  }
package/plugin/index.d.ts CHANGED
@@ -1,15 +1,4 @@
1
1
  import { Application } from 'express';
2
- import { Delta, ServerAPI } from '@signalk/server-api';
3
- interface SKDeltaSubscription {
4
- context: string;
5
- subscribe: Array<{
6
- path: string;
7
- period: number;
8
- }>;
9
- }
2
+ import { ServerAPI } from '@signalk/server-api';
10
3
  export interface FlagsApp extends ServerAPI, Application {
11
- subscriptionmanager: {
12
- subscribe: (subscribe: SKDeltaSubscription, unsubscribes: Array<any>, errorCallback: (error: any) => void, deltaCallback: (delta: Delta) => void) => void;
13
- };
14
4
  }
15
- export {};
package/plugin/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -40,7 +50,6 @@ const promises_1 = require("fs/promises");
40
50
  const path_1 = __importDefault(require("path"));
41
51
  const server_api_1 = require("@signalk/server-api");
42
52
  const openapi = __importStar(require("./openApi.json"));
43
- const mid_1 = require("./mid");
44
53
  const CONFIG_SCHEMA = {
45
54
  properties: {}
46
55
  };
@@ -133,25 +142,29 @@ module.exports = (server) => {
133
142
  }
134
143
  u.values.forEach((v) => {
135
144
  if (v.path === '' && v.value && 'mmsi' in v.value) {
136
- const country = countryFromMmsi(v.value.mmsi);
137
- if (country) {
138
- server.handleMessage(plugin.id, {
139
- context: context,
140
- updates: [
141
- {
142
- values: [
143
- {
144
- path: 'flag',
145
- value: country[0]
146
- },
147
- {
148
- path: 'port',
149
- value: country[3]
150
- }
151
- ]
152
- }
153
- ]
154
- });
145
+ // if doesn't already have flag property
146
+ const vf = server.getPath(`${context}.flag`);
147
+ if (!vf) {
148
+ const country = countryFromMmsi(v.value.mmsi);
149
+ if (country) {
150
+ server.handleMessage(plugin.id, {
151
+ context: context,
152
+ updates: [
153
+ {
154
+ values: [
155
+ {
156
+ path: 'flag',
157
+ value: country.alpha2
158
+ },
159
+ {
160
+ path: 'country',
161
+ value: country.name
162
+ }
163
+ ]
164
+ }
165
+ ]
166
+ });
167
+ }
155
168
  }
156
169
  }
157
170
  });
@@ -205,7 +218,7 @@ module.exports = (server) => {
205
218
  * @param aspect Aspect ratio default= '4x3'
206
219
  * @returns svg file contents
207
220
  */
208
- const iconFromCountryCode = (code, aspect = '4x3', res) => __awaiter(void 0, void 0, void 0, function* () {
221
+ const iconFromCountryCode = (code_1, ...args_1) => __awaiter(void 0, [code_1, ...args_1], void 0, function* (code, aspect = '4x3', res) {
209
222
  try {
210
223
  const flag = `${IMG_BASE_PATH}/${aspect}/${code.toLowerCase()}.svg`;
211
224
  // check flag file exists
@@ -234,10 +247,10 @@ module.exports = (server) => {
234
247
  * @param aspect Flag icon aspect ratio '1x1' or '4x3'
235
248
  * @returns svg file contents
236
249
  */
237
- const iconFromMmsi = (mmsi, aspect = '4x3', res) => __awaiter(void 0, void 0, void 0, function* () {
250
+ const iconFromMmsi = (mmsi_1, ...args_1) => __awaiter(void 0, [mmsi_1, ...args_1], void 0, function* (mmsi, aspect = '4x3', res) {
238
251
  try {
239
252
  const country = countryFromMmsi(mmsi);
240
- const flag = `${IMG_BASE_PATH}/${aspect}/${country[0].toLowerCase()}.svg`;
253
+ const flag = `${IMG_BASE_PATH}/${aspect}/${country === null || country === void 0 ? void 0 : country.alpha2.toLowerCase()}.svg`;
241
254
  // check flag file exists
242
255
  yield (0, promises_1.access)(flag, fs_1.constants.R_OK);
243
256
  res.sendFile(flag, (err) => {
@@ -262,14 +275,10 @@ module.exports = (server) => {
262
275
  /**
263
276
  * Get country details from supplied MMSI
264
277
  * @param mmsi Maritime mobile service identifier
265
- * @returns Array containing country details
278
+ * @returns Object containing country details
266
279
  */
267
280
  const countryFromMmsi = (mmsi) => {
268
- if (typeof mmsi === 'number') {
269
- mmsi = mmsi.toString();
270
- }
271
- const mid = mmsi.slice(0, 3);
272
- return mid_1.MID[mid];
281
+ return (0, server_api_1.getFlagCountry)(mmsi);
273
282
  };
274
283
  return plugin;
275
284
  };
package/CHANGELOG.md DELETED
@@ -1,11 +0,0 @@
1
- # CHANGELOG: Signal K Flag Resources - Signal K plugin
2
-
3
- ## v1.0.1
4
-
5
- - **Fix**: Issue where test for MMSI throwing errors.
6
-
7
- ## v1.0.0
8
-
9
- - Initial release.
10
-
11
-
package/plugin/mid.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export declare const MID: {
2
- [mid: string]: string[];
3
- };
package/plugin/mid.js DELETED
@@ -1,296 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MID = void 0;
4
- // source: https://github.com/michaeljfazio/MIDs/blob/master/mids.json
5
- exports.MID = {
6
- '201': ['AL', 'ALB', '', 'Albania'],
7
- '202': ['AD', 'AND', '', 'Andorra'],
8
- '203': ['AT', 'AUT', '', 'Austria'],
9
- '204': ['PT', 'PRT', 'PT-20', 'Azores'],
10
- '205': ['BE', 'BEL', '', 'Belgium'],
11
- '206': ['BY', 'BLR', '', 'Belarus'],
12
- '207': ['BG', 'BGR', '', 'Bulgaria'],
13
- '208': ['VA', 'VAT', '', 'Vatican City State'],
14
- '209': ['CY', 'CYP', '', 'Cyprus'],
15
- '210': ['CY', 'CYP', '', 'Cyprus'],
16
- '211': ['DE', 'DEU', '', 'Germany'],
17
- '212': ['CY', 'CYP', '', 'Cyprus'],
18
- '213': ['GE', 'GEO', '', 'Georgia'],
19
- '214': ['MD', 'MDA', '', 'Moldova'],
20
- '215': ['MT', 'MLT', '', 'Malta'],
21
- '216': ['AM', 'ARM', '', 'Armenia'],
22
- '218': ['DE', 'DEU', '', 'Germany'],
23
- '219': ['DK', 'DNK', '', 'Denmark'],
24
- '220': ['DK', 'DNK', '', 'Denmark'],
25
- '224': ['ES', 'ESP', '', 'Spain'],
26
- '225': ['ES', 'ESP', '', 'Spain'],
27
- '226': ['FR', 'FRA', '', 'France'],
28
- '227': ['FR', 'FRA', '', 'France'],
29
- '228': ['FR', 'FRA', '', 'France'],
30
- '229': ['MT', 'MLT', '', 'Malta'],
31
- '230': ['FI', 'FIN', '', 'Finland'],
32
- '231': ['FO', 'FRO', '', 'Faroe Islands'],
33
- '232': ['GB', 'GBR', '', 'United Kingdom'],
34
- '233': ['GB', 'GBR', '', 'United Kingdom'],
35
- '234': ['GB', 'GBR', '', 'United Kingdom'],
36
- '235': ['GB', 'GBR', '', 'United Kingdom'],
37
- '236': ['GI', 'GIB', '', 'Gibraltar'],
38
- '237': ['GR', 'GRC', '', 'Greece'],
39
- '238': ['HR', 'HRV', '', 'Croatia'],
40
- '239': ['GR', 'GRC', '', 'Greece'],
41
- '240': ['GR', 'GRC', '', 'Greece'],
42
- '241': ['GR', 'GRC', '', 'Greece'],
43
- '242': ['MA', 'MAR', '', 'Morocco'],
44
- '243': ['HU', 'HUN', '', 'Hungary'],
45
- '244': ['NL', 'NLD', '', 'Netherlands'],
46
- '245': ['NL', 'NLD', '', 'Netherlands'],
47
- '246': ['NL', 'NLD', '', 'Netherlands'],
48
- '247': ['IT', 'ITA', '', 'Italy'],
49
- '248': ['MT', 'MLT', '', 'Malta'],
50
- '249': ['MT', 'MLT', '', 'Malta'],
51
- '250': ['IE', 'IRL', '', 'Ireland'],
52
- '251': ['IS', 'ISL', '', 'Iceland'],
53
- '252': ['LI', 'LIE', '', 'Liechtenstein'],
54
- '253': ['LU', 'LUX', '', 'Luxembourg'],
55
- '254': ['MC', 'MCO', '', 'Monaco'],
56
- '255': ['PT', 'PRT', 'PT-30', 'Madeira'],
57
- '256': ['MT', 'MLT', '', 'Malta'],
58
- '257': ['NO', 'NOR', '', 'Norway'],
59
- '258': ['NO', 'NOR', '', 'Norway'],
60
- '259': ['NO', 'NOR', '', 'Norway'],
61
- '261': ['PL', 'POL', '', 'Poland'],
62
- '262': ['ME', 'MNE', '', 'Montenegro'],
63
- '263': ['PT', 'PRT', '', 'Portugal'],
64
- '264': ['RO', 'ROU', '', 'Romania'],
65
- '265': ['SE', 'SWE', '', 'Sweden'],
66
- '266': ['SE', 'SWE', '', 'Sweden'],
67
- '267': ['SK', 'SVK', '', 'Slovak Republic'],
68
- '268': ['SM', 'SMR', '', 'San Marino'],
69
- '269': ['CH', 'CHE', '', 'Switzerland'],
70
- '270': ['CZ', 'CZE', '', 'Czech Republic'],
71
- '271': ['TR', 'TUR', '', 'Turkey'],
72
- '272': ['UA', 'UKR', '', 'Ukraine'],
73
- '273': ['RU', 'RUS', '', 'Russia'],
74
- '274': ['MK', 'MKD', '', 'Macedonia'],
75
- '275': ['LV', 'LVA', '', 'Latvia'],
76
- '276': ['EE', 'EST', '', 'Estonia'],
77
- '277': ['LT', 'LTU', '', 'Lithuania'],
78
- '278': ['SI', 'SVN', '', 'Slovenia'],
79
- '279': ['RS', 'SRB', '', 'Serbia'],
80
- '301': ['AI', 'AIA', '', 'Anguilla'],
81
- '303': ['US', 'USA', 'US-AK', 'Alaska'],
82
- '304': ['AG', 'ATG', '', 'Antigua and Barbuda'],
83
- '305': ['AG', 'ATG', '', 'Antigua and Barbuda'],
84
- '306': ['CW', 'CUW', '', 'Antilles'],
85
- '307': ['AW', 'ABW', '', 'Aruba'],
86
- '308': ['BS', 'BHS', '', 'Bahamas'],
87
- '309': ['BS', 'BHS', '', 'Bahamas'],
88
- '310': ['BM', 'BMU', '', 'Bermuda'],
89
- '311': ['BS', 'BMU', '', 'Bahamas'],
90
- '312': ['BZ', 'BLZ', '', 'Belize'],
91
- '314': ['BB', 'BRB', '', 'Barbados'],
92
- '316': ['CA', 'CAN', '', 'Canada'],
93
- '319': ['KY', 'CYM', '', 'Cayman Islands'],
94
- '321': ['CR', 'CRI', '', 'Costa Rica'],
95
- '323': ['CU', 'CUB', '', 'Cuba'],
96
- '325': ['DM', 'DMA', '', 'Dominica'],
97
- '327': ['DO', 'DOM', '', 'Dominican Republic'],
98
- '329': ['GP', 'GLP', '', 'Guadeloupe'],
99
- '330': ['GD', 'GRD', '', 'Grenada'],
100
- '331': ['GL', 'GRL', '', 'Greenland'],
101
- '332': ['GT', 'GTM', '', 'Guatemala'],
102
- '335': ['HN', 'HND', '', 'Honduras'],
103
- '336': ['HT', 'HTI', '', 'Haiti'],
104
- '338': ['US', 'USA', '', 'United States of America'],
105
- '339': ['JM', 'JAM', '', 'Jamaica'],
106
- '341': ['KN', 'KNA', '', 'Saint Kitts and Nevis'],
107
- '343': ['LC', 'LCA', '', 'Saint Lucia'],
108
- '345': ['MX', 'MEX', '', 'Mexico'],
109
- '347': ['MQ', 'MTQ', '', 'Martinique'],
110
- '348': ['MS', 'MSR', '', 'Montserrat'],
111
- '350': ['NI', 'NIC', '', 'Nicaragua'],
112
- '351': ['PA', 'PAN', '', 'Panama'],
113
- '352': ['PA', 'PAN', '', 'Panama'],
114
- '353': ['PA', 'PAN', '', 'Panama'],
115
- '354': ['PA', 'PAN', '', 'Panama'],
116
- '355': ['PA', 'PAN', '', 'Panama'],
117
- '356': ['PA', 'PAN', '', 'Panama'],
118
- '357': ['PA', 'PAN', '', 'Panama'],
119
- '358': ['PR', 'PRI', '', 'Puerto Rico'],
120
- '359': ['SV', 'SLV', '', 'El Salvador'],
121
- '361': ['PM', 'SPM', '', 'Saint Pierre and Miquelon'],
122
- '362': ['TT', 'TTO', '', 'Trinidad and Tobago'],
123
- '364': ['TC', 'TCA', '', 'Turks and Caicos Islands'],
124
- '366': ['US', 'USA', '', 'United States of America'],
125
- '367': ['US', 'USA', '', 'United States of America'],
126
- '368': ['US', 'USA', '', 'United States of America'],
127
- '369': ['US', 'USA', '', 'United States of America'],
128
- '370': ['PA', 'PAN', '', 'Panama'],
129
- '371': ['PA', 'PAN', '', 'Panama'],
130
- '372': ['PA', 'PAN', '', 'Panama'],
131
- '373': ['PA', 'PAN', '', 'Panama'],
132
- '374': ['PA', 'PAN', '', 'Panama'],
133
- '375': ['VC', 'VCT', '', 'Saint Vincent and the Grenadines'],
134
- '376': ['VC', 'VCT', '', 'Saint Vincent and the Grenadines'],
135
- '377': ['VC', 'VCT', '', 'Saint Vincent and the Grenadines'],
136
- '378': ['VG', 'VGB', '', 'British Virgin Islands'],
137
- '379': ['VI', 'VIR', '', 'United States Virgin Islands'],
138
- '401': ['AF', 'AFG', '', 'Afghanistan'],
139
- '403': ['SA', 'SAU', '', 'Saudi Arabia'],
140
- '405': ['BD', 'BGD', '', 'Bangladesh'],
141
- '408': ['BH', 'BHR', '', 'Bahrain'],
142
- '410': ['BT', 'BTN', '', 'Bhutan'],
143
- '412': ['CN', 'CHN', '', 'China'],
144
- '413': ['CN', 'CHN', '', 'China'],
145
- '414': ['CN', 'CHN', '', 'China'],
146
- '416': ['TW', 'TWN', '', 'Taiwan'],
147
- '417': ['LK', 'LKA', '', 'Sri Lanka'],
148
- '419': ['IN', 'IND', '', 'India'],
149
- '422': ['IR', 'IRN', '', 'Iran'],
150
- '423': ['AZ', 'AZE', '', 'Azerbaijan'],
151
- '425': ['IQ', 'IRQ', '', 'Iraq'],
152
- '428': ['IL', 'ISR', '', 'Israel'],
153
- '431': ['JP', 'JPN', '', 'Japan'],
154
- '432': ['JP', 'JPN', '', 'Japan'],
155
- '434': ['TM', 'TKM', '', 'Turkmenistan'],
156
- '436': ['KZ', 'KAZ', '', 'Kazakhstan'],
157
- '437': ['UZ', 'UZB', '', 'Uzbekistan'],
158
- '438': ['JO', 'JOR', '', 'Jordan'],
159
- '440': ['KR', 'KOR', '', 'Korea'],
160
- '441': ['KR', 'KOR', '', 'Korea'],
161
- '443': ['PS', 'PSE', '', 'State of Palestine'],
162
- '445': ['KP', 'PRK', '', "Democratic People's Republic of Korea"],
163
- '447': ['KW', 'KWT', '', 'Kuwait'],
164
- '450': ['LB', 'LBN', '', 'Lebanon'],
165
- '451': ['KG', 'KGZ', '', 'Kyrgyz Republic'],
166
- '453': ['MO', 'MAC', '', 'Macao'],
167
- '455': ['MV', 'MDV', '', 'Maldives'],
168
- '457': ['MN', 'MNG', '', 'Mongolia'],
169
- '459': ['NP', 'NPL', '', 'Nepal'],
170
- '461': ['OM', 'OMN', '', 'Oman'],
171
- '463': ['PK', 'PAK', '', 'Pakistan'],
172
- '466': ['QA', 'QAT', '', 'Qatar (State of)'],
173
- '468': ['SY', 'SYR', '', 'Syrian Arab Republic'],
174
- '470': ['AE', 'ARE', '', 'United Arab Emirates'],
175
- '472': ['TJ', 'TJK', '', 'Tajikistan'],
176
- '473': ['YE', 'YEM', '', 'Yemen'],
177
- '475': ['YE', 'YEM', '', 'Yemen'],
178
- '477': ['HK', 'HKG', '', 'Hong Kong'],
179
- '478': ['BA', 'BIH', '', 'Bosnia and Herzegovina'],
180
- '501': ['FR', 'FRA', 'AQ', 'Adelie Land'],
181
- '503': ['AU', 'AUS', '', 'Australia'],
182
- '506': ['MM', 'MMR', '', 'Myanmar'],
183
- '508': ['BN', 'BRN', '', 'Brunei Darussalam'],
184
- '510': ['FM', 'FSM', '', 'Micronesia'],
185
- '511': ['PW', 'PLW', '', 'Palau'],
186
- '512': ['NZ', 'NZL', '', 'New Zealand'],
187
- '514': ['KH', 'KHM', '', 'Cambodia'],
188
- '515': ['KH', 'KHM', '', 'Cambodia'],
189
- '516': ['CX', 'CXR', '', 'Christmas Island'],
190
- '518': ['CK', 'COK', '', 'Cook Islands'],
191
- '520': ['FJ', 'FJI', '', 'Fiji'],
192
- '523': ['CC', 'CCK', '', 'Cocos (Keeling) Islands'],
193
- '525': ['ID', 'IDN', '', 'Indonesia'],
194
- '529': ['KI', 'KIR', '', 'Kiribati'],
195
- '531': ['LA', 'LAO', '', "Lao People's Democratic Republic"],
196
- '533': ['MY', 'MYS', '', 'Malaysia'],
197
- '536': ['MP', 'MNP', '', 'Northern Mariana Islands'],
198
- '538': ['MH', 'MHL', '', 'Marshall Islands'],
199
- '540': ['NC', 'NCL', '', 'New Caledonia'],
200
- '542': ['NU', 'NIU', '', 'Niue'],
201
- '544': ['NR', 'NRU', '', 'Nauru'],
202
- '546': ['PF', 'PYF', '', 'French Polynesia'],
203
- '548': ['PH', 'PHL', '', 'Philippines'],
204
- '553': ['PG', 'PNG', '', 'Papua New Guinea'],
205
- '555': ['PN', 'PCN', '', 'Pitcairn Island'],
206
- '557': ['SB', 'SLB', '', 'Solomon Islands'],
207
- '559': ['AS', 'ASM', '', 'American Samoa'],
208
- '561': ['WS', 'WSM', '', 'Samoa'],
209
- '563': ['SG', 'SGP', '', 'Singapore'],
210
- '564': ['SG', 'SGP', '', 'Singapore'],
211
- '565': ['SG', 'SGP', '', 'Singapore'],
212
- '566': ['SG', 'SGP', '', 'Singapore'],
213
- '567': ['TH', 'THA', '', 'Thailand'],
214
- '570': ['TO', 'TON', '', 'Tonga'],
215
- '572': ['TV', 'TUV', '', 'Tuvalu'],
216
- '574': ['VN', 'VNM', '', 'Viet Nam'],
217
- '576': ['VU', 'VUT', '', 'Vanuatu'],
218
- '577': ['VU', 'VUT', '', 'Vanuatu'],
219
- '578': ['WF', 'WLF', '', 'Wallis and Futuna Islands'],
220
- '601': ['ZA', 'ZAF', '', 'South Africa'],
221
- '603': ['AO', 'AGO', '', 'Angola'],
222
- '605': ['DZ', 'DZA', '', 'Algeria'],
223
- '607': ['FR', 'FRA', 'TF', 'Saint Paul and Amsterdam Islands'],
224
- '608': ['GB', 'GBR', 'AC', 'Ascension Island'],
225
- '609': ['BI', 'BDI', '', 'Burundi'],
226
- '610': ['BJ', 'BEN', '', 'Benin'],
227
- '611': ['BW', 'BWA', '', 'Botswana'],
228
- '612': ['CF', 'CAF', '', 'Central African Republic'],
229
- '613': ['CM', 'CMR', '', 'Cameroon'],
230
- '615': ['CG', 'COG', '', 'Congo'],
231
- '616': ['KM', 'COM', '', 'Comoros'],
232
- '617': ['CV', 'CPV', '', 'Cabo Verde'],
233
- '618': ['FR', 'FRA', 'TF', 'Crozet Archipelago'],
234
- '619': ['CI', 'CIV', '', 'Ivory Coast'],
235
- '620': ['KM', 'COM', '', 'Comoros'],
236
- '621': ['DJ', 'DJI', '', 'Djibouti'],
237
- '622': ['EG', 'EGY', '', 'Egypt'],
238
- '624': ['ET', 'ETH', '', 'Ethiopia'],
239
- '625': ['ER', 'ERI', '', 'Eritrea'],
240
- '626': ['GA', 'GAB', '', 'Gabonese Republic'],
241
- '627': ['GH', 'GHA', '', 'Ghana'],
242
- '629': ['GM', 'GMB', '', 'Gambia'],
243
- '630': ['GW', 'GNB', '', 'Guinea-Bissau'],
244
- '631': ['GQ', 'GNQ', '', 'Equatorial Guinea'],
245
- '632': ['GN', 'GIN', '', 'Guinea'],
246
- '633': ['BF', 'BFA', '', 'Burkina Faso'],
247
- '634': ['KE', 'KEN', '', 'Kenya'],
248
- '635': ['FR', 'FRA', 'TF', 'Kerguelen Islands'],
249
- '636': ['LR', 'LBR', '', 'Liberia'],
250
- '637': ['LR', 'LBR', '', 'Liberia'],
251
- '638': ['SS', 'SSD', '', 'South Sudan'],
252
- '642': ['LY', 'LBY', '', 'Libya'],
253
- '644': ['LS', 'LSO', '', 'Lesotho'],
254
- '645': ['MU', 'MUS', '', 'Mauritius'],
255
- '647': ['MG', 'MDG', '', 'Madagascar'],
256
- '649': ['ML', 'MLI', '', 'Mali'],
257
- '650': ['MZ', 'MOZ', '', 'Mozambique'],
258
- '654': ['MR', 'MRT', '', 'Mauritania'],
259
- '655': ['MW', 'MWI', '', 'Malawi'],
260
- '656': ['NE', 'NER', '', 'Niger'],
261
- '657': ['NG', 'NGA', '', 'Nigeria'],
262
- '659': ['NA', 'NAM', '', 'Namibia'],
263
- '660': ['RE', 'REU', '', 'Reunion'],
264
- '661': ['RW', 'RWA', '', 'Rwanda'],
265
- '662': ['SD', 'SDN', '', 'Sudan'],
266
- '663': ['SN', 'SEN', '', 'Senegal'],
267
- '664': ['SC', 'SYC', '', 'Seychelles'],
268
- '665': ['SH', 'SHN', '', 'Saint Helena'],
269
- '666': ['SO', 'SOM', '', 'Somali Democratic Republic'],
270
- '667': ['SL', 'SLE', '', 'Sierra Leone'],
271
- '668': ['ST', 'STP', '', 'Sao Tome and Principe'],
272
- '669': ['SZ', 'SWZ', '', 'Swaziland'],
273
- '670': ['TD', 'TCD', '', 'Chad'],
274
- '671': ['TG', 'TGO', '', 'Togolese Republic'],
275
- '672': ['TN', 'TUN', '', 'Tunisian Republic'],
276
- '674': ['TZ', 'TZA', '', 'Tanzania'],
277
- '675': ['UG', 'UGA', '', 'Uganda'],
278
- '676': ['CD', 'COD', '', 'Democratic Republic of the Congo'],
279
- '677': ['TZ', 'TZA', '', 'Tanzania'],
280
- '678': ['ZM', 'ZMB', '', 'Zambia'],
281
- '679': ['ZW', 'ZWE', '', 'Zimbabwe'],
282
- '701': ['AR', 'ARG', '', 'Argentine Republic'],
283
- '710': ['BR', 'BRA', '', 'Brazil'],
284
- '720': ['BO', 'BOL', '', 'Bolivia'],
285
- '725': ['CL', 'CHL', '', 'Chile'],
286
- '730': ['CO', 'COL', '', 'Colombia'],
287
- '735': ['EC', 'ECU', '', 'Ecuador'],
288
- '740': ['FK', 'FLK', '', 'Falkland Islands'],
289
- '745': ['GF', 'GUF', '', 'Guiana'],
290
- '750': ['GY', 'GUY', '', 'Guyana'],
291
- '755': ['PY', 'PRY', '', 'Paraguay'],
292
- '760': ['PE', 'PER', '', 'Peru'],
293
- '765': ['SR', 'SUR', '', 'Suriname'],
294
- '770': ['UY', 'URY', '', 'Uruguay'],
295
- '775': ['VE', 'VEN', '', 'Venezuela']
296
- };