@luxonis/visualizer-protobuf 2.5.0 → 2.5.2

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 (39) hide show
  1. package/dist/{index-NHpCmWRz.js → index--973qJhr.js} +175 -142
  2. package/dist/{index-16Fm74Uw.js → index-815UyjXe.js} +1 -1
  3. package/dist/{index-1kGRR1LW.js → index-B-oS4lo9.js} +1 -1
  4. package/dist/{index-DYufn_cZ.js → index-BAty4u9-.js} +1 -1
  5. package/dist/{index-DEvW8DL5.js → index-BOhRuVDj.js} +1 -1
  6. package/dist/{index-ZLPDCVkk.js → index-Bmkj6F04.js} +1 -1
  7. package/dist/{index-C9RAS_2_.js → index-BrniHYok.js} +1 -1
  8. package/dist/{index-BqEaMk6I.js → index-C-7YCit4.js} +1 -1
  9. package/dist/{index-Dbn3jIp3.js → index-C268C4La.js} +1 -1
  10. package/dist/{index-Bg4K4PDT.js → index-C3no0vbu.js} +1 -1
  11. package/dist/{index-DOETjfmm.js → index-C5UABCF_.js} +1 -1
  12. package/dist/{index-CTKzqMRG.js → index-CnOHdOBX.js} +21 -16
  13. package/dist/{index-CqHlndDu.js → index-CodwiqtN.js} +1 -1
  14. package/dist/{index-DfYmZ5i0.js → index-D9OFUMug.js} +2 -2
  15. package/dist/{index-CvMPmv6l.js → index-DMKuVDI3.js} +1 -1
  16. package/dist/{index-BSgO0fZJ.js → index-Dc8AWAbG.js} +1 -1
  17. package/dist/{index-BnZ2drUS.js → index-DkIfiBNh.js} +1 -1
  18. package/dist/{index-BjoNcT1u.js → index-Nllymnr2.js} +1 -1
  19. package/dist/{index-Ca41zUtb.js → index-fmHFT9p5.js} +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/lib/src/connection/connection.js +1 -1
  22. package/dist/lib/src/connection/connection.js.map +1 -1
  23. package/dist/lib/src/connection/foxglove-connection.d.ts +1 -1
  24. package/dist/lib/src/connection/foxglove-connection.d.ts.map +1 -1
  25. package/dist/lib/src/connection/foxglove-connection.js +12 -10
  26. package/dist/lib/src/connection/foxglove-connection.js.map +1 -1
  27. package/dist/lib/src/connection/webrtc/bridge.d.ts.map +1 -1
  28. package/dist/lib/src/connection/webrtc/bridge.js.map +1 -1
  29. package/dist/lib/src/messaging/deserialization/detections/custom.d.ts.map +1 -1
  30. package/dist/lib/src/messaging/deserialization/detections/custom.js +13 -27
  31. package/dist/lib/src/messaging/deserialization/detections/custom.js.map +1 -1
  32. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderablePointsAnnotation.d.ts +1 -1
  33. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderablePointsAnnotation.d.ts.map +1 -1
  34. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderablePointsAnnotation.js +16 -8
  35. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderablePointsAnnotation.js.map +1 -1
  36. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.d.ts.map +1 -1
  37. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.js +4 -7
  38. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.js.map +1 -1
  39. package/package.json +2 -2
