/*
 * 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 = ["M7.004 4.385Q6.487 4 5.662 4t-1.353.385q-.517.373-.814.967-.286.582-.396 1.285A10 10 0 0 0 3 8q0 .66.099 1.363.11.703.396 1.296.297.583.814.967.528.375 1.353.374.825 0 1.342-.374.528-.384.814-.967.297-.593.396-1.296.11-.704.11-1.363 0-.66-.11-1.363a4 4 0 0 0-.396-1.285 2.5 2.5 0 0 0-.814-.967m-.66 6.34q-.274.231-.682.231-.418 0-.693-.23a1.8 1.8 0 0 1-.429-.638 4 4 0 0 1-.22-.945A9 9 0 0 1 4.254 8q0-.604.066-1.132.066-.539.22-.945.165-.406.429-.637.274-.242.693-.242.407 0 .682.242.274.23.429.637.165.407.231.945.066.529.066 1.132 0 .605-.066 1.143a3.7 3.7 0 0 1-.231.945 1.6 1.6 0 0 1-.429.637m4.457-5.468q-.39.069-.801.069v1.028h1.968V12h1.43V4h-1.064q-.069.366-.298.617a1.7 1.7 0 0 1-.537.412 2.4 2.4 0 0 1-.698.228"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M8.011 5.48Q7.365 5 6.331 5 5.3 5 4.639 5.48A3.3 3.3 0 0 0 3.62 6.69a5.6 5.6 0 0 0-.496 1.607A12 12 0 0 0 3 10q0 .825.124 1.703.138.88.496 1.621.371.729 1.018 1.209.66.467 1.694.467 1.032 0 1.68-.467.66-.48 1.018-1.209a5.2 5.2 0 0 0 .496-1.62q.137-.88.137-1.704 0-.825-.137-1.703A5 5 0 0 0 9.03 6.69a3.1 3.1 0 0 0-1.019-1.21m-.826 7.927q-.345.288-.853.288-.524 0-.868-.288-.33-.303-.537-.797a5 5 0 0 1-.275-1.181A12 12 0 0 1 4.57 10q0-.755.083-1.415.083-.673.275-1.181.207-.509.537-.797.345-.302.868-.302.51 0 .853.302.345.288.537.797.207.508.29 1.181.082.66.082 1.415 0 .756-.083 1.429a4.6 4.6 0 0 1-.289 1.18q-.192.495-.537.798m5.817-6.836A6 6 0 0 1 12 6.657v1.286h2.463V15h1.79V5H14.92a1.54 1.54 0 0 1-.372.771q-.273.315-.673.515a3 3 0 0 1-.874.285"] as readonly string[];

export const BinaryNumber: 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="binary-number" ref={ref} {...props}>
            {paths.map((d, i) => (
                <path key={i} d={d} fillRule="evenodd" />
            ))}
        </SVGIconContainer>
    );
});
BinaryNumber.displayName = `Blueprint6.Icon.BinaryNumber`;
export default BinaryNumber;
