@interopio/fdc3 2.7.0 → 2.7.1

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.
package/dist/fdc3.es.js CHANGED
@@ -226,10 +226,10 @@ var syntax = SyntaxError;
226
226
  var type = TypeError;
227
227
 
228
228
  /** @type {import('./gOPD')} */
229
- var gOPD$6 = Object.getOwnPropertyDescriptor;
229
+ var gOPD$5 = Object.getOwnPropertyDescriptor;
230
230
 
231
231
  /** @type {import('.')} */
232
- var $gOPD$2 = gOPD$6;
232
+ var $gOPD$2 = gOPD$5;
233
233
 
234
234
  if ($gOPD$2) {
235
235
  try {
@@ -319,7 +319,7 @@ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBu
319
319
  var hasPropertyDescriptors_1 = hasPropertyDescriptors;
320
320
 
321
321
  var keys = objectKeys$2;
322
- var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
322
+ var hasSymbols$4 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
323
323
 
324
324
  var toStr$4 = Object.prototype.toString;
325
325
  var concat = Array.prototype.concat;
@@ -352,7 +352,7 @@ var defineProperty$1 = function (object, name, value, predicate) {
352
352
  var defineProperties$1 = function (object, map) {
353
353
  var predicates = arguments.length > 2 ? arguments[2] : {};
354
354
  var props = keys(map);
355
- if (hasSymbols$5) {
355
+ if (hasSymbols$4) {
356
356
  props = concat.call(props, Object.getOwnPropertySymbols(map));
357
357
  }
358
358
  for (var i = 0; i < props.length; i += 1) {
@@ -364,7 +364,7 @@ defineProperties$1.supportsDescriptors = !!supportsDescriptors$2;
364
364
 
365
365
  var defineProperties_1 = defineProperties$1;
366
366
 
367
- var callBind$7 = {exports: {}};
367
+ var callBind$6 = {exports: {}};
368
368
 
369
369
  /** @type {import('.')} */
370
370
  var esObjectAtoms = Object;
@@ -418,11 +418,11 @@ var sign$1 = function sign(number) {
418
418
  };
419
419
 
420
420
  var shams$1;
421
- var hasRequiredShams;
421
+ var hasRequiredShams$1;
422
422
 
423
- function requireShams () {
424
- if (hasRequiredShams) return shams$1;
425
- hasRequiredShams = 1;
423
+ function requireShams$1 () {
424
+ if (hasRequiredShams$1) return shams$1;
425
+ hasRequiredShams$1 = 1;
426
426
 
427
427
  /** @type {import('./shams')} */
428
428
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
@@ -471,10 +471,10 @@ function requireShams () {
471
471
  }
472
472
 
473
473
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
474
- var hasSymbolSham = requireShams();
474
+ var hasSymbolSham = requireShams$1();
475
475
 
476
476
  /** @type {import('.')} */
477
- var hasSymbols$4 = function hasNativeSymbols() {
477
+ var hasSymbols$3 = function hasNativeSymbols() {
478
478
  if (typeof origSymbol !== 'function') { return false; }
479
479
  if (typeof Symbol !== 'function') { return false; }
480
480
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -664,60 +664,78 @@ var callBindApplyHelpers = function callBindBasic(args) {
664
664
  return $actualApply(bind$2, $call$1, args);
665
665
  };
666
666
 
667
- var callBind$6 = callBindApplyHelpers;
668
- var gOPD$5 = gopd$1;
667
+ var get;
668
+ var hasRequiredGet;
669
669
 
670
- var hasProtoAccessor;
671
- try {
672
- // eslint-disable-next-line no-extra-parens, no-proto
673
- hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
674
- } catch (e) {
675
- if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
676
- throw e;
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
+ }
677
685
  }
678
- }
679
686
 
680
- // eslint-disable-next-line no-extra-parens
681
- var desc = !!hasProtoAccessor && gOPD$5 && gOPD$5(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
687
+ // eslint-disable-next-line no-extra-parens
688
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
682
689
 
683
- var $Object$3 = Object;
684
- var $getPrototypeOf = $Object$3.getPrototypeOf;
690
+ var $Object = Object;
691
+ var $getPrototypeOf = $Object.getPrototypeOf;
685
692
 
686
- /** @type {import('./get')} */
687
- var get = desc && typeof desc.get === 'function'
688
- ? callBind$6([desc.get])
689
- : typeof $getPrototypeOf === 'function'
690
- ? /** @type {import('./get')} */ function getDunder(value) {
691
- // eslint-disable-next-line eqeqeq
692
- return $getPrototypeOf(value == null ? value : $Object$3(value));
693
- }
694
- : false;
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
+ }
695
704
 
696
- var reflectGetProto = requireReflect_getPrototypeOf();
697
- var originalGetProto = requireObject_getPrototypeOf();
705
+ var getProto$3;
706
+ var hasRequiredGetProto;
698
707
 
699
- var getDunderProto = get;
708
+ function requireGetProto () {
709
+ if (hasRequiredGetProto) return getProto$3;
710
+ hasRequiredGetProto = 1;
700
711
 
701
- /** @type {import('.')} */
702
- var getProto$3 = reflectGetProto
703
- ? function getProto(O) {
704
- // @ts-expect-error TS can't narrow inside a closure, for some reason
705
- return reflectGetProto(O);
706
- }
707
- : originalGetProto
712
+ var reflectGetProto = requireReflect_getPrototypeOf();
713
+ var originalGetProto = requireObject_getPrototypeOf();
714
+
715
+ var getDunderProto = requireGet();
716
+
717
+ /** @type {import('.')} */
718
+ getProto$3 = reflectGetProto
708
719
  ? function getProto(O) {
709
- if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
710
- throw new TypeError('getProto: not an object');
711
- }
712
720
  // @ts-expect-error TS can't narrow inside a closure, for some reason
713
- return originalGetProto(O);
721
+ return reflectGetProto(O);
714
722
  }
715
- : getDunderProto
723
+ : originalGetProto
716
724
  ? function getProto(O) {
725
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
726
+ throw new TypeError('getProto: not an object');
727
+ }
717
728
  // @ts-expect-error TS can't narrow inside a closure, for some reason
718
- return getDunderProto(O);
729
+ return originalGetProto(O);
719
730
  }
720
- : null;
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$3;
738
+ }
721
739
 
722
740
  var hasown;
723
741
  var hasRequiredHasown;
@@ -787,9 +805,9 @@ var ThrowTypeError = $gOPD$1
787
805
  }())
788
806
  : throwTypeError;
789
807
 
790
- var hasSymbols$3 = hasSymbols$4();
808
+ var hasSymbols$2 = hasSymbols$3();
791
809
 
792
- var getProto$2 = getProto$3;
810
+ var getProto$2 = requireGetProto();
793
811
  var $ObjectGPO = requireObject_getPrototypeOf();
794
812
  var $ReflectGPO = requireReflect_getPrototypeOf();
795
813
 
@@ -805,7 +823,7 @@ var INTRINSICS = {
805
823
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
806
824
  '%Array%': Array,
807
825
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
808
- '%ArrayIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
826
+ '%ArrayIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
809
827
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
810
828
  '%AsyncFunction%': needsEval,
811
829
  '%AsyncGenerator%': needsEval,
@@ -836,10 +854,10 @@ var INTRINSICS = {
836
854
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
837
855
  '%isFinite%': isFinite,
838
856
  '%isNaN%': isNaN,
839
- '%IteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
857
+ '%IteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
840
858
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
841
859
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
842
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
860
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
843
861
  '%Math%': Math,
844
862
  '%Number%': Number,
845
863
  '%Object%': $Object$2,
@@ -853,11 +871,11 @@ var INTRINSICS = {
853
871
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
854
872
  '%RegExp%': RegExp,
855
873
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
856
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
874
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
857
875
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
858
876
  '%String%': String,
859
- '%StringIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
860
- '%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
877
+ '%StringIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
878
+ '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
861
879
  '%SyntaxError%': $SyntaxError$1,
862
880
  '%ThrowTypeError%': ThrowTypeError,
863
881
  '%TypedArray%': TypedArray,
@@ -1186,9 +1204,9 @@ var applyBind = function applyBind() {
1186
1204
  } else {
1187
1205
  module.exports.apply = applyBind$1;
1188
1206
  }
1189
- } (callBind$7));
1207
+ } (callBind$6));
1190
1208
 
1191
- var callBindExports = callBind$7.exports;
1209
+ var callBindExports = callBind$6.exports;
1192
1210
 
1193
1211
  var GetIntrinsic$7 = getIntrinsic;
1194
1212
 
@@ -1198,7 +1216,7 @@ var callBindBasic = callBindApplyHelpers;
1198
1216
  var $indexOf$2 = callBindBasic([GetIntrinsic$7('%String.prototype.indexOf%')]);
1199
1217
 
1200
1218
  /** @type {import('.')} */
1201
- var callBound$i = function callBoundIntrinsic(name, allowMissing) {
1219
+ var callBound$h = function callBoundIntrinsic(name, allowMissing) {
1202
1220
  /* eslint no-extra-parens: 0 */
1203
1221
 
1204
1222
  var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic$7(name, !!allowMissing));
@@ -1210,12 +1228,12 @@ var callBound$i = function callBoundIntrinsic(name, allowMissing) {
1210
1228
 
1211
1229
  // modified from https://github.com/es-shims/es6-shim
1212
1230
  var objectKeys$1 = objectKeys$2;
1213
- var hasSymbols$2 = requireShams()();
1214
- var callBound$h = callBound$i;
1231
+ var hasSymbols$1 = requireShams$1()();
1232
+ var callBound$g = callBound$h;
1215
1233
  var $Object$1 = esObjectAtoms;
1216
- var $push = callBound$h('Array.prototype.push');
1217
- var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
1218
- var originalGetSymbols = hasSymbols$2 ? $Object$1.getOwnPropertySymbols : null;
1234
+ var $push = callBound$g('Array.prototype.push');
1235
+ var $propIsEnumerable = callBound$g('Object.prototype.propertyIsEnumerable');
1236
+ var originalGetSymbols = hasSymbols$1 ? $Object$1.getOwnPropertySymbols : null;
1219
1237
 
1220
1238
  // eslint-disable-next-line no-unused-vars
1221
1239
  var implementation$8 = function assign(target, source1) {
@@ -1229,7 +1247,7 @@ var implementation$8 = function assign(target, source1) {
1229
1247
 
1230
1248
  // step 3.a.ii:
1231
1249
  var keys = objectKeys$1(from);
1232
- var getSymbols = hasSymbols$2 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
1250
+ var getSymbols = hasSymbols$1 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
1233
1251
  if (getSymbols) {
1234
1252
  var syms = getSymbols(from);
1235
1253
  for (var j = 0; j < syms.length; ++j) {
@@ -1347,7 +1365,7 @@ var callBind$4 = callBindExports;
1347
1365
 
1348
1366
  var $indexOf$1 = callBind$4(GetIntrinsic$6('String.prototype.indexOf'));
1349
1367
 
1350
- var callBound$g = function callBoundIntrinsic(name, allowMissing) {
1368
+ var callBound$f = function callBoundIntrinsic(name, allowMissing) {
1351
1369
  var intrinsic = GetIntrinsic$6(name, !!allowMissing);
1352
1370
  if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
1353
1371
  return callBind$4(intrinsic);
@@ -1487,7 +1505,7 @@ var getPolyfill$3 = polyfill$2;
1487
1505
  var gOPD$2 = gopd$1;
1488
1506
  var defineProperty = Object.defineProperty;
1489
1507
  var $TypeError$5 = esErrors;
1490
- var getProto$1 = getProto$3;
1508
+ var getProto$1 = requireGetProto();
1491
1509
  var regex = /a/;
1492
1510
 
1493
1511
  var shim$3 = function shimFlags() {
@@ -1526,29 +1544,38 @@ var regexp_prototype_flags = flagsBound;
1526
1544
 
1527
1545
  var esGetIterator = {exports: {}};
1528
1546
 
1529
- var hasSymbols$1 = requireShams();
1547
+ var shams;
1548
+ var hasRequiredShams;
1530
1549
 
1531
- /** @type {import('.')} */
1532
- var shams = function hasToStringTagShams() {
1533
- return hasSymbols$1() && !!Symbol.toStringTag;
1534
- };
1550
+ function requireShams () {
1551
+ if (hasRequiredShams) return shams;
1552
+ hasRequiredShams = 1;
1535
1553
 
1536
- var hasToStringTag$7 = shams();
1537
- var callBound$f = callBound$i;
1554
+ var hasSymbols = requireShams$1();
1538
1555
 
1539
- var $toString$7 = callBound$f('Object.prototype.toString');
1556
+ /** @type {import('.')} */
1557
+ shams = function hasToStringTagShams() {
1558
+ return hasSymbols() && !!Symbol.toStringTag;
1559
+ };
1560
+ return shams;
1561
+ }
1562
+
1563
+ var hasToStringTag$6 = requireShams()();
1564
+ var callBound$e = callBound$h;
1565
+
1566
+ var $toString$6 = callBound$e('Object.prototype.toString');
1540
1567
 
1541
1568
  /** @type {import('.')} */
1542
1569
  var isStandardArguments = function isArguments(value) {
1543
1570
  if (
1544
- hasToStringTag$7
1571
+ hasToStringTag$6
1545
1572
  && value
1546
1573
  && typeof value === 'object'
1547
1574
  && Symbol.toStringTag in value
1548
1575
  ) {
1549
1576
  return false;
1550
1577
  }
1551
- return $toString$7(value) === '[object Arguments]';
1578
+ return $toString$6(value) === '[object Arguments]';
1552
1579
  };
1553
1580
 
1554
1581
  /** @type {import('.')} */
@@ -1561,9 +1588,9 @@ var isLegacyArguments = function isArguments(value) {
1561
1588
  && 'length' in value
1562
1589
  && typeof value.length === 'number'
1563
1590
  && value.length >= 0
1564
- && $toString$7(value) !== '[object Array]'
1591
+ && $toString$6(value) !== '[object Array]'
1565
1592
  && 'callee' in value
1566
- && $toString$7(value.callee) === '[object Function]';
1593
+ && $toString$6(value.callee) === '[object Function]';
1567
1594
  };
1568
1595
 
1569
1596
  var supportsStandardArguments = (function () {
@@ -2243,22 +2270,22 @@ var sideChannelList = function getSideChannelList() {
2243
2270
  };
2244
2271
 
2245
2272
  var GetIntrinsic$5 = getIntrinsic;
2246
- var callBound$e = callBound$i;
2273
+ var callBound$d = callBound$h;
2247
2274
  var inspect$2 = objectInspect;
2248
2275
 
2249
2276
  var $TypeError$3 = type;
2250
2277
  var $Map$3 = GetIntrinsic$5('%Map%', true);
2251
2278
 
2252
2279
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
2253
- var $mapGet$1 = callBound$e('Map.prototype.get', true);
2280
+ var $mapGet$1 = callBound$d('Map.prototype.get', true);
2254
2281
  /** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
2255
- var $mapSet = callBound$e('Map.prototype.set', true);
2282
+ var $mapSet = callBound$d('Map.prototype.set', true);
2256
2283
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2257
- var $mapHas$5 = callBound$e('Map.prototype.has', true);
2284
+ var $mapHas$5 = callBound$d('Map.prototype.has', true);
2258
2285
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2259
- var $mapDelete = callBound$e('Map.prototype.delete', true);
2286
+ var $mapDelete = callBound$d('Map.prototype.delete', true);
2260
2287
  /** @type {<K, V>(thisArg: Map<K, V>) => number} */
2261
- var $mapSize$1 = callBound$e('Map.prototype.size', true);
2288
+ var $mapSize$1 = callBound$d('Map.prototype.size', true);
2262
2289
 
2263
2290
  /** @type {import('.')} */
2264
2291
  var sideChannelMap = !!$Map$3 && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
@@ -2310,7 +2337,7 @@ var sideChannelMap = !!$Map$3 && /** @type {Exclude<import('.'), false>} */ func
2310
2337
  };
2311
2338
 
2312
2339
  var GetIntrinsic$4 = getIntrinsic;
2313
- var callBound$d = callBound$i;
2340
+ var callBound$c = callBound$h;
2314
2341
  var inspect$1 = objectInspect;
2315
2342
  var getSideChannelMap$1 = sideChannelMap;
2316
2343
 
@@ -2318,13 +2345,13 @@ var $TypeError$2 = type;
2318
2345
  var $WeakMap$1 = GetIntrinsic$4('%WeakMap%', true);
2319
2346
 
2320
2347
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
2321
- var $weakMapGet = callBound$d('WeakMap.prototype.get', true);
2348
+ var $weakMapGet = callBound$c('WeakMap.prototype.get', true);
2322
2349
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
2323
- var $weakMapSet = callBound$d('WeakMap.prototype.set', true);
2350
+ var $weakMapSet = callBound$c('WeakMap.prototype.set', true);
2324
2351
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2325
- var $weakMapHas = callBound$d('WeakMap.prototype.has', true);
2352
+ var $weakMapHas = callBound$c('WeakMap.prototype.has', true);
2326
2353
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2327
- var $weakMapDelete = callBound$d('WeakMap.prototype.delete', true);
2354
+ var $weakMapDelete = callBound$c('WeakMap.prototype.delete', true);
2328
2355
 
2329
2356
  /** @type {import('.')} */
2330
2357
  var sideChannelWeakmap = $WeakMap$1
@@ -2553,35 +2580,44 @@ var isarray = Array.isArray || function (arr) {
2553
2580
  return toString.call(arr) == '[object Array]';
2554
2581
  };
2555
2582
 
2556
- var callBound$c = callBound$i;
2583
+ var isString$2;
2584
+ var hasRequiredIsString;
2557
2585
 
2558
- /** @type {(receiver: ThisParameterType<typeof String.prototype.valueOf>, ...args: Parameters<typeof String.prototype.valueOf>) => ReturnType<typeof String.prototype.valueOf>} */
2559
- var $strValueOf = callBound$c('String.prototype.valueOf');
2586
+ function requireIsString () {
2587
+ if (hasRequiredIsString) return isString$2;
2588
+ hasRequiredIsString = 1;
2560
2589
 
2561
- /** @type {import('.')} */
2562
- var tryStringObject = function tryStringObject(value) {
2563
- try {
2564
- $strValueOf(value);
2565
- return true;
2566
- } catch (e) {
2567
- return false;
2568
- }
2569
- };
2570
- /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
2571
- var $toString$6 = callBound$c('Object.prototype.toString');
2572
- var strClass = '[object String]';
2573
- var hasToStringTag$6 = shams();
2590
+ var callBound = callBound$h;
2574
2591
 
2575
- /** @type {import('.')} */
2576
- var isString$2 = function isString(value) {
2577
- if (typeof value === 'string') {
2578
- return true;
2579
- }
2580
- if (!value || typeof value !== 'object') {
2581
- return false;
2582
- }
2583
- return hasToStringTag$6 ? tryStringObject(value) : $toString$6(value) === strClass;
2584
- };
2592
+ /** @type {(receiver: ThisParameterType<typeof String.prototype.valueOf>, ...args: Parameters<typeof String.prototype.valueOf>) => ReturnType<typeof String.prototype.valueOf>} */
2593
+ var $strValueOf = callBound('String.prototype.valueOf');
2594
+
2595
+ /** @type {import('.')} */
2596
+ var tryStringObject = function tryStringObject(value) {
2597
+ try {
2598
+ $strValueOf(value);
2599
+ return true;
2600
+ } catch (e) {
2601
+ return false;
2602
+ }
2603
+ };
2604
+ /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
2605
+ var $toString = callBound('Object.prototype.toString');
2606
+ var strClass = '[object String]';
2607
+ var hasToStringTag = requireShams()();
2608
+
2609
+ /** @type {import('.')} */
2610
+ isString$2 = function isString(value) {
2611
+ if (typeof value === 'string') {
2612
+ return true;
2613
+ }
2614
+ if (!value || typeof value !== 'object') {
2615
+ return false;
2616
+ }
2617
+ return hasToStringTag ? tryStringObject(value) : $toString(value) === strClass;
2618
+ };
2619
+ return isString$2;
2620
+ }
2585
2621
 
2586
2622
  /** @const */
2587
2623
  var $Map$2 = typeof Map === 'function' && Map.prototype ? Map : null;
@@ -2686,7 +2722,7 @@ var isSet$2 = exported$1 || function isSet(x) {
2686
2722
  var isArguments$1 = isArguments$2;
2687
2723
  var getStopIterationIterator = stopIterationIterator;
2688
2724
 
2689
- if (hasSymbols$4() || requireShams()()) {
2725
+ if (hasSymbols$3() || requireShams$1()()) {
2690
2726
  var $iterator = Symbol.iterator;
2691
2727
  // Symbol is available natively or shammed
2692
2728
  // natively:
@@ -2709,11 +2745,11 @@ if (hasSymbols$4() || requireShams()()) {
2709
2745
  } else {
2710
2746
  // Symbol is not available, native or shammed
2711
2747
  var isArray$2 = isarray;
2712
- var isString$1 = isString$2;
2748
+ var isString$1 = requireIsString();
2713
2749
  var GetIntrinsic$3 = getIntrinsic;
2714
2750
  var $Map = GetIntrinsic$3('%Map%', true);
2715
2751
  var $Set$1 = GetIntrinsic$3('%Set%', true);
2716
- var callBound$b = callBound$g;
2752
+ var callBound$b = callBound$f;
2717
2753
  var $arrayPush = callBound$b('Array.prototype.push');
2718
2754
  var $charCodeAt = callBound$b('String.prototype.charCodeAt');
2719
2755
  var $stringSlice = callBound$b('String.prototype.slice');
@@ -2918,7 +2954,7 @@ define(polyfill, {
2918
2954
  var objectIs = polyfill;
2919
2955
 
2920
2956
  var callBind$1 = callBindExports;
2921
- var callBound$a = callBound$i;
2957
+ var callBound$a = callBound$h;
2922
2958
  var GetIntrinsic$2 = getIntrinsic;
2923
2959
 
2924
2960
  var $ArrayBuffer = GetIntrinsic$2('%ArrayBuffer%', true);
@@ -2959,7 +2995,7 @@ var isArrayBuffer$2 = $byteLength$2 || $abSlice
2959
2995
  return false;
2960
2996
  };
2961
2997
 
2962
- var callBound$9 = callBound$i;
2998
+ var callBound$9 = callBound$h;
2963
2999
 
2964
3000
  var getDay = callBound$9('Date.prototype.getDay');
2965
3001
  /** @type {import('.')} */
@@ -2975,7 +3011,7 @@ var tryDateObject = function tryDateGetDayCall(value) {
2975
3011
  /** @type {(value: unknown) => string} */
2976
3012
  var toStr$2 = callBound$9('Object.prototype.toString');
2977
3013
  var dateClass = '[object Date]';
2978
- var hasToStringTag$5 = shams();
3014
+ var hasToStringTag$5 = requireShams()();
2979
3015
 
2980
3016
  /** @type {import('.')} */
2981
3017
  var isDateObject = function isDateObject(value) {
@@ -2985,8 +3021,8 @@ var isDateObject = function isDateObject(value) {
2985
3021
  return hasToStringTag$5 ? tryDateObject(value) : toStr$2(value) === dateClass;
2986
3022
  };
2987
3023
 
2988
- var callBound$8 = callBound$i;
2989
- var hasToStringTag$4 = shams();
3024
+ var callBound$8 = callBound$h;
3025
+ var hasToStringTag$4 = requireShams()();
2990
3026
  var hasOwn = requireHasown();
2991
3027
  var gOPD$1 = gopd$1;
2992
3028
 
@@ -3053,7 +3089,7 @@ if (hasToStringTag$4) {
3053
3089
 
3054
3090
  var isRegex$1 = fn;
3055
3091
 
3056
- var callBound$7 = callBound$i;
3092
+ var callBound$7 = callBound$h;
3057
3093
 
3058
3094
  /** @type {undefined | ((thisArg: SharedArrayBuffer) => number)} */
3059
3095
  var $byteLength$1 = callBound$7('SharedArrayBuffer.prototype.byteLength', true);
@@ -3076,7 +3112,7 @@ var isSharedArrayBuffer$1 = $byteLength$1
3076
3112
  return false;
3077
3113
  };
3078
3114
 
3079
- var callBound$6 = callBound$i;
3115
+ var callBound$6 = callBound$h;
3080
3116
 
3081
3117
  var $numToStr = callBound$6('Number.prototype.toString');
3082
3118
 
@@ -3091,7 +3127,7 @@ var tryNumberObject = function tryNumberObject(value) {
3091
3127
  };
3092
3128
  var $toString$3 = callBound$6('Object.prototype.toString');
3093
3129
  var numClass = '[object Number]';
3094
- var hasToStringTag$3 = shams();
3130
+ var hasToStringTag$3 = requireShams()();
3095
3131
 
3096
3132
  /** @type {import('.')} */
3097
3133
  var isNumberObject = function isNumberObject(value) {
@@ -3104,7 +3140,7 @@ var isNumberObject = function isNumberObject(value) {
3104
3140
  return hasToStringTag$3 ? tryNumberObject(value) : $toString$3(value) === numClass;
3105
3141
  };
3106
3142
 
3107
- var callBound$5 = callBound$i;
3143
+ var callBound$5 = callBound$h;
3108
3144
  var $boolToStr = callBound$5('Boolean.prototype.toString');
3109
3145
  var $toString$2 = callBound$5('Object.prototype.toString');
3110
3146
 
@@ -3118,7 +3154,7 @@ var tryBooleanObject = function booleanBrandCheck(value) {
3118
3154
  }
3119
3155
  };
3120
3156
  var boolClass = '[object Boolean]';
3121
- var hasToStringTag$2 = shams();
3157
+ var hasToStringTag$2 = requireShams()();
3122
3158
 
3123
3159
  /** @type {import('.')} */
3124
3160
  var isBooleanObject = function isBoolean(value) {
@@ -3140,7 +3176,7 @@ function requireSafeRegexTest () {
3140
3176
  if (hasRequiredSafeRegexTest) return safeRegexTest$1;
3141
3177
  hasRequiredSafeRegexTest = 1;
3142
3178
 
3143
- var callBound = callBound$i;
3179
+ var callBound = callBound$h;
3144
3180
  var isRegex = isRegex$1;
3145
3181
 
3146
3182
  var $exec = callBound('RegExp.prototype.exec');
@@ -3158,9 +3194,9 @@ function requireSafeRegexTest () {
3158
3194
  return safeRegexTest$1;
3159
3195
  }
3160
3196
 
3161
- var callBound$4 = callBound$i;
3197
+ var callBound$4 = callBound$h;
3162
3198
  var $toString$1 = callBound$4('Object.prototype.toString');
3163
- var hasSymbols = hasSymbols$4();
3199
+ var hasSymbols = hasSymbols$3();
3164
3200
  var safeRegexTest = requireSafeRegexTest();
3165
3201
 
3166
3202
  if (hasSymbols) {
@@ -3253,7 +3289,7 @@ if (hasBigInts) {
3253
3289
 
3254
3290
  var isBigintExports = isBigint.exports;
3255
3291
 
3256
- var isString = isString$2;
3292
+ var isString = requireIsString();
3257
3293
  var isNumber = isNumberObject;
3258
3294
  var isBoolean = isBooleanObject;
3259
3295
  var isSymbol = isSymbolExports;
@@ -3331,7 +3367,7 @@ var isWeakmap = exported || function isWeakMap(x) {
3331
3367
  var isWeakset = {exports: {}};
3332
3368
 
3333
3369
  var GetIntrinsic$1 = getIntrinsic;
3334
- var callBound$3 = callBound$i;
3370
+ var callBound$3 = callBound$h;
3335
3371
 
3336
3372
  var $WeakSet = GetIntrinsic$1('%WeakSet%', true);
3337
3373
 
@@ -3601,12 +3637,12 @@ var availableTypedArrays$1 = function availableTypedArrays() {
3601
3637
  var forEach = forEach$1;
3602
3638
  var availableTypedArrays = availableTypedArrays$1;
3603
3639
  var callBind = callBindExports;
3604
- var callBound$2 = callBound$i;
3640
+ var callBound$2 = callBound$h;
3605
3641
  var gOPD = gopd$1;
3606
- var getProto = getProto$3;
3642
+ var getProto = requireGetProto();
3607
3643
 
3608
3644
  var $toString = callBound$2('Object.prototype.toString');
3609
- var hasToStringTag = shams();
3645
+ var hasToStringTag = requireShams()();
3610
3646
 
3611
3647
  var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
3612
3648
  var typedArrays = availableTypedArrays();
@@ -3714,7 +3750,7 @@ var whichTypedArray$1 = function whichTypedArray(value) {
3714
3750
  return tryTypedArrays(value);
3715
3751
  };
3716
3752
 
3717
- var callBound$1 = callBound$i;
3753
+ var callBound$1 = callBound$h;
3718
3754
  var $byteLength = callBound$1('ArrayBuffer.prototype.byteLength', true);
3719
3755
 
3720
3756
  var isArrayBuffer$1 = isArrayBuffer$2;
@@ -3728,7 +3764,7 @@ var arrayBufferByteLength = function byteLength(ab) {
3728
3764
  }; // in node < 0.11, byteLength is an own nonconfigurable property
3729
3765
 
3730
3766
  var assign = object_assign;
3731
- var callBound = callBound$g;
3767
+ var callBound = callBound$f;
3732
3768
  var flags = regexp_prototype_flags;
3733
3769
  var GetIntrinsic = getIntrinsic;
3734
3770
  var getIterator = esGetIteratorExports;
@@ -5342,7 +5378,7 @@ var ChannelTypes;
5342
5378
  })(ChannelTypes || (ChannelTypes = {}));
5343
5379
  const defaultChannelsProps = ["id", "type", "broadcast", "addContextListener", "getCurrentContext"];
5344
5380
  const defaultContextProps = ["type"];
5345
- const defaultGlue42APIs = ["contexts", "channels", "interop", "intents", "appManager", "windows"];
5381
+ const defaultGlue42APIs = ["contexts", "channels", "interop", "intents", "windows"];
5346
5382
  const glueChannelNamePrefix = "___channel___";
5347
5383
  const fdc3NothingContextType = "fdc3.nothing";
5348
5384
  const RaiseTimeoutMs = 75 * 1000;
@@ -6259,22 +6295,50 @@ class GlueController {
6259
6295
  if (missingApis.length) {
6260
6296
  return { isValid: false, error: { message: `Fdc3 cannot initialize correctly - Glue is missing the following ${missingApis.length > 1 ? "properties" : "property"}: ${missingApis.join(", ")}` } };
6261
6297
  }
6298
+ if (typeof glue.apps !== "object" && typeof glue.appManager !== "object") {
6299
+ return { isValid: false, error: { message: "Glue should be initialized with either 'apps' or 'appManager' API" } };
6300
+ }
6262
6301
  return { isValid: true };
6263
6302
  }
6264
6303
  interopInstance() {
6265
6304
  return this.glue.interop.instance;
6266
6305
  }
6267
- getApplication(name) {
6268
- return this.glue.appManager.application(name);
6306
+ async getApplication(name) {
6307
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6308
+ if (!isAppsAPIAvailable) {
6309
+ return this.glue.appManager.application(name);
6310
+ }
6311
+ const app = await this.glue.apps.registry.get({ name });
6312
+ return app ?? undefined;
6269
6313
  }
6270
- getAllAppManagerInstances() {
6271
- return this.glue.appManager.instances();
6314
+ async getApplicationInstances(appName) {
6315
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6316
+ if (!isAppsAPIAvailable) {
6317
+ return this.glue.appManager.instances().filter(inst => inst.application.name === appName);
6318
+ }
6319
+ const appInstances = await this.glue.apps.instances.getMany({ appNames: [appName] });
6320
+ return appInstances;
6272
6321
  }
6273
- getApplicationInstances(appName) {
6274
- return this.getAllAppManagerInstances().filter(inst => inst.application.name === appName);
6322
+ async getAppInstanceById(id) {
6323
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6324
+ if (!isAppsAPIAvailable) {
6325
+ return this.glue.appManager.instances().find(inst => inst.id === id);
6326
+ }
6327
+ const appInstance = await this.glue.apps.instances.get({ id });
6328
+ return appInstance ?? undefined;
6275
6329
  }
6276
- getAppInstanceById(id) {
6277
- return this.getAllAppManagerInstances().find(inst => inst.id === id);
6330
+ async startApplication({ app, context, waitForInstanceReady }) {
6331
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6332
+ if (!isAppsAPIAvailable) {
6333
+ const glueInst = await app.start(context, { waitForAGMReady: waitForInstanceReady });
6334
+ return glueInst;
6335
+ }
6336
+ const glueInstance = await this.glue.apps.instances.start({ name: app.name, context });
6337
+ if (!waitForInstanceReady) {
6338
+ return glueInstance;
6339
+ }
6340
+ await this.glue.apps?.instances.waitForReady({ id: glueInstance.id });
6341
+ return glueInstance;
6278
6342
  }
6279
6343
  async findIntents(intentFilter) {
6280
6344
  return this.glue.intents.find(intentFilter);
@@ -6398,8 +6462,15 @@ class GlueController {
6398
6462
  getGlueVersion() {
6399
6463
  return this.glue?.version;
6400
6464
  }
6401
- registerOnInstanceStopped(cb) {
6402
- return this.glue.appManager.onInstanceStopped(cb);
6465
+ async registerOnInstanceStopped(callback) {
6466
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6467
+ if (!isAppsAPIAvailable) {
6468
+ return this.glue.appManager.onInstanceStopped((inst) => callback(inst.id));
6469
+ }
6470
+ const unsub = await this.glue.apps.instances.onStopped((event) => {
6471
+ callback(event.instance.id);
6472
+ });
6473
+ return unsub;
6403
6474
  }
6404
6475
  async unregisterMethod(methodName) {
6405
6476
  return this.glue.interop.unregister(methodName);
@@ -6561,6 +6632,9 @@ class GlueController {
6561
6632
  async contextsSetPaths(name, paths) {
6562
6633
  await this.glue.contexts.setPaths(name, paths);
6563
6634
  }
6635
+ isAppsAPIAvailable() {
6636
+ return typeof this.glue.apps === "object";
6637
+ }
6564
6638
  }
6565
6639
 
6566
6640
  const GLUE42_EVENT_NAME = "Glue42";
@@ -8594,10 +8668,11 @@ class IntentsController {
8594
8668
  throw new Error(ResolveError.NoAppsFound);
8595
8669
  }
8596
8670
  this.logger?.info(`[${commandId}] - parsing glue intents to fdc3 intents and returning`);
8597
- return glueIntents.map((glueIntent) => {
8671
+ const appIntents = await Promise.all(glueIntents.map((glueIntent) => {
8598
8672
  const intentWithFilteredHandlers = this.getGlueIntentWithFilteredHandlers(glueIntent, { contextType: context.type, resultType });
8599
8673
  return this.convertGlue42IntentToFDC3Intent(intentWithFilteredHandlers);
8600
- });
8674
+ }));
8675
+ return appIntents;
8601
8676
  }
8602
8677
  async raiseIntent({ commandId, intent, context, target }) {
8603
8678
  await this.glueController.gluePromise;
@@ -8609,7 +8684,7 @@ class IntentsController {
8609
8684
  throw new Error(ResolveError.NoAppsFound);
8610
8685
  }
8611
8686
  if (!target) {
8612
- const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
8687
+ const filteredGlueIntent = await this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
8613
8688
  this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} and handlers ${filteredGlueIntent.handlers.map(h => h.applicationName && h.instanceId)}`);
8614
8689
  return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
8615
8690
  }
@@ -8715,7 +8790,7 @@ class IntentsController {
8715
8790
  handler: rememberedHandlerWithFilter.handler
8716
8791
  };
8717
8792
  }
8718
- filterGlueIntentHandlers({ commandId, intent, context, target }) {
8793
+ async filterGlueIntentHandlers({ commandId, intent, context, target }) {
8719
8794
  let filteredGlueIntent;
8720
8795
  filteredGlueIntent = this.filterIntentHandlersByContext(intent, context);
8721
8796
  if (!target) {
@@ -8723,14 +8798,14 @@ class IntentsController {
8723
8798
  return filteredGlueIntent;
8724
8799
  }
8725
8800
  this.logger?.log(`[${commandId}] - filtering handlers by target (${JSON.stringify(target)}) for intent ${intent.name}`);
8726
- filteredGlueIntent = this.filterIntentHandlersByTarget({ intent, target, commandId });
8801
+ filteredGlueIntent = await this.filterIntentHandlersByTarget({ intent, target, commandId });
8727
8802
  return filteredGlueIntent;
8728
8803
  }
8729
- filterIntentHandlersByTarget({ intent, target, commandId }) {
8804
+ async filterIntentHandlersByTarget({ intent, target, commandId }) {
8730
8805
  const appName = typeof target === "string" ? target : target.appId;
8731
8806
  const instanceId = typeof target === "string" ? undefined : target.instanceId;
8732
8807
  this.logger?.info(`[${commandId}] - Checking if application with name ${appName} exists`);
8733
- const app = this.glueController.getApplication(appName);
8808
+ const app = await this.glueController.getApplication(appName);
8734
8809
  const serverInstances = this.serverInstanceAsIntentHandler(intent.name);
8735
8810
  if (!app && (typeof target === "string" || !target.instanceId || !serverInstances.length)) {
8736
8811
  throw new Error(ResolveError.TargetAppUnavailable);
@@ -8810,27 +8885,28 @@ class IntentsController {
8810
8885
  this.logger?.info(`[${commandId}] - returning private channel`);
8811
8886
  return channel.toApi();
8812
8887
  }
8813
- convertGlue42IntentToFDC3Intent(glueIntent) {
8888
+ async convertGlue42IntentToFDC3Intent(glueIntent) {
8814
8889
  const { name, handlers } = glueIntent;
8890
+ const apps = await Promise.all(handlers.map(async (handler) => {
8891
+ const appName = handler.applicationName;
8892
+ const app = await this.glueController.getApplication(appName);
8893
+ const icons = (handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons ?? [])] : (app?.userProperties.icons ?? [])).filter((icon) => !!icon).map((icon) => ({ src: icon }));
8894
+ const images = (app?.userProperties.images ?? []).filter((image) => !!image).map((image) => ({ src: image }));
8895
+ return {
8896
+ appId: appName,
8897
+ instanceId: handler.instanceId,
8898
+ name: appName,
8899
+ title: handler.applicationTitle || handler.instanceTitle || appName,
8900
+ tooltip: app?.userProperties.tooltip ?? `${appName} (${handler.type})`,
8901
+ description: handler.applicationDescription,
8902
+ icons,
8903
+ images,
8904
+ resultType: handler.resultType
8905
+ };
8906
+ }));
8815
8907
  const appIntent = {
8816
8908
  intent: { name, displayName: handlers[0].displayName || "" },
8817
- apps: handlers.map((handler) => {
8818
- const appName = handler.applicationName;
8819
- const app = this.glueController.getApplication(appName);
8820
- const icons = (handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons ?? [])] : (app?.userProperties.icons ?? [])).filter((icon) => !!icon).map((icon) => ({ src: icon }));
8821
- const images = (app?.userProperties.images ?? []).filter((image) => !!image).map((image) => ({ src: image }));
8822
- return {
8823
- appId: appName,
8824
- instanceId: handler.instanceId,
8825
- name: appName,
8826
- title: handler.applicationTitle || handler.instanceTitle || appName,
8827
- tooltip: app?.userProperties.tooltip ?? `${appName} (${handler.type})`,
8828
- description: handler.applicationDescription,
8829
- icons,
8830
- images,
8831
- resultType: handler.resultType
8832
- };
8833
- })
8909
+ apps
8834
8910
  };
8835
8911
  return appIntent;
8836
8912
  }
@@ -8943,7 +9019,7 @@ class ApplicationsController {
8943
9019
  await this.glueController.gluePromise;
8944
9020
  this.logger?.log(`[${commandId}] - open() invoked with target ${JSON.stringify(target)} ${context ? `and contextType ${context.type}` : ""}`);
8945
9021
  const name = typeof target === "object" ? target.appId : target;
8946
- const app = this.glueController.getApplication(name);
9022
+ const app = await this.glueController.getApplication(name);
8947
9023
  if (!app) {
8948
9024
  throw new Error(OpenError.AppNotFound);
8949
9025
  }
@@ -8954,8 +9030,7 @@ class ApplicationsController {
8954
9030
  }
8955
9031
  try {
8956
9032
  this.logger?.info(`[${commandId}] - opening app '${app.name}' without context`);
8957
- const inBrowser = this.glueController.isRunningInBrowser();
8958
- const glueInst = await app.start(undefined, { waitForAGMReady: !inBrowser });
9033
+ const glueInst = await this.glueController.startApplication({ app, waitForInstanceReady: !this.glueController.isRunningInBrowser() });
8959
9034
  this.logger?.info(`[${commandId}] - instance with id ${glueInst.id} started`);
8960
9035
  return this.parseGlueInstToAppIdentifier(glueInst);
8961
9036
  }
@@ -8967,11 +9042,11 @@ class ApplicationsController {
8967
9042
  await this.glueController.gluePromise;
8968
9043
  this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
8969
9044
  const { appId } = appIdentifier;
8970
- const app = this.glueController.getApplication(appId);
9045
+ const app = await this.glueController.getApplication(appId);
8971
9046
  if (!app) {
8972
9047
  throw new Error(ResolveError.NoAppsFound);
8973
9048
  }
8974
- const glueInstances = this.glueController.getApplicationInstances(appId);
9049
+ const glueInstances = await this.glueController.getApplicationInstances(appId);
8975
9050
  const fdc3Instances = glueInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
8976
9051
  this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${JSON.stringify(appIdentifier)}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
8977
9052
  return fdc3Instances;
@@ -8980,7 +9055,7 @@ class ApplicationsController {
8980
9055
  await this.glueController.gluePromise;
8981
9056
  this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
8982
9057
  const { appId, instanceId } = appIdentifier;
8983
- const app = this.glueController.getApplication(appId);
9058
+ const app = await this.glueController.getApplication(appId);
8984
9059
  if (!app) {
8985
9060
  throw new Error(OpenError.AppNotFound);
8986
9061
  }
@@ -8988,7 +9063,7 @@ class ApplicationsController {
8988
9063
  this.logger?.info(`[${commandId}] - no opened instances found. Parsing app ${app.name}`);
8989
9064
  return this.parseGlueAppToAppMetadata(app);
8990
9065
  }
8991
- const instance = this.glueController.getAppInstanceById(instanceId);
9066
+ const instance = await this.glueController.getAppInstanceById(instanceId);
8992
9067
  const appMetadata = this.parseGlueAppToAppMetadata(app, instance);
8993
9068
  this.logger?.info(`[${commandId}] - found app metadata: ${appMetadata}`);
8994
9069
  return appMetadata;
@@ -8996,9 +9071,9 @@ class ApplicationsController {
8996
9071
  async getInfo({ commandId }) {
8997
9072
  await this.glueController.gluePromise;
8998
9073
  this.logger?.info(`${commandId} - getInfo() invoked`);
8999
- const appMetadata = this.getCurrentAppMetadata();
9074
+ const appMetadata = await this.getCurrentAppMetadata();
9000
9075
  const globalScope = typeof process !== "undefined" ? process : window;
9001
- const { provider, providerVersion, standardVersion } = globalScope.fdc3Info;
9076
+ const { provider, providerVersion, standardVersion } = globalScope.fdc3Info ?? {};
9002
9077
  return {
9003
9078
  provider,
9004
9079
  providerVersion,
@@ -9011,10 +9086,10 @@ class ApplicationsController {
9011
9086
  appMetadata
9012
9087
  };
9013
9088
  }
9014
- getCurrentAppMetadata() {
9089
+ async getCurrentAppMetadata() {
9015
9090
  const myInstance = this.glueController.interopInstance();
9016
9091
  const myInstanceApplicationName = myInstance.application ?? myInstance.applicationName;
9017
- const myApp = this.glueController.getApplication(myInstanceApplicationName);
9092
+ const myApp = await this.glueController.getApplication(myInstanceApplicationName);
9018
9093
  if (myApp) {
9019
9094
  return { appId: myApp.name, instanceId: myInstance.instance };
9020
9095
  }
@@ -9023,7 +9098,7 @@ class ApplicationsController {
9023
9098
  }
9024
9099
  parseGlueInstToAppIdentifier(glueInst) {
9025
9100
  return {
9026
- appId: glueInst.application.name,
9101
+ appId: this.isApplicationInstance(glueInst) ? glueInst.appName : glueInst.application.name,
9027
9102
  instanceId: glueInst.id
9028
9103
  };
9029
9104
  }
@@ -9042,6 +9117,10 @@ class ApplicationsController {
9042
9117
  const icon = inBrowserNamespace
9043
9118
  ? app.icon
9044
9119
  : (await app.getConfiguration()).icon;
9120
+ const desktopScreenshots = appConfiguration.customProperties?.screenshots ?? appConfiguration.userProperties?.screenshots;
9121
+ const screenshots = inBrowserNamespace
9122
+ ? appConfiguration.screenshots
9123
+ : desktopScreenshots;
9045
9124
  return {
9046
9125
  appId: app.name,
9047
9126
  name: app.name,
@@ -9050,22 +9129,30 @@ class ApplicationsController {
9050
9129
  title: app.title,
9051
9130
  icons: icon ? [{ src: icon }] : [],
9052
9131
  tooltip: appConfiguration.tooltip,
9053
- screenshots: inBrowserNamespace
9054
- ? appConfiguration.screenshots
9055
- : appConfiguration.customProperties.screenshots
9132
+ screenshots
9056
9133
  };
9057
9134
  }
9058
9135
  addInstanceMetadataToAppMetadata(appMetadata, instance) {
9059
- return { ...appMetadata, instanceId: instance.id, instanceMetadata: instance.agm };
9136
+ return {
9137
+ ...appMetadata,
9138
+ instanceId: instance.id,
9139
+ instanceMetadata: this.isApplicationInstance(instance) ? instance.interopInstance : instance.agm
9140
+ };
9141
+ }
9142
+ isApplicationInstance(instance) {
9143
+ return "appName" in instance;
9060
9144
  }
9061
9145
  async openAppWithContext(app, context) {
9062
9146
  const guid = nanoid();
9063
9147
  const startContext = this.buildStartContext(context, guid);
9064
9148
  const wrappedPromise = this.createContextListenerWrappedPromise(app);
9065
9149
  this.appsStateStore.addOpenAppPromise(guid, wrappedPromise);
9066
- const inBrowser = this.glueController.isRunningInBrowser();
9067
9150
  try {
9068
- const glueInst = await app.start(startContext, { waitForAGMReady: !inBrowser });
9151
+ const glueInst = await this.glueController.startApplication({
9152
+ app,
9153
+ context: startContext,
9154
+ waitForInstanceReady: !this.glueController.isRunningInBrowser()
9155
+ });
9069
9156
  await wrappedPromise.promise;
9070
9157
  this.appsStateStore.removeOpenAppPromise(guid);
9071
9158
  return this.parseGlueInstToAppIdentifier(glueInst);
@@ -9527,9 +9614,12 @@ class PrivateChannel {
9527
9614
  this.channelsController.removePrivateChannelFromStoreById(this.id);
9528
9615
  await this.sendCollaborateMessage({ action: "disconnectedFromPrivateChannel" });
9529
9616
  this.logger?.trace(`[${commandId}] - collaborator received action ${"disconnectedFromPrivateChannel"}`);
9530
- if (this.unsubFromInstanceStopped) {
9531
- this.unsubFromInstanceStopped();
9617
+ if (!this.unsubFromInstanceStopped) {
9618
+ return;
9532
9619
  }
9620
+ const unsub = this.unsubFromInstanceStopped instanceof Promise ? await this.unsubFromInstanceStopped : this.unsubFromInstanceStopped;
9621
+ unsub();
9622
+ this.unsubFromInstanceStopped = undefined;
9533
9623
  }
9534
9624
  ensureAlive(commandId) {
9535
9625
  if (!this.disconnected) {
@@ -9548,8 +9638,8 @@ class PrivateChannel {
9548
9638
  throw new Error(ChannelError.AccessDenied);
9549
9639
  }
9550
9640
  subscribeForCollaboratorInstanceStop(commandId) {
9551
- const handler = (instance) => {
9552
- if (instance.id !== this.collaborator?.instanceId) {
9641
+ const handler = (id) => {
9642
+ if (id !== this.collaborator?.instanceId) {
9553
9643
  return;
9554
9644
  }
9555
9645
  this.handleCollaboratorDisconnect();
@@ -10434,7 +10524,7 @@ const fdc3Factory = () => {
10434
10524
  return ioc.fdc3;
10435
10525
  };
10436
10526
 
10437
- var version = "2.7.0";
10527
+ var version = "2.7.1";
10438
10528
 
10439
10529
  const globalScope = typeof process !== "undefined" ? process : window;
10440
10530
  globalScope.fdc3Info = {