@interopio/fdc3 2.7.1-beta.0 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 {
@@ -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;
@@ -641,16 +641,16 @@ function requireFunctionApply () {
641
641
  /** @type {import('./reflectApply')} */
642
642
  var reflectApply$1 = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
643
643
 
644
- var bind$4 = requireFunctionBind();
644
+ var bind$3 = requireFunctionBind();
645
645
 
646
646
  var $apply$2 = requireFunctionApply();
647
647
  var $call$2 = requireFunctionCall();
648
648
  var $reflectApply = reflectApply$1;
649
649
 
650
650
  /** @type {import('./actualApply')} */
651
- var actualApply$1 = $reflectApply || bind$4.call($call$2, $apply$2);
651
+ var actualApply$1 = $reflectApply || bind$3.call($call$2, $apply$2);
652
652
 
653
- var bind$3 = requireFunctionBind();
653
+ var bind$2 = requireFunctionBind();
654
654
  var $TypeError$a = type;
655
655
 
656
656
  var $call$1 = requireFunctionCall();
@@ -661,70 +661,97 @@ var callBindApplyHelpers = function callBindBasic(args) {
661
661
  if (args.length < 1 || typeof args[0] !== 'function') {
662
662
  throw new $TypeError$a('a function is required');
663
663
  }
664
- return $actualApply(bind$3, $call$1, args);
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
- var call = Function.prototype.call;
723
- var $hasOwn = Object.prototype.hasOwnProperty;
724
- var bind$2 = requireFunctionBind();
740
+ var hasown;
741
+ var hasRequiredHasown;
725
742
 
726
- /** @type {import('.')} */
727
- var hasown = bind$2.call(call, $hasOwn);
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
+ }
728
755
 
729
756
  var undefined$1;
730
757
 
@@ -780,7 +807,7 @@ var ThrowTypeError = $gOPD$1
780
807
 
781
808
  var hasSymbols$2 = hasSymbols$3();
782
809
 
783
- var getProto$2 = getProto$3;
810
+ var getProto$2 = requireGetProto();
784
811
  var $ObjectGPO = requireObject_getPrototypeOf();
785
812
  var $ReflectGPO = requireReflect_getPrototypeOf();
786
813
 
@@ -967,7 +994,7 @@ var LEGACY_ALIASES = {
967
994
  };
968
995
 
969
996
  var bind$1 = requireFunctionBind();
970
- var hasOwn$3 = hasown;
997
+ var hasOwn$3 = requireHasown();
971
998
  var $concat$1 = bind$1.call($call, Array.prototype.concat);
972
999
  var $spliceApply = bind$1.call($apply$1, Array.prototype.splice);
973
1000
  var $replace$1 = bind$1.call($call, String.prototype.replace);
@@ -1177,9 +1204,9 @@ var applyBind = function applyBind() {
1177
1204
  } else {
1178
1205
  module.exports.apply = applyBind$1;
1179
1206
  }
1180
- } (callBind$7));
1207
+ } (callBind$6));
1181
1208
 
1182
- var callBindExports = callBind$7.exports;
1209
+ var callBindExports = callBind$6.exports;
1183
1210
 
1184
1211
  var GetIntrinsic$7 = getIntrinsic;
1185
1212
 
@@ -1189,7 +1216,7 @@ var callBindBasic = callBindApplyHelpers;
1189
1216
  var $indexOf$2 = callBindBasic([GetIntrinsic$7('%String.prototype.indexOf%')]);
1190
1217
 
1191
1218
  /** @type {import('.')} */
