@microsoft/teams-js 2.19.0-beta.1 → 2.19.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2420,6 +2420,7 @@ export namespace teams {
2420
2420
  * Limited to Microsoft-internal use
2421
2421
  */
2422
2422
  export namespace videoEffectsEx {
2423
+ const frameProcessingTimeoutInMs = 2000;
2423
2424
  /**
2424
2425
  * @hidden
2425
2426
  * Error level when notifying errors to the host, the host will decide what to do acording to the error level.
@@ -7586,7 +7587,7 @@ export namespace teamsCore {
7586
7587
  /**
7587
7588
  * Registers a handler to be called when the page has been requested to load.
7588
7589
  *
7589
- * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
7590
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/app-caching)
7590
7591
  * for a more detailed explanation about using this API.
7591
7592
  *
7592
7593
  * @param handler - The handler to invoke when the page is loaded.
@@ -7610,7 +7611,7 @@ export namespace teamsCore {
7610
7611
  /**
7611
7612
  * Registers a handler to be called before the page is unloaded.
7612
7613
  *
7613
- * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
7614
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/app-caching)
7614
7615
  * for a more detailed explanation about using this API.
7615
7616
  *
7616
7617
  * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
@@ -764,6 +764,36 @@ function plural(ms, msAbs, n, name) {
764
764
  /******/ }
765
765
  /******/
766
766
  /************************************************************************/
767
+ /******/ /* webpack/runtime/create fake namespace object */
768
+ /******/ (() => {
769
+ /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
770
+ /******/ var leafPrototypes;
771
+ /******/ // create a fake namespace object
772
+ /******/ // mode & 1: value is a module id, require it
773
+ /******/ // mode & 2: merge all properties of value into the ns
774
+ /******/ // mode & 4: return value when already ns object
775
+ /******/ // mode & 16: return value when it's Promise-like
776
+ /******/ // mode & 8|1: behave like require
777
+ /******/ __webpack_require__.t = function(value, mode) {
778
+ /******/ if(mode & 1) value = this(value);
779
+ /******/ if(mode & 8) return value;
780
+ /******/ if(typeof value === 'object' && value) {
781
+ /******/ if((mode & 4) && value.__esModule) return value;
782
+ /******/ if((mode & 16) && typeof value.then === 'function') return value;
783
+ /******/ }
784
+ /******/ var ns = Object.create(null);
785
+ /******/ __webpack_require__.r(ns);
786
+ /******/ var def = {};
787
+ /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
788
+ /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
789
+ /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
790
+ /******/ }
791
+ /******/ def['default'] = () => (value);
792
+ /******/ __webpack_require__.d(ns, def);
793
+ /******/ return ns;
794
+ /******/ };
795
+ /******/ })();
796
+ /******/
767
797
  /******/ /* webpack/runtime/define property getters */
768
798
  /******/ (() => {
769
799
  /******/ // define getter functions for harmony exports
@@ -1054,7 +1084,11 @@ var ApiName;
1054
1084
  ApiName["Tasks_UpdateTask"] = "tasks.updateTask";
1055
1085
  })(ApiName || (ApiName = {}));
1056
1086
 
