@atmosx/event-product-parser 3.0.54 → 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 +1475 -1294
  19. package/dist/esm/index.mjs +1456 -1275
  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 -66
  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/RemoveEvent.ts +70 -0
  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 -32
  74. package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +61 -53
  75. package/src/{@building/building.validate.ts → @manager/ValidateEvents.ts} +141 -152
  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 -62
  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.tags.ts +0 -93
  153. package/src/@manager/manager.mkEvent.ts +0 -98
  154. package/src/@manager/manager.rmEvent.ts +0 -59
  155. package/src/@manager/manager.updateListener.ts +0 -177
  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.54`,
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) {
@@ -1378,6 +1382,7 @@ var setTimeoutAction = (options) => {
1378
1382
  }
1379
1383
  if (options == null ? void 0 : options.expire) {
1380
1384
  delete bootstrap.ratelimits[options == null ? void 0 : options.identifier];
1385
+ return { limited: false };
1381
1386
  }
1382
1387
  if ((target == null ? void 0 : target.length) > 0) {
1383
1388
  bootstrap.ratelimits[options == null ? void 0 : options.identifier] = target.filter((ts) => Date.now() - ts < (options == null ? void 0 : options.interval) * 1e3);
@@ -1397,8 +1402,8 @@ var setTimeoutAction = (options) => {
1397
1402
  return { limited: false };
1398
1403
  };
1399
1404
 
1400
- // src/@modules/@utilities/utilities.setWarning.ts
1401
- var setWarning = (options) => {
1405
+ // src/@modules/@utilities/SetWarning.ts
1406
+ var SetWarning = (options) => {
1402
1407
  var _a, _b;
1403
1408
  const settings = bootstrap.settings;
1404
1409
  bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
@@ -1407,10 +1412,10 @@ var setWarning = (options) => {
1407
1412
  }
1408
1413
  };
1409
1414
 
1410
- // src/@modules/@utilities/utilities.setEventEmit.ts
1411
- var setEventEmit = (options) => {
1415
+ // src/@modules/@utilities/SetEventEmit.ts
1416
+ var SetEventEmit = (options) => {
1412
1417
  if (options.limited) {
1413
- 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 });
1414
1419
  if (isTimeout.limited) return;
1415
1420
  }
1416
1421
  bootstrap.listener.emit(options.event, options.metadata);
@@ -1418,21 +1423,21 @@ var setEventEmit = (options) => {
1418
1423
  bootstrap.listener.emit(`*`, { event: options.event, data: options.metadata });
1419
1424
  }
1420
1425
  if (options.message) {
1421
- setWarning({ message: options.message });
1426
+ SetWarning({ message: options.message });
1422
1427
  }
1423
1428
  };
1424
1429
 
1425
- // src/@modules/@utilities/utilities.setListener.ts
1426
- var setListener = (options) => {
1430
+ // src/@modules/@utilities/SetListener.ts
1431
+ var SetListener = (options) => {
1427
1432
  bootstrap.listener.on(options.event, options.callback);
1428
1433
  return () => {
1429
1434
  void bootstrap.listener.off(options.event, options.callback);
1430
1435
  };
1431
1436
  };
1432
1437
 
1433
- // src/@core/core.createListener.ts
1434
- var createListener = (event, callback) => {
1435
- setListener({ event, callback });
1438
+ // src/@core/CreateListener.ts
1439
+ var CreateListener = (event, callback) => {
1440
+ SetListener({ event, callback });
1436
1441
  };
1437
1442
 
1438
1443
  // node_modules/@xmpp/xml/index.js
@@ -1821,20 +1826,20 @@ var jid_default = j;
1821
1826
 
1822
1827
  // node_modules/@xmpp/error/index.js
1823
1828
  var XMPPError = class extends Error {
1824
- constructor(condition, text2, application) {
1825
- super(condition + (text2 ? ` - ${text2}` : ""));
1829
+ constructor(condition, text, application) {
1830
+ super(condition + (text ? ` - ${text}` : ""));
1826
1831
  this.name = "XMPPError";
1827
1832
  this.condition = condition;
1828
- this.text = text2;
1833
+ this.text = text;
1829
1834
  this.application = application;
1830
1835
  }
1831
1836
  static fromElement(element) {
1832
1837
  const [condition, second, third] = element.getChildElements();
1833
- let text2;
1838
+ let text;
1834
1839
  let application;
1835
1840
  if (second) {
1836
1841
  if (second.is("text")) {
1837
- text2 = second;
1842
+ text = second;
1838
1843
  } else if (second) {
1839
1844
  application = second;
1840
1845
  }
@@ -1842,7 +1847,7 @@ var XMPPError = class extends Error {
1842
1847
  }
1843
1848
  const error = new this(
1844
1849
  condition.name,
1845
- text2 ? text2.text() : "",
1850
+ text ? text.text() : "",
1846
1851
  application
1847
1852
  );
1848
1853
  error.element = element;
@@ -2760,8 +2765,8 @@ function id() {
2760
2765
 
2761
2766
  // node_modules/@xmpp/middleware/lib/StanzaError.js
2762
2767
  var StanzaError = class extends error_default {
2763
- constructor(condition, text2, application, type) {
2764
- super(condition, text2, application);
2768
+ constructor(condition, text, application, type) {
2769
+ super(condition, text, application);
2765
2770
  this.type = type;
2766
2771
  this.name = "StanzaError";
2767
2772
  }
@@ -4190,8 +4195,8 @@ function setupIfAvailable(module2, ...args) {
4190
4195
  return module2(...args);
4191
4196
  }
4192
4197
 
4193
- // src/@modules/@xmpp/xmpp.xOnline.ts
4194
- var xOnline = () => {
4198
+ // src/@modules/@xmpp/OnlineXMPP.ts
4199
+ var OnlineXMPP = () => {
4195
4200
  const settings = bootstrap.settings;
4196
4201
  bootstrap.session_xmpp.on(`online`, (address) => __async(null, null, function* () {
4197
4202
  bootstrap.cache.sigHault = false;
@@ -4202,7 +4207,7 @@ var xOnline = () => {
4202
4207
  to: `nwws@conference.nwws-oi.weather.gov/${nickname}`,
4203
4208
  xmlns: "http://jabber.org/protocol/muc"
4204
4209
  }));
4205
- setEventEmit({
4210
+ SetEventEmit({
4206
4211
  event: `onServiceStatus`,
4207
4212
  metadata: {
4208
4213
  message: `Succesfully connected to NOAA Weather Wire Service as "${nickname}"`,
@@ -4215,12 +4220,12 @@ var xOnline = () => {
4215
4220
  }));
4216
4221
  };
4217
4222
 
4218
- // src/@modules/@xmpp/xmpp.xOffline.ts
4219
- var xOffline = () => {
4223
+ // src/@modules/@xmpp/OfflineXMPP.ts
4224
+ var OfflineXMPP = () => {
4220
4225
  bootstrap.session_xmpp.on(`offline`, () => __async(null, null, function* () {
4221
4226
  bootstrap.cache.isConnected = false;
4222
4227
  bootstrap.cache.sigHault = true;
4223
- setEventEmit({
4228
+ SetEventEmit({
4224
4229
  event: `onServiceStatus`,
4225
4230
  metadata: {
4226
4231
  message: `Client has gone offline`,
@@ -4232,16 +4237,16 @@ var xOffline = () => {
4232
4237
  }));
4233
4238
  };
4234
4239
 
4235
- // src/@modules/@xmpp/xmpp.xError.ts
4236
- var xError = () => {
4240
+ // src/@modules/@xmpp/ErrorXMPP.ts
4241
+ var ErrorXMPP = () => {
4237
4242
  bootstrap.session_xmpp.on(`error`, (error) => __async(null, null, function* () {
4238
4243
  bootstrap.cache.isConnected = false;
4239
4244
  bootstrap.cache.sigHault = true;
4240
4245
  }));
4241
4246
  };
4242
4247
 
4243
- // src/@dictionaries/dictionaries.expressions.ts
4244
- var dict_expressions = {
4248
+ // src/@enums/Expressions.ts
4249
+ var EnumExpressions = {
4245
4250
  location: new RegExp(/^([A-Za-z.\-' ]+),\s*([A-Z]{2})$/),
4246
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"),
4247
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"),
@@ -4252,372 +4257,375 @@ var dict_expressions = {
4252
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")
4253
4258
  };
4254
4259
 
4255
- // src/@dictionaries/dictionaries.awips.ts
4256
- var dict_awips = {
4257
- ABV: `rawinsonde-data-above-100-millibars`,
4258
- ADA: `alarm-alert-administrative-message`,
4259
- ADM: `alert-administrative-message`,
4260
- ADR: `nws-administrative-message`,
4261
- ADV: `space-environment-advisory`,
4262
- AFD: `area-forecast-discussion`,
4263
- AFM: `area-forecast-matrices`,
4264
- AFP: `area-forecast-product`,
4265
- AFW: `fire-weather-matrix`,
4266
- AGF: `agricultural-forecast`,
4267
- AGO: `agricultural-observations`,
4268
- ALT: `space-environment-alert`,
4269
- AQA: `air-quality-alert`,
4270
- AQI: `air-quality-index-statement`,
4271
- ASA: `air-stagnation-advisory`,
4272
- AVA: `avalanche-watch`,
4273
- AVG: `avalanche-weather-guidance`,
4274
- AVW: `avalanche-warning`,
4275
- AWO: `area-weather-outlook`,
4276
- AWS: `area-weather-summary`,
4277
- AWU: `area-weather-update`,
4278
- AWW: `airport-weather-warning`,
4279
- BLU: `blue-alert`,
4280
- BOY: `buoy-report`,
4281
- BRG: `coast-guard-observations`,
4282
- BRT: `hourly-roundup-for-weather-radio`,
4283
- CAE: `child-abduction-emergency`,
4284
- CCF: `coded-city-forecast`,
4285
- CDW: `civil-danger-warning`,
4286
- CEM: `civil-emergency-message`,
4287
- CF6: `monthly-daily-climate-data`,
4288
- CFP: `convective-forecast-product`,
4289
- CFW: `coastal-flood-warnings-watches-statements`,
4290
- CGR: `coast-guard-surface-report`,
4291
- CHG: `computer-hurricane-guidance`,
4292
- CLA: `climatological-report-annual`,
4293
- CLI: `climatological-report-daily`,
4294
- CLM: `climatological-report-monthly`,
4295
- CLQ: `climatological-report-quarterly`,
4296
- CLS: `climatological-report-seasonal`,
4297
- CLT: `climate-report`,
4298
- CMM: `coded-climatological-monthly-means`,
4299
- COD: `coded-analysis-and-forecasts`,
4300
- CPF: `great-lakes-port-forecast`,
4301
- CUR: `space-environment-products-routine`,
4302
- CWA: `center-weather-advisory`,
4303
- CWF: `coastal-waters-forecast`,
4304
- CWS: `center-weather-statement`,
4305
- DAY: `space-environment-product-daily`,
4306
- DDO: `daily-dispersion-outlook`,
4307
- DGT: `drought-information-statement`,
4308
- DMO: `practice-demo-warning`,
4309
- DSA: `unnumbered-depression-advisory`,
4310
- DSM: `asos-daily-summary`,
4311
- DSW: `dust-storm-warning`,
4312
- EFP: `extended-forecast-3-to-5-day`,
4313
- EOL: `six-to-ten-day-weather-outlook-local`,
4314
- EQI: `tsunami-bulletin`,
4315
- EQR: `earthquake-report`,
4316
- EQW: `earthquake-warning`,
4317
- ESF: `flood-potential-outlook`,
4318
- ESG: `extended-streamflow-guidance`,
4319
- ESP: `extended-streamflow-prediction`,
4320
- ESS: `water-supply-outlook`,
4321
- EVI: `evacuation-immediate`,
4322
- EWW: `extreme-wind-warning`,
4323
- FA0: `aviation-area-forecast-pacific`,
4324
- FA1: `aviation-area-forecast-northeast`,
4325
- FA2: `aviation-area-forecast-southeast`,
4326
- FA3: `aviation-area-forecast-north-central`,
4327
- FA4: `aviation-area-forecast-south-central`,
4328
- FA5: `aviation-area-forecast-rocky-mountains`,
4329
- FA6: `aviation-area-forecast-west-coast`,
4330
- FA7: `aviation-area-forecast-juneau-ak`,
4331
- FA8: `aviation-area-forecast-anchorage-ak`,
4332
- FA9: `aviation-area-forecast-fairbanks-ak`,
4333
- FD0: `winds-aloft-forecast-24hr-high-altitude`,
4334
- FD1: `winds-aloft-forecast-6hr`,
4335
- FD2: `winds-aloft-forecast-12hr`,
4336
- FD3: `winds-aloft-forecast-24hr`,
4337
- FD4: `winds-aloft-forecast`,
4338
- FD5: `winds-aloft-forecast`,
4339
- FD6: `winds-aloft-forecast`,
4340
- FD7: `winds-aloft-forecast`,
4341
- FD8: `winds-aloft-forecast-6hr-high-altitude`,
4342
- FD9: `winds-aloft-forecast-12hr-high-altitude`,
4343
- FDI: `fire-danger-indices`,
4344
- FFA: `flash-flood-watch`,
4345
- FFG: `flash-flood-guidance`,
4346
- FFH: `headwater-guidance`,
4347
- FFS: `flash-flood-statement`,
4348
- FFW: `flash-flood-warning`,
4349
- FLN: `national-flood-summary`,
4350
- FLS: `flood-statement`,
4351
- FLW: `flood-warning`,
4352
- FOF: `upper-wind-fallout-forecast`,
4353
- FRW: `fire-warning`,
4354
- FSH: `marine-fisheries-service-message`,
4355
- FTM: `radar-outage-notification`,
4356
- FTP: `temp-pop-guidance`,
4357
- FWA: `fire-weather-administrative-message`,
4358
- FWD: `fire-weather-outlook-discussion`,
4359
- FWF: `fire-weather-forecast`,
4360
- FWL: `land-management-forecast`,
4361
- FWM: `miscellaneous-fire-weather-product`,
4362
- FWN: `fire-weather-notification`,
4363
- FWO: `fire-weather-observation`,
4364
- FWS: `fire-weather-spot-forecast`,
4365
- FZL: `freezing-level-data`,
4366
- GLF: `great-lakes-forecast`,
4367
- GLS: `great-lakes-storm-summary`,
4368
- GRE: `green`,
4369
- HD1: `rfc-qpf-data-product`,
4370
- HD2: `rfc-qpf-data-product`,
4371
- HD3: `rfc-qpf-data-product`,
4372
- HD4: `rfc-qpf-data-product`,
4373
- HD7: `rfc-qpf-data-product`,
4374
- HD8: `rfc-qpf-data-product`,
4375
- HD9: `rfc-qpf-data-product`,
4376
- HLS: `hurricane-local-statement`,
4377
- HMD: `hydrometeorological-discussion`,
4378
- HML: `ahps-xml-product`,
4379
- HMW: `hazardous-materials-warning`,
4380
- HP1: `rfc-qpf-verification-product`,
4381
- HP2: `rfc-qpf-verification-product`,
4382
- HP3: `rfc-qpf-verification-product`,
4383
- HP4: `rfc-qpf-verification-product`,
4384
- HP5: `rfc-qpf-verification-product`,
4385
- HP6: `rfc-qpf-verification-product`,
4386
- HP7: `rfc-qpf-verification-product`,
4387
- HP8: `rfc-qpf-verification-product`,
4388
- HRR: `weather-roundup`,
4389
- HSF: `high-seas-forecast`,
4390
- HWO: `hazardous-weather-outlook`,
4391
- HWR: `hourly-weather-roundup`,
4392
- HYD: `daily-hydrometeorological-products`,
4393
- HYM: `monthly-hydrometeorological-product`,
4394
- ICE: `ice-forecast`,
4395
- IDM: `ice-drift-vectors`,
4396
- INI: `administrative-message`,
4397
- IOB: `ice-observation`,
4398
- KPA: `keep-alive-message`,
4399
- LAE: `local-area-emergency`,
4400
- LCD: `preliminary-local-climatological-data`,
4401
- LCO: `local-cooperative-observation`,
4402
- LEW: `law-enforcement-warning`,
4403
- LFP: `local-forecast`,
4404
- LKE: `lake-stages`,
4405
- LLS: `low-level-sounding`,
4406
- LOW: `low-temperatures`,
4407
- LSR: `local-storm-report`,
4408
- LTG: `lightning-data`,
4409
- MAN: `rawinsonde-mandatory-levels`,
4410
- MAP: `mean-areal-precipitation`,
4411
- MAW: `amended-marine-forecast`,
4412
- MFM: `marine-forecast-matrix`,
4413
- MIM: `marine-interpretation-message`,
4414
- MIS: `miscellaneous-local-product`,
4415
- MOB: `marine-observations`,
4416
- MON: `space-environment-product-monthly`,
4417
- MRP: `marine-product-techniques-development`,
4418
- MSM: `asos-monthly-summary-message`,
4419
- MTR: `metar-observation`,
4420
- MTT: `metar-test-message`,
4421
- MVF: `marine-verification-coded-message`,
4422
- MWS: `marine-weather-statement`,
4423
- MWW: `marine-weather-message`,
4424
- NOU: `weather-reconnaissance-flights`,
4425
- NOW: `short-term-forecast`,
4426
- NOX: `data-management-message`,
4427
- NPW: `non-precipitation-warning`,
4428
- NSH: `nearshore-marine-forecast`,
4429
- NUW: `nuclear-power-plant-warning`,
4430
- NWR: `noaa-weather-radio-forecast`,
4431
- OAV: `other-aviation-products`,
4432
- OBS: `observations`,
4433
- OFA: `offshore-aviation-forecast`,
4434
- OFF: `offshore-forecast`,
4435
- OMR: `other-marine-products`,
4436
- OPU: `other-public-products`,
4437
- OSO: `other-surface-observations`,
4438
- OSW: `ocean-surface-winds`,
4439
- OUA: `other-upper-air-data`,
4440
- OZF: `zone-forecast`,
4441
- PFM: `point-forecast-matrices`,
4442
- PFW: `fire-weather-point-forecast-matrices`,
4443
- PLS: `plain-language-ship-report`,
4444
- PMD: `prognostic-meteorological-discussion`,
4445
- PNS: `public-information-statement`,
4446
- POE: `probability-of-exceedance`,
4447
- PRB: `heat-index-forecast-tables`,
4448
- PRC: `pilot-report-collective`,
4449
- PRE: `preliminary-forecasts`,
4450
- PSH: `post-storm-hurricane-report`,
4451
- PTS: `probabilistic-outlook-points`,
4452
- PWO: `public-severe-weather-outlook`,
4453
- PWS: `tropical-cyclone-probabilities`,
4454
- QPF: `quantitative-precipitation-forecast`,
4455
- QPS: `quantitative-precipitation-statement`,
4456
- RDF: `revised-digital-forecast`,
4457
- REC: `recreational-report`,
4458
- RER: `record-report`,
4459
- RET: `eas-activation-request`,
4460
- RFD: `rangeland-fire-danger-forecast`,
4461
- RFI: `rfi-observation`,
4462
- RFR: `route-forecast`,
4463
- RFW: `red-flag-warning`,
4464
- RHW: `radiological-hazard-warning`,
4465
- RMT: `required-monthly-test`,
4466
- RNS: `rain-information-statement`,
4467
- RR1: `hydro-met-data-report-part-1`,
4468
- RR2: `hydro-met-data-report-part-2`,
4469
- RR3: `hydro-met-data-report-part-3`,
4470
- RR4: `hydro-met-data-report-part-4`,
4471
- RR5: `hydro-met-data-report-part-5`,
4472
- RR6: `hydro-met-data-report-part-6`,
4473
- RR7: `hydro-met-data-report-part-7`,
4474
- RR8: `hydro-met-data-report-part-8`,
4475
- RR9: `hydro-met-data-report-part-9`,
4476
- RRA: `automated-hydrologic-observation-report`,
4477
- RRM: `miscellaneous-hydrologic-data`,
4478
- RRS: `hads-data`,
4479
- RRY: `asos-hourly-test-message`,
4480
- RSD: `daily-snotel-data`,
4481
- RSM: `monthly-snotel-data`,
4482
- RTP: `regional-temp-precip-table`,
4483
- RVA: `river-summary`,
4484
- RVD: `daily-river-forecast`,
4485
- RVF: `river-forecast`,
4486
- RVI: `river-ice-statement`,
4487
- RVM: `miscellaneous-river-product`,
4488
- RVR: `river-recreation-statement`,
4489
- RVS: `river-statement`,
4490
- RWR: `regional-weather-roundup`,
4491
- RWS: `regional-weather-summary`,
4492
- RWT: `required-weekly-test`,
4493
- SAB: `special-avalanche-bulletin`,
4494
- SAF: `agricultural-weather-forecast`,
4495
- SAG: `snow-avalanche-guidance`,
4496
- SAT: `apt-prediction`,
4497
- SAW: `preliminary-notice-of-watch`,
4498
- SCC: `storm-summary`,
4499
- SCD: `supplementary-climatological-data`,
4500
- SCN: `soil-climate-analysis-network`,
4501
- SCP: `satellite-cloud-product`,
4502
- SCS: `selected-cities-summary`,
4503
- SDO: `supplementary-data-observation`,
4504
- SDS: `special-dispersion-statement`,
4505
- SEL: `severe-local-storm-watch`,
4506
- SEV: `spc-watch-point-information`,
4507
- SFP: `state-forecast`,
4508
- SFT: `tabular-state-forecast`,
4509
- SGL: `rawinsonde-significant-levels`,
4510
- SHP: `surface-ship-report`,
4511
- SIG: `international-sigmet`,
4512
- SIM: `satellite-interpretation-message`,
4513
- SLS: `severe-local-storm-outline`,
4514
- SMF: `smoke-management-weather-forecast`,
4515
- SMW: `special-marine-warning`,
4516
- SOO: `science-operations-officer-product`,
4517
- SPE: `satellite-precipitation-estimates`,
4518
- SPF: `storm-strike-probability-bulletin`,
4519
- SPS: `special-weather-statement`,
4520
- SPW: `shelter-in-place-warning`,
4521
- SQW: `snow-squall-warning`,
4522
- SRD: `surf-discussion`,
4523
- SRF: `surf-forecast`,
4524
- SRG: `soaring-guidance`,
4525
- SSM: `synoptic-surface-observation`,
4526
- STA: `weather-statistical-summary`,
4527
- STD: `satellite-tropical-disturbance-summary`,
4528
- STO: `road-condition-report`,
4529
- STP: `state-temp-precip-table`,
4530
- STQ: `spot-forecast-request`,
4531
- SUM: `space-weather-message`,
4532
- SVR: `severe-thunderstorm-warning`,
4533
- SVS: `severe-weather-statement`,
4534
- SWOMCD: `mesoscale-discussion`,
4535
- SWODY1: `storm-prediction-center-day-1-outlook`,
4536
- SWODY2: `storm-prediction-center-day-2-outlook`,
4537
- SWODY3: `storm-prediction-center-day-3-outlook`,
4538
- SWS: `state-weather-summary`,
4539
- SYN: `regional-weather-synopsis`,
4540
- TAF: `terminal-aerodrome-forecast`,
4541
- TAP: `terminal-alerting-products`,
4542
- TAV: `travelers-forecast-table`,
4543
- TCA: `tropical-cyclone-advisory`,
4544
- TCD: `tropical-cyclone-discussion`,
4545
- TCE: `tropical-cyclone-position-estimate`,
4546
- TCM: `tropical-cyclone-marine-aviation-advisory`,
4547
- TCP: `public-tropical-cyclone-advisory`,
4548
- TCS: `satellite-tropical-cyclone-summary`,
4549
- TCU: `tropical-cyclone-update`,
4550
- TCV: `tropical-cyclone-break-points`,
4551
- TIB: `tsunami-bulletin`,
4552
- TID: `tide-report`,
4553
- TMA: `tsunami-tide-seismic-acknowledgement`,
4554
- TOE: `telephone-outage-emergency`,
4555
- TOR: `tornado-warning`,
4556
- TPT: `temperature-precipitation-table`,
4557
- TSU: `tsunami-information-statement`,
4558
- TUV: `ultraviolet-index`,
4559
- TVL: `travelers-forecast`,
4560
- TWB: `transcribed-weather-broadcast`,
4561
- TWD: `tropical-weather-discussion`,
4562
- TWO: `tropical-weather-outlook`,
4563
- TWS: `tropical-weather-summary`,
4564
- URN: `aircraft-reconnaissance`,
4565
- UVI: `ultraviolet-index`,
4566
- VAA: `volcanic-activity-advisory`,
4567
- VER: `forecast-verification-statistics`,
4568
- VFT: `taf-verification-product`,
4569
- VOW: `volcano-warning`,
4570
- WA0: `airmet-pacific`,
4571
- WA1: `airmet-northeast`,
4572
- WA2: `airmet-southeast`,
4573
- WA3: `airmet-north-central`,
4574
- WA4: `airmet-south-central`,
4575
- WA5: `airmet-rocky-mountains`,
4576
- WA6: `airmet-west-coast`,
4577
- WA7: `airmet-juneau-ak`,
4578
- WA8: `airmet-anchorage-ak`,
4579
- WA9: `airmet-fairbanks-ak`,
4580
- WAR: `space-environment-warning`,
4581
- WAT: `space-environment-watch`,
4582
- WCN: `weather-watch-clearance-notification`,
4583
- WCR: `weekly-weather-and-crop-report`,
4584
- WDA: `weekly-data-for-agriculture`,
4585
- WDU: `warning-decision-update`,
4586
- WEK: `space-environment-product-weekly`,
4587
- WOU: `watch-outline-update`,
4588
- WS1: `sigmet-northeast`,
4589
- WS2: `sigmet-southeast`,
4590
- WS3: `sigmet-north-central`,
4591
- WS4: `sigmet-south-central`,
4592
- WS5: `sigmet-rocky-mountains`,
4593
- WS6: `sigmet-west-coast`,
4594
- WST: `tropical-cyclone-sigmet`,
4595
- WSV: `volcanic-activity-sigmet`,
4596
- WSW: `winter-weather-warning`,
4597
- WWA: `watch-status-report`,
4598
- WWP: `watch-probabilities`,
4599
- 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`
4600
4607
  };
