@interopio/fdc3 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,10 +29,10 @@ function getAugmentedNamespace(n) {
29
29
  return a;
30
30
  }
31
31
 
32
- var toStr$9 = Object.prototype.toString;
32
+ var toStr$8 = Object.prototype.toString;
33
33
 
34
34
  var isArguments$3 = function isArguments(value) {
35
- var str = toStr$9.call(value);
35
+ var str = toStr$8.call(value);
36
36
  var isArgs = str === '[object Arguments]';
37
37
  if (!isArgs) {
38
38
  isArgs = str !== '[object Array]' &&
@@ -40,17 +40,17 @@ var isArguments$3 = function isArguments(value) {
40
40
  typeof value === 'object' &&
41
41
  typeof value.length === 'number' &&
42
42
  value.length >= 0 &&
43
- toStr$9.call(value.callee) === '[object Function]';
43
+ toStr$8.call(value.callee) === '[object Function]';
44
44
  }
45
45
  return isArgs;
46
46
  };
47
47
 
48
- var implementation$b;
49
- var hasRequiredImplementation;
48
+ var implementation$a;
49
+ var hasRequiredImplementation$1;
50
50
 
51
- function requireImplementation () {
52
- if (hasRequiredImplementation) return implementation$b;
53
- hasRequiredImplementation = 1;
51
+ function requireImplementation$1 () {
52
+ if (hasRequiredImplementation$1) return implementation$a;
53
+ hasRequiredImplementation$1 = 1;
54
54
 
55
55
  var keysShim;
56
56
  if (!Object.keys) {
@@ -171,15 +171,15 @@ function requireImplementation () {
171
171
  return theKeys;
172
172
  };
173
173
  }
174
- implementation$b = keysShim;
175
- return implementation$b;
174
+ implementation$a = keysShim;
175
+ return implementation$a;
176
176
  }
177
177
 
178
178
  var slice = Array.prototype.slice;
179
179
  var isArgs = isArguments$3;
180
180
 
181
181
  var origKeys = Object.keys;
182
- var keysShim = origKeys ? function keys(o) { return origKeys(o); } : requireImplementation();
182
+ var keysShim = origKeys ? function keys(o) { return origKeys(o); } : requireImplementation$1();
183
183
 
184
184
  var originalKeys = Object.keys;
185
185
 
@@ -206,6 +206,274 @@ keysShim.shim = function shimObjectKeys() {
206
206
 
207
207
  var objectKeys$2 = keysShim;
208
208
 
209
+ /** @type {import('.')} */
210
+ var $defineProperty$3 = Object.defineProperty || false;
211
+ if ($defineProperty$3) {
212
+ try {
213
+ $defineProperty$3({}, 'a', { value: 1 });
214
+ } catch (e) {
215
+ // IE 8 has a broken defineProperty
216
+ $defineProperty$3 = false;
217
+ }
218
+ }
219
+
220
+ var esDefineProperty = $defineProperty$3;
221
+
222
+ /** @type {import('./syntax')} */
223
+ var syntax = SyntaxError;
224
+
225
+ /** @type {import('./type')} */
226
+ var type = TypeError;
227
+
228
+ /** @type {import('./gOPD')} */
229
+ var gOPD$5 = Object.getOwnPropertyDescriptor;
230
+
231
+ /** @type {import('.')} */
232
+ var $gOPD$2 = gOPD$5;
233
+
234
+ if ($gOPD$2) {
235
+ try {
236
+ $gOPD$2([], 'length');
237
+ } catch (e) {
238
+ // IE 8 has a broken gOPD
239
+ $gOPD$2 = null;
240
+ }
241
+ }
242
+
243
+ var gopd$1 = $gOPD$2;
244
+
245
+ var $defineProperty$2 = esDefineProperty;
246
+
247
+ var $SyntaxError$2 = syntax;
248
+ var $TypeError$a = type;
249
+
250
+ var gopd = gopd$1;
251
+
252
+ /** @type {import('.')} */
253
+ var defineDataProperty$1 = function defineDataProperty(
254
+ obj,
255
+ property,
256
+ value
257
+ ) {
258
+ if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
259
+ throw new $TypeError$a('`obj` must be an object or a function`');
260
+ }
261
+ if (typeof property !== 'string' && typeof property !== 'symbol') {
262
+ throw new $TypeError$a('`property` must be a string or a symbol`');
263
+ }
264
+ if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
265
+ throw new $TypeError$a('`nonEnumerable`, if provided, must be a boolean or null');
266
+ }
267
+ if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
268
+ throw new $TypeError$a('`nonWritable`, if provided, must be a boolean or null');
269
+ }
270
+ if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
271
+ throw new $TypeError$a('`nonConfigurable`, if provided, must be a boolean or null');
272
+ }
273
+ if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
274
+ throw new $TypeError$a('`loose`, if provided, must be a boolean');
275
+ }
276
+
277
+ var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
278
+ var nonWritable = arguments.length > 4 ? arguments[4] : null;
279
+ var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
280
+ var loose = arguments.length > 6 ? arguments[6] : false;
281
+
282
+ /* @type {false | TypedPropertyDescriptor<unknown>} */
283
+ var desc = !!gopd && gopd(obj, property);
284
+
285
+ if ($defineProperty$2) {
286
+ $defineProperty$2(obj, property, {
287
+ configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
288
+ enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
289
+ value: value,
290
+ writable: nonWritable === null && desc ? desc.writable : !nonWritable
291
+ });
292
+ } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
293
+ // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
294
+ obj[property] = value; // eslint-disable-line no-param-reassign
295
+ } else {
296
+ throw new $SyntaxError$2('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
297
+ }
298
+ };
299
+
300
+ var $defineProperty$1 = esDefineProperty;
301
+
302
+ var hasPropertyDescriptors = function hasPropertyDescriptors() {
303
+ return !!$defineProperty$1;
304
+ };
305
+
306
+ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
307
+ // node v0.6 has a bug where array lengths can be Set but not Defined
308
+ if (!$defineProperty$1) {
309
+ return null;
310
+ }
311
+ try {
312
+ return $defineProperty$1([], 'length', { value: 1 }).length !== 1;
313
+ } catch (e) {
314
+ // In Firefox 4-22, defining length on an array throws an exception.
315
+ return true;
316
+ }
317
+ };
318
+
319
+ var hasPropertyDescriptors_1 = hasPropertyDescriptors;
320
+
321
+ var keys = objectKeys$2;
322
+ var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
323
+
324
+ var toStr$7 = Object.prototype.toString;
325
+ var concat = Array.prototype.concat;
326
+ var defineDataProperty = defineDataProperty$1;
327
+
328
+ var isFunction = function (fn) {
329
+ return typeof fn === 'function' && toStr$7.call(fn) === '[object Function]';
330
+ };
331
+
332
+ var supportsDescriptors$2 = hasPropertyDescriptors_1();
333
+
334
+ var defineProperty$1 = function (object, name, value, predicate) {
335
+ if (name in object) {
336
+ if (predicate === true) {
337
+ if (object[name] === value) {
338
+ return;
339
+ }
340
+ } else if (!isFunction(predicate) || !predicate()) {
341
+ return;
342
+ }
343
+ }
344
+
345
+ if (supportsDescriptors$2) {
346
+ defineDataProperty(object, name, value, true);
347
+ } else {
348
+ defineDataProperty(object, name, value);
349
+ }
350
+ };
351
+
352
+ var defineProperties$1 = function (object, map) {
353
+ var predicates = arguments.length > 2 ? arguments[2] : {};
354
+ var props = keys(map);
355
+ if (hasSymbols$5) {
356
+ props = concat.call(props, Object.getOwnPropertySymbols(map));
357
+ }
358
+ for (var i = 0; i < props.length; i += 1) {
359
+ defineProperty$1(object, props[i], map[props[i]], predicates[props[i]]);
360
+ }
361
+ };
362
+
363
+ defineProperties$1.supportsDescriptors = !!supportsDescriptors$2;
364
+
365
+ var defineProperties_1 = defineProperties$1;
366
+
367
+ var callBind$6 = {exports: {}};
368
+
369
+ var implementation$9;
370
+ var hasRequiredImplementation;
371
+
372
+ function requireImplementation () {
373
+ if (hasRequiredImplementation) return implementation$9;
374
+ hasRequiredImplementation = 1;
375
+
376
+ /* eslint no-invalid-this: 1 */
377
+
378
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
379
+ var toStr = Object.prototype.toString;
380
+ var max = Math.max;
381
+ var funcType = '[object Function]';
382
+
383
+ var concatty = function concatty(a, b) {
384
+ var arr = [];
385
+
386
+ for (var i = 0; i < a.length; i += 1) {
387
+ arr[i] = a[i];
388
+ }
389
+ for (var j = 0; j < b.length; j += 1) {
390
+ arr[j + a.length] = b[j];
391
+ }
392
+
393
+ return arr;
394
+ };
395
+
396
+ var slicy = function slicy(arrLike, offset) {
397
+ var arr = [];
398
+ for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
399
+ arr[j] = arrLike[i];
400
+ }
401
+ return arr;
402
+ };
403
+
404
+ var joiny = function (arr, joiner) {
405
+ var str = '';
406
+ for (var i = 0; i < arr.length; i += 1) {
407
+ str += arr[i];
408
+ if (i + 1 < arr.length) {
409
+ str += joiner;
410
+ }
411
+ }
412
+ return str;
413
+ };
414
+
415
+ implementation$9 = function bind(that) {
416
+ var target = this;
417
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
418
+ throw new TypeError(ERROR_MESSAGE + target);
419
+ }
420
+ var args = slicy(arguments, 1);
421
+
422
+ var bound;
423
+ var binder = function () {
424
+ if (this instanceof bound) {
425
+ var result = target.apply(
426
+ this,
427
+ concatty(args, arguments)
428
+ );
429
+ if (Object(result) === result) {
430
+ return result;
431
+ }
432
+ return this;
433
+ }
434
+ return target.apply(
435
+ that,
436
+ concatty(args, arguments)
437
+ );
438
+
439
+ };
440
+
441
+ var boundLength = max(0, target.length - args.length);
442
+ var boundArgs = [];
443
+ for (var i = 0; i < boundLength; i++) {
444
+ boundArgs[i] = '$' + i;
445
+ }
446
+
447
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
448
+
449
+ if (target.prototype) {
450
+ var Empty = function Empty() {};
451
+ Empty.prototype = target.prototype;
452
+ bound.prototype = new Empty();
453
+ Empty.prototype = null;
454
+ }
455
+
456
+ return bound;
457
+ };
458
+ return implementation$9;
459
+ }
460
+
461
+ var functionBind;
462
+ var hasRequiredFunctionBind;
463
+
464
+ function requireFunctionBind () {
465
+ if (hasRequiredFunctionBind) return functionBind;
466
+ hasRequiredFunctionBind = 1;
467
+
468
+ var implementation = requireImplementation();
469
+
470
+ functionBind = Function.prototype.bind || implementation;
471
+ return functionBind;
472
+ }
473
+
474
+ /** @type {import('.')} */
475
+ var esObjectAtoms = Object;
476
+
209
477
  /** @type {import('.')} */
210
478
  var esErrors = Error;
211
479
 
@@ -218,15 +486,42 @@ var range = RangeError;
218
486
  /** @type {import('./ref')} */
219
487
  var ref = ReferenceError;
220
488
 
221
- /** @type {import('./syntax')} */
222
- var syntax = SyntaxError;
223
-
224
- /** @type {import('./type')} */
225
- var type = TypeError;
226
-
227
489
  /** @type {import('./uri')} */
228
490
  var uri = URIError;
229
491
 
492
+ /** @type {import('./abs')} */
493
+ var abs$1 = Math.abs;
494
+
495
+ /** @type {import('./floor')} */
496
+ var floor$1 = Math.floor;
497
+
498
+ /** @type {import('./max')} */
499
+ var max$1 = Math.max;
500
+
501
+ /** @type {import('./min')} */
502
+ var min$1 = Math.min;
503
+
504
+ /** @type {import('./pow')} */
505
+ var pow$1 = Math.pow;
506
+
507
+ /** @type {import('./round')} */
508
+ var round$1 = Math.round;
509
+
510
+ /** @type {import('./isNaN')} */
511
+ var _isNaN = Number.isNaN || function isNaN(a) {
512
+ return a !== a;
513
+ };
514
+
515
+ var $isNaN = _isNaN;
516
+
517
+ /** @type {import('./sign')} */
518
+ var sign$1 = function sign(number) {
519
+ if ($isNaN(number) || number === 0) {
520
+ return number;
521
+ }
522
+ return number < 0 ? -1 : 1;
523
+ };
524
+
230
525
  var shams$1;
231
526
  var hasRequiredShams;
232
527
 
