(this.webpackChunk_msteams_react_web_client=this.webpackChunk_msteams_react_web_client||[]).push([[137235],{794827:e=>{e.exports=[{types:{HasAppDevicePermissionSubscriptionInput:[6,{contentsId:6}],ResolveAppDevicePermissionMutationInput:[6,{eventId:10,value:7}],ResolveAppDevicePermissionResponse:[2,{eventId:10,value:7}],HasAppDevicePermissionEvent:[2,{eventId:10,contentsId:6,permissionType:6}]}},{types:{Query:[2,{installedAppsPermissions:"[AppDefinition!]!"}],Subscription:[2,{hasAppDevicePermission:["HasAppDevicePermissionEvent",{input:"HasAppDevicePermissionSubscriptionInput!"}]}],Mutation:[2,{resolveAppDevicePermission:["ResolveAppDevicePermissionResponse",{input:"ResolveAppDevicePermissionMutationInput!"}]}]}}]},693443:(e,i,s)=>{"use strict";s.r(i),s.d(i,{resolvers:()=>m,typeDefs:()=>o});var r,o=s(794827),n=s(425235),t=s.n(n),p=s(850189),a=s(407104),c=s(645343);!function(e){e.camera="camera",e.clipboardRead="clipboardRead",e.geolocation="geolocation",e.microphone="microphone",e.notifications="notifications",e.otherSensors="otherSensors",e.midiSystemExclusiveMessages="midiSystemExclusiveMessages",e.unknown="unknown"}(r||(r={}));const v="[Maglev]",m={Mutation:{resolveAppDevicePermission:async(e,{input:i},{hostCommunicationService:s,loggerFactory:r,platformService:o})=>{const{eventId:n,value:t}=i,p=r.newLogger("resolveAppDevicePermissionMutation","data-resolvers-app-device-permission"),a=await s.loadModule("appdevicepermission");if(o.config.clientType===c.sK.Maglev){if(!a?.resolveFrameDevicePermissionRequest)return void p.error("appdevicepermission module is not loaded");try{return p.log(`${v} Messaging client to resolve app device permission for event ${n} with value ${t}`),await a.resolveFrameDevicePermissionRequest(n,t),{eventId:n,value:t}}catch(e){return void p.error(`${v} Error resolving app device permission request for ${n}`,e)}}if(a?.resolveDevicePermission)try{return p.log(`Messaging client to resolve app device permission for event ${n} with value ${t}`),await a.resolveDevicePermission("hasDevicePermissionsCallback",t,n),{eventId:n,value:t}}catch(e){return void p.error(`Error resolving app device permission request for ${n}`,e)}else p.error("appdevicepermission module is not loaded")}},Subscription:{hasAppDevicePermission:{async subscribe(e,{input:i},{hostCommunicationService:s,loggerFactory:o,platformService:n}){const v=o.newLogger("hasAppDevicePermissionSubscription","data-resolvers-app-device-permission"),m=await s.loadModule("appdevicepermission");let l;const d=n.config.clientType===c.sK.Maglev?new(t())((e=>{if(m?.registerForOnFrameDevicePermissionRequested)return l=m.registerForOnFrameDevicePermissionRequested((({requestId:i,frameId:s,permissionKind:o})=>{v.infoToTelemetry?.(`Processing device permission request from Maglev: ID: ${i}, Frame: ${s}, PermissionType: ${o}`,"app_device_permissions_event_subscription",void 0,!0);const n=(()=>{try{return((e,i)=>{switch(e){case r.camera:case r.microphone:return"media";case r.notifications:return"notifications";case r.midiSystemExclusiveMessages:return"midi";case r.geolocation:return"geolocation";case r.clipboardRead:case r.otherSensors:case r.unknown:default:const s=`Unsupported permission kind for Teams in Maglev: ${e}`;throw i.errorToTelemetry?.(s,"app_device_permissions_maglev_permission_kind_translation_error"),new Error(s)}})(o,v)}catch(e){return v.errorToTelemetry?.(`Error translating the permissionKind from Maglev to permissionType: ID: ${i}, Frame: ${s}, PermissionType: ${o}`,"app_device_permissions_event_subscription",void 0,!0),o}})();e.next({eventId:i,permissionType:n,contentsId:s})})),l;e.complete()})):new(t())((e=>{if(m?.registerForHasDevicePermissions)return l=m.registerForHasDevicePermissions(((i,s,r,o)=>{e.next({eventId:o,permissionType:r,contentsId:`${s}`})})),l;e.complete()}));return(0,p.VQ)((0,a.V)(d,void 0,void 0,"hasAppDevicePermission",v),(e=>{const{contentsId:s,eventId:r,permissionType:o}=e;return i.contentsId!==s?(v.log(`Skipping device permission event for webContents ${s}: Handler is registered for webContents ${i.contentsId}.`),null):{hasAppDevicePermission:{eventId:r,permissionType:o,contentsId:s}}}))}}}}}}]);
//# sourceMappingURL=https://local.teams.office.com/sourcemaps/hashed-assets/r_data-resolvers-app-device-permission-6e724b058d16a1ae.js.map