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EAAE,SAAS;IACpB,iBAAiB,EAAE,iBAAiB;IACpC,cAAc,EAAE,cAAc;IAC9B,YAAY,EAAE,YAAY;IAC1B,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,YAAY,EAAE,sBAAsB;IACpC,UAAU,EAAE,oBAAoB;IAChC,gBAAgB,EAAE,gBAAgB;IAClC,aAAa,EAAE,aAAa;IAC5B,GAAG,EAAE,GAAG;IACR,eAAe,EAAE,eAAe;IAChC,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,kBAAkB;IAxCvC;;;;;;;;;;;;;;;;;;;;OAoBG;gBAEQ,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,YAAY,EACjC,GAAG,EAAE,aAAa,EAClB,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,sBAAsB,EACpC,UAAU,EAAE,oBAAoB,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,kBAAkB;IAWvC,IAAW,aAAa,IAAI,UAAU,CAAC,OAAO,CAAC,CAY9C;IAED;;OAEG;IACI,oBAAoB,IAAI,UAAU,CAAC,OAAO,CAAC;CAOrD","file":"app-context.d.ts","sourcesContent":["import { forkJoin, Observable, of } from 'rxjs';\r\nimport { map, take } from 'rxjs/operators';\r\nimport { AzureManager } from '../azure/azure-manager';\r\nimport { ErrorMonitor } from '../diagnostics/error-monitor';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { FrameConnection } from '../frame/frame-connection';\r\nimport { NotificationConnection } from '../notification/notification-connection';\r\nimport { WorkItemConnection } from '../notification/work-item-connection';\r\nimport { PerformanceProfile } from '../performance/performance-profile';\r\nimport { PerformanceTracker } from '../performance/performance-tracker';\r\nimport { Rpc } from '../rpc/rpc';\r\nimport { ActiveConnection } from '../security/active-connection';\r\nimport { AuthorizationManager } from '../security/authorization-manager';\r\nimport { ConnectionManager } from '../security/connection-manager';\r\nimport { CredSSPManager } from '../security/credssp-manager';\r\nimport { CimConnection } from './cim-connection';\r\nimport { CimStream } from './cim-stream';\r\nimport { FileTransfer } from './file-transfer';\r\nimport { GatewayConnection } from './gateway-connection';\r\nimport { NodeConnection } from './node-connection';\r\nimport { PowerShellConnection } from './powershell-connection';\r\nimport { PowerShellStream } from './powershell-stream';\r\nimport { ResourceCache } from './resource-cache';\r\nimport { SettingsManager } from './settings-manager';\r\nimport { SshStream } from './ssh-stream';\r\n\r\n/**\r\n * The application context class.\r\n */\r\nexport class AppContext {\r\n    /**\r\n     * Initializes a new instance of the AppContext class.\r\n     *\r\n     * @param activeConnection the active connection.\r\n     * @param authorizationManager the authorization manager.\r\n     * @param cim the cim connection.\r\n     * @param cimStream the cim stream.\r\n     * @param connectionManager the connection manager.\r\n     * @param fileTransfer the file transfer connection.\r\n     * @param frame the frame connection.\r\n     * @param gateway the gateway connection.\r\n     * @param node the node connection.\r\n     * @param notification the notification connection.\r\n     * @param powerShell the powerShell connection.\r\n     * @param powerShellStream the powerShell stream.\r\n     * @param resourceCache the resource cache.\r\n     * @param rpc the Rpc.\r\n     * @param settingsManager the user profile.\r\n     * @param sshStream the SSH stream\r\n     * @param workItem the work item connection\r\n     */\r\n    constructor(\r\n        public activeConnection: ActiveConnection,\r\n        public authorizationManager: AuthorizationManager,\r\n        public azureManagerService: AzureManager,\r\n        public cim: CimConnection,\r\n        public cimStream: CimStream,\r\n        public connectionManager: ConnectionManager,\r\n        public credSSPManager: CredSSPManager,\r\n        public fileTransfer: FileTransfer,\r\n        public frame: FrameConnection,\r\n        public gateway: GatewayConnection,\r\n        public node: NodeConnection,\r\n        public notification: NotificationConnection,\r\n        public powerShell: PowerShellConnection,\r\n        public powerShellStream: PowerShellStream,\r\n        public resourceCache: ResourceCache,\r\n        public rpc: Rpc,\r\n        public settingsManager: SettingsManager,\r\n        public sshStream: SshStream,\r\n        public workItem: WorkItemConnection\r\n    ) {\r\n        PerformanceTracker.appContextServiceStarted();\r\n        Logging.current.registerRpc(this.rpc, this.gateway);\r\n        PerformanceProfile.current.registerRpc(this.rpc);\r\n        ErrorMonitor.current.registerRpc(this.rpc);\r\n        PerformanceTracker.appContextRpcInitStarted();\r\n        rpc.init();\r\n        PerformanceTracker.appContextRpcInitComplete();\r\n    }\r\n\r\n    public get servicesReady(): Observable<boolean> {\r\n        if (!MsftSme.self().Environment.configuration.gateway.disabled) {\r\n            return forkJoin([\r\n                this.authorizationManager.initialize(),\r\n                this.connectionManager.initialize(),\r\n                this.gateway.initialize()])\r\n                .pipe(\r\n                    map(() => true),\r\n                    take(1));\r\n        }\r\n\r\n        return of(true);\r\n    }\r\n\r\n    /**\r\n     * Reinitialized all forwarder services to get latest data.\r\n     */\r\n    public reinitializeServices(): Observable<boolean> {\r\n        return forkJoin([\r\n            this.authorizationManager.reinitializeForwardedData(),\r\n            this.connectionManager.reinitializeForwardedData(),\r\n            this.gateway.initialize()\r\n        ]).pipe(map(() => true));\r\n    }\r\n}\r\n"]}