import React, { ForwardedRef, useContext } from 'react';
import { OriginIconProps } from '../type';
import { Context } from '../context';

function IconRegexComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = true, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-Regex${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 18 18" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M4.00795 4.8397H2.43955V14.3605H4.00795C4.17233 14.3605 4.32998 14.4258 4.44622 14.542C4.56245 14.6583 4.62775 14.8159 4.62775 14.9803C4.62775 15.1447 4.56245 15.3023 4.44622 15.4186C4.32998 15.5348 4.17233 15.6001 4.00795 15.6001H2.36995C1.72435 15.6001 1.19995 15.0757 1.19995 14.4301V4.7701C1.19995 4.45979 1.32322 4.1622 1.54264 3.94278C1.76205 3.72337 2.05965 3.6001 2.36995 3.6001H4.00795C4.17233 3.6001 4.32998 3.6654 4.44622 3.78163C4.56245 3.89787 4.62775 4.05552 4.62775 4.2199C4.62775 4.38428 4.56245 4.54193 4.44622 4.65816C4.32998 4.7744 4.17233 4.8397 4.00795 4.8397ZM13.896 4.8397H15.4632H15.4644V14.3605H13.896C13.7316 14.3605 13.5739 14.4258 13.4577 14.542C13.3415 14.6583 13.2762 14.8159 13.2762 14.9803C13.2762 15.1447 13.3415 15.3023 13.4577 15.4186C13.5739 15.5348 13.7316 15.6001 13.896 15.6001H15.534C15.8443 15.6001 16.1418 15.4768 16.3613 15.2574C16.5807 15.038 16.704 14.7404 16.704 14.4301V4.7701C16.704 4.1245 16.1796 3.6001 15.534 3.6001H13.896C13.7316 3.6001 13.5739 3.6654 13.4577 3.78163C13.3415 3.89787 13.2762 4.05552 13.2762 4.2199C13.2762 4.38428 13.3415 4.54193 13.4577 4.65816C13.5739 4.7744 13.7316 4.8397 13.896 4.8397ZM8.6988 8.4553C8.6988 7.0057 7.7508 6.5449 6.5544 6.5449L6.5556 6.5437H4.8396C4.80335 6.5437 4.76746 6.55084 4.73398 6.56471C4.70049 6.57858 4.67007 6.59891 4.64444 6.62454C4.61881 6.65017 4.59848 6.68059 4.58461 6.71408C4.57074 6.74757 4.5636 6.78346 4.5636 6.8197V12.5821C4.5636 12.6183 4.57074 12.6542 4.58461 12.6877C4.59848 12.7212 4.61881 12.7516 4.64444 12.7773C4.67007 12.8029 4.70049 12.8232 4.73398 12.8371C4.76746 12.851 4.80335 12.8581 4.8396 12.8581H5.43C5.5032 12.8581 5.5734 12.829 5.62516 12.7773C5.67692 12.7255 5.706 12.6553 5.706 12.5821V10.4701H6.5004L7.5972 12.7021C7.61993 12.7486 7.65527 12.7878 7.69919 12.8151C7.74311 12.8425 7.79385 12.857 7.8456 12.8569H8.4936C8.54093 12.857 8.58748 12.8449 8.62878 12.8218C8.67009 12.7987 8.70475 12.7653 8.72946 12.725C8.75416 12.6846 8.76807 12.6386 8.76984 12.5913C8.77162 12.544 8.7612 12.497 8.7396 12.4549L7.6116 10.2721C8.2668 9.9913 8.6988 9.4033 8.6988 8.4553ZM5.706 7.5433H6.4464V7.5445C7.1796 7.5445 7.5804 7.7725 7.5804 8.4565C7.5804 9.1297 7.1796 9.4705 6.4464 9.4705H5.706V7.5433ZM13.5504 7.3201V6.8197L13.5516 6.8221C13.5516 6.78586 13.5445 6.74997 13.5306 6.71648C13.5167 6.68299 13.4964 6.65257 13.4708 6.62694C13.4451 6.60131 13.4147 6.58098 13.3812 6.56711C13.3477 6.55324 13.3118 6.5461 13.2756 6.5461H10.3236C10.2504 6.5461 10.1802 6.57518 10.1284 6.62694C10.0767 6.6787 10.0476 6.7489 10.0476 6.8221V12.5821C10.0476 12.6553 10.0767 12.7255 10.1284 12.7773C10.1802 12.829 10.2504 12.8581 10.3236 12.8581H13.3596C13.4328 12.8581 13.503 12.829 13.5548 12.7773C13.6065 12.7255 13.6356 12.6553 13.6356 12.5821V12.0769C13.6356 12.0037 13.6065 11.9335 13.5548 11.8817C13.503 11.83 13.4328 11.8009 13.3596 11.8009H11.1888V10.1125H12.9216C12.9948 10.1125 13.065 10.0834 13.1168 10.0317C13.1685 9.9799 13.1976 9.9097 13.1976 9.8365V9.3301C13.1976 9.2569 13.1685 9.1867 13.1168 9.13494C13.065 9.08318 12.9948 9.0541 12.9216 9.0541H11.19V7.5961H13.2744C13.3476 7.5961 13.4178 7.56702 13.4696 7.51526C13.5213 7.4635 13.5504 7.3933 13.5504 7.3201Z"/></svg>;
}

const IconRegex = React.forwardRef(IconRegexComponent);
export default IconRegex;