1087
+ ;// CONCATENATED MODULE: ./src/artifactsForCDN/validDomains.json
1088
+ const validDomains_namespaceObject = JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","teams.live.com","devspaces.skype.com","ssauth.skype.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","*.teams.microsoft.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","www.bing.com","www.staging-bing-int.com","teams.cloud.microsoft","outlook.cloud.microsoft","m365.cloud.microsoft","copilot.microsoft.com"]}');
1089
+ var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
1057
1090
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1091
+
1058
1092
  /**
1059
1093
  * @hidden
1060
1094
  * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -1155,48 +1189,28 @@ const getMediaCallbackSupportVersion = '2.0.0';
1155
1189
  const scanBarCodeAPIMobileSupportVersion = '1.9.0';
1156
1190
  /**
1157
1191
  * @hidden
1158
- * List of supported Host origins
1159
- *
1160
- * @internal
1161
- * Limited to Microsoft-internal use
1162
- */
1163
- const validOrigins = [
1164
- 'teams.microsoft.com',
1165
- 'teams.microsoft.us',
1166
- 'gov.teams.microsoft.us',
1167
- 'dod.teams.microsoft.us',
1168
- 'int.teams.microsoft.com',
1169
- 'teams.live.com',
1170
- 'devspaces.skype.com',
1171
- 'ssauth.skype.com',
1172
- 'local.teams.live.com',
1173
- 'local.teams.live.com:8080',
1174
- 'local.teams.office.com',
1175
- 'local.teams.office.com:8080',
1176
- 'outlook.office.com',
1177
- 'outlook-sdf.office.com',
1178
- 'outlook.office365.com',
1179
- 'outlook-sdf.office365.com',
1180
- 'outlook.live.com',
1181
- 'outlook-sdf.live.com',
1182
- '*.teams.microsoft.com',
1183
- '*.www.office.com',
1184
- 'www.office.com',
1185
- 'word.office.com',
1186
- 'excel.office.com',
1187
- 'powerpoint.office.com',
1188
- 'www.officeppe.com',
1189
- '*.www.microsoft365.com',
1190
- 'www.microsoft365.com',
1191
- 'bing.com',
1192
- 'edgeservices.bing.com',
1193
- 'www.bing.com',
1194
- 'www.staging-bing-int.com',
1195
- 'teams.cloud.microsoft',
1196
- 'outlook.cloud.microsoft',
1197
- 'm365.cloud.microsoft',
1198
- 'copilot.microsoft.com',
1199
- ];
1192
+ * Fallback list of valid origins in JSON format
1193
+ *
1194
+ * @internal
1195
+ * Limited to Microsoft-internal use
1196
+ */
1197
+ const validOriginsLocal = artifactsForCDN_validDomains_namespaceObject;
1198
+ /**
1199
+ * @hidden
1200
+ * Fallback list of valid origins
1201
+ *
1202
+ * @internal
1203
+ * Limited to Microsoft-internal use
1204
+ */
1205
+ const validOriginsFallback = validOriginsLocal.validOrigins;
1206
+ /**
1207
+ * @hidden
1208
+ * CDN endpoint of the list of valid origins
1209
+ *
1210
+ * @internal
1211
+ * Limited to Microsoft-internal use
1212
+ */
1213
+ const validOriginsCdnEndpoint = new URL('https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json');
1200
1214
  /**
1201
1215
  * @hidden
1202
1216
  * USer specified message origins should satisfy this test
@@ -1649,59 +1663,6 @@ const errorInvalidResponse = new Error('Invalid response: Received more images t
1649
1663
  /* eslint-disable @typescript-eslint/no-unused-vars */
1650
1664
 
1651
1665
 
