@luxonis/visualizer-protobuf 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/{communicator-DKKKAI0H.js → FoxgloveServer-tJZcJH5-.js} +1216 -174
  2. package/dist/apps/depthai-visualizer/src/components/PanelToolbar.d.ts.map +1 -1
  3. package/dist/apps/depthai-visualizer/src/components/PanelToolbar.js +9 -10
  4. package/dist/apps/depthai-visualizer/src/components/PanelToolbar.js.map +1 -1
  5. package/dist/apps/depthai-visualizer/src/connection/adapter.d.ts +4 -7
  6. package/dist/apps/depthai-visualizer/src/connection/adapter.d.ts.map +1 -1
  7. package/dist/apps/depthai-visualizer/src/connection/adapter.js +5 -5
  8. package/dist/apps/depthai-visualizer/src/connection/adapter.js.map +1 -1
  9. package/dist/apps/depthai-visualizer/src/connection/communicator.d.ts +7 -13
  10. package/dist/apps/depthai-visualizer/src/connection/communicator.d.ts.map +1 -1
  11. package/dist/apps/depthai-visualizer/src/connection/communicator.js +5 -4
  12. package/dist/apps/depthai-visualizer/src/connection/communicator.js.map +1 -1
  13. package/dist/apps/depthai-visualizer/src/connection/connection.d.ts +8 -13
  14. package/dist/apps/depthai-visualizer/src/connection/connection.d.ts.map +1 -1
  15. package/dist/apps/depthai-visualizer/src/connection/connection.js +19 -22
  16. package/dist/apps/depthai-visualizer/src/connection/connection.js.map +1 -1
  17. package/dist/apps/depthai-visualizer/src/connection/foxglove-protocol.d.ts +6 -0
  18. package/dist/apps/depthai-visualizer/src/connection/foxglove-protocol.d.ts.map +1 -0
  19. package/dist/apps/depthai-visualizer/src/connection/foxglove-protocol.js +63 -0
  20. package/dist/apps/depthai-visualizer/src/connection/foxglove-protocol.js.map +1 -0
  21. package/dist/apps/depthai-visualizer/src/connection/webrtc/bridge.d.ts +2 -2
  22. package/dist/apps/depthai-visualizer/src/connection/webrtc/bridge.d.ts.map +1 -1
  23. package/dist/apps/depthai-visualizer/src/connection/webrtc/bridge.js +29 -49
  24. package/dist/apps/depthai-visualizer/src/connection/webrtc/bridge.js.map +1 -1
  25. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker-utils.d.ts +20 -20
  26. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker-utils.d.ts.map +1 -1
  27. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker-utils.js +34 -35
  28. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker-utils.js.map +1 -1
  29. package/dist/apps/depthai-visualizer/src/connection/ws/worker.d.ts +16 -1
  30. package/dist/apps/depthai-visualizer/src/connection/ws/worker.d.ts.map +1 -1
  31. package/dist/apps/depthai-visualizer/src/connection/ws/worker.js +114 -2
  32. package/dist/apps/depthai-visualizer/src/connection/ws/worker.js.map +1 -1
  33. package/dist/apps/depthai-visualizer/src/context/ConnectionsProvider.d.ts +1 -1
  34. package/dist/apps/depthai-visualizer/src/context/ConnectionsProvider.d.ts.map +1 -1
  35. package/dist/apps/depthai-visualizer/src/index.d.ts +1 -2
  36. package/dist/apps/depthai-visualizer/src/index.d.ts.map +1 -1
  37. package/dist/apps/depthai-visualizer/src/index.js +0 -1
  38. package/dist/apps/depthai-visualizer/src/index.js.map +1 -1
  39. package/dist/apps/depthai-visualizer/src/messaging/deserialization/detections/detection.js +2 -2
  40. package/dist/apps/depthai-visualizer/src/messaging/deserialization/detections/detection.js.map +1 -1
  41. package/dist/apps/depthai-visualizer/src/messaging/deserialization/detections/utils.d.ts.map +1 -1
  42. package/dist/apps/depthai-visualizer/src/messaging/deserialization/detections/utils.js.map +1 -1
  43. package/dist/apps/depthai-visualizer/src/messaging/deserialization.js +5 -5
  44. package/dist/apps/depthai-visualizer/src/messaging/deserialization.js.map +1 -1
  45. package/dist/apps/depthai-visualizer/src/messaging/utils.d.ts +7 -6
  46. package/dist/apps/depthai-visualizer/src/messaging/utils.d.ts.map +1 -1
  47. package/dist/apps/depthai-visualizer/src/messaging/utils.js +2 -2
  48. package/dist/apps/depthai-visualizer/src/messaging/utils.js.map +1 -1
  49. package/dist/apps/depthai-visualizer/src/protobuf.generated/EncodedFrame.d.ts.map +1 -1
  50. package/dist/apps/depthai-visualizer/src/protobuf.generated/EncodedFrame.js +3 -0
  51. package/dist/apps/depthai-visualizer/src/protobuf.generated/EncodedFrame.js.map +1 -1
  52. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImageAnnotations.d.ts.map +1 -1
  53. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImageAnnotations.js +3 -0
  54. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImageAnnotations.js.map +1 -1
  55. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImgDetections.d.ts.map +1 -1
  56. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImgDetections.js +3 -0
  57. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImgDetections.js.map +1 -1
  58. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImgFrame.d.ts.map +1 -1
  59. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImgFrame.js +3 -0
  60. package/dist/apps/depthai-visualizer/src/protobuf.generated/ImgFrame.js.map +1 -1
  61. package/dist/apps/depthai-visualizer/src/protobuf.generated/PointCloudData.d.ts.map +1 -1
  62. package/dist/apps/depthai-visualizer/src/protobuf.generated/PointCloudData.js +3 -0
  63. package/dist/apps/depthai-visualizer/src/protobuf.generated/PointCloudData.js.map +1 -1
  64. package/dist/apps/depthai-visualizer/src/protobuf.generated/SpatialImgDetections.d.ts.map +1 -1
  65. package/dist/apps/depthai-visualizer/src/protobuf.generated/SpatialImgDetections.js +3 -0
  66. package/dist/apps/depthai-visualizer/src/protobuf.generated/SpatialImgDetections.js.map +1 -1
  67. package/dist/apps/depthai-visualizer/src/protobuf.generated/common.d.ts.map +1 -1
  68. package/dist/apps/depthai-visualizer/src/protobuf.generated/common.js +3 -0
  69. package/dist/apps/depthai-visualizer/src/protobuf.generated/common.js.map +1 -1
  70. package/dist/apps/depthai-visualizer/src/utils/artificial-worker.d.ts +6 -6
  71. package/dist/apps/depthai-visualizer/src/utils/artificial-worker.d.ts.map +1 -1
  72. package/dist/apps/depthai-visualizer/src/utils/artificial-worker.js +10 -7
  73. package/dist/apps/depthai-visualizer/src/utils/artificial-worker.js.map +1 -1
  74. package/dist/apps/depthai-visualizer/src/utils/callback-manager.d.ts +1 -1
  75. package/dist/apps/depthai-visualizer/src/utils/callback-manager.d.ts.map +1 -1
  76. package/dist/apps/depthai-visualizer/src/utils/callback-manager.js +5 -5
  77. package/dist/apps/depthai-visualizer/src/utils/callback-manager.js.map +1 -1
  78. package/dist/apps/depthai-visualizer/src/utils/compatibility.d.ts.map +1 -1
  79. package/dist/apps/depthai-visualizer/src/utils/metrics-manager.d.ts.map +1 -1
  80. package/dist/apps/depthai-visualizer/src/utils/metrics-manager.js +1 -0
  81. package/dist/apps/depthai-visualizer/src/utils/metrics-manager.js.map +1 -1
  82. package/dist/communicator-D9LSiWws.js +147 -0
  83. package/dist/foxglove-protocol-RBwoTi12.js +76 -0
  84. package/dist/{index-DbIgJEn4.js → index-BatOjqHR.js} +4 -5
  85. package/dist/{index-BZjzIIuE.js → index-BeMujwTx.js} +4 -5
  86. package/dist/{index-CE1LH59a.js → index-Bmv-vCsr.js} +4 -5
  87. package/dist/{index-Dai0K-_7.js → index-Bpb1nLXX.js} +4 -5
  88. package/dist/{index-FdS8KlrP.js → index-C38MwKQ5.js} +4 -5
  89. package/dist/{index-BsdqQ862.js → index-C4Xw5gJf.js} +4 -5
  90. package/dist/{index-C6m30paN.js → index-CCjTYhIj.js} +4 -5
  91. package/dist/{index-D0g7yNKD.js → index-CRzS8jhh.js} +4 -5
  92. package/dist/{index-MOg_zBJW.js → index-CTV8k4Ur.js} +4 -5
  93. package/dist/{index-Cqzhj8jS.js → index-Cjzn2Mk3.js} +4 -5
  94. package/dist/{index-SZgAiOi4.js → index-CzJG5yoW.js} +4 -5
  95. package/dist/{index-Cmp_Tjng.js → index-D2tE4ai8.js} +5 -6
  96. package/dist/{index-DleEaqya.js → index-D8PL1mUz.js} +4 -5
  97. package/dist/{index-B3F-eA-i.js → index-Dx5rKk7S.js} +115 -126
  98. package/dist/{index-DkDTcHOl.js → index-JdSlhtdz.js} +4 -5
  99. package/dist/{index-D_AhdZqi.js → index-LBWmbzab.js} +4 -5
  100. package/dist/{index-D7I7neMi.js → index-fDKFJqYA.js} +4 -5
  101. package/dist/{index-1yvlF6NH.js → index-kO40p_fI.js} +4 -5
  102. package/dist/{index-B4j3EVf8.js → index-lcxcWrBB.js} +4 -5
  103. package/dist/index.js +4 -5
  104. package/dist/{worker-CMZIJlQN.js → worker-BX0SIDt0.js} +24 -20
  105. package/dist/worker-C6ruK-iB.js +150 -0
  106. package/package.json +1 -1
  107. package/dist/apps/depthai-visualizer/src/connection/ws/worker-utils.d.ts +0 -19
  108. package/dist/apps/depthai-visualizer/src/connection/ws/worker-utils.d.ts.map +0 -1
  109. package/dist/apps/depthai-visualizer/src/connection/ws/worker-utils.js +0 -128
  110. package/dist/apps/depthai-visualizer/src/connection/ws/worker-utils.js.map +0 -1
  111. package/dist/apps/depthai-visualizer/src/panels/CanvasPanel.d.ts +0 -12
  112. package/dist/apps/depthai-visualizer/src/panels/CanvasPanel.d.ts.map +0 -1
  113. package/dist/apps/depthai-visualizer/src/panels/CanvasPanel.js +0 -52
  114. package/dist/apps/depthai-visualizer/src/panels/CanvasPanel.js.map +0 -1
  115. package/dist/worker-DtDgSl3T.js +0 -11
  116. package/dist/worker-utils-BuUq1bP1.js +0 -1357
