@openfin/node-adapter 34.78.7 → 34.78.8

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.
@@ -2,16 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var require$$0 = require('events');
5
6
  var require$$3 = require('lodash');
6
- var require$$0$1 = require('fs');
7
+ var require$$0$2 = require('fs');
7
8
  var require$$1$1 = require('crypto');
8
9
  var require$$2$1 = require('ws');
9
10
  var require$$1 = require('net');
10
- var require$$0$2 = require('path');
11
- var require$$0$3 = require('os');
11
+ var require$$0$3 = require('path');
12
+ var require$$0$4 = require('os');
12
13
  var require$$4 = require('timers');
13
14
  var require$$2 = require('child_process');
14
- var require$$0 = require('node:url');
15
+ var require$$0$1 = require('node:url');
15
16
 
16
17
  function _mergeNamespaces(n, m) {
17
18
  m.forEach(function (e) {
@@ -30,493 +31,17 @@ function _mergeNamespaces(n, m) {
30
31
 
31
32
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
32
33
 
33
- var main$1 = {};
34
-
35
- var fin = {};
36
-
37
- var eventsExports = {};
38
- var events = {
39
- get exports(){ return eventsExports; },
40
- set exports(v){ eventsExports = v; },
41
- };
42
-
43
- var R = typeof Reflect === 'object' ? Reflect : null;
44
- var ReflectApply = R && typeof R.apply === 'function'
45
- ? R.apply
46
- : function ReflectApply(target, receiver, args) {
47
- return Function.prototype.apply.call(target, receiver, args);
48
- };
49
-
50
- var ReflectOwnKeys;
51
- if (R && typeof R.ownKeys === 'function') {
52
- ReflectOwnKeys = R.ownKeys;
53
- } else if (Object.getOwnPropertySymbols) {
54
- ReflectOwnKeys = function ReflectOwnKeys(target) {
55
- return Object.getOwnPropertyNames(target)
56
- .concat(Object.getOwnPropertySymbols(target));
57
- };
58
- } else {
59
- ReflectOwnKeys = function ReflectOwnKeys(target) {
60
- return Object.getOwnPropertyNames(target);
61
- };
62
- }
63
-
64
- function ProcessEmitWarning(warning) {
65
- if (console && console.warn) console.warn(warning);
66
- }
67
-
68
- var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
69
- return value !== value;
70
- };
71
-
72
- function EventEmitter() {
73
- EventEmitter.init.call(this);
74
- }
75
- events.exports = EventEmitter;
76
- eventsExports.once = once;
77
-
78
- // Backwards-compat with node 0.10.x
79
- EventEmitter.EventEmitter = EventEmitter;
80
-
81
- EventEmitter.prototype._events = undefined;
82
- EventEmitter.prototype._eventsCount = 0;
83
- EventEmitter.prototype._maxListeners = undefined;
84
-
85
- // By default EventEmitters will print a warning if more than 10 listeners are
86
- // added to it. This is a useful default which helps finding memory leaks.
87
- var defaultMaxListeners = 10;
88
-
89
- function checkListener(listener) {
90
- if (typeof listener !== 'function') {
91
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
92
- }
93
- }
94
-
95
- Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
96
- enumerable: true,
97
- get: function() {
98
- return defaultMaxListeners;
99
- },
100
- set: function(arg) {
101
- if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
102
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
103
- }
104
- defaultMaxListeners = arg;
105
- }
106
- });
107
-
108
- EventEmitter.init = function() {
109
-
110
- if (this._events === undefined ||
111
- this._events === Object.getPrototypeOf(this)._events) {
112
- this._events = Object.create(null);
113
- this._eventsCount = 0;
114
- }
115
-
116
- this._maxListeners = this._maxListeners || undefined;
117
- };
118
-
119
- // Obviously not all Emitters should be limited to 10. This function allows
120
- // that to be increased. Set to zero for unlimited.
121
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
122
- if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
123
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
124
- }
125
- this._maxListeners = n;
126
- return this;
127
- };
128
-
129
- function _getMaxListeners(that) {
130
- if (that._maxListeners === undefined)
131
- return EventEmitter.defaultMaxListeners;
132
- return that._maxListeners;
133
- }
134
-
135
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
136
- return _getMaxListeners(this);
137
- };
138
-
139
- EventEmitter.prototype.emit = function emit(type) {
140
- var args = [];
141
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
142
- var doError = (type === 'error');
143
-
144
- var events = this._events;
145
- if (events !== undefined)
146
- doError = (doError && events.error === undefined);
147
- else if (!doError)
148
- return false;
149
-
150
- // If there is no 'error' event listener then throw.
151
- if (doError) {
152
- var er;
153
- if (args.length > 0)
154
- er = args[0];
155
- if (er instanceof Error) {
156
- // Note: The comments on the `throw` lines are intentional, they show
157
- // up in Node's output if this results in an unhandled exception.
158
- throw er; // Unhandled 'error' event
159
- }
160
- // At least give some kind of context to the user
161
- var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
162
- err.context = er;
163
- throw err; // Unhandled 'error' event
164
- }
165
-
166
- var handler = events[type];
167
-
168
- if (handler === undefined)
169
- return false;
170
-
171
- if (typeof handler === 'function') {
172
- ReflectApply(handler, this, args);
173
- } else {
174
- var len = handler.length;
175
- var listeners = arrayClone(handler, len);
176
- for (var i = 0; i < len; ++i)
177
- ReflectApply(listeners[i], this, args);
178
- }
179
-
180
- return true;
181
- };
182
-
183
- function _addListener(target, type, listener, prepend) {
184
- var m;
185
- var events;
186
- var existing;
187
-
188
- checkListener(listener);
189
-
190
- events = target._events;
191
- if (events === undefined) {
192
- events = target._events = Object.create(null);
193
- target._eventsCount = 0;
194
- } else {
195
- // To avoid recursion in the case that type === "newListener"! Before
196
- // adding it to the listeners, first emit "newListener".
197
- if (events.newListener !== undefined) {
198
- target.emit('newListener', type,
199
- listener.listener ? listener.listener : listener);
200
-
201
- // Re-assign `events` because a newListener handler could have caused the
202
- // this._events to be assigned to a new object
203
- events = target._events;
204
- }
205
- existing = events[type];
206
- }
207
-
208
- if (existing === undefined) {
209
- // Optimize the case of one listener. Don't need the extra array object.
210
- existing = events[type] = listener;
211
- ++target._eventsCount;
212
- } else {
213
- if (typeof existing === 'function') {
214
- // Adding the second element, need to change to array.
215
- existing = events[type] =
216
- prepend ? [listener, existing] : [existing, listener];
217
- // If we've already got an array, just append.
218
- } else if (prepend) {
219
- existing.unshift(listener);
220
- } else {
221
- existing.push(listener);
222
- }
223
-
224
- // Check for listener leak
225
- m = _getMaxListeners(target);
226
- if (m > 0 && existing.length > m && !existing.warned) {
227
- existing.warned = true;
228
- // No error code for this since it is a Warning
229
- // eslint-disable-next-line no-restricted-syntax
230
- var w = new Error('Possible EventEmitter memory leak detected. ' +
231
- existing.length + ' ' + String(type) + ' listeners ' +
232
- 'added. Use emitter.setMaxListeners() to ' +
233
- 'increase limit');
234
- w.name = 'MaxListenersExceededWarning';
235
- w.emitter = target;
236
- w.type = type;
237
- w.count = existing.length;
238
- ProcessEmitWarning(w);
239
- }
240
- }
241
-
242
- return target;
243
- }
244
-
245
- EventEmitter.prototype.addListener = function addListener(type, listener) {
246
- return _addListener(this, type, listener, false);
247
- };
248
-
249
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
250
-
251
- EventEmitter.prototype.prependListener =
252
- function prependListener(type, listener) {
253
- return _addListener(this, type, listener, true);
254
- };
255
-
256
- function onceWrapper() {
257
- if (!this.fired) {
258
- this.target.removeListener(this.type, this.wrapFn);
259
- this.fired = true;
260
- if (arguments.length === 0)
261
- return this.listener.call(this.target);
262
- return this.listener.apply(this.target, arguments);
263
- }
34
+ function getDefaultExportFromCjs (x) {
35
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
264
36
  }
265
37
 
266
- function _onceWrap(target, type, listener) {
267
- var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
268
- var wrapped = onceWrapper.bind(state);
269
- wrapped.listener = listener;
270
- state.wrapFn = wrapped;
271
- return wrapped;
272
- }
273
-
274
- EventEmitter.prototype.once = function once(type, listener) {
275
- checkListener(listener);
276
- this.on(type, _onceWrap(this, type, listener));
277
- return this;
278
- };
279
-
280
- EventEmitter.prototype.prependOnceListener =
281
- function prependOnceListener(type, listener) {
282
- checkListener(listener);
283
- this.prependListener(type, _onceWrap(this, type, listener));
284
- return this;
285
- };
286
-
287
- // Emits a 'removeListener' event if and only if the listener was removed.
288
- EventEmitter.prototype.removeListener =
289
- function removeListener(type, listener) {
290
- var list, events, position, i, originalListener;
291
-
292
- checkListener(listener);
293
-
294
- events = this._events;
295
- if (events === undefined)
296
- return this;
297
-
298
- list = events[type];
299
- if (list === undefined)
300
- return this;
301
-
302
- if (list === listener || list.listener === listener) {
303
- if (--this._eventsCount === 0)
304
- this._events = Object.create(null);
305
- else {
306
- delete events[type];
307
- if (events.removeListener)
308
- this.emit('removeListener', type, list.listener || listener);
309
- }
310
- } else if (typeof list !== 'function') {
311
- position = -1;
312
-
313
- for (i = list.length - 1; i >= 0; i--) {
314
- if (list[i] === listener || list[i].listener === listener) {
315
- originalListener = list[i].listener;
316
- position = i;
317
- break;
318
- }
319
- }
320
-
321
- if (position < 0)
322
- return this;
323
-
324
- if (position === 0)
325
- list.shift();
326
- else {
327
- spliceOne(list, position);
328
- }
329
-
330
- if (list.length === 1)
331
- events[type] = list[0];
332
-
333
- if (events.removeListener !== undefined)
334
- this.emit('removeListener', type, originalListener || listener);
335
- }
336
-
337
- return this;
338
- };
339
-
340
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
341
-
342
- EventEmitter.prototype.removeAllListeners =
343
- function removeAllListeners(type) {
344
- var listeners, events, i;
345
-
346
- events = this._events;
347
- if (events === undefined)
348
- return this;
349
-
350
- // not listening for removeListener, no need to emit
351
- if (events.removeListener === undefined) {
352
- if (arguments.length === 0) {
353
- this._events = Object.create(null);
354
- this._eventsCount = 0;
355
- } else if (events[type] !== undefined) {
356
- if (--this._eventsCount === 0)
357
- this._events = Object.create(null);
358
- else
359
- delete events[type];
360
- }
361
- return this;
362
- }
363
-
364
- // emit removeListener for all listeners on all events
365
- if (arguments.length === 0) {
366
- var keys = Object.keys(events);
367
- var key;
368
- for (i = 0; i < keys.length; ++i) {
369
- key = keys[i];
370
- if (key === 'removeListener') continue;
371
- this.removeAllListeners(key);
372
- }
373
- this.removeAllListeners('removeListener');
374
- this._events = Object.create(null);
375
- this._eventsCount = 0;
376
- return this;
377
- }
378
-
379
- listeners = events[type];
380
-
381
- if (typeof listeners === 'function') {
382
- this.removeListener(type, listeners);
383
- } else if (listeners !== undefined) {
384
- // LIFO order
385
- for (i = listeners.length - 1; i >= 0; i--) {
386
- this.removeListener(type, listeners[i]);
387
- }
388
- }
389
-
390
- return this;
391
- };
392
-
393
- function _listeners(target, type, unwrap) {
394
- var events = target._events;
395
-
396
- if (events === undefined)
397
- return [];
398
-
399
- var evlistener = events[type];
400
- if (evlistener === undefined)
401
- return [];
402
-
403
- if (typeof evlistener === 'function')
404
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
405
-
406
- return unwrap ?
407
- unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
408
- }
409
-
410
- EventEmitter.prototype.listeners = function listeners(type) {
411
- return _listeners(this, type, true);
412
- };
413
-
414
- EventEmitter.prototype.rawListeners = function rawListeners(type) {
415
- return _listeners(this, type, false);
416
- };
417
-
418
- EventEmitter.listenerCount = function(emitter, type) {
419
- if (typeof emitter.listenerCount === 'function') {
420
- return emitter.listenerCount(type);
421
- } else {
422
- return listenerCount.call(emitter, type);
423
- }
424
- };
425
-
426
- EventEmitter.prototype.listenerCount = listenerCount;
427
- function listenerCount(type) {
428
- var events = this._events;
429
-
430
- if (events !== undefined) {
431
- var evlistener = events[type];
432
-
433
- if (typeof evlistener === 'function') {
434
- return 1;
435
- } else if (evlistener !== undefined) {
436
- return evlistener.length;
437
- }
438
- }
439
-
440
- return 0;
441
- }
442
-
443
- EventEmitter.prototype.eventNames = function eventNames() {
444
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
445
- };
446
-
447
- function arrayClone(arr, n) {
448
- var copy = new Array(n);
449
- for (var i = 0; i < n; ++i)
450
- copy[i] = arr[i];
451
- return copy;
452
- }
453
-
454
- function spliceOne(list, index) {
455
- for (; index + 1 < list.length; index++)
456
- list[index] = list[index + 1];
457
- list.pop();
458
- }
459
-
460
- function unwrapListeners(arr) {
461
- var ret = new Array(arr.length);
462
- for (var i = 0; i < ret.length; ++i) {
463
- ret[i] = arr[i].listener || arr[i];
464
- }
465
- return ret;
466
- }
467
-
468
- function once(emitter, name) {
469
- return new Promise(function (resolve, reject) {
470
- function errorListener(err) {
471
- emitter.removeListener(name, resolver);
472
- reject(err);
473
- }
474
-
475
- function resolver() {
476
- if (typeof emitter.removeListener === 'function') {
477
- emitter.removeListener('error', errorListener);
478
- }
479
- resolve([].slice.call(arguments));
480
- }
481
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
482
- if (name !== 'error') {
483
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
484
- }
485
- });
486
- }
487
-
488
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
489
- if (typeof emitter.on === 'function') {
490
- eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
491
- }
492
- }
38
+ var main$1 = {};
493
39
 
494
- function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
495
- if (typeof emitter.on === 'function') {
496
- if (flags.once) {
497
- emitter.once(name, listener);
498
- } else {
499
- emitter.on(name, listener);
500
- }
501
- } else if (typeof emitter.addEventListener === 'function') {
502
- // EventTarget does not have `error` event semantics like Node
503
- // EventEmitters, we do not listen for `error` events here.
504
- emitter.addEventListener(name, function wrapListener(arg) {
505
- // IE does not have builtin `{ once: true }` support so we
506
- // have to do it manually.
507
- if (flags.once) {
508
- emitter.removeEventListener(name, wrapListener);
509
- }
510
- listener(arg);
511
- });
512
- } else {
513
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
514
- }
515
- }
40
+ var fin = {};
516
41
 
517
- var system = {};
42
+ var system$1 = {};
518
43
 
519
- var base = {};
44
+ var base$1 = {};
520
45
 
521
46
  var promises = {};
522
47
 
@@ -559,8 +84,8 @@ var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateF
559
84
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
560
85
  };
561
86
  var _EmitterBase_emitterAccessor;
562
- Object.defineProperty(base, "__esModule", { value: true });
563
- base.Reply = base.EmitterBase = base.Base = void 0;
87
+ Object.defineProperty(base$1, "__esModule", { value: true });
88
+ base$1.Reply = base$1.EmitterBase = base$1.Base = void 0;
564
89
  const promises_1$2 = promises;
565
90
  class Base {
566
91
  /**
@@ -581,11 +106,18 @@ class Base {
581
106
  get fin() {
582
107
  return this.wire.getFin();
583
108
  }
109
+ /**
110
+ * Provides access to the OpenFin representation of the current code context (usually a document
111
+ * such as a {@link OpenFin.View} or {@link OpenFin.Window}), as well as to the current `Interop` context.
112
+ *
113
+ * Useful for debugging in the devtools console, where this will intelligently type itself based
114
+ * on the context in which the devtools panel was opened.
115
+ */
584
116
  get me() {
585
117
  return this.wire.me;
586
118
  }
587
119
  }
588
- base.Base = Base;
120
+ base$1.Base = Base;
589
121
  /**
590
122
  * An entity that emits OpenFin events.
591
123
  *
@@ -615,6 +147,9 @@ class EmitterBase extends Base {
615
147
  this.topic = topic;
616
148
  _EmitterBase_emitterAccessor.set(this, void 0);
617
149
  this.eventNames = () => (this.hasEmitter() ? this.getOrCreateEmitter().eventNames() : []);
150
+ /**
151
+ * @internal
152
+ */
618
153
  this.emit = (eventType, payload, ...args) => {
619
154
  return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
620
155
  };
@@ -657,16 +192,13 @@ class EmitterBase extends Base {
657
192
  // This will only be reached if unsubscribe from event that does not exist but do not want to error here
658
193
  return Promise.resolve();
659
194
  };
660
- this.addListener = this.on;
661
195
  __classPrivateFieldSet$d(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
662
196
  this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
663
197
  }
664
198
  /**
665
199
  * Adds a listener to the end of the listeners array for the specified event.
666
200
  *
667
- * @param eventType
668
- * @param listener
669
- * @param options
201
+ * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
670
202
  */
