/*
 * 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 = ["M15 0a1 1 0 0 1 .993.883L16 1v14a1 1 0 0 1-.883.993L15 16h-3a1 1 0 0 1-.117-1.993L12 14h2V2h-2a1 1 0 0 1-.993-.883L11 1a1 1 0 0 1 .883-.993L12 0zM4 0a1 1 0 0 1 .117 1.993L4 2H2v12h2a1 1 0 0 1 .993.883L5 15a1 1 0 0 1-.883.993L4 16H1a1 1 0 0 1-.993-.883L0 15V1A1 1 0 0 1 .883.007L1 0zm6.904 5q.384 0 .68.112.296.113.5.312.204.2.312.476t.108.604q0 .344-.152.636a1.3 1.3 0 0 1-.456.492v.016l.08.04q.083.046.168.124.128.116.232.284a1.67 1.67 0 0 1 .24.872q0 .375-.128.68a1.52 1.52 0 0 1-.896.852 2 2 0 0 1-.68.116q-.64 0-1.096-.304a1.36 1.36 0 0 1-.584-.864q-.016-.08.064-.104l.696-.16.033-.002q.045.004.063.058.088.24.288.408t.536.168q.384 0 .592-.228a.83.83 0 0 0 .208-.58q0-.416-.24-.652t-.648-.236h-.232l-.035-.005q-.045-.015-.045-.075v-.632l.005-.035q.015-.045.075-.045h.216l.138-.009a.73.73 0 0 0 .438-.207q.216-.216.216-.576a.75.75 0 0 0-.192-.532q-.192-.204-.536-.204-.304 0-.48.152a.8.8 0 0 0-.248.408q-.024.072-.096.056l-.68-.16-.034-.012q-.042-.024-.03-.084a1.35 1.35 0 0 1 .516-.828q.204-.156.48-.244A2 2 0 0 1 10.904 5m-6.152.088.035.005q.045.015.045.075v5.28l-.005.035q-.015.045-.075.045h-.736l-.035-.005q-.045-.015-.045-.075V6.16H3.92l-.832.584-.032.016Q3 6.779 3 6.696V5.88l.006-.04a.16.16 0 0 1 .05-.072l.872-.632.04-.027a.24.24 0 0 1 .104-.021zM7.344 5q.384 0 .68.12t.5.324.312.48.108.596q0 .367-.136.676-.136.308-.376.596l-1.584 1.92v.016h2.016l.035.005q.045.015.045.075v.64l-.005.035q-.015.045-.075.045H5.808l-.035-.005q-.045-.015-.045-.075v-.6l.004-.04a.13.13 0 0 1 .036-.064l1.92-2.392.1-.133a2 2 0 0 0 .156-.267 1 1 0 0 0 .096-.432.74.74 0 0 0-.188-.512Q7.664 5.8 7.32 5.8q-.329 0-.512.184a.83.83 0 0 0-.224.496q-.015.08-.088.064L5.792 6.4l-.034-.012q-.042-.024-.03-.084a1.43 1.43 0 0 1 .94-1.192A1.9 1.9 0 0 1 7.344 5"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M19 0a1 1 0 0 1 .993.883L20 1v18a1 1 0 0 1-.883.993L19 20h-4a1 1 0 0 1-.117-1.993L15 18h3V2h-3a1 1 0 0 1-.993-.883L14 1a1 1 0 0 1 .883-.993L15 0zM5 0a1 1 0 0 1 .117 1.993L5 2H2v16h3a1 1 0 0 1 .993.883L6 19a1 1 0 0 1-.883.993L5 20H1a1 1 0 0 1-.993-.883L0 19V1A1 1 0 0 1 .883.007L1 0zm8.995 6.09q.48 0 .85.14t.625.39.39.595.135.755q0 .43-.19.795a1.64 1.64 0 0 1-.57.615v.02l.101.05q.102.058.209.155.16.145.29.355a2.1 2.1 0 0 1 .3 1.09q0 .47-.16.85a1.9 1.9 0 0 1-1.12 1.065 2.4 2.4 0 0 1-.85.145q-.8 0-1.37-.38a1.7 1.7 0 0 1-.73-1.08q-.02-.1.08-.13l.87-.2.041-.003q.057.006.079.073.11.3.36.51t.67.21q.48 0 .74-.285t.26-.725q0-.52-.3-.815t-.81-.295h-.29l-.044-.006q-.056-.02-.056-.094V9.1l.006-.044q.02-.056.094-.056h.27l.145-.008a.93.93 0 0 0 .575-.262q.27-.27.27-.72 0-.41-.24-.665t-.67-.255q-.38 0-.6.19t-.31.51q-.03.09-.12.07l-.85-.2-.042-.015q-.053-.03-.038-.105a1.68 1.68 0 0 1 .645-1.035q.255-.195.6-.305t.755-.11m-7.99.11.044.006q.056.02.056.094v6.6l-.006.044q-.02.056-.094.056h-.92l-.044-.006q-.056-.02-.056-.094V7.54h-.02l-1.04.73-.04.02q-.07.024-.07-.08V7.19l.008-.051a.2.2 0 0 1 .062-.089l1.09-.79.051-.033a.3.3 0 0 1 .129-.027zm3.34-.11q.48 0 .85.15t.625.405.39.6.135.745q0 .46-.17.845a3.2 3.2 0 0 1-.47.745l-1.98 2.4V12h2.52l.044.006q.056.02.056.094v.8l-.006.044q-.02.056-.094.056h-3.82l-.044-.006q-.056-.02-.056-.094v-.75l.006-.05a.2.2 0 0 1 .044-.08l2.4-2.99.124-.167q.116-.166.196-.333.12-.25.12-.54a.92.92 0 0 0-.235-.64q-.235-.26-.665-.26-.41 0-.64.23t-.28.62q-.02.1-.11.08l-.88-.18-.043-.015q-.052-.03-.037-.105.03-.3.17-.59a1.8 1.8 0 0 1 .39-.525q.25-.236.615-.375a2.4 2.4 0 0 1 .845-.14"] as readonly string[];

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