@@ -1,11 +1,11 @@
1
- import { c as commonjsGlobal, g as getAugmentedNamespace, a as getDefaultExportFromCjs } from './worker-utils-BuUq1bP1.js';
2
- import { T as Type$1, P as PointsAnnotationType$2, a as Profile, p as protobufsBySchema } from './communicator-DKKKAI0H.js';
1
+ import { c as commonjsGlobal, g as getAugmentedNamespace, a as getDefaultExportFromCjs, T as Type$1, P as PointsAnnotationType$2, b as Profile, p as protobufsBySchema, B as BinaryOpcode } from './FoxgloveServer-tJZcJH5-.js';
3
2
  import * as React$1 from 'react';
4
3
  import React__default, { useContext, useRef, useLayoutEffect, createContext, useReducer, useState, useCallback, useMemo, forwardRef, createElement, Component, useEffect, useImperativeHandle, Fragment as Fragment$1, Suspense } from 'react';
5
4
  import { createStore, useStore } from 'zustand';
6
5
  import { isParent as isParent$1, getLeaves, createRemoveUpdate, updateTree, getNodeAtPath, createHideUpdate, createDragToUpdates, MosaicContext, MosaicWindowContext } from 'react-mosaic-component';
7
6
  import { useTheme as useTheme$3, alpha, Typography, Divider, Link, Button as Button$1, GlobalStyles, Dialog as Dialog$2, DialogTitle as DialogTitle$2, DialogContent as DialogContent$2, DialogContentText, DialogActions, Stack as Stack$3 } from '@mui/material';
