@atmosx/event-product-parser 3.0.55 → 3.0.61

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.
Files changed (156) hide show
  1. package/.github/CODE_OF_CONDUCT.md +9 -9
  2. package/.github/CONTRIBUTING.md +29 -29
  3. package/.github/LICENSE +17 -17
  4. package/.github/SECURITY.md +20 -20
  5. package/.github/SUPPORTED_EVENTS.md +369 -369
  6. package/.github/docs/docs-functions.md +30 -0
  7. package/.github/docs/docs-general-configurations.md +209 -0
  8. package/.github/docs/docs-integrations.md +37 -0
  9. package/.github/docs/docs-listeners.md +28 -0
  10. package/.github/docs/docs-source-configuration.md +218 -0
  11. package/.github/docs/docs-technical.md +50 -0
  12. package/.github/logo.png +0 -0
  13. package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
  14. package/.github/samples/SAMPLE_GEOJSON.json +204 -0
  15. package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +119 -0
  16. package/.vscode/settings.json +3 -3
  17. package/README.md +167 -0
  18. package/dist/cjs/index.cjs +1439 -1277
  19. package/dist/esm/index.mjs +1420 -1258
  20. package/package.json +47 -52
  21. package/src/@building/{building.create.ts → CreateEvent.ts} +55 -55
  22. package/src/@building/{building.clean.ts → GetCleanedEvent.ts} +29 -29
  23. package/src/@building/{building.attachments.ts → GetEventAttachments.ts} +85 -82
  24. package/src/@building/{building.enhance.ts → GetEventEnhancedName.ts} +54 -59
  25. package/src/@building/{building.geometry.ts → GetEventGeometry.ts} +47 -47
  26. package/src/@building/{building.headers.ts → GetEventHeader.ts} +36 -36
  27. package/src/@building/{building.polygon.ts → GetEventNodes.ts} +72 -69
  28. package/src/@building/{building.office.ts → GetEventOffice.ts} +42 -42
  29. package/src/@building/{building.properties.ts → GetEventProperties.ts} +95 -95
  30. package/src/@building/{building.signature.ts → GetEventSignature.ts} +60 -60
  31. package/src/@building/{building.tags.ts → GetEventTags.ts} +29 -24
  32. package/src/@building/{building.tracking.ts → GetEventTracking.ts} +67 -67
  33. package/src/@core/{core.clearEvents.ts → ClearEvents.ts} +30 -30
  34. package/src/@core/{core.createListener.ts → CreateListener.ts} +23 -23
  35. package/src/@core/{core.getEvents.ts → GetEvents.ts} +23 -23
  36. package/src/@core/{core.getNodes.ts → GetNodes.ts} +23 -23
  37. package/src/@core/{core.getRandomEvent.ts → GetRandomEvent.ts} +23 -23
  38. package/src/@core/{core.getVersion.ts → GetVersion.ts} +23 -23
  39. package/src/@core/{core.manualEvent.ts → ManualEvent.ts} +56 -38
  40. package/src/@core/{core.query.ts → QueryStanza.ts} +38 -38
  41. package/src/@core/{core.setNode.ts → SetNode.ts} +80 -80
  42. package/src/@core/{core.start.ts → StartService.ts} +60 -60
  43. package/src/@core/{core.stop.ts → StopService.ts} +31 -31
  44. package/src/@enums/AWIPS.ts +366 -0
  45. package/src/{@dictionaries/dictionaries.actions.ts → @enums/Actions.ts} +27 -27
  46. package/src/{@dictionaries/dictionaries.cancellation.ts → @enums/Cancellation.ts} +30 -30
  47. package/src/{@dictionaries/dictionaries.causes.ts → @enums/Causes.ts} +35 -35
  48. package/src/{@dictionaries/dictionaries.correlations.ts → @enums/Correlations.ts} +42 -42
  49. package/src/{@dictionaries/dictionaries.enhanced.ts → @enums/Enhanced.ts} +69 -69
  50. package/src/{@dictionaries/dictionaries.events.ts → @enums/Events.ts} +82 -82
  51. package/src/{@dictionaries/dictionaries.expressions.ts → @enums/Expressions.ts} +28 -28
  52. package/src/@enums/GlobalFilter.ts +24 -0
  53. package/src/{@dictionaries/dictionaries.hail.ts → @enums/Hail.ts} +37 -35
  54. package/src/{@dictionaries/dictionaries.icao.ts → @enums/ICAO.ts} +258 -258
  55. package/src/{@dictionaries/dictionaries.matches.ts → @enums/Matches.ts} +54 -54
  56. package/src/{@dictionaries/dictionaries.products.ts → @enums/Products.ts} +24 -24
  57. package/src/{@dictionaries/dictionaries.records.ts → @enums/Records.ts} +25 -25
  58. package/src/{@dictionaries/dictionaries.severity.ts → @enums/Severity.ts} +27 -27
  59. package/src/{@dictionaries/dictionaries.shapefiles.ts → @enums/Shapefiles.ts} +35 -35
  60. package/src/{@dictionaries/dictionaries.states.ts → @enums/States.ts} +71 -71
  61. package/src/{@dictionaries/dictionaries.status.ts → @enums/Status.ts} +30 -30
  62. package/src/{@dictionaries/dictionaries.global.ts → @enums/Strings.ts} +22 -24
  63. package/src/@enums/Tags.ts +167 -0
  64. package/src/{@dictionaries/dictionaries.testing.ts → @enums/Testing.ts} +24 -24
  65. package/src/@events/{events.api.ts → ParseAPI.ts} +116 -116
  66. package/src/@events/{events.text.ts → ParseText.ts} +87 -84
  67. package/src/@events/{events.ugc.ts → ParseUGC.ts} +93 -89
  68. package/src/@events/{events.vtec.ts → ParseVTEC.ts} +86 -86
  69. package/src/@manager/MakeEvents.ts +106 -0
  70. package/src/@manager/{manager.rmEvent.ts → RemoveEvent.ts} +69 -71
  71. package/src/@manager/{manager.setHash.ts → SetHash.ts} +35 -35
  72. package/src/@manager/Tasks.ts +246 -0
  73. package/src/@manager/{manager.updateEvents.ts → UpdateEvents.ts} +34 -34
  74. package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +61 -53
  75. package/src/{@building/building.validate.ts → @manager/ValidateEvents.ts} +141 -154
  76. package/src/@modules/@database/{database.cache.ts → GetCachedEvents.ts} +49 -49
  77. package/src/@modules/@database/{database.broadcastify.ts → ImportBroadcastify.ts} +69 -66
  78. package/src/@modules/@database/{database.shapefiles.ts → ImportShapefiles.ts} +92 -92
  79. package/src/@modules/@database/{database.stanza.ts → ImportStanza.ts} +46 -46
  80. package/src/@modules/@database/{database.init.ts → InitializeDatabase.ts} +58 -58
  81. package/src/@modules/@eas/{eas.setEasTone.ts → GenerateEASMessage.ts} +144 -151
  82. package/src/@modules/@eas/{eas.getCleanDescription.ts → GetCleanDescription.ts} +91 -91
  83. package/src/@modules/@eas/{eas.getFloatPCM16.ts → GetFloatPCM16.ts} +29 -29
  84. package/src/@modules/@eas/{eas.getMergedPCM16.ts → GetMergedPCM16.ts} +32 -32
  85. package/src/@modules/@eas/{eas.getPCM16.ts → GetPCM16.ts} +52 -52
  86. package/src/@modules/@eas/{eas.getPCMToFloat.ts → GetPCMToFloat.ts} +26 -26
  87. package/src/@modules/@eas/{eas.getSampledPCM16.ts → GetSampledPCM16.ts} +36 -36
  88. package/src/@modules/@eas/{eas.getTTS.ts → GetTTS.ts} +54 -54
  89. package/src/@modules/@eas/{eas.getWavPCM16.ts → GetWavPCM16.ts} +52 -52
  90. package/src/@modules/@eas/{eas.setAFSK.ts → SetAFSK.ts} +51 -51
  91. package/src/@modules/@eas/{eas.setAsciiToBits.ts → SetAsciiToBits.ts} +31 -31
  92. package/src/@modules/@eas/{eas.setAttentionTone.ts → SetAttentionTone.ts} +40 -40
  93. package/src/@modules/@eas/{eas.setNoise.ts → SetNoise.ts} +32 -32
  94. package/src/@modules/@eas/{eas.setRadioEffect.ts → SetRadioEffect.ts} +50 -50
  95. package/src/@modules/@eas/{eas.setSameHeader.ts → SetSameHeader.ts} +44 -44
  96. package/src/@modules/@stanza/{stanza.getAwipsType.ts → GetAwipsType.ts} +47 -45
  97. package/src/@modules/@stanza/{stanza.validate.ts → ValidateStanza.ts} +49 -49
  98. package/src/@modules/@utilities/{utilities.createHttp.ts → CreateHttp.ts} +83 -83
  99. package/src/@modules/@utilities/{utilities.getFormattedTime.ts → GetFormattedTime.ts} +43 -43
  100. package/src/@modules/@utilities/{utilities.getLatestIssuance.ts → GetLatestIssuance.ts} +32 -32
  101. package/src/@modules/@utilities/{utilities.getMatched.ts → GetMatched.ts} +33 -33
  102. package/src/@modules/@utilities/{utilities.getSettings.ts → GetSettings.ts} +25 -25
  103. package/src/@modules/@utilities/{utilities.getShapeNearestPoint.ts → GetShapeNearestPoint.ts} +114 -114
  104. package/src/@modules/@utilities/{utilities.setCronSchedule.ts → SetCronSchedule.ts} +94 -94
  105. package/src/@modules/@utilities/{utilities.setDebug.ts → SetDebug.ts} +37 -38
  106. package/src/@modules/@utilities/{utilities.setEventEmit.ts → SetEventEmit.ts} +41 -41
  107. package/src/@modules/@utilities/{utilities.setListener.ts → SetListener.ts} +30 -30
  108. package/src/@modules/@utilities/{utilities.setSettings.ts → SetSettings.ts} +42 -42
  109. package/src/@modules/@utilities/{utilities.setSleep.ts → SetSleep.ts} +33 -33
  110. package/src/@modules/@utilities/{utilities.setTimeoutAction.ts → SetTimeoutAction.ts} +63 -63
  111. package/src/@modules/@utilities/{utilities.setWarning.ts → SetWarning.ts} +34 -34
  112. package/src/@modules/@xmpp/{xmpp.xDeploy.ts → DeployXMPP.ts} +57 -57
  113. package/src/@modules/@xmpp/{xmpp.xError.ts → ErrorXMPP.ts} +26 -26
  114. package/src/@modules/@xmpp/{xmpp.xOffline.ts → OfflineXMPP.ts} +36 -36
  115. package/src/@modules/@xmpp/{xmpp.xOnline.ts → OnlineXMPP.ts} +45 -45
  116. package/src/@modules/@xmpp/{xmpp.xReconnect.ts → ReconnectXMPP.ts} +64 -64
  117. package/src/@modules/@xmpp/{xmpp.xStanza.ts → StanzaXMPP.ts} +62 -62
  118. package/src/@parsers/@hvtec/{hvtec.extract.ts → HVExtract.ts} +39 -39
  119. package/src/@parsers/@pvtec/{pvtec.expires.ts → GetExpiry.ts} +25 -25
  120. package/src/@parsers/@pvtec/{pvtec.extract.ts → VTECExtract.ts} +48 -48
  121. package/src/@parsers/@text/{text.getDescriptionFromProduct.ts → GetDescriptionFromProduct.ts} +59 -52
  122. package/src/@parsers/@text/{text.getEmbedText.ts → GetEmbededText.ts} +55 -55
  123. package/src/@parsers/@text/{text.getPolygonFromProduct.ts → GetPolygonFromProduct.ts} +52 -52
  124. package/src/@parsers/@text/{text.getStringText.ts → GetStringText.ts} +57 -53
  125. package/src/@parsers/@text/{text.getTextFromProduct.ts → GetTextFromProduct.ts} +42 -42
  126. package/src/@parsers/@text/{text.getXML.ts → GetXML.ts} +60 -60
  127. package/src/@parsers/@ugc/{ugc.getCache.ts → GetCache.ts} +23 -23
  128. package/src/@parsers/@ugc/{ugc.expiry.ts → GetExpiry.ts} +31 -31
  129. package/src/@parsers/@ugc/{ugc.locations.ts → GetLocations.ts} +56 -56
  130. package/src/@parsers/@ugc/{ugc.header.ts → GetUGCHeader.ts} +29 -29
  131. package/src/@parsers/@ugc/{ugc.coordinates.ts → GetZonePolygon.ts} +110 -110
  132. package/src/@parsers/@ugc/{ugc.zones.ts → GetZones.ts} +51 -51
  133. package/src/@parsers/@ugc/{ugc.setCache.ts → SetCache.ts} +27 -27
  134. package/src/@parsers/@ugc/{ugc.extract.ts → UGCExtract.ts} +36 -36
  135. package/src/@types/{type.listener.ts → Actions.ts} +37 -38
  136. package/src/@types/{type.attributes.ts → Attributes.ts} +28 -28
  137. package/src/@types/{type.event.ts → Event.ts} +69 -69
  138. package/src/@types/{type.hvtec.ts → HVTEC.ts} +25 -25
  139. package/src/@types/{type.hash.ts → Hash.ts} +24 -24
  140. package/src/@types/{type.properties.ts → Properties.ts} +77 -77
  141. package/src/@types/{type.settings.ts → Settings.ts} +99 -93
  142. package/src/@types/{type.stanza.ts → Stanza.ts} +37 -37
  143. package/src/@types/{type.compiled.ts → StanzaCompiled.ts} +35 -34
  144. package/src/@types/{type.ugc.ts → UGC.ts} +24 -24
  145. package/src/@types/{type.pvtec.ts → VTEC.ts} +30 -30
  146. package/src/bootstrap.ts +128 -124
  147. package/src/index.ts +74 -74
  148. package/tsconfig.json +13 -13
  149. package/tsup.config.ts +15 -15
  150. package/.github/README.md +0 -384
  151. package/src/@dictionaries/dictionaries.awips.ts +0 -364
  152. package/src/@dictionaries/dictionaries.strings.ts +0 -22
  153. package/src/@dictionaries/dictionaries.tags.ts +0 -93
  154. package/src/@manager/manager.mkEvent.ts +0 -98
  155. package/src/@manager/manager.updateListener.ts +0 -180
  156. package/testing/init.js +0 -91
