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

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

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-websdk${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 24 24" fill={useCurrentColor ? 'currentColor' : 'none'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><rect width="24" height="24" rx="4" fill={useCurrentColor ? 'currentColor' : '#E1EDFB'}/><rect x="4.3" y="4.6" width="17.6" height="16.8" rx="2" fill={useCurrentColor ? 'currentColor' : '#44D3FF'}/><path d="M2 4.59998C2 3.49541 2.89543 2.59998 4 2.59998H17.6C18.7046 2.59998 19.6 3.49541 19.6 4.59998V17.4C19.6 18.5045 18.7046 19.4 17.6 19.4H4C2.89543 19.4 2 18.5045 2 17.4V4.59998Z" fill={useCurrentColor ? 'currentColor' : '#44D3FF'}/><path d="M2 4.59998H19.6V17.6382C19.6 18.7446 18.7016 19.6409 17.5951 19.6381L3.99511 19.6049C2.89245 19.6022 2 18.7075 2 17.6049V4.59998Z" fill={useCurrentColor ? 'currentColor' : '#2D76FF'}/><path opacity=".3" d="M2 13.6H16.3V17.6C16.3 18.7045 15.4046 19.6 14.3 19.6H4C2.89543 19.6 2 18.7045 2 17.6V13.6Z" fill={useCurrentColor ? 'currentColor' : '#fff'}/><path d="M6.86676 10.3792C6.86676 10.6843 6.61945 10.9316 6.31437 10.9316H5.99399C5.85366 10.9316 5.7399 10.8179 5.7399 10.6775C5.7464 10.4415 5.68328 10.2088 5.5584 10.0084C5.4353 9.82054 5.23171 9.72743 4.94447 9.72743C4.8135 9.72166 4.6835 9.75225 4.56885 9.81581C4.47634 9.87168 4.39716 9.94709 4.33685 10.0368C4.27621 10.1371 4.23498 10.2479 4.21532 10.3635C4.1929 10.489 4.18181 10.6163 4.18218 10.7438L4.19007 11.0184C4.19165 11.0595 4.19481 11.0973 4.19954 11.1305C4.20838 11.2271 4.23627 11.3209 4.28161 11.4067C4.32849 11.4907 4.39444 11.5626 4.47415 11.6166C4.55938 11.675 4.67617 11.7349 4.82294 11.7933L5.68466 12.1358C5.9356 12.2305 6.13761 12.3441 6.29228 12.472C6.44251 12.5955 6.56647 12.7479 6.65685 12.9202C6.73734 13.097 6.79258 13.299 6.82257 13.5215C6.85255 13.7472 6.86676 14.0029 6.86676 14.2901C6.86676 14.6215 6.83361 14.9293 6.76733 15.2134C6.70104 15.4975 6.59372 15.7373 6.44695 15.9362C6.29228 16.1414 6.09027 16.3039 5.83933 16.4223C5.55038 16.5479 5.2373 16.6083 4.92237 16.5991C4.64934 16.5991 4.39524 16.5517 4.16008 16.4554C3.9328 16.3652 3.72612 16.2299 3.55246 16.0577C3.38284 15.8877 3.24636 15.6875 3.15001 15.4675C3.04875 15.2356 2.99766 14.985 3.00008 14.732C3.00008 14.5002 3.18804 14.3122 3.41989 14.3122H3.77342C3.96866 14.3122 4.12694 14.4705 4.12694 14.6657C4.12694 14.8709 4.18692 15.0571 4.30844 15.2244C4.43154 15.3901 4.63513 15.4722 4.92237 15.4722C5.07613 15.4801 5.22962 15.452 5.37059 15.3901C5.47484 15.3368 5.56103 15.2539 5.61837 15.1518C5.68084 15.0376 5.71697 14.9109 5.72412 14.7809C5.74782 14.452 5.74571 14.1216 5.7178 13.793C5.7091 13.6815 5.67909 13.5727 5.62942 13.4726C5.57739 13.3913 5.50715 13.3232 5.42425 13.2737C5.3163 13.2105 5.20395 13.1551 5.08809 13.108L4.28161 12.7766C3.79551 12.5777 3.4704 12.3142 3.3031 11.9875C3.13739 11.6592 3.05532 11.2488 3.05532 10.7549C3.05532 10.4597 3.09635 10.1804 3.17684 9.91524C3.25021 9.66438 3.3743 9.43125 3.54142 9.23028C3.69608 9.03932 3.89336 8.88623 4.13326 8.7726C4.40198 8.65213 4.69426 8.59335 4.98866 8.60057C5.26801 8.60057 5.52526 8.65265 5.75726 8.75524C5.98926 8.85782 6.18969 8.99513 6.35857 9.164C6.69789 9.51752 6.86676 9.92155 6.86676 10.3792ZM8.65588 16.5328C8.10359 16.5328 7.65587 16.0851 7.65587 15.5328V9.66685C7.65587 9.11457 8.10359 8.66685 8.65587 8.66685H9.32407C9.97115 8.66685 10.4636 8.84362 10.7981 9.19714C11.1343 9.55067 11.3016 10.051 11.3016 10.6996V14.3785C11.3016 15.1155 11.1233 15.6569 10.765 16.0088C10.4083 16.3576 9.89381 16.5328 9.22464 16.5328H8.65588ZM8.78116 9.72743C8.78203 9.72743 8.78273 9.72813 8.78273 9.72901V14.953C8.78273 15.2397 9.01521 15.4722 9.30197 15.4722C9.61762 15.4722 9.84331 15.3933 9.97588 15.2355C10.1085 15.0776 10.1747 14.8283 10.1747 14.489V10.6996C10.1747 10.3903 10.1116 10.1504 9.98535 9.98152C9.86067 9.81265 9.6334 9.72743 9.30197 9.72743H8.78116ZM12.8751 16.5328C12.5639 16.5328 12.3117 16.2805 12.3117 15.9693V9.23028C12.3117 8.91911 12.5639 8.66685 12.8751 8.66685C13.1863 8.66685 13.4385 8.91911 13.4385 9.23028V12.2439C13.4385 12.2513 13.4446 12.2573 13.452 12.2573C13.4572 12.2573 13.462 12.2543 13.4642 12.2495L14.9723 8.96001C15.0542 8.78138 15.2327 8.66685 15.4292 8.66685C15.8007 8.66685 16.0438 9.05593 15.881 9.38981L14.8891 11.4234C14.7672 11.6734 14.7549 11.9628 14.8552 12.2222L16.23 15.7801C16.3701 16.1426 16.1025 16.5328 15.7139 16.5328C15.4819 16.5328 15.2745 16.388 15.1946 16.1702L14.4459 14.1306C14.2912 13.7093 13.7112 13.669 13.4998 14.0649C13.4596 14.1402 13.4385 14.2243 13.4385 14.3097V15.9693C13.4385 16.2805 13.1863 16.5328 12.8751 16.5328ZM17.9491 14.8646C18.1922 14.8646 18.391 14.9419 18.5678 15.1187C18.6497 15.1993 18.7145 15.2957 18.7582 15.402C18.8019 15.5083 18.8235 15.6224 18.8219 15.7373C18.8228 15.852 18.8009 15.9658 18.7575 16.072C18.7142 16.1781 18.6502 16.2747 18.5694 16.356C18.4009 16.5127 18.1792 16.5996 17.9491 16.5991C17.8367 16.6012 17.7251 16.5808 17.6207 16.5391C17.5163 16.4973 17.4214 16.4351 17.3415 16.356C17.2586 16.2762 17.1933 16.1799 17.1498 16.0734C17.1064 15.9668 17.0856 15.8524 17.089 15.7373C17.089 15.4943 17.1647 15.2844 17.3415 15.1187C17.4177 15.034 17.5117 14.9673 17.6168 14.9234C17.7218 14.8795 17.8354 14.8594 17.9491 14.8646Z" fill={useCurrentColor ? 'currentColor' : '#fff'}/></svg>;
}

const IconWebsdk = React.forwardRef(IconWebsdkComponent);
export default IconWebsdk;