8
7
  import { i as isObjectLike, b as baseGetTag, S as Symbol$1, a as isArray, g as getNative, r as root$6, o as overArg, c as isPrototype, d as isArrayLike, e as arrayLikeKeys, M as MapCache, f as isArguments, s as setToString, h as overRest, t as toSource, j as Map$1, k as eq, U as Uint8Array$2, l as isBuffer, m as Stack$2, n as isTypedArray, p as isObject$2, q as isLength, u as isIndex, v as identity$1, w as baseFor, x as baseRest, y as isArrayLikeObject, z as baseAssignValue, A as assignValue, B as tinycolor, C as merge$2, D as instance } from './i18next-C5Qe4-E1.js';
8
+ import { p as parseFoxgloveMessage } from './foxglove-protocol-RBwoTi12.js';
9
9
  import { DndProvider } from 'react-dnd';
10
10
  import { HTML5Backend } from 'react-dnd-html5-backend';
11
11
  import { ThemeContext, __unsafe_useEmotionCache } from '@emotion/react';
@@ -177,11 +177,15 @@ class FoxgloveWebSocketAdapter extends EventTarget {
177
177
  this.dispatchEvent(new MessageEvent("services", event.data));
178
178
  break;
179
179
  }
180
- case 'custom':
180
+ case "service_response":
181
181
  {
182
- this.dispatchEvent(new MessageEvent('custom', event.data));
182
+ // Each service request has its own response listener
183
183
  break;
184
184
  }
185
+ default:
186
+ {
187
+ console.warn(`Foxglove Ws Adapter: Worker sent unexpected message`, event.data);
188
+ }
185
189
  }
186
190
  });
187
191
  }
@@ -281,13 +285,9 @@ class FoxgloveWebSocketAdapter extends EventTarget {
281
285
  }
282
286
  });
283
287
  }
284
-
285
- // @ts-expect-error TODO: WebRTC hack
286
288
  send(data) {
287
- this.#sendToWorker({
288
- type: "send",
289
- data: data
290
- });
289
+ console.error('Foxglove Ws Aparter Error: raw send was requested', data);
290
+ // this.#sendToWorker({ type: "send", data: data as any });
291
291
  }
292
292
  }
293
293
 
