/*
 * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import * as React from "react";
import type { SVGIconProps } from "../../svgIconProps";
import { IconSize } from "../../iconTypes";
import { SVGIconContainer } from "../../svgIconContainer";

/** Path data for the 16px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_16 = ["M12 1a.999.999 0 1 1 2 0v1h1a1 1 0 0 1 .83.44 1 1 0 0 1-.02 1.148A1 1 0 0 1 15 4h-1v1a1 1 0 0 1-.49.86 1 1 0 0 1-.9.061A1 1 0 0 1 12 5V4h-1a1 1 0 0 1-.83-.44 1 1 0 0 1 .033-1.164A1 1 0 0 1 11 2h1zm2 6.83a3 3 0 0 0 1.872-1.959q.065-.02.128-.042V14c0 .6-.4 1-1 1H1a1 1 0 0 1-1-1V2c0-.5.4-1 1-1h7.764A3 3 0 0 0 8 3c0 .768.289 1.47.764 2H2v8h12zm-6.64 3.89L5 9.363V10a1 1 0 0 1-2 0V7a1 1 0 0 1 1-1h3a1 1 0 0 1 0 2h-.645l2.365 2.362a.962.962 0 0 1-1.36 1.359"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M15 1a1 1 0 1 1 2 0v2h2a1 1 0 1 1 0 2h-2v2a1 1 0 1 1-2 0V5h-2a1 1 0 1 1 0-2h2zM1 1h12a3 3 0 0 0-2.236 5H2v11h15V9.83A3 3 0 0 0 19 7v11a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2c0-.5.4-1 1-1m2 7a1 1 0 0 1 1-1h5a1 1 0 0 1 0 2H6.414l5.293 5.293a1 1 0 1 1-1.414 1.414L5 10.414V13a1 1 0 0 1-2 0z"] as readonly string[];

export const ThVirtualAdd: React.FC<SVGIconProps> = React.forwardRef<any, SVGIconProps>((props, ref) => {
    const isLarge = (props.size ?? IconSize.STANDARD) >= IconSize.LARGE;
    const paths = isLarge ? PATHS_20 : PATHS_16;
    return (
        <SVGIconContainer iconName="th-virtual-add" ref={ref} {...props}>
            {paths.map((d, i) => (
                <path key={i} d={d} fillRule="evenodd" />
            ))}
        </SVGIconContainer>
    );
});
ThVirtualAdd.displayName = `Blueprint6.Icon.ThVirtualAdd`;
export default ThVirtualAdd;