@@ -299,13 +299,13 @@ var require_Element = __commonJS({
299
299
  return result;
300
300
  }
301
301
  getText() {
302
- let text2 = "";
302
+ let text = "";
303
303
  for (const child of this.children) {
304
304
  if (typeof child === "string" || typeof child === "number") {
305
- text2 += child;
305
+ text += child;
306
306
  }
307
307
  }
308
- return text2;
308
+ return text;
309
309
  }
310
310
  getChildText(name, xmlns) {
311
311
  const child = this.getChild(name, xmlns);
@@ -364,8 +364,8 @@ var require_Element = __commonJS({
364
364
  }
365
365
  }
366
366
  /** add text node and return element */
367
- t(text2) {
368
- this.children.push(text2);
367
+ t(text) {
368
+ this.children.push(text);
369
369
  return this;
370
370
  }
371
371
  /* Manipulation */
@@ -578,9 +578,9 @@ var require_ltx = __commonJS({
578
578
  switch (state) {
579
579
  case STATE_TEXT:
580
580
  if (c === 60) {
581
- const text2 = endRecording();
582
- if (text2) {
583
- this.emit("text", escape2.unescapeXML(text2));
581
+ const text = endRecording();
582
+ if (text) {
583
+ this.emit("text", escape2.unescapeXML(text));
584
584
  }
585
585
  state = STATE_TAG_NAME;
586
586
  recordStart = pos + 1;
@@ -813,10 +813,10 @@ var require_bitops = __commonJS({
813
813
  }
814
814
  return new Uint8Array(res);
815
815
  };
816
- exports2.H = function(text2) {
816
+ exports2.H = function(text) {
817
817
  return __async(this, null, function* () {
818
818
  return new Uint8Array(
819
- yield crypto.subtle.digest("SHA-1", text2)
819
+ yield crypto.subtle.digest("SHA-1", text)
820
820
  );
821
821
  });
822
822
  };
@@ -838,9 +838,9 @@ var require_bitops = __commonJS({
838
838
  ));
839
839
  });
840
840
  };
841
- exports2.Hi = function(text2, salt, iterations) {
841
+ exports2.Hi = function(text, salt, iterations) {
842
842
  return __async(this, null, function* () {
843
- const key = new TextEncoder().encode(text2);
843
+ const key = new TextEncoder().encode(text);
844
844
  var concat = new Uint8Array(salt.length + 4);
845
845
  concat.set(salt);
846
846
  concat.set(new Uint8Array([0, 0, 0, 1]), salt.length);
@@ -1102,21 +1102,21 @@ var require_main3 = __commonJS({
1102
1102
  // src/index.ts
1103
1103
  var index_exports = {};
1104
1104
  __export(index_exports, {
1105
+ ClearEvents: () => ClearEvents,
1106
+ GenerateEASMessage: () => GenerateEASMessage,
1107
+ GetCleanedEvent: () => GetCleanedEvent,
1108
+ GetEventGeometry: () => GetEventGeometry,
1109
+ GetEvents: () => GetEvents,
1110
+ GetNodes: () => GetNodes,
1111
+ GetRandomEvent: () => GetRandomEvent,
1105
1112
  Manager: () => Manager,
1106
- clearEvents: () => clearEvents,
1107
- default: () => index_default,
1108
- getCleanedEvent: () => getCleanedEvent,
1109
- getEventGeometry: () => getEventGeometry,
1110
- getEvents: () => getEvents,
1111
- getNodes: () => getNodes,
1112
- getRandomEvent: () => getRandomEvent,
1113
- manualEvent: () => manualEvent,
1114
- query: () => query,
1115
- setEasTone: () => setEasTone,
1116
- setNode: () => setNode,
1117
- setSettings: () => setSettings,
1118
- startService: () => startService,
1119
- stopService: () => stopService
1113
+ ManualEvent: () => ManualEvent,
1114
+ QueryStanza: () => QueryStanza,
1115
+ SetNode: () => SetNode,
1116
+ SetSettings: () => SetSettings,
1117
+ StartService: () => StartService,
1118
+ StopService: () => StopService,
1119
+ default: () => index_default
1120
1120
  });
1121
1121
  module.exports = __toCommonJS(index_exports);
1122
1122
 
@@ -1124,7 +1124,7 @@ module.exports = __toCommonJS(index_exports);
1124
1124
  var import_path = __toESM(require("path"));
1125
1125
  var import_node_events = require("events");
1126
1126
  var bootstrap = {
1127
- version: `3.0.55`,
1127
+ version: `3.0.61`,
1128
1128
  isReady: true,
1129
1129
  ratelimits: {},
1130
1130
  session_xmpp: null,
@@ -1191,22 +1191,26 @@ var bootstrap = {
1191
1191
  NotifyServer: {
1192
1192
  Enabled: false,
1193
1193
  Server: `https://ntfy.sh`,
1194
- Attachments: null,
1194
+ Timezone: "UTC",
1195
+ MediaStorage: {
1196
+ EAS: null,
1197
+ TEXT: null,
1198
+ JSON: null
1199
+ },
1195
1200
  Credentials: {
1196
1201
  Username: null,
1197
1202
  Password: null
1198
1203
  }
1199
1204
  },
1200
- ListenerSettings: [],
1205
+ ActionSettings: [],
1201
1206
  GlobalSettings: {
1202
1207
  EventManagement: true,
1203
- BetterEventNames: true,
1204
1208
  DisableGeometryParsing: false,
1205
1209
  UseShapefileCoordinates: true,
1206
1210
  SPCWatchesOnly: true,
1207
1211
  ShapefileSkipPoints: 15,
1208
1212
  NodeTTL: 60,
1209
- NodeMinDistance: 120,
1213
+ NodeMaxDistance: 120,
1210
1214
  EventFiltering: {
1211
1215
  ListeningEvents: [],
1212
1216
  ListeningICAO: [],
@@ -1219,7 +1223,7 @@ var bootstrap = {
1219
1223
  },
1220
1224
  ArchiveSettings: {
1221
1225
  TTL: 60,
1222
- EventDirectory: null,
1226
+ JSONDirectory: null,
1223
1227
  TextDirectory: null,
1224
1228
  EasDirectory: null,
1225
1229
  EasToneout: null
@@ -1228,8 +1232,8 @@ var bootstrap = {
1228
1232
  }
1229
1233
  };
1230
1234
 
1231
- // src/@modules/@utilities/utilities.setSettings.ts
1232
- var setSettings = (newSettings) => {
1235
+ // src/@modules/@utilities/SetSettings.ts
1236
+ var SetSettings = (newSettings) => {
1233
1237
  const settings = bootstrap.settings;
1234
1238
  const merge = (target, source) => {
1235
1239
  for (const key in source) {
@@ -1250,12 +1254,12 @@ var setSettings = (newSettings) => {
1250
1254
  return settings;
1251
1255
  };
1252
1256
 
1253
- // src/@modules/@utilities/utilities.getSettings.ts
1254
- var getSettings = () => {
1257
+ // src/@modules/@utilities/GetSettings.ts
1258
+ var GetSettings = () => {
1255
1259
  return bootstrap.settings;
1256
1260
  };
1257
1261
 
1258
- // src/@parsers/@ugc/ugc.coordinates.ts
1262
+ // src/@parsers/@ugc/GetZonePolygon.ts
1259
1263
  var import_polygon_clipping = require("polygon-clipping");
1260
1264
  var getZonePolygon = (options) => {
1261
1265
  var _a, _b;
@@ -1333,18 +1337,18 @@ var getZonePolygon = (options) => {
1333
1337
  }
1334
1338
  };
1335
1339
 
1336
- // src/@building/building.geometry.ts
1337
- var getEventGeometry = (event) => {
1340
+ // src/@building/GetEventGeometry.ts
1341
+ var GetEventGeometry = (event) => {
1338
1342
  var _a, _b, _c, _d, _e, _f;
1339
- const settings = getSettings();
1343
+ const settings = GetSettings();
1340
1344
  const generated = (_c = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.geocode) == null ? void 0 : _b.polygon) != null ? _c : null;
1341
- const ugc2 = (_f = (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.geocode) == null ? void 0 : _e.ugc) != null ? _f : null;
1345
+ const ugc = (_f = (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.geocode) == null ? void 0 : _e.ugc) != null ? _f : null;
1342
1346
  let geo = {
1343
1347
  type: `Polygon`,
1344
1348
  coordinates: generated != null ? JSON.parse(Buffer.from(generated, "base64").toString("utf-8")) : null
1345
1349
  };
1346
- if (settings.GlobalSettings.UseShapefileCoordinates && generated == null && ugc2 != null) {
1347
- geo = getZonePolygon({ zones: ugc2, isUnion: false });
1350
+ if (settings.GlobalSettings.UseShapefileCoordinates && generated == null && ugc != null) {
1351
+ geo = getZonePolygon({ zones: ugc, isUnion: false });
1348
1352
  if (geo == null) {
1349
1353
  geo = {
1350
1354
  type: `Polygon`,
@@ -1355,21 +1359,21 @@ var getEventGeometry = (event) => {
1355
1359
  return geo;
1356
1360
  };
1357
1361
 
1358
- // src/@building/building.clean.ts
1359
- var getCleanedEvent = (event) => {
1362
+ // src/@building/GetCleanedEvent.ts
1363
+ var GetCleanedEvent = (event) => {
1360
1364
  for (const key of Object.keys(event)) {
1361
1365
  const value = event[key];
1362
1366
  if (value === null || value === void 0) {
1363
1367
  delete event[key];
1364
1368
  } else if (typeof value === "object" && value !== null && !Array.isArray(value)) {
1365
- event[key] = getCleanedEvent(value);
1369
+ event[key] = GetCleanedEvent(value);
1366
1370
  }
1367
1371
  }
1368
1372
  return event;
1369
1373
  };
1370
1374
 
1371
- // src/@modules/@utilities/utilities.setTimeoutAction.ts
1372
- var setTimeoutAction = (options) => {
1375
+ // src/@modules/@utilities/SetTimeoutAction.ts
1376
+ var SetTimeoutAction = (options) => {
1373
1377
  var _a, _b, _c;
1374
1378
  let target = (_b = (_a = bootstrap) == null ? void 0 : _a.ratelimits) == null ? void 0 : _b[options == null ? void 0 : options.identifier];
1375
1379
  if (!target) {
@@ -1398,8 +1402,8 @@ var setTimeoutAction = (options) => {
1398
1402
  return { limited: false };
1399
1403
  };
1400
1404
 
1401
- // src/@modules/@utilities/utilities.setWarning.ts
1402
- var setWarning = (options) => {
1405
+ // src/@modules/@utilities/SetWarning.ts
1406
+ var SetWarning = (options) => {
1403
1407
  var _a, _b;
1404
1408
  const settings = bootstrap.settings;
1405
1409
  bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
@@ -1408,10 +1412,10 @@ var setWarning = (options) => {
1408
1412
  }
1409
1413
  };
1410
1414
 
1411
- // src/@modules/@utilities/utilities.setEventEmit.ts
1412
- var setEventEmit = (options) => {
1415
+ // src/@modules/@utilities/SetEventEmit.ts
1416
+ var SetEventEmit = (options) => {
1413
1417
  if (options.limited) {
1414
- const isTimeout = setTimeoutAction({ identifier: `event.${options.event}`, addTime: true, max: 1, interval: 1 });
1418
+ const isTimeout = SetTimeoutAction({ identifier: `event.${options.event}`, addTime: true, max: 1, interval: 1 });
1415
1419
  if (isTimeout.limited) return;
1416
1420
  }
1417
1421
  bootstrap.listener.emit(options.event, options.metadata);
@@ -1419,21 +1423,21 @@ var setEventEmit = (options) => {
1419
1423
  bootstrap.listener.emit(`*`, { event: options.event, data: options.metadata });
1420
1424
  }
1421
1425
  if (options.message) {
1422
- setWarning({ message: options.message });
1426
+ SetWarning({ message: options.message });
1423
1427
  }
1424
1428
  };
1425
1429
 
1426
- // src/@modules/@utilities/utilities.setListener.ts
1427
- var setListener = (options) => {
1430
+ // src/@modules/@utilities/SetListener.ts
1431
+ var SetListener = (options) => {
1428
1432
  bootstrap.listener.on(options.event, options.callback);
1429
1433
  return () => {
1430
1434
  void bootstrap.listener.off(options.event, options.callback);
1431
1435
  };
1432
1436
  };
1433
1437
 
1434
- // src/@core/core.createListener.ts
1435
- var createListener = (event, callback) => {
1436
- setListener({ event, callback });
1438
+ // src/@core/CreateListener.ts
1439
+ var CreateListener = (event, callback) => {
1440
+ SetListener({ event, callback });
1437
1441
  };
1438
1442
 
1439
1443
  // node_modules/@xmpp/xml/index.js
@@ -1822,20 +1826,20 @@ var jid_default = j;
1822
1826
 
1823
1827
  // node_modules/@xmpp/error/index.js
1824
1828
  var XMPPError = class extends Error {
1825
- constructor(condition, text2, application) {
1826
- super(condition + (text2 ? ` - ${text2}` : ""));
1829
+ constructor(condition, text, application) {
1830
+ super(condition + (text ? ` - ${text}` : ""));
1827
1831
  this.name = "XMPPError";
1828
1832
  this.condition = condition;
1829
- this.text = text2;
1833
+ this.text = text;
1830
1834
  this.application = application;
1831
1835
  }
1832
1836
  static fromElement(element) {
1833
1837
  const [condition, second, third] = element.getChildElements();
1834
- let text2;
1838
+ let text;
1835
1839
  let application;
1836
1840
  if (second) {
1837
1841
  if (second.is("text")) {
1838
- text2 = second;
1842
+ text = second;
1839
1843
  } else if (second) {
1840
1844
  application = second;
1841
1845
  }
@@ -1843,7 +1847,7 @@ var XMPPError = class extends Error {
1843
1847
  }
1844
1848
  const error = new this(
1845
1849
  condition.name,
1846
- text2 ? text2.text() : "",
1850
+ text ? text.text() : "",
1847
1851
  application
1848
1852
  );
1849
1853
  error.element = element;
@@ -2761,8 +2765,8 @@ function id() {
2761
2765
 
2762
2766
  // node_modules/@xmpp/middleware/lib/StanzaError.js
2763
2767
  var StanzaError = class extends error_default {
2764
- constructor(condition, text2, application, type) {
2765
- super(condition, text2, application);
2768
+ constructor(condition, text, application, type) {
2769
+ super(condition, text, application);
2766
2770
  this.type = type;
2767
2771
  this.name = "StanzaError";
2768
2772
  }
@@ -4191,8 +4195,8 @@ function setupIfAvailable(module2, ...args) {
4191
4195
  return module2(...args);
4192
4196
  }
4193
4197
 
4194
- // src/@modules/@xmpp/xmpp.xOnline.ts
4195
- var xOnline = () => {
4198
+ // src/@modules/@xmpp/OnlineXMPP.ts
4199
+ var OnlineXMPP = () => {
4196
4200
  const settings = bootstrap.settings;
4197
4201
  bootstrap.session_xmpp.on(`online`, (address) => __async(null, null, function* () {
4198
4202
  bootstrap.cache.sigHault = false;
@@ -4203,7 +4207,7 @@ var xOnline = () => {
4203
4207
  to: `nwws@conference.nwws-oi.weather.gov/${nickname}`,
4204
4208
  xmlns: "http://jabber.org/protocol/muc"
4205
4209
  }));
4206
- setEventEmit({
4210
+ SetEventEmit({
4207
4211
  event: `onServiceStatus`,
4208
4212
  metadata: {
4209
4213
  message: `Succesfully connected to NOAA Weather Wire Service as "${nickname}"`,
@@ -4216,12 +4220,12 @@ var xOnline = () => {
4216
4220
  }));
4217
4221
  };
4218
4222
 
4219
- // src/@modules/@xmpp/xmpp.xOffline.ts
4220
- var xOffline = () => {
4223
+ // src/@modules/@xmpp/OfflineXMPP.ts
4224
+ var OfflineXMPP = () => {
4221
4225
  bootstrap.session_xmpp.on(`offline`, () => __async(null, null, function* () {
4222
4226
  bootstrap.cache.isConnected = false;
4223
4227
  bootstrap.cache.sigHault = true;
4224
- setEventEmit({
4228
+ SetEventEmit({
4225
4229
  event: `onServiceStatus`,
4226
4230
  metadata: {
4227
4231
  message: `Client has gone offline`,
@@ -4233,16 +4237,16 @@ var xOffline = () => {
4233
4237
  }));
4234
4238
  };
4235
4239
 
4236
- // src/@modules/@xmpp/xmpp.xError.ts
4237
- var xError = () => {
4240
+ // src/@modules/@xmpp/ErrorXMPP.ts
4241
+ var ErrorXMPP = () => {
4238
4242
  bootstrap.session_xmpp.on(`error`, (error) => __async(null, null, function* () {
4239
4243
  bootstrap.cache.isConnected = false;
4240
4244
  bootstrap.cache.sigHault = true;
4241
4245
  }));
4242
4246
  };
4243
4247
 
4244
- // src/@dictionaries/dictionaries.expressions.ts
4245
- var dict_expressions = {
4248
+ // src/@enums/Expressions.ts
4249
+ var EnumExpressions = {
4246
4250
  location: new RegExp(/^([A-Za-z.\-' ]+),\s*([A-Z]{2})$/),
4247
4251
  pvtec: new RegExp(`[OTEX].(NEW|CON|EXT|EXA|EXB|UPG|CAN|EXP|COR|ROU).[A-Z]{4}.[A-Z]{2}.[WAYSFON].[0-9]{4}.[0-9]{6}T[0-9]{4}Z-[0-9]{6}T[0-9]{4}Z`, "g"),
4248
4252
  hvtec: new RegExp(`[a-zA-Z0-9]{4}.[A-Z0-9].[A-Z]{2}.[0-9]{6}T[0-9]{4}Z.[0-9]{6}T[0-9]{4}Z.[0-9]{6}T[0-9]{4}Z.[A-Z]{2}`, "imu"),
@@ -4253,372 +4257,375 @@ var dict_expressions = {
4253
4257
  dateline: new RegExp(`\\d{3,4}\\s*(AM|PM)?\\s*[A-Z]{2,4}\\s+[A-Z]{3,}\\s+[A-Z]{3,}\\s+\\d{1,2}\\s+\\d{4}`, "gim")
4254
4258
  };
4255
4259
 
4256
- // src/@dictionaries/dictionaries.awips.ts
4257
- var dict_awips = {
4258
- ABV: `rawinsonde-data-above-100-millibars`,
4259
- ADA: `alarm-alert-administrative-message`,
4260
- ADM: `alert-administrative-message`,
4261
- ADR: `nws-administrative-message`,
4262
- ADV: `space-environment-advisory`,
4263
- AFD: `area-forecast-discussion`,
4264
- AFM: `area-forecast-matrices`,
4265
- AFP: `area-forecast-product`,
4266
- AFW: `fire-weather-matrix`,
4267
- AGF: `agricultural-forecast`,
4268
- AGO: `agricultural-observations`,
4269
- ALT: `space-environment-alert`,
4270
- AQA: `air-quality-alert`,
4271
- AQI: `air-quality-index-statement`,
4272
- ASA: `air-stagnation-advisory`,
4273
- AVA: `avalanche-watch`,
4274
- AVG: `avalanche-weather-guidance`,
4275
- AVW: `avalanche-warning`,
4276
- AWO: `area-weather-outlook`,
4277
- AWS: `area-weather-summary`,
4278
- AWU: `area-weather-update`,
4279
- AWW: `airport-weather-warning`,
4280
- BLU: `blue-alert`,
4281
- BOY: `buoy-report`,
4282
- BRG: `coast-guard-observations`,
4283
- BRT: `hourly-roundup-for-weather-radio`,
4284
- CAE: `child-abduction-emergency`,
4285
- CCF: `coded-city-forecast`,
4286
- CDW: `civil-danger-warning`,
4287
- CEM: `civil-emergency-message`,
4288
- CF6: `monthly-daily-climate-data`,
4289
- CFP: `convective-forecast-product`,
4290
- CFW: `coastal-flood-warnings-watches-statements`,
4291
- CGR: `coast-guard-surface-report`,
4292
- CHG: `computer-hurricane-guidance`,
4293
- CLA: `climatological-report-annual`,
4294
- CLI: `climatological-report-daily`,
4295
- CLM: `climatological-report-monthly`,
4296
- CLQ: `climatological-report-quarterly`,
4297
- CLS: `climatological-report-seasonal`,
4298
- CLT: `climate-report`,
4299
- CMM: `coded-climatological-monthly-means`,
4300
- COD: `coded-analysis-and-forecasts`,
4301
- CPF: `great-lakes-port-forecast`,
4302
- CUR: `space-environment-products-routine`,
4303
- CWA: `center-weather-advisory`,
4304
- CWF: `coastal-waters-forecast`,
4305
- CWS: `center-weather-statement`,
4306
- DAY: `space-environment-product-daily`,
4307
- DDO: `daily-dispersion-outlook`,
4308
- DGT: `drought-information-statement`,
4309
- DMO: `practice-demo-warning`,
4310
- DSA: `unnumbered-depression-advisory`,
4311
- DSM: `asos-daily-summary`,
4312
- DSW: `dust-storm-warning`,
4313
- EFP: `extended-forecast-3-to-5-day`,
4314
- EOL: `six-to-ten-day-weather-outlook-local`,
4315
- EQI: `tsunami-bulletin`,
4316
- EQR: `earthquake-report`,
4317
- EQW: `earthquake-warning`,
4318
- ESF: `flood-potential-outlook`,
4319
- ESG: `extended-streamflow-guidance`,
4320
- ESP: `extended-streamflow-prediction`,
4321
- ESS: `water-supply-outlook`,
4322
- EVI: `evacuation-immediate`,
4323
- EWW: `extreme-wind-warning`,
4324
- FA0: `aviation-area-forecast-pacific`,
4325
- FA1: `aviation-area-forecast-northeast`,
4326
- FA2: `aviation-area-forecast-southeast`,
4327
- FA3: `aviation-area-forecast-north-central`,
4328
- FA4: `aviation-area-forecast-south-central`,
4329
- FA5: `aviation-area-forecast-rocky-mountains`,
4330
- FA6: `aviation-area-forecast-west-coast`,
4331
- FA7: `aviation-area-forecast-juneau-ak`,
4332
- FA8: `aviation-area-forecast-anchorage-ak`,
4333
- FA9: `aviation-area-forecast-fairbanks-ak`,
4334
- FD0: `winds-aloft-forecast-24hr-high-altitude`,
4335
- FD1: `winds-aloft-forecast-6hr`,
4336
- FD2: `winds-aloft-forecast-12hr`,
4337
- FD3: `winds-aloft-forecast-24hr`,
4338
- FD4: `winds-aloft-forecast`,
4339
- FD5: `winds-aloft-forecast`,
4340
- FD6: `winds-aloft-forecast`,
4341
- FD7: `winds-aloft-forecast`,
4342
- FD8: `winds-aloft-forecast-6hr-high-altitude`,
4343
- FD9: `winds-aloft-forecast-12hr-high-altitude`,
4344
- FDI: `fire-danger-indices`,
4345
- FFA: `flash-flood-watch`,
4346
- FFG: `flash-flood-guidance`,
4347
- FFH: `headwater-guidance`,
4348
- FFS: `flash-flood-statement`,
4349
- FFW: `flash-flood-warning`,
4350
- FLN: `national-flood-summary`,
4351
- FLS: `flood-statement`,
4352
- FLW: `flood-warning`,
4353
- FOF: `upper-wind-fallout-forecast`,
4354
- FRW: `fire-warning`,
4355
- FSH: `marine-fisheries-service-message`,
4356
- FTM: `radar-outage-notification`,
4357
- FTP: `temp-pop-guidance`,
4358
- FWA: `fire-weather-administrative-message`,
4359
- FWD: `fire-weather-outlook-discussion`,
4360
- FWF: `fire-weather-forecast`,
4361
- FWL: `land-management-forecast`,
4362
- FWM: `miscellaneous-fire-weather-product`,
4363
- FWN: `fire-weather-notification`,
4364
- FWO: `fire-weather-observation`,
4365
- FWS: `fire-weather-spot-forecast`,
4366
- FZL: `freezing-level-data`,
4367
- GLF: `great-lakes-forecast`,
4368
- GLS: `great-lakes-storm-summary`,
4369
- GRE: `green`,
4370
- HD1: `rfc-qpf-data-product`,
4371
- HD2: `rfc-qpf-data-product`,
4372
- HD3: `rfc-qpf-data-product`,
4373
- HD4: `rfc-qpf-data-product`,
4374
- HD7: `rfc-qpf-data-product`,
4375
- HD8: `rfc-qpf-data-product`,
4376
- HD9: `rfc-qpf-data-product`,
4377
- HLS: `hurricane-local-statement`,
4378
- HMD: `hydrometeorological-discussion`,
4379
- HML: `ahps-xml-product`,
4380
- HMW: `hazardous-materials-warning`,
4381
- HP1: `rfc-qpf-verification-product`,
4382
- HP2: `rfc-qpf-verification-product`,
4383
- HP3: `rfc-qpf-verification-product`,
4384
- HP4: `rfc-qpf-verification-product`,
4385
- HP5: `rfc-qpf-verification-product`,
4386
- HP6: `rfc-qpf-verification-product`,
4387
- HP7: `rfc-qpf-verification-product`,
4388
- HP8: `rfc-qpf-verification-product`,
4389
- HRR: `weather-roundup`,
4390
- HSF: `high-seas-forecast`,
4391
- HWO: `hazardous-weather-outlook`,
4392
- HWR: `hourly-weather-roundup`,
4393
- HYD: `daily-hydrometeorological-products`,
4394
- HYM: `monthly-hydrometeorological-product`,
4395
- ICE: `ice-forecast`,
4396
- IDM: `ice-drift-vectors`,
4397
- INI: `administrative-message`,
4398
- IOB: `ice-observation`,
4399
- KPA: `keep-alive-message`,
4400
- LAE: `local-area-emergency`,
4401
- LCD: `preliminary-local-climatological-data`,
4402
- LCO: `local-cooperative-observation`,
4403
- LEW: `law-enforcement-warning`,
4404
- LFP: `local-forecast`,
4405
- LKE: `lake-stages`,
4406
- LLS: `low-level-sounding`,
4407
- LOW: `low-temperatures`,
4408
- LSR: `local-storm-report`,
4409
- LTG: `lightning-data`,
4410
- MAN: `rawinsonde-mandatory-levels`,
4411
- MAP: `mean-areal-precipitation`,
4412
- MAW: `amended-marine-forecast`,
4413
- MFM: `marine-forecast-matrix`,
4414
- MIM: `marine-interpretation-message`,
4415
- MIS: `miscellaneous-local-product`,
4416
- MOB: `marine-observations`,
4417
- MON: `space-environment-product-monthly`,
4418
- MRP: `marine-product-techniques-development`,
4419
- MSM: `asos-monthly-summary-message`,
4420
- MTR: `metar-observation`,
4421
- MTT: `metar-test-message`,
4422
- MVF: `marine-verification-coded-message`,
4423
- MWS: `marine-weather-statement`,
4424
- MWW: `marine-weather-message`,
4425
- NOU: `weather-reconnaissance-flights`,
4426
- NOW: `short-term-forecast`,
4427
- NOX: `data-management-message`,
4428
- NPW: `non-precipitation-warning`,
4429
- NSH: `nearshore-marine-forecast`,
4430
- NUW: `nuclear-power-plant-warning`,
4431
- NWR: `noaa-weather-radio-forecast`,
4432
- OAV: `other-aviation-products`,
4433
- OBS: `observations`,
4434
- OFA: `offshore-aviation-forecast`,
4435
- OFF: `offshore-forecast`,
4436
- OMR: `other-marine-products`,
4437
- OPU: `other-public-products`,
4438
- OSO: `other-surface-observations`,
4439
- OSW: `ocean-surface-winds`,
4440
- OUA: `other-upper-air-data`,
4441
- OZF: `zone-forecast`,
4442
- PFM: `point-forecast-matrices`,
4443
- PFW: `fire-weather-point-forecast-matrices`,
4444
- PLS: `plain-language-ship-report`,
4445
- PMD: `prognostic-meteorological-discussion`,
4446
- PNS: `public-information-statement`,
4447
- POE: `probability-of-exceedance`,
4448
- PRB: `heat-index-forecast-tables`,
4449
- PRC: `pilot-report-collective`,
4450
- PRE: `preliminary-forecasts`,
4451
- PSH: `post-storm-hurricane-report`,
4452
- PTS: `probabilistic-outlook-points`,
4453
- PWO: `public-severe-weather-outlook`,
4454
- PWS: `tropical-cyclone-probabilities`,
4455
- QPF: `quantitative-precipitation-forecast`,
4456
- QPS: `quantitative-precipitation-statement`,
4457
- RDF: `revised-digital-forecast`,
4458
- REC: `recreational-report`,
4459
- RER: `record-report`,
4460
- RET: `eas-activation-request`,
4461
- RFD: `rangeland-fire-danger-forecast`,
4462
- RFI: `rfi-observation`,
4463
- RFR: `route-forecast`,
4464
- RFW: `red-flag-warning`,
4465
- RHW: `radiological-hazard-warning`,
4466
- RMT: `required-monthly-test`,
4467
- RNS: `rain-information-statement`,
4468
- RR1: `hydro-met-data-report-part-1`,
4469
- RR2: `hydro-met-data-report-part-2`,
4470
- RR3: `hydro-met-data-report-part-3`,
4471
- RR4: `hydro-met-data-report-part-4`,
4472
- RR5: `hydro-met-data-report-part-5`,
4473
- RR6: `hydro-met-data-report-part-6`,
4474
- RR7: `hydro-met-data-report-part-7`,
4475
- RR8: `hydro-met-data-report-part-8`,
4476
- RR9: `hydro-met-data-report-part-9`,
4477
- RRA: `automated-hydrologic-observation-report`,
4478
- RRM: `miscellaneous-hydrologic-data`,
4479
- RRS: `hads-data`,
4480
- RRY: `asos-hourly-test-message`,
4481
- RSD: `daily-snotel-data`,
4482
- RSM: `monthly-snotel-data`,
4483
- RTP: `regional-temp-precip-table`,
4484
- RVA: `river-summary`,
4485
- RVD: `daily-river-forecast`,
4486
- RVF: `river-forecast`,
4487
- RVI: `river-ice-statement`,
4488
- RVM: `miscellaneous-river-product`,
4489
- RVR: `river-recreation-statement`,
4490
- RVS: `river-statement`,
4491
- RWR: `regional-weather-roundup`,
4492
- RWS: `regional-weather-summary`,
4493
- RWT: `required-weekly-test`,
4494
- SAB: `special-avalanche-bulletin`,
4495
- SAF: `agricultural-weather-forecast`,
4496
- SAG: `snow-avalanche-guidance`,
4497
- SAT: `apt-prediction`,
4498
- SAW: `preliminary-notice-of-watch`,
4499
- SCC: `storm-summary`,
4500
- SCD: `supplementary-climatological-data`,
4501
- SCN: `soil-climate-analysis-network`,
4502
- SCP: `satellite-cloud-product`,
4503
- SCS: `selected-cities-summary`,
4504
- SDO: `supplementary-data-observation`,
4505
- SDS: `special-dispersion-statement`,
4506
- SEL: `severe-local-storm-watch`,
4507
- SEV: `spc-watch-point-information`,
4508
- SFP: `state-forecast`,
4509
- SFT: `tabular-state-forecast`,
4510
- SGL: `rawinsonde-significant-levels`,
4511
- SHP: `surface-ship-report`,
4512
- SIG: `international-sigmet`,
4513
- SIM: `satellite-interpretation-message`,
4514
- SLS: `severe-local-storm-outline`,
4515
- SMF: `smoke-management-weather-forecast`,
4516
- SMW: `special-marine-warning`,
4517
- SOO: `science-operations-officer-product`,
4518
- SPE: `satellite-precipitation-estimates`,
4519
- SPF: `storm-strike-probability-bulletin`,
4520
- SPS: `special-weather-statement`,
4521
- SPW: `shelter-in-place-warning`,
4522
- SQW: `snow-squall-warning`,
4523
- SRD: `surf-discussion`,
4524
- SRF: `surf-forecast`,
4525
- SRG: `soaring-guidance`,
4526
- SSM: `synoptic-surface-observation`,
4527
- STA: `weather-statistical-summary`,
4528
- STD: `satellite-tropical-disturbance-summary`,
4529
- STO: `road-condition-report`,
4530
- STP: `state-temp-precip-table`,
4531
- STQ: `spot-forecast-request`,
4532
- SUM: `space-weather-message`,
4533
- SVR: `severe-thunderstorm-warning`,
4534
- SVS: `severe-weather-statement`,
4535
- SWOMCD: `mesoscale-discussion`,
4536
- SWODY1: `storm-prediction-center-day-1-outlook`,
4537
- SWODY2: `storm-prediction-center-day-2-outlook`,
4538
- SWODY3: `storm-prediction-center-day-3-outlook`,
4539
- SWS: `state-weather-summary`,
4540
- SYN: `regional-weather-synopsis`,
4541
- TAF: `terminal-aerodrome-forecast`,
4542
- TAP: `terminal-alerting-products`,
4543
- TAV: `travelers-forecast-table`,
4544
- TCA: `tropical-cyclone-advisory`,
4545
- TCD: `tropical-cyclone-discussion`,
4546
- TCE: `tropical-cyclone-position-estimate`,
4547
- TCM: `tropical-cyclone-marine-aviation-advisory`,
4548
- TCP: `public-tropical-cyclone-advisory`,
4549
- TCS: `satellite-tropical-cyclone-summary`,
4550
- TCU: `tropical-cyclone-update`,
4551
- TCV: `tropical-cyclone-break-points`,
4552
- TIB: `tsunami-bulletin`,
4553
- TID: `tide-report`,
4554
- TMA: `tsunami-tide-seismic-acknowledgement`,
4555
- TOE: `telephone-outage-emergency`,
4556
- TOR: `tornado-warning`,
4557
- TPT: `temperature-precipitation-table`,
4558
- TSU: `tsunami-information-statement`,
4559
- TUV: `ultraviolet-index`,
4560
- TVL: `travelers-forecast`,
4561
- TWB: `transcribed-weather-broadcast`,
4562
- TWD: `tropical-weather-discussion`,
4563
- TWO: `tropical-weather-outlook`,
4564
- TWS: `tropical-weather-summary`,
4565
- URN: `aircraft-reconnaissance`,
4566
- UVI: `ultraviolet-index`,
4567
- VAA: `volcanic-activity-advisory`,
4568
- VER: `forecast-verification-statistics`,
4569
- VFT: `taf-verification-product`,
4570
- VOW: `volcano-warning`,
4571
- WA0: `airmet-pacific`,
4572
- WA1: `airmet-northeast`,
4573
- WA2: `airmet-southeast`,
4574
- WA3: `airmet-north-central`,
4575
- WA4: `airmet-south-central`,
4576
- WA5: `airmet-rocky-mountains`,
4577
- WA6: `airmet-west-coast`,
4578
- WA7: `airmet-juneau-ak`,
4579
- WA8: `airmet-anchorage-ak`,
4580
- WA9: `airmet-fairbanks-ak`,
4581
- WAR: `space-environment-warning`,
4582
- WAT: `space-environment-watch`,
4583
- WCN: `weather-watch-clearance-notification`,
4584
- WCR: `weekly-weather-and-crop-report`,
4585
- WDA: `weekly-data-for-agriculture`,
4586
- WDU: `warning-decision-update`,
4587
- WEK: `space-environment-product-weekly`,
4588
- WOU: `watch-outline-update`,
4589
- WS1: `sigmet-northeast`,
4590
- WS2: `sigmet-southeast`,
4591
- WS3: `sigmet-north-central`,
4592
- WS4: `sigmet-south-central`,
4593
- WS5: `sigmet-rocky-mountains`,
4594
- WS6: `sigmet-west-coast`,
4595
- WST: `tropical-cyclone-sigmet`,
4596
- WSV: `volcanic-activity-sigmet`,
4597
- WSW: `winter-weather-warning`,
4598
- WWA: `watch-status-report`,
4599
- WWP: `watch-probabilities`,
4600
- ZFP: `zone-forecast-product`
4260
+ // src/@enums/AWIPS.ts
4261
+ var EnumAWIPS = {
4262
+ ABV: `Rawinsonde Data Above 100 Millibars`,
4263
+ ADA: `Alarm Alert Administrative Message`,
4264
+ ADM: `Alert Administrative Message`,
4265
+ ADR: `NWS Administrative Message`,
4266
+ ADV: `Space Environment Advisory`,
4267
+ AFD: `Area Forecast Discussion`,
4268
+ AFM: `Area Forecast Matrices`,
4269
+ AFP: `Area Forecast Product`,
4270
+ AFW: `Fire Weather Matrix`,
4271
+ AGF: `Agricultural Forecast`,
4272
+ AGO: `Agricultural Observations`,
4273
+ ALT: `Space Environment Alert`,
4274
+ AQA: `Air Quality Alert`,
4275
+ AQI: `Air Quality Index Statement`,
4276
+ ASA: `Air Stagnation Advisory`,
4277
+ AVA: `Avalanche Watch`,
4278
+ AVG: `Avalanche Weather Guidance`,
4279
+ AVW: `Avalanche Warning`,
4280
+ AWO: `Area Weather Outlook`,
4281
+ AWS: `Area Weather Summary`,
4282
+ AWU: `Area Weather Update`,
4283
+ AWW: `Airport Weather Warning`,
4284
+ BLU: `Blue Alert`,
4285
+ BOY: `Buoy Report`,
4286
+ BRG: `Coast Guard Observations`,
4287
+ BRT: `Hourly Roundup for Weather Radio`,
4288
+ CAE: `Child Abduction Emergency`,
4289
+ CCF: `Coded City Forecast`,
4290
+ CDW: `Civil Danger Warning`,
4291
+ CEM: `Civil Emergency Message`,
4292
+ CF6: `Monthly Daily Climate Data`,
4293
+ CFP: `Convective Forecast Product`,
4294
+ CFW: `Coastal Flood Warnings, Watches, and Statements`,
4295
+ CGR: `Coast Guard Surface Report`,
4296
+ CHG: `Computer Hurricane Guidance`,
4297
+ CLA: `Climatological Report Annual`,
4298
+ CLI: `Climatological Report Daily`,
4299
+ CLM: `Climatological Report Monthly`,
4300
+ CLQ: `Climatological Report Quarterly`,
4301
+ CLS: `Climatological Report Seasonal`,
4302
+ CLT: `Climate Report`,
4303
+ CMM: `Coded Climatological Monthly Means`,
4304
+ COD: `Coded Analysis and Forecasts`,
4305
+ CPF: `Great Lakes Port Forecast`,
4306
+ CUR: `Space Environment Products Routine`,
4307
+ CWA: `Center Weather Advisory`,
4308
+ CWF: `Coastal Waters Forecast`,
4309
+ CWS: `Center Weather Statement`,
4310
+ DAY: `Space Environment Product Daily`,
4311
+ DDO: `Daily Dispersion Outlook`,
4312
+ DGT: `Drought Information Statement`,
4313
+ DMO: `Practice Demo Warning`,
4314
+ DSA: `Unnumbered Depression Advisory`,
4315
+ DSM: `ASOS Daily Summary`,
4316
+ DSW: `Dust Storm Warning`,
4317
+ EFP: `Extended Forecast (3 to 5 Day)`,
4318
+ EOL: `Six to Ten Day Weather Outlook (Local)`,
4319
+ EQI: `Tsunami Bulletin`,
4320
+ EQR: `Earthquake Report`,
4321
+ EQW: `Earthquake Warning`,
4322
+ ESF: `Flood Potential Outlook`,
4323
+ ESG: `Extended Streamflow Guidance`,
4324
+ ESP: `Extended Streamflow Prediction`,
4325
+ ESS: `Water Supply Outlook`,
4326
+ EVI: `Evacuation Immediate`,
4327
+ EWW: `Extreme Wind Warning`,
4328
+ FA0: `Aviation Area Forecast (Pacific)`,
4329
+ FA1: `Aviation Area Forecast (Northeast)`,
4330
+ FA2: `Aviation Area Forecast (Southeast)`,
4331
+ FA3: `Aviation Area Forecast (North Central)`,
4332
+ FA4: `Aviation Area Forecast (South Central)`,
4333
+ FA5: `Aviation Area Forecast (Rocky Mountains)`,
4334
+ FA6: `Aviation Area Forecast (West Coast)`,
4335
+ FA7: `Aviation Area Forecast (Juneau, AK)`,
4336
+ FA8: `Aviation Area Forecast (Anchorage, AK)`,
4337
+ FA9: `Aviation Area Forecast (Fairbanks, AK)`,
4338
+ FD0: `Winds Aloft Forecast (24-Hour High Altitude)`,
4339
+ FD1: `Winds Aloft Forecast (6-Hour)`,
4340
+ FD2: `Winds Aloft Forecast (12-Hour)`,
4341
+ FD3: `Winds Aloft Forecast (24-Hour)`,
4342
+ FD4: `Winds Aloft Forecast`,
4343
+ FD5: `Winds Aloft Forecast`,
4344
+ FD6: `Winds Aloft Forecast`,
4345
+ FD7: `Winds Aloft Forecast`,
4346
+ FD8: `Winds Aloft Forecast (6-Hour High Altitude)`,
4347
+ FD9: `Winds Aloft Forecast (12-Hour High Altitude)`,
4348
+ FDI: `Fire Danger Indices`,
4349
+ FFA: `Flash Flood Watch`,
4350
+ FFG: `Flash Flood Guidance`,
4351
+ FFH: `Headwater Guidance`,
4352
+ FFS: `Flash Flood Statement`,
4353
+ FFW: `Flash Flood Warning`,
4354
+ FLN: `National Flood Summary`,
4355
+ FLS: `Flood Statement`,
4356
+ FLW: `Flood Warning`,
4357
+ FOF: `Upper Wind Fallout Forecast`,
4358
+ FRW: `Fire Warning`,
4359
+ FSH: `Marine Fisheries Service Message`,
4360
+ FTM: `Radar Outage Notification`,
4361
+ FTP: `Temp POP Guidance`,
4362
+ FWA: `Fire Weather Administrative Message`,
4363
+ FWD: `Fire Weather Outlook Discussion`,
4364
+ FWF: `Fire Weather Forecast`,
4365
+ FWL: `Land Management Forecast`,
4366
+ FWM: `Miscellaneous Fire Weather Product`,
4367
+ FWN: `Fire Weather Notification`,
4368
+ FWO: `Fire Weather Observation`,
4369
+ FWS: `Fire Weather Spot Forecast`,
4370
+ FZL: `Freezing Level Data`,
4371
+ GLF: `Great Lakes Forecast`,
4372
+ GLS: `Great Lakes Storm Summary`,
4373
+ GRE: `Green`,
4374
+ HD1: `RFC QPF Data Product`,
4375
+ HD2: `RFC QPF Data Product`,
4376
+ HD3: `RFC QPF Data Product`,
4377
+ HD4: `RFC QPF Data Product`,
4378
+ HD7: `RFC QPF Data Product`,
4379
+ HD8: `RFC QPF Data Product`,
4380
+ HD9: `RFC QPF Data Product`,
4381
+ HLS: `Hurricane Local Statement`,
4382
+ HMD: `Hydrometeorological Discussion`,
4383
+ HML: `AHPS XML Product`,
4384
+ HMW: `Hazardous Materials Warning`,
4385
+ HP1: `RFC QPF Verification Product`,
4386
+ HP2: `RFC QPF Verification Product`,
4387
+ HP3: `RFC QPF Verification Product`,
4388
+ HP4: `RFC QPF Verification Product`,
4389
+ HP5: `RFC QPF Verification Product`,
4390
+ HP6: `RFC QPF Verification Product`,
4391
+ HP7: `RFC QPF Verification Product`,
4392
+ HP8: `RFC QPF Verification Product`,
4393
+ HRR: `Weather Roundup`,
4394
+ HSF: `High Seas Forecast`,
4395
+ HWO: `Hazardous Weather Outlook`,
4396
+ HWR: `Hourly Weather Roundup`,
4397
+ HYD: `Daily Hydrometeorological Products`,
4398
+ HYM: `Monthly Hydrometeorological Product`,
4399
+ ICE: `Ice Forecast`,
4400
+ IDM: `Ice Drift Vectors`,
4401
+ INI: `Administrative Message`,
4402
+ IOB: `Ice Observation`,
4403
+ KPA: `Keep Alive Message`,
4404
+ LAE: `Local Area Emergency`,
4405
+ LCD: `Preliminary Local Climatological Data`,
4406
+ LCO: `Local Cooperative Observation`,
4407
+ LEW: `Law Enforcement Warning`,
4408
+ LFP: `Local Forecast`,
4409
+ LKE: `Lake Stages`,
4410
+ LLS: `Low Level Sounding`,
4411
+ LOW: `Low Temperatures`,
4412
+ LSR: `Local Storm Report`,
4413
+ LTG: `Lightning Data`,
4414
+ MAN: `Rawinsonde Mandatory Levels`,
4415
+ MAP: `Mean Areal Precipitation`,
4416
+ MAW: `Amended Marine Forecast`,
4417
+ MFM: `Marine Forecast Matrix`,
4418
+ MIM: `Marine Interpretation Message`,
4419
+ MIS: `Miscellaneous Local Product`,
4420
+ MOB: `Marine Observations`,
4421
+ MON: `Space Environment Product Monthly`,
4422
+ MRP: `Marine Product Techniques Development`,
4423
+ MSM: `ASOS Monthly Summary Message`,
4424
+ MTR: `METAR Observation`,
4425
+ MTT: `METAR Test Message`,
4426
+ MVF: `Marine Verification Coded Message`,
4427
+ MWS: `Marine Weather Statement`,
4428
+ MWW: `Marine Weather Message`,
4429
+ NOU: `Weather Reconnaissance Flights`,
4430
+ NOW: `Short-Term Forecast`,
4431
+ NOX: `Data Management Message`,
4432
+ NPW: `Non-Precipitation Warning`,
4433
+ NSH: `Nearshore Marine Forecast`,
4434
+ NUW: `Nuclear Power Plant Warning`,
4435
+ NWR: `NOAA Weather Radio Forecast`,
4436
+ OAV: `Other Aviation Products`,
4437
+ OBS: `Observations`,
4438
+ OFA: `Offshore Aviation Forecast`,
4439
+ OFF: `Offshore Forecast`,
4440
+ OMR: `Other Marine Products`,
4441
+ OPU: `Other Public Products`,
4442
+ OSO: `Other Surface Observations`,
4443
+ OSW: `Ocean Surface Winds`,
4444
+ OUA: `Other Upper Air Data`,
4445
+ OZF: `Zone Forecast`,
4446
+ PFM: `Point Forecast Matrices`,
4447
+ PFW: `Fire Weather Point Forecast Matrices`,
4448
+ PLS: `Plain Language Ship Report`,
4449
+ PMD: `Prognostic Meteorological Discussion`,
4450
+ PNS: `Public Information Statement`,
4451
+ POE: `Probability of Exceedance`,
4452
+ PRB: `Heat Index Forecast Tables`,
4453
+ PRC: `Pilot Report Collective`,
4454
+ PRE: `Preliminary Forecasts`,
4455
+ PSH: `Post-Storm Hurricane Report`,
4456
+ PTS: `Probabilistic Outlook Points`,
4457
+ AAG: `Aviation Area Forecast`,
4458
+ PWO: `Public Severe Weather Outlook`,
4459
+ PWS: `Tropical Cyclone Probabilities`,
4460
+ QPF: `Quantitative Precipitation Forecast`,
4461
+ QPS: `Quantitative Precipitation Statement`,
4462
+ RDF: `Revised Digital Forecast`,
4463
+ REC: `Recreational Report`,
4464
+ RER: `Record Report`,
4465
+ RET: `EAS Activation Request`,
4466
+ RFD: `Rangeland Fire Danger Forecast`,
4467
+ RFI: `RFI Observation`,
4468
+ RFR: `Route Forecast`,
4469
+ RFW: `Red Flag Warning`,
4470
+ RHW: `Radiological Hazard Warning`,
4471
+ RMT: `Required Monthly Test`,
4472
+ RNS: `Rain Information Statement`,
4473
+ RR1: `Hydro-Met Data Report Part 1`,
4474
+ RR2: `Hydro-Met Data Report Part 2`,
4475
+ RR3: `Hydro-Met Data Report Part 3`,
4476
+ RR4: `Hydro-Met Data Report Part 4`,
4477
+ RR5: `Hydro-Met Data Report Part 5`,
4478
+ RR6: `Hydro-Met Data Report Part 6`,
4479
+ RR7: `Hydro-Met Data Report Part 7`,
4480
+ RR8: `Hydro-Met Data Report Part 8`,
4481
+ RR9: `Hydro-Met Data Report Part 9`,
4482
+ RRA: `Automated Hydrologic Observation Report`,
4483
+ RRM: `Miscellaneous Hydrologic Data`,
4484
+ RRS: `HADS Data`,
4485
+ RRY: `ASOS Hourly Test Message`,
4486
+ RSD: `Daily SNOTEL Data`,
4487
+ RSM: `Monthly SNOTEL Data`,
4488
+ RTP: `Regional Temperature and Precipitation Table`,
4489
+ RVA: `River Summary`,
4490
+ RVD: `Daily River Forecast`,
4491
+ RVF: `River Forecast`,
4492
+ RVI: `River Ice Statement`,
4493
+ RVM: `Miscellaneous River Product`,
4494
+ RVR: `River Recreation Statement`,
4495
+ RVS: `River Statement`,
4496
+ RWR: `Regional Weather Roundup`,
4497
+ RWS: `Regional Weather Summary`,
4498
+ RWT: `Required Weekly Test`,
4499
+ SAB: `Special Avalanche Bulletin`,
4500
+ SAF: `Agricultural Weather Forecast`,
4501
+ SAG: `Snow Avalanche Guidance`,
4502
+ SAT: `APT Prediction`,
4503
+ SAW: `Preliminary Notice of Watch`,
4504
+ SCC: `Storm Summary`,
4505
+ SCD: `Supplementary Climatological Data`,
4506
+ SCN: `Soil Climate Analysis Network`,
4507
+ SCP: `Satellite Cloud Product`,
4508
+ SCS: `Selected Cities Summary`,
4509
+ SDO: `Supplementary Data Observation`,
4510
+ SDS: `Special Dispersion Statement`,
4511
+ SEL: `Severe Local Storm Watch`,
4512
+ SEV: `SPC Watch Point Information`,
4513
+ SFP: `State Forecast`,
4514
+ SFT: `Tabular State Forecast`,
4515
+ SGL: `Rawinsonde Significant Levels`,
4516
+ SHP: `Surface Ship Report`,
4517
+ SIG: `International SIGMET`,
4518
+ SIM: `Satellite Interpretation Message`,
4519
+ SLS: `Severe Local Storm Outline`,
4520
+ SMF: `Smoke Management Weather Forecast`,
4521
+ SMW: `Special Marine Warning`,
4522
+ SOO: `Science Operations Officer Product`,
4523
+ SPE: `Satellite Precipitation Estimates`,
4524
+ SPF: `Storm Strike Probability Bulletin`,
4525
+ SPS: `Special Weather Statement`,
4526
+ SPW: `Shelter in Place Warning`,
4527
+ SQW: `Snow Squall Warning`,
4528
+ SRD: `Surf Discussion`,
4529
+ SRF: `Surf Forecast`,
4530
+ SRG: `Soaring Guidance`,
4531
+ SSM: `Synoptic Surface Observation`,
4532
+ STA: `Weather Statistical Summary`,
4533
+ STD: `Satellite Tropical Disturbance Summary`,
4534
+ STO: `Road Condition Report`,
4535
+ STP: `State Temperature and Precipitation Table`,
4536
+ STQ: `Spot Forecast Request`,
4537
+ SUM: `Space Weather Message`,
4538
+ SVR: `Severe Thunderstorm Warning`,
4539
+ SVS: `Severe Weather Statement`,
4540
+ SWOMCD: `Mesoscale Discussion`,
4541
+ SWODY1: `Storm Prediction Center Day 1 Outlook`,
4542
+ SWODY2: `Storm Prediction Center Day 2 Outlook`,
4543
+ SWODY3: `Storm Prediction Center Day 3 Outlook`,
4544
+ SWOD48: `Storm Prediction Center Day 4 to 8 Outlook`,
4545
+ SWS: `State Weather Summary`,
4546
+ SYN: `Regional Weather Synopsis`,
4547
+ TAF: `Terminal Aerodrome Forecast`,
4548
+ TAP: `Terminal Alerting Products`,
4549
+ TAV: `Travelers Forecast Table`,
4550
+ TCA: `Tropical Cyclone Advisory`,
4551
+ TCD: `Tropical Cyclone Discussion`,
4552
+ TCE: `Tropical Cyclone Position Estimate`,
4553
+ TCM: `Tropical Cyclone Marine Aviation Advisory`,
4554
+ TCP: `Public Tropical Cyclone Advisory`,
4555
+ TCS: `Satellite Tropical Cyclone Summary`,
4556
+ TCU: `Tropical Cyclone Update`,
4557
+ TCV: `Tropical Cyclone Break Points`,
4558
+ TIB: `Tsunami Bulletin`,
4559
+ TID: `Tide Report`,
4560
+ TMA: `Tsunami Tide Seismic Acknowledgement`,
4561
+ TOE: `Telephone Outage Emergency`,
4562
+ TOR: `Tornado Warning`,
4563
+ TPT: `Temperature Precipitation Table`,
4564
+ TSU: `Tsunami Information Statement`,
4565
+ TUV: `Ultraviolet Index`,
4566
+ TVL: `Travelers Forecast`,
4567
+ TWB: `Transcribed Weather Broadcast`,
4568
+ TWD: `Tropical Weather Discussion`,
4569
+ TWO: `Tropical Weather Outlook`,
4570
+ TWS: `Tropical Weather Summary`,
4571
+ URN: `Aircraft Reconnaissance`,
4572
+ UVI: `Ultraviolet Index`,
4573
+ VAA: `Volcanic Activity Advisory`,
4574
+ VER: `Forecast Verification Statistics`,
4575
+ VFT: `TAF Verification Product`,
4576
+ VOW: `Volcano Warning`,
4577
+ WA0: `AIRMET Pacific`,
4578
+ WA1: `AIRMET Northeast`,
4579
+ WA2: `AIRMET Southeast`,
4580
+ WA3: `AIRMET North Central`,
4581
+ WA4: `AIRMET South Central`,
4582
+ WA5: `AIRMET Rocky Mountains`,
4583
+ WA6: `AIRMET West Coast`,
4584
+ WA7: `AIRMET Juneau, AK`,
4585
+ WA8: `AIRMET Anchorage, AK`,
4586
+ WA9: `AIRMET Fairbanks, AK`,
4587
+ WAR: `Space Environment Warning`,
4588
+ WAT: `Space Environment Watch`,
4589
+ WCN: `Weather Watch Clearance Notification`,
4590
+ WCR: `Weekly Weather and Crop Report`,
4591
+ WDA: `Weekly Data for Agriculture`,
4592
+ WDU: `Warning Decision Update`,
4593
+ WEK: `Space Environment Product Weekly`,
4594
+ WOU: `Watch Outline Update`,
4595
+ WS1: `SIGMET Northeast`,
4596
+ WS2: `SIGMET Southeast`,
4597
+ WS3: `SIGMET North Central`,
4598
+ WS4: `SIGMET South Central`,
4599
+ WS5: `SIGMET Rocky Mountains`,
4600
+ WS6: `SIGMET West Coast`,
4601
+ WST: `Tropical Cyclone SIGMET`,
4602
+ WSV: `Volcanic Activity SIGMET`,
4603
+ WSW: `Winter Weather Warning`,
4604
+ WWA: `Watch Status Report`,
4605
+ WWP: `Watch Probabilities`,
4606
+ ZFP: `Zone Forecast Product`
4601
4607
  };
4602
4608
 
4603
- // src/@modules/@stanza/stanza.getAwipsType.ts
4604
- var getAwipsType = (options) => {
4609
+ // src/@modules/@stanza/GetAwipsType.ts
4610
+ var GetAwipsType = (options) => {
4605
4611
  const attributes = options.attributes;
4606
4612
  if (!attributes.awipsid) {
4607
4613
  return {
4608
4614
  type: null,
4609
- prefix: null
4615
+ prefix: null,
4616
+ discovered: false
4610
4617
  };
4611
4618
  }
4612
- for (const [prefix, type] of Object.entries(dict_awips)) {
4619
+ for (const [prefix, type] of Object.entries(EnumAWIPS)) {
4613
4620
  if (attributes.awipsid.startsWith(prefix)) {
4614
- return { type, prefix };
4621
+ return { type, prefix, discovered: true };
4615
4622
  }
4616
4623
  }
4617
- return { type: null, prefix: null };
4624
+ return { type: options.attributes.awipsid, prefix: options.attributes.awipsid, discovered: false };
4618
4625
  };
4619
4626
 
4620
- // src/@modules/@stanza/stanza.validate.ts
4621
- var validate = (options) => {
4627
+ // src/@modules/@stanza/ValidateStanza.ts
4628
+ var ValidateStanza = (options) => {
4622
4629
  if (options.stanza.is(`message`)) {
4623
4630
  const cb = options.stanza.getChild(`x`);
4624
4631
  if (cb && cb.children) {
@@ -4627,9 +4634,9 @@ var validate = (options) => {
4627
4634
  if (attributes.awipsid && attributes.awipsid.length > 1) {
4628
4635
  const isCapEvent = message.includes(`<?xml`);
4629
4636
  const isCapAreaDescription = message.includes(`<areaDesc>`);
4630
- const isVTEC = message.match(dict_expressions.pvtec) != null;
4631
- const isUGC = message.match(dict_expressions.ugc1) != null;
4632
- const getType = getAwipsType({ attributes });
4637
+ const isVTEC = message.match(EnumExpressions.pvtec) != null;
4638
+ const isUGC = message.match(EnumExpressions.ugc1) != null;
4639
+ const getType = GetAwipsType({ attributes });
4633
4640
  if (getType.type != null) {
4634
4641
  return {
4635
4642
  message,
@@ -4649,8 +4656,8 @@ var validate = (options) => {
4649
4656
  return { isIgnored: true };
4650
4657
  };
4651
4658
 
4652
- // src/@dictionaries/dictionaries.matches.ts
4653
- var dict_matches = {
4659
+ // src/@enums/Matches.ts
4660
+ var EnumMatches = {
4654
4661
  SPS: [
4655
4662
  { match: /STRONG THUNDERSTORM/i, label: "Convective Special Weather Statement", statement: false },
4656
4663
  { match: /SPECIAL WEATHER STATEMENT/i, label: "Special Weather Statement", statement: false }
@@ -4686,15 +4693,20 @@ var dict_matches = {
4686
4693
  ]
4687
4694
  };
4688
4695
 
4689
- // src/@parsers/@text/text.getDescriptionFromProduct.ts
4690
- var getDescriptionFromProduct = (options) => {
4696
+ // src/@parsers/@text/GetDescriptionFromProduct.ts
4697
+ var GetDescriptionFromProduct = (options) => {
4691
4698
  let message = options.message;
4692
- const dates = Array.from(message.matchAll(dict_expressions.dateline));
4699
+ const predefinedEndMarkers = ["&&", "LAT..."];
4700
+ const getEndIndex = (text, fromIndex = 0) => {
4701
+ const indices = predefinedEndMarkers.map((marker) => text.indexOf(marker, fromIndex)).filter((idx) => idx !== -1);
4702
+ return indices.length ? Math.min(...indices) : -1;
4703
+ };
4704
+ const dates = Array.from(message.matchAll(EnumExpressions.dateline));
4693
4705
  if (dates.length) {
4694
4706
  const lastMatch = dates[dates.length - 1][0];
4695
4707
  const sIndx = message.lastIndexOf(lastMatch);
4696
4708
  if (sIndx !== -1) {
4697
- const endIndx = message.indexOf("&&", sIndx);
4709
+ const endIndx = getEndIndex(message, sIndx);
4698
4710
  message = message.substring(sIndx + lastMatch.length, endIndx !== -1 ? endIndx : void 0).trimStart();
4699
4711
  if (message.startsWith("/")) message = message.slice(1).trimStart();
4700
4712
  if (options.handle && message.includes(options.handle)) {
@@ -4708,22 +4720,22 @@ var getDescriptionFromProduct = (options) => {
4708
4720
  if (handleIndx !== -1) {
4709
4721
  let afterHandle = message.substring(handleIndx + options.handle.length).trimStart();
4710
4722
  if (afterHandle.startsWith("/")) afterHandle = afterHandle.slice(1).trimStart();
4711
- const latEnd = afterHandle.indexOf("&&");
4723
+ const latEnd = getEndIndex(afterHandle);
4712
4724
  message = latEnd !== -1 ? afterHandle.substring(0, latEnd).trim() : afterHandle.trim();
4713
4725
  }
4714
4726
  }
4715
4727
  return message.trim();
4716
4728
  };
4717
4729
 
4718
- // src/@parsers/@text/text.getPolygonFromProduct.ts
4730
+ // src/@parsers/@text/GetPolygonFromProduct.ts
4719
4731
  var getPolygonFromProduct = (message) => {
4720
4732
  const coordinates = [];
4721
4733
  const match = message.match(
4722
4734
  /LAT\.\.\.LON\s+([\s\S]*?)(?=\n[A-Z]{2,}(?:\.\.\.|:)|\$\$|&&|$)/i
4723
4735
  );
4724
4736
  if (!match) return coordinates;
4725
- const text2 = match[1];
4726
- const values = text2.match(/\d{4,8}/g);
4737
+ const text = match[1];
4738
+ const values = text.match(/\d{4,8}/g);
4727
4739
  if (!values) return coordinates;
4728
4740
  if (values.every((v) => v.length === 8)) {
4729
4741
  for (const value of values) {
@@ -4748,8 +4760,8 @@ var getPolygonFromProduct = (message) => {
4748
4760
  return coordinates;
4749
4761
  };
4750
4762
 
4751
- // src/@parsers/@text/text.getTextFromProduct.ts
4752
- var getTextFromProduct = (options) => {
4763
+ // src/@parsers/@text/GetTextFromProduct.ts
4764
+ var GetTextFromProduct = (options) => {
4753
4765
  var _a;
4754
4766
  const lines = options.message.split(`
4755
4767
  `);
@@ -4769,8 +4781,8 @@ var getTextFromProduct = (options) => {
4769
4781
  return null;
4770
4782
  };
4771
4783
 
4772
- // src/@dictionaries/dictionaries.icao.ts
4773
- var dict_icao = {
4784
+ // src/@enums/ICAO.ts
4785
+ var EnumICAO = {
4774
4786
  "KLUB": "Lubbock, TX",
4775
4787
  "KLCH": "Lake Charles, LA",
4776
4788
  "TSTL": "St. Louis, MO",
@@ -5011,180 +5023,251 @@ var dict_icao = {
5011
5023
  "PAJK": "Juneau, AK"
5012
5024
  };
5013
5025
 
5014
- // src/@building/building.office.ts
5015
- var getEventOffice = (options) => {
5026
+ // src/@building/GetEventOffice.ts
5027
+ var GetEventOffice = (options) => {
5016
5028
  var _a, _b, _c, _d, _e, _f, _g;
5017
5029
  const office = options.pVtec != null ? (_b = (_a = options.pVtec) == null ? void 0 : _a.tracking) == null ? void 0 : _b.split(`.`)[0] : (_e = (_c = options.attributes) == null ? void 0 : _c.cccc) != null ? _e : options.organization != null ? Array.isArray(options.organization) ? (_d = options.organization) == null ? void 0 : _d[0] : options.organization : null;
5018
- const name = (_g = (_f = dict_icao) == null ? void 0 : _f[office]) != null ? _g : null;
5030
+ const name = (_g = (_f = EnumICAO) == null ? void 0 : _f[office]) != null ? _g : null;
5019
5031
  return { office, name };
5020
5032
  };
5021
5033
 
5022
- // src/@dictionaries/dictionaries.tags.ts
5023
- var dict_tags = {
5024
- "FROSTBITE AND HYPOTHERMIA ARE LIKELY": "Frostbite and Hypothermia Likely",
5025
- "LICKELY BECOME SLICK AND HAZARDOUS": "Slick and Hazardous Roads",
5026
- "SLIPPERY ROAD CONDITIONS": "Slippery Roads",
5027
- "BLOWING SNOW WHICH COULD REDUCE VISIBILITY": "Blowing Snow Reducing Visibility",
5028
- "TRAVEL COULD BE VERY DIFFICULT": "Difficult Travel Conditions",
5029
- "DIFFICULT TRAVEL CONDITIONS": "Difficult Travel Conditions",
5030
- "EXPECT DISRUPTIONS": "Expect Disruptions to Travel",
5031
- "A LARGE AND EXTREMELY DANGEROUS TORNADO": "Large and Dangerous Tornado",
5032
- "THIS IS A PARTICULARLY DANGEROUS SITUATION": "Particularly Dangerous Situation",
5033
- "RADAR INDICATED ROTATION": "Radar Indicated Tornado",
5034
- "WEATHER SPOTTERS CONFIRMED TORNADO": "Confirmed by Storm Spotters",
5035
- "A SEVERE THUNDERSTORM CAPABLE OF PRODUCING A TORNADO": "Developing Tornado",
5036
- "LAW ENFORCEMENT CONFIRMED TORNADO": "Reported by Law Enforcement",
5037
- "A TORNADO IS ON THE GROUND": "Confirmed Tornado",
5038
- "WEATHER SPOTTERS REPORTED FUNNEL CLOUD": "Confirmed Funnel Cloud by Storm Spotters",
5039
- "PUBLIC CONFIRMED TORNADO": "Public reports of Tornado",
5040
- "RADAR CONFIRMED": "Radar Confirmed",
5041
- "TORNADO WAS REPORTED BRIEFLY ON THE GROUND": "Tornado no longer on ground",
5042
- "SPOTTERS INDICATE THAT A FUNNEL CLOUD CONTINUES WITH THIS STORM": "Funnel Cloud Continues",
5043
- "A TORNADO MAY DEVELOP AT ANY TIME": "Potentional still exists for Tornado to form",
5044
- "LIFE-THREATENING SITUATION": "Life Threating Situation",
5045
- "COMPLETE DESTRUCTION IS POSSIBLE": "Extremly Damaging Tornado",
5046
- "POTENTIALLY DEADLY TORNADO": "Deadly Tornado",
5047
- "RADAR INDICATED": "Radar Indicated",
5048
- "HAIL DAMAGE TO VEHICLES IS EXPECTED": "Damaging to Vehicles",
5049
- "EXPECT WIND DAMAGE": "Wind Damage",
5050
- "FREQUENT LIGHTNING": "Frequent Lightning",
5051
- "PEOPLE AND ANIMALS OUTDOORS WILL BE INJURED": "Capable of Injuring People and Animals",
5052
- "TRAINED WEATHER SPOTTERS": "Confirmed by Storm Spotters",
5053
- "SOURCE...PUBLIC": "Confirmed by Public",
5054
- "SMALL CRAFT COULD BE DAMAGED": "Potential Damage to Small Craft",
5055
- "A TORNADO WATCH REMAINS IN EFFECT": "Active Tornado Watch",
5056
- "TENNIS BALL SIZE HAIL": "Tennis Ball Size Hail",
5057
- "BASEBALL SIZE HAIL": "Baseball Size Hail",
5058
- "GOLF BALL SIZE HAIL": "Golf Ball Size Hail",
5059
- "QUARTER SIZE HAIL": "Quarter Size Hail",
5060
- "PING PONG BALL SIZE HAIL": "Ping Pong Ball Size Hail",
5061
- "NICKEL SIZE HAIL": "Nickel Size Hail",
5062
- "DOPPLER RADAR.": "Confirmed by Radar",
5063
- "DOPPLER RADAR AND AUTOMATED GAUGES.": "Confirmed by Radar and Gauges",
5064
- "FLASH FLOODING CAUSED BY THUNDERSTORMS.": "Caused by Thunderstorm",
5065
- "SOURCE...EMERGENCY MANAGEMENT.": "Confirmed by Emergency Management",
5066
- "FLASH FLOODING CAUSED BY HEAVY RAIN.": "Caused by heavy rain",
5067
- "SOURCE...LAW ENFORCEMENT REPORTED.": "Confirmed by Law Enforcement",
5068
- "MINOR FLOODING IS OCCURING": "Minor Flooding Occurring",
5069
- "VERY COLD TEMPERATURES CAN LEAD TO HYPOTHERMIA": "Hypothermia Risk",
5070
- "SENSITIVE VEGETATION AND POSSIBLY DAMAGE UNPROTECTED OUTDOOR": "Vegetation and Outdoor Plumbing Risk",
5071
- "RIP CURRENTS CAN SWEEP EVEN THE BEST SWIMMER": "Hazardous to All Swimmers",
5072
- "HYPOTHERMIA IF PRECAUTIONS ARE NOT TAKEN.": "Hypothermia Risk",
5073
- "FROSTBITE AND HYPOTHERMIA WILL OCCUR IF UNPROTECTED SKIN": "Frostbite and Hypothermia Risk on Unprotected Skin",
5074
- "TEMPERATURES COULD CAUSE RUPTURED WATER PIPES": "Risk of Ruptured Water Pipes",
5075
- "COULD RESULT IN HYPOTHERMIA OR FROSTBITE ON EXPOSED SKIN IF": "Hypothermia or Frostbite Risk on Exposed Skin",
5076
- "WINDS WILL STRENGTHEN": "Strengthening Winds",
5077
- "EXPECT ROADS TO RE-FREEZE": "Roads May Re-Freeze",
5078
- "SLICK AND ICY SPOTS ON ROADS": "Slick and Icy Roads",
5079
- "ICY PATCHES MAY BE MORE COMMON ON BRIDGES": "Icy Patches Likely on Bridges",
5080
- "SLICK SPOTS ON UNTREATED ROADS": "Slick Spots on Untreated Roads",
5081
- "TEMPERATURES ARE EXPECTED TO FALL BELOW FREEZING": "Temperatures Expected Below Freezing",
5082
- "HAZARDOUS ROADWAYS AND BLACK ICE": "Hazardous Roadways and Black Ice",
5083
- "SLOW DOWN AND ALLOW EXTRA TIME": "Slow Down and Allow Extra Time",
5084
- "SHOULD EXERCISE CAUTION": "Should Exercise Caution",
5085
- "LAKE EFFECT SNOW EXPECTED": "Lake Effect Snow Expected",
5086
- "MODERATE LAKE EFFECT SNOWFALL RATES AND BLOWING SNOW": "Moderate Lake Effect Snowfall and Blowing Snow",
5087
- "NO TSUNAMI THREAT": "No Active Tsunami Threat",
5088
- "NO SIGNIFICANT TSUNAMI THREAT": "No Significant Tsunami Threat",
5089
- "NO TSUNAMI IMPACTS ARE EXPECTED": "No Tsunami Impacts Expected",
5090
- "A TSUNAMI THREAT EXISTS": "Tsunami Threat Exists",
5091
- "TSUNAMI THREAT": "Active Tsunami Threat",
5092
- "HEAT ILLNESSES": "Can cause heat illness",
5093
- "WATCH POSSIBLE": "Watch Possible",
5094
- "INTENSIFYING": "Intensifying",
5095
- "CAPABLE OF PRODUCING A LANDSPOUT": "Landspout Possible"
5034
+ // src/@enums/Tags.ts
5035
+ var EnumTags = {
5036
+ SEVERE_WEATHER: [
5037
+ { match: /A Large And Extremely Dangerous Tornado/i, tag: "Large and Dangerous Tornado" },
5038
+ { match: /This Is A Particularly Dangerous Situation/i, tag: "Particularly Dangerous Situation" },
5039
+ { match: /Weather Spotters Confirmed Tornado/i, tag: "Weather Spotters Confirmed Tornado" },
5040
+ { match: /Law Enforcement Confirmed Tornado/i, tag: "Law Enforcement Confirmed Tornado" },
5041
+ { match: /Radar Confirmed/i, tag: "Radar Confirmed" },
5042
+ { match: /Radar Indicated Rotation/i, tag: "Radar Indicated Rotation" },
5043
+ { match: /Radar Indicated(?! Rotation)/i, tag: "Radar Indicated" },
5044
+ { match: /A Tornado Is On The Ground/i, tag: "Tornado On The Ground" },
5045
+ { match: /Tornado Was Reported Briefly On The Ground/i, tag: "Tornado Briefly On Ground" },
5046
+ { match: /Weather Spotters Reported Funnel Cloud/i, tag: "Confirmed Funnel Cloud" },
5047
+ { match: /Spotters Indicate That A Funnel Cloud Continues With This Storm/i, tag: "Funnel Cloud Continues" },
5048
+ { match: /A Severe Thunderstorm Capable Of Producing A Tornado/i, tag: "Tornado Possible" },
5049
+ { match: /A Tornado May Develop At Any Time/i, tag: "Tornado May Develop" },
5050
+ { match: /A Tornado Watch Remains In Effect/i, tag: "Active Tornado Watch" },
5051
+ { match: /Complete Destruction Is Possible/i, tag: "Extremely Damaging Tornado" },
5052
+ { match: /Potentially Deadly Tornado/i, tag: "Deadly Tornado" },
5053
+ { match: /Life-Threatening Situation/i, tag: "Life Threatening Situation" },
5054
+ { match: /Capable Of Producing A Landspout/i, tag: "Landspout Possible" },
5055
+ { match: /Public Confirmed Tornado/i, tag: "Public Confirmed Tornado" },
5056
+ { match: /Expect Wind Damage/i, tag: "Wind Damage" },
5057
+ { match: /Destructive Winds/i, tag: "Destructive Winds" },
5058
+ { match: /Wind Damage With This Storm Will Occur/i, tag: "Immediate Wind Damage Threat" },
5059
+ { match: /Widespread Wind Damage/i, tag: "Widespread Wind Damage" },
5060
+ { match: /Significant Wind Damage/i, tag: "Significant Wind Damage" },
5061
+ { match: /Tornado Like Wind Speeds/i, tag: "Tornado-Like Wind Speeds" },
5062
+ { match: /Winds Will Strengthen/i, tag: "Strengthening Winds" },
5063
+ { match: /Gusty Winds/i, tag: "Gusty Winds" },
5064
+ { match: /Could Knock Down Tree Limbs/i, tag: "Tree Damage Possible" },
5065
+ { match: /Blow Around Unsecured Objects/i, tag: "Loose Object Damage Possible" },
5066
+ { match: /Unsecured lightweight objects blown about/i, tag: "Loose Objects May Blow Around" },
5067
+ { match: /Many large tree limbs broken off/i, tag: "Tree Limb Damage Possible" },
5068
+ { match: /Some fences and roadway signs blown over/i, tag: "Fence and Sign Damage Possible" },
5069
+ { match: /Hazardous driving conditions on bridges/i, tag: "Hazardous Bridge Travel" },
5070
+ { match: /Scattered power and communications outages/i, tag: "Power Outages Possible" },
5071
+ { match: /Hail Damage To Vehicles Is Expected/i, tag: "Vehicle Damaging Hail" },
5072
+ { match: /Extremely Large Hail/i, tag: "Extremely Large Hail" },
5073
+ { match: new RegExp("(?<!Extremely )Large Hail", "i"), tag: "Large Hail" },
5074
+ { match: /Tennis Ball Size Hail/i, tag: "Tennis Ball Size Hail" },
5075
+ { match: /Baseball Size Hail/i, tag: "Baseball Size Hail" },
5076
+ { match: /Golf Ball Size Hail/i, tag: "Golf Ball Size Hail" },
5077
+ { match: /Quarter Size Hail/i, tag: "Quarter Size Hail" },
5078
+ { match: /Ping Pong Ball Size Hail/i, tag: "Ping Pong Ball Size Hail" },
5079
+ { match: /Nickel Size Hail/i, tag: "Nickel Size Hail" },
5080
+ { match: /Hail Driven By Severe Winds/i, tag: "Wind Driven Hail" },
5081
+ { match: /Prepare Immediately For Large Hail/i, tag: "Large Hail" },
5082
+ { match: /Half Inch Hail/i, tag: "Half Inch Hail" },
5083
+ { match: /Frequent Lightning/i, tag: "Frequent Lightning" },
5084
+ { match: /Deadly Cloud To Ground Lightning/i, tag: "Deadly Cloud To Ground Lightning" },
5085
+ { match: /Continuous Cloud To Ground Lightning/i, tag: "Continuous Cloud To Ground Lightning" },
5086
+ { match: /Frequent Cloud To Ground Lightning/i, tag: "Frequent Cloud To Ground Lightning" },
5087
+ { match: /Lightning Can Strike \d+ Miles Away/i, tag: "Lightning Safety Threat" },
5088
+ { match: /Showers and thunderstorms with gusty winds may still occur/i, tag: "Gusty Thunderstorms Possible" }
5089
+ ],
5090
+ FLOOD: [
5091
+ { match: /Flash Flooding Caused By Thunderstorms/i, tag: "Thunderstorm Flash Flooding" },
5092
+ { match: /Flash Flooding Caused By Heavy Rain/i, tag: "Heavy Rain Flash Flooding" },
5093
+ { match: /Torrential Rainfall/i, tag: "Torrential Rainfall" },
5094
+ { match: /May Lead To Flash Flooding/i, tag: "Flash Flooding Possible" },
5095
+ { match: /Minor Flooding Is Occurring/i, tag: "Minor Flooding Occurring" },
5096
+ { match: /Localized Flooding/i, tag: "Localized Flooding Possible" },
5097
+ { match: /Do Not Drive Your Vehicle Through Flooded Roadways/i, tag: "Flooded Roadways" },
5098
+ { match: /No storm surge inundation forecast/i, tag: "No Storm Surge Inundation" },
5099
+ { match: /Localized storm surge possible/i, tag: "Localized Storm Surge Possible" },
5100
+ { match: /Peak Storm Surge Inundation/i, tag: "Storm Surge Inundation Risk" },
5101
+ { match: /Potential for storm surge flooding/i, tag: "Storm Surge Flooding Possible" },
5102
+ { match: /Small streams, creeks, and ditches may become swollen/i, tag: "Small Stream Flooding Risk" },
5103
+ { match: /Rivers and tributaries may quickly rise/i, tag: "Rapid River Rise Possible" },
5104
+ { match: /Flood waters can enter a few structures/i, tag: "Flood Damage Possible" },
5105
+ { match: /Rapid ponding of water occurs/i, tag: "Water Ponding Possible" },
5106
+ { match: /Brief road and bridge closures/i, tag: "Road Closures Possible" }
5107
+ ],
5108
+ WINTER_WEATHER: [
5109
+ { match: /Frostbite And Hypothermia Are Likely/i, tag: "Frostbite and Hypothermia Likely" },
5110
+ { match: /Very Cold Temperatures Can Lead To Hypothermia/i, tag: "Hypothermia Risk" },
5111
+ { match: /Hypothermia If Precautions Are Not Taken/i, tag: "Hypothermia Risk" },
5112
+ { match: /Frostbite And Hypothermia Will Occur If Unprotected Skin/i, tag: "Frostbite Risk" },
5113
+ { match: /Temperatures Could Cause Ruptured Water Pipes/i, tag: "Ruptured Water Pipes Possible" },
5114
+ { match: /Blowing Snow Which Could Reduce Visibility/i, tag: "Reduced Visibility From Blowing Snow" },
5115
+ { match: /Lake Effect Snow Expected/i, tag: "Lake Effect Snow" },
5116
+ { match: /Slick And Icy Spots On Roads/i, tag: "Icy Roads" },
5117
+ { match: /Hazardous Roadways And Black Ice/i, tag: "Black Ice" },
5118
+ { match: /Icy Patches May Be More Common On Bridges/i, tag: "Bridge Icing" }
5119
+ ],
5120
+ COASTAL_MARINE: [
5121
+ { match: /Rip Currents Can Sweep Even The Best Swimmer/i, tag: "Dangerous Rip Currents" },
5122
+ { match: /Small Craft Could Be Damaged/i, tag: "Small Craft Damage Possible" },
5123
+ { match: /No Tsunami Threat/i, tag: "No Tsunami Threat" },
5124
+ { match: /Tsunami Threat Exists/i, tag: "Tsunami Threat Exists" },
5125
+ { match: /TROPICAL STORM WARNING IN EFFECT/i, tag: "Tropical Storm Warning" },
5126
+ { match: /TROPICAL STORM WARNING REMAINS IN EFFECT/i, tag: "Tropical Storm Warning Continues" },
5127
+ { match: /Tropical storm[- ]force winds/i, tag: "Tropical Storm Force Winds" },
5128
+ { match: /hazardous wind/i, tag: "Hazardous Winds" },
5129
+ { match: /hazardous seas/i, tag: "Hazardous Seas" },
5130
+ { match: /could capsize or damage vessels/i, tag: "Vessel Damage Risk" },
5131
+ { match: /reduce visibility/i, tag: "Reduced Visibility" },
5132
+ { match: /Mariners should alter plans/i, tag: "Marine Travel Disruption" },
5133
+ { match: /Remain in port/i, tag: "Remain In Port" },
5134
+ { match: /seek safe harbor/i, tag: "Seek Safe Harbor" },
5135
+ { match: /secure the vessel for severe conditions/i, tag: "Secure Vessel" }
5136
+ ],
5137
+ SAFETY_INFO: [
5138
+ { match: /Seek Shelter Now/i, tag: "Seek Shelter Now" },
5139
+ { match: /Seek Shelter Immediately/i, tag: "Seek Shelter Immediately" },
5140
+ { match: /Move To An Interior Room/i, tag: "Move To Interior Room" },
5141
+ { match: /Move To Safe Shelter Now/i, tag: "Move To Safe Shelter" },
5142
+ { match: /Potentially Deadly Storm/i, tag: "Potentially Deadly Storm" },
5143
+ { match: /Serious Injury And Significant Property Damage/i, tag: "Serious Damage Possible" },
5144
+ { match: /People And Animals Outdoors Will Be Injured/i, tag: "Outdoor Injury Risk" },
5145
+ { match: /IMMINENT DANGEROUS WEATHER CONDITIONS/i, tag: "Imminent Dangerous Weather" },
5146
+ { match: /Follow the instructions of local officials/i, tag: "Follow Local Officials" },
5147
+ { match: /Monitor forecasts/i, tag: "Monitor Forecast Updates" },
5148
+ { match: /Complete preparations.*before conditions become unsafe/i, tag: "Complete Preparations Early" },
5149
+ { match: /Leave immediately if evacuation orders are given/i, tag: "Evacuate If Ordered" },
5150
+ { match: /Heed any flood watches and warnings/i, tag: "Monitor Flood Alerts" },
5151
+ { match: /Listen for changes in the forecast/i, tag: "Stay Weather Aware" },
5152
+ { match: /Travel Could Be Very Difficult/i, tag: "Difficult Travel Conditions" },
5153
+ { match: /Expect Disruptions/i, tag: "Travel Disruptions Expected" },
5154
+ { match: /Trained Weather Spotters/i, tag: "Confirmed By Storm Spotters" },
5155
+ { match: /Doppler Radar/i, tag: "Confirmed By Radar" },
5156
+ { match: /Source\.\.\.Storm Spotters/i, tag: "Confirmed By Storm Spotters" },
5157
+ { match: /Source\.\.\.Doppler Radar/i, tag: "Confirmed By Radar" },
5158
+ { match: /Source\.\.\.Automated Gauges/i, tag: "Confirmed By Automated Gauges" },
5159
+ { match: /Source\.\.\.Radar Confirmed/i, tag: "Confirmed By Radar" },
5160
+ { match: /Source\.\.\.Radar Indicated/i, tag: "Indicated By Radar" },
5161
+ { match: /Source\.\.\.Public/i, tag: "Confirmed By Public" },
5162
+ { match: /Source\.\.\.Amateur Radio/i, tag: "Confirmed By Amateur Radio" },
5163
+ { match: /Source\.\.\.Emergency Management/i, tag: "Confirmed By Emergency Management" },
5164
+ { match: /Source\.\.\.Law Enforcement Reported/i, tag: "Confirmed By Law Enforcement" },
5165
+ { match: /Source\.\.\.Broadcast Media/i, tag: "Confirmed By Broadcast Media" },
5166
+ { match: /Source\.\.\.Media/i, tag: "Confirmed By Media" },
5167
+ { match: /Source\.\.\.Media Reported/i, tag: "Confirmed By Media" },
5168
+ { match: /Doppler Radar And Automated Gauges/i, tag: "Confirmed By Radar and Gauges" },
5169
+ { match: /Potential Impacts:\s*Limited/i, tag: "Limited Impacts Expected" },
5170
+ { match: /Potential Impacts:\s*Little to None/i, tag: "Minimal Impacts Expected" },
5171
+ { match: /Slow Down And Allow Extra Time/i, tag: "Allow Extra Travel Time" },
5172
+ { match: /Should Exercise Caution/i, tag: "Exercise Caution" },
5173
+ { match: /Heat Illnesses/i, tag: "Heat Illness Risk" },
5174
+ { match: /\bIntensifying\b/i, tag: "Intensifying Conditions" }
5175
+ ]
5096
5176
  };
5097
5177
 
5098
- // src/@building/building.tags.ts
5099
- var getEventTags = (message) => {
5100
- return Object.entries(dict_tags).filter(([key]) => message == null ? void 0 : message.toLowerCase().includes(key.toLowerCase())).map(([, value]) => value);
5178
+ // src/@building/GetEventTags.ts
5179
+ var GetEventTags = (message) => {
5180
+ if (!message) return [];
5181
+ return [...new Set(
5182
+ Object.values(EnumTags).flat().filter(({ match }) => match.test(message)).map(({ tag }) => tag)
5183
+ )];
5101
5184
  };
5102
5185
 
5103
- // src/@building/building.properties.ts
5104
- var properties = (options) => {
5186
+ // src/@building/GetEventProperties.ts
5187
+ var GetEventProperties = (options) => {
5105
5188
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X;
5106
- const organization = (_b = (_a = options.message.match(dict_expressions.wmo)) == null ? void 0 : _a[0]) != null ? _b : null;
5189
+ const organization = (_b = (_a = options.message.match(EnumExpressions.wmo)) == null ? void 0 : _a[0]) != null ? _b : null;
5107
5190
  const polygons = getPolygonFromProduct(options.message);
5108
- const properties2 = {
5191
+ const properties = {
5109
5192
  locations: (_e = (_d = (_c = options == null ? void 0 : options.ugc) == null ? void 0 : _c.locations) == null ? void 0 : _d.join(`; `)) != null ? _e : null,
5110
5193
  locations_array: (_g = (_f = options == null ? void 0 : options.ugc) == null ? void 0 : _f.locations) != null ? _g : [],
5111
- description: getDescriptionFromProduct({ message: options.message, handle: (_i = (_h = options == null ? void 0 : options.pVtec) == null ? void 0 : _h.vtec) != null ? _i : null }),
5194
+ description: GetDescriptionFromProduct({ message: options.message, handle: (_i = (_h = options == null ? void 0 : options.pVtec) == null ? void 0 : _h.vtec) != null ? _i : null }),
5112
5195
  attributes: options.attributes,
5113
5196
  geocode: {
5114
- office: getEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
5197
+ office: GetEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
5115
5198
  organization,
5116
5199
  ugc: (_k = (_j = options == null ? void 0 : options.ugc) == null ? void 0 : _j.zones) != null ? _k : [],
5117
5200
  polygon: polygons.length > 0 ? Buffer.from(JSON.stringify([polygons])).toString("base64") : null,
5118
5201
  polygon_generated: polygons.length > 0 ? true : false
5119
5202
  },
5120
5203
  parameters: {
5121
- tags: getEventTags(options.message),
5122
- instructions: (_l = getTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`] })) != null ? _l : null,
5123
- source: (_m = getTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`] })) != null ? _m : null,
5124
- hazards: (_n = getTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`] })) != null ? _n : null,
5125
- impacts: (_o = getTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`] })) != null ? _o : null,
5126
- estimated_hail_size: (_p = getTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ["in"] })) != null ? _p : null,
5127
- estimated_wind_gusts: (_q = getTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`] })) != null ? _q : null,
5128
- damage_threat: (_r = getTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: [] })) != null ? _r : null,
5129
- tornado_threat: (_s = getTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] })) != null ? _s : null,
5130
- flood_threat: (_t = getTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`] })) != null ? _t : null,
5131
- wind_threat: (_u = getTextFromProduct({ message: options.message, find: [`WIND THREAT...`] })) != null ? _u : null,
5132
- hail_threat: (_v = getTextFromProduct({ message: options.message, find: [`HAIL THREAT...`], removal: [] })) != null ? _v : null
5204
+ tags: GetEventTags(options.message),
5205
+ instructions: (_l = GetTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`] })) != null ? _l : null,
5206
+ source: (_m = GetTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`] })) != null ? _m : null,
5207
+ hazards: (_n = GetTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`] })) != null ? _n : null,
5208
+ impacts: (_o = GetTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`] })) != null ? _o : null,
5209
+ estimated_hail_size: (_p = GetTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ["in"] })) != null ? _p : null,
5210
+ estimated_wind_gusts: (_q = GetTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`] })) != null ? _q : null,
5211
+ damage_threat: (_r = GetTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: [] })) != null ? _r : null,
5212
+ tornado_threat: (_s = GetTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] })) != null ? _s : null,
5213
+ flood_threat: (_t = GetTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`] })) != null ? _t : null,
5214
+ wind_threat: (_u = GetTextFromProduct({ message: options.message, find: [`WIND THREAT...`] })) != null ? _u : null,
5215
+ hail_threat: (_v = GetTextFromProduct({ message: options.message, find: [`HAIL THREAT...`], removal: [] })) != null ? _v : null
5133
5216
  },
5134
5217
  discussion_parameters: {
5135
- discussion_number: (_y = (_x = (_w = getTextFromProduct({ message: options.message, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _w.toString()) == null ? void 0 : _x.padStart(4, "0")) != null ? _y : null,
5136
- discussion_concerning: (_z = getTextFromProduct({ message: options.message, find: [`Concerning...`] })) != null ? _z : null,
5137
- discussion_max_tornado: (_A = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _A : null,
5138
- discussion_max_hail: (_B = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _B : null,
5139
- discussion_max_wind: (_C = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _C : null,
5140
- discussion_watch_issuance: (_D = getTextFromProduct({ message: options.message, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _D : null
5218
+ discussion_number: (_y = (_x = (_w = GetTextFromProduct({ message: options.message, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _w.toString()) == null ? void 0 : _x.padStart(4, "0")) != null ? _y : null,
5219
+ discussion_concerning: (_z = GetTextFromProduct({ message: options.message, find: [`Concerning...`] })) != null ? _z : null,
5220
+ discussion_max_tornado: (_A = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _A : null,
5221
+ discussion_max_hail: (_B = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _B : null,
5222
+ discussion_max_wind: (_C = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _C : null,
5223
+ discussion_watch_issuance: (_D = GetTextFromProduct({ message: options.message, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _D : null
5141
5224
  },
5142
5225
  watch_parameters: {
5143
- watch_number: ((_E = options == null ? void 0 : options.pVtec) == null ? void 0 : _E.is_watch) && ((_O = (_N = (_I = (_H = (_G = (_F = getTextFromProduct({ message: options.message, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _F.replace(/(WT|WS|)/g, "")) == null ? void 0 : _G.trim()) == null ? void 0 : _H.toString()) == null ? void 0 : _I.padStart(4, "0")) != null ? _N : (_M = (_L = (_K = (_J = options == null ? void 0 : options.pVtec) == null ? void 0 : _J.tracking) == null ? void 0 : _K.slice(-4)) == null ? void 0 : _L.toString()) == null ? void 0 : _M.padStart(4, "0")) != null ? _O : null),
5226
+ watch_number: ((_E = options == null ? void 0 : options.pVtec) == null ? void 0 : _E.is_watch) ? (_O = (_N = (_I = (_H = (_G = (_F = GetTextFromProduct({ message: options.message, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _F.replace(/(WT|WS|)/g, "")) == null ? void 0 : _G.trim()) == null ? void 0 : _H.toString()) == null ? void 0 : _I.padStart(4, "0")) != null ? _N : (_M = (_L = (_K = (_J = options == null ? void 0 : options.pVtec) == null ? void 0 : _J.tracking) == null ? void 0 : _K.slice(-4)) == null ? void 0 : _L.toString()) == null ? void 0 : _M.padStart(4, "0")) != null ? _O : null : null,
5144
5227
  watch_type: options.message.includes(`TORNADO WATCH`) ? `Tornado` : (options == null ? void 0 : options.message.includes(`SEVERE`)) ? `Severe` : null,
5145
- additional_tornadoes_probability: (_P = getTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _P : null,
5146
- strong_tornadoes_probability: (_Q = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Q : null,
5147
- severe_wind_probability: (_R = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _R : null,
5148
- severe_hail_probability: (_S = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _S : null,
5149
- hail_2in_probability: (_T = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _T : null,
5150
- combined_hail_wind_probability: (_U = getTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _U : null,
5151
- max_hail_in: (_V = getTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _V : null,
5152
- max_wind_surface: (_W = getTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _W : null,
5153
- max_tops_x100feet: (_X = getTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _X : null,
5154
- pds_watch: getTextFromProduct({ message: options.message, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES` ? true : null
5228
+ additional_tornadoes_probability: (_P = GetTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _P : null,
5229
+ strong_tornadoes_probability: (_Q = GetTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Q : null,
5230
+ severe_wind_probability: (_R = GetTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _R : null,
5231
+ severe_hail_probability: (_S = GetTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _S : null,
5232
+ hail_2in_probability: (_T = GetTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _T : null,
5233
+ combined_hail_wind_probability: (_U = GetTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _U : null,
5234
+ max_hail_in: (_V = GetTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _V : null,
5235
+ max_wind_surface: (_W = GetTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _W : null,
5236
+ max_tops_x100feet: (_X = GetTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _X : null,
5237
+ pds_watch: GetTextFromProduct({ message: options.message, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES` ? true : null
5155
5238
  }
5156
5239
  };
5157
- if (isNaN(Number(properties2.watch_parameters.watch_number))) {
5158
- properties2.watch_parameters.watch_number = null;
5240
+ if (isNaN(Number(properties.watch_parameters.watch_number))) {
5241
+ properties.watch_parameters.watch_number = null;
5159
5242
  }
5160
- return properties2;
5243
+ return properties;
5161
5244
  };
5162
5245
 
5163
- // src/@building/building.headers.ts
5164
- var getEventHeader = (options) => {
5246
+ // src/@building/GetEventHeader.ts
5247
+ var GetEventHeader = (options) => {
5165
5248
  var _a, _b, _c;
5166
- const properties2 = options.properties;
5167
- const vtec2 = (_a = options.vtec) != null ? _a : null;
5168
- const ugc2 = properties2.geocode.ugc != null ? properties2.geocode.ugc.join(`-`) : `0`;
5169
- return `ZCZC-ATMOSX-${options.getType.prefix}-${ugc2}-${(_b = vtec2 == null ? void 0 : vtec2.status) != null ? _b : `Issued`}-${(/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").split(".")[0]}-${(_c = properties2.geocode.office.office) != null ? _c : `KWNS`}`;
5249
+ const properties = options.properties;
5250
+ const vtec = (_a = options.vtec) != null ? _a : null;
5251
+ const ugc = properties.geocode.ugc != null ? properties.geocode.ugc.join(`-`) : `0`;
5252
+ return `ZCZC-ATMOSX-${options.getType.prefix}-${ugc}-${(_b = vtec == null ? void 0 : vtec.status) != null ? _b : `Issued`}-${(/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").split(".")[0]}-${(_c = properties.geocode.office.office) != null ? _c : `KWNS`}`;
5170
5253
  };
5171
5254
 
5172
- // src/@building/building.tracking.ts
5173
- var getEventTracking = (options) => {
5255
+ // src/@building/GetEventTracking.ts
5256
+ var GetEventTracking = (options) => {
5174
5257
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5175
- const properties2 = options.properties;
5258
+ const properties = options.properties;
5176
5259
  const attributes = options.attributes;
5177
5260
  const stanza = options.stanza;
5178
- const vtec2 = options.vtec;
5261
+ const vtec = options.vtec;
5179
5262
  if (options.type === `RAW`) {
5180
- const getWatchNumber = (_a = properties2.watch_parameters.watch_number) != null ? _a : null;
5263
+ const getWatchNumber = (_a = properties.watch_parameters.watch_number) != null ? _a : null;
5181
5264
  if (getWatchNumber) {
5182
- return `${properties2.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
5265
+ return `${properties.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
5183
5266
  }
5184
- return `${properties2.geocode.office.office}.${attributes.ttaaii}.${(_b = attributes.id.slice(-4).replace(`.`, ``)) != null ? _b : "0"}`;
5267
+ return `${properties.geocode.office.office}.${attributes.ttaaii}.${(_b = attributes.id.slice(-4).replace(`.`, ``)) != null ? _b : "0"}`;
5185
5268
  }
5186
5269
  if (options.type === `VTEC`) {
5187
- return vtec2.tracking;
5270
+ return vtec.tracking;
5188
5271
  }
5189
5272
  if (options.type === `API`) {
5190
5273
  if (options.vtec) {
@@ -5203,37 +5286,39 @@ var getEventTracking = (options) => {
5203
5286
  }
5204
5287
  };
5205
5288
 
5206
- // src/@modules/@utilities/utilities.setDebug.ts
5207
- var setDebug = (options) => {
5208
- var _a, _b, _c, _d;
5289
+ // src/@modules/@utilities/SetDebug.ts
5290
+ var SetDebug = (options) => {
5291
+ var _a, _b;
5209
5292
  const settings = bootstrap.settings;
5210
5293
  bootstrap.listener.emit(`debug`, {
5211
5294
  message: options.message,
5212
- parent: (_b = (_a = options == null ? void 0 : options.title) == null ? void 0 : _a.split(`.`)[0]) == null ? void 0 : _b.replace(`@`, ``),
5213
- function: (_c = options == null ? void 0 : options.title) == null ? void 0 : _c.split(`.`)[1]
5295
+ function: (_a = options.title) != null ? _a : `debug`
5214
5296
  });
5215
5297
  if (settings.EnableDebugging) {
5216
- console.log(`[${bootstrap.ansi_colors.BLUE}${(_d = options.title) != null ? _d : `debug`}${bootstrap.ansi_colors.RESET}] ${options.message}`);
5298
+ console.log(`[${bootstrap.ansi_colors.BLUE}${(_b = options.title) != null ? _b : `debug`}${bootstrap.ansi_colors.RESET}] ${options.message}`);
5217
5299
  }
5218
5300
  };
5219
5301
 
5220
- // src/@events/events.text.ts
5221
- var text = (stanza) => __async(null, null, function* () {
5302
+ // src/@events/ParseText.ts
5303
+ var ParseText = (stanza) => __async(null, null, function* () {
5222
5304
  var _a, _b, _c, _d, _e;
5223
5305
  const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
5224
5306
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5225
5307
  for (const message of getMessages) {
5226
5308
  const tick = performance.now();
5227
5309
  const attributes = stanza == null ? void 0 : stanza.attributes;
5228
- const props = properties({ message, attributes });
5229
- const header = getEventHeader({ properties: props, getType: stanza.getType });
5310
+ const props = GetEventProperties({ message, attributes });
5311
+ const header = GetEventHeader({ properties: props, getType: stanza.getType });
5230
5312
  const issued = new Date(attributes.issue);
5231
5313
  const expires = new Date(issued.getTime() + 12 * 60 * 60 * 1e3);
5232
- const matches = (_d = dict_matches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5314
+ const matches = (_d = EnumMatches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5233
5315
  let event = matches == null ? void 0 : matches.label;
5234
5316
  let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5235
5317
  if (!event) {
5236
- event = stanza.getType.type.split(`-`).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `);
5318
+ event = stanza.getType.type;
5319
+ if (!stanza.getType.discovered) {
5320
+ event += ` (AWIPSID)`;
5321
+ }
5237
5322
  isStatement = true;
5238
5323
  }
5239
5324
  bootstrap.cache.processed.push({
@@ -5252,7 +5337,7 @@ var text = (stanza) => __async(null, null, function* () {
5252
5337
  metadata: {
5253
5338
  ms: performance.now() - tick,
5254
5339
  source: `events.text`,
5255
- tracking: getEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5340
+ tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5256
5341
  header,
5257
5342
  vtec: null,
5258
5343
  hvtec: null,
@@ -5267,20 +5352,20 @@ var text = (stanza) => __async(null, null, function* () {
5267
5352
  }
5268
5353
  })
5269
5354
  });
5270
- setDebug({ title: `@events.text`, message: `Event process took ${performance.now() - tick} ms` });
5355
+ SetDebug({ title: `ParseText`, message: `${Math.round(performance.now() - tick)}ms` });
5271
5356
  }
5272
5357
  });
5273
5358
 
5274
- // src/@parsers/@ugc/ugc.header.ts
5359
+ // src/@parsers/@ugc/GetUGCHeader.ts
5275
5360
  var getUGCHeader = (message) => {
5276
- const start = message.search(dict_expressions.ugc1);
5361
+ const start = message.search(EnumExpressions.ugc1);
5277
5362
  const sub = message.substring(start);
5278
- const end = sub.search(dict_expressions.ugc2);
5363
+ const end = sub.search(EnumExpressions.ugc2);
5279
5364
  const fin = sub.substring(0, end).replace(/\s+/g, "").slice(0, -1);
5280
5365
  return fin != null ? fin : null;
5281
5366
  };
5282
5367
 
5283
- // src/@parsers/@ugc/ugc.zones.ts
5368
+ // src/@parsers/@ugc/GetZones.ts
5284
5369
  var getZones = (header) => {
5285
5370
  const splits = header.split("-");
5286
5371
  const zones = [];
@@ -5315,8 +5400,8 @@ var getZones = (header) => {
5315
5400
  return zones.filter((item) => item !== "");
5316
5401
  };
5317
5402
 
5318
- // src/@parsers/@ugc/ugc.expiry.ts
5319
- var getExpiry = (message) => {
5403
+ // src/@parsers/@ugc/GetExpiry.ts
5404
+ var GetExpiry = (message) => {
5320
5405
  const match = message.match(/\b(\d{6})-/);
5321
5406
  if (!match) {
5322
5407
  return null;
@@ -5330,12 +5415,12 @@ var getExpiry = (message) => {
5330
5415
  return expires.toISOString();
5331
5416
  };
5332
5417
 
5333
- // src/@parsers/@ugc/ugc.getCache.ts
5418
+ // src/@parsers/@ugc/GetCache.ts
5334
5419
  var getCache = (key) => {
5335
5420
  return bootstrap.cache.ugc.get(key);
5336
5421
  };
5337
5422
 
5338
- // src/@parsers/@ugc/ugc.setCache.ts
5423
+ // src/@parsers/@ugc/SetCache.ts
5339
5424
  var setCache = (key, value) => {
5340
5425
  if (bootstrap.cache.ugc.size >= 5e3) {
5341
5426
  const firstKey = bootstrap.cache.ugc.keys().next().value;
@@ -5344,7 +5429,7 @@ var setCache = (key, value) => {
5344
5429
  bootstrap.cache.ugc.set(key, value);
5345
5430
  };
5346
5431
 
5347
- // src/@parsers/@ugc/ugc.locations.ts
5432
+ // src/@parsers/@ugc/GetLocations.ts
5348
5433
  var getLocations = (zones) => __async(null, null, function* () {
5349
5434
  const uniqueZones = Array.from(new Set(zones));
5350
5435
  const results = [];
@@ -5373,11 +5458,11 @@ var getLocations = (zones) => __async(null, null, function* () {
5373
5458
  return results;
5374
5459
  });
5375
5460
 
5376
- // src/@parsers/@ugc/ugc.extract.ts
5461
+ // src/@parsers/@ugc/UGCExtract.ts
5377
5462
  var ugcExtract = (message) => __async(null, null, function* () {
5378
5463
  const head = getUGCHeader(message);
5379
5464
  const ugcs = getZones(head);
5380
- const expires = getExpiry(message);
5465
+ const expires = GetExpiry(message);
5381
5466
  const areas = yield getLocations(ugcs);
5382
5467
  if (!head || (ugcs == null ? void 0 : ugcs.length) == 0) return;
5383
5468
  return {
@@ -5387,25 +5472,28 @@ var ugcExtract = (message) => __async(null, null, function* () {
5387
5472
  };
5388
5473
  });
5389
5474
 
5390
- // src/@events/events.ugc.ts
5391
- var ugc = (stanza) => __async(null, null, function* () {
5475
+ // src/@events/ParseUGC.ts
5476
+ var ParseUGC = (stanza) => __async(null, null, function* () {
5392
5477
  var _a, _b, _c, _d, _e;
5393
5478
  const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
5394
5479
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5395
5480
  for (const message of getMessages) {
5396
5481
  const tick = performance.now();
5397
5482
  const attributes = stanza == null ? void 0 : stanza.attributes;
5398
- const ugc2 = yield ugcExtract(message);
5399
- if (ugc2 != null) {
5400
- const props = properties({ message, attributes, ugc: ugc2 });
5483
+ const ugc = yield ugcExtract(message);
5484
+ if (ugc != null) {
5485
+ const props = GetEventProperties({ message, attributes, ugc });
5401
5486
  const issued = new Date(attributes.issue);
5402
- const expires = new Date(ugc2.expires);
5403
- const header = getEventHeader({ properties: props, getType: stanza.getType });
5404
- const matches = (_d = dict_matches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5487
+ const expires = new Date(ugc.expires);
5488
+ const header = GetEventHeader({ properties: props, getType: stanza.getType });
5489
+ const matches = (_d = EnumMatches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5405
5490
  let event = matches == null ? void 0 : matches.label;
5406
5491
  let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5407
5492
  if (!event) {
5408
- event = stanza.getType.type.split(`-`).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `);
5493
+ event = stanza.getType.type;
5494
+ if (!stanza.getType.discovered) {
5495
+ event += ` (AWIPSID)`;
5496
+ }
5409
5497
  isStatement = true;
5410
5498
  }
5411
5499
  bootstrap.cache.processed.push({
@@ -5424,7 +5512,7 @@ var ugc = (stanza) => __async(null, null, function* () {
5424
5512
  metadata: {
5425
5513
  ms: performance.now() - tick,
5426
5514
  source: `events.ugc`,
5427
- tracking: getEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5515
+ tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5428
5516
  header,
5429
5517
  vtec: null,
5430
5518
  hvtec: null,
@@ -5439,21 +5527,21 @@ var ugc = (stanza) => __async(null, null, function* () {
5439
5527
  }
5440
5528
  })
5441
5529
  });
5442
- setDebug({ title: `@events.ugc`, message: `Event process took ${performance.now() - tick} ms` });
5530
+ SetDebug({ title: `ParseUGC`, message: `${Math.round(performance.now() - tick)}ms` });
5443
5531
  }
5444
5532
  }
5445
5533
  });
5446
5534
 
5447
- // src/@dictionaries/dictionaries.products.ts
5448
- var dict_products = {
5535
+ // src/@enums/Products.ts
5536
+ var EnumProducts = {
5449
5537
  "O": "Operational Product",
5450
5538
  "T": "Test Product",
5451
5539
  "E": "Experimental Product",
5452
5540
  "X": "Experimental Product (Non-Operational)"
5453
5541
  };
5454
5542
 
5455
- // src/@dictionaries/dictionaries.events.ts
5456
- var dict_events = {
5543
+ // src/@enums/Events.ts
5544
+ var EnumEvents = {
5457
5545
  "AF": "Ashfall",
5458
5546
  "AS": "Air Stagnation",
5459
5547
  "BH": "Beach Hazard",
@@ -5517,8 +5605,8 @@ var dict_events = {
5517
5605
  "ZY": "Freezing Spray"
5518
5606
  };
5519
5607
 
5520
- // src/@dictionaries/dictionaries.actions.ts
5521
- var dict_actions = {
5608
+ // src/@enums/Actions.ts
5609
+ var EnumActions = {
5522
5610
  "W": "Warning",
5523
5611
  "F": "Forecast",
5524
5612
  "A": "Watch",
@@ -5528,8 +5616,8 @@ var dict_actions = {
5528
5616
  "S": "Statement"
5529
5617
  };
5530
5618
 
5531
- // src/@dictionaries/dictionaries.status.ts
5532
- var dict_status = {
5619
+ // src/@enums/Status.ts
5620
+ var EnumStatus = {
5533
5621
  "NEW": "Issued",
5534
5622
  "CON": "Updated",
5535
5623
  "EXT": "Extended",
@@ -5542,8 +5630,8 @@ var dict_status = {
5542
5630
  "EXP": "Expired"
5543
5631
  };
5544
5632
 
5545
- // src/@parsers/@pvtec/pvtec.expires.ts
5546
- var getExpiry2 = (dates) => {
5633
+ // src/@parsers/@pvtec/GetExpiry.ts
5634
+ var GetExpiry2 = (dates) => {
5547
5635
  if ((dates == null ? void 0 : dates[1]) == `000000T0000Z`) return "Invalid Date Format";
5548
5636
  const expires = `${(/* @__PURE__ */ new Date()).getFullYear().toString().substring(0, 2)}${dates[1].substring(0, 2)}-${dates[1].substring(2, 4)}-${dates[1].substring(4, 6)}T${dates[1].substring(7, 9)}:${dates[1].substring(9, 11)}:00`;
5549
5637
  const local = new Date(new Date(expires).getTime() - 4 * 60 * 6e4);
@@ -5551,24 +5639,24 @@ var getExpiry2 = (dates) => {
5551
5639
  return `${local.getFullYear()}-${pad(local.getMonth() + 1)}-${pad(local.getDate())}T${pad(local.getHours())}:${pad(local.getMinutes())}:00.000-04:00`;
5552
5640
  };
5553
5641
 
5554
- // src/@parsers/@pvtec/pvtec.extract.ts
5555
- var pvExtract = (message) => {
5642
+ // src/@parsers/@pvtec/VTECExtract.ts
5643
+ var VTECExtract = (message) => {
5556
5644
  var _a, _b, _c, _d;
5557
5645
  if (!message) return null;
5558
- const getVTECs = (_a = message.match(dict_expressions.pvtec)) != null ? _a : [];
5646
+ const getVTECs = (_a = message.match(EnumExpressions.pvtec)) != null ? _a : [];
5559
5647
  const vtecs = [];
5560
- for (const vtec2 of getVTECs) {
5561
- const sub = vtec2.split(`.`);
5648
+ for (const vtec of getVTECs) {
5649
+ const sub = vtec.split(`.`);
5562
5650
  if ((sub == null ? void 0 : sub.length) < 7) continue;
5563
5651
  const dates = (_b = sub[6]) == null ? void 0 : _b.split(`-`);
5564
5652
  vtecs.push({
5565
- vtec: vtec2,
5566
- product: dict_products[sub[0]],
5653
+ vtec,
5654
+ product: EnumProducts[sub[0]],
5567
5655
  tracking: `${sub[2]}.${sub[3]}.${sub[4]}.${sub[5]}`,
5568
- event: `${dict_events[sub[3]]} ${dict_actions[sub[4]]}`,
5569
- status: dict_status[sub[1]],
5570
- organization: (_d = (_c = message.match(dict_expressions.wmo)) == null ? void 0 : _c[0]) != null ? _d : null,
5571
- expires: getExpiry2(dates),
5656
+ event: `${EnumEvents[sub[3]]} ${EnumActions[sub[4]]}`,
5657
+ status: EnumStatus[sub[1]],
5658
+ organization: (_d = (_c = message.match(EnumExpressions.wmo)) == null ? void 0 : _c[0]) != null ? _d : null,
5659
+ expires: GetExpiry2(dates),
5572
5660
  is_watch: (sub[4] == `A` || sub[4] == `Y`) && (sub[3] == `TO` || sub[3] == `SV`),
5573
5661
  prediction_center: sub[2] == `KWNS` ? true : false
5574
5662
  });
@@ -5576,8 +5664,8 @@ var pvExtract = (message) => {
5576
5664
  return vtecs.length > 0 ? vtecs : null;
5577
5665
  };
5578
5666
 
5579
- // src/@dictionaries/dictionaries.causes.ts
5580
- var dict_causes = {
5667
+ // src/@enums/Causes.ts
5668
+ var EnumCauses = {
5581
5669
  "SM": "Snow Melt",
5582
5670
  "RS": "Rain/Snow Melt",
5583
5671
  "ER": "Excessive Rain",
@@ -5595,16 +5683,16 @@ var dict_causes = {
5595
5683
  "OT": "Other Effects"
5596
5684
  };
5597
5685
 
5598
- // src/@dictionaries/dictionaries.records.ts
5599
- var dict_records = {
5686
+ // src/@enums/Records.ts
5687
+ var EnumRecords = {
5600
5688
  "NO": "No Record Expected",
5601
5689
  "NR": "Near Record or possible record",
5602
5690
  "UU": "Unknown history of records",
5603
5691
  "OO": "Other"
5604
5692
  };
5605
5693
 
5606
- // src/@dictionaries/dictionaries.severity.ts
5607
- var dict_severity = {
5694
+ // src/@enums/Severity.ts
5695
+ var EnumSeverity = {
5608
5696
  N: "Not Expected",
5609
5697
  0: "Areal Flood or FF Product",
5610
5698
  1: "Minor",
@@ -5613,42 +5701,42 @@ var dict_severity = {
5613
5701
  U: "Unknown"
5614
5702
  };
5615
5703
 
5616
- // src/@parsers/@hvtec/hvtec.extract.ts
5617
- var hvExtract = (message) => {
5704
+ // src/@parsers/@hvtec/HVExtract.ts
5705
+ var HVExtract = (message) => {
5618
5706
  var _a;
5619
- const getHVTECs = (_a = message.match(dict_expressions.hvtec)) != null ? _a : [];
5707
+ const getHVTECs = (_a = message.match(EnumExpressions.hvtec)) != null ? _a : [];
5620
5708
  const vtecs = [];
5621
- for (const vtec2 of getHVTECs) {
5622
- const sub = vtec2.split(`.`);
5709
+ for (const vtec of getHVTECs) {
5710
+ const sub = vtec.split(`.`);
5623
5711
  if (sub.length < 7) continue;
5624
5712
  vtecs.push({
5625
- hvtec: vtec2,
5626
- severity: dict_severity[sub[1]],
5627
- cause: dict_causes[sub[2]],
5628
- record: dict_records[sub[6]]
5713
+ hvtec: vtec,
5714
+ severity: EnumSeverity[sub[1]],
5715
+ cause: EnumCauses[sub[2]],
5716
+ record: EnumRecords[sub[6]]
5629
5717
  });
5630
5718
  }
5631
5719
  return vtecs.length > 0 ? vtecs : null;
5632
5720
  };
5633
5721
 
5634
- // src/@events/events.vtec.ts
5635
- var vtec = (stanza) => __async(null, null, function* () {
5722
+ // src/@events/ParseVTEC.ts
5723
+ var ParseVTEC = (stanza) => __async(null, null, function* () {
5636
5724
  var _a, _b, _c, _d, _e;
5637
5725
  const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
5638
5726
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5639
5727
  for (const message of getMessages) {
5640
5728
  const tick = performance.now();
5641
5729
  const attributes = stanza == null ? void 0 : stanza.attributes;
5642
- const pVtec = pvExtract(message);
5643
- const hVtec = hvExtract(message);
5644
- const ugc2 = yield ugcExtract(message);
5645
- if (pVtec != null && ugc2 != null) {
5730
+ const pVtec = VTECExtract(message);
5731
+ const hVtec = HVExtract(message);
5732
+ const ugc = yield ugcExtract(message);
5733
+ if (pVtec != null && ugc != null) {
5646
5734
  for (const pv of pVtec) {
5647
- const vtec2 = pv;
5648
- const props = properties({ message, attributes, ugc: ugc2, pVtec: vtec2 });
5649
- const header = getEventHeader({ properties: props, getType: stanza.getType, vtec: vtec2 });
5735
+ const vtec = pv;
5736
+ const props = GetEventProperties({ message, attributes, ugc, pVtec: vtec });
5737
+ const header = GetEventHeader({ properties: props, getType: stanza.getType, vtec });
5650
5738
  const issued = (_d = new Date(attributes.issue)) != null ? _d : /* @__PURE__ */ new Date();
5651
- const expires = new Date(vtec2.expires);
5739
+ const expires = new Date(vtec.expires);
5652
5740
  bootstrap.cache.processed.push({
5653
5741
  type: `Feature`,
5654
5742
  geometry: {
@@ -5660,12 +5748,12 @@ var vtec = (stanza) => __async(null, null, function* () {
5660
5748
  parent: pv.event,
5661
5749
  status: pv.status,
5662
5750
  issued: !isNaN(issued.getTime()) ? issued.toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
5663
- expires: !isNaN(expires.getTime()) ? expires.toISOString() : (_e = ugc2.expires) != null ? _e : new Date(issued.getTime() + 60 * 60 * 1e3).toISOString()
5751
+ expires: !isNaN(expires.getTime()) ? expires.toISOString() : (_e = ugc.expires) != null ? _e : new Date(issued.getTime() + 60 * 60 * 1e3).toISOString()
5664
5752
  }, props), {
5665
5753
  metadata: {
5666
5754
  ms: performance.now() - tick,
5667
5755
  source: `events.vtec`,
5668
- tracking: getEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec: vtec2 }),
5756
+ tracking: GetEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec }),
5669
5757
  header,
5670
5758
  vtec: pv,
5671
5759
  hvtec: hVtec,
@@ -5680,19 +5768,19 @@ var vtec = (stanza) => __async(null, null, function* () {
5680
5768
  }
5681
5769
  })
5682
5770
  });
5683
- setDebug({ title: `@events.vtec`, message: `Event process took ${performance.now() - tick} ms` });
5771
+ SetDebug({ title: `ParseVTEC`, message: `${Math.round(performance.now() - tick)}ms` });
5684
5772
  }
5685
5773
  }
5686
5774
  }
5687
5775
  });
5688
5776
 
5689
- // src/@events/events.api.ts
5690
- var api = (stanza) => __async(null, null, function* () {
5777
+ // src/@events/ParseAPI.ts
5778
+ var ParseAPI = (stanza) => __async(null, null, function* () {
5691
5779
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub;
5692
5780
  const messages = Object.values(JSON.parse(stanza.message).features);
5693
5781
  for (const feature of messages) {
5694
5782
  const tick = performance.now();
5695
- const pVtec = (_d = pvExtract((_c = (_b = (_a = feature == null ? void 0 : feature.properties) == null ? void 0 : _a.parameters) == null ? void 0 : _b.VTEC) == null ? void 0 : _c[0])) != null ? _d : null;
5783
+ const pVtec = (_d = VTECExtract((_c = (_b = (_a = feature == null ? void 0 : feature.properties) == null ? void 0 : _a.parameters) == null ? void 0 : _b.VTEC) == null ? void 0 : _c[0])) != null ? _d : null;
5696
5784
  bootstrap.cache.processed.push({
5697
5785
  type: `Feature`,
5698
5786
  geometry: {
@@ -5712,7 +5800,7 @@ var api = (stanza) => __async(null, null, function* () {
5712
5800
  geocode: {
5713
5801
  office: {
5714
5802
  office: pVtec ? (_w = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _w.tracking.split(`.`)[0] : null,
5715
- name: (_y = dict_icao[pVtec ? (_x = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _x.tracking.split(`.`)[0] : null]) != null ? _y : null
5803
+ name: (_y = EnumICAO[pVtec ? (_x = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _x.tracking.split(`.`)[0] : null]) != null ? _y : null
5716
5804
  },
5717
5805
  organization: (_B = (_A = (_z = feature == null ? void 0 : feature.properties) == null ? void 0 : _z.parameters) == null ? void 0 : _A.WMOidentifier) == null ? void 0 : _B[0],
5718
5806
  ugc: (_E = (_D = (_C = feature == null ? void 0 : feature.properties) == null ? void 0 : _C.geocode) == null ? void 0 : _D.UGC) != null ? _E : [],
@@ -5720,11 +5808,11 @@ var api = (stanza) => __async(null, null, function* () {
5720
5808
  polygon_generated: ((_H = feature == null ? void 0 : feature.geometry) == null ? void 0 : _H.coordinates.length) > 0 ? true : false
5721
5809
  },
5722
5810
  parameters: {
5723
- tags: getEventTags((_I = feature == null ? void 0 : feature.properties) == null ? void 0 : _I.description),
5811
+ tags: GetEventTags((_I = feature == null ? void 0 : feature.properties) == null ? void 0 : _I.description),
5724
5812
  instructions: (_K = (_J = feature == null ? void 0 : feature.properties) == null ? void 0 : _J.instruction) != null ? _K : null,
5725
- source: (_M = getTextFromProduct({ message: (_L = feature == null ? void 0 : feature.properties) == null ? void 0 : _L.description, find: [`SOURCE...`], removal: [`.`] })) != null ? _M : null,
5726
- hazards: (_O = getTextFromProduct({ message: (_N = feature == null ? void 0 : feature.properties) == null ? void 0 : _N.description, find: [`HAZARD...`], removal: [`.`] })) != null ? _O : null,
5727
- impacts: (_Q = getTextFromProduct({ message: (_P = feature == null ? void 0 : feature.properties) == null ? void 0 : _P.description, find: [`IMPACT...`], removal: [`.`] })) != null ? _Q : null,
5813
+ source: (_M = GetTextFromProduct({ message: (_L = feature == null ? void 0 : feature.properties) == null ? void 0 : _L.description, find: [`SOURCE...`], removal: [`.`] })) != null ? _M : null,
5814
+ hazards: (_O = GetTextFromProduct({ message: (_N = feature == null ? void 0 : feature.properties) == null ? void 0 : _N.description, find: [`HAZARD...`], removal: [`.`] })) != null ? _O : null,
5815
+ impacts: (_Q = GetTextFromProduct({ message: (_P = feature == null ? void 0 : feature.properties) == null ? void 0 : _P.description, find: [`IMPACT...`], removal: [`.`] })) != null ? _Q : null,
5728
5816
  estimated_hail_size: (_U = (_T = (_S = (_R = feature == null ? void 0 : feature.properties) == null ? void 0 : _R.parameters) == null ? void 0 : _S.maxHailSize) == null ? void 0 : _T[0]) != null ? _U : null,
5729
5817
  estimated_wind_gusts: (_Y = (_X = (_W = (_V = feature == null ? void 0 : feature.properties) == null ? void 0 : _V.parameters) == null ? void 0 : _W.maxWindGust) == null ? void 0 : _X[0]) != null ? _Y : null,
5730
5818
  damage_threat: (_aa = (_$ = (__ = (_Z = feature == null ? void 0 : feature.properties) == null ? void 0 : _Z.parameters) == null ? void 0 : __.thunderstormDamageThreat) == null ? void 0 : _$[0]) != null ? _aa : null,
@@ -5734,31 +5822,31 @@ var api = (stanza) => __async(null, null, function* () {
5734
5822
  hail_threat: (_qa = (_pa = (_oa = (_na = feature == null ? void 0 : feature.properties) == null ? void 0 : _na.parameters) == null ? void 0 : _oa.hailThreat) == null ? void 0 : _pa[0]) != null ? _qa : null
5735
5823
  },
5736
5824
  discussion_parameters: {
5737
- discussion_number: (_ua = (_ta = (_sa = getTextFromProduct({ message: (_ra = feature == null ? void 0 : feature.properties) == null ? void 0 : _ra.description, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _sa.toString()) == null ? void 0 : _ta.padStart(4, "0")) != null ? _ua : null,
5738
- discussion_concerning: (_wa = getTextFromProduct({ message: (_va = feature == null ? void 0 : feature.properties) == null ? void 0 : _va.description, find: [`Concerning...`] })) != null ? _wa : null,
5739
- discussion_max_tornado: (_ya = getTextFromProduct({ message: (_xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _xa.description, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _ya : null,
5740
- discussion_max_hail: (_Aa = getTextFromProduct({ message: (_za = feature == null ? void 0 : feature.properties) == null ? void 0 : _za.description, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _Aa : null,
5741
- discussion_max_wind: (_Ca = getTextFromProduct({ message: (_Ba = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ba.description, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _Ca : null,
5742
- discussion_watch_issuance: (_Ea = getTextFromProduct({ message: (_Da = feature == null ? void 0 : feature.properties) == null ? void 0 : _Da.description, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _Ea : null
5825
+ discussion_number: (_ua = (_ta = (_sa = GetTextFromProduct({ message: (_ra = feature == null ? void 0 : feature.properties) == null ? void 0 : _ra.description, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _sa.toString()) == null ? void 0 : _ta.padStart(4, "0")) != null ? _ua : null,
5826
+ discussion_concerning: (_wa = GetTextFromProduct({ message: (_va = feature == null ? void 0 : feature.properties) == null ? void 0 : _va.description, find: [`Concerning...`] })) != null ? _wa : null,
5827
+ discussion_max_tornado: (_ya = GetTextFromProduct({ message: (_xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _xa.description, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _ya : null,
5828
+ discussion_max_hail: (_Aa = GetTextFromProduct({ message: (_za = feature == null ? void 0 : feature.properties) == null ? void 0 : _za.description, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _Aa : null,
5829
+ discussion_max_wind: (_Ca = GetTextFromProduct({ message: (_Ba = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ba.description, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _Ca : null,
5830
+ discussion_watch_issuance: (_Ea = GetTextFromProduct({ message: (_Da = feature == null ? void 0 : feature.properties) == null ? void 0 : _Da.description, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _Ea : null
5743
5831
  },
5744
5832
  watch_parameters: {
5745
- watch_number: ((_Fa = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _Fa.is_watch) && ((_Qa = (_Pa = (_Ka = (_Ja = (_Ia = (_Ha = getTextFromProduct({ message: (_Ga = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ga.description, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _Ha.replace(/(WT|WS|)/g, "")) == null ? void 0 : _Ia.trim()) == null ? void 0 : _Ja.toString()) == null ? void 0 : _Ka.padStart(4, "0")) != null ? _Pa : (_Oa = (_Na = (_Ma = (_La = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _La.tracking) == null ? void 0 : _Ma.slice(-4)) == null ? void 0 : _Na.toString()) == null ? void 0 : _Oa.padStart(4, "0")) != null ? _Qa : null),
5833
+ watch_number: ((_Fa = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _Fa.is_watch) && ((_Qa = (_Pa = (_Ka = (_Ja = (_Ia = (_Ha = GetTextFromProduct({ message: (_Ga = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ga.description, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _Ha.replace(/(WT|WS|)/g, "")) == null ? void 0 : _Ia.trim()) == null ? void 0 : _Ja.toString()) == null ? void 0 : _Ka.padStart(4, "0")) != null ? _Pa : (_Oa = (_Na = (_Ma = (_La = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _La.tracking) == null ? void 0 : _Ma.slice(-4)) == null ? void 0 : _Na.toString()) == null ? void 0 : _Oa.padStart(4, "0")) != null ? _Qa : null),
5746
5834
  watch_type: ((_Ra = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ra.description.includes(`TORNADO WATCH`)) ? `Tornado` : ((_Sa = feature == null ? void 0 : feature.properties) == null ? void 0 : _Sa.description.includes(`SEVERE`)) ? `Severe` : null,
5747
- additional_tornadoes_probability: (_Ua = getTextFromProduct({ message: (_Ta = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ta.description, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Ua : null,
5748
- strong_tornadoes_probability: (_Wa = getTextFromProduct({ message: (_Va = feature == null ? void 0 : feature.properties) == null ? void 0 : _Va.description, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Wa : null,
5749
- severe_wind_probability: (_Ya = getTextFromProduct({ message: (_Xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _Xa.description, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _Ya : null,
5750
- severe_hail_probability: (__a = getTextFromProduct({ message: (_Za = feature == null ? void 0 : feature.properties) == null ? void 0 : _Za.description, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? __a : null,
5751
- hail_2in_probability: (_ab = getTextFromProduct({ message: (_$a = feature == null ? void 0 : feature.properties) == null ? void 0 : _$a.description, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _ab : null,
5752
- combined_hail_wind_probability: (_cb = getTextFromProduct({ message: (_bb = feature == null ? void 0 : feature.properties) == null ? void 0 : _bb.description, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _cb : null,
5753
- max_hail_in: (_eb = getTextFromProduct({ message: (_db = feature == null ? void 0 : feature.properties) == null ? void 0 : _db.description, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _eb : null,
5754
- max_wind_surface: (_gb = getTextFromProduct({ message: (_fb = feature == null ? void 0 : feature.properties) == null ? void 0 : _fb.description, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _gb : null,
5755
- max_tops_x100feet: (_ib = getTextFromProduct({ message: (_hb = feature == null ? void 0 : feature.properties) == null ? void 0 : _hb.description, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _ib : null,
5756
- pds_watch: getTextFromProduct({ message: (_jb = feature == null ? void 0 : feature.properties) == null ? void 0 : _jb.description, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES`
5835
+ additional_tornadoes_probability: (_Ua = GetTextFromProduct({ message: (_Ta = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ta.description, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Ua : null,
5836
+ strong_tornadoes_probability: (_Wa = GetTextFromProduct({ message: (_Va = feature == null ? void 0 : feature.properties) == null ? void 0 : _Va.description, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Wa : null,
5837
+ severe_wind_probability: (_Ya = GetTextFromProduct({ message: (_Xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _Xa.description, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _Ya : null,
5838
+ severe_hail_probability: (__a = GetTextFromProduct({ message: (_Za = feature == null ? void 0 : feature.properties) == null ? void 0 : _Za.description, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? __a : null,
5839
+ hail_2in_probability: (_ab = GetTextFromProduct({ message: (_$a = feature == null ? void 0 : feature.properties) == null ? void 0 : _$a.description, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _ab : null,
5840
+ combined_hail_wind_probability: (_cb = GetTextFromProduct({ message: (_bb = feature == null ? void 0 : feature.properties) == null ? void 0 : _bb.description, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _cb : null,
5841
+ max_hail_in: (_eb = GetTextFromProduct({ message: (_db = feature == null ? void 0 : feature.properties) == null ? void 0 : _db.description, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _eb : null,
5842
+ max_wind_surface: (_gb = GetTextFromProduct({ message: (_fb = feature == null ? void 0 : feature.properties) == null ? void 0 : _fb.description, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _gb : null,
5843
+ max_tops_x100feet: (_ib = GetTextFromProduct({ message: (_hb = feature == null ? void 0 : feature.properties) == null ? void 0 : _hb.description, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _ib : null,
5844
+ pds_watch: GetTextFromProduct({ message: (_jb = feature == null ? void 0 : feature.properties) == null ? void 0 : _jb.description, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES`
5757
5845
  },
5758
5846
  metadata: {
5759
5847
  ms: performance.now() - tick,
5760
5848
  source: `events.api`,
5761
- tracking: getEventTracking({ type: `API`, organization: { wmoidentifier: (_mb = (_lb = (_kb = feature == null ? void 0 : feature.properties) == null ? void 0 : _kb.parameters) == null ? void 0 : _lb.WMOidentifier) == null ? void 0 : _mb[0], featureId: feature == null ? void 0 : feature.id }, vtec: pVtec == null ? void 0 : pVtec[0] }),
5849
+ tracking: GetEventTracking({ type: `API`, organization: { wmoidentifier: (_mb = (_lb = (_kb = feature == null ? void 0 : feature.properties) == null ? void 0 : _kb.parameters) == null ? void 0 : _lb.WMOidentifier) == null ? void 0 : _mb[0], featureId: feature == null ? void 0 : feature.id }, vtec: pVtec == null ? void 0 : pVtec[0] }),
5762
5850
  header: `ZCZC-ATMOSX-${(_ob = (_nb = feature == null ? void 0 : feature.properties) == null ? void 0 : _nb.parameters) == null ? void 0 : _ob.WMOidentifier}`,
5763
5851
  vtec: pVtec == null ? void 0 : pVtec[0],
5764
5852
  hvtec: null,
@@ -5773,12 +5861,12 @@ var api = (stanza) => __async(null, null, function* () {
5773
5861
  }
5774
5862
  }
5775
5863
  });
5776
- setDebug({ title: `@events.api`, message: `Event process took ${performance.now() - tick} ms` });
5864
+ SetDebug({ title: `ParseAPI`, message: `${Math.round(performance.now() - tick)}ms` });
5777
5865
  }
5778
5866
  });
5779
5867
 
5780
- // src/@dictionaries/dictionaries.enhanced.ts
5781
- var dict_enhanced = {
5868
+ // src/@enums/Enhanced.ts
5869
+ var EnumEnhanced = {
5782
5870
  "Tornado Warning": {
5783
5871
  "Tornado Emergency": { description: "tornado emergency" },
5784
5872
  "PDS Tornado Warning": { description: "particularly dangerous situation", damage: `CONSIDERABLE` },
@@ -5822,19 +5910,15 @@ var dict_enhanced = {
5822
5910
  }
5823
5911
  };
5824
5912
 
5825
- // src/@building/building.enhance.ts
5826
- var getEventEnhancedName = (event) => {
5827
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5828
- const configurations = bootstrap.settings;
5913
+ // src/@building/GetEventEnhancedName.ts
5914
+ var GetEventEnhancedName = (event) => {
5915
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
5829
5916
  let name = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.event;
5830
- if (!((_b = configurations == null ? void 0 : configurations.GlobalSettings) == null ? void 0 : _b.BetterEventNames)) {
5831
- return name;
5832
- }
5833
- const damage = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat;
5834
- const tornado = (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.tornado_threat;
5835
- const pdswatch = (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.watch_parameters) == null ? void 0 : _h.pds_watch;
5836
- const description = (_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.description) == null ? void 0 : _j.toLowerCase();
5837
- for (const [eventKey, eventConfig] of Object.entries(dict_enhanced)) {
5917
+ const damage = (_c = (_b = event == null ? void 0 : event.properties) == null ? void 0 : _b.parameters) == null ? void 0 : _c.damage_threat;
5918
+ const tornado = (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.parameters) == null ? void 0 : _e.tornado_threat;
5919
+ const pdswatch = (_g = (_f = event == null ? void 0 : event.properties) == null ? void 0 : _f.watch_parameters) == null ? void 0 : _g.pds_watch;
5920
+ const description = (_i = (_h = event == null ? void 0 : event.properties) == null ? void 0 : _h.description) == null ? void 0 : _i.toLowerCase();
5921
+ for (const [eventKey, eventConfig] of Object.entries(EnumEnhanced)) {
5838
5922
  if (eventKey !== name) continue;
5839
5923
  for (const [paramKey, paramValue] of Object.entries(eventConfig)) {
5840
5924
  let matches = true;
@@ -5859,8 +5943,8 @@ var getEventEnhancedName = (event) => {
5859
5943
  return name;
5860
5944
  };
5861
5945
 
5862
- // src/@dictionaries/dictionaries.correlations.ts
5863
- var dict_correlations = [
5946
+ // src/@enums/Correlations.ts
5947
+ var EnumCorrelations = [
5864
5948
  { type: "Statement", name: "Statement", isCancel: false, isUpdate: false, isIssued: true, isStatement: true },
5865
5949
  { type: "Update", name: "Updated", isCancel: false, isUpdate: true, isIssued: false, isStatement: false },
5866
5950
  { type: "Cancel", name: "Cancelled", isCancel: true, isUpdate: false, isIssued: false, isStatement: false },
@@ -5875,8 +5959,8 @@ var dict_correlations = [
5875
5959
  { type: "Routine", name: "Routine", isCancel: false, isUpdate: true, isIssued: false, isStatement: false }
5876
5960
  ];
5877
5961
 
5878
- // src/@dictionaries/dictionaries.cancellation.ts
5879
- var dict_cancellation = [
5962
+ // src/@enums/Cancellation.ts
5963
+ var EnumCancellation = [
5880
5964
  "has been cancelled",
5881
5965
  "subsided sufficiently for the advisory to be cancelled",
5882
5966
  "has been cancelled",
@@ -5889,22 +5973,24 @@ var dict_cancellation = [
5889
5973
  "has weakened below severe"
5890
5974
  ];
5891
5975
 
5892
- // src/@dictionaries/dictionaries.testing.ts
5893
- var dict_testing = [
5976
+ // src/@enums/Testing.ts
5977
+ var EnumTesting = [
5894
5978
  `This is a test message`,
5895
5979
  `Monitoring message only.`,
5896
5980
  `THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY`,
5897
5981
  "TEST MESSAGE"
5898
5982
  ];
5899
5983
 
5900
- // src/@dictionaries/dictionaries.hail.ts
5901
- var dict_hail = {
5984
+ // src/@enums/Hail.ts
5985
+ var EnumHail = {
5986
+ "0.25": "Pea",
5902
5987
  ".25": "Pea",
5988
+ "0.50": "Penny",
5903
5989
  ".50": "Penny",
5904
5990
  ".75": "Penny",
5905
5991
  "Up to .75": "Penny",
5906
- ".88": "Nickel",
5907
5992
  "0.75": "Penny",
5993
+ ".88": "Nickel",
5908
5994
  "0.88": "Nickel",
5909
5995
  "1.00": "Quarter",
5910
5996
  "1.25": "Half Dollar",
@@ -5916,62 +6002,62 @@ var dict_hail = {
5916
6002
  "4.00": "CD/DVD"
5917
6003
  };
5918
6004
 
5919
- // src/@building/building.signature.ts
5920
- var getEventSignature = (event) => {
6005
+ // src/@building/GetEventSignature.ts
6006
+ var GetEventSignature = (event) => {
5921
6007
  var _a, _b, _c, _d, _e, _f, _g, _h;
5922
- const properties2 = event == null ? void 0 : event.properties;
5923
- const vtec2 = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.vtec;
5924
- const status = dict_correlations.find((c) => c.type === (properties2 == null ? void 0 : properties2.status));
5925
- const csig = dict_cancellation.find((sig) => properties2.description.toLowerCase().includes(sig.toLowerCase()));
5926
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_issued: true, is_test: false });
5927
- if ((_c = properties2 == null ? void 0 : properties2.parameters) == null ? void 0 : _c.estimated_hail_size) {
5928
- properties2.parameters.estimated_hail_size += ` (${(_e = dict_hail[(_d = properties2 == null ? void 0 : properties2.parameters) == null ? void 0 : _d.estimated_hail_size]) != null ? _e : "--"})`;
6008
+ const properties = event == null ? void 0 : event.properties;
6009
+ const vtec = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.vtec;
6010
+ const status = EnumCorrelations.find((c) => c.type === (properties == null ? void 0 : properties.status));
6011
+ const csig = EnumCancellation.find((sig) => properties.description.toLowerCase().includes(sig.toLowerCase()));
6012
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_issued: true, is_test: false });
6013
+ if ((_c = properties == null ? void 0 : properties.parameters) == null ? void 0 : _c.estimated_hail_size) {
6014
+ properties.parameters.estimated_hail_size += ` (${(_e = EnumHail[(_d = properties == null ? void 0 : properties.parameters) == null ? void 0 : _d.estimated_hail_size]) != null ? _e : "--"})`;
5929
6015
  }
5930
6016
  if (status) {
5931
- properties2.status = (_f = status.name) != null ? _f : properties2.status;
5932
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_updated: !!status.isUpdate, is_issued: !!status.isIssued, is_expired: !!status.isCancel, is_statement: !!status.isStatement });
6017
+ properties.status = (_f = status.name) != null ? _f : properties.status;
6018
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_updated: !!status.isUpdate, is_issued: !!status.isIssued, is_expired: !!status.isCancel, is_statement: !!status.isStatement });
5933
6019
  }
5934
6020
  if (csig) {
5935
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_expired: true });
6021
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_expired: true });
5936
6022
  }
5937
- const getProduct = (_h = (_g = vtec2 == null ? void 0 : vtec2.vtec) == null ? void 0 : _g.split(`.`)[0]) == null ? void 0 : _h.replace(`/`, ``);
5938
- const isTestProduct = dict_products[getProduct] == `Test Product`;
5939
- if (isTestProduct || dict_testing.some((sig) => {
6023
+ const getProduct = (_h = (_g = vtec == null ? void 0 : vtec.vtec) == null ? void 0 : _g.split(`.`)[0]) == null ? void 0 : _h.replace(`/`, ``);
6024
+ const isTestProduct = EnumProducts[getProduct] == `Test Product`;
6025
+ if (isTestProduct || EnumTesting.some((sig) => {
5940
6026
  var _a2, _b2, _c2, _d2;
5941
- return (_d2 = (_a2 = properties2.description) == null ? void 0 : _a2.toLowerCase().includes(sig.toLowerCase())) != null ? _d2 : (_c2 = (_b2 = properties2 == null ? void 0 : properties2.parameters) == null ? void 0 : _b2.instructions) == null ? void 0 : _c2.toLowerCase().includes(sig.toLowerCase());
6027
+ return (_d2 = (_a2 = properties.description) == null ? void 0 : _a2.toLowerCase().includes(sig.toLowerCase())) != null ? _d2 : (_c2 = (_b2 = properties == null ? void 0 : properties.parameters) == null ? void 0 : _b2.instructions) == null ? void 0 : _c2.toLowerCase().includes(sig.toLowerCase());
5942
6028
  })) {
5943
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_test: true });
6029
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_test: true });
5944
6030
  }
5945
- if (new Date(properties2.expires).getTime() < Date.now()) {
5946
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_expired: true });
6031
+ if (new Date(properties.expires).getTime() < Date.now()) {
6032
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_expired: true });
5947
6033
  }
5948
- properties2.status_metadata = __spreadValues({}, properties2.status_metadata);
6034
+ properties.status_metadata = __spreadValues({}, properties.status_metadata);
5949
6035
  return event;
5950
6036
  };
5951
6037
 
5952
- // src/@dictionaries/dictionaries.global.ts
5953
- var dict_global = [
5954
- "spc day 1 outlook",
5955
- "spc day 2 outlook",
5956
- "spc day 3 outlook"
6038
+ // src/@enums/GlobalFilter.ts
6039
+ var EnumGlobalFilter = [
6040
+ "storm prediction center day 1 outlook",
6041
+ "storm prediction center day 2 outlook",
6042
+ "storm prediction center day 3 outlook"
5957
6043
  ];
5958
6044
 
5959
- // src/@manager/manager.setHash.ts
5960
- var setHash = (event, entry) => {
5961
- if (entry) {
5962
- entry.hashes.push(event.properties.metadata.hash);
5963
- entry.expires = event.properties.expires;
5964
- } else {
6045
+ // src/@manager/SetHash.ts
6046
+ var SetHash = (event, entry) => {
6047
+ if (!entry) {
5965
6048
  bootstrap.cache.hashes.push({
5966
6049
  tracking: event.properties.metadata.tracking,
5967
6050
  hashes: [event.properties.metadata.hash],
5968
6051
  expires: event.properties.expires
5969
6052
  });
6053
+ return;
5970
6054
  }
6055
+ entry.hashes.push(event.properties.metadata.hash);
6056
+ entry.expires = event.properties.expires;
5971
6057
  };
5972
6058
 
5973
- // src/@modules/@eas/eas.getWavPCM16.ts
5974
- var getWavPCM16 = (buffer) => {
6059
+ // src/@modules/@eas/GetWavPCM16.ts
6060
+ var GetWavPCM16 = (buffer) => {
5975
6061
  if (buffer.toString("ascii", 0, 4) !== "RIFF" || buffer.toString("ascii", 8, 12) !== "WAVE") {
5976
6062
  return null;
5977
6063
  }
@@ -5999,8 +6085,8 @@ var getWavPCM16 = (buffer) => {
5999
6085
  return { samples: new Int16Array(samples), sampleRate, channels, bitsPerSample };
6000
6086
  };
6001
6087
 
6002
- // src/@modules/@eas/eas.getSampledPCM16.ts
6003
- var getSampledPCM16 = (int16, originalRate, targetRate) => {
6088
+ // src/@modules/@eas/GetSampledPCM16.ts
6089
+ var GetSampledPCM16 = (int16, originalRate, targetRate) => {
6004
6090
  if (originalRate === targetRate) return int16;
6005
6091
  const ratio = targetRate / originalRate;
6006
6092
  const outLen = Math.max(1, Math.round(int16.length * ratio));
@@ -6016,15 +6102,15 @@ var getSampledPCM16 = (int16, originalRate, targetRate) => {
6016
6102
  return out;
6017
6103
  };
6018
6104
 
6019
- // src/@modules/@eas/eas.getPCMToFloat.ts
6020
- var getPCMToFloat = (int16) => {
6105
+ // src/@modules/@eas/GetPCMToFloat.ts
6106
+ var GetPCMToFloat = (int16) => {
6021
6107
  const out = new Float32Array(int16.length);
6022
6108
  for (let i = 0; i < int16.length; i++) out[i] = int16[i] / 32768;
6023
6109
  return out;
6024
6110
  };
6025
6111
 
6026
- // src/@modules/@eas/eas.getFloatPCM16.ts
6027
- var getFloatPCM16 = (float32) => {
6112
+ // src/@modules/@eas/GetFloatPCM16.ts
6113
+ var GetFloatPCM16 = (float32) => {
6028
6114
  const out = new Int16Array(float32.length);
6029
6115
  for (let i = 0; i < float32.length; i++) {
6030
6116
  let v = Math.max(-1, Math.min(1, float32[i]));
@@ -6033,11 +6119,11 @@ var getFloatPCM16 = (float32) => {
6033
6119
  return out;
6034
6120
  };
6035
6121
 
6036
- // src/@modules/@eas/eas.setRadioEffect.ts
6037
- var setRadioEffect = (int16, sampleRate) => {
6122
+ // src/@modules/@eas/SetRadioEffect.ts
6123
+ var SetRadioEffect = (int16, sampleRate) => {
6038
6124
  const hpCut = 3555;
6039
6125
  const lpCut = 1600;
6040
- const x = getPCMToFloat(int16);
6126
+ const x = GetPCMToFloat(int16);
6041
6127
  const dt = 1 / sampleRate;
6042
6128
  const rcHP = 1 / (2 * Math.PI * hpCut);
6043
6129
  const aHP = rcHP / (rcHP + dt);
@@ -6058,11 +6144,11 @@ var setRadioEffect = (int16, sampleRate) => {
6058
6144
  const compGain = 2;
6059
6145
  const norm = Math.tanh(compGain);
6060
6146
  for (let i = 0; i < x.length; i++) x[i] = Math.tanh(x[i] * compGain) / norm;
6061
- return getFloatPCM16(x);
6147
+ return GetFloatPCM16(x);
6062
6148
  };
6063
6149
 
6064
- // src/@modules/@eas/eas.setAFSK.ts
6065
- var setAFSK = (bits, sampleRate) => {
6150
+ // src/@modules/@eas/SetAFSK.ts
6151
+ var SetAFSK = (bits, sampleRate) => {
6066
6152
  const baud = 520.83;
6067
6153
  const markFreq = 2083.3;
6068
6154
  const spaceFreq = 1562.5;
@@ -6093,8 +6179,8 @@ var setAFSK = (bits, sampleRate) => {
6093
6179
  return Int16Array.from(result);
6094
6180
  };
6095
6181
 
6096
- // src/@modules/@eas/eas.setAsciiToBits.ts
6097
- var setAsciiToBits = (str) => {
6182
+ // src/@modules/@eas/SetAsciiToBits.ts
6183
+ var SetAsciiToBits = (str) => {
6098
6184
  const bits = [];
6099
6185
  for (let i = 0; i < str.length; i++) {
6100
6186
  const c = str.charCodeAt(i) & 255;
@@ -6105,8 +6191,8 @@ var setAsciiToBits = (str) => {
6105
6191
  return bits;
6106
6192
  };
6107
6193
 
6108
- // src/@modules/@eas/eas.getMergedPCM16.ts
6109
- var getMergedPCM16 = (arrays) => {
6194
+ // src/@modules/@eas/GetMergedPCM16.ts
6195
+ var GetMergedPCM16 = (arrays) => {
6110
6196
  let total = 0;
6111
6197
  for (const a of arrays) total += a.length;
6112
6198
  const out = new Int16Array(total);
@@ -6118,16 +6204,16 @@ var getMergedPCM16 = (arrays) => {
6118
6204
  return out;
6119
6205
  };
6120
6206
 
6121
- // src/@modules/@eas/eas.setSameHeader.ts
6122
- var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
6207
+ // src/@modules/@eas/SetSameHeader.ts
6208
+ var SetSameHeader = (vtec, repeats, sampleRate = 8e3, options = {}) => {
6123
6209
  var _a, _b;
6124
6210
  const preMarkSec = (_a = options.preMarkSec) != null ? _a : 0.3;
6125
6211
  const gapSec = (_b = options.gapSec) != null ? _b : 0.1;
6126
6212
  const bursts = [];
6127
6213
  const gap = new Int16Array(Math.floor(gapSec * sampleRate));
6128
6214
  for (let i = 0; i < repeats; i++) {
6129
- const bodyBits = setAsciiToBits(vtec2);
6130
- const body = setAFSK(bodyBits, sampleRate);
6215
+ const bodyBits = SetAsciiToBits(vtec);
6216
+ const body = SetAFSK(bodyBits, sampleRate);
6131
6217
  const extendedBodyDuration = Math.round(preMarkSec * sampleRate);
6132
6218
  const extendedBody = new Int16Array(extendedBodyDuration + gap.length);
6133
6219
  for (let j2 = 0; j2 < extendedBodyDuration; j2++) {
@@ -6137,11 +6223,11 @@ var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
6137
6223
  bursts.push(extendedBody);
6138
6224
  if (i !== repeats - 1) bursts.push(gap);
6139
6225
  }
6140
- return getMergedPCM16(bursts);
6226
+ return GetMergedPCM16(bursts);
6141
6227
  };
6142
6228
 
6143
- // src/@modules/@eas/eas.setAttentionTone.ts
6144
- var setAttentionTone = (ms, sampleRate) => {
6229
+ // src/@modules/@eas/SetAttentionTone.ts
6230
+ var SetAttentionTone = (ms, sampleRate) => {
6145
6231
  const len = Math.floor(ms * sampleRate);
6146
6232
  const out = new Int16Array(len);
6147
6233
  const f1 = 853;
@@ -6161,18 +6247,18 @@ var setAttentionTone = (ms, sampleRate) => {
6161
6247
  return out;
6162
6248
  };
6163
6249
 
6164
- // src/@modules/@eas/eas.setNoise.ts
6165
- var setNoise = (int16, noiseLevel = 0.02) => {
6166
- const x = getPCMToFloat(int16);
6250
+ // src/@modules/@eas/SetNoise.ts
6251
+ var SetNoise = (int16, noiseLevel = 0.02) => {
6252
+ const x = GetPCMToFloat(int16);
6167
6253
  for (let i = 0; i < x.length; i++) x[i] += (Math.random() * 2 - 1) * noiseLevel;
6168
6254
  let peak = 0;
6169
6255
  for (let i = 0; i < x.length; i++) peak = Math.max(peak, Math.abs(x[i]));
6170
6256
  if (peak > 1) for (let i = 0; i < x.length; i++) x[i] *= 0.98 / peak;
6171
- return getFloatPCM16(x);
6257
+ return GetFloatPCM16(x);
6172
6258
  };
6173
6259
 
6174
- // src/@modules/@eas/eas.getPCM16.ts
6175
- var getPCM16 = (samples, sampleRate) => {
6260
+ // src/@modules/@eas/GetPCM16.ts
6261
+ var GetPCM16 = (samples, sampleRate) => {
6176
6262
  let o = 0;
6177
6263
  const bytesPerSample = 2;
6178
6264
  const blockAlign = 1 * bytesPerSample;
@@ -6212,17 +6298,17 @@ var getPCM16 = (samples, sampleRate) => {
6212
6298
  return buffer;
6213
6299
  };
6214
6300
 
6215
- // src/@modules/@eas/eas.getTTS.ts
6301
+ // src/@modules/@eas/GetTTS.ts
6216
6302
  var import_os = require("os");
6217
6303
  var import_fs = require("fs");
6218
6304
  var import_child_process = require("child_process");
6219
- var getTTS = (text2, outputPath) => __async(null, null, function* () {
6305
+ var GetTTS = (text, outputPath) => __async(null, null, function* () {
6220
6306
  const vPlatform = (0, import_os.platform)();
6221
6307
  switch (vPlatform) {
6222
6308
  case "win32": {
6223
6309
  try {
6224
6310
  const txtPath = outputPath + ".txt";
6225
- (0, import_fs.writeFileSync)(txtPath, text2, "utf8");
6311
+ (0, import_fs.writeFileSync)(txtPath, text, "utf8");
6226
6312
  const command = [
6227
6313
  "Add-Type -AssemblyName System.Speech;",
6228
6314
  `$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;`,
@@ -6239,7 +6325,7 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
6239
6325
  }
6240
6326
  case "linux":
6241
6327
  try {
6242
- (0, import_child_process.execSync)(`espeak -w "${outputPath}" "${text2.replace(/"/g, '\\"')}"`);
6328
+ (0, import_child_process.execSync)(`espeak -w "${outputPath}" "${text.replace(/"/g, '\\"')}"`);
6243
6329
  } catch (e) {
6244
6330
  }
6245
6331
  break;
@@ -6248,8 +6334,8 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
6248
6334
  }
6249
6335
  });
6250
6336
 
6251
- // src/@modules/@eas/eas.getCleanDescription.ts
6252
- var getCleanDescription = (message) => {
6337
+ // src/@modules/@eas/GetCleanDescription.ts
6338
+ var GetCleanDescription = (message) => {
6253
6339
  const patches = [
6254
6340
  { regex: /\.{3,}/g, replacement: ". " },
6255
6341
  { regex: /\bUTC\b/g, replacement: "Coordinated Universal Time" },
@@ -6320,12 +6406,12 @@ var getCleanDescription = (message) => {
6320
6406
  return message.replace(/'/g, "''").replace(/\b(\d{1,2}):(\d{2})\s*(AM|PM)\b/gi, (_, h, m, ap) => fmt(+h, +m, ap.toUpperCase())).replace(/\b(\d{1,2})\s+(\d{2})\s+(AM|PM)\b/gi, (_, h, m, ap) => fmt(+h, +m, ap.toUpperCase())).replace(/\b(\d{2})(\d{2})\s+(AM|PM)\b/gi, (_, hh, mm, ap) => fmt(+hh, +mm, ap.toUpperCase())).replace(/\b(\d{1,2})\s+(AM|PM)\b/gi, (_, h, ap) => fmt(+h, 0, ap.toUpperCase())).replace(/\*+/g, " ").replace(/-/g, " ").replace(/\n/g, " ").trim();
6321
6407
  };
6322
6408
 
6323
- // src/@modules/@eas/eas.setEasTone.ts
6409
+ // src/@modules/@eas/GenerateEASMessage.ts
6324
6410
  var import_path2 = require("path");
6325
6411
  var import_fs2 = require("fs");
6326
6412
  var import_child_process2 = require("child_process");
6327
6413
  var import_os2 = require("os");
6328
- var setEasTone = (options) => __async(null, null, function* () {
6414
+ var GenerateEASMessage = (options) => __async(null, null, function* () {
6329
6415
  var _a;
6330
6416
  const tick = performance.now();
6331
6417
  const settings = bootstrap.settings;
@@ -6335,7 +6421,7 @@ var setEasTone = (options) => __async(null, null, function* () {
6335
6421
  let header = options.header;
6336
6422
  let title = ((_a = options.title) != null ? _a : `${Math.random().toString(36).substring(2, 15)}-${header.replace(/[^a-zA-Z0-9]/g, "")}`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6337
6423
  if (!message || !header) {
6338
- setWarning({
6424
+ SetWarning({
6339
6425
  title: `EAS`,
6340
6426
  message: `Message and header are required to generate an EAS tone.`
6341
6427
  });
@@ -6347,25 +6433,19 @@ var setEasTone = (options) => __async(null, null, function* () {
6347
6433
  if (!(0, import_fs2.existsSync)(directory)) {
6348
6434
  (0, import_fs2.mkdirSync)(directory, { recursive: true });
6349
6435
  }
6350
- if (!(0, import_fs2.existsSync)((0, import_path2.join)(directory, `/tts`))) {
6351
- (0, import_fs2.mkdirSync)((0, import_path2.join)(directory, `/tts`), { recursive: true });
6352
- }
6353
- if (!(0, import_fs2.existsSync)((0, import_path2.join)(directory, `/encoded`))) {
6354
- (0, import_fs2.mkdirSync)((0, import_path2.join)(directory, `/encoded`), { recursive: true });
6355
- }
6356
- const tmpTTS = (0, import_path2.join)(directory, `/tts/${title}.wav`);
6357
- const outTTS = (0, import_path2.join)(directory, `/encoded/${title}.wav`);
6436
+ const tmpTTS = (0, import_path2.join)(directory, `/${title}-tts.wav`);
6437
+ const outTTS = (0, import_path2.join)(directory, `/${title}.wav`);
6358
6438
  const vPlatform = (0, import_os2.platform)();
6359
6439
  if (vPlatform === "darwin") {
6360
- setWarning({
6440
+ SetWarning({
6361
6441
  title: `EAS`,
6362
6442
  message: `EAS tone generation is not supported on macOS.`
6363
6443
  });
6364
6444
  return null;
6365
6445
  }
6366
6446
  yield new Promise((resolve6, reject) => {
6367
- const tMsg = getCleanDescription(message);
6368
- getTTS(tMsg, tmpTTS).then(() => {
6447
+ const tMsg = GetCleanDescription(message);
6448
+ GetTTS(tMsg, tmpTTS).then(() => {
6369
6449
  resolve6();
6370
6450
  });
6371
6451
  });
@@ -6373,19 +6453,19 @@ var setEasTone = (options) => __async(null, null, function* () {
6373
6453
  return null;
6374
6454
  }
6375
6455
  buffTTS = (0, import_fs2.readFileSync)(tmpTTS);
6376
- const vWav = getWavPCM16(buffTTS);
6377
- const vSamples = getSampledPCM16(vWav.samples, vWav.sampleRate, 8e3);
6378
- const vRadio = setRadioEffect(vSamples, 8e3);
6456
+ const vWav = GetWavPCM16(buffTTS);
6457
+ const vSamples = GetSampledPCM16(vWav.samples, vWav.sampleRate, 8e3);
6458
+ const vRadio = SetRadioEffect(vSamples, 8e3);
6379
6459
  if ((0, import_fs2.existsSync)(prefix)) {
6380
6460
  let tBuffer = (0, import_fs2.readFileSync)(prefix);
6381
- let tWav = getWavPCM16(tBuffer);
6461
+ let tWav = GetWavPCM16(tBuffer);
6382
6462
  if (tWav == null) {
6383
6463
  try {
6384
- const converted = (0, import_path2.join)(directory, `/tts/${title}.converted.wav`);
6464
+ const converted = (0, import_path2.join)(directory, `/${title}-tts-fixed.wav`);
6385
6465
  (0, import_child_process2.execSync)(`ffmpeg -y -i "${prefix}" -ar 8000 -ac 1 -sample_fmt s16 "${converted}"`, { stdio: "ignore" });
6386
6466
  if ((0, import_fs2.existsSync)(converted)) {
6387
6467
  tBuffer = (0, import_fs2.readFileSync)(converted);
6388
- tWav = getWavPCM16(tBuffer);
6468
+ tWav = GetWavPCM16(tBuffer);
6389
6469
  try {
6390
6470
  (0, import_fs2.unlinkSync)(converted);
6391
6471
  } catch (e) {
@@ -6395,41 +6475,41 @@ var setEasTone = (options) => __async(null, null, function* () {
6395
6475
  }
6396
6476
  }
6397
6477
  if (tWav == null) {
6398
- setWarning({ title: `EAS`, message: `Intro tone isn't a valid .WAV file or isn't in PCM 16-bit format. Converted attempt failed; please convert it then try again.` });
6478
+ SetWarning({ title: `EAS`, message: `Intro tone isn't a valid .WAV file or isn't in PCM 16-bit format. Converted attempt failed; please convert it then try again.` });
6399
6479
  return null;
6400
6480
  }
6401
- const tSamples = tWav.sampleRate != 8e3 ? getSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
6402
- buffRadio = setRadioEffect(tSamples, 8e3);
6481
+ const tSamples = tWav.sampleRate != 8e3 ? GetSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
6482
+ buffRadio = SetRadioEffect(tSamples, 8e3);
6403
6483
  }
6404
6484
  buffFull = buffRadio != null ? [buffRadio, new Int16Array(Math.floor(0.5 * 8e3))] : [];
6405
6485
  buffFull.push(
6406
- setSameHeader(header, 3, 8e3, {
6486
+ SetSameHeader(header, 3, 8e3, {
6407
6487
  preMarkSec: 1.1,
6408
6488
  gapSec: 0.5
6409
6489
  }),
6410
6490
  new Int16Array(Math.floor(0.5 * 8e3)),
6411
- setAttentionTone(8, 8e3),
6491
+ SetAttentionTone(8, 8e3),
6412
6492
  new Int16Array(Math.floor(0.5 * 8e3)),
6413
6493
  vRadio
6414
6494
  );
6415
6495
  for (let i = 0; i < 3; i++) {
6416
- buffFull.push(setSameHeader(header, 1, 8e3, { preMarkSec: 0.5, gapSec: 0.1 }));
6496
+ buffFull.push(SetSameHeader(header, 1, 8e3, { preMarkSec: 0.5, gapSec: 0.1 }));
6417
6497
  buffFull.push(new Int16Array(Math.floor(0.5 * 8e3)));
6418
6498
  }
6419
- const aSamples = getMergedPCM16(buffFull);
6420
- const aFinal = setNoise(aSamples, 2e-3);
6421
- const aBuffer = getPCM16(Array.from(aFinal).map((v) => ({ value: v })), 8e3);
6499
+ const aSamples = GetMergedPCM16(buffFull);
6500
+ const aFinal = SetNoise(aSamples, 2e-3);
6501
+ const aBuffer = GetPCM16(Array.from(aFinal).map((v) => ({ value: v })), 8e3);
6422
6502
  (0, import_fs2.writeFileSync)(outTTS, aBuffer);
6423
6503
  try {
6424
6504
  (0, import_fs2.unlinkSync)(tmpTTS);
6425
6505
  } catch (e) {
6426
6506
  }
6427
- setDebug({ title: `@eas.setEasTone`, message: `EAS tone generation took ${performance.now() - tick} ms` });
6507
+ SetDebug({ title: `GenerateEASMessage`, message: `${Math.round(performance.now() - tick)}ms` });
6428
6508
  return outTTS;
6429
6509
  });
6430
6510
 
6431
- // src/@parsers/@text/text.getEmbedText.ts
6432
- var getEmebedText = (event) => {
6511
+ // src/@parsers/@text/GetEmbededText.ts
6512
+ var GetEmebedText = (event) => {
6433
6513
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na;
6434
6514
  const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6435
6515
  const isStatement = event.properties.status_metadata.is_statement;
@@ -6466,44 +6546,46 @@ var getEmebedText = (event) => {
6466
6546
  ].filter(Boolean).join("\n");
6467
6547
  };
6468
6548
 
6469
- // src/@parsers/@text/text.getStringText.ts
6470
- var getStringText = (event) => {
6471
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da;
6549
+ // src/@parsers/@text/GetStringText.ts
6550
+ var GetStringText = (event) => {
6551
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea;
6552
+ const settings = bootstrap.settings;
6553
+ const timezone = (_a = settings.NotifyServer.Timezone) != null ? _a : `UTC`;
6472
6554
  const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6473
6555
  const isStatement = event.properties.status_metadata.is_statement;
6474
6556
  const isExpired = event.properties.status_metadata.is_expired;
6475
6557
  return [
6476
- line(`Locations:`, (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.locations) == null ? void 0 : _b.slice(0, 100)),
6477
- line(`Issued:`, new Date(event.properties.issued).toUTCString(), !isExpired),
6478
- line(`Expires:`, new Date(event.properties.expires).toUTCString(), !isStatement),
6479
- line(`Damage Threat:`, (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat, !isExpired),
6480
- line(`Flood Threat:`, (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.flood_threat, !isExpired),
6481
- line(`Tornado Threat:`, (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.parameters) == null ? void 0 : _h.tornado_threat, !isExpired),
6482
- line(`Estimated Wind Gusts:`, `${(_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.parameters) == null ? void 0 : _j.estimated_wind_gusts} ${((_l = (_k = event == null ? void 0 : event.properties) == null ? void 0 : _k.parameters) == null ? void 0 : _l.wind_threat) ? ` (${(_n = (_m = event == null ? void 0 : event.properties) == null ? void 0 : _m.parameters) == null ? void 0 : _n.wind_threat})` : ""}`, !isExpired && ((_p = (_o = event == null ? void 0 : event.properties) == null ? void 0 : _o.parameters) == null ? void 0 : _p.estimated_wind_gusts) != null),
6483
- line(`Estimated Hail Size:`, `${(_r = (_q = event == null ? void 0 : event.properties) == null ? void 0 : _q.parameters) == null ? void 0 : _r.estimated_hail_size} ${((_t = (_s = event == null ? void 0 : event.properties) == null ? void 0 : _s.parameters) == null ? void 0 : _t.hail_threat) ? ` (${(_v = (_u = event == null ? void 0 : event.properties) == null ? void 0 : _u.parameters) == null ? void 0 : _v.hail_threat})` : ""}`, !isExpired && ((_x = (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.parameters) == null ? void 0 : _x.estimated_hail_size) != null),
6484
- line(`Discussion:`, (_z = (_y = event == null ? void 0 : event.properties) == null ? void 0 : _y.discussion_parameters) == null ? void 0 : _z.discussion_number, !isExpired),
6485
- line(`Concern:`, (_B = (_A = event == null ? void 0 : event.properties) == null ? void 0 : _A.discussion_parameters) == null ? void 0 : _B.discussion_concerning, !isExpired),
6486
- line(`SPC Max Tornado Threat:`, (_D = (_C = event == null ? void 0 : event.properties) == null ? void 0 : _C.discussion_parameters) == null ? void 0 : _D.discussion_max_tornado, !isExpired),
6487
- line(`SPC Max Hail Threat:`, (_F = (_E = event == null ? void 0 : event.properties) == null ? void 0 : _E.discussion_parameters) == null ? void 0 : _F.discussion_max_hail, !isExpired),
6488
- line(`SPC Max Wind Threat:`, (_H = (_G = event == null ? void 0 : event.properties) == null ? void 0 : _G.discussion_parameters) == null ? void 0 : _H.discussion_max_wind, !isExpired),
6489
- line(`SPC Watch Issuance Probability:`, ((_J = (_I = event == null ? void 0 : event.properties) == null ? void 0 : _I.discussion_parameters) == null ? void 0 : _J.discussion_watch_issuance) ? `${(_L = (_K = event == null ? void 0 : event.properties) == null ? void 0 : _K.discussion_parameters) == null ? void 0 : _L.discussion_watch_issuance}%` : null, !isExpired),
6490
- line(`Watch Number:`, (_N = (_M = event == null ? void 0 : event.properties) == null ? void 0 : _M.watch_parameters) == null ? void 0 : _N.watch_number, !isExpired),
6491
- line(`Strong Tornadoes Probability:`, ((_P = (_O = event == null ? void 0 : event.properties) == null ? void 0 : _O.watch_parameters) == null ? void 0 : _P.strong_tornadoes_probability) ? `${(_R = (_Q = event == null ? void 0 : event.properties) == null ? void 0 : _Q.watch_parameters) == null ? void 0 : _R.strong_tornadoes_probability}%` : null, !isExpired),
6492
- line(`Additional Tornadoes Probability:`, ((_T = (_S = event == null ? void 0 : event.properties) == null ? void 0 : _S.watch_parameters) == null ? void 0 : _T.additional_tornadoes_probability) ? `${(_V = (_U = event == null ? void 0 : event.properties) == null ? void 0 : _U.watch_parameters) == null ? void 0 : _V.additional_tornadoes_probability}%` : null, !isExpired),
6493
- line(`Combined Hail/Wind Probability:`, ((_X = (_W = event == null ? void 0 : event.properties) == null ? void 0 : _W.watch_parameters) == null ? void 0 : _X.combined_hail_wind_probability) ? `${(_Z = (_Y = event == null ? void 0 : event.properties) == null ? void 0 : _Y.watch_parameters) == null ? void 0 : _Z.combined_hail_wind_probability}%` : null, !isExpired),
6494
- line(`Severe Hail Probability:`, ((_$ = (__ = event == null ? void 0 : event.properties) == null ? void 0 : __.watch_parameters) == null ? void 0 : _$.severe_hail_probability) ? `${(_ba = (_aa = event == null ? void 0 : event.properties) == null ? void 0 : _aa.watch_parameters) == null ? void 0 : _ba.severe_hail_probability}%` : null, !isExpired),
6495
- line(`Hail >2in Probability:`, ((_da = (_ca = event == null ? void 0 : event.properties) == null ? void 0 : _ca.watch_parameters) == null ? void 0 : _da.hail_2in_probability) ? `${(_fa = (_ea = event == null ? void 0 : event.properties) == null ? void 0 : _ea.watch_parameters) == null ? void 0 : _fa.hail_2in_probability}%` : null, !isExpired),
6496
- line(`Max Hail Inches:`, (_ha = (_ga = event == null ? void 0 : event.properties) == null ? void 0 : _ga.watch_parameters) == null ? void 0 : _ha.max_hail_in, !isExpired),
6497
- line(`Severe Wind Probability:`, ((_ja = (_ia = event == null ? void 0 : event.properties) == null ? void 0 : _ia.watch_parameters) == null ? void 0 : _ja.severe_wind_probability) ? `${(_la = (_ka = event == null ? void 0 : event.properties) == null ? void 0 : _ka.watch_parameters) == null ? void 0 : _la.severe_wind_probability}%` : null, !isExpired),
6498
- line(`Max Surface Wind:`, (_na = (_ma = event == null ? void 0 : event.properties) == null ? void 0 : _ma.watch_parameters) == null ? void 0 : _na.max_wind_surface, !isExpired),
6499
- line(`Max Tops (x100 feet):`, (_pa = (_oa = event == null ? void 0 : event.properties) == null ? void 0 : _oa.watch_parameters) == null ? void 0 : _pa.max_tops_x100feet, !isExpired),
6500
- line(`Sender:`, ((_sa = (_ra = (_qa = event == null ? void 0 : event.properties) == null ? void 0 : _qa.geocode) == null ? void 0 : _ra.office) == null ? void 0 : _sa.name) ? `${(_va = (_ua = (_ta = event == null ? void 0 : event.properties) == null ? void 0 : _ta.geocode) == null ? void 0 : _ua.office) == null ? void 0 : _va.name} (${(_ya = (_xa = (_wa = event == null ? void 0 : event.properties) == null ? void 0 : _wa.geocode) == null ? void 0 : _xa.office) == null ? void 0 : _ya.office})` : (_Ba = (_Aa = (_za = event == null ? void 0 : event.properties) == null ? void 0 : _za.geocode) == null ? void 0 : _Aa.office) == null ? void 0 : _Ba.office),
6501
- line(`Tracking:`, (_Da = (_Ca = event == null ? void 0 : event.properties) == null ? void 0 : _Ca.metadata) == null ? void 0 : _Da.tracking)
6558
+ line(`Locations:`, (_c = (_b = event == null ? void 0 : event.properties) == null ? void 0 : _b.locations) == null ? void 0 : _c.slice(0, 100)),
6559
+ line(`Issued:`, `${new Date(event.properties.issued).toLocaleString([], { timeZone: timezone })} (${timezone.replace(`America/`, ``)})`, !isExpired),
6560
+ line(`Expires:`, `${new Date(event.properties.expires).toLocaleString([], { timeZone: timezone })} (${timezone.replace(`America/`, ``)})`, !isStatement),
6561
+ line(`Damage Threat:`, (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.parameters) == null ? void 0 : _e.damage_threat, !isExpired),
6562
+ line(`Flood Threat:`, (_g = (_f = event == null ? void 0 : event.properties) == null ? void 0 : _f.parameters) == null ? void 0 : _g.flood_threat, !isExpired),
6563
+ line(`Tornado Threat:`, (_i = (_h = event == null ? void 0 : event.properties) == null ? void 0 : _h.parameters) == null ? void 0 : _i.tornado_threat, !isExpired),
6564
+ line(`Estimated Wind Gusts:`, `${(_k = (_j = event == null ? void 0 : event.properties) == null ? void 0 : _j.parameters) == null ? void 0 : _k.estimated_wind_gusts} ${((_m = (_l = event == null ? void 0 : event.properties) == null ? void 0 : _l.parameters) == null ? void 0 : _m.wind_threat) ? ` (${(_o = (_n = event == null ? void 0 : event.properties) == null ? void 0 : _n.parameters) == null ? void 0 : _o.wind_threat})` : ""}`, !isExpired && ((_q = (_p = event == null ? void 0 : event.properties) == null ? void 0 : _p.parameters) == null ? void 0 : _q.estimated_wind_gusts) != null),
6565
+ line(`Estimated Hail Size:`, `${(_s = (_r = event == null ? void 0 : event.properties) == null ? void 0 : _r.parameters) == null ? void 0 : _s.estimated_hail_size} ${((_u = (_t = event == null ? void 0 : event.properties) == null ? void 0 : _t.parameters) == null ? void 0 : _u.hail_threat) ? ` (${(_w = (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.parameters) == null ? void 0 : _w.hail_threat})` : ""}`, !isExpired && ((_y = (_x = event == null ? void 0 : event.properties) == null ? void 0 : _x.parameters) == null ? void 0 : _y.estimated_hail_size) != null),
6566
+ line(`Discussion:`, (_A = (_z = event == null ? void 0 : event.properties) == null ? void 0 : _z.discussion_parameters) == null ? void 0 : _A.discussion_number, !isExpired),
6567
+ line(`Concern:`, (_C = (_B = event == null ? void 0 : event.properties) == null ? void 0 : _B.discussion_parameters) == null ? void 0 : _C.discussion_concerning, !isExpired),
6568
+ line(`SPC Max Tornado Threat:`, (_E = (_D = event == null ? void 0 : event.properties) == null ? void 0 : _D.discussion_parameters) == null ? void 0 : _E.discussion_max_tornado, !isExpired),
6569
+ line(`SPC Max Hail Threat:`, (_G = (_F = event == null ? void 0 : event.properties) == null ? void 0 : _F.discussion_parameters) == null ? void 0 : _G.discussion_max_hail, !isExpired),
6570
+ line(`SPC Max Wind Threat:`, (_I = (_H = event == null ? void 0 : event.properties) == null ? void 0 : _H.discussion_parameters) == null ? void 0 : _I.discussion_max_wind, !isExpired),
6571
+ line(`SPC Watch Issuance Probability:`, ((_K = (_J = event == null ? void 0 : event.properties) == null ? void 0 : _J.discussion_parameters) == null ? void 0 : _K.discussion_watch_issuance) ? `${(_M = (_L = event == null ? void 0 : event.properties) == null ? void 0 : _L.discussion_parameters) == null ? void 0 : _M.discussion_watch_issuance}%` : null, !isExpired),
6572
+ line(`Watch Number:`, (_O = (_N = event == null ? void 0 : event.properties) == null ? void 0 : _N.watch_parameters) == null ? void 0 : _O.watch_number, !isExpired),
6573
+ line(`Strong Tornadoes Probability:`, ((_Q = (_P = event == null ? void 0 : event.properties) == null ? void 0 : _P.watch_parameters) == null ? void 0 : _Q.strong_tornadoes_probability) ? `${(_S = (_R = event == null ? void 0 : event.properties) == null ? void 0 : _R.watch_parameters) == null ? void 0 : _S.strong_tornadoes_probability}%` : null, !isExpired),
6574
+ line(`Additional Tornadoes Probability:`, ((_U = (_T = event == null ? void 0 : event.properties) == null ? void 0 : _T.watch_parameters) == null ? void 0 : _U.additional_tornadoes_probability) ? `${(_W = (_V = event == null ? void 0 : event.properties) == null ? void 0 : _V.watch_parameters) == null ? void 0 : _W.additional_tornadoes_probability}%` : null, !isExpired),
6575
+ line(`Combined Hail/Wind Probability:`, ((_Y = (_X = event == null ? void 0 : event.properties) == null ? void 0 : _X.watch_parameters) == null ? void 0 : _Y.combined_hail_wind_probability) ? `${(__ = (_Z = event == null ? void 0 : event.properties) == null ? void 0 : _Z.watch_parameters) == null ? void 0 : __.combined_hail_wind_probability}%` : null, !isExpired),
6576
+ line(`Severe Hail Probability:`, ((_aa = (_$ = event == null ? void 0 : event.properties) == null ? void 0 : _$.watch_parameters) == null ? void 0 : _aa.severe_hail_probability) ? `${(_ca = (_ba = event == null ? void 0 : event.properties) == null ? void 0 : _ba.watch_parameters) == null ? void 0 : _ca.severe_hail_probability}%` : null, !isExpired),
6577
+ line(`Hail >2in Probability:`, ((_ea = (_da = event == null ? void 0 : event.properties) == null ? void 0 : _da.watch_parameters) == null ? void 0 : _ea.hail_2in_probability) ? `${(_ga = (_fa = event == null ? void 0 : event.properties) == null ? void 0 : _fa.watch_parameters) == null ? void 0 : _ga.hail_2in_probability}%` : null, !isExpired),
6578
+ line(`Max Hail Inches:`, (_ia = (_ha = event == null ? void 0 : event.properties) == null ? void 0 : _ha.watch_parameters) == null ? void 0 : _ia.max_hail_in, !isExpired),
6579
+ line(`Severe Wind Probability:`, ((_ka = (_ja = event == null ? void 0 : event.properties) == null ? void 0 : _ja.watch_parameters) == null ? void 0 : _ka.severe_wind_probability) ? `${(_ma = (_la = event == null ? void 0 : event.properties) == null ? void 0 : _la.watch_parameters) == null ? void 0 : _ma.severe_wind_probability}%` : null, !isExpired),
6580
+ line(`Max Surface Wind:`, (_oa = (_na = event == null ? void 0 : event.properties) == null ? void 0 : _na.watch_parameters) == null ? void 0 : _oa.max_wind_surface, !isExpired),
6581
+ line(`Max Tops (x100 feet):`, (_qa = (_pa = event == null ? void 0 : event.properties) == null ? void 0 : _pa.watch_parameters) == null ? void 0 : _qa.max_tops_x100feet, !isExpired),
6582
+ line(`Sender:`, ((_ta = (_sa = (_ra = event == null ? void 0 : event.properties) == null ? void 0 : _ra.geocode) == null ? void 0 : _sa.office) == null ? void 0 : _ta.name) ? `${(_wa = (_va = (_ua = event == null ? void 0 : event.properties) == null ? void 0 : _ua.geocode) == null ? void 0 : _va.office) == null ? void 0 : _wa.name} (${(_za = (_ya = (_xa = event == null ? void 0 : event.properties) == null ? void 0 : _xa.geocode) == null ? void 0 : _ya.office) == null ? void 0 : _za.office})` : (_Ca = (_Ba = (_Aa = event == null ? void 0 : event.properties) == null ? void 0 : _Aa.geocode) == null ? void 0 : _Ba.office) == null ? void 0 : _Ca.office),
6583
+ line(`Tracking:`, (_Ea = (_Da = event == null ? void 0 : event.properties) == null ? void 0 : _Da.metadata) == null ? void 0 : _Ea.tracking)
6502
6584
  ].filter(Boolean).join("\n");
6503
6585
  };
6504
6586
 
6505
- // src/@modules/@utilities/utilities.createHttp.ts
6506
- var createHttp = (options) => __async(null, null, function* () {
6587
+ // src/@modules/@utilities/CreateHttp.ts
6588
+ var CreateHttp = (options) => __async(null, null, function* () {
6507
6589
  var _a, _b, _c, _d;
6508
6590
  const requestOptions = {
6509
6591
  method: (_a = options.method) != null ? _a : "GET",
@@ -6545,8 +6627,8 @@ var createHttp = (options) => __async(null, null, function* () {
6545
6627
  }
6546
6628
  });
6547
6629
 
6548
- // src/@modules/@utilities/utilities.getMatched.ts
6549
- var getMatched = (strings, string) => {
6630
+ // src/@modules/@utilities/GetMatched.ts
6631
+ var GetMatched = (strings, string) => {
6550
6632
  const isMatched = strings.some((pattern) => {
6551
6633
  if (!pattern) return false;
6552
6634
  const lowerP = pattern.toLowerCase();
@@ -6561,150 +6643,204 @@ var getMatched = (strings, string) => {
6561
6643
  return isMatched;
6562
6644
  };
6563
6645
 
6564
- // src/@manager/manager.updateListener.ts
6565
- var import_fs3 = require("fs");
6566
- var updateListener = (event) => __async(null, null, function* () {
6567
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
6646
+ // src/@manager/Tasks.ts
6647
+ var import_promises = require("fs/promises");
6648
+ var Tasks = (events) => __async(null, null, function* () {
6649
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
6568
6650
  const tick = performance.now();
6569
6651
  const settings = bootstrap.settings;
6570
- const listeners2 = settings.ListenerSettings;
6571
- const properties2 = event.properties;
6572
- const metadata = {
6573
- file: null,
6574
- eas: null,
6575
- json: null,
6576
- name: properties2.event,
6577
- status: properties2.status,
6578
- description: properties2.description,
6579
- tracking: properties2.metadata.tracking,
6580
- header: properties2.metadata.header,
6581
- raw: properties2.metadata.raw,
6582
- expired: properties2.status_metadata.is_expired,
6583
- attachments: properties2.metadata.attachments
6584
- };
6585
- for (const listener2 of listeners2) {
6586
- const events = listener2 == null ? void 0 : listener2.Events;
6587
- const webhook = listener2 == null ? void 0 : listener2.Webhook;
6588
- const notify = listener2 == null ? void 0 : listener2.NotificationServer;
6589
- const uploads = listener2 == null ? void 0 : listener2.Uploads;
6590
- const isMatched = getMatched(events != null ? events : [], metadata.name);
6591
- if ((events == null ? void 0 : events.length) == 0 || isMatched) {
6592
- if (uploads == null ? void 0 : uploads.EAS) {
6593
- metadata.eas = yield setEasTone({
6594
- title: `${metadata.name}_${metadata.status}_${metadata.tracking}`,
6595
- message: metadata.description,
6596
- header: metadata.header
6597
- });
6598
- }
6599
- if (uploads == null ? void 0 : uploads.File) {
6600
- const fDestination = settings.GlobalSettings.ArchiveSettings.TextDirectory;
6601
- if (fDestination) {
6602
- const file = `${fDestination}/${metadata.name}_${metadata.tracking}.txt`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6603
- if (!(0, import_fs3.existsSync)(fDestination)) {
6604
- (0, import_fs3.mkdirSync)(fDestination, { recursive: true });
6605
- }
6606
- if ((0, import_fs3.existsSync)(file)) {
6607
- (0, import_fs3.appendFileSync)(file, `${`
6608
- `.repeat(10)}${metadata.raw}`);
6609
- } else {
6610
- (0, import_fs3.writeFileSync)(file, metadata.raw);
6652
+ const notifyServer = settings.NotifyServer;
6653
+ const actions = settings.ActionSettings;
6654
+ for (const event of events) {
6655
+ const properties = event.properties;
6656
+ const hasActions = Array.isArray(actions) && actions.length > 0;
6657
+ if (!hasActions) {
6658
+ SetDebug({ title: `Tasks`, message: `${Math.round(performance.now() - tick)}ms` });
6659
+ return;
6660
+ }
6661
+ const metadata = {
6662
+ text: null,
6663
+ eas: null,
6664
+ json: null,
6665
+ name: properties.event,
6666
+ status: properties.status,
6667
+ description: properties.description,
6668
+ tracking: properties.metadata.tracking,
6669
+ header: properties.metadata.header,
6670
+ raw: properties.metadata.raw,
6671
+ expired: properties.status_metadata.is_expired,
6672
+ attachments: properties.metadata.attachments
6673
+ };
6674
+ const archiveSettings = (_a = settings.GlobalSettings) == null ? void 0 : _a.ArchiveSettings;
6675
+ const textArchiveDir = archiveSettings == null ? void 0 : archiveSettings.TextDirectory;
6676
+ const jsonArchiveDir = archiveSettings == null ? void 0 : archiveSettings.JSONDirectory;
6677
+ const eventBaseName = `${metadata.name}_${metadata.tracking}`;
6678
+ const easTitle = `${metadata.name}_${metadata.status}_${metadata.tracking}`;
6679
+ const cleanedEventText = JSON.stringify(GetCleanedEvent(event), null, 2);
6680
+ const stringText = GetStringText(event);
6681
+ const embedText = GetEmebedText(event);
6682
+ for (const action of actions) {
6683
+ const events2 = action == null ? void 0 : action.Events;
6684
+ const webhook = action == null ? void 0 : action.Webhook;
6685
+ const notify = action == null ? void 0 : action.NotificationServer;
6686
+ const uploads = action == null ? void 0 : action.Uploads;
6687
+ const isMatched = GetMatched(events2 != null ? events2 : [], metadata.name);
6688
+ if ((events2 == null ? void 0 : events2.length) == 0 || isMatched) {
6689
+ const t = performance.now();
6690
+ if ((uploads == null ? void 0 : uploads.EAS) && !metadata.eas) {
6691
+ metadata.eas = yield GenerateEASMessage({
6692
+ title: easTitle,
6693
+ message: metadata.description,
6694
+ header: metadata.header
6695
+ });
6696
+ SetDebug({
6697
+ title: "Tasks/EAS",
6698
+ message: `${Math.round(performance.now() - t)}ms`
6699
+ });
6700
+ }
6701
+ if ((uploads == null ? void 0 : uploads.TEXT) && metadata.text === null) {
6702
+ const t2 = performance.now();
6703
+ if (textArchiveDir) {
6704
+ const file = `${textArchiveDir}/${eventBaseName}.txt`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6705
+ yield (0, import_promises.mkdir)(textArchiveDir, { recursive: true });
6706
+ yield (0, import_promises.appendFile)(file, `${"\n".repeat(7)}${metadata.raw}`);
6707
+ SetDebug({
6708
+ title: "Tasks/TEXT",
6709
+ message: `${Math.round(performance.now() - t2)}ms`
6710
+ });
6611
6711
  }
6712
+ metadata.text = metadata.raw;
6612
6713
  }
6613
- metadata.file = metadata.raw;
6614
- }
6615
- if (uploads == null ? void 0 : uploads.JSON) {
6616
- const eDestination = settings.GlobalSettings.ArchiveSettings.EventDirectory;
6617
- if (eDestination) {
6618
- const file = `${eDestination}/${metadata.name}_${metadata.tracking}.json`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6619
- if (!(0, import_fs3.existsSync)(eDestination)) {
6620
- (0, import_fs3.mkdirSync)(eDestination, { recursive: true });
6714
+ if ((uploads == null ? void 0 : uploads.JSON) && metadata.json === null) {
6715
+ const t2 = performance.now();
6716
+ if (jsonArchiveDir) {
6717
+ const file = `${jsonArchiveDir}/${eventBaseName}.json`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6718
+ yield (0, import_promises.mkdir)(jsonArchiveDir, { recursive: true });
6719
+ yield (0, import_promises.writeFile)(file, cleanedEventText);
6720
+ SetDebug({
6721
+ title: "Tasks/JSON",
6722
+ message: `${Math.round(performance.now() - t2)}ms`
6723
+ });
6621
6724
  }
6622
- (0, import_fs3.writeFileSync)(file, JSON.stringify(getCleanedEvent(event), null, 2));
6725
+ metadata.json = cleanedEventText;
6623
6726
  }
6624
- metadata.json = JSON.stringify(getCleanedEvent(event), null, 2);
6625
- }
6626
- if (((_a = settings == null ? void 0 : settings.NotifyServer) == null ? void 0 : _a.Enabled) && (notify == null ? void 0 : notify.Enabled) && (notify == null ? void 0 : notify.Topic)) {
6627
- const server = settings == null ? void 0 : settings.NotifyServer;
6628
- const auth = ((_b = server == null ? void 0 : server.Credentials) == null ? void 0 : _b.Username) && ((_c = server == null ? void 0 : server.Credentials) == null ? void 0 : _c.Password) ? { username: (_e = (_d = settings == null ? void 0 : settings.NotifyServer) == null ? void 0 : _d.Credentials) == null ? void 0 : _e.Username, password: (_f = server == null ? void 0 : server.Credentials) == null ? void 0 : _f.Password } : void 0;
6629
- const attachment = metadata.eas && (server == null ? void 0 : server.Attachments) ? `${server == null ? void 0 : server.Attachments}/${metadata.name}_${metadata.status}_${metadata.tracking}.wav` : void 0;
6630
- const isRatelimited = setTimeoutAction({ identifier: metadata.tracking + `notify.server`, interval: 1, max: 1, addTime: true });
6631
- if (!isRatelimited.limited) {
6632
- yield createHttp(__spreadProps(__spreadValues({
6633
- url: `${(_g = server == null ? void 0 : server.Server) == null ? void 0 : _g.replace(/\/$/, "")}/${(_h = listener2 == null ? void 0 : listener2.NotificationServer) == null ? void 0 : _h.Topic}`,
6727
+ if ((notifyServer == null ? void 0 : notifyServer.Enabled) && (notify == null ? void 0 : notify.Enabled) && (notify == null ? void 0 : notify.Topic)) {
6728
+ let buttons = [];
6729
+ const t2 = performance.now();
6730
+ const auth = ((_b = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _b.Username) && ((_c = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _c.Password) ? { username: (_d = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _d.Username, password: (_e = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _e.Password } : void 0;
6731
+ const image = (_f = metadata.attachments) == null ? void 0 : _f.find((a) => a.name === "Image: Graphic");
6732
+ if ((_g = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _g.EAS) {
6733
+ if (metadata.eas) {
6734
+ buttons.push({
6735
+ "action": "view",
6736
+ "label": "Listen",
6737
+ "url": `${(_h = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _h.EAS}/${metadata.name}_${metadata.status}_${metadata.tracking}.wav`
6738
+ });
6739
+ }
6740
+ }
6741
+ if (metadata.json) {
6742
+ buttons.push({
6743
+ "action": "view",
6744
+ "label": "View JSON",
6745
+ "url": `${(_i = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _i.JSON}/${metadata.name}_${metadata.tracking}.json`
6746
+ });
6747
+ }
6748
+ if (metadata.text) {
6749
+ buttons.push({
6750
+ "action": "view",
6751
+ "label": "View Text",
6752
+ "url": `${(_j = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _j.TEXT}/${metadata.name}_${metadata.tracking}.txt`
6753
+ });
6754
+ }
6755
+ if (image) {
6756
+ buttons.push({
6757
+ "action": "view",
6758
+ "label": "View Image",
6759
+ "url": image.link
6760
+ });
6761
+ }
6762
+ yield CreateHttp(__spreadProps(__spreadValues({
6763
+ url: `${(_k = notifyServer == null ? void 0 : notifyServer.Server) == null ? void 0 : _k.replace(/\/$/, "")}/${notify.Topic}`,
6634
6764
  timeout: 15e3,
6635
- method: "POST"
6765
+ method: "PUT"
6636
6766
  }, auth && { auth }), {
6637
6767
  headers: __spreadValues({
6638
6768
  "Title": `${metadata.name} (${metadata.status})`,
6639
- "Tags": (_j = (_i = properties2.parameters.tags) == null ? void 0 : _i.join(",")) != null ? _j : "N/A",
6640
- "Expires": new Date(properties2.expires).getTime(),
6641
- "Priority": (notify == null ? void 0 : notify.Priority) ? notify.Priority.toString() : "5"
6642
- }, attachment && { "Attach": attachment }),
6643
- body: getStringText(event)
6769
+ "Tags": (_m = (_l = properties.parameters.tags) == null ? void 0 : _l.join(",")) != null ? _m : "N/A",
6770
+ "Priority": (_n = notify == null ? void 0 : notify.Priority) != null ? _n : "5"
6771
+ }, buttons.length > 0 && { "Actions": JSON.stringify(buttons) }),
6772
+ body: stringText
6644
6773
  }));
6774
+ SetDebug({
6775
+ title: "Tasks/NTFY",
6776
+ message: `${Math.round(performance.now() - t2)}ms`
6777
+ });
6645
6778
  }
6646
- }
6647
- if ((webhook == null ? void 0 : webhook.Enabled) && (webhook == null ? void 0 : webhook.Destination)) {
6648
- const isRatelimited = setTimeoutAction({ identifier: webhook.Destination, interval: ((_k = webhook.Ratelimit) != null ? _k : 2) * 2, max: (_l = webhook.Ratelimit) != null ? _l : 2, addTime: true });
6649
- const form = new FormData();
6650
- const embed = {
6651
- title: `${metadata.name} (${metadata.status})`,
6652
- description: getEmebedText(event),
6653
- fields: [],
6654
- color: 16711680,
6655
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6656
- footer: { text: (_m = webhook.Title) != null ? _m : `AtmosphericX` }
6657
- };
6658
- if (isRatelimited.limited) {
6659
- return;
6660
- }
6661
- if (metadata.description && !metadata.expired) {
6662
- if (metadata.description.length > 900) {
6663
- metadata.description = metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]";
6779
+ if ((webhook == null ? void 0 : webhook.Enabled) && (webhook == null ? void 0 : webhook.Destination)) {
6780
+ const t2 = performance.now();
6781
+ const isRatelimited = SetTimeoutAction({ identifier: webhook.Destination, interval: ((_o = webhook.Ratelimit) != null ? _o : 2) * 2, max: (_p = webhook.Ratelimit) != null ? _p : 2, addTime: true });
6782
+ const form = new FormData();
6783
+ const embed = {
6784
+ title: `${metadata.name} (${metadata.status})`,
6785
+ description: embedText,
6786
+ fields: [],
6787
+ color: 16711680,
6788
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6789
+ footer: { text: (_q = webhook.Title) != null ? _q : `AtmosphericX` }
6790
+ };
6791
+ if (isRatelimited.limited) {
6792
+ return;
6664
6793
  }
6665
- embed.fields.push({
6666
- name: "Description",
6667
- value: metadata.description ? "```\n" + metadata.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
6794
+ if (metadata.description && !metadata.expired) {
6795
+ const description = metadata.description.length > 900 ? metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]" : metadata.description;
6796
+ embed.fields.push({
6797
+ name: "Description",
6798
+ value: description ? "```\n" + description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
6799
+ });
6800
+ }
6801
+ if (((_r = metadata.attachments) == null ? void 0 : _r.length) > 0) {
6802
+ const attachments = metadata.attachments.slice(0, 5);
6803
+ embed.fields.push({
6804
+ name: "Attachments",
6805
+ value: attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
6806
+ });
6807
+ }
6808
+ if (uploads == null ? void 0 : uploads.TEXT) {
6809
+ form.append("fUpload", new Blob([Buffer.from(metadata.text)], { type: "application/text" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}.txt`);
6810
+ }
6811
+ if (uploads == null ? void 0 : uploads.JSON) {
6812
+ form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}.json`);
6813
+ }
6814
+ if (uploads == null ? void 0 : uploads.EAS) {
6815
+ if (metadata.eas) {
6816
+ const file = yield (0, import_promises.readFile)(metadata.eas);
6817
+ form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}_eas.mp3`);
6818
+ }
6819
+ }
6820
+ form.append("payload_json", JSON.stringify({
6821
+ username: (_s = webhook.Title) != null ? _s : "AtmosphericX",
6822
+ content: (_t = webhook.Message) != null ? _t : "",
6823
+ embeds: [embed]
6824
+ }));
6825
+ yield CreateHttp({
6826
+ url: webhook.Destination,
6827
+ timeout: 15e3,
6828
+ method: `POST`,
6829
+ body: form
6668
6830
  });
6669
- }
6670
- if (((_n = metadata.attachments) == null ? void 0 : _n.length) > 0) {
6671
- metadata.attachments = metadata.attachments.slice(0, 5);
6672
- embed.fields.push({
6673
- name: "Attachments",
6674
- value: metadata.attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
6831
+ SetDebug({
6832
+ title: "Tasks/Webhook",
6833
+ message: `${Math.round(performance.now() - t2)}ms`
6675
6834
  });
6676
6835
  }
6677
- if (uploads == null ? void 0 : uploads.File) {
6678
- form.append("fUpload", new Blob([Buffer.from(metadata.file)], { type: "application/text" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.txt`);
6679
- }
6680
- if (uploads == null ? void 0 : uploads.JSON) {
6681
- form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.json`);
6682
- }
6683
- if (uploads == null ? void 0 : uploads.EAS) {
6684
- if (metadata.eas) {
6685
- const file = (0, import_fs3.readFileSync)(metadata.eas);
6686
- form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}_eas.mp3`);
6687
- }
6688
- }
6689
- form.append("payload_json", JSON.stringify({
6690
- username: (_o = webhook.Title) != null ? _o : "AtmosphericX",
6691
- content: (_p = webhook.Message) != null ? _p : "",
6692
- embeds: [embed]
6693
- }));
6694
- yield createHttp({
6695
- url: webhook.Destination,
6696
- timeout: 15e3,
6697
- method: `POST`,
6698
- body: form
6699
- });
6700
6836
  }
6701
6837
  }
6702
6838
  }
6703
- setDebug({ title: `@manager.updateListener`, message: `Listener took ${performance.now() - tick} ms` });
6839
+ SetDebug({ title: `Tasks`, message: `${Math.round(performance.now() - tick)}ms` });
6704
6840
  });
6705
6841
 
6706
- // src/@modules/@utilities/utilities.getShapeNearestPoint.ts
6707
- var getShapeNearestPoint = (coordinates, point) => {
6842
+ // src/@modules/@utilities/GetShapeNearestPoint.ts
6843
+ var GetShapeNearestPoint = (coordinates, point) => {
6708
6844
  if (!coordinates || !point) {
6709
6845
  return { proximity: false, point: [0, 0], distance: null };
6710
6846
  }
@@ -6794,18 +6930,21 @@ var getShapeNearestPoint = (coordinates, point) => {
6794
6930
  return { proximity: distanceMiles === 0, point: closestPoint, distance: distanceMiles, distanceKm, distanceMeters };
6795
6931
  };
6796
6932
 
6797
- // src/@building/building.polygon.ts
6798
- var getEventNodes = (event) => __async(null, null, function* () {
6933
+ // src/@building/GetEventNodes.ts
6934
+ var GetEventNodes = (event) => __async(null, null, function* () {
6799
6935
  var _a, _b;
6936
+ const nodes = bootstrap.cache.nodes.features;
6937
+ if (!nodes || nodes.length === 0) {
6938
+ return { nodes: [], filtered: true, updated: Date.now() };
6939
+ }
6800
6940
  const metadata = { nodes: [], proximity: false, filtered: false };
6801
- const geometry = yield getEventGeometry(event);
6941
+ const geometry = yield GetEventGeometry(event);
6802
6942
  if (!geometry || !geometry.coordinates) {
6803
6943
  return { nodes: [], filtered: false, updated: Date.now() };
6804
6944
  }
6805
- const nodes = bootstrap.cache.nodes.features;
6806
6945
  for (const node of nodes) {
6807
6946
  const [longitude, latitude] = node.geometry.coordinates;
6808
- const getPoint = getShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
6947
+ const getPoint = GetShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
6809
6948
  const miles = (_a = getPoint.distance) != null ? _a : null;
6810
6949
  const kilometers = Number((miles * 1.609344).toFixed(3));
6811
6950
  const info = {
@@ -6814,10 +6953,10 @@ var getEventNodes = (event) => __async(null, null, function* () {
6814
6953
  nearest: getPoint.point,
6815
6954
  miles,
6816
6955
  kilometers,
6817
- proximity: getPoint.proximity
6956
+ proximity: false
6818
6957
  };
6819
6958
  metadata.nodes.push(info);
6820
- if (bootstrap.settings.GlobalSettings.EventFiltering.NodeLocationFiltering && miles < bootstrap.settings.GlobalSettings.NodeMinDistance) {
6959
+ if (miles != null && bootstrap.settings.GlobalSettings.EventFiltering.NodeLocationFiltering && miles < bootstrap.settings.GlobalSettings.NodeMaxDistance) {
6821
6960
  metadata.proximity = true;
6822
6961
  info.proximity = true;
6823
6962
  }
@@ -6829,19 +6968,20 @@ var getEventNodes = (event) => __async(null, null, function* () {
6829
6968
  };
6830
6969
  });
6831
6970
 
6832
- // src/@manager/manager.updateNodes.ts
6833
- var updateNode = (selectedEvent) => __async(null, null, function* () {
6971
+ // src/@manager/UpdateNode.ts
6972
+ var UpdateNode = (selectedEvent) => __async(null, null, function* () {
6834
6973
  const events = bootstrap.cache.events.features;
6835
6974
  const ttl = bootstrap.settings.GlobalSettings.NodeTTL * 1e3;
6836
6975
  let total = 0;
6976
+ const TTLEvents = selectedEvent ? [selectedEvent] : events.filter((evt) => {
6977
+ var _a, _b, _c;
6978
+ const lastUpdate = (_c = (_b = (_a = evt == null ? void 0 : evt.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.updated) != null ? _c : null;
6979
+ return lastUpdate == null || Date.now() - lastUpdate >= ttl;
6980
+ });
6981
+ if (TTLEvents.length === 0) return;
6837
6982
  function update(evt) {
6838
6983
  return __async(this, null, function* () {
6839
- var _a, _b, _c;
6840
- const lastUpdate = (_c = (_b = (_a = evt == null ? void 0 : evt.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.updated) != null ? _c : null;
6841
- if (lastUpdate != null && Date.now() - lastUpdate < ttl) {
6842
- return evt;
6843
- }
6844
- const node = yield getEventNodes(evt);
6984
+ const node = yield GetEventNodes(evt);
6845
6985
  if (node.nodes.length > 0) {
6846
6986
  total++;
6847
6987
  }
@@ -6850,16 +6990,13 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
6850
6990
  evt.properties.metadata.updated = node.updated;
6851
6991
  });
6852
6992
  }
6853
- if (!selectedEvent) {
6854
- yield Promise.all(events.map((evt) => __async(null, null, function* () {
6855
- yield update(evt);
6856
- })));
6857
- }
6858
- if (selectedEvent) {
6859
- yield update(selectedEvent);
6993
+ const concurrency = 4;
6994
+ for (let index = 0; index < TTLEvents.length; index += concurrency) {
6995
+ const batch = TTLEvents.slice(index, index + concurrency);
6996
+ yield Promise.all(batch.map((evt) => update(evt)));
6860
6997
  }
6861
6998
  if (total > 0) {
6862
- setEventEmit({
6999
+ SetEventEmit({
6863
7000
  event: `onNodeUpdate`,
6864
7001
  metadata: {
6865
7002
  type: `global-update`,
@@ -6869,73 +7006,82 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
6869
7006
  }
6870
7007
  });
6871
7008
 
6872
- // src/@manager/manager.mkEvent.ts
6873
- var mkEvent = (event) => __async(null, null, function* () {
7009
+ // src/@manager/MakeEvents.ts
7010
+ var MakeEvents = (events) => __async(null, null, function* () {
6874
7011
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
7012
+ let tasked = [];
6875
7013
  const settings = bootstrap.settings;
6876
- const features = bootstrap.cache.events.features;
6877
- const getHash = event.properties.metadata.hash;
6878
- const getTracking = event.properties.metadata.tracking;
6879
- const isEntry = (_a = bootstrap.cache.hashes) == null ? void 0 : _a.find((hash) => hash.tracking === getTracking);
6880
- const isHashed = (_c = (_b = isEntry == null ? void 0 : isEntry.hashes) == null ? void 0 : _b.includes(getHash)) != null ? _c : false;
6881
- const getFeature = features.find((feature) => feature.properties.metadata.tracking === getTracking);
6882
- if (isHashed || event.properties.status_metadata.is_expired) return;
6883
- setHash(event, isEntry);
6884
- const isFilteredLocation = yield updateNode(event).then(() => event.properties.metadata.filtered_proximity);
6885
- if (!isFilteredLocation && !dict_global.includes(event.properties.event.toLowerCase()) && settings.GlobalSettings.EventFiltering.NodeLocationFiltering) {
6886
- return;
6887
- }
6888
- const isRatelimited = setTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
6889
- if (!isRatelimited.limited) {
6890
- setEventEmit({
6891
- event: `onEventStatus`,
6892
- metadata: {
6893
- type: getFeature ? `Updated` : `New`,
6894
- event
6895
- },
6896
- message: `[${getFeature ? "Updated" : "New"}] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
6897
- });
6898
- }
6899
- if (settings.GlobalSettings.EventManagement) {
6900
- if (event.properties.status_metadata.is_issued || event.properties.status_metadata.is_updated) {
6901
- if (getFeature) {
6902
- const getIndex = features.indexOf(getFeature);
6903
- const cHistory = (_f = (_e = (_d = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _d.metadata) == null ? void 0 : _e.history) != null ? _f : [];
6904
- const cLocations = (_i = (_h = (_g = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _g.locations) == null ? void 0 : _h.split(";").map((l) => l.trim())) != null ? _i : [];
6905
- const cUgc = (_l = (_k = (_j = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _j.geocode) == null ? void 0 : _k.ugc) != null ? _l : [];
6906
- const iHistory = (_o = (_n = (_m = event.properties) == null ? void 0 : _m.metadata) == null ? void 0 : _n.history) != null ? _o : [];
6907
- const iLocations = (_r = (_q = (_p = event.properties) == null ? void 0 : _p.locations) == null ? void 0 : _q.split(";").map((l) => l.trim())) != null ? _r : [];
6908
- const iUgc = (_u = (_t = (_s = event.properties) == null ? void 0 : _s.geocode) == null ? void 0 : _t.ugc) != null ? _u : [];
6909
- const mHistory = [...cHistory, ...iHistory].filter((v, i, a) => a.indexOf(v) === i).filter((v, i, a) => a.findIndex((h) => h.description === v.description && h.issued === v.issued) === i);
6910
- const mLocations = [...cLocations, ...iLocations].filter((v, i, a) => a.indexOf(v) === i).join("; ");
6911
- const mUgc = [...cUgc, ...iUgc].filter((v, i, a) => a.indexOf(v) === i);
6912
- bootstrap.cache.events.features[getIndex] = __spreadProps(__spreadValues({}, event), {
6913
- properties: __spreadProps(__spreadValues({}, event.properties), {
6914
- metadata: __spreadProps(__spreadValues({}, (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.metadata), {
6915
- history: mHistory
6916
- }),
6917
- locations: mLocations,
6918
- geocode: __spreadProps(__spreadValues({}, (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.geocode), {
6919
- ugc: mUgc
7014
+ if (events.length === 0) return;
7015
+ for (const event of events) {
7016
+ const features = bootstrap.cache.events.features;
7017
+ const getHash = event.properties.metadata.hash;
7018
+ const getTracking = event.properties.metadata.tracking;
7019
+ const isEntry = (_a = bootstrap.cache.hashes) == null ? void 0 : _a.find((hash) => hash.tracking === getTracking);
7020
+ const isHashed = (_c = (_b = isEntry == null ? void 0 : isEntry.hashes) == null ? void 0 : _b.includes(getHash)) != null ? _c : false;
7021
+ const isNodeFiltering = settings.GlobalSettings.EventFiltering.NodeLocationFiltering;
7022
+ const getFeature = features.find((feature) => feature.properties.metadata.tracking === getTracking);
7023
+ if (isHashed || event.properties.status_metadata.is_expired) return;
7024
+ SetHash(event, isEntry);
7025
+ if (isNodeFiltering) {
7026
+ yield UpdateNode(event);
7027
+ if (!event.properties.metadata.filtered_proximity && !EnumGlobalFilter.includes(event.properties.event.toLowerCase())) {
7028
+ return;
7029
+ }
7030
+ }
7031
+ const isRatelimited = SetTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
7032
+ if (!isRatelimited.limited) {
7033
+ SetEventEmit({
7034
+ event: `onEventStatus`,
7035
+ metadata: {
7036
+ type: getFeature ? `Updated` : `New`,
7037
+ event
7038
+ },
7039
+ message: `[${getFeature ? "Updated" : "New"}] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
7040
+ });
7041
+ }
7042
+ if (settings.GlobalSettings.EventManagement) {
7043
+ if (event.properties.status_metadata.is_issued || event.properties.status_metadata.is_updated) {
7044
+ if (getFeature) {
7045
+ const getIndex = features.indexOf(getFeature);
7046
+ const cHistory = (_f = (_e = (_d = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _d.metadata) == null ? void 0 : _e.history) != null ? _f : [];
7047
+ const cLocations = (_i = (_h = (_g = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _g.locations) == null ? void 0 : _h.split(";").map((l) => l.trim())) != null ? _i : [];
7048
+ const cUgc = (_l = (_k = (_j = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _j.geocode) == null ? void 0 : _k.ugc) != null ? _l : [];
7049
+ const iHistory = (_o = (_n = (_m = event.properties) == null ? void 0 : _m.metadata) == null ? void 0 : _n.history) != null ? _o : [];
7050
+ const iLocations = (_r = (_q = (_p = event.properties) == null ? void 0 : _p.locations) == null ? void 0 : _q.split(";").map((l) => l.trim())) != null ? _r : [];
7051
+ const iUgc = (_u = (_t = (_s = event.properties) == null ? void 0 : _s.geocode) == null ? void 0 : _t.ugc) != null ? _u : [];
7052
+ const mHistory = [...cHistory, ...iHistory].filter((v, i, a) => a.indexOf(v) === i).filter((v, i, a) => a.findIndex((h) => h.description === v.description && h.issued === v.issued) === i);
7053
+ const mLocations = [...cLocations, ...iLocations].filter((v, i, a) => a.indexOf(v) === i).join("; ");
7054
+ const mUgc = [...cUgc, ...iUgc].filter((v, i, a) => a.indexOf(v) === i);
7055
+ bootstrap.cache.events.features[getIndex] = __spreadProps(__spreadValues({}, event), {
7056
+ properties: __spreadProps(__spreadValues({}, event.properties), {
7057
+ metadata: __spreadProps(__spreadValues({}, (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.metadata), {
7058
+ history: mHistory
7059
+ }),
7060
+ locations: mLocations,
7061
+ geocode: __spreadProps(__spreadValues({}, (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.geocode), {
7062
+ ugc: mUgc
7063
+ })
6920
7064
  })
6921
- })
6922
- });
6923
- yield updateListener(bootstrap.cache.events.features[getIndex]);
6924
- } else {
6925
- features.push(event);
6926
- yield updateListener(event);
7065
+ });
7066
+ tasked.push(bootstrap.cache.events.features[getIndex]);
7067
+ } else {
7068
+ features.push(event);
7069
+ tasked.push(event);
7070
+ }
6927
7071
  }
6928
7072
  }
6929
7073
  }
7074
+ yield Tasks(tasked);
7075
+ SetEventEmit({ event: `onEventCache`, metadata: bootstrap.cache.events, limited: true });
6930
7076
  });
6931
7077
 
6932
- // src/@dictionaries/dictionaries.strings.ts
6933
- var dict_strings = {
6934
- cancellation: `{EVENT} has been allowed to expire. This product is no longer in effect.`
7078
+ // src/@enums/Strings.ts
7079
+ var EnumStrings = {
7080
+ cancellation: `{EVENT} has been allowed to expire. This event is no longer in effect.`
6935
7081
  };
6936
7082
 
6937
- // src/@manager/manager.rmEvent.ts
6938
- var rmEvent = (event, isTimeBasedExpiration) => __async(null, null, function* () {
7083
+ // src/@manager/RemoveEvent.ts
7084
+ var RemoveEvent = (event, isTimeBasedExpiration) => __async(null, null, function* () {
6939
7085
  const gTracking = event.properties.metadata.tracking;
6940
7086
  const isTrackingEventLogged = bootstrap.cache.events.features.find((f) => {
6941
7087
  var _a, _b;
@@ -6946,35 +7092,35 @@ var rmEvent = (event, isTimeBasedExpiration) => __async(null, null, function* ()
6946
7092
  event.properties.expires = (/* @__PURE__ */ new Date()).toISOString();
6947
7093
  event.properties.status = `Expired`;
6948
7094
  event.properties.status_metadata.is_expired = true;
6949
- const description = isTimeBasedExpiration ? dict_strings.cancellation.replace(`{SENDER}`, event.properties.geocode.office.name).replace(`{EVENT}`, event.properties.event) : event.properties.metadata.raw;
6950
- event.properties.description = event.properties.metadata.raw = description;
7095
+ const description = isTimeBasedExpiration ? EnumStrings.cancellation.replace(`{SENDER}`, event.properties.geocode.office.name).replace(`{EVENT}`, event.properties.event) : event.properties.description;
7096
+ event.properties.description = description;
7097
+ event.properties.metadata.raw = isTimeBasedExpiration ? description : event.properties.metadata.raw;
6951
7098
  event.properties.metadata.history.push({
6952
- description,
7099
+ description: isTimeBasedExpiration ? description : event.properties.description,
6953
7100
  issued: event.properties.expires,
6954
7101
  status: event.properties.status
6955
7102
  });
6956
7103
  bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(isTrackingEventLogged), 1);
6957
7104
  bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== gTracking);
6958
7105
  if (!isStatement) {
6959
- setEventEmit({
7106
+ SetEventEmit({
6960
7107
  event: `onEventStatus`,
6961
7108
  metadata: { type: `Removed`, event },
6962
7109
  message: `[Removed] ${event.properties.event} (${event.properties.status}) (${gTracking})`
6963
7110
  });
6964
- yield updateListener(event);
7111
+ yield Tasks([event]);
6965
7112
  }
6966
- setTimeoutAction({ identifier: gTracking, expire: true });
6967
- setTimeoutAction({ identifier: gTracking + `notify.server`, expire: true });
7113
+ SetTimeoutAction({ identifier: gTracking, expire: true });
6968
7114
  }
6969
- setEventEmit({
7115
+ SetEventEmit({
6970
7116
  event: `onEventCache`,
6971
7117
  metadata: bootstrap.cache.events,
6972
7118
  limited: true
6973
7119
  });
6974
7120
  });
6975
7121
 
6976
- // src/@dictionaries/dictionaries.states.ts
6977
- var dict_states = {
7122
+ // src/@enums/States.ts
7123
+ var EnumStates = {
6978
7124
  "AL": "Alabama",
6979
7125
  "AK": "Alaska",
6980
7126
  "AZ": "Arizona",
@@ -7028,8 +7174,8 @@ var dict_states = {
7028
7174
  "DC": "District of Columbia"
7029
7175
  };
7030
7176
 
7031
- // src/@modules/@utilities/utilities.getLatestIssuance.ts
7032
- var getLatestIssuance = () => {
7177
+ // src/@modules/@utilities/GetLatestIssuance.ts
7178
+ var GetLatestIssuance = () => {
7033
7179
  const now = /* @__PURE__ */ new Date();
7034
7180
  const current = now.getUTCHours() * 100 + now.getUTCMinutes();
7035
7181
  const issuances = [100, 600, 1300, 1630, 2e3];
@@ -7042,11 +7188,12 @@ var getLatestIssuance = () => {
7042
7188
  return latest.toString().padStart(4, "0");
7043
7189
  };
7044
7190
 
7045
- // src/@building/building.attachments.ts
7046
- var getEventAttachments = (event) => {
7191
+ // src/@building/GetEventAttachments.ts
7192
+ var GetEventAttachments = (event) => {
7047
7193
  var _a, _b, _c, _d, _e, _f, _g;
7048
7194
  let attachments = [];
7049
- const issuanceTime = getLatestIssuance();
7195
+ const settings = bootstrap.settings;
7196
+ const issuanceTime = GetLatestIssuance();
7050
7197
  const spcNumber = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.discussion_parameters) == null ? void 0 : _b.discussion_number;
7051
7198
  const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
7052
7199
  const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
@@ -7063,34 +7210,36 @@ var getEventAttachments = (event) => {
7063
7210
  if (events.find((e) => e.target === event.properties.event)) {
7064
7211
  attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target.toLowerCase() === event.properties.event.toLowerCase()).attachment });
7065
7212
  }
7066
- for (const location of locations) {
7067
- if (dict_expressions.location.test(location)) {
7068
- const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`];
7069
- const county = (_f = location == null ? void 0 : location.split(",")[0]) == null ? void 0 : _f.trim().replace(new RegExp(`^(${lines.join("|")}) `), "");
7070
- const state = dict_states[(_g = location == null ? void 0 : location.split(",")[1]) == null ? void 0 : _g.trim()];
7071
- const feeds = bootstrap.database.prepare(`SELECT * FROM broadcastify WHERE state = ? AND county = ?`).all(state, county).sort((a, b) => {
7072
- const typeOrder = ["Other", "Public Safety"];
7073
- const indexA = typeOrder.indexOf(a.type);
7074
- const indexB = typeOrder.indexOf(b.type);
7075
- return indexA - indexB;
7076
- });
7077
- const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
7078
- const filtered = feeds.filter((feed) => tags.includes(feed.type));
7079
- if (filtered.length > 0) {
7080
- filtered.map((filtered2) => {
7081
- if (!attachments.some((a) => a.link === filtered2.link)) {
7082
- attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
7083
- }
7213
+ if (settings.BroadcastifySettings.BroadcastifyAttachments) {
7214
+ for (const location of locations) {
7215
+ if (EnumExpressions.location.test(location)) {
7216
+ const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`];
7217
+ const county = (_f = location == null ? void 0 : location.split(",")[0]) == null ? void 0 : _f.trim().replace(new RegExp(`^(${lines.join("|")}) `), "");
7218
+ const state = EnumStates[(_g = location == null ? void 0 : location.split(",")[1]) == null ? void 0 : _g.trim()];
7219
+ const feeds = bootstrap.database.prepare(`SELECT * FROM broadcastify WHERE state = ? AND county = ?`).all(state, county).sort((a, b) => {
7220
+ const typeOrder = ["Other", "Public Safety"];
7221
+ const indexA = typeOrder.indexOf(a.type);
7222
+ const indexB = typeOrder.indexOf(b.type);
7223
+ return indexA - indexB;
7084
7224
  });
7225
+ const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
7226
+ const filtered = feeds.filter((feed) => tags.includes(feed.type));
7227
+ if (filtered.length > 0) {
7228
+ filtered.map((filtered2) => {
7229
+ if (!attachments.some((a) => a.link === filtered2.link)) {
7230
+ attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
7231
+ }
7232
+ });
7233
+ }
7085
7234
  }
7086
7235
  }
7087
7236
  }
7088
7237
  return attachments;
7089
7238
  };
7090
7239
 
7091
- // src/@building/building.validate.ts
7240
+ // src/@manager/ValidateEvents.ts
7092
7241
  var import_crypto = require("crypto");
7093
- var validateEvents = (events) => __async(null, null, function* () {
7242
+ var ValidateEvents = (events) => __async(null, null, function* () {
7094
7243
  const tick = performance.now();
7095
7244
  if (events.length === 0) return;
7096
7245
  const configurations = bootstrap.settings;
@@ -7108,21 +7257,21 @@ var validateEvents = (events) => __async(null, null, function* () {
7108
7257
  }
7109
7258
  const isFiltered = (define2) => {
7110
7259
  var _a, _b, _c, _d;
7111
- const properties2 = define2.properties;
7112
- const zones = properties2.geocode.ugc;
7113
- const icao = properties2.geocode.office.office;
7114
- if (properties2.status_metadata.is_test) {
7115
- setEventEmit({ event: `onTestProduct`, metadata: define2 });
7260
+ const properties = define2.properties;
7261
+ const zones = properties.geocode.ugc;
7262
+ const icao = properties.geocode.office.office;
7263
+ if (properties.status_metadata.is_test) {
7264
+ SetEventEmit({ event: `onTestProduct`, metadata: define2 });
7116
7265
  if (bools == null ? void 0 : bools.IgnoreTestProducts) return true;
7117
7266
  }
7118
- if (properties2.status_metadata.is_expired) {
7119
- setEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7120
- rmEvent(define2, false);
7267
+ if (properties.status_metadata.is_expired) {
7268
+ SetEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7269
+ RemoveEvent(define2, false);
7121
7270
  return true;
7122
7271
  }
7123
- if (((_b = (_a = properties2.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties2.metadata.source != `events.api`) {
7124
- const isSPC = (_d = (_c = properties2.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
7125
- setEventEmit({ event: isSPC ? `onStormPredictionWatch` : `onNonStormPredictionWatch`, metadata: define2 });
7272
+ if (((_b = (_a = properties.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties.metadata.source != `events.api`) {
7273
+ const isSPC = (_d = (_c = properties.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
7274
+ SetEventEmit({ event: isSPC ? `onStormPredictionWatch` : `onNonStormPredictionWatch`, metadata: define2 });
7126
7275
  if ((bools == null ? void 0 : bools.SPCWatchesOnly) && !isSPC) {
7127
7276
  return true;
7128
7277
  }
@@ -7133,43 +7282,43 @@ var validateEvents = (events) => __async(null, null, function* () {
7133
7282
  for (const key in sets) {
7134
7283
  const setting = sets[key];
7135
7284
  const values = [...setting];
7136
- if (key === "ListeningEvents" && setting.size > 0 && !getMatched(values, define2.properties.event)) {
7137
- setEventEmit({
7285
+ if (key === "ListeningEvents" && setting.size > 0 && !GetMatched(values, define2.properties.event)) {
7286
+ SetEventEmit({
7138
7287
  event: `onFilteredEvent`,
7139
7288
  metadata: define2
7140
7289
  });
7141
7290
  return true;
7142
7291
  }
7143
- if (key === "IgnoredEvents" && setting.size > 0 && getMatched(values, define2.properties.event)) {
7144
- setEventEmit({
7292
+ if (key === "IgnoredEvents" && setting.size > 0 && GetMatched(values, define2.properties.event)) {
7293
+ SetEventEmit({
7145
7294
  event: `onIgnoredEvent`,
7146
7295
  metadata: define2
7147
7296
  });
7148
7297
  return true;
7149
7298
  }
7150
7299
  if (key === "ListeningICAO" && setting.size > 0 && icao != null && !setting.has(icao.toLowerCase())) {
7151
- setEventEmit({
7300
+ SetEventEmit({
7152
7301
  event: `onFilteredICAO`,
7153
7302
  metadata: define2
7154
7303
  });
7155
7304
  return true;
7156
7305
  }
7157
7306
  if (key === "IgnoredICAO" && setting.size > 0 && icao != null && setting.has(icao.toLowerCase())) {
7158
- setEventEmit({
7307
+ SetEventEmit({
7159
7308
  event: `onIgnoredICAO`,
7160
7309
  metadata: define2
7161
7310
  });
7162
7311
  return true;
7163
7312
  }
7164
- if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.toLowerCase()))) {
7165
- setEventEmit({
7313
+ if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.toLowerCase()))) {
7314
+ SetEventEmit({
7166
7315
  event: `onFilteredUGC`,
7167
7316
  metadata: define2
7168
7317
  });
7169
7318
  return true;
7170
7319
  }
7171
- if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.substring(0, 2).toLowerCase()))) {
7172
- setEventEmit({
7320
+ if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.substring(0, 2).toLowerCase()))) {
7321
+ SetEventEmit({
7173
7322
  event: `onFilteredState`,
7174
7323
  metadata: define2
7175
7324
  });
@@ -7180,37 +7329,28 @@ var validateEvents = (events) => __async(null, null, function* () {
7180
7329
  };
7181
7330
  const filtering = events.filter((event) => {
7182
7331
  bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
7183
- const define2 = getEventSignature(event);
7332
+ const define2 = GetEventSignature(event);
7184
7333
  const pre = __spreadProps(__spreadValues({}, define2), { properties: __spreadProps(__spreadValues({}, define2.properties), { metadata: __spreadValues({}, define2.properties.metadata) }) });
7185
- const properties2 = define2.properties;
7334
+ const properties = define2.properties;
7186
7335
  delete pre.properties.metadata.ms;
7187
7336
  delete pre.properties.metadata.header;
7188
- const enhanced = properties2.event = getEventEnhancedName(event);
7337
+ const enhanced = properties.event = GetEventEnhancedName(event);
7189
7338
  const filtered = isFiltered(define2);
7190
7339
  if (!filtered) {
7191
- event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? getEventGeometry(event) : null;
7192
- properties2.metadata.attachments = getEventAttachments(event);
7340
+ event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? GetEventGeometry(event) : null;
7341
+ properties.metadata.attachments = GetEventAttachments(event);
7193
7342
  }
7194
- properties2.metadata.hash = (0, import_crypto.createHash)("sha256").update(JSON.stringify(pre)).digest("hex");
7195
- setEventEmit({ event: `onProductType${enhanced.replace(/\s+/g, "")}`, metadata: define2 });
7343
+ properties.metadata.hash = (0, import_crypto.createHash)("sha256").update(JSON.stringify(pre)).digest("hex");
7344
+ SetEventEmit({ event: `onProductType${enhanced.replace(/\s+/g, "")}`, metadata: define2 });
7196
7345
  return !filtered;
7197
7346
  });
7198
- if (filtering.length > 0) {
7199
- for (const event of filtering) {
7200
- yield mkEvent(event);
7201
- }
7202
- }
7203
- yield updateNode();
7204
- setEventEmit({
7205
- event: `onEventCache`,
7206
- metadata: bootstrap.cache.events,
7207
- limited: true
7208
- });
7209
- setDebug({ title: `@building.validate`, message: `Filtered ${filtering.length} events which took ${performance.now() - tick} ms` });
7347
+ SetDebug({ title: `ValidateEvents (PRE) (${filtering.length}/${events.length})`, message: `${Math.round(performance.now() - tick)}ms` });
7348
+ yield MakeEvents(filtering);
7349
+ SetDebug({ title: `MakeEvents (${filtering.length}/${events.length})`, message: `${Math.round(performance.now() - tick)}ms` });
7210
7350
  });
7211
7351
 
7212
- // src/@building/building.create.ts
7213
- var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7352
+ // src/@building/CreateEvent.ts
7353
+ var CreateEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7214
7354
  const settings = bootstrap.settings;
7215
7355
  const StanzaSettings = settings.NOAAWeatherWireServiceSettings.StanzaSettings;
7216
7356
  const isVtecEvent = stanza.isVTEC && stanza.isUGC;
@@ -7219,26 +7359,26 @@ var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7219
7359
  const isNWWS = stanza.isNWWS;
7220
7360
  switch (true) {
7221
7361
  case !isNWWS:
7222
- yield api(stanza);
7362
+ yield ParseAPI(stanza);
7223
7363
  break;
7224
7364
  case (isNWWS && !StanzaSettings.DisableVTEC && isVtecEvent):
7225
- yield vtec(stanza);
7365
+ yield ParseVTEC(stanza);
7226
7366
  break;
7227
7367
  case (isNWWS && !StanzaSettings.DisableUGC && isUgcEvent):
7228
- yield ugc(stanza);
7368
+ yield ParseUGC(stanza);
7229
7369
  break;
7230
7370
  case (isNWWS && !StanzaSettings.DisableText && isTextEvent):
7231
- yield text(stanza);
7371
+ yield ParseText(stanza);
7232
7372
  break;
7233
7373
  }
7234
7374
  if (!ignorePushing) {
7235
- validateEvents(bootstrap.cache.processed);
7375
+ yield ValidateEvents(bootstrap.cache.processed);
7236
7376
  }
7237
7377
  return "nothing picked";
7238
7378
  });
7239
7379
 
7240
- // src/@modules/@database/database.stanza.ts
7241
- var importStanza = (stanza) => __async(null, null, function* () {
7380
+ // src/@modules/@database/ImportStanza.ts
7381
+ var ImportStanza = (stanza) => __async(null, null, function* () {
7242
7382
  const settings = bootstrap.settings;
7243
7383
  try {
7244
7384
  if (!settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
@@ -7254,17 +7394,17 @@ var importStanza = (stanza) => __async(null, null, function* () {
7254
7394
  }
7255
7395
  }
7256
7396
  } catch (error) {
7257
- setWarning({ message: `An error occurred while importing stanza: ${error.message}` });
7397
+ SetWarning({ message: `An error occurred while importing stanza: ${error.message}` });
7258
7398
  }
7259
7399
  });
7260
7400
 
7261
- // src/@modules/@xmpp/xmpp.xStanza.ts
7262
- var xStanza = () => {
7401
+ // src/@modules/@xmpp/StanzaXMPP.ts
7402
+ var StanzaXMPP = () => {
7263
7403
  bootstrap.session_xmpp.on(`stanza`, (stanza) => __async(null, null, function* () {
7264
7404
  var _a, _b, _c, _d;
7265
7405
  const msgFrom = (_b = (_a = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _a.from) != null ? _b : ``;
7266
7406
  const msgType = (_d = (_c = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _c.type) != null ? _d : ``;
7267
- setEventEmit({
7407
+ SetEventEmit({
7268
7408
  event: `onServiceStatus`,
7269
7409
  metadata: {
7270
7410
  message: stanza,
@@ -7274,18 +7414,18 @@ var xStanza = () => {
7274
7414
  });
7275
7415
  bootstrap.cache.lastStanza = Date.now();
7276
7416
  if (stanza.is(`message`)) {
7277
- const result = validate({ stanza });
7417
+ const result = ValidateStanza({ stanza });
7278
7418
  const isSkippable = result.isIgnored || result.isCapEvent || result.isCapEvent && !result.isCapAreaDescription;
7279
7419
  if (isSkippable) {
7280
7420
  return;
7281
7421
  }
7282
- yield createEvent(result);
7283
- yield importStanza(result);
7422
+ yield CreateEvent(result);
7423
+ yield ImportStanza(result);
7284
7424
  }
7285
7425
  if (stanza.is(`presence`) && msgFrom.startsWith("nwws@conference.nwws-oi.weather.gov/")) {
7286
7426
  const getOccupant = msgFrom.split(`/`).slice(1).join(`/`);
7287
7427
  const getAvailability = msgType === `unavailable`;
7288
- setEventEmit({
7428
+ SetEventEmit({
7289
7429
  event: `onServiceStatus`,
7290
7430
  metadata: {
7291
7431
  message: `Occupant ${getOccupant} has ${getAvailability ? `left` : `joined`} the room`,
@@ -7298,8 +7438,8 @@ var xStanza = () => {
7298
7438
  }));
7299
7439
  };
7300
7440
 
7301
- // src/@modules/@xmpp/xmpp.xDeploy.ts
7302
- var xDeploy = () => __async(null, null, function* () {
7441
+ // src/@modules/@xmpp/DeployXMPP.ts
7442
+ var DeployXMPP = () => __async(null, null, function* () {
7303
7443
  var _a, _b;
7304
7444
  let session;
7305
7445
  const settings = bootstrap.settings;
@@ -7311,13 +7451,13 @@ var xDeploy = () => __async(null, null, function* () {
7311
7451
  password: settings.NOAAWeatherWireServiceSettings.CredentialSettings.Password
7312
7452
  });
7313
7453
  try {
7314
- yield xOffline();
7315
- yield xError();
7316
- yield xStanza();
7317
- yield xOnline();
7454
+ yield OfflineXMPP();
7455
+ yield ErrorXMPP();
7456
+ yield StanzaXMPP();
7457
+ yield OnlineXMPP();
7318
7458
  yield session.start();
7319
7459
  } catch (error) {
7320
- setEventEmit({
7460
+ SetEventEmit({
7321
7461
  event: `onServiceStatus`,
7322
7462
  metadata: {
7323
7463
  message: `Error occured while starting XMPP Session: ${error}`,
@@ -7329,8 +7469,8 @@ var xDeploy = () => __async(null, null, function* () {
7329
7469
  }
7330
7470
  });
7331
7471
 
7332
- // src/@dictionaries/dictionaries.shapefiles.ts
7333
- var dict_shapefiles = [
7472
+ // src/@enums/Shapefiles.ts
7473
+ var EnumShapefiles = [
7334
7474
  { name: "us_counties", id: "C", link: "https://www.weather.gov/source/gis/Shapefiles/County/c_16ap26.zip" },
7335
7475
  { name: "us_states_territories", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/County/s_16ap26.zip" },
7336
7476
  { name: "fire_weather_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/fz16ap26.zip" },
@@ -7342,8 +7482,8 @@ var dict_shapefiles = [
7342
7482
  { name: "high_seas_marine_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/hz17fe26.zip" }
7343
7483
  ];
7344
7484
 
7345
- // src/@modules/@utilities/utilities.setSleep.ts
7346
- var setSleep = (options) => __async(null, null, function* () {
7485
+ // src/@modules/@utilities/SetSleep.ts
7486
+ var SetSleep = (options) => __async(null, null, function* () {
7347
7487
  return new Promise((resolve6) => {
7348
7488
  setTimeout(() => {
7349
7489
  resolve6();
@@ -7351,31 +7491,31 @@ var setSleep = (options) => __async(null, null, function* () {
7351
7491
  });
7352
7492
  });
7353
7493
 
7354
- // src/@modules/@database/database.shapefiles.ts
7355
- var import_fs4 = require("fs");
7494
+ // src/@modules/@database/ImportShapefiles.ts
7495
+ var import_fs3 = require("fs");
7356
7496
  var import_path3 = require("path");
7357
7497
  var import_jszip = require("jszip");
7358
7498
  var import_shapefile = require("shapefile");
7359
- var importShapefiles = () => __async(null, null, function* () {
7499
+ var ImportShapefiles = () => __async(null, null, function* () {
7360
7500
  var _a, _b;
7361
7501
  const settings = bootstrap.settings;
7362
7502
  try {
7363
7503
  const tShapefiles = bootstrap.database.prepare(`SELECT COUNT(*) AS count FROM shapefiles`).get().count;
7364
7504
  if (tShapefiles === 0) {
7365
- yield setSleep({ timeout: 1e3 });
7366
- for (const shapefile of dict_shapefiles) {
7505
+ yield SetSleep({ timeout: 1e3 });
7506
+ for (const shapefile of EnumShapefiles) {
7367
7507
  const response2 = yield fetch(shapefile.link);
7368
7508
  const arrayBuff = yield response2.arrayBuffer();
7369
7509
  const content = yield (0, import_jszip.loadAsync)(arrayBuff);
7370
7510
  const directory = (0, import_path3.resolve)(__dirname, `../../shapefiles`);
7371
- if (!(0, import_fs4.existsSync)(directory)) {
7372
- (0, import_fs4.mkdirSync)(directory, { recursive: true });
7511
+ if (!(0, import_fs3.existsSync)(directory)) {
7512
+ (0, import_fs3.mkdirSync)(directory, { recursive: true });
7373
7513
  }
7374
7514
  for (const file of Object.keys(content.files)) {
7375
7515
  if (file.endsWith(".shp") || file.endsWith(".dbf")) {
7376
7516
  const data = yield content.files[file].async(`nodebuffer`);
7377
7517
  const output = (0, import_path3.resolve)(directory, `${(_a = shapefile == null ? void 0 : shapefile.name) != null ? _a : ``}_${(_b = shapefile == null ? void 0 : shapefile.id) != null ? _b : ``}${(0, import_path3.extname)(file)}`);
7378
- (0, import_fs4.writeFileSync)(output, data);
7518
+ (0, import_fs3.writeFileSync)(output, data);
7379
7519
  }
7380
7520
  }
7381
7521
  const filepath = (0, import_path3.resolve)(__dirname, "../../shapefiles", shapefile.name + "_" + shapefile.id);
@@ -7383,43 +7523,43 @@ var importShapefiles = () => __async(null, null, function* () {
7383
7523
  filepath,
7384
7524
  filepath
7385
7525
  );
7386
- setWarning({ message: `Importing ${features.length} features from ${shapefile.name}_${shapefile.id} for Shapefiles` });
7526
+ SetWarning({ message: `Importing ${features.length} features from ${shapefile.name}_${shapefile.id} for Shapefiles` });
7387
7527
  const insert = bootstrap.database.prepare(`INSERT OR REPLACE INTO shapefiles (id, location, geometry) VALUES (?, ?, ?)`);
7388
7528
  const transaction = bootstrap.database.transaction((entries) => {
7389
7529
  var _a2, _b2, _c;
7390
7530
  for (const entry of entries) {
7391
- const { properties: properties2, geometry } = entry;
7531
+ const { properties, geometry } = entry;
7392
7532
  let final2, location;
7393
- if (properties2.FIPS) {
7394
- final2 = `${properties2.STATE}${shapefile.id}${properties2.FIPS.substring(2)}`;
7395
- location = `${properties2.COUNTYNAME}, ${properties2.STATE}`;
7396
- } else if (properties2.FULLSTAID) {
7397
- final2 = `${properties2.ST}${shapefile.id}${properties2.WFO}`;
7398
- location = `${properties2.CITY}, ${properties2.STATE}`;
7399
- } else if (properties2.STATE) {
7400
- final2 = `${properties2.STATE}${shapefile.id}${(_a2 = properties2.ZONE) != null ? _a2 : properties2.SITE_ID}`;
7401
- location = `${(_b2 = properties2.NAME) != null ? _b2 : `${properties2.RFC_NAME} ${properties2.RFC_CITY}`}, ${properties2.STATE}`;
7533
+ if (properties.FIPS) {
7534
+ final2 = `${properties.STATE}${shapefile.id}${properties.FIPS.substring(2)}`;
7535
+ location = `${properties.COUNTYNAME}, ${properties.STATE}`;
7536
+ } else if (properties.FULLSTAID) {
7537
+ final2 = `${properties.ST}${shapefile.id}${properties.WFO}`;
7538
+ location = `${properties.CITY}, ${properties.STATE}`;
7539
+ } else if (properties.STATE) {
7540
+ final2 = `${properties.STATE}${shapefile.id}${(_a2 = properties.ZONE) != null ? _a2 : properties.SITE_ID}`;
7541
+ location = `${(_b2 = properties.NAME) != null ? _b2 : `${properties.RFC_NAME} ${properties.RFC_CITY}`}, ${properties.STATE}`;
7402
7542
  } else {
7403
- final2 = (_c = properties2.ID) != null ? _c : properties2.WFO;
7404
- location = properties2.NAME;
7543
+ final2 = (_c = properties.ID) != null ? _c : properties.WFO;
7544
+ location = properties.NAME;
7405
7545
  }
7406
7546
  insert.run(final2, location, JSON.stringify(geometry));
7407
7547
  }
7408
7548
  });
7409
- (0, import_fs4.unlinkSync)(`${filepath}.shp`);
7410
- (0, import_fs4.unlinkSync)(`${filepath}.dbf`);
7549
+ (0, import_fs3.unlinkSync)(`${filepath}.shp`);
7550
+ (0, import_fs3.unlinkSync)(`${filepath}.dbf`);
7411
7551
  transaction(features);
7412
7552
  }
7413
- (0, import_fs4.rm)((0, import_path3.resolve)(__dirname, "../../shapefiles"), { recursive: true, force: true }, () => {
7553
+ (0, import_fs3.rm)((0, import_path3.resolve)(__dirname, "../../shapefiles"), { recursive: true, force: true }, () => {
7414
7554
  });
7415
7555
  }
7416
7556
  } catch (error) {
7417
- setWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
7557
+ SetWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
7418
7558
  }
7419
7559
  });
7420
7560
 
7421
- // src/@modules/@database/database.broadcastify.ts
7422
- var importBroadcastify = () => __async(null, null, function* () {
7561
+ // src/@modules/@database/ImportBroadcastify.ts
7562
+ var ImportBroadcastify = () => __async(null, null, function* () {
7423
7563
  const settings = bootstrap.settings;
7424
7564
  const isBroadcastifyImported = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
7425
7565
  if (!settings.BroadcastifySettings.BroadcastifyAttachments) {
@@ -7428,7 +7568,7 @@ var importBroadcastify = () => __async(null, null, function* () {
7428
7568
  if (isBroadcastifyImported) {
7429
7569
  return;
7430
7570
  }
7431
- const broadcastify = yield createHttp({
7571
+ const broadcastify = yield CreateHttp({
7432
7572
  url: settings.BroadcastifySettings.BroadcastifyDatabase,
7433
7573
  timeout: 5e3
7434
7574
  });
@@ -7443,7 +7583,7 @@ var importBroadcastify = () => __async(null, null, function* () {
7443
7583
  });
7444
7584
  const batch = [];
7445
7585
  for (const state of states) {
7446
- setWarning({ message: `Importing ${state.counties.length} counties from ${state.state} for Broadcastify` });
7586
+ SetWarning({ message: `Importing ${state.counties.length} counties from ${state.state} for Broadcastify` });
7447
7587
  for (const county of state.counties) {
7448
7588
  const countyName = county.county;
7449
7589
  for (const feed of county.feeds) {
@@ -7459,17 +7599,20 @@ var importBroadcastify = () => __async(null, null, function* () {
7459
7599
  }
7460
7600
  transaction(batch);
7461
7601
  }
7602
+ if (broadcastify.error) {
7603
+ SetWarning({ message: `Error importing Broadcastify data: ${broadcastify.message}` });
7604
+ }
7462
7605
  });
7463
7606
 
7464
- // src/@modules/@database/database.init.ts
7465
- var import_fs5 = require("fs");
7607
+ // src/@modules/@database/InitializeDatabase.ts
7608
+ var import_fs4 = require("fs");
7466
7609
  var import_better_sqlite3 = __toESM(require("better-sqlite3"));
7467
- var initializeDatabase = () => __async(null, null, function* () {
7610
+ var InitializeDatabase = () => __async(null, null, function* () {
7468
7611
  const settings = bootstrap.settings;
7469
7612
  try {
7470
- if (!(0, import_fs5.existsSync)(settings.Database)) {
7471
- (0, import_fs5.writeFileSync)(settings.Database, "");
7472
- setWarning({ message: `Creating new database at ${settings.Database}` });
7613
+ if (!(0, import_fs4.existsSync)(settings.Database)) {
7614
+ (0, import_fs4.writeFileSync)(settings.Database, "");
7615
+ SetWarning({ message: `Creating new database at ${settings.Database}` });
7473
7616
  }
7474
7617
  bootstrap.database = new import_better_sqlite3.default(settings.Database);
7475
7618
  bootstrap.database.prepare(`CREATE TABLE IF NOT EXISTS stanzas ( id INTEGER PRIMARY KEY AUTOINCREMENT, type TEXT, issued TEXT, stanza TEXT )`).run();
@@ -7477,18 +7620,18 @@ var initializeDatabase = () => __async(null, null, function* () {
7477
7620
  const isNeedingShapefiles = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='shapefiles';`).get();
7478
7621
  const isNeedingBroadcastify = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
7479
7622
  if (!isNeedingShapefiles || !isNeedingBroadcastify) {
7480
- setWarning({ message: `Required database tables are currently building, please ${bootstrap.ansi_colors.RED}DO NOT${bootstrap.ansi_colors.RESET} close your terminal. The building will not finish and will remain incomplete. If you do mess up, you will need to delete ${settings.Database} and restart the application.` });
7481
- yield importBroadcastify();
7482
- yield importShapefiles();
7483
- setWarning({ message: `Building has completed, you can now continue or close the terminal` });
7623
+ SetWarning({ message: `Required database tables are currently building, please ${bootstrap.ansi_colors.RED}DO NOT${bootstrap.ansi_colors.RESET} close your terminal. The building will not finish and will remain incomplete. If you do mess up, you will need to delete ${settings.Database} and restart the application.` });
7624
+ yield ImportBroadcastify();
7625
+ yield ImportShapefiles();
7626
+ SetWarning({ message: `Building has completed, you can now continue or close the terminal` });
7484
7627
  }
7485
7628
  } catch (error) {
7486
- setWarning({ message: `An error occurred while initializing the database: ${error.message}` });
7629
+ SetWarning({ message: `An error occurred while initializing the database: ${error.message}` });
7487
7630
  }
7488
7631
  });
7489
7632
 
7490
- // src/@modules/@database/database.cache.ts
7491
- var getCachedEvents = () => __async(null, null, function* () {
7633
+ // src/@modules/@database/GetCachedEvents.ts
7634
+ var GetCachedEvents = () => __async(null, null, function* () {
7492
7635
  var _a;
7493
7636
  try {
7494
7637
  const settings = bootstrap.settings;
@@ -7496,7 +7639,7 @@ var getCachedEvents = () => __async(null, null, function* () {
7496
7639
  if (settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
7497
7640
  const max = (_a = settings.NOAAWeatherWireServiceSettings.CacheSettings.MaxRetentionHistory) != null ? _a : 500;
7498
7641
  const get = yield bootstrap.database.prepare(`SELECT * FROM stanzas ORDER BY rowid DESC LIMIT ?`).all(max);
7499
- setWarning({ message: `Fetched ${get.length} cached stanzas from the database in ${Math.floor(performance.now() - tick)} ms` });
7642
+ SetWarning({ message: `Fetched ${get.length} cached stanzas from the database in ${Math.floor(performance.now() - tick)} ms` });
7500
7643
  let events = get.map((row) => JSON.parse(row.stanza)).filter((stanza) => {
7501
7644
  if (!stanza) {
7502
7645
  return;
@@ -7505,21 +7648,21 @@ var getCachedEvents = () => __async(null, null, function* () {
7505
7648
  return !isSkippable;
7506
7649
  });
7507
7650
  events = events.sort((a, b) => b.issued - a.issued);
7508
- yield Promise.all(events.map((event) => createEvent(event, true)));
7509
- setWarning({ message: `Processed ${events.length} cached stanzas in ${Math.floor(performance.now() - tick)} ms` });
7510
- validateEvents(bootstrap.cache.processed);
7651
+ yield Promise.all(events.map((event) => CreateEvent(event, true)));
7652
+ SetWarning({ message: `Processed ${events.length} cached stanzas in ${Math.floor(performance.now() - tick)} ms` });
7653
+ yield ValidateEvents(bootstrap.cache.processed);
7511
7654
  }
7512
7655
  } catch (error) {
7513
- setWarning({ message: `An error occurred while fetching cached stanzas: ${error.message} -> ${error.stack}` });
7656
+ SetWarning({ message: `An error occurred while fetching cached stanzas: ${error.message} -> ${error.stack}` });
7514
7657
  }
7515
7658
  });
7516
7659
 
7517
- // src/@modules/@xmpp/xmpp.xReconnect.ts
7518
- var xReconnect = (interval) => __async(null, null, function* () {
7660
+ // src/@modules/@xmpp/ReconnectXMPP.ts
7661
+ var ReconnectXMPP = (interval) => __async(null, null, function* () {
7519
7662
  const settings = bootstrap.settings;
7520
7663
  const lastStanza = Date.now() - bootstrap.cache.lastStanza;
7521
7664
  if (interval < 15) {
7522
- setWarning({ message: `Reconnection interval of ${interval} seconds is too low, setting to 15 seconds` });
7665
+ SetWarning({ message: `Reconnection interval of ${interval} seconds is too low, setting to 15 seconds` });
7523
7666
  interval = 15;
7524
7667
  bootstrap.settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval = 15;
7525
7668
  }
@@ -7533,7 +7676,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
7533
7676
  bootstrap.cache.isConnected = false;
7534
7677
  bootstrap.cache.tReconnects += 1;
7535
7678
  try {
7536
- setEventEmit({
7679
+ SetEventEmit({
7537
7680
  event: `onServiceStatus`,
7538
7681
  metadata: {
7539
7682
  message: `Attempting to reconnect to XMPP Service (Reconnect Attempt ${bootstrap.cache.tReconnects})`,
@@ -7551,7 +7694,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
7551
7694
  yield bootstrap.session_xmpp.start().catch(() => {
7552
7695
  });
7553
7696
  } catch (error) {
7554
- setWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
7697
+ SetWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
7555
7698
  } finally {
7556
7699
  bootstrap.cache.isReconnecting = false;
7557
7700
  }
@@ -7559,26 +7702,26 @@ var xReconnect = (interval) => __async(null, null, function* () {
7559
7702
  }
7560
7703
  });
7561
7704
 
7562
- // src/@modules/@utilities/utilities.setCronSchedule.ts
7563
- var import_fs6 = require("fs");
7705
+ // src/@modules/@utilities/SetCronSchedule.ts
7706
+ var import_fs5 = require("fs");
7564
7707
  var import_path4 = require("path");
7565
- var setCronSchedule = () => __async(null, null, function* () {
7708
+ var SetCronSchedule = () => __async(null, null, function* () {
7566
7709
  const settings = bootstrap.settings;
7567
7710
  const TTL = settings.GlobalSettings.ArchiveSettings.TTL;
7568
7711
  const TTLCUT = Date.now() - TTL * 1e3;
7569
7712
  const walk = (dir) => {
7570
- if ((0, import_fs6.existsSync)(dir)) {
7571
- const entries = (0, import_fs6.readdirSync)(dir, { withFileTypes: true });
7713
+ if ((0, import_fs5.existsSync)(dir)) {
7714
+ const entries = (0, import_fs5.readdirSync)(dir, { withFileTypes: true });
7572
7715
  for (const entry of entries) {
7573
7716
  const fullPath = (0, import_path4.join)(dir, entry.name);
7574
7717
  if (entry.isDirectory()) {
7575
7718
  walk(fullPath);
7576
7719
  continue;
7577
7720
  }
7578
- const stats = (0, import_fs6.statSync)(fullPath);
7721
+ const stats = (0, import_fs5.statSync)(fullPath);
7579
7722
  if (stats.mtime.getTime() < TTLCUT) {
7580
7723
  try {
7581
- (0, import_fs6.unlinkSync)(fullPath);
7724
+ (0, import_fs5.unlinkSync)(fullPath);
7582
7725
  } catch (err) {
7583
7726
  console.error(`Failed to delete ${fullPath}:`, err);
7584
7727
  }
@@ -7588,20 +7731,20 @@ var setCronSchedule = () => __async(null, null, function* () {
7588
7731
  };
7589
7732
  walk(settings.GlobalSettings.ArchiveSettings.TextDirectory);
7590
7733
  walk(settings.GlobalSettings.ArchiveSettings.EasDirectory);
7591
- walk(settings.GlobalSettings.ArchiveSettings.EventDirectory);
7734
+ walk(settings.GlobalSettings.ArchiveSettings.JSONDirectory);
7592
7735
  if (settings.EnableWireService) {
7593
7736
  if (settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.Enabled) {
7594
- void xReconnect(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
7737
+ void ReconnectXMPP(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
7595
7738
  }
7596
7739
  } else {
7597
- const response2 = yield createHttp({
7740
+ const response2 = yield CreateHttp({
7598
7741
  url: settings.NationalWeatherServiceSettings.EventsEndpoint,
7599
7742
  headers: {
7600
7743
  "User-Agent": "@atmosx/event-product-parser"
7601
7744
  }
7602
7745
  });
7603
7746
  if (response2.error) {
7604
- return setEventEmit({
7747
+ return SetEventEmit({
7605
7748
  event: `onServiceStatus`,
7606
7749
  metadata: {
7607
7750
  type: "fetch-api",
@@ -7611,7 +7754,7 @@ var setCronSchedule = () => __async(null, null, function* () {
7611
7754
  }
7612
7755
  });
7613
7756
  }
7614
- setEventEmit({
7757
+ SetEventEmit({
7615
7758
  event: `onServiceStatus`,
7616
7759
  metadata: {
7617
7760
  message: `Fetched latest events from National Weather Service API`,
@@ -7620,18 +7763,18 @@ var setCronSchedule = () => __async(null, null, function* () {
7620
7763
  error: false
7621
7764
  }
7622
7765
  });
7623
- createEvent({ message: response2.message, isNWWS: false });
7766
+ yield CreateEvent({ message: response2.message, isNWWS: false });
7624
7767
  }
7625
7768
  });
7626
7769
 
7627
- // src/@manager/manager.updateEvents.ts
7628
- var updateEvents = (selectedEvent) => __async(null, null, function* () {
7770
+ // src/@manager/UpdateEvents.ts
7771
+ var UpdateEvents = (selectedEvent) => __async(null, null, function* () {
7629
7772
  const events = bootstrap.cache.events.features;
7630
7773
  function update(event) {
7631
7774
  return __async(this, null, function* () {
7632
7775
  if (new Date(event.properties.expires) < /* @__PURE__ */ new Date()) {
7633
- setEventEmit({ event: `onExpiredProduct`, metadata: event });
7634
- yield rmEvent(event, true);
7776
+ SetEventEmit({ event: `onExpiredProduct`, metadata: event });
7777
+ yield RemoveEvent(event, true);
7635
7778
  }
7636
7779
  });
7637
7780
  }
@@ -7645,41 +7788,41 @@ var updateEvents = (selectedEvent) => __async(null, null, function* () {
7645
7788
  }
7646
7789
  });
7647
7790
 
7648
- // src/@core/core.start.ts
7791
+ // src/@core/StartService.ts
7649
7792
  var import_croner = require("croner");
7650
- var startService = (configurations) => __async(null, null, function* () {
7793
+ var StartService = (configurations) => __async(null, null, function* () {
7651
7794
  if (!bootstrap.isReady) {
7652
- return setWarning({
7795
+ return SetWarning({
7653
7796
  message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
7654
7797
  });
7655
7798
  }
7656
- const settings = setSettings(configurations);
7799
+ const settings = SetSettings(configurations);
7657
7800
  bootstrap.isReady = true;
7658
- yield initializeDatabase();
7801
+ yield InitializeDatabase();
7659
7802
  if (settings.EnableWireService) {
7660
7803
  (() => __async(null, null, function* () {
7661
- yield getCachedEvents();
7662
- yield xDeploy();
7804
+ yield GetCachedEvents();
7805
+ yield DeployXMPP();
7663
7806
  }))();
7664
7807
  }
7665
- yield setCronSchedule();
7808
+ yield SetCronSchedule();
7666
7809
  let scheduleInterval = !settings.EnableWireService ? settings.NationalWeatherServiceSettings.CallbackInterval : 1;
7667
7810
  if (!settings.EnableWireService && scheduleInterval < 15) {
7668
- setWarning({ message: `Schedule interval of ${scheduleInterval} seconds is too low, setting to 15 seconds` });
7811
+ SetWarning({ message: `Schedule interval of ${scheduleInterval} seconds is too low, setting to 15 seconds` });
7669
7812
  bootstrap.settings.NationalWeatherServiceSettings.CallbackInterval = 15;
7670
7813
  scheduleInterval = 15;
7671
7814
  }
7672
7815
  bootstrap.cron = new import_croner.Cron(`*/${scheduleInterval} * * * * *`, () => __async(null, null, function* () {
7673
- yield setCronSchedule();
7816
+ yield SetCronSchedule();
7674
7817
  }));
7675
7818
  bootstrap.cron = new import_croner.Cron(`* * * * * *`, () => __async(null, null, function* () {
7676
- yield updateNode();
7677
- yield updateEvents();
7819
+ yield UpdateNode();
7820
+ yield UpdateEvents();
7678
7821
  }));
7679
7822
  });
7680
7823
 
7681
- // src/@core/core.stop.ts
7682
- var stopService = () => __async(null, null, function* () {
7824
+ // src/@core/StopService.ts
7825
+ var StopService = () => __async(null, null, function* () {
7683
7826
  if (bootstrap.isReady) {
7684
7827
  bootstrap.isReady = false;
7685
7828
  if (bootstrap.session_xmpp) {
@@ -7694,15 +7837,15 @@ var stopService = () => __async(null, null, function* () {
7694
7837
  }
7695
7838
  });
7696
7839
 
7697
- // src/@core/core.setNode.ts
7698
- var setNode = (options) => {
7840
+ // src/@core/SetNode.ts
7841
+ var SetNode = (options) => {
7699
7842
  const nodes = bootstrap.cache.nodes.features;
7700
7843
  const exists = nodes.find((node) => node.properties.identifier === options.identifier);
7701
7844
  if (options.delete) {
7702
7845
  if (exists) {
7703
7846
  const index = nodes.indexOf(exists);
7704
7847
  nodes.splice(index, 1);
7705
- return setEventEmit({
7848
+ return SetEventEmit({
7706
7849
  event: `onNodeDelete`,
7707
7850
  metadata: {
7708
7851
  type: `node-delete`,
@@ -7710,7 +7853,7 @@ var setNode = (options) => {
7710
7853
  }
7711
7854
  });
7712
7855
  }
7713
- return setWarning({ message: `Node with identifier '${options.identifier}' not found.` });
7856
+ return SetWarning({ message: `Node with identifier '${options.identifier}' not found.` });
7714
7857
  }
7715
7858
  if (exists) {
7716
7859
  const index = nodes.indexOf(exists);
@@ -7720,7 +7863,7 @@ var setNode = (options) => {
7720
7863
  coordinates: [options.coordinates.longitude, options.coordinates.latitude]
7721
7864
  }
7722
7865
  });
7723
- return setEventEmit({
7866
+ return SetEventEmit({
7724
7867
  event: `onNodeUpdate`,
7725
7868
  metadata: {
7726
7869
  type: `node-update`,
@@ -7738,7 +7881,7 @@ var setNode = (options) => {
7738
7881
  identifier: options.identifier
7739
7882
  }
7740
7883
  });
7741
- return setEventEmit({
7884
+ return SetEventEmit({
7742
7885
  event: `onNodeAdd`,
7743
7886
  metadata: {
7744
7887
  type: `node-add`,
@@ -7747,34 +7890,53 @@ var setNode = (options) => {
7747
7890
  });
7748
7891
  };
7749
7892
 
7750
- // src/@core/core.getEvents.ts
7751
- var getEvents = () => {
7893
+ // src/@core/GetEvents.ts
7894
+ var GetEvents = () => {
7752
7895
  return bootstrap.cache.events;
7753
7896
  };
7754
7897
 
7755
- // src/@core/core.getNodes.ts
7756
- var getNodes = () => {
7898
+ // src/@core/GetNodes.ts
7899
+ var GetNodes = () => {
7757
7900
  return bootstrap.cache.nodes;
7758
7901
  };
7759
7902
 
7760
- // src/@core/core.manualEvent.ts
7761
- var manualEvent = (options) => __async(null, null, function* () {
7903
+ // src/@core/ManualEvent.ts
7904
+ var ManualEvent = (options) => __async(null, null, function* () {
7905
+ var _a;
7762
7906
  const isCapEvent = options.message.includes(`<?xml`);
7763
7907
  const isCapAreaDescription = options.message.includes(`<areaDesc>`);
7764
- const isVTEC = options.message.match(dict_expressions.pvtec) != null;
7765
- const isUGC = options.message.match(dict_expressions.ugc1) != null;
7766
- const getType = getAwipsType({ attributes: options.attributes });
7767
- const result = { message: options.message, attributes: options.attributes, isCapEvent, isVTEC, isUGC, isCapAreaDescription, isIgnored: false, isNWWS: true, getType };
7768
- yield createEvent(result);
7908
+ const isVTEC = options.message.match(EnumExpressions.pvtec) != null;
7909
+ const isUGC = options.message.match(EnumExpressions.ugc1) != null;
7910
+ const attributes = {
7911
+ "xmlns": "@atmosx/event-product-parser",
7912
+ "id": "manual_processor.0000",
7913
+ "issue": (/* @__PURE__ */ new Date()).toISOString(),
7914
+ "ttaaii": "XXXXX",
7915
+ "cccc": "XXX",
7916
+ "awipsid": (_a = options.awipsid) != null ? _a : "XXXXXX"
7917
+ };
7918
+ const getType = GetAwipsType({ attributes });
7919
+ const result = {
7920
+ message: options.message,
7921
+ attributes,
7922
+ isCapEvent,
7923
+ isVTEC,
7924
+ isUGC,
7925
+ isCapAreaDescription,
7926
+ isIgnored: false,
7927
+ isNWWS: true,
7928
+ getType
7929
+ };
7930
+ yield CreateEvent(result);
7769
7931
  });
7770
7932
 
7771
- // src/@core/core.getRandomEvent.ts
7772
- var getRandomEvent = () => {
7933
+ // src/@core/GetRandomEvent.ts
7934
+ var GetRandomEvent = () => {
7773
7935
  return bootstrap.cache.events.features[Math.floor(Math.random() * bootstrap.cache.events.features.length)];
7774
7936
  };
7775
7937
 
7776
- // src/@core/core.query.ts
7777
- var query = (options) => __async(null, null, function* () {
7938
+ // src/@core/QueryStanza.ts
7939
+ var QueryStanza = (options) => __async(null, null, function* () {
7778
7940
  var _a;
7779
7941
  const get = yield bootstrap.database.prepare(
7780
7942
  `SELECT * FROM stanzas WHERE stanza LIKE ? LIMIT ?`
@@ -7783,11 +7945,11 @@ var query = (options) => __async(null, null, function* () {
7783
7945
  return events;
7784
7946
  });
7785
7947
 
7786
- // src/@core/core.clearEvents.ts
7787
- var clearEvents = () => {
7948
+ // src/@core/ClearEvents.ts
7949
+ var ClearEvents = () => {
7788
7950
  bootstrap.cache.events.features = [];
7789
7951
  bootstrap.cache.hashes = [];
7790
- setEventEmit({
7952
+ SetEventEmit({
7791
7953
  event: `onEventCache`,
7792
7954
  metadata: bootstrap.cache.events,
7793
7955
  message: `Manually cleared event cache.`
@@ -7798,17 +7960,17 @@ var clearEvents = () => {
7798
7960
  var Manager = class {
7799
7961
  constructor(settings) {
7800
7962
  this.trycatch();
7801
- startService(settings);
7963
+ StartService(settings);
7802
7964
  }
7803
7965
  on(event, callback) {
7804
- createListener(event, callback);
7966
+ CreateListener(event, callback);
7805
7967
  }
7806
7968
  trycatch() {
7807
7969
  process.on("uncaughtException", (err) => {
7808
7970
  var _a, _b;
7809
7971
  const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND", "ECONNREFUSED", "EPIPE", "EADDRINUSE", "EALREADY", "EACCES", "EAGAIN", "EHOSTDOWN", "STARTTLS_FAILURE"];
7810
7972
  if (ignored.includes(err == null ? void 0 : err.code)) {
7811
- setEventEmit({
7973
+ SetEventEmit({
7812
7974
  event: `onServiceStatus`,
7813
7975
  metadata: {
7814
7976
  message: `Ignored Critical Error: ${(_a = err == null ? void 0 : err.code) != null ? _a : "Unknown error code"}. This may indicate a connection issue. Attempting to continue...`,
@@ -7819,25 +7981,25 @@ var Manager = class {
7819
7981
  });
7820
7982
  return;
7821
7983
  }
7822
- setWarning({ message: `Uncaught Exception: ${err instanceof Error ? (_b = err.stack) != null ? _b : err.message : String(err)}` });
7984
+ SetWarning({ message: `Uncaught Exception: ${err instanceof Error ? (_b = err.stack) != null ? _b : err.message : String(err)}` });
7823
7985
  });
7824
7986
  }
7825
7987
  };
7826
7988
  var index_default = Manager;
7827
7989
  // Annotate the CommonJS export names for ESM import in node:
7828
7990
  0 && (module.exports = {
7991
+ ClearEvents,
7992
+ GenerateEASMessage,
7993
+ GetCleanedEvent,
7994
+ GetEventGeometry,
7995
+ GetEvents,
7996
+ GetNodes,
7997
+ GetRandomEvent,
7829
7998
  Manager,
7830
- clearEvents,
7831
- getCleanedEvent,
7832
- getEventGeometry,
7833
- getEvents,
7834
- getNodes,
7835
- getRandomEvent,
7836
- manualEvent,
7837
- query,
7838
- setEasTone,
7839
- setNode,
7840
- setSettings,
7841
- startService,
7842
- stopService
7999
+ ManualEvent,
8000
+ QueryStanza,
8001
+ SetNode,
8002
+ SetSettings,
8003
+ StartService,
8004
+ StopService
7843
8005
  });