/*
 * 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 = ["M2.477 7.618c.275.55-.263 1.505-.879 2.6-.634 1.126-1.35 2.4-1.35 3.53 0 .18.19.34.349.442.132.085.29.116.446.116h2.875a.79.79 0 0 0 .788-.789c0-.209.083-.41.231-.557l.13-.13a.67.67 0 0 0 .197-.475c0-.178.07-.35.197-.476l.081-.081a.95.95 0 0 0 .279-.673v-.163c0-.308.25-.558.557-.558h2.787c.615 0 1.114-.499 1.114-1.114V8.175c0-.616.5-1.115 1.115-1.115h3.344c.616 0 1.115-.499 1.115-1.114v-.894c0-.066.026-.13.073-.175A.24.24 0 0 0 16 4.702v-.394a.36.36 0 0 0-.074-.217.36.36 0 0 1-.073-.217v-.158a.557.557 0 0 0-.558-.557h-.278a.28.28 0 0 1-.279-.278.28.28 0 0 0-.279-.28h-.115a.4.4 0 0 0-.279.116l-.163.164a.95.95 0 0 1-.673.278H2.708a.56.56 0 0 1-.394-.163.557.557 0 0 0-.788 0 .56.56 0 0 1-.395.163H.805a.557.557 0 0 0-.557.557v1.967c0 .173-.042.342-.106.503-.128.328-.284.874.106.874q.136 0 .319-.012c.628-.033 1.583-.083 1.91.57m3.657 2.229a.244.244 0 0 1-.237-.304l.24-.962c.035-.14.241-.115.241.03 0 .067.055.121.122.121h.351q.084.001.155.047l.442.295c.254.17.556-.133.387-.386l-.295-.443a.3.3 0 0 1-.047-.154v-.195c0-.154.125-.278.279-.278h1.277c.074 0 .145.03.197.081l.15.15c.209.209.326.492.326.788v.537c0 .074-.03.145-.081.197l-.15.15a1.12 1.12 0 0 1-.788.326zM1.81 5h12.9a.25.25 0 0 1 .207.389l-.167.25a.25.25 0 0 1-.208.111H1.644a.25.25 0 0 1-.208-.389l.167-.25A.25.25 0 0 1 1.811 5"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M3.096 9.522c.344.687-.328 1.881-1.098 3.25-.792 1.408-1.688 3-1.688 4.413 0 .225.238.426.436.553.165.106.362.144.558.144h3.594a.985.985 0 0 0 .985-.985c0-.262.104-.512.288-.697l.162-.162a.84.84 0 0 0 .246-.594.84.84 0 0 1 .247-.595l.102-.102a1.2 1.2 0 0 0 .348-.84v-.205c0-.385.312-.697.697-.697h3.483c.77 0 1.393-.623 1.393-1.393V10.22c0-.77.624-1.393 1.394-1.393h4.179c.77 0 1.394-.624 1.394-1.394V6.315c0-.083.033-.162.092-.219A.3.3 0 0 0 20 5.878v-.493a.44.44 0 0 0-.092-.271.44.44 0 0 1-.092-.271v-.197a.697.697 0 0 0-.697-.697h-.348a.35.35 0 0 1-.349-.348.35.35 0 0 0-.348-.349h-.144a.5.5 0 0 0-.349.145l-.203.204a1.2 1.2 0 0 1-.841.348H3.385a.7.7 0 0 1-.493-.204.697.697 0 0 0-.985 0 .7.7 0 0 1-.493.204h-.408a.697.697 0 0 0-.696.697v2.457c0 .217-.053.429-.132.63-.161.41-.356 1.093.132 1.093.112 0 .248-.008.398-.016.786-.041 1.98-.104 2.388.712m4.571 2.787a.305.305 0 0 1-.296-.38l.3-1.203c.045-.175.302-.143.302.037 0 .084.068.152.153.152h.438q.106 0 .193.059l.553.369c.317.21.694-.167.483-.483l-.368-.553a.35.35 0 0 1-.059-.194V9.87c0-.192.156-.348.348-.348h1.598a.35.35 0 0 1 .246.102l.187.187c.26.261.408.615.408.985v.672a.35.35 0 0 1-.102.246l-.187.187a1.4 1.4 0 0 1-.985.408zM2.264 6.25h16.124c.25 0 .398.278.26.486l-.209.312a.31.31 0 0 1-.26.14H2.055a.312.312 0 0 1-.26-.486l.209-.313a.31.31 0 0 1 .26-.139"] as readonly string[];

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