1652
-
1653
-
1654
-
1655
- /**
1656
- * @param pattern - reference pattern
1657
- * @param host - candidate string
1658
- * @returns returns true if host matches pre-know valid pattern
1659
- *
1660
- * @example
1661
- * validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true
1662
- * validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false
1663
- *
1664
- * @internal
1665
- * Limited to Microsoft-internal use
1666
- */
1667
- function validateHostAgainstPattern(pattern, host) {
1668
- if (pattern.substring(0, 2) === '*.') {
1669
- const suffix = pattern.substring(1);
1670
- if (host.length > suffix.length &&
1671
- host.split('.').length === suffix.split('.').length &&
1672
- host.substring(host.length - suffix.length) === suffix) {
1673
- return true;
1674
- }
1675
- }
1676
- else if (pattern === host) {
1677
- return true;
1678
- }
1679
- return false;
1680
- }
1681
- const validateOriginLogger = getLogger('validateOrigin');
1682
- /**
1683
- * @internal
1684
- * Limited to Microsoft-internal use
1685
- */
1686
- function validateOrigin(messageOrigin) {
1687
- // Check whether the url is in the pre-known allowlist or supplied by user
1688
- if (!isValidHttpsURL(messageOrigin)) {
1689
- validateOriginLogger('Origin %s is invalid because it is not using https protocol. Protocol being used: %s', messageOrigin, messageOrigin.protocol);
1690
- return false;
1691
- }
1692
- const messageOriginHost = messageOrigin.host;
1693
- if (validOrigins.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {
1694
- return true;
1695
- }
1696
- for (const domainOrPattern of GlobalVars.additionalValidOrigins) {
1697
- const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;
1698
- if (validateHostAgainstPattern(pattern, messageOriginHost)) {
1699
- return true;
1700
- }
1701
- }
1702
- validateOriginLogger('Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o', messageOrigin, validOrigins, GlobalVars.additionalValidOrigins);
1703
- return false;
1704
- }
1705
1666
  /**
1706
1667
  * @internal
1707
1668
  * Limited to Microsoft-internal use
@@ -2106,9 +2067,6 @@ const versionAndPlatformAgnosticTeamsRuntimeConfig = {
2106
2067
  hostVersionsInfo: teamsMinAdaptiveCardVersion,
2107
2068
  isLegacyTeams: true,
2108
2069
  supports: {
2109
- app: {
2110
- lifecycle: {},
2111
- },
2112
2070
  appInstallDialog: {},
2113
2071
  appEntity: {},
2114
2072
  call: {},
@@ -2265,7 +2223,13 @@ const mapTeamsVersionToSupportedCapabilities = {
2265
2223
  '2.0.5': [
2266
2224
  {
2267
2225
  capability: { webStorage: {} },
2268
- hostClientTypes: [HostClientType.android, HostClientType.desktop, HostClientType.ios],
2226
+ hostClientTypes: [HostClientType.android, HostClientType.ios],
2227
+ },
2228
+ ],
2229
+ '2.0.8': [
2230
+ {
2231
+ capability: { sharing: {} },
2232
+ hostClientTypes: [HostClientType.android, HostClientType.ios],
2269
2233
  },
2270
2234
  ],
2271
2235
  };
@@ -2382,7 +2346,7 @@ const _minRuntimeConfigToUninitialize = {
2382
2346
  * @hidden
2383
2347
  * Package version.
2384
2348
  */
2385
- const version = "2.19.0-beta.1";
2349
+ const version = "2.19.0-beta.3";
2386
2350
 
2387
2351
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2388
2352
 
@@ -2518,6 +2482,137 @@ function isNullOrUndefined(value) {
2518
2482
  return value === null || value === undefined;
2519
2483
  }
2520
2484
 
2485
+ ;// CONCATENATED MODULE: ./src/internal/validOrigins.ts
2486
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
2487
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2488
+ return new (P || (P = Promise))(function (resolve, reject) {
2489
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2490
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2491
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2492
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2493
+ });
2494
+ };
2495
+
2496
+
2497
+
2498
+
2499
+ let validOriginsCache = [];
2500
+ const validateOriginLogger = getLogger('validateOrigin');
2501
+ function prefetchOriginsFromCDN() {
2502
+ return __awaiter(this, void 0, void 0, function* () {
2503
+ yield getValidOriginsListFromCDN();
2504
+ });
2505
+ }
2506
+ function isValidOriginsCacheEmpty() {
2507
+ return validOriginsCache.length !== 0;
2508
+ }
2509
+ function getValidOriginsListFromCDN() {
2510
+ return __awaiter(this, void 0, void 0, function* () {
2511
+ if (isValidOriginsCacheEmpty()) {
2512
+ return validOriginsCache;
2513
+ }
2514
+ if (!inServerSideRenderingEnvironment()) {
2515
+ return fetch(validOriginsCdnEndpoint)
2516
+ .then((response) => {
2517
+ if (!response.ok) {
2518
+ throw new Error('Invalid Response from Fetch Call');
2519
+ }
2520
+ return response.json().then((validOriginsCDN) => {
2521
+ if (isValidOriginsJSONValid(JSON.stringify(validOriginsCDN))) {
2522
+ validOriginsCache = validOriginsCDN.validOrigins;
2523
+ return validOriginsCache;
2524
+ }
2525
+ else {
2526
+ throw new Error('Valid Origins List Is Invalid');
2527
+ }
2528
+ });
2529
+ })
2530
+ .catch((e) => {
2531
+ validateOriginLogger('validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list', e);
2532
+ validOriginsCache = validOriginsFallback;
2533
+ return validOriginsCache;
2534
+ });
2535
+ }
2536
+ else {
2537
+ validOriginsCache = validOriginsFallback;
2538
+ return validOriginsFallback;
2539
+ }
2540
+ });
2541
+ }
2542
+ function isValidOriginsJSONValid(validOriginsJSON) {
2543
+ let validOriginsCDN = JSON.parse(validOriginsJSON);
2544
+ try {
2545
+ validOriginsCDN = JSON.parse(validOriginsJSON);
2546
+ }
2547
+ catch (_) {
2548
+ return false;
2549
+ }
2550
+ if (!validOriginsCDN.validOrigins) {
2551
+ return false;
2552
+ }
2553
+ for (const validOrigin of validOriginsCDN.validOrigins) {
2554
+ try {
2555
+ new URL('https://' + validOrigin);
2556
+ }
2557
+ catch (_) {
2558
+ validateOriginLogger('isValidOriginsFromCDN call failed to validate origin: %s', validOrigin);
2559
+ return false;
2560
+ }
2561
+ }
2562
+ return true;
2563
+ }
2564
+ /**
2565
+ * @param pattern - reference pattern
2566
+ * @param host - candidate string
2567
+ * @returns returns true if host matches pre-know valid pattern
2568
+ *
2569
+ * @example
2570
+ * validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true
2571
+ * validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false
2572
+ *
2573
+ * @internal
2574
+ * Limited to Microsoft-internal use
2575
+ */
2576
+ function validateHostAgainstPattern(pattern, host) {
2577
+ if (pattern.substring(0, 2) === '*.') {
2578
+ const suffix = pattern.substring(1);
2579
+ if (host.length > suffix.length &&
2580
+ host.split('.').length === suffix.split('.').length &&
2581
+ host.substring(host.length - suffix.length) === suffix) {
2582
+ return true;
2583
+ }
2584
+ }
2585
+ else if (pattern === host) {
2586
+ return true;
2587
+ }
2588
+ return false;
2589
+ }
2590
+ /**
2591
+ * @internal
2592
+ * Limited to Microsoft-internal use
2593
+ */
2594
+ function validateOrigin(messageOrigin) {
2595
+ return getValidOriginsListFromCDN().then((validOriginsList) => {
2596
+ // Check whether the url is in the pre-known allowlist or supplied by user
2597
+ if (!isValidHttpsURL(messageOrigin)) {
2598
+ validateOriginLogger('Origin %s is invalid because it is not using https protocol. Protocol being used: %s', messageOrigin, messageOrigin.protocol);
2599
+ return false;
2600
+ }
2601
+ const messageOriginHost = messageOrigin.host;
2602
+ if (validOriginsList.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {
2603
+ return true;
2604
+ }
2605
+ for (const domainOrPattern of GlobalVars.additionalValidOrigins) {
2606
+ const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;
2607
+ if (validateHostAgainstPattern(pattern, messageOriginHost)) {
2608
+ return true;
2609
+ }
2610
+ }
2611
+ validateOriginLogger('Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o', messageOrigin, validOriginsList, GlobalVars.additionalValidOrigins);
2612
+ return false;
2613
+ });
2614
+ }
2615
+
2521
2616
  ;// CONCATENATED MODULE: ./src/public/authentication.ts
2522
2617
 
2523
2618
 
@@ -3568,6 +3663,7 @@ var menus;
3568
3663
 
3569
3664
 
3570
3665
 
3666
+
3571
3667
  /**
3572
3668
  * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
3573
3669
  */
@@ -3792,6 +3888,7 @@ var app;
3792
3888
  * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
3793
3889
  */
3794
3890
  function initialize(validMessageOrigins) {
3891
+ prefetchOriginsFromCDN();
3795
3892
  return appInitializeHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_Initialize), validMessageOrigins);
