import "core-js/modules/es.array.map.js";
import "core-js/modules/es.object.to-string.js";
import { useI18n } from '../../../i18n';
import FcrDivider from '../../divider';
import { FcrIcon } from '../../icon';
import { FcrIconType } from '../../icon/type';
import { FcrPopover } from '../../popover';
import { FcrToolTip } from '../../tooltip';
import './index.css';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export var More = function More(props) {
  var t = useI18n();
  return /*#__PURE__*/_jsx("div", {
    className: "share-action-nav__button share-action-nav__not-draggable share-action-nav__single-button",
    children: /*#__PURE__*/_jsx(FcrPopover, {
      trigger: "click",
      overlayClassName: "share-action-nav__popover",
      visible: props.visible,
      onVisibleChange: props.onVisibleChange,
      content: props.morePopoverContent ? props.morePopoverContent : /*#__PURE__*/_jsx(MorePopoverContent, {}),
      overlayInnerStyle: {
        border: 0,
        boxShadow: 'var(--fcr_web_light_dropup_m)',
        borderRadius: 'var(--fcr_cornerradius_l)',
        minWidth: '210px',
        maxWidth: '230px'
      },
      children: /*#__PURE__*/_jsx(FcrToolTip
      //todo 容易遮挡结束共享按钮，暂时隐藏tooltip
      , {
        visible: false,
        content: t('fmt_participants_member_button_more'),
        trigger: "hover",
        placement: "top",
        mouseEnterDelay: 0,
        children: /*#__PURE__*/_jsx("div", {
          className: "share-action-nav__action-button",
          onClick: props.onButtonClick,
          children: /*#__PURE__*/_jsx(FcrIcon, {
            type: FcrIconType.FCR_MOBILE_MORE,
            size: 32,
            colors: {
              iconPrimary: 'var(--fcr_web_ui_scene_mainicon1)'
            }
          })
        })
      })
    })
  });
};
var MeetingItemRole = /*#__PURE__*/function (MeetingItemRole) {
  MeetingItemRole[MeetingItemRole["ALL"] = 0] = "ALL";
  MeetingItemRole[MeetingItemRole["HOST"] = 1] = "HOST";
  MeetingItemRole[MeetingItemRole["GUEST"] = 2] = "GUEST";
  return MeetingItemRole;
}(MeetingItemRole || {});
var MorePopoverContent = function MorePopoverContent() {
  var t = useI18n();
  var moreOptions = [{
    type: 'item',
    icon: FcrIconType.FCR_CHAT,
    text: t('fmt_chat_label_chat'),
    showRole: MeetingItemRole.ALL,
    key: 'chat'
  }, {
    type: 'item',
    icon: FcrIconType.FCR_EMO,
    text: t('fmt_popup_label_expression'),
    showRole: MeetingItemRole.ALL,
    key: 'emoji'
  }, {
    type: 'divider',
    showRole: MeetingItemRole.ALL,
    key: 'divider'
  }, {
    type: 'item',
    icon: null,
    text: t('fmt_record_button_Localrecording'),
    showRole: MeetingItemRole.ALL,
    key: 'localRecord'
  }, {
    type: 'item',
    icon: null,
    text: t('fmt_record_button_Cloudrecording'),
    showRole: MeetingItemRole.ALL,
    key: 'cloudRecord'
  }];
  return /*#__PURE__*/_jsx("div", {
    className: "share-action-nav__popover-inner-content share-action-nav__not-draggable",
    children: moreOptions.map(function (item, index) {
      return item.type === 'item' ? /*#__PURE__*/_jsx("div", {
        className: "share-action-nav__media-list-group",
        children: /*#__PURE__*/_jsxs("div", {
          className: "fcr-flex fcr-items-center share-action-nav__popover-option-media-setting share-action-nav__popover-option",
          children: [item.icon ? /*#__PURE__*/_jsx(FcrIcon, {
            type: FcrIconType.FCR_SETTING,
            size: 24,
            colors: {
              iconPrimary: 'var(--fcr_ui_scene_icontext5)'
            }
          }, item.key) : /*#__PURE__*/_jsx("div", {
            className: "icon-placeholder-symbol"
          }), /*#__PURE__*/_jsx("span", {
            children: t('fmt_settings_option_setting')
          })]
        })
      }, item.key) : /*#__PURE__*/_jsx(FcrDivider, {
        type: "horizontal",
        style: {
          margin: '8px 0'
        }
      }, "divider_".concat(index));
    })
  });
};