1192
- var callBound$i = function callBoundIntrinsic(name, allowMissing) {
1219
+ var callBound$h = function callBoundIntrinsic(name, allowMissing) {
1193
1220
  /* eslint no-extra-parens: 0 */
1194
1221
 
1195
1222
  var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic$7(name, !!allowMissing));
@@ -1202,10 +1229,10 @@ var callBound$i = function callBoundIntrinsic(name, allowMissing) {
1202
1229
  // modified from https://github.com/es-shims/es6-shim
1203
1230
  var objectKeys$1 = objectKeys$2;
1204
1231
  var hasSymbols$1 = requireShams$1()();
1205
- var callBound$h = callBound$i;
1232
+ var callBound$g = callBound$h;
1206
1233
  var $Object$1 = esObjectAtoms;
1207
- var $push = callBound$h('Array.prototype.push');
1208
- var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
1234
+ var $push = callBound$g('Array.prototype.push');
1235
+ var $propIsEnumerable = callBound$g('Object.prototype.propertyIsEnumerable');
1209
1236
  var originalGetSymbols = hasSymbols$1 ? $Object$1.getOwnPropertySymbols : null;
1210
1237
 
1211
1238
  // eslint-disable-next-line no-unused-vars
@@ -1338,7 +1365,7 @@ var callBind$4 = callBindExports;
1338
1365
 
1339
1366
  var $indexOf$1 = callBind$4(GetIntrinsic$6('String.prototype.indexOf'));
1340
1367
 
1341
- var callBound$g = function callBoundIntrinsic(name, allowMissing) {
1368
+ var callBound$f = function callBoundIntrinsic(name, allowMissing) {
1342
1369
  var intrinsic = GetIntrinsic$6(name, !!allowMissing);
1343
1370
  if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
1344
1371
  return callBind$4(intrinsic);
@@ -1478,7 +1505,7 @@ var getPolyfill$3 = polyfill$2;
1478
1505
  var gOPD$2 = gopd$1;
1479
1506
  var defineProperty = Object.defineProperty;
1480
1507
  var $TypeError$5 = esErrors;
1481
- var getProto$1 = getProto$3;
1508
+ var getProto$1 = requireGetProto();
1482
1509
  var regex = /a/;
1483
1510
 
1484
1511
  var shim$3 = function shimFlags() {
@@ -1533,22 +1560,22 @@ function requireShams () {
1533
1560
  return shams;
1534
1561
  }
1535
1562
 
1536
- var hasToStringTag$7 = requireShams()();
1537
- var callBound$f = callBound$i;
1563
+ var hasToStringTag$6 = requireShams()();
1564
+ var callBound$e = callBound$h;
1538
1565
 
1539
- var $toString$7 = callBound$f('Object.prototype.toString');
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
@@ -2437,7 +2464,7 @@ var sideChannel = function getSideChannel() {
2437
2464
  /** @typedef {`$${import('.').InternalSlot}`} SaltedInternalSlot */
2438
2465
  /** @typedef {{ [k in SaltedInternalSlot]?: unknown }} SlotsObject */
2439
2466
 
2440
- var hasOwn$1 = hasown;
2467
+ var hasOwn$1 = requireHasown();
2441
2468
  /** @type {import('side-channel').Channel<object, SlotsObject>} */
2442
2469
  var channel = sideChannel();
2443
2470
 
@@ -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 = requireShams()();
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;
@@ -2709,11 +2745,11 @@ if (hasSymbols$3() || requireShams$1()()) {
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('.')} */
@@ -2985,9 +3021,9 @@ 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;
3024
+ var callBound$8 = callBound$h;
2989
3025
  var hasToStringTag$4 = requireShams()();
2990
- var hasOwn = hasown;
3026
+ var hasOwn = requireHasown();
2991
3027
  var gOPD$1 = gopd$1;
2992
3028
 
2993
3029
  /** @type {import('.')} */
@@ -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
 
@@ -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
 
@@ -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,7 +3194,7 @@ 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
3199
  var hasSymbols = hasSymbols$3();
3164
3200
  var safeRegexTest = requireSafeRegexTest();
@@ -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,9 +3637,9 @@ 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
3645
  var hasToStringTag = requireShams()();
@@ -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,65 @@ 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(options) {
6307
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6308
+ if (!isAppsAPIAvailable) {
6309
+ return this.glue.appManager.application(options.name);
6310
+ }
6311
+ const app = await this.glue.apps.registry.get(options);
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 getIoCDAppConfiguration(app) {
6331
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6332
+ if (!isAppsAPIAvailable) {
6333
+ return app.getConfiguration();
6334
+ }
6335
+ const definition = app.definition;
6336
+ if (definition) {
6337
+ return definition;
6338
+ }
6339
+ const appWithDefinition = await this.glue.apps.registry.get({ name: app.name, includeDefinition: true });
6340
+ if (!appWithDefinition?.definition) {
6341
+ throw new Error(`Application definition for app '${app.name}' could not be found`);
6342
+ }
6343
+ return appWithDefinition.definition;
6344
+ }
6345
+ async startApplication({ app, context, waitForInstanceReady }) {
6346
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6347
+ if (!isAppsAPIAvailable) {
6348
+ const glueInst = await app.start(context, { waitForAGMReady: waitForInstanceReady });
6349
+ return glueInst;
6350
+ }
6351
+ const glueInstance = await this.glue.apps.instances.start({ name: app.name, context });
6352
+ if (!waitForInstanceReady) {
6353
+ return glueInstance;
6354
+ }
6355
+ await this.glue.apps.instances.waitForReady({ id: glueInstance.id });
6356
+ return glueInstance;
6278
6357
  }
6279
6358
  async findIntents(intentFilter) {
6280
6359
  return this.glue.intents.find(intentFilter);
@@ -6398,8 +6477,15 @@ class GlueController {
6398
6477
  getGlueVersion() {
6399
6478
  return this.glue?.version;
6400
6479
  }
6401
- registerOnInstanceStopped(cb) {
6402
- return this.glue.appManager.onInstanceStopped(cb);
6480
+ async registerOnInstanceStopped(callback) {
6481
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6482
+ if (!isAppsAPIAvailable) {
6483
+ return this.glue.appManager.onInstanceStopped((inst) => callback(inst.id));
6484
+ }
6485
+ const unsub = await this.glue.apps.instances.onStopped((event) => {
6486
+ callback(event.instance.id);
6487
+ });
6488
+ return unsub;
6403
6489
  }
6404
6490
  async unregisterMethod(methodName) {
6405
6491
  return this.glue.interop.unregister(methodName);
@@ -6561,6 +6647,9 @@ class GlueController {
6561
6647
  async contextsSetPaths(name, paths) {
6562
6648
  await this.glue.contexts.setPaths(name, paths);
6563
6649
  }
6650
+ isAppsAPIAvailable() {
6651
+ return typeof this.glue.apps === "object";
6652
+ }
6564
6653
  }
6565
6654
 
6566
6655
  const GLUE42_EVENT_NAME = "Glue42";
@@ -8579,7 +8668,7 @@ class IntentsController {
8579
8668
  if (!context && !resultType) {
8580
8669
  return this.convertGlue42IntentToFDC3Intent(searchedGlueIntent);
8581
8670
  }
8582
- const contextType = (context && context.type === fdc3NothingContextType) ? undefined : context?.type;
8671
+ const contextType = context?.type === fdc3NothingContextType ? undefined : context?.type;
8583
8672
  const filteredIntent = this.getGlueIntentWithFilteredHandlers(searchedGlueIntent, { contextType, resultType });
8584
8673
  if (!filteredIntent.handlers.length) {
8585
8674
  throw new Error(ResolveError.NoAppsFound);
@@ -8594,10 +8683,11 @@ class IntentsController {
8594
8683
  throw new Error(ResolveError.NoAppsFound);
8595
8684
  }
8596
8685
  this.logger?.info(`[${commandId}] - parsing glue intents to fdc3 intents and returning`);
8597
- return glueIntents.map((glueIntent) => {
8686
+ const appIntents = await Promise.all(glueIntents.map((glueIntent) => {
8598
8687
  const intentWithFilteredHandlers = this.getGlueIntentWithFilteredHandlers(glueIntent, { contextType: context.type, resultType });
8599
8688
  return this.convertGlue42IntentToFDC3Intent(intentWithFilteredHandlers);
8600
- });
8689
+ }));
8690
+ return appIntents;
8601
8691
  }
8602
8692
  async raiseIntent({ commandId, intent, context, target }) {
8603
8693
  await this.glueController.gluePromise;
@@ -8609,7 +8699,7 @@ class IntentsController {
8609
8699
  throw new Error(ResolveError.NoAppsFound);
8610
8700
  }
8611
8701
  if (!target) {
8612
- const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
8702
+ const filteredGlueIntent = await this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
8613
8703
  this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} and handlers ${filteredGlueIntent.handlers.map(h => h.applicationName && h.instanceId)}`);
8614
8704
  return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
8615
8705
  }
@@ -8715,7 +8805,7 @@ class IntentsController {
8715
8805
  handler: rememberedHandlerWithFilter.handler
8716
8806
  };
8717
8807
  }
8718
- filterGlueIntentHandlers({ commandId, intent, context, target }) {
8808
+ async filterGlueIntentHandlers({ commandId, intent, context, target }) {
8719
8809
  let filteredGlueIntent;
8720
8810
  filteredGlueIntent = this.filterIntentHandlersByContext(intent, context);
8721
8811
  if (!target) {
@@ -8723,14 +8813,14 @@ class IntentsController {
8723
8813
  return filteredGlueIntent;
8724
8814
  }
8725
8815
  this.logger?.log(`[${commandId}] - filtering handlers by target (${JSON.stringify(target)}) for intent ${intent.name}`);
8726
- filteredGlueIntent = this.filterIntentHandlersByTarget({ intent, target, commandId });
8816
+ filteredGlueIntent = await this.filterIntentHandlersByTarget({ intent, target, commandId });
8727
8817
  return filteredGlueIntent;
8728
8818
  }
8729
- filterIntentHandlersByTarget({ intent, target, commandId }) {
8819
+ async filterIntentHandlersByTarget({ intent, target, commandId }) {
8730
8820
  const appName = typeof target === "string" ? target : target.appId;
8731
8821
  const instanceId = typeof target === "string" ? undefined : target.instanceId;
8732
8822
  this.logger?.info(`[${commandId}] - Checking if application with name ${appName} exists`);
8733
- const app = this.glueController.getApplication(appName);
8823
+ const app = await this.glueController.getApplication({ name: appName, includeDefinition: true, includeInstances: true });
8734
8824
  const serverInstances = this.serverInstanceAsIntentHandler(intent.name);
8735
8825
  if (!app && (typeof target === "string" || !target.instanceId || !serverInstances.length)) {
8736
8826
  throw new Error(ResolveError.TargetAppUnavailable);
@@ -8744,8 +8834,9 @@ class IntentsController {
8744
8834
  this.logger?.log(`[${commandId}] - returning all handlers for intent ${intent.name} and target: ${JSON.stringify(target)}`);
8745
8835
  return { name: intent.name, handlers: validHandlersByApplicationName };
8746
8836
  }
8837
+ const appInstances = app?.instances ?? await (this.glueController.getApplicationInstances(appName));
8747
8838
  const isValidInstanceOfTheApp = app
8748
- ? app.instances.find((inst) => inst.id === instanceId)
8839
+ ? appInstances.find((inst) => inst.id === instanceId)
8749
8840
  : serverInstances.find((inst) => inst.instance === instanceId);
8750
8841
  if (!isValidInstanceOfTheApp) {
8751
8842
  throw new Error(ResolveError.TargetInstanceUnavailable);
@@ -8810,27 +8901,33 @@ class IntentsController {
8810
8901
  this.logger?.info(`[${commandId}] - returning private channel`);
8811
8902
  return channel.toApi();
8812
8903
  }
8813
- convertGlue42IntentToFDC3Intent(glueIntent) {
8904
+ async convertGlue42IntentToFDC3Intent(glueIntent) {
8814
8905
  const { name, handlers } = glueIntent;
8906
+ const apps = await Promise.all(handlers.map(async (handler) => {
8907
+ const appName = handler.applicationName;
8908
+ const app = await this.glueController.getApplication({ name: appName, includeDefinition: true });
8909
+ const icons = [app?.icon, ...(app?.userProperties?.icons ?? []), ...(app?.customProperties?.icons ?? [])]
8910
+ .filter((icon) => !!icon)
8911
+ .map((icon) => ({ src: icon }));
8912
+ const images = [...(app?.userProperties?.images ?? []), ...(app?.customProperties?.images ?? [])]
8913
+ .filter((image) => !!image)
8914
+ .map((image) => ({ src: image }));
8915
+ const tooltip = app?.title || app?.userProperties?.tooltip || `${appName} (${handler.type})`;
8916
+ return {
8917
+ appId: appName,
8918
+ instanceId: handler.instanceId,
8919
+ name: appName,
8920
+ title: handler.applicationTitle || handler.instanceTitle || appName,
8921
+ tooltip,
8922
+ description: handler.applicationDescription,
8923
+ icons,
8924
+ images,
8925
+ resultType: handler.resultType
8926
+ };
8927
+ }));
8815
8928
  const appIntent = {
8816
8929
  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
- })
8930
+ apps
8834
8931
  };
8835
8932
  return appIntent;
8836
8933
  }
@@ -8943,7 +9040,7 @@ class ApplicationsController {
8943
9040
  await this.glueController.gluePromise;
8944
9041
  this.logger?.log(`[${commandId}] - open() invoked with target ${JSON.stringify(target)} ${context ? `and contextType ${context.type}` : ""}`);
8945
9042
  const name = typeof target === "object" ? target.appId : target;
8946
- const app = this.glueController.getApplication(name);
9043
+ const app = await this.glueController.getApplication({ name });
8947
9044
  if (!app) {
8948
9045
  throw new Error(OpenError.AppNotFound);
8949
9046
  }
@@ -8954,8 +9051,7 @@ class ApplicationsController {
8954
9051
  }
8955
9052
  try {
8956
9053
  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 });
9054
+ const glueInst = await this.glueController.startApplication({ app, waitForInstanceReady: !this.glueController.isRunningInBrowser() });
8959
9055
  this.logger?.info(`[${commandId}] - instance with id ${glueInst.id} started`);
8960
9056
  return this.parseGlueInstToAppIdentifier(glueInst);
8961
9057
  }
@@ -8967,12 +9063,12 @@ class ApplicationsController {
8967
9063
  await this.glueController.gluePromise;
8968
9064
  this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
8969
9065
  const { appId } = appIdentifier;
8970
- const app = this.glueController.getApplication(appId);
9066
+ const app = await this.glueController.getApplication({ name: appId, includeInstances: true, includeDefinition: true });
8971
9067
  if (!app) {
8972
9068
  throw new Error(ResolveError.NoAppsFound);
8973
9069
  }
8974
- const glueInstances = this.glueController.getApplicationInstances(appId);
8975
- const fdc3Instances = glueInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
9070
+ const appInstances = app.instances ?? await this.glueController.getApplicationInstances(appId);
9071
+ const fdc3Instances = appInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
8976
9072
  this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${JSON.stringify(appIdentifier)}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
8977
9073
  return fdc3Instances;
8978
9074
  }
@@ -8980,7 +9076,7 @@ class ApplicationsController {
8980
9076
  await this.glueController.gluePromise;
8981
9077
  this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
8982
9078
  const { appId, instanceId } = appIdentifier;
8983
- const app = this.glueController.getApplication(appId);
9079
+ const app = await this.glueController.getApplication({ name: appId, includeDefinition: true, includeInstances: true });
8984
9080
  if (!app) {
8985
9081
  throw new Error(OpenError.AppNotFound);
8986
9082
  }
@@ -8988,7 +9084,7 @@ class ApplicationsController {
8988
9084
  this.logger?.info(`[${commandId}] - no opened instances found. Parsing app ${app.name}`);
8989
9085
  return this.parseGlueAppToAppMetadata(app);
8990
9086
  }
8991
- const instance = this.glueController.getAppInstanceById(instanceId);
9087
+ const instance = await this.glueController.getAppInstanceById(instanceId);
8992
9088
  const appMetadata = this.parseGlueAppToAppMetadata(app, instance);
8993
9089
  this.logger?.info(`[${commandId}] - found app metadata: ${appMetadata}`);
8994
9090
  return appMetadata;
@@ -8996,9 +9092,9 @@ class ApplicationsController {
8996
9092
  async getInfo({ commandId }) {
8997
9093
  await this.glueController.gluePromise;
8998
9094
  this.logger?.info(`${commandId} - getInfo() invoked`);
8999
- const appMetadata = this.getCurrentAppMetadata();
9095
+ const appMetadata = await this.getCurrentAppMetadata();
9000
9096
  const globalScope = typeof process !== "undefined" ? process : window;
9001
- const { provider, providerVersion, standardVersion } = globalScope.fdc3Info;
9097
+ const { provider, providerVersion, standardVersion } = globalScope.fdc3Info ?? {};
9002
9098
  return {
9003
9099
  provider,
9004
9100
  providerVersion,
@@ -9011,10 +9107,10 @@ class ApplicationsController {
9011
9107
  appMetadata
9012
9108
  };
9013
9109
  }
9014
- getCurrentAppMetadata() {
9110
+ async getCurrentAppMetadata() {
9015
9111
  const myInstance = this.glueController.interopInstance();
9016
9112
  const myInstanceApplicationName = myInstance.application ?? myInstance.applicationName;
9017
- const myApp = this.glueController.getApplication(myInstanceApplicationName);
9113
+ const myApp = await this.glueController.getApplication({ name: myInstanceApplicationName, includeDefinition: true });
9018
9114
  if (myApp) {
9019
9115
  return { appId: myApp.name, instanceId: myInstance.instance };
9020
9116
  }
@@ -9023,49 +9119,64 @@ class ApplicationsController {
9023
9119
  }
9024
9120
  parseGlueInstToAppIdentifier(glueInst) {
9025
9121
  return {
9026
- appId: glueInst.application.name,
9122
+ appId: this.isApplicationInstance(glueInst) ? glueInst.appName : glueInst.application.name,
9027
9123
  instanceId: glueInst.id
9028
9124
  };
9029
9125
  }
9030
9126
  async parseGlueAppToAppMetadata(app, instance) {
9031
- const appMetadata = await this.getBaseGlueAppToAppMetadata(app);
9127
+ const inBrowserNamespace = this.glueController.isRunningInBrowser();
9128
+ const appMetadata = inBrowserNamespace
9129
+ ? await this.getBaseGlueAppToAppMetadataInBrowser(app)
9130
+ : await this.getBaseGlueAppToAppMetadataInDesktop(app);
9032
9131
  if (!instance) {
9033
9132
  return appMetadata;
9034
9133
  }
9035
- return this.addInstanceMetadataToAppMetadata(appMetadata, instance);
9134
+ const instanceData = {
9135
+ instanceId: instance.id,
9136
+ instanceMetadata: this.isApplicationInstance(instance) ? instance.interopInstance : instance.agm
9137
+ };
9138
+ return { ...appMetadata, ...instanceData };
9036
9139
  }
9037
- async getBaseGlueAppToAppMetadata(app) {
9038
- const inBrowserNamespace = this.glueController.isRunningInBrowser();
9039
- const appConfiguration = inBrowserNamespace
9040
- ? app.userProperties
9041
- : await app.getConfiguration();
9042
- const icon = inBrowserNamespace
9043
- ? app.icon
9044
- : (await app.getConfiguration()).icon;
9140
+ async getBaseGlueAppToAppMetadataInDesktop(app) {
9141
+ const appConfiguration = await this.glueController.getIoCDAppConfiguration(app);
9142
+ const screenshots = appConfiguration.customProperties?.screenshots ?? appConfiguration.userProperties?.screenshots;
9143
+ return {
9144
+ appId: appConfiguration.name,
9145
+ name: appConfiguration.name,
9146
+ version: appConfiguration.version,
9147
+ description: appConfiguration.description,
9148
+ title: appConfiguration.title,
9149
+ icons: appConfiguration.icon ? [{ src: appConfiguration.icon }] : [],
9150
+ tooltip: appConfiguration.tooltip,
9151
+ screenshots
9152
+ };
9153
+ }
9154
+ async getBaseGlueAppToAppMetadataInBrowser(app) {
9045
9155
  return {
9046
9156
  appId: app.name,
9047
9157
  name: app.name,
9048
9158
  version: app.version,
9049
- description: appConfiguration.description,
9159
+ description: app.userProperties.description,
9050
9160
  title: app.title,
9051
- icons: icon ? [{ src: icon }] : [],
9052
- tooltip: appConfiguration.tooltip,
9053
- screenshots: inBrowserNamespace
9054
- ? appConfiguration.screenshots
9055
- : appConfiguration.customProperties.screenshots
9161
+ icons: app.icon ? [{ src: app.icon }] : [],
9162
+ tooltip: app.userProperties.tooltip,
9163
+ screenshots: app.userProperties.screenshots
9056
9164
  };
9057
9165
  }
9058
- addInstanceMetadataToAppMetadata(appMetadata, instance) {
9059
- return { ...appMetadata, instanceId: instance.id, instanceMetadata: instance.agm };
9166
+ isApplicationInstance(instance) {
9167
+ return "appName" in instance;
9060
9168
  }
9061
9169
  async openAppWithContext(app, context) {
9062
9170
  const guid = nanoid();
9063
9171
  const startContext = this.buildStartContext(context, guid);
9064
- const wrappedPromise = this.createContextListenerWrappedPromise(app);
9172
+ const wrappedPromise = this.createContextListenerWrappedPromise(app.name);
9065
9173
  this.appsStateStore.addOpenAppPromise(guid, wrappedPromise);
9066
- const inBrowser = this.glueController.isRunningInBrowser();
9067
9174
  try {
9068
- const glueInst = await app.start(startContext, { waitForAGMReady: !inBrowser });
9175
+ const glueInst = await this.glueController.startApplication({
9176
+ app,
9177
+ context: startContext,
9178
+ waitForInstanceReady: !this.glueController.isRunningInBrowser()
9179
+ });
9069
9180
  await wrappedPromise.promise;
9070
9181
  this.appsStateStore.removeOpenAppPromise(guid);
9071
9182
  return this.parseGlueInstToAppIdentifier(glueInst);
@@ -9092,15 +9203,16 @@ class ApplicationsController {
9092
9203
  }
9093
9204
  };
9094
9205
  }
9095
- createContextListenerWrappedPromise(app) {
9206
+ createContextListenerWrappedPromise(appName) {
9096
9207
  let resolve = () => { };
9097
9208
  let reject = () => { };
9209
+ const timeoutMessage = `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${appName} to register context listener`;
9098
9210
  const promise = promisePlus(() => {
9099
9211
  return new Promise((res, rej) => {
9100
9212
  resolve = res;
9101
9213
  reject = rej;
9102
9214
  });
9103
- }, this.defaultContextListenerInvokedPromiseTimeout, `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${app.name} to register context listener`);
9215
+ }, this.defaultContextListenerInvokedPromiseTimeout, timeoutMessage);
9104
9216
  return { promise, resolve, reject };
9105
9217
  }
9106
9218
  }
@@ -9527,9 +9639,12 @@ class PrivateChannel {
9527
9639
  this.channelsController.removePrivateChannelFromStoreById(this.id);
9528
9640
  await this.sendCollaborateMessage({ action: "disconnectedFromPrivateChannel" });
9529
9641
  this.logger?.trace(`[${commandId}] - collaborator received action ${"disconnectedFromPrivateChannel"}`);
9530
- if (this.unsubFromInstanceStopped) {
9531
- this.unsubFromInstanceStopped();
9642
+ if (!this.unsubFromInstanceStopped) {
9643
+ return;
9532
9644
  }
9645
+ const unsub = this.unsubFromInstanceStopped instanceof Promise ? await this.unsubFromInstanceStopped : this.unsubFromInstanceStopped;
9646
+ unsub();
9647
+ this.unsubFromInstanceStopped = undefined;
9533
9648
  }
9534
9649
  ensureAlive(commandId) {
9535
9650
  if (!this.disconnected) {
@@ -9548,8 +9663,8 @@ class PrivateChannel {
9548
9663
  throw new Error(ChannelError.AccessDenied);
9549
9664
  }
9550
9665
  subscribeForCollaboratorInstanceStop(commandId) {
9551
- const handler = (instance) => {
9552
- if (instance.id !== this.collaborator?.instanceId) {
9666
+ const handler = (id) => {
9667
+ if (id !== this.collaborator?.instanceId) {
9553
9668
  return;
9554
9669
  }
9555
9670
  this.handleCollaboratorDisconnect();
@@ -10434,7 +10549,7 @@ const fdc3Factory = () => {
10434
10549
  return ioc.fdc3;
10435
10550
  };
10436
10551
 
10437
- var version = "2.7.1-beta.0";
10552
+ var version = "2.7.2";
10438
10553
 
10439
10554
  const globalScope = typeof process !== "undefined" ? process : window;
10440
10555
  globalScope.fdc3Info = {