3796
3893
  }
3797
3894
  app.initialize = initialize;
@@ -5092,6 +5189,16 @@ function handlers_registerOnResumeHandler(handler) {
5092
5189
  /* eslint-disable @typescript-eslint/ban-types */
5093
5190
  /* eslint-disable @typescript-eslint/no-explicit-any */
5094
5191
  /* eslint-disable strict-null-checks/all */
5192
+ var communication_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
5193
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5194
+ return new (P || (P = Promise))(function (resolve, reject) {
5195
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5196
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
5197
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
5198
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
5199
+ });
5200
+ };
5201
+
5095
5202
 
5096
5203
 
5097
5204
 
@@ -5123,7 +5230,7 @@ CommunicationPrivate.promiseCallbacks = {};
5123
5230
  */
5124
5231
  function initializeCommunication(validMessageOrigins, apiVersionTag) {
5125
5232
  // Listen for messages post to our window
5126
- CommunicationPrivate.messageListener = (evt) => processMessage(evt);
5233
+ CommunicationPrivate.messageListener = (evt) => communication_awaiter(this, void 0, void 0, function* () { return yield processMessage(evt); });
5127
5234
  // If we are in an iframe, our parent window is the one hosting us (i.e., window.parent); otherwise,
5128
5235
  // it's the window that opened us (i.e., window.opener)
5129
5236
  Communication.currentWindow = Communication.currentWindow || ssrSafeWindow();
@@ -5407,29 +5514,33 @@ const processMessageLogger = communicationLogger.extend('processMessage');
5407
5514
  * Limited to Microsoft-internal use
5408
5515
  */
5409
5516
  function processMessage(evt) {
5410
- // Process only if we received a valid message
5411
- if (!evt || !evt.data || typeof evt.data !== 'object') {
5412
- processMessageLogger('Unrecognized message format received by app, message being ignored. Message: %o', evt);
5413
- return;
5414
- }
5415
- // Process only if the message is coming from a different window and a valid origin
5416
- // valid origins are either a pre-known origin or one specified by the app developer
5417
- // in their call to app.initialize
5418
- const messageSource = evt.source || (evt.originalEvent && evt.originalEvent.source);
5419
- const messageOrigin = evt.origin || (evt.originalEvent && evt.originalEvent.origin);
5420
- if (!shouldProcessMessage(messageSource, messageOrigin)) {
5421
- processMessageLogger('Message being ignored by app because it is either coming from the current window or a different window with an invalid origin');
5422
- return;
5423
- }
5424
- // Update our parent and child relationships based on this message
5425
- updateRelationships(messageSource, messageOrigin);
5426
- // Handle the message
5427
- if (messageSource === Communication.parentWindow) {
5428
- handleParentMessage(evt);
5429
- }
5430
- else if (messageSource === Communication.childWindow) {
5431
- handleChildMessage(evt);
5432
- }
5517
+ return communication_awaiter(this, void 0, void 0, function* () {
5518
+ // Process only if we received a valid message
5519
+ if (!evt || !evt.data || typeof evt.data !== 'object') {
5520
+ processMessageLogger('Unrecognized message format received by app, message being ignored. Message: %o', evt);
5521
+ return;
5522
+ }
5523
+ // Process only if the message is coming from a different window and a valid origin
5524
+ // valid origins are either a pre-known origin or one specified by the app developer
5525
+ // in their call to app.initialize
5526
+ const messageSource = evt.source || (evt.originalEvent && evt.originalEvent.source);
5527
+ const messageOrigin = evt.origin || (evt.originalEvent && evt.originalEvent.origin);
5528
+ return shouldProcessMessage(messageSource, messageOrigin).then((result) => {
5529
+ if (!result) {
5530
+ processMessageLogger('Message being ignored by app because it is either coming from the current window or a different window with an invalid origin');
5531
+ return;
5532
+ }
5533
+ // Update our parent and child relationships based on this message
5534
+ updateRelationships(messageSource, messageOrigin);
5535
+ // Handle the message
5536
+ if (messageSource === Communication.parentWindow) {
5537
+ handleParentMessage(evt);
5538
+ }
5539
+ else if (messageSource === Communication.childWindow) {
5540
+ handleChildMessage(evt);
5541
+ }
5542
+ });
5543
+ });
5433
5544
  }
5434
5545
  const shouldProcessMessageLogger = communicationLogger.extend('shouldProcessMessage');
5435
5546
  /**
@@ -5440,25 +5551,27 @@ const shouldProcessMessageLogger = communicationLogger.extend('shouldProcessMess
5440
5551
  * Limited to Microsoft-internal use
5441
5552
  */
5442
5553
  function shouldProcessMessage(messageSource, messageOrigin) {
5443
- // Process if message source is a different window and if origin is either in
5444
- // Teams' pre-known whitelist or supplied as valid origin by user during initialization
5445
- if (Communication.currentWindow && messageSource === Communication.currentWindow) {
5446
- shouldProcessMessageLogger('Should not process message because it is coming from the current window');
5447
- return false;
5448
- }
5449
- else if (Communication.currentWindow &&
5450
- Communication.currentWindow.location &&
5451
- messageOrigin &&
5452
- messageOrigin === Communication.currentWindow.location.origin) {
5453
- return true;
5454
- }
5455
- else {
5456
- const isOriginValid = validateOrigin(new URL(messageOrigin));
5457
- if (!isOriginValid) {
5458
- shouldProcessMessageLogger('Message has an invalid origin of %s', messageOrigin);
5554
+ return communication_awaiter(this, void 0, void 0, function* () {
5555
+ // Process if message source is a different window and if origin is either in
5556
+ // Teams' pre-known whitelist or supplied as valid origin by user during initialization
5557
+ if (Communication.currentWindow && messageSource === Communication.currentWindow) {
5558
+ shouldProcessMessageLogger('Should not process message because it is coming from the current window');
5559
+ return false;
5459
5560
  }
5460
- return isOriginValid;
5461
- }
5561
+ else if (Communication.currentWindow &&
5562
+ Communication.currentWindow.location &&
5563
+ messageOrigin &&
5564
+ messageOrigin === Communication.currentWindow.location.origin) {
5565
+ return true;
5566
+ }
5567
+ else {
5568
+ const isOriginValid = yield validateOrigin(new URL(messageOrigin));
5569
+ if (!isOriginValid) {
5570
+ shouldProcessMessageLogger('Message has an invalid origin of %s', messageOrigin);
5571
+ }
5572
+ return isOriginValid;
5573
+ }
5574
+ });
5462
5575
  }
5463
5576
  /**
5464
5577
  * @internal
@@ -7064,7 +7177,7 @@ var chat;
7064
7177
  })(chat || (chat = {}));
7065
7178
 
7066
7179
  ;// CONCATENATED MODULE: ./src/public/clipboard.ts
7067
- var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
7180
+ var clipboard_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
7068
7181
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7069
7182
  return new (P || (P = Promise))(function (resolve, reject) {
7070
7183
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7104,7 +7217,7 @@ var clipboard;
7104
7217
  * rejects with error stating the reason for failure.
7105
7218
  */
7106
7219
  function write(blob) {
7107
- return __awaiter(this, void 0, void 0, function* () {
7220
+ return clipboard_awaiter(this, void 0, void 0, function* () {
7108
7221
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
7109
7222
  if (!isSupported()) {
7110
7223
  throw errorNotSupportedOnPlatform;
@@ -7129,7 +7242,7 @@ var clipboard;
7129
7242
  * Note: Returned blob type will contain one of the MIME type `image/png`, `text/plain` or `text/html`.
7130
7243
  */
7131
7244
  function read() {
7132
- return __awaiter(this, void 0, void 0, function* () {
7245
+ return clipboard_awaiter(this, void 0, void 0, function* () {
7133
7246
  internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
7134
7247
  if (!isSupported()) {
7135
7248
  throw errorNotSupportedOnPlatform;
@@ -8416,7 +8529,7 @@ var teamsCore;
8416
8529
  /**
8417
8530
  * Registers a handler to be called when the page has been requested to load.
8418
8531
  *
8419
- * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
8532
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/app-caching)
8420
8533
  * for a more detailed explanation about using this API.
8421
8534
  *
8422
8535
  * @param handler - The handler to invoke when the page is loaded.
@@ -8455,7 +8568,7 @@ var teamsCore;
8455
8568
  /**
8456
8569
  * Registers a handler to be called before the page is unloaded.
8457
8570
  *
8458
- * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/build-tabs-for-meeting?tabs=desktop%2Cmeeting-chat-view-desktop%2Cmeeting-stage-view-desktop%2Cchannel-meeting-desktop#app-caching)
8571
+ * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/app-caching)
8459
8572
  * for a more detailed explanation about using this API.
8460
8573
  *
8461
8574
  * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should
@@ -13230,6 +13343,7 @@ var videoEffectsEx_awaiter = (undefined && undefined.__awaiter) || function (thi
13230
13343
  */
13231
13344
  var videoEffectsEx;
13232
13345
  (function (videoEffectsEx) {
13346
+ videoEffectsEx.frameProcessingTimeoutInMs = 2000;
13233
13347
  const videoPerformanceMonitor = inServerSideRenderingEnvironment()
13234
13348
  ? undefined
13235
13349
  : new VideoPerformanceMonitor(sendMessageToParent);
@@ -13284,8 +13398,10 @@ var videoEffectsEx;
13284
13398
  registerHandler('video.newVideoFrame', (videoBufferData) => {
13285
13399
  if (videoBufferData) {
13286
13400
  videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.reportStartFrameProcessing(videoBufferData.width, videoBufferData.height);
13401
+ const clearProcessingTimeout = createFrameProcessingTimeout();
13287
13402
  const timestamp = videoBufferData.timestamp;
13288
13403
  parameters.videoBufferHandler(normalizedVideoBufferData(videoBufferData), () => {
13404
+ clearProcessingTimeout();
13289
13405
  videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.reportFrameProcessed();
13290
13406
  notifyVideoFrameProcessed(timestamp);
13291
13407
  }, notifyError);
@@ -13301,12 +13417,22 @@ var videoEffectsEx;
13301
13417
  }
13302
13418
  }
13303
13419
  videoEffectsEx.registerForVideoFrame = registerForVideoFrame;
13420
+ function createFrameProcessingTimeout() {
13421
+ const frameProcessingTimer = setTimeout(() => {
13422
+ notifyError(`Frame not processed in ${videoEffectsEx.frameProcessingTimeoutInMs}ms`, ErrorLevel.Warn);
13423
+ }, videoEffectsEx.frameProcessingTimeoutInMs);
13424
+ return function clearTimer() {
13425
+ clearTimeout(frameProcessingTimer);
13426
+ };
13427
+ }
13304
13428
  function createMonitoredVideoFrameHandler(videoFrameHandler, videoPerformanceMonitor) {
13305
13429
  return (receivedVideoFrame) => videoEffectsEx_awaiter(this, void 0, void 0, function* () {
13306
13430
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13307
13431
  const originalFrame = receivedVideoFrame.videoFrame;
13308
13432
  videoPerformanceMonitor.reportStartFrameProcessing(originalFrame.codedWidth, originalFrame.codedHeight);
13433
+ const clearProcessingTimeout = createFrameProcessingTimeout();
13309
13434
  const processedFrame = yield videoFrameHandler(receivedVideoFrame);
13435
+ clearProcessingTimeout();
13310
13436
  videoPerformanceMonitor.reportFrameProcessed();
13311
13437
  return processedFrame;
13312
13438
  });