@@ -11027,30 +11027,15 @@ function deserializeImgDetectionsCustom({
11027
11027
  const texts = [];
11028
11028
  const circles = [];
11029
11029
  for (const annotations of message.annotations) {
11030
- for (const annotation of annotations.points) {
11031
- if (annotation.type === PointsAnnotationType$2.POINTS) {
11032
- circles.push(...annotation.points.map(point => ({
11033
- timestamp: receiveTime,
11034
- position: point,
11035
- xMultiplier,
11036
- yMultiplier,
11037
- diameter: annotation.thickness / 200,
11038
- thickness: annotation.thickness,
11039
- fill_color: annotation.fillColor ?? DEFAULT_STYLE.fill,
11040
- outline_color: annotation.outlineColor ?? DEFAULT_STYLE.fill
11041
- })));
11042
- } else {
11043
- points.push({
11044
- timestamp: receiveTime,
11045
- type: annotation.type === PointsAnnotationType$2.UNRECOGNIZED ? typescript$1.PointsAnnotationType.UNKNOWN : Number(annotation.type),
11046
- points: annotation.points,
11047
- outline_color: annotation.outlineColor ?? DEFAULT_STYLE.outline,
11048
- outline_colors: [],
11049
- fill_color: annotation.fillColor ?? DEFAULT_STYLE.fill,
11050
- thickness: annotation.thickness
11051
- });
11052
- }
11053
- }
11030
+ points.push(...annotations.points.map(annotation => ({
11031
+ timestamp: receiveTime,
11032
+ type: annotation.type === PointsAnnotationType$2.UNRECOGNIZED ? typescript$1.PointsAnnotationType.UNKNOWN : Number(annotation.type),
11033
+ points: annotation.points,
11034
+ outline_color: annotation.outlineColor ?? DEFAULT_STYLE.outline,
11035
+ outline_colors: [],
11036
+ fill_color: annotation.fillColor ?? DEFAULT_STYLE.fill,
11037
+ thickness: annotation.thickness
11038
+ })));
11054
11039
  texts.push(...annotations.texts.map(annotation => ({
11055
11040
  timestamp: receiveTime,
11056
11041
  position: annotation.position ?? {
@@ -11064,6 +11049,8 @@ function deserializeImgDetectionsCustom({
11064
11049
  })));
11065
11050
  circles.push(...annotations.circles.map(annotation => ({
11066
11051
  timestamp: receiveTime,
11052
+ xMultiplier,
11053
+ yMultiplier,
11067
11054
  position: annotation.position ?? {
11068
11055
  x: 0,
11069
11056
  y: 0
@@ -11753,7 +11740,7 @@ class FoxgloveConnection {
11753
11740
  playerCapabilities = [PlayerCapabilities.playbackControl];
11754
11741
 
11755
11742
  // state options
11756
- messageEvent = null;
11743
+ messageEvents = [];
11757
11744
  receivedBytes = 0;
11758
11745
  parameters = new Map();
11759
11746
  publishedTopics = new Map();
@@ -11791,13 +11778,13 @@ class FoxgloveConnection {
11791
11778
  this.decodeMetrics.registerEvent(event.topic);
11792
11779
  const messageSize = estimateObjectSize(event.message);
11793
11780
  event.sizeInBytes = messageSize;
11794
- this.messageEvent = event;
11781
+ this.messageEvents.push(event);
11795
11782
  this.emitState();
11796
11783
  }
11797
11784
  emitState = debouncePromise(async () => {
11798
- const message = this.messageEvent;
11799
- this.messageEvent = null;
11800
- if (!this.listener || !message) {
11785
+ const messages = this.messageEvents;
11786
+ this.messageEvents = [];
11787
+ if (!this.listener || messages.length === 0) {
11801
11788
  await Promise.resolve();
11802
11789
  return;
11803
11790
  }
@@ -11810,10 +11797,12 @@ class FoxgloveConnection {
11810
11797
  }
11811
11798
  const problems = this.problems.getProblems();
11812
11799
  this.problems.clearProblems();
11813
- this.topics[message.topic] = {
11814
- name: message.topic,
11815
- schemaName: message.schemaName
11816
- };
11800
+ for (const message of messages) {
11801
+ this.topics[message.topic] = {
11802
+ name: message.topic,
11803
+ schemaName: message.schemaName
11804
+ };
11805
+ }
11817
11806
  const newPlayerState = {
11818
11807
  name: this.id,
11819
11808
  presence: this.playerPresence,
@@ -11824,7 +11813,7 @@ class FoxgloveConnection {
11824
11813
  problems,
11825
11814
  urlState: undefined,
11826
11815
  activeData: {
11827
- messages: [message],
11816
+ messages,
11828
11817
  totalBytesReceived: this.receivedBytes,
11829
11818
  startTime: this.startTime,
11830
11819
  endTime: this.endTime,
@@ -11846,6 +11835,7 @@ class FoxgloveConnection {
11846
11835
  });
11847
11836
  }
11848
11837
 
11838
+ // biome-ignore lint/suspicious/noExplicitAny: See https://github.com/biomejs/biome/issues/4906
11849
11839
  class EventEmitter {
11850
11840
  id = 0;
11851
11841
  handlers = {};
@@ -11869,7 +11859,7 @@ class EventEmitter {
11869
11859
  if (!this.handlers[key]) {
11870
11860
  return;
11871
11861
  }
11872
- const index = this.handlers[key].findIndex(handler => handler.id === id);
11862
+ const index = this.handlers[key].findIndex((handler) => handler.id === id);
11873
11863
  if (index > 0) {
11874
11864
  this.handlers[key].splice(index, 1);
11875
11865
  }
@@ -11900,54 +11890,62 @@ class WebRtcDataChannel {
11900
11890
  withFragmentation;
11901
11891
  events = new EventEmitter();
11902
11892
  oldMessages = [];
11903
- buffer = new Uint8Array(0);
11893
+ buffers = new Map();
11904
11894
  constructor(channel, withFragmentation = false) {
11905
11895
  this.channel = channel;
11906
11896
  this.withFragmentation = withFragmentation;
11907
- this.channel.addEventListener('error', event => this.events.emit('error', [event]));
11908
- this.channel.addEventListener('message', async (event) => {
11909
- if (channel.label === 'ping-pong') {
11910
- this.sendMessage('pong');
11897
+ this.channel.addEventListener("error", (event) => this.events.emit("error", [event]));
11898
+ this.channel.addEventListener("message", async (event) => {
11899
+ if (channel.label === "ping-pong") {
11900
+ this.sendMessage("pong");
11911
11901
  }
11912
11902
  if (!this.withFragmentation) {
11913
- this.events.emit('message', [event]);
11903
+ this.events.emit("message", [event]);
11914
11904
  return;
11915
11905
  }
11916
- const buffer = event.data instanceof ArrayBuffer ? event.data : await event.data.arrayBuffer();
11906
+ const buffer = event.data instanceof ArrayBuffer
11907
+ ? event.data
11908
+ : await event.data.arrayBuffer();
11917
11909
  const view = new DataView(buffer);
11918
11910
  const totalChunks = view.getUint32(0);
11919
11911
  const chunkIndex = view.getUint32(4);
11920
- const data = new Uint8Array(buffer, 8).slice(0);
11912
+ const messageId = view.getUint32(8);
11913
+ const data = new Uint8Array(buffer, 12).slice(0);
11921
11914
  if (totalChunks !== 1) {
11922
- this.appendChunk(data);
11915
+ this.appendChunk(messageId, data);
11923
11916
  if (totalChunks - 1 !== chunkIndex) {
11924
11917
  return;
11925
11918
  }
11926
11919
  }
11927
- const completeData = totalChunks === 1 ? data : this.buffer;
11928
- this.events.emit('message', [
11929
- new MessageEvent('message', {
11920
+ const completeData =
11921
+ // biome-ignore lint/style/noNonNullAssertion: Buffer is definitely created above
11922
+ totalChunks === 1 ? data : this.buffers.get(messageId);
11923
+ this.events.emit("message", [
11924
+ new MessageEvent("message", {
11930
11925
  data: completeData.buffer,
11931
11926
  }),
11932
11927
  ]);
11933
11928
  if (totalChunks !== 1) {
11934
- this.buffer = new Uint8Array(0);
11929
+ this.buffers.delete(messageId);
11935
11930
  }
11936
11931
  });
11937
- this.channel.addEventListener('close', event => this.events.emit('close', [event]));
11938
- this.channel.addEventListener('open', event => {
11939
- this.events.emit('open', [event]);
11932
+ this.channel.addEventListener("close", (event) => this.events.emit("close", [event]));
11933
+ this.channel.addEventListener("open", (event) => {
11934
+ this.events.emit("open", [event]);
11940
11935
  for (const message of this.oldMessages) {
11941
11936
  this.sendMessage(message);
11942
11937
  }
11943
11938
  this.oldMessages = [];
11944
11939
  });
11945
11940
  }
11946
- appendChunk(bytes) {
11947
- const newBuffer = new Uint8Array(this.buffer.byteLength + bytes.byteLength);
11948
- newBuffer.set(this.buffer, 0);
11949
- newBuffer.set(bytes, this.buffer.byteLength);
11950
- this.buffer = newBuffer;
11941
+ appendChunk(messageId, bytes) {
11942
+ const buffer = this.buffers.get(messageId);
11943
+ const newBuffer = new Uint8Array((buffer?.byteLength ?? 0) + bytes.byteLength);
11944
+ if (buffer) {
11945
+ newBuffer.set(buffer, 0);
11946
+ }
11947
+ newBuffer.set(bytes, buffer?.byteLength ?? 0);
11948
+ this.buffers.set(messageId, newBuffer);
11951
11949
  }
11952
11950
  get raw() {
11953
11951
  return this.channel;
@@ -11956,8 +11954,10 @@ class WebRtcDataChannel {
11956
11954
  return this.channel.label;
11957
11955
  }
11958
11956
  sendMessage(message) {
11959
- if (this.channel.readyState === 'open') {
11960
- const chunks = message instanceof DataView && this.withFragmentation ? makeChunks(message) : [message];
11957
+ if (this.channel.readyState === "open") {
11958
+ const chunks = message instanceof DataView && this.withFragmentation
11959
+ ? makeChunks(message)
11960
+ : [message];
11961
11961
  for (const chunk of chunks) {
11962
11962
  this.channel.send(chunk);
11963
11963
  }
@@ -11973,29 +11973,39 @@ class WebRtcDataChannel {
11973
11973
  * **only** if you are sure that all messages sent over this channel will contain text.
11974
11974
  */
11975
11975
  onTextMessage(callback) {
11976
- return this.events.on('message', async (event) => {
11977
- const buffer = event.data instanceof ArrayBuffer ? event.data : await event.data.arrayBuffer();
11978
- const message = new TextDecoder('utf-8').decode(buffer);
11976
+ this.events.on("message", async (event) => {
11977
+ const buffer = event.data instanceof ArrayBuffer
11978
+ ? event.data
11979
+ : await event.data.arrayBuffer();
11980
+ const message = new TextDecoder("utf-8").decode(buffer);
11979
11981
  callback(message);
11980
11982
  });
11981
11983
  }
11982
11984
  on(event, callback) {
11983
- const specificMessageEvents = ['message:binary', 'message:string', 'message:json'];
11985
+ const specificMessageEvents = [
11986
+ "message:binary",
11987
+ "message:string",
11988
+ "message:json",
11989
+ ];
11984
11990
  if (!specificMessageEvents.includes(event)) {
11985
11991
  return this.events.on(event, callback);
11986
11992
  }
11987
- return this.events.on('message', async (rawEvent) => {
11988
- const buffer = rawEvent.data instanceof ArrayBuffer ? rawEvent.data : await rawEvent.data.arrayBuffer();
11989
- if (event === 'message:binary') {
11993
+ return this.events.on("message", async (rawEvent) => {
11994
+ const buffer = rawEvent.data instanceof ArrayBuffer
11995
+ ? rawEvent.data
11996
+ : await rawEvent.data.arrayBuffer();
11997
+ if (event === "message:binary") {
11990
11998
  const view = new DataView(buffer);
11999
+ // biome-ignore lint/suspicious/noExplicitAny: TS is weak
11991
12000
  callback(view);
11992
12001
  }
11993
12002
  else {
11994
- const message = new TextDecoder('utf-8').decode(buffer);
11995
- if (event === 'message:string') {
12003
+ const message = new TextDecoder("utf-8").decode(buffer);
12004
+ if (event === "message:string") {
12005
+ // biome-ignore lint/suspicious/noExplicitAny: TS is weak
11996
12006
  callback(message);
11997
12007
  }
11998
- else if (event === 'message:json') {
12008
+ else if (event === "message:json") {
11999
12009
  callback(JSON.parse(message));
12000
12010
  }
12001
12011
  }
@@ -12011,42 +12021,40 @@ class WebRtcConnection {
12011
12021
  onIceCandidate;
12012
12022
  onConnectionEstablished;
12013
12023
  constructor(args) {
12014
- this.iceServers = args.iceServers;
12024
+ this.iceServers = args.iceServers ?? [];
12015
12025
  this.onIceCandidate = args.onCandidate;
12016
12026
  this.onConnectionEstablished = args.onConnectionEstablished;
12017
12027
  this.#peerConnection = this.createPeerConnection(args.withFragmentation);
12018
12028
  }
12019
12029
  createPeerConnection(withFragmentation = false) {
12020
- const config = {
12021
- iceServers: this.iceServers ?? [],
12022
- };
12023
- const connection = new RTCPeerConnection(config);
12024
- connection.addEventListener('connectionstatechange', () => {
12025
- if (connection.connectionState === 'disconnected' ||
12026
- connection.connectionState === 'failed' ||
12027
- connection.connectionState === 'closed') {
12028
- this.events.emit('connection_closed', []);
12030
+ console.log("Using ICE servers:", this.iceServers);
12031
+ const connection = new RTCPeerConnection({ iceServers: this.iceServers });
12032
+ connection.addEventListener("connectionstatechange", () => {
12033
+ if (connection.connectionState === "disconnected" ||
12034
+ connection.connectionState === "failed" ||
12035
+ connection.connectionState === "closed") {
12036
+ this.events.emit("connection_closed", []);
12029
12037
  this.connected = false;
12030
12038
  }
12031
12039
  });
12032
- connection.addEventListener('iceconnectionstatechange', () => {
12033
- if (connection.connectionState === 'connected') {
12040
+ connection.addEventListener("iceconnectionstatechange", () => {
12041
+ if (connection.connectionState === "connected") {
12034
12042
  this.onConnectionEstablished();
12035
12043
  this.connected = true;
12036
12044
  }
12037
12045
  else if (this.connected) {
12038
- this.events.emit('connection_closed', []);
12046
+ this.events.emit("connection_closed", []);
12039
12047
  this.connected = false;
12040
12048
  }
12041
12049
  });
12042
- connection.onicecandidate = event => {
12050
+ connection.onicecandidate = (event) => {
12043
12051
  if (event.candidate) {
12044
12052
  this.onIceCandidate(event.candidate);
12045
12053
  }
12046
12054
  };
12047
- connection.addEventListener('datachannel', event => {
12048
- const channel = new WebRtcDataChannel(event.channel, event.channel.label !== 'ping-pong' && withFragmentation);
12049
- this.events.emit('data_channel', [channel]);
12055
+ connection.addEventListener("datachannel", (event) => {
12056
+ const channel = new WebRtcDataChannel(event.channel, event.channel.label !== "ping-pong" && withFragmentation);
12057
+ this.events.emit("data_channel", [channel]);
12050
12058
  });
12051
12059
  return connection;
12052
12060
  }
@@ -12061,7 +12069,7 @@ class WebRtcConnection {
12061
12069
  return this.#peerConnection.setRemoteDescription({ type, sdp });
12062
12070
  }
12063
12071
  async createDescription(type) {
12064
- const description = await this.#peerConnection[type === 'offer' ? 'createOffer' : 'createAnswer']();
12072
+ const description = await this.#peerConnection[type === "offer" ? "createOffer" : "createAnswer"]();
12065
12073
  await this.#peerConnection.setLocalDescription(description);
12066
12074
  return description;
12067
12075
  }
@@ -12069,12 +12077,13 @@ class WebRtcConnection {
12069
12077
  return this.#peerConnection.addIceCandidate(new RTCIceCandidate(candidate));
12070
12078
  }
12071
12079
  close() {
12072
- return this.#peerConnection.close();
12080
+ this.#peerConnection.close();
12073
12081
  }
12074
12082
  on = this.events.on.bind(this.events);
12075
12083
  }
12076
12084
 
12077
- const DEFAULT_SIGNALING_SERVER_URL = 'wss://signal.cloud.luxonis.com/session/';
12085
+ const ICE_SERVERS_API_ENDPOINT = "https://signal.cloud.luxonis.com/api/v1/turn-credentials";
12086
+ const DEFAULT_SIGNALING_SERVER_URL = "wss://signal.cloud.luxonis.com/session/";
12078
12087
  class WebRtcClient {
12079
12088
  config;
12080
12089
  socket;
@@ -12084,9 +12093,24 @@ class WebRtcClient {
12084
12093
  iceCandidates = [];
12085
12094
  constructor(config) {
12086
12095
  this.config = config;
12087
- this.signalingConnectionRetries = (config.signalingConnectionRetries ?? 3) || 0;
12096
+ this.config.iceServers ??= [];
12097
+ this.signalingConnectionRetries =
12098
+ (config.signalingConnectionRetries ?? 3) || 0;
12088
12099
  this.connectSignalingServer();
12089
12100
  }
12101
+ async useLuxonisIceServers() {
12102
+ try {
12103
+ const response = await fetch(ICE_SERVERS_API_ENDPOINT);
12104
+ const data = (await response.json());
12105
+ if (data.iceServers) {
12106
+ // biome-ignore lint/style/noNonNullAssertion: Always set in the constructor
12107
+ this.config.iceServers.push(data.iceServers);
12108
+ }
12109
+ }
12110
+ catch (error) {
12111
+ console.error("DAI Connection Error: Cannot retrieve ICE servers, falling back to default:", error);
12112
+ }
12113
+ }
12090
12114
  get signalingServerConnected() {
12091
12115
  return this.socket.readyState === WebSocket.OPEN;
12092
12116
  }
@@ -12094,7 +12118,7 @@ class WebRtcClient {
12094
12118
  this.connection?.close();
12095
12119
  this.sendMessage({
12096
12120
  Disconnect: {
12097
- type: 'normal',
12121
+ type: "normal",
12098
12122
  reason,
12099
12123
  },
12100
12124
  });
@@ -12114,22 +12138,23 @@ class WebRtcClient {
12114
12138
  this.connect();
12115
12139
  };
12116
12140
  // this.socket.onclose = () => console.debug('[WebRTC] Disconnected from signaling server');
12117
- this.socket.onerror = error => {
12118
- this.events.emit('error', ['signaling_connection_error', error]);
12119
- if (!this.events.isEventHandled('error')) {
12120
- console.error('[WebRTC] Signaling connection error:', error);
12141
+ this.socket.onerror = (error) => {
12142
+ this.events.emit("error", ["signaling_connection_error", error]);
12143
+ if (!this.events.isEventHandled("error")) {
12144
+ console.error("[WebRTC] Signaling connection error:", error);
12121
12145
  }
12122
12146
  setTimeout(() => {
12123
12147
  if (this.signalingConnectionRetries) {
12124
12148
  this.signalingConnectionRetries -= 1;
12125
- if (this.socket.readyState === WebSocket.CLOSED || this.socket.readyState === WebSocket.CLOSING) {
12149
+ if (this.socket.readyState === WebSocket.CLOSED ||
12150
+ this.socket.readyState === WebSocket.CLOSING) {
12126
12151
  // console.debug('[WebRTC] Reconnecting to signaling server');
12127
12152
  this.connectSignalingServer();
12128
12153
  }
12129
12154
  }
12130
12155
  }, 3_000);
12131
12156
  };
12132
- this.socket.onmessage = event => {
12157
+ this.socket.onmessage = (event) => {
12133
12158
  const message = JSON.parse(event.data);
12134
12159
  this.handleSignalingMessage(message);
12135
12160
  };
@@ -12138,7 +12163,7 @@ class WebRtcClient {
12138
12163
  if (this.signalingServerConnected) {
12139
12164
  this.sendMessage({
12140
12165
  Disconnect: {
12141
- type: 'normal',
12166
+ type: "normal",
12142
12167
  reason,
12143
12168
  },
12144
12169
  });
@@ -12146,38 +12171,46 @@ class WebRtcClient {
12146
12171
  }
12147
12172
  }
12148
12173
  handleSignalingMessage(message) {
12149
- if ('AcknowledgeSession' in message) {
12174
+ if ("AcknowledgeSession" in message) {
12150
12175
  if (message.AcknowledgeSession.acknowledge) {
12151
- this.createConnection();
12176
+ if (this.config.useLuxonisIceServers) {
12177
+ this.useLuxonisIceServers().then(() => this.createConnection());
12178
+ }
12179
+ else {
12180
+ this.createConnection();
12181
+ }
12152
12182
  }
12153
12183
  else {
12154
- if (!this.events.isEventHandled('error')) {
12155
- console.error('[WebRTC] Connection refused:', message.AcknowledgeSession.reason);
12184
+ if (!this.events.isEventHandled("error")) {
12185
+ console.error("[WebRTC] Connection refused:", message.AcknowledgeSession.reason);
12156
12186
  }
12157
- this.events.emit('error', ['signaling_rejected', message.AcknowledgeSession.reason]);
12158
- this.dispose('Connection refused');
12187
+ this.events.emit("error", [
12188
+ "signaling_rejected",
12189
+ message.AcknowledgeSession.reason,
12190
+ ]);
12191
+ this.dispose("Connection refused");
12159
12192
  }
12160
12193
  }
12161
- else if ('Candidate' in message) {
12194
+ else if ("Candidate" in message) {
12162
12195
  void this.handleCandidateMessage(message);
12163
12196
  }
12164
- else if ('Disconnect' in message) {
12165
- this.dispose('Targed disconnected');
12197
+ else if ("Disconnect" in message) {
12198
+ this.dispose("Targed disconnected");
12166
12199
  }
12167
12200
  }
12168
- async handleCandidateMessage({ Candidate: { type: kind, candidate } }) {
12201
+ async handleCandidateMessage({ Candidate: { type: kind, candidate }, }) {
12169
12202
  if (!this.connection) {
12170
12203
  // console.error('[WebRTC] Candidate message dropped: conenction not established');
12171
12204
  return;
12172
12205
  }
12173
12206
  // console.debug('[WebRTC] Processing candidate message', kind);
12174
12207
  switch (kind) {
12175
- case 'answer':
12176
- case 'offer': {
12208
+ case "answer":
12209
+ case "offer": {
12177
12210
  const data = `${candidate}`;
12178
- if (data === 'null' || data === '') {
12179
- console.error('[WebRTC] Offer refused: remote description cannot be null');
12180
- this.reconnect('Error: received invalid candidate');
12211
+ if (data === "null" || data === "") {
12212
+ console.error("[WebRTC] Offer refused: remote description cannot be null");
12213
+ this.reconnect("Error: received invalid candidate");
12181
12214
  return;
12182
12215
  }
12183
12216
  // console.debug('[WebRTC] Offer accepted. Setting remote description..');
@@ -12188,19 +12221,19 @@ class WebRtcClient {
12188
12221
  void this.connection.addIceCandidate(JSON.parse(iceCandidate));
12189
12222
  }
12190
12223
  this.iceCandidates = [];
12191
- if (kind === 'offer') {
12192
- const answer = await this.connection.createDescription('answer');
12224
+ if (kind === "offer") {
12225
+ const answer = await this.connection.createDescription("answer");
12193
12226
  // console.debug('[WebRTC] Answer created (set local description)');
12194
12227
  this.sendMessage({
12195
12228
  Candidate: {
12196
- type: 'answer',
12197
- candidate: answer.sdp ?? '',
12229
+ type: "answer",
12230
+ candidate: answer.sdp ?? "",
12198
12231
  },
12199
12232
  });
12200
12233
  }
12201
12234
  return;
12202
12235
  }
12203
- case 'candidate': {
12236
+ case "candidate": {
12204
12237
  if (this.connection.peerConnection.remoteDescription === null) {
12205
12238
  // console.debug('[WebRTC] Storing ICE candidate (remote description is not set yet)');
12206
12239
  this.iceCandidates.push(candidate);
@@ -12226,18 +12259,18 @@ class WebRtcClient {
12226
12259
  createConnection() {
12227
12260
  this.connection = new WebRtcConnection({
12228
12261
  iceServers: this.config.iceServers,
12229
- onCandidate: candidate => {
12262
+ onCandidate: (candidate) => {
12230
12263
  this.sendMessage({
12231
12264
  Candidate: {
12232
- type: 'candidate',
12265
+ type: "candidate",
12233
12266
  candidate: JSON.stringify(candidate),
12234
12267
  },
12235
12268
  });
12236
12269
  },
12237
- onConnectionEstablished: () => this.disconnectSignalingServer('P2P connection established'),
12270
+ onConnectionEstablished: () => this.disconnectSignalingServer("P2P connection established"),
12238
12271
  withFragmentation: this.config.withFragmentation,
12239
12272
  });
12240
- this.events.emit('connection_established', [this.connection]);
12273
+ this.events.emit("connection_established", [this.connection]);
12241
12274
  }
12242
12275
  dispose(reason) {
12243
12276
  this.disconnect(reason);
@@ -12526,7 +12559,7 @@ class VisualizerConnection extends FoxgloveConnection {
12526
12559
  this.emitState();
12527
12560
  });
12528
12561
  this.#adapter.addEventListener("error", _event => {
12529
- this.messageEvent = null;
12562
+ this.messageEvents = [];
12530
12563
  this.playerPresence = PlayerPresence.ERROR;
12531
12564
  this.emitState();
12532
12565
  });
@@ -89667,7 +89700,7 @@ function legacy(parser) {
89667
89700
  return new LanguageSupport(StreamLanguage.define(parser));
89668
89701
  }
89669
89702
  function sql$1(dialectName) {
89670
- return import('./index-DEvW8DL5.js').then(m => m.sql({ dialect: m[dialectName] }));
89703
+ return import('./index-BOhRuVDj.js').then(m => m.sql({ dialect: m[dialectName] }));
89671
89704
  }
89672
89705
  /**
89673
89706
  An array of language descriptions for known language packages.
@@ -89678,7 +89711,7 @@ const languages = [
89678
89711
  name: "C",
89679
89712
  extensions: ["c", "h", "ino"],
89680
89713
  load() {
89681
- return import('./index-Ca41zUtb.js').then(m => m.cpp());
89714
+ return import('./index-fmHFT9p5.js').then(m => m.cpp());
89682
89715
  }
89683
89716
  }),
89684
89717
  /*@__PURE__*/LanguageDescription.of({
@@ -89686,7 +89719,7 @@ const languages = [
89686
89719
  alias: ["cpp"],
89687
89720
  extensions: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"],
89688
89721
  load() {
89689
- return import('./index-Ca41zUtb.js').then(m => m.cpp());
89722
+ return import('./index-fmHFT9p5.js').then(m => m.cpp());
89690
89723
  }
89691
89724
  }),
89692
89725
  /*@__PURE__*/LanguageDescription.of({
@@ -89706,7 +89739,7 @@ const languages = [
89706
89739
  name: "Go",
89707
89740
  extensions: ["go"],
89708
89741
  load() {
89709
- return import('./index-CvMPmv6l.js').then(m => m.go());
89742
+ return import('./index-DMKuVDI3.js').then(m => m.go());
89710
89743
  }
89711
89744
  }),
89712
89745
  /*@__PURE__*/LanguageDescription.of({
@@ -89721,7 +89754,7 @@ const languages = [
89721
89754
  name: "Java",
89722
89755
  extensions: ["java"],
89723
89756
  load() {
89724
- return import('./index-BnZ2drUS.js').then(m => m.java());
89757
+ return import('./index-DkIfiBNh.js').then(m => m.java());
89725
89758
  }
89726
89759
  }),
89727
89760
  /*@__PURE__*/LanguageDescription.of({
@@ -89737,7 +89770,7 @@ const languages = [
89737
89770
  alias: ["json5"],
89738
89771
  extensions: ["json", "map"],
89739
89772
  load() {
89740
- return import('./index-BjoNcT1u.js').then(m => m.json());
89773
+ return import('./index-Nllymnr2.js').then(m => m.json());
89741
89774
  }
89742
89775
  }),
89743
89776
  /*@__PURE__*/LanguageDescription.of({
@@ -89751,14 +89784,14 @@ const languages = [
89751
89784
  name: "LESS",
89752
89785
  extensions: ["less"],
89753
89786
  load() {
89754
- return import('./index-BSgO0fZJ.js').then(m => m.less());
89787
+ return import('./index-Dc8AWAbG.js').then(m => m.less());
89755
89788
  }
89756
89789
  }),
89757
89790
  /*@__PURE__*/LanguageDescription.of({
89758
89791
  name: "Liquid",
89759
89792
  extensions: ["liquid"],
89760
89793
  load() {
89761
- return import('./index-DOETjfmm.js').then(m => m.liquid());
89794
+ return import('./index-C5UABCF_.js').then(m => m.liquid());
89762
89795
  }
89763
89796
  }),
89764
89797
  /*@__PURE__*/LanguageDescription.of({
@@ -89784,7 +89817,7 @@ const languages = [
89784
89817
  name: "PHP",
89785
89818
  extensions: ["php", "php3", "php4", "php5", "php7", "phtml"],
89786
89819
  load() {
89787
- return import('./index-CqHlndDu.js').then(m => m.php());
89820
+ return import('./index-CodwiqtN.js').then(m => m.php());
89788
89821
  }
89789
89822
  }),
89790
89823
  /*@__PURE__*/LanguageDescription.of({
@@ -89801,28 +89834,28 @@ const languages = [
89801
89834
  extensions: ["BUILD", "bzl", "py", "pyw"],
89802
89835
  filename: /^(BUCK|BUILD)$/,
89803
89836
  load() {
89804
- return import('./index-16Fm74Uw.js').then(m => m.python());
89837
+ return import('./index-815UyjXe.js').then(m => m.python());
89805
89838
  }
89806
89839
  }),
89807
89840
  /*@__PURE__*/LanguageDescription.of({
89808
89841
  name: "Rust",
89809
89842
  extensions: ["rs"],
89810
89843
  load() {
89811
- return import('./index-BqEaMk6I.js').then(m => m.rust());
89844
+ return import('./index-C-7YCit4.js').then(m => m.rust());
89812
89845
  }
89813
89846
  }),
89814
89847
  /*@__PURE__*/LanguageDescription.of({
89815
89848
  name: "Sass",
89816
89849
  extensions: ["sass"],
89817
89850
  load() {
89818
- return import('./index-Bg4K4PDT.js').then(m => m.sass({ indented: true }));
89851
+ return import('./index-C3no0vbu.js').then(m => m.sass({ indented: true }));
89819
89852
  }
89820
89853
  }),
89821
89854
  /*@__PURE__*/LanguageDescription.of({
89822
89855
  name: "SCSS",
89823
89856
  extensions: ["scss"],
89824
89857
  load() {
89825
- return import('./index-Bg4K4PDT.js').then(m => m.sass());
89858
+ return import('./index-C3no0vbu.js').then(m => m.sass());
89826
89859
  }
89827
89860
  }),
89828
89861
  /*@__PURE__*/LanguageDescription.of({
@@ -89853,7 +89886,7 @@ const languages = [
89853
89886
  name: "WebAssembly",
89854
89887
  extensions: ["wat", "wast"],
89855
89888
  load() {
89856
- return import('./index-ZLPDCVkk.js').then(m => m.wast());
89889
+ return import('./index-Bmkj6F04.js').then(m => m.wast());
89857
89890
  }
89858
89891
  }),
89859
89892
  /*@__PURE__*/LanguageDescription.of({
@@ -89861,7 +89894,7 @@ const languages = [
89861
89894
  alias: ["rss", "wsdl", "xsd"],
89862
89895
  extensions: ["xml", "xsl", "xsd", "svg"],
89863
89896
  load() {
89864
- return import('./index-C9RAS_2_.js').then(m => m.xml());
89897
+ return import('./index-BrniHYok.js').then(m => m.xml());
89865
89898
  }
89866
89899
  }),
89867
89900
  /*@__PURE__*/LanguageDescription.of({
@@ -89869,7 +89902,7 @@ const languages = [
89869
89902
  alias: ["yml"],
89870
89903
  extensions: ["yaml", "yml"],
89871
89904
  load() {
89872
- return import('./index-DYufn_cZ.js').then(m => m.yaml());
89905
+ return import('./index-BAty4u9-.js').then(m => m.yaml());
89873
89906
  }
89874
89907
  }),
89875
89908
  // Legacy modes ported from CodeMirror 5
@@ -90665,13 +90698,13 @@ const languages = [
90665
90698
  name: "Vue",
90666
90699
  extensions: ["vue"],
90667
90700
  load() {
90668
- return import('./index-1kGRR1LW.js').then(m => m.vue());
90701
+ return import('./index-B-oS4lo9.js').then(m => m.vue());
90669
90702
  }
90670
90703
  }),
90671
90704
  /*@__PURE__*/LanguageDescription.of({
90672
90705
  name: "Angular Template",
90673
90706
  load() {
90674
- return import('./index-Dbn3jIp3.js').then(m => m.angular());
90707
+ return import('./index-C268C4La.js').then(m => m.angular());
90675
90708
  }
90676
90709
  })
90677
90710
  ];
@@ -161576,7 +161609,7 @@ const Panel = ({
161576
161609
  }, children))))));
161577
161610
  };
161578
161611
 
161579
- const ImagePanelComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-DfYmZ5i0.js'));
161612
+ const ImagePanelComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-D9OFUMug.js'));
161580
161613
  const ImagePanelBody = ({
161581
161614
  topic
161582
161615
  }) => {
@@ -161611,7 +161644,7 @@ const ImagePanel = /*#__PURE__*/React__default.memo(function ImagePanel(props) {
161611
161644
  // License, v2.0. If a copy of the MPL was not distributed with this
161612
161645
  // file, You can obtain one at http://mozilla.org/MPL/2.0/
161613
161646
 
161614
- const ThreeDeeRenderComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-CTKzqMRG.js'));
161647
+ const ThreeDeeRenderComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-CnOHdOBX.js'));
161615
161648
  const PointCloudPanelBody = ({
161616
161649
  topic
161617
161650
  }) => {