671
203
  async on(eventType, listener, options) {
672
204
  await this.registerEventListener(eventType, options, (emitter) => {
@@ -676,12 +208,16 @@ class EmitterBase extends Base {
676
208
  });
677
209
  return this;
678
210
  }
211
+ /**
212
+ * Adds a listener to the end of the listeners array for the specified event.
213
+ */
214
+ async addListener(eventType, listener, options) {
215
+ return this.on(eventType, listener, options);
216
+ }
679
217
  /**
680
218
  * Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
681
219
  *
682
- * @param eventType
683
- * @param listener
684
- * @param options
220
+ * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
685
221
  */
686
222
  async once(eventType, listener, options) {
687
223
  const deregister = () => this.deregisterEventListener(eventType);
@@ -697,9 +233,7 @@ class EmitterBase extends Base {
697
233
  /**
698
234
  * Adds a listener to the beginning of the listeners array for the specified event.
699
235
  *
700
- * @param eventType
701
- * @param listener
702
- * @param options
236
+ * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
703
237
  */
704
238
  async prependListener(eventType, listener, options) {
705
239
  await this.registerEventListener(eventType, options, (emitter) => {
@@ -713,9 +247,7 @@ class EmitterBase extends Base {
713
247
  * Adds a one time listener for the event. The listener is invoked only the first time the event is fired,
714
248
  * after which it is removed. The listener is added to the beginning of the listeners array.
715
249
  *
716
- * @param eventType
717
- * @param listener
718
- * @param options
250
+ * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
719
251
  */
720
252
  async prependOnceListener(eventType, listener, options) {
721
253
  const deregister = () => this.deregisterEventListener(eventType);
@@ -732,10 +264,6 @@ class EmitterBase extends Base {
732
264
  * Remove a listener from the listener array for the specified event.
733
265
  *
734
266
  * @remarks Caution: Calling this method changes the array indices in the listener array behind the listener.
735
- *
736
- * @param eventType
737
- * @param listener
738
- * @param options
739
267
  */
740
268
  async removeListener(eventType, listener, options) {
741
269
  const emitter = await this.deregisterEventListener(eventType, options);
@@ -762,7 +290,6 @@ class EmitterBase extends Base {
762
290
  /**
763
291
  * Removes all listeners, or those of the specified event.
764
292
  *
765
- * @param eventType
766
293
  */
767
294
  async removeAllListeners(eventType) {
768
295
  const removeByEvent = async (event) => {
@@ -787,11 +314,11 @@ class EmitterBase extends Base {
787
314
  }
788
315
  }
789
316
  }
790
- base.EmitterBase = EmitterBase;
317
+ base$1.EmitterBase = EmitterBase;
791
318
  _EmitterBase_emitterAccessor = new WeakMap();
792
319
  class Reply {
793
320
  }
794
- base.Reply = Reply;
321
+ base$1.Reply = Reply;
795
322
 
796
323
  var transportErrors = {};
797
324
 
@@ -824,7 +351,7 @@ class InternalError extends Error {
824
351
  const { message, name, stack, ...rest } = err;
825
352
  super(message);
826
353
  this.name = name || 'Error';
827
- this.stack = stack !== null && stack !== void 0 ? stack : this.toString();
354
+ this.stack = stack ?? this.toString();
828
355
  Object.keys(rest).forEach(key => {
829
356
  this[key] = rest[key];
830
357
  });
@@ -833,7 +360,6 @@ class InternalError extends Error {
833
360
  // For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
834
361
  class RuntimeError extends Error {
835
362
  static getCallSite(callsToRemove = 0) {
836
- var _a, _b;
837
363
  const length = Error.stackTraceLimit;
838
364
  const realCallsToRemove = callsToRemove + 1; // remove this call;
839
365
  Error.stackTraceLimit = length + realCallsToRemove;
@@ -842,7 +368,7 @@ class RuntimeError extends Error {
842
368
  // This will be called when we access the `stack` property
843
369
  Error.prepareStackTrace = (_, stack) => stack;
844
370
  // stack is optional in non chromium contexts
845
- const stack = (_b = (_a = new Error().stack) === null || _a === void 0 ? void 0 : _a.slice(realCallsToRemove)) !== null && _b !== void 0 ? _b : [];
371
+ const stack = new Error().stack?.slice(realCallsToRemove) ?? [];
846
372
  Error.prepareStackTrace = _prepareStackTrace;
847
373
  Error.stackTraceLimit = length;
848
374
  return stack;
@@ -864,7 +390,7 @@ class RuntimeError extends Error {
864
390
  const { reason, error } = payload;
865
391
  super(reason);
866
392
  this.name = 'RuntimeError';
867
- if (error === null || error === void 0 ? void 0 : error.stack) {
393
+ if (error?.stack) {
868
394
  this.cause = new InternalError(error);
869
395
  }
870
396
  if (callSites) {
@@ -874,7 +400,7 @@ class RuntimeError extends Error {
874
400
  }
875
401
  transportErrors.RuntimeError = RuntimeError;
876
402
 
877
- var window$1 = {};
403
+ var window$2 = {};
878
404
 
879
405
  var Factory$8 = {};
880
406
 
@@ -893,16 +419,30 @@ validate.validateIdentity = validateIdentity;
893
419
 
894
420
  var Instance$7 = {};
895
421
 
896
- var application = {};
422
+ var application$1 = {};
897
423
 
898
424
  var Factory$7 = {};
899
425
 
900
426
  var Instance$6 = {};
901
427
 
902
- var view = {};
428
+ var view$1 = {};
903
429
 
904
430
  var Factory$6 = {};
905
431
 
432
+ var warnings = {};
433
+
434
+ Object.defineProperty(warnings, "__esModule", { value: true });
435
+ warnings.handleDeprecatedWarnings = void 0;
436
+ const handleDeprecatedWarnings = (options) => {
437
+ if (options.contentNavigation?.whitelist ||
438
+ options.contentNavigation?.blacklist ||
439
+ options.contentRedirect?.whitelist ||
440
+ options.contentRedirect?.blacklist) {
441
+ console.warn(`The properties 'whitelist' and 'blacklist' have been marked as deprecated and will be removed in a future version. Please use 'allowlist' and 'denylist'.`);
442
+ }
443
+ };
444
+ warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
445
+
906
446
  var hasRequiredFactory$3;
907
447
 
908
448
  function requireFactory$3 () {
@@ -910,9 +450,13 @@ function requireFactory$3 () {
910
450
  hasRequiredFactory$3 = 1;
911
451
  Object.defineProperty(Factory$6, "__esModule", { value: true });
912
452
  Factory$6.ViewModule = void 0;
913
- const base_1 = base;
453
+ const base_1 = base$1;
914
454
  const validate_1 = validate;
915
455
  const index_1 = requireView();
456
+ const warnings_1 = warnings;
457
+ /**
458
+ * Static namespace for OpenFin API methods that interact with the {@link View} class, available under `fin.View`.
459
+ */
916
460
  class ViewModule extends base_1.Base {
917
461
  /**
918
462
  * Creates a new View.
@@ -947,6 +491,7 @@ function requireFactory$3 () {
947
491
  if (!options.name || typeof options.name !== 'string') {
948
492
  throw new Error('Please provide a name property as a string in order to create a View.');
949
493
  }
494
+ (0, warnings_1.handleDeprecatedWarnings)(options);
950
495
  if (this.wire.environment.childViews) {
951
496
  await this.wire.environment.createChildContent({
952
497
  entityType: 'view',
@@ -1234,7 +779,7 @@ class ChannelsExposer {
1234
779
  this.exposeFunction = async (target, config) => {
1235
780
  const { key, options, meta } = config;
1236
781
  const { id } = meta;
1237
- const action = `${id}.${(options === null || options === void 0 ? void 0 : options.action) || key}`;
782
+ const action = `${id}.${options?.action || key}`;
1238
783
  await this.channelProviderOrClient.register(action, async ({ args }) => {
1239
784
  return target(...args);
1240
785
  });
@@ -1265,7 +810,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
1265
810
  };
1266
811
  Object.defineProperty(exports, "__esModule", { value: true });
1267
812
  __exportStar(channelsConsumer, exports);
1268
- __exportStar(channelsExposer, exports);
813
+ __exportStar(channelsExposer, exports);
1269
814
  } (openfinChannels));
1270
815
 
1271
816
  (function (exports) {
@@ -1284,7 +829,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
1284
829
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1285
830
  };
1286
831
  Object.defineProperty(exports, "__esModule", { value: true });
1287
- __exportStar(openfinChannels, exports);
832
+ __exportStar(openfinChannels, exports);
1288
833
  } (strategies));
1289
834
 
1290
835
  (function (exports) {
@@ -1306,7 +851,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
1306
851
  __exportStar(apiConsumer, exports);
1307
852
  __exportStar(apiExposer, exports);
1308
853
  __exportStar(strategies, exports);
1309
- __exportStar(decorators, exports);
854
+ __exportStar(decorators, exports);
1310
855
  } (apiExposer$1));
1311
856
 
1312
857
  var channelApiRelay = {};
@@ -1547,14 +1092,14 @@ _LayoutNode_client = new WeakMap();
1547
1092
  /**
1548
1093
  * @ignore
1549
1094
  * @internal
1550
- * Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
1095
+ * Encapsulates Api consumption of {@link LayoutEntitiesClient} with a relayed dispatch
1551
1096
  * @param client
1552
1097
  * @param controllerId
1553
1098
  * @param identity
1554
1099
  * @returns a new instance of {@link LayoutEntitiesClient} with bound to the controllerId
1555
1100
  */
1556
1101
  LayoutNode.newLayoutEntitiesClient = async (client, controllerId, identity) => {
1557
- const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that has been destroyed.');
1102
+ const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that does not exist or has been destroyed.');
1558
1103
  const consumer = new api_exposer_1.ApiConsumer(new api_exposer_1.ChannelsConsumer({ dispatch }));
1559
1104
  return consumer.consume({ id: controllerId });
1560
1105
  };
@@ -1864,15 +1409,20 @@ _ColumnOrRow_client = new WeakMap();
1864
1409
  var layout_constants = {};
1865
1410
 
1866
1411
  Object.defineProperty(layout_constants, "__esModule", { value: true });
1867
- layout_constants.LAYOUT_CONTROLLER_ID = void 0;
1412
+ layout_constants.DEFAULT_LAYOUT_KEY = layout_constants.LAYOUT_CONTROLLER_ID = void 0;
1868
1413
  layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
1414
+ layout_constants.DEFAULT_LAYOUT_KEY = 'default';
1869
1415
 
1870
1416
  var main = {};
1871
1417
 
1872
1418
  Object.defineProperty(main, "__esModule", { value: true });
1873
1419
  main.WebContents = void 0;
1874
- const base_1$k = base;
1420
+ const base_1$k = base$1;
1875
1421
  class WebContents extends base_1$k.EmitterBase {
1422
+ /**
1423
+ * @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
1424
+ * @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
1425
+ */
1876
1426
  constructor(wire, identity, entityType) {
1877
1427
  super(wire, entityType, identity.uuid, identity.name);
1878
1428
  this.identity = identity;
@@ -1925,6 +1475,11 @@ class WebContents extends base_1$k.EmitterBase {
1925
1475
  * }
1926
1476
  * console.log(await wnd.capturePage(options));
1927
1477
  * ```
1478
+ *
1479
+ * @remarks
1480
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1481
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1482
+ * {@link OpenFin.WebContentsEvents event namespace}.
1928
1483
  */
1929
1484
  capturePage(options) {
1930
1485
  return this.wire.sendAction('capture-page', { options, ...this.identity }).then(({ payload }) => payload.data);
@@ -1960,6 +1515,10 @@ class WebContents extends base_1$k.EmitterBase {
1960
1515
  *
1961
1516
  * executeJavaScript(`console.log('Hello, Openfin')`).then(() => console.log('Javascript excuted')).catch(err => console.log(err));
1962
1517
  * ```
1518
+ * @remarks
1519
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1520
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1521
+ * {@link OpenFin.WebContentsEvents event namespace}.
1963
1522
  */
1964
1523
  executeJavaScript(code) {
1965
1524
  return this.wire
@@ -1999,6 +1558,10 @@ class WebContents extends base_1$k.EmitterBase {
1999
1558
  *
2000
1559
  * getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
2001
1560
  * ```
1561
+ * @remarks
1562
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1563
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1564
+ * {@link OpenFin.WebContentsEvents event namespace}.
2002
1565
  */
2003
1566
  getZoomLevel() {
2004
1567
  return this.wire.sendAction('get-zoom-level', this.identity).then(({ payload }) => payload.data);
@@ -2037,6 +1600,10 @@ class WebContents extends base_1$k.EmitterBase {
2037
1600
  *
2038
1601
  * setZoomLevel(4).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
2039
1602
  * ```
1603
+ * @remarks
1604
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1605
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1606
+ * {@link OpenFin.WebContentsEvents event namespace}.
2040
1607
  */
2041
1608
  setZoomLevel(level) {
2042
1609
  return this.wire.sendAction('set-zoom-level', { ...this.identity, level }).then(() => undefined);
@@ -2044,7 +1611,7 @@ class WebContents extends base_1$k.EmitterBase {
2044
1611
  /**
2045
1612
  * Navigates the WebContents to a specified URL.
2046
1613
  *
2047
- * @remarks The url must contain the protocol prefix such as http:// or https://.
1614
+ * Note: The url must contain the protocol prefix such as http:// or https://.
2048
1615
  * @param url - The URL to navigate the WebContents to.
2049
1616
  *
2050
1617
  * @example
@@ -2074,6 +1641,10 @@ class WebContents extends base_1$k.EmitterBase {
2074
1641
  * navigate().then(() => console.log('Navigate to tutorial')).catch(err => console.log(err));
2075
1642
  * ```
2076
1643
  * @experimental
1644
+ * @remarks
1645
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1646
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1647
+ * {@link OpenFin.WebContentsEvents event namespace}.
2077
1648
  */
2078
1649
  navigate(url) {
2079
1650
  return this.wire.sendAction('navigate-window', { ...this.identity, url }).then(() => undefined);
@@ -2101,6 +1672,10 @@ class WebContents extends base_1$k.EmitterBase {
2101
1672
  * }
2102
1673
  * navigateBack().then(() => console.log('Navigated back')).catch(err => console.log(err));
2103
1674
  * ```
1675
+ * @remarks
1676
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1677
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1678
+ * {@link OpenFin.WebContentsEvents event namespace}.
2104
1679
  */
2105
1680
  navigateBack() {
2106
1681
  return this.wire.sendAction('navigate-window-back', { ...this.identity }).then(() => undefined);
@@ -2130,6 +1705,10 @@ class WebContents extends base_1$k.EmitterBase {
2130
1705
  * }
2131
1706
  * navigateForward().then(() => console.log('Navigated forward')).catch(err => console.log(err));
2132
1707
  * ```
1708
+ * @remarks
1709
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1710
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1711
+ * {@link OpenFin.WebContentsEvents event namespace}.
2133
1712
  */
2134
1713
  async navigateForward() {
2135
1714
  await this.wire.sendAction('navigate-window-forward', { ...this.identity });
@@ -2157,6 +1736,10 @@ class WebContents extends base_1$k.EmitterBase {
2157
1736
  * }
2158
1737
  * stopNavigation().then(() => console.log('you shall not navigate')).catch(err => console.log(err));
2159
1738
  * ```
1739
+ * @remarks
1740
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1741
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1742
+ * {@link OpenFin.WebContentsEvents event namespace}.
2160
1743
  */
2161
1744
  stopNavigation() {
2162
1745
  return this.wire.sendAction('stop-window-navigation', { ...this.identity }).then(() => undefined);
@@ -2194,6 +1777,10 @@ class WebContents extends base_1$k.EmitterBase {
2194
1777
  * console.log('Reloaded window')
2195
1778
  * }).catch(err => console.log(err));
2196
1779
  * ```
1780
+ * @remarks
1781
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1782
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1783
+ * {@link OpenFin.WebContentsEvents event namespace}.
2197
1784
  */
2198
1785
  reload(ignoreCache = false) {
2199
1786
  return this.wire
@@ -2207,7 +1794,7 @@ class WebContents extends base_1$k.EmitterBase {
2207
1794
  * Prints the WebContents.
2208
1795
  * @param options Printer Options
2209
1796
  *
2210
- * @remarks When `silent` is set to `true`, the API will pick the system's default printer if deviceName
1797
+ * Note: When `silent` is set to `true`, the API will pick the system's default printer if deviceName
2211
1798
  * is empty and the default settings for printing.
2212
1799
  *
2213
1800
  * Use the CSS style `page-break-before: always;` to force print to a new page.
@@ -2220,6 +1807,10 @@ class WebContents extends base_1$k.EmitterBase {
2220
1807
  * console.log('print call has been sent to the system');
2221
1808
  * });
2222
1809
  * ```
1810
+ * @remarks
1811
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1812
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1813
+ * {@link OpenFin.WebContentsEvents event namespace}.
2223
1814
  */
2224
1815
  print(options = {}) {
2225
1816
  return this.wire.sendAction('print', { ...this.identity, options }).then(() => undefined);
@@ -2229,7 +1820,7 @@ class WebContents extends base_1$k.EmitterBase {
2229
1820
  * @param searchTerm Term to find in page
2230
1821
  * @param options Search options
2231
1822
  *
2232
- * @remarks By default, each subsequent call will highlight the next text that matches the search term.
1823
+ * Note: By default, each subsequent call will highlight the next text that matches the search term.
2233
1824
  *
2234
1825
  * Returns a promise with the results for the request. By subscribing to the
2235
1826
  * found-in-page event, you can get the results of this call as well.
@@ -2264,6 +1855,10 @@ class WebContents extends base_1$k.EmitterBase {
2264
1855
  * console.log(result)
2265
1856
  * });
2266
1857
  * ```
1858
+ * @remarks
1859
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1860
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1861
+ * {@link OpenFin.WebContentsEvents event namespace}.
2267
1862
  */
2268
1863
  findInPage(searchTerm, options) {
2269
1864
  return this.wire
@@ -2307,6 +1902,10 @@ class WebContents extends base_1$k.EmitterBase {
2307
1902
  * console.log(results);
2308
1903
  * });
2309
1904
  * ```
1905
+ * @remarks
1906
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1907
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1908
+ * {@link OpenFin.WebContentsEvents event namespace}.
2310
1909
  */
2311
1910
  stopFindInPage(action) {
2312
1911
  return this.wire.sendAction('stop-find-in-page', { ...this.identity, action }).then(() => undefined);
@@ -2349,6 +1948,10 @@ class WebContents extends base_1$k.EmitterBase {
2349
1948
  * console.log(err);
2350
1949
  * });
2351
1950
  * ```
1951
+ * @remarks
1952
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1953
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1954
+ * {@link OpenFin.WebContentsEvents event namespace}.
2352
1955
  */
2353
1956
  getPrinters() {
2354
1957
  return this.wire.sendAction('get-printers', { ...this.identity }).then(({ payload }) => payload.data);
@@ -2371,6 +1974,10 @@ class WebContents extends base_1$k.EmitterBase {
2371
1974
  *
2372
1975
  * focusWindow().then(() => console.log('Window focused')).catch(err => console.log(err));
2373
1976
  * ```
1977
+ * @remarks
1978
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1979
+ * We do not expose an explicit superclass for this functionality, but it does have its own
1980
+ * {@link OpenFin.WebContentsEvents event namespace}.
2374
1981
  */
2375
1982
  async focus({ emitSynthFocused } = { emitSynthFocused: true }) {
2376
1983
  await this.wire.sendAction('focus-window', { emitSynthFocused, ...this.identity });
@@ -2402,6 +2009,10 @@ class WebContents extends base_1$k.EmitterBase {
2402
2009
  * .then(() => console.log('Showing dev tools'))
2403
2010
  * .catch(err => console.error(err));
2404
2011
  * ```
2012
+ * @remarks
2013
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2014
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2015
+ * {@link OpenFin.WebContentsEvents event namespace}.
2405
2016
  */
2406
2017
  async showDeveloperTools() {
2407
2018
  // Note this hits the system action map in core state for legacy reasons.
@@ -2410,7 +2021,7 @@ class WebContents extends base_1$k.EmitterBase {
2410
2021
  /**
2411
2022
  * Retrieves the process information associated with a WebContents.
2412
2023
  *
2413
- * @remarks This includes any iframes associated with the WebContents
2024
+ * Note: This includes any iframes associated with the WebContents
2414
2025
  *
2415
2026
  * @example
2416
2027
  * View:
@@ -2424,6 +2035,10 @@ class WebContents extends base_1$k.EmitterBase {
2424
2035
  * const win = await fin.Window.getCurrent();
2425
2036
  * const processInfo = await win.getProcessInfo();
2426
2037
  * ```
2038
+ * @remarks
2039
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2040
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2041
+ * {@link OpenFin.WebContentsEvents event namespace}.
2427
2042
  */
2428
2043
  async getProcessInfo() {
2429
2044
  const { payload: { data } } = await this.wire.sendAction('get-process-info', this.identity);
@@ -2459,6 +2074,10 @@ class WebContents extends base_1$k.EmitterBase {
2459
2074
  * const win = await fin.Window.create(winOption);
2460
2075
  * const sharedWorkers = await win.getSharedWorkers();
2461
2076
  * ```
2077
+ * @remarks
2078
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2079
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2080
+ * {@link OpenFin.WebContentsEvents event namespace}.
2462
2081
  */
2463
2082
  async getSharedWorkers() {
2464
2083
  return this.wire.sendAction('get-shared-workers', this.identity).then(({ payload }) => payload.data);
@@ -2493,6 +2112,10 @@ class WebContents extends base_1$k.EmitterBase {
2493
2112
  * const win = await fin.Window.create(winOption);
2494
2113
  * await win.inspectSharedWorker();
2495
2114
  * ```
2115
+ * @remarks
2116
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2117
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2118
+ * {@link OpenFin.WebContentsEvents event namespace}.
2496
2119
  */
2497
2120
  async inspectSharedWorker() {
2498
2121
  await this.wire.sendAction('inspect-shared-worker', { ...this.identity });
@@ -2530,6 +2153,10 @@ class WebContents extends base_1$k.EmitterBase {
2530
2153
  * const sharedWorkers = await win.getSharedWorkers();
2531
2154
  * await win.inspectSharedWorkerById(sharedWorkers[0].id);
2532
2155
  * ```
2156
+ * @remarks
2157
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2158
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2159
+ * {@link OpenFin.WebContentsEvents event namespace}.
2533
2160
  */
2534
2161
  async inspectSharedWorkerById(workerId) {
2535
2162
  await this.wire.sendAction('inspect-shared-worker-by-id', { ...this.identity, workerId });
@@ -2564,6 +2191,10 @@ class WebContents extends base_1$k.EmitterBase {
2564
2191
  * const win = await fin.Window.create(winOption);
2565
2192
  * await win.inspectServiceWorker();
2566
2193
  * ```
2194
+ * @remarks
2195
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2196
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2197
+ * {@link OpenFin.WebContentsEvents event namespace}.
2567
2198
  */
2568
2199
  async inspectServiceWorker() {
2569
2200
  await this.wire.sendAction('inspect-service-worker', { ...this.identity });
@@ -2571,7 +2202,7 @@ class WebContents extends base_1$k.EmitterBase {
2571
2202
  /**
2572
2203
  * Shows a popup window.
2573
2204
  *
2574
- * @remarks If this WebContents is a view and its attached window has a popup open, this will close it.
2205
+ * Note: If this WebContents is a view and its attached window has a popup open, this will close it.
2575
2206
  *
2576
2207
  * Shows a popup window. Including a `name` in `options` will attempt to show an existing window as a popup, if
2577
2208
  * that window doesn't exist or no `name` is included a window will be created. If the caller view or the caller
@@ -2579,7 +2210,7 @@ class WebContents extends base_1$k.EmitterBase {
2579
2210
  * open popup window before showing the new popup window. Also, if the caller view is destroyed or detached, the popup
2580
2211
  * will be dismissed.
2581
2212
  *
2582
- * NOTE: in the case where the window being shown as a popup needs to be created, it is a child of the caller view's parent window.
2213
+ * Note: in the case where the window being shown as a popup needs to be created, it is a child of the caller view's parent window.
2583
2214
  *
2584
2215
  * @example
2585
2216
  *
@@ -2774,12 +2405,16 @@ class WebContents extends base_1$k.EmitterBase {
2774
2405
  * onPopupReady: popupWindowCallback;
2775
2406
  * });
2776
2407
  * ```
2408
+ * @remarks
2409
+ * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2410
+ * We do not expose an explicit superclass for this functionality, but it does have its own
2411
+ * {@link OpenFin.WebContentsEvents event namespace}.
2777
2412
  */
2778
2413
  async showPopupWindow(options) {
2779
2414
  this.wire.sendAction(`${this.entityType}-show-popup-window`, this.identity).catch(() => {
2780
2415
  // we do not want to expose this error, just continue if this analytics-only call fails
2781
2416
  });
2782
- if (options === null || options === void 0 ? void 0 : options.onPopupReady) {
2417
+ if (options?.onPopupReady) {
2783
2418
  const readyListener = async ({ popupName }) => {
2784
2419
  try {
2785
2420
  const popupWindow = this.fin.Window.wrapSync({ uuid: this.fin.me.uuid, name: popupName });
@@ -2798,8 +2433,8 @@ class WebContents extends base_1$k.EmitterBase {
2798
2433
  ...options,
2799
2434
  // Internal use only.
2800
2435
  // @ts-expect-error
2801
- hasResultCallback: !!(options === null || options === void 0 ? void 0 : options.onPopupResult),
2802
- hasReadyCallback: !!(options === null || options === void 0 ? void 0 : options.onPopupReady)
2436
+ hasResultCallback: !!options?.onPopupResult,
2437
+ hasReadyCallback: !!options?.onPopupReady
2803
2438
  },
2804
2439
  ...this.identity
2805
2440
  });
@@ -2824,7 +2459,7 @@ class WebContents extends base_1$k.EmitterBase {
2824
2459
  }
2825
2460
  return popupResult;
2826
2461
  };
2827
- if (options === null || options === void 0 ? void 0 : options.onPopupResult) {
2462
+ if (options?.onPopupResult) {
2828
2463
  const dispatchResultListener = async (payload) => {
2829
2464
  await options.onPopupResult(normalizePopupResult(payload));
2830
2465
  };
@@ -3150,6 +2785,49 @@ function requireInstance$2 () {
3150
2785
  this.show = async () => {
3151
2786
  await this.wire.sendAction('show-view', { ...this.identity });
3152
2787
  };
2788
+ /**
2789
+ * Sets the bounds (top, left, width, height) of the view relative to its window and shows it if it is hidden.
2790
+ * This method ensures the view is both positioned and showing. It will reposition a visible view and both show and reposition a hidden view.
2791
+ *
2792
+ * @remarks View position is relative to the bounds of the window.
2793
+ * ({top: 0, left: 0} represents the top left corner of the window)
2794
+ *
2795
+ * @example
2796
+ * ```js
2797
+ * let view;
2798
+ * async function createView() {
2799
+ * const me = await fin.Window.getCurrent();
2800
+ * return fin.View.create({
2801
+ * name: 'viewNameSetBounds',
2802
+ * target: me.identity,
2803
+ * bounds: {top: 10, left: 10, width: 200, height: 200}
2804
+ * });
2805
+ * }
2806
+ *
2807
+ * async function showViewAt() {
2808
+ * view = await createView();
2809
+ * console.log('View created.');
2810
+ *
2811
+ * await view.navigate('https://google.com');
2812
+ * console.log('View navigated to given url.');
2813
+ *
2814
+ * await view.showAt({
2815
+ * top: 100,
2816
+ * left: 100,
2817
+ * width: 300,
2818
+ * height: 300
2819
+ * });
2820
+ * }
2821
+ *
2822
+ * showViewAt()
2823
+ * .then(() => console.log('View set to new bounds and shown.'))
2824
+ * .catch(err => console.log(err));
2825
+ * ```
2826
+ * @experimental
2827
+ */
2828
+ this.showAt = async (bounds) => {
2829
+ await this.wire.sendAction('show-view-at', { bounds, ...this.identity });
2830
+ };
3153
2831
  /**
3154
2832
  * Hides the current view if it is currently visible.
3155
2833
  *
@@ -3309,8 +2987,24 @@ function requireInstance$2 () {
3309
2987
  this.wire.sendAction('view-get-parent-layout', { ...this.identity }).catch(() => {
3310
2988
  // don't expose
3311
2989
  });
3312
- const currentWindow = await this.getCurrentWindow();
3313
- return currentWindow.getLayout();
2990
+ const layoutWindow = await this.getCurrentWindow();
2991
+ try {
2992
+ const providerChannelClient = await __classPrivateFieldGet(this, _View_providerChannelClient, "f").getValue();
2993
+ const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindow.identity);
2994
+ const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
2995
+ return this.fin.Platform.Layout.wrap(layoutIdentity);
2996
+ }
2997
+ catch (e) {
2998
+ const allowedErrors = [
2999
+ 'No action registered at target for',
3000
+ 'getLayoutIdentityForViewOrThrow is not a function'
3001
+ ];
3002
+ if (!allowedErrors.some((m) => e.message.includes(m))) {
3003
+ throw e;
3004
+ }
3005
+ // fallback logic for missing endpoint
3006
+ return this.fin.Platform.Layout.wrap(layoutWindow.identity);
3007
+ }
3314
3008
  };
3315
3009
  /**
3316
3010
  * Gets the View's options.
@@ -3525,7 +3219,7 @@ function requireInstance$2 () {
3525
3219
  var hasRequiredView;
3526
3220
 
3527
3221
  function requireView () {
3528
- if (hasRequiredView) return view;
3222
+ if (hasRequiredView) return view$1;
3529
3223
  hasRequiredView = 1;
3530
3224
  (function (exports) {
3531
3225
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -3544,9 +3238,9 @@ function requireView () {
3544
3238
  };
3545
3239
  Object.defineProperty(exports, "__esModule", { value: true });
3546
3240
  /**
3547
- * Entry points for the OpenFin `View` API.
3241
+ * Entry points for the OpenFin `View` API (`fin.View`).
3548
3242
  *
3549
- * * {@link ViewModule} contains static methods relating to the `View` type, accessible through `fin.View`.
3243
+ * * {@link ViewModule} contains static members of the `View` API, accessible through `fin.View`.
3550
3244
  * * {@link View} describes an instance of an OpenFin View, e.g. as returned by `fin.View.getCurrent`.
3551
3245
  *
3552
3246
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -3555,9 +3249,9 @@ function requireView () {
3555
3249
  * @packageDocumentation
3556
3250
  */
3557
3251
  __exportStar(requireFactory$3(), exports);
3558
- __exportStar(requireInstance$2(), exports);
3559
- } (view));
3560
- return view;
3252
+ __exportStar(requireInstance$2(), exports);
3253
+ } (view$1));
3254
+ return view$1;
3561
3255
  }
3562
3256
 
3563
3257
  var hasRequiredInstance$1;
@@ -3568,7 +3262,7 @@ function requireInstance$1 () {
3568
3262
  Object.defineProperty(Instance$6, "__esModule", { value: true });
3569
3263
  Instance$6.Application = void 0;
3570
3264
  /* eslint-disable import/prefer-default-export */
3571
- const base_1 = base;
3265
+ const base_1 = base$1;
3572
3266
  const window_1 = requireWindow();
3573
3267
  const view_1 = requireView();
3574
3268
  /**
@@ -4043,6 +3737,7 @@ function requireInstance$1 () {
4043
3737
  /**
4044
3738
  * Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
4045
3739
  * If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
3740
+ *
4046
3741
  * Note: If the "name" property is omitted it defaults to "tasks".
4047
3742
  * @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
4048
3743
  *
@@ -4343,6 +4038,7 @@ function requireInstance$1 () {
4343
4038
  }
4344
4039
  /**
4345
4040
  * Sets file auto download location. It's only allowed in the same application.
4041
+ *
4346
4042
  * Note: This method is restricted by default and must be enabled via
4347
4043
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4348
4044
  * @param downloadLocation file auto download location
@@ -4368,6 +4064,7 @@ function requireInstance$1 () {
4368
4064
  }
4369
4065
  /**
4370
4066
  * Gets file auto download location. It's only allowed in the same application. If file auto download location is not set, it will return the default location.
4067
+ *
4371
4068
  * Note: This method is restricted by default and must be enabled via
4372
4069
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4373
4070
  *
@@ -4395,9 +4092,12 @@ function requireFactory$2 () {
4395
4092
  hasRequiredFactory$2 = 1;
4396
4093
  Object.defineProperty(Factory$7, "__esModule", { value: true });
4397
4094
  Factory$7.ApplicationModule = void 0;
4398
- const base_1 = base;
4095
+ const base_1 = base$1;
4399
4096
  const validate_1 = validate;
4400
4097
  const Instance_1 = requireInstance$1();
4098
+ /**
4099
+ * Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
4100
+ */
4401
4101
  class ApplicationModule extends base_1.Base {
4402
4102
  /**
4403
4103
  * Asynchronously returns an Application object that represents an existing application.
@@ -4660,7 +4360,7 @@ function requireFactory$2 () {
4660
4360
  var hasRequiredApplication;
4661
4361
 
4662
4362
  function requireApplication () {
4663
- if (hasRequiredApplication) return application;
4363
+ if (hasRequiredApplication) return application$1;
4664
4364
  hasRequiredApplication = 1;
4665
4365
  (function (exports) {
4666
4366
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -4679,9 +4379,9 @@ function requireApplication () {
4679
4379
  };
4680
4380
  Object.defineProperty(exports, "__esModule", { value: true });
4681
4381
  /**
4682
- * Entry points for the OpenFin `Application` API.
4382
+ * Entry points for the OpenFin `Application` API (`fin.Application`).
4683
4383
  *
4684
- * * {@link ApplicationModule} contains static methods relating to the `Application` type, accessible through `fin.Application`.
4384
+ * * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
4685
4385
  * * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
4686
4386
  *
4687
4387
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -4690,9 +4390,9 @@ function requireApplication () {
4690
4390
  * @packageDocumentation
4691
4391
  */
4692
4392
  __exportStar(requireFactory$2(), exports);
4693
- __exportStar(requireInstance$1(), exports);
4694
- } (application));
4695
- return application;
4393
+ __exportStar(requireInstance$1(), exports);
4394
+ } (application$1));
4395
+ return application$1;
4696
4396
  }
4697
4397
 
4698
4398
  var hasRequiredInstance;
@@ -4709,6 +4409,7 @@ function requireInstance () {
4709
4409
  const application_1 = requireApplication();
4710
4410
  const main_1 = main;
4711
4411
  const view_1 = requireView();
4412
+ const warnings_1 = warnings;
4712
4413
  /**
4713
4414
  * @PORTED
4714
4415
  * @typedef { object } Margins
@@ -5193,7 +4894,6 @@ function requireInstance () {
5193
4894
  */
5194
4895
  constructor(wire, identity) {
5195
4896
  super(wire, identity, 'window');
5196
- this.identity = identity;
5197
4897
  }
5198
4898
  /**
5199
4899
  * Adds a listener to the end of the listeners array for the specified event.
@@ -5319,6 +5019,7 @@ function requireInstance () {
5319
5019
  if (options.autoShow === undefined) {
5320
5020
  options.autoShow = true;
5321
5021
  }
5022
+ (0, warnings_1.handleDeprecatedWarnings)(options);
5322
5023
  const windowCreation = this.wire.environment.createChildContent({ entityType: 'window', options });
5323
5024
  Promise.all([pageResponse, windowCreation])
5324
5025
  .then((resolvedArr) => {
@@ -5735,15 +5436,15 @@ function requireInstance () {
5735
5436
  * ```
5736
5437
  * @experimental
5737
5438
  */
5738
- async getLayout() {
5439
+ async getLayout(layoutIdentity) {
5739
5440
  this.wire.sendAction('window-get-layout', this.identity).catch((e) => {
5740
5441
  // don't expose
5741
5442
  });
5742
5443
  const opts = await this.getOptions();
5743
- if (!opts.layout) {
5444
+ if (!opts.layout || !opts.layoutSnapshot) {
5744
5445
  throw new Error('Window does not have a Layout');
5745
5446
  }
5746
- return this.fin.Platform.Layout.wrap(this.identity);
5447
+ return this.fin.Platform.Layout.wrap(layoutIdentity ?? this.identity);
5747
5448
  }
5748
5449
  /**
5749
5450
  * Gets the current settings of the window.
@@ -6024,11 +5725,12 @@ function requireInstance () {
6024
5725
  * moveBy(580, 300).then(() => console.log('Moved')).catch(err => console.log(err));
6025
5726
  * ```
6026
5727
  */
6027
- moveBy(deltaLeft, deltaTop) {
5728
+ moveBy(deltaLeft, deltaTop, positioningOptions) {
6028
5729
  return this.wire
6029
5730
  .sendAction('move-window-by', {
6030
5731
  deltaLeft,
6031
5732
  deltaTop,
5733
+ positioningOptions,
6032
5734
  ...this.identity
6033
5735
  })
6034
5736
  .then(() => undefined);
@@ -6058,11 +5760,12 @@ function requireInstance () {
6058
5760
  * moveTo(580, 300).then(() => console.log('Moved')).catch(err => console.log(err))
6059
5761
  * ```
6060
5762
  */
6061
- moveTo(left, top) {
5763
+ moveTo(left, top, positioningOptions) {
6062
5764
  return this.wire
6063
5765
  .sendAction('move-window', {
6064
5766
  left,
6065
5767
  top,
5768
+ positioningOptions,
6066
5769
  ...this.identity
6067
5770
  })
6068
5771
  .then(() => undefined);
@@ -6095,12 +5798,13 @@ function requireInstance () {
6095
5798
  * resizeBy(580, 300, 'top-right').then(() => console.log('Resized')).catch(err => console.log(err));
6096
5799
  * ```
6097
5800
  */
6098
- resizeBy(deltaWidth, deltaHeight, anchor) {
5801
+ resizeBy(deltaWidth, deltaHeight, anchor, positioningOptions) {
6099
5802
  return this.wire
6100
5803
  .sendAction('resize-window-by', {
6101
5804
  deltaWidth: Math.floor(deltaWidth),
6102
5805
  deltaHeight: Math.floor(deltaHeight),
6103
5806
  anchor,
5807
+ positioningOptions,
6104
5808
  ...this.identity
6105
5809
  })
6106
5810
  .then(() => undefined);
@@ -6133,12 +5837,13 @@ function requireInstance () {
6133
5837
  * resizeTo(580, 300, 'top-left').then(() => console.log('Resized')).catch(err => console.log(err));
6134
5838
  * ```
6135
5839
  */
6136
- resizeTo(width, height, anchor) {
5840
+ resizeTo(width, height, anchor, positioningOptions) {
6137
5841
  return this.wire
6138
5842
  .sendAction('resize-window', {
6139
5843
  width: Math.floor(width),
6140
5844
  height: Math.floor(height),
6141
5845
  anchor,
5846
+ positioningOptions,
6142
5847
  ...this.identity
6143
5848
  })
6144
5849
  .then(() => undefined);
@@ -6197,7 +5902,6 @@ function requireInstance () {
6197
5902
  }
6198
5903
  /**
6199
5904
  * Sets the window's size and position.
6200
- * @property { Bounds } bounds This is a * @type {string} name - name of the window.object that holds the propertys of
6201
5905
  *
6202
5906
  * @example
6203
5907
  * ```js
@@ -6224,8 +5928,10 @@ function requireInstance () {
6224
5928
  * }).then(() => console.log('Bounds set to window')).catch(err => console.log(err));
6225
5929
  * ```
6226
5930
  */
6227
- setBounds(bounds) {
6228
- return this.wire.sendAction('set-window-bounds', { ...bounds, ...this.identity }).then(() => undefined);
5931
+ setBounds(bounds, positioningOptions) {
5932
+ return this.wire
5933
+ .sendAction('set-window-bounds', { ...bounds, ...this.identity, positioningOptions })
5934
+ .then(() => undefined);
6229
5935
  }
6230
5936
  /**
6231
5937
  * Shows the window if it is hidden.
@@ -6367,7 +6073,10 @@ function requireInstance () {
6367
6073
  * Calling this method will close previously opened menus.
6368
6074
  * @experimental
6369
6075
  * @param options
6370
- *
6076
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
6077
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
6078
+ * of all possible data shapes for the entire menu, and the click handler should process
6079
+ * these with a "reducer" pattern.
6371
6080
  * @example
6372
6081
  * This could be used to show a drop down menu over views in a platform window:
6373
6082
  * ```js
@@ -6457,6 +6166,7 @@ function requireInstance () {
6457
6166
  return this.wire.sendAction('close-popup-menu', { ...this.identity }).then(() => undefined);
6458
6167
  }
6459
6168
  /**
6169
+ * @PORTED
6460
6170
  * @typedef {object} PopupOptions
6461
6171
  * @property {string} [name] - If a window with this `name` exists, it will be shown as a popup. Otherwise, a new window with this `name` will be created. If this `name` is undefined, `initialOptions.name` will be used. If this `name` and `intialOptions.name` are both undefined, a `name` will be generated.
6462
6172
  * @property {string} [url] - Navigates to this `url` if showing an existing window as a popup, otherwise the newly created window will load this `url`.
@@ -6474,6 +6184,7 @@ function requireInstance () {
6474
6184
  * @property {boolean} [hideOnClose] - Hide the popup window instead of closing whenever `close` is called on it. Note: if this is `true` and `blurBehavior` and/or `resultDispatchBehavior` are set to `close`, the window will be hidden.
6475
6185
  */
6476
6186
  /**
6187
+ * @PORTED
6477
6188
  * @typedef {object} PopupResult
6478
6189
  * @property {Identity} identity - `name` and `uuid` of the popup window that called dispatched this result.
6479
6190
  * @property {'clicked' | 'dismissed'} result - Result of the user interaction with the popup window.
@@ -6564,9 +6275,12 @@ function requireFactory$1 () {
6564
6275
  hasRequiredFactory$1 = 1;
6565
6276
  Object.defineProperty(Factory$8, "__esModule", { value: true });
6566
6277
  Factory$8._WindowModule = void 0;
6567
- const base_1 = base;
6278
+ const base_1 = base$1;
6568
6279
  const validate_1 = validate;
6569
6280
  const Instance_1 = requireInstance();
6281
+ /**
6282
+ * Static namespace for OpenFin API methods that interact with the {@link _Window} class, available under `fin.Window`.
6283
+ */
6570
6284
  class _WindowModule extends base_1.Base {
6571
6285
  /**
6572
6286
  * Asynchronously returns a Window object that represents an existing window.
@@ -6703,7 +6417,7 @@ function requireFactory$1 () {
6703
6417
  var hasRequiredWindow;
6704
6418
 
6705
6419
  function requireWindow () {
6706
- if (hasRequiredWindow) return window$1;
6420
+ if (hasRequiredWindow) return window$2;
6707
6421
  hasRequiredWindow = 1;
6708
6422
  (function (exports) {
6709
6423
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -6722,9 +6436,9 @@ function requireWindow () {
6722
6436
  };
6723
6437
  Object.defineProperty(exports, "__esModule", { value: true });
6724
6438
  /**
6725
- * Entry points for the OpenFin `Window` API.
6439
+ * Entry points for the OpenFin `Window` API (`fin.Window`).
6726
6440
  *
6727
- * * {@link _WindowModule} contains static methods relating to the `Window` type, accessible through `fin.Window`.
6441
+ * * {@link _WindowModule} contains static members of the `Window` API, accessible through `fin.Window`.
6728
6442
  * * {@link _Window} describes an instance of an OpenFin Window, e.g. as returned by `fin.Window.getCurrent`.
6729
6443
  *
6730
6444
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -6735,17 +6449,24 @@ function requireWindow () {
6735
6449
  * @packageDocumentation
6736
6450
  */
6737
6451
  __exportStar(requireFactory$1(), exports);
6738
- __exportStar(requireInstance(), exports);
6739
- } (window$1));
6740
- return window$1;
6452
+ __exportStar(requireInstance(), exports);
6453
+ } (window$2));
6454
+ return window$2;
6741
6455
  }
6742
6456
 
6743
- Object.defineProperty(system, "__esModule", { value: true });
6744
- system.System = void 0;
6745
- const base_1$j = base;
6457
+ /**
6458
+ * Entry point for the OpenFin `System` API (`fin.System`).
6459
+ *
6460
+ * * {@link System} contains static members of the `System` API (available under `fin.System`)
6461
+ *
6462
+ * @packageDocumentation
6463
+ */
6464
+ Object.defineProperty(system$1, "__esModule", { value: true });
6465
+ system$1.System = void 0;
6466
+ const base_1$j = base$1;
6746
6467
  const transport_errors_1$2 = transportErrors;
6747
6468
  const window_1 = requireWindow();
6748
- const events_1$6 = eventsExports;
6469
+ const events_1$6 = require$$0;
6749
6470
  /**
6750
6471
  * An object representing the core of OpenFin Runtime. Allows the developer
6751
6472
  * to perform system-level actions, such as accessing logs, viewing processes,
@@ -7696,24 +7417,77 @@ class System extends base_1$j.EmitterBase {
7696
7417
  * .catch(err => console.log(err));
7697
7418
  * ```
7698
7419
  *
7699
- * Example of permission definition to enable non-default protocols:
7420
+ * Example of permission definition to enable non-default protocols:
7421
+ *
7422
+ * Note: permission definition should be specified in an app manifest file if there is no DOS settings.
7423
+ * Otherwise it has to be specified in both DOS and app manifest files.
7424
+ *
7425
+ * ```js
7426
+ * "permissions": {
7427
+ * "System": {
7428
+ * "openUrlWithBrowser": {
7429
+ * "enabled": true,
7430
+ * "protocols": [ "msteams", "slack"]
7431
+ * }
7432
+ * }
7433
+ * }
7434
+ * ```
7435
+ */
7436
+ openUrlWithBrowser(url) {
7437
+ return this.wire.sendAction('open-url-with-browser', { url }).then(() => undefined);
7438
+ }
7439
+ /**
7440
+ * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
7441
+ * overwrites the existing registry entry if the given custom protocol name already exists.
7442
+ *
7443
+ * Note: This method is restricted by default and must be enabled via
7444
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
7445
+ *
7446
+ *
7447
+ * @remarks These protocols are reserved and cannot be registered:
7448
+ * - fin
7449
+ * - fins
7450
+ * - openfin
7451
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
7452
+ *
7453
+ * @throws if a given custom protocol failed to be registered.
7454
+ * @throws if a manifest URL contains the '%1' string.
7455
+ * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
7456
+ * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
7457
+ *
7458
+ * @example
7459
+ * ```js
7460
+ * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
7461
+ * ```
7462
+ */
7463
+ async registerCustomProtocol(options) {
7464
+ if (typeof options !== 'object') {
7465
+ throw new Error('Must provide an object with a `protocolName` property having a string value.');
7466
+ }
7467
+ await this.wire.sendAction('register-custom-protocol', options);
7468
+ }
7469
+ /**
7470
+ * Removes the registry entry for a given custom protocol.
7471
+ *
7472
+ * Note: This method is restricted by default and must be enabled via
7473
+ * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
7474
+ *
7475
+ *
7476
+ * @remarks These protocols are reserved and cannot be unregistered:
7477
+ * - fin
7478
+ * - fins
7479
+ * - openfin
7480
+ * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
7700
7481
  *
7701
- * Note: permission definition should be specified in an app manifest file if there is no DOS settings.
7702
- * Otherwise it has to be specified in both DOS and app manifest files.
7482
+ * @throws if a protocol entry failed to be removed in registry.
7703
7483
  *
7484
+ * @example
7704
7485
  * ```js
7705
- * "permissions": {
7706
- * "System": {
7707
- * "openUrlWithBrowser": {
7708
- * "enabled": true,
7709
- * "protocols": [ "msteams", "slack"]
7710
- * }
7711
- * }
7712
- * }
7486
+ * await fin.System.unregisterCustomProtocol('protocol1');
7713
7487
  * ```
7714
7488
  */
7715
- openUrlWithBrowser(url) {
7716
- return this.wire.sendAction('open-url-with-browser', { url }).then(() => undefined);
7489
+ async unregisterCustomProtocol(protocolName) {
7490
+ await this.wire.sendAction('unregister-custom-protocol', { protocolName });
7717
7491
  }
7718
7492
  /**
7719
7493
  * Removes the process entry for the passed UUID obtained from a prior call
@@ -7747,7 +7521,8 @@ class System extends base_1$j.EmitterBase {
7747
7521
  }
7748
7522
  /**
7749
7523
  * Attempt to close an external process. The process will be terminated if it
7750
- * has not closed after the elapsed timeout in milliseconds.<br>
7524
+ * has not closed after the elapsed timeout in milliseconds.
7525
+ *
7751
7526
  * Note: This method is restricted by default and must be enabled via
7752
7527
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
7753
7528
  * @param options A object defined in the TerminateExternalRequestType interface
@@ -7783,7 +7558,8 @@ class System extends base_1$j.EmitterBase {
7783
7558
  return this.wire.sendAction('update-proxy', options).then(() => undefined);
7784
7559
  }
7785
7560
  /**
7786
- * Downloads the given application asset<br>
7561
+ * Downloads the given application asset.
7562
+ *
7787
7563
  * Note: This method is restricted by default and must be enabled via
7788
7564
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
7789
7565
  * @param appAsset App asset object
@@ -8586,7 +8362,7 @@ class System extends base_1$j.EmitterBase {
8586
8362
  await this.wire.sendAction('set-domain-settings', { domainSettings, ...this.identity });
8587
8363
  }
8588
8364
  }
8589
- system.System = System;
8365
+ system$1.System = System;
8590
8366
 
8591
8367
  var interappbus = {};
8592
8368
 
@@ -8677,7 +8453,7 @@ class ChannelBase {
8677
8453
  try {
8678
8454
  const mainAction = this.subscriptions.has(topic)
8679
8455
  ? this.subscriptions.get(topic)
8680
- : (currentPayload, id) => { var _a; return ((_a = this.defaultAction) !== null && _a !== void 0 ? _a : ChannelBase.defaultAction)(topic, currentPayload, id); };
8456
+ : (currentPayload, id) => (this.defaultAction ?? ChannelBase.defaultAction)(topic, currentPayload, id);
8681
8457
  const preActionProcessed = this.preAction ? await this.preAction(topic, payload, senderIdentity) : payload;
8682
8458
  const actionProcessed = await mainAction(preActionProcessed, senderIdentity);
8683
8459
  return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
@@ -9006,17 +8782,17 @@ const channelClientsByEndpointId = new Map();
9006
8782
  * provider via {@link ChannelClient#dispatch dispatch} and to listen for communication
9007
8783
  * from the provider by registering an action via {@link ChannelClient#register register}.
9008
8784
  *
9009
- * Synchronous Methods:
8785
+ * ### Synchronous Methods:
9010
8786
  * * {@link ChannelClient#onDisconnection onDisconnection(listener)}
9011
8787
  * * {@link ChannelClient#register register(action, listener)}
9012
8788
  * * {@link ChannelClient#remove remove(action)}
9013
8789
  *
9014
- * Asynchronous Methods:
8790
+ * ### Asynchronous Methods:
9015
8791
  * * {@link ChannelClient#disconnect disconnect()}
9016
8792
  * * {@link ChannelClient#dispatch dispatch(action, payload)}
9017
8793
  *
9018
- * Middleware:
9019
- * <br>Middleware functions receive the following arguments: (action, payload, senderId).
8794
+ * ### Middleware:
8795
+ * Middleware functions receive the following arguments: (action, payload, senderId).
9020
8796
  * The return value of the middleware function will be passed on as the payload from beforeAction, to the action listener, to afterAction
9021
8797
  * unless it is undefined, in which case the original payload is used. Middleware can be used for side effects.
9022
8798
  * * {@link ChannelClient#setDefaultAction setDefaultAction(middleware)}
@@ -9210,7 +8986,6 @@ class ClassicStrategy {
9210
8986
  // connection problems occur
9211
8987
  _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
9212
8988
  this.send = async (endpointId, action, payload) => {
9213
- var _a;
9214
8989
  const to = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
9215
8990
  if (!to) {
9216
8991
  throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
@@ -9230,13 +9005,12 @@ class ClassicStrategy {
9230
9005
  action,
9231
9006
  payload
9232
9007
  });
9233
- (_a = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)) === null || _a === void 0 ? void 0 : _a.add(p);
9008
+ __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
9234
9009
  const raw = await p.catch((error) => {
9235
9010
  throw new Error(error.message);
9236
9011
  }).finally(() => {
9237
- var _a;
9238
9012
  // clean up the pending promise
9239
- (_a = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)) === null || _a === void 0 ? void 0 : _a.delete(p);
9013
+ __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
9240
9014
  });
9241
9015
  return raw.payload.data.result;
9242
9016
  };
@@ -9257,8 +9031,8 @@ class ClassicStrategy {
9257
9031
  const id = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
9258
9032
  __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
9259
9033
  const pendingSet = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
9260
- pendingSet === null || pendingSet === void 0 ? void 0 : pendingSet.forEach((p) => {
9261
- const errorMsg = `Channel connection with identity uuid: ${id === null || id === void 0 ? void 0 : id.uuid} / name: ${id === null || id === void 0 ? void 0 : id.name} / endpointId: ${endpointId} no longer connected.`;
9034
+ pendingSet?.forEach((p) => {
9035
+ const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
9262
9036
  p.cancel(new Error(errorMsg));
9263
9037
  });
9264
9038
  }
@@ -9270,9 +9044,8 @@ class ClassicStrategy {
9270
9044
  __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
9271
9045
  }
9272
9046
  isValidEndpointPayload(payload) {
9273
- var _a, _b;
9274
- return (typeof ((_a = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _a === void 0 ? void 0 : _a.endpointId) === 'string' ||
9275
- typeof ((_b = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _b === void 0 ? void 0 : _b.channelId) === 'string');
9047
+ return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
9048
+ typeof payload?.endpointIdentity?.channelId === 'string');
9276
9049
  }
9277
9050
  }
9278
9051
  strategy$2.ClassicStrategy = ClassicStrategy;
@@ -9349,13 +9122,12 @@ class RTCEndpoint {
9349
9122
  this.rtc.rtcClient.close();
9350
9123
  };
9351
9124
  this.rtc.channels.response.addEventListener('message', (e) => {
9352
- var _a;
9353
9125
  let { data } = e;
9354
9126
  if (e.data instanceof ArrayBuffer) {
9355
9127
  data = new TextDecoder().decode(e.data);
9356
9128
  }
9357
9129
  const { messageId, payload, success, error } = JSON.parse(data);
9358
- const { resolve, reject } = (_a = this.responseMap.get(messageId)) !== null && _a !== void 0 ? _a : {};
9130
+ const { resolve, reject } = this.responseMap.get(messageId) ?? {};
9359
9131
  if (resolve && reject) {
9360
9132
  this.responseMap.delete(messageId);
9361
9133
  if (success) {
@@ -9528,7 +9300,7 @@ var iceManager = {};
9528
9300
 
9529
9301
  Object.defineProperty(iceManager, "__esModule", { value: true });
9530
9302
  iceManager.RTCICEManager = void 0;
9531
- const base_1$i = base;
9303
+ const base_1$i = base$1;
9532
9304
  /*
9533
9305
  Singleton that facilitates Offer and Answer exchange required for establishing RTC connections.
9534
9306
  */
@@ -9604,9 +9376,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
9604
9376
  const rtcConnectionId = Math.random().toString();
9605
9377
  const rtcClient = this.createRtcPeer();
9606
9378
  rtcClient.addEventListener('icecandidate', async (e) => {
9607
- var _a;
9608
9379
  if (e.candidate) {
9609
- await this.raiseClientIce(rtcConnectionId, { candidate: (_a = e.candidate) === null || _a === void 0 ? void 0 : _a.toJSON() });
9380
+ await this.raiseClientIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
9610
9381
  }
9611
9382
  });
9612
9383
  await this.listenForProviderIce(rtcConnectionId, async (payload) => {
@@ -9631,9 +9402,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
9631
9402
  const requestChannelPromise = RTCICEManager.createDataChannelPromise('request', rtcClient);
9632
9403
  const responseChannelPromise = RTCICEManager.createDataChannelPromise('response', rtcClient);
9633
9404
  rtcClient.addEventListener('icecandidate', async (e) => {
9634
- var _a;
9635
9405
  if (e.candidate) {
9636
- await this.raiseProviderIce(rtcConnectionId, { candidate: (_a = e.candidate) === null || _a === void 0 ? void 0 : _a.toJSON() });
9406
+ await this.raiseProviderIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
9637
9407
  }
9638
9408
  });
9639
9409
  await this.listenForClientIce(rtcConnectionId, async (payload) => {
@@ -9706,20 +9476,20 @@ const runtimeVersioning_1 = runtimeVersioning;
9706
9476
  * a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
9707
9477
  * and to listen for communication from clients by registering an action via {@link ChannelProvider#register register}.
9708
9478
  *
9709
- * Synchronous Methods:
9479
+ * ### Synchronous Methods:
9710
9480
  * * {@link ChannelProvider#onConnection onConnection(listener)}
9711
9481
  * * {@link ChannelProvider#onDisconnection onDisconnection(listener)}
9712
9482
  * * {@link ChannelProvider#publish publish(action, payload)}
9713
9483
  * * {@link ChannelProvider#register register(action, listener)}
9714
9484
  * * {@link ChannelProvider#remove remove(action)}
9715
9485
  *
9716
- * Asynchronous Methods:
9486
+ * ### Asynchronous Methods:
9717
9487
  * * {@link ChannelProvider#destroy destroy()}
9718
9488
  * * {@link ChannelProvider#dispatch dispatch(to, action, payload)}
9719
9489
  * * {@link ChannelProvider#getAllClientInfo getAllClientInfo()}
9720
9490
  *
9721
- * Middleware:
9722
- * <br>Middleware functions receive the following arguments: (action, payload, senderId).
9491
+ * ### Middleware:
9492
+ * Middleware functions receive the following arguments: (action, payload, senderId).
9723
9493
  * The return value of the middleware function will be passed on as the payload from beforeAction, to the action listener, to afterAction
9724
9494
  * unless it is undefined, in which case the most recently defined payload is used. Middleware can be used for side effects.
9725
9495
  * * {@link ChannelProvider#setDefaultAction setDefaultAction(middleware)}
@@ -9815,8 +9585,7 @@ class ChannelProvider extends channel_1.ChannelBase {
9815
9585
  * ```
9816
9586
  */
9817
9587
  dispatch(to, action, payload) {
9818
- var _a;
9819
- const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
9588
+ const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
9820
9589
  if (endpointId && __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
9821
9590
  return __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
9822
9591
  }
@@ -9992,13 +9761,12 @@ class ChannelProvider extends channel_1.ChannelBase {
9992
9761
  }
9993
9762
  }
9994
9763
  getEndpointIdForOpenFinId(clientIdentity, action) {
9995
- var _a;
9996
9764
  const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
9997
9765
  if (matchingConnections.length >= 2) {
9998
9766
  const protectedObj = __classPrivateFieldGet$9(this, _ChannelProvider_protectedObj, "f");
9999
9767
  const { uuid, name } = clientIdentity;
10000
- const providerUuid = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.uuid;
10001
- const providerName = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.name;
9768
+ const providerUuid = protectedObj?.providerIdentity.uuid;
9769
+ const providerName = protectedObj?.providerIdentity.name;
10002
9770
  // eslint-disable-next-line no-console
10003
9771
  console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the
10004
9772
  "endpointId" parameter. The identity you are dispatching to ({uuid: ${uuid}, name: ${name}})
@@ -10006,7 +9774,7 @@ class ChannelProvider extends channel_1.ChannelBase {
10006
9774
  ({uuid: ${providerUuid}, name: ${providerName}}) will only be processed by the most recently-created client.`);
10007
9775
  }
10008
9776
  // Pop to return the most recently created endpointId.
10009
- return (_a = matchingConnections.pop()) === null || _a === void 0 ? void 0 : _a.endpointId;
9777
+ return matchingConnections.pop()?.endpointId;
10010
9778
  }
10011
9779
  // eslint-disable-next-line class-methods-use-this
10012
9780
  static clientIdentityIncludesEndpointId(subscriptionIdentity) {
@@ -10023,12 +9791,12 @@ _ChannelProvider_connections = new WeakMap(), _ChannelProvider_protectedObj = ne
10023
9791
  // static #removalMap = new WeakMap<ChannelProvider, Function>();
10024
9792
  ChannelProvider.removalMap = new WeakMap();
10025
9793
 
10026
- var messageReceiver = {};
9794
+ var messageReceiver$1 = {};
10027
9795
 
10028
- Object.defineProperty(messageReceiver, "__esModule", { value: true });
10029
- messageReceiver.MessageReceiver = void 0;
9796
+ Object.defineProperty(messageReceiver$1, "__esModule", { value: true });
9797
+ messageReceiver$1.MessageReceiver = void 0;
10030
9798
  const client_1$1 = client;
10031
- const base_1$h = base;
9799
+ const base_1$h = base$1;
10032
9800
  /*
10033
9801
  This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
10034
9802
  It needs to be a singleton because there can only be one per wire. It tracks both clients and providers' processAction passed in via the strategy.
@@ -10049,9 +9817,10 @@ class MessageReceiver extends base_1$h.Base {
10049
9817
  wire.registerMessageHandler(this.onmessage.bind(this));
10050
9818
  }
10051
9819
  async processChannelMessage(msg) {
10052
- var _a, _b;
10053
9820
  const { senderIdentity, providerIdentity, action, ackToSender, payload, intendedTargetIdentity } = msg.payload;
10054
- const key = (_b = (_a = intendedTargetIdentity.channelId) !== null && _a !== void 0 ? _a : intendedTargetIdentity.endpointId) !== null && _b !== void 0 ? _b : this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
9821
+ const key = intendedTargetIdentity.channelId ?? // The recipient is a provider
9822
+ intendedTargetIdentity.endpointId ?? // The recipient is a client
9823
+ this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
10055
9824
  const handler = this.endpointMap.get(key);
10056
9825
  if (!handler) {
10057
9826
  ackToSender.payload.success = false;
@@ -10096,7 +9865,7 @@ class MessageReceiver extends base_1$h.Base {
10096
9865
  }
10097
9866
  }
10098
9867
  }
10099
- messageReceiver.MessageReceiver = MessageReceiver;
9868
+ messageReceiver$1.MessageReceiver = MessageReceiver;
10100
9869
 
10101
9870
  var protocolManager = {};
10102
9871
 
@@ -10131,12 +9900,9 @@ class ProtocolManager {
10131
9900
  return supported;
10132
9901
  };
10133
9902
  this.getCompatibleProtocols = (providerProtocols, clientOffer) => {
10134
- const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => {
10135
- var _a;
10136
- return providerProtocol.type === clientProtocol.type &&
10137
- clientProtocol.version >= providerProtocol.minimumVersion &&
10138
- providerProtocol.version >= ((_a = clientProtocol.minimumVersion) !== null && _a !== void 0 ? _a : 0);
10139
- }));
9903
+ const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => providerProtocol.type === clientProtocol.type &&
9904
+ clientProtocol.version >= providerProtocol.minimumVersion &&
9905
+ providerProtocol.version >= (clientProtocol.minimumVersion ?? 0)));
10140
9906
  return supported.slice(0, clientOffer.maxProtocols);
10141
9907
  };
10142
9908
  }
@@ -10218,12 +9984,12 @@ var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
10218
9984
  Object.defineProperty(connectionManager, "__esModule", { value: true });
10219
9985
  connectionManager.ConnectionManager = void 0;
10220
9986
  const exhaustive_1 = exhaustive;
10221
- const base_1$g = base;
9987
+ const base_1$g = base$1;
10222
9988
  const strategy_1 = strategy$2;
10223
9989
  const strategy_2 = strategy$1;
10224
9990
  const ice_manager_1 = iceManager;
10225
9991
  const provider_1$1 = provider;
10226
- const message_receiver_1 = messageReceiver;
9992
+ const message_receiver_1 = messageReceiver$1;
10227
9993
  const protocol_manager_1 = protocolManager;
10228
9994
  const strategy_3 = strategy;
10229
9995
  class ConnectionManager extends base_1$g.Base {
@@ -10261,7 +10027,7 @@ class ConnectionManager extends base_1$g.Base {
10261
10027
  }
10262
10028
  createProvider(options, providerIdentity) {
10263
10029
  const opts = Object.assign(this.wire.environment.getDefaultChannelOptions().create, options || {});
10264
- const protocols = this.protocolManager.getProviderProtocols(opts === null || opts === void 0 ? void 0 : opts.protocols);
10030
+ const protocols = this.protocolManager.getProviderProtocols(opts?.protocols);
10265
10031
  const createSingleStrategy = (stratType) => {
10266
10032
  switch (stratType) {
10267
10033
  case 'rtc':
@@ -10298,7 +10064,7 @@ class ConnectionManager extends base_1$g.Base {
10298
10064
  return channel;
10299
10065
  }
10300
10066
  async createClientOffer(options) {
10301
- const protocols = this.protocolManager.getClientProtocols(options === null || options === void 0 ? void 0 : options.protocols);
10067
+ const protocols = this.protocolManager.getClientProtocols(options?.protocols);
10302
10068
  let rtcPacket;
10303
10069
  const supportedProtocols = await Promise.all(protocols.map(async (type) => {
10304
10070
  switch (type) {
@@ -10326,14 +10092,13 @@ class ConnectionManager extends base_1$g.Base {
10326
10092
  };
10327
10093
  }
10328
10094
  async createClientStrategy(rtcPacket, routingInfo) {
10329
- var _a;
10330
10095
  if (!routingInfo.endpointId) {
10331
10096
  routingInfo.endpointId = this.wire.environment.getNextMessageId();
10332
10097
  // For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
10333
10098
  // clients that are in the same context as the newly-connected client.
10334
10099
  __classPrivateFieldGet$8(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
10335
10100
  }
10336
- const answer = (_a = routingInfo.answer) !== null && _a !== void 0 ? _a : {
10101
+ const answer = routingInfo.answer ?? {
10337
10102
  supportedProtocols: [{ type: 'classic', version: 1 }]
10338
10103
  };
10339
10104
  const createStrategyFromAnswer = async (protocol) => {
@@ -10391,7 +10156,7 @@ class ConnectionManager extends base_1$g.Base {
10391
10156
  if (!(provider instanceof provider_1$1.ChannelProvider)) {
10392
10157
  throw Error('Cannot connect to a channel client');
10393
10158
  }
10394
- const offer = clientOffer !== null && clientOffer !== void 0 ? clientOffer : {
10159
+ const offer = clientOffer ?? {
10395
10160
  supportedProtocols: [{ type: 'classic', version: 1 }],
10396
10161
  maxProtocols: 1
10397
10162
  };
@@ -10449,6 +10214,15 @@ class ConnectionManager extends base_1$g.Base {
10449
10214
  connectionManager.ConnectionManager = ConnectionManager;
10450
10215
  _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnectionManager = new WeakMap();
10451
10216
 
10217
+ /**
10218
+ * Entry points for the `Channel` subset of the `InterApplicationBus` API (`fin.InterApplicationBus.Channel`).
10219
+ *
10220
+ * * {@link Channel} contains static members of the `Channel` API, accessible through `fin.InterApplicationBus.Channel`.
10221
+ * * {@link OpenFin.ChannelClient} describes a client of a channel, e.g. as returned by `fin.InterApplicationBus.Channel.connect`.
10222
+ * * {@link OpenFin.ChannelProvider} describes a provider of a channel, e.g. as returned by `fin.InterApplicationBus.Channel.create`.
10223
+ *
10224
+ * @packageDocumentation
10225
+ */
10452
10226
  var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10453
10227
  if (kind === "m") throw new TypeError("Private method is not writable");
10454
10228
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -10464,9 +10238,9 @@ var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyToConnec
10464
10238
  Object.defineProperty(channel$1, "__esModule", { value: true });
10465
10239
  channel$1.Channel = void 0;
10466
10240
  /* eslint-disable no-console */
10467
- const events_1$5 = eventsExports;
10241
+ const events_1$5 = require$$0;
10468
10242
  const lazy_1$1 = lazy;
10469
- const base_1$f = base;
10243
+ const base_1$f = base$1;
10470
10244
  const client_1 = client;
10471
10245
  const connection_manager_1 = connectionManager;
10472
10246
  const provider_1 = provider;
@@ -10784,8 +10558,15 @@ _Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakM
10784
10558
 
10785
10559
  Object.defineProperty(interappbus, "__esModule", { value: true });
10786
10560
  interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
10787
- const events_1$4 = eventsExports;
10788
- const base_1$e = base;
10561
+ /**
10562
+ * Entry point for the OpenFin `InterApplicationBus` API (`fin.InterApplicationBus`).
10563
+ *
10564
+ * * {@link InterApplicationBus} contains static members of the `InterApplicationBus` API, accessible through `fin.InterApplicationBus`.
10565
+ *
10566
+ * @packageDocumentation
10567
+ */
10568
+ const events_1$4 = require$$0;
10569
+ const base_1$e = base$1;
10789
10570
  const ref_counter_1 = refCounter;
10790
10571
  const index_1$2 = channel$1;
10791
10572
  const validate_1$3 = validate;
@@ -10992,9 +10773,16 @@ function createKey(...toHash) {
10992
10773
 
10993
10774
  var clipboard = {};
10994
10775
 
10776
+ /**
10777
+ * Entry point for the OpenFin `Clipboard` API (`fin.Clipboard`).
10778
+ *
10779
+ * * {@link Clipboard} contains static members of the `Clipboard` API, accessible through `fin.Clipboard`.
10780
+ *
10781
+ * @packageDocumentation
10782
+ */
10995
10783
  Object.defineProperty(clipboard, "__esModule", { value: true });
10996
10784
  clipboard.Clipboard = void 0;
10997
- const base_1$d = base;
10785
+ const base_1$d = base$1;
10998
10786
  /**
10999
10787
  * @PORTED
11000
10788
  * WriteRequestType interface
@@ -11193,7 +10981,7 @@ class Clipboard extends base_1$d.Base {
11193
10981
  }
11194
10982
  clipboard.Clipboard = Clipboard;
11195
10983
 
11196
- var externalApplication = {};
10984
+ var externalApplication$1 = {};
11197
10985
 
11198
10986
  var Factory$5 = {};
11199
10987
 
@@ -11202,11 +10990,11 @@ var Instance$4 = {};
11202
10990
  Object.defineProperty(Instance$4, "__esModule", { value: true });
11203
10991
  Instance$4.ExternalApplication = void 0;
11204
10992
  /* eslint-disable import/prefer-default-export */
11205
- const base_1$c = base;
10993
+ const base_1$c = base$1;
11206
10994
  /**
11207
10995
  * An ExternalApplication object representing native language adapter connections to the runtime. Allows
11208
10996
  * the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
11209
- * Discovery of connections is provided by <a href="tutorial-System.getAllExternalApplications.html">getAllExternalApplications.</a>
10997
+ * Discovery of connections is provided by {@link System.System.getAllExternalApplications getAllExternalApplications}.</a>
11210
10998
  *
11211
10999
  * Processes that can be wrapped as `ExternalApplication`s include the following:
11212
11000
  * - Processes which have connected to an OpenFin runtime via an adapter
@@ -11318,8 +11106,11 @@ Instance$4.ExternalApplication = ExternalApplication;
11318
11106
 
11319
11107
  Object.defineProperty(Factory$5, "__esModule", { value: true });
11320
11108
  Factory$5.ExternalApplicationModule = void 0;
11321
- const base_1$b = base;
11109
+ const base_1$b = base$1;
11322
11110
  const Instance_1$4 = Instance$4;
11111
+ /**
11112
+ * Static namespace for OpenFin API methods that interact with the {@link ExternalApplication} class, available under `fin.ExternalApplication`.
11113
+ */
11323
11114
  class ExternalApplicationModule extends base_1$b.Base {
11324
11115
  /**
11325
11116
  * Asynchronously returns an External Application object that represents an external application.
@@ -11379,9 +11170,9 @@ Factory$5.ExternalApplicationModule = ExternalApplicationModule;
11379
11170
  };
11380
11171
  Object.defineProperty(exports, "__esModule", { value: true });
11381
11172
  /**
11382
- * Entry points for the OpenFin `ExternalApplication` API.
11173
+ * Entry points for the OpenFin `ExternalApplication` API (`fin.ExternalApplication`).
11383
11174
  *
11384
- * * {@link ExternalApplicationModule} contains static methods relating to the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
11175
+ * * {@link ExternalApplicationModule} contains static members of the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
11385
11176
  * * {@link ExternalApplication} describes an instance of an OpenFin ExternalApplication, e.g. as returned by `fin.ExternalApplication.getCurrent`.
11386
11177
  *
11387
11178
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -11390,10 +11181,10 @@ Factory$5.ExternalApplicationModule = ExternalApplicationModule;
11390
11181
  * @packageDocumentation
11391
11182
  */
11392
11183
  __exportStar(Factory$5, exports);
11393
- __exportStar(Instance$4, exports);
11394
- } (externalApplication));
11184
+ __exportStar(Instance$4, exports);
11185
+ } (externalApplication$1));
11395
11186
 
11396
- var frame = {};
11187
+ var frame$1 = {};
11397
11188
 
11398
11189
  var Factory$4 = {};
11399
11190
 
@@ -11402,7 +11193,7 @@ var Instance$3 = {};
11402
11193
  Object.defineProperty(Instance$3, "__esModule", { value: true });
11403
11194
  Instance$3._Frame = void 0;
11404
11195
  /* eslint-disable import/prefer-default-export */
11405
- const base_1$a = base;
11196
+ const base_1$a = base$1;
11406
11197
  /**
11407
11198
  * An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
11408
11199
  * has its own DOM and global JS context (which may or may not be linked to that of the parent depending
@@ -11544,9 +11335,12 @@ Instance$3._Frame = _Frame;
11544
11335
 
11545
11336
  Object.defineProperty(Factory$4, "__esModule", { value: true });
11546
11337
  Factory$4._FrameModule = void 0;
11547
- const base_1$9 = base;
11338
+ const base_1$9 = base$1;
11548
11339
  const validate_1$2 = validate;
11549
11340
  const Instance_1$3 = Instance$3;
11341
+ /**
11342
+ * Static namespace for OpenFin API methods that interact with the {@link _Frame} class, available under `fin.Frame`.
11343
+ */
11550
11344
  class _FrameModule extends base_1$9.Base {
11551
11345
  /**
11552
11346
  * Asynchronously returns a reference to the specified frame. The frame does not have to exist
@@ -11627,12 +11421,12 @@ Factory$4._FrameModule = _FrameModule;
11627
11421
 
11628
11422
  (function (exports) {
11629
11423
  /**
11630
- * Entry points for the OpenFin `Frame` API.
11424
+ * Entry points for the OpenFin `Frame` API (`fin.Frame`).
11631
11425
  *
11632
- * * {@link _FrameModule} contains static methods relating to the `Frame` type, accessible through `fin.Frame`.
11426
+ * * {@link _FrameModule} contains static members of the `Frame` API, accessible through `fin.Frame`.
11633
11427
  * * {@link _Frame} describes an instance of an OpenFin Frame, e.g. as returned by `fin.Frame.getCurrent`.
11634
11428
  *
11635
- * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
11429
+ * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
11636
11430
  * both of these were documented on the same page.
11637
11431
  *
11638
11432
  * Underscore prefixing of OpenFin types that alias DOM entities will be fixed in a future version.
@@ -11655,14 +11449,14 @@ Factory$4._FrameModule = _FrameModule;
11655
11449
  };
11656
11450
  Object.defineProperty(exports, "__esModule", { value: true });
11657
11451
  __exportStar(Factory$4, exports);
11658
- __exportStar(Instance$3, exports);
11659
- } (frame));
11452
+ __exportStar(Instance$3, exports);
11453
+ } (frame$1));
11660
11454
 
11661
- var globalHotkey = {};
11455
+ var globalHotkey$1 = {};
11662
11456
 
11663
- Object.defineProperty(globalHotkey, "__esModule", { value: true });
11664
- globalHotkey.GlobalHotkey = void 0;
11665
- const base_1$8 = base;
11457
+ Object.defineProperty(globalHotkey$1, "__esModule", { value: true });
11458
+ globalHotkey$1.GlobalHotkey = void 0;
11459
+ const base_1$8 = base$1;
11666
11460
  /**
11667
11461
  * The GlobalHotkey module can register/unregister a global hotkeys.
11668
11462
  *
@@ -11678,6 +11472,8 @@ class GlobalHotkey extends base_1$8.EmitterBase {
11678
11472
  * Registers a global hotkey with the operating system.
11679
11473
  * @param hotkey a hotkey string
11680
11474
  * @param listener called when the registered hotkey is pressed by the user.
11475
+ * @throws If the `hotkey` is reserved, see list below.
11476
+ * @throws if the `hotkey` is already registered by another application.
11681
11477
  *
11682
11478
  * @remarks The `hotkey` parameter expects an electron compatible [accelerator](https://github.com/electron/electron/blob/master/docs/api/accelerator.md) and the `listener` will be called if the `hotkey` is pressed by the user.
11683
11479
  * If successfull, the hotkey will be 'claimed' by the application, meaning that this register call can be called multiple times from within the same application but will fail if another application has registered the hotkey.
@@ -11770,7 +11566,7 @@ class GlobalHotkey extends base_1$8.EmitterBase {
11770
11566
  return undefined;
11771
11567
  }
11772
11568
  /**
11773
- * Checks if a given hotkey has been registered
11569
+ * Checks if a given hotkey has been registered by an application within the current runtime.
11774
11570
  * @param hotkey a hotkey string
11775
11571
  *
11776
11572
  * @example
@@ -11791,9 +11587,9 @@ class GlobalHotkey extends base_1$8.EmitterBase {
11791
11587
  return data;
11792
11588
  }
11793
11589
  }
11794
- globalHotkey.GlobalHotkey = GlobalHotkey;
11590
+ globalHotkey$1.GlobalHotkey = GlobalHotkey;
11795
11591
 
11796
- var platform = {};
11592
+ var platform$1 = {};
11797
11593
 
11798
11594
  var Factory$3 = {};
11799
11595
 
@@ -11808,16 +11604,14 @@ var _Platform_connectToProvider;
11808
11604
  Object.defineProperty(Instance$2, "__esModule", { value: true });
11809
11605
  Instance$2.Platform = void 0;
11810
11606
  /* eslint-disable import/prefer-default-export, no-undef */
11811
- const base_1$7 = base;
11607
+ const base_1$7 = base$1;
11812
11608
  const validate_1$1 = validate;
11813
11609
  // Reuse clients to avoid overwriting already-registered client in provider
11814
11610
  const clientMap = new Map();
11815
11611
  /** Manages the life cycle of windows and views in the application.
11816
11612
  *
11817
- * Enables taking snapshots of itself and applyi
11818
- * ng them to restore a previous configuration
11613
+ * Enables taking snapshots of itself and applying them to restore a previous configuration
11819
11614
  * as well as listen to {@link OpenFin.PlatformEvents platform events}.
11820
- *
11821
11615
  */
11822
11616
  class Platform extends base_1$7.EmitterBase {
11823
11617
  /**
@@ -12176,15 +11970,13 @@ class Platform extends base_1$7.EmitterBase {
12176
11970
  });
12177
11971
  }
12178
11972
  /**
12179
- * ***DEPRECATED - please use Platform.createView.***
11973
+ * ***DEPRECATED - please use {@link Platform.createView Platform.createView}.***
12180
11974
  * Reparents a specified view in a new target window.
12181
11975
  * @param viewIdentity View identity
12182
11976
  * @param target new owner window identity
12183
11977
  *
12184
- * @tutorial Platform.createView
12185
11978
  */
12186
11979
  async reparentView(viewIdentity, target) {
12187
- var _a;
12188
11980
  // eslint-disable-next-line no-console
12189
11981
  console.warn('Platform.reparentView has been deprecated, please use Platform.createView');
12190
11982
  this.wire.sendAction('platform-reparent-view', this.identity).catch((e) => {
@@ -12192,7 +11984,7 @@ class Platform extends base_1$7.EmitterBase {
12192
11984
  });
12193
11985
  const normalizedViewIdentity = {
12194
11986
  ...viewIdentity,
12195
- uuid: (_a = viewIdentity.uuid) !== null && _a !== void 0 ? _a : this.identity.uuid
11987
+ uuid: viewIdentity.uuid ?? this.identity.uuid
12196
11988
  };
12197
11989
  const view = await this.fin.View.wrap(normalizedViewIdentity);
12198
11990
  const viewOptions = await view.getOptions();
@@ -12671,10 +12463,142 @@ Object.defineProperty(Instance$1, "__esModule", { value: true });
12671
12463
  Instance$1.Layout = void 0;
12672
12464
  const lazy_1 = lazy;
12673
12465
  const validate_1 = validate;
12674
- const base_1$6 = base;
12466
+ const base_1$6 = base$1;
12675
12467
  const common_utils_1 = commonUtils;
12676
12468
  const layout_entities_1 = layoutEntities;
12677
12469
  const layout_constants_1 = layout_constants;
12470
+ /**
12471
+ *
12472
+ * Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
12473
+ * enables the initialization and manipulation of a window's Layout. A Layout will
12474
+ * emit events locally on the DOM element representing the layout-container.
12475
+ *
12476
+ *
12477
+ * ### Layout.DOMEvents
12478
+ *
12479
+ * When a Layout is created, it emits events onto the DOM element representing the Layout container.
12480
+ * This Layout container is the DOM element referenced by containerId in {@link Layout.LayoutModule#init Layout.init}.
12481
+ * You can use the built-in event emitter to listen to these events using [addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).
12482
+ * The events are emitted synchronously and only in the process where the Layout exists.
12483
+ * Any values returned by the called listeners are ignored and will be discarded.
12484
+ * If the target DOM element is destroyed, any events that have been set up on that element will be destroyed.
12485
+ *
12486
+ * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
12487
+ *
12488
+ * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
12489
+ * Adds a listener to the end of the listeners array for the specified event.
12490
+ * @example
12491
+ * ```js
12492
+ * const myLayoutContainer = document.getElementById('layout-container');
12493
+ *
12494
+ * myLayoutContainer.addEventListener('tab-created', function(event) {
12495
+ * const { tabSelector } = event.detail;
12496
+ * const tabElement = document.getElementById(tabSelector);
12497
+ * const existingColor = tabElement.style.backgroundColor;
12498
+ * tabElement.style.backgroundColor = "red";
12499
+ * setTimeout(() => {
12500
+ * tabElement.style.backgroundColor = existingColor;
12501
+ * }, 2000);
12502
+ * });
12503
+ * ```
12504
+ *
12505
+ * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
12506
+ * Adds a listener to the end of the listeners array for the specified event.
12507
+ * @example
12508
+ * ```js
12509
+ * const myLayoutContainer = document.getElementById('layout-container');
12510
+ *
12511
+ * const listener = function(event) {
12512
+ * console.log(event.detail);
12513
+ * console.log('container-created event fired once, removing listener');
12514
+ * myLayoutContainer.removeEventListener('container-created', listener);
12515
+ * };
12516
+ *
12517
+ * myLayoutContainer.addEventListener('container-created', listener);
12518
+ * ```
12519
+ *
12520
+ * ### Supported event types are:
12521
+ *
12522
+ * * tab-created
12523
+ * * container-created
12524
+ * * layout-state-changed
12525
+ * * tab-closed
12526
+ * * tab-dropped
12527
+ *
12528
+ * ### Layout DOM Node Events
12529
+ *
12530
+ * #### tab-created
12531
+ * Generated when a tab is created. As a user drags and drops tabs within window, new tabs are created. A single view may have multiple tabs created and destroyed during its lifetime attached to a single window.
12532
+ * ```js
12533
+ * // The response has the following shape in event.detail:
12534
+ * {
12535
+ * containerSelector: "container-component_A",
12536
+ * name: "component_A",
12537
+ * tabSelector: "tab-component_A",
12538
+ * topic: "openfin-DOM-event",
12539
+ * type: "tab-created",
12540
+ * uuid: "OpenFin POC"
12541
+ * }
12542
+ * ```
12543
+ *
12544
+ * #### container-created
12545
+ * Generated when a container is created. A single view will have only one container during its lifetime attached to a single window and the container's lifecycle is tied to the view. To discover when the container is destroyed, please listen to view-detached event.
12546
+ * ```js
12547
+ * // The response has the following shape in event.detail:
12548
+ * {
12549
+ * containerSelector: "container-component_A",
12550
+ * name: "component_A",
12551
+ * tabSelector: "tab-component_A",
12552
+ * topic: "openfin-DOM-event",
12553
+ * type: "container-created",
12554
+ * uuid: "OpenFin POC"
12555
+ * }
12556
+ * ```
12557
+ *
12558
+ * ### layout-state-changed
12559
+ * Generated when the state of the layout changes in any way, such as a view added/removed/replaced. Note that this event can fire frequently as the underlying layout can change multiple components from all kinds of changes (resizing for example). Given this, it is recommended to debounce this event and then you can use the {@link Layout#getConfig Layout.getConfig} API to retrieve the most up-to-date state.
12560
+ * ```js
12561
+ * // The response has the following shape in event.detail
12562
+ * {
12563
+ * containerSelector: "container-component_A",
12564
+ * name: "component_A",
12565
+ * tabSelector: "tab-component_A",
12566
+ * topic: "openfin-DOM-event",
12567
+ * type: "layout-state-changed",
12568
+ * uuid: "OpenFin POC"
12569
+ * }
12570
+ * ```
12571
+ *
12572
+ * #### tab-closed
12573
+ * Generated when a tab is closed.
12574
+ * ```js
12575
+ * // The response has the following shape in event.detail:
12576
+ * {
12577
+ * containerSelector: "container-component_A",
12578
+ * name: "component_A",
12579
+ * tabSelector: "tab-component_A",
12580
+ * topic: "openfin-DOM-event",
12581
+ * type: "tab-closed",
12582
+ * uuid: "OpenFin POC",
12583
+ * url: "http://openfin.co" // The url of the view that was closed.
12584
+ * }
12585
+ * ```
12586
+ *
12587
+ * #### tab-dropped
12588
+ * Generated when a tab is dropped.
12589
+ * ```js
12590
+ * // The response has the following shape in event.detail:
12591
+ * {
12592
+ * containerSelector: "container-component_A",
12593
+ * name: "component_A",
12594
+ * tabSelector: "tab-component_A",
12595
+ * topic: "openfin-DOM-event",
12596
+ * type: "tab-dropped",
12597
+ * uuid: "OpenFin POC",
12598
+ * url: "http://openfin.co" // The url of the view linked to the dropped tab.
12599
+ * }
12600
+ * ```
12601
+ */
12678
12602
  class Layout extends base_1$6.Base {
12679
12603
  /**
12680
12604
  * @internal
@@ -12848,10 +12772,30 @@ class Layout extends base_1$6.Base {
12848
12772
  // don't expose
12849
12773
  });
12850
12774
  const client = await this.platform.getClient();
12775
+ console.log(`Layout::toConfig() called!`);
12851
12776
  return client.dispatch('get-frame-snapshot', {
12852
12777
  target: this.identity
12853
12778
  });
12854
12779
  }
12780
+ /**
12781
+ * Retrieves the attached views in current window layout.
12782
+ *
12783
+ * @example
12784
+ * ```js
12785
+ * const layout = fin.Platform.Layout.getCurrentSync();
12786
+ * const views = await layout.getCurrentViews();
12787
+ * ```
12788
+ */
12789
+ async getCurrentViews() {
12790
+ this.wire.sendAction('layout-get-views').catch((e) => {
12791
+ // don't expose
12792
+ });
12793
+ const client = await this.platform.getClient();
12794
+ const viewIdentities = await client.dispatch('get-layout-views', {
12795
+ target: this.identity
12796
+ });
12797
+ return viewIdentities.map((identity) => this.fin.View.wrapSync(identity));
12798
+ }
12855
12799
  /**
12856
12800
  * Retrieves the top level content item of the layout.
12857
12801
  *
@@ -12878,7 +12822,7 @@ class Layout extends base_1$6.Base {
12878
12822
  // don't expose
12879
12823
  });
12880
12824
  const client = await __classPrivateFieldGet$5(this, _Layout_layoutClient, "f").getValue();
12881
- const root = await client.getRoot();
12825
+ const root = await client.getRoot(this.identity);
12882
12826
  return layout_entities_1.LayoutNode.getEntity(root, client);
12883
12827
  }
12884
12828
  }
@@ -12896,16 +12840,20 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
12896
12840
  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");
12897
12841
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12898
12842
  };
12899
- var _LayoutModule_layoutInitializationAttempted;
12843
+ var _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager;
12900
12844
  Object.defineProperty(Factory$2, "__esModule", { value: true });
12901
12845
  Factory$2.LayoutModule = void 0;
12902
12846
  /* eslint-disable no-undef, import/prefer-default-export */
12903
- const base_1$5 = base;
12847
+ const base_1$5 = base$1;
12904
12848
  const Instance_1$2 = Instance$1;
12849
+ /**
12850
+ * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
12851
+ */
12905
12852
  class LayoutModule extends base_1$5.Base {
12906
12853
  constructor() {
12907
12854
  super(...arguments);
12908
12855
  _LayoutModule_layoutInitializationAttempted.set(this, false);
12856
+ _LayoutModule_layoutManager.set(this, null);
12909
12857
  /**
12910
12858
  * Initialize the window's Layout.
12911
12859
  *
@@ -12955,7 +12903,17 @@ class LayoutModule extends base_1$5.Base {
12955
12903
  throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
12956
12904
  }
12957
12905
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12958
- return this.wire.environment.initLayout(this.fin, this.wire, options);
12906
+ // TODO: remove this.wire and always use this.fin
12907
+ __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayout(this.fin, this.wire, options), "f");
12908
+ // TODO: if create() wasn't called, warn!! aka, if lm.getLayouts().length === 0
12909
+ const layoutInstance = await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").resolveLayout();
12910
+ const layout = this.wrapSync(layoutInstance.identity);
12911
+ // Adding this to the returned instance undocumented/typed for Browser
12912
+ // TODO: if not overridden, then return layoutManager: layoutInstance
12913
+ return Object.assign(layout, { layoutManager: layoutInstance });
12914
+ };
12915
+ this.getCurrentLayoutManagerSync = () => {
12916
+ return __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f");
12959
12917
  };
12960
12918
  }
12961
12919
  /**
@@ -13053,13 +13011,13 @@ class LayoutModule extends base_1$5.Base {
13053
13011
  }
13054
13012
  }
13055
13013
  Factory$2.LayoutModule = LayoutModule;
13056
- _LayoutModule_layoutInitializationAttempted = new WeakMap();
13014
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap();
13057
13015
 
13058
13016
  (function (exports) {
13059
13017
  /**
13060
- * Entry point for the OpenFin `Layout` namespace.
13018
+ * Entry point for the OpenFin `Layout` subset of the `Platform` API (`fin.Platform.Layout`).
13061
13019
  *
13062
- * * {@link LayoutModule} contains static methods relating to the `Layout` type, accessible through `fin.Platform.Layout`.
13020
+ * * {@link LayoutModule} contains static members of the `Layout` API, accessible through `fin.Platform.Layout`.
13063
13021
  * * {@link Layout} describes an instance of an OpenFin Layout, e.g. as returned by `fin.Platform.Layout.getCurrent`.
13064
13022
  *
13065
13023
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -13067,131 +13025,6 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
13067
13025
  *
13068
13026
  * @packageDocumentation
13069
13027
  *
13070
- *
13071
- * ### Layout.DOMEvents
13072
- *
13073
- * When a Layout is created, it emits events onto the DOM element representing the Layout container.
13074
- * This Layout container is the DOM element referenced by containerId in {@link Layout.LayoutModule#init Layout.init}.
13075
- * You can use the built-in event emitter to listen to these events using [addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).
13076
- * The events are emitted synchronously and only in the process where the Layout exists.
13077
- * Any values returned by the called listeners are ignored and will be discarded.
13078
- * If the target DOM element is destroyed, any events that have been set up on that element will be destroyed.
13079
- *
13080
- * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
13081
- *
13082
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
13083
- * Adds a listener to the end of the listeners array for the specified event.
13084
- * @example
13085
- * ```js
13086
- * const myLayoutContainer = document.getElementById('layout-container');
13087
- *
13088
- * myLayoutContainer.addEventListener('tab-created', function(event) {
13089
- * const { tabSelector } = event.detail;
13090
- * const tabElement = document.getElementById(tabSelector);
13091
- * const existingColor = tabElement.style.backgroundColor;
13092
- * tabElement.style.backgroundColor = "red";
13093
- * setTimeout(() => {
13094
- * tabElement.style.backgroundColor = existingColor;
13095
- * }, 2000);
13096
- * });
13097
- * ```
13098
- *
13099
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
13100
- * Adds a listener to the end of the listeners array for the specified event.
13101
- * @example
13102
- * ```js
13103
- * const myLayoutContainer = document.getElementById('layout-container');
13104
- *
13105
- * const listener = function(event) {
13106
- * console.log(event.detail);
13107
- * console.log('container-created event fired once, removing listener');
13108
- * myLayoutContainer.removeEventListener('container-created', listener);
13109
- * };
13110
- *
13111
- * myLayoutContainer.addEventListener('container-created', listener);
13112
- * ```
13113
- *
13114
- * ### Supported event types are:
13115
- *
13116
- * * tab-created
13117
- * * container-created
13118
- * * layout-state-changed
13119
- * * tab-closed
13120
- * * tab-dropped
13121
- *
13122
- * ### Layout DOM Node Events
13123
- *
13124
- * #### tab-created
13125
- * Generated when a tab is created. As a user drags and drops tabs within window, new tabs are created. A single view may have multiple tabs created and destroyed during its lifetime attached to a single window.
13126
- * ```js
13127
- * // The response has the following shape in event.detail:
13128
- * {
13129
- * containerSelector: "container-component_A",
13130
- * name: "component_A",
13131
- * tabSelector: "tab-component_A",
13132
- * topic: "openfin-DOM-event",
13133
- * type: "tab-created",
13134
- * uuid: "OpenFin POC"
13135
- * }
13136
- * ```
13137
- *
13138
- * #### container-created
13139
- * Generated when a container is created. A single view will have only one container during its lifetime attached to a single window and the container's lifecycle is tied to the view. To discover when the container is destroyed, please listen to view-detached event.
13140
- * ```js
13141
- * // The response has the following shape in event.detail:
13142
- * {
13143
- * containerSelector: "container-component_A",
13144
- * name: "component_A",
13145
- * tabSelector: "tab-component_A",
13146
- * topic: "openfin-DOM-event",
13147
- * type: "container-created",
13148
- * uuid: "OpenFin POC"
13149
- * }
13150
- * ```
13151
- *
13152
- * ### layout-state-changed
13153
- * Generated when the state of the layout changes in any way, such as a view added/removed/replaced. Note that this event can fire frequently as the underlying layout can change multiple components from all kinds of changes (resizing for example). Given this, it is recommended to debounce this event and then you can use the {@link Layout#getConfig Layout.getConfig} API to retrieve the most up-to-date state.
13154
- * ```js
13155
- * // The response has the following shape in event.detail
13156
- * {
13157
- * containerSelector: "container-component_A",
13158
- * name: "component_A",
13159
- * tabSelector: "tab-component_A",
13160
- * topic: "openfin-DOM-event",
13161
- * type: "layout-state-changed",
13162
- * uuid: "OpenFin POC"
13163
- * }
13164
- * ```
13165
- *
13166
- * #### tab-closed
13167
- * Generated when a tab is closed.
13168
- * ```js
13169
- * // The response has the following shape in event.detail:
13170
- * {
13171
- * containerSelector: "container-component_A",
13172
- * name: "component_A",
13173
- * tabSelector: "tab-component_A",
13174
- * topic: "openfin-DOM-event",
13175
- * type: "tab-closed",
13176
- * uuid: "OpenFin POC",
13177
- * url: "http://openfin.co" // The url of the view that was closed.
13178
- * }
13179
- * ```
13180
- *
13181
- * #### tab-dropped
13182
- * Generated when a tab is dropped.
13183
- * ```js
13184
- * // The response has the following shape in event.detail:
13185
- * {
13186
- * containerSelector: "container-component_A",
13187
- * name: "component_A",
13188
- * tabSelector: "tab-component_A",
13189
- * topic: "openfin-DOM-event",
13190
- * type: "tab-dropped",
13191
- * uuid: "OpenFin POC",
13192
- * url: "http://openfin.co" // The url of the view linked to the dropped tab.
13193
- * }
13194
- * ```
13195
13028
  */
13196
13029
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13197
13030
  if (k2 === undefined) k2 = k;
@@ -13209,14 +13042,17 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
13209
13042
  };
13210
13043
  Object.defineProperty(exports, "__esModule", { value: true });
13211
13044
  __exportStar(Factory$2, exports);
13212
- __exportStar(Instance$1, exports);
13045
+ __exportStar(Instance$1, exports);
13213
13046
  } (layout));
13214
13047
 
13215
13048
  Object.defineProperty(Factory$3, "__esModule", { value: true });
13216
13049
  Factory$3.PlatformModule = void 0;
13217
- const base_1$4 = base;
13050
+ const base_1$4 = base$1;
13218
13051
  const Instance_1$1 = Instance$2;
13219
13052
  const index_1$1 = layout;
13053
+ /**
13054
+ * Static namespace for OpenFin API methods that interact with the {@link Platform} class, available under `fin.Platform`.
13055
+ */
13220
13056
  class PlatformModule extends base_1$4.Base {
13221
13057
  /**
13222
13058
  * @internal
@@ -13460,9 +13296,9 @@ Factory$3.PlatformModule = PlatformModule;
13460
13296
  };
13461
13297
  Object.defineProperty(exports, "__esModule", { value: true });
13462
13298
  /**
13463
- * Entry points for the OpenFin `Platform` API.
13299
+ * Entry points for the OpenFin `Platform` API (`fin.Platform`)
13464
13300
  *
13465
- * * {@link PlatformModule} contains static methods relating to the `Platform` type, accessible through `fin.Platform`.
13301
+ * * {@link PlatformModule} contains static members of the `Platform` API, accessible through `fin.Platform`.
13466
13302
  * * {@link Platform} describes an instance of an OpenFin Platform, e.g. as returned by `fin.Platform.getCurrent`.
13467
13303
  *
13468
13304
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -13471,8 +13307,8 @@ Factory$3.PlatformModule = PlatformModule;
13471
13307
  * @packageDocumentation
13472
13308
  */
13473
13309
  __exportStar(Factory$3, exports);
13474
- __exportStar(Instance$2, exports);
13475
- } (platform));
13310
+ __exportStar(Instance$2, exports);
13311
+ } (platform$1));
13476
13312
 
13477
13313
  var me = {};
13478
13314
 
@@ -13480,9 +13316,9 @@ var me = {};
13480
13316
  Object.defineProperty(exports, "__esModule", { value: true });
13481
13317
  exports.getMe = exports.getBaseMe = exports.environmentUnsupportedMessage = void 0;
13482
13318
  const view_1 = requireView();
13483
- const frame_1 = frame;
13319
+ const frame_1 = frame$1;
13484
13320
  const window_1 = requireWindow();
13485
- const external_application_1 = externalApplication;
13321
+ const external_application_1 = externalApplication$1;
13486
13322
  exports.environmentUnsupportedMessage = 'You are not running in OpenFin.';
13487
13323
  function getBaseMe(entityType, uuid, name) {
13488
13324
  const entityTypeHelpers = {
@@ -13609,7 +13445,7 @@ var me = {};
13609
13445
  };
13610
13446
  }
13611
13447
  }
13612
- exports.getMe = getMe;
13448
+ exports.getMe = getMe;
13613
13449
  } (me));
13614
13450
 
13615
13451
  var interop = {};
@@ -13712,9 +13548,8 @@ function requireSessionContextGroupBroker () {
13712
13548
  this.lastContext = context;
13713
13549
  const clientSubscriptionStates = Array.from(this.clients.values());
13714
13550
  clientSubscriptionStates.forEach((client) => {
13715
- var _a;
13716
13551
  // eslint-disable-next-line no-unused-expressions
13717
- (_a = client.contextHandlers.get(context.type)) === null || _a === void 0 ? void 0 : _a.forEach((handlerId) => {
13552
+ client.contextHandlers.get(context.type)?.forEach((handlerId) => {
13718
13553
  this.provider.dispatch(client.clientIdentity, handlerId, context);
13719
13554
  });
13720
13555
  if (client.globalHandler) {
@@ -13848,7 +13683,7 @@ var utils$1 = {};
13848
13683
  }
13849
13684
  };
13850
13685
  };
13851
- exports.wrapIntentHandler = wrapIntentHandler;
13686
+ exports.wrapIntentHandler = wrapIntentHandler;
13852
13687
  } (utils$1));
13853
13688
 
13854
13689
  var PrivateChannelProvider = {};
@@ -14143,7 +13978,7 @@ function requireInteropBroker () {
14143
13978
  hasRequiredInteropBroker = 1;
14144
13979
  Object.defineProperty(InteropBroker, "__esModule", { value: true });
14145
13980
  InteropBroker.InteropBroker = void 0;
14146
- const base_1 = base;
13981
+ const base_1 = base$1;
14147
13982
  const SessionContextGroupBroker_1 = requireSessionContextGroupBroker();
14148
13983
  const utils_1 = utils$1;
14149
13984
  const lodash_1 = require$$3;
@@ -14321,10 +14156,10 @@ function requireInteropBroker () {
14321
14156
  this.getProvider = getProvider;
14322
14157
  this.interopClients = new Map();
14323
14158
  this.contextGroupsById = new Map();
14324
- if (options === null || options === void 0 ? void 0 : options.contextGroups) {
14159
+ if (options?.contextGroups) {
14325
14160
  contextGroups = options.contextGroups;
14326
14161
  }
14327
- if (options === null || options === void 0 ? void 0 : options.logging) {
14162
+ if (options?.logging) {
14328
14163
  this.logging = options.logging;
14329
14164
  }
14330
14165
  this.intentClientMap = new Map();
@@ -14459,18 +14294,17 @@ function requireInteropBroker () {
14459
14294
  *
14460
14295
  */
14461
14296
  getCurrentContext(getCurrentContextOptions, clientIdentity) {
14462
- var _a;
14463
14297
  this.wire.sendAction('interop-broker-get-current-context').catch((e) => {
14464
14298
  // don't expose, analytics-only call
14465
14299
  });
14466
14300
  const clientState = this.getClientState(clientIdentity);
14467
- if (!(clientState === null || clientState === void 0 ? void 0 : clientState.contextGroupId)) {
14301
+ if (!clientState?.contextGroupId) {
14468
14302
  throw new Error('You must be a member of a context group to call getCurrentContext');
14469
14303
  }
14470
14304
  const { contextGroupId } = clientState;
14471
14305
  const contextGroupState = this.contextGroupsById.get(contextGroupId);
14472
14306
  const lastContextType = this.lastContextMap.get(contextGroupId);
14473
- const contextType = (_a = getCurrentContextOptions === null || getCurrentContextOptions === void 0 ? void 0 : getCurrentContextOptions.contextType) !== null && _a !== void 0 ? _a : lastContextType;
14307
+ const contextType = getCurrentContextOptions?.contextType ?? lastContextType;
14474
14308
  return contextGroupState && contextType ? contextGroupState.get(contextType) : undefined;
14475
14309
  }
14476
14310
  /*
@@ -15121,10 +14955,9 @@ function requireInteropBroker () {
15121
14955
  }
15122
14956
  // Used to restore interop broker state in snapshots.
15123
14957
  applySnapshot(snapshot, options) {
15124
- var _a;
15125
- const contextGroupStates = (_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.interopSnapshotDetails) === null || _a === void 0 ? void 0 : _a.contextGroupStates;
14958
+ const contextGroupStates = snapshot?.interopSnapshotDetails?.contextGroupStates;
15126
14959
  if (contextGroupStates) {
15127
- if (!(options === null || options === void 0 ? void 0 : options.closeExistingWindows)) {
14960
+ if (!options?.closeExistingWindows) {
15128
14961
  this.updateExistingClients(contextGroupStates);
15129
14962
  }
15130
14963
  this.rehydrateContextGroupStates(contextGroupStates);
@@ -15175,7 +15008,7 @@ function requireInteropBroker () {
15175
15008
  contextHandlerRegistered({ contextType, handlerId }, clientIdentity) {
15176
15009
  const handlerInfo = { contextType, handlerId };
15177
15010
  const clientState = this.getClientState(clientIdentity);
15178
- clientState === null || clientState === void 0 ? void 0 : clientState.contextHandlers.set(handlerId, handlerInfo);
15011
+ clientState?.contextHandlers.set(handlerId, handlerInfo);
15179
15012
  if (clientState && clientState.contextGroupId) {
15180
15013
  const { contextGroupId } = clientState;
15181
15014
  const contextGroupMap = this.contextGroupsById.get(contextGroupId);
@@ -15197,7 +15030,7 @@ function requireInteropBroker () {
15197
15030
  async intentHandlerRegistered(payload, clientIdentity) {
15198
15031
  const { handlerId } = payload;
15199
15032
  const clientIntentInfo = this.intentClientMap.get(clientIdentity.name);
15200
- const handlerInfo = clientIntentInfo === null || clientIntentInfo === void 0 ? void 0 : clientIntentInfo.get(handlerId);
15033
+ const handlerInfo = clientIntentInfo?.get(handlerId);
15201
15034
  if (!clientIntentInfo) {
15202
15035
  this.intentClientMap.set(clientIdentity.name, new Map());
15203
15036
  const newHandlerInfoMap = this.intentClientMap.get(clientIdentity.name);
@@ -15366,8 +15199,8 @@ function requireInteropBroker () {
15366
15199
  clientIdentity
15367
15200
  };
15368
15201
  // Only allow the client to join a contextGroup that actually exists.
15369
- if ((payload === null || payload === void 0 ? void 0 : payload.currentContextGroup) && this.contextGroupsById.has(payload.currentContextGroup)) {
15370
- clientSubscriptionState.contextGroupId = payload === null || payload === void 0 ? void 0 : payload.currentContextGroup;
15202
+ if (payload?.currentContextGroup && this.contextGroupsById.has(payload.currentContextGroup)) {
15203
+ clientSubscriptionState.contextGroupId = payload?.currentContextGroup;
15371
15204
  }
15372
15205
  this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
15373
15206
  });
@@ -15385,17 +15218,15 @@ function requireInteropBroker () {
15385
15218
  this.clientDisconnected(clientIdentity);
15386
15219
  });
15387
15220
  channel.beforeAction(async (action, payload, clientIdentity) => {
15388
- var _a, _b;
15389
15221
  if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
15390
15222
  throw new Error(`Action (${action}) not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
15391
15223
  }
15392
- if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.beforeAction) === null || _b === void 0 ? void 0 : _b.enabled) {
15224
+ if (this.logging?.beforeAction?.enabled) {
15393
15225
  console.log(action, payload, clientIdentity);
15394
15226
  }
15395
15227
  });
15396
15228
  channel.afterAction((action, payload, clientIdentity) => {
15397
- var _a, _b;
15398
- if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.afterAction) === null || _b === void 0 ? void 0 : _b.enabled) {
15229
+ if (this.logging?.afterAction?.enabled) {
15399
15230
  console.log(action, payload, clientIdentity);
15400
15231
  }
15401
15232
  });
@@ -15477,7 +15308,7 @@ var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateF
15477
15308
  };
15478
15309
  var _SessionContextGroupClient_clientPromise;
15479
15310
  Object.defineProperty(SessionContextGroupClient$1, "__esModule", { value: true });
15480
- const base_1$3 = base;
15311
+ const base_1$3 = base$1;
15481
15312
  const utils_1$3 = utils$1;
15482
15313
  class SessionContextGroupClient extends base_1$3.Base {
15483
15314
  constructor(wire, client, id) {
@@ -15564,7 +15395,7 @@ var __classPrivateFieldGet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateF
15564
15395
  var _InteropClient_clientPromise, _InteropClient_sessionContextGroups;
15565
15396
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
15566
15397
  InteropClient$1.InteropClient = void 0;
15567
- const base_1$2 = base;
15398
+ const base_1$2 = base$1;
15568
15399
  const SessionContextGroupClient_1 = SessionContextGroupClient$1;
15569
15400
  const utils_1$2 = utils$1;
15570
15401
  /**
@@ -16244,9 +16075,8 @@ function requireOverrideCheck () {
16244
16075
  overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
16245
16076
  const InteropBroker_1 = requireInteropBroker();
16246
16077
  function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
16247
- var _a, _b, _c, _d;
16248
- const setVersion = (_c = (_b = (_a = manifest.platform) === null || _a === void 0 ? void 0 : _a.defaultViewOptions) === null || _b === void 0 ? void 0 : _b.fdc3InteropApi) !== null && _c !== void 0 ? _c : (_d = initialOptions.defaultViewOptions) === null || _d === void 0 ? void 0 : _d.fdc3InteropApi;
16249
- return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
16078
+ const setVersion = manifest.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
16079
+ return ['1.2', '2.0'].includes(setVersion ?? '') ? setVersion : undefined;
16250
16080
  }
16251
16081
  overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
16252
16082
  // TODO: Unit test this
@@ -16283,7 +16113,7 @@ function requireFactory () {
16283
16113
  Factory$1.InteropModule = void 0;
16284
16114
  const lodash_1 = require$$3;
16285
16115
  const inaccessibleObject_1 = inaccessibleObject;
16286
- const base_1 = base;
16116
+ const base_1 = base$1;
16287
16117
  const InteropBroker_1 = requireInteropBroker();
16288
16118
  const InteropClient_1 = InteropClient$1;
16289
16119
  const overrideCheck_1 = requireOverrideCheck();
@@ -16319,13 +16149,12 @@ function requireFactory () {
16319
16149
  * ```
16320
16150
  */
16321
16151
  async init(name, override = defaultOverride) {
16322
- var _a;
16323
16152
  this.wire.sendAction('interop-init').catch(() => {
16324
16153
  // don't expose, analytics-only call
16325
16154
  });
16326
16155
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
16327
16156
  const options = await this.fin.Application.getCurrentSync().getInfo();
16328
- const opts = (_a = options.initialOptions.interopBrokerConfiguration) !== null && _a !== void 0 ? _a : {};
16157
+ const opts = options.initialOptions.interopBrokerConfiguration ?? {};
16329
16158
  const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
16330
16159
  const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
16331
16160
  let provider;
@@ -16393,9 +16222,9 @@ function requireInterop () {
16393
16222
  hasRequiredInterop = 1;
16394
16223
  (function (exports) {
16395
16224
  /**
16396
- * Entry point for the OpenFin Interop namespace.
16225
+ * Entry point for the OpenFin `Interop` API (`fin.Interop`).
16397
16226
  *
16398
- * * {@link InteropModule} contains static members of the `Interop` namespace (available under `fin.Interop`)
16227
+ * * {@link InteropModule} contains static members of the `Interop` API (available under `fin.Interop`)
16399
16228
  * * {@link InteropClient} and {@link InteropBroker} document instances of their respective classes.
16400
16229
  *
16401
16230
  * @packageDocumentation
@@ -16417,8 +16246,8 @@ function requireInterop () {
16417
16246
  Object.defineProperty(exports, "__esModule", { value: true });
16418
16247
  __exportStar(requireFactory(), exports);
16419
16248
  __exportStar(InteropClient$1, exports);
16420
- __exportStar(requireInteropBroker(), exports);
16421
- } (interop));
16249
+ __exportStar(requireInteropBroker(), exports);
16250
+ } (interop));
16422
16251
  return interop;
16423
16252
  }
16424
16253
 
@@ -16451,12 +16280,14 @@ var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_get
16451
16280
  Object.defineProperty(Instance, "__esModule", { value: true });
16452
16281
  Instance.SnapshotSource = void 0;
16453
16282
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
16454
- const base_1$1 = base;
16283
+ const base_1$1 = base$1;
16455
16284
  const utils_1$1 = utils;
16456
16285
  const connectionMap = new Map();
16457
16286
  /**
16458
16287
  * Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.
16459
16288
  *
16289
+ * @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
16290
+ * custom snapshot implementations for legacy applications to define their own snapshot format.
16460
16291
  */
16461
16292
  class SnapshotSource extends base_1$1.Base {
16462
16293
  /**
@@ -16592,13 +16423,19 @@ _SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new We
16592
16423
 
16593
16424
  Object.defineProperty(Factory, "__esModule", { value: true });
16594
16425
  Factory.SnapshotSourceModule = void 0;
16595
- const base_1 = base;
16426
+ const base_1 = base$1;
16596
16427
  const Instance_1 = Instance;
16597
16428
  const utils_1 = utils;
16429
+ /**
16430
+ * Static namespace for OpenFin API methods that interact with the {@link SnapshotSource} class, available under `fin.SnapshotSource`.
16431
+ */
16598
16432
  class SnapshotSourceModule extends base_1.Base {
16599
16433
  /**
16600
16434
  * Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
16601
16435
  *
16436
+ * @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
16437
+ * custom snapshot implementations for legacy applications to define their own snapshot format.
16438
+ *
16602
16439
  * @example
16603
16440
  * ```js
16604
16441
  * const snapshotProvider = {
@@ -16614,6 +16451,7 @@ class SnapshotSourceModule extends base_1.Base {
16614
16451
  *
16615
16452
  * await fin.SnapshotSource.init(snapshotProvider);
16616
16453
  * ```
16454
+ *
16617
16455
  */
16618
16456
  async init(provider) {
16619
16457
  this.wire.sendAction('snapshot-source-init').catch((e) => {
@@ -16668,10 +16506,10 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
16668
16506
 
16669
16507
  (function (exports) {
16670
16508
  /**
16671
- * Entry points for the OpenFin `SnapshotSource` API.
16509
+ * Entry points for the OpenFin `SnapshotSource` API (`fin.SnapshotSource`).
16672
16510
  *
16673
- * * {@link SnapshotSourceModule} contains static methods relating to the `SnapshotSource` type, accessible through `fin.SnapshotSource`.
16674
- * * {@link SnapshotSource} describes an instance of an OpenFin SnapshotSource, e.g. as returned by `fin.SnapshotSource.getCurrent`.
16511
+ * * {@link SnapshotSourceModule} contains static members of the `SnapshotSource` API, accessible through `fin.SnapshotSource`.
16512
+ * * {@link SnapshotSource} describes an instance of an OpenFin SnapshotSource, e.g. as returned by `fin.SnapshotSource.wrap`.
16675
16513
  *
16676
16514
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
16677
16515
  * both of these were documented on the same page.
@@ -16694,26 +16532,29 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
16694
16532
  };
16695
16533
  Object.defineProperty(exports, "__esModule", { value: true });
16696
16534
  __exportStar(Factory, exports);
16697
- __exportStar(Instance, exports);
16535
+ __exportStar(Instance, exports);
16698
16536
  } (snapshotSource));
16699
16537
 
16700
16538
  Object.defineProperty(fin, "__esModule", { value: true });
16701
16539
  fin.Fin = void 0;
16702
- const events_1$3 = eventsExports;
16540
+ const events_1$3 = require$$0;
16703
16541
  // Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
16704
- const index_1 = system;
16542
+ const index_1 = system$1;
16705
16543
  const index_2 = requireWindow();
16706
16544
  const index_3 = requireApplication();
16707
16545
  const index_4 = interappbus;
16708
16546
  const index_5 = clipboard;
16709
- const index_6 = externalApplication;
16710
- const index_7 = frame;
16711
- const index_8 = globalHotkey;
16547
+ const index_6 = externalApplication$1;
16548
+ const index_7 = frame$1;
16549
+ const index_8 = globalHotkey$1;
16712
16550
  const index_9 = requireView();
16713
- const index_10 = platform;
16551
+ const index_10 = platform$1;
16714
16552
  const me_1$1 = me;
16715
16553
  const interop_1 = requireInterop();
16716
16554
  const snapshot_source_1 = snapshotSource;
16555
+ /**
16556
+ * @internal
16557
+ */
16717
16558
  class Fin extends events_1$3.EventEmitter {
16718
16559
  /**
16719
16560
  * @internal
@@ -16746,7 +16587,7 @@ fin.Fin = Fin;
16746
16587
  var wire = {};
16747
16588
 
16748
16589
  Object.defineProperty(wire, "__esModule", { value: true });
16749
- wire.isInternalConnectConfig = wire.isPortDiscoveryConfig = wire.isNewConnectConfig = wire.isRemoteConfig = wire.isExistingConnectConfig = wire.isExternalConfig = void 0;
16590
+ wire.isInternalConnectConfig = wire.isPortDiscoveryConfig = wire.isNewConnectConfig = wire.isConfigWithReceiver = wire.isRemoteConfig = wire.isExistingConnectConfig = wire.isExternalConfig = void 0;
16750
16591
  function isExternalConfig(config) {
16751
16592
  if (typeof config.manifestUrl === 'string') {
16752
16593
  return true;
@@ -16762,6 +16603,10 @@ function isRemoteConfig(config) {
16762
16603
  return isExistingConnectConfig(config) && typeof config.token === 'string';
16763
16604
  }
16764
16605
  wire.isRemoteConfig = isRemoteConfig;
16606
+ function isConfigWithReceiver(config) {
16607
+ return typeof config.receiver === 'object' && isRemoteConfig({ ...config, address: '' });
16608
+ }
16609
+ wire.isConfigWithReceiver = isConfigWithReceiver;
16765
16610
  function hasUuid(config) {
16766
16611
  return typeof config.uuid === 'string';
16767
16612
  }
@@ -16802,8 +16647,8 @@ var http = {};
16802
16647
  (function (exports) {
16803
16648
  Object.defineProperty(exports, "__esModule", { value: true });
16804
16649
  exports.fetchJson = exports.downloadFile = exports.fetch = exports.getRequestOptions = exports.getProxy = void 0;
16805
- const node_url_1 = require$$0; // This must explicitly use node builtin to avoid accidentally bundling npm:url.
16806
- const fs = require$$0$1;
16650
+ const node_url_1 = require$$0$1; // This must explicitly use node builtin to avoid accidentally bundling npm:url.
16651
+ const fs = require$$0$2;
16807
16652
  const getProxyVar = () => {
16808
16653
  return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy;
16809
16654
  };
@@ -16888,13 +16733,13 @@ var http = {};
16888
16733
  const res = await (0, exports.fetch)(url);
16889
16734
  return JSON.parse(res);
16890
16735
  };
16891
- exports.fetchJson = fetchJson;
16736
+ exports.fetchJson = fetchJson;
16892
16737
  } (http));
16893
16738
 
16894
16739
  Object.defineProperty(util, "__esModule", { value: true });
16895
16740
  util.resolveDir = util.first = util.resolveRuntimeVersion = util.rmDir = util.unzip = util.exists = void 0;
16896
- const path$1 = require$$0$2;
16897
- const fs$1 = require$$0$1;
16741
+ const path$1 = require$$0$3;
16742
+ const fs$1 = require$$0$2;
16898
16743
  const child_process_1$1 = require$$2;
16899
16744
  const promises_1$1 = promises;
16900
16745
  const http_1$1 = http;
@@ -16996,7 +16841,7 @@ async function resolveDir(base, paths) {
16996
16841
  util.resolveDir = resolveDir;
16997
16842
 
16998
16843
  Object.defineProperty(winLaunch, "__esModule", { value: true });
16999
- const path = require$$0$2;
16844
+ const path = require$$0$3;
17000
16845
  const child_process_1 = require$$2;
17001
16846
  const util_1 = util;
17002
16847
  function launchRVM(config, manifestLocation, namedPipeName, rvm) {
@@ -17018,7 +16863,7 @@ function launchRVM(config, manifestLocation, namedPipeName, rvm) {
17018
16863
  async function checkRvmPath() {
17019
16864
  let rvmPath = path.resolve(process.env.LOCALAPPDATA, 'OpenFin', 'OpenFinRVM.exe');
17020
16865
  if (!(await (0, util_1.exists)(rvmPath))) {
17021
- rvmPath = path.join(__dirname, '..', '..', 'resources', 'win', 'OpenFinRVM.exe');
16866
+ rvmPath = path.join(__dirname, '..', 'resources', 'win', 'OpenFinRVM.exe');
17022
16867
  }
17023
16868
  return rvmPath;
17024
16869
  }
@@ -17080,8 +16925,8 @@ function requireServices () {
17080
16925
  const startServices = async (services) => {
17081
16926
  await (0, promises_1.promiseMapSerial)(services, exports.launchService);
17082
16927
  };
17083
- exports.startServices = startServices;
17084
- } (services));
16928
+ exports.startServices = startServices;
16929
+ } (services));
17085
16930
  return services;
17086
16931
  }
17087
16932
 
@@ -17092,8 +16937,8 @@ function requireNixLaunch () {
17092
16937
  hasRequiredNixLaunch = 1;
17093
16938
  Object.defineProperty(nixLaunch, "__esModule", { value: true });
17094
16939
  nixLaunch.install = nixLaunch.getRuntimePath = nixLaunch.download = nixLaunch.getUrl = void 0;
17095
- const fs = require$$0$1;
17096
- const path = require$$0$2;
16940
+ const fs = require$$0$2;
16941
+ const path = require$$0$3;
17097
16942
  const child_process_1 = require$$2;
17098
16943
  const promises_1 = promises;
17099
16944
  const util_1 = util;
@@ -17200,8 +17045,8 @@ function requireLauncher () {
17200
17045
  if (hasRequiredLauncher) return launcher;
17201
17046
  hasRequiredLauncher = 1;
17202
17047
  Object.defineProperty(launcher, "__esModule", { value: true });
17203
- const os = require$$0$3;
17204
- const path = require$$0$2;
17048
+ const os = require$$0$4;
17049
+ const path = require$$0$3;
17205
17050
  const win_launch_1 = winLaunch;
17206
17051
  const nix_launch_1 = requireNixLaunch();
17207
17052
  class Launcher {
@@ -17276,10 +17121,10 @@ function requirePortDiscovery () {
17276
17121
  hasRequiredPortDiscovery = 1;
17277
17122
  Object.defineProperty(portDiscovery, "__esModule", { value: true });
17278
17123
  /* eslint-disable @typescript-eslint/naming-convention */
17279
- const fs = require$$0$1;
17124
+ const fs = require$$0$2;
17280
17125
  const net = require$$1;
17281
- const path = require$$0$2;
17282
- const os = require$$0$3;
17126
+ const path = require$$0$3;
17127
+ const os = require$$0$4;
17283
17128
  const timers_1 = require$$4;
17284
17129
  const wire_1 = wire;
17285
17130
  const launcher_1 = requireLauncher();
@@ -17554,12 +17399,17 @@ function requireNodeEnv () {
17554
17399
  hasRequiredNodeEnv = 1;
17555
17400
  Object.defineProperty(nodeEnv, "__esModule", { value: true });
17556
17401
  /* eslint-disable class-methods-use-this */
17557
- const fs_1 = require$$0$1;
17402
+ const fs_1 = require$$0$2;
17558
17403
  const crypto_1 = require$$1$1;
17559
- const WS = require$$2$1;
17404
+ const _WS = require$$2$1;
17560
17405
  const environment_1 = environment;
17561
17406
  const port_discovery_1 = requirePortDiscovery();
17562
17407
  const transport_errors_1 = transportErrors;
17408
+ // Due to https://github.com/rollup/rollup/issues/1267, we need this guard
17409
+ // to ensure the import works with and without the 'esModuleInterop' ts flag.
17410
+ // This is due to our mocha tests not being compatible with esModuleInterop,
17411
+ // whereas rollup enforces it.
17412
+ const WS = _WS.default || _WS;
17563
17413
  class NodeEnvironment {
17564
17414
  constructor() {
17565
17415
  this.messageCounter = 0;
@@ -17634,7 +17484,7 @@ var emitterMap = {};
17634
17484
 
17635
17485
  Object.defineProperty(emitterMap, "__esModule", { value: true });
17636
17486
  emitterMap.EmitterMap = void 0;
17637
- const events_1$2 = eventsExports;
17487
+ const events_1$2 = require$$0;
17638
17488
  class EmitterMap {
17639
17489
  constructor() {
17640
17490
  this.storage = new Map();
@@ -17716,7 +17566,7 @@ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFie
17716
17566
  var _Transport_wire, _Transport_fin;
17717
17567
  Object.defineProperty(transport, "__esModule", { value: true });
17718
17568
  transport.Transport = void 0;
17719
- const events_1$1 = eventsExports;
17569
+ const events_1$1 = require$$0;
17720
17570
  const wire_1$1 = wire;
17721
17571
  const transport_errors_1$1 = transportErrors;
17722
17572
  const eventAggregator_1 = eventAggregator;
@@ -17758,13 +17608,13 @@ class Transport extends events_1$1.EventEmitter {
17758
17608
  }
17759
17609
  getFin() {
17760
17610
  if (!__classPrivateFieldGet(this, _Transport_fin, "f")) {
17761
- throw new Error("No Fin object registered for this transport");
17611
+ throw new Error('No Fin object registered for this transport');
17762
17612
  }
17763
17613
  return __classPrivateFieldGet(this, _Transport_fin, "f");
17764
17614
  }
17765
17615
  registerFin(_fin) {
17766
17616
  if (__classPrivateFieldGet(this, _Transport_fin, "f")) {
17767
- throw new Error("Fin object has already been registered for this transport");
17617
+ throw new Error('Fin object has already been registered for this transport');
17768
17618
  }
17769
17619
  __classPrivateFieldSet(this, _Transport_fin, _fin, "f");
17770
17620
  }
@@ -17773,6 +17623,10 @@ class Transport extends events_1$1.EventEmitter {
17773
17623
  return wire.shutdown();
17774
17624
  }
17775
17625
  async connect(config) {
17626
+ if ((0, wire_1$1.isConfigWithReceiver)(config)) {
17627
+ await __classPrivateFieldGet(this, _Transport_wire, "f").connect(config.receiver);
17628
+ return this.authorize(config);
17629
+ }
17776
17630
  if ((0, wire_1$1.isRemoteConfig)(config)) {
17777
17631
  return this.connectRemote(config);
17778
17632
  }
@@ -17786,14 +17640,14 @@ class Transport extends events_1$1.EventEmitter {
17786
17640
  return undefined;
17787
17641
  }
17788
17642
  async connectRemote(config) {
17789
- await __classPrivateFieldGet(this, _Transport_wire, "f").connect(config.address, this.environment.getWsConstructor());
17643
+ await __classPrivateFieldGet(this, _Transport_wire, "f").connect(new (this.environment.getWsConstructor())(config.address));
17790
17644
  return this.authorize(config);
17791
17645
  }
17792
17646
  async connectByPort(config) {
17793
17647
  const { address, uuid } = config;
17794
17648
  const reqAuthPayload = { ...config, type: 'file-token' };
17795
17649
  const wire = __classPrivateFieldGet(this, _Transport_wire, "f");
17796
- await wire.connect(address, this.environment.getWsConstructor());
17650
+ await wire.connect(new (this.environment.getWsConstructor())(config.address));
17797
17651
  const requestExtAuthRet = await this.sendAction('request-external-authorization', {
17798
17652
  uuid,
17799
17653
  type: 'file-token'
@@ -17813,7 +17667,9 @@ class Transport extends events_1$1.EventEmitter {
17813
17667
  throw new transport_errors_1$1.RuntimeError(requestAuthRet.payload);
17814
17668
  }
17815
17669
  }
17816
- sendAction(action, payload = {}, uncorrelated = false) {
17670
+ sendAction(action, payload = {}, uncorrelated = false
17671
+ // specialResponse type is only used for 'requestAuthorization'
17672
+ ) {
17817
17673
  // eslint-disable-next-line @typescript-eslint/no-empty-function
17818
17674
  let cancel = () => { };
17819
17675
  // We want the callsite from the caller of this function, not from here.
@@ -17863,7 +17719,10 @@ class Transport extends events_1$1.EventEmitter {
17863
17719
  this.uncorrelatedListener = resolve;
17864
17720
  }
17865
17721
  else if (this.wireListeners.has(id)) {
17866
- handleNack({ reason: 'Duplicate handler id', error: (0, errors_1.errorToPOJO)(new transport_errors_1$1.DuplicateCorrelationError(String(id))) });
17722
+ handleNack({
17723
+ reason: 'Duplicate handler id',
17724
+ error: (0, errors_1.errorToPOJO)(new transport_errors_1$1.DuplicateCorrelationError(String(id)))
17725
+ });
17867
17726
  }
17868
17727
  else {
17869
17728
  this.wireListeners.set(id, { resolve, handleNack });
@@ -17923,9 +17782,19 @@ _Transport_wire = new WeakMap(), _Transport_fin = new WeakMap();
17923
17782
 
17924
17783
  var websocket = {};
17925
17784
 
17785
+ var messageReceiver = {};
17786
+
17787
+ Object.defineProperty(messageReceiver, "__esModule", { value: true });
17788
+ messageReceiver.isOpen = void 0;
17789
+ function isOpen(receiver) {
17790
+ return receiver.readyState === 'open' || receiver.readyState === 1;
17791
+ }
17792
+ messageReceiver.isOpen = isOpen;
17793
+
17926
17794
  Object.defineProperty(websocket, "__esModule", { value: true });
17927
- const events_1 = eventsExports;
17795
+ const events_1 = require$$0;
17928
17796
  const transport_errors_1 = transportErrors;
17797
+ const messageReceiver_1 = messageReceiver;
17929
17798
  /* `READY_STATE` is an instance var set by `constructor` to reference the `WebTransportSocket.READY_STATE` enum.
17930
17799
  * This is syntactic sugar that makes the enum accessible through the `wire` property of the various `fin` singletons.
17931
17800
  * For example, `fin.system.wire.READY_STATE` is a shortcut to `fin.system.wire.wire.constructor.READY_STATE`.
@@ -17943,15 +17812,18 @@ var READY_STATE;
17943
17812
  class WebSocketTransport extends events_1.EventEmitter {
17944
17813
  constructor(onmessage) {
17945
17814
  super();
17946
- this.connect = (address, WsConstructor) => {
17815
+ this.connect = (messageReceiver) => {
17947
17816
  return new Promise((resolve, reject) => {
17948
- this.wire = new WsConstructor(address);
17949
- this.wire.addEventListener('open', resolve);
17817
+ this.wire = messageReceiver;
17818
+ this.wire.addEventListener('open', () => resolve());
17950
17819
  this.wire.addEventListener('error', reject);
17951
17820
  this.wire.addEventListener('message', (message) => this.onmessage.call(null, JSON.parse(message.data)));
17952
17821
  this.wire.addEventListener('close', () => {
17953
17822
  this.emit('disconnected');
17954
17823
  });
17824
+ if ((0, messageReceiver_1.isOpen)(this.wire)) {
17825
+ resolve();
17826
+ }
17955
17827
  });
17956
17828
  };
17957
17829
  this.connectSync = () => {
@@ -17961,7 +17833,7 @@ class WebSocketTransport extends events_1.EventEmitter {
17961
17833
  }
17962
17834
  send(data, flags) {
17963
17835
  return new Promise((resolve, reject) => {
17964
- if (this.wire.readyState !== READY_STATE.OPEN) {
17836
+ if (!(0, messageReceiver_1.isOpen)(this.wire)) {
17965
17837
  reject(new transport_errors_1.DisconnectedError(READY_STATE[this.wire.readyState]));
17966
17838
  }
17967
17839
  else {
@@ -17975,6 +17847,7 @@ class WebSocketTransport extends events_1.EventEmitter {
17975
17847
  return Promise.resolve();
17976
17848
  }
17977
17849
  getPort() {
17850
+ // @ts-expect-error
17978
17851
  return this.wire.url.split(':').slice(-1)[0];
17979
17852
  }
17980
17853
  }
@@ -17984,8 +17857,8 @@ var normalizeConfig$1 = {};
17984
17857
 
17985
17858
  Object.defineProperty(normalizeConfig$1, "__esModule", { value: true });
17986
17859
  normalizeConfig$1.validateConfig = normalizeConfig$1.normalizeConfig = void 0;
17987
- const fs = require$$0$1;
17988
- const node_url_1 = require$$0; // This must explicitly use node builtin to avoid accidentally bundling npm:url
17860
+ const fs = require$$0$2;
17861
+ const node_url_1 = require$$0$1; // This must explicitly use node builtin to avoid accidentally bundling npm:url
17989
17862
  const wire_1 = wire;
17990
17863
  const promises_1 = promises;
17991
17864
  const http_1 = http;
@@ -18054,9 +17927,9 @@ function requireMain () {
18054
17927
  Object.defineProperty(exports, "ChannelClient", { enumerable: true, get: function () { return client_1.ChannelClient; } });
18055
17928
  const provider_1 = provider;
18056
17929
  Object.defineProperty(exports, "ChannelProvider", { enumerable: true, get: function () { return provider_1.ChannelProvider; } });
18057
- const frame_1 = frame;
17930
+ const frame_1 = frame$1;
18058
17931
  Object.defineProperty(exports, "Frame", { enumerable: true, get: function () { return frame_1._Frame; } });
18059
- const system_1 = system;
17932
+ const system_1 = system$1;
18060
17933
  Object.defineProperty(exports, "System", { enumerable: true, get: function () { return system_1.System; } });
18061
17934
  const wire_1 = wire;
18062
17935
  const node_env_1 = requireNodeEnv();
@@ -18067,11 +17940,10 @@ function requireMain () {
18067
17940
  const environment = new node_env_1.default();
18068
17941
  // Connect to an OpenFin Runtime
18069
17942
  async function connect(config) {
18070
- var _a;
18071
17943
  const normalized = await (0, normalize_config_1.validateConfig)(config);
18072
17944
  const wire = new transport_1.Transport(websocket_1.default, environment, {
18073
17945
  ...normalized,
18074
- name: (_a = normalized.name) !== null && _a !== void 0 ? _a : normalized.uuid
17946
+ name: normalized.name ?? normalized.uuid
18075
17947
  });
18076
17948
  await wire.connect(normalized);
18077
17949
  return new fin_1.Fin(wire);
@@ -18085,22 +17957,268 @@ function requireMain () {
18085
17957
  const pd = new port_discovery_1.default(normalized, environment);
18086
17958
  return pd.retrievePort();
18087
17959
  }
18088
- exports.launch = launch;
18089
- } (main$1));
17960
+ exports.launch = launch;
17961
+ } (main$1));
18090
17962
  return main$1;
18091
17963
  }
18092
17964
 
18093
17965
  var mainExports = requireMain();
18094
17966
 
18095
- var OpenFin$1 = {};
17967
+ var OpenFin$2 = {};
17968
+
17969
+ var events = {};
17970
+
17971
+ var application = {};
17972
+
17973
+ /**
17974
+ * Namespace for events that can be emitted by an {@link OpenFin.Application}. Includes events
17975
+ * re-propagated from the {@link OpenFin.Window} (and, transitively, {@link OpenFin.View}) level, prefixed with `window-` (and also, if applicable, `view-`).
17976
+ * For example, a view's "attached" event will fire as 'window-view-attached' at the application level.
17977
+ *
17978
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
17979
+ *
17980
+ * This namespace contains only payload shapes for events that are unique to `Application`. Events that propagate to `Application` from
17981
+ * child {@link OpenFin.Window windows} and {@link OpenFin.View views} are defined in the {@link OpenFin.WindowEvents} and
17982
+ * {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all* application events, see {@link Application.on Application.on}.
17983
+ *
17984
+ * {@link ApplicationSourcedEvent Application-sourced events} (i.e. those that have not propagated from {@link OpenFin.ViewEvents Views}
17985
+ * or {@link OpenFin.WindowEvents Windows} re-propagate to {@link OpenFin.SystemEvents System} with their type string prefixed with `application-`.
17986
+ * {@link ApplicationWindowEvent Application events that are tied to Windows but do not propagate from them}
17987
+ * are propagated to `System` without any type string prefixing.
17988
+ *
17989
+ * "Requested" events (e.g. {@link RunRequestedEvent}) do not propagate.
17990
+ *
17991
+ * @packageDocumentation
17992
+ */
17993
+ Object.defineProperty(application, "__esModule", { value: true });
17994
+
17995
+ var base = {};
17996
+
17997
+ /**
17998
+ * Namespace for shared event payloads and utility types common to all event emitters.
17999
+ *
18000
+ * @packageDocumentation
18001
+ */
18002
+ Object.defineProperty(base, "__esModule", { value: true });
18003
+
18004
+ var externalApplication = {};
18005
+
18006
+ /**
18007
+ * Namespace for events that can be transmitted by an {@link OpenFin.ExternalApplication}.
18008
+ *
18009
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18010
+ *
18011
+ * For a list of valid string keys for external application events, see {@link ExternalApplication.on ExternalApplication.on}.
18012
+ *
18013
+ * @packageDocumentation
18014
+ */
18015
+ Object.defineProperty(externalApplication, "__esModule", { value: true });
18016
+
18017
+ var frame = {};
18018
+
18019
+ Object.defineProperty(frame, "__esModule", { value: true });
18020
+
18021
+ var globalHotkey = {};
18022
+
18023
+ Object.defineProperty(globalHotkey, "__esModule", { value: true });
18024
+
18025
+ var platform = {};
18026
+
18027
+ /**
18028
+ *
18029
+ * Namespace for events that can emitted by a {@link OpenFin.Platform}.
18030
+ *
18031
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18032
+ *
18033
+ * The Platform `EventEmitter` is a superset of the {@link OpenFin.Application} `EventEmitter`,
18034
+ * meaning it can listen to all {@link OpenFin.ApplicationEvents Application events} in addition to the
18035
+ * Platform-specific events listed here. For a list of valid string keys for *all* platform events, see
18036
+ * {@link Platform.on Platform.on}.
18037
+ *
18038
+ * @packageDocumentation
18039
+ */
18040
+ Object.defineProperty(platform, "__esModule", { value: true });
18041
+
18042
+ var system = {};
18043
+
18044
+ /**
18045
+ * Namespace for runtime-wide OpenFin events emitted by {@link System.System}. Includes events
18046
+ * re-propagated from {@link OpenFin.Application}, {@link OpenFin.Window}, and {@link OpenFin.View} (prefixed with `application-`, `window-`, and `view-`). All
18047
+ * event propagations are visible at the System level. Propagated events from WebContents (windows, views, frames) to the Application level will *not*
18048
+ * transitively re-propagate to the System level, because they are already visible at the system level and contain the identity
18049
+ * of the application. For example, an application's "closed" event will fire as 'application-closed' at the system level. A view's 'shown' event
18050
+ * will be visible as 'view-shown' at the system level, but *not* as `application-window-view-shown`.
18051
+ *
18052
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18053
+ *
18054
+ * This namespace contains only payload shapes for events that are unique to `System`. Events that propagate to `System` from
18055
+ * child {@link OpenFin.Application applications}, {@link OpenFin.Window windows}, and {@link OpenFin.View views} are defined in the
18056
+ * {@link OpenFin.ApplicationEvents}, {@link OpenFin.WindowEvents}, and {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all*
18057
+ * system events, see {@link System.on System.on}.
18058
+ *
18059
+ * @packageDocumentation
18060
+ */
18061
+ Object.defineProperty(system, "__esModule", { value: true });
18062
+
18063
+ var view = {};
18064
+
18065
+ /**
18066
+ * Namespace for events that can be emitted by a {@link OpenFin.View}.
18067
+ *
18068
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18069
+ *
18070
+ * This namespace contains only payload shapes for events that are unique to `View`. Events that are shared between all `WebContents`
18071
+ * (i.e. {@link OpenFin.Window}, {@link OpenFin.View}) are defined in {@link OpenFin.WebContentsEvents}. For a list
18072
+ * of valid string keys for *all* View events, see {@link View.on View.on}.
18073
+ *
18074
+ * View events propagate to their parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
18075
+ * and {@link OpenFin.SystemEvents System} with an added `viewIdentity` property and their event types prefixed with `'view-'`.
18076
+ *
18077
+ * @packageDocumentation
18078
+ */
18079
+ Object.defineProperty(view, "__esModule", { value: true });
18080
+
18081
+ var webcontents = {};
18082
+
18083
+ /**
18084
+ * Namespace for events shared by all OpenFin WebContents elements (i.e. {@link OpenFin.Window},
18085
+ * {@link OpenFin.View}).
18086
+ *
18087
+ * WebContents events are divided into two groups: {@link WillPropagateWebContentsEvent} and {@link NonPropagatedWebContentsEvent}. Propagating events
18088
+ * will re-emit on parent entities - e.g., a propagating event in a view will also be emitted on the view's
18089
+ * parent window, and propagating events in a window will also be emitted on the window's parent {@link OpenFin.Application}.
18090
+ *
18091
+ * Non-propagating events will not re-emit on parent entities.
18092
+ *
18093
+ * @packageDocumentation
18094
+ */
18095
+ Object.defineProperty(webcontents, "__esModule", { value: true });
18096
+
18097
+ var window$1 = {};
18098
+
18099
+ /**
18100
+ * Namespace for events that can be emitted by a {@link OpenFin.Window}.
18101
+ *
18102
+ * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18103
+ *
18104
+ * This namespace contains only payload shapes for events that are unique to `Window`. Events that are shared between all `WebContents`
18105
+ * (i.e. {@link OpenFin.Window}, {@link OpenFin.View}) are defined in {@link OpenFin.WebContentsEvents}. Events that
18106
+ * propagate from `View` are defined in {@link OpenFin.ViewEvents}. For a list of valid string keys for *all* Window events, see
18107
+ * {@link Window.on Window.on}
18108
+ *
18109
+ * {@link OpenFin.WindowEvents.WindowSourcedEvent Window-sourced events} (i.e. those that are not propagated from a
18110
+ * {@link OpenFin.ViewEvents View}) propagate to their parent {@link OpenFin.ApplicationEvents Application} and
18111
+ * {@link OpenFin.SystemEvents System} with their event types prefixed with `'window-'`).
18112
+ *
18113
+ * "Requested" events (e.g. {@link AuthRequestedEvent}) do not propagate to `System. The {@link OpenFin.WindowEvents.WindowCloseRequestedEvent}
18114
+ * does not propagate at all.
18115
+ *
18116
+ * @packageDocumentation
18117
+ */
18118
+ Object.defineProperty(window$1, "__esModule", { value: true });
18119
+
18120
+ /**
18121
+ * Namespace for OpenFin event types. Each entity that emits OpenFin events has its own sub-namespace. Event payloads
18122
+ * themselves are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18123
+ *
18124
+ * #### Event emitters
18125
+ *
18126
+ * The following entities emit OpenFin events, and have corresponding sub-namespaces:
18127
+ *
18128
+ * * {@link OpenFin.Application}: {@link OpenFin.ApplicationEvents}
18129
+ * * {@link OpenFin.ExternalApplication}: {@link OpenFin.ExternalApplicationEvents}
18130
+ * * {@link OpenFin.Frame}: {@link OpenFin.FrameEvents}
18131
+ * * {@link OpenFin.GlobalHotkey}: {@link OpenFin.GlobalHotkeyEvents}
18132
+ * * {@link OpenFin.Platform}: {@link OpenFin.PlatformEvents}
18133
+ * * {@link OpenFin.System}: {@link OpenFin.SystemEvents}
18134
+ * * {@link OpenFin.View}: {@link OpenFin.ViewEvents}
18135
+ * * {@link OpenFin.Window}: {@link OpenFin.WindowEvents}
18136
+ *
18137
+ * These `EventEmitter` entities share a common set of methods for interacting with the OpenFin event bus, which can be
18138
+ * seen on the individual documentation pages for each entity type.
18139
+ *
18140
+ * Registering event handlers is an asynchronous operation. It is important to ensure that the returned Promises are awaited to reduce the
18141
+ * risk of race conditions.
18142
+ *
18143
+ * When the `EventEmitter` receives an event from the browser process and emits on the renderer, all of the functions attached to that
18144
+ * specific event are called synchronously. Any values returned by the called listeners are ignored and will be discarded. If the window document
18145
+ * is destroyed by page navigation or reload, its registered event listeners will be removed.
18146
+ *
18147
+ * We recommend using Arrow Functions for event listeners to ensure the this scope is consistent with the original function context.
18148
+ *
18149
+ * Events re-propagate from smaller/more-local scopes to larger/more-global scopes. For example, an event emitted on a specific
18150
+ * view will propagate to the window in which the view is embedded, and then to the application in which the window is running, and
18151
+ * finally to the OpenFin runtime itself at the "system" level. For details on propagation semantics, see the namespace for
18152
+ * the propagating (or propagated-to) entity.
18153
+ *
18154
+ * If you need the payload type for a specific type of event (especially propagated events), use the emitting topic's `Payload` generic
18155
+ * (e.g. {@link WindowEvents.Payload}) with the event's `type` string. For example, the payload of
18156
+ * a {@link ViewEvents.CreatedEvent} after it has propagated to its parent {@link WindowEvents Window} can be found with
18157
+ * `WindowEvents.Payload<'view-created'>`.
18158
+ *
18159
+ * @packageDocumentation
18160
+ */
18161
+ Object.defineProperty(events, "__esModule", { value: true });
18162
+ events.WindowEvents = events.WebContentsEvents = events.ViewEvents = events.SystemEvents = events.PlatformEvents = events.GlobalHotkeyEvents = events.FrameEvents = events.ExternalApplicationEvents = events.BaseEvents = events.ApplicationEvents = void 0;
18163
+ const ApplicationEvents = application;
18164
+ events.ApplicationEvents = ApplicationEvents;
18165
+ const BaseEvents = base;
18166
+ events.BaseEvents = BaseEvents;
18167
+ const ExternalApplicationEvents = externalApplication;
18168
+ events.ExternalApplicationEvents = ExternalApplicationEvents;
18169
+ const FrameEvents = frame;
18170
+ events.FrameEvents = FrameEvents;
18171
+ const GlobalHotkeyEvents = globalHotkey;
18172
+ events.GlobalHotkeyEvents = GlobalHotkeyEvents;
18173
+ const PlatformEvents = platform;
18174
+ events.PlatformEvents = PlatformEvents;
18175
+ const SystemEvents = system;
18176
+ events.SystemEvents = SystemEvents;
18177
+ const ViewEvents = view;
18178
+ events.ViewEvents = ViewEvents;
18179
+ const WebContentsEvents = webcontents;
18180
+ events.WebContentsEvents = WebContentsEvents;
18181
+ const WindowEvents = window$1;
18182
+ events.WindowEvents = WindowEvents;
18183
+
18184
+ (function (exports) {
18185
+ /**
18186
+ * Top-level namespace for types referenced by the OpenFin API. Contains:
18187
+ *
18188
+ * * The type of the global `fin` entry point ({@link FinApi})
18189
+ * * Classes that act as static namespaces returned from the `fin` global (e.g. {@link ApplicationModule}, accessible via `fin.Application`)
18190
+ * * Instance classes that are returned from API calls (e.g. {@link Application}, accessible via `fin.Application.getCurrentSync()`)
18191
+ * * Parameter shapes for API methods (e.g. {@link ApplicationOptions}, used in `fin.Application.start()`)
18192
+ * * Event namespaces and payload union types (e.g. {@link ApplicationEvents} and {@link ApplicationEvent})
18193
+ *
18194
+ * @packageDocumentation
18195
+ */
18196
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18197
+ if (k2 === undefined) k2 = k;
18198
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18199
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18200
+ desc = { enumerable: true, get: function() { return m[k]; } };
18201
+ }
18202
+ Object.defineProperty(o, k2, desc);
18203
+ }) : (function(o, m, k, k2) {
18204
+ if (k2 === undefined) k2 = k;
18205
+ o[k2] = m[k];
18206
+ }));
18207
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
18208
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18209
+ };
18210
+ Object.defineProperty(exports, "__esModule", { value: true });
18211
+ // Deprecated shim to preserve v30 namespace names
18212
+ __exportStar(events, exports);
18213
+ } (OpenFin$2));
18096
18214
 
18097
- Object.defineProperty(OpenFin$1, "__esModule", { value: true });
18215
+ var OpenFin = /*@__PURE__*/getDefaultExportFromCjs(OpenFin$2);
18098
18216
 
18099
- var OpenFin = /*#__PURE__*/_mergeNamespaces({
18217
+ var OpenFin$1 = /*#__PURE__*/_mergeNamespaces({
18100
18218
  __proto__: null,
18101
- default: OpenFin$1
18102
- }, [OpenFin$1]);
18219
+ default: OpenFin
18220
+ }, [OpenFin$2]);
18103
18221
 
18104
18222
  exports.connect = mainExports.connect;
18105
- exports.default = OpenFin;
18223
+ exports.default = OpenFin$1;
18106
18224
  exports.launch = mainExports.launch;