import "core-js/modules/es.symbol.js";
import "core-js/modules/es.array.filter.js";
import "core-js/modules/es.array.for-each.js";
import "core-js/modules/es.array.push.js";
import "core-js/modules/es.object.define-properties.js";
import "core-js/modules/es.object.define-property.js";
import "core-js/modules/es.object.get-own-property-descriptor.js";
import "core-js/modules/es.object.get-own-property-descriptors.js";
import "core-js/modules/es.object.keys.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.filter.js";
import "core-js/modules/esnext.iterator.for-each.js";
import "core-js/modules/web.dom-collections.for-each.js";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["content", "onClose", "closeable"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import 'rc-tooltip/assets/bootstrap_white.css';
import './index.css';
import './arrow.css';
import { FcrToolTip } from '.';
import classNames from 'classnames';
import { FcrIcon } from '../icon';
import { FcrIconType } from '../icon/type';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var DialogToolTipClosableOverlayWrap = function DialogToolTipClosableOverlayWrap(props) {
  var content = props.content,
    onClose = props.onClose,
    closeable = props.closeable;
  return /*#__PURE__*/_jsxs("div", {
    className: classNames('fcr-dialog-tooltip-overlay-content'),
    children: [closeable && /*#__PURE__*/_jsx("div", {
      className: classNames('fcr-dialog-tooltip-overlay-close'),
      onClick: onClose,
      children: /*#__PURE__*/_jsx(FcrIcon, {
        type: FcrIconType.FCR_CLOSE,
        size: 10
      })
    }), /*#__PURE__*/_jsx("div", {
      className: classNames('fcr-dialog-tooltip-overlay-content-inner'),
      children: content
    })]
  });
};
export var FcrDialogToolTip = function FcrDialogToolTip(props) {
  var content = props.content,
    onClose = props.onClose,
    _props$closeable = props.closeable,
    closeable = _props$closeable === void 0 ? true : _props$closeable,
    others = _objectWithoutProperties(props, _excluded);
  var defaultDialogOverlayInnerStyle = {
    padding: '0',
    background: "var(--fcr_mobile_ui_scene_color_popup_fill1)",
    border: "2px solid var(--fcr_ui_scene_line2)",
    color: "var(--fcr_ui_scene_icontext1)",
    borderRadius: "var(--fcr_cornerradius_xs)",
    boxShadow: 'none'
  };
  return /*#__PURE__*/_jsx(FcrToolTip, _objectSpread(_objectSpread({
    arrowContent: /*#__PURE__*/_jsx(FcrIcon, {
      type: FcrIconType.FCR_TOOLTIP_ARROW_2,
      colors: {
        iconPrimary: 'var(--fcr_mobile_ui_scene_color_popup_fill1)',
        iconSecondary: 'var(--fcr_ui_scene_line2)'
      },
      size: 20
    }),
    content: /*#__PURE__*/_jsx(DialogToolTipClosableOverlayWrap, {
      onClose: onClose,
      content: content,
      closeable: closeable
    }),
    overlayInnerStyle: _objectSpread(_objectSpread({}, defaultDialogOverlayInnerStyle), props.overlayInnerStyle)
  }, others), {}, {
    overlayClassName: "fcr-dialog-tooltip fcr-tooltip-border-width-2 ".concat(others.overlayClassName || '')
  }));
};