{"version":3,"sources":["../../../src/window/clients/conversation.ts"],"names":[],"mappings":"AAgDO,MAAM,mBAAoB,CAAA;AAAA,EACtB,MAAA;AAAA,EAET,YAAY,MAAsB,EAAA;AAChC,IAAA,IAAA,CAAK,MAAS,GAAA,MAAA;AAAA;AAChB,EAEA,MAAM,KAAK,MAAgC,EAAA;AACzC,IAAA,MAAM,IAAK,CAAA,MAAA,CAAO,IAAK,CAAA,gCAAA,EAAkC,MAAM,CAAA;AAAA;AACjE,EAEA,MAAM,KAAQ,GAAA;AACZ,IAAM,MAAA,IAAA,CAAK,MAAO,CAAA,IAAA,CAAK,iCAAiC,CAAA;AAAA;AAC1D,EAEA,MAAM,OAAO,MAAkC,EAAA;AAC7C,IAAA,MAAM,IAAK,CAAA,MAAA,CAAO,IAAK,CAAA,eAAA,EAAiB,MAAM,CAAA;AAAA;AAChD,EAEA,MAAM,UAAa,GAAA;AACjB,IAAM,MAAA,CAAC,EAAE,OAAQ,EAAC,IAChB,MAAM,IAAA,CAAK,MAAO,CAAA,IAAA,CAAyC,gBAAgB,CAAA;AAE7E,IAAO,OAAA,OAAA;AAAA;AAEX","file":"conversation.mjs","sourcesContent":["import { ThreadMember } from '../types';\nimport { WindowClient } from '../window-client';\n\nexport interface OpenConversationParams {\n  /**\n   * The Id of the subEntity where the conversation is taking place\n   */\n  subEntityId: string;\n\n  /**\n   * The title of the conversation\n   */\n  title: string;\n\n  /**\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  conversationId?: string;\n\n  /**\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  channelId?: string;\n\n  /**\n   * The entity Id of the tab\n   */\n  entityId: string;\n}\n\nexport interface CreateConversationParams {\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  members: string[];\n\n  /**\n   * An optional message used when initiating chat\n   */\n  message?: string;\n\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\nexport class ConversationsClient {\n  readonly window: WindowClient;\n\n  constructor(client: WindowClient) {\n    this.window = client;\n  }\n\n  async open(params: OpenConversationParams) {\n    await this.window.send('conversations.openConversation', params);\n  }\n\n  async close() {\n    await this.window.send('conversations.closeConversation');\n  }\n\n  async create(params: CreateConversationParams) {\n    await this.window.send('chat.openChat', params);\n  }\n\n  async getMembers() {\n    const [{ members }] =\n      await this.window.send<[{ members: Array<ThreadMember> }]>('getChatMembers');\n\n    return members;\n  }\n}\n"]}