{"version":3,"file":"acorex-components-conversation-open-composer-picker-for-files-DnSW908R.mjs","sources":["../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-popup.ts","../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-for-files.ts"],"sourcesContent":["import type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversationComposerAction } from '../../registries/composer-action.registry';\n\nexport async function openComposerPickerPopup(\n  composerService: AXConversationComposerService,\n  action: AXConversationComposerAction,\n  files: File[],\n): Promise<void> {\n  if (files.length === 0) {\n    return;\n  }\n\n  await composerService.openActionComponent(action, {}, { initialFiles: files });\n}\n","import type { AXActionSheetService } from '@acorex/components/action-sheet';\nimport type { AXPopupService } from '@acorex/components/popup';\nimport type { AXPlatform } from '@acorex/core/platform';\nimport type { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXFileService } from '@acorex/core/file';\nimport type { AXValidationRuleResult } from '@acorex/core/validation';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversation } from '../../models';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport { notifyPickerValidationErrors } from '../../plugins/composer/components/shared/picker-upload';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\nimport { openComposerPickerPopup } from './open-composer-picker-popup';\n\nexport interface AXConversationOpenComposerPickerForFilesDeps {\n  fileService: AXFileService;\n  composerService: AXConversationComposerService;\n  composerActionRegistry: AXConversationComposerActionRegistry;\n  popupService: AXPopupService;\n  actionSheetService: AXActionSheetService;\n  platform: AXPlatform;\n  toast: AXToastService;\n  translation: AXTranslationService;\n  conversation: AXConversation | null | undefined;\n  config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>;\n}\n\n/** Catalogs registered on picker actions (conversation-image, conversation-file, …). */\nfunction pickerCatalogNames(registry: AXConversationComposerActionRegistry): string[] {\n  const names = new Set<string>();\n  for (const action of registry.actions()) {\n    if ((action.component || action.componentLoader) && action.fileType) {\n      names.add(action.fileType);\n    }\n  }\n  return [...names];\n}\n\ninterface AXConversationInboundFilesAnalysis {\n  matchingCatalogs: string[];\n  actions: AXConversationComposerAction[];\n  supportedFiles: File[];\n  unsupportedFiles: { file: File; errors: AXValidationRuleResult[] }[];\n}\n\n/** Files that are not accepted by any registered picker catalog. */\nasync function collectUnsupportedInboundFiles(\n  deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerActionRegistry'>,\n  files: File[],\n  catalogs: string[],\n): Promise<{ file: File; errors: AXValidationRuleResult[] }[]> {\n  const unsupported: { file: File; errors: AXValidationRuleResult[] }[] = [];\n\n  for (const file of files) {\n    let acceptedByAny = false;\n    let lastErrors: AXValidationRuleResult[] = [];\n\n    for (const catalog of catalogs) {\n      const errors = await deps.fileService.validate(file, catalog);\n      if (errors.length === 0) {\n        acceptedByAny = true;\n        break;\n      }\n      lastErrors = errors;\n    }\n\n    if (!acceptedByAny) {\n      unsupported.push({ file, errors: lastErrors });\n    }\n  }\n\n  return unsupported;\n}\n\nasync function analyzeInboundFiles(\n  deps: Pick<\n    AXConversationOpenComposerPickerForFilesDeps,\n    'fileService' | 'composerService' | 'composerActionRegistry'\n  >,\n  files: File[],\n): Promise<AXConversationInboundFilesAnalysis> {\n  if (!files.length) {\n    return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles: [] };\n  }\n\n  const catalogs = pickerCatalogNames(deps.composerActionRegistry);\n  const unsupportedFiles = await collectUnsupportedInboundFiles(deps, files, catalogs);\n  const unsupportedSet = new Set(unsupportedFiles.map((entry) => entry.file));\n  const supportedFiles = files.filter((file) => !unsupportedSet.has(file));\n\n  if (supportedFiles.length === 0) {\n    return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles };\n  }\n\n  const context = deps.composerService.actionContext();\n  const matchingCatalogs: string[] = [];\n\n  for (const catalog of catalogs) {\n    const { rejected } = await deps.fileService.validateMany(supportedFiles, catalog);\n    if (rejected.length === 0) {\n      matchingCatalogs.push(catalog);\n    }\n  }\n\n  const seen = new Set<string>();\n  const actions: AXConversationComposerAction[] = [];\n\n  for (const catalog of matchingCatalogs) {\n    for (const action of deps.composerActionRegistry.findPickerActionsForFileType(catalog, context)) {\n      if (!seen.has(action.id)) {\n        seen.add(action.id);\n        actions.push(action);\n      }\n    }\n  }\n\n  return {\n    matchingCatalogs,\n    actions: actions.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)),\n    supportedFiles,\n    unsupportedFiles,\n  };\n}\n\nfunction notifyInboundFilesValidationFailures(\n  deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'toast' | 'translation'>,\n  analysis: AXConversationInboundFilesAnalysis,\n): void {\n  if (analysis.supportedFiles.length === 0) {\n    if (analysis.unsupportedFiles.length === 0) {\n      deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n    }\n    return;\n  }\n\n  if (analysis.actions.length === 0) {\n    const key =\n      analysis.matchingCatalogs.length === 0\n        ? '@acorex:chat.errors.inbound-files-none-supported'\n        : '@acorex:chat.errors.inbound-files-no-send-option';\n    deps.toast.warning(deps.translation.translateSync(key));\n  }\n}\n\n/**\n * File catalogs that accept every supported file in the batch, then matching visible picker actions.\n */\nexport async function resolvePickerActionsForAllFiles(\n  deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerService' | 'composerActionRegistry'>,\n  files: File[],\n): Promise<AXConversationComposerAction[]> {\n  const analysis = await analyzeInboundFiles(deps, files);\n  return analysis.actions;\n}\n\nasync function promptComposerActionChoice(\n  deps: AXConversationOpenComposerPickerForFilesDeps,\n  actions: AXConversationComposerAction[],\n  fileCount: number,\n): Promise<AXConversationComposerAction | undefined> {\n  const { AXConversationComposerActionChoiceDialogComponent } = await import('./composer-action-choice-dialog.component');\n  const result = await deps.popupService.open(AXConversationComposerActionChoiceDialogComponent, {\n    title: deps.translation.translateSync('@acorex:chat.dialog.choose-send-option.title'),\n    size: 'sm',\n    closeButton: true,\n    header: true,\n    inputs: {\n      actions,\n      fileCount,\n      composerActionRegistry: deps.composerActionRegistry,\n    },\n  });\n\n  const action = result?.data as AXConversationComposerAction | undefined;\n  if (!action?.component && !action?.componentLoader) {\n    return undefined;\n  }\n  return action;\n}\n\n/**\n * Match dropped/pasted files to composer picker action(s) and open the popup.\n * Unsupported files are skipped after a warning toast; supported files continue.\n * @returns true when a picker popup was opened\n */\nexport async function openComposerPickerForFiles(\n  deps: AXConversationOpenComposerPickerForFilesDeps,\n  files: File[],\n): Promise<boolean> {\n  if (!files.length) {\n    return false;\n  }\n\n  const conversation = deps.conversation;\n  if (!conversation) {\n    return false;\n  }\n\n  const analysis = await analyzeInboundFiles(deps, files);\n\n  if (analysis.unsupportedFiles.length > 0) {\n    notifyPickerValidationErrors(deps.toast, deps.translation, analysis.unsupportedFiles);\n  }\n\n  if (!analysis.supportedFiles.length || !analysis.actions.length) {\n    notifyInboundFilesValidationFailures(deps, analysis);\n    return false;\n  }\n\n  let action = analysis.actions[0];\n  if (analysis.actions.length > 1) {\n    const chosen = await promptComposerActionChoice(deps, analysis.actions, analysis.supportedFiles.length);\n    if (!chosen) {\n      return false;\n    }\n    action = chosen;\n  }\n\n  const catalog = action.fileType;\n  if (!catalog) {\n    deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n    return false;\n  }\n\n  const { accepted, rejected } = await deps.fileService.validateMany(analysis.supportedFiles, catalog);\n  if (rejected.length > 0) {\n    notifyPickerValidationErrors(deps.toast, deps.translation, rejected);\n  }\n  if (accepted.length === 0) {\n    return false;\n  }\n\n  await openComposerPickerPopup(deps.composerService, action, accepted);\n  return true;\n}\n\n/** Extract OS-copied files from a paste event (e.g. Ctrl+V after copying a file in Explorer). */\nexport function filesFromClipboardEvent(event: ClipboardEvent): File[] {\n  const items = event.clipboardData?.items;\n  if (!items?.length) {\n    return [];\n  }\n\n  const files: File[] = [];\n  for (let i = 0; i < items.length; i++) {\n    const item = items[i];\n    if (item.kind === 'file') {\n      const file = item.getAsFile();\n      if (file) {\n        files.push(file);\n      }\n    }\n  }\n  return files;\n}\n\n/** Whether a paste event target lies in the chat panel (not sidebar). */\nexport function isPasteTargetInChatPanel(host: HTMLElement, target: EventTarget | null): boolean {\n  if (!(target instanceof Node) || !host.contains(target)) {\n    return false;\n  }\n\n  const excluded = host.querySelector('.conversation-sidebar-container, .sidebar-container');\n  if (excluded?.contains(target)) {\n    return false;\n  }\n\n  const chatMain = host.querySelector('.conversation-main-container, .main-area, .conversation-view');\n  if (chatMain) {\n    return chatMain.contains(target);\n  }\n\n  return true;\n}\n\n/** Handle Ctrl+V / paste when the clipboard holds files copied from the OS. */\nexport async function handleConversationFilePaste(\n  event: ClipboardEvent,\n  host: HTMLElement,\n  deps: AXConversationOpenComposerPickerForFilesDeps,\n): Promise<void> {\n  if (!isPasteTargetInChatPanel(host, event.target)) {\n    return;\n  }\n\n  const files = filesFromClipboardEvent(event);\n  if (!files.length) {\n    return;\n  }\n\n  const handled = await openComposerPickerForFiles(deps, files);\n  if (handled) {\n    event.preventDefault();\n    event.stopImmediatePropagation();\n  }\n}\n"],"names":[],"mappings":";;AAGO,eAAe,uBAAuB,CAC3C,eAA8C,EAC9C,MAAoC,EACpC,KAAa,EAAA;AAEb,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB;IACF;AAEA,IAAA,MAAM,eAAe,CAAC,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AAChF;;ACcA;AACA,SAAS,kBAAkB,CAAC,QAA8C,EAAA;AACxE,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU;IAC/B,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;AACvC,QAAA,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,eAAe,KAAK,MAAM,CAAC,QAAQ,EAAE;AACnE,YAAA,KAAK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