@@ -10956,7 +10956,7 @@ function parseMessageType(type) {
10956
10956
  case Type$1.NV12:
10957
10957
  return ["nv12", 1];
10958
10958
  case Type$1.RGB888i:
10959
- return ["rgb8", 1];
10959
+ return ["rgb8", 3];
10960
10960
  case Type$1.RGB888p:
10961
10961
  return ["rgb8p", 1];
10962
10962
  case Type$1.RGBA8888:
@@ -10979,7 +10979,7 @@ function parseMessage(message) {
10979
10979
  const stride = message.fb?.stride ?? message.sourceFb?.stride ?? null;
10980
10980
  const p2Offset = message.fb?.p2Offset ?? message.sourceFb?.p2Offset ?? null;
10981
10981
  const p1Offset = message.fb?.p1Offset ?? message.sourceFb?.p1Offset ?? null;
10982
- let planeStride = p1Offset !== null && p2Offset !== null ? p2Offset - p1Offset : 0;
10982
+ let planeStride = p1Offset != null && p2Offset != null ? p2Offset - p1Offset : 0;
10983
10983
  if (planeStride <= 0) {
10984
10984
  planeStride = null;
10985
10985
  }
@@ -11557,14 +11557,14 @@ async function deserializeDepthAiMessage(args) {
11557
11557
  height: message.height
11558
11558
  });
11559
11559
  if (message.profile === Profile.AVC) {
11560
- deserializeEncodedFrameH264({
11560
+ await deserializeEncodedFrameH264({
11561
11561
  topic,
11562
11562
  message,
11563
11563
  topicDecoders,
11564
11564
  callback
11565
11565
  });
11566
11566
  } else if (message.profile === Profile.JPEG) {
11567
- deserializeMJPEGFrame({
11567
+ await deserializeMJPEGFrame({
11568
11568
  topic,
11569
11569
  message,
11570
11570
  callback
@@ -11577,16 +11577,16 @@ async function deserializeDepthAiMessage(args) {
11577
11577
  const {
11578
11578
  width,
11579
11579
  height,
11580
- type
11580
+ type: messageType
11581
11581
  } = parseMessage(message);
11582
11582
  topicSizes.set(topic, {
11583
11583
  width,
11584
11584
  height
11585
11585
  });
11586
- switch (type) {
11586
+ switch (messageType) {
11587
11587
  case Type$1.BITSTREAM:
11588
11588
  {
11589
- deserializeEncodedFrameH264({
11589
+ await deserializeEncodedFrameH264({
11590
11590
  topic,
11591
11591
  message,
11592
11592
  topicDecoders,
@@ -11705,6 +11705,7 @@ class MetricsManager {
11705
11705
  metrics = {};
11706
11706
  registerEvent(topic) {
11707
11707
  const currentTime = performance.now();
11708
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
11708
11709
  this.metrics[topic] ??= [];
11709
11710
  this.metrics[topic].unshift(currentTime);
11710
11711
  this.metrics[topic].length = 100;
@@ -12248,6 +12249,7 @@ class WebRtcClient {
12248
12249
  class ArtificialWorker extends EventTarget {
12249
12250
  #selfTarget = new EventTarget();
12250
12251
 
12252
+ // Post message from main to worker
12251
12253
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
12252
12254
  postMessage(data, _transferable) {
12253
12255
  const event = new MessageEvent('message', {
@@ -12256,24 +12258,26 @@ class ArtificialWorker extends EventTarget {
12256
12258
  this.#selfTarget.dispatchEvent(event);
12257
12259
  }
12258
12260
 
12261
+ // Listen for worker-to-main messages
12262
+ // @ts-expect-error Make it typed
12263
+ addEventListener(type, callback) {
12264
+ super.addEventListener(type, callback);
12265
+ }
12266
+
12267
+ // Post message from worker to main
12259
12268
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
12260
- selfPostMessage(data, _transferable) {
12269
+ postMessageToMain(data, _transferable) {
12261
12270
  const event = new MessageEvent('message', {
12262
12271
  data
12263
12272
  });
12264
12273
  super.dispatchEvent(event);
12265
12274
  }
12266
12275
 
12276
+ // Listen for main-to-worker messages
12267
12277
  // @ts-expect-error Make it typed
12268
- selfAddEventListener(type, callback) {
12278
+ addEventListenerFromMain(type, callback) {
12269
12279
  this.#selfTarget.addEventListener(type, callback);
12270
12280
  }
12271
-
12272
- // @ts-expect-error Make it typed
12273
- addEventListener(type, callback) {
12274
- super.addEventListener(type, callback);
12275
- }
12276
- terminate() {}
12277
12281
  }
12278
12282
 
12279
12283
  // This Source Code Form is subject to the terms of the Mozilla Public
@@ -12289,7 +12293,7 @@ class WebRtcBridge extends ArtificialWorker {
12289
12293
  #systemChannel = null;
12290
12294
  constructor() {
12291
12295
  super();
12292
- this.#worker = new Worker(new URL("worker-CMZIJlQN.js", import.meta.url), {
12296
+ this.#worker = new Worker(new URL("worker-BX0SIDt0.js", import.meta.url), {
12293
12297
  type: "module"
12294
12298
  });
12295
12299
  this.#setupArtificialWorker();
@@ -12298,7 +12302,7 @@ class WebRtcBridge extends ArtificialWorker {
12298
12302
  this.#worker.terminate();
12299
12303
  }
12300
12304
  #setupArtificialWorker() {
12301
- this.selfAddEventListener("message", event => {
12305
+ this.addEventListenerFromMain("message", event => {
12302
12306
  switch (event.data.type) {
12303
12307
  case "open":
12304
12308
  {
@@ -12316,16 +12320,6 @@ class WebRtcBridge extends ArtificialWorker {
12316
12320
  this.terminate();
12317
12321
  break;
12318
12322
  }
12319
- case "send":
12320
- {
12321
- this.#worker.postMessage({
12322
- kind: "rawSend",
12323
- data: {
12324
- message: event.data.data
12325
- }
12326
- });
12327
- break;
12328
- }
12329
12323
  case "call_service":
12330
12324
  {
12331
12325
  this.#worker.postMessage({
@@ -12358,7 +12352,9 @@ class WebRtcBridge extends ArtificialWorker {
12358
12352
  this.#handleMessages();
12359
12353
  }
12360
12354
  #handleWebRtc(client) {
12361
- client.on("error", error => console.error("WebRtc Client Failed", error));
12355
+ client.on("error", error => {
12356
+ console.error("WebRtc Client Failed", error);
12357
+ });
12362
12358
  client.on("connection_established", connection => {
12363
12359
  connection.on("data_channel", channel => {
12364
12360
  channel.on("close", () => {
@@ -12372,41 +12368,35 @@ class WebRtcBridge extends ArtificialWorker {
12372
12368
  ready: false
12373
12369
  }
12374
12370
  });
12375
- this.selfPostMessage({
12371
+ this.postMessageToMain({
12376
12372
  type: "close"
12377
12373
  });
12378
12374
  });
12379
12375
  if (channel.label === MESSAGE_CHANNEL_NAME) {
12380
12376
  this.#messageChannel = channel;
12381
12377
  channel.on("message:binary", async view => {
12382
- const operation = view.getUint8(0);
12383
- const action = operation === 0x01 ? "message" : operation === 0x03 ? "service_response" : "other";
12384
- if (action === "message") {
12385
- const subscriptionId = view.getUint32(1);
12386
- const payload = new DataView(view.buffer, view.byteOffset + 1 + 4 + 8);
12378
+ const message = parseFoxgloveMessage(view);
12379
+ if (!message) {
12380
+ return;
12381
+ }
12382
+ if (message.op === BinaryOpcode.MESSAGE_DATA) {
12387
12383
  this.#worker.postMessage({
12388
12384
  kind: "genericMessage",
12389
12385
  data: {
12390
- message: {
12391
- subscriptionId,
12392
- data: payload
12393
- }
12386
+ message
12394
12387
  }
12395
- }, [payload.buffer]);
12388
+ }, [message.data.buffer]);
12396
12389
  } else {
12397
- const callId = view.getUint32(1 + 4); // op-code + service-id
12398
- const encodingLength = view.getUint32(1 + 4 + 4); // op-code + service-id + call-id
12399
- const payload = new DataView(view.buffer, view.byteOffset + 1 + 4 + 4 + 4 + encodingLength); // op-code + service-id + call-id + encoding-length
12400
12390
  this.#worker.postMessage({
12401
12391
  kind: "systemMessage",
12402
12392
  data: {
12403
12393
  message: {
12404
12394
  op: "serviceResponse",
12405
- callId,
12406
- data: payload
12395
+ callId: message.callId,
12396
+ data: message.data
12407
12397
  }
12408
12398
  }
12409
- }, [payload.buffer]);
12399
+ }, [message.data.buffer]);
12410
12400
  }
12411
12401
  });
12412
12402
  } else if (channel.label === SYSTEM_CHANNEL_NAME) {
@@ -12420,15 +12410,17 @@ class WebRtcBridge extends ArtificialWorker {
12420
12410
  });
12421
12411
  });
12422
12412
  }
12423
- this.#worker.postMessage({
12424
- kind: "connection",
12425
- data: {
12426
- channel: channel.label === MESSAGE_CHANNEL_NAME ? "message" : "system",
12427
- ready: true
12428
- }
12429
- });
12413
+ if (channel.label === MESSAGE_CHANNEL_NAME || channel.label === SYSTEM_CHANNEL_NAME) {
12414
+ this.#worker.postMessage({
12415
+ kind: "connection",
12416
+ data: {
12417
+ channel: channel.label === MESSAGE_CHANNEL_NAME ? "message" : "system",
12418
+ ready: true
12419
+ }
12420
+ });
12421
+ }
12430
12422
  if (this.#systemChannel?.raw.readyState === "open" && this.#messageChannel?.raw.readyState === "open") {
12431
- this.selfPostMessage({
12423
+ this.postMessageToMain({
12432
12424
  type: "open"
12433
12425
  });
12434
12426
  }
@@ -12441,7 +12433,7 @@ class WebRtcBridge extends ArtificialWorker {
12441
12433
  ready: false
12442
12434
  }
12443
12435
  });
12444
- this.selfPostMessage({
12436
+ this.postMessageToMain({
12445
12437
  type: "close"
12446
12438
  });
12447
12439
  });
@@ -12460,7 +12452,7 @@ class WebRtcBridge extends ArtificialWorker {
12460
12452
  }
12461
12453
  default:
12462
12454
  {
12463
- this.selfPostMessage(event.data);
12455
+ this.postMessageToMain(event.data);
12464
12456
  }
12465
12457
  }
12466
12458
  });
@@ -12477,21 +12469,20 @@ class VisualizerConnection extends FoxgloveConnection {
12477
12469
  #adapter;
12478
12470
  constructor({
12479
12471
  type,
12480
- data,
12481
- worker
12472
+ data
12482
12473
  }) {
12483
12474
  super(type === 'ws' ? data.connectionUrl : data.config.clientId);
12484
- let finalWorker = worker;
12475
+ let worker;
12485
12476
  if (type === 'ws') {
12486
12477
  this.#url = data.connectionUrl;
12487
- finalWorker ??= new Worker(new URL("worker-DtDgSl3T.js", import.meta.url), {
12478
+ worker = new Worker(new URL("worker-C6ruK-iB.js", import.meta.url), {
12488
12479
  type: "module"
12489
12480
  });
12490
12481
  } else {
12491
12482
  this.#config = data.config;
12492
- finalWorker = new WebRtcBridge();
12483
+ worker = new WebRtcBridge();
12493
12484
  }
12494
- this.#open(finalWorker);
12485
+ this.#open(worker);
12495
12486
  }
12496
12487
  close() {
12497
12488
  this.#adapter?.close();
@@ -12522,25 +12513,22 @@ class VisualizerConnection extends FoxgloveConnection {
12522
12513
  wsUrl: this.#url,
12523
12514
  config: this.#config
12524
12515
  }, worker);
12525
- this.#adapter.addEventListener("open", this.#onOpen.bind(this));
12516
+ this.#adapter.addEventListener("open", () => {
12517
+ this.playerPresence = PlayerPresence.PRESENT;
12518
+ this.emitState();
12519
+ });
12520
+ this.#adapter.addEventListener("close", () => {
12521
+ this.playerPresence = PlayerPresence.NOT_PRESENT;
12522
+ this.emitState();
12523
+ });
12524
+ this.#adapter.addEventListener("error", _event => {
12525
+ this.messageEvent = null;
12526
+ this.playerPresence = PlayerPresence.ERROR;
12527
+ this.emitState();
12528
+ });
12526
12529
  this.#adapter.addEventListener("message", event => {
12527
12530
  this.onMessagePacket.bind(this)(event);
12528
12531
  });
12529
- this.#adapter.addEventListener("close", this.#onClose.bind(this));
12530
- this.#adapter.addEventListener("error", this.#onClose.bind(this));
12531
- };
12532
- #onOpen = () => {
12533
- this.playerPresence = PlayerPresence.PRESENT;
12534
- this.emitState();
12535
- };
12536
- #onClose = () => {
12537
- this.playerPresence = PlayerPresence.NOT_PRESENT;
12538
- this.emitState();
12539
- };
12540
- #onError = _event => {
12541
- this.messageEvent = null;
12542
- this.playerPresence = PlayerPresence.ERROR;
12543
- this.emitState();
12544
12532
  };
12545
12533
  }
12546
12534
 
@@ -89675,7 +89663,7 @@ function legacy(parser) {
89675
89663
  return new LanguageSupport(StreamLanguage.define(parser));
89676
89664
  }
89677
89665
  function sql$1(dialectName) {
89678
- return import('./index-D_AhdZqi.js').then(m => m.sql({ dialect: m[dialectName] }));
89666
+ return import('./index-LBWmbzab.js').then(m => m.sql({ dialect: m[dialectName] }));
89679
89667
  }
89680
89668
  /**
89681
89669
  An array of language descriptions for known language packages.
@@ -89686,7 +89674,7 @@ const languages = [
89686
89674
  name: "C",
89687
89675
  extensions: ["c", "h", "ino"],
89688
89676
  load() {
89689
- return import('./index-DkDTcHOl.js').then(m => m.cpp());
89677
+ return import('./index-JdSlhtdz.js').then(m => m.cpp());
89690
89678
  }
89691
89679
  }),
89692
89680
  /*@__PURE__*/LanguageDescription.of({
@@ -89694,7 +89682,7 @@ const languages = [
89694
89682
  alias: ["cpp"],
89695
89683
  extensions: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"],
89696
89684
  load() {
89697
- return import('./index-DkDTcHOl.js').then(m => m.cpp());
89685
+ return import('./index-JdSlhtdz.js').then(m => m.cpp());
89698
89686
  }
89699
89687
  }),
89700
89688
  /*@__PURE__*/LanguageDescription.of({
@@ -89714,7 +89702,7 @@ const languages = [
89714
89702
  name: "Go",
89715
89703
  extensions: ["go"],
89716
89704
  load() {
89717
- return import('./index-B4j3EVf8.js').then(m => m.go());
89705
+ return import('./index-lcxcWrBB.js').then(m => m.go());
89718
89706
  }
89719
89707
  }),
89720
89708
  /*@__PURE__*/LanguageDescription.of({
@@ -89729,7 +89717,7 @@ const languages = [
89729
89717
  name: "Java",
89730
89718
  extensions: ["java"],
89731
89719
  load() {
89732
- return import('./index-1yvlF6NH.js').then(m => m.java());
89720
+ return import('./index-kO40p_fI.js').then(m => m.java());
89733
89721
  }
89734
89722
  }),
89735
89723
  /*@__PURE__*/LanguageDescription.of({
@@ -89745,7 +89733,7 @@ const languages = [
89745
89733
  alias: ["json5"],
89746
89734
  extensions: ["json", "map"],
89747
89735
  load() {
89748
- return import('./index-FdS8KlrP.js').then(m => m.json());
89736
+ return import('./index-C38MwKQ5.js').then(m => m.json());
89749
89737
  }
89750
89738
  }),
89751
89739
  /*@__PURE__*/LanguageDescription.of({
@@ -89759,14 +89747,14 @@ const languages = [
89759
89747
  name: "LESS",
89760
89748
  extensions: ["less"],
89761
89749
  load() {
89762
- return import('./index-MOg_zBJW.js').then(m => m.less());
89750
+ return import('./index-CTV8k4Ur.js').then(m => m.less());
89763
89751
  }
89764
89752
  }),
89765
89753
  /*@__PURE__*/LanguageDescription.of({
89766
89754
  name: "Liquid",
89767
89755
  extensions: ["liquid"],
89768
89756
  load() {
89769
- return import('./index-BsdqQ862.js').then(m => m.liquid());
89757
+ return import('./index-C4Xw5gJf.js').then(m => m.liquid());
89770
89758
  }
89771
89759
  }),
89772
89760
  /*@__PURE__*/LanguageDescription.of({
@@ -89792,7 +89780,7 @@ const languages = [
89792
89780
  name: "PHP",
89793
89781
  extensions: ["php", "php3", "php4", "php5", "php7", "phtml"],
89794
89782
  load() {
89795
- return import('./index-CE1LH59a.js').then(m => m.php());
89783
+ return import('./index-Bmv-vCsr.js').then(m => m.php());
89796
89784
  }
89797
89785
  }),
89798
89786
  /*@__PURE__*/LanguageDescription.of({
@@ -89809,28 +89797,28 @@ const languages = [
89809
89797
  extensions: ["BUILD", "bzl", "py", "pyw"],
89810
89798
  filename: /^(BUCK|BUILD)$/,
89811
89799
  load() {
89812
- return import('./index-SZgAiOi4.js').then(m => m.python());
89800
+ return import('./index-CzJG5yoW.js').then(m => m.python());
89813
89801
  }
89814
89802
  }),
89815
89803
  /*@__PURE__*/LanguageDescription.of({
89816
89804
  name: "Rust",
89817
89805
  extensions: ["rs"],
89818
89806
  load() {
89819
- return import('./index-D0g7yNKD.js').then(m => m.rust());
89807
+ return import('./index-CRzS8jhh.js').then(m => m.rust());
89820
89808
  }
89821
89809
  }),
89822
89810
  /*@__PURE__*/LanguageDescription.of({
89823
89811
  name: "Sass",
89824
89812
  extensions: ["sass"],
89825
89813
  load() {
89826
- return import('./index-D7I7neMi.js').then(m => m.sass({ indented: true }));
89814
+ return import('./index-fDKFJqYA.js').then(m => m.sass({ indented: true }));
89827
89815
  }
89828
89816
  }),
89829
89817
  /*@__PURE__*/LanguageDescription.of({
89830
89818
  name: "SCSS",
89831
89819
  extensions: ["scss"],
89832
89820
  load() {
89833
- return import('./index-D7I7neMi.js').then(m => m.sass());
89821
+ return import('./index-fDKFJqYA.js').then(m => m.sass());
89834
89822
  }
89835
89823
  }),
89836
89824
  /*@__PURE__*/LanguageDescription.of({
@@ -89861,7 +89849,7 @@ const languages = [
89861
89849
  name: "WebAssembly",
89862
89850
  extensions: ["wat", "wast"],
89863
89851
  load() {
89864
- return import('./index-DbIgJEn4.js').then(m => m.wast());
89852
+ return import('./index-BatOjqHR.js').then(m => m.wast());
89865
89853
  }
89866
89854
  }),
89867
89855
  /*@__PURE__*/LanguageDescription.of({
@@ -89869,7 +89857,7 @@ const languages = [
89869
89857
  alias: ["rss", "wsdl", "xsd"],
89870
89858
  extensions: ["xml", "xsl", "xsd", "svg"],
89871
89859
  load() {
89872
- return import('./index-Dai0K-_7.js').then(m => m.xml());
89860
+ return import('./index-Bpb1nLXX.js').then(m => m.xml());
89873
89861
  }
89874
89862
  }),
89875
89863
  /*@__PURE__*/LanguageDescription.of({
@@ -89877,7 +89865,7 @@ const languages = [
89877
89865
  alias: ["yml"],
89878
89866
  extensions: ["yaml", "yml"],
89879
89867
  load() {
89880
- return import('./index-Cqzhj8jS.js').then(m => m.yaml());
89868
+ return import('./index-Cjzn2Mk3.js').then(m => m.yaml());
89881
89869
  }
89882
89870
  }),
89883
89871
  // Legacy modes ported from CodeMirror 5
@@ -90673,13 +90661,13 @@ const languages = [
90673
90661
  name: "Vue",
90674
90662
  extensions: ["vue"],
90675
90663
  load() {
90676
- return import('./index-DleEaqya.js').then(m => m.vue());
90664
+ return import('./index-D8PL1mUz.js').then(m => m.vue());
90677
90665
  }
90678
90666
  }),
90679
90667
  /*@__PURE__*/LanguageDescription.of({
90680
90668
  name: "Angular Template",
90681
90669
  load() {
90682
- return import('./index-C6m30paN.js').then(m => m.angular());
90670
+ return import('./index-CCjTYhIj.js').then(m => m.angular());
90683
90671
  }
90684
90672
  })
90685
90673
  ];
@@ -161443,21 +161431,30 @@ const PanelToolbar = ({
161443
161431
  // eslint-disable-next-line react-hooks/exhaustive-deps
161444
161432
  }, []);
161445
161433
  const [annotationsOpened, setAnnotationsOpened] = React__default.useState(false);
161446
- const hasExtra = React__default.useMemo(() => detections.some(topic => topic.extra && !topic.enabled), [detections]);
161434
+ const hasExtra = React__default.useMemo(() => detections.some(detection => detection.extra && !detection.enabled), [detections]);
161447
161435
  const [extraVisible, setExtraVisible] = React__default.useState(false);
161448
161436
  const onToggleTopic = React__default.useCallback(toggleTopicName => {
161449
- setDetections?.(current => current.map(topic => ({
161450
- ...topic,
161451
- ...(toggleTopicName === topic.name && {
161452
- enabled: !topic.enabled
161437
+ setDetections?.(current => current.map(detection => ({
161438
+ ...detection,
161439
+ ...(toggleTopicName === detection.name && {
161440
+ enabled: !detection.enabled
161453
161441
  })
161454
161442
  })));
161455
161443
  }, [setDetections]);
161456
161444
 
161457
161445
  // TODO: show only when debug mode is ON
161458
161446
  const name = React__default.useMemo(() => {
161459
- return `${topic} - ${metrics?.inputFPS || 0}/${metrics?.postDecodeFPS || 0} FPS`;
161447
+ return `${topic} - ${metrics?.inputFPS ?? 0}/${metrics?.postDecodeFPS ?? 0} FPS`;
161460
161448
  }, [topic, metrics]);
161449
+ const makeDetection = React__default.useCallback((detection, {
161450
+ extra
161451
+ }) => (extra ? detection.extra && !detection.enabled : !detection.extra || detection.enabled) && /*#__PURE__*/React__default.createElement(PanelAnnotationButton, {
161452
+ key: detection.name,
161453
+ topic: detection,
161454
+ onClick: () => {
161455
+ onToggleTopic(detection.name);
161456
+ }
161457
+ }), [onToggleTopic]);
161461
161458
  return /*#__PURE__*/React__default.createElement(Flex, {
161462
161459
  direction: "row",
161463
161460
  gap: "sm",
@@ -161485,12 +161482,8 @@ const PanelToolbar = ({
161485
161482
  borderRadius: 0,
161486
161483
  borderTopRightRadius: 8
161487
161484
  }
161488
- })), /*#__PURE__*/React__default.createElement(DropdownMenuContent, null, detections.map(topic => (!topic.extra || topic.enabled) && /*#__PURE__*/React__default.createElement(PanelAnnotationButton, {
161489
- key: topic.name,
161490
- topic: topic,
161491
- onClick: () => {
161492
- onToggleTopic(topic.name);
161493
- }
161485
+ })), /*#__PURE__*/React__default.createElement(DropdownMenuContent, null, extraVisible && detections.map(detection => makeDetection(detection, {
161486
+ extra: false
161494
161487
  })), hasExtra && /*#__PURE__*/React__default.createElement(Button, {
161495
161488
  width: "full",
161496
161489
  paddingY: "xs",
@@ -161503,16 +161496,12 @@ const PanelToolbar = ({
161503
161496
  style: {
161504
161497
  borderRadius: 4
161505
161498
  }
161506
- }, extraVisible ? "Less" : "More"), extraVisible && detections.map(topic => topic.extra && !topic.enabled && /*#__PURE__*/React__default.createElement(PanelAnnotationButton, {
161507
- key: topic.name,
161508
- topic: topic,
161509
- onClick: () => {
161510
- onToggleTopic(topic.name);
161511
- }
161499
+ }, extraVisible ? "Less" : "More"), extraVisible && detections.map(detection => makeDetection(detection, {
161500
+ extra: true
161512
161501
  })))), kind === 'pointCloud' && /*#__PURE__*/React__default.createElement(Tooltip, {
161513
161502
  content: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Label$3, {
161514
161503
  text: "To move camera:"
161515
- }), /*#__PURE__*/React__default.createElement("ul", null, /*#__PURE__*/React__default.createElement("li", null, "w - Move camera forward"), /*#__PURE__*/React__default.createElement("li", null, "a - Move camera backward"), /*#__PURE__*/React__default.createElement("li", null, "s - Move camera to the left"), /*#__PURE__*/React__default.createElement("li", null, "d - Move camera to the right"), /*#__PURE__*/React__default.createElement("li", null, "Scroll \u2013 Zoom in and out"), /*#__PURE__*/React__default.createElement("li", null, "Drag \u2013 Move camera parallel to the ground"), /*#__PURE__*/React__default.createElement("li", null, "Right-click + Drag horizontally \u2013 Rotate the camera around the world's z-axis"), /*#__PURE__*/React__default.createElement("li", null, "Right-click + Drag vertically \u2013 Pan the camera around the world's x- and y- axes")))
161504
+ }), /*#__PURE__*/React__default.createElement("ul", null, /*#__PURE__*/React__default.createElement("li", null, "w - Move camera forward"), /*#__PURE__*/React__default.createElement("li", null, "a - Move camera backward"), /*#__PURE__*/React__default.createElement("li", null, "s - Move camera to the left"), /*#__PURE__*/React__default.createElement("li", null, "d - Move camera to the right"), /*#__PURE__*/React__default.createElement("li", null, "Scroll \u2013 Zoom in and out"), /*#__PURE__*/React__default.createElement("li", null, "Drag \u2013 Move camera parallel to the ground"), /*#__PURE__*/React__default.createElement("li", null, `Right-click + Drag horizontally Rotate the camera around the world's z-axis`), /*#__PURE__*/React__default.createElement("li", null, `Right-click + Drag vertically Pan the camera around the world's x- and y- axes`)))
161516
161505
  }, /*#__PURE__*/React__default.createElement(Button, {
161517
161506
  variant: "ghost",
161518
161507
  colorVariant: "white",
@@ -161593,7 +161582,7 @@ const Panel = ({
161593
161582
  }, children))))));
161594
161583
  };
161595
161584
 
161596
- const ImagePanelComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-Cmp_Tjng.js'));
161585
+ const ImagePanelComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-D2tE4ai8.js'));
161597
161586
  const ImagePanelBody = ({
161598
161587
  topic
161599
161588
  }) => {
@@ -161628,7 +161617,7 @@ const ImagePanel = /*#__PURE__*/React__default.memo(function ImagePanel(props) {
161628
161617
  // License, v2.0. If a copy of the MPL was not distributed with this
161629
161618
  // file, You can obtain one at http://mozilla.org/MPL/2.0/
161630
161619
 
161631
- const ThreeDeeRenderComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-BZjzIIuE.js'));
161620
+ const ThreeDeeRenderComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-BeMujwTx.js'));
161632
161621
  const PointCloudPanelBody = ({
161633
161622
  topic
161634
161623
  }) => {
@@ -1,14 +1,13 @@
1
- import { au as ExternalTokenizer, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, an as indentNodeProp, ao as continuedIndent, az as flatIndent, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport } from './index-B3F-eA-i.js';
2
- import './worker-utils-BuUq1bP1.js';
3
- import 'hydrated-ws';
4
- import 'ms';
5
- import './communicator-DKKKAI0H.js';
1
+ import { au as ExternalTokenizer, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, an as indentNodeProp, ao as continuedIndent, az as flatIndent, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport } from './index-Dx5rKk7S.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
6
3
  import 'protobufjs/minimal';
4
+ import 'ms';
7
5
  import 'react';
8
6
  import 'zustand';
9
7
  import 'react-mosaic-component';
10
8
  import '@mui/material';
11
9
  import './i18next-C5Qe4-E1.js';
10
+ import './foxglove-protocol-RBwoTi12.js';
12
11
  import 'react-dnd';
13
12
  import 'react-dnd-html5-backend';
14
13
  import '@emotion/react';
@@ -1,14 +1,13 @@
1
- import { an as indentNodeProp, ao as continuedIndent, ap as foldNodeProp, aq as styleTags, ar as tags, as as LRLanguage, at as LanguageSupport, au as ExternalTokenizer, av as LRParser, aw as ifNotIn, ax as completeFromList, ay as syntaxTree } from './index-B3F-eA-i.js';
2
- import './worker-utils-BuUq1bP1.js';
3
- import 'hydrated-ws';
4
- import 'ms';
5
- import './communicator-DKKKAI0H.js';
1
+ import { an as indentNodeProp, ao as continuedIndent, ap as foldNodeProp, aq as styleTags, ar as tags, as as LRLanguage, at as LanguageSupport, au as ExternalTokenizer, av as LRParser, aw as ifNotIn, ax as completeFromList, ay as syntaxTree } from './index-Dx5rKk7S.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
6
3
  import 'protobufjs/minimal';
4
+ import 'ms';
7
5
  import 'react';
8
6
  import 'zustand';
9
7
  import 'react-mosaic-component';
10
8
  import '@mui/material';
11
9
  import './i18next-C5Qe4-E1.js';
10
+ import './foxglove-protocol-RBwoTi12.js';
12
11
  import 'react-dnd';
13
12
  import 'react-dnd-html5-backend';
14
13
  import '@emotion/react';
@@ -1,14 +1,13 @@
1
- import { au as ExternalTokenizer, aC as ContextTracker, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, ap as foldNodeProp, aB as foldInside, an as indentNodeProp, ao as continuedIndent, aH as defineCSSCompletionSource, at as LanguageSupport } from './index-B3F-eA-i.js';
2
- import './worker-utils-BuUq1bP1.js';
3
- import 'hydrated-ws';
4
- import 'ms';
5
- import './communicator-DKKKAI0H.js';
1
+ import { au as ExternalTokenizer, aC as ContextTracker, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, ap as foldNodeProp, aB as foldInside, an as indentNodeProp, ao as continuedIndent, aH as defineCSSCompletionSource, at as LanguageSupport } from './index-Dx5rKk7S.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
6
3
  import 'protobufjs/minimal';
4
+ import 'ms';
7
5
  import 'react';
8
6
  import 'zustand';
9
7
  import 'react-mosaic-component';
10
8
  import '@mui/material';
11
9
  import './i18next-C5Qe4-E1.js';
10
+ import './foxglove-protocol-RBwoTi12.js';
12
11
  import 'react-dnd';
13
12
  import 'react-dnd-html5-backend';
14
13
  import '@emotion/react';