{"version":3,"sources":["../../../src/window/clients/app-initialization.ts"],"names":[],"mappings":"AAgDO,MAAM,uBAAwB,CAAA;AAAA,EAC1B,MAAA;AAAA,EAET,YAAY,MAAsB,EAAA;AAChC,IAAA,IAAA,CAAK,MAAS,GAAA,MAAA;AAAA;AAChB,EAEA,MAAM,MAAS,GAAA;AACb,IAAM,MAAA,IAAA,CAAK,MAAO,CAAA,IAAA,CAAK,6BAA6B,CAAA;AAAA;AACtD,EAEA,MAAM,OAAU,GAAA;AACd,IAAM,MAAA,IAAA,CAAK,MAAO,CAAA,IAAA,CAAK,0BAA0B,CAAA;AAAA;AACnD,EAEA,MAAM,QAAQ,MAAsB,EAAA;AAClC,IAAM,MAAA,IAAA,CAAK,OAAO,IAAK,CAAA,2BAAA,EAA6B,CAAC,MAAO,CAAA,MAAA,EAAQ,MAAO,CAAA,OAAO,CAAC,CAAA;AAAA;AACrF,EAEA,MAAM,gBAAgB,MAA+B,EAAA;AACnD,IAAM,MAAA,IAAA,CAAK,OAAO,IAAK,CAAA,mCAAA,EAAqC,CAAC,MAAO,CAAA,MAAA,EAAQ,MAAO,CAAA,OAAO,CAAC,CAAA;AAAA;AAE/F","file":"app-initialization.mjs","sourcesContent":["import { WindowClient } from '../window-client';\n\n/**\n * Describes errors that caused app initialization to fail\n */\nexport type FailedReason = 'AuthFailed' | 'Timeout' | 'Other';\n\n/**\n * Describes expected errors that occurred during an otherwise successful\n * app initialization\n */\nexport type ExpectedFailureReason =\n  | 'PermissionError'\n  | 'NotFound'\n  | 'Throttling'\n  | 'Offline'\n  | 'Other';\n\n/**\n * Represents the failed request sent during a failed app initialization.\n */\nexport interface FailedParams {\n  /**\n   * The reason for the failure\n   */\n  reason: FailedReason;\n\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 */\nexport interface ExpectedFailureParams {\n  /**\n   * The reason for the failure\n   */\n  reason: ExpectedFailureReason;\n\n  /**\n   * A message that describes the failure\n   */\n  message?: string;\n}\n\nexport class AppInitializationClient {\n  readonly window: WindowClient;\n\n  constructor(client: WindowClient) {\n    this.window = client;\n  }\n\n  async loaded() {\n    await this.window.send('appInitialization.appLoaded');\n  }\n\n  async success() {\n    await this.window.send('appInitialization.sucess');\n  }\n\n  async failure(params: FailedParams) {\n    await this.window.send('appInitialization.failure', [params.reason, params.message]);\n  }\n\n  async expectedFailure(params: ExpectedFailureParams) {\n    await this.window.send('appInitialization.expectedFailure', [params.reason, params.message]);\n  }\n}\n"]}