import 'core-js/modules/es.object.assign.js';
import { __rest } from '../../../_virtual/_tslib.js';
import { jsx, jsxs } from 'react/jsx-runtime';
import { styled, Box, css, Link } from '@mui/material';
import { IconFont } from '../../atom/IconFont/IconFont.js';
import { Typography } from '../../atom/Typography/Typography.js';

let _ = t => t,
  _t,
  _t2;
const StyledContainer = styled(Box)(({
  theme
}) => css(_t || (_t = _`
    &:hover {
      color: ${0};
    }
  `), theme.palette.text.secondary));
const StyledIconFont = styled(IconFont)(_t2 || (_t2 = _`
  pointer: cursor;
  transition: color 0.3s ease-in-out;
`));
const LinkIconText = _a => {
  var {
      variant,
      text,
      hasIcon = true,
      onClick,
      color
    } = _a,
    props = __rest(_a, ["variant", "text", "hasIcon", "onClick", "color"]);
  return jsx(StyledContainer, Object.assign({
    color: color || 'inherit'
  }, props, {
    children: jsxs(Box, Object.assign({
      display: "flex",
      alignItems: "center",
      gap: 1
    }, {
      children: [hasIcon && jsx(StyledIconFont, {
        name: "open_in_new",
        fontSize: variant === 'body1' ? 20 : 14
      }), jsx(Link, Object.assign({
        component: "button",
        underline: "none",
        sx: {
          position: 'relative',
          backgroundColor: 'inherit',
          color: 'inherit',
          '&::before': {
            content: '""',
            position: 'absolute',
            bottom: '-2px',
            left: 0,
            width: '100%',
            height: '1px',
            backgroundColor: color || 'primary.main'
          },
          '&::after': {
            content: '""',
            position: 'absolute',
            bottom: '-2px',
            left: 0,
            width: 0,
            height: '1px',
            backgroundColor: 'text.secondary',
            transition: 'width 0.3s cubic-bezier(0.215, 0.61, 0.355, 1)'
          },
          '&:hover': {
            '&::after': {
              width: '100%'
            }
          }
        },
        variant: variant,
        onClick: onClick
      }, {
        children: jsx(Typography, Object.assign({
          variant: variant,
          sx: {
            color: 'inherit',
            transition: 'color 0.3s ease-in-out'
          }
        }, {
          children: text
        }))
      }))]
    }))
  }));
};

export { LinkIconText, LinkIconText as default };
