@microsoft/teams-js 2.28.1-beta.0 → 2.29.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/esm/_virtual/__polyfill-node.tty.js +1 -0
- package/dist/esm/_virtual/__polyfill-node.util.js +1 -0
- package/dist/esm/_virtual/_commonjsHelpers.js +1 -0
- package/dist/esm/_virtual/_polyfill-node._inherits.js +1 -0
- package/dist/esm/_virtual/_polyfill-node.buffer.js +1 -0
- package/dist/esm/_virtual/_polyfill-node.global.js +1 -0
- package/dist/esm/_virtual/_polyfill-node.process.js +1 -0
- package/dist/esm/_virtual/_polyfill-node.tty.js +1 -0
- package/dist/esm/_virtual/_polyfill-node.util.js +1 -0
- package/dist/esm/_virtual/browser.js +1 -0
- package/dist/esm/_virtual/index.js +1 -0
- package/dist/esm/_virtual/node.js +1 -0
- package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.22.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js +1 -0
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js +1 -0
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js +1 -0
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/index.js +1 -0
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js +1 -0
- package/dist/esm/node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js +1 -0
- package/dist/esm/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/browser.js +1 -0
- package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/native.js +1 -0
- package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/rng.js +1 -0
- package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js +1 -0
- package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js +1 -0
- package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js +1 -0
- package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -0
- package/dist/esm/packages/teams-js/src/index.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/appIdValidation.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/constants.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/deepLinkConstants.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/globalVars.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/internalAPIs.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/marketplaceUtils.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/mediaUtil.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/messageObjects.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/nestedAppAuthUtils.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/profileUtil.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/telemetry.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/typeCheckUtilities.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/utils.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/uuidObject.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/videoEffectsUtils.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/videoFrameTick.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/videoPerformanceMonitor.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/videoPerformanceStatistics.js +1 -0
- package/dist/esm/packages/teams-js/src/private/appEntity.js +1 -0
- package/dist/esm/packages/teams-js/src/private/conversations.js +1 -0
- package/dist/esm/packages/teams-js/src/private/copilot.js +1 -0
- package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -0
- package/dist/esm/packages/teams-js/src/private/externalAppCardActions.js +1 -0
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForCEA.js +1 -0
- package/dist/esm/packages/teams-js/src/private/externalAppCommands.js +1 -0
- package/dist/esm/packages/teams-js/src/private/files.js +1 -0
- package/dist/esm/packages/teams-js/src/private/hostEntity.js +1 -0
- package/dist/esm/packages/teams-js/src/private/interfaces.js +1 -0
- package/dist/esm/packages/teams-js/src/private/logs.js +1 -0
- package/dist/esm/packages/teams-js/src/private/meetingRoom.js +1 -0
- package/dist/esm/packages/teams-js/src/private/messageChannels.js +1 -0
- package/dist/esm/packages/teams-js/src/private/notifications.js +1 -0
- package/dist/esm/packages/teams-js/src/private/otherAppStateChange.js +1 -0
- package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -0
- package/dist/esm/packages/teams-js/src/private/remoteCamera.js +1 -0
- package/dist/esm/packages/teams-js/src/private/teams.js +1 -0
- package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -0
- package/dist/esm/packages/teams-js/src/public/adaptiveCards.js +1 -0
- package/dist/esm/packages/teams-js/src/public/app.js +1 -0
- package/dist/esm/packages/teams-js/src/public/appId.js +1 -0
- package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -0
- package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -0
- package/dist/esm/packages/teams-js/src/public/appWindow.js +1 -0
- package/dist/esm/packages/teams-js/src/public/authentication.js +1 -0
- package/dist/esm/packages/teams-js/src/public/barCode.js +1 -0
- package/dist/esm/packages/teams-js/src/public/calendar.js +1 -0
- package/dist/esm/packages/teams-js/src/public/call.js +1 -0
- package/dist/esm/packages/teams-js/src/public/chat.js +1 -0
- package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -0
- package/dist/esm/packages/teams-js/src/public/constants.js +1 -0
- package/dist/esm/packages/teams-js/src/public/dialog.js +1 -0
- package/dist/esm/packages/teams-js/src/public/geoLocation.js +1 -0
- package/dist/esm/packages/teams-js/src/public/interfaces.js +1 -0
- package/dist/esm/packages/teams-js/src/public/liveShareHost.js +1 -0
- package/dist/esm/packages/teams-js/src/public/location.js +1 -0
- package/dist/esm/packages/teams-js/src/public/mail.js +1 -0
- package/dist/esm/packages/teams-js/src/public/marketplace.js +1 -0
- package/dist/esm/packages/teams-js/src/public/media.js +1 -0
- package/dist/esm/packages/teams-js/src/public/meeting.js +1 -0
- package/dist/esm/packages/teams-js/src/public/menus.js +1 -0
- package/dist/esm/packages/teams-js/src/public/monetization.js +1 -0
- package/dist/esm/packages/teams-js/src/public/navigation.js +1 -0
- package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -0
- package/dist/esm/packages/teams-js/src/public/pages.js +1 -0
- package/dist/esm/packages/teams-js/src/public/people.js +1 -0
- package/dist/esm/packages/teams-js/src/public/profile.js +1 -0
- package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -0
- package/dist/esm/packages/teams-js/src/public/runtime.js +1 -0
- package/dist/esm/packages/teams-js/src/public/search.js +1 -0
- package/dist/esm/packages/teams-js/src/public/secondaryBrowser.js +1 -0
- package/dist/esm/packages/teams-js/src/public/settings.js +1 -0
- package/dist/esm/packages/teams-js/src/public/sharing.js +1 -0
- package/dist/esm/packages/teams-js/src/public/stageView.js +1 -0
- package/dist/esm/packages/teams-js/src/public/tasks.js +1 -0
- package/dist/esm/packages/teams-js/src/public/teamsAPIs.js +1 -0
- package/dist/esm/packages/teams-js/src/public/thirdPartyCloudStorage.js +1 -0
- package/dist/esm/packages/teams-js/src/public/version.js +1 -0
- package/dist/esm/packages/teams-js/src/public/videoEffects.js +1 -0
- package/dist/esm/packages/teams-js/src/public/visualMedia.js +1 -0
- package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -0
- package/dist/{MicrosoftTeams.d.ts → umd/MicrosoftTeams.d.ts} +155 -45
- package/dist/{MicrosoftTeams.js → umd/MicrosoftTeams.js} +1048 -913
- package/dist/umd/MicrosoftTeams.js.map +1 -0
- package/dist/umd/MicrosoftTeams.min.js +2 -0
- package/dist/umd/MicrosoftTeams.min.js.map +1 -0
- package/package.json +1 -1
- package/dist/MicrosoftTeams.js.map +0 -1
- package/dist/MicrosoftTeams.min.js +0 -2
- package/dist/MicrosoftTeams.min.js.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"MicrosoftTeams.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;ACVY;;AAEZ,kBAAkB;AAClB,mBAAmB;AACnB,qBAAqB;;AAErB;AACA;AACA;;AAEA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C,UAAU;AACrD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;ACrJA;;AAEA;AACA;AACA;;AAEA,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf,eAAe;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4CAA4C;;AAEvD;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,GAAU;;AAEnC,OAAO,YAAY;;AAEnB;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;AC3QA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAO,CAAC,GAAI;AACpC;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA,kBAAkB,sBAAsB;AACxC;AACA,cAAc;AACd;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI;AACJ;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc,SAAS;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;;AAEA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;ACjRA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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GAAG,KAAK,CAAC;AAC5B,iCAAsB,GAAa,EAAE,CAAC;AACtC,4BAAiB,GAA8B,SAAS,CAAC;AACzD,4BAAiB,GAAG,KAAK,CAAC;AAC1B,uBAAY,GAA8B,SAAS,CAAC;AACpD,yBAAc,GAAuB,SAAS,CAAC;AAE/C,iCAAsB,GAAG,KAAK,CAAC;;;;;ACVhB;;AAE/B;AAC6B;;AAE7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sEAAsE;AACtE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS,qBAAkB;AAC3B;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0DAA0D;AAC1D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,uBAAoB;AAC/B,IAAI;AACJ,WAAW,uBAAoB;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AC31BA;AACA,yDAAe;AACf;AACA,CAAC;;ACHD;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;ACjBqC;AACrC;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB,SAAS;AACzB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,4DAAe,yDAAS;;AChCS;AACN;AACsB;;AAEjD;AACA,MAAM,kBAAM;AACZ,WAAW,kBAAM;AACjB;;AAEA;AACA,iDAAiD,GAAG,KAAK;;A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;;;;;;;OAUG;IACH,SAAgB,WAAW;QACzB,OAAO,iBAAiB,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAClF,CAAC;IAFe,sBAAW,cAE1B;AACH,CAAC,EApUgB,UAAU,KAAV,UAAU,QAoU1B;;;ACxV6B;AAWR;AAQC;AACyB;AACZ;AACoC;AACN;AACN;AAC5B;AACY;AACQ;AACJ;AACY;AACd;AACN;AACR;AACkB;AACR;;;AClCV;AACD","sources":["webpack://microsoftTeams/webpack/universalModuleDefinition","webpack://microsoftTeams/../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js","webpack://microsoftTeams/../../node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js","webpack://microsoftTeams/../../node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js","webpack://microsoftTeams/../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js","webpack://microsoftTeams/webpack/bootstrap","webpack://microsoftTeams/webpack/runtime/create fake namespace object","webpack://microsoftTeams/webpack/runtime/define property getters","webpack://microsoftTeams/webpack/runtime/hasOwnProperty shorthand","webpack://microsoftTeams/webpack/runtime/make namespace object","webpack://microsoftTeams/./src/internal/telemetry.ts","webpack://microsoftTeams/./src/internal/constants.ts","webpack://microsoftTeams/./src/internal/globalVars.ts","webpack://microsoftTeams/../../node_modules/.pnpm/skeleton-buffer@file+skeleton-buffer/node_modules/skeleton-buffer/index.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/native.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/rng.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/stringify.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/regex.js","webpack://microsoftTeams/../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js","webpack://microsoftTeams/./src/public/interfaces.ts","webpack://microsoftTeams/./src/public/constants.ts","webpack://microsoftTeams/./src/internal/utils.ts","webpack://microsoftTeams/./src/public/runtime.ts","webpack://microsoftTeams/./src/public/version.ts","webpack://microsoftTeams/./src/internal/internalAPIs.ts","webpack://microsoftTeams/./src/internal/typeCheckUtilities.ts","webpack://microsoftTeams/./src/internal/validOrigins.ts","webpack://microsoftTeams/./src/private/messageChannels.ts","webpack://microsoftTeams/./src/public/authentication.ts","webpack://microsoftTeams/./src/public/dialog.ts","webpack://microsoftTeams/./src/public/menus.ts","webpack://microsoftTeams/./src/public/app.ts","webpack://microsoftTeams/./src/public/pages.ts","webpack://microsoftTeams/./src/internal/handlers.ts","webpack://microsoftTeams/./src/internal/uuidObject.ts","webpack://microsoftTeams/./src/internal/messageObjects.ts","webpack://microsoftTeams/./src/internal/nestedAppAuthUtils.ts","webpack://microsoftTeams/./src/internal/communication.ts","webpack://microsoftTeams/./src/private/logs.ts","webpack://microsoftTeams/./src/private/interfaces.ts","webpack://microsoftTeams/./src/private/privateAPIs.ts","webpack://microsoftTeams/./src/private/conversations.ts","webpack://microsoftTeams/./src/private/copilot.ts","webpack://microsoftTeams/./src/private/externalAppAuthentication.ts","webpack://microsoftTeams/./src/private/externalAppCardActions.ts","webpack://microsoftTeams/./src/private/externalAppCommands.ts","webpack://microsoftTeams/./src/private/files.ts","webpack://microsoftTeams/./src/private/meetingRoom.ts","webpack://microsoftTeams/./src/private/notifications.ts","webpack://microsoftTeams/./src/private/otherAppStateChange.ts","webpack://microsoftTeams/./src/private/remoteCamera.ts","webpack://microsoftTeams/./src/private/appEntity.ts","webpack://microsoftTeams/./src/private/teams.ts","webpack://microsoftTeams/./src/internal/videoFrameTick.ts","webpack://microsoftTeams/./src/internal/videoPerformanceStatistics.ts","webpack://microsoftTeams/./src/internal/videoPerformanceMonitor.ts","webpack://microsoftTeams/./src/public/videoEffects.ts","webpack://microsoftTeams/./src/internal/videoEffectsUtils.ts","webpack://microsoftTeams/./src/private/videoEffectsEx.ts","webpack://microsoftTeams/./src/internal/appIdValidation.ts","webpack://microsoftTeams/./src/public/appId.ts","webpack://microsoftTeams/./src/internal/deepLinkConstants.ts","webpack://microsoftTeams/./src/internal/deepLinkUtilities.ts","webpack://microsoftTeams/./src/public/appInstallDialog.ts","webpack://microsoftTeams/./src/public/media.ts","webpack://microsoftTeams/./src/internal/mediaUtil.ts","webpack://microsoftTeams/./src/public/barCode.ts","webpack://microsoftTeams/./src/public/chat.ts","webpack://microsoftTeams/./src/public/clipboard.ts","webpack://microsoftTeams/./src/public/nestedAppAuth.ts","webpack://microsoftTeams/./src/public/geoLocation.ts","webpack://microsoftTeams/./src/public/adaptiveCards.ts","webpack://microsoftTeams/./src/public/appWindow.ts","webpack://microsoftTeams/./src/public/secondaryBrowser.ts","webpack://microsoftTeams/./src/public/location.ts","webpack://microsoftTeams/./src/public/meeting.ts","webpack://microsoftTeams/./src/public/monetization.ts","webpack://microsoftTeams/./src/public/calendar.ts","webpack://microsoftTeams/./src/public/mail.ts","webpack://microsoftTeams/./src/public/teamsAPIs.ts","webpack://microsoftTeams/./src/public/people.ts","webpack://microsoftTeams/./src/internal/profileUtil.ts","webpack://microsoftTeams/./src/public/profile.ts","webpack://microsoftTeams/./src/public/search.ts","webpack://microsoftTeams/./src/public/sharing.ts","webpack://microsoftTeams/./src/public/stageView.ts","webpack://microsoftTeams/./src/public/visualMedia.ts","webpack://microsoftTeams/./src/public/webStorage.ts","webpack://microsoftTeams/./src/public/call.ts","webpack://microsoftTeams/./src/public/appInitialization.ts","webpack://microsoftTeams/./src/public/thirdPartyCloudStorage.ts","webpack://microsoftTeams/./src/public/publicAPIs.ts","webpack://microsoftTeams/./src/public/navigation.ts","webpack://microsoftTeams/./src/public/settings.ts","webpack://microsoftTeams/./src/public/tasks.ts","webpack://microsoftTeams/./src/public/liveShareHost.ts","webpack://microsoftTeams/./src/internal/marketplaceUtils.ts","webpack://microsoftTeams/./src/public/marketplace.ts","webpack://microsoftTeams/./src/public/index.ts","webpack://microsoftTeams/./src/private/hostEntity.ts","webpack://microsoftTeams/./src/private/index.ts","webpack://microsoftTeams/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"microsoftTeams\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"microsoftTeams\"] = factory();\n\telse\n\t\troot[\"microsoftTeams\"] = factory();\n})(typeof self !== 'undefined' ? self : this, () => {\nreturn ","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { debug as registerLogger, Debugger } from 'debug';\n\nconst topLevelLogger = registerLogger('teamsJs');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace\n */\nexport function getLogger(namespace: string): Debugger {\n return topLevelLogger.extend(namespace);\n}\n\n/**\n * @hidden\n * Creates a string tag for labeling apiVersionTag, which is used for API function call to create message request\n * sent to host(s).\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function getApiVersionTag(apiVersionNumber: ApiVersionNumber, functionName: ApiName): string {\n return `${apiVersionNumber}_${functionName}`;\n}\n\n/**\n * @hidden\n * Check if apiVersionTag developer sends follows the pattern starting with a lowercase 'v', then\n * followed by one or more digits, then concatenated with underscore and some characters to indicate api name.\n * For example, 'v2_app.getContext'. If yes, return true. Otherwise, return false.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isFollowingApiVersionTagFormat(apiVersionTag: string): boolean {\n const pattern = /^v\\d+_[\\w.]+$/;\n return pattern.test(apiVersionTag);\n}\n\n/**\n * Use enum to set or update API version number\n * v3 will be used for next beta version of APIs if they have used v2\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const enum ApiVersionNumber {\n V_1 = 'v1',\n V_2 = 'v2',\n V_3 = 'v3',\n}\n\nexport const enum ApiName {\n App_GetContext = 'app.getContext',\n App_Initialize = 'app.initialize',\n App_NotifyAppLoaded = 'app.notifyAppLoaded',\n App_NotifyExpectedFailure = 'app.notifyExpectedFailure',\n App_NotifyFailure = 'app.notifyFailure',\n App_NotifySuccess = 'app.notifySuccess',\n App_OpenLink = 'app.openLink',\n App_RegisterOnThemeChangeHandler = 'app.registerOnThemeChangeHandler',\n AppInitialization_NotifyAppLoaded = 'appInitialization.notifyAppLoaded',\n AppInitialization_NotifyExpectedFailure = 'appInitialization.notifyExpectedFailure',\n AppInitialization_NotifyFailure = 'appInitialization.notifyFailure',\n AppInitialization_NotifySuccess = 'appInitialization.notifySuccess',\n AppEntity_SelectAppEntity = 'appEntity.selectAppEntity',\n AppInstallDialog_OpenAppInstallDialog = 'appInstallDialog.openAppInstallDialog',\n AppWindow_ChildAppWindow_AddEventListener = 'appWindow.childAppWindow.addEventListener',\n AppWindow_ChildAppWindow_PostMessage = 'appWindow.childAppWindow.postMessage',\n AppWindow_ParentAppWindow_AddEventListener = 'appWindow.parentAppWindow.addEventListener',\n AppWindow_ParentAppWindow_PostMessage = 'appWindow.parentAppWindow.postMessage',\n Authentication_AuthenticationWindow_RegisterInitializeHandler = 'authentication.authenticationWindow.registerInitializeHandler',\n Authentication_AuthenticationWindow_RegisterNavigateCrossDomainHandler = 'authentication.authenticationWindow.registerNavigateCrossDomainHandler',\n Authentication_Authenticate = 'authentication.authenticate',\n Authentication_GetAuthToken = 'authentication.getAuthToken',\n Authentication_GetUser = 'authentication.getUser',\n Authentication_NotifyFailure = 'authentication.notifyFailure',\n Authentication_NotifySuccess = 'authentication.notifySuccess',\n Authentication_RegisterAuthenticateFailureHandler = 'authentication.registerAuthenticateFailureHandler',\n Authentication_RegisterAuthenticateSuccessHandler = 'authentication.registerAuthenticateSuccessHandler',\n BarCode_HasPermission = 'barCode.hasPermission',\n BarCode_RequestPermission = 'barCode.requestPermission',\n BarCode_ScanBarCode = 'barCode.scanBarCode',\n Calendar_ComposeMeeting = 'calendar.composeMeeting',\n Calendar_OpenCalendarItem = 'calendar.openCalendarItem',\n Meeting_JoinMeeting = 'meeting.joinMeeting',\n Call_StartCall = 'call.startCall',\n Chat_OpenChat = 'chat.openChat',\n Chat_OpenGroupChat = 'chat.openGroupChat',\n Clipboard_Read = 'clipboard.read',\n Clipboard_Write = 'clipboard.write',\n Conversations_CloseConversation = 'conversations.closeConversation',\n Conversations_GetChatMember = 'conversations.getChatMember',\n Conversations_OpenConversation = 'conversations.openConversation',\n Conversations_RegisterCloseConversationHandler = 'conversations.registerCloseConversationHandler',\n Conversations_RegisterStartConversationHandler = 'conversations.registerStartConversationHandler',\n Dialog_AdaptiveCard_Bot_Open = 'dialog.adaptiveCard.bot.open',\n Dialog_AdaptiveCard_Open = 'dialog.adaptiveCard.open',\n Dialog_RegisterMessageForChildHandler = 'dialog.registerMessageForChildHandler',\n Dialog_Update_Resize = 'dialog.update.resize',\n Dialog_Url_Bot_Open = 'dialog.url.bot.open',\n Dialog_Url_Bot_RegisterMessageForParentHandler = 'dialog.url.bot.registerMessageForParentHandler',\n Dialog_Url_Open = 'dialog.url.open',\n Dialog_Url_RegisterMessageForParentHandler = 'dialog.url.registerMessageForParentHandler',\n Dialog_Url_Submit = 'dialog.url.submit',\n Dialog_Url_ParentCommunication_RegisterMessageForChildHandler = 'dialog.url.parentCommunication.registerMessageForChildHandler',\n Dialog_Url_ParentCommunication_SendMessageToParentFromDialog = 'dialog.url.parentCommunication.sendMessageToParentFromDialog',\n Dialog_Url_ParentCommunication_SendMessageToDialog = 'dialog.url.parentCommunication.sendMessageToDialog',\n ExternalAppAuthentication_AuthenticateAndResendRequest = 'externalAppAuthentication.authenticateAndResendRequest',\n ExternalAppAuthentication_AuthenticateWithSSO = 'externalAppAuthentication.authenticateWithSSO',\n ExternalAppAuthentication_AuthenticateWithSSOAndResendRequest = 'externalAppAuthentication.authenticateWithSSOAndResendRequest',\n ExternalAppAuthentication_AuthenticateWithOauth2 = 'externalAppAuthentication.authenticateWithOauth2',\n ExternalAppAuthentication_AuthenticateWithPowerPlatformConnectorPlugins = 'externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins',\n ExternalAppCardActions_ProcessActionOpenUrl = 'externalAppCardActions.processActionOpenUrl',\n ExternalAppCardActions_ProcessActionSubmit = 'externalAppCardActions.processActionSubmit',\n ExternalAppCommands_ProcessActionCommands = 'externalAppCommands.processActionCommand',\n Files_AddCloudStorageFolder = 'files.addCloudStorageFolder',\n Files_AddCloudStorageProvider = 'files.addCloudStorageProvider',\n Files_AddCloudStorageProviderFile = 'files.addCloudStorageProviderFile',\n Files_CopyMoveFiles = 'files.copyMoveFiles',\n Files_DeleteCloudStorageFolder = 'files.deleteCloudStorageFolder',\n Files_DeleteCloudStorageProviderFile = 'files.deleteCloudStorageProviderFile',\n Files_DownloadCloudStorageProviderFile = 'files.downloadCloudStorageProviderFile',\n Files_GetCloudStorageFolderContents = 'files.getCloudStorageFolderContents',\n Files_GetCloudStorageFolders = 'files.getCloudStorageFolders',\n Files_GetExternalProviders = 'files.getExternalProviders',\n Files_GetFileDownloads = 'files.getFileDownloads',\n Files_OpenCloudStorageFile = 'files.openCloudStorageFile',\n Files_OpenDownloadFolder = 'files.openDownloadFolder',\n Files_RegisterCloudStorageProviderContentChangeHandler = 'files.registerCloudStorageProviderContentChangeHandler',\n Files_RegisterCloudStorageProviderListChangeHandler = 'files.registerCloudStorageProviderListChangeHandler',\n Files_RemoveCloudStorageProvider = 'files.removeCloudStorageProvider',\n Files_RenameCloudStorageProviderFile = 'files.renameCloudStorageProviderFile',\n Files_UploadCloudStorageProviderFile = 'files.uploadCloudStorageProviderFile',\n GeoLocation_GetCurrentLocation = 'geoLocation.getCurrentLocation',\n GeoLocation_HasPermission = 'geoLocation.hasPermission',\n GeoLocation_Map_ChooseLocation = 'geoLocation.map.chooseLocation',\n GeoLocation_RequestPermission = 'geoLocation.requestPermission',\n GeoLocation_ShowLocation = 'geoLocation.showLocation',\n HandleBeforeUnload = 'handleBeforeUnload',\n HostEntity_Tab_addAndConfigureApp = 'hostEntity.tab.addAndConfigure',\n HostEntity_Tab_reconfigure = 'hostEntity.tab.reconfigure',\n HostEntity_Tab_rename = 'hostEntity.tab.rename',\n HostEntity_Tab_remove = 'hostEntity.tab.remove',\n HostEntity_Tab_getAll = 'hostEntity.tab.getAll',\n Interactive_GetClientInfo = 'interactive.getClientInfo',\n Interactive_GetClientRoles = 'interactive.getClientRoles',\n Interactive_GetFluidContainerId = 'interactive.getFluidContainerId',\n Interactive_GetFluidTenantInfo = 'interactive.getFluidTenantInfo',\n Interactive_GetFluidToken = 'interactive.getFluidToken',\n Interactive_GetNtpTime = 'interactive.getNtpTime',\n Interactive_RegisterClientId = 'interactive.registerClientId',\n Interactive_SetFluidContainerId = 'interactive.setFluidContainerId',\n Location_GetLocation = 'location.getLocation',\n Location_ShowLocation = 'location.showLocation',\n Logs_Receive = 'log.receive',\n Logs_RegisterLogRequestHandler = 'log.request',\n Mail_ComposeMail = 'mail.composeMail',\n Mail_OpenMailItem = 'mail.openMailItem',\n Marketplace_AddOrUpdateCartItems = 'marketplace.addOrUpdateCartItems',\n Marketplace_GetCart = 'marketplace.getCart',\n Marketplace_RemoveCardItems = 'marketplace.removeCartItems',\n Marketplace_UpdateCartStatus = 'marketplace.updateCartStatus',\n Media_CaptureImage = 'media.captureImage',\n Media_Controller = 'media.controller',\n Media_GetMedia = 'media.getMedia',\n Media_HasPermission = 'media.hasPermission',\n Media_RegisterGetMediaRequestHandler = 'media.registerGetMediaRequestHandler',\n Media_RequestPermission = 'media.requestPermission',\n Media_ScanBarCode = 'media.scanBarCode',\n Media_SelectMedia = 'media.selectMedia',\n Media_ViewImages = 'media.viewImages',\n Meeting_AppShareButton_SetOptions = 'meeting.appShareButton.setOptions',\n Meeting_GetAppContentStageSharingCapabilities = 'meeting.getAppContentStageSharingCapabilities',\n Meeting_GetAppContentStageSharingState = 'meeting.getAppContentStageSharingState',\n Meeting_GetAuthenticationTokenForAnonymousUser = 'meeting.getAuthenticationTokenForAnonymousUser',\n Meeting_GetIncomingClientAudioState = 'meeting.getIncomingClientAudioState',\n Meeting_GetLiveStreamState = 'meeting.getLiveStreamState',\n Meeting_GetMeetingDetails = 'meeting.getMeetingDetails',\n Meeting_GetMeetingDetailsVerbose = 'meeting.getMeetingDetailsVerbose',\n Meeting_RegisterAudioDeviceSelectionChangedHandler = 'meeting.registerAudioDeviceSelectionChangedHandler',\n Meeting_RegisterLiveStreamChangedHandler = 'meeting.registerLiveStreamChangedHandler',\n Meeting_RegisterMeetingReactionReceivedHandler = 'meeting.registerMeetingReactionReceivedHandler',\n Meeting_RegisterMicStateChangeHandler = 'meeting.registerMicStateChangeHandler',\n Meeting_RegisterRaiseHandStateChangedHandler = 'meeting.registerRaiseHandStateChangedHandler',\n Meeting_RegisterSpeakingStateChangeHandler = 'meeting.registerSpeakingStateChangeHandler',\n Meeting_RequestAppAudioHandling = 'meeting.requestAppAudioHandling',\n Meeting_RequestStartLiveStreaming = 'meeting.requestStartLiveStreaming',\n Meeting_RequestStopLiveStreaming = 'meeting.requestStopLiveStreaming',\n Meeting_SetMicStateWithReason = 'meeting.setMicStateWithReason',\n Meeting_ShareAppContentToStage = 'meeting.shareAppContentToStage',\n Meeting_StopSharingAppContentToStage = 'meeting.stopSharingAppContentToStage',\n Meeting_ToggleIncomingClientAudio = 'meeting.toggleIncomingClientAudio',\n MeetingRoom_GetPairedMeetingRoomInfo = 'meetingRoom.getPairedMeetingRoomInfo',\n MeetingRoom_RegisterMeetingRoomCapabilitiesUpdateHandler = 'meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler',\n MeetingRoom_RegisterMeetingRoomStatesUpdateHandler = 'meetingRoom.registerMeetingRoomStatesUpdateHandler',\n MeetingRoom_SendCommandToPairedMeetingRoom = 'meetingRoom.sendCommandToPairedMeetingRoom',\n Menus_HandleActionMenuItemPress = 'menus.handleActionMenuItemPress',\n Menus_HandleNavBarMenuItemPress = 'menus.handleNavBarMenuItemPress',\n Menus_HandleViewConfigItemPress = 'menus.handleViewConfigItemPress',\n Menus_RegisterActionMenuItemPressHandler = 'menus.registerActionMenuItemPressHandler',\n Menus_RegisterNavBarMenuItemPressHandler = 'menus.registerNavBarMenuItemPressHandler',\n Menus_RegisterSetModuleViewHandler = 'menus.registerSetModuleViewHandler',\n Menus_SetNavBarMenu = 'menus.setNavBarMenu',\n Menus_SetUpViews = 'menus.setUpViews',\n Menus_ShowActionMenu = 'menus.showActionMenu',\n MessageChannels_Telemetry_GetTelemetryPort = 'messageChannels.telemetry.getTelemetryPort',\n MessageChannels_DataLayer_GetDataLayerPort = 'messageChannels.dataLayer.getDataLayerPort',\n Monetization_OpenPurchaseExperience = 'monetization.openPurchaseExperience',\n Navigation_NavigateBack = 'navigation.navigateBack',\n Navigation_NavigateCrossDomain = 'navigation.navigateCrossDomain',\n Navigation_NavigateToTab = 'navigation.navigateToTab',\n Navigation_ReturnFocus = 'navigation.returnFocus',\n Notifications_ShowNotification = 'notifications.showNotification',\n OtherAppStateChange_Install = 'otherApp.install',\n OtherAppStateChange_UnregisterInstall = 'otherApp.unregisterInstall',\n Pages_AppButton_OnClick = 'pages.appButton.onClick',\n Pages_AppButton_OnHoverEnter = 'pages.appButton.onHoverEnter',\n Pages_AppButton_OnHoverLeave = 'pages.appButton.onHoverLeave',\n Pages_BackStack_NavigateBack = 'pages.backStack.navigateBack',\n Pages_BackStack_RegisterBackButtonHandler = 'pages.backStack.registerBackButtonHandler',\n Pages_BackStack_RegisterBackButtonPressHandler = 'pages.backStack.registerBackButtonPressHandler',\n Pages_Config_RegisterChangeConfigHandler = 'pages.config.registerChangeConfigHandler',\n Pages_Config_RegisterOnRemoveHandler = 'pages.config.registerOnRemoveHandler',\n Pages_Config_RegisterOnSaveHandler = 'pages.config.registerOnSaveHandler',\n Pages_Config_RegisterSettingsRemoveHandler = 'pages.config.registerSettingsRemoveHandler',\n Pages_Config_RegisterSettingsSaveHandler = 'pages.config.registerSettingsSaveHandler',\n Pages_Config_SetConfig = 'pages.config.setConfig',\n Pages_Config_SetValidityState = 'pages.config.setValidityState',\n Pages_CurrentApp_NavigateTo = 'pages.currentApp.navigateTo',\n Pages_CurrentApp_NavigateToDefaultPage = 'pages.currentApp.navigateToDefaultPage',\n Pages_InitializeWithFrameContext = 'pages.initializeWithFrameContext',\n Pages_FullTrust_EnterFullscreen = 'pages.fullTrust.enterFullscreen',\n Pages_FullTrust_ExitFullscreen = 'pages.fullTrust.exitFullscreen',\n Pages_GetConfig = 'pages.getConfig.',\n Pages_NavigateCrossDomain = 'pages.navigateCrossDomain',\n Pages_NavigateToApp = 'pages.navigateToApp',\n Pages_RegisterFocusEnterHandler = 'pages.registerFocusEnterHandler',\n Pages_RegisterFullScreenHandler = 'pages.registerFullScreenHandler',\n Pages_RemoveEvent_NotifyFailure = 'pages.removeEvent.notifyFailure',\n Pages_RemoveEvent_NotifySuccess = 'pages.removeEvent.notifySuccess',\n Pages_ReturnFocus = 'pages.returnFocus',\n Pages_SaveEvent_NotifyFailure = 'pages.saveEvent.notifyFailure',\n Pages_SaveEvent_NotifySuccess = 'pages.saveEvent.notifySuccess',\n Pages_SetCurrentFrame = 'pages.setCurrentFrame',\n Pages_ShareDeepLink = 'pages.shareDeepLink',\n Pages_Tabs_GetMruTabInstances = 'pages.tabs.getMruTabInstances',\n Pages_Tabs_GetTabInstances = 'pages.tabs.getTabInstances',\n Pages_Tabs_NavigateToTab = 'pages.tabs.navigateToTab',\n People_SelectPeople = 'people.selectPeople',\n PrivateAPIs_OpenFilePreview = 'openFilePreview',\n PrivateAPIs_RegisterCustomHandler = 'registerCustomHandler',\n PrivateAPIs_RegisterUserSettingsChangeHandler = 'registerUserSettingsChangeHandler',\n PrivateAPIs_SendCustomMessage = 'sendCustomMessage',\n PrivateAPIs_UploadCustomApp = 'uploadCustomApp',\n Profile_ShowProfile = 'profile.showProfile',\n PublicAPIs_ExecuteDeepLink = 'executeDeepLink',\n PublicAPIs_GetContext = 'getContext',\n PublicAPIs_GetMruTabInstances = 'getMruTabInstances',\n PublicAPIs_GetTabInstances = 'getTabInstances',\n PublicAPIs_Initialize = 'initialize',\n PublicAPIs_InitializeWithFrameContext = 'initializeWithFrameContext',\n PublicAPIs_RegisterAppButtonClickHandler = 'registerAppButtonClickHandler',\n PublicAPIs_RegisterAppButtonHoverEnterHandler = 'registerAppButtonHoverEnterHandler',\n PublicAPIs_RegisterAppButtonHoverLeaveHandler = 'registerAppButtonHoverLeaveHandler',\n PublicAPIs_RegisterBackButtonHandler = 'registerBackButtonHandler',\n PublicAPIs_RegisterBeforeUnloadHandler = 'registerBeforeUnloadHandler',\n PublicAPIs_RegisterChangeSettingsHandler = 'registerChangeSettingsHandler',\n PublicAPIs_RegisterFocusEnterHandler = 'registerFocusEnterHandler',\n PublicAPIs_RegisterFullScreenHandler = 'registerFullScreenHandler',\n PublicAPIs_RegisterOnLoadHandler = 'registerOnLoadHandler',\n PublicAPIs_RegisterOnThemeChangeHandlerHelper = 'registerOnThemeChangeHandlerHelper',\n PublicAPIs_SetFrameContext = 'setFrameContext',\n PublicAPIs_ShareDeepLink = 'shareDeepLink',\n RegisterBeforeSuspendOrTerminateHandler = 'registerBeforeSuspendOrTerminateHandler',\n RegisterHandler = 'registerHandler',\n RegisterOnResumeHandler = 'registerOnResumeHandler',\n RegisterOnThemeChangeHandler = 'registerOnThemeChangeHandler',\n RemoteCamera_GetCapableParticipants = 'remoteCamera.getCapableParticipants',\n RemoteCamera_RegisterOnCapableParticipantsChangeHandler = 'remoteCamera.registerOnCapableParticipantsChangeHandler',\n RemoteCamera_RegisterOnDeviceStateChangeHandler = 'remoteCamera.registerOnDeviceStateChangeHandler',\n RemoteCamera_RegisterOnErrorHandler = 'remoteCamera.registerOnErrorHandler',\n RemoteCamera_RegisterOnSessionStatusChangeHandler = 'remoteCamera.registerOnSessionStatusChangeHandler',\n RemoteCamera_RequestControl = 'remoteCamera.requestControl',\n RemoteCamera_SendControlCommand = 'remoteCamera.sendControlCommand',\n RemoteCamera_TerminateSession = 'remoteCamera.terminateSession',\n Search_CloseSearch = 'search.closeSearch',\n Search_RegisterOnChangeHandler = 'search.registerOnChangeHandler',\n Search_RegisterOnClosedHandler = 'search.registerOnClosedHandler',\n Search_RegisterOnExecutedHandler = 'search.registerOnExecutedHandler',\n Search_UnregisterHandlers = 'search.unregisterHandlers',\n SecondaryBrowser_OpenUrl = 'secondaryBrowser.openUrl',\n Settings_GetSettings = 'settings.getSettings',\n Settings_RegisterOnRemoveHandler = 'settings.registerOnRemoveHandler',\n Settings_RegisterOnSaveHandler = 'settings.registerOnSaveHandler',\n Settings_Remove_Failure = 'settings.remove.failure',\n Settings_Remove_Success = 'settings.remove.success',\n Settings_Save_Failure = 'settings.save.failure',\n Settings_Save_Success = 'settings.save.success',\n Settings_SetSettings = 'settings.setSettings',\n Settings_SetValidityState = 'settings.setValidityState',\n Sharing_History_GetContent = 'sharing.history.getContent',\n Sharing_ShareWebContent = 'sharing.shareWebContent',\n StageView_Open = 'stageView.open',\n StageView_Self_Close = 'stageView.self.close',\n Tasks_StartTask = 'tasks.startTask',\n Tasks_SubmitTask = 'tasks.submitTask',\n Tasks_UpdateTask = 'tasks.updateTask',\n Teams_FullTrust_GetConfigSetting = 'teams.fullTrust.getConfigSetting',\n Teams_FullTrust_JoinedTeams_GetUserJoinedTeams = 'teams.fullTrust.joinedTeams.getUserJoinedTeams',\n Teams_GetTeamChannels = 'teams.getTeamChannels',\n Teams_RefreshSiteUrl = 'teams.refreshSiteUrl',\n TeamsAPIs_RegisterBeforeUnloadHandler = 'teamsAPIs_registerBeforeUnloadHandler',\n TeamsAPIs_RegisterOnLoadHandler = 'teamsAPIs_registerOnLoadHandler',\n ThirdPartyCloudStorage_GetDragAndDropFiles = 'thirdPartyCloudStorage.getDragAndDropFiles',\n VideoEffects_MediaStream_RegisterForVideoFrame = 'videoEffects.mediaStream.registerForVideoFrame',\n VideoEffects_NotifySelectedVideoEffectChanged = 'videoEffects.notifySelectedVideoEffectChanged',\n VideoEffects_NotifyError = 'videoEffects.notifyError',\n VideoEffects_NotifyVideoFrameProcessed = 'videoEffects.notifyVideoFrameProcessed',\n VideoEffects_RegisterEffectParameterChangeHandler = 'videoEffects.registerEffectParameterChangeHandler',\n VideoEffects_RegisterForVideoEffect = 'videoEffects.registerForVideoEffect',\n VideoEffects_RegisterForVideoFrame = 'videoEffects.registerForVideoFrame',\n VideoEffects_RegisterSetFrameProcessTimeLimitHandler = 'videoEffects.setFrameProcessTimeLimitHandler',\n VideoEffects_RegisterStartVideoExtensibilityVideoStreamHandler = 'videoEffects.startVideoExtensibilityVideoStreamHandler',\n VideoEffects_RegisterForVideoBufferHandler = 'videoEffects.registerForVideoBufferHandler',\n VideoEffectsEx_MediaStream_RegisterForVideoFrame = 'videoEffectsEX.mediaStream.registerForVideoFrame',\n VideoEffectsEx_NotifyError = 'videoEffectsEx.notifyError',\n VideoEffectsEx_NotifySelectedVideoEffectChanged = 'videoEffectsEx.notifySelectedVideoEffectChanged',\n VideoEffectsEx_NotifyVideoFrameProcessed = 'videoEffectsEx.notifyVideoFrameProcessed',\n VideoEffectsEx_RegisterEffectParameterChangeHandler = 'videoEffectsEx.registerEffectParamterChangeHandler',\n VideoEffectsEx_RegisterForVideoEffect = 'videoEffectsEx.registerForVideoEffect',\n VideoEffectsEx_RegisterForVideoFrame = 'videoEffectsEx.registerForVideoFrame',\n VideoEffectsEx_RegisterNewVideoFrameHandler = 'videoEffectsEx.registerNewVideoFrameHandler',\n VideoEffectsEx_RegisterSetFrameProcessTimeLimitHandler = 'videoEffectsEX.registerSetFrameProcessTimeLimitHandler',\n VideoEffectsEx_RegisterStartVideoExtensibilityVideoStreamHandler = 'videoEffectsEX.registerStartVideoExtensibilityVideoStreamHandler',\n VideoEffectsEx_UpdatePersonalizedEffects = 'videoEffectsEx.updatePersonalizedEffects',\n VideoEffectsUtils_EffectFailure = 'videoEffectsUtils.effectFailure',\n VideoEffectsUtils_ReportVideoEffectChanged = 'videoEffectsUtils.reportVideoEffectChanged',\n VideoEffectsUtils_TransformerWithMetadata_Constructor = 'videoEffectsUtils.transformerWithMetadata.constructor',\n VideoPerformanceMonitor_Constructor = 'videoPerformanceMonitor.performanceDataGenerated',\n VideoPerformanceMonitor_ReportFrameProcessed = 'videoPerformanceMonitor.reportFrameProcessed',\n VideoPerformanceMonitor_ReportTextureStreamAcquired = 'videoPerformanceMonitor.reportTextureStreamAcquired',\n VideoPerformanceMonitor_StartMonitorSlowFrameProcessing = 'videoPerformanceMonitor.startMonitorSlowFrameProcessing',\n VisualMedia_HasPermission = 'visualMedia.hasPermission',\n VisualMedia_Image_CaptureImages = 'visualMedia.image.captureImages',\n VisualMedia_Image_RetrieveImages = 'visualMedia.image.retrieveImages',\n VisualMedia_RequestPermission = 'visualMedia.requestPermission',\n WebStorage_IsWebStorageClearedOnUserLogOut = 'webStorage.isWebStorageClearedOnUserLogOut',\n}\n","import * as validOriginsJSON from '../artifactsForCDN/validDomains.json';\n\n/**\n * @hidden\n * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.\n * Modified to 2.0.1 which is hightest till now so that if any client doesn't pass version in initialize function, it will be set to highest.\n * Mobile clients are passing versions, hence will be applicable to web and desktop clients only.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const defaultSDKVersionForCompatCheck = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - VideoAndImage is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const videoAndImageMediaAPISupportVersion = '2.0.2';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const nonFullScreenVideoModeAPISupportVersion = '2.0.3';\n\n/**\n * @hidden\n * This is the client version when selectMedia API - ImageOutputFormats is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const imageOutputFormatsAPISupportVersion = '2.0.4';\n\n/**\n * @hidden\n * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when location APIs (getLocation and showLocation) are supported.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const locationAPIsRequiredVersion = '1.9.0';\n\n/**\n * @hidden\n * This is the client version when permisisons are supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const permissionsAPIsRequiredVersion = '2.0.1';\n\n/**\n * @hidden\n * This is the client version when people picker API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const peoplePickerRequiredVersion = '2.0.0';\n\n/**\n * @hidden\n * This is the client version when captureImage API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const captureImageMobileSupportVersion = '1.7.0';\n\n/**\n * @hidden\n * This is the client version when media APIs are supported on all three platforms ios, android and web.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const mediaAPISupportVersion = '1.8.0';\n\n/**\n * @hidden\n * This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const getMediaCallbackSupportVersion = '2.0.0';\n\n/**\n * @hidden\n * This is the client version when scanBarCode API is supported on mobile.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const scanBarCodeAPIMobileSupportVersion = '1.9.0';\n\n/**\n * @hidden\n * Fallback list of valid origins in JSON format\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nconst validOriginsLocal = validOriginsJSON;\n\n/**\n * @hidden\n * Fallback list of valid origins\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const validOriginsFallback = validOriginsLocal.validOrigins;\n\n/**\n * @hidden\n * CDN endpoint of the list of valid origins\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const validOriginsCdnEndpoint = new URL(\n 'https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json',\n);\n\n/**\n * @hidden\n * USer specified message origins should satisfy this test\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const userOriginUrlValidationRegExp = /^https:\\/\\//;\n\n/**\n * @hidden\n * The protocol used for deep links into Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const teamsDeepLinkProtocol = 'https';\n\n/**\n * @hidden\n * The host used for deep links into Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const teamsDeepLinkHost = 'teams.microsoft.com';\n\n/** @hidden */\nexport const errorLibraryNotInitialized = 'The library has not yet been initialized';\n\n/** @hidden */\nexport const errorRuntimeNotInitialized = 'The runtime has not yet been initialized';\n\n/** @hidden */\nexport const errorRuntimeNotSupported = 'The runtime version is not supported';\n\n/** @hidden */\nexport const errorCallNotStarted = 'The call was not properly started';\n","import { FrameContexts } from '../public/constants';\nexport class GlobalVars {\n public static initializeCalled = false;\n public static initializeCompleted = false;\n public static additionalValidOrigins: string[] = [];\n public static initializePromise: Promise<void> | undefined = undefined;\n public static isFramelessWindow = false;\n public static frameContext: FrameContexts | undefined = undefined;\n public static hostClientType: string | undefined = undefined;\n public static clientSupportedSDKVersion: string;\n public static printCapabilityEnabled = false;\n}\n","import base64 from 'base64-js';\n\nconst _Buffer = Buffer;\nexport { _Buffer as Buffer };\n\nconst K_MAX_LENGTH = 0x7fffffff;\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport();\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error('This browser lacks typed array (Uint8Array) support which is required');\n}\n\nfunction typedArraySupport() {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1);\n const proto = {\n foo: function () {\n return 42;\n },\n };\n Object.setPrototypeOf(proto, Uint8Array.prototype);\n Object.setPrototypeOf(arr, proto);\n return arr.foo() === 42;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError('The \"string\" argument must be of type string. Received type number');\n }\n return allocUnsafe(arg);\n }\n return from(arg, encodingOrOffset, length);\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length);\n};\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype);\nObject.setPrototypeOf(Buffer, Uint8Array);\n\nfunction from(value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset);\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value);\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' +\n typeof value,\n );\n }\n\n if (isInstance(value, ArrayBuffer) || (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n\n if (\n typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) || (value && isInstance(value.buffer, SharedArrayBuffer)))\n ) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type number');\n }\n\n const valueOf = value.valueOf && value.valueOf();\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length);\n }\n\n const b = fromObject(value);\n if (b) {\n return b;\n }\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length);\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' +\n typeof value,\n );\n}\n\nfunction allocUnsafe(size) {\n assertSize(size);\n return createBuffer(size < 0 ? 0 : checked(size) | 0);\n}\n\nfunction assertSize(size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number');\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"');\n }\n}\n\nfunction createBuffer(length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"');\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length);\n Object.setPrototypeOf(buf, Buffer.prototype);\n return buf;\n}\n\nfunction checked(length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError(\n 'Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes',\n );\n }\n return length | 0;\n}\n\nfunction fromString(string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8';\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding);\n }\n\n const length = byteLength(string, encoding) | 0;\n let buf = createBuffer(length);\n\n const actual = buf.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual);\n }\n\n return buf;\n}\n\nBuffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true;\n default:\n return false;\n }\n};\n\nfunction byteLength(string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length;\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength;\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof string,\n );\n }\n\n const len = string.length;\n const mustMatch = arguments.length > 2 && arguments[2] === true;\n if (!mustMatch && len === 0) {\n return 0;\n }\n\n // Use a for loop to avoid recursion\n let loweredCase = false;\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len;\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length;\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2;\n case 'hex':\n return len >>> 1;\n case 'base64':\n return base64ToBytes(string).length;\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8\n }\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n}\n\nBuffer.isBuffer = function isBuffer(b) {\n return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false\n};\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance(obj, type) {\n return (\n obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name)\n );\n}\n\nfunction utf8ToBytes(string, units) {\n units = units || Infinity;\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i);\n\n // is surrogate component\n if (codePoint > 0xd7ff && codePoint < 0xe000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xdbff) {\n // unexpected trail\n if ((units -= 3) > -1) {\n bytes.push(0xef, 0xbf, 0xbd);\n }\n continue;\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) {\n bytes.push(0xef, 0xbf, 0xbd);\n }\n continue;\n }\n\n // valid lead\n leadSurrogate = codePoint;\n\n continue;\n }\n\n // 2 leads in a row\n if (codePoint < 0xdc00) {\n if ((units -= 3) > -1) {\n bytes.push(0xef, 0xbf, 0xbd);\n }\n leadSurrogate = codePoint;\n continue;\n }\n\n // valid surrogate pair\n codePoint = (((leadSurrogate - 0xd800) << 10) | (codePoint - 0xdc00)) + 0x10000;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) {\n bytes.push(0xef, 0xbf, 0xbd);\n }\n }\n\n leadSurrogate = null;\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) {\n break;\n }\n bytes.push(codePoint);\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) {\n break;\n }\n bytes.push((codePoint >> 0x6) | 0xc0, (codePoint & 0x3f) | 0x80);\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) {\n break;\n }\n bytes.push((codePoint >> 0xc) | 0xe0, ((codePoint >> 0x6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) {\n break;\n }\n bytes.push(\n (codePoint >> 0x12) | 0xf0,\n ((codePoint >> 0xc) & 0x3f) | 0x80,\n ((codePoint >> 0x6) & 0x3f) | 0x80,\n (codePoint & 0x3f) | 0x80,\n );\n } else {\n throw new Error('Invalid code point');\n }\n }\n\n return bytes;\n}\n\nfunction base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n}\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;\n\nfunction base64clean(str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0];\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '');\n // Node converts strings with length < 2 to ''\n if (str.length < 2) {\n return '';\n }\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '=';\n }\n return str;\n}\n\nfunction fromArrayView(arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView);\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);\n }\n return fromArrayLike(arrayView);\n}\n\nfunction fromArrayBuffer(array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds');\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds');\n }\n\n let buf;\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array);\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset);\n } else {\n buf = new Uint8Array(array, byteOffset, length);\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype);\n\n return buf;\n}\n\nfunction fromArrayLike(array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0;\n const buf = createBuffer(length);\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255;\n }\n return buf;\n}\n\nBuffer.prototype.toString = function toString() {\n const length = this.length;\n if (length === 0) {\n return '';\n }\n if (arguments.length === 0) {\n return utf8Slice(this, 0, length);\n }\n return slowToString.apply(this, arguments);\n};\n\nfunction utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n const res = [];\n\n let i = start;\n while (i < end) {\n const firstByte = buf[i];\n let codePoint = null;\n let bytesPerSequence = firstByte > 0xef ? 4 : firstByte > 0xdf ? 3 : firstByte > 0xbf ? 2 : 1;\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte;\n }\n break;\n case 2:\n secondByte = buf[i + 1];\n if ((secondByte & 0xc0) === 0x80) {\n tempCodePoint = ((firstByte & 0x1f) << 0x6) | (secondByte & 0x3f);\n if (tempCodePoint > 0x7f) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80) {\n tempCodePoint = ((firstByte & 0xf) << 0xc) | ((secondByte & 0x3f) << 0x6) | (thirdByte & 0x3f);\n if (tempCodePoint > 0x7ff && (tempCodePoint < 0xd800 || tempCodePoint > 0xdfff)) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80 && (fourthByte & 0xc0) === 0x80) {\n tempCodePoint =\n ((firstByte & 0xf) << 0x12) |\n ((secondByte & 0x3f) << 0xc) |\n ((thirdByte & 0x3f) << 0x6) |\n (fourthByte & 0x3f);\n if (tempCodePoint > 0xffff && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint;\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xfffd;\n bytesPerSequence = 1;\n } else if (codePoint > 0xffff) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000;\n res.push(((codePoint >>> 10) & 0x3ff) | 0xd800);\n codePoint = 0xdc00 | (codePoint & 0x3ff);\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res);\n}\n\nfunction slowToString(encoding, start, end) {\n let loweredCase = false;\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0;\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return '';\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return '';\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return '';\n }\n\n if (!encoding) {\n encoding = 'utf8';\n }\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end);\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end);\n\n case 'ascii':\n return asciiSlice(this, start, end);\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end);\n\n case 'base64':\n return base64Slice(this, start, end);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end);\n\n default:\n if (loweredCase) {\n throw new TypeError('Unknown encoding: ' + encoding);\n }\n encoding = (encoding + '').toLowerCase();\n loweredCase = true;\n }\n }\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000;\n\nfunction decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = '';\n let i = 0;\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, (i += MAX_ARGUMENTS_LENGTH)));\n }\n return res;\n}\n\nfunction hexSlice(buf, start, end) {\n const len = buf.length;\n\n if (!start || start < 0) {\n start = 0;\n }\n if (!end || end < 0 || end > len) {\n end = len;\n }\n\n let out = '';\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]];\n }\n return out;\n}\n\nfunction asciiSlice(buf, start, end) {\n let ret = '';\n end = Math.min(buf.length, end);\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7f);\n }\n return ret;\n}\n\nfunction latin1Slice(buf, start, end) {\n let ret = '';\n end = Math.min(buf.length, end);\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n return ret;\n}\n\nfunction base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n}\n\nfunction utf16leSlice(buf, start, end) {\n const bytes = buf.slice(start, end);\n let res = '';\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n return res;\n}\n\nBuffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8';\n length = this.length;\n offset = 0;\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset;\n length = this.length;\n offset = 0;\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0;\n if (isFinite(length)) {\n length = length >>> 0;\n if (encoding === undefined) {\n encoding = 'utf8';\n }\n } else {\n encoding = length;\n length = undefined;\n }\n } else {\n throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');\n }\n\n const remaining = this.length - offset;\n if (length === undefined || length > remaining) {\n length = remaining;\n }\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds');\n }\n\n if (!encoding) {\n encoding = 'utf8';\n }\n\n let loweredCase = false;\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length);\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length);\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length);\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length);\n\n default:\n if (loweredCase) {\n throw new TypeError('Unknown encoding: ' + encoding);\n }\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n};\n\nfunction hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n const remaining = buf.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n if (length > remaining) {\n length = remaining;\n }\n }\n\n const strLen = string.length;\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n let i;\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16);\n if (numberIsNaN(parsed)) {\n return i;\n }\n buf[offset + i] = parsed;\n }\n return i;\n}\n\nfunction utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n}\n\nfunction asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n}\n\nfunction base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n}\n\nfunction ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n}\n\nfunction asciiToBytes(str) {\n const byteArray = [];\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xff);\n }\n return byteArray;\n}\n\nfunction utf16leToBytes(str, units) {\n let c, hi, lo;\n const byteArray = [];\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) {\n break;\n }\n\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray;\n}\n\nfunction blitBuffer(src, dst, offset, length) {\n let i;\n for (i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) {\n break;\n }\n dst[i + offset] = src[i];\n }\n return i;\n}\n\nfunction numberIsNaN(obj) {\n // For IE11 support\n return obj !== obj; // eslint-disable-line no-self-compare\n}\n\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef';\n const table = new Array(256);\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16;\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j];\n }\n }\n return table;\n})();\n\nfunction fromObject(obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0;\n const buf = createBuffer(len);\n\n if (buf.length === 0) {\n return buf;\n }\n\n obj.copy(buf, 0, 0, len);\n return buf;\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0);\n }\n return fromArrayLike(obj);\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data);\n }\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","/* eslint-disable @typescript-eslint/no-explicit-any*/\n\nimport { ChannelType, DialogDimension, HostClientType, HostName, TeamType, UserTeamRole } from './constants';\nimport { FrameContexts } from './constants';\n\n/**\n * Represents information about tabs for an app\n */\nexport interface TabInformation {\n /** Represents the tabs associated with a Microsoft Teams app */\n teamTabs: TabInstance[];\n}\n\n/**\n * Represents information about a tab instance\n */\nexport interface TabInstance {\n /**\n * The name of the tab\n */\n tabName: string;\n\n /**\n * @internal\n * Limited to Microsoft-internal use\n * @protected\n */\n internalTabInstanceId?: string;\n\n /**\n * Last viewed time of this tab. null means unknown\n */\n lastViewUnixEpochTime?: string;\n\n /**\n * The developer-defined unique ID for the entity this content points to.\n */\n entityId?: string;\n\n /**\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n channelId?: string;\n\n /**\n * The name for the channel with which the content is associated.\n */\n channelName?: string;\n\n /**\n * Is this tab in a favorite channel?\n */\n channelIsFavorite?: boolean;\n\n /**\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n teamId?: string;\n\n /**\n * The name for the team with which the content is associated.\n */\n teamName?: string;\n\n /**\n * Is this tab in a favorite team?\n */\n teamIsFavorite?: boolean;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Content URL of this tab\n */\n url?: string;\n\n /**\n * Website URL of this tab\n */\n websiteUrl?: string;\n\n /**\n * AppId of this tab\n */\n appId?: string;\n\n /**\n * Order of this tab. Order is 1-indexed.\n */\n order?: number;\n}\n\n/**\n * Indicates information about the tab instance for filtering purposes.\n */\nexport interface TabInstanceParameters {\n /**\n * Flag allowing to select favorite channels only\n */\n favoriteChannelsOnly?: boolean;\n\n /**\n * Flag allowing to select favorite teams only\n */\n favoriteTeamsOnly?: boolean;\n}\n\n/**\n * Represents Team Information\n */\nexport interface TeamInformation {\n /**\n * Id of the team\n */\n teamId: string;\n\n /**\n * Team display name\n */\n teamName: string;\n\n /**\n * Team description\n */\n teamDescription?: string;\n\n /**\n * Thumbnail Uri\n */\n thumbnailUri?: string;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Role of current user in the team\n */\n userTeamRole?: UserTeamRole;\n\n /**\n * The type of the team.\n */\n teamType?: TeamType;\n\n /**\n * The locked status of the team\n */\n isTeamLocked?: boolean;\n\n /**\n * The archived status of the team\n */\n isTeamArchived?: boolean;\n}\n\n/**\n * Represents OS locale info used for formatting date and time data\n */\nexport interface LocaleInfo {\n /** Represents the user's platform on which the app is running. */\n platform: HostClientType.android | HostClientType.ios | HostClientType.macos | 'windows';\n /**\n * Represents the regional format used by the user's locale.\n * @example `en-us`.\n */\n regionalFormat: string;\n /**\n * Displays date values, as specified by the short date format MM/DD/YYYY in user's regional settings.\n * @example 4/21/2023 or 4-21-2023\n */\n shortDate: string;\n /**\n * Displays only date values, as specified by the Long Date format in user's regional settings.\n * @example Friday, April 21, 2023\n */\n longDate: string;\n /**\n * A string representing the short time format used by the user's locale.\n * @example 10:10\n */\n shortTime: string;\n /**\n * A string representing the long time format used by the user's locale.\n * @example 10:10:42 AM\n */\n longTime: string;\n}\n\n/**\n * Allowed user file open preferences\n */\nexport enum FileOpenPreference {\n /** Indicates that the user should be prompted to open the file in inline. */\n Inline = 'inline',\n /** Indicates that the user should be prompted to open the file in the native desktop application associated with the file type. */\n Desktop = 'desktop',\n /** Indicates that the user should be prompted to open the file in a web browser. */\n Web = 'web',\n}\n\n/**\n * Types of Action Objects\n *\n * @beta\n */\nexport enum ActionObjectType {\n /** Represents content within a Microsoft 365 application. */\n M365Content = 'm365content',\n}\n\n/**\n * Data pertaining to object(s) the action is being performed on\n *\n * @param T The type of action being implemented\n *\n * @beta\n */\nexport interface BaseActionObject<T extends ActionObjectType> {\n /** Represents action type. */\n type: T;\n}\n\n/**\n * Stores information needed to represent content stored in OneDrive or Sharepoint\n *\n * @beta\n */\nexport interface M365ContentAction extends BaseActionObject<ActionObjectType.M365Content> {\n /**\n * Only office content IDs are passed to the app. Apps should use these ids\n * to query the Microsoft graph for more details.\n */\n itemId: string;\n /** Represents an optional secondary identifier for an action in a Microsoft 365 content item. */\n secondaryId?: SecondaryId;\n}\n\n/**\n * Contains additional IDs of the content that the action is triggered from. Maps to ids used in the Graph.\n *\n * @beta\n */\nexport interface SecondaryId {\n /** Name of the secondary id that should be used. */\n name: SecondaryM365ContentIdName;\n /** The secondary id value that can be used to retrieve M365 content. */\n value: string;\n}\n\n/**\n * These correspond with field names in the MSGraph.\n * See [commonly accessed resources](https://learn.microsoft.com/graph/api/resources/onedrive?view=graph-rest-1.0#commonly-accessed-resources).\n * @beta\n */\nexport enum SecondaryM365ContentIdName {\n /** OneDrive ID */\n DriveId = 'driveId',\n /** Teams Group ID */\n GroupId = 'groupId',\n /** SharePoint ID */\n SiteId = 'siteId',\n /** User ID */\n UserId = 'userId',\n}\n\n/**\n * Information about an Action.\n *\n * @remarks\n * This contains Id of the action, and the information about the object that triggered the action.\n * @beta\n */\nexport interface ActionInfo {\n /**\n * Id of the action. Maps to the action id supplied inside the manifest\n */\n actionId: string;\n /**\n * Array of corresponding action objects\n */\n actionObjects: BaseActionObject<ActionObjectType>[];\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use the {@link app.Context} interface and its updated properties instead.\n *\n * @remarks\n * For more details about the updated {@link app.Context} interface, visit the\n * [Teams JavaScript client SDK](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/using-teams-client-sdk#updates-to-the-context-interface)\n * overview article.\n *\n * Represents the structure of the received context message.\n */\nexport interface Context {\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link ActionInfo | app.Context.actionInfo} instead\n *\n * Common information applicable to all content actions\n */\n actionInfo?: ActionInfo;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.groupId | app.Context.team.groupId} instead\n *\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.internalId | app.Context.team.internalId} instead\n *\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n teamId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.displayName | app.Context.team.displayName} instead\n *\n * The name for the team with which the content is associated.\n */\n teamName?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.id | app.Context.channel.id} instead\n *\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n channelId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.displayName | app.Context.channel.displayName} instead\n *\n * The name for the channel with which the content is associated.\n */\n channelName?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.membershipType | app.Context.channel.membershipType} instead\n *\n * The type of the channel with which the content is associated.\n */\n channelType?: ChannelType;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.PageInfo.id | app.Context.page.id} instead\n *\n * The developer-defined unique ID for the entity this content points to.\n */\n entityId: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.PageInfo.subPageId | app.Context.page.subPageId} instead\n *\n * The developer-defined unique ID for the sub-entity this content points to.\n * This field should be used to restore to a specific state within an entity,\n * such as scrolling to or activating a specific piece of content.\n */\n subEntityId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.locale | app.Context.app.locale} instead\n *\n * The current locale that the user has configured for the app formatted as\n * languageId-countryId (for example, en-us).\n */\n locale: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.osLocaleInfo | app.Context.app.osLocaleInfo} instead\n *\n * More detailed locale info from the user's OS if available. Can be used together with\n * the @microsoft/globe NPM package to ensure your app respects the user's OS date and\n * time format configuration\n */\n osLocaleInfo?: LocaleInfo;\n\n /**\n * @deprecated\n *\n * As of TeamsJS v2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} or\n * {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead.\n * The UPN of the current user.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n upn?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TenantInfo.id | app.Context.user.tenant.id} instead\n *\n * The Microsoft Entra tenant ID of the current user.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n tid?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.theme | app.Context.app.theme} instead\n *\n * The current UI theme.\n */\n theme?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.PageInfo.isFullScreen | app.Context.page.isFullScreen} instead\n *\n * Indication whether the tab is in full-screen mode.\n */\n isFullScreen?: boolean;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.type | app.Context.team.type} instead\n *\n * The type of the team.\n */\n teamType?: TeamType;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.teamSiteUrl | app.Context.sharePointSite.teamSiteUrl} instead\n *\n * The root SharePoint site associated with the team.\n */\n teamSiteUrl?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.teamSiteDomain | app.Context.sharePointSite.teamSiteDomain} instead\n *\n * The domain of the root SharePoint site associated with the team.\n */\n teamSiteDomain?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.teamSitePath | app.Context.sharePointSite.teamSitePath} instead\n *\n * The relative path to the SharePoint site associated with the team.\n */\n teamSitePath?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.ownerTenantId | app.Context.channel.ownerTenantId} instead\n *\n * The tenant ID of the host team.\n */\n hostTeamTenantId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.ownerGroupId | app.Context.channel.ownerGroupId} instead\n *\n * The Microsoft Entra group ID of the host team.\n */\n hostTeamGroupId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.relativeUrl | app.Context.channel.relativeUrl} instead\n *\n * The relative path to the SharePoint folder associated with the channel.\n */\n channelRelativeUrl?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.sessionId | app.Context.app.host.sessionId} instead\n *\n * Unique ID for the current Teams session for use in correlating telemetry data.\n */\n sessionId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.userRole | app.Context.team.userRole} instead\n *\n * The user's role in the team.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to the user's role, and never as proof of her role.\n */\n userTeamRole?: UserTeamRole;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ChatInfo.id | app.Context.chat.id} instead\n *\n * The Microsoft Teams ID for the chat with which the content is associated.\n */\n chatId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.UserInfo.loginHint | app.Context.user.loginHint} instead\n *\n * A value suitable for use as a login_hint when authenticating with Microsoft Entra ID.\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n loginHint?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.UserInfo.userPrincipalName | app.Context.user.userPrincipalName} instead\n *\n * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).\n * Because a malicious party run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n userPrincipalName?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.UserInfo.id | app.Context.user.id} instead\n *\n * The Microsoft Entra object ID of the current user.\n * Because a malicious party run your content in a browser, this value should\n * be used only as a hint as to who the user is and never as proof of identity.\n * This field is available only when the identity permission is requested in the manifest.\n */\n userObjectId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.isArchived | app.Context.team.isArchived} instead\n *\n * Indicates whether team is archived.\n * Apps should use this as a signal to prevent any changes to content associated with archived teams.\n */\n isTeamArchived?: boolean;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.name | app.Context.app.host.name} instead\n *\n * The name of the host client. Possible values are: Office, Orange, Outlook, Teams\n */\n hostName?: HostName;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.clientType | app.Context.app.host.clientType} instead\n *\n * The type of the host client. Possible values are : android, ios, web, desktop, rigel(deprecated, use teamsRoomsWindows instead),\n * surfaceHub, teamsRoomsWindows, teamsRoomsAndroid, teamsPhones, teamsDisplays\n */\n hostClientType?: HostClientType;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.PageInfo.frameContext | app.Context.page.frameContext} instead\n *\n * The context where tab url is loaded (content, task, setting, remove, sidePanel)\n */\n frameContext?: FrameContexts;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.Context | app.Context.sharepoint} instead\n *\n * SharePoint context. This is only available when hosted in SharePoint.\n */\n sharepoint?: any;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TenantInfo.teamsSku | app.Context.tenant.teamsSku} instead\n *\n * The type of license for the current users tenant.\n */\n tenantSKU?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.UserInfo.licenseType | app.Context.user.licenseType} instead\n *\n * The license type for the current user.\n */\n userLicenseType?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.parentMessageId | app.Context.app.parentMessageId} instead\n *\n * The ID of the parent message from which this task module was launched.\n * This is only available in task modules launched from bot cards.\n */\n parentMessageId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppHostInfo.ringId | app.Context.app.host.ringId} instead\n *\n * Current ring ID\n */\n ringId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.sessionId | app.Context.app.sessionId} instead\n *\n * Unique ID for the current session for use in correlating telemetry data. A session corresponds to the lifecycle of an app. A new session begins upon the creation of a webview (on Teams mobile) or iframe (in Teams desktop) hosting the app, and ends when it is destroyed.\n */\n appSessionId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.appLaunchId | app.Context.app.appLaunchId} instead\n *\n * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data``\n */\n appLaunchId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.UserInfo.isCallingAllowed | app.Context.user.isCallingAllowed} instead\n *\n * Represents whether calling is allowed for the current logged in User\n */\n isCallingAllowed?: boolean;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.UserInfo.isPSTNCallingAllowed | app.Context.user.isPSTNCallingAllowed} instead\n *\n * Represents whether PSTN calling is allowed for the current logged in User\n */\n isPSTNCallingAllowed?: boolean;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.MeetingInfo.id | app.Context.meeting.id} instead\n *\n * Meeting Id used by tab when running in meeting context\n */\n meetingId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ChannelInfo.defaultOneNoteSectionId | app.Context.channel.defaultOneNoteSectionId} instead\n *\n * The OneNote section ID that is linked to the channel.\n */\n defaultOneNoteSectionId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.PageInfo.isMultiWindow | app.Context.page.isMultiWindow} instead\n *\n * Indication whether the tab is in a pop out window\n */\n isMultiWindow?: boolean;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.PageInfo.isBackgroundLoad | app.Context.page.isBackgroundLoad} instead\n *\n * Indication whether the tab is being loaded in the background\n */\n isBackgroundLoad?: boolean;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.iconPositionVertical | app.Context.app.iconPositionVertical} instead\n *\n * Personal app icon y coordinate position\n */\n appIconPosition?: number;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.PageInfo.sourceOrigin | app.Context.page.sourceOrigin} instead\n *\n * Source origin from where the tab is opened\n */\n sourceOrigin?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.userClickTime | app.Context.app.userClickTime} instead\n *\n * Time when the user clicked on the tab\n */\n userClickTime?: number;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.TeamInfo.templateId | app.Context.team.templateId} instead\n *\n * Team Template ID if there was a Team Template associated with the creation of the team.\n */\n teamTemplateId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.AppInfo.userFileOpenPreference | app.Context.app.userFileOpenPreference} instead\n *\n * Where the user prefers the file to be opened from by default during file open\n */\n userFileOpenPreference?: FileOpenPreference;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.UserInfo.displayName | app.Context.user.displayName} instead\n *\n * The address book name of the current user.\n */\n userDisplayName?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.teamSiteId | app.Context.sharePointSite.teamSiteId} instead\n *\n * Teamsite ID, aka sharepoint site id.\n */\n teamSiteId?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.mySiteDomain | app.Context.sharePointSite.mySiteDomain} instead\n *\n * The SharePoint my site domain associated with the user.\n */\n mySiteDomain?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.SharePointSiteInfo.mySitePath | app.Context.sharePointSite.mySitePath} instead\n *\n * The SharePoint relative path to the current users mysite\n */\n mySitePath?: string;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.Context.dialogParameters} instead\n *\n * When `processActionCommand` activates a dialog, this dialog should automatically fill in some fields with information. This information comes from M365 and is given to `processActionCommand` as `extractedParameters`.\n * App developers need to use these `extractedParameters` in their dialog.\n * They help pre-fill the dialog with necessary information (`dialogParameters`) along with other details.\n */\n dialogParameters?: Record<string, string>;\n}\n\n/** Represents the parameters used to share a deep link. */\nexport interface ShareDeepLinkParameters {\n /**\n * The developer-defined unique ID for the sub-page to which this deep link points in the current page.\n * This field should be used to restore to a specific state within a page, such as scrolling to or activating a specific piece of content.\n */\n subPageId: string;\n\n /**\n * The label for the sub-page that should be displayed when the deep link is rendered in a client.\n */\n subPageLabel: string;\n\n /**\n * The fallback URL to which to navigate the user if the client cannot render the page.\n * This URL should lead directly to the sub-entity.\n */\n subPageWebUrl?: string;\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link ShareDeepLinkParameters} instead.\n */\nexport interface DeepLinkParameters {\n /**\n * The developer-defined unique ID for the sub-entity to which this deep link points in the current entity.\n * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.\n */\n subEntityId: string;\n\n /**\n * The label for the sub-entity that should be displayed when the deep link is rendered in a client.\n */\n subEntityLabel: string;\n\n /**\n * The fallback URL to which to navigate the user if the client cannot render the page.\n * This URL should lead directly to the sub-entity.\n */\n subEntityWebUrl?: string;\n}\n\n/**\n * @hidden\n * Shared Dialog Properties\n */\nexport interface BaseDialogInfo {\n /**\n * The requested size of the dialog\n */\n size: DialogSize;\n\n /**\n * Title of the dialog module.\n */\n title?: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open an Adaptive Card-based dialog.\n */\nexport interface AdaptiveCardDialogInfo extends BaseDialogInfo {\n /**\n * JSON defining an Adaptive Card.\n */\n card: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open a bot-based Adaptive Card-based dialog.\n */\nexport interface BotAdaptiveCardDialogInfo extends AdaptiveCardDialogInfo {\n /**\n * Specifies a bot ID to send the result of the user's interaction with the dialog module.\n * The bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId: string;\n}\n\n/**\n * Data structure to represent the size of a dialog\n */\nexport interface DialogSize {\n /**\n * The requested height of the webview/iframe.\n */\n height: DialogDimension | number;\n\n /**\n * The requested width of the webview/iframe.\n */\n width: DialogDimension | number;\n}\n\n/**\n * Data structure to describe dialog information needed to open a url-based dialog.\n */\nexport interface UrlDialogInfo extends BaseDialogInfo {\n /**\n * The url to be rendered in the webview/iframe.\n *\n * @remarks\n * The domain of the url must match at least one of the\n * valid domains specified in the [validDomains block](https://learn.microsoft.com/microsoftteams/platform/resources/schema/manifest-schema#validdomains) of the app manifest\n */\n url: string;\n\n /**\n * If client doesnt support the URL, the URL that needs to be opened in the browser.\n */\n fallbackUrl?: string;\n}\n\n/**\n * Data structure to describe dialog information needed to open a bot based dialog.\n */\nexport interface BotUrlDialogInfo extends UrlDialogInfo {\n /**\n * Specifies a bot ID to send the result of the user's interaction with the task module.\n * The bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId: string;\n}\n\n/**\n * Data structure to describe dialog information\n */\nexport interface DialogInfo {\n /**\n * The url to be rendered in the webview/iframe.\n *\n * @remarks\n * The domain of the url must match at least one of the\n * valid domains specified in the validDomains block of the manifest\n */\n url?: string;\n\n /**\n * JSON defining an adaptive card.\n */\n card?: string;\n\n /**\n * The requested height of the webview/iframe.\n */\n height?: DialogDimension | number;\n\n /**\n * The requested width of the webview/iframe.\n */\n width?: DialogDimension | number;\n\n /**\n * Title of the task module.\n */\n title?: string;\n\n /**\n * If client doesnt support the URL, the URL that needs to be opened in the browser.\n */\n fallbackUrl?: string;\n\n /**\n * Specifies a bot ID to send the result of the user's interaction with the task module.\n * If specified, the bot will receive a task/complete invoke event with a JSON object\n * in the event payload.\n */\n completionBotId?: string;\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link DialogInfo} instead.\n */\nexport type TaskInfo = DialogInfo;\n\n/**\n * @beta\n * Data structure to be used with the {@link app.lifecycle.registerOnResumeHandler app.lifecycle.registerOnResumeHandler(handler: (context: ResumeContext) => void): void} to pass the context to the app.\n */\nexport interface ResumeContext {\n /**\n * The entity that is requested to be loaded\n */\n entityId: string;\n\n /**\n * The content URL that is requested to be loaded\n */\n contentUrl: URL;\n}\n\n/**\n * @deprecated\n * As of 2.14.1, please use {@link ResumeContext} instead.\n */\nexport interface LoadContext {\n /**\n * The entity that is requested to be loaded\n */\n entityId: string;\n\n /**\n * The content URL that is requested to be loaded\n */\n contentUrl: string;\n}\n\n/** Represents information about a frame within a tab or dialog module. */\nexport interface FrameInfo {\n /**\n * The current URL that needs to be used in the iframe if the tab is reloaded\n */\n contentUrl: string;\n\n /**\n * The current URL that needs to be used for opening the website when the user clicks on 'Go to website'\n */\n websiteUrl: string;\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link FrameInfo} instead.\n */\nexport type FrameContext = FrameInfo;\n\n/** Represents an error that occurs during the execution of an app or integration. */\nexport interface SdkError {\n /**\n error code\n */\n errorCode: ErrorCode;\n /**\n Optional description for the error. This may contain useful information for web-app developers.\n This string will not be localized and is not for end-user consumption. \n App should not depend on the string content. The exact value may change. This is only for debugging purposes.\n */\n message?: string;\n}\n\nexport function isSdkError(err: unknown): err is SdkError {\n return (err as SdkError)?.errorCode !== undefined;\n}\n\n/** Error codes used to identify different types of errors that can occur while developing apps. */\nexport enum ErrorCode {\n /**\n * API not supported in the current platform.\n */\n NOT_SUPPORTED_ON_PLATFORM = 100,\n /**\n * Internal error encountered while performing the required operation.\n */\n INTERNAL_ERROR = 500,\n /**\n * API is not supported in the current context\n */\n NOT_SUPPORTED_IN_CURRENT_CONTEXT = 501,\n /**\n Permissions denied by user\n */\n PERMISSION_DENIED = 1000,\n /**\n * Network issue\n */\n NETWORK_ERROR = 2000,\n /**\n * Underlying hardware doesn't support the capability\n */\n NO_HW_SUPPORT = 3000,\n /**\n * One or more arguments are invalid\n */\n INVALID_ARGUMENTS = 4000,\n /**\n * User is not authorized for this operation\n */\n UNAUTHORIZED_USER_OPERATION = 5000,\n /**\n * Could not complete the operation due to insufficient resources\n */\n INSUFFICIENT_RESOURCES = 6000,\n /**\n * Platform throttled the request because of API was invoked too frequently\n */\n THROTTLE = 7000,\n /**\n * User aborted the operation\n */\n USER_ABORT = 8000,\n /**\n * Could not complete the operation in the given time interval\n */\n OPERATION_TIMED_OUT = 8001,\n /**\n * Platform code is old and doesn't implement this API\n */\n OLD_PLATFORM = 9000,\n /**\n * The file specified was not found on the given location\n */\n FILE_NOT_FOUND = 404,\n /**\n * The return value is too big and has exceeded our size boundries\n */\n SIZE_EXCEEDED = 10000,\n}\n\n/** @hidden */\nexport enum DevicePermission {\n GeoLocation = 'geolocation',\n Media = 'media',\n}\n\n/** @hidden */\nexport interface HostVersionsInfo {\n adaptiveCardSchemaVersion?: AdaptiveCardVersion;\n appEligibilityInformation?: AppEligibilityInformation;\n}\n\n/**\n * Represents the major and minor versions of the Adaptive Card schema in the current host\n */\nexport interface AdaptiveCardVersion {\n /** Represents the major version number. */\n majorVersion: number;\n /** Represents the minor version number. */\n minorVersion: number;\n}\n\n/**\n * @hidden\n * Eligibility Information for the app user.\n *\n * @beta\n */\nexport interface AppEligibilityInformation {\n /**\n * Describes the user’s age group, which can have implications on which product they are able to use.\n */\n ageGroup: LegalAgeGroupClassification | null;\n /**\n * Describes the user’s chat experience based on their eligible licenses & their tenant’s eligible licenses.\n * A user will be in at most one cohort.\n */\n cohort: Cohort | null;\n /**\n * Indicates that the user is eligible for Microsoft Entra ID Authenticated Copilot experience.\n */\n isCopilotEligible: boolean;\n /**\n * Implementation may change to be based on tenant-home region rather than IP.\n */\n isCopilotEnabledRegion: boolean;\n /**\n * Indicates if the tenant admin has opted the user out of Copilot.\n */\n isOptedOutByAdmin: boolean;\n /**\n * Education Eligibility Information for the app user\n */\n userClassification: UserClassification | null;\n}\n\n/**\n * @hidden\n *\n * @beta\n */\nexport interface UserClassificationWithEduType {\n /**\n * For EDU tenants only. Indicates if the tenant is higher ed or K12.\n */\n eduType: EduType;\n /**\n * Describes additional traits of the user that contribute to FRE experience, etc.\n */\n persona: Persona.Faculty | Persona.Student;\n}\n\n/**\n * @hidden\n *\n * @beta\n */\nexport interface UserClassificationWithOtherType {\n persona: Persona.Other;\n}\n\n/**\n * @hidden\n *\n * @beta\n */\nexport type UserClassification = UserClassificationWithEduType | UserClassificationWithOtherType;\n\n/**\n * @hidden\n *\n * @beta\n */\nexport enum Cohort {\n BCAIS = 'bcais',\n BCWAF = 'bcwaf',\n BCWBF = 'bcwbf',\n}\n\n/**\n * @hidden\n *\n * @beta\n */\nexport enum Persona {\n /**\n * User has a faculty license\n */\n Faculty = 'faculty',\n /**\n * User has a student license\n */\n Student = 'student',\n /**\n * When user is not a faculty or student\n */\n Other = 'other',\n}\n\n/**\n * @hidden\n *\n * @beta\n */\n// https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#legalagegroupclassification-values\nexport enum LegalAgeGroupClassification {\n /**\n * The user is considered an adult based on the age-related regulations of their country or region.\n */\n Adult = 'adult',\n /**\n * The user is a minor but is from a country or region that has no age-related regulations.\n */\n MinorNoParentalConsentRequired = 'minorNoParentalConsentRequired',\n /**\n * Reserved for future use\n */\n MinorWithoutParentalConsent = 'minorWithoutParentalConsent',\n /**\n * The user is considered a minor based on the age-related regulations of their country or region, and the administrator\n * of the account obtained appropriate consent from a parent or guardian.\n */\n MinorWithParentalConsent = 'minorWithParentalConsent',\n /**\n * The user is from a country or region that has additional age-related regulations, such as the United States,\n * United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age\n * (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.\n */\n NonAdult = 'nonAdult',\n}\n\n/**\n * @hidden\n *\n * @beta\n */\nexport enum EduType {\n /**\n * User is from a tenant labeled as “HigherEd”\n */\n HigherEducation = 'higherEducation',\n /**\n * User is from a tenant labeled as “K12”\n */\n K12 = 'k12',\n /**\n * User is from a tenant labeled as “Others” (e.g. research institutions)\n */\n Other = 'other',\n}\n\n/**\n * Currently supported Mime type\n */\nexport enum ClipboardSupportedMimeType {\n TextPlain = 'text/plain',\n TextHtml = 'text/html',\n ImagePNG = 'image/png',\n ImageJPEG = 'image/jpeg',\n}\n\n/**\n * Clipboard write parameters\n */\nexport interface ClipboardParams {\n /** Mime Type of data to be copied to Clipboard */\n mimeType: ClipboardSupportedMimeType;\n /** Blob content in Base64 string format */\n content: string;\n}\n","/** HostClientType represents the different client platforms on which host can be run. */\nexport enum HostClientType {\n /** Represents the desktop client of host, which is installed on a user's computer and runs as a standalone application. */\n desktop = 'desktop',\n /** Represents the web-based client of host, which runs in a web browser. */\n web = 'web',\n /** Represents the Android mobile client of host, which runs on Android devices such as smartphones and tablets. */\n android = 'android',\n /** Represents the iOS mobile client of host, which runs on iOS devices such as iPhones. */\n ios = 'ios',\n /** Represents the iPadOS client of host, which runs on iOS devices such as iPads. */\n ipados = 'ipados',\n /** The host is running on a macOS client, which runs on devices such as MacBooks. */\n macos = 'macos',\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link teamsRoomsWindows} instead.\n */\n rigel = 'rigel',\n /** Represents the client of host, which runs on surface hub devices. */\n surfaceHub = 'surfaceHub',\n /** Represents the client of host, which runs on Teams Rooms on Windows devices. More information on Microsoft Teams Rooms on Windows can be found [Microsoft Teams Rooms (Windows)](https://support.microsoft.com/office/microsoft-teams-rooms-windows-help-e667f40e-5aab-40c1-bd68-611fe0002ba2)*/\n teamsRoomsWindows = 'teamsRoomsWindows',\n /** Represents the client of host, which runs on Teams Rooms on Android devices. More information on Microsoft Teams Rooms on Android can be found [Microsoft Teams Rooms (Android)].(https://support.microsoft.com/office/get-started-with-teams-rooms-on-android-68517298-d513-46be-8d6d-d41db5e6b4b2)*/\n teamsRoomsAndroid = 'teamsRoomsAndroid',\n /** Represents the client of host, which runs on Teams phones. More information can be found [Microsoft Teams Phones](https://support.microsoft.com/office/get-started-with-teams-phones-694ca17d-3ecf-40ca-b45e-d21b2c442412) */\n teamsPhones = 'teamsPhones',\n /** Represents the client of host, which runs on Teams displays devices. More information can be found [Microsoft Teams Displays](https://support.microsoft.com/office/get-started-with-teams-displays-ff299825-7f13-4528-96c2-1d3437e6d4e6) */\n teamsDisplays = 'teamsDisplays',\n}\n\n/** HostName indicates the possible hosts for your application. */\nexport enum HostName {\n /**\n * Office.com and Office Windows App\n */\n office = 'Office',\n\n /**\n * For \"desktop\" specifically, this refers to the new, pre-release version of Outlook for Windows.\n * Also used on other platforms that map to a single Outlook client.\n */\n outlook = 'Outlook',\n\n /**\n * Outlook for Windows: the classic, native, desktop client\n */\n outlookWin32 = 'OutlookWin32',\n\n /**\n * Microsoft-internal test Host\n */\n orange = 'Orange',\n\n /**\n * Microsoft connected workplace platform\n */\n places = 'Places',\n\n /**\n * Teams\n */\n teams = 'Teams',\n\n /**\n * Modern Teams\n */\n teamsModern = 'TeamsModern',\n}\n\n/**\n * FrameContexts provides information about the context in which the app is running within the host.\n * Developers can use FrameContexts to determine how their app should behave in different contexts,\n * and can use the information provided by the context to adapt the app to the user's needs.\n *\n * @example\n * If your app is running in the \"settings\" context, you should be displaying your apps configuration page.\n * If the app is running in the content context, the developer may want to display information relevant to\n * the content the user is currently viewing.\n */\nexport enum FrameContexts {\n /**\n * App's frame context from where settings page can be accessed.\n * See [how to create a configuration page.]( https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/create-tab-pages/configuration-page?tabs=teamsjs-v2)\n */\n settings = 'settings',\n /** The default context for the app where all the content of the app is displayed. */\n content = 'content',\n /** Frame context used when app is running in the authentication window launched by calling {@link authentication.authenticate} */\n authentication = 'authentication',\n /** The page shown when the user uninstalls the app. */\n remove = 'remove',\n /** A task module is a pop-up window that can be used to display a form, a dialog, or other interactive content within the host. */\n task = 'task',\n /** The side panel is a persistent panel that is displayed on the right side of the host and can be used to display content or UI that is relevant to the current page or tab. */\n sidePanel = 'sidePanel',\n /** The stage is a large area that is displayed at the center of the host and can be used to display content or UI that requires a lot of space, such as a video player or a document editor. */\n stage = 'stage',\n /** App's frame context from where meetingStage can be accessed in a meeting session, which is the primary area where video and presentation content is displayed during a meeting. */\n meetingStage = 'meetingStage',\n}\n\n/**\n * Indicates the team type, currently used to distinguish between different team\n * types in Office 365 for Education (team types 1, 2, 3, and 4).\n */\nexport enum TeamType {\n /** Represents a standard or classic team in host that is designed for ongoing collaboration and communication among a group of people. */\n Standard = 0,\n /** Represents an educational team in host that is designed for classroom collaboration and communication among students and teachers. */\n Edu = 1,\n /** Represents a class team in host that is designed for classroom collaboration and communication among students and teachers in a structured environment. */\n Class = 2,\n /** Represents a professional learning community (PLC) team in host that is designed for educators to collaborate and share resources and best practices. */\n Plc = 3,\n /** Represents a staff team in host that is designed for staff collaboration and communication among staff members.*/\n Staff = 4,\n}\n\n/**\n * Indicates the various types of roles of a user in a team.\n */\nexport enum UserTeamRole {\n /** Represents that the user is an owner or administrator of the team. */\n Admin = 0,\n /** Represents that the user is a standard member of the team. */\n User = 1,\n /** Represents that the user does not have any role in the team. */\n Guest = 2,\n}\n\n/**\n * Dialog module dimension enum\n */\nexport enum DialogDimension {\n /** Represents a large-sized dialog box, which is typically used for displaying large amounts of content or complex workflows that require more space. */\n Large = 'large',\n /** Represents a medium-sized dialog box, which is typically used for displaying moderate amounts of content or workflows that require less space. */\n Medium = 'medium',\n /** Represents a small-sized dialog box, which is typically used for displaying simple messages or workflows that require minimal space.*/\n Small = 'small',\n}\n\nimport { AdaptiveCardVersion, ErrorCode, SdkError } from './interfaces';\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link DialogDimension} instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport import TaskModuleDimension = DialogDimension;\nimport { HostVersionsInfo } from './interfaces';\n\n/**\n * The type of the channel with which the content is associated.\n */\nexport enum ChannelType {\n /** The default channel type. Type of channel is used for general collaboration and communication within a team. */\n Regular = 'Regular',\n /** Type of channel is used for sensitive or confidential communication within a team and is only accessible to members of the channel. */\n Private = 'Private',\n /** Type of channel is used for collaboration between multiple teams or groups and is accessible to members of all the teams or groups. */\n Shared = 'Shared',\n}\n\n/** An error object indicating that the requested operation or feature is not supported on the current platform or device.\n * @typedef {Object} SdkError\n */\nexport const errorNotSupportedOnPlatform: SdkError = {\n errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM,\n};\n\n/**\n * @hidden\n *\n * Minimum Adaptive Card version supported by the host.\n */\nexport const minAdaptiveCardVersion: AdaptiveCardVersion = { majorVersion: 1, minorVersion: 5 };\n\n/**\n * @hidden\n *\n * Adaptive Card version supported by the Teams v1 client.\n */\nexport const teamsMinAdaptiveCardVersion: HostVersionsInfo = {\n adaptiveCardSchemaVersion: { majorVersion: 1, minorVersion: 5 },\n};\n\n/**\n * @hidden\n * An error object indicates that the image count from visualMedia.image API is invalid.\n *\n * @beta\n */\nexport const errorInvalidCount = new Error('Invalid input count: Must supply a valid image count (limit of 10).');\n/**\n * @hidden\n * An error object indicates that the response from the visualMedia.image API is invalid.\n *\n * @beta\n */\nexport const errorInvalidResponse = new Error(\n 'Invalid response: Received more images than the specified max limit in the response.',\n);\n","/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { Buffer } from 'buffer';\nimport * as uuid from 'uuid';\n\nimport { minAdaptiveCardVersion } from '../public/constants';\nimport { AdaptiveCardVersion, SdkError } from '../public/interfaces';\nimport { pages } from '../public/pages';\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function getGenericOnCompleteHandler(errorMessage?: string): (success: boolean, reason?: string) => void {\n return (success: boolean, reason: string): void => {\n if (!success) {\n throw new Error(errorMessage ? errorMessage : reason);\n }\n };\n}\n\n/**\n * @hidden\n * Compares SDK versions.\n *\n * @param v1 - first version\n * @param v2 - second version\n * @returns NaN in case inputs are not in right format\n * -1 if v1 < v2\n * 1 if v1 > v2\n * 0 otherwise\n * @example\n * compareSDKVersions('1.2', '1.2.0') returns 0\n * compareSDKVersions('1.2a', '1.2b') returns NaN\n * compareSDKVersions('1.2', '1.3') returns -1\n * compareSDKVersions('2.0', '1.3.2') returns 1\n * compareSDKVersions('2.0', 2.0) returns NaN\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function compareSDKVersions(v1: string, v2: string): number {\n if (typeof v1 !== 'string' || typeof v2 !== 'string') {\n return NaN;\n }\n\n const v1parts = v1.split('.');\n const v2parts = v2.split('.');\n\n function isValidPart(x: string): boolean {\n // input has to have one or more digits\n // For ex - returns true for '11', false for '1a1', false for 'a', false for '2b'\n return /^\\d+$/.test(x);\n }\n\n if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) {\n return NaN;\n }\n\n // Make length of both parts equal\n while (v1parts.length < v2parts.length) {\n v1parts.push('0');\n }\n while (v2parts.length < v1parts.length) {\n v2parts.push('0');\n }\n\n for (let i = 0; i < v1parts.length; ++i) {\n if (Number(v1parts[i]) == Number(v2parts[i])) {\n continue;\n } else if (Number(v1parts[i]) > Number(v2parts[i])) {\n return 1;\n } else {\n return -1;\n }\n }\n return 0;\n}\n\n/**\n * @hidden\n * Generates a GUID\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function generateGUID(): string {\n return uuid.v4();\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function deepFreeze<T extends object>(obj: T): T {\n Object.keys(obj).forEach((prop) => {\n if (obj[prop] === null || obj[prop] === undefined) {\n return;\n }\n if (typeof obj[prop] === 'object') {\n deepFreeze(obj[prop]);\n }\n });\n return Object.freeze(obj);\n}\n\n/**\n * @hidden\n * The following type definitions will be used in the\n * utility functions below, which help in transforming the\n * promises to support callbacks for backward compatibility\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport type ErrorResultCallback<T> = (err?: SdkError, result?: T) => void;\nexport type ErrorResultNullCallback<T> = (err: SdkError | null, result: T | null) => void;\nexport type ErrorBooleanResultCallback = (err?: SdkError, result?: boolean) => void;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InputFunction<T> = (...args: any[]) => Promise<T>;\nexport type ResultCallback<T> = (result?: T) => void;\nexport type SdkErrorCallback = ResultCallback<SdkError | null>;\n\n/**\n * This utility function is used when the result of the promise is same as the result in the callback.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrResultFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorResultCallback<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then((result: T) => {\n if (callback) {\n callback(undefined, result);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e);\n }\n });\n return p;\n}\n\n/**\n * This utility function is used when the return type of the promise is usually void and\n * the result in the callback is a boolean type (true for success and false for error)\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrBooleanFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorBooleanResultCallback,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then(() => {\n if (callback) {\n callback(undefined, true);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e, false);\n }\n });\n return p;\n}\n\n/**\n * This utility function is called when the callback has only Error/SdkError as the primary argument.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithSdkErrorFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: SdkErrorCallback,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then(() => {\n if (callback) {\n callback(null);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e);\n }\n });\n return p;\n}\n\n/**\n * This utility function is used when the result of the promise is same as the result in the callback.\n * @param funcHelper\n * @param callback\n * @param args\n * @returns\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise<T>(\n funcHelper: InputFunction<T>,\n callback?: ErrorResultNullCallback<T>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n): Promise<T> {\n const p = funcHelper(...args);\n p.then((result: T) => {\n if (callback) {\n callback(null, result);\n }\n }).catch((e: SdkError) => {\n if (callback) {\n callback(e, null);\n }\n });\n return p;\n}\n\n/**\n * A helper function to add a timeout to an asynchronous operation.\n *\n * @param action Action to wrap the timeout around\n * @param timeoutInMs Timeout period in milliseconds\n * @param timeoutError Error to reject the promise with if timeout elapses before the action completed\n * @returns A promise which resolves to the result of provided action or rejects with a provided timeout error\n * if the initial action didn't complete within provided timeout.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function runWithTimeout<TResult, TError>(\n action: () => Promise<TResult>,\n timeoutInMs: number,\n timeoutError: TError,\n): Promise<TResult> {\n return new Promise((resolve, reject) => {\n const timeoutHandle = setTimeout(reject, timeoutInMs, timeoutError);\n action()\n .then((result) => {\n clearTimeout(timeoutHandle);\n resolve(result);\n })\n .catch((error) => {\n clearTimeout(timeoutHandle);\n reject(error);\n });\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function createTeamsAppLink(params: pages.NavigateToAppParams): string {\n const url = new URL(\n 'https://teams.microsoft.com/l/entity/' +\n encodeURIComponent(params.appId) +\n '/' +\n encodeURIComponent(params.pageId),\n );\n\n if (params.webUrl) {\n url.searchParams.append('webUrl', params.webUrl);\n }\n if (params.chatId || params.channelId || params.subPageId) {\n url.searchParams.append(\n 'context',\n JSON.stringify({ chatId: params.chatId, channelId: params.channelId, subEntityId: params.subPageId }),\n );\n }\n return url.toString();\n}\n\n/**\n * @hidden\n * Checks if the Adaptive Card schema version is supported by the host.\n * @param hostAdaptiveCardSchemaVersion Host's supported Adaptive Card version in the runtime.\n *\n * @returns true if the Adaptive Card Version is not supported and false if it is supported.\n */\nexport function isHostAdaptiveCardSchemaVersionUnsupported(\n hostAdaptiveCardSchemaVersion: AdaptiveCardVersion,\n): boolean {\n const versionCheck = compareSDKVersions(\n `${hostAdaptiveCardSchemaVersion.majorVersion}.${hostAdaptiveCardSchemaVersion.minorVersion}`,\n `${minAdaptiveCardVersion.majorVersion}.${minAdaptiveCardVersion.minorVersion}`,\n );\n if (versionCheck >= 0) {\n return false;\n } else {\n return true;\n }\n}\n\n/**\n * @hidden\n * Checks if a URL is a HTTPS protocol based URL.\n * @param url URL to be validated.\n *\n * @returns true if the URL is an https URL.\n */\nexport function isValidHttpsURL(url: URL): boolean {\n return url.protocol === 'https:';\n}\n\n/**\n * Convert base64 string to blob\n * @param base64Data string respresenting the content\n * @param contentType Mimetype\n * @returns Promise\n */\nexport function base64ToBlob(mimeType: string, base64String: string): Promise<Blob> {\n return new Promise<Blob>((resolve, reject) => {\n if (!mimeType) {\n reject('MimeType cannot be null or empty.');\n }\n if (!base64String) {\n reject('Base64 string cannot be null or empty.');\n }\n /**\n * For images we need to convert binary data to image to achieve that:\n * 1. A new Uint8Array is created with a length equal to the length of byteCharacters.\n * The byteCharacters is a string representing the base64 data decoded using atob.\n * 2. Then loop iterates over each character in the byteCharacters string and assigns the\n * corresponding character code to the corresponding index in the byteArray. The purpose\n * of this loop is to convert the base64 string to a binary representation, as the Blob\n * constructor expects binary data.\n */\n if (mimeType.startsWith('image/')) {\n const byteCharacters = atob(base64String);\n const byteArray = new Uint8Array(byteCharacters.length);\n for (let i = 0; i < byteCharacters.length; i++) {\n byteArray[i] = byteCharacters.charCodeAt(i);\n }\n resolve(new Blob([byteArray], { type: mimeType }));\n }\n const byteCharacters = Buffer.from(base64String, 'base64').toString();\n resolve(new Blob([byteCharacters], { type: mimeType }));\n });\n}\n\n/**\n * Converts blob to base64 string.\n * @param blob Blob to convert to base64 string.\n */\nexport function getBase64StringFromBlob(blob: Blob): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n if (blob.size === 0) {\n reject(new Error('Blob cannot be empty.'));\n }\n const reader = new FileReader();\n reader.onloadend = () => {\n if (reader.result) {\n resolve(reader.result.toString().split(',')[1]);\n } else {\n reject(new Error('Failed to read the blob'));\n }\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n reader.readAsDataURL(blob);\n });\n}\n\n/**\n * Returns an SSR safe reference to the window object\n * @returns Window object reference\n */\n\nexport function ssrSafeWindow(): Window {\n if (!inServerSideRenderingEnvironment()) {\n return window;\n } else {\n // This should NEVER actually be written.\n // If you EVER see this error in ANY log file, something has gone horribly wrong and a bug needs to be filed.\n throw new Error('window object undefined at SSR check');\n }\n}\n\n/**\n * Checks if running in a Server Side Environment\n * @returns True if running in a Server Side Environment\n */\nexport function inServerSideRenderingEnvironment(): boolean {\n return typeof window === 'undefined';\n}\n\n/**\n * @param id The id to validate\n * @param errorToThrow Customized error to throw if the id is not valid\n *\n * @throws Error if id is not valid\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateId(id: string, errorToThrow?: Error): void {\n if (hasScriptTags(id) || !isIdLengthValid(id) || !isOpaque(id)) {\n throw errorToThrow || new Error('id is not valid.');\n }\n}\n\nexport function validateUrl(url: URL, errorToThrow?: Error): void {\n const urlString = url.toString().toLocaleLowerCase();\n if (hasScriptTags(urlString)) {\n throw errorToThrow || new Error('Invalid Url');\n }\n if (urlString.length > 2048) {\n throw errorToThrow || new Error('Url exceeds the maximum size of 2048 characters');\n }\n if (!isValidHttpsURL(url)) {\n throw errorToThrow || new Error('Url should be a valid https url');\n }\n}\n\n/**\n * This function takes in a string that represents a full or relative path and returns a\n * fully qualified URL object.\n *\n * Currently this is accomplished by assigning the input string to an a tag and then retrieving\n * the a tag's href value. A side effect of doing this is that the string becomes a fully qualified\n * URL. This is probably not how I would choose to do this, but in order to not unintentionally\n * break something I've preseved the functionality here and just isolated the code to make it\n * easier to mock.\n *\n * @example\n * `fullyQualifyUrlString('https://example.com')` returns `new URL('https://example.com')`\n * `fullyQualifyUrlString('helloWorld')` returns `new URL('https://example.com/helloWorld')`\n * `fullyQualifyUrlString('hello%20World')` returns `new URL('https://example.com/hello%20World')`\n *\n * @param fullOrRelativePath A string representing a full or relative URL.\n * @returns A fully qualified URL representing the input string.\n */\nexport function fullyQualifyUrlString(fullOrRelativePath: string): URL {\n const link = document.createElement('a');\n link.href = fullOrRelativePath;\n return new URL(link.href);\n}\n\n/**\n * The hasScriptTags function first decodes any HTML entities in the input string using the decodeHTMLEntities function.\n * It then tries to decode the result as a URI component. If the URI decoding fails (which would throw an error), it assumes that the input was not encoded and uses the original input.\n * Next, it defines a regular expression scriptRegex that matches any string that starts with <script (followed by any characters), then has any characters (including newlines),\n * and ends with </script> (preceded by any characters).\n * Finally, it uses the test method to check if the decoded input matches this regular expression. The function returns true if a match is found and false otherwise.\n * @param input URL converted to string to pattern match\n * @returns true if the input string contains a script tag, false otherwise\n */\nfunction hasScriptTags(input: string): boolean {\n let decodedInput;\n try {\n const decodedHTMLInput = decodeHTMLEntities(input);\n decodedInput = decodeURIComponent(decodedHTMLInput);\n } catch (e) {\n // input was not encoded, use it as is\n decodedInput = input;\n }\n const scriptRegex = /<script[^>]*>[\\s\\S]*?<\\/script[^>]*>/gi;\n return scriptRegex.test(decodedInput);\n}\n\n/**\n * The decodeHTMLEntities function replaces HTML entities in the input string with their corresponding characters.\n */\nfunction decodeHTMLEntities(input: string): string {\n const entityMap = new Map<string, string>([\n ['<', '<'],\n ['>', '>'],\n ['&', '&'],\n ['"', '\"'],\n [''', \"'\"],\n ['/', '/'],\n ]);\n entityMap.forEach((value, key) => {\n input = input.replace(new RegExp(key, 'gi'), value);\n });\n return input;\n}\n\nfunction isIdLengthValid(id: string): boolean {\n return id.length < 256 && id.length > 4;\n}\n\nfunction isOpaque(id: string): boolean {\n for (let i = 0; i < id.length; i++) {\n const charCode = id.charCodeAt(i);\n if (charCode < 32 || charCode > 126) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @param id The ID to validate against the UUID format\n * @throws Error if ID is not a valid UUID\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateUuid(id: string | undefined | null): void {\n if (!id) {\n throw new Error('id must not be empty');\n }\n if (uuid.validate(id) === false) {\n throw new Error('id must be a valid UUID');\n }\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { errorRuntimeNotInitialized, errorRuntimeNotSupported } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { getLogger } from '../internal/telemetry';\nimport { compareSDKVersions, deepFreeze } from '../internal/utils';\nimport { HostClientType, teamsMinAdaptiveCardVersion } from './constants';\nimport { HostVersionsInfo } from './interfaces';\n\nconst runtimeLogger = getLogger('runtime');\n\nexport interface IBaseRuntime {\n readonly apiVersion: number;\n readonly hostVersionsInfo?: HostVersionsInfo;\n readonly isLegacyTeams?: boolean;\n readonly supports?: {};\n}\n\n/**\n * Latest runtime interface version\n */\nexport type Runtime = IRuntimeV4;\n\nexport const latestRuntimeApiVersion = 4;\n\nfunction isLatestRuntimeVersion(runtime: IBaseRuntime): runtime is Runtime {\n return runtime.apiVersion === latestRuntimeApiVersion;\n}\n\ninterface IRuntimeV1 extends IBaseRuntime {\n readonly apiVersion: 1;\n readonly isLegacyTeams?: boolean;\n readonly supports: {\n readonly appEntity?: {};\n readonly appInstallDialog?: {};\n readonly barCode?: {};\n readonly calendar?: {};\n readonly call?: {};\n readonly chat?: {};\n readonly conversations?: {};\n readonly dialog?: {\n readonly bot?: {};\n readonly update?: {};\n };\n readonly geoLocation?: {\n readonly map?: {};\n };\n readonly location?: {};\n readonly logs?: {};\n readonly mail?: {};\n readonly meetingRoom?: {};\n readonly menus?: {};\n readonly monetization?: {};\n readonly notifications?: {};\n readonly pages?: {\n readonly appButton?: {};\n readonly backStack?: {};\n readonly config?: {};\n readonly currentApp?: {};\n readonly fullTrust?: {};\n readonly tabs?: {};\n };\n readonly people?: {};\n readonly permissions?: {};\n readonly profile?: {};\n readonly remoteCamera?: {};\n readonly search?: {};\n readonly sharing?: {};\n readonly stageView?: {};\n readonly teams?: {\n readonly fullTrust?: {\n readonly joinedTeams?: {};\n };\n };\n readonly teamsCore?: {};\n readonly video?: {\n readonly mediaStream?: {};\n readonly sharedFrame?: {};\n };\n readonly webStorage?: {};\n };\n}\n\ninterface IRuntimeV2 extends IBaseRuntime {\n readonly apiVersion: 2;\n readonly hostVersionsInfo?: HostVersionsInfo;\n readonly isLegacyTeams?: boolean;\n readonly supports: {\n readonly appEntity?: {};\n readonly appInstallDialog?: {};\n readonly appNotification?: {};\n readonly barCode?: {};\n readonly calendar?: {};\n readonly call?: {};\n readonly chat?: {};\n readonly conversations?: {};\n readonly dialog?: {\n readonly card?: {\n readonly bot?: {};\n };\n readonly url?: {\n readonly bot?: {};\n };\n readonly update?: {};\n };\n readonly geoLocation?: {\n readonly map?: {};\n };\n readonly interactive?: {};\n readonly secondaryBrowser?: {};\n readonly location?: {};\n readonly logs?: {};\n readonly mail?: {};\n readonly marketplace?: {};\n readonly meetingRoom?: {};\n readonly menus?: {};\n readonly monetization?: {};\n readonly notifications?: {};\n readonly pages?: {\n readonly appButton?: {};\n readonly backStack?: {};\n readonly config?: {};\n readonly currentApp?: {};\n readonly fullTrust?: {};\n readonly tabs?: {};\n };\n readonly people?: {};\n readonly permissions?: {};\n readonly profile?: {};\n readonly remoteCamera?: {};\n readonly search?: {};\n readonly sharing?: {};\n readonly stageView?: {};\n readonly teams?: {\n readonly fullTrust?: {\n readonly joinedTeams?: {};\n };\n };\n readonly teamsCore?: {};\n readonly video?: {\n readonly mediaStream?: {};\n readonly sharedFrame?: {};\n };\n readonly webStorage?: {};\n };\n}\n\ninterface IRuntimeV3 extends IBaseRuntime {\n readonly apiVersion: 3;\n readonly hostVersionsInfo?: HostVersionsInfo;\n readonly isNAAChannelRecommended?: boolean;\n readonly isLegacyTeams?: boolean;\n readonly supports: {\n readonly appEntity?: {};\n readonly appInstallDialog?: {};\n readonly barCode?: {};\n readonly calendar?: {};\n readonly call?: {};\n readonly chat?: {};\n readonly clipboard?: {};\n readonly conversations?: {};\n readonly dialog?: {\n readonly card?: {\n readonly bot?: {};\n };\n readonly url?: {\n readonly bot?: {};\n };\n readonly update?: {};\n };\n readonly externalAppAuthentication?: {};\n readonly externalAppCardActions?: {};\n readonly geoLocation?: {\n readonly map?: {};\n };\n readonly interactive?: {};\n readonly secondaryBrowser?: {};\n readonly location?: {};\n readonly logs?: {};\n readonly mail?: {};\n readonly marketplace?: {};\n readonly meetingRoom?: {};\n readonly menus?: {};\n readonly monetization?: {};\n readonly nestedAppAuth?: {};\n readonly notifications?: {};\n readonly pages?: {\n readonly appButton?: {};\n readonly backStack?: {};\n readonly config?: {};\n readonly currentApp?: {};\n readonly fullTrust?: {};\n readonly tabs?: {};\n };\n readonly people?: {};\n readonly permissions?: {};\n readonly profile?: {};\n readonly remoteCamera?: {};\n readonly search?: {};\n readonly sharing?: {};\n readonly stageView?: {};\n readonly teams?: {\n readonly fullTrust?: {\n readonly joinedTeams?: {};\n };\n };\n readonly thirdPartyCloudStorage?: {};\n readonly teamsCore?: {};\n readonly video?: {\n readonly mediaStream?: {};\n readonly sharedFrame?: {};\n };\n readonly visualMedia?: {\n readonly image?: {};\n };\n readonly webStorage?: {};\n };\n}\n\ninterface IRuntimeV4 extends IBaseRuntime {\n readonly apiVersion: 4;\n readonly hostVersionsInfo?: HostVersionsInfo;\n readonly isNAAChannelRecommended?: boolean;\n readonly isLegacyTeams?: boolean;\n readonly supports: {\n readonly appEntity?: {};\n readonly appInstallDialog?: {};\n readonly barCode?: {};\n readonly calendar?: {};\n readonly call?: {};\n readonly chat?: {};\n readonly clipboard?: {};\n readonly conversations?: {};\n readonly dialog?: {\n readonly card?: {\n readonly bot?: {};\n };\n readonly url?: {\n readonly bot?: {};\n readonly parentCommunication?: {};\n };\n readonly update?: {};\n };\n readonly externalAppAuthentication?: {};\n readonly externalAppCardActions?: {};\n readonly externalAppCommands?: {};\n readonly geoLocation?: {\n readonly map?: {};\n };\n readonly hostEntity?: {\n readonly tab?: {};\n };\n readonly interactive?: {};\n readonly secondaryBrowser?: {};\n readonly location?: {};\n readonly logs?: {};\n readonly mail?: {};\n readonly marketplace?: {};\n readonly meetingRoom?: {};\n readonly menus?: {};\n readonly messageChannels?: {\n readonly telemetry?: {};\n readonly dataLayer?: {};\n };\n readonly monetization?: {};\n readonly nestedAppAuth?: {};\n readonly notifications?: {};\n readonly otherAppStateChange?: {};\n readonly pages?: {\n readonly appButton?: {};\n readonly backStack?: {};\n readonly config?: {};\n readonly currentApp?: {};\n readonly fullTrust?: {};\n readonly tabs?: {};\n };\n readonly people?: {};\n readonly permissions?: {};\n readonly profile?: {};\n readonly remoteCamera?: {};\n readonly search?: {};\n readonly sharing?: {\n readonly history?: {};\n };\n readonly stageView?: {\n readonly self?: {};\n };\n readonly teams?: {\n readonly fullTrust?: {\n readonly joinedTeams?: {};\n };\n };\n readonly thirdPartyCloudStorage?: {};\n readonly teamsCore?: {};\n readonly video?: {\n readonly mediaStream?: {};\n readonly sharedFrame?: {};\n };\n readonly visualMedia?: {\n readonly image?: {};\n };\n readonly webStorage?: {};\n };\n}\n// Constant used to set the runtime configuration\nconst _uninitializedRuntime: UninitializedRuntime = {\n apiVersion: -1,\n supports: {},\n};\n\ninterface UninitializedRuntime extends IBaseRuntime {\n readonly apiVersion: -1;\n readonly supports: {};\n}\n\n/**\n * @hidden\n * Ensures that the runtime has been initialized\n\n * @returns True if the runtime has been initialized\n * @throws Error if the runtime has not been initialized\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isRuntimeInitialized(runtime: IBaseRuntime): runtime is Runtime {\n if (isLatestRuntimeVersion(runtime)) {\n return true;\n } else if (runtime.apiVersion === -1) {\n throw new Error(errorRuntimeNotInitialized);\n } else {\n throw new Error(errorRuntimeNotSupported);\n }\n}\n\nexport let runtime: Runtime | UninitializedRuntime = _uninitializedRuntime;\n\n/**\n * This object is used as the default runtime for versions of Teams which don't pass a runtime object during\n * initialization. If the host DOES pass a runtime object during init, then this object is not used.\n *\n * In practice, this is used in Teams V1 and ALL versions of Teams mobile since they are the only hosts\n * that don't pass a runtime object during initialization (since they don't use the host SDK).\n *\n * If there are certain versions of Teams V1 or Teams mobile which support a capability but not ALL\n * versions, then you should modify the mapTeamsVersionToSupportedCapabilities structure for that purpose. That\n * structure allows you to specify particular versions on particular platforms that support certain capabilities.\n * This structure is version agnostic.\n *\n * In practice, if you are adding a new capability, you are likely only to need to update mapTeamsVersionToSupportedCapabilities\n * and NOT this structure, as this structure is effectively only used for capabilities that have existed \"forever.\"\n *\n * Remember that everything here all still ONLY applies to versions of Teams that don't pass a runtime object during\n * initialization -- if they do, then neither this object nor the mapTeamsVersionToSupportedCapabilities structure is\n * used -- all runtime capabilities are dynamically discovered at runtime in the case where the runtime object is passed\n * during initialization.\n */\nexport const versionAndPlatformAgnosticTeamsRuntimeConfig: Runtime = {\n apiVersion: 4,\n isNAAChannelRecommended: false,\n hostVersionsInfo: teamsMinAdaptiveCardVersion,\n isLegacyTeams: true,\n supports: {\n appInstallDialog: {},\n appEntity: {},\n call: {},\n chat: {},\n conversations: {},\n dialog: {\n card: {\n bot: {},\n },\n url: {\n bot: {},\n parentCommunication: {},\n },\n update: {},\n },\n interactive: {},\n logs: {},\n meetingRoom: {},\n menus: {},\n monetization: {},\n notifications: {},\n pages: {\n config: {},\n backStack: {},\n fullTrust: {},\n },\n remoteCamera: {},\n teams: {\n fullTrust: {},\n },\n teamsCore: {},\n video: {\n sharedFrame: {},\n },\n },\n};\n\nexport interface ICapabilityReqs {\n readonly capability: object;\n readonly hostClientTypes: Array<string>;\n}\n\nconst v1NonMobileHostClientTypes = [\n HostClientType.desktop,\n HostClientType.web,\n HostClientType.rigel,\n HostClientType.surfaceHub,\n HostClientType.teamsRoomsWindows,\n HostClientType.teamsRoomsAndroid,\n HostClientType.teamsPhones,\n HostClientType.teamsDisplays,\n];\n\nexport const v1MobileHostClientTypes = [HostClientType.android, HostClientType.ios, HostClientType.ipados];\n\nexport const v1HostClientTypes = [...v1NonMobileHostClientTypes, ...v1MobileHostClientTypes];\n\n/**\n * @hidden\n * `upgradeToNextVersion` transforms runtime of version `versionToUpgradeFrom` to the next higher version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\ninterface IRuntimeUpgrade {\n versionToUpgradeFrom: number;\n upgradeToNextVersion: (previousVersionRuntime: IBaseRuntime) => IBaseRuntime;\n}\n\n/**\n * @hidden\n * Uses upgradeChain to transform an outdated runtime object to the latest format.\n * @param outdatedRuntime - The runtime object to be upgraded\n * @returns The upgraded runtime object\n * @throws Error if the runtime object could not be upgraded to the latest version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function fastForwardRuntime(outdatedRuntime: IBaseRuntime): Runtime {\n let runtime = outdatedRuntime;\n if (runtime.apiVersion < latestRuntimeApiVersion) {\n upgradeChain.forEach((upgrade) => {\n if (runtime.apiVersion === upgrade.versionToUpgradeFrom) {\n runtime = upgrade.upgradeToNextVersion(runtime);\n }\n });\n }\n if (isLatestRuntimeVersion(runtime)) {\n return runtime;\n } else {\n throw new Error('Received a runtime that could not be upgraded to the latest version');\n }\n}\n\n/**\n * @hidden\n * List of transformations required to upgrade a runtime object from a previous version to the next higher version.\n * This list must be ordered from lowest version to highest version\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const upgradeChain: IRuntimeUpgrade[] = [\n {\n versionToUpgradeFrom: 1,\n upgradeToNextVersion: (previousVersionRuntime: IRuntimeV1): IRuntimeV2 => {\n return {\n apiVersion: 2,\n hostVersionsInfo: undefined,\n isLegacyTeams: previousVersionRuntime.isLegacyTeams,\n supports: {\n ...previousVersionRuntime.supports,\n dialog: previousVersionRuntime.supports.dialog\n ? {\n card: undefined,\n url: previousVersionRuntime.supports.dialog,\n update: previousVersionRuntime.supports.dialog?.update,\n }\n : undefined,\n },\n };\n },\n },\n {\n versionToUpgradeFrom: 2,\n upgradeToNextVersion: (previousVersionRuntime: IRuntimeV2): IRuntimeV3 => {\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ /* Intentionally assigned to unused variable to delete propery when destructuring */\n const { appNotification: _, ...newSupports } = previousVersionRuntime.supports;\n return {\n ...previousVersionRuntime,\n apiVersion: 3,\n supports: newSupports,\n };\n },\n },\n {\n versionToUpgradeFrom: 3,\n upgradeToNextVersion: (previousVersionRuntime: IRuntimeV3): IRuntimeV4 => {\n return {\n apiVersion: 4,\n hostVersionsInfo: previousVersionRuntime.hostVersionsInfo,\n isNAAChannelRecommended: previousVersionRuntime.isNAAChannelRecommended,\n isLegacyTeams: previousVersionRuntime.isLegacyTeams,\n supports: {\n ...previousVersionRuntime.supports,\n dialog: previousVersionRuntime.supports.dialog\n ? {\n card: previousVersionRuntime.supports.dialog?.card,\n url: {\n bot: previousVersionRuntime.supports.dialog?.url?.bot,\n parentCommunication: previousVersionRuntime.supports.dialog?.url ? {} : undefined,\n },\n update: previousVersionRuntime.supports.dialog?.update,\n }\n : undefined,\n },\n };\n },\n },\n];\n\n/**\n * This structure is used for versions of Teams that don't pass a runtime object during initialization.\n * Please see the extensive comments in versionAndPlatformAgnosticTeamsRuntimeConfig for more information\n * on when and how to use this structure.\n */\nexport const mapTeamsVersionToSupportedCapabilities: Record<string, Array<ICapabilityReqs>> = {\n // 1.0.0 just signifies \"these capabilities have practically always been supported.\" For some of these\n // we don't know what the real first version that supported them was -- but it was long enough ago that\n // we can just effectively consider them always supported (on the specified platforms)\n '1.0.0': [\n {\n capability: { pages: { appButton: {}, tabs: {} }, stageView: {} },\n hostClientTypes: v1NonMobileHostClientTypes,\n },\n ],\n '1.9.0': [\n {\n capability: { location: {} },\n hostClientTypes: v1HostClientTypes,\n },\n ],\n '2.0.0': [\n {\n capability: { people: {} },\n hostClientTypes: v1HostClientTypes,\n },\n {\n capability: { sharing: {} },\n hostClientTypes: [HostClientType.desktop, HostClientType.web],\n },\n ],\n '2.0.1': [\n {\n capability: { teams: { fullTrust: { joinedTeams: {} } } },\n hostClientTypes: [\n HostClientType.android,\n HostClientType.desktop,\n HostClientType.ios,\n HostClientType.teamsRoomsAndroid,\n HostClientType.teamsPhones,\n HostClientType.teamsDisplays,\n HostClientType.web,\n ],\n },\n {\n capability: { webStorage: {} },\n hostClientTypes: [HostClientType.desktop],\n },\n ],\n '2.0.5': [\n {\n capability: { webStorage: {} },\n hostClientTypes: [HostClientType.android, HostClientType.ios],\n },\n ],\n '2.0.8': [\n {\n capability: { sharing: {} },\n hostClientTypes: [HostClientType.android, HostClientType.ios],\n },\n ],\n};\n\nconst generateBackCompatRuntimeConfigLogger = runtimeLogger.extend('generateBackCompatRuntimeConfig');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Merges the capabilities of two runtime objects. Fully supports arbitrarily nested capabilities/subcapabilities.\n *\n * Note that this function isn't actually doing anything specific to capabilities/runtime. It's just doing a\n * generic merge of two objects.\n *\n * This function is NOT intended to handle objects that are NOT \"shaped\" like runtime objects. Specifically\n * this means that it doesn't know how to merge values that aren't themselves objects. For example, it cannot\n * properly handle situations where both objects contain a string or number with the same property name since the proper way to\n * merge such values would be domain-dependent. For now it just happens to keep the value in the baseline and ignore the other.\n * Since the runtime is only supposed to have objects, this limitation is fine.\n *\n * @param baselineRuntime the baseline runtime object\n * @param runtimeToMergeIntoBaseline the runtime object to merge into the baseline\n * @returns the merged runtime object which is the union of baselineRuntime and runtimeToMergeIntoBaseline\n */\nfunction mergeRuntimeCapabilities(baselineRuntime: object, runtimeToMergeIntoBaseline: object): object {\n const merged: object = { ...baselineRuntime };\n\n for (const key in runtimeToMergeIntoBaseline) {\n if (Object.prototype.hasOwnProperty.call(runtimeToMergeIntoBaseline, key)) {\n if (typeof runtimeToMergeIntoBaseline[key] === 'object' && !Array.isArray(runtimeToMergeIntoBaseline[key])) {\n merged[key] = mergeRuntimeCapabilities(baselineRuntime[key] || {}, runtimeToMergeIntoBaseline[key]);\n } else {\n if (!(key in baselineRuntime)) {\n merged[key] = runtimeToMergeIntoBaseline[key];\n }\n }\n }\n }\n\n return merged;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Generates and returns a runtime configuration for host clients which are not on the latest host SDK version\n * and do not provide their own runtime config (this is just older versions of Teams on some platforms).\n * Their supported capabilities are based on the highest client SDK version that they can support.\n *\n * @param highestSupportedVersion - The highest client SDK version that the host client can support.\n * @returns runtime which describes the APIs supported by the legacy host client.\n */\nexport function generateVersionBasedTeamsRuntimeConfig(\n highestSupportedVersion: string,\n versionAgnosticRuntimeConfig: Runtime,\n mapVersionToSupportedCapabilities: Record<string, Array<ICapabilityReqs>>,\n): Runtime {\n generateBackCompatRuntimeConfigLogger('generating back compat runtime config for %s', highestSupportedVersion);\n\n let newSupports = { ...versionAgnosticRuntimeConfig.supports };\n\n generateBackCompatRuntimeConfigLogger(\n 'Supported capabilities in config before updating based on highestSupportedVersion: %o',\n newSupports,\n );\n\n Object.keys(mapVersionToSupportedCapabilities).forEach((versionNumber) => {\n if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {\n mapVersionToSupportedCapabilities[versionNumber].forEach((capabilityReqs) => {\n if (\n GlobalVars.hostClientType !== undefined &&\n capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)\n ) {\n newSupports = mergeRuntimeCapabilities(newSupports, capabilityReqs.capability);\n }\n });\n }\n });\n\n const teamsBackCompatRuntimeConfig: Runtime = {\n apiVersion: latestRuntimeApiVersion,\n hostVersionsInfo: teamsMinAdaptiveCardVersion,\n isLegacyTeams: true,\n supports: newSupports,\n };\n\n generateBackCompatRuntimeConfigLogger(\n 'Runtime config after updating based on highestSupportedVersion: %o',\n teamsBackCompatRuntimeConfig,\n );\n\n return teamsBackCompatRuntimeConfig;\n}\n\nconst applyRuntimeConfigLogger = runtimeLogger.extend('applyRuntimeConfig');\nexport function applyRuntimeConfig(runtimeConfig: IBaseRuntime): void {\n // Some hosts that have not adopted runtime versioning send a string for apiVersion, so we should handle those as v1 inputs\n if (typeof runtimeConfig.apiVersion === 'string') {\n applyRuntimeConfigLogger('Trying to apply runtime with string apiVersion, processing as v1: %o', runtimeConfig);\n runtimeConfig = {\n ...runtimeConfig,\n apiVersion: 1,\n };\n }\n applyRuntimeConfigLogger('Fast-forwarding runtime %o', runtimeConfig);\n const ffRuntimeConfig = fastForwardRuntime(runtimeConfig);\n applyRuntimeConfigLogger('Applying runtime %o', ffRuntimeConfig);\n runtime = deepFreeze(ffRuntimeConfig);\n}\n\nexport function setUnitializedRuntime(): void {\n runtime = deepFreeze(_uninitializedRuntime);\n}\n\n/**\n * @hidden\n * Constant used to set minimum runtime configuration\n * while un-initializing an app in unit test case.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const _minRuntimeConfigToUninitialize: Runtime = {\n apiVersion: latestRuntimeApiVersion,\n supports: {\n pages: {\n appButton: {},\n tabs: {},\n config: {},\n backStack: {},\n fullTrust: {},\n },\n teamsCore: {},\n logs: {},\n },\n};\n","// This assignment is replaced at build time by a webpack plugin (or Jest during unit tests) which ensures the value matches the version set in the package version\ndeclare const PACKAGE_VERSION = 'ERROR: This value should be replaced by webpack!';\n/**\n * @hidden\n * Package version.\n */\nexport const version = PACKAGE_VERSION;\n","import { HostClientType } from '../public/constants';\nimport { ErrorCode, SdkError } from '../public/interfaces';\nimport { IBaseRuntime, isRuntimeInitialized, Runtime } from '../public/runtime';\nimport {\n defaultSDKVersionForCompatCheck,\n errorLibraryNotInitialized,\n userOriginUrlValidationRegExp,\n} from './constants';\nimport { GlobalVars } from './globalVars';\nimport { getLogger } from './telemetry';\nimport { compareSDKVersions } from './utils';\n\nconst internalLogger = getLogger('internal');\nconst ensureInitializeCalledLogger = internalLogger.extend('ensureInitializeCalled');\nconst ensureInitializedLogger = internalLogger.extend('ensureInitialized');\n\n/**\n * Ensures `initialize` was called. This function does NOT verify that a response from Host was received and initialization completed.\n *\n * `ensureInitializeCalled` should only be used for APIs which:\n * - work in all FrameContexts\n * - are part of a required Capability\n * - are suspected to be used directly after calling `initialize`, potentially without awaiting the `initialize` call itself\n *\n * For most APIs {@link ensureInitialized} is the right validation function to use instead.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function ensureInitializeCalled(): void {\n if (!GlobalVars.initializeCalled) {\n ensureInitializeCalledLogger(errorLibraryNotInitialized);\n throw new Error(errorLibraryNotInitialized);\n }\n}\n\n/**\n * Ensures `initialize` was called and response from Host was received and processed and that `runtime` is initialized.\n * If expected FrameContexts are provided, it also validates that the current FrameContext matches one of the expected ones.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function ensureInitialized(runtime: IBaseRuntime, ...expectedFrameContexts: string[]): runtime is Runtime {\n // This global var can potentially be removed in the future if we use the initialization status of the runtime object as our source of truth\n if (!GlobalVars.initializeCompleted) {\n ensureInitializedLogger(\n '%s. initializeCalled: %s',\n errorLibraryNotInitialized,\n GlobalVars.initializeCalled.toString(),\n );\n throw new Error(errorLibraryNotInitialized);\n }\n\n if (expectedFrameContexts && expectedFrameContexts.length > 0) {\n let found = false;\n for (let i = 0; i < expectedFrameContexts.length; i++) {\n if (expectedFrameContexts[i] === GlobalVars.frameContext) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n throw new Error(\n `This call is only allowed in following contexts: ${JSON.stringify(expectedFrameContexts)}. ` +\n `Current context: \"${GlobalVars.frameContext}\".`,\n );\n }\n }\n return isRuntimeInitialized(runtime);\n}\n\n/**\n * @hidden\n * Checks whether the platform has knowledge of this API by doing a comparison\n * on API required version and platform supported version of the SDK\n *\n * @param requiredVersion - SDK version required by the API\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isCurrentSDKVersionAtLeast(requiredVersion: string = defaultSDKVersionForCompatCheck): boolean {\n const value = compareSDKVersions(GlobalVars.clientSupportedSDKVersion, requiredVersion);\n if (isNaN(value)) {\n return false;\n }\n return value >= 0;\n}\n\n/**\n * @hidden\n * Helper function to identify if host client is either android, ios, or ipados\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isHostClientMobile(): boolean {\n return (\n GlobalVars.hostClientType == HostClientType.android ||\n GlobalVars.hostClientType == HostClientType.ios ||\n GlobalVars.hostClientType == HostClientType.ipados\n );\n}\n\n/**\n * @hidden\n * Helper function which indicates if current API is supported on mobile or not.\n * @throws SdkError if host client is not android/ios or if the requiredVersion is not\n * supported by platform or not. Null is returned in case of success.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function throwExceptionIfMobileApiIsNotSupported(\n requiredVersion: string = defaultSDKVersionForCompatCheck,\n): void {\n if (!isHostClientMobile()) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n throw notSupportedError;\n } else if (!isCurrentSDKVersionAtLeast(requiredVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n throw oldPlatformError;\n }\n}\n\n/**\n * @hidden\n * Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp\n * which is used later for message source/origin validation\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function processAdditionalValidOrigins(validMessageOrigins: string[]): void {\n let combinedOriginUrls = GlobalVars.additionalValidOrigins.concat(\n validMessageOrigins.filter((_origin: string) => {\n return typeof _origin === 'string' && userOriginUrlValidationRegExp.test(_origin);\n }),\n );\n const dedupUrls: { [url: string]: boolean } = {};\n combinedOriginUrls = combinedOriginUrls.filter((_originUrl) => {\n if (dedupUrls[_originUrl]) {\n return false;\n }\n dedupUrls[_originUrl] = true;\n return true;\n });\n GlobalVars.additionalValidOrigins = combinedOriginUrls;\n}\n","export function isNullOrUndefined(value?: unknown): boolean {\n return value === null || value === undefined;\n}\n","import { validOriginsCdnEndpoint, validOriginsFallback } from './constants';\nimport { GlobalVars } from './globalVars';\nimport { getLogger } from './telemetry';\nimport { inServerSideRenderingEnvironment, isValidHttpsURL } from './utils';\n\nlet validOriginsCache: string[] = [];\nconst validateOriginLogger = getLogger('validateOrigin');\n\nexport async function prefetchOriginsFromCDN(): Promise<void> {\n await getValidOriginsListFromCDN();\n}\n\nfunction isValidOriginsCacheEmpty(): boolean {\n return validOriginsCache.length === 0;\n}\n\nasync function getValidOriginsListFromCDN(): Promise<string[]> {\n if (!isValidOriginsCacheEmpty()) {\n return validOriginsCache;\n }\n if (!inServerSideRenderingEnvironment()) {\n return fetch(validOriginsCdnEndpoint)\n .then((response) => {\n if (!response.ok) {\n throw new Error('Invalid Response from Fetch Call');\n }\n return response.json().then((validOriginsCDN) => {\n if (isValidOriginsJSONValid(JSON.stringify(validOriginsCDN))) {\n validOriginsCache = validOriginsCDN.validOrigins;\n return validOriginsCache;\n } else {\n throw new Error('Valid Origins List Is Invalid');\n }\n });\n })\n .catch((e) => {\n validateOriginLogger('validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list', e);\n validOriginsCache = validOriginsFallback;\n return validOriginsCache;\n });\n } else {\n validOriginsCache = validOriginsFallback;\n return validOriginsFallback;\n }\n}\n\nfunction isValidOriginsJSONValid(validOriginsJSON: string): boolean {\n let validOriginsCDN = JSON.parse(validOriginsJSON);\n try {\n validOriginsCDN = JSON.parse(validOriginsJSON);\n } catch (_) {\n return false;\n }\n if (!validOriginsCDN.validOrigins) {\n return false;\n }\n for (const validOrigin of validOriginsCDN.validOrigins) {\n try {\n new URL('https://' + validOrigin);\n } catch (_) {\n validateOriginLogger('isValidOriginsFromCDN call failed to validate origin: %s', validOrigin);\n return false;\n }\n }\n return true;\n}\n\n/**\n * @param pattern - reference pattern\n * @param host - candidate string\n * @returns returns true if host matches pre-know valid pattern\n *\n * @example\n * validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true\n * validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction validateHostAgainstPattern(pattern: string, host: string): boolean {\n if (pattern.substring(0, 2) === '*.') {\n const suffix = pattern.substring(1);\n if (\n host.length > suffix.length &&\n host.split('.').length === suffix.split('.').length &&\n host.substring(host.length - suffix.length) === suffix\n ) {\n return true;\n }\n } else if (pattern === host) {\n return true;\n }\n return false;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateOrigin(messageOrigin: URL): Promise<boolean> {\n return getValidOriginsListFromCDN().then((validOriginsList) => {\n // Check whether the url is in the pre-known allowlist or supplied by user\n if (!isValidHttpsURL(messageOrigin)) {\n validateOriginLogger(\n 'Origin %s is invalid because it is not using https protocol. Protocol being used: %s',\n messageOrigin,\n messageOrigin.protocol,\n );\n return false;\n }\n const messageOriginHost = messageOrigin.host;\n if (validOriginsList.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {\n return true;\n }\n\n for (const domainOrPattern of GlobalVars.additionalValidOrigins) {\n const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;\n if (validateHostAgainstPattern(pattern, messageOriginHost)) {\n return true;\n }\n }\n\n validateOriginLogger(\n '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',\n messageOrigin,\n validOriginsList,\n GlobalVars.additionalValidOrigins,\n );\n return false;\n });\n}\n","import { requestPortFromParentWithVersion } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag, getLogger } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n * Namespace to request message ports from the host application.\n *\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace messageChannels {\n export namespace telemetry {\n let telemetryPort: MessagePort | undefined;\n\n const messageChannelsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n const logger = getLogger('messageChannels.telemetry');\n /**\n * @hidden\n * @beta\n *\n * Fetches a MessagePort to batch telemetry through the host's telemetry worker.\n * The port is cached once received, so subsequent calls return the same port.\n * @returns MessagePort.\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed,\n * if the host does not support the feature, or if the port request is rejected.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export async function getTelemetryPort(): Promise<MessagePort> {\n // If the port has already been initialized, return it.\n if (telemetryPort) {\n logger('Returning telemetry port from cache');\n return telemetryPort;\n }\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n // Send request for telemetry port, will throw if the request is rejected\n telemetryPort = await requestPortFromParentWithVersion(\n getApiVersionTag(messageChannelsTelemetryVersionNumber, ApiName.MessageChannels_Telemetry_GetTelemetryPort),\n ApiName.MessageChannels_Telemetry_GetTelemetryPort,\n );\n return telemetryPort;\n }\n\n /**\n * @hidden\n *\n * @beta\n *\n * Checks if the messageChannels.telemetry capability is supported by the host\n * @returns boolean to represent whether the messageChannels.telemetry capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.messageChannels?.telemetry ? true : false;\n }\n\n /**\n * @hidden\n * Undocumented function used to clear state between unit tests\n *\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function _clearTelemetryPort(): void {\n telemetryPort = undefined;\n }\n }\n\n export namespace dataLayer {\n let dataLayerPort: MessagePort | undefined;\n\n const messageChannelsDataLayerVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n const logger = getLogger('messageChannels.dataLayer');\n /**\n * @hidden\n * @beta\n *\n * Fetches a MessagePort to allow access to the host's data layer worker.\n * The port is cached once received, so subsequent calls return the same port.\n * @returns MessagePort.\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed,\n * if the host does not support the feature, or if the port request is rejected.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export async function getDataLayerPort(): Promise<MessagePort> {\n // If the port has already been initialized, return it.\n if (dataLayerPort) {\n logger('Returning dataLayer port from cache');\n return dataLayerPort;\n }\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n // Send request for telemetry port, will throw if the request is rejected\n dataLayerPort = await requestPortFromParentWithVersion(\n getApiVersionTag(messageChannelsDataLayerVersionNumber, ApiName.MessageChannels_DataLayer_GetDataLayerPort),\n ApiName.MessageChannels_DataLayer_GetDataLayerPort,\n );\n return dataLayerPort;\n }\n\n /**\n * @hidden\n *\n * @beta\n *\n * Checks if the messageChannels.dataLayer capability is supported by the host\n * @returns boolean to represent whether the messageChannels.dataLayer capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.messageChannels?.dataLayer ? true : false;\n }\n\n /**\n * @hidden\n * Undocumented function used to clear state between unit tests\n *\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function _clearDataLayerPort(): void {\n dataLayerPort = undefined;\n }\n }\n\n /**\n * @hidden\n *\n * @beta\n *\n * Checks if the messageChannels capability is supported by the host\n * @returns boolean to represent whether the messageChannels capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.messageChannels ? true : false;\n }\n}\n","import {\n Communication,\n sendMessageEventToChild,\n sendMessageToParent,\n sendMessageToParentAsync,\n waitForMessageQueue,\n} from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitializeCalled, ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { fullyQualifyUrlString, validateUrl } from '../internal/utils';\nimport { FrameContexts, HostClientType } from './constants';\nimport { SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace to interact with the authentication-specific part of the SDK.\n *\n * This object is used for starting or completing authentication flows.\n */\n\n/**\n * Exceptional APIs telemetry versioning file: v1 and v2 APIs are mixed together in this file\n */\nconst authenticationTelemetryVersionNumber_v1: ApiVersionNumber = ApiVersionNumber.V_1;\nconst authenticationTelemetryVersionNumber_v2: ApiVersionNumber = ApiVersionNumber.V_2;\n\nexport namespace authentication {\n let authHandlers: { success: (string) => void; fail: (string) => void } | undefined;\n let authWindowMonitor: number | undefined;\n\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use; automatically called when library is initialized\n */\n export function initialize(): void {\n registerHandler(\n getApiVersionTag(\n authenticationTelemetryVersionNumber_v1,\n ApiName.Authentication_RegisterAuthenticateSuccessHandler,\n ),\n 'authentication.authenticate.success',\n handleSuccess,\n false,\n );\n registerHandler(\n getApiVersionTag(\n authenticationTelemetryVersionNumber_v1,\n ApiName.Authentication_RegisterAuthenticateFailureHandler,\n ),\n 'authentication.authenticate.failure',\n handleFailure,\n false,\n );\n }\n\n let authParams: AuthenticateParameters | undefined;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, this function has been deprecated in favor of a Promise-based pattern using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}\n *\n * Registers handlers to be called with the result of an authentication flow triggered using {@link authentication.authenticate authentication.authenticate(authenticateParameters?: AuthenticateParameters): void}\n *\n * @param authenticateParameters - Configuration for authentication flow pop-up result communication\n */\n export function registerAuthenticationHandlers(authenticateParameters: AuthenticateParameters): void {\n authParams = authenticateParameters;\n }\n\n /**\n * Initiates an authentication flow which requires a new window.\n * There are two primary uses for this function:\n * 1. When your app needs to authenticate using a 3rd-party identity provider (not Microsoft Entra ID)\n * 2. When your app needs to show authentication UI that is blocked from being shown in an iframe (e.g., Microsoft Entra consent prompts)\n *\n * For more details, see [Enable authentication using third-party OAuth provider](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab)\n *\n * This function is *not* needed for \"standard\" Microsoft Entra SSO usage. Using {@link getAuthToken} is usually sufficient in that case. For more, see\n * [Enable SSO for tab apps](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview))\n *\n * @remarks\n * The authentication flow must start and end from the same domain, otherwise success and failure messages won't be returned to the window that initiated the call.\n * The [Teams authentication flow](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab) starts and ends at an endpoint on\n * your own service (with a redirect round-trip to the 3rd party identity provider in the middle).\n *\n * @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow\n *\n * @returns `Promise` that will be fulfilled with the result from the authentication pop-up, if successful. The string in this result is provided in the parameter\n * passed by your app when it calls {@link authentication.notifySuccess authentication.notifySuccess(result?: string): void} in the pop-up window after returning from the identity provider redirect.\n *\n * @throws `Error` if the authentication request fails or is canceled by the user. This error is provided in the parameter passed by your app when it calls\n * {@link authentication.notifyFailure authentication.notifyFailure(result?: string): void} in the pop-up window after returning from the identity provider redirect. However, in some cases it can also be provided by\n * the infrastructure depending on the failure (e.g., a user cancelation)\n *\n */\n export function authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise<string>;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} instead.\n *\n * The documentation for {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} applies\n * to this function.\n * The one difference is that instead of the result being returned via the `Promise`, the result is returned to the callback functions provided in the\n * `authenticateParameters` parameter.\n *\n * @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow and callbacks used for indicating the result\n *\n */\n export function authenticate(authenticateParameters?: AuthenticateParameters): void;\n export function authenticate(authenticateParameters?: AuthenticateParameters): Promise<string> {\n const isDifferentParamsInCall: boolean = authenticateParameters !== undefined;\n const authenticateParams: AuthenticateParameters | undefined = isDifferentParamsInCall\n ? authenticateParameters\n : authParams;\n if (!authenticateParams) {\n throw new Error('No parameters are provided for authentication');\n }\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n const apiVersionTag =\n authenticateParams.successCallback || authenticateParams.failureCallback\n ? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_Authenticate)\n : getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_Authenticate);\n return authenticateHelper(apiVersionTag, authenticateParams)\n .then((value: string) => {\n try {\n if (authenticateParams && authenticateParams.successCallback) {\n authenticateParams.successCallback(value);\n return '';\n }\n return value;\n } finally {\n if (!isDifferentParamsInCall) {\n authParams = undefined;\n }\n }\n })\n .catch((err: Error) => {\n try {\n if (authenticateParams && authenticateParams.failureCallback) {\n authenticateParams.failureCallback(err.message);\n return '';\n }\n throw err;\n } finally {\n if (!isDifferentParamsInCall) {\n authParams = undefined;\n }\n }\n });\n }\n\n function authenticateHelper(apiVersionTag: string, authenticateParameters: AuthenticateParameters): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n if (GlobalVars.hostClientType !== HostClientType.web) {\n // Convert any relative URLs into absolute URLs before sending them over to the parent window.\n const fullyQualifiedURL: URL = fullyQualifyUrlString(authenticateParameters.url);\n validateUrl(fullyQualifiedURL);\n\n // Ask the parent window to open an authentication window with the parameters provided by the caller.\n resolve(\n sendMessageToParentAsync<[boolean, string]>(apiVersionTag, 'authentication.authenticate', [\n fullyQualifiedURL.href,\n authenticateParameters.width,\n authenticateParameters.height,\n authenticateParameters.isExternal,\n ]).then(([success, response]: [boolean, string]) => {\n if (success) {\n return response;\n } else {\n throw new Error(response);\n }\n }),\n );\n } else {\n // Open an authentication window with the parameters provided by the caller.\n authHandlers = {\n success: resolve,\n fail: reject,\n };\n openAuthenticationWindow(authenticateParameters);\n }\n });\n }\n\n /**\n * Requests an Microsoft Entra token to be issued on behalf of your app in an SSO flow.\n * The token is acquired from the cache if it is not expired. Otherwise a request is sent to Microsoft Entra to\n * obtain a new token.\n * This function is used to enable SSO scenarios. See [Enable SSO for tab apps](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview)\n * for more details.\n *\n * @param authTokenRequest - An optional set of values that configure the token request.\n *\n * @returns `Promise` that will be resolved with the token, if successful.\n *\n * @throws `Error` if the request fails in some way\n */\n export function getAuthToken(authTokenRequest?: AuthTokenRequestParameters): Promise<string>;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\\<string\\>} instead.\n *\n * The documentation {@link authentication.getAuthToken authentication.getAuthToken(authTokenRequest: AuthTokenRequestParameters): Promise\\<string\\>} applies to this\n * function as well. The one difference when using this function is that the result is provided in the callbacks in the `authTokenRequest` parameter\n * instead of as a `Promise`.\n *\n * @param authTokenRequest - An optional set of values that configure the token request.\n * It contains callbacks to call in case of success/failure\n */\n export function getAuthToken(authTokenRequest?: AuthTokenRequest): void;\n export function getAuthToken(authTokenRequest?: AuthTokenRequest): Promise<string> {\n ensureInitializeCalled();\n const apiVersionTag =\n authTokenRequest && (authTokenRequest.successCallback || authTokenRequest.failureCallback)\n ? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_GetAuthToken)\n : getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_GetAuthToken);\n return getAuthTokenHelper(apiVersionTag, authTokenRequest)\n .then((value: string) => {\n if (authTokenRequest && authTokenRequest.successCallback) {\n authTokenRequest.successCallback(value);\n return '';\n }\n return value;\n })\n .catch((err: Error) => {\n if (authTokenRequest && authTokenRequest.failureCallback) {\n authTokenRequest.failureCallback(err.message);\n return '';\n }\n throw err;\n });\n }\n\n function getAuthTokenHelper(apiVersionTag: string, authTokenRequest?: AuthTokenRequest): Promise<string> {\n return new Promise<[boolean, string]>((resolve) => {\n resolve(\n sendMessageToParentAsync(apiVersionTag, 'authentication.getAuthToken', [\n authTokenRequest?.resources,\n authTokenRequest?.claims,\n authTokenRequest?.silent,\n authTokenRequest?.tenantId,\n ]),\n );\n }).then(([success, result]: [boolean, string]) => {\n if (success) {\n return result;\n } else {\n throw new Error(result);\n }\n });\n }\n\n /**\n * @hidden\n * Requests the decoded Microsoft Entra user identity on behalf of the app.\n *\n * @returns Promise that resolves with the {@link UserProfile}.\n *\n * @throws `Error` object in case of any problems, the most likely of which is that the calling app does not have appropriate permissions\n * to call this method.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUser(): Promise<UserProfile>;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link authentication.getUser authentication.getUser(): Promise\\<UserProfile\\>} instead.\n *\n * @hidden\n * Requests the decoded Microsoft Entra user identity on behalf of the app.\n *\n * @param userRequest - It passes success/failure callbacks in the userRequest object(deprecated)\n *\n * @throws `Error` object in case of any problems, the most likely of which is that the calling app does not have appropriate permissions\n * to call this method.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUser(userRequest: UserRequest): void;\n export function getUser(userRequest?: UserRequest): Promise<UserProfile | null> {\n ensureInitializeCalled();\n const apiVersionTag =\n userRequest && (userRequest.successCallback || userRequest.failureCallback)\n ? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_GetUser)\n : getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_GetUser);\n return getUserHelper(apiVersionTag)\n .then((value: UserProfile) => {\n if (userRequest && userRequest.successCallback) {\n userRequest.successCallback(value);\n return null;\n }\n return value;\n })\n .catch((err: SdkError) => {\n const errorMessage = `Error returned, code = ${err.errorCode}, message = ${err.message}`;\n if (userRequest && userRequest.failureCallback) {\n userRequest.failureCallback(errorMessage);\n return null;\n }\n throw new Error(errorMessage);\n });\n }\n\n function getUserHelper(apiVersionTag: string): Promise<UserProfile> {\n return new Promise<[boolean, UserProfile | SdkError]>((resolve) => {\n resolve(sendMessageToParentAsync(apiVersionTag, 'authentication.getUser'));\n }).then(([success, result]: [boolean, UserProfile | SdkError]) => {\n if (success) {\n return result as UserProfile;\n } else {\n throw result;\n }\n });\n }\n\n function closeAuthenticationWindow(): void {\n // Stop monitoring the authentication window\n stopAuthenticationWindowMonitor();\n // Try to close the authentication window and clear all properties associated with it\n try {\n if (Communication.childWindow) {\n Communication.childWindow.close();\n }\n } finally {\n Communication.childWindow = null;\n Communication.childOrigin = null;\n }\n }\n\n /**\n * Different browsers handle authentication flows in pop-up windows differently.\n * Firefox and Safari, which use Quantum and WebKit browser engines respectively, block the use of 'window.open' for pop-up windows.\n * Any chrome-based browser (Chrome, Edge, Brave, etc.) opens a new browser window without any user-prompts.\n * To ensure consistent behavior across all browsers, consider using the following function to create a new authentication window.\n *\n * @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow.\n */\n function openAuthenticationWindow(authenticateParameters: AuthenticateParameters): void {\n // Close the previously opened window if we have one\n closeAuthenticationWindow();\n // Start with a sensible default size\n let width = authenticateParameters.width || 600;\n let height = authenticateParameters.height || 400;\n // Ensure that the new window is always smaller than our app's window so that it never fully covers up our app\n width = Math.min(width, Communication.currentWindow.outerWidth - 400);\n height = Math.min(height, Communication.currentWindow.outerHeight - 200);\n\n // Convert any relative URLs into absolute URLs before sending them over to the parent window\n const fullyQualifiedURL = fullyQualifyUrlString(authenticateParameters.url.replace('{oauthRedirectMethod}', 'web'));\n validateUrl(fullyQualifiedURL);\n\n // We are running in the browser, so we need to center the new window ourselves\n let left: number =\n typeof Communication.currentWindow.screenLeft !== 'undefined'\n ? Communication.currentWindow.screenLeft\n : Communication.currentWindow.screenX;\n let top: number =\n typeof Communication.currentWindow.screenTop !== 'undefined'\n ? Communication.currentWindow.screenTop\n : Communication.currentWindow.screenY;\n left += Communication.currentWindow.outerWidth / 2 - width / 2;\n top += Communication.currentWindow.outerHeight / 2 - height / 2;\n // Open a child window with a desired set of standard browser features\n Communication.childWindow = Communication.currentWindow.open(\n fullyQualifiedURL.href,\n '_blank',\n 'toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top=' +\n top +\n ', left=' +\n left +\n ', width=' +\n width +\n ', height=' +\n height,\n );\n if (Communication.childWindow) {\n // Start monitoring the authentication window so that we can detect if it gets closed before the flow completes\n startAuthenticationWindowMonitor();\n } else {\n // If we failed to open the window, fail the authentication flow\n handleFailure('FailedToOpenWindow');\n }\n }\n\n function stopAuthenticationWindowMonitor(): void {\n if (authWindowMonitor) {\n clearInterval(authWindowMonitor);\n authWindowMonitor = 0;\n }\n removeHandler('initialize');\n removeHandler('navigateCrossDomain');\n }\n\n function startAuthenticationWindowMonitor(): void {\n // Stop the previous window monitor if one is running\n stopAuthenticationWindowMonitor();\n // Create an interval loop that\n // - Notifies the caller of failure if it detects that the authentication window is closed\n // - Keeps pinging the authentication window while it is open to re-establish\n // contact with any pages along the authentication flow that need to communicate\n // with us\n authWindowMonitor = Communication.currentWindow.setInterval(() => {\n if (!Communication.childWindow || Communication.childWindow.closed) {\n handleFailure('CancelledByUser');\n } else {\n const savedChildOrigin = Communication.childOrigin;\n try {\n Communication.childOrigin = '*';\n sendMessageEventToChild('ping');\n } finally {\n Communication.childOrigin = savedChildOrigin;\n }\n }\n }, 100);\n // Set up an initialize-message handler that gives the authentication window its frame context\n registerHandler(\n getApiVersionTag(\n authenticationTelemetryVersionNumber_v1,\n ApiName.Authentication_AuthenticationWindow_RegisterInitializeHandler,\n ),\n 'initialize',\n () => {\n return [FrameContexts.authentication, GlobalVars.hostClientType];\n },\n );\n // Set up a navigateCrossDomain message handler that blocks cross-domain re-navigation attempts\n // in the authentication window. We could at some point choose to implement this method via a call to\n // authenticationWindow.location.href = url; however, we would first need to figure out how to\n // validate the URL against the tab's list of valid domains.\n registerHandler(\n getApiVersionTag(\n authenticationTelemetryVersionNumber_v1,\n ApiName.Authentication_AuthenticationWindow_RegisterNavigateCrossDomainHandler,\n ),\n 'navigateCrossDomain',\n () => {\n return false;\n },\n );\n }\n\n /**\n * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}, the\n * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of\n * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} that the\n * authentication request was successful.\n *\n * @remarks\n * This function is usable only from the authentication window.\n * This call causes the authentication window to be closed.\n *\n * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives\n * this value in its callback or via the `Promise` return value\n */\n export function notifySuccess(result?: string): void;\n /**\n * @deprecated\n * This function used to have an unused optional second parameter called callbackUrl. Because it was not used, it has been removed.\n * Please use the {@link authentication.notifySuccess authentication.notifySuccess(result?: string): void} instead.\n */\n export function notifySuccess(result?: string, _callbackUrl?: string): void {\n ensureInitialized(runtime, FrameContexts.authentication);\n const apiVersionTag = _callbackUrl\n ? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_NotifySuccess)\n : getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_NotifySuccess);\n sendMessageToParent(apiVersionTag, 'authentication.authenticate.success', [result]);\n // Wait for the message to be sent before closing the window\n waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));\n }\n\n /**\n * When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}, the\n * window that was opened to execute the authentication flow should call this method after authentiction to notify the caller of\n * {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} that the\n * authentication request failed.\n\n *\n * @remarks\n * This function is usable only on the authentication window.\n * This call causes the authentication window to be closed.\n *\n * @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives\n * this value in its callback or via the `Promise` return value\n * @param _callbackUrl - This parameter is deprecated and unused\n */\n export function notifyFailure(result?: string): void;\n /**\n * @deprecated\n * This function used to have an unused optional second parameter called callbackUrl. Because it was not used, it has been removed.\n * Please use the {@link authentication.notifyFailure authentication.notifyFailure(result?: string): void} instead.\n */\n export function notifyFailure(reason?: string, _callbackUrl?: string): void {\n ensureInitialized(runtime, FrameContexts.authentication);\n const apiVersionTag = _callbackUrl\n ? getApiVersionTag(authenticationTelemetryVersionNumber_v1, ApiName.Authentication_NotifyFailure)\n : getApiVersionTag(authenticationTelemetryVersionNumber_v2, ApiName.Authentication_NotifyFailure);\n sendMessageToParent(apiVersionTag, 'authentication.authenticate.failure', [reason]);\n // Wait for the message to be sent before closing the window\n waitForMessageQueue(Communication.parentWindow, () => setTimeout(() => Communication.currentWindow.close(), 200));\n }\n\n function handleSuccess(result?: string): void {\n try {\n if (authHandlers) {\n authHandlers.success(result);\n }\n } finally {\n authHandlers = undefined;\n closeAuthenticationWindow();\n }\n }\n\n function handleFailure(reason?: string): void {\n try {\n if (authHandlers) {\n authHandlers.fail(new Error(reason));\n }\n } finally {\n authHandlers = undefined;\n closeAuthenticationWindow();\n }\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, this interface has been deprecated in favor of leveraging the `Promise` returned from {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>}\n *-------------------------\n * Used in {@link AuthenticateParameters} and {@link AuthTokenRequest}\n */\n export interface LegacyCallBacks {\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, this property has been deprecated in favor of a Promise-based pattern.\n *\n * A function that is called if the request succeeds.\n */\n successCallback?: (result: string) => void;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, this property has been deprecated in favor of a Promise-based pattern.\n *\n * A function that is called if the request fails, with the reason for the failure.\n */\n failureCallback?: (reason: string) => void;\n }\n\n /**\n * Describes the authentication pop-up parameters\n */\n export interface AuthenticatePopUpParameters {\n /**\n * The URL for the authentication pop-up.\n */\n url: string;\n /**\n * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n width?: number;\n /**\n * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n height?: number;\n /**\n * Some identity providers restrict their authentication pages from being displayed in embedded browsers (e.g., a web view inside of a native application)\n * If the identity provider you are using prevents embedded browser usage, this flag should be set to `true` to enable the authentication page specified in\n * the {@link url} property to be opened in an external browser.\n * If this flag is `false`, the page will be opened directly within the current hosting application.\n *\n * This flag is ignored when the host for the application is a web app (as opposed to a native application) as the behavior is unnecessary in a web-only\n * environment without an embedded browser.\n */\n isExternal?: boolean;\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\\<string\\>} and\n * the associated {@link AuthenticatePopUpParameters} instead.\n *\n * @see {@link LegacyCallBacks}\n */\n export type AuthenticateParameters = AuthenticatePopUpParameters & LegacyCallBacks;\n\n /**\n * Describes authentication token request parameters\n */\n export interface AuthTokenRequestParameters {\n /**\n * @hidden\n * @internal\n * An list of resources for which to acquire the access token; only for internal Microsoft usage\n */\n resources?: string[];\n /**\n * An optional list of claims which to pass to Microsoft Entra when requesting the access token.\n */\n claims?: string[];\n /**\n * An optional flag indicating whether to attempt the token acquisition silently or allow a prompt to be shown.\n */\n silent?: boolean;\n /**\n * An optional identifier of the home tenant for which to acquire the access token for (used in cross-tenant shared channels).\n */\n tenantId?: string;\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link AuthTokenRequestParameters} instead.\n */\n export type AuthTokenRequest = AuthTokenRequestParameters & LegacyCallBacks;\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface UserProfile {\n /**\n * @hidden\n * The intended recipient of the token. The application that receives the token must verify that the audience\n * value is correct and reject any tokens intended for a different audience.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n aud: string;\n /**\n * @hidden\n * Identifies how the subject of the token was authenticated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n amr: string[];\n /**\n * @hidden\n * Stores the time at which the token was issued. It is often used to measure token freshness.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n iat: number;\n /**\n * @hidden\n * Identifies the security token service (STS) that constructs and returns the token. In the tokens that Microsoft Entra\n * returns, the issuer is sts.windows.net. The GUID in the issuer claim value is the tenant ID of the Microsoft Entra\n * directory. The tenant ID is an immutable and reliable identifier of the directory.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n iss: string;\n /**\n * @hidden\n * Provides the last name, surname, or family name of the user as defined in the Microsoft Entra user object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n family_name: string;\n /**\n * @hidden\n * Provides the first or \"given\" name of the user, as set on the Microsoft Entra user object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n given_name: string;\n /**\n * @hidden\n * Provides a human-readable value that identifies the subject of the token. This value is not guaranteed to\n * be unique within a tenant and is designed to be used only for display purposes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n unique_name: string;\n /**\n * @hidden\n * Contains a unique identifier of an object in Microsoft Entra. This value is immutable and cannot be reassigned or\n * reused. Use the object ID to identify an object in queries to Microsoft Entra.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n oid: string;\n /**\n * @hidden\n * Identifies the principal about which the token asserts information, such as the user of an application.\n * This value is immutable and cannot be reassigned or reused, so it can be used to perform authorization\n * checks safely. Because the subject is always present in the tokens the Microsoft Entra issues, we recommended\n * using this value in a general-purpose authorization system.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n sub: string;\n /**\n * @hidden\n * An immutable, non-reusable identifier that identifies the directory tenant that issued the token. You can\n * use this value to access tenant-specific directory resources in a multitenant application. For example,\n * you can use this value to identify the tenant in a call to the Graph API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n tid: string;\n /**\n * @hidden\n * Defines the end of the time interval within which a token is valid. The service that validates the token\n * should verify that the current date is within the token lifetime; otherwise it should reject the token. The\n * service might allow for up to five minutes beyond the token lifetime to account for any differences in clock\n * time (\"time skew\") between Microsoft Entra and the service.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n exp: number;\n /**\n * @hidden\n * Defines the start of the time interval within which a token is valid. The service that validates the token\n * should verify that the current date is within the token lifetime; otherwise it should reject the token. The\n * service might allow for up to five minutes beyond the token lifetime to account for any differences in clock\n * time (\"time skew\") between Microsoft Entra and the service.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n nbf: number;\n /**\n * @hidden\n * Stores the user name of the user principal.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n upn: string;\n /**\n * @hidden\n * Stores the version number of the token.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n ver: string;\n /**\n * @hidden\n * Stores the data residency of the user.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n dataResidency?: DataResidency;\n }\n\n /**\n * @hidden\n * Limited set of data residencies information exposed to 1P application developers\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum DataResidency {\n /**\n * Public\n */\n Public = 'public',\n\n /**\n * European Union Data Boundary\n */\n EUDB = 'eudb',\n\n /**\n * Other, stored to cover fields that will not be exposed\n */\n Other = 'other',\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, this interface has been deprecated in favor of a Promise-based pattern.\n * @hidden\n * Describes the UserRequest. Success callback describes how a successful request is handled.\n * Failure callback describes how a failed request is handled.\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface UserRequest {\n /**\n * A function that is called if the token request succeeds, with the resulting token.\n */\n successCallback?: (user: UserProfile) => void;\n /**\n * A function that is called if the token request fails, with the reason for the failure.\n */\n failureCallback?: (reason: string) => void;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { isHostAdaptiveCardSchemaVersionUnsupported } from '../internal/utils';\nimport { DialogDimension, errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport {\n AdaptiveCardDialogInfo,\n BotAdaptiveCardDialogInfo,\n BotUrlDialogInfo,\n DialogInfo,\n DialogSize,\n M365ContentAction,\n TaskInfo,\n UrlDialogInfo,\n} from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst dialogTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\nexport function updateResizeHelper(apiVersionTag: string, dimensions: DialogSize): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.task,\n FrameContexts.meetingStage,\n );\n if (!dialog.update.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(apiVersionTag, 'tasks.updateTask', [dimensions]);\n}\n\nexport function urlOpenHelper(\n apiVersionTag: string,\n urlDialogInfo: UrlDialogInfo,\n submitHandler?: dialog.DialogSubmitHandler,\n messageFromChildHandler?: dialog.PostMessageChannel,\n): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!dialog.url.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (messageFromChildHandler) {\n registerHandler(\n getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_RegisterMessageForParentHandler),\n 'messageForParent',\n messageFromChildHandler,\n );\n }\n const dialogInfo: DialogInfo = dialog.url.getDialogInfoFromUrlDialogInfo(urlDialogInfo);\n sendMessageToParent(apiVersionTag, 'tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n removeHandler('messageForParent');\n });\n}\n\nexport function botUrlOpenHelper(\n apiVersionTag: string,\n urlDialogInfo: BotUrlDialogInfo,\n submitHandler?: dialog.DialogSubmitHandler,\n messageFromChildHandler?: dialog.PostMessageChannel,\n): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!dialog.url.bot.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (messageFromChildHandler) {\n registerHandler(\n getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Bot_RegisterMessageForParentHandler),\n 'messageForParent',\n messageFromChildHandler,\n );\n }\n const dialogInfo: DialogInfo = dialog.url.getDialogInfoFromBotUrlDialogInfo(urlDialogInfo);\n sendMessageToParent(apiVersionTag, 'tasks.startTask', [dialogInfo], (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n removeHandler('messageForParent');\n });\n}\n\nexport function urlSubmitHelper(apiVersionTag: string, result?: string | object, appIds?: string | string[]): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (!dialog.url.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients\n sendMessageToParent(apiVersionTag, 'tasks.completeTask', [\n result,\n appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : [],\n ]);\n}\n\n/**\n * This group of capabilities enables apps to show modal dialogs. There are two primary types of dialogs: URL-based dialogs and [Adaptive Card](https://learn.microsoft.com/adaptive-cards/) dialogs.\n * Both types of dialogs are shown on top of your app, preventing interaction with your app while they are displayed.\n * - URL-based dialogs allow you to specify a URL from which the contents will be shown inside the dialog.\n * - For URL dialogs, use the functions and interfaces in the {@link dialog.url} namespace.\n * - Adaptive Card-based dialogs allow you to provide JSON describing an Adaptive Card that will be shown inside the dialog.\n * - For Adaptive Card dialogs, use the functions and interfaces in the {@link dialog.adaptiveCard} namespace.\n *\n * @remarks Note that dialogs were previously called \"task modules\". While they have been renamed for clarity, the functionality has been maintained.\n * For more details, see [Dialogs](https://learn.microsoft.com/microsoftteams/platform/task-modules-and-cards/what-are-task-modules)\n *\n * @beta\n */\nexport namespace dialog {\n /**\n * Data Structure to represent the SDK response when dialog closes\n *\n * @beta\n */\n export interface ISdkResponse {\n /**\n * Error in case there is a failure before dialog submission\n */\n err?: string;\n\n /**\n * Value provided in the `result` parameter by the dialog when the {@linkcode url.submit} function\n * was called.\n * If the dialog was closed by the user without submitting (e.g., using a control in the corner\n * of the dialog), this value will be `undefined` here.\n */\n result?: string | object;\n }\n\n /**\n * Handler used to receive and process messages sent between a dialog and the app that launched it\n * @beta\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export type PostMessageChannel = (message: any) => void;\n\n /**\n * Handler used for receiving results when a dialog closes, either the value passed by {@linkcode url.submit}\n * or an error if the dialog was closed by the user.\n *\n * @see {@linkcode ISdkResponse}\n *\n * @beta\n */\n export type DialogSubmitHandler = (result: ISdkResponse) => void;\n const storedMessages: string[] = [];\n\n /**\n * @hidden\n * Hide from docs because this function is only used during initialization\n *\n * Adds register handlers for messageForChild upon initialization and only in the tasks FrameContext. {@link FrameContexts.task}\n * Function is called during app initialization\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function initialize(): void {\n registerHandler(\n getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_RegisterMessageForChildHandler),\n 'messageForChild',\n handleDialogMessage,\n false,\n );\n }\n\n function handleDialogMessage(message: string): void {\n if (!GlobalVars.frameContext) {\n // GlobalVars.frameContext is currently not set\n return;\n }\n\n if (GlobalVars.frameContext === FrameContexts.task) {\n storedMessages.push(message);\n } else {\n // Not in task FrameContext, remove 'messageForChild' handler\n removeHandler('messageForChild');\n }\n }\n\n export namespace url {\n /**\n * Allows app to open a url based dialog.\n *\n * @remarks\n * This function cannot be called from inside of a dialog\n *\n * @param urlDialogInfo - An object containing the parameters of the dialog module.\n * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode submit} function or when the user closes the dialog.\n * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.\n *\n * @beta\n */\n export function open(\n urlDialogInfo: UrlDialogInfo,\n submitHandler?: DialogSubmitHandler,\n messageFromChildHandler?: PostMessageChannel,\n ): void {\n urlOpenHelper(\n getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Open),\n urlDialogInfo,\n submitHandler,\n messageFromChildHandler,\n );\n }\n\n /**\n * Submit the dialog module and close the dialog\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it,\n * If this function is called from a dialog while {@link M365ContentAction} is set in the context object by the host, result will be ignored\n *\n * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.\n *\n * @beta\n */\n export function submit(result?: string | object, appIds?: string | string[]): void {\n urlSubmitHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Submit), result, appIds);\n }\n\n /**\n * Subcapability that allows communication between the dialog and the parent app.\n *\n * @remarks\n * Note that dialog can be invoked from parentless scenarios e.g. Search Message Extensions. The subcapability `parentCommunication` is not supported in such scenarios.\n *\n * @beta\n */\n export namespace parentCommunication {\n /**\n * Send message to the parent from dialog\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param message - The message to send to the parent\n *\n * @beta\n */\n export function sendMessageToParentFromDialog(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message: any,\n ): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent(\n getApiVersionTag(\n dialogTelemetryVersionNumber,\n ApiName.Dialog_Url_ParentCommunication_SendMessageToParentFromDialog,\n ),\n 'messageForParent',\n [message],\n );\n }\n\n /**\n * Send message to the dialog from the parent\n *\n * @param message - The message to send\n *\n * @beta\n */\n export function sendMessageToDialog(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message: any,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent(\n getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_ParentCommunication_SendMessageToDialog),\n 'messageForChild',\n [message],\n );\n }\n\n /**\n * Register a listener that will be triggered when a message is received from the app that opened the dialog.\n *\n * @remarks\n * This function is only intended to be called from code running within the dialog. Calling it from outside the dialog will have no effect.\n *\n * @param listener - The listener that will be triggered.\n *\n * @beta\n */\n export function registerOnMessageFromParent(listener: PostMessageChannel): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n // We need to remove the original 'messageForChild'\n // handler since the original does not allow for post messages.\n // It is replaced by the user specified listener that is passed in.\n removeHandler('messageForChild');\n registerHandler(\n getApiVersionTag(\n dialogTelemetryVersionNumber,\n ApiName.Dialog_Url_ParentCommunication_RegisterMessageForChildHandler,\n ),\n 'messageForChild',\n listener,\n );\n storedMessages.reverse();\n while (storedMessages.length > 0) {\n const message = storedMessages.pop();\n listener(message);\n }\n }\n\n /**\n * Checks if dialog.url.parentCommunication capability is supported by the host\n *\n * @returns boolean to represent whether dialog.url.parentCommunication capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && !!runtime.supports.dialog?.url?.parentCommunication;\n }\n }\n\n /**\n * Checks if dialog.url module is supported by the host\n *\n * @returns boolean to represent whether dialog.url module is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && (runtime.supports.dialog && runtime.supports.dialog.url) !== undefined;\n }\n\n /**\n * Namespace to open a dialog that sends results to the bot framework\n *\n * @beta\n */\n export namespace bot {\n /**\n * Allows an app to open a dialog that sends submitted data to a bot.\n *\n * @param botUrlDialogInfo - An object containing the parameters of the dialog module including completionBotId.\n * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.\n * @param messageFromChildHandler - Handler that triggers if dialog sends a message to the app.\n *\n * @returns a function that can be used to send messages to the dialog.\n *\n * @beta\n */\n export function open(\n botUrlDialogInfo: BotUrlDialogInfo,\n submitHandler?: DialogSubmitHandler,\n messageFromChildHandler?: PostMessageChannel,\n ): void {\n botUrlOpenHelper(\n getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Bot_Open),\n botUrlDialogInfo,\n submitHandler,\n messageFromChildHandler,\n );\n }\n\n /**\n * Checks if dialog.url.bot capability is supported by the host\n *\n * @returns boolean to represent whether dialog.url.bot is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return (\n ensureInitialized(runtime) &&\n (runtime.supports.dialog && runtime.supports.dialog.url && runtime.supports.dialog.url.bot) !== undefined\n );\n }\n }\n\n /**\n * @hidden\n *\n * Convert UrlDialogInfo to DialogInfo to send the information to host in {@linkcode open} API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getDialogInfoFromUrlDialogInfo(urlDialogInfo: UrlDialogInfo): DialogInfo {\n const dialogInfo: DialogInfo = {\n url: urlDialogInfo.url,\n height: urlDialogInfo.size ? urlDialogInfo.size.height : DialogDimension.Small,\n width: urlDialogInfo.size ? urlDialogInfo.size.width : DialogDimension.Small,\n title: urlDialogInfo.title,\n fallbackUrl: urlDialogInfo.fallbackUrl,\n };\n return dialogInfo;\n }\n\n /**\n * @hidden\n *\n * Convert BotUrlDialogInfo to DialogInfo to send the information to host in {@linkcode bot.open} API.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo: BotUrlDialogInfo): DialogInfo {\n const dialogInfo: DialogInfo = getDialogInfoFromUrlDialogInfo(botUrlDialogInfo);\n dialogInfo.completionBotId = botUrlDialogInfo.completionBotId;\n return dialogInfo;\n }\n }\n\n /**\n * This function currently serves no purpose and should not be used. All functionality that used\n * to be covered by this method is now in subcapabilities and those isSupported methods should be\n * used directly.\n *\n * @hidden\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.dialog ? true : false;\n }\n\n /**\n * Namespace to update the dialog\n *\n * @beta\n */\n export namespace update {\n /**\n * Update dimensions - height/width of a dialog.\n *\n * @param dimensions - An object containing width and height properties.\n *\n * @beta\n */\n export function resize(dimensions: DialogSize): void {\n updateResizeHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Update_Resize), dimensions);\n }\n\n /**\n * Checks if dialog.update capability is supported by the host\n * @returns boolean to represent whether dialog.update capabilty is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.dialog\n ? runtime.supports.dialog.update\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Subcapability for interacting with adaptive card dialogs\n * @beta\n */\n export namespace adaptiveCard {\n /**\n * Allows app to open an adaptive card based dialog.\n *\n * @remarks\n * This function cannot be called from inside of a dialog\n *\n * @param adaptiveCardDialogInfo - An object containing the parameters of the dialog module {@link AdaptiveCardDialogInfo}.\n * @param submitHandler - Handler that triggers when a dialog calls the {@linkcode url.submit} function or when the user closes the dialog.\n *\n * @beta\n */\n export function open(adaptiveCardDialogInfo: AdaptiveCardDialogInfo, submitHandler?: DialogSubmitHandler): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const dialogInfo: DialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo);\n sendMessageToParent(\n getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_AdaptiveCard_Open),\n 'tasks.startTask',\n [dialogInfo],\n (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n },\n );\n }\n\n /**\n * Checks if dialog.adaptiveCard module is supported by the host\n *\n * @returns boolean to represent whether dialog.adaptiveCard module is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n const isAdaptiveCardVersionSupported =\n runtime.hostVersionsInfo &&\n runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&\n !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);\n return (\n ensureInitialized(runtime) &&\n (isAdaptiveCardVersionSupported && runtime.supports.dialog && runtime.supports.dialog.card) !== undefined\n );\n }\n\n /**\n * Namespace for interaction with adaptive card dialogs that need to communicate with the bot framework\n *\n * @beta\n */\n export namespace bot {\n /**\n * Allows an app to open an adaptive card-based dialog module using bot.\n *\n * @param botAdaptiveCardDialogInfo - An object containing the parameters of the dialog module including completionBotId.\n * @param submitHandler - Handler that triggers when the dialog has been submitted or closed.\n *\n * @beta\n */\n export function open(\n botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo,\n submitHandler?: DialogSubmitHandler,\n ): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n const dialogInfo: DialogInfo = getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);\n\n sendMessageToParent(\n getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_AdaptiveCard_Bot_Open),\n 'tasks.startTask',\n [dialogInfo],\n (err: string, result: string | object) => {\n submitHandler?.({ err, result });\n },\n );\n }\n\n /**\n * Checks if dialog.adaptiveCard.bot capability is supported by the host\n *\n * @returns boolean to represent whether dialog.adaptiveCard.bot is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n const isAdaptiveCardVersionSupported =\n runtime.hostVersionsInfo &&\n runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&\n !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);\n return (\n ensureInitialized(runtime) &&\n (isAdaptiveCardVersionSupported &&\n runtime.supports.dialog &&\n runtime.supports.dialog.card &&\n runtime.supports.dialog.card.bot) !== undefined\n );\n }\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Convert AdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.\n *\n * @internal\n */\n function getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo: AdaptiveCardDialogInfo): DialogInfo {\n const dialogInfo: DialogInfo = {\n card: adaptiveCardDialogInfo.card,\n height: adaptiveCardDialogInfo.size ? adaptiveCardDialogInfo.size.height : DialogDimension.Small,\n width: adaptiveCardDialogInfo.size ? adaptiveCardDialogInfo.size.width : DialogDimension.Small,\n title: adaptiveCardDialogInfo.title,\n };\n return dialogInfo;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Convert BotAdaptiveCardDialogInfo to DialogInfo to send the information to host in {@linkcode adaptiveCard.open} API.\n *\n * @internal\n */\n function getDialogInfoFromBotAdaptiveCardDialogInfo(\n botAdaptiveCardDialogInfo: BotAdaptiveCardDialogInfo,\n ): DialogInfo {\n const dialogInfo: DialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);\n dialogInfo.completionBotId = botAdaptiveCardDialogInfo.completionBotId;\n return dialogInfo;\n }\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { runtime } from '../public/runtime';\nimport { errorNotSupportedOnPlatform } from './constants';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst menuTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Namespace to interact with the menu-specific part of the SDK.\n * This object is used to show View Configuration, Action Menu and Navigation Bar Menu.\n */\nexport namespace menus {\n /**\n * @hidden\n * Represents information about item in View Configuration.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ViewConfiguration {\n /**\n * @hidden\n * Unique identifier of view.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display title of the view.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Additional information for accessibility.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n contentDescription?: string;\n }\n\n /**\n * Defines how a menu item should appear in the NavBar.\n */\n export enum DisplayMode {\n /**\n * Only place this item in the NavBar if there's room for it.\n * If there's no room, item is shown in the overflow menu.\n */\n ifRoom = 0,\n /**\n * Never place this item in the NavBar.\n * The item would always be shown in NavBar's overflow menu.\n */\n overflowOnly = 1,\n }\n\n /**\n * @hidden\n * Represents information about menu item for Action Menu and Navigation Bar Menu.\n */\n export class MenuItem {\n /**\n * @hidden\n * Unique identifier for the menu item.\n */\n public id: string;\n /**\n * @hidden\n * Display title of the menu item.\n */\n public title: string;\n /**\n * @hidden\n * Display icon of the menu item. The icon value must be a string having SVG icon content.\n */\n public icon: string;\n /**\n * @hidden\n * Selected state display icon of the menu item. The icon value must be a string having SVG icon content.\n */\n public iconSelected?: string;\n /**\n * @hidden\n * Additional information for accessibility.\n */\n public contentDescription?: string;\n /**\n * @hidden\n * State of the menu item\n */\n public enabled = true;\n /**\n * @hidden\n * Interface to show list of items on selection of menu item.\n */\n public viewData?: ViewData;\n /**\n * @hidden\n * Whether the menu item is selected or not\n */\n public selected = false;\n /**\n * The Display Mode of the menu item.\n * Default Behaviour would be DisplayMode.ifRoom if null.\n * Refer {@link DisplayMode}\n */\n public displayMode?: DisplayMode;\n }\n\n /**\n * @hidden\n * Represents information about view to show on Navigation Bar Menu item selection\n */\n export interface ViewData {\n /**\n * @hidden\n * Display header title of the item list.\n */\n listTitle?: string;\n /**\n * @hidden\n * Type of the menu item.\n */\n listType: MenuListType;\n /**\n * @hidden\n * Array of MenuItem. Icon value will be required for all items in the list.\n */\n listItems: MenuItem[];\n }\n\n /**\n * @hidden\n * Represents information about type of list to display in Navigation Bar Menu.\n */\n export enum MenuListType {\n dropDown = 'dropDown',\n popOver = 'popOver',\n }\n let navBarMenuItemPressHandler: ((id: string) => boolean) | undefined;\n let actionMenuItemPressHandler: ((id: string) => boolean) | undefined;\n let viewConfigItemPressHandler: ((id: string) => boolean) | undefined;\n\n /**\n * @hidden\n * Register navBarMenuItemPress, actionMenuItemPress, setModuleView handlers.\n *\n * @internal\n * Limited to Microsoft-internal use.\n */\n export function initialize(): void {\n registerHandler(\n getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_RegisterNavBarMenuItemPressHandler),\n 'navBarMenuItemPress',\n handleNavBarMenuItemPress,\n false,\n );\n registerHandler(\n getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_RegisterActionMenuItemPressHandler),\n 'actionMenuItemPress',\n handleActionMenuItemPress,\n false,\n );\n registerHandler(\n getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_RegisterSetModuleViewHandler),\n 'setModuleView',\n handleViewConfigItemPress,\n false,\n );\n }\n\n /**\n * @hidden\n * Registers list of view configurations and it's handler.\n * Handler is responsible for listening selection of View Configuration.\n *\n * @param viewConfig - List of view configurations. Minimum 1 value is required.\n * @param handler - The handler to invoke when the user selects view configuration.\n */\n export function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n viewConfigItemPressHandler = handler;\n sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_SetUpViews), 'setUpViews', [\n viewConfig,\n ]);\n }\n\n function handleViewConfigItemPress(id: string): void {\n if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent(\n getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_HandleViewConfigItemPress),\n 'viewConfigItemPress',\n [id],\n );\n }\n }\n\n /**\n * @hidden\n * Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.\n *\n * @param items List of MenuItems for Navigation Bar Menu.\n * @param handler The handler to invoke when the user selects menu item.\n */\n export function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n navBarMenuItemPressHandler = handler;\n sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_SetNavBarMenu), 'setNavBarMenu', [\n items,\n ]);\n }\n\n function handleNavBarMenuItemPress(id: string): void {\n if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent(\n getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_HandleNavBarMenuItemPress),\n 'handleNavBarMenuItemPress',\n [id],\n );\n }\n }\n\n /** Parameters used to create an action menu within an app */\n export interface ActionMenuParameters {\n /**\n * @hidden\n * Display title for Action Menu\n */\n title: string;\n /**\n * @hidden\n * List of MenuItems for Action Menu\n */\n items: MenuItem[];\n }\n\n /**\n * @hidden\n * Used to show Action Menu.\n *\n * @param params - Parameters for Menu Parameters\n * @param handler - The handler to invoke when the user selects menu item.\n */\n export function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean): void {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n actionMenuItemPressHandler = handler;\n sendMessageToParent(getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_ShowActionMenu), 'showActionMenu', [\n params,\n ]);\n }\n\n function handleActionMenuItemPress(id: string): void {\n if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {\n ensureInitialized(runtime);\n sendMessageToParent(\n getApiVersionTag(menuTelemetryVersionNumber, ApiName.Menus_HandleActionMenuItemPress),\n 'handleActionMenuItemPress',\n [id],\n );\n }\n }\n\n /**\n * Checks if the menus capability is supported by the host\n * @returns boolean to represent whether the menus capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.menus ? true : false;\n }\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport {\n Communication,\n initializeCommunication,\n sendAndHandleStatusAndReason,\n sendAndUnwrap,\n sendMessageToParent,\n uninitializeCommunication,\n} from '../internal/communication';\nimport { defaultSDKVersionForCompatCheck } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport * as Handlers from '../internal/handlers'; // Conflict with some names\nimport { ensureInitializeCalled, ensureInitialized, processAdditionalValidOrigins } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { getLogger } from '../internal/telemetry';\nimport { isNullOrUndefined } from '../internal/typeCheckUtilities';\nimport { compareSDKVersions, inServerSideRenderingEnvironment, runWithTimeout } from '../internal/utils';\nimport { prefetchOriginsFromCDN } from '../internal/validOrigins';\nimport { messageChannels } from '../private/messageChannels';\nimport { authentication } from './authentication';\nimport { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from './constants';\nimport { dialog } from './dialog';\nimport { ActionInfo, Context as LegacyContext, FileOpenPreference, LocaleInfo, ResumeContext } from './interfaces';\nimport { menus } from './menus';\nimport { pages } from './pages';\nimport {\n applyRuntimeConfig,\n generateVersionBasedTeamsRuntimeConfig,\n IBaseRuntime,\n mapTeamsVersionToSupportedCapabilities,\n runtime,\n versionAndPlatformAgnosticTeamsRuntimeConfig,\n} from './runtime';\nimport { version } from './version';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst appTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Number of milliseconds we'll give the initialization call to return before timing it out\n */\nconst initializationTimeoutInMs = 5000;\n\nconst appLogger = getLogger('app');\n\nexport function appInitializeHelper(apiVersionTag: string, validMessageOrigins?: string[]): Promise<void> {\n if (!inServerSideRenderingEnvironment()) {\n return runWithTimeout(\n () => initializeHelper(apiVersionTag, validMessageOrigins),\n initializationTimeoutInMs,\n new Error('SDK initialization timed out.'),\n );\n } else {\n const initializeLogger = appLogger.extend('initialize');\n // This log statement should NEVER actually be written. This code path exists only to enable compilation in server-side rendering environments.\n // If you EVER see this statement in ANY log file, something has gone horribly wrong and a bug needs to be filed.\n initializeLogger('window object undefined at initialization');\n return Promise.resolve();\n }\n}\n\nexport function notifyAppLoadedHelper(apiVersionTag: string): void {\n sendMessageToParent(apiVersionTag, app.Messages.AppLoaded, [version]);\n}\n\nexport function notifyExpectedFailureHelper(\n apiVersionTag: string,\n expectedFailureRequest: app.IExpectedFailureRequest,\n): void {\n sendMessageToParent(apiVersionTag, app.Messages.ExpectedFailure, [\n expectedFailureRequest.reason,\n expectedFailureRequest.message,\n ]);\n}\n\nexport function notifyFailureHelper(apiVersiontag: string, appInitializationFailedRequest: app.IFailedRequest): void {\n sendMessageToParent(apiVersiontag, app.Messages.Failure, [\n appInitializationFailedRequest.reason,\n appInitializationFailedRequest.message,\n ]);\n}\n\nexport function notifySuccessHelper(apiVersionTag: string): void {\n sendMessageToParent(apiVersionTag, app.Messages.Success, [version]);\n}\n\nconst initializeHelperLogger = appLogger.extend('initializeHelper');\nfunction initializeHelper(apiVersionTag: string, validMessageOrigins?: string[]): Promise<void> {\n return new Promise<void>((resolve) => {\n // Independent components might not know whether the SDK is initialized so might call it to be safe.\n // Just no-op if that happens to make it easier to use.\n if (!GlobalVars.initializeCalled) {\n GlobalVars.initializeCalled = true;\n Handlers.initializeHandlers();\n GlobalVars.initializePromise = initializeCommunication(validMessageOrigins, apiVersionTag).then(\n ({ context, clientType, runtimeConfig, clientSupportedSDKVersion = defaultSDKVersionForCompatCheck }) => {\n GlobalVars.frameContext = context;\n GlobalVars.hostClientType = clientType;\n GlobalVars.clientSupportedSDKVersion = clientSupportedSDKVersion;\n // Temporary workaround while the Host is updated with the new argument order.\n // For now, we might receive any of these possibilities:\n // - `runtimeConfig` in `runtimeConfig` and `clientSupportedSDKVersion` in `clientSupportedSDKVersion`.\n // - `runtimeConfig` in `clientSupportedSDKVersion` and `clientSupportedSDKVersion` in `runtimeConfig`.\n // - `clientSupportedSDKVersion` in `runtimeConfig` and no `clientSupportedSDKVersion`.\n // This code supports any of these possibilities\n\n // Teams AppHost won't provide this runtime config\n // so we assume that if we don't have it, we must be running in Teams.\n // After Teams updates its client code, we can remove this default code.\n try {\n initializeHelperLogger('Parsing %s', runtimeConfig);\n const givenRuntimeConfig: IBaseRuntime | null = JSON.parse(runtimeConfig);\n initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig ?? 'null');\n // Check that givenRuntimeConfig is a valid instance of IBaseRuntime\n if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {\n throw new Error('Received runtime config is invalid');\n }\n runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);\n } catch (e) {\n if (e instanceof SyntaxError) {\n try {\n initializeHelperLogger('Attempting to parse %s as an SDK version', runtimeConfig);\n // if the given runtime config was actually meant to be a SDK version, store it as such.\n // TODO: This is a temporary workaround to allow Teams to store clientSupportedSDKVersion even when\n // it doesn't provide the runtimeConfig. After Teams updates its client code, we should\n // remove this feature.\n if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {\n GlobalVars.clientSupportedSDKVersion = runtimeConfig;\n }\n const givenRuntimeConfig: IBaseRuntime | null = JSON.parse(clientSupportedSDKVersion);\n initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig ?? 'null');\n\n if (!givenRuntimeConfig) {\n throw new Error(\n 'givenRuntimeConfig string was successfully parsed. However, it parsed to value of null',\n );\n } else {\n applyRuntimeConfig(givenRuntimeConfig);\n }\n } catch (e) {\n if (e instanceof SyntaxError) {\n applyRuntimeConfig(\n generateVersionBasedTeamsRuntimeConfig(\n GlobalVars.clientSupportedSDKVersion,\n versionAndPlatformAgnosticTeamsRuntimeConfig,\n mapTeamsVersionToSupportedCapabilities,\n ),\n );\n } else {\n throw e;\n }\n }\n } else {\n // If it's any error that's not a JSON parsing error, we want the program to fail.\n throw e;\n }\n }\n\n GlobalVars.initializeCompleted = true;\n },\n );\n\n authentication.initialize();\n menus.initialize();\n pages.config.initialize();\n dialog.initialize();\n }\n\n // Handle additional valid message origins if specified\n if (Array.isArray(validMessageOrigins)) {\n processAdditionalValidOrigins(validMessageOrigins);\n }\n\n if (GlobalVars.initializePromise !== undefined) {\n resolve(GlobalVars.initializePromise);\n } else {\n initializeHelperLogger('GlobalVars.initializePromise is unexpectedly undefined');\n }\n });\n}\n\nexport function registerOnThemeChangeHandlerHelper(apiVersionTag: string, handler: app.themeHandler): void {\n // allow for registration cleanup even when not called initialize\n !isNullOrUndefined(handler) && ensureInitializeCalled();\n Handlers.registerOnThemeChangeHandler(apiVersionTag, handler);\n}\n\nexport function openLinkHelper(apiVersionTag: string, deepLink: string): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', deepLink));\n });\n}\n\n/**\n * Namespace to interact with app initialization and lifecycle.\n */\nexport namespace app {\n const appLogger = getLogger('app');\n\n // ::::::::::::::::::::::: MicrosoftTeams client SDK public API ::::::::::::::::::::\n\n /** App Initialization Messages */\n export const Messages = {\n /** App loaded. */\n AppLoaded: 'appInitialization.appLoaded',\n /** App initialized successfully. */\n Success: 'appInitialization.success',\n /** App initialization failed. */\n Failure: 'appInitialization.failure',\n /** App initialization expected failure. */\n ExpectedFailure: 'appInitialization.expectedFailure',\n };\n\n /**\n * Describes errors that caused app initialization to fail\n */\n export enum FailedReason {\n /**\n * Authentication failed\n */\n AuthFailed = 'AuthFailed',\n /**\n * The application timed out\n */\n Timeout = 'Timeout',\n /**\n * The app failed for a different reason\n */\n Other = 'Other',\n }\n\n /**\n * Describes expected errors that occurred during an otherwise successful\n * app initialization\n */\n export enum ExpectedFailureReason {\n /**\n * There was a permission error\n */\n PermissionError = 'PermissionError',\n /**\n * The item was not found\n */\n NotFound = 'NotFound',\n /**\n * The network is currently throttled\n */\n Throttling = 'Throttling',\n /**\n * The application is currently offline\n */\n Offline = 'Offline',\n /**\n * The app failed for a different reason\n */\n Other = 'Other',\n }\n\n /**\n * Represents the failed request sent during a failed app initialization.\n */\n export interface IFailedRequest {\n /**\n * The reason for the failure\n */\n reason: FailedReason;\n /**\n * This property is currently unused.\n */\n message?: string;\n }\n\n /**\n * Represents the failure request sent during an erroneous app initialization.\n */\n export interface IExpectedFailureRequest {\n /**\n * The reason for the failure\n */\n reason: ExpectedFailureReason;\n /**\n * A message that describes the failure\n */\n message?: string;\n }\n\n /**\n * Represents application information.\n */\n export interface AppInfo {\n /**\n * The current locale that the user has configured for the app formatted as\n * languageId-countryId (for example, en-us).\n */\n locale: string;\n\n /**\n * The current UI theme of the host. Possible values: \"default\", \"dark\", \"contrast\" or \"glass\".\n */\n theme: string;\n\n /**\n * Unique ID for the current session for use in correlating telemetry data. A session corresponds to the lifecycle of an app. A new session begins upon the creation of a webview (on Teams mobile) or iframe (in Teams desktop) hosting the app, and ends when it is destroyed.\n */\n sessionId: string;\n\n /**\n * Info of the host\n */\n host: AppHostInfo;\n\n /**\n * More detailed locale info from the user's OS if available. Can be used together with\n * the @microsoft/globe NPM package to ensure your app respects the user's OS date and\n * time format configuration\n */\n osLocaleInfo?: LocaleInfo;\n /**\n * Personal app icon y coordinate position\n */\n iconPositionVertical?: number;\n\n /**\n * Time when the user clicked on the tab\n */\n userClickTime?: number;\n\n /**\n * The ID of the parent message from which this task module was launched.\n * This is only available in task modules launched from bot cards.\n */\n parentMessageId?: string;\n\n /**\n * Where the user prefers the file to be opened from by default during file open\n */\n userFileOpenPreference?: FileOpenPreference;\n\n /**\n * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.\n */\n appLaunchId?: string;\n }\n\n /**\n * Represents information about the application's host.\n */\n export interface AppHostInfo {\n /**\n * Identifies which host is running your app\n */\n name: HostName;\n\n /**\n * The client type on which the host is running\n */\n clientType: HostClientType;\n\n /**\n * Unique ID for the current Host session for use in correlating telemetry data.\n */\n sessionId: string;\n\n /**\n * Current ring ID\n */\n ringId?: string;\n }\n\n /**\n * Represents Channel information.\n */\n export interface ChannelInfo {\n /**\n * The Microsoft Teams ID for the channel with which the content is associated.\n */\n id: string;\n\n /**\n * The name for the channel with which the content is associated.\n */\n displayName?: string;\n\n /**\n * The relative path to the SharePoint folder associated with the channel.\n */\n relativeUrl?: string;\n\n /**\n * The type of the channel with which the content is associated.\n */\n membershipType?: ChannelType;\n\n /**\n * The OneNote section ID that is linked to the channel.\n */\n defaultOneNoteSectionId?: string;\n\n /**\n * The tenant ID of the team which owns the channel.\n */\n ownerTenantId?: string;\n\n /**\n * The Microsoft Entra group ID of the team which owns the channel.\n */\n ownerGroupId?: string;\n }\n\n /**\n * Represents Chat information.\n */\n export interface ChatInfo {\n /**\n * The Microsoft Teams ID for the chat with which the content is associated.\n */\n id: string;\n }\n\n /**\n * Represents Meeting information.\n */\n export interface MeetingInfo {\n /**\n * Meeting Id used by tab when running in meeting context\n */\n id: string;\n }\n\n /**\n * Represents Page information.\n */\n export interface PageInfo {\n /**\n * The developer-defined unique ID for the page this content points to.\n */\n id: string;\n\n /**\n * The context where page url is loaded (content, task, setting, remove, sidePanel)\n */\n frameContext: FrameContexts;\n\n /**\n * The developer-defined unique ID for the sub-page this content points to.\n * This field should be used to restore to a specific state within a page,\n * such as scrolling to or activating a specific piece of content.\n */\n subPageId?: string;\n\n /**\n * Indication whether the page is in full-screen mode.\n */\n isFullScreen?: boolean;\n\n /**\n * Indication whether the page is in a pop out window\n */\n isMultiWindow?: boolean;\n\n /**\n * Indicates whether the page is being loaded in the background as\n * part of an opt-in performance enhancement.\n */\n isBackgroundLoad?: boolean;\n\n /**\n * Source origin from where the page is opened\n */\n sourceOrigin?: string;\n }\n\n /**\n * Represents Team information.\n */\n export interface TeamInfo {\n /**\n * The Microsoft Teams ID for the team with which the content is associated.\n */\n internalId: string;\n\n /**\n * The name for the team with which the content is associated.\n */\n displayName?: string;\n\n /**\n * The type of the team.\n */\n type?: TeamType;\n\n /**\n * The Office 365 group ID for the team with which the content is associated.\n * This field is available only when the identity permission is requested in the manifest.\n */\n groupId?: string;\n\n /**\n * Indicates whether team is archived.\n * Apps should use this as a signal to prevent any changes to content associated with archived teams.\n */\n isArchived?: boolean;\n\n /**\n * Team Template ID if there was a Team Template associated with the creation of the team.\n */\n templateId?: string;\n\n /**\n * The user's role in the team.\n\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a hint as to the user's role, and never as proof of her role.\n */\n userRole?: UserTeamRole;\n }\n\n /**\n * Represents User information.\n */\n export interface UserInfo {\n /**\n * The Microsoft Entra object id of the current user.\n *\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a optimization hint as to who the user is and never as proof of identity.\n * Specifically, this value should never be used to determine if a user is authorized to access\n * a resource; access tokens should be used for that.\n * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.\n *\n * This field is available only when the identity permission is requested in the manifest.\n */\n id: string;\n\n /**\n * The address book name of the current user.\n */\n displayName?: string;\n\n /**\n * Represents whether calling is allowed for the current logged in User\n */\n isCallingAllowed?: boolean;\n\n /**\n * Represents whether PSTN calling is allowed for the current logged in User\n */\n isPSTNCallingAllowed?: boolean;\n\n /**\n * The license type for the current user. Possible values are:\n * \"Unknown\", \"Teacher\", \"Student\", \"Free\", \"SmbBusinessVoice\", \"SmbNonVoice\", \"FrontlineWorker\", \"Anonymous\"\n */\n licenseType?: string;\n\n /**\n * A value suitable for use when providing a login_hint to Microsoft Entra ID for authentication purposes.\n * See [Provide optional claims to your app](https://learn.microsoft.com/azure/active-directory/develop/active-directory-optional-claims#v10-and-v20-optional-claims-set)\n * for more information about the use of login_hint\n *\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a optimization hint as to who the user is and never as proof of identity.\n * Specifically, this value should never be used to determine if a user is authorized to access\n * a resource; access tokens should be used for that.\n * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.\n */\n loginHint?: string;\n\n /**\n * The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).\n\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a optimization hint as to who the user is and never as proof of identity.\n * Specifically, this value should never be used to determine if a user is authorized to access\n * a resource; access tokens should be used for that.\n * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.\n */\n userPrincipalName?: string;\n\n /**\n * The tenant related info of the current user.\n */\n tenant?: TenantInfo;\n }\n\n /**\n * Represents Tenant information.\n */\n export interface TenantInfo {\n /**\n * The Microsoft Entra tenant ID of the current user.\n\n * Because a malicious party can run your content in a browser, this value should\n * be used only as a optimization hint as to who the user is and never as proof of identity.\n * Specifically, this value should never be used to determine if a user is authorized to access\n * a resource; access tokens should be used for that.\n * See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.\n */\n id: string;\n\n /**\n * The type of license for the current user's tenant. Possible values are enterprise, free, edu, and unknown.\n */\n teamsSku?: string;\n }\n\n /** Represents information about a SharePoint site */\n export interface SharePointSiteInfo {\n /**\n * The root SharePoint site associated with the team.\n */\n teamSiteUrl?: string;\n\n /**\n * The domain of the root SharePoint site associated with the team.\n */\n teamSiteDomain?: string;\n\n /**\n * The relative path to the SharePoint site associated with the team.\n */\n teamSitePath?: string;\n\n /**\n * Teamsite ID, aka sharepoint site id.\n */\n teamSiteId?: string;\n\n /**\n * The SharePoint my site domain associated with the user.\n */\n mySiteDomain?: string;\n\n /**\n * The SharePoint relative path to the current users mysite\n */\n mySitePath?: string;\n }\n\n /**\n * Represents structure of the received context message.\n */\n export interface Context {\n /**\n * Content Action Info\n *\n * @beta\n */\n actionInfo?: ActionInfo;\n /**\n * Properties about the current session for your app\n */\n app: AppInfo;\n\n /**\n * Info about the current page context hosting your app\n */\n page: PageInfo;\n\n /**\n * Info about the currently logged in user running the app.\n * If the current user is not logged in/authenticated (e.g. a meeting app running for an anonymously-joined partcipant) this will be `undefined`.\n */\n user?: UserInfo;\n\n /**\n * When running in the context of a Teams channel, provides information about the channel, else `undefined`\n */\n channel?: ChannelInfo;\n\n /**\n * When running in the context of a Teams chat, provides information about the chat, else `undefined`\n */\n chat?: ChatInfo;\n\n /**\n * When running in the context of a Teams meeting, provides information about the meeting, else `undefined`\n */\n meeting?: MeetingInfo;\n\n /**\n * When hosted in SharePoint, this is the [SharePoint PageContext](https://learn.microsoft.com/javascript/api/sp-page-context/pagecontext?view=sp-typescript-latest), else `undefined`\n */\n sharepoint?: any;\n\n /**\n * When running in Teams for an organization with a tenant, provides information about the SharePoint site associated with the team.\n * Will be `undefined` when not running in Teams for an organization with a tenant.\n */\n sharePointSite?: SharePointSiteInfo;\n\n /**\n * When running in Teams, provides information about the Team context in which your app is running.\n * Will be `undefined` when not running in Teams.\n */\n team?: TeamInfo;\n\n /**\n * When `processActionCommand` activates a dialog, this dialog should automatically fill in some fields with information. This information comes from M365 and is given to `processActionCommand` as `extractedParameters`.\n * App developers need to use these `extractedParameters` in their dialog.\n * They help pre-fill the dialog with necessary information (`dialogParameters`) along with other details.\n * If there's no key/value pairs passed, the object will be empty in the case\n */\n dialogParameters: Record<string, string>;\n }\n\n /**\n * This function is passed to registerOnThemeHandler. It is called every time the user changes their theme.\n */\n export type themeHandler = (theme: string) => void;\n\n /**\n * Checks whether the Teams client SDK has been initialized.\n * @returns whether the Teams client SDK has been initialized.\n */\n export function isInitialized(): boolean {\n return GlobalVars.initializeCompleted;\n }\n\n /**\n * Gets the Frame Context that the App is running in. See {@link FrameContexts} for the list of possible values.\n * @returns the Frame Context.\n */\n export function getFrameContext(): FrameContexts | undefined {\n return GlobalVars.frameContext;\n }\n\n function logWhereTeamsJsIsBeingUsed(): void {\n if (inServerSideRenderingEnvironment()) {\n return;\n }\n const scripts = document.getElementsByTagName('script');\n // This will always be the current script because browsers load and execute scripts in order.\n // Whenever a script is executing for the first time it will be the last script in this array.\n const currentScriptSrc = scripts && scripts[scripts.length - 1] && scripts[scripts.length - 1].src;\n const scriptUsageWarning =\n 'Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues';\n if (!currentScriptSrc || currentScriptSrc.length === 0) {\n appLogger('teamsjs is being used from a script tag embedded directly in your html. %s', scriptUsageWarning);\n } else {\n appLogger('teamsjs is being used from %s. %s', currentScriptSrc, scriptUsageWarning);\n }\n }\n\n // This is called right away to make sure that we capture which script is being executed correctly\n logWhereTeamsJsIsBeingUsed();\n\n /**\n * Initializes the library.\n *\n * @remarks\n * Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made\n *\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins. They must have\n * https: protocol otherwise they will be ignored. Example: https://www.example.com\n * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out\n */\n export function initialize(validMessageOrigins?: string[]): Promise<void> {\n prefetchOriginsFromCDN();\n return appInitializeHelper(\n getApiVersionTag(appTelemetryVersionNumber, ApiName.App_Initialize),\n validMessageOrigins,\n );\n }\n\n /**\n * @hidden\n * Undocumented function used to set a mock window for unit tests\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function _initialize(hostWindow: any): void {\n Communication.currentWindow = hostWindow;\n }\n\n /**\n * @hidden\n * Undocumented function used to clear state between unit tests\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function _uninitialize(): void {\n if (!GlobalVars.initializeCalled) {\n return;\n }\n\n Handlers.uninitializeHandlers();\n\n GlobalVars.initializeCalled = false;\n GlobalVars.initializeCompleted = false;\n GlobalVars.initializePromise = undefined;\n GlobalVars.additionalValidOrigins = [];\n GlobalVars.frameContext = undefined;\n GlobalVars.hostClientType = undefined;\n GlobalVars.isFramelessWindow = false;\n\n messageChannels.telemetry._clearTelemetryPort();\n messageChannels.dataLayer._clearDataLayerPort();\n\n uninitializeCommunication();\n }\n\n /**\n * Retrieves the current context the frame is running in.\n *\n * @returns Promise that will resolve with the {@link app.Context} object.\n */\n export function getContext(): Promise<app.Context> {\n return new Promise<LegacyContext>((resolve) => {\n ensureInitializeCalled();\n resolve(sendAndUnwrap(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_GetContext), 'getContext'));\n }).then((legacyContext) => transformLegacyContextToAppContext(legacyContext)); // converts globalcontext to app.context\n }\n\n /**\n * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.\n */\n export function notifyAppLoaded(): void {\n ensureInitializeCalled();\n notifyAppLoadedHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyAppLoaded));\n }\n\n /**\n * Notifies the frame that app initialization is successful and is ready for user interaction.\n */\n export function notifySuccess(): void {\n ensureInitializeCalled();\n notifySuccessHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifySuccess));\n }\n\n /**\n * Notifies the frame that app initialization has failed and to show an error page in its place.\n *\n * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed\n * during initialization as well as an optional message.\n */\n export function notifyFailure(appInitializationFailedRequest: IFailedRequest): void {\n ensureInitializeCalled();\n notifyFailureHelper(\n getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyFailure),\n appInitializationFailedRequest,\n );\n }\n\n /**\n * Notifies the frame that app initialized with some expected errors.\n *\n * @param expectedFailureRequest - The expected failure request containing the reason and an optional message\n */\n export function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void {\n ensureInitializeCalled();\n notifyExpectedFailureHelper(\n getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyExpectedFailure),\n expectedFailureRequest,\n );\n }\n\n /**\n * Registers a handler for theme changes.\n *\n * @remarks\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user changes their theme.\n */\n export function registerOnThemeChangeHandler(handler: themeHandler): void {\n registerOnThemeChangeHandlerHelper(\n getApiVersionTag(appTelemetryVersionNumber, ApiName.App_RegisterOnThemeChangeHandler),\n handler,\n );\n }\n\n /**\n * This function opens deep links to other modules in the host such as chats or channels or\n * general-purpose links (to external websites). It should not be used for navigating to your\n * own or other apps.\n *\n * @remarks\n * If you need to navigate to your own or other apps, use:\n *\n * - {@link pages.currentApp.navigateToDefaultPage} for navigating to the default page of your own app\n * - {@link pages.currentApp.navigateTo} for navigating to a section of your own app\n * - {@link pages.navigateToApp} for navigating to other apps besides your own\n *\n * Many areas of functionality previously provided by deep links are now handled by strongly-typed functions in capabilities.\n * If your app is using a deep link to trigger these specific components, use the strongly-typed alternatives.\n * For example (this list is not exhaustive):\n * - To open an app installation dialog, use the {@link appInstallDialog} capability\n * - To start a call, use the {@link call} capability\n * - To open a chat, use the {@link chat} capability\n * - To open a dialog, use the {@link dialog} capability\n * - To create a new meeting, use the {@link calendar.composeMeeting} function\n * - To open a Stage View, use the {@link stageView} capability\n *\n * In each of these capabilities, you can use the `isSupported()` function to determine if the host supports that capability.\n * When using a deep link to trigger these components, there's no way to determine whether the host supports it.\n *\n * For more information on crafting deep links to the host, see [Configure deep links](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/deep-links)\n *\n * @param deepLink The host deep link or external web URL to which to navigate\n * @returns `Promise` that will be fulfilled when the navigation has initiated. A successful `Promise` resolution\n * does not necessarily indicate whether the target loaded successfully.\n */\n export function openLink(deepLink: string): Promise<void> {\n return openLinkHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_OpenLink), deepLink);\n }\n\n /**\n * A namespace for enabling the suspension or delayed termination of an app when the user navigates away.\n * When an app registers for the registerBeforeSuspendOrTerminateHandler, it chooses to delay termination.\n * When an app registers for both registerBeforeSuspendOrTerminateHandler and registerOnResumeHandler, it chooses the suspension of the app .\n * Please note that selecting suspension doesn't guarantee prevention of background termination.\n * The outcome is influenced by factors such as available memory and the number of suspended apps.\n *\n * @beta\n */\n export namespace lifecycle {\n /**\n * Register on resume handler function type\n *\n * @param context - Data structure to be used to pass the context to the app.\n */\n export type registerOnResumeHandlerFunctionType = (context: ResumeContext) => void;\n\n /**\n * Register before suspendOrTerminate handler function type\n *\n * @returns void\n */\n export type registerBeforeSuspendOrTerminateHandlerFunctionType = () => Promise<void>;\n\n /**\n * Registers a handler to be called before the page is suspended or terminated. Once a user navigates away from an app,\n * the handler will be invoked. App developers can use this handler to save unsaved data, pause sync calls etc.\n *\n * @param handler - The handler to invoke before the page is suspended or terminated. When invoked, app can perform tasks like cleanups, logging etc.\n * Upon returning, the app will be suspended or terminated.\n *\n */\n export function registerBeforeSuspendOrTerminateHandler(\n handler: registerBeforeSuspendOrTerminateHandlerFunctionType,\n ): void {\n if (!handler) {\n throw new Error('[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null');\n }\n ensureInitialized(runtime);\n Handlers.registerBeforeSuspendOrTerminateHandler(handler);\n }\n\n /**\n * Registers a handler to be called when the page has been requested to resume from being suspended.\n *\n * @param handler - The handler to invoke when the page is requested to be resumed. The app is supposed to navigate to\n * the appropriate page using the ResumeContext. Once done, the app should then call {@link notifySuccess}.\n *\n * @beta\n */\n export function registerOnResumeHandler(handler: registerOnResumeHandlerFunctionType): void {\n if (!handler) {\n throw new Error('[app.lifecycle.registerOnResumeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime);\n Handlers.registerOnResumeHandler(handler);\n }\n }\n}\n\n/**\n * @hidden\n * Transforms the Legacy Context object received from Messages to the structured app.Context object\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction transformLegacyContextToAppContext(legacyContext: LegacyContext): app.Context {\n const context: app.Context = {\n actionInfo: legacyContext.actionInfo,\n app: {\n locale: legacyContext.locale,\n sessionId: legacyContext.appSessionId ? legacyContext.appSessionId : '',\n theme: legacyContext.theme ? legacyContext.theme : 'default',\n iconPositionVertical: legacyContext.appIconPosition,\n osLocaleInfo: legacyContext.osLocaleInfo,\n parentMessageId: legacyContext.parentMessageId,\n userClickTime: legacyContext.userClickTime,\n userFileOpenPreference: legacyContext.userFileOpenPreference,\n host: {\n name: legacyContext.hostName ? legacyContext.hostName : HostName.teams,\n clientType: legacyContext.hostClientType ? legacyContext.hostClientType : HostClientType.web,\n sessionId: legacyContext.sessionId ? legacyContext.sessionId : '',\n ringId: legacyContext.ringId,\n },\n appLaunchId: legacyContext.appLaunchId,\n },\n page: {\n id: legacyContext.entityId,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,\n subPageId: legacyContext.subEntityId,\n isFullScreen: legacyContext.isFullScreen,\n isMultiWindow: legacyContext.isMultiWindow,\n isBackgroundLoad: legacyContext.isBackgroundLoad,\n sourceOrigin: legacyContext.sourceOrigin,\n },\n user: {\n id: legacyContext.userObjectId ?? '',\n displayName: legacyContext.userDisplayName,\n isCallingAllowed: legacyContext.isCallingAllowed,\n isPSTNCallingAllowed: legacyContext.isPSTNCallingAllowed,\n licenseType: legacyContext.userLicenseType,\n loginHint: legacyContext.loginHint,\n userPrincipalName: legacyContext.userPrincipalName,\n tenant: legacyContext.tid\n ? {\n id: legacyContext.tid,\n teamsSku: legacyContext.tenantSKU,\n }\n : undefined,\n },\n channel: legacyContext.channelId\n ? {\n id: legacyContext.channelId,\n displayName: legacyContext.channelName,\n relativeUrl: legacyContext.channelRelativeUrl,\n membershipType: legacyContext.channelType,\n defaultOneNoteSectionId: legacyContext.defaultOneNoteSectionId,\n ownerGroupId: legacyContext.hostTeamGroupId,\n ownerTenantId: legacyContext.hostTeamTenantId,\n }\n : undefined,\n chat: legacyContext.chatId\n ? {\n id: legacyContext.chatId,\n }\n : undefined,\n meeting: legacyContext.meetingId\n ? {\n id: legacyContext.meetingId,\n }\n : undefined,\n sharepoint: legacyContext.sharepoint,\n team: legacyContext.teamId\n ? {\n internalId: legacyContext.teamId,\n displayName: legacyContext.teamName,\n type: legacyContext.teamType,\n groupId: legacyContext.groupId,\n templateId: legacyContext.teamTemplateId,\n isArchived: legacyContext.isTeamArchived,\n userRole: legacyContext.userTeamRole,\n }\n : undefined,\n sharePointSite:\n legacyContext.teamSiteUrl ||\n legacyContext.teamSiteDomain ||\n legacyContext.teamSitePath ||\n legacyContext.mySitePath ||\n legacyContext.mySiteDomain\n ? {\n teamSiteUrl: legacyContext.teamSiteUrl,\n teamSiteDomain: legacyContext.teamSiteDomain,\n teamSitePath: legacyContext.teamSitePath,\n teamSiteId: legacyContext.teamSiteId,\n mySitePath: legacyContext.mySitePath,\n mySiteDomain: legacyContext.mySiteDomain,\n }\n : undefined,\n dialogParameters: legacyContext.dialogParameters || {},\n };\n\n return context;\n}\n","import {\n Communication,\n sendAndHandleSdkError,\n sendAndHandleStatusAndReason,\n sendAndHandleStatusAndReasonWithDefaultError,\n sendAndUnwrap,\n sendMessageEventToChild,\n sendMessageToParent,\n} from '../internal/communication';\nimport { registerHandler, registerHandlerHelper } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { isNullOrUndefined } from '../internal/typeCheckUtilities';\nimport { createTeamsAppLink } from '../internal/utils';\nimport { prefetchOriginsFromCDN } from '../internal/validOrigins';\nimport { appInitializeHelper } from './app';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { FrameInfo, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst pagesTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\nexport function navigateCrossDomainHelper(apiVersionTag: string, url: string): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!pages.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage =\n 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';\n resolve(sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, 'navigateCrossDomain', errorMessage, url));\n });\n}\n\nexport function backStackNavigateBackHelper(apiVersionTag: string): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime);\n if (!pages.backStack.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage = 'Back navigation is not supported in the current client or context.';\n resolve(sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, 'navigateBack', errorMessage));\n });\n}\n\nexport function tabsNavigateToTabHelper(apiVersionTag: string, tabInstance: TabInstance): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime);\n if (!pages.tabs.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';\n resolve(sendAndHandleStatusAndReasonWithDefaultError(apiVersionTag, 'navigateToTab', errorMessage, tabInstance));\n });\n}\n/**\n * @hidden\n */\nexport function returnFocusHelper(apiVersionTag: string, navigateForward?: boolean): void {\n ensureInitialized(runtime);\n if (!pages.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(apiVersionTag, 'returnFocus', [navigateForward]);\n}\n\nexport function getTabInstancesHelper(\n apiVersionTag: string,\n tabInstanceParameters?: TabInstanceParameters,\n): Promise<TabInformation> {\n return new Promise<TabInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!pages.tabs.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndUnwrap(apiVersionTag, 'getTabInstances', tabInstanceParameters));\n });\n}\n\nexport function getMruTabInstancesHelper(\n apiVersionTag: string,\n tabInstanceParameters?: TabInstanceParameters,\n): Promise<TabInformation> {\n return new Promise<TabInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!pages.tabs.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndUnwrap(apiVersionTag, 'getMruTabInstances', tabInstanceParameters));\n });\n}\n\nexport function shareDeepLinkHelper(apiVersionTag: string, deepLinkParameters: ShareDeepLinkParameters): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!pages.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(apiVersionTag, 'shareDeepLink', [\n deepLinkParameters.subPageId,\n deepLinkParameters.subPageLabel,\n deepLinkParameters.subPageWebUrl,\n ]);\n}\n\nexport function setCurrentFrameHelper(apiVersionTag: string, frameInfo: FrameInfo): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!pages.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(apiVersionTag, 'setFrameContext', [frameInfo]);\n}\n\nexport function configSetValidityStateHelper(apiVersionTag: string, validityState: boolean): void {\n ensureInitialized(runtime, FrameContexts.settings, FrameContexts.remove);\n if (!pages.config.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(apiVersionTag, 'settings.setValidityState', [validityState]);\n}\n\nexport function getConfigHelper(apiVersionTag: string): Promise<pages.InstanceConfig> {\n return new Promise<pages.InstanceConfig>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.sidePanel,\n );\n if (!pages.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndUnwrap(apiVersionTag, 'settings.getSettings'));\n });\n}\n\nexport function configSetConfigHelper(apiVersionTag: string, instanceConfig: pages.InstanceConfig): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);\n if (!pages.config.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleStatusAndReason(apiVersionTag, 'settings.setSettings', instanceConfig));\n });\n}\n\n/**\n * Navigation-specific part of the SDK.\n */\nexport namespace pages {\n /** Callback function */\n export type handlerFunctionType = () => void;\n /** Full screen function */\n export type fullScreenChangeFunctionType = (isFullScreen: boolean) => void;\n /** Back button handler function */\n export type backButtonHandlerFunctionType = () => boolean;\n /** Save event function */\n export type saveEventType = (evt: pages.config.SaveEvent) => void;\n /** Remove event function */\n export type removeEventType = (evt: pages.config.RemoveEvent) => void;\n\n /**\n * @hidden\n * List of enter focus action items\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum EnterFocusType {\n /**\n * Determines the previous direction to focus in app when hot keys entered.\n */\n PreviousLandmark = 0,\n /**\n * Determines the next direction to focus in app when hot keys entered.\n */\n NextLandmark = 1,\n /**\n * Determines if the focus should go to the particular content of the app.\n * Read - Focus should go to the content of the app.\n */\n Read = 2,\n /**\n * Determines if the focus should go to the particular content of the app.\n * Compose - Focus should go to the compose area (such as textbox) of the app.\n */\n Compose = 3,\n }\n\n /**\n * Return focus action items\n */\n export enum ReturnFocusType {\n /**\n * Determines the direction to focus in host for previous landmark.\n */\n PreviousLandmark = 0,\n /**\n * Determines the direction to focus in host for next landmark.\n */\n NextLandmark = 1,\n /**\n * Determines if the focus should go to the host's activity feed\n */\n GoToActivityFeed = 2,\n }\n\n /**\n * @deprecated\n * Return focus to the host. Will move focus forward or backward based on where the application container falls in\n * the F6/tab order in the host.\n * On mobile hosts or hosts where there is no keyboard interaction or UI notion of \"focus\" this function has no\n * effect and will be a no-op when called.\n * @param navigateForward - Determines the direction to focus in host.\n */\n export function returnFocus(navigateForward?: boolean): void;\n\n /**\n * Return focus to the host. Will attempt to send focus to the appropriate part of the host (as specified by returnFocusType) based on where the application container falls in\n * the F6/tab order in the host.\n * On mobile hosts or hosts where there is no keyboard interaction or UI notion of \"focus\" this function has no\n * effect and will be a no-op when called.\n * @param returnFocusType - Determines the type of focus to return to in the host.\n */\n export function returnFocus(returnFocusType: pages.ReturnFocusType): void;\n\n /**\n * @hidden\n */\n export function returnFocus(arg1?: boolean | pages.ReturnFocusType): void {\n const apiVersionTag = getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_ReturnFocus);\n ensureInitialized(runtime);\n if (!pages.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (arg1 === undefined) {\n sendMessageToParent(apiVersionTag, 'returnFocus', [false]);\n }\n if (typeof arg1 === 'boolean') {\n sendMessageToParent(apiVersionTag, 'returnFocus', [arg1]);\n } else {\n switch (arg1) {\n case pages.ReturnFocusType.PreviousLandmark:\n case pages.ReturnFocusType.GoToActivityFeed:\n sendMessageToParent(apiVersionTag, 'returnFocus', [false, arg1]);\n break;\n case pages.ReturnFocusType.NextLandmark:\n sendMessageToParent(apiVersionTag, 'returnFocus', [true, arg1]);\n break;\n }\n }\n }\n\n /**\n * @hidden\n *\n * Registers a handler for specifying focus when it passes from the host to the application.\n * On mobile hosts or hosts where there is no UI notion of \"focus\" the handler registered with\n * this function will never be called.\n *\n * @param handler - The handler for placing focus within the application.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerFocusEnterHandler(\n handler: (navigateForward: boolean, enterFocusType?: EnterFocusType) => void,\n ): void {\n registerHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RegisterFocusEnterHandler),\n 'focusEnter',\n handler,\n [],\n () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * Sets/Updates the current frame with new information\n *\n * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the\n * user clicks 'Go To Website'\n */\n export function setCurrentFrame(frameInfo: FrameInfo): void {\n setCurrentFrameHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SetCurrentFrame), frameInfo);\n }\n\n /**\n * Initializes the library with context information for the frame\n *\n * @param frameInfo - Frame information containing the URL used in the iframe on reload and the URL for when the\n * user clicks 'Go To Website'\n * @param callback - An optional callback that is executed once the application has finished initialization.\n * @param validMessageOrigins - An optional list of cross-frame message origins. They must have\n * https: protocol otherwise they will be ignored. Example: https:www.example.com\n */\n export function initializeWithFrameContext(\n frameInfo: FrameInfo,\n callback?: handlerFunctionType,\n validMessageOrigins?: string[],\n ): void {\n prefetchOriginsFromCDN();\n appInitializeHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_InitializeWithFrameContext),\n validMessageOrigins,\n ).then(() => callback && callback());\n setCurrentFrame(frameInfo);\n }\n\n /**\n * Defines the configuration of the current or desired instance\n */\n export interface InstanceConfig {\n /**\n * A suggested display name for the new content.\n * In the settings for an existing instance being updated, this call has no effect.\n */\n suggestedDisplayName?: string;\n /**\n * Sets the URL to use for the content of this instance.\n */\n contentUrl: string;\n /**\n * Sets the URL for the removal configuration experience.\n */\n removeUrl?: string;\n /**\n * Sets the URL to use for the external link to view the underlying resource in a browser.\n */\n websiteUrl?: string;\n /**\n * The developer-defined unique ID for the entity to which this content points.\n */\n entityId?: string;\n }\n\n /**\n * Gets the config for the current instance.\n * @returns Promise that resolves with the {@link InstanceConfig} object.\n */\n export function getConfig(): Promise<InstanceConfig> {\n return getConfigHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_GetConfig));\n }\n\n /**\n * @deprecated\n * As of 2.0.0, this API is deprecated and can be replaced by the standard JavaScript\n * API, window.location.href, when navigating the app to a new cross-domain URL. Any URL\n * that is redirected to must be listed in the validDomains block of the manifest. Please\n * remove any calls to this API.\n * @param url - The URL to navigate the frame to.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateCrossDomain(url: string): Promise<void> {\n return navigateCrossDomainHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_NavigateCrossDomain),\n url,\n );\n }\n\n /**\n * Used to navigate to apps other than your own.\n *\n * If you are looking to navigate within your own app, use {@link pages.currentApp.navigateToDefaultPage} or {@link pages.currentApp.navigateTo}\n *\n * @param params Parameters for the navigation\n * @returns a `Promise` that will resolve if the navigation was successful or reject if it was not\n */\n export function navigateToApp(params: NavigateToAppParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const apiVersionTag: string = getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_NavigateToApp);\n if (runtime.isLegacyTeams) {\n resolve(sendAndHandleStatusAndReason(apiVersionTag, 'executeDeepLink', createTeamsAppLink(params)));\n } else {\n resolve(sendAndHandleStatusAndReason(apiVersionTag, 'pages.navigateToApp', params));\n }\n });\n }\n\n /**\n * Shares a deep link that a user can use to navigate back to a specific state in this page.\n * Please note that this method does not yet work on mobile hosts.\n *\n * @param deepLinkParameters - ID and label for the link and fallback URL.\n */\n export function shareDeepLink(deepLinkParameters: ShareDeepLinkParameters): void {\n return shareDeepLinkHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_ShareDeepLink),\n deepLinkParameters,\n );\n }\n\n /**\n * Registers a handler for changes from or to full-screen view for a tab.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * On hosts where there is no support for making an app full screen, the handler registered\n * with this function will never be called.\n * @param handler - The handler to invoke when the user toggles full-screen view for a tab.\n */\n export function registerFullScreenHandler(handler: fullScreenChangeFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RegisterFullScreenHandler),\n 'fullScreenChange',\n handler,\n [],\n () => {\n if (!isNullOrUndefined(handler) && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * Checks if the pages capability is supported by the host\n * @returns boolean to represent whether the appEntity capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages ? true : false;\n }\n\n /**\n * Parameters for the NavigateToApp API\n */\n export interface NavigateToAppParams {\n /**\n * ID of the app to navigate to\n */\n appId: string;\n\n /**\n * Developer-defined ID of the page to navigate to within the app (formerly called `entityId`)\n */\n pageId: string;\n\n /**\n * Fallback URL to open if the navigation cannot be completed within the host (e.g. if the target app is not installed)\n */\n webUrl?: string;\n\n /**\n * Developer-defined ID describing the content to navigate to within the page. This ID is passed to the application\n * via the {@link app.PageInfo.subPageId} property on the {@link app.Context} object (retrieved by calling {@link app.getContext})\n */\n subPageId?: string;\n\n /**\n * For apps installed as a channel tab, this ID can be supplied to indicate in which Teams channel the app should be opened\n */\n channelId?: string;\n\n /**\n * Optional ID of the chat or meeting where the app should be opened\n\n */\n chatId?: string;\n }\n\n /**\n * Provides APIs for querying and navigating between contextual tabs of an application. Unlike personal tabs,\n * contextual tabs are pages associated with a specific context, such as channel or chat.\n */\n export namespace tabs {\n /**\n * Navigates the hosted application to the specified tab instance.\n * @param tabInstance - The destination tab instance.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateToTab(tabInstance: TabInstance): Promise<void> {\n return tabsNavigateToTabHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_NavigateToTab),\n tabInstance,\n );\n }\n /**\n * Retrieves application tabs for the current user.\n * If no TabInstanceParameters are passed, the application defaults to favorite teams and favorite channels.\n * @param tabInstanceParameters - An optional set of flags that specify whether to scope call to favorite teams or channels.\n * @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.\n */\n export function getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation> {\n return getTabInstancesHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_GetTabInstances),\n tabInstanceParameters,\n );\n }\n\n /**\n * Retrieves the most recently used application tabs for the current user.\n * @param tabInstanceParameters - An optional set of flags. Note this is currently ignored and kept for future use.\n * @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.\n */\n export function getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise<TabInformation> {\n return getMruTabInstancesHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_GetMruTabInstances),\n tabInstanceParameters,\n );\n }\n\n /**\n * Checks if the pages.tab capability is supported by the host\n * @returns boolean to represent whether the pages.tab capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.tabs\n ? true\n : false\n : false;\n }\n }\n /**\n * Provides APIs to interact with the configuration-specific part of the SDK.\n * This object is usable only on the configuration frame.\n */\n export namespace config {\n let saveHandler: undefined | ((evt: SaveEvent) => void);\n let removeHandler: undefined | ((evt: RemoveEvent) => void);\n\n /**\n * @hidden\n * Hide from docs because this function is only used during initialization\n *\n * Adds register handlers for settings.save and settings.remove upon initialization. Function is called in {@link app.initializeHelper}\n * @internal\n * Limited to Microsoft-internal use\n */\n export function initialize(): void {\n registerHandler(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterSettingsSaveHandler),\n 'settings.save',\n handleSave,\n false,\n );\n registerHandler(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterSettingsRemoveHandler),\n 'settings.remove',\n handleRemove,\n false,\n );\n }\n\n /**\n * Sets the validity state for the configuration.\n * The initial value is false, so the user cannot save the configuration until this is called with true.\n * @param validityState - Indicates whether the save or remove button is enabled for the user.\n */\n export function setValidityState(validityState: boolean): void {\n return configSetValidityStateHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetValidityState),\n validityState,\n );\n }\n\n /**\n * Sets the configuration for the current instance.\n * This is an asynchronous operation; calls to getConfig are not guaranteed to reflect the changed state.\n * @param instanceConfig - The desired configuration for this instance.\n * @returns Promise that resolves when the operation has completed.\n */\n export function setConfig(instanceConfig: InstanceConfig): Promise<void> {\n return configSetConfigHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetConfig),\n instanceConfig,\n );\n }\n\n /**\n * Registers a handler for when the user attempts to save the configuration. This handler should be used\n * to create or update the underlying resource powering the content.\n * The object passed to the handler must be used to notify whether to proceed with the save.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when the user selects the Save button.\n */\n export function registerOnSaveHandler(handler: saveEventType): void {\n registerOnSaveHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnSaveHandler),\n handler,\n () => {\n if (!isNullOrUndefined(handler) && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnSaveHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param apiVersionTag - The API version tag, which is used for telemetry, composed by API version number and source API name.\n * @param handler - The handler to invoke when the user selects the Save button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerOnSaveHandlerHelper(\n apiVersionTag: string,\n handler: (evt: SaveEvent) => void,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n !isNullOrUndefined(handler) && ensureInitialized(runtime, FrameContexts.settings);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n saveHandler = handler;\n !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['save']);\n }\n\n /**\n * Registers a handler for user attempts to remove content. This handler should be used\n * to remove the underlying resource powering the content.\n * The object passed to the handler must be used to indicate whether to proceed with the removal.\n * Only one handler may be registered at a time. Subsequent registrations will override the first.\n * @param handler - The handler to invoke when the user selects the Remove button.\n */\n export function registerOnRemoveHandler(handler: removeEventType): void {\n registerOnRemoveHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnRemoveHandler),\n handler,\n () => {\n if (!isNullOrUndefined(handler) && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnRemoveHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param apiVersionTag - The API version tag, which is used for telemetry, composed by API version number and source API name.\n * @param handler - The handler to invoke when the user selects the Remove button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerOnRemoveHandlerHelper(\n apiVersionTag: string,\n handler: (evt: RemoveEvent) => void,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n !isNullOrUndefined(handler) && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n removeHandler = handler;\n !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['remove']);\n }\n\n function handleSave(result?: SaveParameters): void {\n const saveEventType = new SaveEventImpl(result);\n if (saveHandler) {\n saveHandler(saveEventType);\n } else if (Communication.childWindow) {\n sendMessageEventToChild('settings.save', [result]);\n } else {\n // If no handler is registered, we assume success.\n saveEventType.notifySuccess();\n }\n }\n\n /**\n * Registers a handler for when the tab configuration is changed by the user\n * @param handler - The handler to invoke when the user clicks on Settings.\n */\n export function registerChangeConfigHandler(handler: handlerFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterChangeConfigHandler),\n 'changeSettings',\n handler,\n [FrameContexts.content],\n () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * Describes the results of the settings.save event. Includes result, notifySuccess, and notifyFailure\n * to indicate the return object (result) and the status of whether the settings.save call succeeded or not and why.\n */\n export interface SaveEvent {\n /**\n * Object containing properties passed as arguments to the settings.save event.\n */\n result: SaveParameters;\n /**\n * Indicates that the underlying resource has been created and the config can be saved.\n */\n notifySuccess(): void;\n /**\n * Indicates that creation of the underlying resource failed and that the config cannot be saved.\n * @param reason - Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.\n */\n notifyFailure(reason?: string): void;\n }\n\n /**\n * Describes the results of the settings.remove event. Includes notifySuccess, and notifyFailure\n * to indicate the status of whether the settings.save call succeeded or not and why.\n */\n export interface RemoveEvent {\n /**\n * Indicates that the underlying resource has been removed and the content can be removed.\n */\n notifySuccess(): void;\n /**\n * Indicates that removal of the underlying resource failed and that the content cannot be removed.\n * @param reason - Specifies a reason for the failure. If provided, this string is displayed to the user; otherwise a generic error is displayed.\n */\n notifyFailure(reason?: string): void;\n }\n\n /**\n * Parameters used in the settings.save event\n */\n export interface SaveParameters {\n /**\n * Connector's webhook Url returned as arguments to settings.save event as part of user clicking on Save\n */\n webhookUrl?: string;\n }\n\n /**\n * @hidden\n * Hide from docs, since this class is not directly used.\n */\n class SaveEventImpl implements SaveEvent {\n public notified = false;\n public result: SaveParameters;\n public constructor(result?: SaveParameters) {\n this.result = result ? result : {};\n }\n public notifySuccess(): void {\n this.ensureNotNotified();\n sendMessageToParent(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SaveEvent_NotifySuccess),\n 'settings.save.success',\n );\n this.notified = true;\n }\n public notifyFailure(reason?: string): void {\n this.ensureNotNotified();\n sendMessageToParent(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SaveEvent_NotifyFailure),\n 'settings.save.failure',\n [reason],\n );\n this.notified = true;\n }\n private ensureNotNotified(): void {\n if (this.notified) {\n throw new Error('The SaveEvent may only notify success or failure once.');\n }\n }\n }\n\n function handleRemove(): void {\n const removeEventType = new RemoveEventImpl();\n if (removeHandler) {\n removeHandler(removeEventType);\n } else if (Communication.childWindow) {\n sendMessageEventToChild('settings.remove', []);\n } else {\n // If no handler is registered, we assume success.\n removeEventType.notifySuccess();\n }\n }\n\n /**\n * @hidden\n * Hide from docs, since this class is not directly used.\n */\n class RemoveEventImpl implements RemoveEvent {\n public notified = false;\n\n public notifySuccess(): void {\n this.ensureNotNotified();\n sendMessageToParent(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RemoveEvent_NotifySuccess),\n 'settings.remove.success',\n );\n this.notified = true;\n }\n\n public notifyFailure(reason?: string): void {\n this.ensureNotNotified();\n sendMessageToParent(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RemoveEvent_NotifyFailure),\n 'settings.remove.failure',\n [reason],\n );\n this.notified = true;\n }\n\n private ensureNotNotified(): void {\n if (this.notified) {\n throw new Error('The removeEventType may only notify success or failure once.');\n }\n }\n }\n\n /**\n * Checks if the pages.config capability is supported by the host\n * @returns boolean to represent whether the pages.config capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.config\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides APIs for handling the user's navigational history.\n */\n export namespace backStack {\n let backButtonPressHandler: (() => boolean) | undefined;\n\n /**\n * @hidden\n * Register backButtonPress handler.\n *\n * @internal\n * Limited to Microsoft-internal use.\n */\n export function _initialize(): void {\n registerHandler(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_BackStack_RegisterBackButtonPressHandler),\n 'backButtonPress',\n handleBackButtonPress,\n false,\n );\n }\n\n /**\n * Navigates back in the hosted application. See {@link pages.backStack.registerBackButtonHandler} for notes on usage.\n * @returns Promise that resolves when the navigation has completed.\n */\n export function navigateBack(): Promise<void> {\n return backStackNavigateBackHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_BackStack_NavigateBack),\n );\n }\n\n /**\n * Registers a handler for user presses of the host client's back button. Experiences that maintain an internal\n * navigation stack should use this handler to navigate the user back within their frame. If an application finds\n * that after running its back button handler it cannot handle the event it should call the navigateBack\n * method to ask the host client to handle it instead.\n * @param handler - The handler to invoke when the user presses the host client's back button.\n */\n export function registerBackButtonHandler(handler: backButtonHandlerFunctionType): void {\n registerBackButtonHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_BackStack_RegisterBackButtonHandler),\n handler,\n () => {\n if (!isNullOrUndefined(handler) && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerBackButtonHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n * @param apiVersionTag - The tag indicating API version number with name\n * @param handler - The handler to invoke when the user presses the host client's back button.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n */\n export function registerBackButtonHandlerHelper(\n apiVersionTag: string,\n handler: () => boolean,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n !isNullOrUndefined(handler) && ensureInitialized(runtime);\n if (versionSpecificHelper) {\n versionSpecificHelper();\n }\n backButtonPressHandler = handler;\n !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['backButton']);\n }\n\n function handleBackButtonPress(): void {\n if (!backButtonPressHandler || !backButtonPressHandler()) {\n if (Communication.childWindow) {\n // If the current window did not handle it let the child window\n sendMessageEventToChild('backButtonPress', []);\n } else {\n navigateBack();\n }\n }\n }\n\n /**\n * Checks if the pages.backStack capability is supported by the host\n * @returns boolean to represent whether the pages.backStack capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.backStack\n ? true\n : false\n : false;\n }\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Provides APIs to interact with the full-trust part of the SDK. Limited to 1P applications\n * @internal\n * Limited to Microsoft-internal use\n */\n export namespace fullTrust {\n /**\n * @hidden\n * Hide from docs\n * ------\n * Place the tab into full-screen mode.\n *\n */\n export function enterFullscreen(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_FullTrust_EnterFullscreen),\n 'enterFullscreen',\n [],\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Reverts the tab into normal-screen mode.\n */\n export function exitFullscreen(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_FullTrust_ExitFullscreen),\n 'exitFullscreen',\n [],\n );\n }\n /**\n * @hidden\n *\n * Checks if the pages.fullTrust capability is supported by the host\n * @returns boolean to represent whether the pages.fullTrust capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.fullTrust\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides APIs to interact with the app button part of the SDK.\n */\n export namespace appButton {\n /**\n * Registers a handler for clicking the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when the personal app button is clicked in the app bar.\n */\n export function onClick(handler: handlerFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnClick),\n 'appButtonClick',\n handler,\n [FrameContexts.content],\n () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * Registers a handler for entering hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.\n */\n export function onHoverEnter(handler: handlerFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnHoverEnter),\n 'appButtonHoverEnter',\n handler,\n [FrameContexts.content],\n () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * Registers a handler for exiting hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.\n */\n export function onHoverLeave(handler: handlerFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnHoverLeave),\n 'appButtonHoverLeave',\n handler,\n [FrameContexts.content],\n () => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * Checks if pages.appButton capability is supported by the host\n * @returns boolean to represent whether the pages.appButton capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.appButton\n ? true\n : false\n : false;\n }\n }\n\n /**\n * Provides functions for navigating within your own app\n *\n * @remarks\n * If you are looking to navigate to a different app, use {@link pages.navigateToApp}.\n */\n export namespace currentApp {\n /**\n * Parameters provided to the {@link pages.currentApp.navigateTo} function\n */\n export interface NavigateWithinAppParams {\n /**\n * The developer-defined unique ID for the page defined in the manifest or when first configuring\n * the page. (Known as {@linkcode Context.entityId} prior to TeamsJS v2.0.0)\n */\n pageId: string;\n\n /**\n * Optional developer-defined unique ID describing the content to navigate to within the page. This\n * can be retrieved from the Context object {@link app.PageInfo.subPageId | app.Context.page.subPageId}\n */\n subPageId?: string;\n }\n\n /**\n * Navigate within the currently running app\n *\n * @remarks\n * If you are looking to navigate to a different app, use {@link pages.navigateToApp}.\n *\n * @param params Parameters for the navigation\n * @returns `Promise` that will resolve if the navigation was successful and reject if not\n */\n export function navigateTo(params: NavigateWithinAppParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_CurrentApp_NavigateTo),\n 'pages.currentApp.navigateTo',\n params,\n ),\n );\n });\n }\n\n /**\n * Navigate to the currently running app's first static page defined in the application\n * manifest.\n *\n * @returns `Promise` that will resolve if the navigation was successful and reject if not\n */\n export function navigateToDefaultPage(): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_CurrentApp_NavigateToDefaultPage),\n 'pages.currentApp.navigateToDefaultPage',\n ),\n );\n });\n }\n\n /**\n * Checks if pages.currentApp capability is supported by the host\n * @returns boolean to represent whether the pages.currentApp capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.pages\n ? runtime.supports.pages.currentApp\n ? true\n : false\n : false;\n }\n }\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from '../public/constants';\nimport { LoadContext, ResumeContext } from '../public/interfaces';\nimport { pages } from '../public/pages';\nimport { runtime } from '../public/runtime';\nimport { Communication, sendMessageEventToChild, sendMessageToParent } from './communication';\nimport { ensureInitialized } from './internalAPIs';\nimport { getLogger } from './telemetry';\nimport { isNullOrUndefined } from './typeCheckUtilities';\n\nconst handlersLogger = getLogger('handlers');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nclass HandlersPrivate {\n public static handlers: {\n [func: string]: Function;\n } = {};\n public static themeChangeHandler: null | ((theme: string) => void) = null;\n /**\n * @deprecated\n */\n public static loadHandler: null | ((context: LoadContext) => void) = null;\n /**\n * @deprecated\n */\n public static beforeUnloadHandler: null | ((readyToUnload: () => void) => boolean) = null;\n public static beforeSuspendOrTerminateHandler: null | (() => Promise<void>) = null;\n public static resumeHandler: null | ((context: ResumeContext) => void) = null;\n\n /**\n * @internal\n * Limited to Microsoft-internal use\n * Initializes the handlers.\n */\n public static initializeHandlers(): void {\n // ::::::::::::::::::::MicrosoftTeams SDK Internal :::::::::::::::::\n HandlersPrivate.handlers['themeChange'] = handleThemeChange;\n HandlersPrivate.handlers['load'] = handleLoad;\n HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;\n pages.backStack._initialize();\n }\n\n /**\n * @internal\n * Limited to Microsoft-internal use\n * Uninitializes the handlers.\n */\n public static uninitializeHandlers(): void {\n HandlersPrivate.handlers = {};\n HandlersPrivate.themeChangeHandler = null;\n HandlersPrivate.loadHandler = null;\n HandlersPrivate.beforeUnloadHandler = null;\n HandlersPrivate.beforeSuspendOrTerminateHandler = null;\n HandlersPrivate.resumeHandler = null;\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function initializeHandlers(): void {\n HandlersPrivate.initializeHandlers();\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function uninitializeHandlers(): void {\n HandlersPrivate.uninitializeHandlers();\n}\nconst callHandlerLogger = handlersLogger.extend('callHandler');\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function callHandler(name: string, args?: unknown[]): [true, unknown] | [false, undefined] {\n const handler = HandlersPrivate.handlers[name];\n if (handler) {\n callHandlerLogger('Invoking the registered handler for message %s with arguments %o', name, args);\n const result = handler.apply(this, args);\n return [true, result];\n } else if (Communication.childWindow) {\n sendMessageEventToChild(name, args);\n return [false, undefined];\n } else {\n callHandlerLogger('Handler for action message %s not found.', name);\n return [false, undefined];\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerHandler(\n apiVersionTag: string,\n name: string,\n handler: Function,\n sendMessage = true,\n args: unknown[] = [],\n): void {\n if (handler) {\n HandlersPrivate.handlers[name] = handler;\n sendMessage && sendMessageToParent(apiVersionTag, 'registerHandler', [name, ...args]);\n } else {\n delete HandlersPrivate.handlers[name];\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function removeHandler(name: string): void {\n delete HandlersPrivate.handlers[name];\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function doesHandlerExist(name: string): boolean {\n return HandlersPrivate.handlers[name] != null;\n}\n\n/**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of register*Handler APIs\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param apiVersionTag - The tag of the api version and name\n * @param name - The name of the handler to register.\n * @param handler - The handler to invoke.\n * @param contexts - The context within which it is valid to register this handler.\n * @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.\n */\nexport function registerHandlerHelper(\n apiVersionTag: string,\n name: string,\n handler: Function,\n contexts: FrameContexts[],\n registrationHelper?: () => void,\n): void {\n // allow for registration cleanup even when not finished initializing\n handler && ensureInitialized(runtime, ...contexts);\n if (registrationHelper) {\n registrationHelper();\n }\n\n registerHandler(apiVersionTag, name, handler);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerOnThemeChangeHandler(apiVersionTag: string, handler: (theme: string) => void): void {\n HandlersPrivate.themeChangeHandler = handler;\n !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['themeChange']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function handleThemeChange(theme: string): void {\n if (HandlersPrivate.themeChangeHandler) {\n HandlersPrivate.themeChangeHandler(theme);\n }\n\n if (Communication.childWindow) {\n sendMessageEventToChild('themeChange', [theme]);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * @deprecated\n */\nexport function registerOnLoadHandler(apiVersionTag: string, handler: (context: LoadContext) => void): void {\n HandlersPrivate.loadHandler = handler;\n !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['load']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleLoad(loadContext: LoadContext): void {\n const resumeContext = convertToResumeContext(loadContext);\n if (HandlersPrivate.resumeHandler) {\n HandlersPrivate.resumeHandler(resumeContext);\n if (Communication.childWindow) {\n sendMessageEventToChild('load', [resumeContext]);\n }\n } else if (HandlersPrivate.loadHandler) {\n HandlersPrivate.loadHandler(loadContext);\n if (Communication.childWindow) {\n sendMessageEventToChild('load', [loadContext]);\n }\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction convertToResumeContext(context: LoadContext): ResumeContext {\n return {\n entityId: context.entityId,\n contentUrl: new URL(context.contentUrl),\n };\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * @deprecated\n */\nexport function registerBeforeUnloadHandler(\n apiVersionTag: string,\n handler: (readyToUnload: () => void) => boolean,\n): void {\n HandlersPrivate.beforeUnloadHandler = handler;\n !isNullOrUndefined(handler) && sendMessageToParent(apiVersionTag, 'registerHandler', ['beforeUnload']);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nasync function handleBeforeUnload(): Promise<void> {\n const readyToUnload = (): void => {\n sendMessageToParent(getApiVersionTag(ApiVersionNumber.V_2, ApiName.HandleBeforeUnload), 'readyToUnload', []);\n };\n\n if (HandlersPrivate.beforeSuspendOrTerminateHandler) {\n await HandlersPrivate.beforeSuspendOrTerminateHandler();\n if (Communication.childWindow) {\n sendMessageEventToChild('beforeUnload');\n } else {\n readyToUnload();\n }\n } else if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {\n if (Communication.childWindow) {\n sendMessageEventToChild('beforeUnload');\n } else {\n readyToUnload();\n }\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerBeforeSuspendOrTerminateHandler(handler: () => Promise<void>): void {\n HandlersPrivate.beforeSuspendOrTerminateHandler = handler;\n !isNullOrUndefined(handler) &&\n sendMessageToParent(\n getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterBeforeSuspendOrTerminateHandler),\n 'registerHandler',\n ['beforeUnload'],\n );\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerOnResumeHandler(handler: (context: ResumeContext) => void): void {\n HandlersPrivate.resumeHandler = handler;\n !isNullOrUndefined(handler) &&\n sendMessageToParent(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterOnResumeHandler), 'registerHandler', [\n 'load',\n ]);\n}\n","import { generateGUID, validateUuid } from './utils';\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * UUID object\n */\nexport class UUID {\n public constructor(private readonly uuid: string = generateGUID()) {\n validateUuid(uuid);\n }\n\n public toString(): string {\n return this.uuid;\n }\n}\n","import { UUID as MessageUUID } from './uuidObject';\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * MessageIDs represent the legacy number id used for processing MessageRequests and MessageResponses\n */\nexport type MessageID = number;\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface MessageRequest {\n id?: MessageID;\n uuid?: MessageUUID;\n func: string;\n timestamp?: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args?: any[];\n apiVersionTag?: string;\n isPartialResponse?: boolean;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface SerializedMessageRequest {\n id?: MessageID;\n uuidAsString?: string;\n func: string;\n timestamp?: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args?: any[];\n apiVersionTag?: string;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface SerializedMessageResponse {\n id: MessageID;\n uuidAsString?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args?: any[];\n isPartialResponse?: boolean; // If the message is partial, then there will be more future responses for the given message ID.\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface MessageResponse {\n id: MessageID;\n uuid?: MessageUUID;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args?: any[];\n isPartialResponse?: boolean; // If the message is partial, then there will be more future responses for the given message ID.\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * For reasons that are unclear at this time, some MessageRequest objects can exist without an id or timestamp, even though\n * many parts of code assume that they are defined.\n * To enable type-safety in some scenarios, this new interface can be used where these properties are required. Because it\n * derives from the original interface, objects of this type can be user interchangeably with the original interface.\n * As the required messaging scenarios are better understood, the interfaces will eventually be updated and\n * merged. However, it's a journey.\n */\nexport interface MessageRequestWithRequiredProperties extends MessageRequest {\n id: MessageID;\n uuid: MessageUUID;\n timestamp: number;\n}\n\nexport const serializeMessageRequest = (message: MessageRequest): SerializedMessageRequest => {\n const { uuid, ...restOfMessage } = message;\n const uuidAsString = uuid?.toString();\n const request: SerializedMessageRequest = {\n ...restOfMessage,\n uuidAsString: uuidAsString,\n };\n return request;\n};\n\nexport const deserializeMessageRequest = (message: SerializedMessageRequest): MessageRequest => {\n const { uuidAsString, ...restOfMessage } = message;\n const request: MessageRequest = {\n ...restOfMessage,\n uuid: uuidAsString ? new MessageUUID(uuidAsString) : undefined,\n };\n return request;\n};\n\nexport const deserializeMessageResponse = (serializedResponse: SerializedMessageResponse): MessageResponse => {\n const { uuidAsString, ...restOfResponse } = serializedResponse;\n const messageResponse: MessageResponse = {\n ...restOfResponse,\n uuid: uuidAsString ? new MessageUUID(uuidAsString) : undefined,\n };\n return messageResponse;\n};\n\nexport const serializeMessageResponse = (response: MessageResponse): SerializedMessageResponse => {\n const { uuid, ...restOfResponse } = response;\n const uuidAsString = uuid?.toString();\n const messageResponse: SerializedMessageResponse = {\n ...restOfResponse,\n uuidAsString: uuidAsString,\n };\n return messageResponse;\n};\n","import { GlobalVars } from './globalVars';\nimport { MessageRequestWithRequiredProperties } from './messageObjects';\nimport { getLogger } from './telemetry';\n\nconst nestedAppAuthLogger = getLogger('nestedAppAuthUtils');\nconst tryPolyfillWithNestedAppAuthBridgeLogger = nestedAppAuthLogger.extend('tryPolyfillWithNestedAppAuthBridge');\n\n/**\n * @hidden\n * Enumeration for nested app authentication message event names.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @enum {string}\n *\n * @property {string} Request - Event name for a nested app authentication request.\n * @property {string} Response - Event name for a nested app authentication response.\n */\nexport const enum NestedAppAuthMessageEventNames {\n Request = 'NestedAppAuthRequest',\n Response = 'NestedAppAuthResponse',\n}\n\n/**\n * @hidden\n * Interface for a nested app authentication request.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @interface\n * @extends {MessageRequest}\n *\n * @property {string} func - The function name, should always be 'nestedAppAuthRequest'.\n * @property {string} data - data associated with the request, represented as a string.\n */\nexport interface NestedAppAuthRequest extends MessageRequestWithRequiredProperties {\n func: 'nestedAppAuth.execute';\n data: string;\n}\n\n/**\n * @hidden\n * Interface for parsed data from a nested app authentication message.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @interface\n * @property {NestedAppAuthMessageEventNames} messageType - The type of the nested app authentication message event.\n */\nexport interface ParsedNestedAppAuthMessageData {\n messageType: NestedAppAuthMessageEventNames;\n}\n\n/**\n * @hidden\n * Interface for a nested app authentication bridge.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @interface\n *\n * @property {Function} addEventListener - Function to add an event listener to the bridge. Takes an event name and a callback function as parameters.\n * @property {Function} postMessage - Function to post a message to the bridge. Takes a message string as a parameter.\n * @property {Function} removeEventListener - Function to remove an event listener from the bridge. Takes an event name and a callback function as parameters.\n */\nexport interface NestedAppAuthBridge {\n addEventListener: (eventName: string, callback: (response: string) => void) => void;\n postMessage: (message: string) => void;\n removeEventListener: (eventName: string, callback: (response: string) => void) => void;\n}\n\n/**\n * @hidden\n * Interface for a Window object extended with a nested app authentication bridge.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @interface\n * @extends {Window}\n *\n * @property {NestedAppAuthBridge} nestedAppAuthBridge - The nested app authentication bridge associated with the window.\n */\nexport interface NestedAuthExtendedWindow extends Window {\n nestedAppAuthBridge: NestedAppAuthBridge;\n}\n\n/**\n * @hidden\n * Type for handlers in a nested app authentication bridge.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @typedef {Object} NestedAppAuthBridgeHandlers\n *\n * @property {Function} onMessage - Function to handle a message event. Takes a MessageEvent object and a callback function as parameters. The callback function is called when a message is received.\n * @property {Function} handlePostMessage - Function to handle posting a message. Takes a message string as a parameter.\n */\ntype NestedAppAuthBridgeHandlers = {\n onMessage: (evt: MessageEvent, onMessageReceived: (response: string) => void) => void;\n sendPostMessage: (message: string) => void;\n};\n\n/**\n * @hidden\n * Attempt to polyfill the nestedAppAuthBridge object on the given window\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function tryPolyfillWithNestedAppAuthBridge(\n clientSupportedSDKVersion: string,\n window: Window | null,\n handlers: NestedAppAuthBridgeHandlers,\n): void {\n const logger = tryPolyfillWithNestedAppAuthBridgeLogger;\n\n if (GlobalVars.isFramelessWindow) {\n logger('Cannot polyfill nestedAppAuthBridge as current window is frameless');\n return;\n }\n\n if (!window) {\n logger('Cannot polyfill nestedAppAuthBridge as current window does not exist');\n return;\n }\n\n const parsedClientSupportedSDKVersion = (() => {\n try {\n return JSON.parse(clientSupportedSDKVersion);\n } catch (e) {\n return null;\n }\n })();\n\n if (!parsedClientSupportedSDKVersion || !parsedClientSupportedSDKVersion.supports?.nestedAppAuth) {\n logger('Cannot polyfill nestedAppAuthBridge as current hub does not support nested app auth');\n return;\n }\n\n const extendedWindow = window as unknown as NestedAuthExtendedWindow;\n if (extendedWindow.nestedAppAuthBridge) {\n logger('nestedAppAuthBridge already exists on current window, skipping polyfill');\n return;\n }\n\n const nestedAppAuthBridge = createNestedAppAuthBridge(extendedWindow, handlers);\n if (nestedAppAuthBridge) {\n extendedWindow.nestedAppAuthBridge = nestedAppAuthBridge;\n }\n}\n\nconst createNestedAppAuthBridgeLogger = nestedAppAuthLogger.extend('createNestedAppAuthBridge');\n\n/**\n * @hidden\n * Creates a bridge for nested app authentication.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param {Window | null} window - The window object where the nested app authentication bridge will be created. If null, the function will log an error message and return null.\n * @returns {NestedAppAuthBridge | null} Returns an object with methods for adding and removing event listeners, and posting messages. If the provided window is null, returns null.\n *\n * @property {Function} addEventListener - Adds an event listener to the window. Only supports the 'message' event. If an unsupported event is passed, logs an error message.\n * @property {Function} postMessage - Posts a message to the window. The message should be a stringified JSON object with a messageType of 'NestedAppAuthRequest'. If the message does not meet these criteria, logs an error message.\n * @property {Function} removeEventListener - Removes an event listener from the window.\n */\nfunction createNestedAppAuthBridge(\n window: Window | null,\n bridgeHandlers: NestedAppAuthBridgeHandlers,\n): NestedAppAuthBridge | null {\n const logger = createNestedAppAuthBridgeLogger;\n\n if (!window) {\n logger('nestedAppAuthBridge cannot be created as current window does not exist');\n return null;\n }\n\n const { onMessage, sendPostMessage } = bridgeHandlers;\n const nestedAppAuthBridgeHandler = (callback: (response: string) => void) => (evt: MessageEvent) =>\n onMessage(evt, callback);\n\n return {\n addEventListener: (eventName, callback): void => {\n if (eventName === 'message') {\n window.addEventListener(eventName, nestedAppAuthBridgeHandler(callback));\n } else {\n logger(`Event ${eventName} is not supported by nestedAppAuthBridge`);\n }\n },\n postMessage: (message: string): void => {\n // Validate that it is a valid auth bridge request message\n const parsedMessage = (() => {\n try {\n return JSON.parse(message);\n } catch (e) {\n return null;\n }\n })();\n\n if (\n !parsedMessage ||\n typeof parsedMessage !== 'object' ||\n parsedMessage.messageType !== NestedAppAuthMessageEventNames.Request\n ) {\n logger('Unrecognized data format received by app, message being ignored. Message: %o', message);\n return;\n }\n\n // Post the message to the top window\n sendPostMessage(message);\n },\n removeEventListener: (eventName: string, callback): void => {\n window.removeEventListener(eventName, nestedAppAuthBridgeHandler(callback));\n },\n };\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable strict-null-checks/all */\n\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from '../public/constants';\nimport { SdkError } from '../public/interfaces';\nimport { latestRuntimeApiVersion } from '../public/runtime';\nimport { version } from '../public/version';\nimport { GlobalVars } from './globalVars';\nimport { callHandler } from './handlers';\nimport { DOMMessageEvent, ExtendedWindow } from './interfaces';\nimport {\n deserializeMessageRequest,\n deserializeMessageResponse,\n MessageID,\n MessageRequest,\n MessageRequestWithRequiredProperties,\n MessageResponse,\n SerializedMessageRequest,\n SerializedMessageResponse,\n serializeMessageRequest,\n serializeMessageResponse,\n} from './messageObjects';\nimport {\n NestedAppAuthMessageEventNames,\n NestedAppAuthRequest,\n ParsedNestedAppAuthMessageData,\n tryPolyfillWithNestedAppAuthBridge,\n} from './nestedAppAuthUtils';\nimport { getLogger, isFollowingApiVersionTagFormat } from './telemetry';\nimport { ssrSafeWindow } from './utils';\nimport { UUID as MessageUUID } from './uuidObject';\nimport { validateOrigin } from './validOrigins';\n\nconst communicationLogger = getLogger('communication');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport class Communication {\n public static currentWindow: Window | any;\n public static parentOrigin: string | null;\n public static parentWindow: Window | any;\n public static childWindow: Window | null;\n public static childOrigin: string | null;\n public static topWindow: Window | any;\n public static topOrigin: string | null;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nclass CommunicationPrivate {\n public static parentMessageQueue: MessageRequest[] = [];\n public static childMessageQueue: MessageRequest[] = [];\n public static topMessageQueue: MessageRequest[] = [];\n public static nextMessageId = 0;\n public static callbacks: Map<MessageUUID, Function> = new Map();\n public static promiseCallbacks: Map<MessageUUID, (value?: unknown) => void> = new Map();\n public static portCallbacks: Map<MessageUUID, (port?: MessagePort, args?: unknown[]) => void> = new Map();\n public static messageListener: Function;\n public static legacyMessageIdsToUuidMap: {\n [legacyId: MessageID]: MessageUUID;\n } = {};\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\ninterface InitializeResponse {\n context: FrameContexts;\n clientType: string;\n runtimeConfig: string;\n clientSupportedSDKVersion: string;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function initializeCommunication(\n validMessageOrigins: string[] | undefined,\n apiVersionTag: string,\n): Promise<InitializeResponse> {\n // Listen for messages post to our window\n CommunicationPrivate.messageListener = async (evt: DOMMessageEvent): Promise<void> => await processMessage(evt);\n\n // If we are in an iframe, our parent window is the one hosting us (i.e., window.parent); otherwise,\n // it's the window that opened us (i.e., window.opener)\n Communication.currentWindow = Communication.currentWindow || ssrSafeWindow();\n Communication.parentWindow =\n Communication.currentWindow.parent !== Communication.currentWindow.self\n ? Communication.currentWindow.parent\n : Communication.currentWindow.opener;\n Communication.topWindow = Communication.currentWindow.top;\n\n // Listen to messages from the parent or child frame.\n // Frameless windows will only receive this event from child frames and if validMessageOrigins is passed.\n if (Communication.parentWindow || validMessageOrigins) {\n Communication.currentWindow.addEventListener('message', CommunicationPrivate.messageListener, false);\n }\n\n if (!Communication.parentWindow) {\n const extendedWindow = Communication.currentWindow as unknown as ExtendedWindow;\n if (extendedWindow.nativeInterface) {\n GlobalVars.isFramelessWindow = true;\n extendedWindow.onNativeMessage = handleParentMessage;\n } else {\n // at this point we weren't able to find a parent to talk to, no way initialization will succeed\n return Promise.reject(new Error('Initialization Failed. No Parent window found.'));\n }\n }\n\n try {\n // Send the initialized message to any origin, because at this point we most likely don't know the origin\n // of the parent window, and this message contains no data that could pose a security risk.\n Communication.parentOrigin = '*';\n return sendMessageToParentAsync<[FrameContexts, string, string, string]>(apiVersionTag, 'initialize', [\n version,\n latestRuntimeApiVersion,\n validMessageOrigins,\n ]).then(\n ([context, clientType, runtimeConfig, clientSupportedSDKVersion]: [FrameContexts, string, string, string]) => {\n tryPolyfillWithNestedAppAuthBridge(clientSupportedSDKVersion, Communication.currentWindow, {\n onMessage: processAuthBridgeMessage,\n sendPostMessage: sendNestedAuthRequestToTopWindow,\n });\n return { context, clientType, runtimeConfig, clientSupportedSDKVersion };\n },\n );\n } finally {\n Communication.parentOrigin = null;\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function uninitializeCommunication(): void {\n if (Communication.currentWindow) {\n Communication.currentWindow.removeEventListener('message', CommunicationPrivate.messageListener, false);\n }\n\n Communication.currentWindow = null;\n Communication.parentWindow = null;\n Communication.parentOrigin = null;\n Communication.childWindow = null;\n Communication.childOrigin = null;\n CommunicationPrivate.parentMessageQueue = [];\n CommunicationPrivate.childMessageQueue = [];\n CommunicationPrivate.nextMessageId = 0;\n CommunicationPrivate.callbacks.clear();\n CommunicationPrivate.promiseCallbacks.clear();\n CommunicationPrivate.portCallbacks.clear();\n CommunicationPrivate.legacyMessageIdsToUuidMap = {};\n}\n\n/**\n * @hidden\n * Send a message to parent and then unwrap result. Uses nativeInterface on mobile to communicate with parent context\n * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent\n * for telemetry work.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndUnwrap<T>(apiVersionTag: string, actionName: string, ...args: any[]): Promise<T> {\n return sendMessageToParentAsync(apiVersionTag, actionName, args).then(([result]: [T]) => result);\n}\n\n/**\n * @hidden\n * Send a message to parent and then handle status and reason. Uses nativeInterface on mobile to communicate with parent context\n * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent\n * for telemetry work.\n */\nexport function sendAndHandleStatusAndReason(apiVersionTag: string, actionName: string, ...args: any[]): Promise<void> {\n return sendMessageToParentAsync(apiVersionTag, actionName, args).then(\n ([wasSuccessful, reason]: [boolean, string]) => {\n if (!wasSuccessful) {\n throw new Error(reason);\n }\n },\n );\n}\n\n/**\n * @hidden\n * Send a message to parent and then handle status and reason with default error. Uses nativeInterface on mobile to communicate with parent context\n * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent\n * for telemetry work.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndHandleStatusAndReasonWithDefaultError(\n apiVersionTag: string,\n actionName: string,\n defaultError: string,\n ...args: any[]\n): Promise<void> {\n return sendMessageToParentAsync(apiVersionTag, actionName, args).then(\n ([wasSuccessful, reason]: [boolean, string]) => {\n if (!wasSuccessful) {\n throw new Error(reason ? reason : defaultError);\n }\n },\n );\n}\n\n/**\n * @hidden\n * Send a message to parent and then handle SDK error. Uses nativeInterface on mobile to communicate with parent context\n * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent\n * for telemetry work.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendAndHandleSdkError<T>(apiVersionTag: string, actionName: string, ...args: any[]): Promise<T> {\n return sendMessageToParentAsync(apiVersionTag, actionName, args).then(([error, result]: [SdkError, T]) => {\n if (error) {\n throw error;\n }\n return result;\n });\n}\n\n/**\n * @hidden\n * Send a message to parent asynchronously. Uses nativeInterface on mobile to communicate with parent context\n * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent\n * for telemetry work.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParentAsync<T>(\n apiVersionTag: string,\n actionName: string,\n args: any[] | undefined = undefined,\n): Promise<T> {\n if (!isFollowingApiVersionTagFormat(apiVersionTag)) {\n throw Error(\n `apiVersionTag: ${apiVersionTag} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`,\n );\n }\n\n return new Promise((resolve) => {\n const request = sendMessageToParentHelper(apiVersionTag, actionName, args);\n resolve(waitForResponse<T>(request.uuid));\n });\n}\n\n/**\n * @hidden\n * Send a message to parent requesting a MessageChannel Port.\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function requestPortFromParentWithVersion(\n apiVersionTag: string,\n actionName: string,\n args: any[] | undefined = undefined,\n): Promise<MessagePort> {\n if (!isFollowingApiVersionTagFormat(apiVersionTag)) {\n throw Error(\n `apiVersionTag: ${apiVersionTag} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`,\n );\n }\n const request = sendMessageToParentHelper(apiVersionTag, actionName, args);\n return waitForPort(request.uuid);\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction waitForPort(requestUuid: MessageUUID): Promise<MessagePort> {\n return new Promise<MessagePort>((resolve, reject) => {\n CommunicationPrivate.portCallbacks.set(requestUuid, (port: MessagePort | undefined, args?: unknown[]) => {\n if (port instanceof MessagePort) {\n resolve(port);\n } else {\n // First arg is the error message, if present\n reject(args && args.length > 0 ? args[0] : new Error('Host responded without port or error details.'));\n }\n });\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction waitForResponse<T>(requestUuid: MessageUUID): Promise<T> {\n return new Promise<T>((resolve) => {\n CommunicationPrivate.promiseCallbacks.set(requestUuid, resolve);\n });\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParent(apiVersionTag: string, actionName: string, callback?: Function): void;\n\n/**\n * @hidden\n * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageToParent(\n apiVersionTag: string,\n actionName: string,\n args: any[] | undefined,\n callback?: Function,\n): void;\n\n/**\n * @hidden\n * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context\n * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent\n * for telemetry work.\n *\n */\nexport function sendMessageToParent(\n apiVersionTag: string,\n actionName: string,\n argsOrCallback?: any[] | Function,\n callback?: Function,\n): void {\n let args: any[] | undefined;\n if (argsOrCallback instanceof Function) {\n callback = argsOrCallback;\n } else if (argsOrCallback instanceof Array) {\n args = argsOrCallback;\n }\n\n if (!isFollowingApiVersionTagFormat(apiVersionTag)) {\n throw Error(\n `apiVersionTag: ${apiVersionTag} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`,\n );\n }\n\n const request = sendMessageToParentHelper(apiVersionTag, actionName, args);\n if (callback) {\n CommunicationPrivate.callbacks.set(request.uuid, callback);\n }\n}\n\nconst sendNestedAuthRequestToTopWindowLogger = communicationLogger.extend('sendNestedAuthRequestToTopWindow');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendNestedAuthRequestToTopWindow(message: string): NestedAppAuthRequest {\n const logger = sendNestedAuthRequestToTopWindowLogger;\n\n const targetWindow = Communication.topWindow;\n const request = createNestedAppAuthRequest(message);\n\n logger('Message %i information: %o', request.uuid, { actionName: request.func });\n\n return sendRequestToTargetWindowHelper(targetWindow, request) as NestedAppAuthRequest;\n}\n\nconst sendRequestToTargetWindowHelperLogger = communicationLogger.extend('sendRequestToTargetWindowHelper');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction sendRequestToTargetWindowHelper(\n targetWindow: Window,\n messageRequest: MessageRequestWithRequiredProperties | NestedAppAuthRequest,\n): MessageRequestWithRequiredProperties | NestedAppAuthRequest {\n const logger = sendRequestToTargetWindowHelperLogger;\n const targetWindowName = getTargetName(targetWindow);\n const request: SerializedMessageRequest = serializeMessageRequest(messageRequest);\n\n if (GlobalVars.isFramelessWindow) {\n if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {\n logger(`Sending message %i to ${targetWindowName} via framelessPostMessage interface`, request.uuidAsString);\n (Communication.currentWindow as ExtendedWindow).nativeInterface.framelessPostMessage(JSON.stringify(request));\n }\n } else {\n const targetOrigin = getTargetOrigin(targetWindow);\n\n // If the target window isn't closed and we already know its origin, send the message right away; otherwise,\n // queue the message and send it after the origin is established\n if (targetWindow && targetOrigin) {\n logger(`Sending message %i to ${targetWindowName} via postMessage`, request.uuidAsString);\n targetWindow.postMessage(request, targetOrigin);\n } else {\n logger(`Adding message %i to ${targetWindowName} message queue`, request.uuidAsString);\n getTargetMessageQueue(targetWindow).push(messageRequest);\n }\n }\n return messageRequest;\n}\n\nconst sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction sendMessageToParentHelper(\n apiVersionTag: string,\n actionName: string,\n args: any[] | undefined,\n): MessageRequestWithRequiredProperties {\n const logger = sendMessageToParentHelperLogger;\n\n const targetWindow = Communication.parentWindow;\n const request = createMessageRequest(apiVersionTag, actionName, args);\n\n logger('Message %i information: %o', request.uuid, { actionName, args });\n\n return sendRequestToTargetWindowHelper(targetWindow, request);\n}\n\nconst processMessageLogger = communicationLogger.extend('processMessage');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nasync function processMessage(evt: DOMMessageEvent): Promise<void> {\n // Process only if we received a valid message\n if (!evt || !evt.data || typeof evt.data !== 'object') {\n processMessageLogger('Unrecognized message format received by app, message being ignored. Message: %o', evt);\n return;\n }\n\n // Process only if the message is coming from a different window and a valid origin\n // valid origins are either a pre-known origin or one specified by the app developer\n // in their call to app.initialize\n const messageSource = evt.source || (evt.originalEvent && evt.originalEvent.source);\n const messageOrigin = evt.origin || (evt.originalEvent && evt.originalEvent.origin);\n\n return shouldProcessMessage(messageSource, messageOrigin).then((result) => {\n if (!result) {\n processMessageLogger(\n 'Message being ignored by app because it is either coming from the current window or a different window with an invalid origin',\n );\n return;\n }\n // Update our parent and child relationships based on this message\n updateRelationships(messageSource, messageOrigin);\n // Handle the message\n if (messageSource === Communication.parentWindow) {\n handleParentMessage(evt);\n } else if (messageSource === Communication.childWindow) {\n handleChildMessage(evt);\n }\n });\n}\n\nconst processAuthBridgeMessageLogger = communicationLogger.extend('processAuthBridgeMessage');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction processAuthBridgeMessage(evt: MessageEvent, onMessageReceived: (response: string) => void): void {\n const logger = processAuthBridgeMessageLogger;\n\n // Process only if we received a valid message\n if (!evt || !evt.data || typeof evt.data !== 'object') {\n logger('Unrecognized message format received by app, message being ignored. Message: %o', evt);\n return;\n }\n\n const { args } = evt.data as SerializedMessageResponse;\n const [, message] = args ?? [];\n const parsedData: ParsedNestedAppAuthMessageData = (() => {\n try {\n return JSON.parse(message);\n } catch (e) {\n return null;\n }\n })();\n\n // Validate that it is a valid auth bridge response message\n if (\n !parsedData ||\n typeof parsedData !== 'object' ||\n parsedData.messageType !== NestedAppAuthMessageEventNames.Response\n ) {\n logger('Unrecognized data format received by app, message being ignored. Message: %o', evt);\n return;\n }\n\n // Process only if the message is coming from a different window and a valid origin\n // valid origins are either a pre-known origin or one specified by the app developer\n // in their call to app.initialize\n const messageSource = evt.source || (evt as unknown as DOMMessageEvent)?.originalEvent?.source;\n const messageOrigin = evt.origin || (evt as unknown as DOMMessageEvent)?.originalEvent?.origin;\n if (!messageSource) {\n logger('Message being ignored by app because it is coming for a target that is null');\n return;\n }\n\n if (!shouldProcessMessage(messageSource, messageOrigin)) {\n logger(\n 'Message being ignored by app because it is either coming from the current window or a different window with an invalid origin',\n );\n return;\n }\n\n /**\n * In most cases, top level window and the parent window will be same.\n * If they're not, perform the necessary updates for the top level window.\n *\n * Top window logic to flush messages is kept independent so that we don't affect\n * any of the code for the existing communication channel.\n */\n if (!Communication.topWindow || Communication.topWindow.closed || messageSource === Communication.topWindow) {\n Communication.topWindow = messageSource;\n Communication.topOrigin = messageOrigin;\n }\n\n // Clean up pointers to closed parent and child windows\n if (Communication.topWindow && Communication.topWindow.closed) {\n Communication.topWindow = null;\n Communication.topOrigin = null;\n }\n\n flushMessageQueue(Communication.topWindow);\n\n // Return the response to the registered callback\n onMessageReceived(message);\n}\n\nconst shouldProcessMessageLogger = communicationLogger.extend('shouldProcessMessage');\n\n/**\n * @hidden\n * Validates the message source and origin, if it should be processed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nasync function shouldProcessMessage(messageSource: Window, messageOrigin: string): Promise<boolean> {\n // Process if message source is a different window and if origin is either in\n // Teams' pre-known whitelist or supplied as valid origin by user during initialization\n if (Communication.currentWindow && messageSource === Communication.currentWindow) {\n shouldProcessMessageLogger('Should not process message because it is coming from the current window');\n return false;\n } else if (\n Communication.currentWindow &&\n Communication.currentWindow.location &&\n messageOrigin &&\n messageOrigin === Communication.currentWindow.location.origin\n ) {\n return true;\n } else {\n let messageOriginURL: URL;\n try {\n messageOriginURL = new URL(messageOrigin);\n } catch (_) {\n shouldProcessMessageLogger('Message has an invalid origin of %s', messageOrigin);\n return false;\n }\n\n const isOriginValid = await validateOrigin(messageOriginURL);\n if (!isOriginValid) {\n shouldProcessMessageLogger('Message has an invalid origin of %s', messageOrigin);\n }\n return isOriginValid;\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction updateRelationships(messageSource: Window, messageOrigin: string): void {\n // Determine whether the source of the message is our parent or child and update our\n // window and origin pointer accordingly\n // For frameless windows (i.e mobile), there is no parent frame, so the message must be from the child.\n if (\n !GlobalVars.isFramelessWindow &&\n (!Communication.parentWindow || Communication.parentWindow.closed || messageSource === Communication.parentWindow)\n ) {\n Communication.parentWindow = messageSource;\n Communication.parentOrigin = messageOrigin;\n } else if (\n !Communication.childWindow ||\n Communication.childWindow.closed ||\n messageSource === Communication.childWindow\n ) {\n Communication.childWindow = messageSource;\n Communication.childOrigin = messageOrigin;\n }\n\n // Clean up pointers to closed parent and child windows\n if (Communication.parentWindow && Communication.parentWindow.closed) {\n Communication.parentWindow = null;\n Communication.parentOrigin = null;\n }\n if (Communication.childWindow && Communication.childWindow.closed) {\n Communication.childWindow = null;\n Communication.childOrigin = null;\n }\n\n // If we have any messages in our queue, send them now\n flushMessageQueue(Communication.parentWindow);\n flushMessageQueue(Communication.childWindow);\n}\n\nconst handleParentMessageLogger = communicationLogger.extend('handleParentMessage');\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction retrieveMessageUUIDFromResponse(response: MessageResponse): MessageUUID | undefined {\n const logger = handleParentMessageLogger;\n if (response.uuid) {\n const responseUUID = response.uuid;\n const callbackUUID = retrieveMessageUUIDFromCallback(CommunicationPrivate.callbacks, responseUUID);\n if (callbackUUID) {\n return callbackUUID;\n }\n const promiseCallbackUUID = retrieveMessageUUIDFromCallback(CommunicationPrivate.promiseCallbacks, responseUUID);\n if (promiseCallbackUUID) {\n return promiseCallbackUUID;\n }\n const portCallbackUUID = retrieveMessageUUIDFromCallback(CommunicationPrivate.portCallbacks, responseUUID);\n if (portCallbackUUID) {\n return portCallbackUUID;\n }\n } else {\n return CommunicationPrivate.legacyMessageIdsToUuidMap[response.id];\n }\n logger(\n `Received a message with uuid: ${response.uuid?.toString()} and legacyId: %i that failed to produce a callbackId`,\n response.id,\n );\n return undefined;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * This function is used to compare a new MessageUUID object value to the key values in the specified callback and retrieving that key\n * We use this because two objects with the same value are not considered equivalent therefore we can't use the new MessageUUID object\n * as a key to retrieve the value assosciated with it and should use this function instead.\n */\nfunction retrieveMessageUUIDFromCallback(\n map: Map<MessageUUID, Function>,\n responseUUID?: MessageUUID,\n): MessageUUID | undefined {\n if (responseUUID) {\n const callback = [...map].find(([key, _value]) => {\n return key.toString() === responseUUID.toString();\n });\n\n if (callback) {\n return callback[0];\n }\n }\n return undefined;\n}\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction removeMessageHandlers(message: MessageResponse, map: Map<MessageUUID, Function>): void {\n const callbackId = retrieveMessageUUIDFromCallback(map, message.uuid);\n if (callbackId) {\n map.delete(callbackId);\n }\n if (!message.uuid) {\n delete CommunicationPrivate.legacyMessageIdsToUuidMap[message.id];\n } else {\n //If we are here, then the parent is capable of sending UUIDs, therefore free up memory\n CommunicationPrivate.legacyMessageIdsToUuidMap = {};\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleParentMessage(evt: DOMMessageEvent): void {\n const logger = handleParentMessageLogger;\n\n if ('id' in evt.data && typeof evt.data.id === 'number') {\n // Call any associated Communication.callbacks\n const serializedResponse = evt.data as SerializedMessageResponse;\n const message: MessageResponse = deserializeMessageResponse(serializedResponse);\n const callbackId = retrieveMessageUUIDFromResponse(message);\n if (callbackId) {\n const callback = CommunicationPrivate.callbacks.get(callbackId);\n logger('Received a response from parent for message %i', callbackId);\n if (callback) {\n logger('Invoking the registered callback for message %i with arguments %o', callbackId, message.args);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n callback.apply(null, [...message.args, message.isPartialResponse]);\n\n // Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response\n if (!isPartialResponse(evt)) {\n logger('Removing registered callback for message %i', callbackId);\n removeMessageHandlers(message, CommunicationPrivate.callbacks);\n }\n }\n const promiseCallback = CommunicationPrivate.promiseCallbacks.get(callbackId);\n if (promiseCallback) {\n logger('Invoking the registered promise callback for message %i with arguments %o', callbackId, message.args);\n promiseCallback(message.args);\n\n logger('Removing registered promise callback for message %i', callbackId);\n removeMessageHandlers(message, CommunicationPrivate.promiseCallbacks);\n }\n const portCallback = CommunicationPrivate.portCallbacks.get(callbackId);\n if (portCallback) {\n logger('Invoking the registered port callback for message %i with arguments %o', callbackId, message.args);\n let port: MessagePort | undefined;\n if (evt.ports && evt.ports[0] instanceof MessagePort) {\n port = evt.ports[0];\n }\n portCallback(port, message.args);\n\n logger('Removing registered port callback for message %i', callbackId);\n removeMessageHandlers(message, CommunicationPrivate.portCallbacks);\n }\n if (message.uuid) {\n CommunicationPrivate.legacyMessageIdsToUuidMap = {};\n }\n }\n } else if ('func' in evt.data && typeof evt.data.func === 'string') {\n // Delegate the request to the proper handler\n const message = evt.data as MessageRequest;\n logger('Received an action message %s from parent', message.func);\n callHandler(message.func, message.args);\n } else {\n logger('Received an unknown message: %O', evt);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction isPartialResponse(evt: DOMMessageEvent): boolean {\n return evt.data.isPartialResponse === true;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction handleChildMessage(evt: DOMMessageEvent): void {\n if ('id' in evt.data && 'func' in evt.data) {\n // Try to delegate the request to the proper handler, if defined\n const message = deserializeMessageRequest(evt.data as SerializedMessageRequest);\n const [called, result] = callHandler(message.func, message.args);\n if (called && typeof result !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n sendMessageResponseToChild(message.id, message.uuid, Array.isArray(result) ? result : [result]);\n } else {\n // No handler, proxy to parent\n sendMessageToParent(\n getApiVersionTag(ApiVersionNumber.V_2, ApiName.Tasks_StartTask),\n message.func,\n message.args,\n (...args: any[]): void => {\n if (Communication.childWindow) {\n const isPartialResponse = args.pop();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n sendMessageResponseToChild(message.id, message.uuid, args, isPartialResponse);\n }\n },\n );\n }\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Checks if the top window and the parent window are different.\n *\n * @returns {boolean} Returns true if the top window and the parent window are different, false otherwise.\n */\nfunction areTopAndParentWindowsDistinct(): boolean {\n return Communication.topWindow !== Communication.parentWindow;\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction getTargetMessageQueue(targetWindow: Window | null): MessageRequest[] {\n if (targetWindow === Communication.topWindow && areTopAndParentWindowsDistinct()) {\n return CommunicationPrivate.topMessageQueue;\n } else if (targetWindow === Communication.parentWindow) {\n return CommunicationPrivate.parentMessageQueue;\n } else if (targetWindow === Communication.childWindow) {\n return CommunicationPrivate.childMessageQueue;\n } else {\n return [];\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction getTargetOrigin(targetWindow: Window | null): string | null {\n if (targetWindow === Communication.topWindow && areTopAndParentWindowsDistinct()) {\n return Communication.topOrigin;\n } else if (targetWindow === Communication.parentWindow) {\n return Communication.parentOrigin;\n } else if (targetWindow === Communication.childWindow) {\n return Communication.childOrigin;\n } else {\n return null;\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction getTargetName(targetWindow: Window | null): string | null {\n if (targetWindow === Communication.topWindow && areTopAndParentWindowsDistinct()) {\n return 'top';\n } else if (targetWindow === Communication.parentWindow) {\n return 'parent';\n } else if (targetWindow === Communication.childWindow) {\n return 'child';\n } else {\n return null;\n }\n}\n\nconst flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction flushMessageQueue(targetWindow: Window | any): void {\n const targetOrigin = getTargetOrigin(targetWindow);\n const targetMessageQueue = getTargetMessageQueue(targetWindow);\n const target = getTargetName(targetWindow);\n\n while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {\n const messageRequest = targetMessageQueue.shift();\n if (messageRequest) {\n const request: SerializedMessageRequest = serializeMessageRequest(messageRequest);\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n flushMessageQueueLogger(\n 'Flushing message %i from ' + target + ' message queue via postMessage.',\n request?.uuidAsString,\n );\n\n targetWindow.postMessage(request, targetOrigin);\n }\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function waitForMessageQueue(targetWindow: Window, callback: () => void): void {\n let messageQueueMonitor: ReturnType<typeof setInterval>;\n /* const cannot be used to declare messageQueueMonitor here because of the JS temporal dead zone. In order for messageQueueMonitor to be referenced inside setInterval,\n it has to be defined before the setInterval call. */\n /* eslint-disable-next-line prefer-const */\n messageQueueMonitor = Communication.currentWindow.setInterval(() => {\n if (getTargetMessageQueue(targetWindow).length === 0) {\n clearInterval(messageQueueMonitor);\n callback();\n }\n }, 100);\n}\n\n/**\n * @hidden\n * Send a response to child for a message request that was from child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction sendMessageResponseToChild(\n id: MessageID,\n uuid?: MessageUUID,\n args?: any[],\n isPartialResponse?: boolean,\n): void {\n const targetWindow = Communication.childWindow;\n const response = createMessageResponse(id, uuid, args, isPartialResponse);\n const serializedResponse = serializeMessageResponse(response);\n const targetOrigin = getTargetOrigin(targetWindow);\n if (targetWindow && targetOrigin) {\n targetWindow.postMessage(serializedResponse, targetOrigin);\n }\n}\n\n/**\n * @hidden\n * Send a custom message object that can be sent to child window,\n * instead of a response message to a child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendMessageEventToChild(actionName: string, args?: any[]): void {\n const targetWindow = Communication.childWindow;\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const customEvent = createMessageEvent(actionName, args);\n const targetOrigin = getTargetOrigin(targetWindow);\n\n // If the target window isn't closed and we already know its origin, send the message right away; otherwise,\n // queue the message and send it after the origin is established\n if (targetWindow && targetOrigin) {\n targetWindow.postMessage(customEvent, targetOrigin);\n } else {\n getTargetMessageQueue(targetWindow).push(customEvent);\n }\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageRequest(\n apiVersionTag: string,\n func: string,\n args: any[] | undefined,\n): MessageRequestWithRequiredProperties {\n const messageId: MessageID = CommunicationPrivate.nextMessageId++;\n const messageUuid: MessageUUID = new MessageUUID();\n CommunicationPrivate.legacyMessageIdsToUuidMap[messageId] = messageUuid;\n return {\n id: messageId,\n uuid: messageUuid,\n func: func,\n timestamp: Date.now(),\n args: args || [],\n apiVersionTag: apiVersionTag,\n };\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n *\n * Creates a nested app authentication request.\n *\n * @param {string} message - The message to be included in the request. This is typically a stringified JSON object containing the details of the authentication request.\n * The reason for using a string is to allow complex data structures to be sent as a message while avoiding potential issues with object serialization and deserialization.\n *\n * @returns {NestedAppAuthRequest} Returns a NestedAppAuthRequest object with a unique id, the function name set to 'nestedAppAuthRequest', the current timestamp, an empty args array, and the provided message as data.\n */\nfunction createNestedAppAuthRequest(message: string): NestedAppAuthRequest {\n const messageId: MessageID = CommunicationPrivate.nextMessageId++;\n const messageUuid: MessageUUID = new MessageUUID();\n CommunicationPrivate.legacyMessageIdsToUuidMap[messageId] = messageUuid;\n return {\n id: messageId,\n uuid: messageUuid,\n func: 'nestedAppAuth.execute',\n timestamp: Date.now(),\n // Since this is a nested app auth request, we don't need to send any args.\n // We avoid overloading the args array with the message to avoid potential issues processing of these messages on the hubSDK.\n args: [],\n data: message,\n };\n}\n\n/**\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageResponse(\n id: MessageID,\n uuid?: MessageUUID,\n args?: any[] | undefined,\n isPartialResponse?: boolean,\n): MessageResponse {\n return {\n id: id,\n uuid: uuid,\n args: args || [],\n isPartialResponse,\n };\n}\n\n/**\n * @hidden\n * Creates a message object without any id and api version, used for custom actions being sent to child frame/window\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction createMessageEvent(func: string, args?: any[]): MessageRequest {\n return {\n func: func,\n args: args || [],\n };\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { isNullOrUndefined } from '../internal/typeCheckUtilities';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n * Namespace to interact with the logging part of the SDK.\n * This object is used to send the app logs on demand to the host client\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst logsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport namespace logs {\n /**\n * @hidden\n *\n * Registers a handler for getting app log\n *\n * @param handler - The handler to invoke to get the app log\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerGetLogHandler(handler: () => string): void {\n // allow for registration cleanup even when not finished initializing\n !isNullOrUndefined(handler) && ensureInitialized(runtime);\n if (!isNullOrUndefined(handler) && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (handler) {\n registerHandler(\n getApiVersionTag(logsTelemetryVersionNumber, ApiName.Logs_RegisterLogRequestHandler),\n 'log.request',\n () => {\n const log: string = handler();\n sendMessageToParent(getApiVersionTag(logsTelemetryVersionNumber, ApiName.Logs_Receive), 'log.receive', [log]);\n },\n );\n } else {\n removeHandler('log.request');\n }\n }\n\n /**\n * @hidden\n *\n * Checks if the logs capability is supported by the host\n * @returns boolean to represent whether the logs capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.logs ? true : false;\n }\n}\n","import { FileOpenPreference, TeamInformation } from '../public/interfaces';\n\n/**\n * @hidden\n *\n * Information about all members in a chat\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ChatMembersInformation {\n members: ThreadMember[];\n}\n\n/**\n * @hidden\n *\n * Information about a chat member\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ThreadMember {\n /**\n * @hidden\n * The member's user principal name in the current tenant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n upn: string;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport enum NotificationTypes {\n fileDownloadStart = 'fileDownloadStart',\n fileDownloadComplete = 'fileDownloadComplete',\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ShowNotificationParameters {\n message: string;\n notificationType: NotificationTypes;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport enum ViewerActionTypes {\n view = 'view',\n edit = 'edit',\n editNew = 'editNew',\n}\n\n/**\n * @hidden\n *\n * User setting changes that can be subscribed to\n */\nexport enum UserSettingTypes {\n /**\n * @hidden\n * Use this key to subscribe to changes in user's file open preference\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n fileOpenPreference = 'fileOpenPreference',\n /**\n * @hidden\n * Use this key to subscribe to theme changes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n theme = 'theme',\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface FilePreviewParameters {\n /**\n * @hidden\n * The developer-defined unique ID for the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId?: string;\n\n /**\n * @hidden\n * The display name of the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title?: string;\n\n /**\n * @hidden\n * An optional description of the file.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n description?: string;\n\n /**\n * @hidden\n * The file extension; e.g. pptx, docx, etc.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n type: string;\n\n /**\n * @hidden\n * The size of the file in bytes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n sizeInBytes?: number;\n\n /**\n * @hidden\n * A url to the source of the file, used to open the content in the user's default browser\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectUrl: string;\n\n /**\n * @hidden\n * Optional; an alternate self-authenticating url used to preview the file in Mobile clients and offer it for download by the user\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n downloadUrl?: string;\n\n /**\n * @hidden\n * Optional; an alternate url optimized for previewing the file in web and desktop clients\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n webPreviewUrl?: string;\n\n /**\n * @hidden\n * Optional; an alternate url that allows editing of the file in web and desktop clients\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n webEditUrl?: string;\n\n /**\n * @hidden\n * Optional; the base url of the site where the file is hosted\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n baseUrl?: string;\n\n /**\n * @hidden\n * Deprecated; prefer using {@linkcode viewerAction} instead\n * Optional; indicates whether the file should be opened in edit mode\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n editFile?: boolean;\n\n /**\n * @hidden\n * Optional; the developer-defined unique ID for the sub-entity to return to when the file stage closes.\n * This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n subEntityId?: string;\n\n /**\n * @hidden\n * Optional; indicates the mode in which file should be opened. Takes precedence over edit mode.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n viewerAction?: ViewerActionTypes;\n\n /**\n * @hidden\n * Optional; indicates how user prefers to open the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n fileOpenPreference?: FileOpenPreference;\n\n /**\n * @hidden\n * Optional; id required to enable conversation button in files. Will be channel id in case file is shared in a channel or the chat id in p2p chat case.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n}\n\n/**\n * @hidden\n *\n * Query parameters used when fetching team information\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface TeamInstanceParameters {\n /**\n * @hidden\n * Flag allowing to select favorite teams only\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n favoriteTeamsOnly?: boolean;\n}\n\n/**\n * @hidden\n *\n * Information on userJoined Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface UserJoinedTeamsInformation {\n /**\n * @hidden\n * List of team information\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n userJoinedTeams: TeamInformation[];\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { Communication, sendMessageEventToChild, sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { FilePreviewParameters, UserSettingTypes } from './interfaces';\n\n/**\n * @hidden\n * Upload a custom App manifest directly to both team and personal scopes.\n * This method works just for the first party Apps.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst privateAPIsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport function uploadCustomApp(manifestBlob: Blob, onComplete?: (status: boolean, reason?: string) => void): void {\n ensureInitialized(runtime);\n\n sendMessageToParent(\n getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_UploadCustomApp),\n 'uploadCustomApp',\n [manifestBlob],\n onComplete ? onComplete : getGenericOnCompleteHandler(),\n );\n}\n\n/**\n * @hidden\n * Sends a custom action MessageRequest to host or parent window\n *\n * @param actionName - Specifies name of the custom action to be sent\n * @param args - Specifies additional arguments passed to the action\n * @param callback - Optionally specify a callback to receive response parameters from the parent\n * @returns id of sent message\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendCustomMessage(actionName: string, args?: any[], callback?: (...args: any[]) => void): void {\n ensureInitialized(runtime);\n\n sendMessageToParent(\n getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_SendCustomMessage),\n actionName,\n args,\n callback,\n );\n}\n\n/**\n * @hidden\n * Sends a custom action MessageEvent to a child iframe/window, only if you are not using auth popup.\n * Otherwise it will go to the auth popup (which becomes the child)\n *\n * @param actionName - Specifies name of the custom action to be sent\n * @param args - Specifies additional arguments passed to the action\n * @returns id of sent message\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function sendCustomEvent(actionName: string, args?: any[]): void {\n ensureInitialized(runtime);\n\n //validate childWindow\n if (!Communication.childWindow) {\n throw new Error('The child window has not yet been initialized or is not present');\n }\n sendMessageEventToChild(actionName, args);\n}\n\n/**\n * @hidden\n * Adds a handler for an action sent by a child window or parent window\n *\n * @param actionName - Specifies name of the action message to handle\n * @param customHandler - The callback to invoke when the action message is received. The return value is sent to the child\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerCustomHandler(actionName: string, customHandler: (...args: any[]) => any[]): void {\n ensureInitialized(runtime);\n registerHandler(\n getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_RegisterCustomHandler),\n actionName,\n (...args: any[]) => {\n return customHandler.apply(this, args);\n },\n );\n}\n\n/**\n * @hidden\n * register a handler to be called when a user setting changes. The changed setting type & value is provided in the callback.\n *\n * @param settingTypes - List of user setting changes to subscribe\n * @param handler - When a subscribed setting is updated this handler is called\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function registerUserSettingsChangeHandler(\n settingTypes: UserSettingTypes[],\n handler: (settingType: UserSettingTypes, value: any) => void,\n): void {\n ensureInitialized(runtime);\n\n registerHandler(\n getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_RegisterUserSettingsChangeHandler),\n 'userSettingsChange',\n handler,\n true,\n [settingTypes],\n );\n}\n\n/**\n * @hidden\n * Opens a client-friendly preview of the specified file.\n *\n * @param file - The file to preview.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function openFilePreview(filePreviewParameters: FilePreviewParameters): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n const params = [\n filePreviewParameters.entityId,\n filePreviewParameters.title,\n filePreviewParameters.description,\n filePreviewParameters.type,\n filePreviewParameters.objectUrl,\n filePreviewParameters.downloadUrl,\n filePreviewParameters.webPreviewUrl,\n filePreviewParameters.webEditUrl,\n filePreviewParameters.baseUrl,\n filePreviewParameters.editFile,\n filePreviewParameters.subEntityId,\n filePreviewParameters.viewerAction,\n filePreviewParameters.fileOpenPreference,\n filePreviewParameters.conversationId,\n filePreviewParameters.sizeInBytes,\n ];\n\n sendMessageToParent(\n getApiVersionTag(privateAPIsTelemetryVersionNumber, ApiName.PrivateAPIs_OpenFilePreview),\n 'openFilePreview',\n params,\n );\n}\n","import { sendAndHandleStatusAndReason, sendAndUnwrap, sendMessageToParent } from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { ChatMembersInformation } from './interfaces';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst conversationsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport interface OpenConversationRequest {\n /**\n * @hidden\n * The Id of the subEntity where the conversation is taking place\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n subEntityId: string;\n\n /**\n * @hidden\n * The title of the conversation\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n\n /**\n * @hidden\n * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n\n /**\n * @hidden\n * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n channelId?: string;\n\n /**\n * @hidden\n * The entity Id of the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId: string;\n\n /**\n * @hidden\n * A function that is called once the conversation Id has been created\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n onStartConversation?: (conversationResponse: ConversationResponse) => void;\n\n /**\n * @hidden\n * A function that is called if the pane is closed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n onCloseConversation?: (conversationResponse: ConversationResponse) => void;\n}\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport interface ConversationResponse {\n /**\n * @hidden\n *\n * Limited to Microsoft-internal use\n * The Id of the subEntity where the conversation is taking place\n */\n subEntityId: string;\n\n /**\n * @hidden\n * The Id of the conversation. This is optional and should be specified whenever a previous conversation about a specific sub-entity has already been started before\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n conversationId?: string;\n\n /**\n * @hidden\n * The Id of the channel. This is optional and should be specified whenever a conversation is started or opened in a personal app scope\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n channelId?: string;\n\n /**\n * @hidden\n * The entity Id of the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n entityId?: string;\n}\n\n/**\n * @hidden\n * Namespace to interact with the conversational subEntities inside the tab\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace conversations {\n /**\n * @hidden\n * Hide from docs\n * --------------\n * Allows the user to start or continue a conversation with each subentity inside the tab\n *\n * @returns Promise resolved upon completion\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openConversation(openConversationRequest: OpenConversationRequest): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const sendPromise = sendAndHandleStatusAndReason(\n getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_OpenConversation),\n 'conversations.openConversation',\n {\n title: openConversationRequest.title,\n subEntityId: openConversationRequest.subEntityId,\n conversationId: openConversationRequest.conversationId,\n channelId: openConversationRequest.channelId,\n entityId: openConversationRequest.entityId,\n },\n );\n if (openConversationRequest.onStartConversation) {\n registerHandler(\n getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_RegisterStartConversationHandler),\n 'startConversation',\n (subEntityId: string, conversationId: string, channelId: string, entityId: string) =>\n openConversationRequest.onStartConversation?.({\n subEntityId,\n conversationId,\n channelId,\n entityId,\n }),\n );\n }\n if (openConversationRequest.onCloseConversation) {\n registerHandler(\n getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_RegisterCloseConversationHandler),\n 'closeConversation',\n (subEntityId: string, conversationId?: string, channelId?: string, entityId?: string) =>\n openConversationRequest.onCloseConversation?.({\n subEntityId,\n conversationId,\n channelId,\n entityId,\n }),\n );\n }\n resolve(sendPromise);\n });\n }\n\n /**\n * @hidden\n *\n * Allows the user to close the conversation in the right pane\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function closeConversation(): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_CloseConversation),\n 'conversations.closeConversation',\n );\n removeHandler('startConversation');\n removeHandler('closeConversation');\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Allows retrieval of information for all chat members.\n * NOTE: This value should be used only as a hint as to who the members are\n * and never as proof of membership in case your app is being hosted by a malicious party.\n *\n * @returns Promise resolved with information on all chat members\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getChatMembers(): Promise<ChatMembersInformation> {\n return new Promise<ChatMembersInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(\n sendAndUnwrap(\n getApiVersionTag(conversationsTelemetryVersionNumber, ApiName.Conversations_GetChatMember),\n 'getChatMembers',\n ),\n );\n });\n }\n\n /**\n * Checks if the conversations capability is supported by the host\n * @returns boolean to represent whether conversations capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.conversations ? true : false;\n }\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { AppEligibilityInformation } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\n\n/**\n * @beta\n * @hidden\n * Namespace to delegate copilot app specific APIs\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace copilot {\n /**\n * @beta\n * @hidden\n * User information required by specific apps\n * @internal\n * Limited to Microsoft-internal use\n */\n export namespace eligibility {\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n * @beta\n * @returns boolean to represent whether copilot.eligibility capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && !!runtime.hostVersionsInfo?.appEligibilityInformation;\n }\n\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n * @beta\n * @returns the copilot eligibility information about the user\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function getEligibilityInfo(): AppEligibilityInformation {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n return runtime.hostVersionsInfo!.appEligibilityInformation!;\n }\n }\n}\n","import { sendMessageToParentAsync } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { validateId, validateUrl } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst externalAppAuthenticationTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * @hidden\n * Namespace to delegate authentication and message extension requests to the host\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace externalAppAuthentication {\n /*********** BEGIN REQUEST TYPE ************/\n /**\n * @hidden\n * Information about the bot request that should be resent by the host\n * @internal\n * Limited to Microsoft-internal use\n */\n export type IOriginalRequestInfo = IQueryMessageExtensionRequest | IActionExecuteInvokeRequest;\n\n /**\n * @hidden\n * Parameters OauthWindow\n * @internal\n * Limited to Microsoft-internal use\n */\n export type OauthWindowProperties = {\n /**\n * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n width?: number;\n /**\n * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n height?: number;\n /**\n * Some identity providers restrict their authentication pages from being displayed in embedded browsers (e.g., a web view inside of a native application)\n * If the identity provider you are using prevents embedded browser usage, this flag should be set to `true` to enable the authentication page\n * to be opened in an external browser. If this flag is `false`, the page will be opened directly within the current hosting application.\n *\n * This flag is ignored when the host for the application is a web app (as opposed to a native application) as the behavior is unnecessary in a web-only\n * environment without an embedded browser.\n */\n isExternal?: boolean;\n };\n /**\n * @hidden\n * Parameters for the authentication pop-up. This interface is used exclusively with the externalAppAuthentication APIs\n * @internal\n * Limited to Microsoft-internal use\n */\n export type AuthenticatePopUpParameters = {\n /**\n * The URL for the authentication pop-up.\n */\n url: URL;\n /**\n * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n width?: number;\n /**\n * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.\n */\n height?: number;\n /**\n * Some identity providers restrict their authentication pages from being displayed in embedded browsers (e.g., a web view inside of a native application)\n * If the identity provider you are using prevents embedded browser usage, this flag should be set to `true` to enable the authentication page specified in\n * the {@link url} property to be opened in an external browser.\n * If this flag is `false`, the page will be opened directly within the current hosting application.\n *\n * This flag is ignored when the host for the application is a web app (as opposed to a native application) as the behavior is unnecessary in a web-only\n * environment without an embedded browser.\n */\n isExternal?: boolean;\n };\n\n /**\n * @hidden\n * Parameters for SSO authentication. This interface is used exclusively with the externalAppAuthentication APIs\n * @internal\n * Limited to Microsoft-internal use\n */\n export type AuthTokenRequestParameters = {\n /**\n * An optional list of claims which to pass to Microsoft Entra when requesting the access token.\n */\n claims?: string[];\n /**\n * An optional flag indicating whether to attempt the token acquisition silently or allow a prompt to be shown.\n */\n silent?: boolean;\n };\n\n /**\n * @hidden\n * Information about the message extension request that should be resent by the host. Corresponds to request schema in https://learn.microsoft.com/microsoftteams/platform/resources/messaging-extension-v3/search-extensions#receive-user-requests\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IQueryMessageExtensionRequest {\n requestType: OriginalRequestType.QueryMessageExtensionRequest;\n commandId: string;\n parameters: {\n name: string;\n value: string;\n }[];\n queryOptions?: {\n count: number;\n skip: number;\n };\n }\n\n /**\n * @hidden\n * Information about the Action.Execute request that should be resent by the host. Corresponds to schema in https://adaptivecards.io/explorer/Action.Execute.html\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IActionExecuteInvokeRequest {\n requestType: OriginalRequestType.ActionExecuteInvokeRequest;\n type: string; // This must be \"Action.Execute\"\n id: string; // The unique identifier associated with the action\n verb: string; // The card author defined verb associated with the action\n data: string | Record<string, unknown>;\n }\n\n /**\n * @hidden\n * This is the only allowed value for IActionExecuteInvokeRequest.type. Used for validation\n * @internal\n * Limited to Microsoft-internal use\n */\n const ActionExecuteInvokeRequestType = 'Action.Execute';\n\n /**\n * @hidden\n * Used to differentiate between IOriginalRequestInfo types\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum OriginalRequestType {\n ActionExecuteInvokeRequest = 'ActionExecuteInvokeRequest',\n QueryMessageExtensionRequest = 'QueryMessageExtensionRequest',\n }\n /*********** END REQUEST TYPE ************/\n\n /*********** BEGIN RESPONSE TYPE ************/\n /**\n * @hidden\n * The response from the bot returned via the host\n * @internal\n * Limited to Microsoft-internal use\n */\n export type IInvokeResponse = IQueryMessageExtensionResponse | IActionExecuteResponse;\n\n /**\n * @hidden\n * Used to differentiate between IInvokeResponse types\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum InvokeResponseType {\n ActionExecuteInvokeResponse = 'ActionExecuteInvokeResponse',\n QueryMessageExtensionResponse = 'QueryMessageExtensionResponse',\n }\n\n /**\n * @hidden\n * The response from the bot returned via the host for a message extension query request.\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IQueryMessageExtensionResponse {\n responseType: InvokeResponseType.QueryMessageExtensionResponse;\n composeExtension?: ComposeExtensionResponse;\n }\n\n /**\n * @hidden\n * The response from the bot returned via the host for an Action.Execute request.\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IActionExecuteResponse {\n responseType: InvokeResponseType.ActionExecuteInvokeResponse;\n value: Record<string, unknown>;\n signature?: string;\n statusCode: number;\n type: string;\n }\n\n /**\n * @hidden\n * The compose extension response returned for a message extension query request. `suggestedActions` will be present only when the type is is 'config' or 'auth'.\n * @internal\n * Limited to Microsoft-internal use\n */\n export type ComposeExtensionResponse = {\n attachmentLayout: AttachmentLayout;\n type: ComposeResultTypes;\n attachments?: QueryMessageExtensionAttachment[];\n suggestedActions?: QueryMessageExtensionSuggestedActions;\n text?: string;\n };\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type QueryMessageExtensionSuggestedActions = {\n actions: Action[];\n };\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type Action = {\n type: string;\n title: string;\n value: string;\n };\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type QueryMessageExtensionCard = {\n contentType: string;\n content: Record<string, unknown>;\n fallbackHtml?: string;\n signature?: string;\n };\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type QueryMessageExtensionAttachment = QueryMessageExtensionCard & {\n preview?: QueryMessageExtensionCard;\n };\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type AttachmentLayout = 'grid' | 'list';\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type ComposeResultTypes = 'auth' | 'config' | 'message' | 'result' | 'silentAuth';\n /*********** END RESPONSE TYPE ************/\n\n /*********** BEGIN ERROR TYPE ***********/\n export interface InvokeError {\n errorCode: InvokeErrorCode;\n message?: string;\n }\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum InvokeErrorCode {\n INTERNAL_ERROR = 'INTERNAL_ERROR', // Generic error\n }\n\n /**\n * @hidden\n * Wrapper to differentiate between InvokeError and IInvokeResponse response from host\n * @internal\n * Limited to Microsoft-internal use\n */\n type InvokeErrorWrapper = InvokeError & { responseType: undefined };\n /*********** END ERROR TYPE ***********/\n\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n */\n function validateOriginalRequestInfo(originalRequestInfo: IOriginalRequestInfo): void {\n if (originalRequestInfo.requestType === OriginalRequestType.ActionExecuteInvokeRequest) {\n const actionExecuteRequest = originalRequestInfo as IActionExecuteInvokeRequest;\n if (actionExecuteRequest.type !== ActionExecuteInvokeRequestType) {\n const error: InvokeError = {\n errorCode: InvokeErrorCode.INTERNAL_ERROR,\n message: `Invalid action type ${actionExecuteRequest.type}. Action type must be \"${ActionExecuteInvokeRequestType}\"`,\n };\n throw error;\n }\n } else if (originalRequestInfo.requestType === OriginalRequestType.QueryMessageExtensionRequest) {\n if (originalRequestInfo.commandId.length > 64) {\n throw new Error('originalRequestInfo.commandId exceeds the maximum size of 64 characters');\n }\n if (originalRequestInfo.parameters.length > 5) {\n throw new Error('originalRequestInfo.parameters exceeds the maximum size of 5');\n }\n for (const parameter of originalRequestInfo.parameters) {\n if (parameter.name.length > 64) {\n throw new Error('originalRequestInfo.parameters.name exceeds the maximum size of 64 characters');\n }\n if (parameter.value.length > 512) {\n throw new Error('originalRequestInfo.parameters.value exceeds the maximum size of 512 characters');\n }\n }\n }\n }\n\n /**\n * @beta\n * @hidden\n * Signals to the host to perform authentication using the given authentication parameters and then resend the request to the application specified by the app ID with the authentication result.\n * @internal\n * Limited to Microsoft-internal use\n * @param appId ID of the application backend to which the request and authentication response should be sent. This must be a UUID\n * @param authenticateParameters Parameters for the authentication pop-up\n * @param originalRequestInfo Information about the original request that should be resent\n * @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request\n */\n export function authenticateAndResendRequest(\n appId: string,\n authenticateParameters: AuthenticatePopUpParameters,\n originalRequestInfo: IOriginalRequestInfo,\n ): Promise<IInvokeResponse> {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n validateId(appId, new Error('App id is not valid.'));\n validateOriginalRequestInfo(originalRequestInfo);\n\n // Ask the parent window to open an authentication window with the parameters provided by the caller.\n return sendMessageToParentAsync<[boolean, IInvokeResponse | InvokeErrorWrapper]>(\n getApiVersionTag(\n externalAppAuthenticationTelemetryVersionNumber,\n ApiName.ExternalAppAuthentication_AuthenticateAndResendRequest,\n ),\n 'externalAppAuthentication.authenticateAndResendRequest',\n [\n appId,\n originalRequestInfo,\n authenticateParameters.url.href,\n authenticateParameters.width,\n authenticateParameters.height,\n authenticateParameters.isExternal,\n ],\n ).then(([wasSuccessful, response]: [boolean, IInvokeResponse | InvokeErrorWrapper]) => {\n if (wasSuccessful && response.responseType != null) {\n return response as IInvokeResponse;\n } else {\n const error = response as InvokeError;\n throw error;\n }\n });\n }\n\n /**\n * @beta\n * @hidden\n * Signals to the host to perform SSO authentication for the application specified by the app ID\n * @internal\n * Limited to Microsoft-internal use\n * @param appId ID of the application backend for which the host should attempt SSO authentication. This must be a UUID\n * @param authTokenRequest Parameters for SSO authentication\n * @returns A promise that resolves when authentication and succeeds and rejects with InvokeError on failure\n */\n export function authenticateWithSSO(appId: string, authTokenRequest: AuthTokenRequestParameters): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n validateId(appId, new Error('App id is not valid.'));\n return sendMessageToParentAsync(\n getApiVersionTag(\n externalAppAuthenticationTelemetryVersionNumber,\n ApiName.ExternalAppAuthentication_AuthenticateWithSSO,\n ),\n 'externalAppAuthentication.authenticateWithSSO',\n [appId, authTokenRequest.claims, authTokenRequest.silent],\n ).then(([wasSuccessful, error]: [boolean, InvokeError]) => {\n if (!wasSuccessful) {\n throw error;\n }\n });\n }\n\n /**\n * @beta\n * @hidden\n * Signals to the host to perform SSO authentication for the application specified by the app ID and then resend the request to the application backend with the authentication result\n * @internal\n * Limited to Microsoft-internal use\n * @param appId ID of the application backend for which the host should attempt SSO authentication and resend the request and authentication response. This must be a UUID.\n * @param authTokenRequest Parameters for SSO authentication\n * @param originalRequestInfo Information about the original request that should be resent\n * @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request\n */\n export function authenticateWithSSOAndResendRequest(\n appId: string,\n authTokenRequest: AuthTokenRequestParameters,\n originalRequestInfo: IOriginalRequestInfo,\n ): Promise<IInvokeResponse> {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n validateId(appId, new Error('App id is not valid.'));\n\n validateOriginalRequestInfo(originalRequestInfo);\n\n return sendMessageToParentAsync<[boolean, IInvokeResponse | InvokeErrorWrapper]>(\n getApiVersionTag(\n externalAppAuthenticationTelemetryVersionNumber,\n ApiName.ExternalAppAuthentication_AuthenticateWithSSOAndResendRequest,\n ),\n 'externalAppAuthentication.authenticateWithSSOAndResendRequest',\n [appId, originalRequestInfo, authTokenRequest.claims, authTokenRequest.silent],\n ).then(([wasSuccessful, response]: [boolean, IInvokeResponse | InvokeErrorWrapper]) => {\n if (wasSuccessful && response.responseType != null) {\n return response as IInvokeResponse;\n } else {\n const error = response as InvokeError;\n throw error;\n }\n });\n }\n\n /**\n * @beta\n * @hidden\n * Signals to the host to perform Oauth2 authentication for the application specified by the title ID\n * @internal\n * Limited to Microsoft-internal use\n * @param titleId ID of the acquisition\n * @param oauthConfigId lookup ID in token store\n * @param oauthWindowParameters parameters for the signIn window\n * @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure\n */\n export function authenticateWithOauth2(\n titleId: string,\n oauthConfigId: string,\n oauthWindowParameters: OauthWindowProperties,\n ): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n validateId(titleId, new Error('titleId is Invalid.'));\n validateId(oauthConfigId, new Error('oauthConfigId is Invalid.'));\n\n return sendMessageToParentAsync(\n getApiVersionTag(\n externalAppAuthenticationTelemetryVersionNumber,\n ApiName.ExternalAppAuthentication_AuthenticateWithOauth2,\n ),\n 'externalAppAuthentication.authenticateWithOauth2',\n [\n titleId,\n oauthConfigId,\n oauthWindowParameters.width,\n oauthWindowParameters.height,\n oauthWindowParameters.isExternal,\n ],\n ).then(([wasSuccessful, error]: [boolean, InvokeError]) => {\n if (!wasSuccessful) {\n throw error;\n }\n });\n }\n\n /**\n * @beta\n * @hidden\n * API to authenticate power platform connector plugins\n * @internal\n * Limited to Microsoft-internal use\n * @param titleId ID of the acquisition\n * @param signInUrl signInUrl for the connctor page listing the connector. This is optional\n * @param oauthWindowParameters parameters for the signIn window\n * @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure\n */\n export function authenticateWithPowerPlatformConnectorPlugins(\n titleId: string,\n signInUrl?: URL,\n oauthWindowParameters?: OauthWindowProperties,\n ): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n validateId(titleId, new Error('titleId is Invalid.'));\n\n if (signInUrl) {\n validateUrl(signInUrl);\n }\n\n return sendMessageToParentAsync(\n getApiVersionTag(\n externalAppAuthenticationTelemetryVersionNumber,\n ApiName.ExternalAppAuthentication_AuthenticateWithPowerPlatformConnectorPlugins,\n ),\n 'externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins',\n [\n titleId,\n signInUrl?.toString(),\n oauthWindowParameters?.width,\n oauthWindowParameters?.height,\n oauthWindowParameters?.isExternal,\n ],\n ).then(([wasSuccessful, error]: [boolean, InvokeError]) => {\n if (!wasSuccessful) {\n throw error;\n }\n });\n }\n\n /**\n * @hidden\n * Checks if the externalAppAuthentication capability is supported by the host\n * @returns boolean to represent whether externalAppAuthentication capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.externalAppAuthentication ? true : false;\n }\n}\n","import { sendMessageToParentAsync } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { validateId } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { ExternalAppErrorCode } from './constants';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst externalAppCardActionsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * @hidden\n * Namespace to delegate adaptive card action execution to the host\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace externalAppCardActions {\n /**\n * @hidden\n * The type of deeplink action that was executed by the host\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ActionOpenUrlType {\n DeepLinkDialog = 'DeepLinkDialog',\n DeepLinkOther = 'DeepLinkOther',\n DeepLinkStageView = 'DeepLinkStageView',\n GenericUrl = 'GenericUrl',\n }\n\n /**\n * @hidden\n * Error that can be thrown from IExternalAppCardActionService.handleActionOpenUrl\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ActionOpenUrlError {\n errorCode: ActionOpenUrlErrorCode;\n message?: string;\n }\n\n /**\n * @hidden\n * Error codes that can be thrown from IExternalAppCardActionService.handleActionOpenUrl\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ActionOpenUrlErrorCode {\n INTERNAL_ERROR = 'INTERNAL_ERROR', // Generic error\n INVALID_LINK = 'INVALID_LINK', // Deep link is invalid\n NOT_SUPPORTED = 'NOT_SUPPORTED', // Deep link is not supported\n }\n\n /**\n * @hidden\n * The payload that is used when executing an Adaptive Card Action.Submit\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IAdaptiveCardActionSubmit {\n id: string;\n data: string | Record<string, unknown>;\n }\n\n /**\n *\n * @hidden\n * Error that can be thrown from IExternalAppCardActionService.handleActionSubmit\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ActionSubmitError {\n errorCode: ExternalAppErrorCode;\n message?: string;\n }\n\n /**\n * @beta\n * @hidden\n * Delegates an Adaptive Card Action.Submit request to the host for the application with the provided app ID\n * @internal\n * Limited to Microsoft-internal use\n * @param appId ID of the application the request is intended for. This must be a UUID\n * @param actionSubmitPayload The Adaptive Card Action.Submit payload\n * @param cardActionsConfig The card actions configuration. This indicates which subtypes should be handled by this API\n * @returns Promise that resolves when the request is completed and rejects with ActionSubmitError if the request fails\n */\n export function processActionSubmit(appId: string, actionSubmitPayload: IAdaptiveCardActionSubmit): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n validateId(appId, new Error('App id is not valid.'));\n\n return sendMessageToParentAsync<[boolean, ActionSubmitError]>(\n getApiVersionTag(\n externalAppCardActionsTelemetryVersionNumber,\n ApiName.ExternalAppCardActions_ProcessActionSubmit,\n ),\n 'externalAppCardActions.processActionSubmit',\n [appId, actionSubmitPayload],\n ).then(([wasSuccessful, error]: [boolean, ActionSubmitError]) => {\n if (!wasSuccessful) {\n throw error;\n }\n });\n }\n\n /**\n * @beta\n * @hidden\n * Delegates an Adaptive Card Action.OpenUrl request to the host for the application with the provided app ID.\n * If `fromElement` is not provided, the information from the manifest is used to determine whether the URL can\n * be processed by the host. Deep link URLs for plugins are not supported and will result in an error.\n * @internal\n * Limited to Microsoft-internal use\n * @param appId ID of the application the request is intended for. This must be a UUID\n * @param url The URL to open\n * @param fromElement The element on behalf of which the M365 app is making the request.\n * @returns Promise that resolves to ActionOpenUrlType indicating the type of URL that was opened on success and rejects with ActionOpenUrlError if the request fails\n */\n export function processActionOpenUrl(\n appId: string,\n url: URL,\n fromElement?: { name: 'composeExtensions' | 'plugins' },\n ): Promise<ActionOpenUrlType> {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n validateId(appId, new Error('App id is not valid.'));\n return sendMessageToParentAsync<[ActionOpenUrlError, ActionOpenUrlType]>(\n getApiVersionTag(\n externalAppCardActionsTelemetryVersionNumber,\n ApiName.ExternalAppCardActions_ProcessActionOpenUrl,\n ),\n 'externalAppCardActions.processActionOpenUrl',\n [appId, url.href, fromElement],\n ).then(([error, response]: [ActionOpenUrlError, ActionOpenUrlType]) => {\n if (error) {\n throw error;\n } else {\n return response;\n }\n });\n }\n\n /**\n * @hidden\n * Checks if the externalAppCardActions capability is supported by the host\n * @returns boolean to represent whether externalAppCardActions capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.externalAppCardActions ? true : false;\n }\n}\n","import { sendMessageToParentAsync } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { validateId } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { ExternalAppErrorCode } from './constants';\nimport { externalAppAuthentication } from './externalAppAuthentication';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst externalAppCommandsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * @hidden\n * Namespace to delegate the ActionCommand to the host\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\nexport namespace externalAppCommands {\n /**\n * @hidden\n * The payload of IActionCommandResponse\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export type IActionCommandResponse = ITextActionCommandResponse | ICardActionCommandResponse;\n\n /**\n * @hidden\n * The payload of IBaseActionCommandResponse\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface IBaseActionCommandResponse {\n taskModuleClosedReason: TaskModuleClosedReason;\n }\n\n /**\n * @hidden\n * The text result type\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface ITextActionCommandResponse extends IBaseActionCommandResponse {\n resultType: 'text';\n text: string | undefined;\n }\n\n /**\n * @hidden\n * The card result type\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface ICardActionCommandResponse extends IBaseActionCommandResponse {\n resultType: 'card';\n attachmentLayout: externalAppAuthentication.AttachmentLayout;\n attachments: externalAppAuthentication.QueryMessageExtensionAttachment[];\n }\n\n /**\n * @hidden\n * The result type for the ActionCommandResultType\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export type ActionCommandResultType = 'card' | 'text';\n\n /**\n * @hidden\n * The reason for the TaskModuleClosedReason\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export type TaskModuleClosedReason = 'Done' | 'CancelledByUser';\n\n /**\n *\n * @hidden\n * Error that can be thrown from IExternalAppCommandsService.processActionCommand\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface ActionCommandError {\n errorCode: ExternalAppErrorCode;\n message?: string;\n }\n\n /**\n * @internal\n * Limited to Microsoft-internal use\n * @hidden\n * This API delegates an ActionCommand request to the host for the application with the provided following parameters:\n *\n * @param appId ID of the application the request is intended for. This must be a UUID\n * @param commandId extensibilityProvider use this ID to look up the command declared by ActionME\n * @param extractedParameters are the key-value pairs that the dialog will be prepopulated with\n *\n * @returns Promise that resolves with the {@link IActionCommandResponse} when the request is completed and rejects with {@link ActionCommandError} if the request fails\n *\n * @beta\n */\n export async function processActionCommand(\n appId: string,\n commandId: string,\n extractedParameters: Record<string, string>,\n ): Promise<IActionCommandResponse> {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n validateId(appId, new Error('App id is not valid.'));\n\n const [error, response] = await sendMessageToParentAsync<[ActionCommandError, IActionCommandResponse]>(\n getApiVersionTag(externalAppCommandsTelemetryVersionNumber, ApiName.ExternalAppCommands_ProcessActionCommands),\n ApiName.ExternalAppCommands_ProcessActionCommands,\n [appId, commandId, extractedParameters],\n );\n if (error) {\n throw error;\n } else {\n return response;\n }\n }\n\n /**\n * @hidden\n * Checks if the externalAppCommands capability is supported by the host\n * @returns boolean to represent whether externalAppCommands capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.externalAppCommands ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from '../public/constants';\nimport { ErrorCode, FileOpenPreference, SdkError } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * Namespace to interact with the files specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst filesTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport namespace files {\n /**\n * @hidden\n *\n * Cloud storage providers registered with Microsoft Teams\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProvider {\n Dropbox = 'DROPBOX',\n Box = 'BOX',\n Sharefile = 'SHAREFILE',\n GoogleDrive = 'GOOGLEDRIVE',\n Egnyte = 'EGNYTE',\n SharePoint = 'SharePoint',\n }\n interface IWopiThumbnail {\n size: number;\n url: string;\n }\n\n interface IWopiService {\n name: string;\n description: string;\n thumbnails: IWopiThumbnail[];\n }\n\n /**\n * @hidden\n *\n * External third-party cloud storages providers interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IExternalProvider extends IWopiService {\n providerType: CloudStorageProviderType;\n providerCode: CloudStorageProvider;\n }\n\n /**\n * @hidden\n *\n * Cloud storage provider type enums\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProviderType {\n Sharepoint = 0,\n WopiIntegration,\n Google,\n OneDrive,\n Recent,\n Aggregate,\n FileSystem, // Used for Downloaded files on Desktop\n Search, // Used by P2P files with OSearch\n AllFiles, // Used by P2P files with AllFiles API\n SharedWithMe,\n }\n\n /**\n * @hidden\n *\n * Cloud storage folder interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageFolder {\n /**\n * @hidden\n * ID of the cloud storage folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display Name/Title of the cloud storage folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * ID of the cloud storage folder in the provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n folderId: string;\n /**\n * @hidden\n * Type of the cloud storage folder provider integration\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n providerType: CloudStorageProviderType;\n /**\n * @hidden\n * Code of the supported cloud storage folder provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n providerCode: CloudStorageProvider;\n /**\n * @hidden\n * Display name of the owner of the cloud storage folder provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n ownerDisplayName: string;\n /**\n * @hidden\n * Sharepoint specific siteURL of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n siteUrl?: string;\n /**\n * @hidden\n * Sharepoint specific serverRelativeUrl of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n serverRelativeUrl?: string;\n /**\n * @hidden\n * Sharepoint specific libraryType of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n libraryType?: string;\n /**\n * @hidden\n * Sharepoint specific accessType of the folder\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n accessType?: string;\n }\n\n /**\n * @hidden\n *\n * Cloud storage item interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageFolderItem {\n /**\n * @hidden\n * ID of the item in the provider\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display name/title\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Key to differentiate files and subdirectory\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n isSubdirectory: boolean;\n /**\n * @hidden\n * File extension\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n type: string;\n /**\n * @hidden\n * Last modifed time of the item\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n lastModifiedTime: string;\n /**\n * @hidden\n * Display size of the items in bytes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n size: number;\n /**\n * @hidden\n * URL of the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectUrl: string;\n /**\n * @hidden\n * Temporary access token for the item\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n accessToken?: string;\n }\n\n /**\n * @hidden\n *\n * Files entity user interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IFilesEntityUser {\n /**\n * @hidden\n * User name.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName: string;\n /**\n * @hidden\n * User email.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n email: string;\n\n /**\n * @hidden\n * User MRI.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n mri: string;\n }\n\n /**\n * @hidden\n *\n * Special Document Library enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum SpecialDocumentLibraryType {\n ClassMaterials = 'classMaterials',\n }\n\n /**\n * @hidden\n *\n * Document Library Access enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum DocumentLibraryAccessType {\n Readonly = 'readonly',\n }\n\n /**\n * @hidden\n *\n * SharePoint file interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ISharePointFile {\n siteId?: string;\n siteUrl: string;\n objectId: string;\n objectUrl: string;\n openInWindowFileUrl: string;\n title: string;\n isFolder: boolean;\n serverRelativeUrl: string;\n lastModifiedByUser: IFilesEntityUser;\n lastModifiedTime: string;\n sentByUser: IFilesEntityUser;\n createdByUser: IFilesEntityUser;\n createdTime: string;\n size: number;\n type: string;\n spItemUrl?: string;\n libraryType?: SpecialDocumentLibraryType;\n accessType?: DocumentLibraryAccessType;\n etag?: string;\n remoteItem?: string;\n listUrl?: string;\n }\n\n /**\n * @hidden\n *\n * Download status enum\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum FileDownloadStatus {\n Downloaded = 'Downloaded',\n Downloading = 'Downloading',\n Failed = 'Failed',\n }\n\n /**\n * @hidden\n *\n * Download Files interface\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IFileItem {\n /**\n * @hidden\n * ID of the file metadata\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n objectId?: string;\n /**\n * @hidden\n * Path of the file\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n path?: string;\n /**\n * @hidden\n * Size of the file in bytes\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n sizeInBytes?: number;\n /**\n * @hidden\n * Download status\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n status?: FileDownloadStatus;\n /**\n * @hidden\n * Download timestamp\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n timestamp: Date;\n /**\n * @hidden\n * File name\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n title: string;\n /**\n * @hidden\n * Type of file i.e. the file extension.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n extension: string;\n }\n\n /**\n * @hidden\n * Object used to represent a file\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface File extends Blob {\n /**\n * A number that represents the number of milliseconds since the Unix epoch\n */\n lastModified: number;\n /**\n * Name of the file\n */\n name: string;\n /**\n * A string containing the path of the file relative to the ancestor directory the user selected\n */\n webkitRelativePath?: string;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Actions specific to 3P cloud storage provider file and / or account\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum CloudStorageProviderFileAction {\n Download = 'DOWNLOAD',\n Upload = 'UPLOAD',\n Delete = 'DELETE',\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface for 3P cloud storage provider request content type\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderRequest<T> {\n content: T;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Base interface for 3P cloud storage provider action request content\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderContent {\n providerCode: CloudStorageProvider;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider add new file action.\n * The file extension represents type of file e.g. docx, pptx etc. and need not be prefixed with dot(.)\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderNewFileContent extends CloudStorageProviderContent {\n newFileName: string;\n newFileExtension: string;\n destinationFolder: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider rename existing file action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderRenameFileContent extends CloudStorageProviderContent {\n existingFile: CloudStorageFolderItem | ISharePointFile;\n newFile: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider delete existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderDeleteFileContent extends CloudStorageProviderContent {\n itemList: CloudStorageFolderItem[] | ISharePointFile[];\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Interface representing 3P cloud storage provider download existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderDownloadFileContent extends CloudStorageProviderContent {\n itemList: CloudStorageFolderItem[] | ISharePointFile[];\n }\n\n /**\n * @hidden\n * Hide from docs\n * @beta\n *\n * Interface representing 3P cloud storage provider upload existing file(s) action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface CloudStorageProviderUploadFileContent extends CloudStorageProviderContent {\n itemList: File[];\n destinationFolder: CloudStorageFolderItem | ISharePointFile;\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Gets a list of cloud storage folders added to the channel. This function will not timeout;\n * the callback will only return when the host responds with a list of folders or error.\n *\n * @param channelId - ID of the channel whose cloud storage folders should be retrieved\n * @param callback - Callback that will be triggered post folders load\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCloudStorageFolders(\n channelId: string,\n callback: (error: SdkError, folders: CloudStorageFolder[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId || channelId.length === 0) {\n throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.getCloudStorageFolders] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_GetCloudStorageFolders),\n 'files.getCloudStorageFolders',\n [channelId],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n * Initiates the add cloud storage folder flow\n *\n * @param channelId - ID of the channel to add cloud storage folder\n * @param callback - Callback that will be triggered post add folder flow is compelete\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageFolder(\n channelId: string,\n callback: (error: SdkError, isFolderAdded: boolean, folders: CloudStorageFolder[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId || channelId.length === 0) {\n throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.addCloudStorageFolder] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_AddCloudStorageFolder),\n 'files.addCloudStorageFolder',\n [channelId],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Deletes a cloud storage folder from channel\n *\n * @param channelId - ID of the channel where folder is to be deleted\n * @param folderToDelete - cloud storage folder to be deleted\n * @param callback - Callback that will be triggered post delete\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function deleteCloudStorageFolder(\n channelId: string,\n folderToDelete: CloudStorageFolder,\n callback: (error: SdkError, isFolderDeleted: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!channelId) {\n throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');\n }\n if (!folderToDelete) {\n throw new Error('[files.deleteCloudStorageFolder] folderToDelete cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.deleteCloudStorageFolder] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_DeleteCloudStorageFolder),\n 'files.deleteCloudStorageFolder',\n [channelId, folderToDelete],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Fetches the contents of a Cloud storage folder (CloudStorageFolder) / sub directory\n *\n * @param folder - Cloud storage folder (CloudStorageFolder) / sub directory (CloudStorageFolderItem)\n * @param providerCode - Code of the cloud storage folder provider\n * @param callback - Callback that will be triggered post contents are loaded\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCloudStorageFolderContents(\n folder: CloudStorageFolder | CloudStorageFolderItem,\n providerCode: CloudStorageProvider,\n callback: (error: SdkError, items: CloudStorageFolderItem[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!folder || !providerCode) {\n throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[files.getCloudStorageFolderContents] Callback cannot be null');\n }\n\n if ('isSubdirectory' in folder && !folder.isSubdirectory) {\n throw new Error('[files.getCloudStorageFolderContents] provided folder is not a subDirectory');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_GetCloudStorageFolderContents),\n 'files.getCloudStorageFolderContents',\n [folder, providerCode],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Open a cloud storage file in Teams\n *\n * @param file - cloud storage file that should be opened\n * @param providerCode - Code of the cloud storage folder provider\n * @param fileOpenPreference - Whether file should be opened in web/inline\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openCloudStorageFile(\n file: CloudStorageFolderItem,\n providerCode: CloudStorageProvider,\n fileOpenPreference?: FileOpenPreference.Web | FileOpenPreference.Inline,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!file || !providerCode) {\n throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');\n }\n\n if (file.isSubdirectory) {\n throw new Error('[files.openCloudStorageFile] provided file is a subDirectory');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_OpenCloudStorageFile),\n 'files.openCloudStorageFile',\n [file, providerCode, fileOpenPreference],\n );\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function to get the external\n * third party cloud storage accounts that the tenant supports\n * @param excludeAddedProviders: return a list of support third party\n * cloud storages that hasn't been added yet.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getExternalProviders(\n excludeAddedProviders = false,\n callback: (error: SdkError, providers: IExternalProvider[]) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.getExternalProviders] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_GetExternalProviders),\n 'files.getExternalProviders',\n [excludeAddedProviders],\n callback,\n );\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function to move files\n * among SharePoint and third party cloud storages.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function copyMoveFiles(\n selectedFiles: CloudStorageFolderItem[] | ISharePointFile[],\n providerCode: CloudStorageProvider,\n destinationFolder: CloudStorageFolderItem | ISharePointFile,\n destinationProviderCode: CloudStorageProvider,\n isMove = false,\n callback: (error?: SdkError) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!selectedFiles || selectedFiles.length === 0) {\n throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');\n }\n if (!providerCode) {\n throw new Error('[files.copyMoveFiles] providerCode cannot be null or empty');\n }\n if (!destinationFolder) {\n throw new Error('[files.copyMoveFiles] destinationFolder cannot be null or empty');\n }\n if (!destinationProviderCode) {\n throw new Error('[files.copyMoveFiles] destinationProviderCode cannot be null or empty');\n }\n if (!callback) {\n throw new Error('[files.copyMoveFiles] callback cannot be null');\n }\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_CopyMoveFiles),\n 'files.copyMoveFiles',\n [selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * ------\n *\n * Gets list of downloads for current user\n * @param callback Callback that will be triggered post downloads load\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getFileDownloads(callback: (error?: SdkError, files?: IFileItem[]) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.getFileDownloads] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_GetFileDownloads),\n 'files.getFileDownloads',\n [],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Open download preference folder if fileObjectId value is undefined else open folder containing the file with id fileObjectId\n * @param fileObjectId - Id of the file whose containing folder should be opened\n * @param callback Callback that will be triggered post open download folder/path\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openDownloadFolder(\n fileObjectId: string | undefined = undefined,\n callback: (error?: SdkError) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw new Error('[files.openDownloadFolder] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_OpenDownloadFolder),\n 'files.openDownloadFolder',\n [fileObjectId],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates add 3P cloud storage provider flow, where a pop up window opens for user to select required\n * 3P provider from the configured policy supported 3P provider list, following which user authentication\n * for selected 3P provider is performed on success of which the selected 3P provider support is added for user\n * @beta\n *\n * @param callback Callback that will be triggered post add 3P cloud storage provider action.\n * If the error is encountered (and hence passed back), no provider value is sent back.\n * For success scenarios, error value will be passed as null and a valid provider value is sent.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageProvider(callback: (error?: SdkError, provider?: CloudStorageProvider) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProvider] callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_AddCloudStorageProvider),\n 'files.addCloudStorageProvider',\n [],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates signout of 3P cloud storage provider flow, which will remove the selected\n * 3P cloud storage provider from the list of added providers. No other user input and / or action\n * is required except the 3P cloud storage provider to signout from\n *\n * @param logoutRequest 3P cloud storage provider remove action request content\n * @param callback Callback that will be triggered post signout of 3P cloud storage provider action\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function removeCloudStorageProvider(\n logoutRequest: CloudStorageProviderRequest<CloudStorageProviderContent>,\n callback: (error?: SdkError) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.removeCloudStorageProvider] callback cannot be null');\n }\n\n if (!(logoutRequest && logoutRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.removeCloudStorageProvider] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_RemoveCloudStorageProvider),\n 'files.removeCloudStorageProvider',\n [logoutRequest],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the add 3P cloud storage file flow, which will add a new file for the given 3P provider\n *\n * @param addNewFileRequest 3P cloud storage provider add action request content\n * @param callback Callback that will be triggered post adding a new file flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function addCloudStorageProviderFile(\n addNewFileRequest: CloudStorageProviderRequest<CloudStorageProviderNewFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProviderFile] callback cannot be null');\n }\n\n if (!(addNewFileRequest && addNewFileRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.addCloudStorageProviderFile] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_AddCloudStorageProviderFile),\n 'files.addCloudStorageProviderFile',\n [addNewFileRequest],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the rename 3P cloud storage file flow, which will rename an existing file in the given 3P provider\n *\n * @param renameFileRequest 3P cloud storage provider rename action request content\n * @param callback Callback that will be triggered post renaming an existing file flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function renameCloudStorageProviderFile(\n renameFileRequest: CloudStorageProviderRequest<CloudStorageProviderRenameFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.renameCloudStorageProviderFile] callback cannot be null');\n }\n\n if (!(renameFileRequest && renameFileRequest.content)) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.renameCloudStorageProviderFile] 3P cloud storage provider request content is missing',\n );\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_RenameCloudStorageProviderFile),\n 'files.renameCloudStorageProviderFile',\n [renameFileRequest],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the delete 3P cloud storage file(s) / folder (folder has to be empty) flow,\n * which will delete existing file(s) / folder from the given 3P provider\n *\n * @param deleteFileRequest 3P cloud storage provider delete action request content\n * @param callback Callback that will be triggered post deleting existing file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function deleteCloudStorageProviderFile(\n deleteFileRequest: CloudStorageProviderRequest<CloudStorageProviderDeleteFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] callback cannot be null');\n }\n\n if (\n !(\n deleteFileRequest &&\n deleteFileRequest.content &&\n deleteFileRequest.content.itemList &&\n deleteFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.deleteCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_DeleteCloudStorageProviderFile),\n 'files.deleteCloudStorageProviderFile',\n [deleteFileRequest],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the download 3P cloud storage file(s) flow,\n * which will download existing file(s) from the given 3P provider in the teams client side without sharing any file info in the callback\n *\n * @param downloadFileRequest 3P cloud storage provider download file(s) action request content\n * @param callback Callback that will be triggered post downloading existing file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function downloadCloudStorageProviderFile(\n downloadFileRequest: CloudStorageProviderRequest<CloudStorageProviderDownloadFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.downloadCloudStorageProviderFile] callback cannot be null',\n );\n }\n\n if (\n !(\n downloadFileRequest &&\n downloadFileRequest.content &&\n downloadFileRequest.content.itemList &&\n downloadFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.downloadCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_DownloadCloudStorageProviderFile),\n 'files.downloadCloudStorageProviderFile',\n [downloadFileRequest],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Initiates the upload 3P cloud storage file(s) flow, which will upload file(s) to the given 3P provider\n * @beta\n *\n * @param uploadFileRequest 3P cloud storage provider upload file(s) action request content\n * @param callback Callback that will be triggered post uploading file(s) flow is finished\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function uploadCloudStorageProviderFile(\n uploadFileRequest: CloudStorageProviderRequest<CloudStorageProviderUploadFileContent>,\n callback: (error?: SdkError, actionStatus?: boolean) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!callback) {\n throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] callback cannot be null');\n }\n\n if (\n !(\n uploadFileRequest &&\n uploadFileRequest.content &&\n uploadFileRequest.content.itemList &&\n uploadFileRequest.content.itemList.length > 0\n )\n ) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.uploadCloudStorageProviderFile] 3P cloud storage provider request content details are missing',\n );\n }\n\n if (!uploadFileRequest.content.destinationFolder) {\n throw getSdkError(\n ErrorCode.INVALID_ARGUMENTS,\n '[files.uploadCloudStorageProviderFile] Invalid destination folder details',\n );\n }\n\n sendMessageToParent(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_UploadCloudStorageProviderFile),\n 'files.uploadCloudStorageProviderFile',\n [uploadFileRequest],\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Register a handler to be called when a user's 3P cloud storage provider list changes i.e.\n * post adding / removing a 3P provider, list is updated\n *\n * @param handler - When 3P cloud storage provider list is updated this handler is called\n *\n * @internal Limited to Microsoft-internal use\n */\n export function registerCloudStorageProviderListChangeHandler(handler: () => void): void {\n ensureInitialized(runtime);\n\n if (!handler) {\n throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');\n }\n\n registerHandler(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_RegisterCloudStorageProviderListChangeHandler),\n 'files.cloudStorageProviderListChange',\n handler,\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n *\n * Register a handler to be called when a user's 3P cloud storage provider content changes i.e.\n * when file(s) is/are added / renamed / deleted / uploaded, the list of files is updated\n *\n * @param handler - When 3P cloud storage provider content is updated this handler is called\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerCloudStorageProviderContentChangeHandler(handler: () => void): void {\n ensureInitialized(runtime);\n\n if (!handler) {\n throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');\n }\n\n registerHandler(\n getApiVersionTag(filesTelemetryVersionNumber, ApiName.Files_RegisterCloudStorageProviderContentChangeHandler),\n 'files.cloudStorageProviderContentChange',\n handler,\n );\n }\n\n function getSdkError(errorCode: ErrorCode, message: string): SdkError {\n const sdkError: SdkError = {\n errorCode: errorCode,\n message: message,\n };\n return sdkError;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst meetingRoomTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport namespace meetingRoom {\n /**\n * @hidden\n *\n * Data structure to represent a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomInfo {\n /**\n * @hidden\n * Endpoint id of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n endpointId: string;\n /**\n * @hidden\n * Device name of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n deviceName: string;\n /**\n * @hidden\n * Client type of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n clientType: string;\n /**\n * @hidden\n * Client version of the meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n clientVersion: string;\n }\n\n /**\n * @hidden\n * Type of Media control capabilities of a meeting room.\n */\n type MediaControls = 'toggleMute' | 'toggleCamera' | 'toggleCaptions' | 'volume';\n\n /**\n * @hidden\n * Types of Stage Layout control capabilities of a meeting room.\n */\n\n type StageLayoutControls =\n | 'showVideoGallery'\n | 'showContent'\n | 'showVideoGalleryAndContent'\n | 'showLargeGallery'\n | 'showTogether';\n\n /**\n * @hidden\n * Types of Meeting Control capabilities of a meeting room.\n */\n\n type MeetingControls = 'leaveMeeting';\n\n /**\n * @hidden\n * Types of Stage Layout State of a meeting room.\n */\n\n type StageLayoutStates = 'Gallery' | 'Content + gallery' | 'Content' | 'Large gallery' | 'Together mode';\n\n /**\n * @hidden\n * Data structure to represent capabilities of a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomCapability {\n /**\n * @hidden\n * Media control capabilities, value can be \"toggleMute\", \"toggleCamera\", \"toggleCaptions\", \"volume\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n mediaControls: MediaControls[];\n /**\n * @hidden\n * Main stage layout control capabilities, value can be \"showVideoGallery\", \"showContent\", \"showVideoGalleryAndContent\", \"showLargeGallery\", \"showTogether\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n stageLayoutControls: StageLayoutControls[];\n /**\n * @hidden\n * Meeting control capabilities, value can be \"leaveMeeting\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n meetingControls: MeetingControls[];\n }\n\n /**\n * @hidden\n * Data structure to represent states of a meeting room.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface MeetingRoomState {\n /**\n * @hidden\n * Current mute state, true: mute, false: unmute.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleMute: boolean;\n /**\n * @hidden\n * Current camera state, true: camera on, false: camera off.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleCamera: boolean;\n /**\n * @hidden\n * Current captions state, true: captions on, false: captions off.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n toggleCaptions: boolean;\n /**\n * @hidden\n * Current main stage layout state, value can be one of \"Gallery\", \"Content + gallery\", \"Content\", \"Large gallery\" and \"Together mode\".\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n stageLayout: StageLayoutStates;\n /**\n * @hidden\n * Current leaveMeeting state, true: leave, false: no-op.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n leaveMeeting: boolean;\n }\n\n /**\n * @hidden\n * Fetch the meeting room info that paired with current client.\n *\n * @returns Promise resolved with meeting room info or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getPairedMeetingRoomInfo(): Promise<MeetingRoomInfo> {\n return new Promise<MeetingRoomInfo>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(meetingRoomTelemetryVersionNumber, ApiName.MeetingRoom_GetPairedMeetingRoomInfo),\n 'meetingRoom.getPairedMeetingRoomInfo',\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Send a command to paired meeting room.\n *\n * @param commandName The command name.\n * @returns Promise resolved upon completion or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function sendCommandToPairedMeetingRoom(commandName: string): Promise<void> {\n return new Promise<void>((resolve) => {\n if (!commandName || commandName.length == 0) {\n throw new Error('[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(meetingRoomTelemetryVersionNumber, ApiName.MeetingRoom_SendCommandToPairedMeetingRoom),\n 'meetingRoom.sendCommandToPairedMeetingRoom',\n commandName,\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Registers a handler for meeting room capabilities update.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the capabilities of meeting room update.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerMeetingRoomCapabilitiesUpdateHandler(\n handler: (capabilities: MeetingRoomCapability) => void,\n ): void {\n if (!handler) {\n throw new Error('[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler(\n getApiVersionTag(\n meetingRoomTelemetryVersionNumber,\n ApiName.MeetingRoom_RegisterMeetingRoomCapabilitiesUpdateHandler,\n ),\n 'meetingRoom.meetingRoomCapabilitiesUpdate',\n (capabilities: MeetingRoomCapability) => {\n ensureInitialized(runtime);\n handler(capabilities);\n },\n );\n }\n\n /**\n * @hidden\n * Hide from docs\n * Registers a handler for meeting room states update.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the states of meeting room update.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerMeetingRoomStatesUpdateHandler(handler: (states: MeetingRoomState) => void): void {\n if (!handler) {\n throw new Error('[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null');\n }\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler(\n getApiVersionTag(meetingRoomTelemetryVersionNumber, ApiName.MeetingRoom_RegisterMeetingRoomStatesUpdateHandler),\n 'meetingRoom.meetingRoomStatesUpdate',\n (states: MeetingRoomState) => {\n ensureInitialized(runtime);\n handler(states);\n },\n );\n }\n\n /**\n * @hidden\n *\n * Checks if the meetingRoom capability is supported by the host\n * @returns boolean to represent whether the meetingRoom capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.meetingRoom ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { ShowNotificationParameters } from './interfaces';\n/**\n * @hidden\n * Hidden from Docs\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst notificationsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport namespace notifications {\n /**\n * @hidden\n * display notification API.\n *\n * @param message - Notification message.\n * @param notificationType - Notification type\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function showNotification(showNotificationParameters: ShowNotificationParameters): void {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent(\n getApiVersionTag(notificationsTelemetryVersionNumber, ApiName.Notifications_ShowNotification),\n 'notifications.showNotification',\n [showNotificationParameters],\n );\n }\n\n /**\n * @hidden\n *\n * Checks if the notifications capability is supported by the host\n * @returns boolean to represent whether the notifications capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.notifications ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { isNullOrUndefined } from '../internal/typeCheckUtilities';\nimport { ErrorCode } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * This capability contains the APIs for handling events that happen to other applications on the host\n * *while* the developer's application is running. For example, if the developer wants to be notified\n * when another application has been installed.\n */\nexport namespace otherAppStateChange {\n /**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\n const otherAppStateChangeTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n /**\n * @hidden\n * @beta\n * @internal\n * Limited to Microsoft-internal use\n *\n * Represent an event that has happened with other number of applications installed on this host.\n * (e.g. a new app has been installed)\n */\n export interface OtherAppStateChangeEvent {\n /** An array of app ids that this event applies to */\n appIds: string[];\n }\n\n /**\n * @hidden\n * @beta\n * @internal\n * Limited to Microsoft-internal use\n *\n * A function handler that will be called whenever an event happens with some number of applications installed on this host.\n */\n export type OtherAppStateChangeEventHandler = (event: OtherAppStateChangeEvent) => void;\n\n /**\n * @hidden\n * @beta\n * @internal\n * Limited to Microsoft-internal use\n *\n * This function allows an app to register a handler that will receive whenever other applications are installed\n * on the host while the developer's application is running.\n *\n * @param appInstallHandler - This handler will be called whenever apps are installed on the host.\n *\n * @throws Error if {@link app.initialize} has not successfully completed, if the platform\n * does not support the otherAppStateChange capability, or if a valid handler is not passed to the function.\n *\n * @example\n * ``` ts\n * if (otherAppStateChange.isSupported()) {\n * otherAppStateChange.registerAppInstallationHandler((event: otherAppStateChange.OtherAppStateChangeEvent) => {\n * // code to handle the event goes here\n * });\n * }\n * ```\n */\n export function registerAppInstallationHandler(appInstallHandler: OtherAppStateChangeEventHandler): void {\n if (!isSupported()) {\n throw new Error(ErrorCode.NOT_SUPPORTED_ON_PLATFORM.toString());\n }\n\n if (isNullOrUndefined(appInstallHandler)) {\n throw new Error(ErrorCode.INVALID_ARGUMENTS.toString());\n }\n\n registerHandler(\n getApiVersionTag(otherAppStateChangeTelemetryVersionNumber, ApiName.OtherAppStateChange_Install),\n ApiName.OtherAppStateChange_Install,\n appInstallHandler,\n );\n }\n\n /**\n * @hidden\n * @beta\n * @internal\n * Limited to Microsoft-internal use\n *\n * This function can be called so that the handler passed to {@link registerAppInstallationHandler}\n * will no longer receive app installation events. If this is called before registering a handler\n * it will have no effect.\n *\n * @throws Error if {@link app.initialize} has not successfully completed or if the platform\n * does not support the otherAppStateChange capability.\n */\n export function unregisterAppInstallationHandler(): void {\n if (!isSupported()) {\n throw new Error(ErrorCode.NOT_SUPPORTED_ON_PLATFORM.toString());\n }\n\n sendMessageToParent(\n getApiVersionTag(otherAppStateChangeTelemetryVersionNumber, ApiName.OtherAppStateChange_UnregisterInstall),\n ApiName.OtherAppStateChange_UnregisterInstall,\n );\n\n removeHandler(ApiName.OtherAppStateChange_Install);\n }\n\n /**\n * Checks if the otherAppStateChange capability is supported by the host\n * @returns boolean to represent whether the otherAppStateChange capability is supported\n *\n * @throws Error if {@link app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.otherAppStateChange ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { SdkError } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\n\n/**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst remoteCameraTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport namespace remoteCamera {\n /**\n * @hidden\n * Data structure to represent patricipant details needed to request control of camera.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface Participant {\n /**\n * @hidden\n * Id of participant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n id: string;\n /**\n * @hidden\n * Display name of participant.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName?: string;\n /**\n * @hidden\n * Active indicates whether the participant's device is actively being controlled.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n active?: boolean;\n }\n\n /**\n * @hidden\n * Enum used to indicate possible camera control commands.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ControlCommand {\n Reset = 'Reset',\n ZoomIn = 'ZoomIn',\n ZoomOut = 'ZoomOut',\n PanLeft = 'PanLeft',\n PanRight = 'PanRight',\n TiltUp = 'TiltUp',\n TiltDown = 'TiltDown',\n }\n\n /**\n * @hidden\n * Data structure to indicate the current state of the device.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface DeviceState {\n /**\n * @hidden\n * All operation are available to apply.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n available: boolean;\n /**\n * @hidden\n * Either camera doesnt support to get state or It unable to apply command.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n error: boolean;\n /**\n * @hidden\n * Reset max out or already applied. Client Disable Reset.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n reset: boolean;\n /**\n * @hidden\n * ZoomIn maxed out.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n zoomIn: boolean;\n /**\n * @hidden\n * ZoomOut maxed out.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n zoomOut: boolean;\n /**\n * @hidden\n * PanLeft reached max left.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n panLeft: boolean;\n /**\n * @hidden\n * PanRight reached max right.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n panRight: boolean;\n /**\n * @hidden\n * TiltUp reached top.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n tiltUp: boolean;\n /**\n * @hidden\n * TiltDown reached bottom.\n *\n * @internal Limited to Microsoft-internal use\n */\n tiltDown: boolean;\n }\n\n /**\n * @hidden\n * Enum used to indicate the reason for the error.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ErrorReason {\n CommandResetError,\n CommandZoomInError,\n CommandZoomOutError,\n CommandPanLeftError,\n CommandPanRightError,\n CommandTiltUpError,\n CommandTiltDownError,\n SendDataError,\n }\n\n /**\n * @hidden\n * Data structure to indicate the status of the current session.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface SessionStatus {\n /**\n * @hidden\n * Whether the far-end user is controlling a device.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n inControl: boolean;\n /**\n * @hidden\n * Reason the control session was terminated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n terminatedReason?: SessionTerminatedReason;\n }\n\n /**\n * @hidden\n * Enum used to indicate the reason the session was terminated.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum SessionTerminatedReason {\n None,\n ControlDenied,\n ControlNoResponse,\n ControlBusy,\n AckTimeout,\n ControlTerminated,\n ControllerTerminated,\n DataChannelError,\n ControllerCancelled,\n ControlDisabled,\n ControlTerminatedToAllowOtherController,\n }\n\n /**\n * @hidden\n * Fetch a list of the participants with controllable-cameras in a meeting.\n *\n * @param callback - Callback contains 2 parameters, error and participants.\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\n * participants can either contain an array of Participant objects, incase of a successful fetch or null when it fails\n * participants: object that contains an array of participants with controllable-cameras\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getCapableParticipants(\n callback: (error: SdkError | null, participants: Participant[] | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[remoteCamera.getCapableParticipants] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_GetCapableParticipants),\n 'remoteCamera.getCapableParticipants',\n callback,\n );\n }\n\n /**\n * @hidden\n * Request control of a participant's camera.\n *\n * @param participant - Participant specifies the participant to send the request for camera control.\n * @param callback - Callback contains 2 parameters, error and requestResponse.\n * error can either contain an error of type SdkError, incase of an error, or null when fetch is successful\n * requestResponse can either contain the true/false value, incase of a successful request or null when it fails\n * requestResponse: True means request was accepted and false means request was denied\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function requestControl(\n participant: Participant,\n callback: (error: SdkError | null, requestResponse: boolean | null) => void,\n ): void {\n if (!participant) {\n throw new Error('[remoteCamera.requestControl] Participant cannot be null');\n }\n if (!callback) {\n throw new Error('[remoteCamera.requestControl] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RequestControl),\n 'remoteCamera.requestControl',\n [participant],\n callback,\n );\n }\n\n /**\n * @hidden\n * Send control command to the participant's camera.\n *\n * @param ControlCommand - ControlCommand specifies the command for controling the camera.\n * @param callback - Callback to invoke when the command response returns.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function sendControlCommand(ControlCommand: ControlCommand, callback: (error: SdkError | null) => void): void {\n if (!ControlCommand) {\n throw new Error('[remoteCamera.sendControlCommand] ControlCommand cannot be null');\n }\n if (!callback) {\n throw new Error('[remoteCamera.sendControlCommand] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_SendControlCommand),\n 'remoteCamera.sendControlCommand',\n [ControlCommand],\n callback,\n );\n }\n\n /**\n * @hidden\n * Terminate the remote session\n *\n * @param callback - Callback to invoke when the command response returns.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function terminateSession(callback: (error: SdkError | null) => void): void {\n if (!callback) {\n throw new Error('[remoteCamera.terminateSession] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_TerminateSession),\n 'remoteCamera.terminateSession',\n callback,\n );\n }\n\n /**\n * @hidden\n * Registers a handler for change in participants with controllable-cameras.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the list of participants with controllable-cameras changes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnCapableParticipantsChangeHandler(\n handler: (participantChange: Participant[]) => void,\n ): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler(\n getApiVersionTag(\n remoteCameraTelemetryVersionNumber,\n ApiName.RemoteCamera_RegisterOnCapableParticipantsChangeHandler,\n ),\n 'remoteCamera.capableParticipantsChange',\n handler,\n );\n }\n\n /**\n * @hidden\n * Registers a handler for error.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when there is an error from the camera handler.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnErrorHandler(handler: (error: ErrorReason) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnErrorHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler(\n getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnErrorHandler),\n 'remoteCamera.handlerError',\n handler,\n );\n }\n\n /**\n * @hidden\n * Registers a handler for device state change.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the controlled device changes state.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnDeviceStateChangeHandler(handler: (deviceStateChange: DeviceState) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler(\n getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnDeviceStateChangeHandler),\n 'remoteCamera.deviceStateChange',\n handler,\n );\n }\n\n /**\n * @hidden\n * Registers a handler for session status change.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the current session status changes.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerOnSessionStatusChangeHandler(handler: (sessionStatusChange: SessionStatus) => void): void {\n if (!handler) {\n throw new Error('[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler(\n getApiVersionTag(remoteCameraTelemetryVersionNumber, ApiName.RemoteCamera_RegisterOnSessionStatusChangeHandler),\n 'remoteCamera.sessionStatusChange',\n handler,\n );\n }\n\n /**\n * @hidden\n *\n * Checks if the remoteCamera capability is supported by the host\n * @returns boolean to represent whether the remoteCamera capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.remoteCamera ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { SdkError } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst appEntityTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n/**\n * @hidden\n * Namespace to interact with the application entities specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport namespace appEntity {\n /**\n * @hidden\n *\n * Information on an app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface AppEntity {\n /**\n * @hidden\n * ID of the application\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n appId: string;\n\n /**\n * @hidden\n * URL for the application's icon\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n appIconUrl: string;\n\n /**\n * @hidden\n * Content URL for the app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n contentUrl: string;\n\n /**\n * @hidden\n * The display name for the app entity\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n displayName: string;\n\n /**\n * @hidden\n * Website URL for the app entity. It is meant to be opened by the user in a browser.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n websiteUrl: string;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Open the Tab Gallery and retrieve the app entity\n * @param threadId ID of the thread where the app entity will be created\n * @param categories A list of application categories that will be displayed in the opened tab gallery\n * @param subEntityId An object that will be made available to the application being configured\n * through the Context's subEntityId field.\n * @param callback Callback that will be triggered once the app entity information is available.\n * The callback takes two arguments: an SdkError in case something happened (i.e.\n * no permissions to execute the API) and the app entity configuration, if available\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function selectAppEntity(\n threadId: string,\n categories: string[],\n subEntityId: string,\n callback: (sdkError?: SdkError, appEntity?: AppEntity) => void,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!threadId || threadId.length == 0) {\n throw new Error('[appEntity.selectAppEntity] threadId name cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[appEntity.selectAppEntity] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(appEntityTelemetryVersionNumber, ApiName.AppEntity_SelectAppEntity),\n 'appEntity.selectAppEntity',\n [threadId, categories, subEntityId],\n callback,\n );\n }\n\n /**\n * @hidden\n *\n * Checks if the appEntity capability is supported by the host\n * @returns boolean to represent whether the appEntity capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.appEntity ? true : false;\n }\n}\n","import { sendAndUnwrap, sendMessageToParent } from '../internal/communication';\nimport { getUserJoinedTeamsSupportedAndroidClientVersion } from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts, HostClientType } from '../public/constants';\nimport { ErrorCode, SdkError } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\nimport { TeamInstanceParameters, UserJoinedTeamsInformation } from './interfaces';\n\n/**\n * @hidden\n * Namespace to interact with the `teams` specific part of the SDK.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst teamsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport namespace teams {\n export enum ChannelType {\n Regular = 0,\n Private = 1,\n Shared = 2,\n }\n\n /**\n * @hidden\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ChannelInfo {\n siteUrl: string;\n objectId: string;\n folderRelativeUrl: string;\n displayName: string;\n channelType: ChannelType;\n }\n\n /**\n * @hidden\n * Get a list of channels belong to a Team\n *\n * @param groupId - a team's objectId\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getTeamChannels(groupId: string, callback: (error: SdkError, channels: ChannelInfo[]) => void): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!groupId) {\n throw new Error('[teams.getTeamChannels] groupId cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[teams.getTeamChannels] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_GetTeamChannels),\n 'teams.getTeamChannels',\n [groupId],\n callback,\n );\n }\n\n /**\n * @hidden\n * Allow 1st party apps to call this function when they receive migrated errors to inform the Hub/Host to refresh the siteurl\n * when site admin renames siteurl.\n *\n * @param threadId - ID of the thread where the app entity will be created; if threadId is not\n * provided, the threadId from route params will be used.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function refreshSiteUrl(threadId: string, callback: (error: SdkError) => void): void {\n ensureInitialized(runtime);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!threadId) {\n throw new Error('[teams.refreshSiteUrl] threadId cannot be null or empty');\n }\n\n if (!callback) {\n throw new Error('[teams.refreshSiteUrl] Callback cannot be null');\n }\n\n sendMessageToParent(\n getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_RefreshSiteUrl),\n 'teams.refreshSiteUrl',\n [threadId],\n callback,\n );\n }\n\n /**\n * @hidden\n *\n * Checks if teams capability is supported by the host\n * @returns boolean to represent whether the teams capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams ? true : false;\n }\n\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n */\n export namespace fullTrust {\n /**\n * @hidden\n * @internal\n * Limited to Microsoft-internal use\n */\n export namespace joinedTeams {\n /**\n * @hidden\n * Allows an app to retrieve information of all user joined teams\n *\n * @param teamInstanceParameters - Optional flags that specify whether to scope call to favorite teams\n * @returns Promise that resolves with information about the user joined teams or rejects with an error when the operation has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getUserJoinedTeams(\n teamInstanceParameters?: TeamInstanceParameters,\n ): Promise<UserJoinedTeamsInformation> {\n return new Promise<UserJoinedTeamsInformation>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (\n (GlobalVars.hostClientType === HostClientType.android ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\n GlobalVars.hostClientType === HostClientType.teamsDisplays) &&\n !isCurrentSDKVersionAtLeast(getUserJoinedTeamsSupportedAndroidClientVersion)\n ) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n throw new Error(JSON.stringify(oldPlatformError));\n }\n\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(\n sendAndUnwrap(\n getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_FullTrust_JoinedTeams_GetUserJoinedTeams),\n 'getUserJoinedTeams',\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n teamInstanceParameters,\n ),\n );\n });\n }\n /**\n * @hidden\n *\n * Checks if teams.fullTrust.joinedTeams capability is supported by the host\n * @returns boolean to represent whether the teams.fullTrust.joinedTeams capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams\n ? runtime.supports.teams.fullTrust\n ? runtime.supports.teams.fullTrust.joinedTeams\n ? true\n : false\n : false\n : false;\n }\n }\n\n /**\n * @hidden\n * Allows an app to get the configuration setting value\n *\n * @param key - The key for the config setting\n * @returns Promise that resolves with the value for the provided configuration setting or rejects with an error when the operation has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getConfigSetting(key: string): Promise<string> {\n return new Promise<string>((resolve) => {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(\n sendAndUnwrap(\n getApiVersionTag(teamsTelemetryVersionNumber, ApiName.Teams_FullTrust_GetConfigSetting),\n 'getConfigSetting',\n key,\n ),\n );\n });\n }\n\n /**\n * @hidden\n *\n * Checks if teams.fullTrust capability is supported by the host\n * @returns boolean to represent whether the teams.fullTrust capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teams\n ? runtime.supports.teams.fullTrust\n ? true\n : false\n : false;\n }\n }\n}\n","import { generateGUID } from './utils';\n\nexport class VideoFrameTick {\n private static readonly setTimeoutCallbacks: {\n [key: string]: {\n callback: () => void;\n startedAtInMs: number;\n timeoutInMs: number;\n };\n } = {};\n\n public static setTimeout(callback: () => void, timeoutInMs: number): string {\n const startedAtInMs = performance.now();\n const id = generateGUID();\n VideoFrameTick.setTimeoutCallbacks[id] = {\n callback,\n timeoutInMs,\n startedAtInMs,\n };\n return id;\n }\n\n public static clearTimeout(id: string): void {\n delete VideoFrameTick.setTimeoutCallbacks[id];\n }\n\n public static setInterval(callback: () => void, intervalInMs: number): void {\n VideoFrameTick.setTimeout(function next() {\n callback();\n VideoFrameTick.setTimeout(next, intervalInMs);\n }, intervalInMs);\n }\n\n /**\n * Call this function whenever a frame comes in, it will check if any timeout is due and call the callback\n */\n public static tick(): void {\n const now = performance.now();\n const timeoutIds: string[] = [];\n // find all the timeouts that are due,\n // not to invoke them in the loop to avoid modifying the collection while iterating\n for (const key in VideoFrameTick.setTimeoutCallbacks) {\n const callback = VideoFrameTick.setTimeoutCallbacks[key];\n const start = callback.startedAtInMs;\n if (now - start >= callback.timeoutInMs) {\n timeoutIds.push(key);\n }\n }\n // invoke the callbacks\n for (const id of timeoutIds) {\n const callback = VideoFrameTick.setTimeoutCallbacks[id];\n callback.callback();\n delete VideoFrameTick.setTimeoutCallbacks[id];\n }\n }\n}\n","import { VideoFrameTick } from './videoFrameTick';\n\nexport type VideoPerformanceStatisticsResult = {\n effectId: string;\n effectParam?: string;\n frameWidth: number;\n frameHeight: number;\n /**\n * The duration in milliseconds that the data were collected\n */\n duration: number;\n /**\n * The number of frames that were processed in the duration\n */\n sampleCount: number;\n /**\n * An array that presents counts of frames that were finished in n milliseconds:\n * distributionBins[frameProcessingDurationInMs]=frameCount.\n * For example, distributionBins[10] = 5 means that 5 frames were processed in 10 milliseconds.\n */\n distributionBins: Uint32Array;\n};\n\nexport class VideoPerformanceStatistics {\n private static readonly initialSessionTimeoutInMs = 1000;\n private static readonly maxSessionTimeoutInMs = 1000 * 30;\n\n private currentSession: {\n startedAtInMs: number;\n timeoutInMs: number;\n effectId: string;\n effectParam?: string;\n frameWidth: number;\n frameHeight: number;\n };\n\n private frameProcessingStartedAt: number;\n private distributionBins: Uint32Array;\n private sampleCount = 0;\n private timeoutId: string;\n\n public constructor(\n distributionBinSize: number,\n /**\n * Function to report the statistics result\n */\n private reportStatisticsResult: (result: VideoPerformanceStatisticsResult) => void,\n ) {\n this.distributionBins = new Uint32Array(distributionBinSize);\n }\n\n /**\n * Call this function before processing every frame\n */\n public processStarts(effectId: string, frameWidth: number, frameHeight: number, effectParam?: string): void {\n VideoFrameTick.tick();\n if (!this.suitableForThisSession(effectId, frameWidth, frameHeight, effectParam)) {\n this.reportAndResetSession(this.getStatistics(), effectId, effectParam, frameWidth, frameHeight);\n }\n this.start();\n }\n\n public processEnds(): void {\n // calculate duration of the process and record it\n const durationInMillisecond = performance.now() - this.frameProcessingStartedAt;\n const binIndex = Math.floor(Math.max(0, Math.min(this.distributionBins.length - 1, durationInMillisecond)));\n this.distributionBins[binIndex] += 1;\n this.sampleCount += 1;\n }\n\n private getStatistics(): VideoPerformanceStatisticsResult | null {\n if (!this.currentSession) {\n return null;\n }\n return {\n effectId: this.currentSession.effectId,\n effectParam: this.currentSession.effectParam,\n frameHeight: this.currentSession.frameHeight,\n frameWidth: this.currentSession.frameWidth,\n duration: performance.now() - this.currentSession.startedAtInMs,\n sampleCount: this.sampleCount,\n distributionBins: this.distributionBins.slice(),\n };\n }\n\n private start(): void {\n this.frameProcessingStartedAt = performance.now();\n }\n\n private suitableForThisSession(\n effectId: string,\n frameWidth: number,\n frameHeight: number,\n effectParam?: string,\n ): boolean {\n return (\n this.currentSession &&\n this.currentSession.effectId === effectId &&\n this.currentSession.effectParam === effectParam &&\n this.currentSession.frameWidth === frameWidth &&\n this.currentSession.frameHeight === frameHeight\n );\n }\n\n private reportAndResetSession(result, effectId, effectParam, frameWidth, frameHeight): void {\n result && this.reportStatisticsResult(result);\n this.resetCurrentSession(\n this.getNextTimeout(effectId, this.currentSession),\n effectId,\n effectParam,\n frameWidth,\n frameHeight,\n );\n if (this.timeoutId) {\n VideoFrameTick.clearTimeout(this.timeoutId);\n }\n this.timeoutId = VideoFrameTick.setTimeout(\n (() => this.reportAndResetSession(this.getStatistics(), effectId, effectParam, frameWidth, frameHeight)).bind(\n this,\n ),\n this.currentSession.timeoutInMs,\n );\n }\n\n private resetCurrentSession(\n timeoutInMs: number,\n effectId: string,\n effectParam: string,\n frameWidth: number,\n frameHeight: number,\n ): void {\n this.currentSession = {\n startedAtInMs: performance.now(),\n timeoutInMs,\n effectId,\n effectParam,\n frameWidth,\n frameHeight,\n };\n this.sampleCount = 0;\n this.distributionBins.fill(0);\n }\n\n // send the statistics result every n second, where n starts from 1, 2, 4...and finally stays at every 30 seconds.\n private getNextTimeout(effectId: string, currentSession?: { timeoutInMs: number; effectId: string }): number {\n // only reset timeout when new session or effect changed\n if (!currentSession || currentSession.effectId !== effectId) {\n return VideoPerformanceStatistics.initialSessionTimeoutInMs;\n }\n return Math.min(VideoPerformanceStatistics.maxSessionTimeoutInMs, currentSession.timeoutInMs * 2);\n }\n}\n","import { ApiName, ApiVersionNumber, getApiVersionTag } from './telemetry';\nimport { VideoFrameTick } from './videoFrameTick';\nimport { VideoPerformanceStatistics } from './videoPerformanceStatistics';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst videoPerformanceMonitorTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * This class is used to monitor the performance of video processing, and report performance events.\n */\nexport class VideoPerformanceMonitor {\n private static readonly distributionBinSize = 1000;\n private static readonly calculateFPSInterval = 1000;\n\n private isFirstFrameProcessed = false;\n\n // The effect that the user last selected:\n private applyingEffect?: {\n effectId: string;\n effectParam?: string;\n };\n\n // The effect that is currently applied to the video:\n private appliedEffect?: {\n effectId: string;\n effectParam?: string;\n };\n\n private frameProcessTimeLimit = 100;\n private gettingTextureStreamStartedAt: number;\n private currentStreamId: string;\n private frameProcessingStartedAt = 0;\n private frameProcessingTimeCost = 0;\n private processedFrameCount = 0;\n\n private performanceStatistics: VideoPerformanceStatistics;\n\n public constructor(\n private reportPerformanceEvent: (apiVersionTag: string, actionName: string, args: unknown[]) => void,\n ) {\n this.performanceStatistics = new VideoPerformanceStatistics(VideoPerformanceMonitor.distributionBinSize, (result) =>\n this.reportPerformanceEvent(\n getApiVersionTag(videoPerformanceMonitorTelemetryVersionNumber, ApiName.VideoPerformanceMonitor_Constructor),\n 'video.performance.performanceDataGenerated',\n [result],\n ),\n );\n }\n\n /**\n * Start to check frame processing time intervally\n * and report performance event if the average frame processing time is too long.\n */\n public startMonitorSlowFrameProcessing(): void {\n VideoFrameTick.setInterval(() => {\n if (this.processedFrameCount === 0) {\n return;\n }\n const averageFrameProcessingTime = this.frameProcessingTimeCost / this.processedFrameCount;\n if (averageFrameProcessingTime > this.frameProcessTimeLimit) {\n this.reportPerformanceEvent(\n getApiVersionTag(\n videoPerformanceMonitorTelemetryVersionNumber,\n ApiName.VideoPerformanceMonitor_StartMonitorSlowFrameProcessing,\n ),\n 'video.performance.frameProcessingSlow',\n [averageFrameProcessingTime],\n );\n }\n this.frameProcessingTimeCost = 0;\n this.processedFrameCount = 0;\n }, VideoPerformanceMonitor.calculateFPSInterval);\n }\n\n /**\n * Define the time limit of frame processing.\n * When the average frame processing time is longer than the time limit, a \"video.performance.frameProcessingSlow\" event will be reported.\n * @param timeLimit\n */\n public setFrameProcessTimeLimit(timeLimit: number): void {\n this.frameProcessTimeLimit = timeLimit;\n }\n\n /**\n * Call this function when the app starts to switch to the new video effect\n */\n public reportApplyingVideoEffect(effectId: string, effectParam?: string): void {\n if (this.applyingEffect?.effectId === effectId && this.applyingEffect?.effectParam === effectParam) {\n return;\n }\n this.applyingEffect = {\n effectId,\n effectParam,\n };\n this.appliedEffect = undefined;\n }\n\n /**\n * Call this function when the new video effect is ready\n */\n public reportVideoEffectChanged(effectId: string, effectParam?: string): void {\n if (\n this.applyingEffect === undefined ||\n (this.applyingEffect.effectId !== effectId && this.applyingEffect.effectParam !== effectParam)\n ) {\n // don't handle obsoleted event\n return;\n }\n this.appliedEffect = {\n effectId,\n effectParam,\n };\n this.applyingEffect = undefined;\n this.isFirstFrameProcessed = false;\n }\n\n /**\n * Call this function when the app starts to process a video frame\n */\n public reportStartFrameProcessing(frameWidth: number, frameHeight: number): void {\n VideoFrameTick.tick();\n if (!this.appliedEffect) {\n return;\n }\n this.frameProcessingStartedAt = performance.now();\n this.performanceStatistics.processStarts(\n this.appliedEffect.effectId,\n frameWidth,\n frameHeight,\n this.appliedEffect.effectParam,\n );\n }\n\n /**\n * Call this function when the app finishes successfully processing a video frame\n */\n public reportFrameProcessed(): void {\n if (!this.appliedEffect) {\n return;\n }\n this.processedFrameCount++;\n this.frameProcessingTimeCost += performance.now() - this.frameProcessingStartedAt;\n this.performanceStatistics.processEnds();\n if (!this.isFirstFrameProcessed) {\n this.isFirstFrameProcessed = true;\n this.reportPerformanceEvent(\n getApiVersionTag(\n videoPerformanceMonitorTelemetryVersionNumber,\n ApiName.VideoPerformanceMonitor_ReportFrameProcessed,\n ),\n 'video.performance.firstFrameProcessed',\n [Date.now(), this.appliedEffect.effectId, this.appliedEffect?.effectParam],\n );\n }\n }\n\n /**\n * Call this function when the app starts to get the texture stream\n */\n public reportGettingTextureStream(streamId: string): void {\n this.gettingTextureStreamStartedAt = performance.now();\n this.currentStreamId = streamId;\n }\n\n /**\n * Call this function when the app finishes successfully getting the texture stream\n */\n public reportTextureStreamAcquired(): void {\n if (this.gettingTextureStreamStartedAt !== undefined) {\n const timeTaken = performance.now() - this.gettingTextureStreamStartedAt;\n this.reportPerformanceEvent(\n getApiVersionTag(\n videoPerformanceMonitorTelemetryVersionNumber,\n ApiName.VideoPerformanceMonitor_ReportTextureStreamAcquired,\n ),\n 'video.performance.textureStreamAcquired',\n [this.currentStreamId, timeTaken],\n );\n }\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { inServerSideRenderingEnvironment, ssrSafeWindow } from '../internal/utils';\nimport { createEffectParameterChangeCallback, processMediaStream } from '../internal/videoEffectsUtils';\nimport { VideoPerformanceMonitor } from '../internal/videoPerformanceMonitor';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst videoEffectsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Namespace to video extensibility of the SDK\n * @beta\n */\nexport namespace videoEffects {\n const videoPerformanceMonitor = inServerSideRenderingEnvironment()\n ? undefined\n : new VideoPerformanceMonitor(sendMessageToParent);\n\n /** Notify video frame processed function type */\n export type notifyVideoFrameProcessedFunctionType = () => void;\n /** Notify error function type */\n export type notifyErrorFunctionType = (errorMessage: string) => void;\n\n /**\n * Represents a video frame\n * @beta\n */\n export interface VideoBufferData {\n /**\n * Video frame width\n */\n width: number;\n /**\n * Video frame height\n */\n height: number;\n /**\n * Video frame buffer\n */\n videoFrameBuffer: Uint8ClampedArray;\n /**\n * NV12 luma stride, valid only when video frame format is NV12\n */\n lumaStride?: number;\n /**\n * NV12 chroma stride, valid only when video frame format is NV12\n */\n chromaStride?: number;\n /**\n * RGB stride, valid only when video frame format is RGB\n */\n stride?: number;\n /**\n * The time stamp of the current video frame\n */\n timestamp?: number;\n }\n\n /**\n * Video frame format enum, currently only support NV12\n * @beta\n */\n export enum VideoFrameFormat {\n /** Video format used for encoding and decoding YUV color data in video streaming and storage applications. */\n NV12 = 'NV12',\n }\n\n /**\n * Video frame configuration supplied to the host to customize the generated video frame parameters, like format\n * @beta\n */\n export interface VideoFrameConfig {\n /**\n * Video format\n */\n format: VideoFrameFormat;\n }\n\n /**\n * Video effect change type enum\n * @beta\n */\n export enum EffectChangeType {\n /**\n * Current video effect changed\n */\n EffectChanged = 'EffectChanged',\n /**\n * Disable the video effect\n */\n EffectDisabled = 'EffectDisabled',\n }\n\n /**\n * Predefined failure reasons for preparing the selected video effect\n * @beta\n */\n export enum EffectFailureReason {\n /**\n * A wrong effect id is provide.\n * Use this reason when the effect id is not found or empty, this may indicate a mismatch between the app and its manifest or a bug of the host.\n */\n InvalidEffectId = 'InvalidEffectId',\n /**\n * The effect can't be initialized\n */\n InitializationFailure = 'InitializationFailure',\n }\n\n /**\n * Video effect change call back function definition\n * Return a Promise which will be resolved when the effect is prepared, or throw an {@link EffectFailureReason} on error.\n * @beta\n */\n export type VideoEffectCallback = (effectId: string | undefined) => Promise<void>;\n\n /**\n * @beta\n * Video frame call back function definition\n * The callback will be called on every frame when running on the supported host.\n * We require the frame rate of the video to be at least 22fps for 720p, thus the callback should process a frame timely.\n * The video app should call `notifyVideoFrameProcessed` to notify a successfully processed video frame.\n * The video app should call `notifyError` to notify a failure. When the failures accumulate to a certain number, the host will see the app is \"frozen\" and ask the user to close it or not.\n */\n export type VideoBufferHandler = (\n videoBufferData: VideoBufferData,\n notifyVideoFrameProcessed: notifyVideoFrameProcessedFunctionType,\n notifyError: notifyErrorFunctionType,\n ) => void;\n\n /**\n * @beta\n * VideoFrame definition, align with the W3C spec: https://www.w3.org/TR/webcodecs/#videoframe-interface.\n * The current version of typescript doesn't have the definition of VideoFrame so we have to define it here.\n * At runtime it can be cast to VideoFrame directly: `(videoFrame as VideoFrame)`.\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface VideoFrame {}\n\n /**\n * @beta\n * Video frame data extracted from the media stream. More properties may be added in the future.\n */\n export type VideoFrameData = {\n /**\n * The video frame from the media stream.\n */\n videoFrame: VideoFrame;\n };\n\n /**\n * @beta\n * Video frame call back function definition.\n * The callback will be called on every frame when running on the supported host.\n * We require the frame rate of the video to be at least 22fps for 720p, thus the callback should process a frame timely.\n * The video app should resolve the promise to notify a successfully processed video frame.\n * The video app should reject the promise to notify a failure. When the failures accumulate to a certain number, the host will see the app is \"frozen\" and ask the user to close it or not.\n */\n export type VideoFrameHandler = (receivedVideoFrame: VideoFrameData) => Promise<VideoFrame>;\n\n /**\n * @beta\n * Callbacks and configuration supplied to the host to process the video frames.\n */\n export type RegisterForVideoFrameParameters = {\n /**\n * Callback function to process the video frames extracted from a media stream.\n */\n videoFrameHandler: VideoFrameHandler;\n /**\n * Callback function to process the video frames shared by the host.\n */\n videoBufferHandler: VideoBufferHandler;\n /**\n * Video frame configuration supplied to the host to customize the generated video frame parameters, like format\n */\n config: VideoFrameConfig;\n };\n\n /**\n * Register callbacks to process the video frames if the host supports it.\n * @beta\n * @param parameters - Callbacks and configuration to process the video frames. A host may support either {@link VideoFrameHandler} or {@link VideoBufferHandler}, but not both.\n * To ensure the video effect works on all supported hosts, the video app must provide both {@link VideoFrameHandler} and {@link VideoBufferHandler}.\n * The host will choose the appropriate callback based on the host's capability.\n *\n * @example\n * ```typescript\n * videoEffects.registerForVideoFrame({\n * videoFrameHandler: async (videoFrameData) => {\n * const originalFrame = videoFrameData.videoFrame as VideoFrame;\n * try {\n * const processedFrame = await processFrame(originalFrame);\n * return processedFrame;\n * } catch (e) {\n * throw e;\n * }\n * },\n * videoBufferHandler: (\n * bufferData: VideoBufferData,\n * notifyVideoFrameProcessed: notifyVideoFrameProcessedFunctionType,\n * notifyError: notifyErrorFunctionType\n * ) => {\n * try {\n * processFrameInplace(bufferData);\n * notifyVideoFrameProcessed();\n * } catch (e) {\n * notifyError(e);\n * }\n * },\n * config: {\n * format: videoEffects.VideoPixelFormat.NV12,\n * }\n * });\n * ```\n */\n export function registerForVideoFrame(parameters: RegisterForVideoFrameParameters): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!parameters.videoFrameHandler || !parameters.videoBufferHandler) {\n throw new Error('Both videoFrameHandler and videoBufferHandler must be provided');\n }\n registerHandler(\n getApiVersionTag(\n videoEffectsTelemetryVersionNumber,\n ApiName.VideoEffects_RegisterSetFrameProcessTimeLimitHandler,\n ),\n 'video.setFrameProcessTimeLimit',\n (timeLimitInfo: { timeLimit: number }) =>\n videoPerformanceMonitor?.setFrameProcessTimeLimit(timeLimitInfo.timeLimit),\n false,\n );\n if (doesSupportMediaStream()) {\n registerForMediaStream(parameters.videoFrameHandler, parameters.config);\n } else if (doesSupportSharedFrame()) {\n registerForVideoBuffer(parameters.videoBufferHandler, parameters.config);\n } else {\n // should not happen if isSupported() is true\n throw errorNotSupportedOnPlatform;\n }\n videoPerformanceMonitor?.startMonitorSlowFrameProcessing();\n }\n\n /**\n * Video extension should call this to notify host that the current selected effect parameter changed.\n * If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.\n * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.\n * @beta\n * @param effectChangeType - the effect change type.\n * @param effectId - Newly selected effect id.\n */\n export function notifySelectedVideoEffectChanged(\n effectChangeType: EffectChangeType,\n effectId: string | undefined,\n ): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifySelectedVideoEffectChanged),\n 'video.videoEffectChanged',\n [effectChangeType, effectId],\n );\n }\n\n /**\n * Register a callback to be notified when a new video effect is applied.\n * @beta\n * @param callback - Function to be called when new video effect is applied.\n */\n export function registerForVideoEffect(callback: VideoEffectCallback): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n registerHandler(\n getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterEffectParameterChangeHandler),\n 'video.effectParameterChange',\n createEffectParameterChangeCallback(callback, videoPerformanceMonitor),\n false,\n );\n sendMessageToParent(\n getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoEffect),\n 'video.registerForVideoEffect',\n );\n }\n\n /**\n * Sending notification to host finished the video frame processing, now host can render this video frame\n * or pass the video frame to next one in video pipeline\n * @beta\n */\n function notifyVideoFrameProcessed(timestamp?: number): void {\n sendMessageToParent(\n getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifyVideoFrameProcessed),\n 'video.videoFrameProcessed',\n [timestamp],\n );\n }\n\n /**\n * Sending error notification to host\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n */\n function notifyError(errorMessage: string): void {\n sendMessageToParent(\n getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_NotifyError),\n 'video.notifyError',\n [errorMessage],\n );\n }\n\n /**\n * Checks if video capability is supported by the host.\n * @beta\n * @returns boolean to represent whether the video capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return (\n ensureInitialized(runtime) &&\n !!runtime.supports.video &&\n /** A host should support either mediaStream or sharedFrame sub-capability to support the video capability */\n (!!runtime.supports.video.mediaStream || !!runtime.supports.video.sharedFrame)\n );\n }\n\n function registerForMediaStream(videoFrameHandler: VideoFrameHandler, config: VideoFrameConfig): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported() || !doesSupportMediaStream()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(\n getApiVersionTag(\n videoEffectsTelemetryVersionNumber,\n ApiName.VideoEffects_RegisterStartVideoExtensibilityVideoStreamHandler,\n ),\n 'video.startVideoExtensibilityVideoStream',\n async (mediaStreamInfo: { streamId: string }) => {\n // when a new streamId is ready:\n const { streamId } = mediaStreamInfo;\n const monitoredVideoFrameHandler = createMonitoredVideoFrameHandler(videoFrameHandler, videoPerformanceMonitor);\n await processMediaStream(streamId, monitoredVideoFrameHandler, notifyError, videoPerformanceMonitor);\n },\n false,\n );\n\n sendMessageToParent(\n getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_MediaStream_RegisterForVideoFrame),\n 'video.mediaStream.registerForVideoFrame',\n [config],\n );\n }\n\n function createMonitoredVideoFrameHandler(\n videoFrameHandler: VideoFrameHandler,\n videoPerformanceMonitor?: VideoPerformanceMonitor,\n ): VideoFrameHandler {\n return async (videoFrameData: VideoFrameData): Promise<VideoFrame> => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const originalFrame = videoFrameData.videoFrame as any;\n videoPerformanceMonitor?.reportStartFrameProcessing(originalFrame.codedWidth, originalFrame.codedHeight);\n const processedFrame = await videoFrameHandler(videoFrameData);\n videoPerformanceMonitor?.reportFrameProcessed();\n return processedFrame;\n };\n }\n\n /**\n * Old video frame data structure, almost identical to the {@link VideoBufferData} except `videoFrameBuffer` is named as `data`.\n * Old host like the old Teams passes this data to the SDK. It will be deprecated in the future.\n */\n type LegacyVideoBufferData = Omit<VideoBufferData, 'videoFrameBuffer'> & {\n /**\n * Video frame buffer\n */\n data: Uint8ClampedArray;\n };\n\n function registerForVideoBuffer(videoBufferHandler: VideoBufferHandler, config: VideoFrameConfig): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported() || !doesSupportSharedFrame()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(\n getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoBufferHandler),\n 'video.newVideoFrame',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (videoBufferData: VideoBufferData | LegacyVideoBufferData) => {\n if (videoBufferData) {\n const timestamp = videoBufferData.timestamp;\n videoPerformanceMonitor?.reportStartFrameProcessing(videoBufferData.width, videoBufferData.height);\n videoBufferHandler(\n normalizeVideoBufferData(videoBufferData),\n () => {\n videoPerformanceMonitor?.reportFrameProcessed();\n notifyVideoFrameProcessed(timestamp);\n },\n notifyError,\n );\n }\n },\n false,\n );\n sendMessageToParent(\n getApiVersionTag(videoEffectsTelemetryVersionNumber, ApiName.VideoEffects_RegisterForVideoFrame),\n 'video.registerForVideoFrame',\n [config],\n );\n }\n\n function normalizeVideoBufferData(videoBufferData: VideoBufferData | LegacyVideoBufferData): VideoBufferData {\n if ('videoFrameBuffer' in videoBufferData) {\n return videoBufferData;\n } else {\n // The host may pass the VideoFrame with the old definition which has `data` instead of `videoFrameBuffer`\n const { data, ...newVideoBufferData } = videoBufferData;\n return {\n ...newVideoBufferData,\n videoFrameBuffer: data,\n };\n }\n }\n\n function doesSupportMediaStream(): boolean {\n return (\n ensureInitialized(runtime, FrameContexts.sidePanel) &&\n isTextureStreamAvailable() &&\n !!runtime.supports.video?.mediaStream\n );\n }\n\n function isTextureStreamAvailable(): boolean {\n return !!(\n ssrSafeWindow()['chrome']?.webview?.getTextureStream && ssrSafeWindow()['chrome']?.webview?.registerTextureStream\n );\n }\n\n function doesSupportSharedFrame(): boolean {\n return ensureInitialized(runtime, FrameContexts.sidePanel) && !!runtime.supports.video?.sharedFrame;\n }\n} //end of video namespace\n","import { videoEffectsEx } from '../private/videoEffectsEx';\nimport { errorNotSupportedOnPlatform } from '../public/constants';\nimport { videoEffects } from '../public/videoEffects';\nimport { sendMessageToParent } from './communication';\nimport { registerHandler } from './handlers';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from './telemetry';\nimport { inServerSideRenderingEnvironment, ssrSafeWindow } from './utils';\nimport {\n AllowSharedBufferSource,\n PlaneLayout,\n VideoFrameBufferInit,\n VideoFrameCopyToOptions,\n VideoFrameInit,\n VideoPixelFormat,\n} from './VideoFrameTypes';\nimport { VideoPerformanceMonitor } from './videoPerformanceMonitor';\n\n/**\n * @hidden\n * Align with the W3C spec: https://www.w3.org/TR/webcodecs/\n *\n * @internal\n * Limited to Microsoft-internal use\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst videoEffectsUtilTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\ninterface VideoFrame {\n /**\n * The width of the VideoFrame in pixels, potentially including non-visible padding, and prior to\n * considering potential ratio adjustments.\n */\n readonly codedWidth: number;\n /**\n * The height of the VideoFrame in pixels, potentially including non-visible padding, and prior to\n * considering potential ratio adjustments.\n */\n readonly codedHeight: number;\n /**\n * The pixel format of the VideoFrame.\n */\n readonly format: VideoPixelFormat | null;\n /**\n * An integer indicating the timestamp of the video in microseconds.\n */\n readonly timestamp: number;\n /**\n * Clears all states and releases the reference to the media resource\n */\n close(): void;\n /**\n * Copies the contents of the VideoFrame to an ArrayBuffer\n * @param destination An ArrayBuffer, a TypedArray, or a DataView to copy to.\n * @param options An object containing rect - the rectangle of pixels to copy from the VideoFrame.\n */\n copyTo(destination: AllowSharedBufferSource, options?: VideoFrameCopyToOptions): Promise<PlaneLayout[]>;\n}\n\n/**\n * @hidden\n */\n// eslint-disable-next-line strict-null-checks/all\ndeclare const VideoFrame: {\n prototype: videoEffects.VideoFrame;\n new (source: CanvasImageSource, init?: VideoFrameInit): videoEffects.VideoFrame;\n new (data: AllowSharedBufferSource, init: VideoFrameBufferInit): videoEffects.VideoFrame;\n};\n\n/**\n * @hidden\n * Create a MediaStreamTrack from the media stream with the given streamId and processed by videoFrameHandler.\n */\nexport async function processMediaStream(\n streamId: string,\n videoFrameHandler: videoEffects.VideoFrameHandler,\n notifyError: (string) => void,\n videoPerformanceMonitor?: VideoPerformanceMonitor,\n): Promise<void> {\n const generator = createProcessedStreamGeneratorWithoutSource();\n !inServerSideRenderingEnvironment() && window['chrome']?.webview?.registerTextureStream(streamId, generator);\n pipeVideoSourceToGenerator(\n await getInputVideoTrack(streamId, notifyError, videoPerformanceMonitor),\n new DefaultTransformer(notifyError, videoFrameHandler),\n generator.writable,\n );\n}\n\n/**\n * @hidden\n * Create a MediaStreamTrack from the media stream with the given streamId and processed by videoFrameHandler.\n * The videoFrameHandler will receive metadata of the video frame.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport async function processMediaStreamWithMetadata(\n streamId: string,\n videoFrameHandler: videoEffectsEx.VideoFrameHandler,\n notifyError: (string) => void,\n videoPerformanceMonitor?: VideoPerformanceMonitor,\n): Promise<void> {\n const generator = createProcessedStreamGeneratorWithoutSource();\n !inServerSideRenderingEnvironment() && window['chrome']?.webview?.registerTextureStream(streamId, generator);\n pipeVideoSourceToGenerator(\n await getInputVideoTrack(streamId, notifyError, videoPerformanceMonitor),\n new TransformerWithMetadata(notifyError, videoFrameHandler),\n generator.writable,\n );\n}\n\n/**\n * Get the video track from the media stream gotten from chrome.webview.getTextureStream(streamId).\n */\nasync function getInputVideoTrack(\n streamId: string,\n notifyError: (string) => void,\n videoPerformanceMonitor?: VideoPerformanceMonitor,\n): Promise<MediaStreamTrack> {\n if (inServerSideRenderingEnvironment()) {\n throw errorNotSupportedOnPlatform;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chrome = ssrSafeWindow()['chrome'] as any;\n try {\n videoPerformanceMonitor?.reportGettingTextureStream(streamId);\n const mediaStream = await chrome.webview.getTextureStream(streamId);\n const tracks = mediaStream.getVideoTracks();\n if (tracks.length === 0) {\n throw new Error(`No video track in stream ${streamId}`);\n }\n videoPerformanceMonitor?.reportTextureStreamAcquired();\n return tracks[0];\n } catch (error) {\n const errorMsg = `Failed to get video track from stream ${streamId}, error: ${error}`;\n notifyError(errorMsg);\n throw new Error(`Internal error: can't get video track from stream ${streamId}`);\n }\n}\n\n/**\n * The function to create a MediaStreamTrack generator.\n * The generator can then get the processed frames as media stream source.\n * The generator can be registered back to the media stream so that the host can get the processed frames.\n */\nfunction createProcessedStreamGeneratorWithoutSource(): MediaStreamTrack & { writable: WritableStream } {\n if (inServerSideRenderingEnvironment()) {\n throw errorNotSupportedOnPlatform;\n }\n const MediaStreamTrackGenerator = window['MediaStreamTrackGenerator'];\n if (!MediaStreamTrackGenerator) {\n throw errorNotSupportedOnPlatform;\n }\n return new MediaStreamTrackGenerator({ kind: 'video' });\n}\n\n/**\n * The function to create a processed video track from the original video track.\n * It reads frames from the video track and pipes them to the video frame callback to process the frames.\n * The processed frames are then enqueued to the generator.\n */\nfunction pipeVideoSourceToGenerator(\n videoTrack: unknown,\n transformer: TransformerWithMetadata | DefaultTransformer,\n sink: WritableStream,\n): void {\n const MediaStreamTrackProcessor = ssrSafeWindow()['MediaStreamTrackProcessor'];\n const processor = new MediaStreamTrackProcessor({ track: videoTrack });\n const source = processor.readable;\n\n source.pipeThrough(new TransformStream(transformer)).pipeTo(sink);\n}\n\n/**\n * @hidden\n * Error messages during video frame transformation.\n */\nconst enum VideoFrameTransformErrors {\n TimestampIsNull = 'timestamp of the original video frame is null',\n UnsupportedVideoFramePixelFormat = 'Unsupported video frame pixel format',\n}\n\nclass DefaultTransformer {\n public constructor(\n private notifyError: (string) => void,\n private videoFrameHandler: videoEffects.VideoFrameHandler,\n ) {}\n\n public transform = async (originalFrame, controller): Promise<void> => {\n const timestamp = originalFrame.timestamp;\n if (timestamp !== null) {\n try {\n const frameProcessedByApp = await this.videoFrameHandler({ videoFrame: originalFrame });\n // the current typescript version(4.6.4) dosn't support webcodecs API fully, we have to do type conversion here.\n const processedFrame = new VideoFrame(frameProcessedByApp as unknown as CanvasImageSource, {\n // we need the timestamp to be unchanged from the oirginal frame, so we explicitly set it here.\n timestamp: timestamp,\n });\n controller.enqueue(processedFrame);\n originalFrame.close();\n (frameProcessedByApp as VideoFrame).close();\n } catch (error) {\n originalFrame.close();\n this.notifyError(error);\n }\n } else {\n this.notifyError(VideoFrameTransformErrors.TimestampIsNull);\n }\n };\n}\n\n/**\n * @hidden\n * Utility class to parse the header of a one-texture-input texture.\n */\nclass OneTextureHeader {\n private readonly headerDataView: Uint32Array;\n // Identifier for the texture layout, which is the 4-byte ASCII string \"oti1\" hardcoded by the host\n // (oti1 stands for \"one texture input version 1\")\n private readonly ONE_TEXTURE_INPUT_ID = 0x6f746931;\n private readonly INVALID_HEADER_ERROR = 'Invalid video frame header';\n private readonly UNSUPPORTED_LAYOUT_ERROR = 'Unsupported texture layout';\n public constructor(\n private readonly headerBuffer: ArrayBuffer,\n private readonly notifyError: (string) => void,\n ) {\n this.headerDataView = new Uint32Array(headerBuffer);\n // headerDataView will contain the following data:\n // 0: oneTextureLayoutId\n // 1: version\n // 2: frameRowOffset\n // 3: frameFormat\n // 4: frameWidth\n // 5: frameHeight\n // 6: multiStreamHeaderRowOffset\n // 7: multiStreamCount\n if (this.headerDataView.length < 8) {\n this.notifyError(this.INVALID_HEADER_ERROR);\n throw new Error(this.INVALID_HEADER_ERROR);\n }\n // ensure the texture layout is supported\n if (this.headerDataView[0] !== this.ONE_TEXTURE_INPUT_ID) {\n this.notifyError(this.UNSUPPORTED_LAYOUT_ERROR);\n throw new Error(this.UNSUPPORTED_LAYOUT_ERROR);\n }\n }\n\n public get oneTextureLayoutId(): number {\n return this.headerDataView[0];\n }\n\n public get version(): number {\n return this.headerDataView[1];\n }\n\n public get frameRowOffset(): number {\n return this.headerDataView[2];\n }\n\n public get frameFormat(): number {\n return this.headerDataView[3];\n }\n\n public get frameWidth(): number {\n return this.headerDataView[4];\n }\n\n public get frameHeight(): number {\n return this.headerDataView[5];\n }\n\n public get multiStreamHeaderRowOffset(): number {\n return this.headerDataView[6];\n }\n\n public get multiStreamCount(): number {\n return this.headerDataView[7];\n }\n}\n\n/**\n * @hidden\n * Utility class to parse the metadata of a one-texture-input texture.\n */\nclass OneTextureMetadata {\n private readonly metadataMap: Map<number, Uint8Array> = new Map();\n // Stream id for audio inference metadata, which is the 4-byte ASCII string \"1dia\" hardcoded by the host\n // (1dia stands for \"audio inference data version 1\")\n private readonly AUDIO_INFERENCE_RESULT_STREAM_ID = 0x31646961;\n private readonly ATTRIBUTE_ID_MAP_STREAM_ID = 0x4d444941;\n public constructor(metadataBuffer: ArrayBuffer, streamCount: number) {\n const metadataDataView = new Uint32Array(metadataBuffer);\n for (let i = 0, index = 0; i < streamCount; i++) {\n const streamId = metadataDataView[index++];\n const streamDataOffset = metadataDataView[index++];\n const streamDataSize = metadataDataView[index++];\n const streamData = new Uint8Array(metadataBuffer, streamDataOffset, streamDataSize);\n this.metadataMap.set(streamId, streamData);\n }\n }\n\n public get audioInferenceResult(): Uint8Array | undefined {\n return this.metadataMap.get(this.AUDIO_INFERENCE_RESULT_STREAM_ID);\n }\n\n /**\n * @hidden\n * Additional attributes on the video frame are string-indexed, with their stream Id dynamically generated.\n * The mapping of attribute Ids to their stream Ids is itself stored as frame metadata with layout:\n *\n * | attribute count | attribute stream Id | attribute id | ... |\n * | :---: | :---: | :---: | :---: |\n * | 4 bytes | 4 bytes | variable length string (null terminated, 4 byte aligned) | ... |\n *\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n public get attributes(): ReadonlyMap<string, Uint8Array> | undefined {\n const data = this.metadataMap.get(this.ATTRIBUTE_ID_MAP_STREAM_ID);\n if (data === undefined) {\n return undefined;\n }\n\n const map: Map<string, Uint8Array> = new Map();\n const textDecoder = new TextDecoder('utf-8');\n\n let offset = 0;\n const count = data[offset] + (data[++offset] << 8) + (data[++offset] << 16) + (data[++offset] << 24);\n\n for (let i = 0; i < count && offset < data.length - 1; i++) {\n const streamId = data[++offset] + (data[++offset] << 8) + (data[++offset] << 16) + (data[++offset] << 24);\n\n // Find start of null-terminator for the subsequent variable-length string entry\n const nullTerminatorStartIndex = data.findIndex((value, index, _) => {\n return value == 0 && index > offset;\n });\n\n const attributeId = textDecoder.decode(data.slice(++offset, nullTerminatorStartIndex));\n\n // Read attribute value from metadata map\n const metadata = this.metadataMap.get(streamId);\n if (metadata !== undefined) {\n map.set(attributeId, metadata);\n }\n\n // Variable length attribute Id strings are null-terminated to a 4-byte alignment\n const stringByteLength = nullTerminatorStartIndex - offset;\n const paddingSize = 4 - (stringByteLength % 4);\n\n // Set offset to index of last trailing zero\n offset = nullTerminatorStartIndex + (paddingSize - 1);\n }\n\n return map;\n }\n}\n\nclass TransformerWithMetadata {\n private shouldDiscardAudioInferenceResult = false;\n\n public constructor(\n private notifyError: (string) => void,\n private videoFrameHandler: videoEffectsEx.VideoFrameHandler,\n ) {\n registerHandler(\n getApiVersionTag(\n videoEffectsUtilTelemetryVersionNumber,\n ApiName.VideoEffectsUtils_TransformerWithMetadata_Constructor,\n ),\n 'video.mediaStream.audioInferenceDiscardStatusChange',\n ({ discardAudioInferenceResult }: { discardAudioInferenceResult: boolean }) => {\n this.shouldDiscardAudioInferenceResult = discardAudioInferenceResult;\n },\n );\n }\n\n public transform = async (originalFrame, controller): Promise<void> => {\n const timestamp = originalFrame.timestamp;\n if (timestamp !== null) {\n try {\n const { videoFrame, metadata: { audioInferenceResult, attributes } = {} } =\n await this.extractVideoFrameAndMetadata(originalFrame);\n const frameProcessedByApp = await this.videoFrameHandler({ videoFrame, audioInferenceResult, attributes });\n // the current typescript version(4.6.4) dosn't support webcodecs API fully, we have to do type conversion here.\n const processedFrame = new VideoFrame(frameProcessedByApp as unknown as CanvasImageSource, {\n // we need the timestamp to be unchanged from the oirginal frame, so we explicitly set it here.\n timestamp: timestamp,\n });\n controller.enqueue(processedFrame);\n videoFrame.close();\n originalFrame.close();\n (frameProcessedByApp as VideoFrame).close();\n } catch (error) {\n originalFrame.close();\n this.notifyError(error);\n }\n } else {\n this.notifyError(VideoFrameTransformErrors.TimestampIsNull);\n }\n };\n\n /**\n * @hidden\n * Extract video frame and metadata from the given texture.\n * The given texure should be in NV12 format and the layout of the texture should be:\n * | Texture layout |\n * | :--- |\n * | Header |\n * | Real video frame data |\n * | Metadata |\n *\n * The header data is in the first two rows with the following format:\n * | oneTextureLayoutId | version | frameRowOffset | frameFormat | frameWidth | frameHeight | multiStreamHeaderRowOffset | multiStreamCount | ... |\n * | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n * | 4 bytes | 4 bytes | 4 bytes | 4 bytes | 4 bytes | 4 bytes | 4 bytes | 4 bytes | ... |\n *\n * After header, it comes with the real video frame data.\n * At the end of the texture, it comes with the metadata. The metadata section can contain multiple types of metadata.\n * Each type of metadata is called a stream. The section is in the following format:\n * | stream1.id | stream1.dataOffset | stream1.dataSize | stream2.id | stream2.dataOffset | stream2.dataSize | ... | stream1.data | stream2.data | ... |\n * | :---: | :---: | :---: | :---: | :---: | :---: |:---:| :---: | :---: |:---:|\n * | 4 bytes | 4 bytes | 4 bytes | 4 bytes | 4 bytes | 4 bytes | ... | ... | ... | ... |\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n private extractVideoFrameAndMetadata = async (\n texture: VideoFrame,\n ): Promise<{\n videoFrame: VideoFrame;\n metadata: { audioInferenceResult?: Uint8Array; attributes?: ReadonlyMap<string, Uint8Array> };\n }> => {\n if (inServerSideRenderingEnvironment()) {\n throw errorNotSupportedOnPlatform;\n }\n if (texture.format !== 'NV12') {\n this.notifyError(VideoFrameTransformErrors.UnsupportedVideoFramePixelFormat);\n throw new Error(VideoFrameTransformErrors.UnsupportedVideoFramePixelFormat);\n }\n\n // The rectangle of pixels to copy from the texture. The first two rows are the header.\n const headerRect = { x: 0, y: 0, width: texture.codedWidth, height: 2 };\n // allocate buffer for the header\n // The texture is in NV12 format (https://learn.microsoft.com/windows/win32/medfound/recommended-8-bit-yuv-formats-for-video-rendering#nv12).\n // NV12 has one luma \"luminance\" plane Y and one UV plane with U and V values interleaved.\n // In NV12, chroma planes (blue and red) are subsampled in both the horizontal and vertical dimensions by a factor of 2.\n // So for a 2×2 group of pixels, you have 4 Y samples and 1 U and 1 V sample, each sample being 1 byte.\n // for a 10×10 NV12 frame: there are 100 Y samples followed by 25 U and 25 V samples interleaved.\n // The graphical representation of the memory layout of a 2×2 NV12 frame is as follows:\n // | Y0 | Y1 | Y2 | Y3 | U0 | V0 |\n // The number of pixels of the header is (headerRect.width * headerRect.height), so the number of bytes of the header is\n // (the size of the Y plane + the size of the UV plane)\n // which is (headerRect.width * headerRect.height) + (headerRect.width * headerRect.height) / 2\n // = (headerRect.width * headerRect.height * 3) / 2\n const headerBuffer = new ArrayBuffer((headerRect.width * headerRect.height * 3) / 2);\n await texture.copyTo(headerBuffer, { rect: headerRect });\n const header = new OneTextureHeader(headerBuffer, this.notifyError);\n\n // The rectangle of pixels to copy from the texture. Metadata are at the bottom.\n const metadataRect = {\n x: 0,\n y: header.multiStreamHeaderRowOffset,\n width: texture.codedWidth,\n height: texture.codedHeight - header.multiStreamHeaderRowOffset,\n };\n // Allocate buffer for the metadata. The number of pixels of the metadata section is\n // (metadataRect.width * metadataRect.height), so the number of bytes of the metadata section is\n // (the size of the Y plane + the size of the UV plane), which is\n // (metadataRect.width * metadataRect.height) + (metadataRect.width * metadataRect.height) / 2\n // = (metadataRect.width * metadataRect.height * 3) / 2\n const metadataBuffer = new ArrayBuffer((metadataRect.width * metadataRect.height * 3) / 2);\n await texture.copyTo(metadataBuffer, { rect: metadataRect });\n const metadata = new OneTextureMetadata(metadataBuffer, header.multiStreamCount);\n return {\n videoFrame: new VideoFrame(texture as unknown as CanvasImageSource, {\n timestamp: texture.timestamp,\n visibleRect: {\n x: 0,\n y: header.frameRowOffset,\n width: header.frameWidth,\n height: header.frameHeight,\n },\n }) as VideoFrame,\n metadata: {\n audioInferenceResult: this.shouldDiscardAudioInferenceResult ? undefined : metadata.audioInferenceResult,\n attributes: metadata.attributes,\n },\n };\n };\n}\n\n/**\n * @hidden\n * Video effect change call back function definition\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\ntype VideoEffectCallBack = (effectId: string | undefined, effectParam?: string) => Promise<void>;\n\n/**\n * @hidden\n */\nexport function createEffectParameterChangeCallback(\n callback: VideoEffectCallBack,\n videoPerformanceMonitor?: VideoPerformanceMonitor,\n) {\n return (effectId: string | undefined, effectParam?: string): void => {\n videoPerformanceMonitor?.reportApplyingVideoEffect(effectId || '', effectParam);\n\n callback(effectId, effectParam)\n .then(() => {\n videoPerformanceMonitor?.reportVideoEffectChanged(effectId || '', effectParam);\n sendMessageToParent(\n getApiVersionTag(videoEffectsUtilTelemetryVersionNumber, ApiName.VideoEffectsUtils_ReportVideoEffectChanged),\n 'video.videoEffectReadiness',\n [true, effectId, undefined, effectParam],\n );\n })\n .catch((reason) => {\n const validReason =\n reason in videoEffects.EffectFailureReason ? reason : videoEffects.EffectFailureReason.InitializationFailure;\n sendMessageToParent(\n getApiVersionTag(videoEffectsUtilTelemetryVersionNumber, ApiName.VideoEffectsUtils_EffectFailure),\n 'video.videoEffectReadiness',\n [false, effectId, validReason, effectParam],\n );\n });\n };\n}\n\nexport { VideoEffectCallBack as DefaultVideoEffectCallBack };\n","import { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { inServerSideRenderingEnvironment } from '../internal/utils';\nimport {\n createEffectParameterChangeCallback,\n DefaultVideoEffectCallBack as VideoEffectCallBack,\n processMediaStream,\n processMediaStreamWithMetadata,\n} from '../internal/videoEffectsUtils';\nimport { VideoPerformanceMonitor } from '../internal/videoPerformanceMonitor';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\nimport { videoEffects } from '../public/videoEffects';\n\n/**\n * @hidden\n * Extended video API\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst videoEffectsExTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\nexport namespace videoEffectsEx {\n export const frameProcessingTimeoutInMs = 2000;\n\n const videoPerformanceMonitor = inServerSideRenderingEnvironment()\n ? undefined\n : new VideoPerformanceMonitor(sendMessageToParent);\n /**\n * @hidden\n * Error level when notifying errors to the host, the host will decide what to do acording to the error level.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export enum ErrorLevel {\n Fatal = 'fatal',\n Warn = 'warn',\n }\n /**\n * @hidden\n * Video frame configuration supplied to the host to customize the generated video frame parameters\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface VideoFrameConfig extends videoEffects.VideoFrameConfig {\n /**\n * @hidden\n * Flag to indicate use camera stream to synthesize video frame or not.\n * Default value is true.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n requireCameraStream?: boolean;\n /**\n * @hidden\n * Machine learning model to run in the host to do audio inference for you\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n audioInferenceModel?: ArrayBuffer;\n /**\n * @hidden\n * Specifies additional capabilities that should be applied to the video frame\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n requiredCapabilities?: string[];\n }\n\n /**\n * @hidden\n * Represents a video frame\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface VideoBufferData extends videoEffects.VideoBufferData {\n /**\n * @hidden\n * The model output if you passed in an {@linkcode VideoFrameConfig.audioInferenceModel}\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n audioInferenceResult?: Uint8Array;\n }\n\n /**\n * Old video frame data structure, almost identical to the {@link VideoBufferData} except `videoFrameBuffer` is named as `data`.\n * Old host like the old Teams passes this data to the SDK. It will be deprecated in the future.\n */\n type LegacyVideoBufferData = Omit<VideoBufferData, 'videoFrameBuffer'> & {\n /**\n * Video frame buffer\n */\n data: Uint8ClampedArray;\n };\n\n /**\n * @hidden\n * The callback will be called on every frame when running on the supported host.\n * We require the frame rate of the video to be at least 22fps for 720p, thus the callback should process a frame timely.\n * The video app should call `notifyVideoFrameProcessed` to notify a successfully processed video frame.\n * The video app should call `notifyError` to notify a failure. When the failures accumulate to a certain number(determined by the host), the host will see the app is \"frozen\" and give the user the option to close the app.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type VideoBufferHandler = (\n videoBufferData: VideoBufferData,\n notifyVideoFrameProcessed: () => void,\n notifyError: (errorMessage: string) => void,\n ) => void;\n\n /**\n * @hidden\n * Video frame data extracted from the media stream. More properties may be added in the future.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type VideoFrameData = videoEffects.VideoFrameData & {\n /**\n * @hidden\n * The model output if you passed in an {@linkcode VideoFrameConfig.audioInferenceModel}\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n audioInferenceResult?: Uint8Array;\n /**\n * @hidden\n * Additional metadata determined by capabilities specified in {@linkcode VideoFrameConfig.requiredCapabilities}\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n attributes?: ReadonlyMap<string, Uint8Array>;\n };\n\n /**\n * @hidden\n * The callback will be called on every frame when running on the supported host.\n * We require the frame rate of the video to be at least 22fps for 720p, thus the callback should process a frame timely.\n * The video app should resolve the promise to notify a successfully processed video frame.\n * The video app should reject the promise to notify a failure. When the failures accumulate to a certain number(determined by the host), the host will see the app is \"frozen\" and give the user the option to close the app.\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export type VideoFrameHandler = (receivedVideoFrame: VideoFrameData) => Promise<videoEffects.VideoFrame>;\n\n /**\n * @hidden\n * @beta\n * Callbacks and configuration supplied to the host to process the video frames.\n * @internal\n * Limited to Microsoft-internal use\n */\n export type RegisterForVideoFrameParameters = {\n /**\n * Callback function to process the video frames extracted from a media stream.\n */\n videoFrameHandler: VideoFrameHandler;\n /**\n * Callback function to process the video frames shared by the host.\n */\n videoBufferHandler: VideoBufferHandler;\n /**\n * Video frame configuration supplied to the host to customize the generated video frame parameters, like format\n */\n config: VideoFrameConfig;\n };\n\n /**\n * @hidden\n * Register to process video frames\n * @beta\n *\n * @param parameters - Callbacks and configuration to process the video frames. A host may support either {@link VideoFrameHandler} or {@link VideoBufferHandler}, but not both.\n * To ensure the video effect works on all supported hosts, the video app must provide both {@link VideoFrameHandler} and {@link VideoBufferHandler}.\n * The host will choose the appropriate callback based on the host's capability.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerForVideoFrame(parameters: RegisterForVideoFrameParameters): void {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!parameters.videoFrameHandler || !parameters.videoBufferHandler) {\n throw new Error('Both videoFrameHandler and videoBufferHandler must be provided');\n }\n\n if (ensureInitialized(runtime, FrameContexts.sidePanel)) {\n registerHandler(\n getApiVersionTag(\n videoEffectsExTelemetryVersionNumber,\n ApiName.VideoEffectsEx_RegisterSetFrameProcessTimeLimitHandler,\n ),\n 'video.setFrameProcessTimeLimit',\n (timeLimit: number) => videoPerformanceMonitor?.setFrameProcessTimeLimit(timeLimit),\n false,\n );\n if (runtime.supports.video?.mediaStream) {\n registerHandler(\n getApiVersionTag(\n videoEffectsExTelemetryVersionNumber,\n ApiName.VideoEffectsEx_RegisterStartVideoExtensibilityVideoStreamHandler,\n ),\n 'video.startVideoExtensibilityVideoStream',\n async (mediaStreamInfo: { streamId: string; metadataInTexture?: boolean }) => {\n const { streamId, metadataInTexture } = mediaStreamInfo;\n const handler = videoPerformanceMonitor\n ? createMonitoredVideoFrameHandler(parameters.videoFrameHandler, videoPerformanceMonitor)\n : parameters.videoFrameHandler;\n metadataInTexture\n ? await processMediaStreamWithMetadata(streamId, handler, notifyError, videoPerformanceMonitor)\n : await processMediaStream(streamId, handler, notifyError, videoPerformanceMonitor);\n },\n false,\n );\n sendMessageToParent(\n getApiVersionTag(\n videoEffectsExTelemetryVersionNumber,\n ApiName.VideoEffectsEx_MediaStream_RegisterForVideoFrame,\n ),\n 'video.mediaStream.registerForVideoFrame',\n [parameters.config],\n );\n } else if (runtime.supports.video?.sharedFrame) {\n registerHandler(\n getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterNewVideoFrameHandler),\n 'video.newVideoFrame',\n (videoBufferData: VideoBufferData | LegacyVideoBufferData) => {\n if (videoBufferData) {\n videoPerformanceMonitor?.reportStartFrameProcessing(videoBufferData.width, videoBufferData.height);\n const clearProcessingTimeout = createFrameProcessingTimeout();\n const timestamp = videoBufferData.timestamp;\n parameters.videoBufferHandler(\n normalizedVideoBufferData(videoBufferData),\n () => {\n clearProcessingTimeout();\n videoPerformanceMonitor?.reportFrameProcessed();\n notifyVideoFrameProcessed(timestamp);\n },\n notifyError,\n );\n }\n },\n false,\n );\n sendMessageToParent(\n getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterForVideoFrame),\n 'video.registerForVideoFrame',\n [parameters.config],\n );\n } else {\n // should not happen if isSupported() is true\n throw errorNotSupportedOnPlatform;\n }\n videoPerformanceMonitor?.startMonitorSlowFrameProcessing();\n }\n }\n\n function createFrameProcessingTimeout(): () => void {\n const frameProcessingTimer = setTimeout(() => {\n notifyError(`Frame not processed in ${frameProcessingTimeoutInMs}ms`, ErrorLevel.Warn);\n }, frameProcessingTimeoutInMs);\n\n return function clearTimer() {\n clearTimeout(frameProcessingTimer);\n };\n }\n\n function createMonitoredVideoFrameHandler(\n videoFrameHandler: VideoFrameHandler,\n videoPerformanceMonitor: VideoPerformanceMonitor,\n ): VideoFrameHandler {\n return async (receivedVideoFrame: VideoFrameData): Promise<videoEffects.VideoFrame> => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const originalFrame = receivedVideoFrame.videoFrame as any;\n videoPerformanceMonitor.reportStartFrameProcessing(originalFrame.codedWidth, originalFrame.codedHeight);\n const clearProcessingTimeout = createFrameProcessingTimeout();\n const processedFrame = await videoFrameHandler(receivedVideoFrame);\n clearProcessingTimeout();\n videoPerformanceMonitor.reportFrameProcessed();\n return processedFrame;\n };\n }\n\n function normalizedVideoBufferData(videoBufferData: VideoBufferData | LegacyVideoBufferData): VideoBufferData {\n videoBufferData['videoFrameBuffer'] = videoBufferData['videoFrameBuffer'] || videoBufferData['data'];\n delete videoBufferData['data'];\n return videoBufferData as VideoBufferData;\n }\n\n /**\n * @hidden\n * Video extension should call this to notify host that the current selected effect parameter changed.\n * If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.\n * If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.\n * @beta\n * @param effectChangeType - the effect change type.\n * @param effectId - Newly selected effect id. {@linkcode VideoEffectCallBack}\n * @param effectParam Variant for the newly selected effect. {@linkcode VideoEffectCallBack}\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function notifySelectedVideoEffectChanged(\n effectChangeType: videoEffects.EffectChangeType,\n effectId: string | undefined,\n effectParam?: string,\n ): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifySelectedVideoEffectChanged),\n 'video.videoEffectChanged',\n [effectChangeType, effectId, effectParam],\n );\n }\n\n /**\n * @hidden\n * Register the video effect callback, host uses this to notify the video extension the new video effect will by applied\n * @beta\n * @param callback - The VideoEffectCallback to invoke when registerForVideoEffect has completed\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function registerForVideoEffect(callback: VideoEffectCallBack): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(\n getApiVersionTag(\n videoEffectsExTelemetryVersionNumber,\n ApiName.VideoEffectsEx_RegisterEffectParameterChangeHandler,\n ),\n 'video.effectParameterChange',\n createEffectParameterChangeCallback(callback, videoPerformanceMonitor),\n false,\n );\n sendMessageToParent(\n getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_RegisterForVideoEffect),\n 'video.registerForVideoEffect',\n );\n }\n\n /**\n * @hidden\n * Personalized video effect\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface PersonalizedEffect {\n /**\n * Personalized effect id\n */\n id: string;\n /**\n * Display name\n */\n name: string;\n /**\n * Effect type defined by app\n */\n type: string;\n /**\n * Data URI of the thumbnail image content encoded in ASCII format using the base64 scheme\n */\n thumbnail: string;\n }\n\n /**\n * @hidden\n * Send personalized effects to Teams client\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function updatePersonalizedEffects(effects: PersonalizedEffect[]): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (!videoEffects.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_UpdatePersonalizedEffects),\n 'video.personalizedEffectsChanged',\n [effects],\n );\n }\n\n /**\n * @hidden\n *\n * Checks if video capability is supported by the host\n * @beta\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @returns boolean to represent whether the video capability is supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function isSupported(): boolean {\n ensureInitialized(runtime);\n return videoEffects.isSupported();\n }\n\n /**\n * @hidden\n * Sending notification to host finished the video frame processing, now host can render this video frame\n * or pass the video frame to next one in video pipeline\n * @beta\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n function notifyVideoFrameProcessed(timestamp?: number): void {\n sendMessageToParent(\n getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifyVideoFrameProcessed),\n 'video.videoFrameProcessed',\n [timestamp],\n );\n }\n\n /**\n * @hidden\n * Sending error notification to host\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n * @param errorLevel - The error level that will be sent to the host\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n function notifyError(errorMessage: string, errorLevel: ErrorLevel = ErrorLevel.Warn): void {\n sendMessageToParent(\n getApiVersionTag(videoEffectsExTelemetryVersionNumber, ApiName.VideoEffectsEx_NotifyError),\n 'video.notifyError',\n [errorMessage, errorLevel],\n );\n }\n\n /**\n * @hidden\n * Sending fatal error notification to host. Call this function only when your app meets fatal error and can't continue.\n * The host will stop the video pipeline and terminate this session, and optionally, show an error message to the user.\n * @beta\n * @param errorMessage - The error message that will be sent to the host\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function notifyFatalError(errorMessage: string): void {\n ensureInitialized(runtime);\n if (!videoEffects.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n notifyError(errorMessage, ErrorLevel.Fatal);\n }\n}\n","/**\n * This function can be used to validate if a string is a \"valid\" app id.\n * Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:\n * https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id\n * However, there are some older internal/hard-coded apps which violate this schema and use names like com.microsoft.teamspace.tab.youtube.\n * For compatibility with these legacy apps, we unfortunately cannot securely and completely validate app ids as UUIDs. Based\n * on this, the validation is limited to checking for script tags, length, and non-printable characters.\n *\n * @param potentialAppId A string to check if it's a \"valid\" app id\n * @throws Error with a message describing the exact validation violation\n */\nexport function validateStringAsAppId(potentialAppId: string): void {\n if (doesStringContainScriptTags(potentialAppId)) {\n throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains script tags.`);\n }\n\n if (!isStringWithinAppIdLengthLimits(potentialAppId)) {\n throw new Error(\n `Potential app id (${potentialAppId}) is invalid; its length ${potentialAppId.length} is not within the length limits (${minimumValidAppIdLength}-${maximumValidAppIdLength}).`,\n );\n }\n\n if (doesStringContainNonPrintableCharacters(potentialAppId)) {\n throw new Error(`Potential app id (${potentialAppId}) is invalid; it contains non-printable characters.`);\n }\n}\n\nexport function doesStringContainScriptTags(str: string): boolean {\n const scriptRegex = /<script[^>]*>[\\s\\S]*?<\\/script[^>]*>/gi;\n return scriptRegex.test(str);\n}\n\nexport const minimumValidAppIdLength = 4;\nexport const maximumValidAppIdLength = 256;\n\nexport function isStringWithinAppIdLengthLimits(potentialAppId: string): boolean {\n return potentialAppId.length < maximumValidAppIdLength && potentialAppId.length > minimumValidAppIdLength;\n}\n\nexport function doesStringContainNonPrintableCharacters(str: string): boolean {\n return [...str].some((char) => {\n const charCode = char.charCodeAt(0);\n return charCode < 32 || charCode > 126;\n });\n}\n","import { validateStringAsAppId } from '../internal/appIdValidation';\n\n/**\n * A strongly-typed class used to represent a \"valid\" app id.\n *\n * Valid is a relative term, in this case. Truly valid app ids are UUIDs as documented in the schema:\n * https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#id\n * However, there are some older internal/hard-coded apps which violate this schema and use names like\n * com.microsoft.teamspace.tab.youtube. For compatibility with these legacy apps, we unfortunately cannot\n * securely and completely validate app ids as UUIDs. Based on this, the validation is limited to checking\n * for script tags, length, and non-printable characters.\n */\nexport class AppId {\n /**\n * Creates a strongly-typed AppId from a string\n *\n * @param appIdAsString An app id represented as a string\n * @throws Error with a message describing the exact validation violation\n */\n public constructor(private readonly appIdAsString: string) {\n validateStringAsAppId(appIdAsString);\n }\n\n /**\n * Returns the app id as a string\n */\n public toString(): string {\n return this.appIdAsString;\n }\n}\n","/**\n * App install dialog constants\n */\nexport const teamsDeepLinkUrlPathForAppInstall = '/l/app/';\n\n/**\n * Calendar constants\n */\nexport const teamsDeepLinkUrlPathForCalendar = '/l/meeting/new';\nexport const teamsDeepLinkAttendeesUrlParameterName = 'attendees';\nexport const teamsDeepLinkStartTimeUrlParameterName = 'startTime';\nexport const teamsDeepLinkEndTimeUrlParameterName = 'endTime';\nexport const teamsDeepLinkSubjectUrlParameterName = 'subject';\nexport const teamsDeepLinkContentUrlParameterName = 'content';\n\n/**\n * Call constants\n */\nexport const teamsDeepLinkUrlPathForCall = '/l/call/0/0';\nexport const teamsDeepLinkSourceUrlParameterName = 'source';\nexport const teamsDeepLinkWithVideoUrlParameterName = 'withVideo';\n\n/**\n * Chat constants\n */\nexport const teamsDeepLinkUrlPathForChat = '/l/chat/0/0';\nexport const teamsDeepLinkUsersUrlParameterName = 'users';\nexport const teamsDeepLinkTopicUrlParameterName = 'topicName';\nexport const teamsDeepLinkMessageUrlParameterName = 'message';\n","import { teamsDeepLinkHost, teamsDeepLinkProtocol } from './constants';\nimport {\n teamsDeepLinkAttendeesUrlParameterName,\n teamsDeepLinkContentUrlParameterName,\n teamsDeepLinkEndTimeUrlParameterName,\n teamsDeepLinkMessageUrlParameterName,\n teamsDeepLinkSourceUrlParameterName,\n teamsDeepLinkStartTimeUrlParameterName,\n teamsDeepLinkSubjectUrlParameterName,\n teamsDeepLinkTopicUrlParameterName,\n teamsDeepLinkUrlPathForAppInstall,\n teamsDeepLinkUrlPathForCalendar,\n teamsDeepLinkUrlPathForCall,\n teamsDeepLinkUrlPathForChat,\n teamsDeepLinkUsersUrlParameterName,\n teamsDeepLinkWithVideoUrlParameterName,\n} from './deepLinkConstants';\n\nexport function createTeamsDeepLinkForChat(users: string[], topic?: string, message?: string): string {\n if (users.length === 0) {\n throw new Error('Must have at least one user when creating a chat deep link');\n }\n\n const usersSearchParameter =\n `${teamsDeepLinkUsersUrlParameterName}=` + users.map((user) => encodeURIComponent(user)).join(',');\n const topicSearchParameter =\n topic === undefined ? '' : `&${teamsDeepLinkTopicUrlParameterName}=${encodeURIComponent(topic)}`;\n const messageSearchParameter =\n message === undefined ? '' : `&${teamsDeepLinkMessageUrlParameterName}=${encodeURIComponent(message)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForChat}?${usersSearchParameter}${topicSearchParameter}${messageSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForCall(targets: string[], withVideo?: boolean, source?: string): string {\n if (targets.length === 0) {\n throw new Error('Must have at least one target when creating a call deep link');\n }\n const usersSearchParameter =\n `${teamsDeepLinkUsersUrlParameterName}=` + targets.map((user) => encodeURIComponent(user)).join(',');\n const withVideoSearchParameter =\n withVideo === undefined ? '' : `&${teamsDeepLinkWithVideoUrlParameterName}=${encodeURIComponent(withVideo)}`;\n const sourceSearchParameter =\n source === undefined ? '' : `&${teamsDeepLinkSourceUrlParameterName}=${encodeURIComponent(source)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForCall}?${usersSearchParameter}${withVideoSearchParameter}${sourceSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForCalendar(\n attendees?: string[],\n startTime?: string,\n endTime?: string,\n subject?: string,\n content?: string,\n): string {\n const attendeeSearchParameter =\n attendees === undefined\n ? ''\n : `${teamsDeepLinkAttendeesUrlParameterName}=` +\n attendees.map((attendee) => encodeURIComponent(attendee)).join(',');\n const startTimeSearchParameter =\n startTime === undefined ? '' : `&${teamsDeepLinkStartTimeUrlParameterName}=${encodeURIComponent(startTime)}`;\n const endTimeSearchParameter =\n endTime === undefined ? '' : `&${teamsDeepLinkEndTimeUrlParameterName}=${encodeURIComponent(endTime)}`;\n const subjectSearchParameter =\n subject === undefined ? '' : `&${teamsDeepLinkSubjectUrlParameterName}=${encodeURIComponent(subject)}`;\n const contentSearchParameter =\n content === undefined ? '' : `&${teamsDeepLinkContentUrlParameterName}=${encodeURIComponent(content)}`;\n\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForCalendar}?${attendeeSearchParameter}${startTimeSearchParameter}${endTimeSearchParameter}${subjectSearchParameter}${contentSearchParameter}`;\n}\n\nexport function createTeamsDeepLinkForAppInstallDialog(appId: string): string {\n if (!appId) {\n throw new Error('App ID must be set when creating an app install dialog deep link');\n }\n return `${teamsDeepLinkProtocol}://${teamsDeepLinkHost}${teamsDeepLinkUrlPathForAppInstall}${encodeURIComponent(\n appId,\n )}`;\n}\n","import { sendAndHandleStatusAndReason, sendMessageToParent } from '../internal/communication';\nimport { createTeamsDeepLinkForAppInstallDialog } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst appInstallDialogTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport namespace appInstallDialog {\n /** Represents set of parameters needed to open the appInstallDialog. */\n export interface OpenAppInstallDialogParams {\n /** A unique identifier for the app being installed. */\n appId: string;\n }\n\n /**\n * Displays a dialog box that allows users to install a specific app within the host environment.\n *\n * @param openAPPInstallDialogParams - See {@link OpenAppInstallDialogParams | OpenAppInstallDialogParams} for more information.\n */\n export function openAppInstallDialog(openAPPInstallDialogParams: OpenAppInstallDialogParams): Promise<void> {\n return new Promise((resolve) => {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n const apiVersionTag = getApiVersionTag(\n appInstallDialogTelemetryVersionNumber,\n ApiName.AppInstallDialog_OpenAppInstallDialog,\n );\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleStatusAndReason(\n apiVersionTag,\n 'executeDeepLink',\n createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId),\n ),\n );\n } else {\n sendMessageToParent(apiVersionTag, 'appInstallDialog.openAppInstallDialog', [openAPPInstallDialogParams]);\n resolve();\n }\n });\n }\n\n /**\n * Checks if the appInstallDialog capability is supported by the host\n * @returns boolean to represent whether the appInstallDialog capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-member-accessibility */\n\nimport { sendAndHandleSdkError, sendMessageToParent } from '../internal/communication';\nimport {\n captureImageMobileSupportVersion,\n getMediaCallbackSupportVersion,\n mediaAPISupportVersion,\n nonFullScreenVideoModeAPISupportVersion,\n scanBarCodeAPIMobileSupportVersion,\n} from '../internal/constants';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport {\n ensureInitialized,\n isCurrentSDKVersionAtLeast,\n throwExceptionIfMobileApiIsNotSupported,\n} from '../internal/internalAPIs';\nimport {\n createFile,\n decodeAttachment,\n isVideoControllerRegistered,\n throwExceptionIfMediaCallIsNotSupportedOnMobile,\n validateGetMediaInputs,\n validateScanBarCodeInput,\n validateSelectMediaInputs,\n validateViewImagesInput,\n} from '../internal/mediaUtil';\nimport { ApiName, ApiVersionNumber, getApiVersionTag, getLogger } from '../internal/telemetry';\nimport { isNullOrUndefined } from '../internal/typeCheckUtilities';\nimport { generateGUID } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts, HostClientType } from './constants';\nimport { DevicePermission, ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst mediaTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nconst mediaLogger = getLogger('media');\n\n/**\n * Interact with media, including capturing and viewing images.\n */\nexport namespace media {\n /**\n * Function callback type used when calling {@link media.captureImage}.\n *\n * @param error - Error encountered during the API call, if any, {@link SdkError}\n * @param files - Collection of File objects (images) captured by the user. Will be an empty array in the case of an error.\n * */\n export type captureImageCallbackFunctionType = (error: SdkError, files: File[]) => void;\n\n /**\n * Function callback type used when calling {@link media.selectMedia}.\n *\n * @param error - Error encountered during the API call, if any, {@link SdkError}\n * @param attachments - Collection of {@link Media} objects selected by the user. Will be an empty array in the case of an error.\n * */\n export type selectMediaCallbackFunctionType = (error: SdkError, attachments: Media[]) => void;\n\n /** Error callback function type. */\n export type errorCallbackFunctionType = (error?: SdkError) => void;\n /**\n * Function callback type used when calling {@link media.scanBarCode}.\n *\n * @param error - Error encountered during the API call, if any, {@link SdkError}\n * @param decodedText - Decoded text from the barcode, if any. In the case of an error, this will be the empty string.\n * */\n export type scanBarCodeCallbackFunctionType = (error: SdkError, decodedText: string) => void;\n\n /**\n * Function callback type used when calling {@link media.Media.getMedia}\n *\n * @param error - Error encountered during the API call, if any, {@link SdkError}\n * @param blob - Blob of media returned. Will be a blob with no BlobParts, in the case of an error.\n * */\n export type getMediaCallbackFunctionType = (error: SdkError, blob: Blob) => void;\n\n /**\n * Enum for file formats supported\n */\n export enum FileFormat {\n /** Base64 encoding */\n Base64 = 'base64',\n /** File id */\n ID = 'id',\n }\n\n /**\n * File object that can be used to represent image or video or audio\n */\n export class File {\n /**\n * Content of the file. When format is Base64, this is the base64 content\n * When format is ID, this is id mapping to the URI\n * When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.\n */\n public content: string;\n\n /**\n * Format of the content\n */\n public format: FileFormat;\n\n /**\n * Size of the file in KB\n */\n public size: number;\n\n /**\n * MIME type. This can be used for constructing a dataUrl, if needed.\n */\n public mimeType: string;\n\n /**\n * Optional: Name of the file\n */\n public name?: string;\n }\n\n /**\n * Launch camera, capture image or choose image from gallery and return the images as a File[] object to the callback.\n *\n * @params callback - Callback will be called with an @see SdkError if there are any.\n * If error is null or undefined, the callback will be called with a collection of @see File objects\n * @remarks\n * Note: Currently we support getting one File through this API, i.e. the file arrays size will be one.\n * Note: For desktop, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.\n *\n */\n export function captureImage(callback: captureImageCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[captureImage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!GlobalVars.isFramelessWindow) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(notSupportedError, []);\n return;\n }\n\n if (!isCurrentSDKVersionAtLeast(captureImageMobileSupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n callback(oldPlatformError, []);\n return;\n }\n\n sendMessageToParent(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_CaptureImage),\n 'captureImage',\n callback,\n );\n }\n\n /**\n * Checks whether or not media has user permission\n *\n * @returns Promise that will resolve with true if the user had granted the app permission to media information, or with false otherwise,\n * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function hasPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isPermissionSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n\n return new Promise<boolean>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_HasPermission),\n 'permissions.has',\n permissions,\n ),\n );\n });\n }\n\n /**\n * Requests user permission for media\n *\n * @returns Promise that will resolve with true if the user consented permission for media, or with false otherwise,\n * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function requestPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isPermissionSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n\n return new Promise<boolean>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_RequestPermission),\n 'permissions.request',\n permissions,\n ),\n );\n });\n }\n\n /**\n * Checks if permission capability is supported by the host\n * @returns boolean to represent whether permission is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n function isPermissionSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.permissions ? true : false;\n }\n\n /**\n * Media object returned by the select Media API\n */\n export class Media extends File {\n constructor(that?: Media) {\n super();\n if (that) {\n this.content = that.content;\n this.format = that.format;\n this.mimeType = that.mimeType;\n this.name = that.name;\n this.preview = that.preview;\n this.size = that.size;\n }\n }\n\n /**\n * A preview of the file which is a lightweight representation.\n * In case of images this will be a thumbnail/compressed image in base64 encoding.\n */\n public preview: string;\n\n /**\n * Gets the media in chunks irrespective of size, these chunks are assembled and sent back to the webapp as file/blob\n * @param callback - callback is called with the @see SdkError if there is an error\n * If error is null or undefined, the callback will be called with @see Blob.\n */\n public getMedia(callback: getMediaCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[get Media] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n callback(oldPlatformError, new Blob());\n return;\n }\n if (!validateGetMediaInputs(this.mimeType, this.format, this.content)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n callback(invalidInput, new Blob());\n return;\n }\n // Call the new get media implementation via callbacks if the client version is greater than or equal to '2.0.0'\n if (isCurrentSDKVersionAtLeast(getMediaCallbackSupportVersion)) {\n this.getMediaViaCallback(callback);\n } else {\n this.getMediaViaHandler(callback);\n }\n }\n\n /** Function to retrieve media content, such as images or videos, via callback. */\n private getMediaViaCallback(callback: getMediaCallbackFunctionType): void {\n const helper: MediaHelper = {\n mediaMimeType: this.mimeType,\n assembleAttachment: [],\n };\n const localUriId = [this.content];\n function handleGetMediaCallbackRequest(mediaResult: MediaResult): void {\n if (callback) {\n if (mediaResult && mediaResult.error) {\n callback(mediaResult.error, new Blob());\n } else {\n if (mediaResult && mediaResult.mediaChunk) {\n // If the chunksequence number is less than equal to 0 implies EOF\n // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number\n if (mediaResult.mediaChunk.chunkSequence <= 0) {\n const file = createFile(helper.assembleAttachment, helper.mediaMimeType);\n callback(mediaResult.error, file ?? new Blob());\n } else {\n // Keep pushing chunks into assemble attachment\n const assemble: AssembleAttachment | null = decodeAttachment(\n mediaResult.mediaChunk,\n helper.mediaMimeType,\n );\n if (assemble) {\n helper.assembleAttachment.push(assemble);\n } else {\n mediaLogger(\n `Received a null assemble attachment for when decoding chunk sequence ${mediaResult.mediaChunk.chunkSequence}; not including the chunk in the assembled file.`,\n );\n }\n }\n } else {\n callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, new Blob());\n }\n }\n }\n }\n sendMessageToParent(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_GetMedia),\n 'getMedia',\n localUriId,\n handleGetMediaCallbackRequest,\n );\n }\n\n /** Function to retrieve media content, such as images or videos, via handler. */\n private getMediaViaHandler(callback: getMediaCallbackFunctionType): void {\n const actionName = generateGUID();\n const helper: MediaHelper = {\n mediaMimeType: this.mimeType,\n assembleAttachment: [],\n };\n const params = [actionName, this.content];\n this.content &&\n !isNullOrUndefined(callback) &&\n sendMessageToParent(getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_GetMedia), 'getMedia', params);\n function handleGetMediaRequest(response: string): void {\n if (callback) {\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n const mediaResult: MediaResult = JSON.parse(response);\n if (mediaResult.error) {\n callback(mediaResult.error, new Blob());\n removeHandler('getMedia' + actionName);\n } else {\n if (mediaResult.mediaChunk) {\n // If the chunksequence number is less than equal to 0 implies EOF\n // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number\n if (mediaResult.mediaChunk.chunkSequence <= 0) {\n const file = createFile(helper.assembleAttachment, helper.mediaMimeType);\n callback(mediaResult.error, file ?? new Blob());\n removeHandler('getMedia' + actionName);\n } else {\n // Keep pushing chunks into assemble attachment\n const assemble: AssembleAttachment | null = decodeAttachment(\n mediaResult.mediaChunk,\n helper.mediaMimeType,\n );\n if (assemble) {\n helper.assembleAttachment.push(assemble);\n }\n }\n } else {\n callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, new Blob());\n removeHandler('getMedia' + actionName);\n }\n }\n }\n }\n\n registerHandler(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_RegisterGetMediaRequestHandler),\n 'getMedia' + actionName,\n handleGetMediaRequest,\n );\n }\n }\n\n /**\n * Input parameter supplied to the select Media API\n */\n export interface MediaInputs {\n /**\n * Only one media type can be selected at a time\n */\n mediaType: MediaType;\n\n /**\n * max limit of media allowed to be selected in one go, current max limit is 10 set by office lens.\n */\n maxMediaCount: number;\n\n /**\n * Additional properties for customization of select media - Image in mobile devices\n */\n imageProps?: ImageProps;\n\n /**\n * Additional properties for customization of select media - Video in mobile devices\n */\n videoProps?: VideoProps;\n\n /**\n * Additional properties for customization of select media - VideoAndImage in mobile devices\n */\n videoAndImageProps?: VideoAndImageProps;\n\n /**\n * Additional properties for audio capture flows.\n */\n audioProps?: AudioProps;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * All properties common to Image and Video Props\n */\n interface MediaProps {\n /**\n * @hidden\n * Optional; Lets the developer specify the media source, more than one can be specified.\n * Default value is both camera and gallery\n */\n sources?: Source[];\n\n /**\n * @hidden\n * Optional; Specify in which mode the camera will be opened.\n * Default value is Photo\n */\n startMode?: CameraStartMode;\n\n /**\n * @hidden\n * Optional; indicate if user is allowed to move between front and back camera\n * Default value is true\n */\n cameraSwitcher?: boolean;\n }\n\n /**\n * All properties in ImageProps are optional and have default values in the platform\n */\n export interface ImageProps extends MediaProps {\n /**\n * Optional; indicate if inking on the selected Image is allowed or not\n * Default value is true\n */\n ink?: boolean;\n\n /**\n * Optional; indicate if putting text stickers on the selected Image is allowed or not\n * Default value is true\n */\n textSticker?: boolean;\n\n /**\n * Optional; indicate if image filtering mode is enabled on the selected image\n * Default value is false\n */\n enableFilter?: boolean;\n\n /**\n * Optional; Lets the developer specify the image output formats, more than one can be specified.\n * Default value is Image.\n */\n imageOutputFormats?: ImageOutputFormats[];\n }\n\n /**\n * All properties in VideoProps are optional and have default values in the platform\n */\n export interface VideoProps extends MediaProps {\n /**\n * Optional; the maximum duration in seconds after which the recording should terminate automatically.\n * Default value is defined by the platform serving the API.\n */\n maxDuration?: number;\n\n /**\n * Optional; to determine if the video capturing flow needs to be launched\n * in Full Screen Mode (Lens implementation) or PictureInPicture Mode (Native implementation).\n * Default value is true, indicating video will always launch in Full Screen Mode via lens.\n */\n isFullScreenMode?: boolean;\n\n /**\n * Optional; controls the visibility of stop button in PictureInPicture Mode.\n * Default value is true, indicating the user will be able to stop the video.\n */\n isStopButtonVisible?: boolean;\n\n /**\n * Optional; setting VideoController will register your app to listen to the lifecycle events during the video capture flow.\n * Your app can also dynamically control the experience while capturing the video by notifying the host client.\n */\n videoController?: VideoController;\n }\n\n /**\n * All properties in VideoAndImageProps are optional and have default values in the platform\n */\n export interface VideoAndImageProps extends ImageProps, VideoProps {}\n\n /**\n * All properties in AudioProps are optional and have default values in the platform\n */\n export interface AudioProps {\n /**\n * Optional; the maximum duration in minutes after which the recording should terminate automatically\n * Default value is defined by the platform serving the API.\n */\n maxDuration?: number;\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Base class which holds the callback and notifies events to the host client\n */\n abstract class MediaController<T> {\n /** Callback that can be registered to handle events related to the playback and control of video content. */\n protected controllerCallback?: T;\n\n public constructor(controllerCallback?: T) {\n this.controllerCallback = controllerCallback;\n }\n\n protected abstract getMediaType(): MediaType;\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * This function will be implemented by the respective media class which holds the logic\n * of specific events that needs to be notified to the app.\n * @param mediaEvent indicates the event signed by the host client to the app\n */\n protected abstract notifyEventToApp(mediaEvent: MediaControllerEvent): void;\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Function to notify the host client to programatically control the experience\n * @param mediaEvent indicates what the event that needs to be signaled to the host client\n * Optional; @param callback is used to send app if host client has successfully handled the notification event or not\n */\n protected notifyEventToHost(mediaEvent: MediaControllerEvent, callback?: errorCallbackFunctionType): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n try {\n throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);\n } catch (err) {\n if (callback) {\n callback(err);\n }\n return;\n }\n\n const params: MediaControllerParam = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };\n sendMessageToParent(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_Controller),\n 'media.controller',\n [params],\n (err?: SdkError) => {\n if (callback) {\n callback(err);\n }\n },\n );\n }\n\n /**\n * Function to programatically stop the ongoing media event\n * Optional; @param callback is used to send app if host client has successfully stopped the event or not\n */\n public stop(callback?: errorCallbackFunctionType): void {\n this.notifyEventToHost(MediaControllerEvent.StopRecording, callback);\n }\n }\n\n /**\n * Callback which will register your app to listen to lifecycle events during the video capture flow\n */\n export interface VideoControllerCallback {\n /** The event is a type of callback that can be enlisted to handle various events linked to `onRecordingStarted`, which helps with playback of video content. */\n onRecordingStarted?(): void;\n }\n\n /**\n * VideoController class is used to communicate between the app and the host client during the video capture flow\n */\n export class VideoController extends MediaController<VideoControllerCallback> {\n /** Gets media type video. */\n protected getMediaType(): MediaType {\n return MediaType.Video;\n }\n /** Notify or send an event related to the playback and control of video content to a registered application. */\n public notifyEventToApp(mediaEvent: MediaControllerEvent): void {\n if (!this.controllerCallback) {\n // Early return as app has not registered with the callback\n return;\n }\n\n switch (mediaEvent) {\n case MediaControllerEvent.StartRecording:\n if (this.controllerCallback.onRecordingStarted) {\n this.controllerCallback.onRecordingStarted();\n break;\n }\n }\n }\n }\n\n /**\n * @beta\n * Events which are used to communicate between the app and the host client during the media recording flow\n */\n export enum MediaControllerEvent {\n /** Start recording. */\n StartRecording = 1,\n /** Stop recording. */\n StopRecording = 2,\n }\n\n /**\n * @hidden\n * Hide from docs\n * --------\n * Interface with relevant info to send communication from the app to the host client\n */\n interface MediaControllerParam {\n /**\n * List of team information\n */\n mediaType: media.MediaType;\n\n /**\n * List of team information\n */\n mediaControllerEvent: MediaControllerEvent;\n }\n\n /**\n * The modes in which camera can be launched in select Media API\n */\n export enum CameraStartMode {\n /** Photo mode. */\n Photo = 1,\n /** Document mode. */\n Document = 2,\n /** Whiteboard mode. */\n Whiteboard = 3,\n /** Business card mode. */\n BusinessCard = 4,\n }\n\n /**\n * Specifies the image source\n */\n export enum Source {\n /** Image source is camera. */\n Camera = 1,\n /** Image source is gallery. */\n Gallery = 2,\n }\n\n /**\n * Specifies the type of Media\n */\n export enum MediaType {\n /** Media type photo or image */\n Image = 1,\n /** Media type video. */\n Video = 2,\n /** Media type video and image. */\n VideoAndImage = 3,\n /** Media type audio. */\n Audio = 4,\n }\n\n /**\n * Input for view images API\n */\n export interface ImageUri {\n /** Image location */\n value: string;\n /** Image Uri type */\n type: ImageUriType;\n }\n\n /**\n * ID contains a mapping for content uri on platform's side, URL is generic\n */\n export enum ImageUriType {\n /** Image Id. */\n ID = 1,\n /** Image URL. */\n URL = 2,\n }\n\n /**\n * Specifies the image output formats.\n */\n export enum ImageOutputFormats {\n /** Outputs image. */\n IMAGE = 1,\n /** Outputs pdf. */\n PDF = 2,\n }\n\n /**\n * Media chunks an output of getMedia API from platform\n */\n export interface MediaChunk {\n /**\n * Base 64 data for the requested uri\n */\n chunk: string;\n\n /**\n * chunk sequence number\n */\n chunkSequence: number;\n }\n\n /**\n * Output of getMedia API from platform\n */\n export interface MediaResult {\n /**\n * error encountered in getMedia API\n */\n error: SdkError;\n\n /**\n * Media chunk which will be assemebled and converted into a blob\n */\n mediaChunk: MediaChunk;\n }\n\n /**\n * Helper object to assembled media chunks\n */\n export interface AssembleAttachment {\n /** A number representing the sequence of the attachment in the media chunks. */\n sequence: number;\n /** A Blob object representing the data of the media chunks. */\n file: Blob;\n }\n\n /**\n * Helper class for assembling media\n */\n interface MediaHelper {\n /** A string representing the MIME type of the media file */\n mediaMimeType: string;\n /** An array of {@link media.AssembleAttachment | AssembleAttachment} objects representing the media files to be sent as attachment */\n assembleAttachment: AssembleAttachment[];\n }\n\n /**\n * Select an attachment using camera/gallery\n *\n * @param mediaInputs - The input params to customize the media to be selected\n * @param callback - The callback to invoke after fetching the media\n */\n export function selectMedia(mediaInputs: MediaInputs, callback: selectMediaCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[select Media] Callback cannot be null');\n }\n\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n callback(oldPlatformError, []);\n return;\n }\n\n try {\n throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs);\n } catch (err) {\n callback(err, []);\n return;\n }\n\n if (!validateSelectMediaInputs(mediaInputs)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n callback(invalidInput, []);\n return;\n }\n\n const params = [mediaInputs];\n // What comes back from native as attachments would just be objects and will be missing getMedia method on them\n sendMessageToParent(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_SelectMedia),\n 'selectMedia',\n params,\n (err: SdkError, localAttachments?: Media[], mediaEvent?: MediaControllerEvent) => {\n // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia\n if (mediaEvent) {\n if (isVideoControllerRegistered(mediaInputs)) {\n mediaInputs?.videoProps?.videoController?.notifyEventToApp(mediaEvent);\n }\n return;\n }\n\n // Media Attachments are final response to selectMedia\n if (!localAttachments) {\n callback(err, []);\n return;\n }\n\n const mediaArray: Media[] = [];\n for (const attachment of localAttachments) {\n mediaArray.push(new Media(attachment));\n }\n callback(err, mediaArray);\n },\n );\n }\n\n /**\n * View images using native image viewer\n *\n * @param uriList - list of URIs for images to be viewed - can be content URI or server URL. Supports up to 10 Images in a single call\n * @param callback - returns back error if encountered, returns null in case of success\n */\n export function viewImages(uriList: ImageUri[], callback: errorCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[view images] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n callback(oldPlatformError);\n return;\n }\n if (!validateViewImagesInput(uriList)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n callback(invalidInput);\n return;\n }\n\n const params = [uriList];\n sendMessageToParent(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_ViewImages),\n 'viewImages',\n params,\n callback,\n );\n }\n\n /**\n * Barcode configuration supplied to scanBarCode API to customize barcode scanning experience in mobile\n * All properties in BarCodeConfig are optional and have default values in the platform\n */\n export interface BarCodeConfig {\n /**\n * Optional; Lets the developer specify the scan timeout interval in seconds\n * Default value is 30 seconds and max allowed value is 60 seconds\n */\n timeOutIntervalInSec?: number;\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use {@link barCode.scanBarCode barCode.scanBarCode(config?: BarCodeConfig): Promise\\<string\\>} instead.\n\n * Scan Barcode/QRcode using camera\n *\n * @remarks\n * Note: For desktop and web, this API is not supported. Callback will be resolved with ErrorCode.NotSupported.\n *\n * @param callback - callback to invoke after scanning the barcode\n * @param config - optional input configuration to customize the barcode scanning experience\n */\n export function scanBarCode(callback: scanBarCodeCallbackFunctionType, config?: BarCodeConfig): void {\n if (!callback) {\n throw new Error('[media.scanBarCode] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (\n GlobalVars.hostClientType === HostClientType.desktop ||\n GlobalVars.hostClientType === HostClientType.web ||\n GlobalVars.hostClientType === HostClientType.rigel ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||\n GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||\n GlobalVars.hostClientType === HostClientType.teamsPhones ||\n GlobalVars.hostClientType === HostClientType.teamsDisplays\n ) {\n const notSupportedError: SdkError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };\n callback(notSupportedError, '');\n return;\n }\n\n if (!isCurrentSDKVersionAtLeast(scanBarCodeAPIMobileSupportVersion)) {\n const oldPlatformError: SdkError = { errorCode: ErrorCode.OLD_PLATFORM };\n callback(oldPlatformError, '');\n return;\n }\n\n if (!validateScanBarCodeInput(config)) {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n callback(invalidInput, '');\n return;\n }\n\n sendMessageToParent(\n getApiVersionTag(mediaTelemetryVersionNumber, ApiName.Media_ScanBarCode),\n 'media.scanBarCode',\n [config],\n callback,\n );\n }\n}\n","import { media } from '../public/media';\nimport { people } from '../public/people';\nimport {\n imageOutputFormatsAPISupportVersion,\n nonFullScreenVideoModeAPISupportVersion,\n videoAndImageMediaAPISupportVersion,\n} from './constants';\nimport { throwExceptionIfMobileApiIsNotSupported } from './internalAPIs';\n\n/**\n * @hidden\n * Helper function to create a blob from media chunks based on their sequence\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function createFile(assembleAttachment: media.AssembleAttachment[], mimeType: string): Blob | null {\n if (assembleAttachment == null || mimeType == null || assembleAttachment.length <= 0) {\n return null;\n }\n let file: Blob | null = null;\n let sequence = 1;\n assembleAttachment.sort((a, b) => (a.sequence > b.sequence ? 1 : -1));\n assembleAttachment.forEach((item) => {\n if (item.sequence == sequence) {\n if (file) {\n file = new Blob([file, item.file], { type: mimeType });\n } else {\n file = new Blob([item.file], { type: mimeType });\n }\n sequence++;\n }\n });\n return file;\n}\n\n/**\n * @hidden\n * Helper function to convert Media chunks into another object type which can be later assemebled\n * Converts base 64 encoded string to byte array and then into an array of blobs\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function decodeAttachment(attachment: media.MediaChunk, mimeType: string): media.AssembleAttachment | null {\n if (attachment == null || mimeType == null) {\n return null;\n }\n const decoded = atob(attachment.chunk);\n const byteNumbers = new Array(decoded.length);\n for (let i = 0; i < decoded.length; i++) {\n byteNumbers[i] = decoded.charCodeAt(i);\n }\n const byteArray = new Uint8Array(byteNumbers);\n const blob: Blob = new Blob([byteArray], { type: mimeType });\n const assemble: media.AssembleAttachment = {\n sequence: attachment.chunkSequence,\n file: blob,\n };\n return assemble;\n}\n\n/**\n * @hidden\n * Function throws an SdkError if the media call is not supported on current mobile version, else undefined.\n *\n * @throws an SdkError if the media call is not supported\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs: media.MediaInputs): void {\n if (isMediaCallForVideoAndImageInputs(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(videoAndImageMediaAPISupportVersion);\n } else if (isMediaCallForNonFullScreenVideoMode(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);\n } else if (isMediaCallForImageOutputFormats(mediaInputs)) {\n throwExceptionIfMobileApiIsNotSupported(imageOutputFormatsAPISupportVersion);\n }\n}\n\n/**\n * @hidden\n * Function returns true if the app has registered to listen to video controller events, else false.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isVideoControllerRegistered(mediaInputs: media.MediaInputs): boolean {\n if (\n mediaInputs.mediaType == media.MediaType.Video &&\n mediaInputs.videoProps &&\n mediaInputs.videoProps.videoController\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are valid and false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateSelectMediaInputs(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs == null || mediaInputs.maxMediaCount > 10) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for mediatype Image and contains Image outputs formats, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function isMediaCallForImageOutputFormats(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs?.mediaType == media.MediaType.Image && mediaInputs?.imageProps?.imageOutputFormats) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for mediatype VideoAndImage and false otherwise\n *\n * @internal\n */\nexport function isMediaCallForVideoAndImageInputs(mediaInputs: media.MediaInputs): boolean {\n if (mediaInputs && (mediaInputs.mediaType == media.MediaType.VideoAndImage || mediaInputs.videoAndImageProps)) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the mediaInput params are called for non-full screen video mode and false otherwise\n *\n * @internal\n */\nexport function isMediaCallForNonFullScreenVideoMode(mediaInputs: media.MediaInputs): boolean {\n if (\n mediaInputs &&\n mediaInputs.mediaType == media.MediaType.Video &&\n mediaInputs.videoProps &&\n !mediaInputs.videoProps.isFullScreenMode\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * @hidden\n * Returns true if the get Media params are valid and false otherwise\n *\n * @internal\n */\nexport function validateGetMediaInputs(mimeType: string, format: media.FileFormat, content: string): boolean {\n if (mimeType == null || format == null || format != media.FileFormat.ID || content == null) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the view images param is valid and false otherwise\n *\n * @internal\n */\nexport function validateViewImagesInput(uriList: media.ImageUri[]): boolean {\n if (uriList == null || uriList.length <= 0 || uriList.length > 10) {\n return false;\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the scan barcode param is valid and false otherwise\n *\n * @internal\n */\nexport function validateScanBarCodeInput(barCodeConfig?: media.BarCodeConfig): boolean {\n if (barCodeConfig) {\n if (\n barCodeConfig.timeOutIntervalInSec === null ||\n (barCodeConfig.timeOutIntervalInSec != undefined && barCodeConfig.timeOutIntervalInSec <= 0) ||\n (barCodeConfig.timeOutIntervalInSec != undefined && barCodeConfig.timeOutIntervalInSec > 60)\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @hidden\n * Returns true if the people picker params are valid and false otherwise\n *\n * @internal\n */\nexport function validatePeoplePickerInput(peoplePickerInputs?: people.PeoplePickerInputs): boolean {\n if (peoplePickerInputs) {\n if (peoplePickerInputs.title) {\n if (typeof peoplePickerInputs.title !== 'string') {\n return false;\n }\n }\n\n if (peoplePickerInputs.setSelected) {\n if (typeof peoplePickerInputs.setSelected !== 'object') {\n return false;\n }\n }\n\n if (peoplePickerInputs.openOrgWideSearchInChatOrChannel) {\n if (typeof peoplePickerInputs.openOrgWideSearchInChatOrChannel !== 'boolean') {\n return false;\n }\n }\n if (peoplePickerInputs.singleSelect) {\n if (typeof peoplePickerInputs.singleSelect !== 'boolean') {\n return false;\n }\n }\n }\n return true;\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { validateScanBarCodeInput } from '../internal/mediaUtil';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { DevicePermission, ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst barCodeTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Namespace to interact with the barcode scanning-specific part of the SDK.\n *\n * @beta\n */\nexport namespace barCode {\n /**\n * Data structure to customize the barcode scanning experience in scanBarCode API.\n * All properties in BarCodeConfig are optional and have default values in the platform\n *\n * @beta\n */\n export interface BarCodeConfig {\n /**\n * Optional; designates the scan timeout interval in seconds.\n * Default value is 30 seconds, max allowed value is 60 seconds.\n */\n timeOutIntervalInSec?: number;\n }\n\n /**\n * Scan Barcode or QRcode using camera\n *\n * @param barCodeConfig - input configuration to customize the barcode scanning experience\n *\n * @returns a scanned code\n *\n * @beta\n */\n export function scanBarCode(barCodeConfig: BarCodeConfig): Promise<string> {\n return new Promise<string>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!validateScanBarCodeInput(barCodeConfig)) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_ScanBarCode),\n 'media.scanBarCode',\n barCodeConfig,\n ),\n );\n });\n }\n\n /**\n * Checks whether or not media has user permission\n *\n * @returns true if the user has granted the app permission to media information, false otherwise\n *\n * @beta\n */\n export function hasPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n\n return new Promise<boolean>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_HasPermission),\n 'permissions.has',\n permissions,\n ),\n );\n });\n }\n\n /**\n * Requests user permission for media\n *\n * @returns true if the user has granted the app permission to the media, false otherwise\n *\n * @beta\n */\n export function requestPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n\n return new Promise<boolean>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(barCodeTelemetryVersionNumber, ApiName.BarCode_RequestPermission),\n 'permissions.request',\n permissions,\n ),\n );\n });\n }\n\n /**\n * Checks if barCode capability is supported by the host\n * @returns boolean to represent whether the barCode capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.barCode && runtime.supports.permissions ? true : false;\n }\n}\n","import { sendAndHandleStatusAndReason } from '../internal/communication';\nimport { createTeamsDeepLinkForChat } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from '../public/constants';\nimport { runtime } from '../public/runtime';\n\n/**\n * Describes information needed to start a chat\n */\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst chatTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\ninterface OpenChatRequest {\n /**\n * An optional message used when initiating chat\n */\n message?: string;\n}\n\n/**\n * Used when starting a chat with one person\n *\n * @see OpenGroupChatRequest for use when a chat with more than one person\n */\nexport interface OpenSingleChatRequest extends OpenChatRequest {\n /**\n * The [Microsoft Entra UPN](https://learn.microsoft.com/entra/identity/hybrid/connect/plan-connect-userprincipalname) (usually but not always an e-mail address)\n * of the user with whom to begin a chat\n */\n user: string;\n}\n\n/**\n * Used when starting a chat with more than one person\n *\n * @see OpenSingleChatRequest for use in a chat with only one person\n */\nexport interface OpenGroupChatRequest extends OpenChatRequest {\n /**\n * Array containing [Microsoft Entra UPNs](https://learn.microsoft.com/entra/identity/hybrid/connect/plan-connect-userprincipalname) (usually but not always an e-mail address)\n * of users with whom to begin a chat\n */\n users: string[];\n /**\n * The display name of a conversation for 3 or more users (chats with fewer than three users will ignore this field)\n */\n topic?: string;\n}\n\n/**\n * Contains functionality to start chat with others\n */\nexport namespace chat {\n /**\n * Allows the user to open a chat with a single user and allows\n * for the user to specify the message they wish to send.\n *\n * @param openChatRequest: {@link OpenSingleChatRequest}- a request object that contains a user's email as well as an optional message parameter.\n *\n * @returns Promise resolved upon completion\n */\n export function openChat(openChatRequest: OpenSingleChatRequest): Promise<void> {\n const apiVersionTag = getApiVersionTag(chatTelemetryVersionNumber, ApiName.Chat_OpenChat);\n return openChatHelper(apiVersionTag, openChatRequest);\n }\n\n function openChatHelper(apiVersionTag: string, openChatRequest: OpenSingleChatRequest): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleStatusAndReason(\n apiVersionTag,\n 'executeDeepLink',\n createTeamsDeepLinkForChat([openChatRequest.user], undefined /*topic*/, openChatRequest.message),\n ),\n );\n } else {\n const sendPromise = sendAndHandleStatusAndReason(apiVersionTag, 'chat.openChat', {\n members: [openChatRequest.user],\n message: openChatRequest.message,\n });\n resolve(sendPromise);\n }\n });\n }\n /**\n * Allows the user to create a chat with multiple users (2+) and allows\n * for the user to specify a message and name the topic of the conversation. If\n * only 1 user is provided into users array default back to origin openChat.\n *\n * @param openChatRequest: {@link OpenGroupChatRequest} - a request object that contains a list of user emails as well as optional parameters for message and topic (display name for the group chat).\n *\n * @returns Promise resolved upon completion\n */\n export function openGroupChat(openChatRequest: OpenGroupChatRequest): Promise<void> {\n const apiVersionTag = getApiVersionTag(chatTelemetryVersionNumber, ApiName.Chat_OpenGroupChat);\n return new Promise<void>((resolve) => {\n if (openChatRequest.users.length < 1) {\n throw Error('OpenGroupChat Failed: No users specified');\n }\n if (openChatRequest.users.length === 1) {\n const chatRequest: OpenSingleChatRequest = {\n user: openChatRequest.users[0],\n message: openChatRequest.message,\n };\n resolve(openChatHelper(apiVersionTag, chatRequest));\n } else {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleStatusAndReason(\n apiVersionTag,\n 'executeDeepLink',\n createTeamsDeepLinkForChat(openChatRequest.users, openChatRequest.topic, openChatRequest.message),\n ),\n );\n } else {\n const sendPromise = sendAndHandleStatusAndReason(apiVersionTag, 'chat.openChat', {\n members: openChatRequest.users,\n message: openChatRequest.message,\n topic: openChatRequest.topic,\n });\n resolve(sendPromise);\n }\n }\n });\n }\n\n /**\n * Checks if the chat capability is supported by the host\n * @returns boolean to represent whether the chat capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.chat ? true : false;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport * as utils from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ClipboardParams, ClipboardSupportedMimeType } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst clipboardTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Interact with the system clipboard\n *\n * @beta\n */\nexport namespace clipboard {\n /**\n * Function to copy data to clipboard.\n * @remarks\n * Note: clipboard.write only supports Text, HTML, PNG, and JPEG data format.\n * MIME type for Text -> `text/plain`, HTML -> `text/html`, PNG/JPEG -> `image/(png | jpeg)`\n * Also, JPEG will be converted to PNG image when copying to clipboard.\n *\n * @param blob - A Blob object representing the data to be copied to clipboard.\n * @returns A string promise which resolves to success message from the clipboard or\n * rejects with error stating the reason for failure.\n */\n export async function write(blob: Blob): Promise<void> {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.meetingStage,\n FrameContexts.task,\n FrameContexts.settings,\n FrameContexts.stage,\n FrameContexts.sidePanel,\n );\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!(blob.type && Object.values(ClipboardSupportedMimeType).includes(blob.type as ClipboardSupportedMimeType))) {\n throw new Error(\n `Blob type ${blob.type} is not supported. Supported blob types are ${Object.values(\n ClipboardSupportedMimeType,\n )}`,\n );\n }\n const base64StringContent = await utils.getBase64StringFromBlob(blob);\n const writeParams: ClipboardParams = {\n mimeType: blob.type as ClipboardSupportedMimeType,\n content: base64StringContent,\n };\n return sendAndHandleSdkError(\n getApiVersionTag(clipboardTelemetryVersionNumber, ApiName.Clipboard_Write),\n 'clipboard.writeToClipboard',\n writeParams,\n );\n }\n\n /**\n * Function to read data from clipboard.\n *\n * @returns A promise blob which resolves to the data read from the clipboard or\n * rejects stating the reason for failure.\n * Note: Returned blob type will contain one of the MIME type `image/png`, `text/plain` or `text/html`.\n */\n export async function read(): Promise<Blob> {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.meetingStage,\n FrameContexts.task,\n FrameContexts.settings,\n FrameContexts.stage,\n FrameContexts.sidePanel,\n );\n const apiVersionTag = getApiVersionTag(clipboardTelemetryVersionNumber, ApiName.Clipboard_Read);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const response = await sendAndHandleSdkError(apiVersionTag, 'clipboard.readFromClipboard');\n if (typeof response === 'string') {\n const data = JSON.parse(response) as ClipboardParams;\n return utils.base64ToBlob(data.mimeType, data.content);\n } else {\n return response as Blob;\n }\n }\n\n /**\n * Checks if clipboard capability is supported by the host\n * @returns boolean to represent whether the clipboard capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n if (GlobalVars.isFramelessWindow) {\n return ensureInitialized(runtime) && runtime.supports.clipboard ? true : false;\n } else {\n return ensureInitialized(runtime) && navigator && navigator.clipboard && runtime.supports.clipboard\n ? true\n : false;\n }\n }\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { runtime } from './runtime';\n\n/**\n * @beta\n * Nested app auth capabilities\n */\nexport namespace nestedAppAuth {\n /**\n * Checks if MSAL-NAA channel recommended by the host\n * @returns true if host is recommending NAA channel and false otherwise\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isNAAChannelRecommended(): boolean {\n return (ensureInitialized(runtime) && runtime.isNAAChannelRecommended) ?? false;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { DevicePermission, ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst geoLocationTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Namespace to interact with the geoLocation module-specific part of the SDK. This is the newer version of location module.\n *\n * @beta\n */\nexport namespace geoLocation {\n /**\n * Data struture to represent the location information\n *\n * @beta\n */\n export interface Location {\n /**\n Latitude of the location\n */\n latitude: number;\n /**\n Longitude of the location\n */\n longitude: number;\n /**\n Accuracy describes the maximum distance in meters from the captured coordinates to the possible actual location\n @remarks\n This property is only in scope for mobile\n */\n accuracy?: number;\n /**\n Time stamp when the location was captured\n */\n timestamp?: number;\n }\n /**\n * Fetches current user coordinates\n * @returns Promise that will resolve with {@link geoLocation.Location} object or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function getCurrentLocation(): Promise<Location> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n return sendAndHandleSdkError(\n getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_GetCurrentLocation),\n 'location.getLocation',\n {\n allowChooseLocation: false,\n showMap: false,\n },\n );\n }\n\n /**\n * Checks whether or not location has user permission\n *\n * @returns Promise that will resolve with true if the user had granted the app permission to location information, or with false otherwise,\n * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function hasPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.GeoLocation;\n\n return new Promise<boolean>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_HasPermission),\n 'permissions.has',\n permissions,\n ),\n );\n });\n }\n\n /**\n * Requests user permission for location\n *\n * @returns true if the user consented permission for location, false otherwise\n * @returns Promise that will resolve with true if the user consented permission for location, or with false otherwise,\n * In case of an error, promise will reject with the error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function requestPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.GeoLocation;\n\n return new Promise<boolean>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_RequestPermission),\n 'permissions.request',\n permissions,\n ),\n );\n });\n }\n\n /**\n * Checks if geoLocation capability is supported by the host\n * @returns boolean to represent whether geoLocation is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.geoLocation && runtime.supports.permissions ? true : false;\n }\n\n /**\n * Namespace to interact with the location on map module-specific part of the SDK.\n *\n * @beta\n */\n export namespace map {\n /**\n * Allows user to choose location on map\n *\n * @returns Promise that will resolve with {@link geoLocation.Location} object chosen by the user or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function chooseLocation(): Promise<Location> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n return sendAndHandleSdkError(\n getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_Map_ChooseLocation),\n 'location.getLocation',\n {\n allowChooseLocation: true,\n showMap: true,\n },\n );\n }\n\n /**\n * Shows the location on map corresponding to the given coordinates\n *\n * @param location - Location to be shown on the map\n * @returns Promise that resolves when the location dialog has been closed or reject with an error. Function can also throw a NOT_SUPPORTED_ON_PLATFORM error\n *\n * @beta\n */\n export function showLocation(location: Location): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!location) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n return sendAndHandleSdkError(\n getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_ShowLocation),\n 'location.showLocation',\n location,\n );\n }\n\n /**\n * Checks if geoLocation.map capability is supported by the host\n * @returns boolean to represent whether geoLocation.map is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) &&\n runtime.supports.geoLocation &&\n runtime.supports.geoLocation.map &&\n runtime.supports.permissions\n ? true\n : false;\n }\n }\n}\n","import { AdaptiveCardVersion } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * @returns The {@linkcode AdaptiveCardVersion} representing the Adaptive Card schema\n * version supported by the host, or undefined if the host does not support Adaptive Cards\n */\nexport function getAdaptiveCardSchemaVersion(): AdaptiveCardVersion | undefined {\n if (!runtime.hostVersionsInfo) {\n return undefined;\n } else {\n return runtime.hostVersionsInfo.adaptiveCardSchemaVersion;\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { registerHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/** onComplete function type */\nexport type onCompleteFunctionType = (status: boolean, reason?: string) => void;\n/** addEventListner function type */\nexport type addEventListnerFunctionType = (message: any) => void;\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst appWindowTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n/** Represents a window or frame within the host app. */\nexport interface IAppWindow {\n /**\n * Send a message to the AppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n postMessage(message: any, onComplete?: onCompleteFunctionType): void;\n\n /**\n * Add a listener that will be called when an event is received from this AppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n addEventListener(type: string, listener: Function): void;\n}\n\n/**\n * An object that application can utilize to establish communication\n * with the child window it opened, which contains the corresponding task.\n */\nexport class ChildAppWindow implements IAppWindow {\n /**\n * Send a message to the ChildAppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n public postMessage(message: any, onComplete?: onCompleteFunctionType): void {\n ensureInitialized(runtime);\n sendMessageToParent(\n getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ChildAppWindow_PostMessage),\n 'messageForChild',\n [message],\n onComplete ? onComplete : getGenericOnCompleteHandler(),\n );\n }\n /**\n * Add a listener that will be called when an event is received from the ChildAppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n public addEventListener(type: string, listener: addEventListnerFunctionType): void {\n ensureInitialized(runtime);\n if (type === 'message') {\n registerHandler(\n getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ChildAppWindow_AddEventListener),\n 'messageForParent',\n listener,\n );\n }\n }\n}\n\n/**\n * An object that is utilized to facilitate communication with a parent window\n * that initiated the opening of current window. For instance, a dialog or task\n * module would utilize it to transmit messages to the application that launched it.\n */\nexport class ParentAppWindow implements IAppWindow {\n /** Represents a parent window or frame. */\n private static _instance: ParentAppWindow;\n /** Get the parent window instance. */\n public static get Instance(): IAppWindow {\n // Do you need arguments? Make it a regular method instead.\n return this._instance || (this._instance = new this());\n }\n\n /**\n * Send a message to the ParentAppWindow.\n *\n * @param message - The message to send\n * @param onComplete - The callback to know if the postMessage has been success/failed.\n */\n public postMessage(message: any, onComplete?: onCompleteFunctionType): void {\n ensureInitialized(runtime, FrameContexts.task);\n sendMessageToParent(\n getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ParentAppWindow_PostMessage),\n 'messageForParent',\n [message],\n onComplete ? onComplete : getGenericOnCompleteHandler(),\n );\n }\n\n /**\n * Add a listener that will be called when an event is received from the ParentAppWindow.\n *\n * @param type - The event to listen to. Currently the only supported type is 'message'.\n * @param listener - The listener that will be called\n */\n public addEventListener(type: string, listener: addEventListnerFunctionType): void {\n ensureInitialized(runtime, FrameContexts.task);\n if (type === 'message') {\n registerHandler(\n getApiVersionTag(appWindowTelemetryVersionNumber, ApiName.AppWindow_ParentAppWindow_AddEventListener),\n 'messageForChild',\n listener,\n );\n }\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { isValidHttpsURL } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst secondaryBrowserTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Namespace to power up the in-app browser experiences in the host app.\n * For e.g., opening a URL in the host app inside a browser\n *\n * @beta\n */\nexport namespace secondaryBrowser {\n /**\n * Open a URL in the secondary browser.\n *\n * On mobile, this is the in-app browser.\n *\n * On web and desktop, please use the `window.open()` method or other native external browser methods.\n *\n * @param url Url to open in the browser\n * @returns Promise that successfully resolves if the URL opens in the secondaryBrowser\n * or throws an error {@link SdkError} incase of failure before starting navigation\n *\n * @remarks Any error that happens after navigation begins is handled by the platform browser component and not returned from this function.\n * @beta\n */\n export function open(url: URL): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!url || !isValidHttpsURL(url)) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS, message: 'Invalid Url: Only https URL is allowed' };\n }\n\n return sendAndHandleSdkError(\n getApiVersionTag(secondaryBrowserTelemetryVersionNumber, ApiName.SecondaryBrowser_OpenUrl),\n 'secondaryBrowser.open',\n url.toString(),\n );\n }\n\n /**\n * Checks if secondaryBrowser capability is supported by the host\n * @returns boolean to represent whether secondaryBrowser is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.secondaryBrowser ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { locationAPIsRequiredVersion } from '../internal/constants';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst locationTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n/**\n * @deprecated\n * As of 2.1.0, please use geoLocation namespace.\n *\n * Namespace to interact with the location module-specific part of the SDK.\n */\nexport namespace location {\n /** Get location callback function type */\n export type getLocationCallbackFunctionType = (error: SdkError, location: Location) => void;\n /** Show location callback function type */\n export type showLocationCallbackFunctionType = (error: SdkError, status: boolean) => void;\n\n /**\n * @deprecated\n * Data Structure to set the location properties in getLocation call.\n */\n export interface LocationProps {\n /**\n whether user can alter location or not\n if false, user will be shown current location \n and wouldn't be allowed to alter it\n */\n allowChooseLocation: boolean;\n /**\n whether selected location should be shown to user on map or not.\n If allowChooseLocation is true, this parameter will be ignored by platform.\n If allowChooseLocation is false, and this parameter is not provided, default \n value will be false.\n */\n showMap?: boolean;\n }\n\n /**\n * @deprecated\n * Data struture to represent the location information\n */\n export interface Location {\n /**\n Latitude of the location\n */\n latitude: number;\n /**\n Longitude of the location\n */\n longitude: number;\n /**\n Accuracy of the coordinates captured\n */\n accuracy?: number;\n /**\n Time stamp when the location was captured\n */\n timestamp?: number;\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use one of the following functions:\n * - {@link geoLocation.getCurrentLocation geoLocation.getCurrentLocation(): Promise\\<Location\\>} to get the current location.\n * - {@link geoLocation.map.chooseLocation geoLocation.map.chooseLocation(): Promise\\<Location\\>} to choose location on map.\n *\n * Fetches user location\n * @param props {@link LocationProps} - Specifying how the location request is handled\n * @param callback - Callback to invoke when current user location is fetched\n */\n export function getLocation(props: LocationProps, callback: getLocationCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[location.getLocation] Callback cannot be null');\n }\n\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n\n if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n if (!props) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n sendMessageToParent(\n getApiVersionTag(locationTelemetryVersionNumber, ApiName.Location_GetLocation),\n 'location.getLocation',\n [props],\n callback,\n );\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use {@link geoLocation.map.showLocation geoLocation.map.showLocation(location: Location): Promise\\<void\\>} instead.\n *\n * Shows the location on map corresponding to the given coordinates\n *\n * @param location - Location to be shown on the map\n * @param callback - Callback to invoke when the location is opened on map\n */\n export function showLocation(location: Location, callback: showLocationCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[location.showLocation] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n if (!location) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n sendMessageToParent(\n getApiVersionTag(locationTelemetryVersionNumber, ApiName.Location_ShowLocation),\n 'location.showLocation',\n [location],\n callback,\n );\n }\n\n /**\n * @deprecated\n * As of 2.1.0, please use geoLocation namespace, and use {@link geoLocation.isSupported geoLocation.isSupported: boolean} to check if geoLocation is supported.\n *\n * Checks if Location capability is supported by the host\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @returns boolean to represent whether Location is supported\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.location ? true : false;\n }\n}\n","import { sendAndHandleSdkError, sendMessageToParent } from '../internal/communication';\nimport { doesHandlerExist, registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst meetingTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n/**\n * Interact with meetings, including retrieving meeting details, getting mic status, and sharing app content.\n * This namespace is used to handle meeting related functionality like\n * get meeting details, get/update state of mic, sharing app content and more.\n *\n * To learn more, visit https://aka.ms/teamsmeetingapps\n */\nexport namespace meeting {\n /** Error callback function type */\n export type errorCallbackFunctionType = (error: SdkError | null, result: boolean | null) => void;\n /** Get live stream state callback function type */\n export type getLiveStreamStateCallbackFunctionType = (\n error: SdkError | null,\n liveStreamState: LiveStreamState | null,\n ) => void;\n /** Live stream error callback function type */\n export type liveStreamErrorCallbackFunctionType = (error: SdkError | null) => void;\n /** Register live stream changed handler function type */\n export type registerLiveStreamChangedHandlerFunctionType = (liveStreamState: LiveStreamState) => void;\n /** Get app content stage sharing capabilities callback function type */\n export type getAppContentCallbackFunctionType = (\n error: SdkError | null,\n appContentStageSharingCapabilities: IAppContentStageSharingCapabilities | null,\n ) => void;\n /** Get app content stage sharing state callback function type */\n export type getAppContentStageCallbackFunctionType = (\n error: SdkError | null,\n appContentStageSharingState: IAppContentStageSharingState | null,\n ) => void;\n /** Register speaking state change handler function type */\n export type registerSpeakingStateChangeHandlerFunctionType = (speakingState: ISpeakingState) => void;\n /**\n * @hidden\n * Data structure to represent meeting details\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IMeetingDetailsResponse {\n /**\n * @hidden\n * details object\n */\n details: IMeetingDetails | ICallDetails;\n\n /**\n * @hidden\n * conversation object\n */\n conversation: IConversation;\n\n /**\n * @hidden\n * organizer object\n */\n organizer: IOrganizer;\n }\n\n /**\n * @hidden\n * Hide from docs\n * Base data structure to represent a meeting or call detail\n */\n export interface IMeetingOrCallDetailsBase<T> {\n /**\n * @hidden\n * Scheduled start time of the meeting or start time of the call\n */\n scheduledStartTime: string;\n\n /**\n * @hidden\n * url to join the current meeting or call\n */\n joinUrl?: string;\n\n /**\n * @hidden\n * type of the meeting or call\n */\n type?: T;\n }\n\n /**\n * @hidden\n * Hide from docs\n * Data structure to represent call details\n */\n export interface ICallDetails extends IMeetingOrCallDetailsBase<CallType> {\n /**\n * @hidden\n * Phone number of a PSTN caller or email of a VoIP caller\n */\n originalCaller?: string;\n\n /**\n * @hidden\n * Phone number of a PSTN callee or email of a VoIP callee\n */\n dialedEntity?: never;\n\n /**\n * @hidden\n * Tracking identifier for grouping related calls\n */\n trackingId?: never;\n }\n\n /**\n * @hidden\n * Hide from docs\n * Data structure to represent meeting details.\n */\n export interface IMeetingDetails extends IMeetingOrCallDetailsBase<MeetingType> {\n /**\n * @hidden\n * Scheduled end time of the meeting\n */\n scheduledEndTime: string;\n\n /**\n * @hidden\n * event id of the meeting\n */\n id?: string;\n\n /**\n * @hidden\n * meeting title name of the meeting\n */\n title?: string;\n }\n\n /**\n * @hidden\n * Data structure to represent a conversation object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IConversation {\n /**\n * @hidden\n * conversation id of the meeting\n */\n id: string;\n }\n\n /**\n * @hidden\n * Data structure to represent an organizer object.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface IOrganizer {\n /**\n * @hidden\n * organizer id of the meeting\n */\n id?: string;\n /**\n * @hidden\n * tenant id of the meeting\n */\n tenantId?: string;\n }\n\n /**\n * Represents the current Real-Time Messaging Protocol (RTMP) live streaming state of a meeting.\n *\n * @remarks\n * RTMP is a popular communication protocol for streaming audio, video, and data over the Internet.\n */\n export interface LiveStreamState {\n /**\n * true when the current meeting is being streamed through RTMP, or false if it is not.\n */\n isStreaming: boolean;\n\n /**\n * error object in case there is a failure\n */\n error?: {\n /** error code from the streaming service, e.g. IngestionFailure */\n code: string;\n /** detailed error message string */\n message?: string;\n };\n }\n\n /** Defines additional sharing options which can be provided to the {@link shareAppContentToStage} API. */\n export interface IShareAppContentToStageOptions {\n /**\n * The protocol option for sharing app content to the meeting stage. Defaults to `Collaborative`.\n * See {@link SharingProtocol} for more information.\n */\n sharingProtocol?: SharingProtocol;\n }\n\n /** Represents app permission to share contents to meeting. */\n export interface IAppContentStageSharingCapabilities {\n /**\n * indicates whether app has permission to share contents to meeting stage.\n * true when your `configurableTabs` or `staticTabs` entry's `context` array includes `meetingStage`.\n */\n doesAppHaveSharePermission: boolean;\n }\n\n /** Represents app being shared to stage. */\n export interface IAppContentStageSharingState {\n /**\n * indicates whether app is currently being shared to stage\n */\n isAppSharing: boolean;\n }\n\n /**\n * Property bag for the speakingState changed event\n *\n */\n export interface ISpeakingState {\n /**\n * true when one or more participants in a meeting are speaking, or false if no participants are speaking\n */\n isSpeakingDetected: boolean;\n\n /**\n * error object in case there is a failure\n */\n error?: SdkError;\n }\n\n /**\n * Property bag for the meeting reaction received event\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface MeetingReactionReceivedEventData {\n /**\n * Indicates the type of meeting reaction received\n *\n * @hidden\n * Hide from docs.\n */\n meetingReactionType?: MeetingReactionType;\n /**\n * error object in case there is a failure\n *\n * @hidden\n * Hide from docs.\n */\n error?: SdkError;\n }\n\n /**\n * Interface for raiseHandState properties\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface IRaiseHandState {\n /** Indicates whether the selfParticipant's hand is raised or not\n *\n * @hidden\n * Hide from docs.\n */\n\n isHandRaised: boolean;\n }\n\n /**\n * Property bag for the raiseHandState changed event\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface RaiseHandStateChangedEventData {\n /**\n * entire raiseHandState object for the selfParticipant\n *\n * @hidden\n * Hide from docs.\n */\n raiseHandState: IRaiseHandState;\n\n /**\n * error object in case there is a failure\n *\n * @hidden\n * Hide from docs.\n */\n error?: SdkError;\n }\n\n /**\n * Interface for mic state change\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface MicState {\n /**\n * Indicates the mute status of the mic\n */\n isMicMuted: boolean;\n }\n\n /**\n * Reasons for the app's microphone state to change\n */\n enum MicStateChangeReason {\n HostInitiated,\n AppInitiated,\n AppDeclinedToChange,\n AppFailedToChange,\n }\n\n /**\n * Interface for RequestAppAudioHandling properties\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface RequestAppAudioHandlingParams {\n /**\n * Indicates whether the app is requesting to start handling audio, or if\n * it's giving audio back to the host\n */\n isAppHandlingAudio: boolean;\n /**\n * Callback for the host to tell the app to change its microphone state\n * @param micState The microphone state for the app to use\n * @returns A promise with the updated microphone state\n */\n micMuteStateChangedCallback: (micState: MicState) => Promise<MicState>;\n /**\n * Callback for the host to tell the app to change its speaker selection\n */\n audioDeviceSelectionChangedCallback?: (selectedDevices: AudioDeviceSelection | SdkError) => void;\n }\n\n /**\n * Interface for AudioDeviceSelection from host selection.\n * If the speaker or the microphone is undefined or don't have a device label, you can try to find the default devices\n * by using\n * ```ts\n * const devices = await navigator.mediaDevices.enumerateDevices();\n * const defaultSpeaker = devices.find((d) => d.deviceId === 'default' && d.kind === 'audiooutput');\n * const defaultMic = devices.find((d) => d.deviceId === 'default' && d.kind === 'audioinput');\n * ```\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface AudioDeviceSelection {\n speaker?: AudioDeviceInfo;\n microphone?: AudioDeviceInfo;\n }\n\n /**\n * Interface for AudioDeviceInfo, includes a device label with the same format as {@link MediaDeviceInfo.label}\n *\n * Hosted app can use this label to compare it with the device info fetched from {@link navigator.mediaDevices.enumerateDevices()}.\n * {@link MediaDeviceInfo} has {@link MediaDeviceInfo.deviceId} as an unique identifier, but that id is also unique to the origin\n * of the calling application, so {@link MediaDeviceInfo.deviceId} cannot be used here as an identifier. Notice there are some cases\n * that devices may have the same device label, but we don't have a better way to solve this, keep this as a known limitation for now.\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface AudioDeviceInfo {\n deviceLabel: string;\n }\n\n /**\n * Different types of meeting reactions that can be sent/received\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export enum MeetingReactionType {\n like = 'like',\n heart = 'heart',\n laugh = 'laugh',\n surprised = 'surprised',\n applause = 'applause',\n }\n\n /**\n * Represents the type of a meeting\n *\n * @hidden\n * Hide from docs.\n *\n * @remarks\n * Teams has several types of meetings to account for different user scenarios and requirements.\n */\n export enum MeetingType {\n /**\n * Used when the meeting type is not known.\n *\n * @remarks\n * This response is not an expected case.\n */\n Unknown = 'Unknown',\n /**\n * Used for group call meeting types.\n *\n * @remarks\n * To test this meeting type in Teams, start a chat with two or more users and click the \"Call\" button.\n * Note that a group call may return as this or {@link CallType.GroupCall}. These two different response types should be considered as equal.\n */\n Adhoc = 'Adhoc',\n /**\n * Used for single-occurrence meetings that have been scheduled in advance.\n *\n * @remarks\n * To create a meeting of this type in Teams, press the \"New meeting\" button from the calendar and enter a meeting title.\n * Before saving, ensure that the \"Online Meeting\" field is checked.\n */\n Scheduled = 'Scheduled',\n /**\n * Used for meetings that occur on a recurring basis.\n *\n * @remarks\n * To create a meeting of this type in Teams, press the \"New meeting\" button from the calendar, enter a meeting title, and then change the field labeled \"Does not repeat\" to some other value.\n * Before saving, ensure that the \"Online Meeting\" field is checked.\n */\n Recurring = 'Recurring',\n /**\n * Used for webinars.\n *\n * @remarks\n * Meeting apps are only supported for those in the \"event group\" of a webinar, which are those who'll be presenting and producing the webinar.\n * To learn how to create a meeting of this type, visit https://aka.ms/teams/howto/webinars.\n */\n Broadcast = 'Broadcast',\n /**\n * Used for meet now meetings, which are meetings users create on the fly.\n *\n * @remarks\n * To create a meeting of this type, click the \"Meet now\" button from the calendar in Teams or the \"Teams call\" button in Outlook.\n */\n MeetNow = 'MeetNow',\n }\n\n /**\n * Represents the type of a call.\n *\n * @hidden\n * Hide from docs.\n */\n export enum CallType {\n /**\n * Represents a call between two people.\n *\n * @remarks\n * To test this feature, start a chat with one other user and click the \"Call\" button.\n */\n OneOnOneCall = 'oneOnOneCall',\n /**\n * Represents a call between more than two people.\n *\n * @remarks\n * To test this meeting type in Teams, start a chat with two or more users and click the \"Call\" button.\n * Note that a group call may return as this or {@link MeetingType.Adhoc}. These two different response types should be considered as equal.\n */\n GroupCall = 'groupCall',\n }\n\n /**\n * Represents the protocol option for sharing app content to the meeting stage.\n */\n export enum SharingProtocol {\n /**\n * The default protocol for sharing app content to stage. To learn more, visit https://aka.ms/teamsjs/shareAppContentToStage\n */\n Collaborative = 'Collaborative',\n /**\n * A read-only protocol for sharing app content to stage, which uses screen sharing in meetings. If provided, this protocol will open\n * the specified `contentUrl` passed to the {@link shareAppContentToStage} API in a new instance and screen share that instance.\n */\n ScreenShare = 'ScreenShare',\n }\n\n /**\n * Allows an app to get the incoming audio speaker setting for the meeting user.\n * To learn more, visit https://aka.ms/teamsjs/getIncomingClientAudioState\n *\n * @remarks\n * Use {@link toggleIncomingClientAudio} to toggle the current audio state.\n * For private scheduled meetings, meet now, or calls, include the `OnlineMeetingParticipant.ToggleIncomingAudio.Chat` RSC permission in your app manifest.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization.\n * This API can only be used in the `sidePanel` and `meetingStage` frame contexts.\n *\n * @param callback - Callback contains 2 parameters, `error` and `result`.\n * `error` can either contain an error of type `SdkError`, in case of an error, or null when fetch is successful.\n * `result` will be true when incoming audio is muted and false when incoming audio is unmuted, or null when the request fails.\n */\n export function getIncomingClientAudioState(callback: errorCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[get incoming client audio state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetIncomingClientAudioState),\n 'getIncomingClientAudioState',\n callback,\n );\n }\n\n /**\n * Allows an app to toggle the incoming audio speaker setting for the meeting user from mute to unmute or vice-versa.\n * To learn more, visit https://aka.ms/teamsjs/toggleIncomingClientAudio\n *\n * @remarks\n * Use {@link getIncomingClientAudioState} to get the current audio state.\n * For private scheduled meetings, meet now, or calls, include the `OnlineMeetingParticipant.ToggleIncomingAudio.Chat` RSC permission in your app manifest.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization.\n * This API can only be used in the `sidePanel` and `meetingStage` frame contexts.\n *\n * @param callback - Callback contains 2 parameters, `error` and `result`.\n * `error` can either contain an error of type `SdkError`, in case of an error, or null when toggle is successful.\n * `result` will be true when incoming audio is muted and false when incoming audio is unmuted, or null when the toggling fails.\n */\n export function toggleIncomingClientAudio(callback: errorCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[toggle incoming client audio] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_ToggleIncomingClientAudio),\n 'toggleIncomingClientAudio',\n callback,\n );\n }\n\n /**\n * @throws error if your app manifest does not include the `OnlineMeeting.ReadBasic.Chat` RSC permission.\n * Find the app manifest reference at https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema.\n * Find the RSC reference at https://learn.microsoft.com/en-us/microsoftteams/platform/graph-api/rsc/resource-specific-consent.\n *\n * @hidden\n * Allows an app to get the meeting details for the meeting\n *\n * @param callback - Callback contains 2 parameters, `error` and `meetingDetailsResponse`.\n * `error` can either contain an error of type `SdkError`, in case of an error, or null when get is successful\n * `result` can either contain a {@link IMeetingDetailsResponse} value, in case of a successful get or null when the get fails\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getMeetingDetails(\n callback: (error: SdkError | null, meetingDetails: IMeetingDetailsResponse | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get meeting details] Callback cannot be null');\n }\n ensureInitialized(\n runtime,\n FrameContexts.sidePanel,\n FrameContexts.meetingStage,\n FrameContexts.settings,\n FrameContexts.content,\n );\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetMeetingDetails),\n 'meeting.getMeetingDetails',\n callback,\n );\n }\n\n /**\n * @throws error if your app manifest does not include both the `OnlineMeeting.ReadBasic.Chat` RSC permission\n * and the `OnlineMeetingParticipant.Read.Chat` RSC permission.\n * Find the app manifest reference at https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema.\n * Find the RSC reference at https://learn.microsoft.com/en-us/microsoftteams/platform/graph-api/rsc/resource-specific-consent.\n *\n * @throws `not supported on platform` error if your app is run on a host that does not support returning additional meeting details.\n *\n * @hidden\n * Allows an app to get the additional meeting details for the meeting.\n * Some additional details are returned on a best-effort basis. They may not be present for every meeting.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export async function getMeetingDetailsVerbose(): Promise<IMeetingDetailsResponse> {\n ensureInitialized(\n runtime,\n FrameContexts.sidePanel,\n FrameContexts.meetingStage,\n FrameContexts.settings,\n FrameContexts.content,\n );\n\n let response: IMeetingDetailsResponse;\n try {\n const shouldGetVerboseDetails = true;\n response = (await sendAndHandleSdkError(\n getApiVersionTag(ApiVersionNumber.V_2, ApiName.Meeting_GetMeetingDetailsVerbose),\n 'meeting.getMeetingDetails',\n shouldGetVerboseDetails,\n )) as IMeetingDetailsResponse;\n } catch (error) {\n throw new Error(error?.errorCode?.toString());\n }\n\n if (\n (response.details?.type == CallType.GroupCall || response.details?.type == CallType.OneOnOneCall) &&\n !response.details.originalCaller\n ) {\n throw new Error(ErrorCode.NOT_SUPPORTED_ON_PLATFORM.toString());\n }\n\n return response;\n }\n\n /**\n * @hidden\n * Allows an app to get the authentication token for the anonymous or guest user in the meeting\n *\n * @param callback - Callback contains 2 parameters, `error` and `authenticationTokenOfAnonymousUser`.\n * `error` can either contain an error of type `SdkError`, in case of an error, or null when get is successful\n * `authenticationTokenOfAnonymousUser` can either contain a string value, in case of a successful get or null when the get fails\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function getAuthenticationTokenForAnonymousUser(\n callback: (error: SdkError | null, authenticationTokenOfAnonymousUser: string | null) => void,\n ): void {\n if (!callback) {\n throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetAuthenticationTokenForAnonymousUser),\n 'meeting.getAuthenticationTokenForAnonymousUser',\n callback,\n );\n }\n\n /**\n * Allows an app to get the state of the outgoing live stream in the current meeting.\n *\n * @remarks\n * Use {@link requestStartLiveStreaming} or {@link requestStopLiveStreaming} to start/stop a live stream.\n * This API can only be used in the `sidePanel` frame context.\n * The `meetingExtensionDefinition.supportsStreaming` field in your app manifest must be `true` to use this API.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/meetingExtensionDefinition.\n *\n * @param callback - Callback contains 2 parameters: `error` and `liveStreamState`.\n * `error` can either contain an error of type `SdkError`, in case of an error, or null when the request is successful\n * `liveStreamState` can either contain a `LiveStreamState` value, or null when operation fails\n */\n export function getLiveStreamState(callback: getLiveStreamStateCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[get live stream state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetLiveStreamState),\n 'meeting.getLiveStreamState',\n callback,\n );\n }\n\n /**\n * Allows an app to ask the local user to begin live streaming the current meeting to the given Real-Time Messaging Protocol (RTMP) stream url.\n * A confirmation dialog will be shown to the local user with options to \"Allow\" or \"Cancel\" this request.\n *\n * @remarks\n * Meeting content (e.g., user video, screenshare, audio, etc.) can be externally streamed to any platform that supports the popular RTMP standard.\n * Content broadcasted through RTMP is automatically formatted and cannot be customized.\n * Use {@link getLiveStreamState} or {@link registerLiveStreamChangedHandler} to get updates on the live stream state.\n * This API can only be used in the `sidePanel` frame context.\n * The `meetingExtensionDefinition.supportsStreaming` field in your app manifest must be `true` to use this API.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/meetingExtensionDefinition.\n *\n * @param callback - completion callback that contains an `error` parameter, which can be of type `SdkError` in case of an error, or null when operation is successful\n * @param streamUrl - the url to the RTMP stream resource\n * @param streamKey - the key to the RTMP stream resource\n */\n export function requestStartLiveStreaming(\n callback: liveStreamErrorCallbackFunctionType,\n streamUrl: string,\n streamKey?: string,\n ): void {\n if (!callback) {\n throw new Error('[request start live streaming] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RequestStartLiveStreaming),\n 'meeting.requestStartLiveStreaming',\n [streamUrl, streamKey],\n callback,\n );\n }\n\n /**\n * Allows an app to request that live streaming be stopped.\n *\n * @remarks\n * Use {@link getLiveStreamState} or {@link registerLiveStreamChangedHandler} to get updates on the live stream state.\n * This API can only be used in the `sidePanel` frame context.\n * The `meetingExtensionDefinition.supportsStreaming` field in your app manifest must be `true` to use this API.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/meetingExtensionDefinition.\n *\n * @param callback - completion callback that contains an error parameter, which can be of type `SdkError` in case of an error, or null when operation is successful\n */\n export function requestStopLiveStreaming(callback: liveStreamErrorCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[request stop live streaming] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RequestStopLiveStreaming),\n 'meeting.requestStopLiveStreaming',\n callback,\n );\n }\n\n /**\n * Registers an event handler for state changes to the live stream.\n *\n * @remarks\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * Use {@link requestStartLiveStreaming} or {@link requestStopLiveStreaming} to start/stop a live stream.\n * This API can only be used in the `sidePanel` frame context.\n * The `meetingExtensionDefinition.supportsStreaming` field in your app manifest must be `true` to use this API.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/meetingExtensionDefinition.\n *\n * @param handler - The handler to invoke when the live stream state changes\n */\n export function registerLiveStreamChangedHandler(handler: registerLiveStreamChangedHandlerFunctionType): void {\n if (!handler) {\n throw new Error('[register live stream changed handler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel);\n registerHandler(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterLiveStreamChangedHandler),\n 'meeting.liveStreamChanged',\n handler,\n );\n }\n\n /**\n * Allows an app to share a given URL to the meeting stage for all users in the meeting.\n * To learn more, visit https://aka.ms/teamsjs/shareAppContentToStage\n *\n * @remarks\n * This API can only be used in the `sidePanel` and `meetingStage` frame contexts.\n * For private scheduled meetings, meet now, or calls, include the `MeetingStage.Write.Chat` RSC permission in your app manifest.\n * For channel meetings, include the `ChannelMeetingStage.Write.Group` RSC permission in your app manifest.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization.\n * Use {@link getAppContentStageSharingCapabilities} to determine if the local user is eligible to use this API.\n * Use {@link getAppContentStageSharingState} to determine whether app content is already being shared to the meeting stage.\n *\n * @param callback - Callback contains 2 parameters, `error` and `result`.\n * `error` can either contain an error of type `SdkError`, in case of an error, or null when share is successful\n * `result` can either contain a true value, in case of a successful share or null when the share fails\n * @param appContentUrl - is the input URL to be shared to the meeting stage.\n * the URL origin must be included in your app manifest's `validDomains` field.\n * @param shareOptions - is an object that contains additional sharing options. If omitted, the default\n * sharing protocol will be `Collaborative`. See {@link IShareAppContentToStageOptions} for more information.\n */\n export function shareAppContentToStage(\n callback: errorCallbackFunctionType,\n appContentUrl: string,\n shareOptions: IShareAppContentToStageOptions = { sharingProtocol: SharingProtocol.Collaborative },\n ): void {\n if (!callback) {\n throw new Error('[share app content to stage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_ShareAppContentToStage),\n 'meeting.shareAppContentToStage',\n [appContentUrl, shareOptions],\n callback,\n );\n }\n\n /**\n * Allows an app to request whether the local user's app version has the required app manifest permissions to share content to meeting stage.\n * To learn more, visit https://aka.ms/teamsjs/getAppContentStageSharingCapabilities\n *\n * @remarks\n * If you are updating your published app to include the share to stage feature, you can use this API to prompt users to update their app if they are using an older version.\n * Your app's `configurableTabs` or `staticTabs` entry's `context` array must include `meetingStage` for `doesAppHaveSharePermission` to be `true` in the `callback` response.\n *\n * @throws error if API is being used outside of `sidePanel` or `meetingStage` frame contexts.\n * @throws error if your app manifest does not include the `MeetingStage.Write.Chat` RSC permission in your app manifest in a private scheduled meeting, meet now, or call --\n * or if it does not include the `ChannelMeetingStage.Write.Group` RSC permission in your app manifest in a channel meeting.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization.\n *\n * @param callback - Completion callback contains 2 parameters: `error` and `appContentStageSharingCapabilities`.\n * `error` can either contain an error of type `SdkError` (error indication), or null (non-error indication).\n * `appContentStageSharingCapabilities` will contain an {@link IAppContentStageSharingCapabilities} object if the request succeeds, or null if it failed.\n */\n export function getAppContentStageSharingCapabilities(callback: getAppContentCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[get app content stage sharing capabilities] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetAppContentStageSharingCapabilities),\n 'meeting.getAppContentStageSharingCapabilities',\n callback,\n );\n }\n\n /**\n * @hidden\n * Hide from docs.\n * Terminates current stage sharing session in meeting\n *\n * @param callback - Callback contains 2 parameters, error and result.\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\n * result can either contain a true boolean value (successful termination), or null (unsuccessful fetch)\n */\n export function stopSharingAppContentToStage(callback: errorCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[stop sharing app content to stage] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_StopSharingAppContentToStage),\n 'meeting.stopSharingAppContentToStage',\n callback,\n );\n }\n\n /**\n * Provides information related to current stage sharing state for your app.\n * To learn more, visit https://aka.ms/teamsjs/getAppContentStageSharingState\n *\n * @remarks\n * This API can only be used in the `sidePanel` and `meetingStage` frame contexts.\n * For private scheduled meetings, meet now, or calls, include the `MeetingStage.Write.Chat` RSC permission in your app manifest.\n * For channel meetings, include the `ChannelMeetingStage.Write.Group` RSC permission in your app manifest.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization.\n *\n * @param callback - Callback contains 2 parameters, `error` and `appContentStageSharingState`.\n * error can either contain an error of type SdkError (error indication), or null (non-error indication)\n * `appContentStageSharingState` can either contain an `IAppContentStageSharingState` object if the request succeeds, or null if it failed\n */\n export function getAppContentStageSharingState(callback: getAppContentStageCallbackFunctionType): void {\n if (!callback) {\n throw new Error('[get app content stage sharing state] Callback cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_GetAppContentStageSharingState),\n 'meeting.getAppContentStageSharingState',\n callback,\n );\n }\n\n /**\n * Registers a handler for changes to participant speaking states.\n * To learn more, visit https://aka.ms/teamsjs/registerSpeakingStateChangeHandler\n *\n * @remarks\n * This API returns {@link ISpeakingState}, which will have `isSpeakingDetected` and/or an error object.\n * If any participant is speaking, `isSpeakingDetected` will be true, or false if no participants are speaking.\n * Only one handler can be registered at a time. Subsequent registrations replace existing registrations.\n * This API can only be used in the `sidePanel` and `meetingStage` frame contexts.\n * For private scheduled meetings, meet now, or calls, include the `OnlineMeetingIncomingAudio.Detect.Chat` RSC permission in your app manifest.\n * For channel meetings, include the `OnlineMeetingIncomingAudio.Detect.Group` RSC permission in your app manifest.\n * Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization.\n *\n * @param handler The handler to invoke when the speaking state of any participant changes (start/stop speaking).\n */\n export function registerSpeakingStateChangeHandler(handler: registerSpeakingStateChangeHandlerFunctionType): void {\n if (!handler) {\n throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterSpeakingStateChangeHandler),\n 'meeting.speakingStateChanged',\n handler,\n );\n }\n\n /**\n * Registers a handler for changes to the selfParticipant's (current user's) raiseHandState. If the selfParticipant raises their hand, isHandRaised\n * will be true. By default and if the selfParticipant hand is lowered, isHandRaised will be false. This API will return {@link RaiseHandStateChangedEventData}\n * that will have the raiseHandState or an error object. Only one handler can be registered at a time. A subsequent registration\n * replaces an existing registration.\n *\n * @param handler The handler to invoke when the selfParticipant's (current user's) raiseHandState changes.\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function registerRaiseHandStateChangedHandler(\n handler: (eventData: RaiseHandStateChangedEventData) => void,\n ): void {\n if (!handler) {\n throw new Error('[registerRaiseHandStateChangedHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterRaiseHandStateChangedHandler),\n 'meeting.raiseHandStateChanged',\n handler,\n );\n }\n\n /**\n * Registers a handler for receiving meeting reactions. When the selfParticipant (current user) successfully sends a meeting reaction and it is being rendered on the UI, the meetingReactionType will be populated. Only one handler can be registered\n * at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler The handler to invoke when the selfParticipant (current user) successfully sends a meeting reaction\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function registerMeetingReactionReceivedHandler(\n handler: (eventData: MeetingReactionReceivedEventData) => void,\n ): void {\n if (!handler) {\n throw new Error('[registerMeetingReactionReceivedHandler] Handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n registerHandler(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterMeetingReactionReceivedHandler),\n 'meeting.meetingReactionReceived',\n handler,\n );\n }\n\n /**\n * @hidden\n * Hide from docs beacuse it's only used internally as a serialization/deserialization type\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface ISerializedJoinMeetingParams {\n joinWebUrl: string;\n source: EventActionSource;\n }\n\n /**\n * This function is used to join a meeting.\n * This opens a meeting in a new window for the desktop app.\n * In case of a web app, it will close the current app and open the meeting in the same tab.\n * There is currently no support or experience for this on mobile platforms.\n * @param joinMeetingParams This takes {@link JoinMeetingParams} for joining the meeting. If source isn't passed then it is marked as 'Other' by default.\n * @throws error if the meeting join fails, the promise will reject to an object with the error message.\n */\n export function joinMeeting(joinMeetingParams: JoinMeetingParams): Promise<void> {\n if (joinMeetingParams?.joinWebUrl === undefined || joinMeetingParams?.joinWebUrl === null) {\n return Promise.reject(new Error('Invalid joinMeetingParams'));\n }\n\n ensureInitialized(runtime);\n\n const serializedJoinMeetingParams: ISerializedJoinMeetingParams = {\n joinWebUrl: joinMeetingParams.joinWebUrl.href,\n source: joinMeetingParams.source || EventActionSource.Other,\n };\n\n return sendAndHandleSdkError(\n getApiVersionTag(ApiVersionNumber.V_2, ApiName.Meeting_JoinMeeting),\n 'meeting.joinMeeting',\n serializedJoinMeetingParams,\n );\n }\n\n /**\n * Contains information associated with parameters required for joining the Microsoft Teams meetings.\n * More details regarding parameters can be found at:\n * [Online Meeting Base - Microsoft Graph v1.0](https://learn.microsoft.com/en-us/graph/api/resources/onlinemeetingbase?view=graph-rest-1.0)\n */\n export interface JoinMeetingParams {\n /** The join URL of the online meeting. */\n joinWebUrl: URL;\n /** The source of the join button click. If not passed, 'Other' is the default value of source. {@link EventActionSource} */\n source?: EventActionSource;\n }\n\n /** The source of the join button click. */\n export enum EventActionSource {\n /**\n * Source is calendar grid context menu.\n */\n M365CalendarGridContextMenu = 'm365_calendar_grid_context_menu',\n /**\n * Source is calendar grid peek.\n */\n M365CalendarGridPeek = 'm365_calendar_grid_peek',\n /**\n * Source is calendar grid event card join button.\n */\n M365CalendarGridEventCardJoinButton = 'm365_calendar_grid_event_card_join_button',\n /**\n * Source is calendar form ribbon join button.\n */\n M365CalendarFormRibbonJoinButton = 'm365_calendar_form_ribbon_join_button',\n /**\n * Source is calendar form join teams meeting button.\n */\n M365CalendarFormJoinTeamsMeetingButton = 'm365_calendar_form_join_teams_meeting_button',\n /**\n * Other sources.\n */\n Other = 'other',\n }\n\n /**\n * Nested namespace for functions to control behavior of the app share button\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export namespace appShareButton {\n /**\n * Property bag for the setVisibilityInfo\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export interface ShareInformation {\n /**\n * boolean flag to set show or hide app share button\n */\n isVisible: boolean;\n\n /**\n * optional string contentUrl, which will override contentUrl coming from Manifest\n */\n contentUrl?: string;\n }\n /**\n * By default app share button will be hidden and this API will govern the visibility of it.\n *\n * This function can be used to hide/show app share button in meeting,\n * along with contentUrl (overrides contentUrl populated in app manifest)\n * @throws standard Invalid Url error\n * @param shareInformation has two elements, one isVisible boolean flag and another\n * optional string contentUrl, which will override contentUrl coming from Manifest\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function setOptions(shareInformation: ShareInformation): void {\n ensureInitialized(runtime, FrameContexts.sidePanel);\n if (shareInformation.contentUrl) {\n new URL(shareInformation.contentUrl);\n }\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_AppShareButton_SetOptions),\n 'meeting.appShareButton.setOptions',\n [shareInformation],\n );\n }\n }\n\n /**\n * Have the app handle audio (mic & speaker) and turn off host audio.\n *\n * When {@link RequestAppAudioHandlingParams.isAppHandlingAudio} is true, the host will switch to audioless mode\n * Registers for mic mute status change events, which are events that the app can receive from the host asking the app to\n * mute or unmute the microphone.\n *\n * When {@link RequestAppAudioHandlingParams.isAppHandlingAudio} is false, the host will switch out of audioless mode\n * Unregisters the mic mute status change events so the app will no longer receive these events\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n * @throws Error if {@link RequestAppAudioHandlingParams.micMuteStateChangedCallback} parameter is not defined\n *\n * @param requestAppAudioHandlingParams - {@link RequestAppAudioHandlingParams} object with values for the audio switchover\n * @param callback - Callback with one parameter, the result\n * can either be true (the host is now in audioless mode) or false (the host is not in audioless mode)\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function requestAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n if (!callback) {\n throw new Error('[requestAppAudioHandling] Callback response cannot be null');\n }\n if (!requestAppAudioHandlingParams.micMuteStateChangedCallback) {\n throw new Error('[requestAppAudioHandling] Callback Mic mute state handler cannot be null');\n }\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n\n if (requestAppAudioHandlingParams.isAppHandlingAudio) {\n startAppAudioHandling(requestAppAudioHandlingParams, callback);\n } else {\n stopAppAudioHandling(requestAppAudioHandlingParams, callback);\n }\n }\n\n function startAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n const callbackInternalRequest = (error: SdkError | null, isHostAudioless: boolean | null): void => {\n if (error && isHostAudioless != null) {\n throw new Error('[requestAppAudioHandling] Callback response - both parameters cannot be set');\n }\n if (error) {\n throw new Error(`[requestAppAudioHandling] Callback response - SDK error ${error.errorCode} ${error.message}`);\n }\n if (typeof isHostAudioless !== 'boolean') {\n throw new Error('[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean');\n }\n\n const micStateChangedCallback = async (micState: MicState): Promise<void> => {\n try {\n const newMicState = await requestAppAudioHandlingParams.micMuteStateChangedCallback(micState);\n\n const micStateDidUpdate = newMicState.isMicMuted === micState.isMicMuted;\n setMicStateWithReason(\n newMicState,\n micStateDidUpdate ? MicStateChangeReason.HostInitiated : MicStateChangeReason.AppDeclinedToChange,\n );\n } catch {\n setMicStateWithReason(micState, MicStateChangeReason.AppFailedToChange);\n }\n };\n registerHandler(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterMicStateChangeHandler),\n 'meeting.micStateChanged',\n micStateChangedCallback,\n );\n\n const audioDeviceSelectionChangedCallback = (selectedDevicesInHost: AudioDeviceSelection): void => {\n requestAppAudioHandlingParams.audioDeviceSelectionChangedCallback?.(selectedDevicesInHost);\n };\n registerHandler(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RegisterAudioDeviceSelectionChangedHandler),\n 'meeting.audioDeviceSelectionChanged',\n audioDeviceSelectionChangedCallback,\n );\n\n callback(isHostAudioless);\n };\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RequestAppAudioHandling),\n 'meeting.requestAppAudioHandling',\n [requestAppAudioHandlingParams.isAppHandlingAudio],\n callbackInternalRequest,\n );\n }\n\n function stopAppAudioHandling(\n requestAppAudioHandlingParams: RequestAppAudioHandlingParams,\n callback: (isHostAudioless: boolean) => void,\n ): void {\n const callbackInternalStop = (error: SdkError | null, isHostAudioless: boolean | null): void => {\n if (error && isHostAudioless != null) {\n throw new Error('[requestAppAudioHandling] Callback response - both parameters cannot be set');\n }\n if (error) {\n throw new Error(`[requestAppAudioHandling] Callback response - SDK error ${error.errorCode} ${error.message}`);\n }\n if (typeof isHostAudioless !== 'boolean') {\n throw new Error('[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean');\n }\n\n if (doesHandlerExist('meeting.micStateChanged')) {\n removeHandler('meeting.micStateChanged');\n }\n\n if (doesHandlerExist('meeting.audioDeviceSelectionChanged')) {\n removeHandler('meeting.audioDeviceSelectionChanged');\n }\n\n callback(isHostAudioless);\n };\n\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_RequestAppAudioHandling),\n 'meeting.requestAppAudioHandling',\n [requestAppAudioHandlingParams.isAppHandlingAudio],\n callbackInternalStop,\n );\n }\n\n /**\n * Notifies the host that the microphone state has changed in the app.\n * @param micState - The new state that the microphone is in\n * isMicMuted - Boolean to indicate the current mute status of the mic.\n *\n * @hidden\n * Hide from docs.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @beta\n */\n export function updateMicState(micState: MicState): void {\n setMicStateWithReason(micState, MicStateChangeReason.AppInitiated);\n }\n\n function setMicStateWithReason(micState: MicState, reason: MicStateChangeReason): void {\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(\n getApiVersionTag(meetingTelemetryVersionNumber, ApiName.Meeting_SetMicStateWithReason),\n 'meeting.updateMicState',\n [micState, reason],\n );\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise, InputFunction } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { SdkError } from './interfaces';\nimport { runtime } from './runtime';\n/**\n * @hidden\n * Hidden from Docs\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n\n/**\n * Exceptional APIs telemetry versioning file: v1 and v2 APIs are mixed together in this file\n */\nconst monetizationTelemetryVersionNumber_v1: ApiVersionNumber = ApiVersionNumber.V_1;\nconst monetizationTelemetryVersionNumber_v2: ApiVersionNumber = ApiVersionNumber.V_2;\n\nexport namespace monetization {\n /**\n * @hidden\n * Data structure to represent a subscription plan.\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export interface PlanInfo {\n /**\n * @hidden\n * plan id\n */\n planId: string;\n /**\n * @hidden\n * term of the plan\n */\n term: string;\n }\n\n /**\n * @hidden\n * Open dialog to start user's purchase experience\n *\n * @param planInfo optional parameter. It contains info of the subscription plan pushed to users.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openPurchaseExperience(planInfo?: PlanInfo): Promise<void>;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link monetization.openPurchaseExperience monetization.openPurchaseExperience(planInfo?: PlanInfo): Promise\\<void\\>} instead.\n *\n * @hidden\n * Open dialog to start user's purchase experience\n *\n * @param callback Callback contains 1 parameters, error.\n * @param planInfo optional parameter. It contains info of the subscription plan pushed to users.\n * error can either contain an error of type SdkError, incase of an error, or null when get is successful\n *\n * @internal\n * Limited to Microsoft-internal use\n */\n export function openPurchaseExperience(callback: (error: SdkError | null) => void, planInfo?: PlanInfo): void;\n /**\n * @hidden\n * This function is the overloaded implementation of openPurchaseExperience.\n * Since the method signatures of the v1 callback and v2 promise differ in the type of the first parameter,\n * we need to do an extra check to know the typeof the @param1 to set the proper arguments of the utility function.\n * @param param1\n * @param param2\n * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value\n */\n export function openPurchaseExperience(\n param1: ((error: SdkError | null) => void) | PlanInfo | undefined,\n param2?: PlanInfo,\n ): Promise<void> {\n let callback: ((error: SdkError | null) => void) | undefined;\n let planInfo: PlanInfo | undefined;\n let apiVersionTag = '';\n\n if (typeof param1 === 'function') {\n callback = param1;\n planInfo = param2;\n apiVersionTag = getApiVersionTag(\n monetizationTelemetryVersionNumber_v1,\n ApiName.Monetization_OpenPurchaseExperience,\n );\n } else {\n planInfo = param1;\n apiVersionTag = getApiVersionTag(\n monetizationTelemetryVersionNumber_v2,\n ApiName.Monetization_OpenPurchaseExperience,\n );\n }\n const wrappedFunction: InputFunction<void> = () => {\n return new Promise<void>((resolve) => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndHandleSdkError(apiVersionTag, 'monetization.openPurchaseExperience', planInfo));\n });\n };\n\n ensureInitialized(runtime, FrameContexts.content);\n return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(wrappedFunction, callback);\n }\n\n /**\n * @hidden\n *\n * Checks if the monetization capability is supported by the host\n * @returns boolean to represent whether the monetization capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.monetization ? true : false;\n }\n}\n","import { sendAndHandleStatusAndReason } from '../internal/communication';\nimport { createTeamsDeepLinkForCalendar } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst calendarTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Interact with the user's calendar, including opening calendar items and composing meetings.\n */\nexport namespace calendar {\n /**\n * Opens a calendar item.\n *\n * @param openCalendarItemParams - object containing unique ID of the calendar item to be opened.\n */\n export function openCalendarItem(openCalendarItemParams: OpenCalendarItemParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n if (!openCalendarItemParams.itemId || !openCalendarItemParams.itemId.trim()) {\n throw new Error('Must supply an itemId to openCalendarItem');\n }\n\n resolve(\n sendAndHandleStatusAndReason(\n getApiVersionTag(calendarTelemetryVersionNumber, ApiName.Calendar_OpenCalendarItem),\n 'calendar.openCalendarItem',\n openCalendarItemParams,\n ),\n );\n });\n }\n\n /**\n * Compose a new meeting in the user's calendar.\n *\n * @param composeMeetingParams - object containing various properties to set up the meeting details.\n */\n export function composeMeeting(composeMeetingParams: ComposeMeetingParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n const apiVersionTag = getApiVersionTag(calendarTelemetryVersionNumber, ApiName.Calendar_ComposeMeeting);\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndHandleStatusAndReason(\n apiVersionTag,\n 'executeDeepLink',\n createTeamsDeepLinkForCalendar(\n composeMeetingParams.attendees,\n composeMeetingParams.startTime,\n composeMeetingParams.endTime,\n composeMeetingParams.subject,\n composeMeetingParams.content,\n ),\n ),\n );\n } else {\n resolve(sendAndHandleStatusAndReason(apiVersionTag, 'calendar.composeMeeting', composeMeetingParams));\n }\n });\n }\n\n /**\n * Checks if the calendar capability is supported by the host\n * @returns boolean to represent whether the calendar capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;\n }\n\n /** Open calendar item parameters. */\n export interface OpenCalendarItemParams {\n /** An unique base64-encoded string id that represents the event's unique identifier of the calendar item to be opened. */\n itemId: string;\n }\n\n /** Compose meeting parameters */\n\n export interface ComposeMeetingParams {\n /** An array of email addresses, user name, or user id of the attendees to invite to the meeting. */\n attendees?: string[];\n /** The start time of the meeting in MM/DD/YYYY HH:MM:SS format. */\n startTime?: string;\n /** The end time of the meeting in MM/DD/YYYY HH:MM:SS format. */\n endTime?: string;\n /** The subject line of the meeting. */\n subject?: string;\n /** The body content of the meeting. */\n content?: string;\n }\n}\n","import { sendAndHandleStatusAndReason } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst mailTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Used to interact with mail capability, including opening and composing mail.\n */\nexport namespace mail {\n /**\n * Opens a mail message in the host.\n *\n * @param openMailItemParams - Object that specifies the ID of the mail message.\n */\n export function openMailItem(openMailItemParams: OpenMailItemParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n if (!openMailItemParams.itemId || !openMailItemParams.itemId.trim()) {\n throw new Error('Must supply an itemId to openMailItem');\n }\n\n resolve(\n sendAndHandleStatusAndReason(\n getApiVersionTag(mailTelemetryVersionNumber, ApiName.Mail_OpenMailItem),\n 'mail.openMailItem',\n openMailItemParams,\n ),\n );\n });\n }\n\n /**\n * Compose a new email in the user's mailbox.\n *\n * @param composeMailParams - Object that specifies the type of mail item to compose and the details of the mail item.\n *\n */\n export function composeMail(composeMailParams: ComposeMailParams): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n resolve(\n sendAndHandleStatusAndReason(\n getApiVersionTag(mailTelemetryVersionNumber, ApiName.Mail_ComposeMail),\n 'mail.composeMail',\n composeMailParams,\n ),\n );\n });\n }\n\n /**\n * Checks if the mail capability is supported by the host\n * @returns boolean to represent whether the mail capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.mail ? true : false;\n }\n\n /** Defines the parameters used to open a mail item in the user's mailbox */\n export interface OpenMailItemParams {\n /** An unique base64-encoded string id that represents the itemId or messageId. */\n itemId: string;\n }\n\n /** Defines compose mail types. */\n export enum ComposeMailType {\n /** Compose a new mail message. */\n New = 'new',\n /** Compose a reply to the sender of an existing mail message. */\n Reply = 'reply',\n /** Compose a reply to all recipients of an existing mail message. */\n ReplyAll = 'replyAll',\n /** Compose a new mail message with the content of an existing mail message forwarded to a new recipient. */\n Forward = 'forward',\n }\n\n /**\n * Foundational interface for all other mail compose interfaces\n * Used for holding the type of mail item being composed\n *\n * @typeParam T - the identity type.\n * @see {@link mail.ComposeMailType}\n */\n interface ComposeMailBase<T extends ComposeMailType> {\n /** Type of the mail item being composed. */\n type: T;\n }\n\n /**\n * Parameters supplied when composing a new mail item\n */\n export interface ComposeNewParams extends ComposeMailBase<ComposeMailType.New> {\n /**\n * The To: recipients for the message\n */\n toRecipients?: string[];\n\n /**\n * The Cc: recipients for the message\n */\n ccRecipients?: string[];\n\n /**\n * The Bcc: recipients for the message\n */\n bccRecipients?: string[];\n\n /**\n * The subject of the message\n */\n subject?: string;\n\n /**\n * The body of the message\n */\n message?: string;\n }\n\n /**\n * Parameters supplied when composing a reply to or forward of a message\n *\n * @see {@link ComposeMailType}\n */\n export interface ComposeReplyOrForwardParams<T extends ComposeMailType> extends ComposeMailBase<T> {\n /** An unique base64-encoded string id that represents the mail message. */\n itemid: string;\n }\n\n /**\n * Parameters supplied to {@link composeMail} when composing a new mail item\n *\n * @see {@link ComposeNewParams}\n * @see {@link ComposeReplyOrForwardParams}\n * @see {@link ComposeMailType}\n */\n export type ComposeMailParams =\n | ComposeNewParams\n | ComposeReplyOrForwardParams<ComposeMailType.Reply>\n | ComposeReplyOrForwardParams<ComposeMailType.ReplyAll>\n | ComposeReplyOrForwardParams<ComposeMailType.Forward>;\n}\n","import { GlobalVars } from '../internal/globalVars';\nimport * as Handlers from '../internal/handlers'; // Conflict with some names\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { isNullOrUndefined } from '../internal/typeCheckUtilities';\nimport { ssrSafeWindow } from '../internal/utils';\nimport { errorNotSupportedOnPlatform } from './constants';\nimport { LoadContext } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Namespace containing the set of APIs that support Teams-specific functionalities.\n *\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst teamsAPIsTelemetryVersionNumber_v2: ApiVersionNumber = ApiVersionNumber.V_2;\n\nexport namespace teamsCore {\n /** Ready to unload function type */\n export type readyToUnloadFunctionType = () => void;\n /** Register on load handler function type */\n export type registerOnLoadHandlerFunctionType = (context: LoadContext) => void;\n /** Register before unload handler function type */\n export type registerBeforeUnloadHandlerFunctionType = (readyToUnload: readyToUnloadFunctionType) => boolean;\n /**\n * Enable print capability to support printing page using Ctrl+P and cmd+P\n */\n export function enablePrintCapability(): void {\n if (!GlobalVars.printCapabilityEnabled) {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n GlobalVars.printCapabilityEnabled = true;\n // adding ctrl+P and cmd+P handler\n document.addEventListener('keydown', (event: KeyboardEvent) => {\n if ((event.ctrlKey || event.metaKey) && event.keyCode === 80) {\n print();\n event.cancelBubble = true;\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n });\n }\n }\n\n /**\n * default print handler\n */\n export function print(): void {\n ssrSafeWindow().print();\n }\n\n /**\n * Registers a handler to be called when the page has been requested to load.\n *\n * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/app-caching)\n * for a more detailed explanation about using this API.\n *\n * @param handler - The handler to invoke when the page is loaded.\n *\n * @beta\n */\n export function registerOnLoadHandler(handler: registerOnLoadHandlerFunctionType): void {\n registerOnLoadHandlerHelper(\n getApiVersionTag(teamsAPIsTelemetryVersionNumber_v2, ApiName.TeamsAPIs_RegisterOnLoadHandler),\n handler,\n () => {\n if (!isNullOrUndefined(handler) && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerOnLoadHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param apiVersionTag - The tag indicating API version number with name\n * @param handler - The handler to invoke when the page is loaded.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n *\n * @deprecated\n */\n export function registerOnLoadHandlerHelper(\n apiVersionTag: string,\n handler: registerOnLoadHandlerFunctionType,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n !isNullOrUndefined(handler) && ensureInitialized(runtime);\n\n if (!isNullOrUndefined(handler) && versionSpecificHelper) {\n versionSpecificHelper();\n }\n\n Handlers.registerOnLoadHandler(apiVersionTag, handler);\n }\n\n /**\n * Registers a handler to be called before the page is unloaded.\n *\n * @remarks Check out [App Caching in Teams](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/app-caching)\n * for a more detailed explanation about using this API.\n *\n * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n *\n * @beta\n */\n export function registerBeforeUnloadHandler(handler: registerBeforeUnloadHandlerFunctionType): void {\n registerBeforeUnloadHandlerHelper(\n getApiVersionTag(teamsAPIsTelemetryVersionNumber_v2, ApiName.TeamsAPIs_RegisterBeforeUnloadHandler),\n handler,\n () => {\n if (!isNullOrUndefined(handler) && !isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n },\n );\n }\n\n /**\n * @hidden\n * Undocumented helper function with shared code between deprecated version and current version of the registerBeforeUnloadHandler API.\n *\n * @internal\n * Limited to Microsoft-internal use\n *\n * @param handler - - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.\n *\n * @deprecated\n */\n export function registerBeforeUnloadHandlerHelper(\n apiVersionTag: string,\n handler: registerBeforeUnloadHandlerFunctionType,\n versionSpecificHelper?: () => void,\n ): void {\n // allow for registration cleanup even when not finished initializing\n !isNullOrUndefined(handler) && ensureInitialized(runtime);\n if (!isNullOrUndefined(handler) && versionSpecificHelper) {\n versionSpecificHelper();\n }\n Handlers.registerBeforeUnloadHandler(apiVersionTag, handler);\n }\n\n /**\n * Checks if teamsCore capability is supported by the host\n *\n * @returns boolean to represent whether the teamsCore capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { peoplePickerRequiredVersion } from '../internal/constants';\nimport { ensureInitialized, isCurrentSDKVersionAtLeast } from '../internal/internalAPIs';\nimport { validatePeoplePickerInput } from '../internal/mediaUtil';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { callCallbackWithErrorOrResultFromPromiseAndReturnPromise } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * Allows your app to add a people picker enabling users to search for and select people in their organization.\n *\n * Exceptional APIs telemetry versioning file: v1 and v2 APIs are mixed together in this file\n */\nconst peopleTelemetryVersionNumber_v1: ApiVersionNumber = ApiVersionNumber.V_1;\nconst peopleTelemetryVersionNumber_v2: ApiVersionNumber = ApiVersionNumber.V_2;\n\nexport namespace people {\n /** Select people callback function type */\n export type selectPeopleCallbackFunctionType = (error: SdkError, people: PeoplePickerResult[]) => void;\n /**\n * Launches a people picker and allows the user to select one or more people from the list\n * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel\n \n * @param callback - Returns list of JSON object of type PeoplePickerResult which consists of Microsoft Entra IDs, display names and emails of the selected users\n * @param peoplePickerInputs - Input parameters to launch customized people picker\n * @returns Promise that will be fulfilled when the operation has completed\n */\n export function selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise<PeoplePickerResult[]>;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link people.selectPeople people.selectPeople(peoplePickerInputs?: PeoplePickerInputs): Promise\\<PeoplePickerResult[]\\>} instead.\n *\n * Launches a people picker and allows the user to select one or more people from the list\n * If the app is added to personal app scope the people picker launched is org wide and if the app is added to a chat/channel, people picker launched is also limited to the members of chat/channel\n \n * @param callback - Returns list of JSON object of type PeoplePickerResult which consists of Microsoft Entra IDs, display names and emails of the selected users\n * @param peoplePickerInputs - Input parameters to launch customized people picker\n */\n export function selectPeople(\n callback: selectPeopleCallbackFunctionType,\n peoplePickerInputs?: PeoplePickerInputs,\n ): void;\n /**\n * @hidden\n * This function is the overloaded implementation of selectPeople.\n * Since the method signatures of the v1 callback and v2 promise differ in the type of the first parameter,\n * we need to do an extra check to know the typeof the @param1 to set the proper arguments of the utility function.\n * @param param1\n * @param param2\n * @returns Promise of Array of PeoplePickerResult objects.\n */\n export function selectPeople(\n param1: PeoplePickerInputs | selectPeopleCallbackFunctionType | undefined,\n param2?: PeoplePickerInputs,\n ): Promise<PeoplePickerResult[]> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);\n\n let callback: selectPeopleCallbackFunctionType | undefined = undefined;\n let peoplePickerInputs: PeoplePickerInputs | undefined = undefined;\n let apiVersionTag = '';\n\n if (typeof param1 === 'function') {\n [callback, peoplePickerInputs] = [param1, param2];\n apiVersionTag = getApiVersionTag(peopleTelemetryVersionNumber_v1, ApiName.People_SelectPeople);\n } else {\n peoplePickerInputs = param1;\n apiVersionTag = getApiVersionTag(peopleTelemetryVersionNumber_v2, ApiName.People_SelectPeople);\n }\n\n return callCallbackWithErrorOrResultFromPromiseAndReturnPromise<PeoplePickerResult[]>(\n selectPeopleHelper,\n callback /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */,\n apiVersionTag,\n peoplePickerInputs,\n );\n }\n\n function selectPeopleHelper(\n apiVersionTag: string,\n peoplePickerInputs?: PeoplePickerInputs,\n ): Promise<PeoplePickerResult[]> {\n return new Promise<PeoplePickerResult[]>((resolve) => {\n if (!isCurrentSDKVersionAtLeast(peoplePickerRequiredVersion)) {\n throw { errorCode: ErrorCode.OLD_PLATFORM };\n }\n\n if (!validatePeoplePickerInput(peoplePickerInputs)) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS };\n }\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */\n resolve(sendAndHandleSdkError(apiVersionTag, 'people.selectPeople', peoplePickerInputs));\n });\n }\n\n /**\n * Input parameter supplied to the People Picker API\n */\n export interface PeoplePickerInputs {\n /**\n * Optional; Set title for the people picker\n * Default value is \"Select people\" for multiselect and \"Select a person\" for single select\n */\n title?: string;\n\n /**\n * Optional; Microsoft Entra IDs of the users to be pre-populated in the search box of people picker control\n * If single select is enabled this value, only the first user in the list will be pre-populated\n * Default value is null\n */\n setSelected?: string[];\n\n /**\n * Optional; launches the people picker in org wide scope even if the app is added to a chat or channel\n * Default value is false\n */\n openOrgWideSearchInChatOrChannel?: boolean;\n\n /**\n * Optional; launches the people picker for which only 1 person can be selected\n * Default value is false\n */\n singleSelect?: boolean;\n }\n\n /**\n * Output user object of people picker API\n */\n export interface PeoplePickerResult {\n /**\n * user object ID (also known as Microsoft Entra ID) of the selected user\n */\n objectId: string;\n\n /**\n * Optional; display name of the selected user\n */\n displayName?: string;\n\n /**\n * Optional; email of the selected user\n */\n email?: string;\n }\n\n /**\n * Checks if the people capability is supported by the host\n * @returns boolean to represent whether the people capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.people ? true : false;\n }\n}\n","import { profile } from '../public/profile';\n\n/**\n * @hidden\n * Validates the request parameters\n * @param showProfileRequest The request parameters\n * @returns true if the parameters are valid, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateShowProfileRequest(\n showProfileRequest: profile.ShowProfileRequest,\n): [boolean, string | undefined] {\n if (!showProfileRequest) {\n return [false, 'A request object is required'];\n }\n\n // Validate modality\n if (showProfileRequest.modality && typeof showProfileRequest.modality !== 'string') {\n return [false, 'modality must be a string'];\n }\n\n // Validate targetElementBoundingRect\n if (\n !showProfileRequest.targetElementBoundingRect ||\n typeof showProfileRequest.targetElementBoundingRect !== 'object'\n ) {\n return [false, 'targetElementBoundingRect must be a DOMRect'];\n }\n\n // Validate triggerType\n if (!showProfileRequest.triggerType || typeof showProfileRequest.triggerType !== 'string') {\n return [false, 'triggerType must be a valid string'];\n }\n\n return validatePersona(showProfileRequest.persona);\n}\n\n/**\n * @hidden\n * Validates the persona that is used to resolve the profile target\n * @param persona The persona object\n * @returns true if the persona is valid, false otherwise\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nfunction validatePersona(persona: profile.Persona): [boolean, string | undefined] {\n if (!persona) {\n return [false, 'persona object must be provided'];\n }\n\n if (persona.displayName && typeof persona.displayName !== 'string') {\n return [false, 'displayName must be a string'];\n }\n\n if (!persona.identifiers || typeof persona.identifiers !== 'object') {\n return [false, 'persona identifiers object must be provided'];\n }\n\n if (!persona.identifiers.AadObjectId && !persona.identifiers.Smtp && !persona.identifiers.Upn) {\n return [false, 'at least one valid identifier must be provided'];\n }\n\n if (persona.identifiers.AadObjectId && typeof persona.identifiers.AadObjectId !== 'string') {\n return [false, 'AadObjectId identifier must be a string'];\n }\n\n if (persona.identifiers.Smtp && typeof persona.identifiers.Smtp !== 'string') {\n return [false, 'Smtp identifier must be a string'];\n }\n\n if (persona.identifiers.Upn && typeof persona.identifiers.Upn !== 'string') {\n return [false, 'Upn identifier must be a string'];\n }\n\n return [true, undefined];\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { validateShowProfileRequest } from '../internal/profileUtil';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from './constants';\nimport { ErrorCode } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst profileTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Namespace for profile related APIs.\n *\n * @beta\n */\nexport namespace profile {\n /**\n * Opens a profile card at a specified position to show profile information about a persona.\n * @param showProfileRequest The parameters to position the card and identify the target user.\n * @returns Promise that will be fulfilled when the operation has completed\n *\n * @beta\n */\n export function showProfile(showProfileRequest: ShowProfileRequest): Promise<void> {\n ensureInitialized(runtime, FrameContexts.content);\n\n return new Promise<void>((resolve) => {\n const [isValid, message] = validateShowProfileRequest(showProfileRequest);\n if (!isValid) {\n throw { errorCode: ErrorCode.INVALID_ARGUMENTS, message };\n }\n\n // Convert the app provided parameters to the form suitable for postMessage.\n const requestInternal: ShowProfileRequestInternal = {\n modality: showProfileRequest.modality,\n persona: showProfileRequest.persona,\n triggerType: showProfileRequest.triggerType,\n targetRectangle: {\n x: showProfileRequest.targetElementBoundingRect.x,\n y: showProfileRequest.targetElementBoundingRect.y,\n width: showProfileRequest.targetElementBoundingRect.width,\n height: showProfileRequest.targetElementBoundingRect.height,\n },\n };\n\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(profileTelemetryVersionNumber, ApiName.Profile_ShowProfile),\n 'profile.showProfile',\n requestInternal,\n ),\n );\n });\n }\n\n /**\n * The type of modalities that are supported when showing a profile.\n * Can be provided as an optional hint with the request and will be\n * respected if the hosting M365 application supports it.\n *\n * @beta\n */\n export type Modality = 'Card' | 'Expanded';\n\n /**\n * The type of the profile trigger.\n * - MouseHover: The user hovered a target.\n * - Press: The target was pressed with either a mouse click or keyboard key press.\n * - AppRequest: The show profile request is happening programmatically, without direct user interaction.\n *\n * @beta\n */\n export type TriggerType = 'MouseHover' | 'Press' | 'AppRequest';\n\n /**\n * The set of identifiers that are supported for resolving the persona.\n *\n * At least one is required, and if multiple are provided then only the highest\n * priority one will be used (AadObjectId > Upn > Smtp). AAD is now known as \"Microsoft Entra ID\"\n *\n * @beta\n */\n export type PersonaIdentifiers = {\n /**\n * The object id in Microsoft Entra.\n *\n * This id is guaranteed to be unique for an object within a tenant,\n * and so if provided will lead to a more performant lookup. It can\n * be resolved via MS Graph (see https://learn.microsoft.com/graph/api/resources/users\n * for examples).\n */\n readonly AadObjectId?: string;\n\n /**\n * The primary SMTP address.\n */\n readonly Smtp?: string;\n\n /**\n * The user principle name.\n */\n readonly Upn?: string;\n };\n\n /**\n * The persona to show the profile for.\n *\n * @beta\n */\n export interface Persona {\n /**\n * The set of identifiers that are supported for resolving the persona.\n */\n identifiers: PersonaIdentifiers;\n\n /**\n * Optional display name override. If not specified the user's display name will be resolved normally.\n */\n displayName?: string;\n }\n\n /**\n * Input parameters provided to the showProfile API.\n *\n * @beta\n */\n export interface ShowProfileRequest {\n /**\n * An optional hint to the hosting M365 application about which modality of the profile you want to show.\n */\n modality?: Modality;\n\n /**\n * The information about the persona to show the profile for.\n */\n persona: Persona;\n\n /**\n * The bounding rectangle of the target.\n */\n targetElementBoundingRect: DOMRect;\n\n /**\n * Specifies which user interaction was used to trigger the API call.\n */\n triggerType: TriggerType;\n }\n\n /**\n * Checks if the profile capability is supported by the host\n * @returns boolean to represent whether the profile capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.profile ? true : false;\n }\n}\n\n/**\n * Internal representation of a DOMRect suitable for sending via postMessage.\n */\nexport type Rectangle = {\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\n/**\n * @beta\n * @hidden\n * An internal representation of the showProfile parameters suitable for sending via postMessage.\n * The hub expects to receive an object of this type.\n */\nexport interface ShowProfileRequestInternal {\n modality?: profile.Modality;\n persona: profile.Persona;\n targetRectangle: Rectangle;\n triggerType: profile.TriggerType;\n}\n","import { sendAndHandleStatusAndReason, sendMessageToParent } from '../internal/communication';\nimport { registerHandler, removeHandler } from '../internal/handlers';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst searchTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Allows your application to interact with the host M365 application's search box.\n * By integrating your application with the host's search box, users can search\n * your app using the same search box they use elsewhere in Teams, Outlook, or Office.\n *\n * This functionality is in Beta.\n * @beta\n */\nexport namespace search {\n const onChangeHandlerName = 'search.queryChange';\n const onClosedHandlerName = 'search.queryClose';\n const onExecutedHandlerName = 'search.queryExecute';\n\n /**\n * This interface contains information pertaining to the contents of the host M365 application's search box\n *\n * @beta\n */\n export interface SearchQuery {\n /** The current search term in the host search experience */\n searchTerm: string;\n\n /** Timestamp sequence value to ensure messages are processed in correct order / combine them. */\n timestamp: number;\n }\n\n /**\n * This type will store the SearchQuery and allow other logic to be made inside the handler.\n *\n * @beta\n */\n export type SearchQueryHandler = (query: SearchQuery) => void;\n\n /**\n * Allows the caller to register for various events fired by the host search experience.\n * Calling this function indicates that your application intends to plug into the host's search box and handle search events,\n * when the user is actively using your page/tab.\n * \n * The host may visually update its search box, e.g. with the name or icon of your application.\n * \n * Your application should *not* re-render inside of these callbacks, there may be a large number\n * of onChangeHandler calls if the user is typing rapidly in the search box.\n *\n * @param onClosedHandler - This handler will be called when the user exits or cancels their search.\n * Should be used to return your application to its most recent, non-search state. The value of {@link SearchQuery.searchTerm} \n * will be whatever the last query was before ending search. \n * \n * @param onExecuteHandler - The handler will be called when the user executes their \n * search (by pressing Enter for example). Should be used to display the full list of search results. \n * The value of {@link SearchQuery.searchTerm} is the complete query the user entered in the search box.\n *\n * @param onChangeHandler - This optional handler will be called when the user first starts using the\n * host's search box and as the user types their query. Can be used to put your application into a \n * word-wheeling state or to display suggestions as the user is typing. \n * \n * This handler will be called with an empty {@link SearchQuery.searchTerm} when search is beginning, and subsequently,\n * with the current contents of the search box.\n * @example\n * ``` ts\n * search.registerHandlers(\n query => {\n console.log('Update your application to handle the search experience being closed. Last query: ${query.searchTerm}');\n },\n query => {\n console.log(`Update your application to handle an executed search result: ${query.searchTerm}`);\n },\n query => {\n console.log(`Update your application with the changed search query: ${query.searchTerm}`);\n },\n );\n * ```\n *\n * @beta\n */\n export function registerHandlers(\n onClosedHandler: SearchQueryHandler,\n onExecuteHandler: SearchQueryHandler,\n onChangeHandler?: SearchQueryHandler,\n ): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n registerHandler(\n getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnClosedHandler),\n onClosedHandlerName,\n onClosedHandler,\n );\n registerHandler(\n getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnExecutedHandler),\n onExecutedHandlerName,\n onExecuteHandler,\n );\n if (onChangeHandler) {\n registerHandler(\n getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_RegisterOnChangeHandler),\n onChangeHandlerName,\n onChangeHandler,\n );\n }\n }\n\n /**\n * Allows the caller to unregister for all events fired by the host search experience. Calling\n * this function will cause your app to stop appearing in the set of search scopes in the hosts\n *\n * @beta\n */\n export function unregisterHandlers(): void {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n // This should let the host know to stop making the app scope show up in the search experience\n // Can also be used to clean up handlers on the host if desired\n sendMessageToParent(\n getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_UnregisterHandlers),\n 'search.unregister',\n );\n removeHandler(onChangeHandlerName);\n removeHandler(onClosedHandlerName);\n removeHandler(onExecutedHandlerName);\n }\n\n /**\n * Checks if search capability is supported by the host\n * @returns boolean to represent whether the search capability is supported\n *\n * @throws Error if {@link app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.search ? true : false;\n }\n\n /**\n * Clear the host M365 application's search box\n *\n * @beta\n */\n export function closeSearch(): Promise<void> {\n return new Promise<void>((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n if (!isSupported()) {\n throw new Error('Not supported');\n }\n\n resolve(\n sendAndHandleStatusAndReason(\n getApiVersionTag(searchTelemetryVersionNumber, ApiName.Search_CloseSearch),\n 'search.closeSearch',\n ),\n );\n });\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { callCallbackWithSdkErrorFromPromiseAndReturnPromise, InputFunction } from '../internal/utils';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nconst sharingTelemetryVersionNumber_v1: ApiVersionNumber = ApiVersionNumber.V_1;\nconst sharingTelemetryVersionNumber_v2: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Namespace to open a share dialog for web content.\n * For more info, see [Share to Teams from personal app or tab](https://learn.microsoft.com/microsoftteams/platform/concepts/build-and-test/share-to-teams-from-personal-app-or-tab)\n */\nexport namespace sharing {\n /** shareWebContent callback function type */\n export type shareWebContentCallbackFunctionType = (err?: SdkError) => void;\n\n /** Type of message that can be sent or received by the sharing APIs */\n export const SharingAPIMessages = {\n /**\n * Share web content message.\n * @internal\n */\n shareWebContent: 'sharing.shareWebContent',\n };\n\n // More types can be added as we expand share capability\n type ContentType = 'URL';\n\n /** Represents parameters for base shared content. */\n interface IBaseSharedContent {\n /** Shared content type */\n type: ContentType;\n }\n\n // More types can be added as we expand share capability\n /** IShareRequestContentType defines share request type. */\n export type IShareRequestContentType = IURLContent;\n\n /** Represents IShareRequest parameters interface.\n * @typeparam T - The identity type\n */\n export interface IShareRequest<T> {\n /** Content of the share request. */\n content: T[];\n }\n\n /** Represents IURLContent parameters. */\n export interface IURLContent extends IBaseSharedContent {\n /** Type */\n type: 'URL';\n\n /**\n * Required URL\n */\n url: string;\n\n /**\n * Default initial message text\n */\n message?: string;\n\n /**\n * Show URL preview, defaults to true\n */\n preview?: boolean;\n }\n\n /**\n * Feature is under development\n * Opens a share dialog for web content\n *\n * @param shareWebContentRequest - web content info\n * @returns Promise that will be fulfilled when the operation has completed\n */\n export function shareWebContent(shareWebContentRequest: IShareRequest<IShareRequestContentType>): Promise<void>;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link sharing.shareWebContent sharing.shareWebContent(shareWebContentRequest: IShareRequest\\<IShareRequestContentType\\>): Promise\\<void\\>} instead.\n *\n * Feature is under development\n * Opens a share dialog for web content\n *\n * @param shareWebContentRequest - web content info\n * @param callback - optional callback\n */\n export function shareWebContent(\n shareWebContentRequest: IShareRequest<IShareRequestContentType>,\n callback: shareWebContentCallbackFunctionType,\n ): void;\n export function shareWebContent(\n shareWebContentRequest: IShareRequest<IShareRequestContentType>,\n callback?: shareWebContentCallbackFunctionType,\n ): Promise<void> {\n // validate the given input (synchronous check)\n try {\n validateNonEmptyContent(shareWebContentRequest);\n validateTypeConsistency(shareWebContentRequest);\n validateContentForSupportedTypes(shareWebContentRequest);\n } catch (err) {\n //return the error via callback(v1) or rejected promise(v2)\n const wrappedFunction: InputFunction<void> = () => Promise.reject(err);\n return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);\n }\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n const apiVersionTag = callback\n ? getApiVersionTag(sharingTelemetryVersionNumber_v1, ApiName.Sharing_ShareWebContent)\n : getApiVersionTag(sharingTelemetryVersionNumber_v2, ApiName.Sharing_ShareWebContent);\n return callCallbackWithSdkErrorFromPromiseAndReturnPromise(\n shareWebContentHelper,\n callback,\n apiVersionTag,\n shareWebContentRequest,\n );\n }\n\n function shareWebContentHelper(\n apiVersionTag: string,\n shareWebContentRequest: IShareRequest<IShareRequestContentType>,\n ): Promise<void> {\n return new Promise<void>((resolve) => {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n resolve(sendAndHandleSdkError(apiVersionTag, SharingAPIMessages.shareWebContent, shareWebContentRequest));\n });\n }\n\n /**\n * Functions for validating the shareRequest input parameter\n */\n function validateNonEmptyContent(shareRequest: IShareRequest<IShareRequestContentType>): void {\n if (!(shareRequest && shareRequest.content && shareRequest.content.length)) {\n const err: SdkError = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content is missing',\n };\n throw err;\n }\n }\n\n function validateTypeConsistency(shareRequest: IShareRequest<IShareRequestContentType>): void {\n let err: SdkError | undefined;\n if (shareRequest.content.some((item) => !item.type)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content type cannot be undefined',\n };\n throw err;\n }\n if (shareRequest.content.some((item) => item.type !== shareRequest.content[0].type)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Shared content must be of the same type',\n };\n throw err;\n }\n }\n\n function validateContentForSupportedTypes(shareRequest: IShareRequest<IShareRequestContentType>): void {\n let err: SdkError | undefined;\n if (shareRequest.content[0].type === 'URL') {\n if (shareRequest.content.some((item) => !item.url)) {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'URLs are required for URL content types',\n };\n throw err;\n }\n } else {\n err = {\n errorCode: ErrorCode.INVALID_ARGUMENTS,\n message: 'Content type is unsupported',\n };\n throw err;\n }\n }\n\n /**\n * Checks if the sharing capability is supported by the host\n * @returns boolean to represent whether the sharing capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.sharing ? true : false;\n }\n\n /**\n * Namespace to get the list of content shared in a Teams meeting\n *\n * @beta\n */\n export namespace history {\n /**\n * Represents the data returned when calling {@link sharing.history.getContent}\n *\n * @beta\n */\n export interface IContentResponse {\n /** Id of the app where the content was shared from */\n appId: string;\n /** Title of the shared content */\n title: string;\n /** Reference of the shared content */\n contentReference: string;\n /** Id of the thread where the content was shared. */\n threadId: string;\n /** Id of the user who shared the content. */\n author: string;\n /** Type of the shared content.\n * For sharing to Teams stage scenarios, this value would be `ShareToStage`\n * Other `contentType` values will be added and documented here over time\n */\n contentType: string;\n }\n\n /**\n * Get the list of content shared in a Teams meeting\n *\n * @throws Error if call capability is not supported\n * @throws Error if returned content details are invalid\n * @returns Promise that will resolve with the {@link IContentResponse} objects array\n *\n * @beta\n */\n export async function getContent(): Promise<IContentResponse[]> {\n ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n const contentDetails: IContentResponse[] = await sendAndHandleSdkError(\n getApiVersionTag(sharingTelemetryVersionNumber_v2, ApiName.Sharing_History_GetContent),\n 'sharing.history.getContent',\n );\n\n return contentDetails;\n }\n\n /**\n * Checks if sharing.history capability is supported by the host\n * @returns boolean to represent whether the sharing.history capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.sharing?.history !== undefined;\n }\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst stageViewTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Namespace to interact with the stage view specific part of the SDK.\n *\n * @beta\n */\nexport namespace stageView {\n /**\n * Parameters to open a stage view.\n */\n export interface StageViewParams {\n /**\n * The ID of the Teams application to be opened.\n */\n appId: string;\n\n /**\n * The URL of the content to display.\n */\n contentUrl: string;\n\n /**\n * The chat or channel ID.\n */\n threadId: string;\n\n /**\n * The messageId identifies a particular channel meeting within the channel as specified by the threadId above. This should be used only when trying to open the stage view for a channel meeting. It will be a no-op for other scenarios\n */\n messageId?: string;\n\n /**\n * The title to give the stage view.\n */\n title?: string;\n\n /**\n * The Teams application website URL.\n */\n websiteUrl?: string;\n\n /**\n * The entity ID of the Teams application content being opened.\n */\n entityId?: string;\n\n /**\n * The open mode for stage content.\n * Optional param: if not passed, hosts can choose their default openMode.\n * If a host does not support any specific openMode, It will fallback to StageViewOpenMode.modal.\n */\n openMode?: StageViewOpenMode;\n }\n\n /**\n * The open mode for stage content.\n */\n export enum StageViewOpenMode {\n /**\n * Open the content in a modal.\n */\n modal = 'modal',\n /**\n * Open the content in a popped-out window.\n */\n popout = 'popout',\n /**\n * Open the content in a popped-out window with chat collaboration.\n */\n popoutWithChat = 'popoutWithChat',\n }\n\n /**\n *\n * Opens a stage view to display a Teams application\n * @beta\n * @param stageViewParams - The parameters to pass into the stage view.\n * @returns Promise that resolves or rejects with an error once the stage view is closed.\n */\n export function open(stageViewParams: StageViewParams): Promise<void> {\n return new Promise((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (!stageViewParams) {\n throw new Error('[stageView.open] Stage view params cannot be null');\n }\n\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(stageViewTelemetryVersionNumber, ApiName.StageView_Open),\n 'stageView.open',\n stageViewParams,\n ),\n );\n });\n }\n\n /**\n * Checks if stageView capability is supported by the host\n * @beta\n * @returns boolean to represent whether the stageView capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.stageView ? true : false;\n }\n\n /**\n * Namespace for actions that can be taken by the stage view itself.\n *\n * @beta\n */\n export namespace self {\n /**\n * Closes the current stage view. This function will be a no-op if called from outside of a stage view.\n * @returns Promise that resolves or rejects with an error once the stage view is closed.\n *\n * @beta\n * @throws Error if stageView.self.close is not supported in the current context or if `app.initialize()` has not resolved successfully.\n */\n export function close(): Promise<void> {\n return new Promise((resolve) => {\n ensureInitialized(runtime, FrameContexts.content);\n\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(stageViewTelemetryVersionNumber, ApiName.StageView_Self_Close),\n 'stageView.self.close',\n ),\n );\n });\n }\n\n /**\n * Checks if stageView.self capability is supported by the host\n * @beta\n * @returns boolean to represent whether the stageView.self capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.stageView?.self !== undefined;\n }\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorInvalidCount, errorInvalidResponse, errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { DevicePermission } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst visualMediaTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * @hidden\n * Interact with images. Allows the app developer ask the user to get images from their camera / camera roll / file system.\n *\n * @beta\n */\nexport namespace visualMedia {\n const maxVisualMediaSelectionLimit = 10;\n /**\n * @hidden\n * All properties common to Image and Video Props\n *\n * @beta\n */\n interface VisualMediaProps {\n /**\n * @hidden\n * The maximum number of media items that can be selected at once is limited to values that are less than or equal to the maximum visual media selection limit.\n */\n maxVisualMediaCount: number;\n }\n\n /**\n * @hidden\n * The required value of the visualMedia files from gallery\n *\n * @beta\n */\n export interface GalleryProps {\n /**\n * The visualMedia source\n */\n source: Source.Gallery;\n }\n /**\n * @hidden\n * The required value of the visualMedia files from camera\n *\n * @beta\n */\n export interface CameraProps {\n /**\n * @hidden\n * The visualMedia source\n */\n source: Source.Camera;\n /**\n * @hidden\n * Optional; Specify whether users have the option to switch between the front and rear cameras. The default setting is FrontOrRear.\n * Default value is FrontOrRear\n */\n cameraRestriction?: CameraRestriction;\n }\n\n /**\n * @hidden\n * Indicate if user is allowed to move between front and back camera or stay in front/back camera only\n * If the camera option requested by the app isn't available, the SDK will silently default to the platform's standard camera.\n *\n * @beta\n */\n export enum CameraRestriction {\n /** User can move between front and back camera */\n FrontOrRear = 1,\n /** User can only use the front camera */\n FrontOnly = 2,\n /** User can only use the back camera */\n RearOnly = 3,\n }\n /**\n * @hidden\n * Specifies the image source\n *\n * @beta\n */\n export enum Source {\n /** The camera is the source of visual media. */\n Camera = 1,\n /** The source of visual media is the gallery. */\n Gallery = 2,\n }\n\n /**\n * @hidden\n * VisualMediaFile object that can be used to represent image or video from host apps.\n *\n * @beta\n */\n export interface VisualMediaFile {\n /**\n * @hidden\n * This is the base64 content of file.\n * If app needs to use this directly in HTML tags, it should convert this to a data url.\n */\n content: string;\n /**\n * @hidden\n * The size of file represented in VisualMediaFile in KB\n */\n sizeInKB: number;\n\n /**\n * @hidden\n * Name of the file (does not include the extension)\n */\n name: string;\n\n /**\n * @hidden\n * File's MIME type. More information on supported `mimeTypes`(https://docs.lens.xyz/docs/metadata-standards#supported-mime-types-for-imagesaudiovideos).\n */\n mimeType: string;\n }\n\n /**\n * @hidden\n * Checks whether or not visualMedia has user permission\n * @returns Promise that will resolve with true if the user had granted the app permission to media information(including Camera and Gallery permission), or with false otherwise,\n * In case of an error, promise will reject with the error.\n * @throws NOT_SUPPORTED_ON_PLATFORM Error if the DevicePermission.Media permission has not successfully granted.\n *\n * @beta\n */\n export function hasPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!image.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n return sendAndHandleSdkError(\n getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_HasPermission),\n 'permissions.has',\n permissions,\n );\n }\n\n /**\n * @hidden\n * Requests user permission for visualMedia\n * @returns Promise that will resolve with true if the user consented permission for media(including Camera and Gallery permission), or with false otherwise,\n * In case of an error, promise will reject with the error.\n * @throws NOT_SUPPORTED_ON_PLATFORM Error if the DevicePermission.Media permission has not successfully granted.\n *\n * @beta\n */\n export function requestPermission(): Promise<boolean> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!image.isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n const permissions: DevicePermission = DevicePermission.Media;\n return sendAndHandleSdkError(\n getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_RequestPermission),\n 'permissions.request',\n permissions,\n );\n }\n\n /**\n * @hidden\n * To enable this image capability will let the app developer ask the user to get images from camera/local storage\n *\n * @beta\n */\n export namespace image {\n /**\n * @hidden\n * CameraImageProperties is for the image taken from the camera\n *\n * @beta\n */\n export interface CameraImageProperties extends VisualMediaProps {\n /**\n * @hidden\n * The source in CameraImageProperties should always be CameraProps\n */\n sourceProps: CameraProps;\n }\n\n /**\n * @hidden\n * CameraImageProperties is for the image taken from the camera\n *\n * @beta\n */\n export interface GalleryImageProperties extends VisualMediaProps {\n /**\n * @hidden\n * The source in GalleryImageProperties should always be GalleryProps\n */\n sourceProps: GalleryProps;\n }\n\n /**\n * @hidden\n * Capture one or multiple image(s) using camera.\n * @param cameraImageInputs - The input params to customize the image(s) to be captured\n * @returns Promise that will resolve with {@link VisualMediaFile[]} object or reject with an error.\n * @throws INVALID_ARGUMENTS Error if imageInputs is null or imageInputs.maxVisualMediaCount is greater than maxVisualMediaSelectionLimit or lesser than 1.\n *\n * @beta\n */\n export async function captureImages(cameraImageInputs: CameraImageProperties): Promise<VisualMediaFile[]> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n ensureSupported();\n ensureImageInputValid(cameraImageInputs);\n const files = await sendAndHandleSdkError<VisualMediaFile[]>(\n getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_Image_CaptureImages),\n 'visualMedia.image.captureImages',\n cameraImageInputs,\n );\n ensureResponseValid(cameraImageInputs.maxVisualMediaCount, files);\n return files;\n }\n\n /**\n * @hidden\n * Upload the existing image(s) from the gallery.\n * @param galleryImageInputs - The input params to customize the image(s) to be captured\n * @returns Promise that will resolve with {@link VisualMediaFile[]} object or reject with an error.\n * @throws INVALID_ARGUMENTS Error if imageInputs is null or imageInputs.maxVisualMediaCount is greater than maxVisualMediaSelectionLimit or lesser than 1.\n *\n * @beta\n */\n export async function retrieveImages(galleryImageInputs: GalleryImageProperties): Promise<VisualMediaFile[]> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n ensureSupported();\n ensureImageInputValid(galleryImageInputs);\n const files = await sendAndHandleSdkError<VisualMediaFile[]>(\n getApiVersionTag(visualMediaTelemetryVersionNumber, ApiName.VisualMedia_Image_RetrieveImages),\n 'visualMedia.image.retrieveImages',\n galleryImageInputs,\n );\n ensureResponseValid(galleryImageInputs.maxVisualMediaCount, files);\n return files;\n }\n\n /**\n * @hidden\n * Checks if visualMedia.image capability is supported by the host\n * @returns boolean to represent whether visualMedia.image is supported\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) &&\n runtime.supports.visualMedia &&\n runtime.supports.visualMedia.image &&\n runtime.supports.permissions\n ? true\n : false;\n }\n\n /**\n * @hidden\n * Ensure visualMedia.image capability is supported by the host\n * @throws errorNotSupportedOnPlatform error if isSupported() fails.\n *\n * @beta\n */\n function ensureSupported(): void {\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n }\n /**\n * @hidden\n * @param imageInput the input can be either CameraImageProperties or GalleryImageProperties\n * @param source the expected Source\n * @throws error if the input check fails.\n * @beta\n */\n function ensureImageInputValid(imageInput: CameraImageProperties | GalleryImageProperties): void {\n if (\n !imageInput ||\n imageInput.maxVisualMediaCount > maxVisualMediaSelectionLimit ||\n imageInput.maxVisualMediaCount < 1\n ) {\n throw errorInvalidCount;\n }\n }\n\n /**\n * @hidden\n * Ensure the number of images in the response is within the maximum limit.\n * @throws error if length check fails.\n * @param maxCount the maxVisualMediaCount set in the imageInpus\n * @param response the response passed from host app\n *\n * @beta\n */\n function ensureResponseValid(maxCount: number, response: VisualMediaFile[]): void {\n // to ensure the number of images in the response is within the maximum limit.\n if (response.length > maxCount) {\n throw errorInvalidResponse;\n }\n }\n }\n}\n","import { sendAndUnwrap } from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { app } from './app';\nimport { errorNotSupportedOnPlatform, HostClientType, HostName } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * Contains functionality enabling apps to query properties about how the host manages web storage (`Window.LocalStorage`)\n *\n * @beta\n */\nexport namespace webStorage {\n /**\n * Checks if web storage (`Window.LocalStorage`) gets cleared when a user logs out from host\n *\n * @returns `true` if web storage gets cleared on logout and `false` if not\n *\n * @throws `Error` if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export async function isWebStorageClearedOnUserLogOut(): Promise<boolean> {\n ensureInitialized(runtime);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (\n runtime.isLegacyTeams &&\n (GlobalVars.hostClientType === HostClientType.android ||\n GlobalVars.hostClientType === HostClientType.ios ||\n GlobalVars.hostClientType === HostClientType.ipados) &&\n (await getHostName()) === HostName.teams\n ) {\n // On Teams Mobile, they haven't yet implemented this capability. However, for compatibility reasons, we need\n // to act as if they do. If they did implement it, they would return true, so that's what we do here.\n // Getting Teams Mobile to implement this is a work-in-progress. Once they do implement it, we can remove this\n // whole if-block. Until then, we cannot send the message to them because they will not understand it.\n // Once they do implement it, this if-block will automatically not apply because runtime.isLegacyTeams will no\n // longer be true. So, we don't need to worry about removing this if block \"at the right time\". We can\n // just keep it here until Teams Mobile implements this capability and uses the host SDK everywhere, at which\n // point we can remove this whole if-block at our leisure.\n return true;\n }\n\n return await sendAndUnwrap(\n getApiVersionTag(ApiVersionNumber.V_2, ApiName.WebStorage_IsWebStorageClearedOnUserLogOut),\n ApiName.WebStorage_IsWebStorageClearedOnUserLogOut,\n );\n }\n\n async function getHostName(): Promise<HostName> {\n if (cachedHostName === null) {\n cachedHostName = (await app.getContext()).app.host.name;\n }\n\n return cachedHostName;\n }\n\n /**\n * Checks if webStorage capability is supported by the host\n * @returns boolean to represent whether the webStorage capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n *\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.webStorage !== undefined;\n }\n}\n\n// It is safe to cache the host name because the host cannot change at runtime\nlet cachedHostName: HostName | null = null;\n\n// ...except during unit tests, where we will change it at runtime regularly for testing purposes\nexport function clearWebStorageCachedHostNameForTests(): void {\n cachedHostName = null;\n}\n","import { sendAndUnwrap, sendMessageToParent } from '../internal/communication';\nimport { errorCallNotStarted } from '../internal/constants';\nimport { createTeamsDeepLinkForCall } from '../internal/deepLinkUtilities';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst callTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Used to interact with call functionality, including starting calls with other users.\n */\nexport namespace call {\n /** Modalities that can be associated with a call. */\n export enum CallModalities {\n /** Indicates that the modality is unknown or undefined. */\n Unknown = 'unknown',\n /** Indicates that the call includes audio. */\n Audio = 'audio',\n /** Indicates that the call includes video. */\n Video = 'video',\n /** Indicates that the call includes video-based screen sharing. */\n VideoBasedScreenSharing = 'videoBasedScreenSharing',\n /** Indicates that the call includes data sharing or messaging. */\n Data = 'data',\n }\n\n /** Represents parameters for {@link startCall | StartCall}. */\n export interface StartCallParams {\n /**\n * Comma-separated list of user IDs representing the participants of the call.\n *\n * @remarks\n * Currently the User ID field supports the Microsoft Entra UserPrincipalName,\n * typically an email address, or in case of a PSTN call, it supports a pstn\n * mri 4:\\<phonenumber>.\n */\n targets: string[];\n /**\n * List of modalities for the call. Defaults to [“audio”].\n */\n requestedModalities?: CallModalities[];\n /**\n * An optional parameter that informs about the source of the deep link\n */\n source?: string;\n }\n\n /**\n * Starts a call with other users\n *\n * @param startCallParams - Parameters for the call\n *\n * @throws Error if call capability is not supported\n * @throws Error if host notifies of a failed start call attempt in a legacy Teams environment\n * @returns always true if the host notifies of a successful call inititation\n */\n export function startCall(startCallParams: StartCallParams): Promise<boolean> {\n const apiVersionTag = getApiVersionTag(callTelemetryVersionNumber, ApiName.Call_StartCall);\n return new Promise((resolve) => {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (runtime.isLegacyTeams) {\n resolve(\n sendAndUnwrap(\n apiVersionTag,\n 'executeDeepLink',\n createTeamsDeepLinkForCall(\n startCallParams.targets,\n startCallParams.requestedModalities?.includes(CallModalities.Video),\n startCallParams.source,\n ),\n ).then((result: boolean) => {\n if (!result) {\n throw new Error(errorCallNotStarted);\n }\n return result;\n }),\n );\n } else {\n return sendMessageToParent(apiVersionTag, 'call.startCall', [startCallParams], resolve);\n }\n });\n }\n\n /**\n * Checks if the call capability is supported by the host\n * @returns boolean to represent whether the call capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.call ? true : false;\n }\n}\n","import { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport {\n app,\n notifyAppLoadedHelper,\n notifyExpectedFailureHelper,\n notifyFailureHelper,\n notifySuccessHelper,\n} from './app';\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app} namespace instead.\n *\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst appInitializationTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\nexport namespace appInitialization {\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.Messages} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import Messages = app.Messages;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.FailedReason} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import FailedReason = app.FailedReason;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.ExpectedFailureReason} instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import ExpectedFailureReason = app.ExpectedFailureReason;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.IFailedRequest} instead.\n */\n export import IFailedRequest = app.IFailedRequest;\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.IExpectedFailureRequest} instead.\n */\n export import IExpectedFailureRequest = app.IExpectedFailureRequest;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.notifyAppLoaded app.notifyAppLoaded(): void} instead.\n *\n * Notifies the frame that app has loaded and to hide the loading indicator if one is shown.\n */\n export function notifyAppLoaded(): void {\n notifyAppLoadedHelper(\n getApiVersionTag(appInitializationTelemetryVersionNumber, ApiName.AppInitialization_NotifyAppLoaded),\n );\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.notifySuccess app.notifySuccess(): void} instead.\n *\n * Notifies the frame that app initialization is successful and is ready for user interaction.\n */\n export function notifySuccess(): void {\n notifySuccessHelper(\n getApiVersionTag(appInitializationTelemetryVersionNumber, ApiName.AppInitialization_NotifySuccess),\n );\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.notifyFailure app.notifyFailure(appInitializationFailedRequest: IFailedRequest): void} instead.\n *\n * Notifies the frame that app initialization has failed and to show an error page in its place.\n * @param appInitializationFailedRequest - The failure request containing the reason for why the app failed\n * during initialization as well as an optional message.\n */\n export function notifyFailure(appInitializationFailedRequest: IFailedRequest): void {\n notifyFailureHelper(\n getApiVersionTag(appInitializationTelemetryVersionNumber, ApiName.AppInitialization_NotifyFailure),\n appInitializationFailedRequest,\n );\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.notifyExpectedFailure app.notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void} instead.\n *\n * Notifies the frame that app initialized with some expected errors.\n * @param expectedFailureRequest - The expected failure request containing the reason and an optional message\n */\n export function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void {\n notifyExpectedFailureHelper(\n getApiVersionTag(appInitializationTelemetryVersionNumber, ApiName.AppInitialization_NotifyExpectedFailure),\n expectedFailureRequest,\n );\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { createFile, decodeAttachment } from '../internal/mediaUtil';\nimport { ApiName, ApiVersionNumber, getApiVersionTag, getLogger } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { ErrorCode, SdkError } from './interfaces';\nimport { runtime } from './runtime';\n\nconst Files3PLogger = getLogger('thirdPartyCloudStorage');\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst thirdPartyCloudStorageTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * Extended files API 3P storage providers, features like sending Blob from Teams to 3P app on user\n * actions like drag and drop to compose\n * @beta\n */\nexport namespace thirdPartyCloudStorage {\n /**\n * Interface to assemble file chunks\n * @beta\n */\n export interface AssembleAttachment {\n /** A number representing the sequence of the attachment in the file chunks. */\n sequence: number;\n /** A Blob object representing the data of the file chunks. */\n file: Blob;\n }\n /**\n * Class to assemble files\n * @beta\n */\n class AttachmentListHelper {\n /** A string representing the MIME type of the file */\n public fileType: string;\n /** An array of {@link AssembleAttachment | AssembleAttachment} objects representing files to be sent as attachment */\n public assembleAttachment: AssembleAttachment[];\n\n public constructor(fileType: string, assembleAttachment: AssembleAttachment[]) {\n this.fileType = fileType;\n this.assembleAttachment = assembleAttachment;\n }\n }\n let files: FilesFor3PStorage[] = [];\n let helper: AttachmentListHelper | null = null;\n let lastChunkVal = true; // setting it to true so that the very first file and first chunk does not fail\n\n /**\n * Object used to represent a file\n * @beta\n *\n */\n export interface FilesFor3PStorage extends Blob {\n /**\n * A number that represents the number of milliseconds since the Unix epoch\n */\n lastModified: number;\n /**\n * Name of the file\n */\n name: string;\n /**\n * file type\n */\n type: string;\n /**\n * A string containing the path of the file relative to the ancestor directory the user selected\n */\n webkitRelativePath?: string;\n }\n\n /**\n * File chunks an output of getDragAndDropFiles API from platform\n * @beta\n */\n export interface FileChunk {\n /**\n * Base 64 data for the requested uri\n */\n chunk: string;\n /**\n * chunk sequence number\n */\n chunkSequence: number;\n /**\n * Indicates whether this chunk is the final segment of a file\n */\n endOfFile: boolean;\n }\n\n /**\n * Output of getDragAndDropFiles API from platform\n * @beta\n */\n export interface FileResult {\n /**\n * Error encountered in getDragAndDropFiles API\n */\n error?: SdkError;\n /**\n * File chunk which will be assemebled and converted into a blob\n */\n fileChunk: FileChunk;\n /**\n * File index of the file for which chunk data is getting recieved\n */\n fileIndex: number;\n /**\n * File type/MIME type which is getting recieved\n */\n fileType: string;\n /**\n * Indicates whether this file is the last one in a sequence.\n */\n isLastFile: boolean;\n /**\n * The name of the file.\n */\n fileName: string;\n }\n\n /**\n * Defines the callback function received from Third Party App\n * @beta\n */\n export interface DragAndDropFileCallback {\n /**\n * Definition of the callback which is received from third party app when calling {@link thirdPartyCloudStorage.getDragAndDropFiles}\n * An array of drag and dropped files {@link thirdPartyCloudStorage.FilesFor3PStorage}\n * Error encountered during the API call {@link SdkError}\n */\n (files: FilesFor3PStorage[], error?: SdkError): void;\n }\n\n let callback: DragAndDropFileCallback | null = null;\n\n /**\n * Get drag-and-drop files using a callback.\n *\n * @param {string} dragAndDropInput - unique id which is a combination of replyToId + threadId of teams chat and channel.\n * Both replyToId and threadId can be fetched from application context.\n * @param {DragAndDropFileCallback} dragAndDropFileCallback - callback\n * A callback function to handle the result of the operation\n * @beta\n */\n export function getDragAndDropFiles(\n dragAndDropInput: string,\n dragAndDropFileCallback: DragAndDropFileCallback,\n ): void {\n if (!dragAndDropFileCallback) {\n throw new Error('[getDragAndDropFiles] Callback cannot be null');\n }\n if (!dragAndDropInput || dragAndDropInput === '') {\n const invalidInput: SdkError = { errorCode: ErrorCode.INVALID_ARGUMENTS };\n dragAndDropFileCallback([], invalidInput);\n return;\n }\n\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n\n if (callback) {\n callback = null;\n throw new Error('getDragAndDropFiles cannot be called twice');\n } else {\n callback = dragAndDropFileCallback;\n }\n lastChunkVal = true;\n\n sendMessageToParent(\n getApiVersionTag(\n thirdPartyCloudStorageTelemetryVersionNumber,\n ApiName.ThirdPartyCloudStorage_GetDragAndDropFiles,\n ),\n 'thirdPartyCloudStorage.getDragAndDropFiles',\n [dragAndDropInput],\n handleGetDragAndDropFilesCallbackRequest,\n );\n }\n\n function handleGetDragAndDropFilesCallbackRequest(fileResult: FileResult): void {\n if (callback) {\n if (fileResult && fileResult.error) {\n callback([], fileResult.error);\n callback = null;\n } else {\n if (fileResult && fileResult.fileChunk) {\n try {\n if (!lastChunkVal && fileResult.fileChunk.chunkSequence === 0) {\n // last chunk value was false\n Files3PLogger(\"Last chunk is not received or 'endOfFile' value for previous chunk was not set to true\");\n lastChunkVal = true; // for next iteration\n\n callback([], {\n errorCode: ErrorCode.INTERNAL_ERROR,\n message: 'error occurred while receiving data',\n });\n files = [];\n callback = null;\n }\n const assemble: AssembleAttachment | null = decodeAttachment(fileResult.fileChunk, fileResult.fileType);\n if (assemble) {\n if (!helper) {\n // creating helper object for received file chunk\n helper = new AttachmentListHelper(fileResult.fileType, []);\n }\n helper.assembleAttachment.push(assemble);\n } else {\n Files3PLogger(\n `Received a null assemble attachment for when decoding chunk sequence ${fileResult.fileChunk.chunkSequence}; not including the chunk in the assembled file.`,\n );\n callback\n ? callback([], { errorCode: ErrorCode.INTERNAL_ERROR, message: 'error occurred while receiving data' })\n : (callback = null);\n files = [];\n callback = null;\n lastChunkVal = true;\n }\n\n // we will store this value to determine whether we received the last chunk of the previous file\n lastChunkVal = fileResult.fileChunk.endOfFile;\n if (fileResult.fileChunk.endOfFile && helper) {\n const fileBlob = createFile(helper.assembleAttachment, helper.fileType);\n\n if (fileBlob) {\n // Convert blob to File\n const receivedFile = new File([fileBlob], fileResult.fileName, {\n type: fileBlob.type,\n });\n files.push(receivedFile);\n }\n\n if (fileResult.isLastFile && callback) {\n callback(files, fileResult.error);\n files = [];\n callback = null;\n lastChunkVal = true;\n }\n\n helper = null;\n }\n } catch (e) {\n if (callback) {\n callback([], { errorCode: ErrorCode.INTERNAL_ERROR, message: e });\n files = [];\n callback = null;\n lastChunkVal = true;\n }\n }\n } else {\n callback([], { errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' });\n files = [];\n callback = null;\n lastChunkVal = true;\n }\n }\n }\n }\n\n /**\n * Checks if the thirdPartyCloudStorage capability is supported by the host\n * @returns boolean to represent whether the thirdPartyCloudStorage capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.thirdPartyCloudStorage ? true : false;\n }\n}\n","import { sendMessageToParent } from '../internal/communication';\nimport { GlobalVars } from '../internal/globalVars';\nimport { registerHandlerHelper } from '../internal/handlers';\nimport { ensureInitializeCalled, ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { appInitializeHelper, openLinkHelper, registerOnThemeChangeHandlerHelper } from './app';\nimport { FrameContexts } from './constants';\nimport {\n Context,\n DeepLinkParameters,\n FrameContext,\n LoadContext,\n TabInformation,\n TabInstanceParameters,\n} from './interfaces';\nimport { getMruTabInstancesHelper, getTabInstancesHelper, setCurrentFrameHelper, shareDeepLinkHelper } from './pages';\nimport { pages } from './pages';\nimport { runtime } from './runtime';\nimport { teamsCore } from './teamsAPIs';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst publicAPIsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n/** Type of callback used to indicate when {@link executeDeepLink} completes */\nexport type executeDeepLinkOnCompleteFunctionType = (status: boolean, reason?: string) => void;\n/** Callback function type */\nexport type callbackFunctionType = () => void;\n/** Get context callback function type */\nexport type getContextCallbackFunctionType = (context: Context) => void;\n/** Get tab instances callback function type */\nexport type getTabInstancesCallbackFunctionType = (tabInfo: TabInformation) => void;\n/** Register back button handler function type */\nexport type registerBackButtonHandlerFunctionType = () => boolean;\n/** Register full screen handler function type */\nexport type registerFullScreenHandlerFunctionType = (isFullScreen: boolean) => void;\n/** Register on theme change handler function type */\nexport type registerOnThemeChangeHandlerFunctionType = (theme: string) => void;\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\\<void\\>} instead.\n *\n * Initializes the library. This must be called before any other SDK calls\n * but after the frame is loaded successfully.\n * @param callback - Optionally specify a callback to invoke when Teams SDK has successfully initialized\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins. There must have\n * https: protocol otherwise they will be ignored. Example: https://www.example.com\n */\nexport function initialize(callback?: callbackFunctionType, validMessageOrigins?: string[]): void {\n appInitializeHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_Initialize),\n validMessageOrigins,\n ).then(() => {\n if (callback) {\n callback();\n }\n });\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link teamsCore.enablePrintCapability teamsCore.enablePrintCapability(): void} instead.\n *\n * Enable print capability to support printing page using Ctrl+P and cmd+P\n */\nexport function enablePrintCapability(): void {\n teamsCore.enablePrintCapability();\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link teamsCore.print teamsCore.print(): void} instead.\n *\n * Default print handler\n */\nexport function print(): void {\n teamsCore.print();\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.getContext app.getContext(): Promise\\<app.Context\\>} instead.\n *\n * Retrieves the current context the frame is running in.\n *\n * @param callback - The callback to invoke when the {@link Context} object is retrieved.\n */\nexport function getContext(callback: getContextCallbackFunctionType): void {\n ensureInitializeCalled();\n sendMessageToParent(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetContext),\n 'getContext',\n (context: Context) => {\n if (!context.frameContext) {\n // Fallback logic for frameContext properties\n context.frameContext = GlobalVars.frameContext;\n }\n callback(context);\n },\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link app.registerOnThemeChangeHandler app.registerOnThemeChangeHandler(handler: registerOnThemeChangeHandlerFunctionType): void} instead.\n *\n * Registers a handler for theme changes.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user changes their theme.\n */\nexport function registerOnThemeChangeHandler(handler: registerOnThemeChangeHandlerFunctionType): void {\n registerOnThemeChangeHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterOnThemeChangeHandlerHelper),\n handler,\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.registerFullScreenHandler pages.registerFullScreenHandler(handler: registerFullScreenHandlerFunctionType): void} instead.\n *\n * Registers a handler for changes from or to full-screen view for a tab.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user toggles full-screen view for a tab.\n */\nexport function registerFullScreenHandler(handler: registerFullScreenHandlerFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterFullScreenHandler),\n 'fullScreenChange',\n handler,\n [],\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.appButton.onClick pages.appButton.onClick(handler: callbackFunctionType): void} instead.\n *\n * Registers a handler for clicking the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the personal app button is clicked in the app bar.\n */\nexport function registerAppButtonClickHandler(handler: callbackFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonClickHandler),\n 'appButtonClick',\n handler,\n [FrameContexts.content],\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.appButton.onHoverEnter pages.appButton.onHoverEnter(handler: callbackFunctionType): void} instead.\n *\n * Registers a handler for entering hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.\n */\nexport function registerAppButtonHoverEnterHandler(handler: callbackFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonHoverEnterHandler),\n 'appButtonHoverEnter',\n handler,\n [FrameContexts.content],\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.appButton.onHoverLeave pages.appButton.onHoverLeave(handler: callbackFunctionType): void} instead.\n *\n * Registers a handler for exiting hover of the app button.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.\n *\n */\nexport function registerAppButtonHoverLeaveHandler(handler: callbackFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonHoverLeaveHandler),\n 'appButtonHoverLeave',\n handler,\n [FrameContexts.content],\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.backStack.registerBackButtonHandler pages.backStack.registerBackButtonHandler(handler: registerBackButtonHandlerFunctionType): void} instead.\n *\n * Registers a handler for user presses of the Team client's back button. Experiences that maintain an internal\n * navigation stack should use this handler to navigate the user back within their frame. If an app finds\n * that after running its back button handler it cannot handle the event it should call the navigateBack\n * method to ask the Teams client to handle it instead.\n *\n * @param handler - The handler to invoke when the user presses their Team client's back button.\n */\nexport function registerBackButtonHandler(handler: registerBackButtonHandlerFunctionType): void {\n pages.backStack.registerBackButtonHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterBackButtonHandler),\n handler,\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link teamsCore.registerOnLoadHandler teamsCore.registerOnLoadHandler(handler: (context: LoadContext) => void): void} instead.\n *\n * @hidden\n * Registers a handler to be called when the page has been requested to load.\n *\n * @param handler - The handler to invoke when the page is loaded.\n */\nexport function registerOnLoadHandler(handler: (context: LoadContext) => void): void {\n teamsCore.registerOnLoadHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterOnLoadHandler),\n handler,\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link teamsCore.registerBeforeUnloadHandler teamsCore.registerBeforeUnloadHandler(handler: (readyToUnload: callbackFunctionType) => boolean): void} instead.\n *\n * @hidden\n * Registers a handler to be called before the page is unloaded.\n *\n * @param handler - The handler to invoke before the page is unloaded. If this handler returns true the page should\n * invoke the readyToUnload function provided to it once it's ready to be unloaded.\n */\nexport function registerBeforeUnloadHandler(handler: (readyToUnload: callbackFunctionType) => boolean): void {\n teamsCore.registerBeforeUnloadHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterBeforeUnloadHandler),\n handler,\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.registerFocusEnterHandler pages.registerFocusEnterHandler(handler: (navigateForward: boolean) => void): void} instead.\n *\n * @hidden\n * Registers a handler when focus needs to be passed from teams to the place of choice on app.\n *\n * @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.\n */\nexport function registerFocusEnterHandler(handler: (navigateForward: boolean) => boolean): void {\n registerHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterFocusEnterHandler),\n 'focusEnter',\n handler,\n [],\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.registerChangeConfigHandler pages.config.registerChangeConfigHandler(handler: callbackFunctionType): void} instead.\n *\n * Registers a handler for when the user reconfigurated tab.\n *\n * @param handler - The handler to invoke when the user click on Settings.\n */\nexport function registerChangeSettingsHandler(handler: callbackFunctionType): void {\n registerHandlerHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterChangeSettingsHandler),\n 'changeSettings',\n handler,\n [FrameContexts.content],\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.tabs.getTabInstances pages.tabs.getTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\\<TabInformation\\>} instead.\n *\n * Allows an app to retrieve for this user tabs that are owned by this app.\n * If no TabInstanceParameters are passed, the app defaults to favorite teams and favorite channels.\n *\n * @param callback - The callback to invoke when the {@link TabInstanceParameters} object is retrieved.\n * @param tabInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams or channels.\n */\nexport function getTabInstances(\n callback: getTabInstancesCallbackFunctionType,\n tabInstanceParameters?: TabInstanceParameters,\n): void {\n ensureInitialized(runtime);\n getTabInstancesHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetTabInstances),\n tabInstanceParameters,\n ).then((tabInfo: TabInformation) => {\n callback(tabInfo);\n });\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.tabs.getMruTabInstances pages.tabs.getMruTabInstances(tabInstanceParameters?: TabInstanceParameters): Promise\\<TabInformation\\>} instead.\n *\n * Allows an app to retrieve the most recently used tabs for this user.\n *\n * @param callback - The callback to invoke when the {@link TabInformation} object is retrieved.\n * @param tabInstanceParameters - OPTIONAL Ignored, kept for future use\n */\nexport function getMruTabInstances(\n callback: getTabInstancesCallbackFunctionType,\n tabInstanceParameters?: TabInstanceParameters,\n): void {\n ensureInitialized(runtime);\n getMruTabInstancesHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetMruTabInstances),\n tabInstanceParameters,\n ).then((tabInfo: TabInformation) => {\n callback(tabInfo);\n });\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.shareDeepLink pages.shareDeepLink(deepLinkParameters: DeepLinkParameters): void} instead.\n *\n * Shares a deep link that a user can use to navigate back to a specific state in this page.\n *\n * @param deepLinkParameters - ID and label for the link and fallback URL.\n */\nexport function shareDeepLink(deepLinkParameters: DeepLinkParameters): void {\n shareDeepLinkHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_ShareDeepLink), {\n subPageId: deepLinkParameters.subEntityId,\n subPageLabel: deepLinkParameters.subEntityLabel,\n subPageWebUrl: deepLinkParameters.subEntityWebUrl,\n });\n}\n\n/**\n * @deprecated\n * This function was previously used for opening various types of links. As of TeamsJS v2.0.0, it has been replaced with multiple different\n * functions depending on the type of link:\n *\n * - Use {@link pages.currentApp.navigateToDefaultPage} to navigate to the default page of your own app\n * - Use {@link pages.currentApp.navigateTo} to navigate to a section of your own app\n * - Use {@link pages.navigateToApp} to navigate to other apps besides your own\n * - Use {@link app.openLink} for opening deep links to other parts of the host (e.g., to chats or channels) or\n * general-purpose links (e.g., to external websites).\n *\n * @param deepLink deep link.\n */\nexport function executeDeepLink(deepLink: string, onComplete?: executeDeepLinkOnCompleteFunctionType): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n const completionHandler: executeDeepLinkOnCompleteFunctionType = onComplete ?? getGenericOnCompleteHandler();\n openLinkHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_ExecuteDeepLink), deepLink)\n .then(() => {\n completionHandler(true);\n })\n .catch((err: Error) => {\n completionHandler(false, err.message);\n });\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.setCurrentFrame pages.setCurrentFrame(frameInfo: FrameInfo): void} instead.\n *\n * Set the current Frame Context\n *\n * @param frameContext - FrameContext information to be set\n */\nexport function setFrameContext(frameContext: FrameContext): void {\n setCurrentFrameHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_SetFrameContext),\n frameContext,\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.initializeWithFrameContext pages.initializeWithFrameContext(frameInfo: FrameInfo, callback?: callbackFunctionType, validMessageOrigins?: string[],): void} instead.\n *\n * Initialize with FrameContext\n *\n * @param frameContext - FrameContext information to be set\n * @param callback - The optional callback to be invoked be invoked after initilizing the frame context\n * @param validMessageOrigins - Optionally specify a list of cross frame message origins.\n * They must have https: protocol otherwise they will be ignored. Example: https:www.example.com\n */\nexport function initializeWithFrameContext(\n frameContext: FrameContext,\n callback?: callbackFunctionType,\n validMessageOrigins?: string[],\n): void {\n appInitializeHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_InitializeWithFrameContext),\n validMessageOrigins,\n ).then(() => callback && callback());\n setCurrentFrameHelper(\n getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_SetFrameContext),\n frameContext,\n );\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { TabInstance } from './interfaces';\nimport {\n backStackNavigateBackHelper,\n navigateCrossDomainHelper,\n returnFocusHelper,\n tabsNavigateToTabHelper,\n} from './pages';\nimport { runtime } from './runtime';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst navigationTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n/**\n * Navigation specific part of the SDK.\n */\n\n/** Navigation on complete handler function type */\nexport type onCompleteHandlerFunctionType = (status: boolean, reason?: string) => void;\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.returnFocus pages.returnFocus(navigateForward?: boolean): void} instead.\n *\n * Return focus to the main Teams app. Will focus search bar if navigating foward and app bar if navigating back.\n *\n * @param navigateForward - Determines the direction to focus in teams app.\n */\nexport function returnFocus(navigateForward?: boolean): void {\n returnFocusHelper(\n getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_ReturnFocus),\n navigateForward,\n );\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.tabs.navigateToTab pages.tabs.navigateToTab(tabInstance: TabInstance): Promise\\<void\\>} instead.\n *\n * Navigates the Microsoft Teams app to the specified tab instance.\n *\n * @param tabInstance - The tab instance to navigate to.\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateToTab(tabInstance: TabInstance, onComplete?: onCompleteHandlerFunctionType): void {\n ensureInitialized(runtime);\n const completionHandler: onCompleteHandlerFunctionType = onComplete ?? getGenericOnCompleteHandler();\n tabsNavigateToTabHelper(\n getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateToTab),\n tabInstance,\n )\n .then(() => {\n completionHandler(true);\n })\n .catch((error: Error) => {\n completionHandler(false, error.message);\n });\n}\n\n/**\n * @deprecated\n * As of 2.0.0, this API is deprecated and can be replaced by the standard JavaScript\n * API, window.location.href, when navigating the app to a new cross-domain URL. Any URL\n * that is redirected to must be listed in the validDomains block of the manifest. Please\n * remove any calls to this API.\n * @param url - The URL to navigate the frame to.\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateCrossDomain(url: string, onComplete?: onCompleteHandlerFunctionType): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.sidePanel,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.task,\n FrameContexts.stage,\n FrameContexts.meetingStage,\n );\n const completionHandler: onCompleteHandlerFunctionType = onComplete ?? getGenericOnCompleteHandler();\n navigateCrossDomainHelper(\n getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateCrossDomain),\n url,\n )\n .then(() => {\n completionHandler(true);\n })\n .catch((error: Error) => {\n completionHandler(false, error.message);\n });\n}\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.backStack.navigateBack pages.backStack.navigateBack(): Promise\\<void\\>} instead.\n *\n * Navigates back in the Teams client.\n * See registerBackButtonHandler for more information on when it's appropriate to use this method.\n *\n * @param onComplete - The callback to invoke when the action is complete.\n */\nexport function navigateBack(onComplete?: onCompleteHandlerFunctionType): void {\n ensureInitialized(runtime);\n const completionHandler: onCompleteHandlerFunctionType = onComplete ?? getGenericOnCompleteHandler();\n backStackNavigateBackHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateBack))\n .then(() => {\n completionHandler(true);\n })\n .catch((error: Error) => {\n completionHandler(false, error.message);\n });\n}\n","import { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { getGenericOnCompleteHandler } from '../internal/utils';\nimport { FrameContexts } from './constants';\nimport { configSetConfigHelper, configSetValidityStateHelper, getConfigHelper, pages } from './pages';\nimport { runtime } from './runtime';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst settingsTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config} namespace instead.\n *\n * Namespace to interact with the settings-specific part of the SDK.\n * This object is usable only on the settings frame.\n */\nexport namespace settings {\n /** Register on remove handler function type */\n export type registerOnRemoveHandlerFunctionType = (evt: RemoveEvent) => void;\n /** Register on save handler function type */\n export type registerOnSaveHandlerFunctionType = (evt: SaveEvent) => void;\n /** Set settings on complete function type */\n export type setSettingsOnCompleteFunctionType = (status: boolean, reason?: string) => void;\n /** Get settings callback function type */\n export type getSettingsCallbackFunctionType = (instanceSettings: Settings) => void;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.Config} instead.\n * @remarks\n * Renamed to config in pages.Config\n */\n export import Settings = pages.InstanceConfig;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.SaveEvent} instead.\n * @remarks\n * See pages.SaveEvent\n */\n export import SaveEvent = pages.config.SaveEvent;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.RemoveEvent} instead.\n * @remarks\n * See pages.RemoveEvent\n */\n export import RemoveEvent = pages.config.RemoveEvent;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.SaveParameters} instead.\n * @remarks\n * See pages.SaveParameters\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n export import SaveParameters = pages.config.SaveParameters;\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.setValidityState pages.config.setValidityState(validityState: boolean): void} instead.\n *\n * Sets the validity state for the settings.\n * The initial value is false, so the user cannot save the settings until this is called with true.\n *\n * @param validityState - Indicates whether the save or remove button is enabled for the user.\n */\n export function setValidityState(validityState: boolean): void {\n configSetValidityStateHelper(\n getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_SetValidityState),\n validityState,\n );\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.getConfig pages.getConfig(): Promise\\<InstanceConfig\\>} instead.\n *\n * Gets the settings for the current instance.\n *\n * @param callback - The callback to invoke when the {@link Settings} object is retrieved.\n */\n export function getSettings(callback: getSettingsCallbackFunctionType): void {\n ensureInitialized(\n runtime,\n FrameContexts.content,\n FrameContexts.settings,\n FrameContexts.remove,\n FrameContexts.sidePanel,\n );\n getConfigHelper(getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_GetSettings)).then(\n (config: pages.InstanceConfig) => {\n callback(config);\n },\n );\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.setConfig pages.config.setConfig(instanceSettings: Config): Promise\\<void\\>} instead.\n *\n * Sets the settings for the current instance.\n * This is an asynchronous operation; calls to getSettings are not guaranteed to reflect the changed state.\n *\n * @param - Set the desired settings for this instance.\n */\n export function setSettings(instanceSettings: Settings, onComplete?: setSettingsOnCompleteFunctionType): void {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);\n const completionHandler: setSettingsOnCompleteFunctionType = onComplete ?? getGenericOnCompleteHandler();\n configSetConfigHelper(\n getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_SetSettings),\n instanceSettings,\n )\n .then(() => {\n completionHandler(true);\n })\n .catch((error: Error) => {\n completionHandler(false, error.message);\n });\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.registerOnSaveHandler pages.config.registerOnSaveHandler(handler: registerOnSaveHandlerFunctionType): void} instead.\n *\n * Registers a handler for when the user attempts to save the settings. This handler should be used\n * to create or update the underlying resource powering the content.\n * The object passed to the handler must be used to notify whether to proceed with the save.\n * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.\n *\n * @param handler - The handler to invoke when the user selects the save button.\n */\n export function registerOnSaveHandler(handler: registerOnSaveHandlerFunctionType): void {\n pages.config.registerOnSaveHandlerHelper(\n getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_RegisterOnSaveHandler),\n handler,\n );\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link pages.config.registerOnRemoveHandler pages.config.registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void} instead.\n *\n * Registers a handler for user attempts to remove content. This handler should be used\n * to remove the underlying resource powering the content.\n * The object passed to the handler must be used to indicate whether to proceed with the removal.\n * Only one handler may be registered at a time. Subsequent registrations will override the first.\n *\n * @param handler - The handler to invoke when the user selects the remove button.\n */\n export function registerOnRemoveHandler(handler: registerOnRemoveHandlerFunctionType): void {\n pages.config.registerOnRemoveHandlerHelper(\n getApiVersionTag(settingsTelemetryVersionNumber, ApiName.Settings_RegisterOnRemoveHandler),\n handler,\n );\n }\n}\n","/* eslint-disable @typescript-eslint/ban-types */\n\nimport { sendMessageToParent } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { ChildAppWindow, IAppWindow } from './appWindow';\nimport { FrameContexts, TaskModuleDimension } from './constants';\nimport { botUrlOpenHelper, updateResizeHelper, urlOpenHelper, urlSubmitHelper } from './dialog';\nimport { dialog } from './dialog';\nimport { BotUrlDialogInfo, DialogInfo, DialogSize, TaskInfo, UrlDialogInfo } from './interfaces';\nimport { runtime } from './runtime';\n\n/**\n * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY\n */\nconst tasksTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_1;\n\n/**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link dialog} namespace instead.\n *\n * Namespace to interact with the task module-specific part of the SDK.\n * This object is usable only on the content frame.\n * The tasks namespace will be deprecated. Please use dialog for future developments.\n */\nexport namespace tasks {\n /**\n * Function type that is used to receive the result when a task module is submitted by\n * calling {@link tasks.submitTask tasks.submitTask(result?: string | object, appIds?: string | string[]): void}\n *\n * @param err - If the task module failed, this string contains the reason for failure. If the task module succeeded, this value is the empty string.\n * @param result - On success, this is the value passed to the `result` parameter of {@link tasks.submitTask tasks.submitTask(result?: string | object, appIds?: string | string[]): void}. On failure, this is the empty string.\n */\n export type startTaskSubmitHandlerFunctionType = (err: string, result: string | object) => void;\n\n /**\n * @deprecated\n * As of 2.8.0:\n * - For url-based dialogs, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} .\n * - For url-based dialogs with bot interaction, please use {@link dialog.url.bot.open dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}\n * - For Adaptive Card-based dialogs:\n * - In Teams, please continue to use this function until the new functions in {@link dialog.adaptiveCard} have been fully implemented. You can tell at runtime when they are implemented in Teams by checking\n * the return value of the {@link dialog.adaptiveCard.isSupported} function. This documentation line will also be removed once they have been fully implemented in Teams.\n * - In all other hosts, please use {@link dialog.adaptiveCard.open dialog.adaptiveCard.open(cardDialogInfo: CardDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}\n *\n * Allows an app to open the task module.\n *\n * @param taskInfo - An object containing the parameters of the task module\n * @param submitHandler - Handler to call when the task module is completed\n */\n export function startTask(taskInfo: TaskInfo, submitHandler?: startTaskSubmitHandlerFunctionType): IAppWindow {\n const apiVersionTag: string = getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_StartTask);\n const dialogSubmitHandler = submitHandler\n ? (sdkResponse: dialog.ISdkResponse) => submitHandler(sdkResponse.err ?? '', sdkResponse.result ?? '')\n : undefined;\n if (taskInfo.card === undefined && taskInfo.url === undefined) {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(apiVersionTag, 'tasks.startTask', [taskInfo as DialogInfo], submitHandler);\n } else if (taskInfo.card) {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);\n sendMessageToParent(apiVersionTag, 'tasks.startTask', [taskInfo as DialogInfo], submitHandler);\n } else if (taskInfo.completionBotId !== undefined) {\n botUrlOpenHelper(apiVersionTag, getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);\n } else {\n urlOpenHelper(apiVersionTag, getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);\n }\n return new ChildAppWindow();\n }\n\n /**\n * @deprecated\n * As of TeamsJS v2.0.0, please use {@link dialog.update.resize dialog.update.resize(dimensions: DialogSize): void} instead.\n *\n * Update height/width task info properties.\n *\n * @param taskInfo - An object containing width and height properties\n */\n export function updateTask(taskInfo: TaskInfo): void {\n taskInfo = getDefaultSizeIfNotProvided(taskInfo);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { width, height, ...extra } = taskInfo;\n\n if (Object.keys(extra).length) {\n throw new Error('resize requires a TaskInfo argument containing only width and height');\n }\n updateResizeHelper(getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_UpdateTask), taskInfo as DialogSize);\n }\n\n /**\n * @deprecated\n * As of 2.8.0, please use {@link dialog.url.submit} instead.\n *\n * Submit the task module.\n *\n * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it\n * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.\n */\n export function submitTask(result?: string | object, appIds?: string | string[]): void {\n urlSubmitHelper(getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_SubmitTask), result, appIds);\n }\n\n /**\n * Converts {@link TaskInfo} to {@link UrlDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - Converted UrlDialogInfo object\n */\n function getUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): UrlDialogInfo {\n if (taskInfo.url === undefined) {\n throw new Error(\"url property of taskInfo object can't be undefined\");\n }\n\n const urldialogInfo: UrlDialogInfo = {\n url: taskInfo.url,\n size: {\n height: taskInfo.height ? taskInfo.height : TaskModuleDimension.Small,\n width: taskInfo.width ? taskInfo.width : TaskModuleDimension.Small,\n },\n title: taskInfo.title,\n fallbackUrl: taskInfo.fallbackUrl,\n };\n return urldialogInfo;\n }\n\n /**\n * Converts {@link TaskInfo} to {@link BotUrlDialogInfo}\n * @param taskInfo - TaskInfo object to convert\n * @returns - converted BotUrlDialogInfo object\n */\n function getBotUrlDialogInfoFromTaskInfo(taskInfo: TaskInfo): BotUrlDialogInfo {\n if (taskInfo.url === undefined || taskInfo.completionBotId === undefined) {\n throw new Error(\n `Both url ${taskInfo.url} and completionBotId ${taskInfo.completionBotId} are required for bot url dialog. At least one is undefined.`,\n );\n }\n\n const botUrldialogInfo: BotUrlDialogInfo = {\n url: taskInfo.url,\n size: {\n height: taskInfo.height ? taskInfo.height : TaskModuleDimension.Small,\n width: taskInfo.width ? taskInfo.width : TaskModuleDimension.Small,\n },\n title: taskInfo.title,\n fallbackUrl: taskInfo.fallbackUrl,\n completionBotId: taskInfo.completionBotId,\n };\n return botUrldialogInfo;\n }\n\n /**\n * Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,\n * otherwise uses the height and width values corresponding to {@link DialogDimension | TaskModuleDimension.Small}\n * @param taskInfo TaskInfo object from which to extract size info, if specified\n * @returns TaskInfo with height and width specified\n */\n export function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo {\n taskInfo.height = taskInfo.height ? taskInfo.height : TaskModuleDimension.Small;\n taskInfo.width = taskInfo.width ? taskInfo.width : TaskModuleDimension.Small;\n return taskInfo;\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst interactiveTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * APIs involving Live Share, a framework for building real-time collaborative apps.\n * For more information, visit https://aka.ms/teamsliveshare\n *\n * @see LiveShareHost\n */\nexport namespace liveShare {\n /**\n * @hidden\n * The meeting roles of a user.\n * Used in Live Share for its role verification feature.\n * For more information, visit https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/teams-live-share-capabilities?tabs=javascript#role-verification-for-live-data-structures\n */\n export enum UserMeetingRole {\n /**\n * Guest role.\n */\n guest = 'Guest',\n /**\n * Attendee role.\n */\n attendee = 'Attendee',\n /**\n * Presenter role.\n */\n presenter = 'Presenter',\n /**\n * Organizer role.\n */\n organizer = 'Organizer',\n }\n\n /**\n * @hidden\n * State of the current Live Share session's Fluid container.\n * This is used internally by the `LiveShareClient` when joining a Live Share session.\n */\n export enum ContainerState {\n /**\n * The call to `LiveShareHost.setContainerId()` successfully created the container mapping\n * for the current Live Share session.\n */\n added = 'Added',\n\n /**\n * A container mapping for the current Live Share session already exists.\n * This indicates to Live Share that a new container does not need be created.\n */\n alreadyExists = 'AlreadyExists',\n\n /**\n * The call to `LiveShareHost.setContainerId()` failed to create the container mapping.\n * This happens when another client has already set the container ID for the session.\n */\n conflict = 'Conflict',\n\n /**\n * A container mapping for the current Live Share session does not yet exist.\n * This indicates to Live Share that a new container should be created.\n */\n notFound = 'NotFound',\n }\n\n /**\n * @hidden\n * Returned from `LiveShareHost.getFluidContainerId()` and `LiveShareHost.setFluidContainerId`.\n * This response specifies the container mapping information for the current Live Share session.\n */\n export interface IFluidContainerInfo {\n /**\n * State of the containerId mapping.\n */\n containerState: ContainerState;\n\n /**\n * ID of the container to join for the meeting. Undefined if the container hasn't been\n * created yet.\n */\n containerId: string | undefined;\n\n /**\n * If true, the local client should create the container and then save the created containers\n * ID to the mapping service.\n */\n shouldCreate: boolean;\n\n /**\n * If `containerId` is undefined and `shouldCreate` is false, the container isn't ready\n * but another client is creating it. In this case, the local client should wait the specified\n * amount of time before calling `LiveShareHost.getFluidContainerId()` again.\n */\n retryAfter: number;\n }\n\n /**\n * @hidden\n * Returned from `LiveShareHost.getNtpTime()` to specify the global timestamp for the current\n * Live Share session.\n */\n export interface INtpTimeInfo {\n /**\n * ISO 8601 formatted server time. For example: '2019-09-07T15:50-04:00'\n */\n ntpTime: string;\n\n /**\n * Server time expressed as the number of milliseconds since the ECMAScript epoch.\n */\n ntpTimeInUTC: number;\n }\n\n /**\n * @hidden\n * Returned from `LiveShareHost.getFluidTenantInfo()` to specify the Fluid service to use for the\n * current Live Share session.\n */\n export interface IFluidTenantInfo {\n /**\n * The Fluid Tenant ID Live Share should use.\n */\n tenantId: string;\n\n /**\n * The Fluid service endpoint Live Share should use.\n */\n serviceEndpoint: string;\n }\n\n /**\n * @hidden\n * Returned from `LiveShareHost.getClientInfo()` to specify the client info for a\n * particular client in a Live Share session.\n */\n export interface IClientInfo {\n /**\n * The host user's `userId` associated with a given `clientId`\n */\n userId: string;\n /**\n * User's meeting roles associated with a given `clientId`\n */\n roles: UserMeetingRole[];\n /**\n * The user's display name associated with a given `clientId`.\n * If this returns as `undefined`, the user may need to update their host client.\n */\n displayName?: string;\n }\n\n /**\n * Checks if the interactive capability is supported by the host\n * @returns boolean to represent whether the interactive capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel, FrameContexts.content) &&\n runtime.supports.interactive\n ? true\n : false;\n }\n}\n\n/**\n * Live Share host implementation for connecting to real-time collaborative sessions.\n * Designed for use with the `LiveShareClient` class in the `@microsoft/live-share` package.\n * Learn more at https://aka.ms/teamsliveshare\n *\n * @remarks\n * The `LiveShareClient` class from Live Share uses the hidden API's to join/manage the session.\n * To create a new `LiveShareHost` instance use the static `LiveShareHost.create()` function.\n */\nexport class LiveShareHost {\n /**\n * @hidden\n * Returns the Fluid Tenant connection info for user's current context.\n */\n public getFluidTenantInfo(): Promise<liveShare.IFluidTenantInfo> {\n ensureSupported();\n return new Promise<liveShare.IFluidTenantInfo>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetFluidTenantInfo),\n 'interactive.getFluidTenantInfo',\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Returns the fluid access token for mapped container Id.\n *\n * @param containerId Fluid's container Id for the request. Undefined for new containers.\n * @returns token for connecting to Fluid's session.\n */\n public getFluidToken(containerId?: string): Promise<string> {\n ensureSupported();\n return new Promise<string>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetFluidToken),\n 'interactive.getFluidToken',\n // eslint-disable-next-line strict-null-checks/all\n containerId,\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Returns the ID of the fluid container associated with the user's current context.\n */\n public getFluidContainerId(): Promise<liveShare.IFluidContainerInfo> {\n ensureSupported();\n return new Promise<liveShare.IFluidContainerInfo>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetFluidContainerId),\n 'interactive.getFluidContainerId',\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Sets the ID of the fluid container associated with the current context.\n *\n * @remarks\n * If this returns false, the client should delete the container they created and then call\n * `getFluidContainerId()` to get the ID of the container being used.\n * @param containerId ID of the fluid container the client created.\n * @returns A data structure with a `containerState` indicating the success or failure of the request.\n */\n public setFluidContainerId(containerId: string): Promise<liveShare.IFluidContainerInfo> {\n ensureSupported();\n return new Promise<liveShare.IFluidContainerInfo>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_SetFluidContainerId),\n 'interactive.setFluidContainerId',\n containerId,\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Returns the shared clock server's current time.\n */\n public getNtpTime(): Promise<liveShare.INtpTimeInfo> {\n ensureSupported();\n return new Promise<liveShare.INtpTimeInfo>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetNtpTime),\n 'interactive.getNtpTime',\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Associates the fluid client ID with a set of user roles.\n *\n * @param clientId The ID for the current user's Fluid client. Changes on reconnects.\n * @returns The roles for the current user.\n */\n public registerClientId(clientId: string): Promise<liveShare.UserMeetingRole[]> {\n ensureSupported();\n return new Promise<liveShare.UserMeetingRole[]>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_RegisterClientId),\n 'interactive.registerClientId',\n clientId,\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Returns the roles associated with a client ID.\n *\n * @param clientId The Client ID the message was received from.\n * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.\n */\n public getClientRoles(clientId: string): Promise<liveShare.UserMeetingRole[] | undefined> {\n ensureSupported();\n return new Promise<liveShare.UserMeetingRole[] | undefined>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetClientRoles),\n 'interactive.getClientRoles',\n clientId,\n ),\n );\n });\n }\n\n /**\n * @hidden\n * Returns the `IClientInfo` associated with a client ID.\n *\n * @param clientId The Client ID the message was received from.\n * @returns The info for a given client. Returns `undefined` if the client ID hasn't been registered yet.\n */\n public getClientInfo(clientId: string): Promise<liveShare.IClientInfo | undefined> {\n ensureSupported();\n return new Promise<liveShare.IClientInfo | undefined>((resolve) => {\n resolve(\n sendAndHandleSdkError(\n getApiVersionTag(interactiveTelemetryVersionNumber, ApiName.Interactive_GetClientInfo),\n 'interactive.getClientInfo',\n clientId,\n ),\n );\n });\n }\n\n /**\n * Factories a new `LiveShareHost` instance for use with the `LiveShareClient` class\n * in the `@microsoft/live-share` package.\n *\n * @remarks\n * `app.initialize()` must first be called before using this API.\n * This API can only be called from `meetingStage` or `sidePanel` contexts.\n */\n public static create(): LiveShareHost {\n ensureSupported();\n\n return new LiveShareHost();\n }\n}\n\nfunction ensureSupported(): void {\n if (!liveShare.isSupported()) {\n throw new Error('LiveShareHost Not supported');\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { validate } from 'uuid';\n\nimport { marketplace } from '../public/marketplace';\n\n/**\n * @hidden\n * deserialize the cart data:\n * - convert url properties from string to URL\n * @param cartItems The cart items\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function deserializeCart(cartData: any): marketplace.Cart {\n try {\n cartData.cartItems = deserializeCartItems(cartData.cartItems);\n return cartData as marketplace.Cart;\n } catch (e) {\n throw new Error('Error deserializing cart');\n }\n}\n\n/**\n * @hidden\n * deserialize the cart items:\n * - convert url properties from string to URL\n * @param cartItems The cart items\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function deserializeCartItems(cartItemsData: any): marketplace.CartItem {\n return cartItemsData.map((cartItem) => {\n if (cartItem.imageURL) {\n const url = new URL(cartItem.imageURL);\n cartItem.imageURL = url;\n }\n if (cartItem.accessories) {\n cartItem.accessories = deserializeCartItems(cartItem.accessories);\n }\n return cartItem;\n }) as marketplace.CartItem;\n}\n\n/**\n * @hidden\n * serialize the cart items:\n * - make URL properties to string\n * @param cartItems The cart items\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport const serializeCartItems = (cartItems: marketplace.CartItem[]): any => {\n try {\n return cartItems.map((cartItem) => {\n const { imageURL, accessories, ...rest } = cartItem;\n const cartItemsData: any = { ...rest };\n if (imageURL) {\n cartItemsData.imageURL = imageURL.href;\n }\n if (accessories) {\n cartItemsData.accessories = serializeCartItems(accessories);\n }\n return cartItemsData;\n });\n } catch (e) {\n throw new Error('Error serializing cart items');\n }\n};\n\n/**\n * @hidden\n * Validate the cart item properties are valid\n * @param cartItems The cart items\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateCartItems(cartItems: marketplace.CartItem[]): void {\n if (!Array.isArray(cartItems) || cartItems.length === 0) {\n throw new Error('cartItems must be a non-empty array');\n }\n for (const cartItem of cartItems) {\n validateBasicCartItem(cartItem);\n validateAccessoryItems(cartItem.accessories);\n }\n}\n\n/**\n * @hidden\n * Validate accessories\n * @param accessoryItems The accessories to be validated\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateAccessoryItems(accessoryItems: marketplace.Item[] | undefined | null): void {\n if (accessoryItems === null || accessoryItems === undefined) {\n return;\n }\n if (!Array.isArray(accessoryItems) || accessoryItems.length === 0) {\n throw new Error('CartItem.accessories must be a non-empty array');\n }\n for (const accessoryItem of accessoryItems) {\n if (accessoryItem['accessories']) {\n throw new Error('Item in CartItem.accessories cannot have accessories');\n }\n validateBasicCartItem(accessoryItem);\n }\n}\n\n/**\n * @hidden\n * Validate the basic cart item properties are valid\n * @param basicCartItem The basic cart item\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateBasicCartItem(basicCartItem: marketplace.Item): void {\n if (!basicCartItem.id) {\n throw new Error('cartItem.id must not be empty');\n }\n if (!basicCartItem.name) {\n throw new Error('cartItem.name must not be empty');\n }\n validatePrice(basicCartItem.price);\n validateQuantity(basicCartItem.quantity);\n}\n\n/**\n * @hidden\n * Validate the id is valid\n * @param id A uuid string\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateUuid(id: string | undefined | null): void {\n if (id === undefined || id === null) {\n return;\n }\n if (!id) {\n throw new Error('id must not be empty');\n }\n if (validate(id) === false) {\n throw new Error('id must be a valid UUID');\n }\n}\n\n/**\n * @hidden\n * Validate the cart item properties are valid\n * @param price The price to be validated\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validatePrice(price: number): void {\n if (typeof price !== 'number' || price < 0) {\n throw new Error(`price ${price} must be a number not less than 0`);\n }\n if (parseFloat(price.toFixed(3)) !== price) {\n throw new Error(`price ${price} must have at most 3 decimal places`);\n }\n}\n\n/**\n * @hidden\n * Validate quantity\n * @param quantity The quantity to be validated\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateQuantity(quantity: number): void {\n if (typeof quantity !== 'number' || quantity <= 0 || parseInt(quantity.toString()) !== quantity) {\n throw new Error(`quantity ${quantity} must be an integer greater than 0`);\n }\n}\n\n/**\n * @hidden\n * Validate cart status\n * @param cartStatus The cartStatus to be validated\n *\n * @internal\n * Limited to Microsoft-internal use\n */\nexport function validateCartStatus(cartStatus: marketplace.CartStatus): void {\n if (!Object.values(marketplace.CartStatus).includes(cartStatus)) {\n throw new Error(`cartStatus ${cartStatus} is not valid`);\n }\n}\n","import { sendAndHandleSdkError } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport {\n deserializeCart,\n serializeCartItems,\n validateCartItems,\n validateCartStatus,\n validateUuid,\n} from '../internal/marketplaceUtils';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { errorNotSupportedOnPlatform, FrameContexts } from './constants';\nimport { runtime } from './runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst marketplaceTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * @hidden\n * Namespace for an app to support a checkout flow by interacting with the marketplace cart in the host.\n * @beta\n */\nexport namespace marketplace {\n /**\n * @hidden\n * the version of the current cart interface\n * which is forced to send to the host in the calls.\n * @internal\n * Limited to Microsoft-internal use\n * @beta\n */\n export const cartVersion: CartVersion = {\n /**\n * @hidden\n * Represents the major version of the current cart interface,\n * it is increased when incompatible interface update happens.\n */\n majorVersion: 1,\n /**\n * @hidden\n * The minor version of the current cart interface, which is compatible\n * with the previous minor version in the same major version.\n */\n minorVersion: 1,\n };\n\n /**\n * @hidden\n * Represents the cart object for the app checkout flow.\n * @beta\n */\n export interface Cart {\n /**\n * @hidden\n * Version of the cart.\n */\n readonly version: CartVersion;\n /**\n * @hidden\n * The uuid of the cart.\n */\n readonly id: string;\n /**\n * @hidden\n * The cart info.\n */\n readonly cartInfo: CartInfo;\n /**\n * @hidden\n * The cart items.\n */\n readonly cartItems: CartItem[];\n }\n\n /**\n * @hidden\n * Version of the cart that is used by the app.\n * @internal\n * Limited to Microsoft-internal use\n * @beta\n */\n interface CartVersion {\n /**\n * @hidden\n * Represents the major version of a cart, it\n * not compatible with the previous major version.\n */\n readonly majorVersion: number;\n /**\n * @hidden\n * The minor version of a cart, which is compatible\n * with the previous minor version in the same major version.\n */\n readonly minorVersion: number;\n }\n\n /**\n * @hidden\n * Represents the cart information\n * @beta\n */\n interface CartInfo {\n /**\n * @hidden\n * The country market where the products are selling.\n * Should be country code in ISO 3166-1 alpha-2 format, e.g. CA for Canada.\n * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\n */\n readonly market: string;\n /**\n * @hidden\n * The identifier to tell the cart is checked out by admin or end user.\n */\n readonly intent: Intent;\n /**\n * @hidden\n * Locale the app should render for the user\n * Should be a BCP 47 language tag, e.g. en-US ([primary tag]-[ISO 3166-1 alpha-2 code]).\n * https://en.wikipedia.org/wiki/IETF_language_tag\n */\n readonly locale: string;\n /**\n * @hidden\n * The status of the cart.\n */\n readonly status: CartStatus;\n /**\n * @hidden\n * ISO 4217 currency code for the cart item price, e.g. USD for US Dollar.\n * https://en.wikipedia.org/wiki/ISO_4217\n */\n readonly currency: string;\n /**\n * @hidden\n * ISO 8601 timestamp string in UTC, indicates when the cart is created.\n * e.g. 2023-06-19T22:06:59Z\n * https://en.wikipedia.org/wiki/ISO_8601\n */\n readonly createdAt: string;\n /**\n * @hidden\n * ISO 8601 timestamp string in UTC, indicates when the cart is updated.\n * e.g. 2023-06-19T22:06:59Z\n * https://en.wikipedia.org/wiki/ISO_8601\n */\n readonly updatedAt: string;\n }\n\n /**\n * @hidden\n * Represents the basic cart item information.\n * @beta\n */\n export interface Item {\n /**\n * @hidden\n * The id of the cart item.\n */\n readonly id: string;\n /**\n * @hidden\n * The display name of the cart item.\n */\n readonly name: string;\n /**\n * @hidden\n * The quantity of the cart item.\n */\n readonly quantity: number;\n /**\n * @hidden\n * The price of the single cart item.\n */\n readonly price: number;\n /**\n * @hidden\n * The thumbnail imageURL of the cart item.\n */\n readonly imageURL?: URL;\n }\n\n /**\n * @hidden\n * Represents the cart item that could have accessories\n * @beta\n */\n export interface CartItem extends Item {\n /**\n * @hidden\n * Accessories to the item if existing.\n */\n readonly accessories?: Item[];\n /**\n * @hidden\n * The thumbnail imageURL of the cart item.\n */\n readonly imageURL?: URL;\n }\n\n /**\n * @hidden\n * Represents the persona creating the cart.\n * @beta\n */\n export enum Intent {\n /**\n * @hidden\n * The cart is created by admin of an organization in Teams Admin Center.\n */\n TACAdminUser = 'TACAdminUser',\n /**\n * @hidden\n * The cart is created by admin of an organization in Teams.\n */\n TeamsAdminUser = 'TeamsAdminUser',\n /**\n * @hidden\n * The cart is created by end user of an organization in Teams.\n */\n TeamsEndUser = 'TeamsEndUser',\n }\n\n /**\n * @hidden\n * Represents the status of the cart.\n * @beta\n */\n export enum CartStatus {\n /**\n * @hidden\n * Cart is created but not checked out yet.\n */\n Open = 'Open',\n /**\n * @hidden\n * Cart is checked out but not completed yet.\n */\n Processing = 'Processing',\n /**\n * @hidden\n * Indicate checking out is completed and the host should\n * return a new cart in the next getCart call.\n */\n Processed = 'Processed',\n /**\n * @hidden\n * Indicate checking out process is manually cancelled by the user\n */\n Closed = 'Closed',\n /**\n * @hidden\n * Indicate checking out is failed and the host should\n * return a new cart in the next getCart call.\n */\n Error = 'Error',\n }\n /**\n * @hidden\n * Represents the parameters to update the cart items.\n * @beta\n */\n export interface AddOrUpdateCartItemsParams {\n /**\n * @hidden\n * The uuid of the cart to be updated, target on the cart\n * being checked out if cartId is not provided.\n */\n cartId?: string;\n /**\n * @hidden\n * A list of cart items object, for each item,\n * if item id exists in the cart, overwrite the item price and quantity,\n * otherwise add new items to cart.\n */\n cartItems: CartItem[];\n }\n /**\n * @hidden\n * Represents the parameters to remove the cart items.\n * @beta\n */\n export interface RemoveCartItemsParams {\n /**\n * @hidden\n * The uuid of the cart to be updated, target on the cart\n * being checked out if cartId is not provided.\n */\n cartId?: string;\n /**\n * @hidden\n * A list of cart id, delete the cart item accordingly.\n */\n cartItemIds: string[];\n }\n /**\n * @hidden\n * Represents the parameters to update the cart status.\n * @beta\n */\n export interface UpdateCartStatusParams {\n /**\n * @hidden\n * The uuid of the cart to be updated, target on the cart\n * being checked out if cartId is not provided.\n */\n cartId?: string;\n /**\n * @hidden\n * Status of the cart.\n */\n cartStatus: CartStatus;\n /**\n * @hidden\n * Extra info to the status.\n */\n statusInfo?: string;\n }\n\n /**\n * @hidden\n * Get the cart object owned by the host to checkout.\n * @returns A promise of the cart object in the cartVersion.\n * @beta\n */\n export function getCart(): Promise<Cart> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n return sendAndHandleSdkError(\n getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_GetCart),\n 'marketplace.getCart',\n cartVersion,\n ).then(deserializeCart);\n }\n /**\n * @hidden\n * Add or update cart items in the cart owned by the host.\n * @param addOrUpdateCartItemsParams Represents the parameters to update the cart items.\n * @returns A promise of the updated cart object in the cartVersion.\n * @beta\n */\n export function addOrUpdateCartItems(addOrUpdateCartItemsParams: AddOrUpdateCartItemsParams): Promise<Cart> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!addOrUpdateCartItemsParams) {\n throw new Error('addOrUpdateCartItemsParams must be provided');\n }\n validateUuid(addOrUpdateCartItemsParams?.cartId);\n validateCartItems(addOrUpdateCartItemsParams?.cartItems);\n return sendAndHandleSdkError(\n getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_AddOrUpdateCartItems),\n 'marketplace.addOrUpdateCartItems',\n {\n ...addOrUpdateCartItemsParams,\n cartItems: serializeCartItems(addOrUpdateCartItemsParams.cartItems),\n cartVersion,\n },\n ).then(deserializeCart);\n }\n\n /**\n * @hidden\n * Remove cart items from the cart owned by the host.\n * @param removeCartItemsParams The parameters to remove the cart items.\n * @returns A promise of the updated cart object in the cartVersion.\n * @beta\n */\n export function removeCartItems(removeCartItemsParams: RemoveCartItemsParams): Promise<Cart> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!removeCartItemsParams) {\n throw new Error('removeCartItemsParams must be provided');\n }\n validateUuid(removeCartItemsParams?.cartId);\n if (!Array.isArray(removeCartItemsParams?.cartItemIds) || removeCartItemsParams?.cartItemIds.length === 0) {\n throw new Error('cartItemIds must be a non-empty array');\n }\n return sendAndHandleSdkError(\n getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_RemoveCardItems),\n 'marketplace.removeCartItems',\n {\n ...removeCartItemsParams,\n cartVersion,\n },\n ).then(deserializeCart);\n }\n /**\n * @hidden\n * Update cart status in the cart owned by the host.\n * @param updateCartStatusParams The parameters to update the cart status.\n * @returns A promise of the updated cart object in the cartVersion.\n * @beta\n */\n export function updateCartStatus(updateCartStatusParams: UpdateCartStatusParams): Promise<Cart> {\n ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);\n if (!isSupported()) {\n throw errorNotSupportedOnPlatform;\n }\n if (!updateCartStatusParams) {\n throw new Error('updateCartStatusParams must be provided');\n }\n validateUuid(updateCartStatusParams?.cartId);\n validateCartStatus(updateCartStatusParams?.cartStatus);\n return sendAndHandleSdkError(\n getApiVersionTag(marketplaceTelemetryVersionNumber, ApiName.Marketplace_UpdateCartStatus),\n 'marketplace.updateCartStatus',\n {\n ...updateCartStatusParams,\n cartVersion,\n },\n ).then(deserializeCart);\n }\n /**\n * @hidden\n * Checks if the marketplace capability is supported by the host.\n * @returns Boolean to represent whether the marketplace capability is supported.\n * @throws Error if {@linkcode app.initialize} has not successfully completed.\n * @beta\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.marketplace ? true : false;\n }\n}\n","export { authentication } from './authentication';\nexport {\n ChannelType,\n DialogDimension,\n FrameContexts,\n HostClientType,\n HostName,\n TaskModuleDimension,\n TeamType,\n UserTeamRole,\n} from './constants';\nexport {\n ActionInfo,\n ActionObjectType,\n AdaptiveCardVersion,\n AdaptiveCardDialogInfo,\n BaseActionObject,\n BotAdaptiveCardDialogInfo,\n BotUrlDialogInfo,\n Context,\n DeepLinkParameters,\n DialogInfo,\n DialogSize,\n ErrorCode,\n FileOpenPreference,\n FrameContext,\n FrameInfo,\n LoadContext,\n LocaleInfo,\n M365ContentAction,\n ResumeContext,\n SdkError,\n SecondaryId,\n SecondaryM365ContentIdName,\n ShareDeepLinkParameters,\n TabInformation,\n TabInstance,\n TabInstanceParameters,\n TaskInfo,\n TeamInformation,\n UrlDialogInfo,\n} from './interfaces';\nexport { app } from './app';\nexport { AppId } from './appId';\nexport { appInstallDialog } from './appInstallDialog';\nexport { barCode } from './barCode';\nexport { chat, OpenGroupChatRequest, OpenSingleChatRequest } from './chat';\nexport { clipboard } from './clipboard';\nexport { dialog } from './dialog';\nexport { nestedAppAuth } from './nestedAppAuth';\nexport { geoLocation } from './geoLocation';\nexport { getAdaptiveCardSchemaVersion } from './adaptiveCards';\nexport { pages } from './pages';\nexport {\n addEventListnerFunctionType,\n ChildAppWindow,\n IAppWindow,\n onCompleteFunctionType,\n ParentAppWindow,\n} from './appWindow';\nexport { menus } from './menus';\nexport { media } from './media';\nexport { secondaryBrowser } from './secondaryBrowser';\nexport { location } from './location';\nexport { meeting } from './meeting';\nexport { monetization } from './monetization';\nexport { calendar } from './calendar';\nexport { mail } from './mail';\nexport { teamsCore } from './teamsAPIs';\nexport { people } from './people';\nexport { profile } from './profile';\nexport { videoEffects } from './videoEffects';\nexport { search } from './search';\nexport { sharing } from './sharing';\nexport { stageView } from './stageView';\nexport { version } from './version';\nexport { visualMedia } from './visualMedia';\nexport { webStorage } from './webStorage';\nexport { call } from './call';\nexport { appInitialization } from './appInitialization';\nexport { thirdPartyCloudStorage } from './thirdPartyCloudStorage';\nexport {\n callbackFunctionType,\n enablePrintCapability,\n executeDeepLink,\n executeDeepLinkOnCompleteFunctionType,\n getContext,\n getContextCallbackFunctionType,\n getMruTabInstances,\n getTabInstances,\n getTabInstancesCallbackFunctionType,\n initialize,\n initializeWithFrameContext,\n print,\n registerAppButtonClickHandler,\n registerAppButtonHoverEnterHandler,\n registerAppButtonHoverLeaveHandler,\n registerBackButtonHandler,\n registerBackButtonHandlerFunctionType,\n registerBeforeUnloadHandler,\n registerChangeSettingsHandler,\n registerFocusEnterHandler,\n registerFullScreenHandler,\n registerFullScreenHandlerFunctionType,\n registerOnLoadHandler,\n registerOnThemeChangeHandler,\n registerOnThemeChangeHandlerFunctionType,\n setFrameContext,\n shareDeepLink,\n} from './publicAPIs';\nexport {\n navigateBack,\n navigateCrossDomain,\n navigateToTab,\n onCompleteHandlerFunctionType,\n returnFocus,\n} from './navigation';\nexport { settings } from './settings';\nexport { tasks } from './tasks';\nexport { liveShare, LiveShareHost } from './liveShareHost';\nexport { marketplace } from './marketplace';\n","import { sendMessageToParentAsync } from '../internal/communication';\nimport { ensureInitialized } from '../internal/internalAPIs';\nimport { ApiName, ApiVersionNumber, getApiVersionTag } from '../internal/telemetry';\nimport { ErrorCode, SdkError } from '../public';\nimport { isSdkError, TabInstance } from '../public/interfaces';\nimport { runtime } from '../public/runtime';\n\n/**\n * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY\n */\nconst hostEntityTelemetryVersionNumber: ApiVersionNumber = ApiVersionNumber.V_2;\n\n/**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * This capability allows an app to associate apps with a host entity, such as a Teams channel or chat, and configure them as needed.\n */\nexport namespace hostEntity {\n export enum AppTypes {\n edu = 'EDU',\n }\n\n /**\n * Id of the teams entity like channel, chat\n */\n interface TeamsEntityId {\n threadId: string;\n }\n\n /**\n * Id of message in which channel meeting is created\n */\n export interface TeamsChannelMeetingEntityIds extends TeamsEntityId {\n parentMessageId: string;\n }\n\n /**\n * Id of the host entity\n */\n export type HostEntityIds = TeamsEntityId | TeamsChannelMeetingEntityIds;\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * CRUD operations for tabs associated with apps\n */\n export namespace tab {\n /**\n * Represents information about a static tab instance\n */\n export interface StaticTabInstance extends TabInstance {\n tabType: 'StaticTab';\n }\n\n /**\n * Represents information about a configurable tab instance\n */\n export interface ConfigurableTabInstance extends TabInstance {\n tabType: 'ConfigurableTab';\n }\n\n /**\n * Represents information about a tab instance associated with a host entity like chat, channel or meeting. Cab be a configurable tab or static tab.\n */\n export type HostEntityTabInstance = StaticTabInstance | ConfigurableTabInstance;\n\n /**\n * Represents all tabs associated with a host entity like chat, channel or meeting\n */\n export interface HostEntityTabInstances {\n allTabs: HostEntityTabInstance[];\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Launches host-owned UI that lets a user select an app, installs it if required,\n * runs through app configuration if required, and then associates the app with the threadId provided\n *\n * @param hostEntityIds Ids of the host entity like channel, chat or meeting\n *\n * @param appTypes What type of applications to show the user. If EDU is passed as appType, only apps supported by EDU tenant are shown.\n * If no value is passed, all apps are shown.\n *\n * @returns The HostEntityTabInstance of the newly associated app\n *\n * @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation or installing\n * or configuring or adding tab fails\n */\n export function addAndConfigure(\n hostEntityIds: HostEntityIds,\n appTypes?: AppTypes[],\n ): Promise<HostEntityTabInstance> {\n ensureInitialized(runtime);\n\n if (!isSupported()) {\n throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);\n }\n\n validateThreadId(hostEntityIds.threadId);\n\n if (appTypes && appTypes.length === 0) {\n throw new Error(`Error code: ${ErrorCode.INVALID_ARGUMENTS}, message: App types cannot be an empty array`);\n }\n\n return sendMessageToParentAsync<[HostEntityTabInstance | SdkError]>(\n getApiVersionTag(hostEntityTelemetryVersionNumber, ApiName.HostEntity_Tab_addAndConfigureApp),\n 'hostEntity.tab.addAndConfigure',\n [hostEntityIds, appTypes],\n ).then(([response]: [HostEntityTabInstance | SdkError]) => {\n if (isSdkError(response)) {\n throw new Error(`Error code: ${response.errorCode}, message: ${response.message ?? 'None'}`);\n }\n return response as HostEntityTabInstance;\n });\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Returns all tab instances associated with a host entity\n *\n * @param hostEntityIds Ids of the host entity like channel, chat or meeting\n *\n * @returns Object with array of HostEntityTabInstance's associated with a host entity\n *\n * @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid or fetching tabs fails\n */\n export function getAll(hostEntityIds: HostEntityIds): Promise<HostEntityTabInstances> {\n ensureInitialized(runtime);\n\n if (!isSupported()) {\n throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);\n }\n\n validateThreadId(hostEntityIds.threadId);\n\n return sendMessageToParentAsync<[HostEntityTabInstances | SdkError]>(\n getApiVersionTag(hostEntityTelemetryVersionNumber, ApiName.HostEntity_Tab_getAll),\n 'hostEntity.tab.getAll',\n [hostEntityIds],\n ).then(([response]: [HostEntityTabInstances | SdkError]) => {\n if (isSdkError(response)) {\n throw new Error(`Error code: ${response.errorCode}, message: ${response.message ?? 'None'}`);\n }\n return response as HostEntityTabInstances;\n });\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Launches host-owned UI that lets a user re-configure the contentUrl of the tab\n *\n * @param tab Configurable tab instance that needs to be updated\n *\n * @param hostEntityIds Ids of the host entity like channel, chat or meeting\n *\n * @returns The HostEntityTabInstance of the updated tab\n *\n * @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation,\n * re-configuring tab fails or if tab is a static tab\n */\n export function reconfigure(\n tab: ConfigurableTabInstance,\n hostEntityIds: HostEntityIds,\n ): Promise<ConfigurableTabInstance> {\n ensureInitialized(runtime);\n\n if (!isSupported()) {\n throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);\n }\n\n validateTab(tab);\n validateThreadId(hostEntityIds.threadId);\n\n return sendMessageToParentAsync<[ConfigurableTabInstance | SdkError]>(\n getApiVersionTag(hostEntityTelemetryVersionNumber, ApiName.HostEntity_Tab_reconfigure),\n 'hostEntity.tab.reconfigure',\n [tab, hostEntityIds],\n ).then(([response]: [ConfigurableTabInstance | SdkError]) => {\n if (isSdkError(response)) {\n throw new Error(`Error code: ${response.errorCode}, message: ${response.message ?? 'None'}`);\n }\n return response as ConfigurableTabInstance;\n });\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Launches host-owned UI that lets a user rename the tab\n *\n * @param tab Configurable tab instance that needs to be updated\n *\n * @param hostEntityIds Ids of the host entity like channel, chat or meeting\n *\n * @returns The HostEntityTabInstance of the updated tab\n *\n * @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation,\n * re-naming tab fails or if tab is a static tab\n */\n export function rename(\n tab: ConfigurableTabInstance,\n hostEntityIds: HostEntityIds,\n ): Promise<ConfigurableTabInstance> {\n ensureInitialized(runtime);\n\n if (!isSupported()) {\n throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);\n }\n\n validateTab(tab);\n validateThreadId(hostEntityIds.threadId);\n\n return sendMessageToParentAsync<[ConfigurableTabInstance | SdkError]>(\n getApiVersionTag(hostEntityTelemetryVersionNumber, ApiName.HostEntity_Tab_rename),\n 'hostEntity.tab.rename',\n [tab, hostEntityIds],\n ).then(([response]: [ConfigurableTabInstance | SdkError]) => {\n if (isSdkError(response)) {\n throw new Error(`Error code: ${response.errorCode}, message: ${response.message ?? 'None'}`);\n }\n return response as ConfigurableTabInstance;\n });\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Launches host-owned UI that lets a user remove the tab\n *\n * @param tab tab instance that needs to be updated. Can be static tab or configurable tab.\n *\n * @param hostEntityIds Ids of the host entity like channel, chat or meeting\n *\n * @returns Boolean. Returns true if removing tab was successful\n *\n * @throws Error if host does not support this capability, library as not been initialized successfully, input parameters are invalid, user cancels operation or\n * removing tab fails\n */\n export function remove(tab: HostEntityTabInstance, hostEntityIds: HostEntityIds): Promise<boolean> {\n ensureInitialized(runtime);\n\n if (!isSupported()) {\n throw new Error(`Error code: ${ErrorCode.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);\n }\n\n validateThreadId(hostEntityIds.threadId);\n validateTab(tab);\n\n return sendMessageToParentAsync<[boolean | SdkError]>(\n getApiVersionTag(hostEntityTelemetryVersionNumber, ApiName.HostEntity_Tab_remove),\n 'hostEntity.tab.remove',\n [tab, hostEntityIds],\n ).then(([response]: [boolean | SdkError]) => {\n if (isSdkError(response)) {\n throw new Error(`Error code: ${response.errorCode}, message: ${response.message ?? 'None'}`);\n }\n return true;\n });\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Checks if the hostEntity.tab capability is supported by the host\n * @returns boolean to represent whether the histEntity and hostEntity.tab capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && hostEntity.isSupported() && runtime.supports.hostEntity?.tab ? true : false;\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Checks if the threadId is defined\n * @throws Error if threadId is null, undefined or empty\n */\n function validateThreadId(threadId: string): void {\n if (!threadId || threadId.length == 0) {\n throw new Error(`Error code: ${ErrorCode.INVALID_ARGUMENTS}, message: ThreadId cannot be null or empty`);\n }\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Checks if the tabId is defined\n * @throws Error if tabId is null, undefined or empty\n */\n function validateTab(tab: HostEntityTabInstance): void {\n if (!tab?.internalTabInstanceId || tab.internalTabInstanceId.length === 0) {\n throw new Error(`Error code: ${ErrorCode.INVALID_ARGUMENTS}, message: TabId cannot be null or empty`);\n }\n }\n }\n\n /**\n * @hidden\n * @internal\n * @beta\n * Limited to Microsoft-internal use\n *\n * Checks if the hostEntity capability is supported by the host\n * @returns boolean to represent whether the hostEntity capability is supported\n *\n * @throws Error if {@linkcode app.initialize} has not successfully completed\n */\n export function isSupported(): boolean {\n return ensureInitialized(runtime) && runtime.supports.hostEntity ? true : false;\n }\n}\n","export { logs } from './logs';\nexport {\n ChatMembersInformation,\n FilePreviewParameters,\n NotificationTypes,\n ShowNotificationParameters,\n TeamInstanceParameters,\n ThreadMember,\n UserJoinedTeamsInformation,\n ViewerActionTypes,\n UserSettingTypes,\n} from './interfaces';\nexport {\n sendCustomMessage,\n sendCustomEvent,\n registerCustomHandler,\n uploadCustomApp,\n registerUserSettingsChangeHandler,\n openFilePreview,\n} from './privateAPIs';\nexport { conversations } from './conversations';\nexport { copilot } from './copilot';\nexport { externalAppAuthentication } from './externalAppAuthentication';\nexport { externalAppCardActions } from './externalAppCardActions';\nexport { externalAppCommands } from './externalAppCommands';\nexport { files } from './files';\nexport { meetingRoom } from './meetingRoom';\nexport { messageChannels } from './messageChannels';\nexport { notifications } from './notifications';\nexport { otherAppStateChange } from './otherAppStateChange';\nexport { remoteCamera } from './remoteCamera';\nexport { appEntity } from './appEntity';\nexport { teams } from './teams';\nexport { videoEffectsEx } from './videoEffectsEx';\nexport { hostEntity } from './hostEntity';\n","export * from './private/index';\nexport * from './public/index';\n"],"names":[],"sourceRoot":""}
|