@openfin/node-adapter 44.100.61 → 45.100.18

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 (2) hide show
  1. package/out/node-adapter.js +359 -175
  2. package/package.json +5 -5
@@ -44,13 +44,13 @@ var system = {};
44
44
 
45
45
  var base = {};
46
46
 
47
- var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
47
+ var __classPrivateFieldSet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
48
48
  if (kind === "m") throw new TypeError("Private method is not writable");
49
49
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
50
50
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
51
51
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
52
52
  };
53
- var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
53
+ var __classPrivateFieldGet$j = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
54
54
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
55
55
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
56
56
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -134,9 +134,9 @@ class EmitterBase extends Base {
134
134
  this.emit = (eventType, payload, ...args) => {
135
135
  return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
136
136
  };
137
- this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
137
+ this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
138
138
  this.getOrCreateEmitter = () => {
139
- return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
139
+ return this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
140
140
  };
141
141
  this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
142
142
  this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
@@ -174,8 +174,8 @@ class EmitterBase extends Base {
174
174
  // This will only be reached if unsubscribe from event that does not exist but do not want to error here
175
175
  return Promise.resolve();
176
176
  };
177
- __classPrivateFieldSet$h(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
178
- __classPrivateFieldSet$h(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
177
+ __classPrivateFieldSet$i(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
178
+ __classPrivateFieldSet$i(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
179
179
  }
180
180
  /**
181
181
  * Adds a listener to the end of the listeners array for the specified event.
@@ -203,7 +203,7 @@ class EmitterBase extends Base {
203
203
  */
204
204
  async once(eventType, listener, options) {
205
205
  const deregister = () => this.deregisterEventListener(eventType);
206
- __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
206
+ __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
207
207
  await this.registerEventListener(eventType, options, (emitter) => {
208
208
  emitter.once(eventType, deregister);
209
209
  emitter.once(eventType, listener);
@@ -234,7 +234,7 @@ class EmitterBase extends Base {
234
234
  */
235
235
  async prependOnceListener(eventType, listener, options) {
236
236
  const deregister = () => this.deregisterEventListener(eventType);
237
- __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
237
+ __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
238
238
  await this.registerEventListener(eventType, options, (emitter) => {
239
239
  emitter.prependOnceListener(eventType, listener);
240
240
  emitter.once(eventType, deregister);
@@ -253,7 +253,7 @@ class EmitterBase extends Base {
253
253
  const emitter = await this.deregisterEventListener(eventType, options);
254
254
  if (emitter) {
255
255
  emitter.removeListener(eventType, listener);
256
- const deregister = __classPrivateFieldGet$i(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
256
+ const deregister = __classPrivateFieldGet$j(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
257
257
  if (deregister) {
258
258
  emitter.removeListener(eventType, deregister);
259
259
  }
@@ -299,7 +299,7 @@ class EmitterBase extends Base {
299
299
  deleteEmitterIfNothingRegistered(emitter) {
300
300
  // TODO: maybe emitterMap should clean up itself..
301
301
  if (emitter.eventNames().length === 0) {
302
- this.wire.eventAggregator.delete(__classPrivateFieldGet$i(this, _EmitterBase_emitterAccessor, "f"));
302
+ this.wire.eventAggregator.delete(__classPrivateFieldGet$j(this, _EmitterBase_emitterAccessor, "f"));
303
303
  }
304
304
  }
305
305
  }
@@ -5523,6 +5523,11 @@ class System extends base_1$m.EmitterBase {
5523
5523
  /**
5524
5524
  * Returns a unique identifier (UUID) provided by the machine.
5525
5525
  *
5526
+ * On Windows, the machine ID is the `MachineGuid` value located in the Windows Registry at:
5527
+ * `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
5528
+ *
5529
+ * On macOS, the machine ID is the hardware UUID of the machine, obtained via native OS APIs.
5530
+ *
5526
5531
  * @example
5527
5532
  * ```js
5528
5533
  * fin.System.getMachineId().then(id => console.log(id)).catch(err => console.log(err));
@@ -7611,12 +7616,12 @@ class ChannelError extends Error {
7611
7616
  }
7612
7617
  channelError.ChannelError = ChannelError;
7613
7618
 
7614
- var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7619
+ var __classPrivateFieldGet$i = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7615
7620
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
7616
7621
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
7617
7622
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7618
7623
  };
7619
- var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7624
+ var __classPrivateFieldSet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7620
7625
  if (kind === "m") throw new TypeError("Private method is not writable");
7621
7626
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
7622
7627
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -7660,7 +7665,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7660
7665
  static closeChannelByEndpointId(id) {
7661
7666
  const channel = channelClientsByEndpointId.get(id);
7662
7667
  if (channel) {
7663
- __classPrivateFieldGet$h(channel, _ChannelClient_close, "f").call(channel);
7668
+ __classPrivateFieldGet$i(channel, _ChannelClient_close, "f").call(channel);
7664
7669
  }
7665
7670
  }
7666
7671
  /**
@@ -7671,7 +7676,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7671
7676
  for (const channelClient of channelClientsByEndpointId.values()) {
7672
7677
  if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
7673
7678
  channelClient.disconnectListener(eventPayload);
7674
- __classPrivateFieldGet$h(channelClient, _ChannelClient_close, "f").call(channelClient);
7679
+ __classPrivateFieldGet$i(channelClient, _ChannelClient_close, "f").call(channelClient);
7675
7680
  }
7676
7681
  }
7677
7682
  }
@@ -7686,12 +7691,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
7686
7691
  this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
7687
7692
  _ChannelClient_close.set(this, () => {
7688
7693
  channelClientsByEndpointId.delete(this.endpointId);
7689
- __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").close();
7694
+ __classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").close();
7690
7695
  });
7691
- __classPrivateFieldSet$g(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
7696
+ __classPrivateFieldSet$h(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
7692
7697
  this.disconnectListener = () => undefined;
7693
7698
  this.endpointId = routingInfo.endpointId;
7694
- __classPrivateFieldSet$g(this, _ChannelClient_strategy, strategy, "f");
7699
+ __classPrivateFieldSet$h(this, _ChannelClient_strategy, strategy, "f");
7695
7700
  channelClientsByEndpointId.set(this.endpointId, this);
7696
7701
  strategy.receive(this.processAction);
7697
7702
  }
@@ -7699,7 +7704,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
7699
7704
  * a read-only provider identity
7700
7705
  */
7701
7706
  get providerIdentity() {
7702
- const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
7707
+ const protectedObj = __classPrivateFieldGet$i(this, _ChannelClient_protectedObj, "f");
7703
7708
  return protectedObj.providerIdentity;
7704
7709
  }
7705
7710
  /**
@@ -7728,9 +7733,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
7728
7733
  * ```
7729
7734
  */
7730
7735
  async dispatch(action, payload) {
7731
- if (__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
7736
+ if (__classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
7732
7737
  const callSites = transport_errors_1$3.RuntimeError.getCallSite();
7733
- return __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
7738
+ return __classPrivateFieldGet$i(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
7734
7739
  throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
7735
7740
  });
7736
7741
  }
@@ -7782,10 +7787,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
7782
7787
  */
7783
7788
  async disconnect() {
7784
7789
  await this.sendDisconnectAction();
7785
- __classPrivateFieldGet$h(this, _ChannelClient_close, "f").call(this);
7790
+ __classPrivateFieldGet$i(this, _ChannelClient_close, "f").call(this);
7786
7791
  }
7787
7792
  async sendDisconnectAction() {
7788
- const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
7793
+ const protectedObj = __classPrivateFieldGet$i(this, _ChannelClient_protectedObj, "f");
7789
7794
  await protectedObj.close();
7790
7795
  }
7791
7796
  /**
@@ -7818,13 +7823,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
7818
7823
 
7819
7824
  var strategy$3 = {};
7820
7825
 
7821
- var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7826
+ var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7822
7827
  if (kind === "m") throw new TypeError("Private method is not writable");
7823
7828
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
7824
7829
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
7825
7830
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7826
7831
  };
7827
- var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7832
+ var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7828
7833
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
7829
7834
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
7830
7835
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -7849,7 +7854,7 @@ class ClassicStrategy {
7849
7854
  // connection problems occur
7850
7855
  _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
7851
7856
  this.send = async (endpointId, action, payload) => {
7852
- const to = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
7857
+ const to = __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
7853
7858
  if (!to) {
7854
7859
  throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
7855
7860
  }
@@ -7861,13 +7866,13 @@ class ClassicStrategy {
7861
7866
  }
7862
7867
  delete cleanId.isLocalEndpointId;
7863
7868
  // grab the promise before awaiting it to save in our pending messages map
7864
- const p = __classPrivateFieldGet$g(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
7869
+ const p = __classPrivateFieldGet$h(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
7865
7870
  ...cleanId,
7866
7871
  providerIdentity: this.providerIdentity,
7867
7872
  action,
7868
7873
  payload
7869
7874
  });
7870
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
7875
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
7871
7876
  const raw = await p
7872
7877
  .catch((error) => {
7873
7878
  if ('cause' in error) {
@@ -7877,16 +7882,16 @@ class ClassicStrategy {
7877
7882
  })
7878
7883
  .finally(() => {
7879
7884
  // clean up the pending promise
7880
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
7885
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
7881
7886
  });
7882
7887
  return raw.payload.data.result;
7883
7888
  };
7884
7889
  this.close = async () => {
7885
7890
  this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
7886
- [...__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
7887
- __classPrivateFieldSet$f(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
7891
+ [...__classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
7892
+ __classPrivateFieldSet$g(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
7888
7893
  };
7889
- __classPrivateFieldSet$f(this, _ClassicStrategy_wire, wire, "f");
7894
+ __classPrivateFieldSet$g(this, _ClassicStrategy_wire, wire, "f");
7890
7895
  }
7891
7896
  onEndpointDisconnect(endpointId, listener) {
7892
7897
  // Never fires for 'classic'.
@@ -7895,20 +7900,20 @@ class ClassicStrategy {
7895
7900
  this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
7896
7901
  }
7897
7902
  async closeEndpoint(endpointId) {
7898
- const id = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
7899
- __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
7900
- const pendingSet = __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
7903
+ const id = __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
7904
+ __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
7905
+ const pendingSet = __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
7901
7906
  pendingSet?.forEach((p) => {
7902
7907
  const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
7903
7908
  p.cancel(new Error(errorMsg));
7904
7909
  });
7905
7910
  }
7906
7911
  isEndpointConnected(endpointId) {
7907
- return __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
7912
+ return __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
7908
7913
  }
7909
7914
  addEndpoint(endpointId, payload) {
7910
- __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
7911
- __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
7915
+ __classPrivateFieldGet$h(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
7916
+ __classPrivateFieldGet$h(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
7912
7917
  }
7913
7918
  isValidEndpointPayload(payload) {
7914
7919
  return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
@@ -7943,12 +7948,12 @@ function errorToPOJO(error) {
7943
7948
  }
7944
7949
  errors.errorToPOJO = errorToPOJO;
7945
7950
 
7946
- var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7951
+ var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7947
7952
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
7948
7953
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
7949
7954
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7950
7955
  };
7951
- var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7956
+ var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7952
7957
  if (kind === "m") throw new TypeError("Private method is not writable");
7953
7958
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
7954
7959
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -7983,8 +7988,8 @@ class RTCEndpoint {
7983
7988
  if (this.rtc.rtcClient.connectionState !== 'connected') {
7984
7989
  this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
7985
7990
  this.close();
7986
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
7987
- __classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
7991
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
7992
+ __classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f").call(this);
7988
7993
  }
7989
7994
  }
7990
7995
  };
@@ -8032,9 +8037,9 @@ class RTCEndpoint {
8032
8037
  data = new TextDecoder().decode(e.data);
8033
8038
  }
8034
8039
  const { messageId, action, payload } = JSON.parse(data);
8035
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
8040
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f")) {
8036
8041
  try {
8037
- const res = await __classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
8042
+ const res = await __classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
8038
8043
  this.rtc.channels.response.send(JSON.stringify({
8039
8044
  messageId,
8040
8045
  payload: res,
@@ -8068,25 +8073,25 @@ class RTCEndpoint {
8068
8073
  datachannel.onclose = (e) => {
8069
8074
  [...this.responseMap.values()].forEach((promise) => promise.reject(new Error('RTCDataChannel closed unexpectedly, this is most commonly caused by message size. Note: RTC Channels have a message size limit of ~255kB.')));
8070
8075
  this.close();
8071
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
8072
- __classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
8076
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
8077
+ __classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f").call(this);
8073
8078
  }
8074
8079
  };
8075
8080
  });
8076
8081
  }
8077
8082
  onDisconnect(listener) {
8078
- if (!__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
8079
- __classPrivateFieldSet$e(this, _RTCEndpoint_disconnectListener, listener, "f");
8083
+ if (!__classPrivateFieldGet$g(this, _RTCEndpoint_disconnectListener, "f")) {
8084
+ __classPrivateFieldSet$f(this, _RTCEndpoint_disconnectListener, listener, "f");
8080
8085
  }
8081
8086
  else {
8082
8087
  throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
8083
8088
  }
8084
8089
  }
8085
8090
  receive(listener) {
8086
- if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
8091
+ if (__classPrivateFieldGet$g(this, _RTCEndpoint_processAction, "f")) {
8087
8092
  throw new Error('You have already set a listener for this RTC Endpoint.');
8088
8093
  }
8089
- __classPrivateFieldSet$e(this, _RTCEndpoint_processAction, listener, "f");
8094
+ __classPrivateFieldSet$f(this, _RTCEndpoint_processAction, listener, "f");
8090
8095
  }
8091
8096
  get connected() {
8092
8097
  return this.rtc.rtcClient.connectionState === 'connected';
@@ -8097,12 +8102,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
8097
8102
 
8098
8103
  var strategy$1 = {};
8099
8104
 
8100
- var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8105
+ var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8101
8106
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8102
8107
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
8103
8108
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8104
8109
  };
8105
- var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8110
+ var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8106
8111
  if (kind === "m") throw new TypeError("Private method is not writable");
8107
8112
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8108
8113
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8123,11 +8128,11 @@ class EndpointStrategy {
8123
8128
  return this.getEndpointById(endpointId).send(action, payload);
8124
8129
  };
8125
8130
  this.close = async () => {
8126
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
8127
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
8128
- __classPrivateFieldSet$d(this, _EndpointStrategy_endpointMap, new Map(), "f");
8131
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f")) {
8132
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
8133
+ __classPrivateFieldSet$e(this, _EndpointStrategy_endpointMap, new Map(), "f");
8129
8134
  }
8130
- __classPrivateFieldSet$d(this, _EndpointStrategy_connected, false, "f");
8135
+ __classPrivateFieldSet$e(this, _EndpointStrategy_connected, false, "f");
8131
8136
  };
8132
8137
  this.isValidEndpointPayload = validateEndpoint;
8133
8138
  }
@@ -8135,39 +8140,39 @@ class EndpointStrategy {
8135
8140
  this.getEndpointById(endpointId).onDisconnect(listener);
8136
8141
  }
8137
8142
  receive(listener) {
8138
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
8143
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")) {
8139
8144
  throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
8140
8145
  }
8141
- __classPrivateFieldSet$d(this, _EndpointStrategy_processAction, listener, "f");
8146
+ __classPrivateFieldSet$e(this, _EndpointStrategy_processAction, listener, "f");
8142
8147
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8143
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")));
8148
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")));
8144
8149
  }
8145
8150
  getEndpointById(endpointId) {
8146
- const endpoint = __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
8151
+ const endpoint = __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
8147
8152
  if (!endpoint) {
8148
8153
  throw new Error(`Client with endpoint id ${endpointId} is not connected`);
8149
8154
  }
8150
8155
  return endpoint;
8151
8156
  }
8152
8157
  get connected() {
8153
- return __classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f");
8158
+ return __classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f");
8154
8159
  }
8155
8160
  isEndpointConnected(endpointId) {
8156
- return __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
8161
+ return __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
8157
8162
  }
8158
8163
  addEndpoint(endpointId, payload) {
8159
- if (!__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
8164
+ if (!__classPrivateFieldGet$f(this, _EndpointStrategy_connected, "f")) {
8160
8165
  console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
8161
8166
  return;
8162
8167
  }
8163
8168
  const clientStrat = new this.EndpointType(payload);
8164
- if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
8165
- clientStrat.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f"));
8169
+ if (__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f")) {
8170
+ clientStrat.receive(__classPrivateFieldGet$f(this, _EndpointStrategy_processAction, "f"));
8166
8171
  }
8167
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
8172
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
8168
8173
  }
8169
8174
  async closeEndpoint(endpointId) {
8170
- __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
8175
+ __classPrivateFieldGet$f(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
8171
8176
  }
8172
8177
  }
8173
8178
  strategy$1.EndpointStrategy = EndpointStrategy;
@@ -8349,12 +8354,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
8349
8354
  }
8350
8355
  runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
8351
8356
 
8352
- var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8357
+ var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8353
8358
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8354
8359
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
8355
8360
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
8356
8361
  };
8357
- var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8362
+ var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8358
8363
  if (kind === "m") throw new TypeError("Private method is not writable");
8359
8364
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8360
8365
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -8398,19 +8403,19 @@ class ChannelProvider extends channel_1.ChannelBase {
8398
8403
  * a read-only array containing all the identities of connecting clients.
8399
8404
  */
8400
8405
  get connections() {
8401
- return [...__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f")];
8406
+ return [...__classPrivateFieldGet$e(this, _ChannelProvider_connections, "f")];
8402
8407
  }
8403
8408
  static handleClientDisconnection(channel, payload) {
8404
8409
  if (payload?.endpointId) {
8405
8410
  const { uuid, name, endpointId, isLocalEndpointId } = payload;
8406
- __classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
8411
+ __classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
8407
8412
  }
8408
8413
  else {
8409
8414
  // this is here to support older runtimes that did not have endpointId
8410
8415
  const multipleRemoves = channel.connections.filter((identity) => {
8411
8416
  return identity.uuid === payload.uuid && identity.name === payload.name;
8412
8417
  });
8413
- multipleRemoves.forEach(__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f"));
8418
+ multipleRemoves.forEach(__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f"));
8414
8419
  }
8415
8420
  channel.disconnectListener(payload);
8416
8421
  }
@@ -8427,8 +8432,8 @@ class ChannelProvider extends channel_1.ChannelBase {
8427
8432
  _ChannelProvider_strategy.set(this, void 0);
8428
8433
  _ChannelProvider_removeEndpoint.set(this, (identity) => {
8429
8434
  const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
8430
- __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
8431
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, remainingConnections, "f");
8435
+ __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
8436
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, remainingConnections, "f");
8432
8437
  });
8433
8438
  // Must be bound.
8434
8439
  this.processAction = async (action, payload, senderIdentity) => {
@@ -8442,17 +8447,17 @@ class ChannelProvider extends channel_1.ChannelBase {
8442
8447
  return super.processAction(action, payload, senderIdentity);
8443
8448
  };
8444
8449
  _ChannelProvider_close.set(this, () => {
8445
- __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").close();
8450
+ __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").close();
8446
8451
  const remove = ChannelProvider.removalMap.get(this);
8447
8452
  if (remove) {
8448
8453
  remove();
8449
8454
  }
8450
8455
  });
8451
- __classPrivateFieldSet$c(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
8456
+ __classPrivateFieldSet$d(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
8452
8457
  this.connectListener = () => undefined;
8453
8458
  this.disconnectListener = () => undefined;
8454
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
8455
- __classPrivateFieldSet$c(this, _ChannelProvider_strategy, strategy, "f");
8459
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
8460
+ __classPrivateFieldSet$d(this, _ChannelProvider_strategy, strategy, "f");
8456
8461
  strategy.receive(this.processAction);
8457
8462
  }
8458
8463
  /**
@@ -8483,16 +8488,16 @@ class ChannelProvider extends channel_1.ChannelBase {
8483
8488
  */
8484
8489
  dispatch(to, action, payload) {
8485
8490
  const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
8486
- if (endpointId && __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
8491
+ if (endpointId && __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
8487
8492
  const callSites = transport_errors_1$2.RuntimeError.getCallSite();
8488
- return __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
8493
+ return __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
8489
8494
  throw new channel_error_1.ChannelError(e, action, payload, callSites);
8490
8495
  });
8491
8496
  }
8492
8497
  return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
8493
8498
  }
8494
8499
  async processConnection(senderId, payload) {
8495
- __classPrivateFieldGet$d(this, _ChannelProvider_connections, "f").push(senderId);
8500
+ __classPrivateFieldGet$e(this, _ChannelProvider_connections, "f").push(senderId);
8496
8501
  return this.connectListener(senderId, payload);
8497
8502
  }
8498
8503
  /**
@@ -8515,7 +8520,7 @@ class ChannelProvider extends channel_1.ChannelBase {
8515
8520
  * ```
8516
8521
  */
8517
8522
  publish(action, payload) {
8518
- return this.connections.map((to) => __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
8523
+ return this.connections.map((to) => __classPrivateFieldGet$e(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
8519
8524
  }
8520
8525
  /**
8521
8526
  * Register a listener that is called on every new client connection.
@@ -8589,11 +8594,11 @@ class ChannelProvider extends channel_1.ChannelBase {
8589
8594
  * ```
8590
8595
  */
8591
8596
  async destroy() {
8592
- const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
8597
+ const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
8593
8598
  protectedObj.providerIdentity;
8594
- __classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
8599
+ __classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
8595
8600
  await protectedObj.close();
8596
- __classPrivateFieldGet$d(this, _ChannelProvider_close, "f").call(this);
8601
+ __classPrivateFieldGet$e(this, _ChannelProvider_close, "f").call(this);
8597
8602
  }
8598
8603
  /**
8599
8604
  * Returns an array with info on every Client connected to the Provider
@@ -8663,7 +8668,7 @@ class ChannelProvider extends channel_1.ChannelBase {
8663
8668
  getEndpointIdForOpenFinId(clientIdentity, action) {
8664
8669
  const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
8665
8670
  if (matchingConnections.length >= 2) {
8666
- const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
8671
+ const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
8667
8672
  const { uuid, name } = clientIdentity;
8668
8673
  const providerUuid = protectedObj?.providerIdentity.uuid;
8669
8674
  const providerName = protectedObj?.providerIdentity.name;
@@ -8875,13 +8880,13 @@ class CombinedStrategy {
8875
8880
  }
8876
8881
  strategy.default = CombinedStrategy;
8877
8882
 
8878
- var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8883
+ var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8879
8884
  if (kind === "m") throw new TypeError("Private method is not writable");
8880
8885
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
8881
8886
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
8882
8887
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8883
8888
  };
8884
- var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8889
+ var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8885
8890
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8886
8891
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
8887
8892
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -8930,8 +8935,8 @@ class ConnectionManager extends base_1$j.Base {
8930
8935
  };
8931
8936
  this.providerMap = new Map();
8932
8937
  this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
8933
- __classPrivateFieldSet$b(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
8934
- __classPrivateFieldSet$b(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
8938
+ __classPrivateFieldSet$c(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
8939
+ __classPrivateFieldSet$c(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
8935
8940
  wire.registerMessageHandler(this.onmessage.bind(this));
8936
8941
  }
8937
8942
  createProvider(options, providerIdentity) {
@@ -8942,7 +8947,7 @@ class ConnectionManager extends base_1$j.Base {
8942
8947
  case 'rtc':
8943
8948
  return new strategy_2.RTCStrategy();
8944
8949
  case 'classic':
8945
- return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"),
8950
+ return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f"),
8946
8951
  // Providers do not have an endpointId, use channelId as endpointId in the strategy.
8947
8952
  providerIdentity.channelId, providerIdentity);
8948
8953
  default:
@@ -8978,7 +8983,7 @@ class ConnectionManager extends base_1$j.Base {
8978
8983
  const supportedProtocols = await Promise.all(protocols.map(async (type) => {
8979
8984
  switch (type) {
8980
8985
  case 'rtc': {
8981
- const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
8986
+ const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
8982
8987
  rtcPacket = { rtcClient, channels, channelsOpened };
8983
8988
  return {
8984
8989
  type: 'rtc',
@@ -9005,18 +9010,18 @@ class ConnectionManager extends base_1$j.Base {
9005
9010
  routingInfo.endpointId = this.wire.environment.getNextMessageId();
9006
9011
  // For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
9007
9012
  // clients that are in the same context as the newly-connected client.
9008
- __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
9013
+ __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
9009
9014
  }
9010
9015
  const answer = routingInfo.answer ?? {
9011
9016
  supportedProtocols: [{ type: 'classic', version: 1 }]
9012
9017
  };
9013
9018
  const createStrategyFromAnswer = async (protocol) => {
9014
9019
  if (protocol.type === 'rtc' && rtcPacket) {
9015
- await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
9020
+ await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
9016
9021
  return new strategy_2.RTCStrategy();
9017
9022
  }
9018
9023
  if (protocol.type === 'classic') {
9019
- return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
9024
+ return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$d(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
9020
9025
  }
9021
9026
  return null;
9022
9027
  };
@@ -9084,7 +9089,7 @@ class ConnectionManager extends base_1$j.Base {
9084
9089
  clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
9085
9090
  const answer = await accumP;
9086
9091
  if (protocolToUse.type === 'rtc') {
9087
- const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
9092
+ const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$d(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
9088
9093
  answer.supportedProtocols.push({
9089
9094
  type: 'rtc',
9090
9095
  version: strategy_2.RTCInfo.version,
@@ -9132,13 +9137,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
9132
9137
  *
9133
9138
  * @packageDocumentation
9134
9139
  */
9135
- var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9140
+ var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9136
9141
  if (kind === "m") throw new TypeError("Private method is not writable");
9137
9142
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9138
9143
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
9139
9144
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
9140
9145
  };
9141
- var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9146
+ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9142
9147
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9143
9148
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
9144
9149
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -9195,11 +9200,11 @@ class Channel extends base_1$i.EmitterBase {
9195
9200
  client_1.ChannelClient.handleProviderDisconnect(eventPayload);
9196
9201
  }),
9197
9202
  this.on('connected', (...args) => {
9198
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").emit('connected', ...args);
9203
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").emit('connected', ...args);
9199
9204
  })
9200
9205
  ]).catch(() => new Error('error setting up channel connection listeners'));
9201
9206
  }));
9202
- __classPrivateFieldSet$a(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
9207
+ __classPrivateFieldSet$b(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
9203
9208
  }
9204
9209
  /**
9205
9210
  *
@@ -9274,7 +9279,7 @@ class Channel extends base_1$i.EmitterBase {
9274
9279
  resolve(true);
9275
9280
  }
9276
9281
  };
9277
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
9282
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
9278
9283
  });
9279
9284
  try {
9280
9285
  if (retryInfo.count > 0) {
@@ -9306,7 +9311,7 @@ class Channel extends base_1$i.EmitterBase {
9306
9311
  finally {
9307
9312
  retryInfo.count += 1;
9308
9313
  // in case of other errors, remove our listener
9309
- __classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
9314
+ __classPrivateFieldGet$c(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
9310
9315
  }
9311
9316
  } while (shouldWait); // If we're waiting we retry the above loop
9312
9317
  // Should wait was false, no channel was found.
@@ -9365,12 +9370,12 @@ class Channel extends base_1$i.EmitterBase {
9365
9370
  async connect(channelName, options = {}) {
9366
9371
  // Make sure we don't connect before listeners are set up
9367
9372
  // This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
9368
- await __classPrivateFieldGet$b(this, _Channel_readyToConnect, "f").getValue();
9373
+ await __classPrivateFieldGet$c(this, _Channel_readyToConnect, "f").getValue();
9369
9374
  if (!channelName || typeof channelName !== 'string') {
9370
9375
  throw new Error('Please provide a channelName string to connect to a channel.');
9371
9376
  }
9372
9377
  const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
9373
- const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientOffer(opts);
9378
+ const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createClientOffer(opts);
9374
9379
  let connectionUrl;
9375
9380
  if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
9376
9381
  connectionUrl = (await this.fin.me.getInfo()).url;
@@ -9382,7 +9387,7 @@ class Channel extends base_1$i.EmitterBase {
9382
9387
  connectionUrl
9383
9388
  };
9384
9389
  const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
9385
- const strategy = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
9390
+ const strategy = await __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
9386
9391
  const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
9387
9392
  // It is the client's responsibility to handle endpoint disconnection to the provider.
9388
9393
  // If the endpoint dies, the client will force a disconnection through the core.
@@ -9451,7 +9456,7 @@ class Channel extends base_1$i.EmitterBase {
9451
9456
  throw new Error('Please provide a channelName to create a channel');
9452
9457
  }
9453
9458
  const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
9454
- const channel = __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
9459
+ const channel = __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
9455
9460
  // TODO: fix typing (internal)
9456
9461
  // @ts-expect-error
9457
9462
  this.on('client-disconnected', (eventPayload) => {
@@ -10342,13 +10347,13 @@ var Factory$3 = {};
10342
10347
 
10343
10348
  var Instance$2 = {};
10344
10349
 
10345
- var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10350
+ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10346
10351
  if (kind === "m") throw new TypeError("Private method is not writable");
10347
10352
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10348
10353
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10349
10354
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
10350
10355
  };
10351
- var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10356
+ var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10352
10357
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10353
10358
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10354
10359
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -10385,24 +10390,24 @@ class Platform extends base_1$a.EmitterBase {
10385
10390
  this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
10386
10391
  // don't expose
10387
10392
  });
10388
- if (!Platform.clientMap.has(__classPrivateFieldGet$a(this, _Platform_channelName, "f"))) {
10389
- const clientPromise = __classPrivateFieldGet$a(this, _Platform_connectToProvider, "f").call(this);
10390
- Platform.clientMap.set(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), clientPromise);
10393
+ if (!Platform.clientMap.has(__classPrivateFieldGet$b(this, _Platform_channelName, "f"))) {
10394
+ const clientPromise = __classPrivateFieldGet$b(this, _Platform_connectToProvider, "f").call(this);
10395
+ Platform.clientMap.set(__classPrivateFieldGet$b(this, _Platform_channelName, "f"), clientPromise);
10391
10396
  }
10392
10397
  // we set it above
10393
10398
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10394
- return Platform.clientMap.get(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10399
+ return Platform.clientMap.get(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10395
10400
  };
10396
10401
  _Platform_connectToProvider.set(this, async () => {
10397
10402
  try {
10398
- const client = await this._channel.connect(__classPrivateFieldGet$a(this, _Platform_channelName, "f"), { wait: false });
10403
+ const client = await this._channel.connect(__classPrivateFieldGet$b(this, _Platform_channelName, "f"), { wait: false });
10399
10404
  client.onDisconnection(() => {
10400
- Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10405
+ Platform.clientMap.delete(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10401
10406
  });
10402
10407
  return client;
10403
10408
  }
10404
10409
  catch (e) {
10405
- Platform.clientMap.delete(__classPrivateFieldGet$a(this, _Platform_channelName, "f"));
10410
+ Platform.clientMap.delete(__classPrivateFieldGet$b(this, _Platform_channelName, "f"));
10406
10411
  throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
10407
10412
  }
10408
10413
  });
@@ -10415,7 +10420,7 @@ class Platform extends base_1$a.EmitterBase {
10415
10420
  if (errorMsg) {
10416
10421
  throw new Error(errorMsg);
10417
10422
  }
10418
- __classPrivateFieldSet$9(this, _Platform_channelName, channelName, "f");
10423
+ __classPrivateFieldSet$a(this, _Platform_channelName, channelName, "f");
10419
10424
  this._channel = this.fin.InterApplicationBus.Channel;
10420
10425
  this.identity = { uuid: identity.uuid };
10421
10426
  this.Layout = this.fin.Platform.Layout;
@@ -11471,13 +11476,13 @@ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async
11471
11476
  };
11472
11477
  channelApiRelay.createRelayedDispatch = createRelayedDispatch;
11473
11478
 
11474
- var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11479
+ var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11475
11480
  if (kind === "m") throw new TypeError("Private method is not writable");
11476
11481
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
11477
11482
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11478
11483
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11479
11484
  };
11480
- var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11485
+ var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11481
11486
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
11482
11487
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11483
11488
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -11531,7 +11536,7 @@ class LayoutNode {
11531
11536
  * console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
11532
11537
  * ```
11533
11538
  */
11534
- this.isRoot = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").isRoot(this.entityId);
11539
+ this.isRoot = () => __classPrivateFieldGet$a(this, _LayoutNode_client, "f").isRoot(this.entityId);
11535
11540
  /**
11536
11541
  * Checks if the TabStack or ColumnOrRow exists
11537
11542
  *
@@ -11551,7 +11556,7 @@ class LayoutNode {
11551
11556
  * console.log(`The entity exists: ${exists}`);
11552
11557
  * ```
11553
11558
  */
11554
- this.exists = () => __classPrivateFieldGet$9(this, _LayoutNode_client, "f").exists(this.entityId);
11559
+ this.exists = () => __classPrivateFieldGet$a(this, _LayoutNode_client, "f").exists(this.entityId);
11555
11560
  /**
11556
11561
  * Retrieves the parent of the TabStack or ColumnOrRow
11557
11562
  *
@@ -11572,11 +11577,11 @@ class LayoutNode {
11572
11577
  * ```
11573
11578
  */
11574
11579
  this.getParent = async () => {
11575
- const parent = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getParent(this.entityId);
11580
+ const parent = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").getParent(this.entityId);
11576
11581
  if (!parent) {
11577
11582
  return undefined;
11578
11583
  }
11579
- return LayoutNode.getEntity(parent, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
11584
+ return LayoutNode.getEntity(parent, __classPrivateFieldGet$a(this, _LayoutNode_client, "f"));
11580
11585
  };
11581
11586
  /**
11582
11587
  * Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
@@ -11627,8 +11632,8 @@ class LayoutNode {
11627
11632
  * @experimental
11628
11633
  */
11629
11634
  this.createAdjacentStack = async (views, options) => {
11630
- const entityId = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
11631
- return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f"));
11635
+ const entityId = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
11636
+ return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet$a(this, _LayoutNode_client, "f"));
11632
11637
  };
11633
11638
  /**
11634
11639
  * Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow.
@@ -11656,16 +11661,16 @@ class LayoutNode {
11656
11661
  * @experimental
11657
11662
  */
11658
11663
  this.getAdjacentStacks = async (edge) => {
11659
- const adjacentStacks = await __classPrivateFieldGet$9(this, _LayoutNode_client, "f").getAdjacentStacks({
11664
+ const adjacentStacks = await __classPrivateFieldGet$a(this, _LayoutNode_client, "f").getAdjacentStacks({
11660
11665
  targetId: this.entityId,
11661
11666
  edge
11662
11667
  });
11663
11668
  return adjacentStacks.map((stack) => LayoutNode.getEntity({
11664
11669
  type: 'stack',
11665
11670
  entityId: stack.entityId
11666
- }, __classPrivateFieldGet$9(this, _LayoutNode_client, "f")));
11671
+ }, __classPrivateFieldGet$a(this, _LayoutNode_client, "f")));
11667
11672
  };
11668
- __classPrivateFieldSet$8(this, _LayoutNode_client, client, "f");
11673
+ __classPrivateFieldSet$9(this, _LayoutNode_client, client, "f");
11669
11674
  this.entityId = entityId;
11670
11675
  }
11671
11676
  }
@@ -11739,7 +11744,7 @@ class TabStack extends LayoutNode {
11739
11744
  * ```
11740
11745
  * @experimental
11741
11746
  */
11742
- this.getViews = () => __classPrivateFieldGet$9(this, _TabStack_client, "f").getStackViews(this.entityId);
11747
+ this.getViews = () => __classPrivateFieldGet$a(this, _TabStack_client, "f").getStackViews(this.entityId);
11743
11748
  /**
11744
11749
  * Adds or creates a view in this {@link TabStack}.
11745
11750
  *
@@ -11770,7 +11775,7 @@ class TabStack extends LayoutNode {
11770
11775
  * ```
11771
11776
  * @experimental
11772
11777
  */
11773
- this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$9(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
11778
+ this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet$a(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
11774
11779
  /**
11775
11780
  * Removes a view from this {@link TabStack}.
11776
11781
  *
@@ -11800,7 +11805,7 @@ class TabStack extends LayoutNode {
11800
11805
  * ```
11801
11806
  */
11802
11807
  this.removeView = async (view) => {
11803
- await __classPrivateFieldGet$9(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
11808
+ await __classPrivateFieldGet$a(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
11804
11809
  };
11805
11810
  /**
11806
11811
  * Sets the active view of the {@link TabStack} without focusing it.
@@ -11824,9 +11829,9 @@ class TabStack extends LayoutNode {
11824
11829
  * @experimental
11825
11830
  */
11826
11831
  this.setActiveView = async (view) => {
11827
- await __classPrivateFieldGet$9(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
11832
+ await __classPrivateFieldGet$a(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
11828
11833
  };
11829
- __classPrivateFieldSet$8(this, _TabStack_client, client, "f");
11834
+ __classPrivateFieldSet$9(this, _TabStack_client, client, "f");
11830
11835
  }
11831
11836
  }
11832
11837
  layoutEntities.TabStack = TabStack;
@@ -11865,10 +11870,10 @@ class ColumnOrRow extends LayoutNode {
11865
11870
  * ```
11866
11871
  */
11867
11872
  this.getContent = async () => {
11868
- const contentItemEntities = await __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f").getContent(this.entityId);
11869
- return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$9(this, _ColumnOrRow_client, "f")));
11873
+ const contentItemEntities = await __classPrivateFieldGet$a(this, _ColumnOrRow_client, "f").getContent(this.entityId);
11874
+ return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet$a(this, _ColumnOrRow_client, "f")));
11870
11875
  };
11871
- __classPrivateFieldSet$8(this, _ColumnOrRow_client, client, "f");
11876
+ __classPrivateFieldSet$9(this, _ColumnOrRow_client, client, "f");
11872
11877
  this.type = type;
11873
11878
  }
11874
11879
  }
@@ -11883,7 +11888,7 @@ layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
11883
11888
  // TODO: eventually export this somehow
11884
11889
  layout_constants.DEFAULT_LAYOUT_KEY = '__default__';
11885
11890
 
11886
- var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11891
+ var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
11887
11892
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
11888
11893
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11889
11894
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -12034,7 +12039,7 @@ class Layout extends base_1$9.Base {
12034
12039
  * @internal
12035
12040
  */
12036
12041
  static getClient(layout) {
12037
- return __classPrivateFieldGet$8(layout, _Layout_layoutClient, "f").getValue();
12042
+ return __classPrivateFieldGet$9(layout, _Layout_layoutClient, "f").getValue();
12038
12043
  }
12039
12044
  /**
12040
12045
  * @internal
@@ -12257,7 +12262,7 @@ class Layout extends base_1$9.Base {
12257
12262
  this.wire.sendAction('layout-get-root-item').catch(() => {
12258
12263
  // don't expose
12259
12264
  });
12260
- const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
12265
+ const client = await __classPrivateFieldGet$9(this, _Layout_layoutClient, "f").getValue();
12261
12266
  const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
12262
12267
  return layout_entities_1.LayoutNode.getEntity(root, client);
12263
12268
  }
@@ -12275,7 +12280,7 @@ class Layout extends base_1$9.Base {
12275
12280
  this.wire.sendAction('layout-get-stack-by-view').catch(() => {
12276
12281
  // don't expose
12277
12282
  });
12278
- const client = await __classPrivateFieldGet$8(this, _Layout_layoutClient, "f").getValue();
12283
+ const client = await __classPrivateFieldGet$9(this, _Layout_layoutClient, "f").getValue();
12279
12284
  const stack = await client.getStackByView(identity);
12280
12285
  if (!stack) {
12281
12286
  throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
@@ -12295,7 +12300,7 @@ class Layout extends base_1$9.Base {
12295
12300
  this.wire.sendAction('layout-add-view').catch((e) => {
12296
12301
  // don't expose
12297
12302
  });
12298
- const { identity } = await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
12303
+ const { identity } = await __classPrivateFieldGet$9(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
12299
12304
  viewOptions,
12300
12305
  location,
12301
12306
  targetView
@@ -12313,7 +12318,7 @@ class Layout extends base_1$9.Base {
12313
12318
  this.wire.sendAction('layout-close-view').catch((e) => {
12314
12319
  // don't expose
12315
12320
  });
12316
- await __classPrivateFieldGet$8(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
12321
+ await __classPrivateFieldGet$9(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
12317
12322
  }
12318
12323
  }
12319
12324
  Instance$1.Layout = Layout;
@@ -12327,12 +12332,12 @@ async function _Layout_forwardLayoutAction(action, payload) {
12327
12332
  return client.dispatch(action, { target: this.identity, opts: payload });
12328
12333
  };
12329
12334
 
12330
- var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12335
+ var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12331
12336
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
12332
12337
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
12333
12338
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12334
12339
  };
12335
- var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12340
+ var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12336
12341
  if (kind === "m") throw new TypeError("Private method is not writable");
12337
12342
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
12338
12343
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
@@ -12398,23 +12403,23 @@ class LayoutModule extends base_1$8.Base {
12398
12403
  if (!this.wire.environment.layoutAllowedInContext(this.fin)) {
12399
12404
  throw new Error('Layout.init can only be called from a Window context.');
12400
12405
  }
12401
- if (__classPrivateFieldGet$7(this, _LayoutModule_layoutInitializationAttempted, "f")) {
12406
+ if (__classPrivateFieldGet$8(this, _LayoutModule_layoutInitializationAttempted, "f")) {
12402
12407
  throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
12403
12408
  }
12404
12409
  if (this.wire.environment.type === 'openfin') {
12405
12410
  // preload the client
12406
12411
  await this.fin.Platform.getCurrentSync().getClient();
12407
12412
  }
12408
- __classPrivateFieldSet$7(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12413
+ __classPrivateFieldSet$8(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12409
12414
  // TODO: rename to createLayoutManager
12410
- __classPrivateFieldSet$7(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
12411
- await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f"), options);
12415
+ __classPrivateFieldSet$8(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
12416
+ await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f"), options);
12412
12417
  const meIdentity = { name: this.fin.me.name, uuid: this.fin.me.uuid };
12413
12418
  if (!options.layoutManagerOverride) {
12414
12419
  // CORE-1081 to be removed when we actually delete the `layoutManager` prop
12415
12420
  // in single-layout case, we return the undocumented layoutManager type
12416
12421
  const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...meIdentity };
12417
- return __classPrivateFieldGet$7(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
12422
+ return __classPrivateFieldGet$8(this, _LayoutModule_getLayoutManagerSpy, "f").call(this, layoutIdentity);
12418
12423
  }
12419
12424
  return this.wrapSync(meIdentity);
12420
12425
  };
@@ -12443,13 +12448,13 @@ class LayoutModule extends base_1$8.Base {
12443
12448
  * @returns
12444
12449
  */
12445
12450
  this.getCurrentLayoutManagerSync = () => {
12446
- return __classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
12451
+ return __classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
12447
12452
  };
12448
12453
  this.create = async (options) => {
12449
- return this.wire.environment.createLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
12454
+ return this.wire.environment.createLayout(__classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
12450
12455
  };
12451
12456
  this.destroy = async (layoutIdentity) => {
12452
- return this.wire.environment.destroyLayout(__classPrivateFieldGet$7(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
12457
+ return this.wire.environment.destroyLayout(__classPrivateFieldGet$8(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
12453
12458
  };
12454
12459
  }
12455
12460
  /**
@@ -12590,10 +12595,10 @@ class LayoutModule extends base_1$8.Base {
12590
12595
  }
12591
12596
  Factory$2.LayoutModule = LayoutModule;
12592
12597
  _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getLayoutManagerSpy = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
12593
- if (!__classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f")) {
12598
+ if (!__classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f")) {
12594
12599
  throw new Error(`You must call init before using the API ${method}`);
12595
12600
  }
12596
- return __classPrivateFieldGet$7(this, _LayoutModule_layoutManager, "f");
12601
+ return __classPrivateFieldGet$8(this, _LayoutModule_layoutManager, "f");
12597
12602
  };
12598
12603
 
12599
12604
  (function (exports) {
@@ -13558,13 +13563,13 @@ class PrivateChannelProvider {
13558
13563
  }
13559
13564
  PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
13560
13565
 
13561
- var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13566
+ var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13562
13567
  if (kind === "m") throw new TypeError("Private method is not writable");
13563
13568
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13564
13569
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
13565
13570
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
13566
13571
  };
13567
- var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
13572
+ var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
13568
13573
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13569
13574
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
13570
13575
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -13755,12 +13760,12 @@ class InteropBroker extends base_1$6.Base {
13755
13760
  _InteropBroker_contextGroups.set(this, void 0);
13756
13761
  _InteropBroker_providerPromise.set(this, void 0);
13757
13762
  this.getProvider = () => {
13758
- return __classPrivateFieldGet$6(this, _InteropBroker_providerPromise, "f").getValue();
13763
+ return __classPrivateFieldGet$7(this, _InteropBroker_providerPromise, "f").getValue();
13759
13764
  };
13760
13765
  this.interopClients = new Map();
13761
13766
  this.contextGroupsById = new Map();
13762
- __classPrivateFieldSet$6(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
13763
- __classPrivateFieldSet$6(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
13767
+ __classPrivateFieldSet$7(this, _InteropBroker_contextGroups, options.contextGroups ?? [...defaultContextGroups], "f");
13768
+ __classPrivateFieldSet$7(this, _InteropBroker_fdc3Info, options.fdc3Info, "f");
13764
13769
  if (options?.logging) {
13765
13770
  this.logging = options.logging;
13766
13771
  }
@@ -13768,7 +13773,7 @@ class InteropBroker extends base_1$6.Base {
13768
13773
  this.lastContextMap = new Map();
13769
13774
  this.sessionContextGroupMap = new Map();
13770
13775
  this.privateChannelProviderMap = new Map();
13771
- __classPrivateFieldSet$6(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
13776
+ __classPrivateFieldSet$7(this, _InteropBroker_providerPromise, new lazy_1$1.Lazy(createProvider), "f");
13772
13777
  this.setContextGroupMap();
13773
13778
  this.setupChannelProvider();
13774
13779
  }
@@ -13940,8 +13945,8 @@ class InteropBroker extends base_1$6.Base {
13940
13945
  if (!this.getContextGroups().find((contextGroupInfo) => contextGroupInfo.id === contextGroupId)) {
13941
13946
  throw new Error(`Attempting to join a context group that does not exist: ${contextGroupId}. You may only join existing context groups.`);
13942
13947
  }
13943
- const oldContextGroupId = clientSubscriptionState.contextGroupId;
13944
- if (oldContextGroupId !== contextGroupId) {
13948
+ const previousContextGroupId = clientSubscriptionState.contextGroupId;
13949
+ if (previousContextGroupId !== contextGroupId) {
13945
13950
  clientSubscriptionState.contextGroupId = contextGroupId;
13946
13951
  await this.setCurrentContextGroupInClientOptions(clientIdentity, contextGroupId);
13947
13952
  const contextGroupMap = this.contextGroupsById.get(contextGroupId);
@@ -13960,6 +13965,13 @@ class InteropBroker extends base_1$6.Base {
13960
13965
  }
13961
13966
  }
13962
13967
  }
13968
+ // All settled will suppress uncaught exceptions. We don't want to await this because it could
13969
+ // result in the operation hanging.
13970
+ Promise.allSettled(this.channel.publish('client-changed-context-group', {
13971
+ identity: clientIdentity,
13972
+ contextGroupId,
13973
+ previousContextGroupId: previousContextGroupId || null
13974
+ }));
13963
13975
  }
13964
13976
  }
13965
13977
  // Removes the target from its context group. Similar structure to joinContextGroup.
@@ -14019,10 +14031,18 @@ class InteropBroker extends base_1$6.Base {
14019
14031
  // don't expose, analytics-only call
14020
14032
  });
14021
14033
  const clientState = this.getClientState(clientIdentity);
14034
+ const previousContextGroupId = clientState?.contextGroupId;
14022
14035
  if (clientState) {
14023
14036
  clientState.contextGroupId = undefined;
14024
14037
  }
14025
14038
  await this.setCurrentContextGroupInClientOptions(clientIdentity, null);
14039
+ // All settled will suppress uncaught exceptions. We don't want to await this because it could
14040
+ // result in the operation hanging.
14041
+ Promise.allSettled(this.channel.publish('client-changed-context-group', {
14042
+ identity: clientIdentity,
14043
+ contextGroupId: null,
14044
+ previousContextGroupId: previousContextGroupId || null
14045
+ }));
14026
14046
  }
14027
14047
  // Used by platform windows to know what client groups the provider has declared. Also used internally to access context groups. Overrideable so that the platform developer can modify it.
14028
14048
  /**
@@ -14036,7 +14056,7 @@ class InteropBroker extends base_1$6.Base {
14036
14056
  // don't expose, analytics-only call
14037
14057
  });
14038
14058
  // Create copy for immutability
14039
- return __classPrivateFieldGet$6(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
14059
+ return __classPrivateFieldGet$7(this, _InteropBroker_contextGroups, "f").map((contextGroup) => {
14040
14060
  return { ...contextGroup };
14041
14061
  });
14042
14062
  }
@@ -14447,7 +14467,7 @@ class InteropBroker extends base_1$6.Base {
14447
14467
  const { fdc3Version } = payload;
14448
14468
  return {
14449
14469
  fdc3Version,
14450
- ...__classPrivateFieldGet$6(this, _InteropBroker_fdc3Info, "f"),
14470
+ ...__classPrivateFieldGet$7(this, _InteropBroker_fdc3Info, "f"),
14451
14471
  optionalFeatures: {
14452
14472
  OriginatingAppMetadata: false,
14453
14473
  UserChannelMembershipAPIs: true
@@ -14832,13 +14852,13 @@ var InteropClient$1 = {};
14832
14852
 
14833
14853
  var SessionContextGroupClient$1 = {};
14834
14854
 
14835
- var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14855
+ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14836
14856
  if (kind === "m") throw new TypeError("Private method is not writable");
14837
14857
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
14838
14858
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14839
14859
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
14840
14860
  };
14841
- var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14861
+ var __classPrivateFieldGet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14842
14862
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
14843
14863
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14844
14864
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
@@ -14852,7 +14872,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14852
14872
  super(wire);
14853
14873
  _SessionContextGroupClient_clientPromise.set(this, void 0);
14854
14874
  this.id = id;
14855
- __classPrivateFieldSet$5(this, _SessionContextGroupClient_clientPromise, client, "f");
14875
+ __classPrivateFieldSet$6(this, _SessionContextGroupClient_clientPromise, client, "f");
14856
14876
  }
14857
14877
  /**
14858
14878
  * Sets a context for the session context group.
@@ -14864,7 +14884,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14864
14884
  this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
14865
14885
  // don't expose, analytics-only call
14866
14886
  });
14867
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
14887
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
14868
14888
  return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
14869
14889
  sessionContextGroupId: this.id,
14870
14890
  context
@@ -14874,7 +14894,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14874
14894
  this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
14875
14895
  // don't expose, analytics-only call
14876
14896
  });
14877
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
14897
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
14878
14898
  return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
14879
14899
  sessionContextGroupId: this.id,
14880
14900
  type
@@ -14887,7 +14907,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14887
14907
  if (typeof contextHandler !== 'function') {
14888
14908
  throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
14889
14909
  }
14890
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
14910
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
14891
14911
  let handlerId;
14892
14912
  if (contextType) {
14893
14913
  handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1$6.generateId)()}`;
@@ -14900,7 +14920,7 @@ class SessionContextGroupClient extends base_1$5.Base {
14900
14920
  return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
14901
14921
  }
14902
14922
  async createUnsubscribeCb(handlerId) {
14903
- const client = await __classPrivateFieldGet$5(this, _SessionContextGroupClient_clientPromise, "f");
14923
+ const client = await __classPrivateFieldGet$6(this, _SessionContextGroupClient_clientPromise, "f");
14904
14924
  return async () => {
14905
14925
  client.remove(handlerId);
14906
14926
  await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
@@ -14918,6 +14938,139 @@ class SessionContextGroupClient extends base_1$5.Base {
14918
14938
  SessionContextGroupClient$1.default = SessionContextGroupClient;
14919
14939
  _SessionContextGroupClient_clientPromise = new WeakMap();
14920
14940
 
14941
+ var channelEvents = {};
14942
+
14943
+ var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14944
+ if (kind === "m") throw new TypeError("Private method is not writable");
14945
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
14946
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14947
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
14948
+ };
14949
+ var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14950
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
14951
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14952
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14953
+ };
14954
+ var _a, _ChannelEvents_channelClient, _ChannelEvents_isChannelReady, _ChannelEvents_actionsByClient, _ChannelEvents_getActions, _ChannelEvents_createRegistration, _ChannelEvents_getRegistration, _ChannelEvents_getOrCreateRegistration;
14955
+ Object.defineProperty(channelEvents, "__esModule", { value: true });
14956
+ channelEvents.ChannelEvents = void 0;
14957
+ /**
14958
+ * Channel events creates a event like syntax out of a channel action, allowing multiple events to be triggered
14959
+ * from a single action (normally only one callback can be created per action).
14960
+ *
14961
+ * This Class essentially allows us to multiplex channel actions to multiple callbacks.
14962
+ */
14963
+ class ChannelEvents {
14964
+ constructor(channelClient) {
14965
+ // eslint-disable-next-line
14966
+ _ChannelEvents_channelClient.set(this, void 0);
14967
+ _ChannelEvents_isChannelReady.set(this, false);
14968
+ _ChannelEvents_getActions.set(this, async () => {
14969
+ const channelClient = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
14970
+ let actions = __classPrivateFieldGet$5(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).get(channelClient);
14971
+ if (!actions) {
14972
+ actions = {};
14973
+ __classPrivateFieldGet$5(ChannelEvents, _a, "f", _ChannelEvents_actionsByClient).set(channelClient, actions);
14974
+ }
14975
+ return actions;
14976
+ });
14977
+ _ChannelEvents_createRegistration.set(this, (actionId) => {
14978
+ const callbacks = [];
14979
+ let registrationPromise;
14980
+ const onChannelAction = (data) => {
14981
+ callbacks.forEach((callback) => callback(data));
14982
+ };
14983
+ return {
14984
+ callbacks,
14985
+ dispose: async (callback) => {
14986
+ const index = callbacks.indexOf(callback);
14987
+ if (index >= 0) {
14988
+ callbacks.splice(index, 1);
14989
+ if (callbacks.length === 0) {
14990
+ const client = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
14991
+ client.remove(actionId);
14992
+ }
14993
+ }
14994
+ },
14995
+ waitForRegistration: async () => {
14996
+ // Use lazy eval to only setup and register the channel on first attempt.
14997
+ if (!registrationPromise) {
14998
+ registrationPromise = (async () => {
14999
+ const client = await __classPrivateFieldGet$5(this, _ChannelEvents_channelClient, "f");
15000
+ await client.register(actionId, onChannelAction);
15001
+ })();
15002
+ }
15003
+ await registrationPromise;
15004
+ }
15005
+ };
15006
+ });
15007
+ _ChannelEvents_getRegistration.set(this, async (actionId) => {
15008
+ const actions = await __classPrivateFieldGet$5(this, _ChannelEvents_getActions, "f").call(this);
15009
+ return actions[actionId];
15010
+ });
15011
+ _ChannelEvents_getOrCreateRegistration.set(this, async (actionId) => {
15012
+ const actions = await __classPrivateFieldGet$5(this, _ChannelEvents_getActions, "f").call(this);
15013
+ const registration = await __classPrivateFieldGet$5(this, _ChannelEvents_getRegistration, "f").call(this, actionId);
15014
+ if (!registration) {
15015
+ actions[actionId] = __classPrivateFieldGet$5(this, _ChannelEvents_createRegistration, "f").call(this, actionId);
15016
+ }
15017
+ return actions[actionId];
15018
+ });
15019
+ /**
15020
+ * Add a listener for the given channel action.
15021
+ *
15022
+ * This will register a handler for the specified channel action if this is the first time we have requested one, or reuse an existing one if it exists.
15023
+ *
15024
+ * Note, only void channel actions are currently supported.
15025
+ *
15026
+ * @param action Action ID, must match the underlying channel action.
15027
+ * @param callback Callback to be called whenever the action is dispatched.
15028
+ */
15029
+ this.addListener = async (action, callback) => {
15030
+ const event = await __classPrivateFieldGet$5(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
15031
+ event.callbacks.push(callback);
15032
+ // This ensures we only resolve the subscription once the action is registered
15033
+ await event.waitForRegistration();
15034
+ };
15035
+ /**
15036
+ * Removes a callback associated with a given action if it exists.
15037
+ *
15038
+ * If this callback is the last one associated with the specified action, the underlying channel action registration is
15039
+ * also removed.
15040
+ * @param action Action ID to remove
15041
+ * @param callback Callback to remove.
15042
+ */
15043
+ this.removeListener = async (action, callback) => {
15044
+ if (!__classPrivateFieldGet$5(this, _ChannelEvents_isChannelReady, "f")) {
15045
+ return;
15046
+ }
15047
+ const registration = await __classPrivateFieldGet$5(this, _ChannelEvents_getRegistration, "f").call(this, action);
15048
+ if (registration) {
15049
+ const event = await __classPrivateFieldGet$5(this, _ChannelEvents_getOrCreateRegistration, "f").call(this, action);
15050
+ await event.dispose(callback);
15051
+ }
15052
+ };
15053
+ __classPrivateFieldSet$5(this, _ChannelEvents_channelClient, channelClient, "f");
15054
+ Promise.resolve(channelClient)
15055
+ .then(() => {
15056
+ __classPrivateFieldSet$5(this, _ChannelEvents_isChannelReady, true, "f");
15057
+ })
15058
+ .catch(() => {
15059
+ // eslint-disable-next-line
15060
+ console.warn('Channel Connection error occurred in channel client. Channel-events registrations will fail.');
15061
+ });
15062
+ }
15063
+ }
15064
+ channelEvents.ChannelEvents = ChannelEvents;
15065
+ _a = ChannelEvents, _ChannelEvents_channelClient = new WeakMap(), _ChannelEvents_isChannelReady = new WeakMap(), _ChannelEvents_getActions = new WeakMap(), _ChannelEvents_createRegistration = new WeakMap(), _ChannelEvents_getRegistration = new WeakMap(), _ChannelEvents_getOrCreateRegistration = new WeakMap();
15066
+ /**
15067
+ * Static map of actions by channel client. This ensures we can reuse the same event and keep track of all its callbacks.
15068
+ *
15069
+ * Weak map will also ensure that when a channel is GC'ed we also tear down the actions/callbacks associated
15070
+ * with it.
15071
+ */
15072
+ _ChannelEvents_actionsByClient = { value: new WeakMap() };
15073
+
14921
15074
  var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
14922
15075
  if (kind === "m") throw new TypeError("Private method is not writable");
14923
15076
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -14932,12 +15085,13 @@ var __classPrivateFieldGet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
14932
15085
  var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
14933
15086
  return (mod && mod.__esModule) ? mod : { "default": mod };
14934
15087
  };
14935
- var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
15088
+ var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory, _InteropClient_channelEvents;
14936
15089
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
14937
15090
  InteropClient$1.InteropClient = void 0;
14938
15091
  const base_1$4 = base;
14939
15092
  const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
14940
15093
  const utils_1$5 = utils$3;
15094
+ const channel_events_1 = channelEvents;
14941
15095
  /**
14942
15096
  * The Interop Client API is broken up into two groups:
14943
15097
  *
@@ -14996,13 +15150,43 @@ class InteropClient extends base_1$4.Base {
14996
15150
  _InteropClient_clientPromise.set(this, void 0);
14997
15151
  _InteropClient_sessionContextGroups.set(this, void 0);
14998
15152
  _InteropClient_fdc3Factory.set(this, void 0);
15153
+ _InteropClient_channelEvents.set(this, void 0);
15154
+ /*
15155
+ Client APIs
15156
+ */
15157
+ /**
15158
+ * `addListener` allows the InteropClient to subscribe to events emitted by the connected InteropBroker.
15159
+ * @param type The event type to subscribe to.
15160
+ * @param listener Callback invoked whenever the event occurs.
15161
+ * @returns Promise resolving with void once the listener is registered.
15162
+ */
15163
+ this.addListener = async (type, listener) => {
15164
+ try {
15165
+ await __classPrivateFieldGet$4(this, _InteropClient_channelEvents, "f").addListener(type, listener);
15166
+ }
15167
+ catch (error) {
15168
+ throw new Error(`An unexpected error occurred when adding a listener to the event ${type}. \n${error.stack}.`);
15169
+ }
15170
+ };
15171
+ /**
15172
+ * `removeListener` removes a registered event listener.
15173
+ * @param type The event type to subscribe to.
15174
+ * @param listener Callback to be removed.
15175
+ * @returns Promise resolving with void even if no callback was found.
15176
+ */
15177
+ this.removeListener = async (type, listener) => {
15178
+ try {
15179
+ await __classPrivateFieldGet$4(this, _InteropClient_channelEvents, "f").removeListener(type, listener);
15180
+ }
15181
+ catch (error) {
15182
+ throw new Error(`An unexpected error occurred when removing a listener for the event ${type}. \n${error.stack}.`);
15183
+ }
15184
+ };
14999
15185
  __classPrivateFieldSet$4(this, _InteropClient_sessionContextGroups, new Map(), "f");
15000
15186
  __classPrivateFieldSet$4(this, _InteropClient_clientPromise, clientPromise, "f");
15001
15187
  __classPrivateFieldSet$4(this, _InteropClient_fdc3Factory, fdc3Factory, "f");
15188
+ __classPrivateFieldSet$4(this, _InteropClient_channelEvents, new channel_events_1.ChannelEvents(clientPromise), "f");
15002
15189
  }
15003
- /*
15004
- Client APIs
15005
- */
15006
15190
  /**
15007
15191
  * Sets a context for the context group of the current entity.
15008
15192
  *
@@ -15516,7 +15700,7 @@ class InteropClient extends base_1$4.Base {
15516
15700
  }
15517
15701
  }
15518
15702
  InteropClient$1.InteropClient = InteropClient;
15519
- _InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap();
15703
+ _InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap(), _InteropClient_fdc3Factory = new WeakMap(), _InteropClient_channelEvents = new WeakMap();
15520
15704
 
15521
15705
  var overrideCheck$1 = {};
15522
15706
 
@@ -18210,7 +18394,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
18210
18394
  };
18211
18395
  }
18212
18396
  getAdapterVersionSync() {
18213
- return "44.100.61";
18397
+ return "45.100.18";
18214
18398
  }
18215
18399
  observeBounds(element, onChange) {
18216
18400
  throw new Error('Method not implemented.');