/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
require("./index.compiled.css");
var _runtime = require("@compiled/react/runtime");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _constants = require("../../../../../constants");
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
var _common = require("../common");
var _excluded = ["className", "testId"];
var baseStyle = null;
var isMessageDescriptor = function isMessageDescriptor(x) {
  return ! /*#__PURE__*/_react.default.isValidElement(x);
};
var fontOverrideStyleMap = {
  'font.body': "_11c8fhey",
  'font.body.large': "_11c81d4k",
  'font.body.small': "_11c8wadc"
};
var maxLinesCss = null;

/**
 * Public API — exported externally. Do not add props without external support intent.
 */
var CustomElementByAccessType = function CustomElementByAccessType(_ref) {
  var _context$data, _props, _context$data2;
  var className = _ref.className,
    _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'custom-by-access-type-element' : _ref$testId,
    props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var context = (0, _flexibleUiContext.useFlexibleCardContext)();
  var accessType = context === null || context === void 0 || (_context$data = context.data) === null || _context$data === void 0 || (_context$data = _context$data.meta) === null || _context$data === void 0 ? void 0 : _context$data.accessType;
  var contentForAccessType = (_props = props[accessType]) !== null && _props !== void 0 ? _props : props.fallback;
  if (!contentForAccessType) {
    return null;
  }
  var values = context === null || context === void 0 || (_context$data2 = context.data) === null || _context$data2 === void 0 || (_context$data2 = _context$data2.actions) === null || _context$data2 === void 0 || (_context$data2 = _context$data2[_constants.InternalActionName.UnresolvedAction]) === null || _context$data2 === void 0 ? void 0 : _context$data2.values;
  if (isMessageDescriptor(contentForAccessType)) {
    return /*#__PURE__*/_react.default.createElement(_common.BaseTextElement, (0, _extends2.default)({}, props, {
      message: {
        descriptor: contentForAccessType,
        values: values
      }
      // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
      ,
      className: className,
      testId: testId,
      hideFormat: true
    }));
  }
  return /*#__PURE__*/_react.default.createElement("span", {
    style: {
      color: props.color
    },
    "data-separator": true,
    "data-smart-element-text": true,
    "data-testid": testId
    // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
    ,
    className: (0, _runtime.ax)(["_11c8wadc _1reo15vq _18m915vq _syazazsu _o5724jg8 _1e0ccj1k _1ul9idpf _1bto1l2s _1nmz1hna _sudp1e54", props.fontSize !== undefined && fontOverrideStyleMap[props.fontSize], "_1yyjkb7n _102k1j6v", className])
  }, contentForAccessType);
};
var _default = exports.default = CustomElementByAccessType;