import _defineProperty from "@babel/runtime/helpers/defineProperty";
import { ActionName, InternalActionName } from '../../../constants';
import { extractAISummaryAction } from './extract-ai-summary-action';
import { extractAutomationAction } from './extract-automation-action';
import { extractCopyLinkClientAction } from './extract-copy-link-action';
import { extractDownloadClientAction } from './extract-download-action';
import extractFollowAction from './extract-follow-action';
import { extractPreviewClientAction } from './extract-preview-action';
import { extractViewRelatedLinksAction } from './extract-view-related-links-action';
export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref) {
  var actionOptions = _ref.actionOptions,
    aiSummaryConfig = _ref.aiSummaryConfig,
    appearance = _ref.appearance,
    fireEvent = _ref.fireEvent,
    id = _ref.id,
    origin = _ref.origin,
    response = _ref.response,
    url = _ref.url,
    isPreviewPanelAvailable = _ref.isPreviewPanelAvailable,
    openPreviewPanel = _ref.openPreviewPanel;
  var action = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ActionName.CopyLinkAction, extractCopyLinkClientAction({
    actionOptions: actionOptions,
    appearance: appearance,
    id: id,
    response: response
  })), ActionName.DownloadAction, extractDownloadClientAction({
    actionOptions: actionOptions,
    appearance: appearance,
    id: id,
    response: response
  })), ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), ActionName.PreviewAction, extractPreviewClientAction({
    actionOptions: actionOptions,
    appearance: appearance,
    fireEvent: fireEvent,
    id: id,
    origin: origin,
    response: response,
    isPreviewPanelAvailable: isPreviewPanelAvailable,
    openPreviewPanel: openPreviewPanel
  })), ActionName.AutomationAction, extractAutomationAction(response)), InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), InternalActionName.ViewRelatedLinksAction, extractViewRelatedLinksAction(response));
  return Object.values(action).some(function (value) {
    return Boolean(value);
  }) ? action : undefined;
};