@@ -234,11 +529,13 @@ function requireShams () {
234
529
  if (hasRequiredShams) return shams$1;
235
530
  hasRequiredShams = 1;
236
531
 
532
+ /** @type {import('./shams')} */
237
533
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
238
534
  shams$1 = function hasSymbols() {
239
535
  if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
240
536
  if (typeof Symbol.iterator === 'symbol') { return true; }
241
537
 
538
+ /** @type {{ [k in symbol]?: unknown }} */
242
539
  var obj = {};
243
540
  var sym = Symbol('test');
244
541
  var symObj = Object(sym);
@@ -257,7 +554,7 @@ function requireShams () {
257
554
 
258
555
  var symVal = 42;
259
556
  obj[sym] = symVal;
260
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
557
+ for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
261
558
  if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
262
559
 
263
560
  if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
@@ -268,7 +565,8 @@ function requireShams () {
268
565
  if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
269
566
 
270
567
  if (typeof Object.getOwnPropertyDescriptor === 'function') {
271
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
568
+ // eslint-disable-next-line no-extra-parens
569
+ var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
272
570
  if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
273
571
  }
274
572
 
@@ -280,7 +578,8 @@ function requireShams () {
280
578
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
281
579
  var hasSymbolSham = requireShams();
282
580
 
283
- var hasSymbols$5 = function hasNativeSymbols() {
581
+ /** @type {import('.')} */
582
+ var hasSymbols$4 = function hasNativeSymbols() {
284
583
  if (typeof origSymbol !== 'function') { return false; }
285
584
  if (typeof Symbol !== 'function') { return false; }
286
585
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -289,124 +588,191 @@ var hasSymbols$5 = function hasNativeSymbols() {
289
588
  return hasSymbolSham();
290
589
  };
291
590
 
292
- var test = {
293
- __proto__: null,
294
- foo: {}
295
- };
591
+ var Reflect_getPrototypeOf;
592
+ var hasRequiredReflect_getPrototypeOf;
296
593
 
297
- var $Object$1 = Object;
594
+ function requireReflect_getPrototypeOf () {
595
+ if (hasRequiredReflect_getPrototypeOf) return Reflect_getPrototypeOf;
596
+ hasRequiredReflect_getPrototypeOf = 1;
298
597
 
299
- /** @type {import('.')} */
300
- var hasProto$1 = function hasProto() {
301
- // @ts-expect-error: TS errors on an inherited property for some reason
302
- return { __proto__: test }.foo === test.foo
303
- && !(test instanceof $Object$1);
304
- };
598
+ /** @type {import('./Reflect.getPrototypeOf')} */
599
+ Reflect_getPrototypeOf = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
600
+ return Reflect_getPrototypeOf;
601
+ }
305
602
 
306
- /* eslint no-invalid-this: 1 */
603
+ var Object_getPrototypeOf;
604
+ var hasRequiredObject_getPrototypeOf;
307
605
 
308
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
309
- var toStr$8 = Object.prototype.toString;
310
- var max = Math.max;
311
- var funcType = '[object Function]';
606
+ function requireObject_getPrototypeOf () {
607
+ if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
608
+ hasRequiredObject_getPrototypeOf = 1;
312
609
 
313
- var concatty = function concatty(a, b) {
314
- var arr = [];
610
+ var $Object = esObjectAtoms;
315
611
 
316
- for (var i = 0; i < a.length; i += 1) {
317
- arr[i] = a[i];
318
- }
319
- for (var j = 0; j < b.length; j += 1) {
320
- arr[j + a.length] = b[j];
321
- }
612
+ /** @type {import('./Object.getPrototypeOf')} */
613
+ Object_getPrototypeOf = $Object.getPrototypeOf || null;
614
+ return Object_getPrototypeOf;
615
+ }
322
616
 
323
- return arr;
324
- };
617
+ var functionCall;
618
+ var hasRequiredFunctionCall;
325
619
 
326
- var slicy = function slicy(arrLike, offset) {
327
- var arr = [];
328
- for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
329
- arr[j] = arrLike[i];
330
- }
331
- return arr;
332
- };
620
+ function requireFunctionCall () {
621
+ if (hasRequiredFunctionCall) return functionCall;
622
+ hasRequiredFunctionCall = 1;
333
623
 
334
- var joiny = function (arr, joiner) {
335
- var str = '';
336
- for (var i = 0; i < arr.length; i += 1) {
337
- str += arr[i];
338
- if (i + 1 < arr.length) {
339
- str += joiner;
340
- }
341
- }
342
- return str;
343
- };
624
+ /** @type {import('./functionCall')} */
625
+ functionCall = Function.prototype.call;
626
+ return functionCall;
627
+ }
344
628
 
345
- var implementation$a = function bind(that) {
346
- var target = this;
347
- if (typeof target !== 'function' || toStr$8.apply(target) !== funcType) {
348
- throw new TypeError(ERROR_MESSAGE + target);
349
- }
350
- var args = slicy(arguments, 1);
351
-
352
- var bound;
353
- var binder = function () {
354
- if (this instanceof bound) {
355
- var result = target.apply(
356
- this,
357
- concatty(args, arguments)
358
- );
359
- if (Object(result) === result) {
360
- return result;
361
- }
362
- return this;
363
- }
364
- return target.apply(
365
- that,
366
- concatty(args, arguments)
367
- );
629
+ var functionApply;
630
+ var hasRequiredFunctionApply;
368
631
 
369
- };
632
+ function requireFunctionApply () {
633
+ if (hasRequiredFunctionApply) return functionApply;
634
+ hasRequiredFunctionApply = 1;
370
635
 
371
- var boundLength = max(0, target.length - args.length);
372
- var boundArgs = [];
373
- for (var i = 0; i < boundLength; i++) {
374
- boundArgs[i] = '$' + i;
375
- }
636
+ /** @type {import('./functionApply')} */
637
+ functionApply = Function.prototype.apply;
638
+ return functionApply;
639
+ }
376
640
 
377
- bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
641
+ /** @type {import('./reflectApply')} */
642
+ var reflectApply$1 = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
378
643
 
379
- if (target.prototype) {
380
- var Empty = function Empty() {};
381
- Empty.prototype = target.prototype;
382
- bound.prototype = new Empty();
383
- Empty.prototype = null;
384
- }
644
+ var bind$2 = requireFunctionBind();
385
645
 
386
- return bound;
387
- };
646
+ var $apply$1 = requireFunctionApply();
647
+ var $call$2 = requireFunctionCall();
648
+ var $reflectApply = reflectApply$1;
388
649
 
389
- var implementation$9 = implementation$a;
650
+ /** @type {import('./actualApply')} */
651
+ var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
390
652
 
391
- var functionBind = Function.prototype.bind || implementation$9;
653
+ var bind$1 = requireFunctionBind();
654
+ var $TypeError$9 = type;
392
655
 
393
- var call = Function.prototype.call;
394
- var $hasOwn = Object.prototype.hasOwnProperty;
395
- var bind$1 = functionBind;
656
+ var $call$1 = requireFunctionCall();
657
+ var $actualApply = actualApply;
396
658
 
397
659
  /** @type {import('.')} */
398
- var hasown = bind$1.call(call, $hasOwn);
660
+ var callBindApplyHelpers = function callBindBasic(args) {
661
+ if (args.length < 1 || typeof args[0] !== 'function') {
662
+ throw new $TypeError$9('a function is required');
663
+ }
664
+ return $actualApply(bind$1, $call$1, args);
665
+ };
666
+
667
+ var get;
668
+ var hasRequiredGet;
669
+
670
+ function requireGet () {
671
+ if (hasRequiredGet) return get;
672
+ hasRequiredGet = 1;
673
+
674
+ var callBind = callBindApplyHelpers;
675
+ var gOPD = gopd$1;
676
+
677
+ var hasProtoAccessor;
678
+ try {
679
+ // eslint-disable-next-line no-extra-parens, no-proto
680
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
681
+ } catch (e) {
682
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
683
+ throw e;
684
+ }
685
+ }
686
+
687
+ // eslint-disable-next-line no-extra-parens
688
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
689
+
690
+ var $Object = Object;
691
+ var $getPrototypeOf = $Object.getPrototypeOf;
692
+
693
+ /** @type {import('./get')} */
694
+ get = desc && typeof desc.get === 'function'
695
+ ? callBind([desc.get])
696
+ : typeof $getPrototypeOf === 'function'
697
+ ? /** @type {import('./get')} */ function getDunder(value) {
698
+ // eslint-disable-next-line eqeqeq
699
+ return $getPrototypeOf(value == null ? value : $Object(value));
700
+ }
701
+ : false;
702
+ return get;
703
+ }
704
+
705
+ var getProto$2;
706
+ var hasRequiredGetProto;
707
+
708
+ function requireGetProto () {
709
+ if (hasRequiredGetProto) return getProto$2;
710
+ hasRequiredGetProto = 1;
711
+
712
+ var reflectGetProto = requireReflect_getPrototypeOf();
713
+ var originalGetProto = requireObject_getPrototypeOf();
714
+
715
+ var getDunderProto = requireGet();
716
+
717
+ /** @type {import('.')} */
718
+ getProto$2 = reflectGetProto
719
+ ? function getProto(O) {
720
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
721
+ return reflectGetProto(O);
722
+ }
723
+ : originalGetProto
724
+ ? function getProto(O) {
725
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
726
+ throw new TypeError('getProto: not an object');
727
+ }
728
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
729
+ return originalGetProto(O);
730
+ }
731
+ : getDunderProto
732
+ ? function getProto(O) {
733
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
734
+ return getDunderProto(O);
735
+ }
736
+ : null;
737
+ return getProto$2;
738
+ }
739
+
740
+ var hasown;
741
+ var hasRequiredHasown;
742
+
743
+ function requireHasown () {
744
+ if (hasRequiredHasown) return hasown;
745
+ hasRequiredHasown = 1;
746
+
747
+ var call = Function.prototype.call;
748
+ var $hasOwn = Object.prototype.hasOwnProperty;
749
+ var bind = requireFunctionBind();
750
+
751
+ /** @type {import('.')} */
752
+ hasown = bind.call(call, $hasOwn);
753
+ return hasown;
754
+ }
399
755
 
400
756
  var undefined$1;
401
757
 
758
+ var $Object$1 = esObjectAtoms;
759
+
402
760
  var $Error = esErrors;
403
761
  var $EvalError = _eval;
404
762
  var $RangeError = range;
405
763
  var $ReferenceError = ref;
406
- var $SyntaxError$2 = syntax;
407
- var $TypeError$6 = type;
764
+ var $SyntaxError$1 = syntax;
765
+ var $TypeError$8 = type;
408
766
  var $URIError = uri;
409
767
 
768
+ var abs = abs$1;
769
+ var floor = floor$1;
770
+ var max = max$1;
771
+ var min = min$1;
772
+ var pow = pow$1;
773
+ var round = round$1;
774
+ var sign = sign$1;
775
+
410
776
  var $Function = Function;
411
777
 
412
778
  // eslint-disable-next-line consistent-return
@@ -416,19 +782,13 @@ var getEvalledConstructor = function (expressionSyntax) {
416
782
  } catch (e) {}
417
783
  };
418
784
 
419
- var $gOPD$2 = Object.getOwnPropertyDescriptor;
420
- if ($gOPD$2) {
421
- try {
422
- $gOPD$2({}, '');
423
- } catch (e) {
424
- $gOPD$2 = null; // this is IE 8, which has a broken gOPD
425
- }
426
- }
785
+ var $gOPD$1 = gopd$1;
786
+ var $defineProperty = esDefineProperty;
427
787
 
428
788
  var throwTypeError = function () {
429
- throw new $TypeError$6();
789
+ throw new $TypeError$8();
430
790
  };
431
- var ThrowTypeError = $gOPD$2
791
+ var ThrowTypeError = $gOPD$1
432
792
  ? (function () {
433
793
  try {
434
794
  // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
@@ -437,7 +797,7 @@ var ThrowTypeError = $gOPD$2
437
797
  } catch (calleeThrows) {
438
798
  try {
439
799
  // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
440
- return $gOPD$2(arguments, 'callee').get;
800
+ return $gOPD$1(arguments, 'callee').get;
441
801
  } catch (gOPDthrows) {
442
802
  return throwTypeError;
443
803
  }
@@ -445,14 +805,14 @@ var ThrowTypeError = $gOPD$2
445
805
  }())
446
806
  : throwTypeError;
447
807
 
448
- var hasSymbols$4 = hasSymbols$5();
449
- var hasProto = hasProto$1();
808
+ var hasSymbols$3 = hasSymbols$4();
450
809
 
451
- var getProto$1 = Object.getPrototypeOf || (
452
- hasProto
453
- ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
454
- : null
455
- );
810
+ var getProto$1 = requireGetProto();
811
+ var $ObjectGPO = requireObject_getPrototypeOf();
812
+ var $ReflectGPO = requireReflect_getPrototypeOf();
813
+
814
+ var $apply = requireFunctionApply();
815
+ var $call = requireFunctionCall();
456
816
 
457
817
  var needsEval = {};
458
818
 
@@ -463,7 +823,7 @@ var INTRINSICS = {
463
823
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
464
824
  '%Array%': Array,
465
825
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
466
- '%ArrayIteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1([][Symbol.iterator]()) : undefined$1,
826
+ '%ArrayIteratorPrototype%': hasSymbols$3 && getProto$1 ? getProto$1([][Symbol.iterator]()) : undefined$1,
467
827
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
468
828
  '%AsyncFunction%': needsEval,
469
829
  '%AsyncGenerator%': needsEval,
@@ -493,13 +853,14 @@ var INTRINSICS = {
493
853
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
494
854
  '%isFinite%': isFinite,
495
855
  '%isNaN%': isNaN,
496
- '%IteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1(getProto$1([][Symbol.iterator]())) : undefined$1,
856
+ '%IteratorPrototype%': hasSymbols$3 && getProto$1 ? getProto$1(getProto$1([][Symbol.iterator]())) : undefined$1,
497
857
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
498
858
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
499
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$4 || !getProto$1 ? undefined$1 : getProto$1(new Map()[Symbol.iterator]()),
859
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$1 ? undefined$1 : getProto$1(new Map()[Symbol.iterator]()),
500
860
  '%Math%': Math,
501
861
  '%Number%': Number,
502
- '%Object%': Object,
862
+ '%Object%': $Object$1,
863
+ '%Object.getOwnPropertyDescriptor%': $gOPD$1,
503
864
  '%parseFloat%': parseFloat,
504
865
  '%parseInt%': parseInt,
505
866
  '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
@@ -509,15 +870,15 @@ var INTRINSICS = {
509
870
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
510
871
  '%RegExp%': RegExp,
511
872
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
512
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$4 || !getProto$1 ? undefined$1 : getProto$1(new Set()[Symbol.iterator]()),
873
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$1 ? undefined$1 : getProto$1(new Set()[Symbol.iterator]()),
513
874
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
514
875
  '%String%': String,
515
- '%StringIteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1(''[Symbol.iterator]()) : undefined$1,
516
- '%Symbol%': hasSymbols$4 ? Symbol : undefined$1,
517
- '%SyntaxError%': $SyntaxError$2,
876
+ '%StringIteratorPrototype%': hasSymbols$3 && getProto$1 ? getProto$1(''[Symbol.iterator]()) : undefined$1,
877
+ '%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
878
+ '%SyntaxError%': $SyntaxError$1,
518
879
  '%ThrowTypeError%': ThrowTypeError,
519
880
  '%TypedArray%': TypedArray,
520
- '%TypeError%': $TypeError$6,
881
+ '%TypeError%': $TypeError$8,
521
882
  '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
522
883
  '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
523
884
  '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
@@ -525,7 +886,20 @@ var INTRINSICS = {
525
886
  '%URIError%': $URIError,
526
887
  '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
527
888
  '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
528
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
889
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
890
+
891
+ '%Function.prototype.call%': $call,
892
+ '%Function.prototype.apply%': $apply,
893
+ '%Object.defineProperty%': $defineProperty,
894
+ '%Object.getPrototypeOf%': $ObjectGPO,
895
+ '%Math.abs%': abs,
896
+ '%Math.floor%': floor,
897
+ '%Math.max%': max,
898
+ '%Math.min%': min,
899
+ '%Math.pow%': pow,
900
+ '%Math.round%': round,
901
+ '%Math.sign%': sign,
902
+ '%Reflect.getPrototypeOf%': $ReflectGPO
529
903
  };
530
904
 
531
905
  if (getProto$1) {
@@ -618,13 +992,13 @@ var LEGACY_ALIASES = {
618
992
  '%WeakSetPrototype%': ['WeakSet', 'prototype']
619
993
  };
620
994
 
621
- var bind = functionBind;
622
- var hasOwn$2 = hasown;
623
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
624
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
625
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
626
- var $strSlice = bind.call(Function.call, String.prototype.slice);
627
- var $exec$1 = bind.call(Function.call, RegExp.prototype.exec);
995
+ var bind = requireFunctionBind();
996
+ var hasOwn$2 = requireHasown();
997
+ var $concat$1 = bind.call($call, Array.prototype.concat);
998
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
999
+ var $replace$1 = bind.call($call, String.prototype.replace);
1000
+ var $strSlice = bind.call($call, String.prototype.slice);
1001
+ var $exec$1 = bind.call($call, RegExp.prototype.exec);
628
1002
 
629
1003
  /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
630
1004
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
@@ -633,9 +1007,9 @@ var stringToPath = function stringToPath(string) {
633
1007
  var first = $strSlice(string, 0, 1);
634
1008
  var last = $strSlice(string, -1);
635
1009
  if (first === '%' && last !== '%') {
636
- throw new $SyntaxError$2('invalid intrinsic syntax, expected closing `%`');
1010
+ throw new $SyntaxError$1('invalid intrinsic syntax, expected closing `%`');
637
1011
  } else if (last === '%' && first !== '%') {
638
- throw new $SyntaxError$2('invalid intrinsic syntax, expected opening `%`');
1012
+ throw new $SyntaxError$1('invalid intrinsic syntax, expected opening `%`');
639
1013
  }
640
1014
  var result = [];
641
1015
  $replace$1(string, rePropName, function (match, number, quote, subString) {
@@ -659,7 +1033,7 @@ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
659
1033
  value = doEval(intrinsicName);
660
1034
  }
661
1035
  if (typeof value === 'undefined' && !allowMissing) {
662
- throw new $TypeError$6('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1036
+ throw new $TypeError$8('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
663
1037
  }
664
1038
 
665
1039
  return {
@@ -669,19 +1043,19 @@ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
669
1043
  };
670
1044
  }
671
1045
 
672
- throw new $SyntaxError$2('intrinsic ' + name + ' does not exist!');
1046
+ throw new $SyntaxError$1('intrinsic ' + name + ' does not exist!');
673
1047
  };
674
1048
 
675
1049
  var getIntrinsic = function GetIntrinsic(name, allowMissing) {
676
1050
  if (typeof name !== 'string' || name.length === 0) {
677
- throw new $TypeError$6('intrinsic name must be a non-empty string');
1051
+ throw new $TypeError$8('intrinsic name must be a non-empty string');
678
1052
  }
679
1053
  if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
680
- throw new $TypeError$6('"allowMissing" argument must be a boolean');
1054
+ throw new $TypeError$8('"allowMissing" argument must be a boolean');
681
1055
  }
682
1056
 
683
1057
  if ($exec$1(/^%?[^%]*%?$/, name) === null) {
684
- throw new $SyntaxError$2('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
1058
+ throw new $SyntaxError$1('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
685
1059
  }
686
1060
  var parts = stringToPath(name);
687
1061
  var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
@@ -708,7 +1082,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
708
1082
  )
709
1083
  && first !== last
710
1084
  ) {
711
- throw new $SyntaxError$2('property names with quotes must have matching quotes');
1085
+ throw new $SyntaxError$1('property names with quotes must have matching quotes');
712
1086
  }
713
1087
  if (part === 'constructor' || !isOwn) {
714
1088
  skipFurtherCaching = true;
@@ -722,12 +1096,12 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
722
1096
  } else if (value != null) {
723
1097
  if (!(part in value)) {
724
1098
  if (!allowMissing) {
725
- throw new $TypeError$6('base intrinsic for ' + name + ' exists, but the property is not available.');
1099
+ throw new $TypeError$8('base intrinsic for ' + name + ' exists, but the property is not available.');
726
1100
  }
727
- return void undefined$1;
1101
+ return void 0;
728
1102
  }
729
- if ($gOPD$2 && (i + 1) >= parts.length) {
730
- var desc = $gOPD$2(value, part);
1103
+ if ($gOPD$1 && (i + 1) >= parts.length) {
1104
+ var desc = $gOPD$1(value, part);
731
1105
  isOwn = !!desc;
732
1106
 
733
1107
  // By convention, when a data property is converted to an accessor
@@ -755,184 +1129,21 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
755
1129
  return value;
756
1130
  };
757
1131
 
758
- var esDefineProperty;
759
- var hasRequiredEsDefineProperty;
760
-
761
- function requireEsDefineProperty () {
762
- if (hasRequiredEsDefineProperty) return esDefineProperty;
763
- hasRequiredEsDefineProperty = 1;
764
-
765
- var GetIntrinsic = getIntrinsic;
766
-
767
- /** @type {import('.')} */
768
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
769
- if ($defineProperty) {
770
- try {
771
- $defineProperty({}, 'a', { value: 1 });
772
- } catch (e) {
773
- // IE 8 has a broken defineProperty
774
- $defineProperty = false;
775
- }
776
- }
777
-
778
- esDefineProperty = $defineProperty;
779
- return esDefineProperty;
780
- }
781
-
782
- var GetIntrinsic$7 = getIntrinsic;
783
-
784
- var $gOPD$1 = GetIntrinsic$7('%Object.getOwnPropertyDescriptor%', true);
785
-
786
- if ($gOPD$1) {
787
- try {
788
- $gOPD$1([], 'length');
789
- } catch (e) {
790
- // IE 8 has a broken gOPD
791
- $gOPD$1 = null;
792
- }
793
- }
794
-
795
- var gopd$1 = $gOPD$1;
796
-
797
- var $defineProperty$1 = requireEsDefineProperty();
798
-
799
- var $SyntaxError$1 = syntax;
800
- var $TypeError$5 = type;
801
-
802
- var gopd = gopd$1;
803
-
804
- /** @type {import('.')} */
805
- var defineDataProperty$1 = function defineDataProperty(
806
- obj,
807
- property,
808
- value
809
- ) {
810
- if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
811
- throw new $TypeError$5('`obj` must be an object or a function`');
812
- }
813
- if (typeof property !== 'string' && typeof property !== 'symbol') {
814
- throw new $TypeError$5('`property` must be a string or a symbol`');
815
- }
816
- if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
817
- throw new $TypeError$5('`nonEnumerable`, if provided, must be a boolean or null');
818
- }
819
- if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
820
- throw new $TypeError$5('`nonWritable`, if provided, must be a boolean or null');
821
- }
822
- if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
823
- throw new $TypeError$5('`nonConfigurable`, if provided, must be a boolean or null');
824
- }
825
- if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
826
- throw new $TypeError$5('`loose`, if provided, must be a boolean');
827
- }
828
-
829
- var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
830
- var nonWritable = arguments.length > 4 ? arguments[4] : null;
831
- var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
832
- var loose = arguments.length > 6 ? arguments[6] : false;
833
-
834
- /* @type {false | TypedPropertyDescriptor<unknown>} */
835
- var desc = !!gopd && gopd(obj, property);
836
-
837
- if ($defineProperty$1) {
838
- $defineProperty$1(obj, property, {
839
- configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
840
- enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
841
- value: value,
842
- writable: nonWritable === null && desc ? desc.writable : !nonWritable
843
- });
844
- } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
845
- // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
846
- obj[property] = value; // eslint-disable-line no-param-reassign
847
- } else {
848
- throw new $SyntaxError$1('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
849
- }
850
- };
851
-
852
- var $defineProperty = requireEsDefineProperty();
853
-
854
- var hasPropertyDescriptors = function hasPropertyDescriptors() {
855
- return !!$defineProperty;
856
- };
857
-
858
- hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
859
- // node v0.6 has a bug where array lengths can be Set but not Defined
860
- if (!$defineProperty) {
861
- return null;
862
- }
863
- try {
864
- return $defineProperty([], 'length', { value: 1 }).length !== 1;
865
- } catch (e) {
866
- // In Firefox 4-22, defining length on an array throws an exception.
867
- return true;
868
- }
869
- };
870
-
871
- var hasPropertyDescriptors_1 = hasPropertyDescriptors;
872
-
873
- var keys = objectKeys$2;
874
- var hasSymbols$3 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
875
-
876
- var toStr$7 = Object.prototype.toString;
877
- var concat = Array.prototype.concat;
878
- var defineDataProperty = defineDataProperty$1;
879
-
880
- var isFunction = function (fn) {
881
- return typeof fn === 'function' && toStr$7.call(fn) === '[object Function]';
882
- };
883
-
884
- var supportsDescriptors$2 = hasPropertyDescriptors_1();
885
-
886
- var defineProperty$1 = function (object, name, value, predicate) {
887
- if (name in object) {
888
- if (predicate === true) {
889
- if (object[name] === value) {
890
- return;
891
- }
892
- } else if (!isFunction(predicate) || !predicate()) {
893
- return;
894
- }
895
- }
896
-
897
- if (supportsDescriptors$2) {
898
- defineDataProperty(object, name, value, true);
899
- } else {
900
- defineDataProperty(object, name, value);
901
- }
902
- };
903
-
904
- var defineProperties$1 = function (object, map) {
905
- var predicates = arguments.length > 2 ? arguments[2] : {};
906
- var props = keys(map);
907
- if (hasSymbols$3) {
908
- props = concat.call(props, Object.getOwnPropertySymbols(map));
909
- }
910
- for (var i = 0; i < props.length; i += 1) {
911
- defineProperty$1(object, props[i], map[props[i]], predicates[props[i]]);
912
- }
913
- };
914
-
915
- defineProperties$1.supportsDescriptors = !!supportsDescriptors$2;
916
-
917
- var defineProperties_1 = defineProperties$1;
918
-
919
- var callBind$6 = {exports: {}};
920
-
921
- var GetIntrinsic$6 = getIntrinsic;
1132
+ var GetIntrinsic$8 = getIntrinsic;
922
1133
  var define$5 = defineDataProperty$1;
923
1134
  var hasDescriptors$1 = hasPropertyDescriptors_1();
924
1135
  var gOPD$4 = gopd$1;
925
1136
 
926
- var $TypeError$4 = type;
927
- var $floor$1 = GetIntrinsic$6('%Math.floor%');
1137
+ var $TypeError$7 = type;
1138
+ var $floor$1 = GetIntrinsic$8('%Math.floor%');
928
1139
 
929
1140
  /** @type {import('.')} */
930
1141
  var setFunctionLength = function setFunctionLength(fn, length) {
931
1142
  if (typeof fn !== 'function') {
932
- throw new $TypeError$4('`fn` is not a function');
1143
+ throw new $TypeError$7('`fn` is not a function');
933
1144
  }
934
1145
  if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor$1(length) !== length) {
935
- throw new $TypeError$4('`length` must be a positive 32-bit integer');
1146
+ throw new $TypeError$7('`length` must be a positive 32-bit integer');
936
1147
  }
937
1148
 
938
1149
  var loose = arguments.length > 2 && !!arguments[2];
@@ -961,7 +1172,7 @@ var setFunctionLength = function setFunctionLength(fn, length) {
961
1172
 
962
1173
  (function (module) {
963
1174
 
964
- var bind = functionBind;
1175
+ var bind = requireFunctionBind();
965
1176
  var GetIntrinsic = getIntrinsic;
966
1177
  var setFunctionLength$1 = setFunctionLength;
967
1178
 
@@ -970,7 +1181,7 @@ var setFunctionLength = function setFunctionLength(fn, length) {
970
1181
  var $call = GetIntrinsic('%Function.prototype.call%');
971
1182
  var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
972
1183
 
973
- var $defineProperty = requireEsDefineProperty();
1184
+ var $defineProperty = esDefineProperty;
974
1185
  var $max = GetIntrinsic('%Math.max%');
975
1186
 
976
1187
  module.exports = function callBind(originalFunction) {
@@ -998,15 +1209,15 @@ var setFunctionLength = function setFunctionLength(fn, length) {
998
1209
 
999
1210
  var callBindExports = callBind$6.exports;
1000
1211
 
1001
- var GetIntrinsic$5 = getIntrinsic;
1212
+ var GetIntrinsic$7 = getIntrinsic;
1002
1213
 
1003
1214
  var callBind$5 = callBindExports;
1004
1215
 
1005
- var $indexOf$1 = callBind$5(GetIntrinsic$5('String.prototype.indexOf'));
1216
+ var $indexOf$2 = callBind$5(GetIntrinsic$7('String.prototype.indexOf'));
1006
1217
 
1007
- var callBound$c = function callBoundIntrinsic(name, allowMissing) {
1008
- var intrinsic = GetIntrinsic$5(name, !!allowMissing);
1009
- if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
1218
+ var callBound$e = function callBoundIntrinsic(name, allowMissing) {
1219
+ var intrinsic = GetIntrinsic$7(name, !!allowMissing);
1220
+ if (typeof intrinsic === 'function' && $indexOf$2(name, '.prototype.') > -1) {
1010
1221
  return callBind$5(intrinsic);
1011
1222
  }
1012
1223
  return intrinsic;
@@ -1015,10 +1226,10 @@ var callBound$c = function callBoundIntrinsic(name, allowMissing) {
1015
1226
  // modified from https://github.com/es-shims/es6-shim
1016
1227
  var objectKeys$1 = objectKeys$2;
1017
1228
  var hasSymbols$2 = requireShams()();
1018
- var callBound$b = callBound$c;
1229
+ var callBound$d = callBound$e;
1019
1230
  var toObject = Object;
1020
- var $push = callBound$b('Array.prototype.push');
1021
- var $propIsEnumerable = callBound$b('Object.prototype.propertyIsEnumerable');
1231
+ var $push = callBound$d('Array.prototype.push');
1232
+ var $propIsEnumerable = callBound$d('Object.prototype.propertyIsEnumerable');
1022
1233
  var originalGetSymbols = hasSymbols$2 ? Object.getOwnPropertySymbols : null;
1023
1234
 
1024
1235
  // eslint-disable-next-line no-unused-vars
@@ -1179,12 +1390,12 @@ var define$3 = defineDataProperty$1;
1179
1390
  var hasDescriptors = hasPropertyDescriptors_1();
1180
1391
  var functionsHaveConfigurableNames = functionsHaveNames_1.functionsHaveConfigurableNames();
1181
1392
 
1182
- var $TypeError$3 = type;
1393
+ var $TypeError$6 = type;
1183
1394
 
1184
1395
  /** @type {import('.')} */
1185
1396
  var setFunctionName$1 = function setFunctionName(fn, name) {
1186
1397
  if (typeof fn !== 'function') {
1187
- throw new $TypeError$3('`fn` is not a function');
1398
+ throw new $TypeError$6('`fn` is not a function');
1188
1399
  }
1189
1400
  var loose = arguments.length > 2 && !!arguments[2];
1190
1401
  if (!loose || functionsHaveConfigurableNames) {
@@ -1198,13 +1409,13 @@ var setFunctionName$1 = function setFunctionName(fn, name) {
1198
1409
  };
1199
1410
 
1200
1411
  var setFunctionName = setFunctionName$1;
1201
- var $TypeError$2 = type;
1412
+ var $TypeError$5 = type;
1202
1413
 
1203
1414
  var $Object = Object;
1204
1415
 
1205
1416
  var implementation$5 = setFunctionName(function flags() {
1206
1417
  if (this == null || this !== $Object(this)) {
1207
- throw new $TypeError$2('RegExp.prototype.flags getter called on non-object');
1418
+ throw new $TypeError$5('RegExp.prototype.flags getter called on non-object');
1208
1419
  }
1209
1420
  var result = '';
1210
1421
  if (this.hasIndices) {
@@ -1321,9 +1532,9 @@ var shams = function hasToStringTagShams() {
1321
1532
  };
1322
1533
 
1323
1534
  var hasToStringTag$7 = shams();
1324
- var callBound$a = callBound$c;
1535
+ var callBound$c = callBound$e;
1325
1536
 
1326
- var $toString$4 = callBound$a('Object.prototype.toString');
1537
+ var $toString$4 = callBound$c('Object.prototype.toString');
1327
1538
 
1328
1539
  var isStandardArguments = function isArguments(value) {
1329
1540
  if (hasToStringTag$7 && value && typeof value === 'object' && Symbol.toStringTag in value) {
@@ -1411,7 +1622,7 @@ function addNumericSeparator(num, str) {
1411
1622
  num === Infinity
1412
1623
  || num === -Infinity
1413
1624
  || num !== num
1414
- || (num && num > -1000 && num < 1000)
1625
+ || (num && num > -1e3 && num < 1000)
1415
1626
  || $test.call(/e/, str)
1416
1627
  ) {
1417
1628
  return str;
@@ -1432,10 +1643,21 @@ var utilInspect = require$$0;
1432
1643
  var inspectCustom = utilInspect.custom;
1433
1644
  var inspectSymbol = isSymbol$2(inspectCustom) ? inspectCustom : null;
1434
1645
 
1646
+ var quotes = {
1647
+ __proto__: null,
1648
+ 'double': '"',
1649
+ single: "'"
1650
+ };
1651
+ var quoteREs = {
1652
+ __proto__: null,
1653
+ 'double': /(["\\])/g,
1654
+ single: /(['\\])/g
1655
+ };
1656
+
1435
1657
  var objectInspect = function inspect_(obj, options, depth, seen) {
1436
1658
  var opts = options || {};
1437
1659
 
1438
- if (has$1(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
1660
+ if (has$1(opts, 'quoteStyle') && !has$1(quotes, opts.quoteStyle)) {
1439
1661
  throw new TypeError('option "quoteStyle" must be "single" or "double"');
1440
1662
  }
1441
1663
  if (
@@ -1607,7 +1829,10 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
1607
1829
  if (typeof window !== 'undefined' && obj === window) {
1608
1830
  return '{ [object Window] }';
1609
1831
  }
1610
- if (obj === commonjsGlobal) {
1832
+ if (
1833
+ (typeof globalThis !== 'undefined' && obj === globalThis)
1834
+ || (typeof commonjsGlobal !== 'undefined' && obj === commonjsGlobal)
1835
+ ) {
1611
1836
  return '{ [object globalThis] }';
1612
1837
  }
1613
1838
  if (!isDate$1(obj) && !isRegExp(obj)) {
@@ -1627,7 +1852,8 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
1627
1852
  };
1628
1853
 
1629
1854
  function wrapQuotes(s, defaultStyle, opts) {
1630
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
1855
+ var style = opts.quoteStyle || defaultStyle;
1856
+ var quoteChar = quotes[style];
1631
1857
  return quoteChar + s + quoteChar;
1632
1858
  }
1633
1859
 
@@ -1785,8 +2011,10 @@ function inspectString(str, opts) {
1785
2011
  var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1786
2012
  return inspectString($slice$1.call(str, 0, opts.maxStringLength), opts) + trailer;
1787
2013
  }
2014
+ var quoteRE = quoteREs[opts.quoteStyle || 'single'];
2015
+ quoteRE.lastIndex = 0;
1788
2016
  // eslint-disable-next-line no-control-regex
1789
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
2017
+ var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1790
2018
  return wrapQuotes(s, 'single', opts);
1791
2019
  }
1792
2020
 
@@ -1886,135 +2114,328 @@ function arrObjKeys(obj, inspect) {
1886
2114
  return xs;
1887
2115
  }
1888
2116
 
1889
- var GetIntrinsic$4 = getIntrinsic;
1890
- var callBound$9 = callBound$c;
1891
- var inspect = objectInspect;
1892
-
1893
- var $TypeError$1 = type;
1894
- var $WeakMap$1 = GetIntrinsic$4('%WeakMap%', true);
1895
- var $Map$3 = GetIntrinsic$4('%Map%', true);
2117
+ var inspect$3 = objectInspect;
1896
2118
 
1897
- var $weakMapGet = callBound$9('WeakMap.prototype.get', true);
1898
- var $weakMapSet = callBound$9('WeakMap.prototype.set', true);
1899
- var $weakMapHas = callBound$9('WeakMap.prototype.has', true);
1900
- var $mapGet$1 = callBound$9('Map.prototype.get', true);
1901
- var $mapSet = callBound$9('Map.prototype.set', true);
1902
- var $mapHas$5 = callBound$9('Map.prototype.has', true);
2119
+ var $TypeError$4 = type;
1903
2120
 
1904
2121
  /*
1905
2122
  * This function traverses the list returning the node corresponding to the given key.
1906
2123
  *
1907
- * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
2124
+ * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.
2125
+ * By doing so, all the recently used nodes can be accessed relatively quickly.
1908
2126
  */
1909
- /** @type {import('.').listGetNode} */
1910
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
2127
+ /** @type {import('./list.d.ts').listGetNode} */
2128
+ // eslint-disable-next-line consistent-return
2129
+ var listGetNode = function (list, key, isDelete) {
1911
2130
  /** @type {typeof list | NonNullable<(typeof list)['next']>} */
1912
2131
  var prev = list;
1913
2132
  /** @type {(typeof list)['next']} */
1914
2133
  var curr;
1915
- for (; (curr = prev.next) !== null; prev = curr) {
2134
+ // eslint-disable-next-line eqeqeq
2135
+ for (; (curr = prev.next) != null; prev = curr) {
1916
2136
  if (curr.key === key) {
1917
2137
  prev.next = curr.next;
1918
- // eslint-disable-next-line no-extra-parens
1919
- curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
1920
- list.next = curr; // eslint-disable-line no-param-reassign
2138
+ if (!isDelete) {
2139
+ // eslint-disable-next-line no-extra-parens
2140
+ curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
2141
+ list.next = curr; // eslint-disable-line no-param-reassign
2142
+ }
1921
2143
  return curr;
1922
2144
  }
1923
2145
  }
1924
2146
  };
1925
2147
 
1926
- /** @type {import('.').listGet} */
2148
+ /** @type {import('./list.d.ts').listGet} */
1927
2149
  var listGet = function (objects, key) {
2150
+ if (!objects) {
2151
+ return void 0;
2152
+ }
1928
2153
  var node = listGetNode(objects, key);
1929
2154
  return node && node.value;
1930
2155
  };
1931
- /** @type {import('.').listSet} */
2156
+ /** @type {import('./list.d.ts').listSet} */
1932
2157
  var listSet = function (objects, key, value) {
1933
2158
  var node = listGetNode(objects, key);
1934
2159
  if (node) {
1935
2160
  node.value = value;
1936
2161
  } else {
1937
2162
  // Prepend the new node to the beginning of the list
1938
- objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
2163
+ objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
1939
2164
  key: key,
1940
2165
  next: objects.next,
1941
2166
  value: value
1942
2167
  });
1943
2168
  }
1944
2169
  };
1945
- /** @type {import('.').listHas} */
2170
+ /** @type {import('./list.d.ts').listHas} */
1946
2171
  var listHas = function (objects, key) {
2172
+ if (!objects) {
2173
+ return false;
2174
+ }
1947
2175
  return !!listGetNode(objects, key);
1948
2176
  };
2177
+ /** @type {import('./list.d.ts').listDelete} */
2178
+ // eslint-disable-next-line consistent-return
2179
+ var listDelete = function (objects, key) {
2180
+ if (objects) {
2181
+ return listGetNode(objects, key, true);
2182
+ }
2183
+ };
2184
+
2185
+ /** @type {import('.')} */
2186
+ var sideChannelList = function getSideChannelList() {
2187
+ /** @typedef {ReturnType<typeof getSideChannelList>} Channel */
2188
+ /** @typedef {Parameters<Channel['get']>[0]} K */
2189
+ /** @typedef {Parameters<Channel['set']>[1]} V */
2190
+
2191
+ /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
2192
+
2193
+ /** @type {Channel} */
2194
+ var channel = {
2195
+ assert: function (key) {
2196
+ if (!channel.has(key)) {
2197
+ throw new $TypeError$4('Side channel does not contain ' + inspect$3(key));
2198
+ }
2199
+ },
2200
+ 'delete': function (key) {
2201
+ var root = $o && $o.next;
2202
+ var deletedNode = listDelete($o, key);
2203
+ if (deletedNode && root && root === deletedNode) {
2204
+ $o = void 0;
2205
+ }
2206
+ return !!deletedNode;
2207
+ },
2208
+ get: function (key) {
2209
+ return listGet($o, key);
2210
+ },
2211
+ has: function (key) {
2212
+ return listHas($o, key);
2213
+ },
2214
+ set: function (key, value) {
2215
+ if (!$o) {
2216
+ // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
2217
+ $o = {
2218
+ next: void 0
2219
+ };
2220
+ }
2221
+ // eslint-disable-next-line no-extra-parens
2222
+ listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);
2223
+ }
2224
+ };
2225
+ // @ts-expect-error TODO: figure out why this is erroring
2226
+ return channel;
2227
+ };
2228
+
2229
+ var GetIntrinsic$6 = getIntrinsic;
2230
+
2231
+ var callBindBasic = callBindApplyHelpers;
2232
+
2233
+ /** @type {(thisArg: string, searchString: string, position?: number) => number} */
2234
+ var $indexOf$1 = callBindBasic([GetIntrinsic$6('%String.prototype.indexOf%')]);
2235
+
2236
+ /** @type {import('.')} */
2237
+ var callBound$b = function callBoundIntrinsic(name, allowMissing) {
2238
+ // eslint-disable-next-line no-extra-parens
2239
+ var intrinsic = /** @type {Parameters<typeof callBindBasic>[0][0]} */ (GetIntrinsic$6(name, !!allowMissing));
2240
+ if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
2241
+ return callBindBasic([intrinsic]);
2242
+ }
2243
+ return intrinsic;
2244
+ };
2245
+
2246
+ var GetIntrinsic$5 = getIntrinsic;
2247
+ var callBound$a = callBound$b;
2248
+ var inspect$2 = objectInspect;
2249
+
2250
+ var $TypeError$3 = type;
2251
+ var $Map$3 = GetIntrinsic$5('%Map%', true);
2252
+
2253
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
2254
+ var $mapGet$1 = callBound$a('Map.prototype.get', true);
2255
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
2256
+ var $mapSet = callBound$a('Map.prototype.set', true);
2257
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2258
+ var $mapHas$5 = callBound$a('Map.prototype.has', true);
2259
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2260
+ var $mapDelete = callBound$a('Map.prototype.delete', true);
2261
+ /** @type {<K, V>(thisArg: Map<K, V>) => number} */
2262
+ var $mapSize$1 = callBound$a('Map.prototype.size', true);
2263
+
2264
+ /** @type {import('.')} */
2265
+ var sideChannelMap = !!$Map$3 && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
2266
+ /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
2267
+ /** @typedef {Parameters<Channel['get']>[0]} K */
2268
+ /** @typedef {Parameters<Channel['set']>[1]} V */
2269
+
2270
+ /** @type {Map<K, V> | undefined} */ var $m;
2271
+
2272
+ /** @type {Channel} */
2273
+ var channel = {
2274
+ assert: function (key) {
2275
+ if (!channel.has(key)) {
2276
+ throw new $TypeError$3('Side channel does not contain ' + inspect$2(key));
2277
+ }
2278
+ },
2279
+ 'delete': function (key) {
2280
+ if ($m) {
2281
+ var result = $mapDelete($m, key);
2282
+ if ($mapSize$1($m) === 0) {
2283
+ $m = void 0;
2284
+ }
2285
+ return result;
2286
+ }
2287
+ return false;
2288
+ },
2289
+ get: function (key) { // eslint-disable-line consistent-return
2290
+ if ($m) {
2291
+ return $mapGet$1($m, key);
2292
+ }
2293
+ },
2294
+ has: function (key) {
2295
+ if ($m) {
2296
+ return $mapHas$5($m, key);
2297
+ }
2298
+ return false;
2299
+ },
2300
+ set: function (key, value) {
2301
+ if (!$m) {
2302
+ // @ts-expect-error TS can't handle narrowing a variable inside a closure
2303
+ $m = new $Map$3();
2304
+ }
2305
+ $mapSet($m, key, value);
2306
+ }
2307
+ };
2308
+
2309
+ // @ts-expect-error TODO: figure out why TS is erroring here
2310
+ return channel;
2311
+ };
2312
+
2313
+ var GetIntrinsic$4 = getIntrinsic;
2314
+ var callBound$9 = callBound$b;
2315
+ var inspect$1 = objectInspect;
2316
+ var getSideChannelMap$1 = sideChannelMap;
2317
+
2318
+ var $TypeError$2 = type;
2319
+ var $WeakMap$1 = GetIntrinsic$4('%WeakMap%', true);
2320
+
2321
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
2322
+ var $weakMapGet = callBound$9('WeakMap.prototype.get', true);
2323
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
2324
+ var $weakMapSet = callBound$9('WeakMap.prototype.set', true);
2325
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2326
+ var $weakMapHas = callBound$9('WeakMap.prototype.has', true);
2327
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2328
+ var $weakMapDelete = callBound$9('WeakMap.prototype.delete', true);
2329
+
2330
+ /** @type {import('.')} */
2331
+ var sideChannelWeakmap = $WeakMap$1
2332
+ ? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {
2333
+ /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
2334
+ /** @typedef {Parameters<Channel['get']>[0]} K */
2335
+ /** @typedef {Parameters<Channel['set']>[1]} V */
2336
+
2337
+ /** @type {WeakMap<K & object, V> | undefined} */ var $wm;
2338
+ /** @type {Channel | undefined} */ var $m;
2339
+
2340
+ /** @type {Channel} */
2341
+ var channel = {
2342
+ assert: function (key) {
2343
+ if (!channel.has(key)) {
2344
+ throw new $TypeError$2('Side channel does not contain ' + inspect$1(key));
2345
+ }
2346
+ },
2347
+ 'delete': function (key) {
2348
+ if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2349
+ if ($wm) {
2350
+ return $weakMapDelete($wm, key);
2351
+ }
2352
+ } else if (getSideChannelMap$1) {
2353
+ if ($m) {
2354
+ return $m['delete'](key);
2355
+ }
2356
+ }
2357
+ return false;
2358
+ },
2359
+ get: function (key) {
2360
+ if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2361
+ if ($wm) {
2362
+ return $weakMapGet($wm, key);
2363
+ }
2364
+ }
2365
+ return $m && $m.get(key);
2366
+ },
2367
+ has: function (key) {
2368
+ if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2369
+ if ($wm) {
2370
+ return $weakMapHas($wm, key);
2371
+ }
2372
+ }
2373
+ return !!$m && $m.has(key);
2374
+ },
2375
+ set: function (key, value) {
2376
+ if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
2377
+ if (!$wm) {
2378
+ $wm = new $WeakMap$1();
2379
+ }
2380
+ $weakMapSet($wm, key, value);
2381
+ } else if (getSideChannelMap$1) {
2382
+ if (!$m) {
2383
+ $m = getSideChannelMap$1();
2384
+ }
2385
+ // eslint-disable-next-line no-extra-parens
2386
+ /** @type {NonNullable<typeof $m>} */ ($m).set(key, value);
2387
+ }
2388
+ }
2389
+ };
2390
+
2391
+ // @ts-expect-error TODO: figure out why this is erroring
2392
+ return channel;
2393
+ }
2394
+ : getSideChannelMap$1;
2395
+
2396
+ var $TypeError$1 = type;
2397
+ var inspect = objectInspect;
2398
+ var getSideChannelList = sideChannelList;
2399
+ var getSideChannelMap = sideChannelMap;
2400
+ var getSideChannelWeakMap = sideChannelWeakmap;
2401
+
2402
+ var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
1949
2403
 
1950
2404
  /** @type {import('.')} */
1951
2405
  var sideChannel = function getSideChannel() {
1952
- /** @type {WeakMap<object, unknown>} */ var $wm;
1953
- /** @type {Map<object, unknown>} */ var $m;
1954
- /** @type {import('.').RootNode<unknown>} */ var $o;
2406
+ /** @typedef {ReturnType<typeof getSideChannel>} Channel */
2407
+
2408
+ /** @type {Channel | undefined} */ var $channelData;
1955
2409
 
1956
- /** @type {import('.').Channel} */
2410
+ /** @type {Channel} */
1957
2411
  var channel = {
1958
2412
  assert: function (key) {
1959
2413
  if (!channel.has(key)) {
1960
2414
  throw new $TypeError$1('Side channel does not contain ' + inspect(key));
1961
2415
  }
1962
2416
  },
1963
- get: function (key) { // eslint-disable-line consistent-return
1964
- if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
1965
- if ($wm) {
1966
- return $weakMapGet($wm, key);
1967
- }
1968
- } else if ($Map$3) {
1969
- if ($m) {
1970
- return $mapGet$1($m, key);
1971
- }
1972
- } else {
1973
- if ($o) { // eslint-disable-line no-lonely-if
1974
- return listGet($o, key);
1975
- }
1976
- }
2417
+ 'delete': function (key) {
2418
+ return !!$channelData && $channelData['delete'](key);
2419
+ },
2420
+ get: function (key) {
2421
+ return $channelData && $channelData.get(key);
1977
2422
  },
1978
2423
  has: function (key) {
1979
- if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
1980
- if ($wm) {
1981
- return $weakMapHas($wm, key);
1982
- }
1983
- } else if ($Map$3) {
1984
- if ($m) {
1985
- return $mapHas$5($m, key);
1986
- }
1987
- } else {
1988
- if ($o) { // eslint-disable-line no-lonely-if
1989
- return listHas($o, key);
1990
- }
1991
- }
1992
- return false;
2424
+ return !!$channelData && $channelData.has(key);
1993
2425
  },
1994
2426
  set: function (key, value) {
1995
- if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
1996
- if (!$wm) {
1997
- $wm = new $WeakMap$1();
1998
- }
1999
- $weakMapSet($wm, key, value);
2000
- } else if ($Map$3) {
2001
- if (!$m) {
2002
- $m = new $Map$3();
2003
- }
2004
- $mapSet($m, key, value);
2005
- } else {
2006
- if (!$o) {
2007
- // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
2008
- $o = { key: {}, next: null };
2009
- }
2010
- listSet($o, key, value);
2427
+ if (!$channelData) {
2428
+ $channelData = makeChannel();
2011
2429
  }
2430
+
2431
+ $channelData.set(key, value);
2012
2432
  }
2013
2433
  };
2434
+ // @ts-expect-error TODO: figure out why this is erroring
2014
2435
  return channel;
2015
2436
  };
2016
2437
 
2017
- var hasOwn = hasown;
2438
+ var hasOwn = requireHasown();
2018
2439
  var channel = sideChannel();
2019
2440
 
2020
2441
  var $TypeError = type;
@@ -2102,7 +2523,7 @@ var stopIterationIterator = function getStopIterationIterator(origIterator) {
2102
2523
  }
2103
2524
  return {
2104
2525
  done: true,
2105
- value: void undefined
2526
+ value: void 0
2106
2527
  };
2107
2528
  }
2108
2529
  }
@@ -2245,7 +2666,7 @@ var isSet$2 = exported$1 || function isSet(x) {
2245
2666
  var isArguments$1 = isArguments$2;
2246
2667
  var getStopIterationIterator = stopIterationIterator;
2247
2668
 
2248
- if (hasSymbols$5() || requireShams()()) {
2669
+ if (hasSymbols$4() || requireShams()()) {
2249
2670
  var $iterator = Symbol.iterator;
2250
2671
  // Symbol is available natively or shammed
2251
2672
  // natively:
@@ -2272,7 +2693,7 @@ if (hasSymbols$5() || requireShams()()) {
2272
2693
  var GetIntrinsic$3 = getIntrinsic;
2273
2694
  var $Map = GetIntrinsic$3('%Map%', true);
2274
2695
  var $Set$1 = GetIntrinsic$3('%Set%', true);
2275
- var callBound$8 = callBound$c;
2696
+ var callBound$8 = callBound$e;
2276
2697
  var $arrayPush = callBound$8('Array.prototype.push');
2277
2698
  var $charCodeAt = callBound$8('String.prototype.charCodeAt');
2278
2699
  var $stringSlice = callBound$8('String.prototype.slice');
@@ -2477,7 +2898,7 @@ define(polyfill, {
2477
2898
  var objectIs = polyfill;
2478
2899
 
2479
2900
  var callBind$1 = callBindExports;
2480
- var callBound$7 = callBound$c;
2901
+ var callBound$7 = callBound$e;
2481
2902
  var GetIntrinsic$2 = getIntrinsic;
2482
2903
 
2483
2904
  var $ArrayBuffer = GetIntrinsic$2('%ArrayBuffer%', true);
@@ -2538,7 +2959,7 @@ var isDateObject = function isDateObject(value) {
2538
2959
  return hasToStringTag$5 ? tryDateObject(value) : toStr$4.call(value) === dateClass;
2539
2960
  };
2540
2961
 
2541
- var callBound$6 = callBound$c;
2962
+ var callBound$6 = callBound$e;
2542
2963
  var hasToStringTag$4 = shams();
2543
2964
  var has;
2544
2965
  var $exec;
@@ -2595,7 +3016,7 @@ var isRegex$1 = hasToStringTag$4
2595
3016
  return $toString$2(value) === regexClass;
2596
3017
  };
2597
3018
 
2598
- var callBound$5 = callBound$c;
3019
+ var callBound$5 = callBound$e;
2599
3020
 
2600
3021
  var $byteLength$1 = callBound$5('SharedArrayBuffer.prototype.byteLength', true);
2601
3022
 
@@ -2639,7 +3060,7 @@ var isNumberObject = function isNumberObject(value) {
2639
3060
  return hasToStringTag$3 ? tryNumberObject(value) : toStr$3.call(value) === numClass;
2640
3061
  };
2641
3062
 
2642
- var callBound$4 = callBound$c;
3063
+ var callBound$4 = callBound$e;
2643
3064
  var $boolToStr = callBound$4('Boolean.prototype.toString');
2644
3065
  var $toString$1 = callBound$4('Object.prototype.toString');
2645
3066
 
@@ -2667,7 +3088,7 @@ var isBooleanObject = function isBoolean(value) {
2667
3088
  var isSymbol$1 = {exports: {}};
2668
3089
 
2669
3090
  var toStr$2 = Object.prototype.toString;
2670
- var hasSymbols = hasSymbols$5();
3091
+ var hasSymbols = hasSymbols$4();
2671
3092
 
2672
3093
  if (hasSymbols) {
2673
3094
  var symToStr = Symbol.prototype.toString;
@@ -2829,7 +3250,7 @@ var isWeakmap = exported || function isWeakMap(x) {
2829
3250
  var isWeakset = {exports: {}};
2830
3251
 
2831
3252
  var GetIntrinsic$1 = getIntrinsic;
2832
- var callBound$3 = callBound$c;
3253
+ var callBound$3 = callBound$e;
2833
3254
 
2834
3255
  var $WeakSet = GetIntrinsic$1('%WeakSet%', true);
2835
3256
 
@@ -3087,7 +3508,7 @@ var availableTypedArrays$1 = function availableTypedArrays() {
3087
3508
  var forEach = forEach_1;
3088
3509
  var availableTypedArrays = availableTypedArrays$1;
3089
3510
  var callBind = callBindExports;
3090
- var callBound$2 = callBound$c;
3511
+ var callBound$2 = callBound$e;
3091
3512
  var gOPD = gopd$1;
3092
3513
 
3093
3514
  /** @type {(O: object) => string} */
@@ -3199,7 +3620,7 @@ var whichTypedArray$1 = function whichTypedArray(value) {
3199
3620
  return tryTypedArrays(value);
3200
3621
  };
3201
3622
 
3202
- var callBound$1 = callBound$c;
3623
+ var callBound$1 = callBound$e;
3203
3624
  var $byteLength = callBound$1('ArrayBuffer.prototype.byteLength', true);
3204
3625
 
3205
3626
  var isArrayBuffer$1 = isArrayBuffer$2;
@@ -3213,7 +3634,7 @@ var arrayBufferByteLength = function byteLength(ab) {
3213
3634
  }; // in node < 0.11, byteLength is an own nonconfigurable property
3214
3635
 
3215
3636
  var assign = object_assign;
3216
- var callBound = callBound$c;
3637
+ var callBound = callBound$e;
3217
3638
  var flags = regexp_prototype_flags;
3218
3639
  var GetIntrinsic = getIntrinsic;
3219
3640
  var getIterator = esGetIteratorExports;
@@ -3605,11 +4026,12 @@ var deepEqual = function deepEqual(a, b, opts) {
3605
4026
 
3606
4027
  var deepEqual$1 = /*@__PURE__*/getDefaultExportFromCjs(deepEqual);
3607
4028
 
4029
+ /* @ts-self-types="./index.d.ts" */
3608
4030
  let urlAlphabet =
3609
4031
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
3610
4032
  let nanoid = (size = 21) => {
3611
4033
  let id = '';
3612
- let i = size;
4034
+ let i = size | 0;
3613
4035
  while (i--) {
3614
4036
  id += urlAlphabet[(Math.random() * 64) | 0];
3615
4037
  }
@@ -3619,21 +4041,17 @@ let nanoid = (size = 21) => {
3619
4041
  const isValidNonEmptyObject = (obj) => {
3620
4042
  return typeof obj === "object" && !Array.isArray(obj) && Object.keys(obj).length !== 0;
3621
4043
  };
3622
- const AsyncListener = (actualUnsub) => {
3623
- return {
3624
- unsubscribe() {
3625
- if (!actualUnsub) {
3626
- console.error("Failed to unsubscribe!");
3627
- return;
3628
- }
3629
- if (typeof actualUnsub === "function") {
3630
- actualUnsub();
3631
- }
3632
- else {
3633
- actualUnsub.then((unsubFunc) => unsubFunc()).catch(console.error);
3634
- }
4044
+ const getListenerWithAsyncUnsubscribe = (unsub) => {
4045
+ const asyncUnsub = () => new Promise((res, rej) => {
4046
+ try {
4047
+ unsub();
4048
+ res();
3635
4049
  }
3636
- };
4050
+ catch (err) {
4051
+ rej(err instanceof Error ? err : new Error(err));
4052
+ }
4053
+ });
4054
+ return { unsubscribe: asyncUnsub };
3637
4055
  };
3638
4056
  const checkIfInElectron = (globalFdc3) => {
3639
4057
  const hasGlue42electron = typeof window !== "undefined" && "glue42electron" in window;
@@ -4751,6 +5169,9 @@ class FDC3Service {
4751
5169
  }
4752
5170
  mergeBaseAppDataWithGlueManifest(baseAppData, hostManifestDefinition) {
4753
5171
  let baseApplicationDefinition = baseAppData;
5172
+ if (hostManifestDefinition.customProperties) {
5173
+ baseApplicationDefinition.userProperties = { ...baseAppData.userProperties, ...hostManifestDefinition.customProperties };
5174
+ }
4754
5175
  if (hostManifestDefinition.details) {
4755
5176
  const details = { ...baseAppData.createOptions, ...hostManifestDefinition.details };
4756
5177
  baseApplicationDefinition.createOptions = details;
@@ -4846,16 +5267,24 @@ const IntentsMethodPrefix = "Tick42.FDC3.Intents.";
4846
5267
  const IO_ERRORS = errors.intents;
4847
5268
  const BrowserClientControlMethodName = "T42.Web.Client.Control";
4848
5269
  const DesktopClientControlMethodName = "T42.Channels.Command";
5270
+ const GlueReceivedPromiseTimeout = 120 * 1000;
4849
5271
 
4850
5272
  const ioConnectFDC3SystemMethod = "FDC3.Collaborate";
4851
5273
  const PrivateChannelPrefix = "___privateFDC3Channel___";
4852
- var PrivateChannelEventMethods;
4853
- (function (PrivateChannelEventMethods) {
4854
- PrivateChannelEventMethods["ListenerAdded"] = "listenerAdded";
4855
- PrivateChannelEventMethods["OnAddContextListener"] = "onAddContextListener";
4856
- PrivateChannelEventMethods["OnUnsubscribe"] = "onUnsubscribe";
4857
- PrivateChannelEventMethods["OnDisconnect"] = "onDisconnect";
4858
- })(PrivateChannelEventMethods || (PrivateChannelEventMethods = {}));
5274
+ var LegacyPrivateChannelEventMethods;
5275
+ (function (LegacyPrivateChannelEventMethods) {
5276
+ LegacyPrivateChannelEventMethods["ListenerAdded"] = "listenerAdded";
5277
+ LegacyPrivateChannelEventMethods["OnAddContextListener"] = "onAddContextListener";
5278
+ LegacyPrivateChannelEventMethods["OnUnsubscribe"] = "onUnsubscribe";
5279
+ LegacyPrivateChannelEventMethods["OnDisconnect"] = "onDisconnect";
5280
+ })(LegacyPrivateChannelEventMethods || (LegacyPrivateChannelEventMethods = {}));
5281
+ var NewPrivateChannelEventMethods;
5282
+ (function (NewPrivateChannelEventMethods) {
5283
+ NewPrivateChannelEventMethods["ContextListenerAdded"] = "contextListenerAdded";
5284
+ NewPrivateChannelEventMethods["AddContextListener"] = "addContextListener";
5285
+ NewPrivateChannelEventMethods["Unsubscribe"] = "unsubscribe";
5286
+ NewPrivateChannelEventMethods["Disconnect"] = "disconnect";
5287
+ })(NewPrivateChannelEventMethods || (NewPrivateChannelEventMethods = {}));
4859
5288
 
4860
5289
  /**
4861
5290
  * Wraps values in an `Ok` type.
@@ -5703,19 +6132,19 @@ const FDC3StartupContextDecoder = object({
5703
6132
  object({
5704
6133
  channelId: optional(nonEmptyStringDecoder)
5705
6134
  });
6135
+ const privateChannelEventTypesDecoder = oneOf(constant("addContextListener"), constant("unsubscribe"), constant("disconnect"));
6136
+ const optionalPrivateChannelEventTypesDecoder = optional(privateChannelEventTypesDecoder);
6137
+ const optionalFdc3EventTypesDecoder = optional(constant("userChannelChanged"));
5706
6138
 
5707
6139
  class GlueController {
5708
6140
  channelsParser;
5709
- channelsStateStore;
5710
6141
  glue;
5711
6142
  _logger;
5712
6143
  glueInitPromise;
5713
6144
  resolveGluePromise;
5714
6145
  rejectGluePromise;
5715
- defaultGluePromiseTimeout = 120 * 1000;
5716
- constructor(channelsParser, channelsStateStore) {
6146
+ constructor(channelsParser) {
5717
6147
  this.channelsParser = channelsParser;
5718
- this.channelsStateStore = channelsStateStore;
5719
6148
  }
5720
6149
  get gluePromise() {
5721
6150
  return this.glueInitPromise.then(this.initializeLogger.bind(this));
@@ -5733,7 +6162,7 @@ class GlueController {
5733
6162
  this.resolveGluePromise = resolve;
5734
6163
  this.rejectGluePromise = reject;
5735
6164
  });
5736
- }, this.defaultGluePromiseTimeout, `Timeout of ${this.defaultGluePromiseTimeout}ms waiting for Glue to initialize`);
6165
+ }, GlueReceivedPromiseTimeout, `Timeout of ${GlueReceivedPromiseTimeout}ms waiting to receive initialized 'io'`);
5737
6166
  }
5738
6167
  get logger() {
5739
6168
  return this._logger;
@@ -5755,11 +6184,14 @@ class GlueController {
5755
6184
  getApplication(name) {
5756
6185
  return this.glue.appManager.application(name);
5757
6186
  }
6187
+ getAllAppManagerInstances() {
6188
+ return this.glue.appManager.instances();
6189
+ }
5758
6190
  getApplicationInstances(appName) {
5759
- return this.glue.appManager.instances().filter(inst => inst.application.name === appName);
6191
+ return this.getAllAppManagerInstances().filter(inst => inst.application.name === appName);
5760
6192
  }
5761
6193
  getAppInstanceById(id) {
5762
- return this.glue.appManager.instances().find(inst => inst.id === id);
6194
+ return this.getAllAppManagerInstances().find(inst => inst.id === id);
5763
6195
  }
5764
6196
  async findIntents(intentFilter) {
5765
6197
  return this.glue.intents.find(intentFilter);
@@ -5792,11 +6224,11 @@ class GlueController {
5792
6224
  }
5793
6225
  return myWin.getContext();
5794
6226
  }
5795
- addIntentListener(intent, handler) {
5796
- const registerMethodExists = this.glue.intents.register;
5797
- return registerMethodExists
5798
- ? this.glue.intents.register(intent, handler)
5799
- : this.glue.intents.addIntentListener(intent, handler);
6227
+ async addIntentListener(intent, handler) {
6228
+ if (typeof this.glue.intents.register === "function") {
6229
+ return await this.glue.intents.register(intent, handler);
6230
+ }
6231
+ return this.glue.intents.addIntentListener(intent, handler);
5800
6232
  }
5801
6233
  getAllContexts() {
5802
6234
  return this.glue.contexts.all();
@@ -5871,7 +6303,11 @@ class GlueController {
5871
6303
  }
5872
6304
  getMyWindow() {
5873
6305
  const win = this.glue.windows.my();
5874
- return isValidNonEmptyObject(win) ? win : undefined;
6306
+ const isValidWindow = isValidNonEmptyObject(win);
6307
+ if (isValidWindow) {
6308
+ return win;
6309
+ }
6310
+ return this.glue.windows.findById(this.glue.interop.instance.instance);
5875
6311
  }
5876
6312
  getMyInteropInstance() {
5877
6313
  return this.glue.interop.instance;
@@ -5952,9 +6388,12 @@ class GlueController {
5952
6388
  getPrefs(app) {
5953
6389
  return this.glue.prefs.get(app);
5954
6390
  }
6391
+ isRunningInBrowser() {
6392
+ return typeof window !== "undefined" && !window.iodesktop;
6393
+ }
5955
6394
  async checkIsFdc3DataWrappingSupported() {
5956
- const globalBrowserNamespace = window.glue42core || window.iobrowser;
5957
- const methodName = globalBrowserNamespace ? BrowserClientControlMethodName : DesktopClientControlMethodName;
6395
+ const inBrowserNamespace = this.isRunningInBrowser();
6396
+ const methodName = inBrowserNamespace ? BrowserClientControlMethodName : DesktopClientControlMethodName;
5958
6397
  const myServer = this.glue.interop.servers().find((server) => server.instance === this.glue.interop.instance.instance);
5959
6398
  if (!myServer) {
5960
6399
  return false;
@@ -5963,7 +6402,7 @@ class GlueController {
5963
6402
  if (!registersControlMethod) {
5964
6403
  return false;
5965
6404
  }
5966
- const data = globalBrowserNamespace ? { domain: "system", operation: "isFdc3DataWrappingSupported" } : { command: "isFdc3DataWrappingSupported" };
6405
+ const data = inBrowserNamespace ? { domain: "system", operation: "isFdc3DataWrappingSupported" } : { command: "isFdc3DataWrappingSupported" };
5967
6406
  try {
5968
6407
  const res = await this.glue.interop.invoke(methodName, data, { instance: this.interopInstance().instance });
5969
6408
  return res.returned.isSupported;
@@ -5989,7 +6428,7 @@ class GlueController {
5989
6428
  }
5990
6429
  return {
5991
6430
  source: {
5992
- appId: instanceServer.applicationName,
6431
+ appId: instanceServer.application ?? instanceServer.applicationName,
5993
6432
  instanceId: instanceServer.instance
5994
6433
  }
5995
6434
  };
@@ -6048,7 +6487,7 @@ const REQUEST_GLUE = "requestGlue";
6048
6487
  const REQUEST_GLUE_RESPONSE = "requestGlueResponse";
6049
6488
  const FDC3_READY = "fdc3Ready";
6050
6489
 
6051
- class EventDispatcher {
6490
+ class WebEventDispatcher {
6052
6491
  fireFdc3Ready() {
6053
6492
  const event = new Event(FDC3_READY);
6054
6493
  window.dispatchEvent(event);
@@ -6068,9 +6507,851 @@ class EventDispatcher {
6068
6507
 
6069
6508
  // To parse this data:
6070
6509
  //
6071
- // import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse, Context } from "./file";
6510
+ // import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, FileAttachment, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file";
6511
+ //
6512
+ // const action = Convert.toAction(json);
6513
+ // const chart = Convert.toChart(json);
6514
+ // const chatInitSettings = Convert.toChatInitSettings(json);
6515
+ // const chatMessage = Convert.toChatMessage(json);
6516
+ // const chatRoom = Convert.toChatRoom(json);
6517
+ // const chatSearchCriteria = Convert.toChatSearchCriteria(json);
6518
+ // const contact = Convert.toContact(json);
6519
+ // const contactList = Convert.toContactList(json);
6520
+ // const context = Convert.toContext(json);
6521
+ // const country = Convert.toCountry(json);
6522
+ // const currency = Convert.toCurrency(json);
6523
+ // const email = Convert.toEmail(json);
6524
+ // const fileAttachment = Convert.toFileAttachment(json);
6525
+ // const instrument = Convert.toInstrument(json);
6526
+ // const instrumentList = Convert.toInstrumentList(json);
6527
+ // const interaction = Convert.toInteraction(json);
6528
+ // const message = Convert.toMessage(json);
6529
+ // const nothing = Convert.toNothing(json);
6530
+ // const order = Convert.toOrder(json);
6531
+ // const orderList = Convert.toOrderList(json);
6532
+ // const organization = Convert.toOrganization(json);
6533
+ // const portfolio = Convert.toPortfolio(json);
6534
+ // const position = Convert.toPosition(json);
6535
+ // const product = Convert.toProduct(json);
6536
+ // const timeRange = Convert.toTimeRange(json);
6537
+ // const trade = Convert.toTrade(json);
6538
+ // const tradeList = Convert.toTradeList(json);
6539
+ // const transactionResult = Convert.toTransactionResult(json);
6540
+ // const valuation = Convert.toValuation(json);
6541
+ //
6542
+ // These functions will throw an error if the JSON doesn't
6543
+ // match the expected interface, even if the JSON is valid.
6544
+ /**
6545
+ * Free text to be used for a keyword search
6546
+ *
6547
+ * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or
6548
+ * `'Meeting'` although other string values are permitted.
6549
+ */
6550
+ // Converts JSON strings to/from your types
6551
+ // and asserts the results of JSON.parse at runtime
6552
+ function a$2(typ) {
6553
+ return { arrayItems: typ };
6554
+ }
6555
+ function u$2(...typs) {
6556
+ return { unionMembers: typs };
6557
+ }
6558
+ function o$2(props, additional) {
6559
+ return { props, additional };
6560
+ }
6561
+ function m$2(additional) {
6562
+ return { props: [], additional };
6563
+ }
6564
+ function r$2(name) {
6565
+ return { ref: name };
6566
+ }
6567
+ ({
6568
+ Action: o$2([
6569
+ { json: 'action', js: 'action', typ: u$2(undefined, r$2('ActionType')) },
6570
+ { json: 'app', js: 'app', typ: u$2(undefined, r$2('AppIdentifier')) },
6571
+ { json: 'channelId', js: 'channelId', typ: u$2(undefined, '') },
6572
+ { json: 'context', js: 'context', typ: r$2('ContextElement') },
6573
+ { json: 'intent', js: 'intent', typ: u$2(undefined, '') },
6574
+ { json: 'title', js: 'title', typ: '' },
6575
+ { json: 'type', js: 'type', typ: r$2('ActionTypeEnum') },
6576
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6577
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6578
+ ], 'any'),
6579
+ AppIdentifier: o$2([
6580
+ { json: 'appId', js: 'appId', typ: '' },
6581
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u$2(undefined, '') },
6582
+ { json: 'instanceId', js: 'instanceId', typ: u$2(undefined, '') },
6583
+ ], 'any'),
6584
+ ContextElement: o$2([
6585
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6586
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6587
+ { json: 'type', js: 'type', typ: '' },
6588
+ ], 'any'),
6589
+ Chart: o$2([
6590
+ { json: 'instruments', js: 'instruments', typ: a$2(r$2('InstrumentElement')) },
6591
+ { json: 'otherConfig', js: 'otherConfig', typ: u$2(undefined, a$2(r$2('ContextElement'))) },
6592
+ { json: 'range', js: 'range', typ: u$2(undefined, r$2('TimeRangeObject')) },
6593
+ { json: 'style', js: 'style', typ: u$2(undefined, r$2('ChartStyle')) },
6594
+ { json: 'type', js: 'type', typ: r$2('ChartType') },
6595
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6596
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6597
+ ], 'any'),
6598
+ InstrumentElement: o$2([
6599
+ { json: 'id', js: 'id', typ: r$2('PurpleInstrumentIdentifiers') },
6600
+ { json: 'market', js: 'market', typ: u$2(undefined, r$2('OrganizationMarket')) },
6601
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6602
+ { json: 'type', js: 'type', typ: r$2('PurpleInteractionType') },
6603
+ ], 'any'),
6604
+ PurpleInstrumentIdentifiers: o$2([
6605
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6606
+ { json: 'CUSIP', js: 'CUSIP', typ: u$2(undefined, '') },
6607
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6608
+ { json: 'FIGI', js: 'FIGI', typ: u$2(undefined, '') },
6609
+ { json: 'ISIN', js: 'ISIN', typ: u$2(undefined, '') },
6610
+ { json: 'PERMID', js: 'PERMID', typ: u$2(undefined, '') },
6611
+ { json: 'RIC', js: 'RIC', typ: u$2(undefined, '') },
6612
+ { json: 'SEDOL', js: 'SEDOL', typ: u$2(undefined, '') },
6613
+ { json: 'ticker', js: 'ticker', typ: u$2(undefined, '') },
6614
+ ], 'any'),
6615
+ OrganizationMarket: o$2([
6616
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6617
+ { json: 'COUNTRY_ISOALPHA2', js: 'COUNTRY_ISOALPHA2', typ: u$2(undefined, '') },
6618
+ { json: 'MIC', js: 'MIC', typ: u$2(undefined, '') },
6619
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6620
+ ], 'any'),
6621
+ TimeRangeObject: o$2([
6622
+ { json: 'endTime', js: 'endTime', typ: u$2(undefined, Date) },
6623
+ { json: 'startTime', js: 'startTime', typ: u$2(undefined, Date) },
6624
+ { json: 'type', js: 'type', typ: r$2('TimeRangeType') },
6625
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6626
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6627
+ ], 'any'),
6628
+ ChatInitSettings: o$2([
6629
+ { json: 'chatName', js: 'chatName', typ: u$2(undefined, '') },
6630
+ { json: 'members', js: 'members', typ: u$2(undefined, r$2('ContactListObject')) },
6631
+ { json: 'message', js: 'message', typ: u$2(undefined, u$2(r$2('MessageObject'), '')) },
6632
+ { json: 'options', js: 'options', typ: u$2(undefined, r$2('ChatOptions')) },
6633
+ { json: 'type', js: 'type', typ: r$2('ChatInitSettingsType') },
6634
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6635
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6636
+ ], 'any'),
6637
+ ContactListObject: o$2([
6638
+ { json: 'contacts', js: 'contacts', typ: a$2(r$2('ContactElement')) },
6639
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6640
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6641
+ { json: 'type', js: 'type', typ: r$2('ContactListType') },
6642
+ ], 'any'),
6643
+ ContactElement: o$2([
6644
+ { json: 'id', js: 'id', typ: r$2('PurpleContactIdentifiers') },
6645
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6646
+ { json: 'type', js: 'type', typ: r$2('FluffyInteractionType') },
6647
+ ], 'any'),
6648
+ PurpleContactIdentifiers: o$2([
6649
+ { json: 'email', js: 'email', typ: u$2(undefined, '') },
6650
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6651
+ ], 'any'),
6652
+ MessageObject: o$2([
6653
+ { json: 'entities', js: 'entities', typ: u$2(undefined, m$2(r$2('EntityValue'))) },
6654
+ { json: 'text', js: 'text', typ: u$2(undefined, r$2('PurpleMessageText')) },
6655
+ { json: 'type', js: 'type', typ: r$2('MessageType') },
6656
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6657
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6658
+ ], 'any'),
6659
+ EntityValue: o$2([
6660
+ { json: 'action', js: 'action', typ: u$2(undefined, r$2('ActionType')) },
6661
+ { json: 'app', js: 'app', typ: u$2(undefined, r$2('AppIdentifier')) },
6662
+ { json: 'channelId', js: 'channelId', typ: u$2(undefined, '') },
6663
+ { json: 'context', js: 'context', typ: u$2(undefined, r$2('ContextElement')) },
6664
+ { json: 'intent', js: 'intent', typ: u$2(undefined, '') },
6665
+ { json: 'title', js: 'title', typ: u$2(undefined, '') },
6666
+ { json: 'type', js: 'type', typ: r$2('EntityType') },
6667
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6668
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6669
+ { json: 'data', js: 'data', typ: u$2(undefined, r$2('EntityData')) },
6670
+ ], 'any'),
6671
+ PurpleMessageText: o$2([
6672
+ { json: 'text/markdown', js: 'text/markdown', typ: u$2(undefined, '') },
6673
+ { json: 'text/plain', js: 'text/plain', typ: u$2(undefined, '') },
6674
+ ], 'any'),
6675
+ ChatOptions: o$2([
6676
+ { json: 'allowAddUser', js: 'allowAddUser', typ: u$2(undefined, true) },
6677
+ { json: 'allowHistoryBrowsing', js: 'allowHistoryBrowsing', typ: u$2(undefined, true) },
6678
+ { json: 'allowMessageCopy', js: 'allowMessageCopy', typ: u$2(undefined, true) },
6679
+ { json: 'groupRecipients', js: 'groupRecipients', typ: u$2(undefined, true) },
6680
+ { json: 'isPublic', js: 'isPublic', typ: u$2(undefined, true) },
6681
+ ], 'any'),
6682
+ ChatMessage: o$2([
6683
+ { json: 'chatRoom', js: 'chatRoom', typ: r$2('ChatRoomObject') },
6684
+ { json: 'message', js: 'message', typ: r$2('MessageObject') },
6685
+ { json: 'type', js: 'type', typ: r$2('ChatMessageType') },
6686
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6687
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6688
+ ], 'any'),
6689
+ ChatRoomObject: o$2([
6690
+ { json: 'id', js: 'id', typ: m$2('') },
6691
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6692
+ { json: 'providerName', js: 'providerName', typ: '' },
6693
+ { json: 'type', js: 'type', typ: r$2('ChatRoomType') },
6694
+ { json: 'url', js: 'url', typ: u$2(undefined, '') },
6695
+ ], 'any'),
6696
+ ChatRoom: o$2([
6697
+ { json: 'id', js: 'id', typ: m$2('') },
6698
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6699
+ { json: 'providerName', js: 'providerName', typ: '' },
6700
+ { json: 'type', js: 'type', typ: r$2('ChatRoomType') },
6701
+ { json: 'url', js: 'url', typ: u$2(undefined, '') },
6702
+ ], 'any'),
6703
+ ChatSearchCriteria: o$2([
6704
+ { json: 'criteria', js: 'criteria', typ: a$2(u$2(r$2('OrganizationObject'), '')) },
6705
+ { json: 'type', js: 'type', typ: r$2('ChatSearchCriteriaType') },
6706
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6707
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6708
+ ], 'any'),
6709
+ OrganizationObject: o$2([
6710
+ { json: 'id', js: 'id', typ: r$2('Identifiers') },
6711
+ { json: 'market', js: 'market', typ: u$2(undefined, r$2('OrganizationMarket')) },
6712
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6713
+ { json: 'type', js: 'type', typ: r$2('TentacledInteractionType') },
6714
+ ], 'any'),
6715
+ Identifiers: o$2([
6716
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6717
+ { json: 'CUSIP', js: 'CUSIP', typ: u$2(undefined, '') },
6718
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6719
+ { json: 'FIGI', js: 'FIGI', typ: u$2(undefined, '') },
6720
+ { json: 'ISIN', js: 'ISIN', typ: u$2(undefined, '') },
6721
+ { json: 'PERMID', js: 'PERMID', typ: u$2(undefined, '') },
6722
+ { json: 'RIC', js: 'RIC', typ: u$2(undefined, '') },
6723
+ { json: 'SEDOL', js: 'SEDOL', typ: u$2(undefined, '') },
6724
+ { json: 'ticker', js: 'ticker', typ: u$2(undefined, '') },
6725
+ { json: 'LEI', js: 'LEI', typ: u$2(undefined, '') },
6726
+ { json: 'email', js: 'email', typ: u$2(undefined, '') },
6727
+ ], 'any'),
6728
+ Contact: o$2([
6729
+ { json: 'id', js: 'id', typ: r$2('FluffyContactIdentifiers') },
6730
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6731
+ { json: 'type', js: 'type', typ: r$2('FluffyInteractionType') },
6732
+ ], 'any'),
6733
+ FluffyContactIdentifiers: o$2([
6734
+ { json: 'email', js: 'email', typ: u$2(undefined, '') },
6735
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6736
+ ], 'any'),
6737
+ ContactList: o$2([
6738
+ { json: 'contacts', js: 'contacts', typ: a$2(r$2('ContactElement')) },
6739
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6740
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6741
+ { json: 'type', js: 'type', typ: r$2('ContactListType') },
6742
+ ], 'any'),
6743
+ Context: o$2([
6744
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6745
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6746
+ { json: 'type', js: 'type', typ: '' },
6747
+ ], 'any'),
6748
+ Country: o$2([
6749
+ { json: 'id', js: 'id', typ: r$2('CountryID') },
6750
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6751
+ { json: 'type', js: 'type', typ: r$2('CountryType') },
6752
+ ], 'any'),
6753
+ CountryID: o$2([
6754
+ { json: 'COUNTRY_ISOALPHA2', js: 'COUNTRY_ISOALPHA2', typ: u$2(undefined, '') },
6755
+ { json: 'COUNTRY_ISOALPHA3', js: 'COUNTRY_ISOALPHA3', typ: u$2(undefined, '') },
6756
+ { json: 'ISOALPHA2', js: 'ISOALPHA2', typ: u$2(undefined, '') },
6757
+ { json: 'ISOALPHA3', js: 'ISOALPHA3', typ: u$2(undefined, '') },
6758
+ ], 'any'),
6759
+ Currency: o$2([
6760
+ { json: 'id', js: 'id', typ: r$2('CurrencyID') },
6761
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6762
+ { json: 'type', js: 'type', typ: r$2('CurrencyType') },
6763
+ ], 'any'),
6764
+ CurrencyID: o$2([{ json: 'CURRENCY_ISOCODE', js: 'CURRENCY_ISOCODE', typ: u$2(undefined, '') }], 'any'),
6765
+ Email: o$2([
6766
+ { json: 'recipients', js: 'recipients', typ: r$2('EmailRecipients') },
6767
+ { json: 'subject', js: 'subject', typ: u$2(undefined, '') },
6768
+ { json: 'textBody', js: 'textBody', typ: u$2(undefined, '') },
6769
+ { json: 'type', js: 'type', typ: r$2('EmailType') },
6770
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6771
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6772
+ ], 'any'),
6773
+ EmailRecipients: o$2([
6774
+ { json: 'id', js: 'id', typ: u$2(undefined, r$2('ContactTIdentifiers')) },
6775
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6776
+ { json: 'type', js: 'type', typ: r$2('EmailRecipientsType') },
6777
+ { json: 'contacts', js: 'contacts', typ: u$2(undefined, a$2(r$2('ContactElement'))) },
6778
+ ], 'any'),
6779
+ ContactTIdentifiers: o$2([
6780
+ { json: 'email', js: 'email', typ: u$2(undefined, '') },
6781
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6782
+ ], 'any'),
6783
+ FileAttachment: o$2([
6784
+ { json: 'data', js: 'data', typ: r$2('FileAttachmentData') },
6785
+ { json: 'type', js: 'type', typ: r$2('FileAttachmentType') },
6786
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6787
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6788
+ ], 'any'),
6789
+ Instrument: o$2([
6790
+ { json: 'id', js: 'id', typ: r$2('FluffyInstrumentIdentifiers') },
6791
+ { json: 'market', js: 'market', typ: u$2(undefined, r$2('PurpleMarket')) },
6792
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6793
+ { json: 'type', js: 'type', typ: r$2('PurpleInteractionType') },
6794
+ ], 'any'),
6795
+ FluffyInstrumentIdentifiers: o$2([
6796
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6797
+ { json: 'CUSIP', js: 'CUSIP', typ: u$2(undefined, '') },
6798
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6799
+ { json: 'FIGI', js: 'FIGI', typ: u$2(undefined, '') },
6800
+ { json: 'ISIN', js: 'ISIN', typ: u$2(undefined, '') },
6801
+ { json: 'PERMID', js: 'PERMID', typ: u$2(undefined, '') },
6802
+ { json: 'RIC', js: 'RIC', typ: u$2(undefined, '') },
6803
+ { json: 'SEDOL', js: 'SEDOL', typ: u$2(undefined, '') },
6804
+ { json: 'ticker', js: 'ticker', typ: u$2(undefined, '') },
6805
+ ], 'any'),
6806
+ PurpleMarket: o$2([
6807
+ { json: 'BBG', js: 'BBG', typ: u$2(undefined, '') },
6808
+ { json: 'COUNTRY_ISOALPHA2', js: 'COUNTRY_ISOALPHA2', typ: u$2(undefined, '') },
6809
+ { json: 'MIC', js: 'MIC', typ: u$2(undefined, '') },
6810
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6811
+ ], 'any'),
6812
+ InstrumentList: o$2([
6813
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6814
+ { json: 'instruments', js: 'instruments', typ: a$2(r$2('InstrumentElement')) },
6815
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6816
+ { json: 'type', js: 'type', typ: r$2('InstrumentListType') },
6817
+ ], 'any'),
6818
+ Interaction: o$2([
6819
+ { json: 'description', js: 'description', typ: '' },
6820
+ { json: 'id', js: 'id', typ: u$2(undefined, r$2('InteractionID')) },
6821
+ { json: 'initiator', js: 'initiator', typ: u$2(undefined, r$2('ContactElement')) },
6822
+ { json: 'interactionType', js: 'interactionType', typ: '' },
6823
+ { json: 'origin', js: 'origin', typ: u$2(undefined, '') },
6824
+ { json: 'participants', js: 'participants', typ: r$2('ContactListObject') },
6825
+ { json: 'timeRange', js: 'timeRange', typ: r$2('TimeRangeObject') },
6826
+ { json: 'type', js: 'type', typ: r$2('InteractionType') },
6827
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6828
+ ], 'any'),
6829
+ InteractionID: o$2([
6830
+ { json: 'SALESFORCE', js: 'SALESFORCE', typ: u$2(undefined, '') },
6831
+ { json: 'SINGLETRACK', js: 'SINGLETRACK', typ: u$2(undefined, '') },
6832
+ { json: 'URI', js: 'URI', typ: u$2(undefined, '') },
6833
+ ], 'any'),
6834
+ Message: o$2([
6835
+ { json: 'entities', js: 'entities', typ: u$2(undefined, m$2(r$2('EntityValue'))) },
6836
+ { json: 'text', js: 'text', typ: u$2(undefined, r$2('FluffyMessageText')) },
6837
+ { json: 'type', js: 'type', typ: r$2('MessageType') },
6838
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6839
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6840
+ ], 'any'),
6841
+ FluffyMessageText: o$2([
6842
+ { json: 'text/markdown', js: 'text/markdown', typ: u$2(undefined, '') },
6843
+ { json: 'text/plain', js: 'text/plain', typ: u$2(undefined, '') },
6844
+ ], 'any'),
6845
+ Nothing: o$2([
6846
+ { json: 'type', js: 'type', typ: r$2('NothingType') },
6847
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6848
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6849
+ ], 'any'),
6850
+ Order: o$2([
6851
+ { json: 'details', js: 'details', typ: u$2(undefined, r$2('PurpleOrderDetails')) },
6852
+ { json: 'id', js: 'id', typ: m$2('') },
6853
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6854
+ { json: 'type', js: 'type', typ: r$2('OrderType') },
6855
+ ], 'any'),
6856
+ PurpleOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
6857
+ ProductObject: o$2([
6858
+ { json: 'id', js: 'id', typ: m$2('') },
6859
+ { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
6860
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6861
+ { json: 'type', js: 'type', typ: r$2('ProductType') },
6862
+ ], 'any'),
6863
+ OrderList: o$2([
6864
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6865
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6866
+ { json: 'orders', js: 'orders', typ: a$2(r$2('OrderElement')) },
6867
+ { json: 'type', js: 'type', typ: r$2('OrderListType') },
6868
+ ], 'any'),
6869
+ OrderElement: o$2([
6870
+ { json: 'details', js: 'details', typ: u$2(undefined, r$2('FluffyOrderDetails')) },
6871
+ { json: 'id', js: 'id', typ: m$2('') },
6872
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6873
+ { json: 'type', js: 'type', typ: r$2('OrderType') },
6874
+ ], 'any'),
6875
+ FluffyOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
6876
+ Organization: o$2([
6877
+ { json: 'id', js: 'id', typ: r$2('OrganizationIdentifiers') },
6878
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6879
+ { json: 'type', js: 'type', typ: r$2('StickyInteractionType') },
6880
+ ], 'any'),
6881
+ OrganizationIdentifiers: o$2([
6882
+ { json: 'FDS_ID', js: 'FDS_ID', typ: u$2(undefined, '') },
6883
+ { json: 'LEI', js: 'LEI', typ: u$2(undefined, '') },
6884
+ { json: 'PERMID', js: 'PERMID', typ: u$2(undefined, '') },
6885
+ ], 'any'),
6886
+ Portfolio: o$2([
6887
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6888
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6889
+ { json: 'positions', js: 'positions', typ: a$2(r$2('PositionElement')) },
6890
+ { json: 'type', js: 'type', typ: r$2('PortfolioType') },
6891
+ ], 'any'),
6892
+ PositionElement: o$2([
6893
+ { json: 'holding', js: 'holding', typ: 3.14 },
6894
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6895
+ { json: 'instrument', js: 'instrument', typ: r$2('InstrumentElement') },
6896
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6897
+ { json: 'type', js: 'type', typ: r$2('PositionType') },
6898
+ ], 'any'),
6899
+ Position: o$2([
6900
+ { json: 'holding', js: 'holding', typ: 3.14 },
6901
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6902
+ { json: 'instrument', js: 'instrument', typ: r$2('InstrumentElement') },
6903
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6904
+ { json: 'type', js: 'type', typ: r$2('PositionType') },
6905
+ ], 'any'),
6906
+ Product: o$2([
6907
+ { json: 'id', js: 'id', typ: m$2('') },
6908
+ { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
6909
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6910
+ { json: 'type', js: 'type', typ: r$2('ProductType') },
6911
+ ], 'any'),
6912
+ TimeRange: o$2([
6913
+ { json: 'endTime', js: 'endTime', typ: u$2(undefined, Date) },
6914
+ { json: 'startTime', js: 'startTime', typ: u$2(undefined, Date) },
6915
+ { json: 'type', js: 'type', typ: r$2('TimeRangeType') },
6916
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6917
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6918
+ ], 'any'),
6919
+ Trade: o$2([
6920
+ { json: 'id', js: 'id', typ: m$2('') },
6921
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6922
+ { json: 'product', js: 'product', typ: r$2('ProductObject') },
6923
+ { json: 'type', js: 'type', typ: r$2('TradeType') },
6924
+ ], 'any'),
6925
+ TradeList: o$2([
6926
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('')) },
6927
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6928
+ { json: 'trades', js: 'trades', typ: a$2(r$2('TradeElement')) },
6929
+ { json: 'type', js: 'type', typ: r$2('TradeListType') },
6930
+ ], 'any'),
6931
+ TradeElement: o$2([
6932
+ { json: 'id', js: 'id', typ: m$2('') },
6933
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6934
+ { json: 'product', js: 'product', typ: r$2('ProductObject') },
6935
+ { json: 'type', js: 'type', typ: r$2('TradeType') },
6936
+ ], 'any'),
6937
+ TransactionResult: o$2([
6938
+ { json: 'context', js: 'context', typ: u$2(undefined, r$2('ContextElement')) },
6939
+ { json: 'message', js: 'message', typ: u$2(undefined, '') },
6940
+ { json: 'status', js: 'status', typ: r$2('TransactionStatus') },
6941
+ { json: 'type', js: 'type', typ: r$2('TransactionResultType') },
6942
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6943
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6944
+ ], 'any'),
6945
+ Valuation: o$2([
6946
+ { json: 'CURRENCY_ISOCODE', js: 'CURRENCY_ISOCODE', typ: '' },
6947
+ { json: 'expiryTime', js: 'expiryTime', typ: u$2(undefined, Date) },
6948
+ { json: 'price', js: 'price', typ: u$2(undefined, 3.14) },
6949
+ { json: 'type', js: 'type', typ: r$2('ValuationType') },
6950
+ { json: 'valuationTime', js: 'valuationTime', typ: u$2(undefined, Date) },
6951
+ { json: 'value', js: 'value', typ: 3.14 },
6952
+ { json: 'id', js: 'id', typ: u$2(undefined, m$2('any')) },
6953
+ { json: 'name', js: 'name', typ: u$2(undefined, '') },
6954
+ ], 'any')});
6955
+
6956
+ // To parse this data:
6957
+ //
6958
+ // import { Convert, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse, WebConnectionProtocol6Goodbye, WebConnectionProtocolMessage, AddContextListenerRequest, AddContextListenerResponse, AddEventListenerRequest, AddEventListenerResponse, AddIntentListenerRequest, AddIntentListenerResponse, AgentEventMessage, AgentResponseMessage, AppRequestMessage, BroadcastEvent, BroadcastRequest, BroadcastResponse, ChannelChangedEvent, ContextListenerUnsubscribeRequest, ContextListenerUnsubscribeResponse, CreatePrivateChannelRequest, CreatePrivateChannelResponse, EventListenerUnsubscribeRequest, EventListenerUnsubscribeResponse, Fdc3UserInterfaceChannelSelected, Fdc3UserInterfaceChannels, Fdc3UserInterfaceDrag, Fdc3UserInterfaceHandshake, Fdc3UserInterfaceHello, Fdc3UserInterfaceMessage, Fdc3UserInterfaceResolve, Fdc3UserInterfaceResolveAction, Fdc3UserInterfaceRestyle, FindInstancesRequest, FindInstancesResponse, FindIntentRequest, FindIntentResponse, FindIntentsByContextRequest, FindIntentsByContextResponse, GetAppMetadataRequest, GetAppMetadataResponse, GetCurrentChannelRequest, GetCurrentChannelResponse, GetCurrentContextRequest, GetCurrentContextResponse, GetInfoRequest, GetInfoResponse, GetOrCreateChannelRequest, GetOrCreateChannelResponse, GetUserChannelsRequest, GetUserChannelsResponse, HeartbeatAcknowledgementRequest, HeartbeatEvent, IntentEvent, IntentListenerUnsubscribeRequest, IntentListenerUnsubscribeResponse, IntentResultRequest, IntentResultResponse, JoinUserChannelRequest, JoinUserChannelResponse, LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, OpenRequest, OpenResponse, PrivateChannelAddEventListenerRequest, PrivateChannelAddEventListenerResponse, PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse, PrivateChannelOnAddContextListenerEvent, PrivateChannelOnDisconnectEvent, PrivateChannelOnUnsubscribeEvent, PrivateChannelUnsubscribeEventListenerRequest, PrivateChannelUnsubscribeEventListenerResponse, RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "./file";
6959
+ //
6960
+ // const webConnectionProtocol1Hello = Convert.toWebConnectionProtocol1Hello(json);
6961
+ // const webConnectionProtocol2LoadURL = Convert.toWebConnectionProtocol2LoadURL(json);
6962
+ // const webConnectionProtocol3Handshake = Convert.toWebConnectionProtocol3Handshake(json);
6963
+ // const webConnectionProtocol4ValidateAppIdentity = Convert.toWebConnectionProtocol4ValidateAppIdentity(json);
6964
+ // const webConnectionProtocol5ValidateAppIdentityFailedResponse = Convert.toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json);
6965
+ // const webConnectionProtocol5ValidateAppIdentitySuccessResponse = Convert.toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json);
6966
+ // const webConnectionProtocol6Goodbye = Convert.toWebConnectionProtocol6Goodbye(json);
6967
+ // const webConnectionProtocolMessage = Convert.toWebConnectionProtocolMessage(json);
6968
+ // const addContextListenerRequest = Convert.toAddContextListenerRequest(json);
6969
+ // const addContextListenerResponse = Convert.toAddContextListenerResponse(json);
6970
+ // const addEventListenerRequest = Convert.toAddEventListenerRequest(json);
6971
+ // const addEventListenerResponse = Convert.toAddEventListenerResponse(json);
6972
+ // const addIntentListenerRequest = Convert.toAddIntentListenerRequest(json);
6973
+ // const addIntentListenerResponse = Convert.toAddIntentListenerResponse(json);
6974
+ // const agentEventMessage = Convert.toAgentEventMessage(json);
6975
+ // const agentResponseMessage = Convert.toAgentResponseMessage(json);
6976
+ // const appRequestMessage = Convert.toAppRequestMessage(json);
6977
+ // const broadcastEvent = Convert.toBroadcastEvent(json);
6978
+ // const broadcastRequest = Convert.toBroadcastRequest(json);
6979
+ // const broadcastResponse = Convert.toBroadcastResponse(json);
6980
+ // const channelChangedEvent = Convert.toChannelChangedEvent(json);
6981
+ // const contextListenerUnsubscribeRequest = Convert.toContextListenerUnsubscribeRequest(json);
6982
+ // const contextListenerUnsubscribeResponse = Convert.toContextListenerUnsubscribeResponse(json);
6983
+ // const createPrivateChannelRequest = Convert.toCreatePrivateChannelRequest(json);
6984
+ // const createPrivateChannelResponse = Convert.toCreatePrivateChannelResponse(json);
6985
+ // const eventListenerUnsubscribeRequest = Convert.toEventListenerUnsubscribeRequest(json);
6986
+ // const eventListenerUnsubscribeResponse = Convert.toEventListenerUnsubscribeResponse(json);
6987
+ // const fdc3UserInterfaceChannelSelected = Convert.toFdc3UserInterfaceChannelSelected(json);
6988
+ // const fdc3UserInterfaceChannels = Convert.toFdc3UserInterfaceChannels(json);
6989
+ // const fdc3UserInterfaceDrag = Convert.toFdc3UserInterfaceDrag(json);
6990
+ // const fdc3UserInterfaceHandshake = Convert.toFdc3UserInterfaceHandshake(json);
6991
+ // const fdc3UserInterfaceHello = Convert.toFdc3UserInterfaceHello(json);
6992
+ // const fdc3UserInterfaceMessage = Convert.toFdc3UserInterfaceMessage(json);
6993
+ // const fdc3UserInterfaceResolve = Convert.toFdc3UserInterfaceResolve(json);
6994
+ // const fdc3UserInterfaceResolveAction = Convert.toFdc3UserInterfaceResolveAction(json);
6995
+ // const fdc3UserInterfaceRestyle = Convert.toFdc3UserInterfaceRestyle(json);
6996
+ // const findInstancesRequest = Convert.toFindInstancesRequest(json);
6997
+ // const findInstancesResponse = Convert.toFindInstancesResponse(json);
6998
+ // const findIntentRequest = Convert.toFindIntentRequest(json);
6999
+ // const findIntentResponse = Convert.toFindIntentResponse(json);
7000
+ // const findIntentsByContextRequest = Convert.toFindIntentsByContextRequest(json);
7001
+ // const findIntentsByContextResponse = Convert.toFindIntentsByContextResponse(json);
7002
+ // const getAppMetadataRequest = Convert.toGetAppMetadataRequest(json);
7003
+ // const getAppMetadataResponse = Convert.toGetAppMetadataResponse(json);
7004
+ // const getCurrentChannelRequest = Convert.toGetCurrentChannelRequest(json);
7005
+ // const getCurrentChannelResponse = Convert.toGetCurrentChannelResponse(json);
7006
+ // const getCurrentContextRequest = Convert.toGetCurrentContextRequest(json);
7007
+ // const getCurrentContextResponse = Convert.toGetCurrentContextResponse(json);
7008
+ // const getInfoRequest = Convert.toGetInfoRequest(json);
7009
+ // const getInfoResponse = Convert.toGetInfoResponse(json);
7010
+ // const getOrCreateChannelRequest = Convert.toGetOrCreateChannelRequest(json);
7011
+ // const getOrCreateChannelResponse = Convert.toGetOrCreateChannelResponse(json);
7012
+ // const getUserChannelsRequest = Convert.toGetUserChannelsRequest(json);
7013
+ // const getUserChannelsResponse = Convert.toGetUserChannelsResponse(json);
7014
+ // const heartbeatAcknowledgementRequest = Convert.toHeartbeatAcknowledgementRequest(json);
7015
+ // const heartbeatEvent = Convert.toHeartbeatEvent(json);
7016
+ // const intentEvent = Convert.toIntentEvent(json);
7017
+ // const intentListenerUnsubscribeRequest = Convert.toIntentListenerUnsubscribeRequest(json);
7018
+ // const intentListenerUnsubscribeResponse = Convert.toIntentListenerUnsubscribeResponse(json);
7019
+ // const intentResultRequest = Convert.toIntentResultRequest(json);
7020
+ // const intentResultResponse = Convert.toIntentResultResponse(json);
7021
+ // const joinUserChannelRequest = Convert.toJoinUserChannelRequest(json);
7022
+ // const joinUserChannelResponse = Convert.toJoinUserChannelResponse(json);
7023
+ // const leaveCurrentChannelRequest = Convert.toLeaveCurrentChannelRequest(json);
7024
+ // const leaveCurrentChannelResponse = Convert.toLeaveCurrentChannelResponse(json);
7025
+ // const openRequest = Convert.toOpenRequest(json);
7026
+ // const openResponse = Convert.toOpenResponse(json);
7027
+ // const privateChannelAddEventListenerRequest = Convert.toPrivateChannelAddEventListenerRequest(json);
7028
+ // const privateChannelAddEventListenerResponse = Convert.toPrivateChannelAddEventListenerResponse(json);
7029
+ // const privateChannelDisconnectRequest = Convert.toPrivateChannelDisconnectRequest(json);
7030
+ // const privateChannelDisconnectResponse = Convert.toPrivateChannelDisconnectResponse(json);
7031
+ // const privateChannelOnAddContextListenerEvent = Convert.toPrivateChannelOnAddContextListenerEvent(json);
7032
+ // const privateChannelOnDisconnectEvent = Convert.toPrivateChannelOnDisconnectEvent(json);
7033
+ // const privateChannelOnUnsubscribeEvent = Convert.toPrivateChannelOnUnsubscribeEvent(json);
7034
+ // const privateChannelUnsubscribeEventListenerRequest = Convert.toPrivateChannelUnsubscribeEventListenerRequest(json);
7035
+ // const privateChannelUnsubscribeEventListenerResponse = Convert.toPrivateChannelUnsubscribeEventListenerResponse(json);
7036
+ // const raiseIntentForContextRequest = Convert.toRaiseIntentForContextRequest(json);
7037
+ // const raiseIntentForContextResponse = Convert.toRaiseIntentForContextResponse(json);
7038
+ // const raiseIntentRequest = Convert.toRaiseIntentRequest(json);
7039
+ // const raiseIntentResponse = Convert.toRaiseIntentResponse(json);
7040
+ // const raiseIntentResultResponse = Convert.toRaiseIntentResultResponse(json);
7041
+ //
7042
+ // These functions will throw an error if the JSON doesn't
7043
+ // match the expected interface, even if the JSON is valid.
7044
+ /**
7045
+ * Identifies the type of the message and it is typically set to the FDC3 function name that
7046
+ * the message relates to, e.g. 'findIntent', with 'Response' appended.
7047
+ */
7048
+ // Converts JSON strings to/from your types
7049
+ // and asserts the results of JSON.parse at runtime
7050
+ function a$1(typ) {
7051
+ return { arrayItems: typ };
7052
+ }
7053
+ function u$1(...typs) {
7054
+ return { unionMembers: typs };
7055
+ }
7056
+ function o$1(props, additional) {
7057
+ return { props, additional };
7058
+ }
7059
+ function m$1(additional) {
7060
+ return { props: [], additional };
7061
+ }
7062
+ function r$1(name) {
7063
+ return { ref: name };
7064
+ }
7065
+ ({
7066
+ WebConnectionProtocol1HelloPayload: o$1([
7067
+ { json: 'actualUrl', js: 'actualUrl', typ: '' },
7068
+ { json: 'channelSelector', js: 'channelSelector', typ: u$1(undefined, true) },
7069
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7070
+ { json: 'identityUrl', js: 'identityUrl', typ: '' },
7071
+ { json: 'intentResolver', js: 'intentResolver', typ: u$1(undefined, true) },
7072
+ ], 'any'),
7073
+ WebConnectionProtocol3HandshakePayload: o$1([
7074
+ { json: 'appLaunchTimeout', js: 'appLaunchTimeout', typ: u$1(undefined, 3.14) },
7075
+ { json: 'channelSelectorUrl', js: 'channelSelectorUrl', typ: u$1(true, '') },
7076
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7077
+ { json: 'intentResolverUrl', js: 'intentResolverUrl', typ: u$1(true, '') },
7078
+ { json: 'messageExchangeTimeout', js: 'messageExchangeTimeout', typ: u$1(undefined, 3.14) },
7079
+ ], false),
7080
+ WebConnectionProtocol4ValidateAppIdentityPayload: o$1([
7081
+ { json: 'actualUrl', js: 'actualUrl', typ: '' },
7082
+ { json: 'identityUrl', js: 'identityUrl', typ: '' },
7083
+ { json: 'instanceId', js: 'instanceId', typ: u$1(undefined, '') },
7084
+ { json: 'instanceUuid', js: 'instanceUuid', typ: u$1(undefined, '') },
7085
+ ], false),
7086
+ WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload: o$1([{ json: 'message', js: 'message', typ: u$1(undefined, '') }], false),
7087
+ ImplementationMetadata: o$1([
7088
+ { json: 'appMetadata', js: 'appMetadata', typ: r$1('AppMetadata') },
7089
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7090
+ { json: 'optionalFeatures', js: 'optionalFeatures', typ: r$1('OptionalFeatures') },
7091
+ { json: 'provider', js: 'provider', typ: '' },
7092
+ { json: 'providerVersion', js: 'providerVersion', typ: u$1(undefined, '') },
7093
+ ], false),
7094
+ AppMetadata: o$1([
7095
+ { json: 'appId', js: 'appId', typ: '' },
7096
+ { json: 'description', js: 'description', typ: u$1(undefined, '') },
7097
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u$1(undefined, '') },
7098
+ { json: 'icons', js: 'icons', typ: u$1(undefined, a$1(r$1('Icon'))) },
7099
+ { json: 'instanceId', js: 'instanceId', typ: u$1(undefined, '') },
7100
+ { json: 'instanceMetadata', js: 'instanceMetadata', typ: u$1(undefined, m$1('any')) },
7101
+ { json: 'name', js: 'name', typ: u$1(undefined, '') },
7102
+ { json: 'resultType', js: 'resultType', typ: u$1(undefined, u$1(null, '')) },
7103
+ { json: 'screenshots', js: 'screenshots', typ: u$1(undefined, a$1(r$1('Image'))) },
7104
+ { json: 'title', js: 'title', typ: u$1(undefined, '') },
7105
+ { json: 'tooltip', js: 'tooltip', typ: u$1(undefined, '') },
7106
+ { json: 'version', js: 'version', typ: u$1(undefined, '') },
7107
+ ], false),
7108
+ Icon: o$1([
7109
+ { json: 'size', js: 'size', typ: u$1(undefined, '') },
7110
+ { json: 'src', js: 'src', typ: '' },
7111
+ { json: 'type', js: 'type', typ: u$1(undefined, '') },
7112
+ ], false),
7113
+ Image: o$1([
7114
+ { json: 'label', js: 'label', typ: u$1(undefined, '') },
7115
+ { json: 'size', js: 'size', typ: u$1(undefined, '') },
7116
+ { json: 'src', js: 'src', typ: '' },
7117
+ { json: 'type', js: 'type', typ: u$1(undefined, '') },
7118
+ ], false),
7119
+ WebConnectionProtocolMessage: o$1([
7120
+ { json: 'meta', js: 'meta', typ: r$1('ConnectionStepMetadata') },
7121
+ { json: 'payload', js: 'payload', typ: u$1(undefined, m$1('any')) },
7122
+ { json: 'type', js: 'type', typ: r$1('ConnectionStepMessageType') },
7123
+ ], false),
7124
+ ConnectionStepMetadata: o$1([
7125
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7126
+ { json: 'connectionAttemptUuid', js: 'connectionAttemptUuid', typ: u$1(undefined, '') },
7127
+ ], false),
7128
+ AddContextListenerRequestMeta: o$1([
7129
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7130
+ { json: 'source', js: 'source', typ: u$1(undefined, r$1('AppIdentifier')) },
7131
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7132
+ ], false),
7133
+ AppIdentifier: o$1([
7134
+ { json: 'appId', js: 'appId', typ: '' },
7135
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u$1(undefined, '') },
7136
+ { json: 'instanceId', js: 'instanceId', typ: u$1(undefined, '') },
7137
+ ], 'any'),
7138
+ AddContextListenerRequestPayload: o$1([
7139
+ { json: 'channelId', js: 'channelId', typ: u$1(null, '') },
7140
+ { json: 'contextType', js: 'contextType', typ: u$1(null, '') },
7141
+ ], false),
7142
+ AddContextListenerResponseMeta: o$1([
7143
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7144
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7145
+ { json: 'source', js: 'source', typ: u$1(undefined, r$1('AppIdentifier')) },
7146
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7147
+ ], false),
7148
+ AddContextListenerResponsePayload: o$1([
7149
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7150
+ { json: 'listenerUUID', js: 'listenerUUID', typ: u$1(undefined, '') },
7151
+ ], false),
7152
+ AddEventListenerRequestPayload: o$1([{ json: 'type', js: 'type', typ: u$1(r$1('FDC3EventType'), null) }], false),
7153
+ AddEventListenerResponsePayload: o$1([
7154
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) },
7155
+ { json: 'listenerUUID', js: 'listenerUUID', typ: u$1(undefined, '') },
7156
+ ], false),
7157
+ PayloadObject: o$1([
7158
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FluffyError')) },
7159
+ { json: 'listenerUUID', js: 'listenerUUID', typ: u$1(undefined, '') },
7160
+ ], 'any'),
7161
+ AgentResponseMessageMeta: o$1([
7162
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7163
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7164
+ { json: 'source', js: 'source', typ: u$1(undefined, r$1('AppIdentifier')) },
7165
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7166
+ ], false),
7167
+ AgentResponseMessageResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) }], 'any'),
7168
+ AppRequestMessageMeta: o$1([
7169
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7170
+ { json: 'source', js: 'source', typ: u$1(undefined, r$1('AppIdentifier')) },
7171
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7172
+ ], false),
7173
+ BroadcastEventPayload: o$1([
7174
+ { json: 'channelId', js: 'channelId', typ: u$1(null, '') },
7175
+ { json: 'context', js: 'context', typ: r$1('Context') },
7176
+ { json: 'originatingApp', js: 'originatingApp', typ: u$1(undefined, r$1('AppIdentifier')) },
7177
+ ], false),
7178
+ Context: o$1([
7179
+ { json: 'id', js: 'id', typ: u$1(undefined, m$1('any')) },
7180
+ { json: 'name', js: 'name', typ: u$1(undefined, '') },
7181
+ { json: 'type', js: 'type', typ: '' },
7182
+ ], 'any'),
7183
+ BroadcastResponseResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) }], 'any'),
7184
+ ChannelChangedEventPayload: o$1([{ json: 'newChannelId', js: 'newChannelId', typ: u$1(null, '') }], false),
7185
+ CreatePrivateChannelResponsePayload: o$1([
7186
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7187
+ { json: 'privateChannel', js: 'privateChannel', typ: u$1(undefined, r$1('Channel')) },
7188
+ ], false),
7189
+ Channel: o$1([
7190
+ { json: 'displayMetadata', js: 'displayMetadata', typ: u$1(undefined, r$1('DisplayMetadata')) },
7191
+ { json: 'id', js: 'id', typ: '' },
7192
+ { json: 'type', js: 'type', typ: r$1('Type') },
7193
+ ], false),
7194
+ DisplayMetadata: o$1([
7195
+ { json: 'color', js: 'color', typ: u$1(undefined, '') },
7196
+ { json: 'glyph', js: 'glyph', typ: u$1(undefined, '') },
7197
+ { json: 'name', js: 'name', typ: u$1(undefined, '') },
7198
+ ], false),
7199
+ Fdc3UserInterfaceChannelSelectedPayload: o$1([{ json: 'selected', js: 'selected', typ: u$1(null, '') }], false),
7200
+ Fdc3UserInterfaceChannelsPayload: o$1([
7201
+ { json: 'selected', js: 'selected', typ: u$1(null, '') },
7202
+ { json: 'userChannels', js: 'userChannels', typ: a$1(r$1('Channel')) },
7203
+ ], false),
7204
+ InitialCSS: o$1([
7205
+ { json: 'bottom', js: 'bottom', typ: u$1(undefined, '') },
7206
+ { json: 'height', js: 'height', typ: u$1(undefined, '') },
7207
+ { json: 'left', js: 'left', typ: u$1(undefined, '') },
7208
+ { json: 'maxHeight', js: 'maxHeight', typ: u$1(undefined, '') },
7209
+ { json: 'maxWidth', js: 'maxWidth', typ: u$1(undefined, '') },
7210
+ { json: 'right', js: 'right', typ: u$1(undefined, '') },
7211
+ { json: 'top', js: 'top', typ: u$1(undefined, '') },
7212
+ { json: 'transition', js: 'transition', typ: u$1(undefined, '') },
7213
+ { json: 'width', js: 'width', typ: u$1(undefined, '') },
7214
+ { json: 'zIndex', js: 'zIndex', typ: u$1(undefined, '') },
7215
+ ], 'any'),
7216
+ Fdc3UserInterfaceMessage: o$1([
7217
+ { json: 'payload', js: 'payload', typ: u$1(undefined, m$1('any')) },
7218
+ { json: 'type', js: 'type', typ: r$1('Fdc3UserInterfaceMessageType') },
7219
+ ], false),
7220
+ IntentMetadata: o$1([
7221
+ { json: 'displayName', js: 'displayName', typ: u$1(undefined, '') },
7222
+ { json: 'name', js: 'name', typ: '' },
7223
+ ], false),
7224
+ Fdc3UserInterfaceResolveActionPayload: o$1([
7225
+ { json: 'action', js: 'action', typ: r$1('Action') },
7226
+ { json: 'appIdentifier', js: 'appIdentifier', typ: u$1(undefined, r$1('AppIdentifier')) },
7227
+ { json: 'intent', js: 'intent', typ: u$1(undefined, '') },
7228
+ ], false),
7229
+ UpdatedCSS: o$1([
7230
+ { json: 'bottom', js: 'bottom', typ: u$1(undefined, '') },
7231
+ { json: 'height', js: 'height', typ: u$1(undefined, '') },
7232
+ { json: 'left', js: 'left', typ: u$1(undefined, '') },
7233
+ { json: 'maxHeight', js: 'maxHeight', typ: u$1(undefined, '') },
7234
+ { json: 'maxWidth', js: 'maxWidth', typ: u$1(undefined, '') },
7235
+ { json: 'right', js: 'right', typ: u$1(undefined, '') },
7236
+ { json: 'top', js: 'top', typ: u$1(undefined, '') },
7237
+ { json: 'transition', js: 'transition', typ: u$1(undefined, '') },
7238
+ { json: 'width', js: 'width', typ: u$1(undefined, '') },
7239
+ { json: 'zIndex', js: 'zIndex', typ: u$1(undefined, '') },
7240
+ ], 'any'),
7241
+ FindInstancesResponsePayload: o$1([
7242
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7243
+ { json: 'appIdentifiers', js: 'appIdentifiers', typ: u$1(undefined, a$1(r$1('AppMetadata'))) },
7244
+ ], false),
7245
+ FindIntentRequestPayload: o$1([
7246
+ { json: 'context', js: 'context', typ: u$1(undefined, r$1('Context')) },
7247
+ { json: 'intent', js: 'intent', typ: '' },
7248
+ { json: 'resultType', js: 'resultType', typ: u$1(undefined, '') },
7249
+ ], false),
7250
+ FindIntentResponsePayload: o$1([
7251
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7252
+ { json: 'appIntent', js: 'appIntent', typ: u$1(undefined, r$1('AppIntent')) },
7253
+ ], false),
7254
+ FindIntentsByContextRequestPayload: o$1([
7255
+ { json: 'context', js: 'context', typ: r$1('Context') },
7256
+ { json: 'resultType', js: 'resultType', typ: u$1(undefined, '') },
7257
+ ], false),
7258
+ FindIntentsByContextResponsePayload: o$1([
7259
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7260
+ { json: 'appIntents', js: 'appIntents', typ: u$1(undefined, a$1(r$1('AppIntent'))) },
7261
+ ], false),
7262
+ GetAppMetadataResponsePayload: o$1([
7263
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7264
+ { json: 'appMetadata', js: 'appMetadata', typ: u$1(undefined, r$1('AppMetadata')) },
7265
+ ], false),
7266
+ GetCurrentChannelResponsePayload: o$1([
7267
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) },
7268
+ { json: 'channel', js: 'channel', typ: u$1(undefined, u$1(r$1('Channel'), null)) },
7269
+ ], false),
7270
+ GetCurrentContextRequestPayload: o$1([
7271
+ { json: 'channelId', js: 'channelId', typ: '' },
7272
+ { json: 'contextType', js: 'contextType', typ: u$1(null, '') },
7273
+ ], false),
7274
+ GetCurrentContextResponsePayload: o$1([
7275
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7276
+ { json: 'context', js: 'context', typ: u$1(undefined, u$1(null, r$1('Context'))) },
7277
+ ], false),
7278
+ GetInfoResponsePayload: o$1([
7279
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) },
7280
+ { json: 'implementationMetadata', js: 'implementationMetadata', typ: u$1(undefined, r$1('ImplementationMetadata')) },
7281
+ ], false),
7282
+ GetOrCreateChannelResponsePayload: o$1([
7283
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7284
+ { json: 'channel', js: 'channel', typ: u$1(undefined, r$1('Channel')) },
7285
+ ], false),
7286
+ GetUserChannelsResponsePayload: o$1([
7287
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7288
+ { json: 'userChannels', js: 'userChannels', typ: u$1(undefined, a$1(r$1('Channel'))) },
7289
+ ], false),
7290
+ IntentEventPayload: o$1([
7291
+ { json: 'context', js: 'context', typ: r$1('Context') },
7292
+ { json: 'intent', js: 'intent', typ: '' },
7293
+ { json: 'originatingApp', js: 'originatingApp', typ: u$1(undefined, r$1('AppIdentifier')) },
7294
+ { json: 'raiseIntentRequestUuid', js: 'raiseIntentRequestUuid', typ: '' },
7295
+ ], false),
7296
+ IntentResult: o$1([
7297
+ { json: 'context', js: 'context', typ: u$1(undefined, r$1('Context')) },
7298
+ { json: 'channel', js: 'channel', typ: u$1(undefined, r$1('Channel')) },
7299
+ ], false),
7300
+ JoinUserChannelResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) }], false),
7301
+ LeaveCurrentChannelResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) }], false),
7302
+ OpenRequestPayload: o$1([
7303
+ { json: 'app', js: 'app', typ: r$1('AppIdentifier') },
7304
+ { json: 'context', js: 'context', typ: u$1(undefined, r$1('Context')) },
7305
+ ], false),
7306
+ OpenResponsePayload: o$1([
7307
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('OpenErrorResponsePayload')) },
7308
+ { json: 'appIdentifier', js: 'appIdentifier', typ: u$1(undefined, r$1('AppIdentifier')) },
7309
+ ], false),
7310
+ PrivateChannelAddEventListenerRequestPayload: o$1([
7311
+ { json: 'listenerType', js: 'listenerType', typ: u$1(r$1('PrivateChannelEventType'), null) },
7312
+ { json: 'privateChannelId', js: 'privateChannelId', typ: '' },
7313
+ ], false),
7314
+ PrivateChannelAddEventListenerResponsePayload: o$1([
7315
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7316
+ { json: 'listenerUUID', js: 'listenerUUID', typ: u$1(undefined, '') },
7317
+ ], false),
7318
+ PrivateChannelDisconnectResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) }], false),
7319
+ PrivateChannelOnAddContextListenerEventPayload: o$1([
7320
+ { json: 'contextType', js: 'contextType', typ: u$1(null, '') },
7321
+ { json: 'privateChannelId', js: 'privateChannelId', typ: '' },
7322
+ ], false),
7323
+ PrivateChannelOnUnsubscribeEventPayload: o$1([
7324
+ { json: 'contextType', js: 'contextType', typ: u$1(null, '') },
7325
+ { json: 'privateChannelId', js: 'privateChannelId', typ: '' },
7326
+ ], false),
7327
+ RaiseIntentForContextRequestPayload: o$1([
7328
+ { json: 'app', js: 'app', typ: u$1(undefined, r$1('AppIdentifier')) },
7329
+ { json: 'context', js: 'context', typ: r$1('Context') },
7330
+ ], false),
7331
+ RaiseIntentForContextResponsePayload: o$1([
7332
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7333
+ { json: 'intentResolution', js: 'intentResolution', typ: u$1(undefined, r$1('IntentResolution')) },
7334
+ { json: 'appIntents', js: 'appIntents', typ: u$1(undefined, a$1(r$1('AppIntent'))) },
7335
+ ], false),
7336
+ RaiseIntentRequestPayload: o$1([
7337
+ { json: 'app', js: 'app', typ: u$1(undefined, r$1('AppIdentifier')) },
7338
+ { json: 'context', js: 'context', typ: r$1('Context') },
7339
+ { json: 'intent', js: 'intent', typ: '' },
7340
+ ], false),
7341
+ RaiseIntentResponsePayload: o$1([
7342
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('FindInstancesErrors')) },
7343
+ { json: 'intentResolution', js: 'intentResolution', typ: u$1(undefined, r$1('IntentResolution')) },
7344
+ { json: 'appIntent', js: 'appIntent', typ: u$1(undefined, r$1('AppIntent')) },
7345
+ ], false),
7346
+ RaiseIntentResultResponsePayload: o$1([
7347
+ { json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) },
7348
+ { json: 'intentResult', js: 'intentResult', typ: u$1(undefined, r$1('IntentResult')) },
7349
+ ], false)});
7350
+
7351
+ // To parse this data:
7352
+ //
7353
+ // import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse } from "./file";
6072
7354
  //
6073
- // const fDC3DesktopAgentAPISchema = Convert.toFDC3DesktopAgentAPISchema(json);
6074
7355
  // const agentErrorResponseMessage = Convert.toAgentErrorResponseMessage(json);
6075
7356
  // const agentRequestMessage = Convert.toAgentRequestMessage(json);
6076
7357
  // const agentResponseMessage = Convert.toAgentResponseMessage(json);
@@ -6079,7 +7360,7 @@ class EventDispatcher {
6079
7360
  // const bridgeResponseMessage = Convert.toBridgeResponseMessage(json);
6080
7361
  // const broadcastAgentRequest = Convert.toBroadcastAgentRequest(json);
6081
7362
  // const broadcastBridgeRequest = Convert.toBroadcastBridgeRequest(json);
6082
- // const bridgingCommons = Convert.toBridgingCommons(json);
7363
+ // const bridgeCommonDefinitions = Convert.toBridgeCommonDefinitions(json);
6083
7364
  // const connectionStepMessage = Convert.toConnectionStepMessage(json);
6084
7365
  // const connectionStep2Hello = Convert.toConnectionStep2Hello(json);
6085
7366
  // const connectionStep3Handshake = Convert.toConnectionStep3Handshake(json);
@@ -6137,17 +7418,439 @@ class EventDispatcher {
6137
7418
  // const raiseIntentResultAgentResponse = Convert.toRaiseIntentResultAgentResponse(json);
6138
7419
  // const raiseIntentResultBridgeErrorResponse = Convert.toRaiseIntentResultBridgeErrorResponse(json);
6139
7420
  // const raiseIntentResultBridgeResponse = Convert.toRaiseIntentResultBridgeResponse(json);
6140
- // const context = Convert.toContext(json);
6141
7421
  //
6142
7422
  // These functions will throw an error if the JSON doesn't
6143
7423
  // match the expected interface, even if the JSON is valid.
6144
7424
  // Converts JSON strings to/from your types
6145
7425
  // and asserts the results of JSON.parse at runtime
7426
+ function a(typ) {
7427
+ return { arrayItems: typ };
7428
+ }
7429
+ function u(...typs) {
7430
+ return { unionMembers: typs };
7431
+ }
7432
+ function o(props, additional) {
7433
+ return { props, additional };
7434
+ }
7435
+ function m(additional) {
7436
+ return { props: [], additional };
7437
+ }
7438
+ function r(name) {
7439
+ return { ref: name };
7440
+ }
7441
+ ({
7442
+ AgentRequestMetadata: o([
7443
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7444
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7445
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceIdentifier')) },
7446
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7447
+ ], false),
7448
+ BridgeParticipantIdentifier: o([
7449
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7450
+ { json: 'appId', js: 'appId', typ: u(undefined, '') },
7451
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7452
+ ], 'any'),
7453
+ SourceIdentifier: o([
7454
+ { json: 'appId', js: 'appId', typ: u(undefined, '') },
7455
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u(undefined, '') },
7456
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7457
+ ], 'any'),
7458
+ ResponseErrorMessagePayload: o([{ json: 'error', js: 'error', typ: u(undefined, r('ResponseErrorDetail')) }], 'any'),
7459
+ BridgeRequestMetadata: o([
7460
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7461
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7462
+ { json: 'source', js: 'source', typ: r('BridgeParticipantIdentifier') },
7463
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7464
+ ], false),
7465
+ BridgeResponseMessageMeta: o([
7466
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7467
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7468
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7469
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7470
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7471
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7472
+ ], false),
7473
+ SourceObject: o([
7474
+ { json: 'appId', js: 'appId', typ: '' },
7475
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u(undefined, '') },
7476
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7477
+ ], 'any'),
7478
+ Context: o([
7479
+ { json: 'id', js: 'id', typ: u(undefined, m('any')) },
7480
+ { json: 'name', js: 'name', typ: u(undefined, '') },
7481
+ { json: 'type', js: 'type', typ: '' },
7482
+ ], 'any'),
7483
+ MetaSource: o([
7484
+ { json: 'appId', js: 'appId', typ: '' },
7485
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7486
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7487
+ ], 'any'),
7488
+ ConnectionStepMetadata: o([
7489
+ { json: 'requestUuid', js: 'requestUuid', typ: u(undefined, '') },
7490
+ { json: 'responseUuid', js: 'responseUuid', typ: u(undefined, '') },
7491
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7492
+ ], false),
7493
+ ConnectionStep2HelloPayload: o([
7494
+ { json: 'authRequired', js: 'authRequired', typ: true },
7495
+ { json: 'authToken', js: 'authToken', typ: u(undefined, '') },
7496
+ { json: 'desktopAgentBridgeVersion', js: 'desktopAgentBridgeVersion', typ: '' },
7497
+ { json: 'supportedFDC3Versions', js: 'supportedFDC3Versions', typ: a('') },
7498
+ ], false),
7499
+ ConnectionStep3HandshakePayload: o([
7500
+ { json: 'authToken', js: 'authToken', typ: u(undefined, '') },
7501
+ { json: 'channelsState', js: 'channelsState', typ: m(a(r('Context'))) },
7502
+ { json: 'implementationMetadata', js: 'implementationMetadata', typ: r('ConnectingAgentImplementationMetadata') },
7503
+ { json: 'requestedName', js: 'requestedName', typ: '' },
7504
+ ], false),
7505
+ ConnectingAgentImplementationMetadata: o([
7506
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7507
+ { json: 'optionalFeatures', js: 'optionalFeatures', typ: r('OptionalFeatures') },
7508
+ { json: 'provider', js: 'provider', typ: '' },
7509
+ { json: 'providerVersion', js: 'providerVersion', typ: u(undefined, '') },
7510
+ ], false),
7511
+ ConnectionStep4AuthenticationFailedPayload: o([{ json: 'message', js: 'message', typ: u(undefined, '') }], false),
7512
+ ConnectionStep6ConnectedAgentsUpdatePayload: o([
7513
+ { json: 'addAgent', js: 'addAgent', typ: u(undefined, '') },
7514
+ { json: 'allAgents', js: 'allAgents', typ: a(r('DesktopAgentImplementationMetadata')) },
7515
+ { json: 'channelsState', js: 'channelsState', typ: u(undefined, m(a(r('Context')))) },
7516
+ { json: 'removeAgent', js: 'removeAgent', typ: u(undefined, '') },
7517
+ ], false),
7518
+ DesktopAgentImplementationMetadata: o([
7519
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7520
+ { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7521
+ { json: 'optionalFeatures', js: 'optionalFeatures', typ: r('OptionalFeatures') },
7522
+ { json: 'provider', js: 'provider', typ: '' },
7523
+ { json: 'providerVersion', js: 'providerVersion', typ: u(undefined, '') },
7524
+ ], false),
7525
+ FindInstancesAgentRequestMeta: o([
7526
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7527
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7528
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceIdentifier')) },
7529
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7530
+ ], false),
7531
+ DestinationObject: o([
7532
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7533
+ { json: 'appId', js: 'appId', typ: u(undefined, '') },
7534
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7535
+ ], 'any'),
7536
+ AppIdentifier: o([
7537
+ { json: 'appId', js: 'appId', typ: '' },
7538
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u(undefined, '') },
7539
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7540
+ ], 'any'),
7541
+ AppMetadata: o([
7542
+ { json: 'appId', js: 'appId', typ: '' },
7543
+ { json: 'description', js: 'description', typ: u(undefined, '') },
7544
+ { json: 'desktopAgent', js: 'desktopAgent', typ: u(undefined, '') },
7545
+ { json: 'icons', js: 'icons', typ: u(undefined, a(r('Icon'))) },
7546
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7547
+ { json: 'instanceMetadata', js: 'instanceMetadata', typ: u(undefined, m('any')) },
7548
+ { json: 'name', js: 'name', typ: u(undefined, '') },
7549
+ { json: 'resultType', js: 'resultType', typ: u(undefined, u(null, '')) },
7550
+ { json: 'screenshots', js: 'screenshots', typ: u(undefined, a(r('Image'))) },
7551
+ { json: 'title', js: 'title', typ: u(undefined, '') },
7552
+ { json: 'tooltip', js: 'tooltip', typ: u(undefined, '') },
7553
+ { json: 'version', js: 'version', typ: u(undefined, '') },
7554
+ ], false),
7555
+ Icon: o([
7556
+ { json: 'size', js: 'size', typ: u(undefined, '') },
7557
+ { json: 'src', js: 'src', typ: '' },
7558
+ { json: 'type', js: 'type', typ: u(undefined, '') },
7559
+ ], false),
7560
+ Image: o([
7561
+ { json: 'label', js: 'label', typ: u(undefined, '') },
7562
+ { json: 'size', js: 'size', typ: u(undefined, '') },
7563
+ { json: 'src', js: 'src', typ: '' },
7564
+ { json: 'type', js: 'type', typ: u(undefined, '') },
7565
+ ], false),
7566
+ FindInstancesBridgeRequestMeta: o([
7567
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7568
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7569
+ { json: 'source', js: 'source', typ: r('MetaSourceObject') },
7570
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7571
+ ], false),
7572
+ MetaSourceObject: o([
7573
+ { json: 'appId', js: 'appId', typ: u(undefined, '') },
7574
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7575
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7576
+ ], 'any'),
7577
+ FindIntentAgentRequestMeta: o([
7578
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7579
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceIdentifier')) },
7580
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7581
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7582
+ ], false),
7583
+ FindIntentAgentRequestPayload: o([
7584
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7585
+ { json: 'intent', js: 'intent', typ: '' },
7586
+ { json: 'resultType', js: 'resultType', typ: u(undefined, '') },
7587
+ ], false),
7588
+ IntentMetadata: o([
7589
+ { json: 'displayName', js: 'displayName', typ: u(undefined, '') },
7590
+ { json: 'name', js: 'name', typ: '' },
7591
+ ], false),
7592
+ FindIntentBridgeRequestMeta: o([
7593
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7594
+ { json: 'source', js: 'source', typ: r('BridgeParticipantIdentifier') },
7595
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7596
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7597
+ ], false),
7598
+ FindIntentBridgeRequestPayload: o([
7599
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7600
+ { json: 'intent', js: 'intent', typ: '' },
7601
+ { json: 'resultType', js: 'resultType', typ: u(undefined, '') },
7602
+ ], false),
7603
+ FindIntentBridgeResponseMeta: o([
7604
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7605
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7606
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7607
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7608
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7609
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7610
+ ], false),
7611
+ FindIntentsByContextAgentRequestMeta: o([
7612
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7613
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7614
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7615
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7616
+ ], false),
7617
+ FindIntentsByContextAgentRequestPayload: o([
7618
+ { json: 'context', js: 'context', typ: r('Context') },
7619
+ { json: 'resultType', js: 'resultType', typ: u(undefined, '') },
7620
+ ], false),
7621
+ FindIntentsByContextBridgeRequestMeta: o([
7622
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7623
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7624
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7625
+ { json: 'destination', js: 'destination', typ: u(undefined, r('BridgeParticipantIdentifier')) },
7626
+ ], false),
7627
+ FindIntentsByContextBridgeRequestPayload: o([
7628
+ { json: 'context', js: 'context', typ: r('Context') },
7629
+ { json: 'resultType', js: 'resultType', typ: u(undefined, '') },
7630
+ ], false),
7631
+ FindIntentsByContextBridgeResponseMeta: o([
7632
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7633
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7634
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7635
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7636
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7637
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7638
+ ], false),
7639
+ GetAppMetadataAgentRequestMeta: o([
7640
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7641
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7642
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceIdentifier')) },
7643
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7644
+ ], false),
7645
+ AppObject: o([
7646
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7647
+ { json: 'appId', js: 'appId', typ: '' },
7648
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7649
+ ], 'any'),
7650
+ GetAppMetadataBridgeRequestMeta: o([
7651
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7652
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7653
+ { json: 'source', js: 'source', typ: r('MetaSourceObject') },
7654
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7655
+ ], false),
7656
+ GetAppMetadataBridgeResponseMeta: o([
7657
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7658
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7659
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7660
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7661
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7662
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7663
+ ], false),
7664
+ OpenAgentRequestMeta: o([
7665
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7666
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7667
+ { json: 'source', js: 'source', typ: r('SourceObject') },
7668
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7669
+ ], false),
7670
+ OpenAgentRequestPayload: o([
7671
+ { json: 'app', js: 'app', typ: r('AppToOpen') },
7672
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7673
+ ], false),
7674
+ AppToOpen: o([
7675
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7676
+ { json: 'appId', js: 'appId', typ: '' },
7677
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7678
+ ], 'any'),
7679
+ OpenBridgeRequestMeta: o([
7680
+ { json: 'destination', js: 'destination', typ: u(undefined, r('DestinationObject')) },
7681
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7682
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7683
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7684
+ ], false),
7685
+ OpenBridgeRequestPayload: o([
7686
+ { json: 'app', js: 'app', typ: r('AppToOpen') },
7687
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7688
+ ], false),
7689
+ OpenBridgeResponseMeta: o([
7690
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7691
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7692
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7693
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7694
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7695
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7696
+ ], false),
7697
+ PrivateChannelBroadcastAgentRequestMeta: o([
7698
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7699
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7700
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7701
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7702
+ ], false),
7703
+ MetaDestination: o([
7704
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7705
+ { json: 'appId', js: 'appId', typ: '' },
7706
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7707
+ ], 'any'),
7708
+ PrivateChannelBroadcastBridgeRequestMeta: o([
7709
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7710
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7711
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7712
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7713
+ ], false),
7714
+ PrivateChannelEventListenerAddedAgentRequestMeta: o([
7715
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7716
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7717
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7718
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7719
+ ], false),
7720
+ PrivateChannelEventListenerAddedBridgeRequestMeta: o([
7721
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7722
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7723
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7724
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7725
+ ], false),
7726
+ PrivateChannelEventListenerRemovedAgentRequestMeta: o([
7727
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7728
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7729
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7730
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7731
+ ], false),
7732
+ PrivateChannelEventListenerRemovedBridgeRequestMeta: o([
7733
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7734
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7735
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7736
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7737
+ ], false),
7738
+ PrivateChannelOnAddContextListenerAgentRequestMeta: o([
7739
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7740
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7741
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7742
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7743
+ ], false),
7744
+ PrivateChannelOnAddContextListenerAgentRequestPayload: o([
7745
+ { json: 'channelId', js: 'channelId', typ: '' },
7746
+ { json: 'contextType', js: 'contextType', typ: u(null, '') },
7747
+ ], false),
7748
+ PrivateChannelOnAddContextListenerBridgeRequestMeta: o([
7749
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7750
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7751
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7752
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7753
+ ], false),
7754
+ PrivateChannelOnAddContextListenerBridgeRequestPayload: o([
7755
+ { json: 'channelId', js: 'channelId', typ: '' },
7756
+ { json: 'contextType', js: 'contextType', typ: u(null, '') },
7757
+ ], false),
7758
+ PrivateChannelOnDisconnectAgentRequestMeta: o([
7759
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7760
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7761
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7762
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7763
+ ], false),
7764
+ PrivateChannelOnDisconnectBridgeRequestMeta: o([
7765
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7766
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7767
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7768
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7769
+ ], false),
7770
+ PrivateChannelOnUnsubscribeAgentRequestMeta: o([
7771
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7772
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7773
+ { json: 'source', js: 'source', typ: u(undefined, r('SourceObject')) },
7774
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7775
+ ], false),
7776
+ PrivateChannelOnUnsubscribeAgentRequestPayload: o([
7777
+ { json: 'channelId', js: 'channelId', typ: '' },
7778
+ { json: 'contextType', js: 'contextType', typ: u(null, '') },
7779
+ ], false),
7780
+ ERequestMetadata: o([
7781
+ { json: 'destination', js: 'destination', typ: u(undefined, r('MetaDestination')) },
7782
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7783
+ { json: 'source', js: 'source', typ: r('MetaSource') },
7784
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7785
+ ], false),
7786
+ PrivateChannelOnUnsubscribeBridgeRequestPayload: o([
7787
+ { json: 'channelId', js: 'channelId', typ: '' },
7788
+ { json: 'contextType', js: 'contextType', typ: u(null, '') },
7789
+ ], false),
7790
+ AppDestinationIdentifier: o([
7791
+ { json: 'desktopAgent', js: 'desktopAgent', typ: '' },
7792
+ { json: 'appId', js: 'appId', typ: '' },
7793
+ { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') },
7794
+ ], 'any'),
7795
+ RaiseIntentBridgeResponseMeta: o([
7796
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7797
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7798
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7799
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7800
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7801
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7802
+ ], false),
7803
+ IntentResult: o([
7804
+ { json: 'context', js: 'context', typ: u(undefined, r('Context')) },
7805
+ { json: 'channel', js: 'channel', typ: u(undefined, r('Channel')) },
7806
+ ], false),
7807
+ Channel: o([
7808
+ { json: 'displayMetadata', js: 'displayMetadata', typ: u(undefined, r('DisplayMetadata')) },
7809
+ { json: 'id', js: 'id', typ: '' },
7810
+ { json: 'type', js: 'type', typ: r('Type') },
7811
+ ], false),
7812
+ DisplayMetadata: o([
7813
+ { json: 'color', js: 'color', typ: u(undefined, '') },
7814
+ { json: 'glyph', js: 'glyph', typ: u(undefined, '') },
7815
+ { json: 'name', js: 'name', typ: u(undefined, '') },
7816
+ ], false),
7817
+ RaiseIntentResultBridgeResponseMeta: o([
7818
+ { json: 'errorDetails', js: 'errorDetails', typ: u(undefined, a(r('ResponseErrorDetail'))) },
7819
+ { json: 'errorSources', js: 'errorSources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7820
+ { json: 'requestUuid', js: 'requestUuid', typ: '' },
7821
+ { json: 'responseUuid', js: 'responseUuid', typ: '' },
7822
+ { json: 'sources', js: 'sources', typ: u(undefined, a(r('DesktopAgentIdentifier'))) },
7823
+ { json: 'timestamp', js: 'timestamp', typ: Date },
7824
+ ], false)});
6146
7825
 
6147
7826
  /**
6148
7827
  * SPDX-License-Identifier: Apache-2.0
6149
7828
  * Copyright FINOS FDC3 contributors - see NOTICE file
6150
7829
  */
7830
+ /**
7831
+ * Contains constants representing the errors that can be encountered when trying to connect to a web-based Desktop Agent with the getAgent function.
7832
+ */
7833
+ var AgentError;
7834
+ (function (AgentError) {
7835
+ /** Returned if no Desktop Agent was found by any means available or
7836
+ * if the Agent previously connected to is not contactable on a
7837
+ * subsequent connection attempt.*/
7838
+ AgentError["AgentNotFound"] = "AgentNotFound";
7839
+ /** Returned if validation of the app identity by the Desktop Agent
7840
+ * Failed or the app is not being allowed to connect to the Desktop Agent
7841
+ * for another reason. */
7842
+ AgentError["AccessDenied"] = "AccessDenied";
7843
+ /** Returned if an error or exception occurs while trying to set
7844
+ * up communication with a Desktop Agent. */
7845
+ AgentError["ErrorOnConnect"] = "ErrorOnConnect";
7846
+ /** Returned if the failover function is not a function, or it did not
7847
+ * resolve to one of the allowed types. */
7848
+ AgentError["InvalidFailover"] = "InvalidFailover";
7849
+ /** Returned if an API call rejects after a timeout. Used where an API call
7850
+ * is not aligned to another error enumeration.
7851
+ */
7852
+ AgentError["ApiTimeout"] = "ApiTimeout";
7853
+ })(AgentError || (AgentError = {}));
6151
7854
  /** Constants representing the errors that can be encountered when calling the `open` method on the DesktopAgent object (`fdc3`). */
6152
7855
  var OpenError;
6153
7856
  (function (OpenError) {
@@ -6163,6 +7866,8 @@ var OpenError;
6163
7866
  OpenError["MalformedContext"] = "MalformedContext";
6164
7867
  /** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
6165
7868
  OpenError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
7869
+ /** Returned if a timeout occurs before a call to open is resolved for any reason other than the not adding its context listener in time.*/
7870
+ OpenError["ApiTimeout"] = "ApiTimeout";
6166
7871
  })(OpenError || (OpenError = {}));
6167
7872
  /** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
6168
7873
  var ResolveError;
@@ -6185,6 +7890,8 @@ var ResolveError;
6185
7890
  ResolveError["MalformedContext"] = "MalformedContext";
6186
7891
  /** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
6187
7892
  ResolveError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
7893
+ /** Returned if a timeout occurs before the API call is resolved for any reason other than the resolver timing out (use ResolverTimeout) or an app launched by a raiseIntent function doesn't add its intent listener in time (use IntentDeliveryFailed).*/
7894
+ ResolveError["ApiTimeout"] = "ApiTimeout";
6188
7895
  })(ResolveError || (ResolveError = {}));
6189
7896
  var ResultError;
6190
7897
  (function (ResultError) {
@@ -6192,6 +7899,8 @@ var ResultError;
6192
7899
  ResultError["NoResultReturned"] = "NoResultReturned";
6193
7900
  /** Returned if the Intent handler function processing the raised intent throws an error or rejects the Promise it returned. */
6194
7901
  ResultError["IntentHandlerRejected"] = "IntentHandlerRejected";
7902
+ /** Returned if a timeout occurs before the getResult() API call is resolved.*/
7903
+ ResultError["ApiTimeout"] = "ApiTimeout";
6195
7904
  })(ResultError || (ResultError = {}));
6196
7905
  var ChannelError;
6197
7906
  (function (ChannelError) {
@@ -6203,6 +7912,8 @@ var ChannelError;
6203
7912
  ChannelError["CreationFailed"] = "CreationFailed";
6204
7913
  /** Returned if a call to the `broadcast` functions is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
6205
7914
  ChannelError["MalformedContext"] = "MalformedContext";
7915
+ /** Returned if a timeout occurs before any Channel related API call is resolved.*/
7916
+ ChannelError["ApiTimeout"] = "ApiTimeout";
6206
7917
  })(ChannelError || (ChannelError = {}));
6207
7918
  var BridgingError;
6208
7919
  (function (BridgingError) {
@@ -6215,28 +7926,51 @@ var BridgingError;
6215
7926
  /** @experimental Returned if a message to a Bridge deviates from the schema for that message sufficiently that it could not be processed. */
6216
7927
  BridgingError["MalformedMessage"] = "MalformedMessage";
6217
7928
  })(BridgingError || (BridgingError = {}));
6218
-
6219
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
6220
- var e = new Error(message);
6221
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
6222
- };
7929
+
7930
+ /**
7931
+ * Type representing the different log-levels that can be set.
7932
+ */
7933
+ var LogLevel;
7934
+ (function (LogLevel) {
7935
+ LogLevel[LogLevel["NONE"] = 0] = "NONE";
7936
+ LogLevel[LogLevel["ERROR"] = 1] = "ERROR";
7937
+ LogLevel[LogLevel["WARN"] = 2] = "WARN";
7938
+ LogLevel[LogLevel["INFO"] = 3] = "INFO";
7939
+ LogLevel[LogLevel["DEBUG"] = 4] = "DEBUG";
7940
+ })(LogLevel || (LogLevel = {}));
7941
+ /** Enumeration of values used to describe types of web-based
7942
+ * Desktop Agent. Each 'type' refers to the means by which
7943
+ * a connection to the agent is made and/or an interface to it
7944
+ * received. */
7945
+ var WebDesktopAgentType;
7946
+ (function (WebDesktopAgentType) {
7947
+ /** Denotes Desktop Agents that inject the FDC3 interface
7948
+ * at `window.fdc3`. */
7949
+ WebDesktopAgentType["Preload"] = "PRELOAD";
7950
+ /** Denotes Desktop Agents that run (or provide an interface)
7951
+ * within a parent window or frame, a reference to which
7952
+ * will be found at `window.opener`, `window.parent`,
7953
+ * `window.parent.opener` etc. */
7954
+ WebDesktopAgentType["ProxyParent"] = "PROXY_PARENT";
7955
+ /** Denotes Desktop Agents that are connected to by loading a URL
7956
+ * into a hidden iframe whose URL was returned by a parent window
7957
+ * or frame. */
7958
+ WebDesktopAgentType["ProxyUrl"] = "PROXY_URL";
7959
+ /** Denotes a Desktop Agent that was returned by a failover
7960
+ * function that was passed by the application. */
7961
+ WebDesktopAgentType["Failover"] = "FAILOVER";
7962
+ })(WebDesktopAgentType || (WebDesktopAgentType = {}));
6223
7963
 
6224
7964
  /**
6225
7965
  * Ensures at compile time that the given string tuple is exhaustive on a given union type, i.e. contains ALL possible values of the given UNION_TYPE.
6226
7966
  */
6227
- var exhaustiveStringTuple = function () { return function () {
6228
- var tuple = [];
6229
- for (var _i = 0; _i < arguments.length; _i++) {
6230
- tuple[_i] = arguments[_i];
6231
- }
6232
- return tuple;
6233
- }; };
7967
+ const exhaustiveStringTuple = () => (...tuple) => tuple;
6234
7968
 
6235
- var STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.nothing', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
7969
+ const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.nothing', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
6236
7970
  // used internally to check if a given intent/context is a standard one
6237
7971
  new Set(STANDARD_CONTEXT_TYPES);
6238
7972
 
6239
- var STANDARD_INTENTS = exhaustiveStringTuple()('CreateInteraction', 'SendChatMessage', 'StartCall', 'StartChat', 'StartEmail', 'ViewAnalysis', 'ViewChat', 'ViewChart', 'ViewContact', 'ViewHoldings', 'ViewInstrument', 'ViewInteractions', 'ViewMessages', 'ViewNews', 'ViewOrders', 'ViewProfile', 'ViewQuote', 'ViewResearch');
7973
+ const STANDARD_INTENTS = exhaustiveStringTuple()('CreateInteraction', 'CreateOrUpdateProfile', 'SendChatMessage', 'StartCall', 'StartChat', 'StartEmail', 'ViewAnalysis', 'ViewChat', 'ViewChart', 'ViewContact', 'ViewHoldings', 'ViewInstrument', 'ViewInteractions', 'ViewMessages', 'ViewNews', 'ViewOrders', 'ViewProfile', 'ViewQuote', 'ViewResearch');
6240
7974
  // used internally to check if a given intent/context is a standard one
6241
7975
  new Set(STANDARD_INTENTS);
6242
7976
 
@@ -6280,6 +8014,7 @@ var ContextTypes;
6280
8014
  var Intents;
6281
8015
  (function (Intents) {
6282
8016
  Intents["CreateInteraction"] = "CreateInteraction";
8017
+ Intents["CreateOrUpdateProfile"] = "CreateOrUpdateProfile";
6283
8018
  Intents["SendChatMessage"] = "SendChatMessage";
6284
8019
  Intents["StartCall"] = "StartCall";
6285
8020
  Intents["StartChat"] = "StartChat";
@@ -6299,6 +8034,90 @@ var Intents;
6299
8034
  Intents["ViewResearch"] = "ViewResearch";
6300
8035
  })(Intents || (Intents = {}));
6301
8036
 
8037
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8038
+ //check if color is supported in (node) console;
8039
+ let noColor = true;
8040
+ //else only occurs in a browser and can't be tested in node
8041
+ /* istanbul ignore if */
8042
+ if (typeof process !== 'undefined') {
8043
+ const argv = process.argv || /* istanbul ignore next */ [];
8044
+ const env = process.env || /* istanbul ignore next */ {};
8045
+ noColor =
8046
+ (!!env.NO_COLOR || argv.includes('--no-color')) &&
8047
+ !(!!env.FORCE_COLOR ||
8048
+ argv.includes('--color') ||
8049
+ process.platform === 'win32' /* istanbul ignore next */ ||
8050
+ ((process.stdout || {}).isTTY && env.TERM !== 'dumb') ||
8051
+ /* istanbul ignore next */ !!env.CI);
8052
+ }
8053
+ class AbstractFDC3Logger {
8054
+ /** This should be overridden by sub-classes to set the prefix applied
8055
+ * to log messages. */
8056
+ /* istanbul ignore next */ static get prefix() {
8057
+ return '';
8058
+ }
8059
+ //sub-classes should override this default log level
8060
+ static logLevel = LogLevel.DEBUG;
8061
+ static setLogLevel(level) {
8062
+ if (level in LogLevel) {
8063
+ this.logLevel = level;
8064
+ }
8065
+ else {
8066
+ /* istanbul ignore next */
8067
+ this.error(`Ignoring unrecognized LogLevel '${level}'! Current log level: '${this.logLevel} (${LogLevel[this.logLevel]})'`);
8068
+ }
8069
+ }
8070
+ static debugColor(value) {
8071
+ return noColor ? /* istanbul ignore next */ value : '\x1b[30m\x1b[2m' + value + '\x1b[22m\x1b[39m';
8072
+ }
8073
+ static logColor(value) {
8074
+ return noColor ? /* istanbul ignore next */ value : '\x1b[32m\x1b[2m' + value + '\x1b[22m\x1b[39m';
8075
+ }
8076
+ static warnColor(value) {
8077
+ return noColor ? /* istanbul ignore next */ value : '\x1b[33m' + value + '\x1b[39m';
8078
+ }
8079
+ static errorColor(value) {
8080
+ return noColor ? /* istanbul ignore next */ value : '\x1b[31m' + value + '\x1b[39m';
8081
+ }
8082
+ static debug(...params) {
8083
+ if (this.logLevel >= LogLevel.DEBUG) {
8084
+ console.debug(...this.prefixAndColorize(this.prefix, params, this.debugColor));
8085
+ }
8086
+ }
8087
+ static log(...params) {
8088
+ if (this.logLevel >= LogLevel.INFO) {
8089
+ console.log(...this.prefixAndColorize(this.prefix, params, this.logColor));
8090
+ }
8091
+ }
8092
+ static warn(...params) {
8093
+ if (this.logLevel >= LogLevel.WARN) {
8094
+ console.warn(...this.prefixAndColorize(this.prefix, params, this.warnColor));
8095
+ }
8096
+ }
8097
+ static error(...params) {
8098
+ if (this.logLevel >= LogLevel.ERROR) {
8099
+ console.error(...this.prefixAndColorize(this.prefix, params, this.errorColor));
8100
+ }
8101
+ }
8102
+ static prefixAndColorize = (prefix, params, colorFn) => {
8103
+ const prefixed = [prefix, ...params];
8104
+ return prefixed.map(value => {
8105
+ if (typeof value === 'string') {
8106
+ //just color strings
8107
+ return colorFn(value);
8108
+ }
8109
+ else if (value && value.stack && value.message) {
8110
+ //probably an error
8111
+ return colorFn(value.stack);
8112
+ }
8113
+ else {
8114
+ //something else... lets hope it stringifies
8115
+ return colorFn(JSON.stringify(value, null, 2));
8116
+ }
8117
+ });
8118
+ };
8119
+ }
8120
+
6302
8121
  class DesktopAgent {
6303
8122
  intentsController;
6304
8123
  applicationController;
@@ -6312,6 +8131,7 @@ class DesktopAgent {
6312
8131
  const api = {
6313
8132
  getStartupContext: this.getStartupContext.bind(this),
6314
8133
  addContextListener: this.addContextListener.bind(this),
8134
+ addEventListener: this.addEventListener.bind(this),
6315
8135
  addIntentListener: this.addIntentListener.bind(this),
6316
8136
  broadcast: this.broadcast.bind(this),
6317
8137
  createPrivateChannel: this.createPrivateChannel.bind(this),
@@ -6453,6 +8273,13 @@ class DesktopAgent {
6453
8273
  async leaveCurrentChannels() {
6454
8274
  return this.channelsController.leave(generateCommandId());
6455
8275
  }
8276
+ async addEventListener(type, handler) {
8277
+ optionalFdc3EventTypesDecoder.runWithException(type);
8278
+ if (typeof handler !== "function") {
8279
+ throw new Error("Please provide the handler as a function!");
8280
+ }
8281
+ return this.channelsController.addEventListener({ commandId: generateCommandId(), type, handler });
8282
+ }
6456
8283
  }
6457
8284
 
6458
8285
  class AppChannel {
@@ -6570,13 +8397,13 @@ class UserChannel {
6570
8397
  async addContextListener(contextType, handler) {
6571
8398
  if (arguments.length === 1) {
6572
8399
  if (typeof contextType !== "function") {
6573
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof contextType}` };
8400
+ throw new Error(ChannelError.AccessDenied);
6574
8401
  }
6575
8402
  return this.channelsController.addContextListener({ commandId: generateCommandId(), handler: contextType, channelId: this.id });
6576
8403
  }
6577
8404
  const contextTypeDecoder = optionalNonEmptyStringDecoder.runWithException(contextType);
6578
8405
  if (typeof handler !== "function") {
6579
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof handler}` };
8406
+ throw new Error(ChannelError.AccessDenied);
6580
8407
  }
6581
8408
  return this.channelsController.addContextListener({ commandId: generateCommandId(), handler, contextType: contextTypeDecoder, channelId: this.id });
6582
8409
  }
@@ -6607,6 +8434,22 @@ const parseContextHandler = (handler, contextType) => {
6607
8434
  };
6608
8435
  return subHandler;
6609
8436
  };
8437
+ const parseHandlerToEventHandler = ({ handler, eventType, contextType }) => {
8438
+ const eventHandler = (event) => {
8439
+ const { type, details } = event;
8440
+ if (eventType && type !== eventType) {
8441
+ return;
8442
+ }
8443
+ if (contextType) {
8444
+ if (details.type === contextType) {
8445
+ handler(details, details.metadata);
8446
+ }
8447
+ return;
8448
+ }
8449
+ handler(details, details.metadata);
8450
+ };
8451
+ return eventHandler;
8452
+ };
6610
8453
 
6611
8454
  class IntentsController {
6612
8455
  glueController;
@@ -6644,11 +8487,11 @@ class IntentsController {
6644
8487
  this.logger?.info(`[${commandId}] - findIntent() invoked for intent ${intent} with contextType ${context?.type} and resultType ${resultType}`);
6645
8488
  const glueIntents = await this.glueController.findIntents({ name: intent });
6646
8489
  if (!glueIntents.length) {
6647
- throw { message: ResolveError.NoAppsFound, reason: `There are no apps handling the passed intent ${intent}` };
8490
+ throw new Error(ResolveError.NoAppsFound);
6648
8491
  }
6649
8492
  const searchedGlueIntent = glueIntents.find((glueIntent) => glueIntent.name === intent);
6650
8493
  if (!searchedGlueIntent) {
6651
- throw { message: ResolveError.NoAppsFound, reason: `There are no apps handling the passed intent ${intent}` };
8494
+ throw new Error(ResolveError.NoAppsFound);
6652
8495
  }
6653
8496
  if (!context && !resultType) {
6654
8497
  return this.convertGlue42IntentToFDC3Intent(searchedGlueIntent);
@@ -6656,7 +8499,7 @@ class IntentsController {
6656
8499
  const contextType = (context && context.type === fdc3NothingContextType) ? undefined : context?.type;
6657
8500
  const filteredIntent = this.getGlueIntentWithFilteredHandlers(searchedGlueIntent, { contextType, resultType });
6658
8501
  if (!filteredIntent.handlers.length) {
6659
- throw { message: ResolveError.NoAppsFound, reason: `No apps handling intent ${intent} with contextType ${context?.type} and resultType ${resultType}` };
8502
+ throw new Error(ResolveError.NoAppsFound);
6660
8503
  }
6661
8504
  return this.convertGlue42IntentToFDC3Intent(filteredIntent);
6662
8505
  }
@@ -6665,7 +8508,7 @@ class IntentsController {
6665
8508
  this.logger?.info(`[${commandId}] - findIntentsByContext() invoked for context type ${context.type} and resultType ${resultType}`);
6666
8509
  const glueIntents = await this.glueController.findIntents({ contextType: context.type, resultType });
6667
8510
  if (!glueIntents.length) {
6668
- throw { message: ResolveError.NoAppsFound, reason: `No apps registering intent with contextType ${context.type} ${resultType ? `and resultType ${resultType}` : ""}` };
8511
+ throw new Error(ResolveError.NoAppsFound);
6669
8512
  }
6670
8513
  this.logger?.info(`[${commandId}] - parsing glue intents to fdc3 intents and returning`);
6671
8514
  return glueIntents.map((glueIntent) => {
@@ -6675,11 +8518,12 @@ class IntentsController {
6675
8518
  }
6676
8519
  async raiseIntent({ commandId, intent, context, target }) {
6677
8520
  await this.glueController.gluePromise;
6678
- this.logger?.info(`[${commandId}] - raiseIntent() invoked for intent ${intent} with contextType: ${context.type} and target: ${target}`);
8521
+ this.logger?.info(`[${commandId}] - raiseIntent() invoked for intent ${intent} with contextType: ${context.type} and target: ${JSON.stringify(target)}`);
6679
8522
  const glueContext = { type: context.type, data: { ...context } };
6680
8523
  const searchedGlueIntent = (await this.glueController.findIntents({ name: intent })).find(glueIntent => glueIntent.name === intent);
8524
+ this.logger?.info(`[${commandId}] - searchedGlueIntent: ${JSON.stringify(searchedGlueIntent)}`);
6681
8525
  if (!searchedGlueIntent) {
6682
- throw { message: ResolveError.NoAppsFound, reason: `There's no app registering an intent '${intent}'` };
8526
+ throw new Error(ResolveError.NoAppsFound);
6683
8527
  }
6684
8528
  if (!target) {
6685
8529
  const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
@@ -6687,14 +8531,17 @@ class IntentsController {
6687
8531
  return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
6688
8532
  }
6689
8533
  if (target?.instanceId) {
6690
- this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} to target instance of app ${target.appId} and id ${target.instanceId}`);
6691
- return this.invokeRaiseIntent(commandId, {
6692
- intent,
6693
- context: glueContext,
6694
- target: { instance: target.instanceId }
6695
- });
8534
+ return this.raiseIntentToInstanceTarget({ intent, context: glueContext, target: { instance: target.instanceId } }, searchedGlueIntent.handlers, target, commandId);
6696
8535
  }
6697
8536
  const targetAppName = typeof target === "string" ? target : target.appId;
8537
+ const appHandlersWithAppId = searchedGlueIntent.handlers.filter((handler) => handler.applicationName === targetAppName);
8538
+ if (!appHandlersWithAppId.length) {
8539
+ throw new Error(ResolveError.TargetAppUnavailable);
8540
+ }
8541
+ const appHandlersWithContextType = appHandlersWithAppId.filter((handler) => !handler.instanceId && handler.contextTypes?.includes(context.type));
8542
+ if (!appHandlersWithContextType.length) {
8543
+ throw new Error(ResolveError.NoAppsFound);
8544
+ }
6698
8545
  return this.invokeRaiseIntent(commandId, {
6699
8546
  intent,
6700
8547
  context: glueContext,
@@ -6744,7 +8591,23 @@ class IntentsController {
6744
8591
  await this.glueController.gluePromise;
6745
8592
  this.logger?.info(`[${commandId}] - addIntentListener() invoked for intent ${intent}`);
6746
8593
  const wrappedHandler = this.getWrappedIntentHandler(handler);
6747
- return this.glueController.addIntentListener(intent, wrappedHandler);
8594
+ const unsub = await this.glueController.addIntentListener(intent, wrappedHandler);
8595
+ return getListenerWithAsyncUnsubscribe(unsub.unsubscribe);
8596
+ }
8597
+ raiseIntentToInstanceTarget(request, glueHandlers, target, commandId) {
8598
+ this.logger?.info(`[${commandId}] - raising intent ${request.intent} with contextType ${request.context?.type} to target instance of app ${target.appId} and id ${target.instanceId}`);
8599
+ const handlersWithSameAppName = glueHandlers.filter((handler) => handler.applicationName === target.appId);
8600
+ const handlersWithSameContext = this.getGlueIntentWithFilteredHandlers({ name: request.intent, handlers: handlersWithSameAppName }, { contextType: request.context?.type }).handlers;
8601
+ if (!handlersWithSameContext.length) {
8602
+ this.logger?.info(`[${commandId}] - No handlers found for intent ${request.intent} with appName ${target.appId} and contextType ${request.context?.type}`);
8603
+ throw new Error(ResolveError.NoAppsFound);
8604
+ }
8605
+ const isValidInstanceHandler = handlersWithSameContext.find((handler) => handler.instanceId === target.instanceId);
8606
+ if (!isValidInstanceHandler) {
8607
+ this.logger?.info(`[${commandId}] - There's no instance with id ${target.instanceId} of the passed app ${target.appId}`);
8608
+ throw new Error(ResolveError.TargetInstanceUnavailable);
8609
+ }
8610
+ return this.invokeRaiseIntent(commandId, request);
6748
8611
  }
6749
8612
  async checkForRememberedIntentHandlerForContext(contextType) {
6750
8613
  let prefs;
@@ -6787,12 +8650,12 @@ class IntentsController {
6787
8650
  const app = this.glueController.getApplication(appName);
6788
8651
  const serverInstances = this.serverInstanceAsIntentHandler(intent.name);
6789
8652
  if (!app && (typeof target === "string" || !target.instanceId || !serverInstances.length)) {
6790
- throw { message: ResolveError.TargetAppUnavailable, reason: `There's no app with appId ${appName}` };
8653
+ throw new Error(ResolveError.TargetAppUnavailable);
6791
8654
  }
6792
8655
  this.logger?.info(`[${commandId}] - target app ${appName} found. Filtering handlers by applicationName: ${appName}`);
6793
8656
  const validHandlersByApplicationName = intent.handlers.filter((handler) => handler.applicationName === appName);
6794
8657
  if (!validHandlersByApplicationName.length) {
6795
- throw { message: ResolveError.NoAppsFound, reason: `Intent ${intent.name} exists but there's no app with appId ${appName} registering it` };
8658
+ throw new Error(ResolveError.NoAppsFound);
6796
8659
  }
6797
8660
  if (!instanceId) {
6798
8661
  this.logger?.log(`[${commandId}] - returning all handlers for intent ${intent.name} and target: ${JSON.stringify(target)}`);
@@ -6802,12 +8665,12 @@ class IntentsController {
6802
8665
  ? app.instances.find((inst) => inst.id === instanceId)
6803
8666
  : serverInstances.find((inst) => inst.instance === instanceId);
6804
8667
  if (!isValidInstanceOfTheApp) {
6805
- throw { message: ResolveError.TargetInstanceUnavailable, reason: `There's no instance with id ${instanceId} of the passed app ${appName}` };
8668
+ throw new Error(ResolveError.TargetInstanceUnavailable);
6806
8669
  }
6807
8670
  this.logger?.info(`[${commandId}] - Filtering handlers by instanceId: ${instanceId}`);
6808
8671
  const validHandlersByInstanceId = validHandlersByApplicationName.filter((handler) => handler.instanceId === instanceId);
6809
8672
  if (!validHandlersByInstanceId.length) {
6810
- throw { message: ResolveError.IntentDeliveryFailed, reason: `There's no instance with id ${instanceId} of app ${appName} registering intent ${intent.name}` };
8673
+ throw new Error(ResolveError.IntentDeliveryFailed);
6811
8674
  }
6812
8675
  return { name: intent.name, handlers: validHandlersByInstanceId };
6813
8676
  }
@@ -6819,7 +8682,7 @@ class IntentsController {
6819
8682
  filterIntentHandlersByContext(intent, context) {
6820
8683
  const filteredGlueIntent = this.getGlueIntentWithFilteredHandlers(intent, { contextType: context.type });
6821
8684
  if (!filteredGlueIntent.handlers.length) {
6822
- throw { message: ResolveError.NoAppsFound, reason: `There's no app registering an intent with the passed context type ${context.type}` };
8685
+ throw new Error(ResolveError.NoAppsFound);
6823
8686
  }
6824
8687
  return filteredGlueIntent;
6825
8688
  }
@@ -6871,15 +8734,17 @@ class IntentsController {
6871
8734
  apps: handlers.map((handler) => {
6872
8735
  const appName = handler.applicationName;
6873
8736
  const app = this.glueController.getApplication(appName);
8737
+ const icons = (handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons ?? [])] : (app?.userProperties.icons ?? [])).filter((icon) => !!icon).map((icon) => ({ src: icon }));
8738
+ const images = (app?.userProperties.images ?? []).filter((image) => !!image).map((image) => ({ src: image }));
6874
8739
  return {
6875
8740
  appId: appName,
6876
8741
  instanceId: handler.instanceId,
6877
8742
  name: appName,
6878
8743
  title: handler.applicationTitle || handler.instanceTitle || appName,
6879
- tooltip: app?.userProperties.tooltip || `${appName} (${handler.type})`,
8744
+ tooltip: app?.userProperties.tooltip ?? `${appName} (${handler.type})`,
6880
8745
  description: handler.applicationDescription,
6881
- icons: handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons || [])] : app?.userProperties.icons,
6882
- images: app?.userProperties.images,
8746
+ icons,
8747
+ images,
6883
8748
  resultType: handler.resultType
6884
8749
  };
6885
8750
  })
@@ -6941,8 +8806,9 @@ class IntentsController {
6941
8806
  return { name, handlers: filteredHandlers };
6942
8807
  }
6943
8808
  async invokeRaiseIntent(commandId, request) {
8809
+ const inBrowser = this.glueController.isRunningInBrowser();
6944
8810
  try {
6945
- const glueIntentResult = await this.glueController.raiseIntent({ ...request, timeout: RaiseTimeoutMs });
8811
+ const glueIntentResult = await this.glueController.raiseIntent({ ...request, timeout: RaiseTimeoutMs, options: { waitForAGMReady: !inBrowser } });
6946
8812
  return {
6947
8813
  source: {
6948
8814
  appId: glueIntentResult.handler.applicationName,
@@ -6953,7 +8819,7 @@ class IntentsController {
6953
8819
  };
6954
8820
  }
6955
8821
  catch (error) {
6956
- throw this.parseIoToFdc3Error(error);
8822
+ throw new Error(this.parseIoToFdc3Error(error).message);
6957
8823
  }
6958
8824
  }
6959
8825
  parseIoToFdc3Error(error) {
@@ -6967,10 +8833,7 @@ class IntentsController {
6967
8833
  this.logger?.info(`[${commandId}] - raiseIntentForContext() invoked with contextType ${context.type} and target ${target}`);
6968
8834
  const appIntents = await this.findIntentsByContext({ commandId, context });
6969
8835
  if (!appIntents || appIntents.length === 0) {
6970
- throw {
6971
- message: ResolveError.NoAppsFound,
6972
- reason: `No apps registering intent with contextType ${context.type} ${target ? `and target ${JSON.stringify(target)}` : ""}`
6973
- };
8836
+ throw new Error(ResolveError.NoAppsFound);
6974
8837
  }
6975
8838
  return this.raiseIntent({ commandId, intent: appIntents[0].intent.name, context, target });
6976
8839
  }
@@ -6995,50 +8858,51 @@ class ApplicationsController {
6995
8858
  }
6996
8859
  async open({ commandId, target, context }) {
6997
8860
  await this.glueController.gluePromise;
6998
- this.logger?.log(`[${commandId}] - open() invoked with target ${target} ${context ? `and contextType ${context.type}` : ""}`);
8861
+ this.logger?.log(`[${commandId}] - open() invoked with target ${JSON.stringify(target)} ${context ? `and contextType ${context.type}` : ""}`);
6999
8862
  const name = typeof target === "object" ? target.appId : target;
7000
8863
  const app = this.glueController.getApplication(name);
7001
8864
  if (!app) {
7002
- throw { message: OpenError.AppNotFound, reason: `Cannot find targeted ${name} application` };
8865
+ throw new Error(OpenError.AppNotFound);
7003
8866
  }
7004
8867
  if (context) {
7005
8868
  await this.glueEventsController.initializeCollaborateMethod();
7006
- this.logger?.info(`[${commandId}] - opening app ${app} with startup context`);
8869
+ this.logger?.info(`[${commandId}] - opening app '${app.name}' with startup context`);
7007
8870
  return this.openAppWithContext(app, context);
7008
8871
  }
7009
8872
  try {
7010
- this.logger?.info(`[${commandId}] - opening app ${app}`);
7011
- const glueInst = await app.start();
8873
+ this.logger?.info(`[${commandId}] - opening app '${app.name}' without context`);
8874
+ const inBrowser = this.glueController.isRunningInBrowser();
8875
+ const glueInst = await app.start(undefined, { waitForAGMReady: !inBrowser });
7012
8876
  this.logger?.info(`[${commandId}] - instance with id ${glueInst.id} started`);
7013
8877
  return this.parseGlueInstToAppIdentifier(glueInst);
7014
8878
  }
7015
8879
  catch (error) {
7016
- throw { message: OpenError.ErrorOnLaunch, reason: typeof error === "string" ? error : JSON.stringify(error) };
8880
+ throw new Error(OpenError.ErrorOnLaunch);
7017
8881
  }
7018
8882
  }
7019
8883
  async findInstances({ commandId, appIdentifier }) {
7020
8884
  await this.glueController.gluePromise;
7021
- this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${appIdentifier}`);
8885
+ this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
7022
8886
  const { appId } = appIdentifier;
7023
8887
  const app = this.glueController.getApplication(appId);
7024
8888
  if (!app) {
7025
- throw { message: ResolveError.NoAppsFound, reason: `App with appId: ${appId} does not exist` };
8889
+ throw new Error(ResolveError.NoAppsFound);
7026
8890
  }
7027
8891
  const glueInstances = this.glueController.getApplicationInstances(appId);
7028
8892
  const fdc3Instances = glueInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
7029
- this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${appIdentifier}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
8893
+ this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${JSON.stringify(appIdentifier)}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
7030
8894
  return fdc3Instances;
7031
8895
  }
7032
8896
  async getAppMetadata({ commandId, appIdentifier }) {
7033
8897
  await this.glueController.gluePromise;
7034
- this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${appIdentifier}`);
8898
+ this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
7035
8899
  const { appId, instanceId } = appIdentifier;
7036
8900
  const app = this.glueController.getApplication(appId);
7037
8901
  if (!app) {
7038
- throw { message: OpenError.AppNotFound, reason: `Cannot find application with appId: ${appId}` };
8902
+ throw new Error(OpenError.AppNotFound);
7039
8903
  }
7040
8904
  if (!instanceId) {
7041
- this.logger?.info(`[${commandId}] - no opened instances found. Parsing app ${app}`);
8905
+ this.logger?.info(`[${commandId}] - no opened instances found. Parsing app ${app.name}`);
7042
8906
  return this.parseGlueAppToAppMetadata(app);
7043
8907
  }
7044
8908
  const instance = this.glueController.getAppInstanceById(instanceId);
@@ -7049,8 +8913,9 @@ class ApplicationsController {
7049
8913
  async getInfo({ commandId }) {
7050
8914
  await this.glueController.gluePromise;
7051
8915
  this.logger?.info(`${commandId} - getInfo() invoked`);
7052
- const appMetadata = await this.getCurrentAppMetadata();
7053
- const { provider, providerVersion, standardVersion } = window.fdc3Info;
8916
+ const appMetadata = this.getCurrentAppMetadata();
8917
+ const globalScope = typeof process !== "undefined" ? process : window;
8918
+ const { provider, providerVersion, standardVersion } = globalScope.fdc3Info;
7054
8919
  return {
7055
8920
  provider,
7056
8921
  providerVersion,
@@ -7065,10 +8930,13 @@ class ApplicationsController {
7065
8930
  }
7066
8931
  getCurrentAppMetadata() {
7067
8932
  const myInstance = this.glueController.interopInstance();
7068
- return Promise.resolve({
7069
- appId: myInstance.applicationName,
7070
- instanceId: myInstance.instance
7071
- });
8933
+ const myInstanceApplicationName = myInstance.application ?? myInstance.applicationName;
8934
+ const myApp = this.glueController.getApplication(myInstanceApplicationName);
8935
+ if (myApp) {
8936
+ return { appId: myApp.name, instanceId: myInstance.instance };
8937
+ }
8938
+ this.logger?.info(`No application found with name ${myInstanceApplicationName} probably because it's an iframe.`);
8939
+ return { appId: myInstanceApplicationName, instanceId: myInstance.instance };
7072
8940
  }
7073
8941
  parseGlueInstToAppIdentifier(glueInst) {
7074
8942
  return {
@@ -7084,13 +8952,13 @@ class ApplicationsController {
7084
8952
  return this.addInstanceMetadataToAppMetadata(appMetadata, instance);
7085
8953
  }
7086
8954
  async getBaseGlueAppToAppMetadata(app) {
7087
- const desktopGlobal = window.glue42gd || window.iodesktop;
7088
- const appConfiguration = desktopGlobal
7089
- ? await app.getConfiguration()
7090
- : app.userProperties;
7091
- const icon = desktopGlobal
7092
- ? (await app.getConfiguration()).icon
7093
- : app.icon;
8955
+ const inBrowserNamespace = this.glueController.isRunningInBrowser();
8956
+ const appConfiguration = inBrowserNamespace
8957
+ ? app.userProperties
8958
+ : await app.getConfiguration();
8959
+ const icon = inBrowserNamespace
8960
+ ? app.icon
8961
+ : (await app.getConfiguration()).icon;
7094
8962
  return {
7095
8963
  appId: app.name,
7096
8964
  name: app.name,
@@ -7099,9 +8967,9 @@ class ApplicationsController {
7099
8967
  title: app.title,
7100
8968
  icons: icon ? [{ src: icon }] : [],
7101
8969
  tooltip: appConfiguration.tooltip,
7102
- screenshots: desktopGlobal
7103
- ? appConfiguration.customProperties.screenshots
7104
- : appConfiguration.screenshots
8970
+ screenshots: inBrowserNamespace
8971
+ ? appConfiguration.screenshots
8972
+ : appConfiguration.customProperties.screenshots
7105
8973
  };
7106
8974
  }
7107
8975
  addInstanceMetadataToAppMetadata(appMetadata, instance) {
@@ -7112,24 +8980,26 @@ class ApplicationsController {
7112
8980
  const startContext = this.buildStartContext(context, guid);
7113
8981
  const wrappedPromise = this.createContextListenerWrappedPromise(app);
7114
8982
  this.appsStateStore.addOpenAppPromise(guid, wrappedPromise);
8983
+ const inBrowser = this.glueController.isRunningInBrowser();
7115
8984
  try {
7116
- const glueInst = await app.start(startContext);
8985
+ const glueInst = await app.start(startContext, { waitForAGMReady: !inBrowser });
7117
8986
  await wrappedPromise.promise;
7118
8987
  this.appsStateStore.removeOpenAppPromise(guid);
7119
8988
  return this.parseGlueInstToAppIdentifier(glueInst);
7120
8989
  }
7121
8990
  catch (error) {
7122
8991
  this.appsStateStore.removeOpenAppPromise(guid);
7123
- throw { message: OpenError.AppTimeout, reason: typeof error === "string" ? error : JSON.stringify(error) };
8992
+ throw new Error(OpenError.AppTimeout);
7124
8993
  }
7125
8994
  }
7126
8995
  buildStartContext(fdc3Context, guid) {
7127
8996
  const myInteropInstance = this.glueController.getMyInteropInstance();
8997
+ const appId = myInteropInstance.application || myInteropInstance.applicationName || "";
7128
8998
  return {
7129
8999
  fdc3: {
7130
9000
  collaborationId: guid,
7131
9001
  openApp: {
7132
- appId: myInteropInstance.application || myInteropInstance.applicationName || "",
9002
+ appId,
7133
9003
  instanceId: myInteropInstance.instance
7134
9004
  },
7135
9005
  context: {
@@ -7152,7 +9022,7 @@ class ApplicationsController {
7152
9022
  }
7153
9023
  }
7154
9024
 
7155
- class EventReceiver {
9025
+ class WebEventReceiver {
7156
9026
  glueController;
7157
9027
  eventDispatcher;
7158
9028
  glueResponseReceived = false;
@@ -7179,7 +9049,7 @@ class EventReceiver {
7179
9049
  }
7180
9050
  glueReceiverHandler(event) {
7181
9051
  const data = event.detail;
7182
- if (!data || !data.glue42) {
9052
+ if (!data?.glue42) {
7183
9053
  return;
7184
9054
  }
7185
9055
  const glue42Event = data.glue42.event;
@@ -7363,7 +9233,8 @@ class PrivateChannel {
7363
9233
  this.isCreator = isCreator;
7364
9234
  this.id = channelId;
7365
9235
  const myServerInstance = this.channelsController.getMyServerInstance();
7366
- this.myAppMetadata = { source: { appId: myServerInstance.applicationName, instanceId: myServerInstance.instance } };
9236
+ const myAppId = myServerInstance.application || myServerInstance.applicationName;
9237
+ this.myAppMetadata = { source: { appId: myAppId, instanceId: myServerInstance.instance } };
7367
9238
  }
7368
9239
  toApi() {
7369
9240
  const api = {
@@ -7373,10 +9244,11 @@ class PrivateChannel {
7373
9244
  broadcast: this.broadcast.bind(this),
7374
9245
  getCurrentContext: this.getCurrentContext.bind(this),
7375
9246
  addContextListener: this.addContextListener.bind(this),
7376
- onAddContextListener: this.onAddContextListener.bind(this),
7377
- onUnsubscribe: this.onUnsubscribe.bind(this),
7378
- onDisconnect: this.onDisconnect.bind(this),
9247
+ onAddContextListener: this.legacyOnAddContextListener.bind(this),
9248
+ onUnsubscribe: this.legacyOnUnsubscribe.bind(this),
9249
+ onDisconnect: this.legacyOnDisconnect.bind(this),
7379
9250
  disconnect: this.disconnect.bind(this),
9251
+ addEventListener: this.addEventListener.bind(this),
7380
9252
  };
7381
9253
  return api;
7382
9254
  }
@@ -7392,54 +9264,62 @@ class PrivateChannel {
7392
9264
  }
7393
9265
  async handleCollaboratorJoin(collaborator, commandId) {
7394
9266
  this.setCollaborator(collaborator, commandId);
7395
- await Promise.all(this.myListenerTypesBeforeBound.map((contextType) => {
7396
- const listenerAddedArgs = {
7397
- action: "addedContextListenerOnPrivateChannel",
7398
- correlationId: this.id,
7399
- collaborationObject: {
7400
- channelId: this.id,
7401
- contextType: contextType || undefined
7402
- }
7403
- };
7404
- this.logger?.trace(`[${commandId}] - announcing ${"addedContextListenerOnPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
7405
- return this.channelsController.invokeSystemMethod(listenerAddedArgs, this.collaborator?.instanceId);
7406
- })).catch((err) => this.logger?.error(err));
9267
+ await Promise.all(this.myListenerTypesBeforeBound.map((contextType) => this.sendCollaborateMessage({ action: "addedContextListenerOnPrivateChannel", contextType }))).catch((err) => this.logger?.error(err));
7407
9268
  }
7408
9269
  handleCollaboratorBroadcast(context, metadata, commandId) {
7409
9270
  this.logger?.trace(`[${commandId}] - heard context with type ${context.type} broadcasted on the channel`);
7410
9271
  this.lastBroadcastedContextType = context.type;
7411
9272
  this.broadcastedContexts[context.type] = { context, metadata };
7412
9273
  this.logger?.trace(`[${commandId}] - invoking all context listeners`);
7413
- this.registry.execute(PrivateChannelEventMethods.ListenerAdded, context, metadata);
9274
+ this.executeCollaboratorBroadcastEvents(context, metadata);
7414
9275
  }
7415
9276
  handleCollaboratorAddContextListener(contextType, commandId) {
7416
9277
  this.logger?.trace(`[${commandId}] - heard collaborator added context listener for type ${contextType}`);
7417
9278
  this.collaboratorListenerTypes.push(contextType);
7418
- this.registry.execute(PrivateChannelEventMethods.OnAddContextListener, contextType);
9279
+ this.executeCollaboratorAddContextListenerEvents(contextType);
7419
9280
  }
7420
9281
  handleCollaboratorRemovedListener(contextType, commandId) {
7421
9282
  this.logger?.trace(`[${commandId}] - heard collaborator removed context listener with type ${contextType}`);
7422
- const index = this.collaboratorListenerTypes.indexOf(contextType);
7423
- this.collaboratorListenerTypes.splice(index, 1);
7424
- this.registry.execute(PrivateChannelEventMethods.OnUnsubscribe, contextType);
9283
+ this.collaboratorListenerTypes.splice(this.collaboratorListenerTypes.indexOf(contextType), 1);
9284
+ this.executeCollaboratorUnsubscribeEvents(contextType);
7425
9285
  }
7426
9286
  handleCollaboratorDisconnect() {
7427
9287
  this.disconnected = true;
7428
- this.collaboratorListenerTypes.forEach((contextType) => this.registry.execute(PrivateChannelEventMethods.OnUnsubscribe, contextType));
7429
- this.registry.execute(PrivateChannelEventMethods.OnDisconnect);
9288
+ this.executeCollaboratorDisconnectEvents();
7430
9289
  }
7431
9290
  async announceJoin(targetInstance, commandId) {
7432
- const joinChannelArgs = {
7433
- action: "joinPrivateChannel",
7434
- correlationId: this.id,
7435
- collaborationObject: {
7436
- channelId: this.id
7437
- }
7438
- };
7439
- this.logger?.trace(`[${commandId}] - announcing ${"joinPrivateChannel"} to target instance with id ${JSON.stringify(targetInstance)}`);
7440
- await this.channelsController.invokeSystemMethod(joinChannelArgs, targetInstance);
9291
+ await this.sendCollaborateMessage({ action: "joinPrivateChannel" });
7441
9292
  this.logger?.trace(`[${commandId}] - collaborator received ${"joinPrivateChannel"} action`);
7442
9293
  }
9294
+ async addEventListener(type, handler) {
9295
+ const decodedType = optionalPrivateChannelEventTypesDecoder.run(type);
9296
+ if (!decodedType.ok) {
9297
+ this.logger?.error(`Expected first argument 'type' as one of ${Object.values(NewPrivateChannelEventMethods).join(", ")}, got ${type}`);
9298
+ throw new Error(ChannelError.AccessDenied);
9299
+ }
9300
+ if (typeof handler !== "function") {
9301
+ this.logger?.error(`Expected function as an argument, got ${typeof handler}`);
9302
+ throw new Error(ChannelError.AccessDenied);
9303
+ }
9304
+ const commandId = generateCommandId();
9305
+ this.ensureAlive(commandId);
9306
+ this.logger?.trace(`[${commandId}] - adding event listener for type ${type}`);
9307
+ return this.addEventListenerByEventType(type, handler);
9308
+ }
9309
+ addEventListenerByEventType(type, handler) {
9310
+ const replayArgs = type === "addContextListener"
9311
+ ? this.collaboratorListenerTypes.map((contextType) => ({ type: NewPrivateChannelEventMethods.AddContextListener, details: { contextType } }))
9312
+ : undefined;
9313
+ if (type) {
9314
+ const unsubscribe = this.registry.add(type, handler, replayArgs);
9315
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
9316
+ }
9317
+ const addContextListener = this.addEventListenerByEventType("addContextListener", handler);
9318
+ const unsubscribeListener = this.addEventListenerByEventType("unsubscribe", handler);
9319
+ const disconnectListener = this.addEventListenerByEventType("disconnect", handler);
9320
+ const unsubscribe = () => [addContextListener, unsubscribeListener, disconnectListener].forEach((listener) => listener.unsubscribe());
9321
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
9322
+ }
7443
9323
  async broadcast(context) {
7444
9324
  const contextDecoderResult = contextDecoder.run(context);
7445
9325
  if (!contextDecoderResult.ok) {
@@ -7450,17 +9330,7 @@ class PrivateChannel {
7450
9330
  this.ensureBound(commandId, "broadcast");
7451
9331
  this.lastBroadcastedContextType = context.type;
7452
9332
  this.broadcastedContexts[context.type] = { context, metadata: this.myAppMetadata };
7453
- const broadcastArgs = {
7454
- action: "publishOnPrivateChannel",
7455
- correlationId: this.id,
7456
- collaborationObject: {
7457
- channelId: this.id,
7458
- contextType: context.type,
7459
- payload: context
7460
- }
7461
- };
7462
- this.logger?.trace(`[${commandId}] - announcing ${"publishOnPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
7463
- await this.channelsController.invokeSystemMethod(broadcastArgs, this.collaborator?.instanceId);
9333
+ this.sendCollaborateMessage({ action: "publishOnPrivateChannel", contextType: context.type, payload: context });
7464
9334
  this.logger?.trace(`[${commandId}] - collaborator received context for action ${"publishOnPrivateChannel"}`);
7465
9335
  }
7466
9336
  async getCurrentContext(contextType) {
@@ -7472,7 +9342,10 @@ class PrivateChannel {
7472
9342
  if (!contextType && !this.lastBroadcastedContextType) {
7473
9343
  return null;
7474
9344
  }
7475
- const searchedType = contextType || this.lastBroadcastedContextType;
9345
+ const searchedType = contextType ?? this.lastBroadcastedContextType;
9346
+ if (!searchedType) {
9347
+ throw new Error("No context type specified and no last broadcasted context available");
9348
+ }
7476
9349
  this.logger?.trace(`[${commandId}] - Returning context with type ${searchedType}`);
7477
9350
  return this.broadcastedContexts[searchedType].context;
7478
9351
  }
@@ -7481,51 +9354,42 @@ class PrivateChannel {
7481
9354
  this.ensureAlive(commandId);
7482
9355
  optionalNonEmptyStringDecoder.runWithException(contextType);
7483
9356
  if (typeof handler !== "function") {
7484
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof contextType}` };
9357
+ throw new Error(ChannelError.AccessDenied);
7485
9358
  }
7486
9359
  this.logger?.trace(`[${commandId}] - adding subscription for broadcasted contexts with type: ${contextType}`);
7487
- const subHandler = (data, metadata) => {
7488
- if (contextType) {
7489
- if (data.type === contextType) {
7490
- handler(data, metadata);
7491
- }
7492
- return;
7493
- }
7494
- handler(data, metadata);
7495
- };
7496
- const lastBroadcastedContextPerType = this.retrieveLatestBroadcastedContextPerType(contextType);
7497
- const replayArgs = lastBroadcastedContextPerType ? [[lastBroadcastedContextPerType.context, lastBroadcastedContextPerType.metadata]] : undefined;
7498
- const unsub = this.registry.add(PrivateChannelEventMethods.ListenerAdded, subHandler, replayArgs);
9360
+ const unsub = this.addContextListenerInRegistry(contextType, handler);
7499
9361
  if (!this.collaborator) {
7500
9362
  this.myListenerTypesBeforeBound.push(contextType);
7501
9363
  const unsubscribe = this.getAddContextListenerUnsub(unsub, contextType, commandId);
7502
- return AsyncListener(unsubscribe);
9364
+ return { unsubscribe };
7503
9365
  }
7504
- const listenerAddedArgs = {
7505
- action: "addedContextListenerOnPrivateChannel",
7506
- correlationId: this.id,
7507
- collaborationObject: {
7508
- channelId: this.id,
7509
- contextType: contextType || undefined
7510
- }
7511
- };
7512
- this.logger?.trace(`[${commandId}] - announcing ${"addedContextListenerOnPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
7513
- await this.channelsController.invokeSystemMethod(listenerAddedArgs, this.collaborator?.instanceId);
9366
+ await this.sendCollaborateMessage({ action: "addedContextListenerOnPrivateChannel", contextType });
7514
9367
  this.logger?.trace(`[${commandId}] - collaborator received action ${"addedContextListenerOnPrivateChannel"}`);
7515
9368
  const unsubscribe = this.getAddContextListenerUnsub(unsub, contextType, commandId);
7516
- return AsyncListener(unsubscribe);
9369
+ return { unsubscribe };
7517
9370
  }
9371
+ addContextListenerInRegistry = (contextType, handler) => {
9372
+ const legacySubHandler = parseContextHandler(handler, contextType);
9373
+ const lastBroadcastedContextPerType = this.retrieveLatestBroadcastedContextPerType(contextType);
9374
+ const legacyReplayArgs = lastBroadcastedContextPerType ? [[lastBroadcastedContextPerType.context, lastBroadcastedContextPerType.metadata]] : undefined;
9375
+ const legacyUnsub = this.registry.add(LegacyPrivateChannelEventMethods.ListenerAdded, legacySubHandler, legacyReplayArgs);
9376
+ const replayArgs = lastBroadcastedContextPerType ? [{ type: NewPrivateChannelEventMethods.ContextListenerAdded, details: { contextType: lastBroadcastedContextPerType.context.type, metadata: lastBroadcastedContextPerType.metadata } }] : undefined;
9377
+ const subHandler = parseHandlerToEventHandler({ handler, eventType: NewPrivateChannelEventMethods.ContextListenerAdded, contextType });
9378
+ const newUnsub = this.registry.add(NewPrivateChannelEventMethods.ContextListenerAdded, subHandler, replayArgs);
9379
+ const unsub = () => {
9380
+ legacyUnsub();
9381
+ newUnsub();
9382
+ };
9383
+ return unsub;
9384
+ };
7518
9385
  retrieveLatestBroadcastedContextPerType(contextType) {
7519
- if (!contextType && !this.lastBroadcastedContextType) {
7520
- return;
9386
+ if (contextType) {
9387
+ return this.broadcastedContexts[contextType];
7521
9388
  }
7522
- if (!contextType && this.lastBroadcastedContextType) {
7523
- return {
7524
- context: this.broadcastedContexts[this.lastBroadcastedContextType].context,
7525
- metadata: this.broadcastedContexts[this.lastBroadcastedContextType].metadata
7526
- };
9389
+ if (!this.lastBroadcastedContextType) {
9390
+ return;
7527
9391
  }
7528
- return this.broadcastedContexts[contextType];
9392
+ return this.broadcastedContexts[this.lastBroadcastedContextType];
7529
9393
  }
7530
9394
  getAddContextListenerUnsub(unsub, contextType, commandId) {
7531
9395
  return async () => {
@@ -7535,45 +9399,36 @@ class PrivateChannel {
7535
9399
  this.myListenerTypesBeforeBound.splice(index, 1);
7536
9400
  return;
7537
9401
  }
7538
- const unsubArgs = {
7539
- action: "removedContextListenerOnPrivateChannel",
7540
- correlationId: this.id,
7541
- collaborationObject: {
7542
- channelId: this.id,
7543
- contextType: contextType || undefined
7544
- }
7545
- };
7546
- this.logger?.trace(`[${commandId}] - announcing unsubscribe from context listener for type ${contextType}`);
7547
- await this.channelsController.invokeSystemMethod(unsubArgs, this.collaborator?.instanceId);
9402
+ await this.sendCollaborateMessage({ action: "removedContextListenerOnPrivateChannel", contextType });
7548
9403
  this.logger?.trace(`[${commandId}] - collaborator heard ${"removedContextListenerOnPrivateChannel"}`);
7549
9404
  };
7550
9405
  }
7551
- onAddContextListener(handler) {
9406
+ legacyOnAddContextListener(handler) {
7552
9407
  if (typeof handler !== "function") {
7553
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof handler}` };
9408
+ throw new Error(ChannelError.AccessDenied);
7554
9409
  }
7555
9410
  const commandId = generateCommandId();
7556
9411
  this.ensureAlive(commandId);
7557
- const unsub = this.registry.add(PrivateChannelEventMethods.OnAddContextListener, handler, this.collaboratorListenerTypes);
7558
- return AsyncListener(unsub);
9412
+ const unsub = this.registry.add(LegacyPrivateChannelEventMethods.OnAddContextListener, handler, this.collaboratorListenerTypes);
9413
+ return getListenerWithAsyncUnsubscribe(unsub);
7559
9414
  }
7560
- onUnsubscribe(handler) {
9415
+ legacyOnUnsubscribe(handler) {
7561
9416
  if (typeof handler !== "function") {
7562
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof handler}` };
9417
+ throw new Error(ChannelError.AccessDenied);
7563
9418
  }
7564
9419
  const commandId = generateCommandId();
7565
9420
  this.ensureAlive(commandId);
7566
- const unsub = this.registry.add(PrivateChannelEventMethods.OnUnsubscribe, handler);
7567
- return AsyncListener(unsub);
9421
+ const unsub = this.registry.add(LegacyPrivateChannelEventMethods.OnUnsubscribe, handler);
9422
+ return getListenerWithAsyncUnsubscribe(unsub);
7568
9423
  }
7569
- onDisconnect(handler) {
9424
+ legacyOnDisconnect(handler) {
7570
9425
  if (typeof handler !== "function") {
7571
- throw { message: ChannelError.AccessDenied, reason: `Expected function as an argument, got ${typeof handler}` };
9426
+ throw new Error(ChannelError.AccessDenied);
7572
9427
  }
7573
9428
  const commandId = generateCommandId();
7574
9429
  this.ensureAlive(commandId);
7575
- const unsub = this.registry.add(PrivateChannelEventMethods.OnDisconnect, handler);
7576
- return AsyncListener(unsub);
9430
+ const unsub = this.registry.add(LegacyPrivateChannelEventMethods.OnDisconnect, handler);
9431
+ return getListenerWithAsyncUnsubscribe(unsub);
7577
9432
  }
7578
9433
  async disconnect() {
7579
9434
  const commandId = generateCommandId();
@@ -7586,15 +9441,8 @@ class PrivateChannel {
7586
9441
  this.logger?.trace(`[${commandId}] - disconnect invoked`);
7587
9442
  this.disconnected = true;
7588
9443
  this.logger?.trace(`[${commandId}] - announcing ${"disconnectedFromPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
7589
- const disconnectArgs = {
7590
- action: "disconnectedFromPrivateChannel",
7591
- correlationId: this.id,
7592
- collaborationObject: {
7593
- channelId: this.id
7594
- }
7595
- };
7596
9444
  this.channelsController.removePrivateChannelFromStoreById(this.id);
7597
- await this.channelsController.invokeSystemMethod(disconnectArgs, this.collaborator?.instanceId);
9445
+ await this.sendCollaborateMessage({ action: "disconnectedFromPrivateChannel" });
7598
9446
  this.logger?.trace(`[${commandId}] - collaborator received action ${"disconnectedFromPrivateChannel"}`);
7599
9447
  if (this.unsubFromInstanceStopped) {
7600
9448
  this.unsubFromInstanceStopped();
@@ -7606,7 +9454,7 @@ class PrivateChannel {
7606
9454
  }
7607
9455
  const errorMsg = "Channel is disconnected - operation is no longer available";
7608
9456
  this.logger?.error(`[${commandId}] - ${errorMsg}`);
7609
- throw { message: ChannelError.AccessDenied, reason: errorMsg };
9457
+ throw new Error(ChannelError.AccessDenied);
7610
9458
  }
7611
9459
  ensureBound(commandId, operation) {
7612
9460
  if (this.collaborator) {
@@ -7614,7 +9462,7 @@ class PrivateChannel {
7614
9462
  }
7615
9463
  const errorMsg = `There's no collaborator on the other side of the channel - operation ${operation} is unavailable`;
7616
9464
  this.logger?.error(`[${commandId}] - ${errorMsg}`);
7617
- throw { message: ChannelError.AccessDenied, reason: errorMsg };
9465
+ throw new Error(ChannelError.AccessDenied);
7618
9466
  }
7619
9467
  subscribeForCollaboratorInstanceStop(commandId) {
7620
9468
  const handler = (instance) => {
@@ -7625,6 +9473,43 @@ class PrivateChannel {
7625
9473
  };
7626
9474
  this.unsubFromInstanceStopped = this.channelsController.subscribeOnInstanceStop(this.id, handler.bind(this), commandId);
7627
9475
  }
9476
+ async sendCollaborateMessage({ action, contextType, payload }) {
9477
+ const args = {
9478
+ action,
9479
+ correlationId: this.id,
9480
+ collaborationObject: {
9481
+ channelId: this.id,
9482
+ contextType,
9483
+ payload
9484
+ }
9485
+ };
9486
+ this.logger?.trace(`Sending '${action}' collaborate message ${JSON.stringify(args)} to collaborator ${JSON.stringify(this.collaborator)}`);
9487
+ await this.channelsController.invokeSystemMethod(args, this.collaborator?.instanceId);
9488
+ }
9489
+ executeCollaboratorAddContextListenerEvents(contextType) {
9490
+ this.registry.execute(LegacyPrivateChannelEventMethods.OnAddContextListener, contextType);
9491
+ const event = { type: NewPrivateChannelEventMethods.AddContextListener, details: { contextType } };
9492
+ this.registry.execute(NewPrivateChannelEventMethods.AddContextListener, event);
9493
+ }
9494
+ executeCollaboratorBroadcastEvents(context, metadata) {
9495
+ this.registry.execute(LegacyPrivateChannelEventMethods.ListenerAdded, context, metadata);
9496
+ const event = {
9497
+ type: NewPrivateChannelEventMethods.ContextListenerAdded,
9498
+ details: { context, metadata }
9499
+ };
9500
+ this.registry.execute(NewPrivateChannelEventMethods.ContextListenerAdded, event);
9501
+ }
9502
+ executeCollaboratorUnsubscribeEvents(contextType) {
9503
+ this.registry.execute(LegacyPrivateChannelEventMethods.OnUnsubscribe, contextType);
9504
+ const event = { type: NewPrivateChannelEventMethods.Unsubscribe, details: { contextType } };
9505
+ this.registry.execute(NewPrivateChannelEventMethods.Unsubscribe, event);
9506
+ }
9507
+ executeCollaboratorDisconnectEvents() {
9508
+ this.collaboratorListenerTypes.forEach((contextType) => this.executeCollaboratorUnsubscribeEvents(contextType));
9509
+ this.registry.execute(LegacyPrivateChannelEventMethods.OnDisconnect);
9510
+ const event = { type: NewPrivateChannelEventMethods.Disconnect, details: {} };
9511
+ this.registry.execute(NewPrivateChannelEventMethods.Disconnect, event);
9512
+ }
7628
9513
  }
7629
9514
 
7630
9515
  class ChannelsFactory {
@@ -7826,7 +9711,7 @@ class ChannelsBaseController {
7826
9711
  const subHandler = parseContextHandler(handler, contextType);
7827
9712
  if (!channelIdToSubscribeTo || onMultiChannels) {
7828
9713
  const unsubscribe = this.glueController.channelsSubscribe(subHandler, contextType);
7829
- return { unsubscribe };
9714
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
7830
9715
  }
7831
9716
  return this.addContextListenerByChannelId({ commandId, handler: subHandler, invokedOnChannelModel: !!channelId, channelId: channelIdToSubscribeTo, contextType });
7832
9717
  }
@@ -7999,6 +9884,14 @@ class ChannelsBaseController {
7999
9884
  this.logger?.info(`[${commandId}] - leaving channel '${ioChannelToLeave.name}'`);
8000
9885
  return this.glueController.leaveChannel({ channel: ioChannelToLeave.name });
8001
9886
  }
9887
+ async addEventListener({ commandId, type, handler }) {
9888
+ await this.initDonePromise;
9889
+ this.logger?.info(`[${commandId}] - addEventListener() invoked for event type ${type}`);
9890
+ if (!type || type === "userChannelChanged") {
9891
+ return this.subscribeForChannelChangedEvent(handler);
9892
+ }
9893
+ throw new Error(`Received unknown event type: ${type}`);
9894
+ }
8002
9895
  get logger() {
8003
9896
  if (!this._logger) {
8004
9897
  this._logger = this.glueController.initSubLogger("fdc3.channels.controller");
@@ -8036,7 +9929,7 @@ class ChannelsBaseController {
8036
9929
  }
8037
9930
  async handleWindowContextOnOpening(commandId, handler, contextType) {
8038
9931
  const myWindow = this.glueController.getMyWindow();
8039
- if (!myWindow) {
9932
+ if (!myWindow || !Object.keys(myWindow).length) {
8040
9933
  this.logger?.trace(`[${commandId}] - Cannot get window context because this is not a Glue window, it's probably an iframe`);
8041
9934
  this.invokeContextHandlerWithStartupContext = false;
8042
9935
  return;
@@ -8117,12 +10010,10 @@ class ChannelsBaseController {
8117
10010
  if (channelType === ChannelTypes.App) {
8118
10011
  this.logger?.info(`[${commandId}] - subscribing for fdc3 app channel with id ${channelId} (underlying glue context with same name)`);
8119
10012
  const unsubscribe = await this.glueController.contextsSubscribe(channelId, subHandler);
8120
- return {
8121
- unsubscribe: () => {
8122
- this.logger?.info(`[${commandId}] - invoking unsubscribe for app channel with id ${channelId}`);
8123
- unsubscribe();
8124
- }
8125
- };
10013
+ return getListenerWithAsyncUnsubscribe(() => {
10014
+ this.logger?.info(`[${commandId}] - invoking unsubscribe for app channel with id ${channelId}`);
10015
+ unsubscribe();
10016
+ });
8126
10017
  }
8127
10018
  this.logger?.error("Cannot add a context listener on an invalid channel");
8128
10019
  throw new Error(ChannelError.AccessDenied);
@@ -8139,6 +10030,28 @@ class ChannelsBaseController {
8139
10030
  this.logger?.error(`Channel with id: ${channelId} does not exist`);
8140
10031
  throw new Error(ChannelError.NoChannelFound);
8141
10032
  }
10033
+ subscribeForChannelChangedEvent(handler) {
10034
+ const wrappedCallback = async (channelName) => {
10035
+ if (!channelName) {
10036
+ this.invokeChannelChangedEventHandler(null, handler);
10037
+ return;
10038
+ }
10039
+ const fdc3ChannelName = await this.glueController.getFDC3ChannelIdByIoChannelName(channelName);
10040
+ if (!fdc3ChannelName) {
10041
+ return;
10042
+ }
10043
+ this.invokeChannelChangedEventHandler(fdc3ChannelName, handler);
10044
+ };
10045
+ const unsubscribe = this.glueController.setOnChannelChanged(wrappedCallback);
10046
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
10047
+ }
10048
+ invokeChannelChangedEventHandler(channelId, handler) {
10049
+ const event = {
10050
+ type: "userChannelChanged",
10051
+ details: { currentChannelId: channelId }
10052
+ };
10053
+ handler(event);
10054
+ }
8142
10055
  }
8143
10056
 
8144
10057
  class LegacyDataWrappingChannelsController {
@@ -8176,7 +10089,7 @@ class LegacyDataWrappingChannelsController {
8176
10089
  if (!invokedOnChannelModel) {
8177
10090
  this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
8178
10091
  const unsubscribe = this.glueController.legacyChannelsSubscribe(handler, contextType);
8179
- return { unsubscribe };
10092
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
8180
10093
  }
8181
10094
  const ioChannelName = await this.glueController.getIoChannelNameByFDC3ChannelId(channelId);
8182
10095
  if (!ioChannelName) {
@@ -8186,7 +10099,7 @@ class LegacyDataWrappingChannelsController {
8186
10099
  const contextToSubscribeTo = this.parser.mapChannelNameToContextName(ioChannelName);
8187
10100
  this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
8188
10101
  const unsubscribe = await this.glueController.contextsSubscribe(contextToSubscribeTo, handler);
8189
- return { unsubscribe };
10102
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
8190
10103
  }
8191
10104
  get logger() {
8192
10105
  if (!this._logger) {
@@ -8232,7 +10145,7 @@ class NewDataWrappingChannelsController {
8232
10145
  if (!invokedOnChannelModel) {
8233
10146
  this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
8234
10147
  const unsubscribe = this.glueController.channelsSubscribe(handler, contextType);
8235
- return { unsubscribe };
10148
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
8236
10149
  }
8237
10150
  const ioChannelName = await this.glueController.getIoChannelNameByFDC3ChannelId(channelId);
8238
10151
  if (!ioChannelName) {
@@ -8242,7 +10155,7 @@ class NewDataWrappingChannelsController {
8242
10155
  const contextToSubscribeTo = this.parser.mapChannelNameToContextName(ioChannelName);
8243
10156
  this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
8244
10157
  const unsubscribe = await this.glueController.contextsSubscribe(contextToSubscribeTo, handler);
8245
- return { unsubscribe };
10158
+ return getListenerWithAsyncUnsubscribe(unsubscribe);
8246
10159
  }
8247
10160
  get logger() {
8248
10161
  if (!this._logger) {
@@ -8252,9 +10165,55 @@ class NewDataWrappingChannelsController {
8252
10165
  }
8253
10166
  }
8254
10167
 
10168
+ class NodeEventReceiver {
10169
+ glueController;
10170
+ glueReceived = false;
10171
+ glueInitialized = false;
10172
+ timer;
10173
+ constructor(glueController) {
10174
+ this.glueController = glueController;
10175
+ }
10176
+ start() {
10177
+ setTimeout(this.clearInterval, GlueReceivedPromiseTimeout);
10178
+ this.setupInterval();
10179
+ }
10180
+ setupInterval() {
10181
+ this.timer = setInterval(() => {
10182
+ if (this.glueReceived) {
10183
+ return this.clearInterval();
10184
+ }
10185
+ const glueAvailable = typeof (process.io ?? process.glue) !== "undefined";
10186
+ if (!glueAvailable) {
10187
+ return;
10188
+ }
10189
+ this.glueReceived = true;
10190
+ const glue = process.io ?? process.glue;
10191
+ const glueValidator = this.glueController.validateGlue(glue);
10192
+ if (!glueValidator.isValid) {
10193
+ this.glueController.initializeFailed(glueValidator.error);
10194
+ return this.clearInterval();
10195
+ }
10196
+ this.clearInterval();
10197
+ this.glueController.initialize(glue);
10198
+ this.glueInitialized = true;
10199
+ }, 100);
10200
+ }
10201
+ clearInterval() {
10202
+ if (!this.timer) {
10203
+ return;
10204
+ }
10205
+ clearInterval(this.timer);
10206
+ this.timer = undefined;
10207
+ if (!this.glueReceived && !this.glueInitialized) {
10208
+ this.glueController.initializeFailed(`Timeout ${GlueReceivedPromiseTimeout}ms waiting for 'io' to be available on the process object`);
10209
+ }
10210
+ }
10211
+ }
10212
+
8255
10213
  class IoC {
8256
- _eventDispatcher;
8257
- _eventReceiver;
10214
+ _webEventDispatcher;
10215
+ _webEventReceiver;
10216
+ _nodeEventReceiver;
8258
10217
  _desktopAgent;
8259
10218
  _glueController;
8260
10219
  _intentsController;
@@ -8272,14 +10231,15 @@ class IoC {
8272
10231
  return this;
8273
10232
  }
8274
10233
  get eventReceiver() {
8275
- if (!this._eventReceiver) {
8276
- this._eventReceiver = new EventReceiver(this.glueController, this.eventDispatcher);
10234
+ const inNode = typeof process !== "undefined";
10235
+ if (inNode) {
10236
+ return this.nodeEventReceiver;
8277
10237
  }
8278
- return this._eventReceiver;
10238
+ return this.webEventReceiver;
8279
10239
  }
8280
10240
  get glueController() {
8281
10241
  if (!this._glueController) {
8282
- this._glueController = new GlueController(this.channelsParser, this.channelsStateStore);
10242
+ this._glueController = new GlueController(this.channelsParser);
8283
10243
  }
8284
10244
  return this._glueController;
8285
10245
  }
@@ -8289,11 +10249,23 @@ class IoC {
8289
10249
  }
8290
10250
  return this._fdc3;
8291
10251
  }
8292
- get eventDispatcher() {
8293
- if (!this._eventDispatcher) {
8294
- this._eventDispatcher = new EventDispatcher();
10252
+ get nodeEventReceiver() {
10253
+ if (!this._nodeEventReceiver) {
10254
+ this._nodeEventReceiver = new NodeEventReceiver(this.glueController);
10255
+ }
10256
+ return this._nodeEventReceiver;
10257
+ }
10258
+ get webEventReceiver() {
10259
+ if (!this._webEventReceiver) {
10260
+ this._webEventReceiver = new WebEventReceiver(this.glueController, this.webEventDispatcher);
10261
+ }
10262
+ return this._webEventReceiver;
10263
+ }
10264
+ get webEventDispatcher() {
10265
+ if (!this._webEventDispatcher) {
10266
+ this._webEventDispatcher = new WebEventDispatcher();
8295
10267
  }
8296
- return this._eventDispatcher;
10268
+ return this._webEventDispatcher;
8297
10269
  }
8298
10270
  get channelsFactory() {
8299
10271
  if (!this._channelsFactory) {
@@ -8379,18 +10351,19 @@ const fdc3Factory = () => {
8379
10351
  return ioc.fdc3;
8380
10352
  };
8381
10353
 
8382
- var version = "2.5.1";
10354
+ var version = "2.6.0";
8383
10355
 
8384
- let globalFdc3 = window.fdc3;
8385
- window.fdc3Info = {
10356
+ const globalScope = typeof process !== "undefined" ? process : window;
10357
+ globalScope.fdc3Info = {
8386
10358
  provider: "io.Connect",
8387
10359
  providerVersion: version,
8388
- standardVersion: "2.1"
10360
+ standardVersion: "2.2"
8389
10361
  };
10362
+ let globalFdc3 = globalScope.fdc3;
8390
10363
  if (typeof globalFdc3 === "undefined") {
8391
10364
  globalFdc3 = fdc3Factory();
8392
10365
  checkIfInElectron(globalFdc3);
8393
- window.fdc3 = globalFdc3;
10366
+ globalScope.fdc3 = globalFdc3;
8394
10367
  }
8395
10368
  else {
8396
10369
  console.warn("Defaulting to using the auto-injected fdc3.");