4601
4608
 
4602
- // src/@modules/@stanza/stanza.getAwipsType.ts
4603
- var getAwipsType = (options) => {
4609
+ // src/@modules/@stanza/GetAwipsType.ts
4610
+ var GetAwipsType = (options) => {
4604
4611
  const attributes = options.attributes;
4605
4612
  if (!attributes.awipsid) {
4606
4613
  return {
4607
4614
  type: null,
4608
- prefix: null
4615
+ prefix: null,
4616
+ discovered: false
4609
4617
  };
4610
4618
  }
4611
- for (const [prefix, type] of Object.entries(dict_awips)) {
4619
+ for (const [prefix, type] of Object.entries(EnumAWIPS)) {
4612
4620
  if (attributes.awipsid.startsWith(prefix)) {
4613
- return { type, prefix };
4621
+ return { type, prefix, discovered: true };
4614
4622
  }
4615
4623
  }
4616
- return { type: null, prefix: null };
4624
+ return { type: options.attributes.awipsid, prefix: options.attributes.awipsid, discovered: false };
4617
4625
  };
4618
4626
 
4619
- // src/@modules/@stanza/stanza.validate.ts
4620
- var validate = (options) => {
4627
+ // src/@modules/@stanza/ValidateStanza.ts
4628
+ var ValidateStanza = (options) => {
4621
4629
  if (options.stanza.is(`message`)) {
4622
4630
  const cb = options.stanza.getChild(`x`);
4623
4631
  if (cb && cb.children) {
@@ -4626,9 +4634,9 @@ var validate = (options) => {
4626
4634
  if (attributes.awipsid && attributes.awipsid.length > 1) {
4627
4635
  const isCapEvent = message.includes(`<?xml`);
4628
4636
  const isCapAreaDescription = message.includes(`<areaDesc>`);
4629
- const isVTEC = message.match(dict_expressions.pvtec) != null;
4630
- const isUGC = message.match(dict_expressions.ugc1) != null;
4631
- 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 });
4632
4640
  if (getType.type != null) {
4633
4641
  return {
4634
4642
  message,
@@ -4648,8 +4656,8 @@ var validate = (options) => {
4648
4656
  return { isIgnored: true };
4649
4657
  };
4650
4658
 
4651
- // src/@dictionaries/dictionaries.matches.ts
4652
- var dict_matches = {
4659
+ // src/@enums/Matches.ts
4660
+ var EnumMatches = {
4653
4661
  SPS: [
4654
4662
  { match: /STRONG THUNDERSTORM/i, label: "Convective Special Weather Statement", statement: false },
4655
4663
  { match: /SPECIAL WEATHER STATEMENT/i, label: "Special Weather Statement", statement: false }
@@ -4685,15 +4693,20 @@ var dict_matches = {
4685
4693
  ]
4686
4694
  };
4687
4695
 
4688
- // src/@parsers/@text/text.getDescriptionFromProduct.ts
4689
- var getDescriptionFromProduct = (options) => {
4696
+ // src/@parsers/@text/GetDescriptionFromProduct.ts
4697
+ var GetDescriptionFromProduct = (options) => {
4690
4698
  let message = options.message;
4691
- 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));
4692
4705
  if (dates.length) {
4693
4706
  const lastMatch = dates[dates.length - 1][0];
4694
4707
  const sIndx = message.lastIndexOf(lastMatch);
4695
4708
  if (sIndx !== -1) {
4696
- const endIndx = message.indexOf("&&", sIndx);
4709
+ const endIndx = getEndIndex(message, sIndx);
4697
4710
  message = message.substring(sIndx + lastMatch.length, endIndx !== -1 ? endIndx : void 0).trimStart();
4698
4711
  if (message.startsWith("/")) message = message.slice(1).trimStart();
4699
4712
  if (options.handle && message.includes(options.handle)) {
@@ -4707,22 +4720,22 @@ var getDescriptionFromProduct = (options) => {
4707
4720
  if (handleIndx !== -1) {
4708
4721
  let afterHandle = message.substring(handleIndx + options.handle.length).trimStart();
4709
4722
  if (afterHandle.startsWith("/")) afterHandle = afterHandle.slice(1).trimStart();
4710
- const latEnd = afterHandle.indexOf("&&");
4723
+ const latEnd = getEndIndex(afterHandle);
4711
4724
  message = latEnd !== -1 ? afterHandle.substring(0, latEnd).trim() : afterHandle.trim();
4712
4725
  }
4713
4726
  }
4714
4727
  return message.trim();
4715
4728
  };
4716
4729
 
4717
- // src/@parsers/@text/text.getPolygonFromProduct.ts
4730
+ // src/@parsers/@text/GetPolygonFromProduct.ts
4718
4731
  var getPolygonFromProduct = (message) => {
4719
4732
  const coordinates = [];
4720
4733
  const match = message.match(
4721
4734
  /LAT\.\.\.LON\s+([\s\S]*?)(?=\n[A-Z]{2,}(?:\.\.\.|:)|\$\$|&&|$)/i
4722
4735
  );
4723
4736
  if (!match) return coordinates;
4724
- const text2 = match[1];
4725
- const values = text2.match(/\d{4,8}/g);
4737
+ const text = match[1];
4738
+ const values = text.match(/\d{4,8}/g);
4726
4739
  if (!values) return coordinates;
4727
4740
  if (values.every((v) => v.length === 8)) {
4728
4741
  for (const value of values) {
@@ -4747,8 +4760,8 @@ var getPolygonFromProduct = (message) => {
4747
4760
  return coordinates;
4748
4761
  };
4749
4762
 
4750
- // src/@parsers/@text/text.getTextFromProduct.ts
4751
- var getTextFromProduct = (options) => {
4763
+ // src/@parsers/@text/GetTextFromProduct.ts
4764
+ var GetTextFromProduct = (options) => {
4752
4765
  var _a;
4753
4766
  const lines = options.message.split(`
4754
4767
  `);
@@ -4768,8 +4781,8 @@ var getTextFromProduct = (options) => {
4768
4781
  return null;
4769
4782
  };
4770
4783
 
4771
- // src/@dictionaries/dictionaries.icao.ts
4772
- var dict_icao = {
4784
+ // src/@enums/ICAO.ts
4785
+ var EnumICAO = {
4773
4786
  "KLUB": "Lubbock, TX",
4774
4787
  "KLCH": "Lake Charles, LA",
4775
4788
  "TSTL": "St. Louis, MO",
@@ -5010,180 +5023,251 @@ var dict_icao = {
5010
5023
  "PAJK": "Juneau, AK"
5011
5024
  };
5012
5025
 
5013
- // src/@building/building.office.ts
5014
- var getEventOffice = (options) => {
5026
+ // src/@building/GetEventOffice.ts
5027
+ var GetEventOffice = (options) => {
5015
5028
  var _a, _b, _c, _d, _e, _f, _g;
5016
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;
5017
- 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;
5018
5031
  return { office, name };
5019
5032
  };
5020
5033
 
5021
- // src/@dictionaries/dictionaries.tags.ts
5022
- var dict_tags = {
5023
- "FROSTBITE AND HYPOTHERMIA ARE LIKELY": "Frostbite and Hypothermia Likely",
5024
- "LICKELY BECOME SLICK AND HAZARDOUS": "Slick and Hazardous Roads",
5025
- "SLIPPERY ROAD CONDITIONS": "Slippery Roads",
5026
- "BLOWING SNOW WHICH COULD REDUCE VISIBILITY": "Blowing Snow Reducing Visibility",
5027
- "TRAVEL COULD BE VERY DIFFICULT": "Difficult Travel Conditions",
5028
- "DIFFICULT TRAVEL CONDITIONS": "Difficult Travel Conditions",
5029
- "EXPECT DISRUPTIONS": "Expect Disruptions to Travel",
5030
- "A LARGE AND EXTREMELY DANGEROUS TORNADO": "Large and Dangerous Tornado",
5031
- "THIS IS A PARTICULARLY DANGEROUS SITUATION": "Particularly Dangerous Situation",
5032
- "RADAR INDICATED ROTATION": "Radar Indicated Tornado",
5033
- "WEATHER SPOTTERS CONFIRMED TORNADO": "Confirmed by Storm Spotters",
5034
- "A SEVERE THUNDERSTORM CAPABLE OF PRODUCING A TORNADO": "Developing Tornado",
5035
- "LAW ENFORCEMENT CONFIRMED TORNADO": "Reported by Law Enforcement",
5036
- "A TORNADO IS ON THE GROUND": "Confirmed Tornado",
5037
- "WEATHER SPOTTERS REPORTED FUNNEL CLOUD": "Confirmed Funnel Cloud by Storm Spotters",
5038
- "PUBLIC CONFIRMED TORNADO": "Public reports of Tornado",
5039
- "RADAR CONFIRMED": "Radar Confirmed",
5040
- "TORNADO WAS REPORTED BRIEFLY ON THE GROUND": "Tornado no longer on ground",
5041
- "SPOTTERS INDICATE THAT A FUNNEL CLOUD CONTINUES WITH THIS STORM": "Funnel Cloud Continues",
5042
- "A TORNADO MAY DEVELOP AT ANY TIME": "Potentional still exists for Tornado to form",
5043
- "LIFE-THREATENING SITUATION": "Life Threating Situation",
5044
- "COMPLETE DESTRUCTION IS POSSIBLE": "Extremly Damaging Tornado",
5045
- "POTENTIALLY DEADLY TORNADO": "Deadly Tornado",
5046
- "RADAR INDICATED": "Radar Indicated",
5047
- "HAIL DAMAGE TO VEHICLES IS EXPECTED": "Damaging to Vehicles",
5048
- "EXPECT WIND DAMAGE": "Wind Damage",
5049
- "FREQUENT LIGHTNING": "Frequent Lightning",
5050
- "PEOPLE AND ANIMALS OUTDOORS WILL BE INJURED": "Capable of Injuring People and Animals",
5051
- "TRAINED WEATHER SPOTTERS": "Confirmed by Storm Spotters",
5052
- "SOURCE...PUBLIC": "Confirmed by Public",
5053
- "SMALL CRAFT COULD BE DAMAGED": "Potential Damage to Small Craft",
5054
- "A TORNADO WATCH REMAINS IN EFFECT": "Active Tornado Watch",
5055
- "TENNIS BALL SIZE HAIL": "Tennis Ball Size Hail",
5056
- "BASEBALL SIZE HAIL": "Baseball Size Hail",
5057
- "GOLF BALL SIZE HAIL": "Golf Ball Size Hail",
5058
- "QUARTER SIZE HAIL": "Quarter Size Hail",
5059
- "PING PONG BALL SIZE HAIL": "Ping Pong Ball Size Hail",
5060
- "NICKEL SIZE HAIL": "Nickel Size Hail",
5061
- "DOPPLER RADAR.": "Confirmed by Radar",
5062
- "DOPPLER RADAR AND AUTOMATED GAUGES.": "Confirmed by Radar and Gauges",
5063
- "FLASH FLOODING CAUSED BY THUNDERSTORMS.": "Caused by Thunderstorm",
5064
- "SOURCE...EMERGENCY MANAGEMENT.": "Confirmed by Emergency Management",
5065
- "FLASH FLOODING CAUSED BY HEAVY RAIN.": "Caused by heavy rain",
5066
- "SOURCE...LAW ENFORCEMENT REPORTED.": "Confirmed by Law Enforcement",
5067
- "MINOR FLOODING IS OCCURING": "Minor Flooding Occurring",
5068
- "VERY COLD TEMPERATURES CAN LEAD TO HYPOTHERMIA": "Hypothermia Risk",
5069
- "SENSITIVE VEGETATION AND POSSIBLY DAMAGE UNPROTECTED OUTDOOR": "Vegetation and Outdoor Plumbing Risk",
5070
- "RIP CURRENTS CAN SWEEP EVEN THE BEST SWIMMER": "Hazardous to All Swimmers",
5071
- "HYPOTHERMIA IF PRECAUTIONS ARE NOT TAKEN.": "Hypothermia Risk",
5072
- "FROSTBITE AND HYPOTHERMIA WILL OCCUR IF UNPROTECTED SKIN": "Frostbite and Hypothermia Risk on Unprotected Skin",
5073
- "TEMPERATURES COULD CAUSE RUPTURED WATER PIPES": "Risk of Ruptured Water Pipes",
5074
- "COULD RESULT IN HYPOTHERMIA OR FROSTBITE ON EXPOSED SKIN IF": "Hypothermia or Frostbite Risk on Exposed Skin",
5075
- "WINDS WILL STRENGTHEN": "Strengthening Winds",
5076
- "EXPECT ROADS TO RE-FREEZE": "Roads May Re-Freeze",
5077
- "SLICK AND ICY SPOTS ON ROADS": "Slick and Icy Roads",
5078
- "ICY PATCHES MAY BE MORE COMMON ON BRIDGES": "Icy Patches Likely on Bridges",
5079
- "SLICK SPOTS ON UNTREATED ROADS": "Slick Spots on Untreated Roads",
5080
- "TEMPERATURES ARE EXPECTED TO FALL BELOW FREEZING": "Temperatures Expected Below Freezing",
5081
- "HAZARDOUS ROADWAYS AND BLACK ICE": "Hazardous Roadways and Black Ice",
5082
- "SLOW DOWN AND ALLOW EXTRA TIME": "Slow Down and Allow Extra Time",
5083
- "SHOULD EXERCISE CAUTION": "Should Exercise Caution",
5084
- "LAKE EFFECT SNOW EXPECTED": "Lake Effect Snow Expected",
5085
- "MODERATE LAKE EFFECT SNOWFALL RATES AND BLOWING SNOW": "Moderate Lake Effect Snowfall and Blowing Snow",
5086
- "NO TSUNAMI THREAT": "No Active Tsunami Threat",
5087
- "NO SIGNIFICANT TSUNAMI THREAT": "No Significant Tsunami Threat",
5088
- "NO TSUNAMI IMPACTS ARE EXPECTED": "No Tsunami Impacts Expected",
5089
- "A TSUNAMI THREAT EXISTS": "Tsunami Threat Exists",
5090
- "TSUNAMI THREAT": "Active Tsunami Threat",
5091
- "HEAT ILLNESSES": "Can cause heat illness",
5092
- "WATCH POSSIBLE": "Watch Possible",
5093
- "INTENSIFYING": "Intensifying",
5094
- "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
+ ]
5095
5176
  };
5096
5177
 
5097
- // src/@building/building.tags.ts
5098
- var getEventTags = (message) => {
5099
- 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
+ )];
5100
5184
  };
5101
5185
 
5102
- // src/@building/building.properties.ts
5103
- var properties = (options) => {
5186
+ // src/@building/GetEventProperties.ts
5187
+ var GetEventProperties = (options) => {
5104
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;
5105
- 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;
5106
5190
  const polygons = getPolygonFromProduct(options.message);
5107
- const properties2 = {
5191
+ const properties = {
5108
5192
  locations: (_e = (_d = (_c = options == null ? void 0 : options.ugc) == null ? void 0 : _c.locations) == null ? void 0 : _d.join(`; `)) != null ? _e : null,
5109
5193
  locations_array: (_g = (_f = options == null ? void 0 : options.ugc) == null ? void 0 : _f.locations) != null ? _g : [],
5110
- 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 }),
5111
5195
  attributes: options.attributes,
5112
5196
  geocode: {
5113
- office: getEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
5197
+ office: GetEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
5114
5198
  organization,
5115
5199
  ugc: (_k = (_j = options == null ? void 0 : options.ugc) == null ? void 0 : _j.zones) != null ? _k : [],
5116
5200
  polygon: polygons.length > 0 ? Buffer.from(JSON.stringify([polygons])).toString("base64") : null,
5117
5201
  polygon_generated: polygons.length > 0 ? true : false
5118
5202
  },
5119
5203
  parameters: {
5120
- tags: getEventTags(options.message),
5121
- instructions: (_l = getTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`] })) != null ? _l : null,
5122
- source: (_m = getTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`] })) != null ? _m : null,
5123
- hazards: (_n = getTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`] })) != null ? _n : null,
5124
- impacts: (_o = getTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`] })) != null ? _o : null,
5125
- estimated_hail_size: (_p = getTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ["in"] })) != null ? _p : null,
5126
- estimated_wind_gusts: (_q = getTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`] })) != null ? _q : null,
5127
- damage_threat: (_r = getTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: [] })) != null ? _r : null,
5128
- tornado_threat: (_s = getTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] })) != null ? _s : null,
5129
- flood_threat: (_t = getTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`] })) != null ? _t : null,
5130
- wind_threat: (_u = getTextFromProduct({ message: options.message, find: [`WIND THREAT...`] })) != null ? _u : null,
5131
- 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
5132
5216
  },
5133
5217
  discussion_parameters: {
5134
- 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,
5135
- discussion_concerning: (_z = getTextFromProduct({ message: options.message, find: [`Concerning...`] })) != null ? _z : null,
5136
- discussion_max_tornado: (_A = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _A : null,
5137
- discussion_max_hail: (_B = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _B : null,
5138
- discussion_max_wind: (_C = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _C : null,
5139
- 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
5140
5224
  },
5141
5225
  watch_parameters: {
5142
- 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,
5143
5227
  watch_type: options.message.includes(`TORNADO WATCH`) ? `Tornado` : (options == null ? void 0 : options.message.includes(`SEVERE`)) ? `Severe` : null,
5144
- additional_tornadoes_probability: (_P = getTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _P : null,
5145
- strong_tornadoes_probability: (_Q = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Q : null,
5146
- severe_wind_probability: (_R = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _R : null,
5147
- severe_hail_probability: (_S = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _S : null,
5148
- hail_2in_probability: (_T = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _T : null,
5149
- combined_hail_wind_probability: (_U = getTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _U : null,
5150
- max_hail_in: (_V = getTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _V : null,
5151
- max_wind_surface: (_W = getTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _W : null,
5152
- max_tops_x100feet: (_X = getTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _X : null,
5153
- 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
5154
5238
  }
5155
5239
  };
5156
- if (isNaN(Number(properties2.watch_parameters.watch_number))) {
5157
- properties2.watch_parameters.watch_number = null;
5240
+ if (isNaN(Number(properties.watch_parameters.watch_number))) {
5241
+ properties.watch_parameters.watch_number = null;
5158
5242
  }
5159
- return properties2;
5243
+ return properties;
5160
5244
  };
5161
5245
 
5162
- // src/@building/building.headers.ts
5163
- var getEventHeader = (options) => {
5246
+ // src/@building/GetEventHeader.ts
5247
+ var GetEventHeader = (options) => {
5164
5248
  var _a, _b, _c;
5165
- const properties2 = options.properties;
5166
- const vtec2 = (_a = options.vtec) != null ? _a : null;
5167
- const ugc2 = properties2.geocode.ugc != null ? properties2.geocode.ugc.join(`-`) : `0`;
5168
- 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`}`;
5169
5253
  };
5170
5254
 
5171
- // src/@building/building.tracking.ts
5172
- var getEventTracking = (options) => {
5255
+ // src/@building/GetEventTracking.ts
5256
+ var GetEventTracking = (options) => {
5173
5257
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5174
- const properties2 = options.properties;
5258
+ const properties = options.properties;
5175
5259
  const attributes = options.attributes;
5176
5260
  const stanza = options.stanza;
5177
- const vtec2 = options.vtec;
5261
+ const vtec = options.vtec;
5178
5262
  if (options.type === `RAW`) {
5179
- const getWatchNumber = (_a = properties2.watch_parameters.watch_number) != null ? _a : null;
5263
+ const getWatchNumber = (_a = properties.watch_parameters.watch_number) != null ? _a : null;
5180
5264
  if (getWatchNumber) {
5181
- return `${properties2.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
5265
+ return `${properties.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
5182
5266
  }
5183
- 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"}`;
5184
5268
  }
5185
5269
  if (options.type === `VTEC`) {
5186
- return vtec2.tracking;
5270
+ return vtec.tracking;
5187
5271
  }
5188
5272
  if (options.type === `API`) {
5189
5273
  if (options.vtec) {
@@ -5202,37 +5286,39 @@ var getEventTracking = (options) => {
5202
5286
  }
5203
5287
  };
5204
5288
 
5205
- // src/@modules/@utilities/utilities.setDebug.ts
5206
- var setDebug = (options) => {
5207
- var _a, _b, _c, _d;
5289
+ // src/@modules/@utilities/SetDebug.ts
5290
+ var SetDebug = (options) => {
5291
+ var _a, _b;
5208
5292
  const settings = bootstrap.settings;
5209
5293
  bootstrap.listener.emit(`debug`, {
5210
5294
  message: options.message,
5211
- parent: (_b = (_a = options == null ? void 0 : options.title) == null ? void 0 : _a.split(`.`)[0]) == null ? void 0 : _b.replace(`@`, ``),
5212
- function: (_c = options == null ? void 0 : options.title) == null ? void 0 : _c.split(`.`)[1]
5295
+ function: (_a = options.title) != null ? _a : `debug`
5213
5296
  });
5214
5297
  if (settings.EnableDebugging) {
5215
- 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}`);
5216
5299
  }
5217
5300
  };
5218
5301
 
5219
- // src/@events/events.text.ts
5220
- var text = (stanza) => __async(null, null, function* () {
5302
+ // src/@events/ParseText.ts
5303
+ var ParseText = (stanza) => __async(null, null, function* () {
5221
5304
  var _a, _b, _c, _d, _e;
5222
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 !== "$$");
5223
5306
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5224
5307
  for (const message of getMessages) {
5225
5308
  const tick = performance.now();
5226
5309
  const attributes = stanza == null ? void 0 : stanza.attributes;
5227
- const props = properties({ message, attributes });
5228
- const header = getEventHeader({ properties: props, getType: stanza.getType });
5310
+ const props = GetEventProperties({ message, attributes });
5311
+ const header = GetEventHeader({ properties: props, getType: stanza.getType });
5229
5312
  const issued = new Date(attributes.issue);
5230
5313
  const expires = new Date(issued.getTime() + 12 * 60 * 60 * 1e3);
5231
- 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()));
5232
5315
  let event = matches == null ? void 0 : matches.label;
5233
5316
  let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5234
5317
  if (!event) {
5235
- 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
+ }
5236
5322
  isStatement = true;
5237
5323
  }
5238
5324
  bootstrap.cache.processed.push({
@@ -5251,7 +5337,7 @@ var text = (stanza) => __async(null, null, function* () {
5251
5337
  metadata: {
5252
5338
  ms: performance.now() - tick,
5253
5339
  source: `events.text`,
5254
- tracking: getEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5340
+ tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5255
5341
  header,
5256
5342
  vtec: null,
5257
5343
  hvtec: null,
@@ -5266,20 +5352,20 @@ var text = (stanza) => __async(null, null, function* () {
5266
5352
  }
5267
5353
  })
5268
5354
  });
5269
- setDebug({ title: `@events.text`, message: `Event process took ${performance.now() - tick} ms` });
5355
+ SetDebug({ title: `ParseText`, message: `${Math.round(performance.now() - tick)}ms` });
5270
5356
  }
5271
5357
  });
5272
5358
 
5273
- // src/@parsers/@ugc/ugc.header.ts
5359
+ // src/@parsers/@ugc/GetUGCHeader.ts
5274
5360
  var getUGCHeader = (message) => {
5275
- const start = message.search(dict_expressions.ugc1);
5361
+ const start = message.search(EnumExpressions.ugc1);
5276
5362
  const sub = message.substring(start);
5277
- const end = sub.search(dict_expressions.ugc2);
5363
+ const end = sub.search(EnumExpressions.ugc2);
5278
5364
  const fin = sub.substring(0, end).replace(/\s+/g, "").slice(0, -1);
5279
5365
  return fin != null ? fin : null;
5280
5366
  };
5281
5367
 
5282
- // src/@parsers/@ugc/ugc.zones.ts
5368
+ // src/@parsers/@ugc/GetZones.ts
5283
5369
  var getZones = (header) => {
5284
5370
  const splits = header.split("-");
5285
5371
  const zones = [];
@@ -5314,8 +5400,8 @@ var getZones = (header) => {
5314
5400
  return zones.filter((item) => item !== "");
5315
5401
  };
5316
5402
 
5317
- // src/@parsers/@ugc/ugc.expiry.ts
5318
- var getExpiry = (message) => {
5403
+ // src/@parsers/@ugc/GetExpiry.ts
5404
+ var GetExpiry = (message) => {
5319
5405
  const match = message.match(/\b(\d{6})-/);
5320
5406
  if (!match) {
5321
5407
  return null;
@@ -5329,12 +5415,12 @@ var getExpiry = (message) => {
5329
5415
  return expires.toISOString();
5330
5416
  };
5331
5417
 
5332
- // src/@parsers/@ugc/ugc.getCache.ts
5418
+ // src/@parsers/@ugc/GetCache.ts
5333
5419
  var getCache = (key) => {
5334
5420
  return bootstrap.cache.ugc.get(key);
5335
5421
  };
5336
5422
 
5337
- // src/@parsers/@ugc/ugc.setCache.ts
5423
+ // src/@parsers/@ugc/SetCache.ts
5338
5424
  var setCache = (key, value) => {
5339
5425
  if (bootstrap.cache.ugc.size >= 5e3) {
5340
5426
  const firstKey = bootstrap.cache.ugc.keys().next().value;
@@ -5343,7 +5429,7 @@ var setCache = (key, value) => {
5343
5429
  bootstrap.cache.ugc.set(key, value);
5344
5430
  };
5345
5431
 
5346
- // src/@parsers/@ugc/ugc.locations.ts
5432
+ // src/@parsers/@ugc/GetLocations.ts
5347
5433
  var getLocations = (zones) => __async(null, null, function* () {
5348
5434
  const uniqueZones = Array.from(new Set(zones));
5349
5435
  const results = [];
@@ -5372,11 +5458,11 @@ var getLocations = (zones) => __async(null, null, function* () {
5372
5458
  return results;
5373
5459
  });
5374
5460
 
5375
- // src/@parsers/@ugc/ugc.extract.ts
5461
+ // src/@parsers/@ugc/UGCExtract.ts
5376
5462
  var ugcExtract = (message) => __async(null, null, function* () {
5377
5463
  const head = getUGCHeader(message);
5378
5464
  const ugcs = getZones(head);
5379
- const expires = getExpiry(message);
5465
+ const expires = GetExpiry(message);
5380
5466
  const areas = yield getLocations(ugcs);
5381
5467
  if (!head || (ugcs == null ? void 0 : ugcs.length) == 0) return;
5382
5468
  return {
@@ -5386,25 +5472,28 @@ var ugcExtract = (message) => __async(null, null, function* () {
5386
5472
  };
5387
5473
  });
5388
5474
 
5389
- // src/@events/events.ugc.ts
5390
- var ugc = (stanza) => __async(null, null, function* () {
5475
+ // src/@events/ParseUGC.ts
5476
+ var ParseUGC = (stanza) => __async(null, null, function* () {
5391
5477
  var _a, _b, _c, _d, _e;
5392
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 !== "$$");
5393
5479
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5394
5480
  for (const message of getMessages) {
5395
5481
  const tick = performance.now();
5396
5482
  const attributes = stanza == null ? void 0 : stanza.attributes;
5397
- const ugc2 = yield ugcExtract(message);
5398
- if (ugc2 != null) {
5399
- const props = properties({ message, attributes, ugc: ugc2 });
5483
+ const ugc = yield ugcExtract(message);
5484
+ if (ugc != null) {
5485
+ const props = GetEventProperties({ message, attributes, ugc });
5400
5486
  const issued = new Date(attributes.issue);
5401
- const expires = new Date(ugc2.expires);
5402
- const header = getEventHeader({ properties: props, getType: stanza.getType });
5403
- 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()));
5404
5490
  let event = matches == null ? void 0 : matches.label;
5405
5491
  let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5406
5492
  if (!event) {
5407
- 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
+ }
5408
5497
  isStatement = true;
5409
5498
  }
5410
5499
  bootstrap.cache.processed.push({
@@ -5423,7 +5512,7 @@ var ugc = (stanza) => __async(null, null, function* () {
5423
5512
  metadata: {
5424
5513
  ms: performance.now() - tick,
5425
5514
  source: `events.ugc`,
5426
- tracking: getEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5515
+ tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
5427
5516
  header,
5428
5517
  vtec: null,
5429
5518
  hvtec: null,
@@ -5438,21 +5527,21 @@ var ugc = (stanza) => __async(null, null, function* () {
5438
5527
  }
5439
5528
  })
5440
5529
  });
5441
- setDebug({ title: `@events.ugc`, message: `Event process took ${performance.now() - tick} ms` });
5530
+ SetDebug({ title: `ParseUGC`, message: `${Math.round(performance.now() - tick)}ms` });
5442
5531
  }
5443
5532
  }
5444
5533
  });
5445
5534
 
5446
- // src/@dictionaries/dictionaries.products.ts
5447
- var dict_products = {
5535
+ // src/@enums/Products.ts
5536
+ var EnumProducts = {
5448
5537
  "O": "Operational Product",
5449
5538
  "T": "Test Product",
5450
5539
  "E": "Experimental Product",
5451
5540
  "X": "Experimental Product (Non-Operational)"
5452
5541
  };
5453
5542
 
5454
- // src/@dictionaries/dictionaries.events.ts
5455
- var dict_events = {
5543
+ // src/@enums/Events.ts
5544
+ var EnumEvents = {
5456
5545
  "AF": "Ashfall",
5457
5546
  "AS": "Air Stagnation",
5458
5547
  "BH": "Beach Hazard",
@@ -5516,8 +5605,8 @@ var dict_events = {
5516
5605
  "ZY": "Freezing Spray"
5517
5606
  };
5518
5607
 
5519
- // src/@dictionaries/dictionaries.actions.ts
5520
- var dict_actions = {
5608
+ // src/@enums/Actions.ts
5609
+ var EnumActions = {
5521
5610
  "W": "Warning",
5522
5611
  "F": "Forecast",
5523
5612
  "A": "Watch",
@@ -5527,8 +5616,8 @@ var dict_actions = {
5527
5616
  "S": "Statement"
5528
5617
  };
5529
5618
 
5530
- // src/@dictionaries/dictionaries.status.ts
5531
- var dict_status = {
5619
+ // src/@enums/Status.ts
5620
+ var EnumStatus = {
5532
5621
  "NEW": "Issued",
5533
5622
  "CON": "Updated",
5534
5623
  "EXT": "Extended",
@@ -5541,8 +5630,8 @@ var dict_status = {
5541
5630
  "EXP": "Expired"
5542
5631
  };
5543
5632
 
5544
- // src/@parsers/@pvtec/pvtec.expires.ts
5545
- var getExpiry2 = (dates) => {
5633
+ // src/@parsers/@pvtec/GetExpiry.ts
5634
+ var GetExpiry2 = (dates) => {
5546
5635
  if ((dates == null ? void 0 : dates[1]) == `000000T0000Z`) return "Invalid Date Format";
5547
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`;
5548
5637
  const local = new Date(new Date(expires).getTime() - 4 * 60 * 6e4);
@@ -5550,24 +5639,24 @@ var getExpiry2 = (dates) => {
5550
5639
  return `${local.getFullYear()}-${pad(local.getMonth() + 1)}-${pad(local.getDate())}T${pad(local.getHours())}:${pad(local.getMinutes())}:00.000-04:00`;
5551
5640
  };
5552
5641
 
5553
- // src/@parsers/@pvtec/pvtec.extract.ts
5554
- var pvExtract = (message) => {
5642
+ // src/@parsers/@pvtec/VTECExtract.ts
5643
+ var VTECExtract = (message) => {
5555
5644
  var _a, _b, _c, _d;
5556
5645
  if (!message) return null;
5557
- const getVTECs = (_a = message.match(dict_expressions.pvtec)) != null ? _a : [];
5646
+ const getVTECs = (_a = message.match(EnumExpressions.pvtec)) != null ? _a : [];
5558
5647
  const vtecs = [];
5559
- for (const vtec2 of getVTECs) {
5560
- const sub = vtec2.split(`.`);
5648
+ for (const vtec of getVTECs) {
5649
+ const sub = vtec.split(`.`);
5561
5650
  if ((sub == null ? void 0 : sub.length) < 7) continue;
5562
5651
  const dates = (_b = sub[6]) == null ? void 0 : _b.split(`-`);
5563
5652
  vtecs.push({
5564
- vtec: vtec2,
5565
- product: dict_products[sub[0]],
5653
+ vtec,
5654
+ product: EnumProducts[sub[0]],
5566
5655
  tracking: `${sub[2]}.${sub[3]}.${sub[4]}.${sub[5]}`,
5567
- event: `${dict_events[sub[3]]} ${dict_actions[sub[4]]}`,
5568
- status: dict_status[sub[1]],
5569
- organization: (_d = (_c = message.match(dict_expressions.wmo)) == null ? void 0 : _c[0]) != null ? _d : null,
5570
- 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),
5571
5660
  is_watch: (sub[4] == `A` || sub[4] == `Y`) && (sub[3] == `TO` || sub[3] == `SV`),
5572
5661
  prediction_center: sub[2] == `KWNS` ? true : false
5573
5662
  });
@@ -5575,8 +5664,8 @@ var pvExtract = (message) => {
5575
5664
  return vtecs.length > 0 ? vtecs : null;
5576
5665
  };
5577
5666
 
5578
- // src/@dictionaries/dictionaries.causes.ts
5579
- var dict_causes = {
5667
+ // src/@enums/Causes.ts
5668
+ var EnumCauses = {
5580
5669
  "SM": "Snow Melt",
5581
5670
  "RS": "Rain/Snow Melt",
5582
5671
  "ER": "Excessive Rain",
@@ -5594,16 +5683,16 @@ var dict_causes = {
5594
5683
  "OT": "Other Effects"
5595
5684
  };
5596
5685
 
5597
- // src/@dictionaries/dictionaries.records.ts
5598
- var dict_records = {
5686
+ // src/@enums/Records.ts
5687
+ var EnumRecords = {
5599
5688
  "NO": "No Record Expected",
5600
5689
  "NR": "Near Record or possible record",
5601
5690
  "UU": "Unknown history of records",
5602
5691
  "OO": "Other"
5603
5692
  };
5604
5693
 
5605
- // src/@dictionaries/dictionaries.severity.ts
5606
- var dict_severity = {
5694
+ // src/@enums/Severity.ts
5695
+ var EnumSeverity = {
5607
5696
  N: "Not Expected",
5608
5697
  0: "Areal Flood or FF Product",
5609
5698
  1: "Minor",
@@ -5612,42 +5701,42 @@ var dict_severity = {
5612
5701
  U: "Unknown"
5613
5702
  };
5614
5703
 
5615
- // src/@parsers/@hvtec/hvtec.extract.ts
5616
- var hvExtract = (message) => {
5704
+ // src/@parsers/@hvtec/HVExtract.ts
5705
+ var HVExtract = (message) => {
5617
5706
  var _a;
5618
- const getHVTECs = (_a = message.match(dict_expressions.hvtec)) != null ? _a : [];
5707
+ const getHVTECs = (_a = message.match(EnumExpressions.hvtec)) != null ? _a : [];
5619
5708
  const vtecs = [];
5620
- for (const vtec2 of getHVTECs) {
5621
- const sub = vtec2.split(`.`);
5709
+ for (const vtec of getHVTECs) {
5710
+ const sub = vtec.split(`.`);
5622
5711
  if (sub.length < 7) continue;
5623
5712
  vtecs.push({
5624
- hvtec: vtec2,
5625
- severity: dict_severity[sub[1]],
5626
- cause: dict_causes[sub[2]],
5627
- record: dict_records[sub[6]]
5713
+ hvtec: vtec,
5714
+ severity: EnumSeverity[sub[1]],
5715
+ cause: EnumCauses[sub[2]],
5716
+ record: EnumRecords[sub[6]]
5628
5717
  });
5629
5718
  }
5630
5719
  return vtecs.length > 0 ? vtecs : null;
5631
5720
  };
5632
5721
 
5633
- // src/@events/events.vtec.ts
5634
- var vtec = (stanza) => __async(null, null, function* () {
5722
+ // src/@events/ParseVTEC.ts
5723
+ var ParseVTEC = (stanza) => __async(null, null, function* () {
5635
5724
  var _a, _b, _c, _d, _e;
5636
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 !== "$$");
5637
5726
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5638
5727
  for (const message of getMessages) {
5639
5728
  const tick = performance.now();
5640
5729
  const attributes = stanza == null ? void 0 : stanza.attributes;
5641
- const pVtec = pvExtract(message);
5642
- const hVtec = hvExtract(message);
5643
- const ugc2 = yield ugcExtract(message);
5644
- 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) {
5645
5734
  for (const pv of pVtec) {
5646
- const vtec2 = pv;
5647
- const props = properties({ message, attributes, ugc: ugc2, pVtec: vtec2 });
5648
- 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 });
5649
5738
  const issued = (_d = new Date(attributes.issue)) != null ? _d : /* @__PURE__ */ new Date();
5650
- const expires = new Date(vtec2.expires);
5739
+ const expires = new Date(vtec.expires);
5651
5740
  bootstrap.cache.processed.push({
5652
5741
  type: `Feature`,
5653
5742
  geometry: {
@@ -5659,12 +5748,12 @@ var vtec = (stanza) => __async(null, null, function* () {
5659
5748
  parent: pv.event,
5660
5749
  status: pv.status,
5661
5750
  issued: !isNaN(issued.getTime()) ? issued.toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
5662
- 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()
5663
5752
  }, props), {
5664
5753
  metadata: {
5665
5754
  ms: performance.now() - tick,
5666
5755
  source: `events.vtec`,
5667
- tracking: getEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec: vtec2 }),
5756
+ tracking: GetEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec }),
5668
5757
  header,
5669
5758
  vtec: pv,
5670
5759
  hvtec: hVtec,
@@ -5679,19 +5768,19 @@ var vtec = (stanza) => __async(null, null, function* () {
5679
5768
  }
5680
5769
  })
5681
5770
  });
5682
- setDebug({ title: `@events.vtec`, message: `Event process took ${performance.now() - tick} ms` });
5771
+ SetDebug({ title: `ParseVTEC`, message: `${Math.round(performance.now() - tick)}ms` });
5683
5772
  }
5684
5773
  }
5685
5774
  }
5686
5775
  });
5687
5776
 
5688
- // src/@events/events.api.ts
5689
- var api = (stanza) => __async(null, null, function* () {
5777
+ // src/@events/ParseAPI.ts
5778
+ var ParseAPI = (stanza) => __async(null, null, function* () {
5690
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;
5691
5780
  const messages = Object.values(JSON.parse(stanza.message).features);
5692
5781
  for (const feature of messages) {
5693
5782
  const tick = performance.now();
5694
- 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;
5695
5784
  bootstrap.cache.processed.push({
5696
5785
  type: `Feature`,
5697
5786
  geometry: {
@@ -5711,7 +5800,7 @@ var api = (stanza) => __async(null, null, function* () {
5711
5800
  geocode: {
5712
5801
  office: {
5713
5802
  office: pVtec ? (_w = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _w.tracking.split(`.`)[0] : null,
5714
- 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
5715
5804
  },
5716
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],
5717
5806
  ugc: (_E = (_D = (_C = feature == null ? void 0 : feature.properties) == null ? void 0 : _C.geocode) == null ? void 0 : _D.UGC) != null ? _E : [],
@@ -5719,11 +5808,11 @@ var api = (stanza) => __async(null, null, function* () {
5719
5808
  polygon_generated: ((_H = feature == null ? void 0 : feature.geometry) == null ? void 0 : _H.coordinates.length) > 0 ? true : false
5720
5809
  },
5721
5810
  parameters: {
5722
- 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),
5723
5812
  instructions: (_K = (_J = feature == null ? void 0 : feature.properties) == null ? void 0 : _J.instruction) != null ? _K : null,
5724
- source: (_M = getTextFromProduct({ message: (_L = feature == null ? void 0 : feature.properties) == null ? void 0 : _L.description, find: [`SOURCE...`], removal: [`.`] })) != null ? _M : null,
5725
- hazards: (_O = getTextFromProduct({ message: (_N = feature == null ? void 0 : feature.properties) == null ? void 0 : _N.description, find: [`HAZARD...`], removal: [`.`] })) != null ? _O : null,
5726
- 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,
5727
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,
5728
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,
5729
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,
@@ -5733,31 +5822,31 @@ var api = (stanza) => __async(null, null, function* () {
5733
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
5734
5823
  },
5735
5824
  discussion_parameters: {
5736
- 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,
5737
- discussion_concerning: (_wa = getTextFromProduct({ message: (_va = feature == null ? void 0 : feature.properties) == null ? void 0 : _va.description, find: [`Concerning...`] })) != null ? _wa : null,
5738
- 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,
5739
- 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,
5740
- 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,
5741
- 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
5742
5831
  },
5743
5832
  watch_parameters: {
5744
- 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),
5745
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,
5746
- 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,
5747
- 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,
5748
- 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,
5749
- 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,
5750
- 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,
5751
- 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,
5752
- 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,
5753
- 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,
5754
- 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,
5755
- 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`
5756
5845
  },
5757
5846
  metadata: {
5758
5847
  ms: performance.now() - tick,
5759
5848
  source: `events.api`,
5760
- 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] }),
5761
5850
  header: `ZCZC-ATMOSX-${(_ob = (_nb = feature == null ? void 0 : feature.properties) == null ? void 0 : _nb.parameters) == null ? void 0 : _ob.WMOidentifier}`,
5762
5851
  vtec: pVtec == null ? void 0 : pVtec[0],
5763
5852
  hvtec: null,
@@ -5772,12 +5861,12 @@ var api = (stanza) => __async(null, null, function* () {
5772
5861
  }
5773
5862
  }
5774
5863
  });
5775
- setDebug({ title: `@events.api`, message: `Event process took ${performance.now() - tick} ms` });
5864
+ SetDebug({ title: `ParseAPI`, message: `${Math.round(performance.now() - tick)}ms` });
5776
5865
  }
5777
5866
  });
5778
5867
 
5779
- // src/@dictionaries/dictionaries.enhanced.ts
5780
- var dict_enhanced = {
5868
+ // src/@enums/Enhanced.ts
5869
+ var EnumEnhanced = {
5781
5870
  "Tornado Warning": {
5782
5871
  "Tornado Emergency": { description: "tornado emergency" },
5783
5872
  "PDS Tornado Warning": { description: "particularly dangerous situation", damage: `CONSIDERABLE` },
@@ -5815,22 +5904,21 @@ var dict_enhanced = {
5815
5904
  "Considerable Severe Thunderstorm Warning (TPROB)": { damage: `CONSIDERABLE`, tornado: `POSSIBLE` },
5816
5905
  "Considerable Severe Thunderstorm Warning": { damage: `CONSIDERABLE` },
5817
5906
  "Severe Thunderstorm Warning (TPROB)": { tornado: `POSSIBLE` }
5907
+ },
5908
+ "Special Weather Statement": {
5909
+ "Convective Special Weather Statement": { description: "strong thunderstorm" }
5818
5910
  }
5819
5911
  };
5820
5912
 
5821
- // src/@building/building.enhance.ts
5822
- var getEventEnhancedName = (event) => {
5823
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5824
- const configurations = bootstrap.settings;
5913
+ // src/@building/GetEventEnhancedName.ts
5914
+ var GetEventEnhancedName = (event) => {
5915
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
5825
5916
  let name = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.event;
5826
- if (!((_b = configurations == null ? void 0 : configurations.GlobalSettings) == null ? void 0 : _b.BetterEventNames)) {
5827
- return name;
5828
- }
5829
- const damage = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat;
5830
- const tornado = (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.tornado_threat;
5831
- const pdswatch = (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.watch_parameters) == null ? void 0 : _h.pds_watch;
5832
- const description = (_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.description) == null ? void 0 : _j.toLowerCase();
5833
- 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)) {
5834
5922
  if (eventKey !== name) continue;
5835
5923
  for (const [paramKey, paramValue] of Object.entries(eventConfig)) {
5836
5924
  let matches = true;
@@ -5855,8 +5943,8 @@ var getEventEnhancedName = (event) => {
5855
5943
  return name;
5856
5944
  };
5857
5945
 
5858
- // src/@dictionaries/dictionaries.correlations.ts
5859
- var dict_correlations = [
5946
+ // src/@enums/Correlations.ts
5947
+ var EnumCorrelations = [
5860
5948
  { type: "Statement", name: "Statement", isCancel: false, isUpdate: false, isIssued: true, isStatement: true },
5861
5949
  { type: "Update", name: "Updated", isCancel: false, isUpdate: true, isIssued: false, isStatement: false },
5862
5950
  { type: "Cancel", name: "Cancelled", isCancel: true, isUpdate: false, isIssued: false, isStatement: false },
@@ -5871,8 +5959,8 @@ var dict_correlations = [
5871
5959
  { type: "Routine", name: "Routine", isCancel: false, isUpdate: true, isIssued: false, isStatement: false }
5872
5960
  ];
5873
5961
 
5874
- // src/@dictionaries/dictionaries.cancellation.ts
5875
- var dict_cancellation = [
5962
+ // src/@enums/Cancellation.ts
5963
+ var EnumCancellation = [
5876
5964
  "has been cancelled",
5877
5965
  "subsided sufficiently for the advisory to be cancelled",
5878
5966
  "has been cancelled",
@@ -5885,22 +5973,24 @@ var dict_cancellation = [
5885
5973
  "has weakened below severe"
5886
5974
  ];
5887
5975
 
5888
- // src/@dictionaries/dictionaries.testing.ts
5889
- var dict_testing = [
5976
+ // src/@enums/Testing.ts
5977
+ var EnumTesting = [
5890
5978
  `This is a test message`,
5891
5979
  `Monitoring message only.`,
5892
5980
  `THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY`,
5893
5981
  "TEST MESSAGE"
5894
5982
  ];
5895
5983
 
5896
- // src/@dictionaries/dictionaries.hail.ts
5897
- var dict_hail = {
5984
+ // src/@enums/Hail.ts
5985
+ var EnumHail = {
5986
+ "0.25": "Pea",
5898
5987
  ".25": "Pea",
5988
+ "0.50": "Penny",
5899
5989
  ".50": "Penny",
5900
5990
  ".75": "Penny",
5901
5991
  "Up to .75": "Penny",
5902
- ".88": "Nickel",
5903
5992
  "0.75": "Penny",
5993
+ ".88": "Nickel",
5904
5994
  "0.88": "Nickel",
5905
5995
  "1.00": "Quarter",
5906
5996
  "1.25": "Half Dollar",
@@ -5912,62 +6002,62 @@ var dict_hail = {
5912
6002
  "4.00": "CD/DVD"
5913
6003
  };
5914
6004
 
5915
- // src/@building/building.signature.ts
5916
- var getEventSignature = (event) => {
6005
+ // src/@building/GetEventSignature.ts
6006
+ var GetEventSignature = (event) => {
5917
6007
  var _a, _b, _c, _d, _e, _f, _g, _h;
5918
- const properties2 = event == null ? void 0 : event.properties;
5919
- const vtec2 = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.vtec;
5920
- const status = dict_correlations.find((c) => c.type === (properties2 == null ? void 0 : properties2.status));
5921
- const csig = dict_cancellation.find((sig) => properties2.description.toLowerCase().includes(sig.toLowerCase()));
5922
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_issued: true, is_test: false });
5923
- if ((_c = properties2 == null ? void 0 : properties2.parameters) == null ? void 0 : _c.estimated_hail_size) {
5924
- 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 : "--"})`;
5925
6015
  }
5926
6016
  if (status) {
5927
- properties2.status = (_f = status.name) != null ? _f : properties2.status;
5928
- 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 });
5929
6019
  }
5930
6020
  if (csig) {
5931
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_expired: true });
6021
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_expired: true });
5932
6022
  }
5933
- const getProduct = (_h = (_g = vtec2 == null ? void 0 : vtec2.vtec) == null ? void 0 : _g.split(`.`)[0]) == null ? void 0 : _h.replace(`/`, ``);
5934
- const isTestProduct = dict_products[getProduct] == `Test Product`;
5935
- 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) => {
5936
6026
  var _a2, _b2, _c2, _d2;
5937
- 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());
5938
6028
  })) {
5939
- properties2.status_metadata = __spreadProps(__spreadValues({}, properties2.status_metadata), { is_test: true });
6029
+ properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_test: true });
5940
6030
  }
5941
- if (new Date(properties2.expires).getTime() < Date.now()) {
5942
- 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 });
5943
6033
  }
5944
- properties2.status_metadata = __spreadValues({}, properties2.status_metadata);
6034
+ properties.status_metadata = __spreadValues({}, properties.status_metadata);
5945
6035
  return event;
5946
6036
  };
5947
6037
 
5948
- // src/@dictionaries/dictionaries.global.ts
5949
- var dict_global = [
5950
- "spc day 1 outlook",
5951
- "spc day 2 outlook",
5952
- "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"
5953
6043
  ];
5954
6044
 
5955
- // src/@manager/manager.setHash.ts
5956
- var setHash = (event, entry) => {
5957
- if (entry) {
5958
- entry.hashes.push(event.properties.metadata.hash);
5959
- entry.expires = event.properties.expires;
5960
- } else {
6045
+ // src/@manager/SetHash.ts
6046
+ var SetHash = (event, entry) => {
6047
+ if (!entry) {
5961
6048
  bootstrap.cache.hashes.push({
5962
6049
  tracking: event.properties.metadata.tracking,
5963
6050
  hashes: [event.properties.metadata.hash],
5964
6051
  expires: event.properties.expires
5965
6052
  });
6053
+ return;
5966
6054
  }
6055
+ entry.hashes.push(event.properties.metadata.hash);
6056
+ entry.expires = event.properties.expires;
5967
6057
  };
5968
6058
 
5969
- // src/@modules/@eas/eas.getWavPCM16.ts
5970
- var getWavPCM16 = (buffer) => {
6059
+ // src/@modules/@eas/GetWavPCM16.ts
6060
+ var GetWavPCM16 = (buffer) => {
5971
6061
  if (buffer.toString("ascii", 0, 4) !== "RIFF" || buffer.toString("ascii", 8, 12) !== "WAVE") {
5972
6062
  return null;
5973
6063
  }
@@ -5995,8 +6085,8 @@ var getWavPCM16 = (buffer) => {
5995
6085
  return { samples: new Int16Array(samples), sampleRate, channels, bitsPerSample };
5996
6086
  };
5997
6087
 
5998
- // src/@modules/@eas/eas.getSampledPCM16.ts
5999
- var getSampledPCM16 = (int16, originalRate, targetRate) => {
6088
+ // src/@modules/@eas/GetSampledPCM16.ts
6089
+ var GetSampledPCM16 = (int16, originalRate, targetRate) => {
6000
6090
  if (originalRate === targetRate) return int16;
6001
6091
  const ratio = targetRate / originalRate;
6002
6092
  const outLen = Math.max(1, Math.round(int16.length * ratio));
@@ -6012,15 +6102,15 @@ var getSampledPCM16 = (int16, originalRate, targetRate) => {
6012
6102
  return out;
6013
6103
  };
6014
6104
 
6015
- // src/@modules/@eas/eas.getPCMToFloat.ts
6016
- var getPCMToFloat = (int16) => {
6105
+ // src/@modules/@eas/GetPCMToFloat.ts
6106
+ var GetPCMToFloat = (int16) => {
6017
6107
  const out = new Float32Array(int16.length);
6018
6108
  for (let i = 0; i < int16.length; i++) out[i] = int16[i] / 32768;
6019
6109
  return out;
6020
6110
  };
6021
6111
 
6022
- // src/@modules/@eas/eas.getFloatPCM16.ts
6023
- var getFloatPCM16 = (float32) => {
6112
+ // src/@modules/@eas/GetFloatPCM16.ts
6113
+ var GetFloatPCM16 = (float32) => {
6024
6114
  const out = new Int16Array(float32.length);
6025
6115
  for (let i = 0; i < float32.length; i++) {
6026
6116
  let v = Math.max(-1, Math.min(1, float32[i]));
@@ -6029,11 +6119,11 @@ var getFloatPCM16 = (float32) => {
6029
6119
  return out;
6030
6120
  };
6031
6121
 
6032
- // src/@modules/@eas/eas.setRadioEffect.ts
6033
- var setRadioEffect = (int16, sampleRate) => {
6122
+ // src/@modules/@eas/SetRadioEffect.ts
6123
+ var SetRadioEffect = (int16, sampleRate) => {
6034
6124
  const hpCut = 3555;
6035
6125
  const lpCut = 1600;
6036
- const x = getPCMToFloat(int16);
6126
+ const x = GetPCMToFloat(int16);
6037
6127
  const dt = 1 / sampleRate;
6038
6128
  const rcHP = 1 / (2 * Math.PI * hpCut);
6039
6129
  const aHP = rcHP / (rcHP + dt);
@@ -6054,11 +6144,11 @@ var setRadioEffect = (int16, sampleRate) => {
6054
6144
  const compGain = 2;
6055
6145
  const norm = Math.tanh(compGain);
6056
6146
  for (let i = 0; i < x.length; i++) x[i] = Math.tanh(x[i] * compGain) / norm;
6057
- return getFloatPCM16(x);
6147
+ return GetFloatPCM16(x);
6058
6148
  };
6059
6149
 
6060
- // src/@modules/@eas/eas.setAFSK.ts
6061
- var setAFSK = (bits, sampleRate) => {
6150
+ // src/@modules/@eas/SetAFSK.ts
6151
+ var SetAFSK = (bits, sampleRate) => {
6062
6152
  const baud = 520.83;
6063
6153
  const markFreq = 2083.3;
6064
6154
  const spaceFreq = 1562.5;
@@ -6089,8 +6179,8 @@ var setAFSK = (bits, sampleRate) => {
6089
6179
  return Int16Array.from(result);
6090
6180
  };
6091
6181
 
6092
- // src/@modules/@eas/eas.setAsciiToBits.ts
6093
- var setAsciiToBits = (str) => {
6182
+ // src/@modules/@eas/SetAsciiToBits.ts
6183
+ var SetAsciiToBits = (str) => {
6094
6184
  const bits = [];
6095
6185
  for (let i = 0; i < str.length; i++) {
6096
6186
  const c = str.charCodeAt(i) & 255;
@@ -6101,8 +6191,8 @@ var setAsciiToBits = (str) => {
6101
6191
  return bits;
6102
6192
  };
6103
6193
 
6104
- // src/@modules/@eas/eas.getMergedPCM16.ts
6105
- var getMergedPCM16 = (arrays) => {
6194
+ // src/@modules/@eas/GetMergedPCM16.ts
6195
+ var GetMergedPCM16 = (arrays) => {
6106
6196
  let total = 0;
6107
6197
  for (const a of arrays) total += a.length;
6108
6198
  const out = new Int16Array(total);
@@ -6114,16 +6204,16 @@ var getMergedPCM16 = (arrays) => {
6114
6204
  return out;
6115
6205
  };
6116
6206
 
6117
- // src/@modules/@eas/eas.setSameHeader.ts
6118
- var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
6207
+ // src/@modules/@eas/SetSameHeader.ts
6208
+ var SetSameHeader = (vtec, repeats, sampleRate = 8e3, options = {}) => {
6119
6209
  var _a, _b;
6120
6210
  const preMarkSec = (_a = options.preMarkSec) != null ? _a : 0.3;
6121
6211
  const gapSec = (_b = options.gapSec) != null ? _b : 0.1;
6122
6212
  const bursts = [];
6123
6213
  const gap = new Int16Array(Math.floor(gapSec * sampleRate));
6124
6214
  for (let i = 0; i < repeats; i++) {
6125
- const bodyBits = setAsciiToBits(vtec2);
6126
- const body = setAFSK(bodyBits, sampleRate);
6215
+ const bodyBits = SetAsciiToBits(vtec);
6216
+ const body = SetAFSK(bodyBits, sampleRate);
6127
6217
  const extendedBodyDuration = Math.round(preMarkSec * sampleRate);
6128
6218
  const extendedBody = new Int16Array(extendedBodyDuration + gap.length);
6129
6219
  for (let j2 = 0; j2 < extendedBodyDuration; j2++) {
@@ -6133,11 +6223,11 @@ var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
6133
6223
  bursts.push(extendedBody);
6134
6224
  if (i !== repeats - 1) bursts.push(gap);
6135
6225
  }
6136
- return getMergedPCM16(bursts);
6226
+ return GetMergedPCM16(bursts);
6137
6227
  };
6138
6228
 
6139
- // src/@modules/@eas/eas.setAttentionTone.ts
6140
- var setAttentionTone = (ms, sampleRate) => {
6229
+ // src/@modules/@eas/SetAttentionTone.ts
6230
+ var SetAttentionTone = (ms, sampleRate) => {
6141
6231
  const len = Math.floor(ms * sampleRate);
6142
6232
  const out = new Int16Array(len);
6143
6233
  const f1 = 853;
@@ -6157,18 +6247,18 @@ var setAttentionTone = (ms, sampleRate) => {
6157
6247
  return out;
6158
6248
  };
6159
6249
 
6160
- // src/@modules/@eas/eas.setNoise.ts
6161
- var setNoise = (int16, noiseLevel = 0.02) => {
6162
- const x = getPCMToFloat(int16);
6250
+ // src/@modules/@eas/SetNoise.ts
6251
+ var SetNoise = (int16, noiseLevel = 0.02) => {
6252
+ const x = GetPCMToFloat(int16);
6163
6253
  for (let i = 0; i < x.length; i++) x[i] += (Math.random() * 2 - 1) * noiseLevel;
6164
6254
  let peak = 0;
6165
6255
  for (let i = 0; i < x.length; i++) peak = Math.max(peak, Math.abs(x[i]));
6166
6256
  if (peak > 1) for (let i = 0; i < x.length; i++) x[i] *= 0.98 / peak;
6167
- return getFloatPCM16(x);
6257
+ return GetFloatPCM16(x);
6168
6258
  };
6169
6259
 
6170
- // src/@modules/@eas/eas.getPCM16.ts
6171
- var getPCM16 = (samples, sampleRate) => {
6260
+ // src/@modules/@eas/GetPCM16.ts
6261
+ var GetPCM16 = (samples, sampleRate) => {
6172
6262
  let o = 0;
6173
6263
  const bytesPerSample = 2;
6174
6264
  const blockAlign = 1 * bytesPerSample;
@@ -6208,17 +6298,17 @@ var getPCM16 = (samples, sampleRate) => {
6208
6298
  return buffer;
6209
6299
  };
6210
6300
 
6211
- // src/@modules/@eas/eas.getTTS.ts
6301
+ // src/@modules/@eas/GetTTS.ts
6212
6302
  var import_os = require("os");
6213
6303
  var import_fs = require("fs");
6214
6304
  var import_child_process = require("child_process");
6215
- var getTTS = (text2, outputPath) => __async(null, null, function* () {
6305
+ var GetTTS = (text, outputPath) => __async(null, null, function* () {
6216
6306
  const vPlatform = (0, import_os.platform)();
6217
6307
  switch (vPlatform) {
6218
6308
  case "win32": {
6219
6309
  try {
6220
6310
  const txtPath = outputPath + ".txt";
6221
- (0, import_fs.writeFileSync)(txtPath, text2, "utf8");
6311
+ (0, import_fs.writeFileSync)(txtPath, text, "utf8");
6222
6312
  const command = [
6223
6313
  "Add-Type -AssemblyName System.Speech;",
6224
6314
  `$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;`,
@@ -6235,7 +6325,7 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
6235
6325
  }
6236
6326
  case "linux":
6237
6327
  try {
6238
- (0, import_child_process.execSync)(`espeak -w "${outputPath}" "${text2.replace(/"/g, '\\"')}"`);
6328
+ (0, import_child_process.execSync)(`espeak -w "${outputPath}" "${text.replace(/"/g, '\\"')}"`);
6239
6329
  } catch (e) {
6240
6330
  }
6241
6331
  break;
@@ -6244,8 +6334,8 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
6244
6334
  }
6245
6335
  });
6246
6336
 
6247
- // src/@modules/@eas/eas.getCleanDescription.ts
6248
- var getCleanDescription = (message) => {
6337
+ // src/@modules/@eas/GetCleanDescription.ts
6338
+ var GetCleanDescription = (message) => {
6249
6339
  const patches = [
6250
6340
  { regex: /\.{3,}/g, replacement: ". " },
6251
6341
  { regex: /\bUTC\b/g, replacement: "Coordinated Universal Time" },
@@ -6316,12 +6406,12 @@ var getCleanDescription = (message) => {
6316
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();
6317
6407
  };
6318
6408
 
6319
- // src/@modules/@eas/eas.setEasTone.ts
6409
+ // src/@modules/@eas/GenerateEASMessage.ts
6320
6410
  var import_path2 = require("path");
6321
6411
  var import_fs2 = require("fs");
6322
6412
  var import_child_process2 = require("child_process");
6323
6413
  var import_os2 = require("os");
6324
- var setEasTone = (options) => __async(null, null, function* () {
6414
+ var GenerateEASMessage = (options) => __async(null, null, function* () {
6325
6415
  var _a;
6326
6416
  const tick = performance.now();
6327
6417
  const settings = bootstrap.settings;
@@ -6331,7 +6421,7 @@ var setEasTone = (options) => __async(null, null, function* () {
6331
6421
  let header = options.header;
6332
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();
6333
6423
  if (!message || !header) {
6334
- setWarning({
6424
+ SetWarning({
6335
6425
  title: `EAS`,
6336
6426
  message: `Message and header are required to generate an EAS tone.`
6337
6427
  });
@@ -6343,25 +6433,19 @@ var setEasTone = (options) => __async(null, null, function* () {
6343
6433
  if (!(0, import_fs2.existsSync)(directory)) {
6344
6434
  (0, import_fs2.mkdirSync)(directory, { recursive: true });
6345
6435
  }
6346
- if (!(0, import_fs2.existsSync)((0, import_path2.join)(directory, `/tts`))) {
6347
- (0, import_fs2.mkdirSync)((0, import_path2.join)(directory, `/tts`), { recursive: true });
6348
- }
6349
- if (!(0, import_fs2.existsSync)((0, import_path2.join)(directory, `/encoded`))) {
6350
- (0, import_fs2.mkdirSync)((0, import_path2.join)(directory, `/encoded`), { recursive: true });
6351
- }
6352
- const tmpTTS = (0, import_path2.join)(directory, `/tts/${title}.wav`);
6353
- 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`);
6354
6438
  const vPlatform = (0, import_os2.platform)();
6355
6439
  if (vPlatform === "darwin") {
6356
- setWarning({
6440
+ SetWarning({
6357
6441
  title: `EAS`,
6358
6442
  message: `EAS tone generation is not supported on macOS.`
6359
6443
  });
6360
6444
  return null;
6361
6445
  }
6362
6446
  yield new Promise((resolve6, reject) => {
6363
- const tMsg = getCleanDescription(message);
6364
- getTTS(tMsg, tmpTTS).then(() => {
6447
+ const tMsg = GetCleanDescription(message);
6448
+ GetTTS(tMsg, tmpTTS).then(() => {
6365
6449
  resolve6();
6366
6450
  });
6367
6451
  });
@@ -6369,19 +6453,19 @@ var setEasTone = (options) => __async(null, null, function* () {
6369
6453
  return null;
6370
6454
  }
6371
6455
  buffTTS = (0, import_fs2.readFileSync)(tmpTTS);
6372
- const vWav = getWavPCM16(buffTTS);
6373
- const vSamples = getSampledPCM16(vWav.samples, vWav.sampleRate, 8e3);
6374
- 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);
6375
6459
  if ((0, import_fs2.existsSync)(prefix)) {
6376
6460
  let tBuffer = (0, import_fs2.readFileSync)(prefix);
6377
- let tWav = getWavPCM16(tBuffer);
6461
+ let tWav = GetWavPCM16(tBuffer);
6378
6462
  if (tWav == null) {
6379
6463
  try {
6380
- const converted = (0, import_path2.join)(directory, `/tts/${title}.converted.wav`);
6464
+ const converted = (0, import_path2.join)(directory, `/${title}-tts-fixed.wav`);
6381
6465
  (0, import_child_process2.execSync)(`ffmpeg -y -i "${prefix}" -ar 8000 -ac 1 -sample_fmt s16 "${converted}"`, { stdio: "ignore" });
6382
6466
  if ((0, import_fs2.existsSync)(converted)) {
6383
6467
  tBuffer = (0, import_fs2.readFileSync)(converted);
6384
- tWav = getWavPCM16(tBuffer);
6468
+ tWav = GetWavPCM16(tBuffer);
6385
6469
  try {
6386
6470
  (0, import_fs2.unlinkSync)(converted);
6387
6471
  } catch (e) {
@@ -6391,41 +6475,41 @@ var setEasTone = (options) => __async(null, null, function* () {
6391
6475
  }
6392
6476
  }
6393
6477
  if (tWav == null) {
6394
- 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.` });
6395
6479
  return null;
6396
6480
  }
6397
- const tSamples = tWav.sampleRate != 8e3 ? getSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
6398
- buffRadio = setRadioEffect(tSamples, 8e3);
6481
+ const tSamples = tWav.sampleRate != 8e3 ? GetSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
6482
+ buffRadio = SetRadioEffect(tSamples, 8e3);
6399
6483
  }
6400
6484
  buffFull = buffRadio != null ? [buffRadio, new Int16Array(Math.floor(0.5 * 8e3))] : [];
6401
6485
  buffFull.push(
6402
- setSameHeader(header, 3, 8e3, {
6486
+ SetSameHeader(header, 3, 8e3, {
6403
6487
  preMarkSec: 1.1,
6404
6488
  gapSec: 0.5
6405
6489
  }),
6406
6490
  new Int16Array(Math.floor(0.5 * 8e3)),
6407
- setAttentionTone(8, 8e3),
6491
+ SetAttentionTone(8, 8e3),
6408
6492
  new Int16Array(Math.floor(0.5 * 8e3)),
6409
6493
  vRadio
6410
6494
  );
6411
6495
  for (let i = 0; i < 3; i++) {
6412
- 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 }));
6413
6497
  buffFull.push(new Int16Array(Math.floor(0.5 * 8e3)));
6414
6498
  }
6415
- const aSamples = getMergedPCM16(buffFull);
6416
- const aFinal = setNoise(aSamples, 2e-3);
6417
- 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);
6418
6502
  (0, import_fs2.writeFileSync)(outTTS, aBuffer);
6419
6503
  try {
6420
6504
  (0, import_fs2.unlinkSync)(tmpTTS);
6421
6505
  } catch (e) {
6422
6506
  }
6423
- setDebug({ title: `@eas.setEasTone`, message: `EAS tone generation took ${performance.now() - tick} ms` });
6507
+ SetDebug({ title: `GenerateEASMessage`, message: `${Math.round(performance.now() - tick)}ms` });
6424
6508
  return outTTS;
6425
6509
  });
6426
6510
 
6427
- // src/@parsers/@text/text.getEmbedText.ts
6428
- var getEmebedText = (event) => {
6511
+ // src/@parsers/@text/GetEmbededText.ts
6512
+ var GetEmebedText = (event) => {
6429
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;
6430
6514
  const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6431
6515
  const isStatement = event.properties.status_metadata.is_statement;
@@ -6462,44 +6546,46 @@ var getEmebedText = (event) => {
6462
6546
  ].filter(Boolean).join("\n");
6463
6547
  };
6464
6548
 
6465
- // src/@parsers/@text/text.getStringText.ts
6466
- var getStringText = (event) => {
6467
- 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`;
6468
6554
  const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6469
6555
  const isStatement = event.properties.status_metadata.is_statement;
6470
6556
  const isExpired = event.properties.status_metadata.is_expired;
6471
6557
  return [
6472
- line(`Locations:`, (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.locations) == null ? void 0 : _b.slice(0, 100)),
6473
- line(`Issued:`, new Date(event.properties.issued).toUTCString(), !isExpired),
6474
- line(`Expires:`, new Date(event.properties.expires).toUTCString(), !isStatement),
6475
- line(`Damage Threat:`, (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat, !isExpired),
6476
- line(`Flood Threat:`, (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.flood_threat, !isExpired),
6477
- line(`Tornado Threat:`, (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.parameters) == null ? void 0 : _h.tornado_threat, !isExpired),
6478
- 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),
6479
- 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),
6480
- line(`Discussion:`, (_z = (_y = event == null ? void 0 : event.properties) == null ? void 0 : _y.discussion_parameters) == null ? void 0 : _z.discussion_number, !isExpired),
6481
- line(`Concern:`, (_B = (_A = event == null ? void 0 : event.properties) == null ? void 0 : _A.discussion_parameters) == null ? void 0 : _B.discussion_concerning, !isExpired),
6482
- 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),
6483
- 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),
6484
- 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),
6485
- 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),
6486
- line(`Watch Number:`, (_N = (_M = event == null ? void 0 : event.properties) == null ? void 0 : _M.watch_parameters) == null ? void 0 : _N.watch_number, !isExpired),
6487
- 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),
6488
- 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),
6489
- 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),
6490
- 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),
6491
- 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),
6492
- 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),
6493
- 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),
6494
- 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),
6495
- 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),
6496
- 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),
6497
- 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)
6498
6584
  ].filter(Boolean).join("\n");
6499
6585
  };
6500
6586
 
6501
- // src/@modules/@utilities/utilities.createHttp.ts
6502
- var createHttp = (options) => __async(null, null, function* () {
6587
+ // src/@modules/@utilities/CreateHttp.ts
6588
+ var CreateHttp = (options) => __async(null, null, function* () {
6503
6589
  var _a, _b, _c, _d;
6504
6590
  const requestOptions = {
6505
6591
  method: (_a = options.method) != null ? _a : "GET",
@@ -6541,8 +6627,8 @@ var createHttp = (options) => __async(null, null, function* () {
6541
6627
  }
6542
6628
  });
6543
6629
 
6544
- // src/@modules/@utilities/utilities.getMatched.ts
6545
- var getMatched = (strings, string) => {
6630
+ // src/@modules/@utilities/GetMatched.ts
6631
+ var GetMatched = (strings, string) => {
6546
6632
  const isMatched = strings.some((pattern) => {
6547
6633
  if (!pattern) return false;
6548
6634
  const lowerP = pattern.toLowerCase();
@@ -6557,146 +6643,204 @@ var getMatched = (strings, string) => {
6557
6643
  return isMatched;
6558
6644
  };
6559
6645
 
6560
- // src/@manager/manager.updateListener.ts
6561
- var import_fs3 = require("fs");
6562
- var updateListener = (event) => __async(null, null, function* () {
6563
- 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;
6564
6650
  const tick = performance.now();
6565
6651
  const settings = bootstrap.settings;
6566
- const listeners2 = settings.ListenerSettings;
6567
- const properties2 = event.properties;
6568
- const metadata = {
6569
- file: null,
6570
- eas: null,
6571
- json: null,
6572
- name: properties2.event,
6573
- status: properties2.status,
6574
- description: properties2.description,
6575
- tracking: properties2.metadata.tracking,
6576
- header: properties2.metadata.header,
6577
- raw: properties2.metadata.raw,
6578
- expired: properties2.status_metadata.is_expired,
6579
- attachments: properties2.metadata.attachments
6580
- };
6581
- for (const listener2 of listeners2) {
6582
- const events = listener2 == null ? void 0 : listener2.Events;
6583
- const webhook = listener2 == null ? void 0 : listener2.Webhook;
6584
- const notify = listener2 == null ? void 0 : listener2.NotificationServer;
6585
- const uploads = listener2 == null ? void 0 : listener2.Uploads;
6586
- const isMatched = getMatched(events != null ? events : [], metadata.name);
6587
- if ((events == null ? void 0 : events.length) == 0 || isMatched) {
6588
- if (uploads == null ? void 0 : uploads.EAS) {
6589
- metadata.eas = yield setEasTone({
6590
- title: `${metadata.name}_${metadata.status}_${metadata.tracking}`,
6591
- message: metadata.description,
6592
- header: metadata.header
6593
- });
6594
- }
6595
- if (uploads == null ? void 0 : uploads.File) {
6596
- const fDestination = settings.GlobalSettings.ArchiveSettings.TextDirectory;
6597
- if (fDestination) {
6598
- const file = `${fDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.txt`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6599
- if (!(0, import_fs3.existsSync)(fDestination)) {
6600
- (0, import_fs3.mkdirSync)(fDestination, { recursive: true });
6601
- }
6602
- if ((0, import_fs3.existsSync)(file)) {
6603
- (0, import_fs3.appendFileSync)(file, metadata.raw);
6604
- } else {
6605
- (0, import_fs3.writeFileSync)(file, metadata.raw);
6606
- }
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
+ });
6607
6700
  }
6608
- metadata.file = metadata.raw;
6609
- }
6610
- if (uploads == null ? void 0 : uploads.JSON) {
6611
- const eDestination = settings.GlobalSettings.ArchiveSettings.EventDirectory;
6612
- if (eDestination) {
6613
- const file = `${eDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.json`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
6614
- if (!(0, import_fs3.existsSync)(eDestination)) {
6615
- (0, import_fs3.mkdirSync)(eDestination, { recursive: true });
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
+ });
6616
6711
  }
6617
- (0, import_fs3.writeFileSync)(file, JSON.stringify(getCleanedEvent(event), null, 2));
6618
- }
6619
- metadata.json = JSON.stringify(getCleanedEvent(event), null, 2);
6620
- }
6621
- 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)) {
6622
- const server = settings == null ? void 0 : settings.NotifyServer;
6623
- 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;
6624
- 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;
6625
- yield createHttp(__spreadProps(__spreadValues({
6626
- 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}`,
6627
- timeout: 15e3,
6628
- method: "POST"
6629
- }, auth && { auth }), {
6630
- headers: __spreadValues({
6631
- "Title": `${metadata.name} (${metadata.status})`,
6632
- "Tags": (_j = (_i = properties2.parameters.tags) == null ? void 0 : _i.join(",")) != null ? _j : "N/A",
6633
- "Expires": new Date(properties2.expires).getTime(),
6634
- "Priority": (notify == null ? void 0 : notify.Priority) ? notify.Priority.toString() : "5"
6635
- }, attachment && { "Attach": attachment }),
6636
- body: getStringText(event)
6637
- }));
6638
- }
6639
- if ((webhook == null ? void 0 : webhook.Enabled) && (webhook == null ? void 0 : webhook.Destination)) {
6640
- const isRatelimited = setTimeoutAction({ identifier: webhook.Destination, interval: ((_k = webhook.Ratelimit) != null ? _k : 2) * 2, max: (_l = webhook.Ratelimit) != null ? _l : 2, addTime: true });
6641
- const form = new FormData();
6642
- const embed = {
6643
- title: `${metadata.name} (${metadata.status})`,
6644
- description: getEmebedText(event),
6645
- fields: [],
6646
- color: 16711680,
6647
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6648
- footer: { text: (_m = webhook.Title) != null ? _m : `AtmosphericX` }
6649
- };
6650
- if (isRatelimited.limited) {
6651
- return;
6712
+ metadata.text = metadata.raw;
6652
6713
  }
6653
- if (metadata.description && !metadata.expired) {
6654
- if (metadata.description.length > 900) {
6655
- metadata.description = metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]";
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
+ });
6656
6724
  }
6657
- embed.fields.push({
6658
- name: "Description",
6659
- value: metadata.description ? "```\n" + metadata.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
6660
- });
6725
+ metadata.json = cleanedEventText;
6661
6726
  }
6662
- if (((_n = metadata.attachments) == null ? void 0 : _n.length) > 0) {
6663
- metadata.attachments = metadata.attachments.slice(0, 5);
6664
- embed.fields.push({
6665
- name: "Attachments",
6666
- value: metadata.attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
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}`,
6764
+ timeout: 15e3,
6765
+ method: "PUT"
6766
+ }, auth && { auth }), {
6767
+ headers: __spreadValues({
6768
+ "Title": `${metadata.name} (${metadata.status})`,
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
6773
+ }));
6774
+ SetDebug({
6775
+ title: "Tasks/NTFY",
6776
+ message: `${Math.round(performance.now() - t2)}ms`
6667
6777
  });
6668
6778
  }
6669
- if (uploads == null ? void 0 : uploads.File) {
6670
- form.append("fUpload", new Blob([Buffer.from(metadata.file)], { type: "application/text" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.txt`);
6671
- }
6672
- if (uploads == null ? void 0 : uploads.JSON) {
6673
- form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.json`);
6674
- }
6675
- if (uploads == null ? void 0 : uploads.EAS) {
6676
- if (metadata.eas) {
6677
- const file = (0, import_fs3.readFileSync)(metadata.eas);
6678
- form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}_eas.mp3`);
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;
6679
6793
  }
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
6830
+ });
6831
+ SetDebug({
6832
+ title: "Tasks/Webhook",
6833
+ message: `${Math.round(performance.now() - t2)}ms`
6834
+ });
6680
6835
  }
6681
- form.append("payload_json", JSON.stringify({
6682
- username: (_o = webhook.Title) != null ? _o : "AtmosphericX",
6683
- content: (_p = webhook.Message) != null ? _p : "",
6684
- embeds: [embed]
6685
- }));
6686
- yield createHttp({
6687
- url: webhook.Destination,
6688
- timeout: 15e3,
6689
- method: `POST`,
6690
- body: form
6691
- });
6692
6836
  }
6693
6837
  }
6694
6838
  }
6695
- setDebug({ title: `@manager.updateListener`, message: `Listener took ${performance.now() - tick} ms` });
6839
+ SetDebug({ title: `Tasks`, message: `${Math.round(performance.now() - tick)}ms` });
6696
6840
  });
6697
6841
 
6698
- // src/@modules/@utilities/utilities.getShapeNearestPoint.ts
6699
- var getShapeNearestPoint = (coordinates, point) => {
6842
+ // src/@modules/@utilities/GetShapeNearestPoint.ts
6843
+ var GetShapeNearestPoint = (coordinates, point) => {
6700
6844
  if (!coordinates || !point) {
6701
6845
  return { proximity: false, point: [0, 0], distance: null };
6702
6846
  }
@@ -6786,18 +6930,21 @@ var getShapeNearestPoint = (coordinates, point) => {
6786
6930
  return { proximity: distanceMiles === 0, point: closestPoint, distance: distanceMiles, distanceKm, distanceMeters };
6787
6931
  };
6788
6932
 
6789
- // src/@building/building.polygon.ts
6790
- var getEventNodes = (event) => __async(null, null, function* () {
6933
+ // src/@building/GetEventNodes.ts
6934
+ var GetEventNodes = (event) => __async(null, null, function* () {
6791
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
+ }
6792
6940
  const metadata = { nodes: [], proximity: false, filtered: false };
6793
- const geometry = yield getEventGeometry(event);
6941
+ const geometry = yield GetEventGeometry(event);
6794
6942
  if (!geometry || !geometry.coordinates) {
6795
6943
  return { nodes: [], filtered: false, updated: Date.now() };
6796
6944
  }
6797
- const nodes = bootstrap.cache.nodes.features;
6798
6945
  for (const node of nodes) {
6799
6946
  const [longitude, latitude] = node.geometry.coordinates;
6800
- const getPoint = getShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
6947
+ const getPoint = GetShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
6801
6948
  const miles = (_a = getPoint.distance) != null ? _a : null;
6802
6949
  const kilometers = Number((miles * 1.609344).toFixed(3));
6803
6950
  const info = {
@@ -6806,10 +6953,10 @@ var getEventNodes = (event) => __async(null, null, function* () {
6806
6953
  nearest: getPoint.point,
6807
6954
  miles,
6808
6955
  kilometers,
6809
- proximity: getPoint.proximity
6956
+ proximity: false
6810
6957
  };
6811
6958
  metadata.nodes.push(info);
6812
- 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) {
6813
6960
  metadata.proximity = true;
6814
6961
  info.proximity = true;
6815
6962
  }
@@ -6821,19 +6968,20 @@ var getEventNodes = (event) => __async(null, null, function* () {
6821
6968
  };
6822
6969
  });
6823
6970
 
6824
- // src/@manager/manager.updateNodes.ts
6825
- var updateNode = (selectedEvent) => __async(null, null, function* () {
6971
+ // src/@manager/UpdateNode.ts
6972
+ var UpdateNode = (selectedEvent) => __async(null, null, function* () {
6826
6973
  const events = bootstrap.cache.events.features;
6827
6974
  const ttl = bootstrap.settings.GlobalSettings.NodeTTL * 1e3;
6828
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;
6829
6982
  function update(evt) {
6830
6983
  return __async(this, null, function* () {
6831
- var _a, _b, _c;
6832
- const lastUpdate = (_c = (_b = (_a = evt == null ? void 0 : evt.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.updated) != null ? _c : null;
6833
- if (lastUpdate != null && Date.now() - lastUpdate < ttl) {
6834
- return evt;
6835
- }
6836
- const node = yield getEventNodes(evt);
6984
+ const node = yield GetEventNodes(evt);
6837
6985
  if (node.nodes.length > 0) {
6838
6986
  total++;
6839
6987
  }
@@ -6842,16 +6990,13 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
6842
6990
  evt.properties.metadata.updated = node.updated;
6843
6991
  });
6844
6992
  }
6845
- if (!selectedEvent) {
6846
- yield Promise.all(events.map((evt) => __async(null, null, function* () {
6847
- yield update(evt);
6848
- })));
6849
- }
6850
- if (selectedEvent) {
6851
- 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)));
6852
6997
  }
6853
6998
  if (total > 0) {
6854
- setEventEmit({
6999
+ SetEventEmit({
6855
7000
  event: `onNodeUpdate`,
6856
7001
  metadata: {
6857
7002
  type: `global-update`,
@@ -6861,103 +7006,121 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
6861
7006
  }
6862
7007
  });
6863
7008
 
6864
- // src/@manager/manager.mkEvent.ts
6865
- var mkEvent = (event) => __async(null, null, function* () {
7009
+ // src/@manager/MakeEvents.ts
7010
+ var MakeEvents = (events) => __async(null, null, function* () {
6866
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 = [];
6867
7013
  const settings = bootstrap.settings;
6868
- const features = bootstrap.cache.events.features;
6869
- const getHash = event.properties.metadata.hash;
6870
- const getTracking = event.properties.metadata.tracking;
6871
- const isEntry = (_a = bootstrap.cache.hashes) == null ? void 0 : _a.find((hash) => hash.tracking === getTracking);
6872
- const isHashed = (_c = (_b = isEntry == null ? void 0 : isEntry.hashes) == null ? void 0 : _b.includes(getHash)) != null ? _c : false;
6873
- const getFeature = features.find((feature) => feature.properties.metadata.tracking === getTracking);
6874
- if (isHashed || event.properties.status_metadata.is_expired) return;
6875
- setHash(event, isEntry);
6876
- const isFilteredLocation = yield updateNode(event).then(() => event.properties.metadata.filtered_proximity);
6877
- if (!isFilteredLocation && !dict_global.includes(event.properties.event.toLowerCase()) && settings.GlobalSettings.EventFiltering.NodeLocationFiltering) {
6878
- return;
6879
- }
6880
- const isRatelimited = setTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
6881
- if (!isRatelimited.limited) {
6882
- setEventEmit({
6883
- event: `onEventStatus`,
6884
- metadata: {
6885
- type: getFeature ? `Updated` : `New`,
6886
- event
6887
- },
6888
- message: `[${getFeature ? "Updated" : "New"}] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
6889
- });
6890
- }
6891
- if (settings.GlobalSettings.EventManagement) {
6892
- if (event.properties.status_metadata.is_issued || event.properties.status_metadata.is_updated) {
6893
- if (getFeature) {
6894
- const getIndex = features.indexOf(getFeature);
6895
- const cHistory = (_f = (_e = (_d = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _d.metadata) == null ? void 0 : _e.history) != null ? _f : [];
6896
- 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 : [];
6897
- const cUgc = (_l = (_k = (_j = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _j.geocode) == null ? void 0 : _k.ugc) != null ? _l : [];
6898
- const iHistory = (_o = (_n = (_m = event.properties) == null ? void 0 : _m.metadata) == null ? void 0 : _n.history) != null ? _o : [];
6899
- const iLocations = (_r = (_q = (_p = event.properties) == null ? void 0 : _p.locations) == null ? void 0 : _q.split(";").map((l) => l.trim())) != null ? _r : [];
6900
- const iUgc = (_u = (_t = (_s = event.properties) == null ? void 0 : _s.geocode) == null ? void 0 : _t.ugc) != null ? _u : [];
6901
- 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);
6902
- const mLocations = [...cLocations, ...iLocations].filter((v, i, a) => a.indexOf(v) === i).join("; ");
6903
- const mUgc = [...cUgc, ...iUgc].filter((v, i, a) => a.indexOf(v) === i);
6904
- bootstrap.cache.events.features[getIndex] = __spreadProps(__spreadValues({}, event), {
6905
- properties: __spreadProps(__spreadValues({}, event.properties), {
6906
- metadata: __spreadProps(__spreadValues({}, (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.metadata), {
6907
- history: mHistory
6908
- }),
6909
- locations: mLocations,
6910
- geocode: __spreadProps(__spreadValues({}, (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.geocode), {
6911
- 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
+ })
6912
7064
  })
6913
- })
6914
- });
6915
- yield updateListener(bootstrap.cache.events.features[getIndex]);
6916
- } else {
6917
- features.push(event);
6918
- yield updateListener(event);
7065
+ });
7066
+ tasked.push(bootstrap.cache.events.features[getIndex]);
7067
+ } else {
7068
+ features.push(event);
7069
+ tasked.push(event);
7070
+ }
6919
7071
  }
6920
7072
  }
6921
7073
  }
7074
+ yield Tasks(tasked);
7075
+ SetEventEmit({ event: `onEventCache`, metadata: bootstrap.cache.events, limited: true });
6922
7076
  });
6923
7077
 
6924
- // src/@manager/manager.rmEvent.ts
6925
- var rmEvent = (event) => __async(null, null, function* () {
6926
- const gSelect = event;
6927
- const gEvent = bootstrap.cache.events.features.find((f) => {
6928
- var _a, _b, _c, _d;
6929
- return ((_b = (_a = f == null ? void 0 : f.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.tracking) === ((_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.metadata) == null ? void 0 : _d.tracking);
7078
+ // src/@enums/Strings.ts
7079
+ var EnumStrings = {
7080
+ cancellation: `{EVENT} has been allowed to expire. This event is no longer in effect.`
7081
+ };
7082
+
7083
+ // src/@manager/RemoveEvent.ts
7084
+ var RemoveEvent = (event, isTimeBasedExpiration) => __async(null, null, function* () {
7085
+ const gTracking = event.properties.metadata.tracking;
7086
+ const isTrackingEventLogged = bootstrap.cache.events.features.find((f) => {
7087
+ var _a, _b;
7088
+ return ((_b = (_a = f == null ? void 0 : f.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.tracking) === gTracking;
6930
7089
  });
6931
- const gStatement = event.properties.status_metadata.is_statement;
6932
- gSelect.properties.expires = (/* @__PURE__ */ new Date()).toISOString();
6933
- gSelect.properties.status = `Expired`;
6934
- gSelect.properties.status_metadata.is_expired = true;
6935
- if (gEvent) {
6936
- if (!gStatement) {
6937
- setEventEmit({
7090
+ const isStatement = event.properties.status_metadata.is_statement;
7091
+ if (isTrackingEventLogged) {
7092
+ event.properties.expires = (/* @__PURE__ */ new Date()).toISOString();
7093
+ event.properties.status = `Expired`;
7094
+ event.properties.status_metadata.is_expired = true;
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;
7098
+ event.properties.metadata.history.push({
7099
+ description: isTimeBasedExpiration ? description : event.properties.description,
7100
+ issued: event.properties.expires,
7101
+ status: event.properties.status
7102
+ });
7103
+ bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(isTrackingEventLogged), 1);
7104
+ bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== gTracking);
7105
+ if (!isStatement) {
7106
+ SetEventEmit({
6938
7107
  event: `onEventStatus`,
6939
- metadata: {
6940
- type: `Removed`,
6941
- event
6942
- },
6943
- message: `[Removed] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
7108
+ metadata: { type: `Removed`, event },
7109
+ message: `[Removed] ${event.properties.event} (${event.properties.status}) (${gTracking})`
6944
7110
  });
6945
- setEventEmit({ event: `onExpiredProduct`, metadata: event });
7111
+ yield Tasks([event]);
6946
7112
  }
6947
- bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(gEvent), 1);
6948
- bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== event.properties.metadata.tracking);
6949
- setTimeoutAction({ identifier: event.properties.metadata.tracking, expire: true });
6950
- if (!gStatement) yield updateListener(gSelect);
7113
+ SetTimeoutAction({ identifier: gTracking, expire: true });
6951
7114
  }
6952
- setEventEmit({
7115
+ SetEventEmit({
6953
7116
  event: `onEventCache`,
6954
7117
  metadata: bootstrap.cache.events,
6955
7118
  limited: true
6956
7119
  });
6957
7120
  });
6958
7121
 
6959
- // src/@dictionaries/dictionaries.states.ts
6960
- var dict_states = {
7122
+ // src/@enums/States.ts
7123
+ var EnumStates = {
6961
7124
  "AL": "Alabama",
6962
7125
  "AK": "Alaska",
6963
7126
  "AZ": "Arizona",
@@ -7011,8 +7174,8 @@ var dict_states = {
7011
7174
  "DC": "District of Columbia"
7012
7175
  };
7013
7176
 
7014
- // src/@modules/@utilities/utilities.getLatestIssuance.ts
7015
- var getLatestIssuance = () => {
7177
+ // src/@modules/@utilities/GetLatestIssuance.ts
7178
+ var GetLatestIssuance = () => {
7016
7179
  const now = /* @__PURE__ */ new Date();
7017
7180
  const current = now.getUTCHours() * 100 + now.getUTCMinutes();
7018
7181
  const issuances = [100, 600, 1300, 1630, 2e3];
@@ -7025,11 +7188,12 @@ var getLatestIssuance = () => {
7025
7188
  return latest.toString().padStart(4, "0");
7026
7189
  };
7027
7190
 
7028
- // src/@building/building.attachments.ts
7029
- var getEventAttachments = (event) => {
7191
+ // src/@building/GetEventAttachments.ts
7192
+ var GetEventAttachments = (event) => {
7030
7193
  var _a, _b, _c, _d, _e, _f, _g;
7031
7194
  let attachments = [];
7032
- const issuanceTime = getLatestIssuance();
7195
+ const settings = bootstrap.settings;
7196
+ const issuanceTime = GetLatestIssuance();
7033
7197
  const spcNumber = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.discussion_parameters) == null ? void 0 : _b.discussion_number;
7034
7198
  const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
7035
7199
  const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
@@ -7046,34 +7210,36 @@ var getEventAttachments = (event) => {
7046
7210
  if (events.find((e) => e.target === event.properties.event)) {
7047
7211
  attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target.toLowerCase() === event.properties.event.toLowerCase()).attachment });
7048
7212
  }
7049
- for (const location of locations) {
7050
- if (dict_expressions.location.test(location)) {
7051
- const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`];
7052
- const county = (_f = location == null ? void 0 : location.split(",")[0]) == null ? void 0 : _f.trim().replace(new RegExp(`^(${lines.join("|")}) `), "");
7053
- const state = dict_states[(_g = location == null ? void 0 : location.split(",")[1]) == null ? void 0 : _g.trim()];
7054
- const feeds = bootstrap.database.prepare(`SELECT * FROM broadcastify WHERE state = ? AND county = ?`).all(state, county).sort((a, b) => {
7055
- const typeOrder = ["Other", "Public Safety"];
7056
- const indexA = typeOrder.indexOf(a.type);
7057
- const indexB = typeOrder.indexOf(b.type);
7058
- return indexA - indexB;
7059
- });
7060
- const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
7061
- const filtered = feeds.filter((feed) => tags.includes(feed.type));
7062
- if (filtered.length > 0) {
7063
- filtered.map((filtered2) => {
7064
- if (!attachments.some((a) => a.link === filtered2.link)) {
7065
- attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
7066
- }
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;
7067
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
+ }
7068
7234
  }
7069
7235
  }
7070
7236
  }
7071
7237
  return attachments;
7072
7238
  };
7073
7239
 
7074
- // src/@building/building.validate.ts
7240
+ // src/@manager/ValidateEvents.ts
7075
7241
  var import_crypto = require("crypto");
7076
- var validateEvents = (events) => __async(null, null, function* () {
7242
+ var ValidateEvents = (events) => __async(null, null, function* () {
7077
7243
  const tick = performance.now();
7078
7244
  if (events.length === 0) return;
7079
7245
  const configurations = bootstrap.settings;
@@ -7091,21 +7257,21 @@ var validateEvents = (events) => __async(null, null, function* () {
7091
7257
  }
7092
7258
  const isFiltered = (define2) => {
7093
7259
  var _a, _b, _c, _d;
7094
- const properties2 = define2.properties;
7095
- const zones = properties2.geocode.ugc;
7096
- const icao = properties2.geocode.office.office;
7097
- if (properties2.status_metadata.is_test) {
7098
- 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 });
7099
7265
  if (bools == null ? void 0 : bools.IgnoreTestProducts) return true;
7100
7266
  }
7101
- if (properties2.status_metadata.is_expired) {
7102
- setEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7103
- rmEvent(define2);
7267
+ if (properties.status_metadata.is_expired) {
7268
+ SetEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7269
+ RemoveEvent(define2, false);
7104
7270
  return true;
7105
7271
  }
7106
- if (((_b = (_a = properties2.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties2.metadata.source != `events.api`) {
7107
- const isSPC = (_d = (_c = properties2.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
7108
- 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 });
7109
7275
  if ((bools == null ? void 0 : bools.SPCWatchesOnly) && !isSPC) {
7110
7276
  return true;
7111
7277
  }
@@ -7116,43 +7282,43 @@ var validateEvents = (events) => __async(null, null, function* () {
7116
7282
  for (const key in sets) {
7117
7283
  const setting = sets[key];
7118
7284
  const values = [...setting];
7119
- if (key === "ListeningEvents" && setting.size > 0 && !getMatched(values, define2.properties.event)) {
7120
- setEventEmit({
7285
+ if (key === "ListeningEvents" && setting.size > 0 && !GetMatched(values, define2.properties.event)) {
7286
+ SetEventEmit({
7121
7287
  event: `onFilteredEvent`,
7122
7288
  metadata: define2
7123
7289
  });
7124
7290
  return true;
7125
7291
  }
7126
- if (key === "IgnoredEvents" && setting.size > 0 && getMatched(values, define2.properties.event)) {
7127
- setEventEmit({
7292
+ if (key === "IgnoredEvents" && setting.size > 0 && GetMatched(values, define2.properties.event)) {
7293
+ SetEventEmit({
7128
7294
  event: `onIgnoredEvent`,
7129
7295
  metadata: define2
7130
7296
  });
7131
7297
  return true;
7132
7298
  }
7133
7299
  if (key === "ListeningICAO" && setting.size > 0 && icao != null && !setting.has(icao.toLowerCase())) {
7134
- setEventEmit({
7300
+ SetEventEmit({
7135
7301
  event: `onFilteredICAO`,
7136
7302
  metadata: define2
7137
7303
  });
7138
7304
  return true;
7139
7305
  }
7140
7306
  if (key === "IgnoredICAO" && setting.size > 0 && icao != null && setting.has(icao.toLowerCase())) {
7141
- setEventEmit({
7307
+ SetEventEmit({
7142
7308
  event: `onIgnoredICAO`,
7143
7309
  metadata: define2
7144
7310
  });
7145
7311
  return true;
7146
7312
  }
7147
- if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.toLowerCase()))) {
7148
- setEventEmit({
7313
+ if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.toLowerCase()))) {
7314
+ SetEventEmit({
7149
7315
  event: `onFilteredUGC`,
7150
7316
  metadata: define2
7151
7317
  });
7152
7318
  return true;
7153
7319
  }
7154
- if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.substring(0, 2).toLowerCase()))) {
7155
- setEventEmit({
7320
+ if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.substring(0, 2).toLowerCase()))) {
7321
+ SetEventEmit({
7156
7322
  event: `onFilteredState`,
7157
7323
  metadata: define2
7158
7324
  });
@@ -7162,37 +7328,29 @@ var validateEvents = (events) => __async(null, null, function* () {
7162
7328
  return false;
7163
7329
  };
7164
7330
  const filtering = events.filter((event) => {
7165
- var _a;
7166
7331
  bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
7167
- const define2 = getEventSignature(event);
7168
- const properties2 = define2.properties;
7169
- (_a = properties2 == null ? void 0 : properties2.metadata) == null ? true : delete _a.ms;
7170
- const enhanced = properties2.event = getEventEnhancedName(event);
7332
+ const define2 = GetEventSignature(event);
7333
+ const pre = __spreadProps(__spreadValues({}, define2), { properties: __spreadProps(__spreadValues({}, define2.properties), { metadata: __spreadValues({}, define2.properties.metadata) }) });
7334
+ const properties = define2.properties;
7335
+ delete pre.properties.metadata.ms;
7336
+ delete pre.properties.metadata.header;
7337
+ const enhanced = properties.event = GetEventEnhancedName(event);
7171
7338
  const filtered = isFiltered(define2);
7172
7339
  if (!filtered) {
7173
- event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? getEventGeometry(event) : null;
7174
- properties2.metadata.attachments = getEventAttachments(event);
7340
+ event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? GetEventGeometry(event) : null;
7341
+ properties.metadata.attachments = GetEventAttachments(event);
7175
7342
  }
7176
- properties2.metadata.hash = (0, import_crypto.createHash)("sha256").update(JSON.stringify(properties2)).digest("hex");
7177
- 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 });
7178
7345
  return !filtered;
7179
7346
  });
7180
- if (filtering.length > 0) {
7181
- for (const event of filtering) {
7182
- yield mkEvent(event);
7183
- }
7184
- }
7185
- yield updateNode();
7186
- setEventEmit({
7187
- event: `onEventCache`,
7188
- metadata: bootstrap.cache.events,
7189
- limited: true
7190
- });
7191
- 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` });
7192
7350
  });
7193
7351
 
7194
- // src/@building/building.create.ts
7195
- var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7352
+ // src/@building/CreateEvent.ts
7353
+ var CreateEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7196
7354
  const settings = bootstrap.settings;
7197
7355
  const StanzaSettings = settings.NOAAWeatherWireServiceSettings.StanzaSettings;
7198
7356
  const isVtecEvent = stanza.isVTEC && stanza.isUGC;
@@ -7201,26 +7359,26 @@ var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
7201
7359
  const isNWWS = stanza.isNWWS;
7202
7360
  switch (true) {
7203
7361
  case !isNWWS:
7204
- yield api(stanza);
7362
+ yield ParseAPI(stanza);
7205
7363
  break;
7206
7364
  case (isNWWS && !StanzaSettings.DisableVTEC && isVtecEvent):
7207
- yield vtec(stanza);
7365
+ yield ParseVTEC(stanza);
7208
7366
  break;
7209
7367
  case (isNWWS && !StanzaSettings.DisableUGC && isUgcEvent):
7210
- yield ugc(stanza);
7368
+ yield ParseUGC(stanza);
7211
7369
  break;
7212
7370
  case (isNWWS && !StanzaSettings.DisableText && isTextEvent):
7213
- yield text(stanza);
7371
+ yield ParseText(stanza);
7214
7372
  break;
7215
7373
  }
7216
7374
  if (!ignorePushing) {
7217
- validateEvents(bootstrap.cache.processed);
7375
+ yield ValidateEvents(bootstrap.cache.processed);
7218
7376
  }
7219
7377
  return "nothing picked";
7220
7378
  });
7221
7379
 
7222
- // src/@modules/@database/database.stanza.ts
7223
- var importStanza = (stanza) => __async(null, null, function* () {
7380
+ // src/@modules/@database/ImportStanza.ts
7381
+ var ImportStanza = (stanza) => __async(null, null, function* () {
7224
7382
  const settings = bootstrap.settings;
7225
7383
  try {
7226
7384
  if (!settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
@@ -7236,17 +7394,17 @@ var importStanza = (stanza) => __async(null, null, function* () {
7236
7394
  }
7237
7395
  }
7238
7396
  } catch (error) {
7239
- setWarning({ message: `An error occurred while importing stanza: ${error.message}` });
7397
+ SetWarning({ message: `An error occurred while importing stanza: ${error.message}` });
7240
7398
  }
7241
7399
  });
7242
7400
 
7243
- // src/@modules/@xmpp/xmpp.xStanza.ts
7244
- var xStanza = () => {
7401
+ // src/@modules/@xmpp/StanzaXMPP.ts
7402
+ var StanzaXMPP = () => {
7245
7403
  bootstrap.session_xmpp.on(`stanza`, (stanza) => __async(null, null, function* () {
7246
7404
  var _a, _b, _c, _d;
7247
7405
  const msgFrom = (_b = (_a = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _a.from) != null ? _b : ``;
7248
7406
  const msgType = (_d = (_c = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _c.type) != null ? _d : ``;
7249
- setEventEmit({
7407
+ SetEventEmit({
7250
7408
  event: `onServiceStatus`,
7251
7409
  metadata: {
7252
7410
  message: stanza,
@@ -7256,18 +7414,18 @@ var xStanza = () => {
7256
7414
  });
7257
7415
  bootstrap.cache.lastStanza = Date.now();
7258
7416
  if (stanza.is(`message`)) {
7259
- const result = validate({ stanza });
7417
+ const result = ValidateStanza({ stanza });
7260
7418
  const isSkippable = result.isIgnored || result.isCapEvent || result.isCapEvent && !result.isCapAreaDescription;
7261
7419
  if (isSkippable) {
7262
7420
  return;
7263
7421
  }
7264
- yield createEvent(result);
7265
- yield importStanza(result);
7422
+ yield CreateEvent(result);
7423
+ yield ImportStanza(result);
7266
7424
  }
7267
7425
  if (stanza.is(`presence`) && msgFrom.startsWith("nwws@conference.nwws-oi.weather.gov/")) {
7268
7426
  const getOccupant = msgFrom.split(`/`).slice(1).join(`/`);
7269
7427
  const getAvailability = msgType === `unavailable`;
7270
- setEventEmit({
7428
+ SetEventEmit({
7271
7429
  event: `onServiceStatus`,
7272
7430
  metadata: {
7273
7431
  message: `Occupant ${getOccupant} has ${getAvailability ? `left` : `joined`} the room`,
@@ -7280,8 +7438,8 @@ var xStanza = () => {
7280
7438
  }));
7281
7439
  };
7282
7440
 
7283
- // src/@modules/@xmpp/xmpp.xDeploy.ts
7284
- var xDeploy = () => __async(null, null, function* () {
7441
+ // src/@modules/@xmpp/DeployXMPP.ts
7442
+ var DeployXMPP = () => __async(null, null, function* () {
7285
7443
  var _a, _b;
7286
7444
  let session;
7287
7445
  const settings = bootstrap.settings;
@@ -7293,13 +7451,13 @@ var xDeploy = () => __async(null, null, function* () {
7293
7451
  password: settings.NOAAWeatherWireServiceSettings.CredentialSettings.Password
7294
7452
  });
7295
7453
  try {
7296
- yield xOffline();
7297
- yield xError();
7298
- yield xStanza();
7299
- yield xOnline();
7454
+ yield OfflineXMPP();
7455
+ yield ErrorXMPP();
7456
+ yield StanzaXMPP();
7457
+ yield OnlineXMPP();
7300
7458
  yield session.start();
7301
7459
  } catch (error) {
7302
- setEventEmit({
7460
+ SetEventEmit({
7303
7461
  event: `onServiceStatus`,
7304
7462
  metadata: {
7305
7463
  message: `Error occured while starting XMPP Session: ${error}`,
@@ -7311,8 +7469,8 @@ var xDeploy = () => __async(null, null, function* () {
7311
7469
  }
7312
7470
  });
7313
7471
 
7314
- // src/@dictionaries/dictionaries.shapefiles.ts
7315
- var dict_shapefiles = [
7472
+ // src/@enums/Shapefiles.ts
7473
+ var EnumShapefiles = [
7316
7474
  { name: "us_counties", id: "C", link: "https://www.weather.gov/source/gis/Shapefiles/County/c_16ap26.zip" },
7317
7475
  { name: "us_states_territories", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/County/s_16ap26.zip" },
7318
7476
  { name: "fire_weather_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/fz16ap26.zip" },
@@ -7324,8 +7482,8 @@ var dict_shapefiles = [
7324
7482
  { name: "high_seas_marine_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/hz17fe26.zip" }
7325
7483
  ];
7326
7484
 
7327
- // src/@modules/@utilities/utilities.setSleep.ts
7328
- var setSleep = (options) => __async(null, null, function* () {
7485
+ // src/@modules/@utilities/SetSleep.ts
7486
+ var SetSleep = (options) => __async(null, null, function* () {
7329
7487
  return new Promise((resolve6) => {
7330
7488
  setTimeout(() => {
7331
7489
  resolve6();
@@ -7333,31 +7491,31 @@ var setSleep = (options) => __async(null, null, function* () {
7333
7491
  });
7334
7492
  });
7335
7493
 
7336
- // src/@modules/@database/database.shapefiles.ts
7337
- var import_fs4 = require("fs");
7494
+ // src/@modules/@database/ImportShapefiles.ts
7495
+ var import_fs3 = require("fs");
7338
7496
  var import_path3 = require("path");
7339
7497
  var import_jszip = require("jszip");
7340
7498
  var import_shapefile = require("shapefile");
7341
- var importShapefiles = () => __async(null, null, function* () {
7499
+ var ImportShapefiles = () => __async(null, null, function* () {
7342
7500
  var _a, _b;
7343
7501
  const settings = bootstrap.settings;
7344
7502
  try {
7345
7503
  const tShapefiles = bootstrap.database.prepare(`SELECT COUNT(*) AS count FROM shapefiles`).get().count;
7346
7504
  if (tShapefiles === 0) {
7347
- yield setSleep({ timeout: 1e3 });
7348
- for (const shapefile of dict_shapefiles) {
7505
+ yield SetSleep({ timeout: 1e3 });
7506
+ for (const shapefile of EnumShapefiles) {
7349
7507
  const response2 = yield fetch(shapefile.link);
7350
7508
  const arrayBuff = yield response2.arrayBuffer();
7351
7509
  const content = yield (0, import_jszip.loadAsync)(arrayBuff);
7352
7510
  const directory = (0, import_path3.resolve)(__dirname, `../../shapefiles`);
7353
- if (!(0, import_fs4.existsSync)(directory)) {
7354
- (0, import_fs4.mkdirSync)(directory, { recursive: true });
7511
+ if (!(0, import_fs3.existsSync)(directory)) {
7512
+ (0, import_fs3.mkdirSync)(directory, { recursive: true });
7355
7513
  }
7356
7514
  for (const file of Object.keys(content.files)) {
7357
7515
  if (file.endsWith(".shp") || file.endsWith(".dbf")) {
7358
7516
  const data = yield content.files[file].async(`nodebuffer`);
7359
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)}`);
7360
- (0, import_fs4.writeFileSync)(output, data);
7518
+ (0, import_fs3.writeFileSync)(output, data);
7361
7519
  }
7362
7520
  }
7363
7521
  const filepath = (0, import_path3.resolve)(__dirname, "../../shapefiles", shapefile.name + "_" + shapefile.id);
@@ -7365,43 +7523,43 @@ var importShapefiles = () => __async(null, null, function* () {
7365
7523
  filepath,
7366
7524
  filepath
7367
7525
  );
7368
- 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` });
7369
7527
  const insert = bootstrap.database.prepare(`INSERT OR REPLACE INTO shapefiles (id, location, geometry) VALUES (?, ?, ?)`);
7370
7528
  const transaction = bootstrap.database.transaction((entries) => {
7371
7529
  var _a2, _b2, _c;
7372
7530
  for (const entry of entries) {
7373
- const { properties: properties2, geometry } = entry;
7531
+ const { properties, geometry } = entry;
7374
7532
  let final2, location;
7375
- if (properties2.FIPS) {
7376
- final2 = `${properties2.STATE}${shapefile.id}${properties2.FIPS.substring(2)}`;
7377
- location = `${properties2.COUNTYNAME}, ${properties2.STATE}`;
7378
- } else if (properties2.FULLSTAID) {
7379
- final2 = `${properties2.ST}${shapefile.id}${properties2.WFO}`;
7380
- location = `${properties2.CITY}, ${properties2.STATE}`;
7381
- } else if (properties2.STATE) {
7382
- final2 = `${properties2.STATE}${shapefile.id}${(_a2 = properties2.ZONE) != null ? _a2 : properties2.SITE_ID}`;
7383
- 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}`;
7384
7542
  } else {
7385
- final2 = (_c = properties2.ID) != null ? _c : properties2.WFO;
7386
- location = properties2.NAME;
7543
+ final2 = (_c = properties.ID) != null ? _c : properties.WFO;
7544
+ location = properties.NAME;
7387
7545
  }
7388
7546
  insert.run(final2, location, JSON.stringify(geometry));
7389
7547
  }
7390
7548
  });
7391
- (0, import_fs4.unlinkSync)(`${filepath}.shp`);
7392
- (0, import_fs4.unlinkSync)(`${filepath}.dbf`);
7549
+ (0, import_fs3.unlinkSync)(`${filepath}.shp`);
7550
+ (0, import_fs3.unlinkSync)(`${filepath}.dbf`);
7393
7551
  transaction(features);
7394
7552
  }
7395
- (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 }, () => {
7396
7554
  });
7397
7555
  }
7398
7556
  } catch (error) {
7399
- setWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
7557
+ SetWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
7400
7558
  }
7401
7559
  });
7402
7560
 
7403
- // src/@modules/@database/database.broadcastify.ts
7404
- var importBroadcastify = () => __async(null, null, function* () {
7561
+ // src/@modules/@database/ImportBroadcastify.ts
7562
+ var ImportBroadcastify = () => __async(null, null, function* () {
7405
7563
  const settings = bootstrap.settings;
7406
7564
  const isBroadcastifyImported = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
7407
7565
  if (!settings.BroadcastifySettings.BroadcastifyAttachments) {
@@ -7410,7 +7568,7 @@ var importBroadcastify = () => __async(null, null, function* () {
7410
7568
  if (isBroadcastifyImported) {
7411
7569
  return;
7412
7570
  }
7413
- const broadcastify = yield createHttp({
7571
+ const broadcastify = yield CreateHttp({
7414
7572
  url: settings.BroadcastifySettings.BroadcastifyDatabase,
7415
7573
  timeout: 5e3
7416
7574
  });
@@ -7425,7 +7583,7 @@ var importBroadcastify = () => __async(null, null, function* () {
7425
7583
  });
7426
7584
  const batch = [];
7427
7585
  for (const state of states) {
7428
- 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` });
7429
7587
  for (const county of state.counties) {
7430
7588
  const countyName = county.county;
7431
7589
  for (const feed of county.feeds) {
@@ -7441,17 +7599,20 @@ var importBroadcastify = () => __async(null, null, function* () {
7441
7599
  }
7442
7600
  transaction(batch);
7443
7601
  }
7602
+ if (broadcastify.error) {
7603
+ SetWarning({ message: `Error importing Broadcastify data: ${broadcastify.message}` });
7604
+ }
7444
7605
  });
7445
7606
 
7446
- // src/@modules/@database/database.init.ts
7447
- var import_fs5 = require("fs");
7607
+ // src/@modules/@database/InitializeDatabase.ts
7608
+ var import_fs4 = require("fs");
7448
7609
  var import_better_sqlite3 = __toESM(require("better-sqlite3"));
7449
- var initializeDatabase = () => __async(null, null, function* () {
7610
+ var InitializeDatabase = () => __async(null, null, function* () {
7450
7611
  const settings = bootstrap.settings;
7451
7612
  try {
7452
- if (!(0, import_fs5.existsSync)(settings.Database)) {
7453
- (0, import_fs5.writeFileSync)(settings.Database, "");
7454
- 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}` });
7455
7616
  }
7456
7617
  bootstrap.database = new import_better_sqlite3.default(settings.Database);
7457
7618
  bootstrap.database.prepare(`CREATE TABLE IF NOT EXISTS stanzas ( id INTEGER PRIMARY KEY AUTOINCREMENT, type TEXT, issued TEXT, stanza TEXT )`).run();
@@ -7459,18 +7620,18 @@ var initializeDatabase = () => __async(null, null, function* () {
7459
7620
  const isNeedingShapefiles = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='shapefiles';`).get();
7460
7621
  const isNeedingBroadcastify = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
7461
7622
  if (!isNeedingShapefiles || !isNeedingBroadcastify) {
7462
- 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.` });
7463
- yield importBroadcastify();
7464
- yield importShapefiles();
7465
- 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` });
7466
7627
  }
7467
7628
  } catch (error) {
7468
- setWarning({ message: `An error occurred while initializing the database: ${error.message}` });
7629
+ SetWarning({ message: `An error occurred while initializing the database: ${error.message}` });
7469
7630
  }
7470
7631
  });
7471
7632
 
7472
- // src/@modules/@database/database.cache.ts
7473
- var getCachedEvents = () => __async(null, null, function* () {
7633
+ // src/@modules/@database/GetCachedEvents.ts
7634
+ var GetCachedEvents = () => __async(null, null, function* () {
7474
7635
  var _a;
7475
7636
  try {
7476
7637
  const settings = bootstrap.settings;
@@ -7478,7 +7639,7 @@ var getCachedEvents = () => __async(null, null, function* () {
7478
7639
  if (settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
7479
7640
  const max = (_a = settings.NOAAWeatherWireServiceSettings.CacheSettings.MaxRetentionHistory) != null ? _a : 500;
7480
7641
  const get = yield bootstrap.database.prepare(`SELECT * FROM stanzas ORDER BY rowid DESC LIMIT ?`).all(max);
7481
- 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` });
7482
7643
  let events = get.map((row) => JSON.parse(row.stanza)).filter((stanza) => {
7483
7644
  if (!stanza) {
7484
7645
  return;
@@ -7487,21 +7648,21 @@ var getCachedEvents = () => __async(null, null, function* () {
7487
7648
  return !isSkippable;
7488
7649
  });
7489
7650
  events = events.sort((a, b) => b.issued - a.issued);
7490
- yield Promise.all(events.map((event) => createEvent(event, true)));
7491
- setWarning({ message: `Processed ${events.length} cached stanzas in ${Math.floor(performance.now() - tick)} ms` });
7492
- 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);
7493
7654
  }
7494
7655
  } catch (error) {
7495
- 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}` });
7496
7657
  }
7497
7658
  });
7498
7659
 
7499
- // src/@modules/@xmpp/xmpp.xReconnect.ts
7500
- var xReconnect = (interval) => __async(null, null, function* () {
7660
+ // src/@modules/@xmpp/ReconnectXMPP.ts
7661
+ var ReconnectXMPP = (interval) => __async(null, null, function* () {
7501
7662
  const settings = bootstrap.settings;
7502
7663
  const lastStanza = Date.now() - bootstrap.cache.lastStanza;
7503
7664
  if (interval < 15) {
7504
- 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` });
7505
7666
  interval = 15;
7506
7667
  bootstrap.settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval = 15;
7507
7668
  }
@@ -7515,7 +7676,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
7515
7676
  bootstrap.cache.isConnected = false;
7516
7677
  bootstrap.cache.tReconnects += 1;
7517
7678
  try {
7518
- setEventEmit({
7679
+ SetEventEmit({
7519
7680
  event: `onServiceStatus`,
7520
7681
  metadata: {
7521
7682
  message: `Attempting to reconnect to XMPP Service (Reconnect Attempt ${bootstrap.cache.tReconnects})`,
@@ -7533,7 +7694,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
7533
7694
  yield bootstrap.session_xmpp.start().catch(() => {
7534
7695
  });
7535
7696
  } catch (error) {
7536
- setWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
7697
+ SetWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
7537
7698
  } finally {
7538
7699
  bootstrap.cache.isReconnecting = false;
7539
7700
  }
@@ -7541,26 +7702,26 @@ var xReconnect = (interval) => __async(null, null, function* () {
7541
7702
  }
7542
7703
  });
7543
7704
 
7544
- // src/@modules/@utilities/utilities.setCronSchedule.ts
7545
- var import_fs6 = require("fs");
7705
+ // src/@modules/@utilities/SetCronSchedule.ts
7706
+ var import_fs5 = require("fs");
7546
7707
  var import_path4 = require("path");
7547
- var setCronSchedule = () => __async(null, null, function* () {
7708
+ var SetCronSchedule = () => __async(null, null, function* () {
7548
7709
  const settings = bootstrap.settings;
7549
7710
  const TTL = settings.GlobalSettings.ArchiveSettings.TTL;
7550
7711
  const TTLCUT = Date.now() - TTL * 1e3;
7551
7712
  const walk = (dir) => {
7552
- if ((0, import_fs6.existsSync)(dir)) {
7553
- 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 });
7554
7715
  for (const entry of entries) {
7555
7716
  const fullPath = (0, import_path4.join)(dir, entry.name);
7556
7717
  if (entry.isDirectory()) {
7557
7718
  walk(fullPath);
7558
7719
  continue;
7559
7720
  }
7560
- const stats = (0, import_fs6.statSync)(fullPath);
7721
+ const stats = (0, import_fs5.statSync)(fullPath);
7561
7722
  if (stats.mtime.getTime() < TTLCUT) {
7562
7723
  try {
7563
- (0, import_fs6.unlinkSync)(fullPath);
7724
+ (0, import_fs5.unlinkSync)(fullPath);
7564
7725
  } catch (err) {
7565
7726
  console.error(`Failed to delete ${fullPath}:`, err);
7566
7727
  }
@@ -7570,20 +7731,20 @@ var setCronSchedule = () => __async(null, null, function* () {
7570
7731
  };
7571
7732
  walk(settings.GlobalSettings.ArchiveSettings.TextDirectory);
7572
7733
  walk(settings.GlobalSettings.ArchiveSettings.EasDirectory);
7573
- walk(settings.GlobalSettings.ArchiveSettings.EventDirectory);
7734
+ walk(settings.GlobalSettings.ArchiveSettings.JSONDirectory);
7574
7735
  if (settings.EnableWireService) {
7575
7736
  if (settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.Enabled) {
7576
- void xReconnect(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
7737
+ void ReconnectXMPP(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
7577
7738
  }
7578
7739
  } else {
7579
- const response2 = yield createHttp({
7740
+ const response2 = yield CreateHttp({
7580
7741
  url: settings.NationalWeatherServiceSettings.EventsEndpoint,
7581
7742
  headers: {
7582
7743
  "User-Agent": "@atmosx/event-product-parser"
7583
7744
  }
7584
7745
  });
7585
7746
  if (response2.error) {
7586
- return setEventEmit({
7747
+ return SetEventEmit({
7587
7748
  event: `onServiceStatus`,
7588
7749
  metadata: {
7589
7750
  type: "fetch-api",
@@ -7593,7 +7754,7 @@ var setCronSchedule = () => __async(null, null, function* () {
7593
7754
  }
7594
7755
  });
7595
7756
  }
7596
- setEventEmit({
7757
+ SetEventEmit({
7597
7758
  event: `onServiceStatus`,
7598
7759
  metadata: {
7599
7760
  message: `Fetched latest events from National Weather Service API`,
@@ -7602,23 +7763,24 @@ var setCronSchedule = () => __async(null, null, function* () {
7602
7763
  error: false
7603
7764
  }
7604
7765
  });
7605
- createEvent({ message: response2.message, isNWWS: false });
7766
+ yield CreateEvent({ message: response2.message, isNWWS: false });
7606
7767
  }
7607
7768
  });
7608
7769
 
7609
- // src/@manager/manager.updateEvents.ts
7610
- var updateEvents = (selectedEvent) => __async(null, null, function* () {
7770
+ // src/@manager/UpdateEvents.ts
7771
+ var UpdateEvents = (selectedEvent) => __async(null, null, function* () {
7611
7772
  const events = bootstrap.cache.events.features;
7612
- function update(evt) {
7773
+ function update(event) {
7613
7774
  return __async(this, null, function* () {
7614
- if (new Date(evt.properties.expires) < /* @__PURE__ */ new Date()) {
7615
- yield rmEvent(evt);
7775
+ if (new Date(event.properties.expires) < /* @__PURE__ */ new Date()) {
7776
+ SetEventEmit({ event: `onExpiredProduct`, metadata: event });
7777
+ yield RemoveEvent(event, true);
7616
7778
  }
7617
7779
  });
7618
7780
  }
7619
7781
  if (!selectedEvent) {
7620
- yield Promise.all(events.map((evt) => __async(null, null, function* () {
7621
- yield update(evt);
7782
+ yield Promise.all(events.map((event) => __async(null, null, function* () {
7783
+ yield update(event);
7622
7784
  })));
7623
7785
  }
7624
7786
  if (selectedEvent) {
@@ -7626,41 +7788,41 @@ var updateEvents = (selectedEvent) => __async(null, null, function* () {
7626
7788
  }
7627
7789
  });
7628
7790
 
7629
- // src/@core/core.start.ts
7791
+ // src/@core/StartService.ts
7630
7792
  var import_croner = require("croner");
7631
- var startService = (configurations) => __async(null, null, function* () {
7793
+ var StartService = (configurations) => __async(null, null, function* () {
7632
7794
  if (!bootstrap.isReady) {
7633
- return setWarning({
7795
+ return SetWarning({
7634
7796
  message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
7635
7797
  });
7636
7798
  }
7637
- const settings = setSettings(configurations);
7799
+ const settings = SetSettings(configurations);
7638
7800
  bootstrap.isReady = true;
7639
- yield initializeDatabase();
7801
+ yield InitializeDatabase();
7640
7802
  if (settings.EnableWireService) {
7641
7803
  (() => __async(null, null, function* () {
7642
- yield getCachedEvents();
7643
- yield xDeploy();
7804
+ yield GetCachedEvents();
7805
+ yield DeployXMPP();
7644
7806
  }))();
7645
7807
  }
7646
- yield setCronSchedule();
7808
+ yield SetCronSchedule();
7647
7809
  let scheduleInterval = !settings.EnableWireService ? settings.NationalWeatherServiceSettings.CallbackInterval : 1;
7648
7810
  if (!settings.EnableWireService && scheduleInterval < 15) {
7649
- 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` });
7650
7812
  bootstrap.settings.NationalWeatherServiceSettings.CallbackInterval = 15;
7651
7813
  scheduleInterval = 15;
7652
7814
  }
7653
7815
  bootstrap.cron = new import_croner.Cron(`*/${scheduleInterval} * * * * *`, () => __async(null, null, function* () {
7654
- yield setCronSchedule();
7816
+ yield SetCronSchedule();
7655
7817
  }));
7656
7818
  bootstrap.cron = new import_croner.Cron(`* * * * * *`, () => __async(null, null, function* () {
7657
- yield updateNode();
7658
- yield updateEvents();
7819
+ yield UpdateNode();
7820
+ yield UpdateEvents();
7659
7821
  }));
7660
7822
  });
7661
7823
 
7662
- // src/@core/core.stop.ts
7663
- var stopService = () => __async(null, null, function* () {
7824
+ // src/@core/StopService.ts
7825
+ var StopService = () => __async(null, null, function* () {
7664
7826
  if (bootstrap.isReady) {
7665
7827
  bootstrap.isReady = false;
7666
7828
  if (bootstrap.session_xmpp) {
@@ -7675,15 +7837,15 @@ var stopService = () => __async(null, null, function* () {
7675
7837
  }
7676
7838
  });
7677
7839
 
7678
- // src/@core/core.setNode.ts
7679
- var setNode = (options) => {
7840
+ // src/@core/SetNode.ts
7841
+ var SetNode = (options) => {
7680
7842
  const nodes = bootstrap.cache.nodes.features;
7681
7843
  const exists = nodes.find((node) => node.properties.identifier === options.identifier);
7682
7844
  if (options.delete) {
7683
7845
  if (exists) {
7684
7846
  const index = nodes.indexOf(exists);
7685
7847
  nodes.splice(index, 1);
7686
- return setEventEmit({
7848
+ return SetEventEmit({
7687
7849
  event: `onNodeDelete`,
7688
7850
  metadata: {
7689
7851
  type: `node-delete`,
@@ -7691,7 +7853,7 @@ var setNode = (options) => {
7691
7853
  }
7692
7854
  });
7693
7855
  }
7694
- return setWarning({ message: `Node with identifier '${options.identifier}' not found.` });
7856
+ return SetWarning({ message: `Node with identifier '${options.identifier}' not found.` });
7695
7857
  }
7696
7858
  if (exists) {
7697
7859
  const index = nodes.indexOf(exists);
@@ -7701,7 +7863,7 @@ var setNode = (options) => {
7701
7863
  coordinates: [options.coordinates.longitude, options.coordinates.latitude]
7702
7864
  }
7703
7865
  });
7704
- return setEventEmit({
7866
+ return SetEventEmit({
7705
7867
  event: `onNodeUpdate`,
7706
7868
  metadata: {
7707
7869
  type: `node-update`,
@@ -7719,7 +7881,7 @@ var setNode = (options) => {
7719
7881
  identifier: options.identifier
7720
7882
  }
7721
7883
  });
7722
- return setEventEmit({
7884
+ return SetEventEmit({
7723
7885
  event: `onNodeAdd`,
7724
7886
  metadata: {
7725
7887
  type: `node-add`,
@@ -7728,34 +7890,53 @@ var setNode = (options) => {
7728
7890
  });
7729
7891
  };
7730
7892
 
7731
- // src/@core/core.getEvents.ts
7732
- var getEvents = () => {
7893
+ // src/@core/GetEvents.ts
7894
+ var GetEvents = () => {
7733
7895
  return bootstrap.cache.events;
7734
7896
  };
7735
7897
 
7736
- // src/@core/core.getNodes.ts
7737
- var getNodes = () => {
7898
+ // src/@core/GetNodes.ts
7899
+ var GetNodes = () => {
7738
7900
  return bootstrap.cache.nodes;
7739
7901
  };
7740
7902
 
7741
- // src/@core/core.manualEvent.ts
7742
- var manualEvent = (options) => __async(null, null, function* () {
7903
+ // src/@core/ManualEvent.ts
7904
+ var ManualEvent = (options) => __async(null, null, function* () {
7905
+ var _a;
7743
7906
  const isCapEvent = options.message.includes(`<?xml`);
7744
7907
  const isCapAreaDescription = options.message.includes(`<areaDesc>`);
7745
- const isVTEC = options.message.match(dict_expressions.pvtec) != null;
7746
- const isUGC = options.message.match(dict_expressions.ugc1) != null;
7747
- const getType = getAwipsType({ attributes: options.attributes });
7748
- const result = { message: options.message, attributes: options.attributes, isCapEvent, isVTEC, isUGC, isCapAreaDescription, isIgnored: false, isNWWS: true, getType };
7749
- 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);
7750
7931
  });
7751
7932
 
7752
- // src/@core/core.getRandomEvent.ts
7753
- var getRandomEvent = () => {
7933
+ // src/@core/GetRandomEvent.ts
7934
+ var GetRandomEvent = () => {
7754
7935
  return bootstrap.cache.events.features[Math.floor(Math.random() * bootstrap.cache.events.features.length)];
7755
7936
  };
7756
7937
 
7757
- // src/@core/core.query.ts
7758
- var query = (options) => __async(null, null, function* () {
7938
+ // src/@core/QueryStanza.ts
7939
+ var QueryStanza = (options) => __async(null, null, function* () {
7759
7940
  var _a;
7760
7941
  const get = yield bootstrap.database.prepare(
7761
7942
  `SELECT * FROM stanzas WHERE stanza LIKE ? LIMIT ?`
@@ -7764,11 +7945,11 @@ var query = (options) => __async(null, null, function* () {
7764
7945
  return events;
7765
7946
  });
7766
7947
 
7767
- // src/@core/core.clearEvents.ts
7768
- var clearEvents = () => {
7948
+ // src/@core/ClearEvents.ts
7949
+ var ClearEvents = () => {
7769
7950
  bootstrap.cache.events.features = [];
7770
7951
  bootstrap.cache.hashes = [];
7771
- setEventEmit({
7952
+ SetEventEmit({
7772
7953
  event: `onEventCache`,
7773
7954
  metadata: bootstrap.cache.events,
7774
7955
  message: `Manually cleared event cache.`
@@ -7779,17 +7960,17 @@ var clearEvents = () => {
7779
7960
  var Manager = class {
7780
7961
  constructor(settings) {
7781
7962
  this.trycatch();
7782
- startService(settings);
7963
+ StartService(settings);
7783
7964
  }
7784
7965
  on(event, callback) {
7785
- createListener(event, callback);
7966
+ CreateListener(event, callback);
7786
7967
  }
7787
7968
  trycatch() {
7788
7969
  process.on("uncaughtException", (err) => {
7789
7970
  var _a, _b;
7790
7971
  const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND", "ECONNREFUSED", "EPIPE", "EADDRINUSE", "EALREADY", "EACCES", "EAGAIN", "EHOSTDOWN", "STARTTLS_FAILURE"];
7791
7972
  if (ignored.includes(err == null ? void 0 : err.code)) {
7792
- setEventEmit({
7973
+ SetEventEmit({
7793
7974
  event: `onServiceStatus`,
7794
7975
  metadata: {
7795
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...`,
@@ -7800,25 +7981,25 @@ var Manager = class {
7800
7981
  });
7801
7982
  return;
7802
7983
  }
7803
- 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)}` });
7804
7985
  });
7805
7986
  }
7806
7987
  };
7807
7988
  var index_default = Manager;
7808
7989
  // Annotate the CommonJS export names for ESM import in node:
7809
7990
  0 && (module.exports = {
7991
+ ClearEvents,
7992
+ GenerateEASMessage,
7993
+ GetCleanedEvent,
7994
+ GetEventGeometry,
7995
+ GetEvents,
7996
+ GetNodes,
7997
+ GetRandomEvent,
7810
7998
  Manager,
7811
- clearEvents,
7812
- getCleanedEvent,
7813
- getEventGeometry,
7814
- getEvents,
7815
- getNodes,
7816
- getRandomEvent,
7817
- manualEvent,
7818
- query,
7819
- setEasTone,
7820
- setNode,
7821
- setSettings,
7822
- startService,
7823
- stopService
7999
+ ManualEvent,
8000
+ QueryStanza,
8001
+ SetNode,
8002
+ SetSettings,
8003
+ StartService,
8004
+ StopService
7824
8005
  });