/*
 * 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 = ["M13.843 15.163c.232.53.138.837.138.837H6.017s-.088-.308.138-.837c.226-.53 1.338-.88 2.079-1.206.735-.332.66-.53.685-.8 0-.03.006-.068.006-.105a2.2 2.2 0 0 1-.61-.892v-.006s-.006-.006-.006-.012c-.025-.074-.056-.16-.075-.24-.176-.031-.276-.222-.314-.394a.8.8 0 0 1-.1-.437c.025-.253.131-.37.244-.419v-.037c0-.313.032-.775.088-1.07A1.84 1.84 0 0 1 8.85 8.37c.315-.24.76-.37 1.156-.37s.842.13 1.156.37c.301.233.534.56.64.935.026.08.045.166.057.246.057.295.088.75.088 1.064v.043c.113.05.214.167.232.413a.75.75 0 0 1-.1.437c-.038.172-.132.357-.301.387a2 2 0 0 1-.076.24l-.006.025a2.35 2.35 0 0 1-.597.892v.111c.025.277-.075.474.666.8s1.853.67 2.079 1.2M14.853 15h1.13s.083-.27-.12-.732c-.16-.373-.82-.641-1.411-.88a15 15 0 0 1-.409-.17c-.565-.25-.57-.412-.577-.61q-.001-.045-.005-.09v-.097c.22-.2.401-.469.522-.781 0 0 .005-.016.005-.022q.042-.105.066-.21c.149-.026.231-.188.264-.339a.66.66 0 0 0 .088-.382c-.016-.215-.104-.318-.203-.36v-.039a6 6 0 0 0-.077-.931 1.6 1.6 0 0 0-.61-1.034 1.74 1.74 0 0 0-1.285-.3c.236.285.42.622.529.996.038.124.065.248.083.36.048.257.079.578.093.867a1.74 1.74 0 0 1 .08 1.624 1.7 1.7 0 0 1-.217.453 1.4 1.4 0 0 1-.176.209q-.12.307-.292.585l.202.083c.285.117.64.261.9.387.226.11.475.245.698.414.213.161.476.408.63.764q.052.12.091.235m-2.712-.88.09.037ZM11 1c.55 0 1 .45 1 1 0 .28-.11.53-.29.7L8 6.41v1.374a2.8 2.8 0 0 0-.833 1.589 7 7 0 0 0-.092.86 1.64 1.64 0 0 0-.25.739l-.001.004c-.02.217.006.413.046.573L5.71 12.71A1.003 1.003 0 0 1 4 12V6.41L.29 2.71A1.003 1.003 0 0 1 1 1z"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M13.917 17.209c1.01.454 2.543.928 2.873 1.643.31.722.186 1.148.186 1.148H6.026s-.13-.426.186-1.148 1.842-1.203 2.86-1.65.914-.722.948-1.093c0-.048.007-.097.007-.145a3.1 3.1 0 0 1-.839-1.237l-.007-.007c0-.007-.006-.014-.006-.02a2 2 0 0 1-.11-.337c-.234-.042-.372-.296-.426-.537a1.05 1.05 0 0 1-.138-.598c.034-.35.179-.509.337-.57v-.056c0-.44.034-1.065.117-1.478q.021-.177.075-.343a2.5 2.5 0 0 1 .887-1.28c.426-.33 1.038-.501 1.58-.501.544 0 1.155.172 1.588.502a2.5 2.5 0 0 1 .963 1.622c.075.413.117 1.045.117 1.478v.062c.15.062.288.22.323.564.02.268-.083.502-.138.598-.048.234-.185.488-.42.537a3 3 0 0 1-.116.364 3.1 3.1 0 0 1-.818 1.224q-.002.084.007.158c.034.378-.103.653.914 1.1m1.059-.639c-.24-.099-.455-.186-.65-.273l-.007-.004a4 4 0 0 1-.194-.091c.224-.288.41-.609.554-.946l.001-.002.013-.033q.028-.065.052-.13l.011-.027.016-.04c.105-.092.19-.19.256-.284a1.9 1.9 0 0 0 .265-.562c.105-.227.225-.593.192-1.027l-.001-.011-.002-.011a1.85 1.85 0 0 0-.325-.91 10 10 0 0 0-.12-1.246 3 3 0 0 0-.106-.475l-.001-.006a3.54 3.54 0 0 0-.763-1.353c.27-.092.56-.139.83-.139.495 0 1.05.156 1.444.456a2.27 2.27 0 0 1 .875 1.475c.069.375.106.95.106 1.344v.056c.138.056.263.2.294.513a1 1 0 0 1-.125.543c-.044.213-.169.444-.381.488-.025.1-.056.206-.094.3a2.8 2.8 0 0 1-.756 1.144q-.002.076.006.144.006.065.007.127c.01.283.018.518.824.872.192.087.404.173.623.263.83.34 1.752.717 1.99 1.231.28.657.168 1.044.168 1.044h-2.081a4 4 0 0 0-.188-.542l-.005-.013-.006-.012c-.183-.397-.491-.681-.76-.88a5.6 5.6 0 0 0-.896-.522 17 17 0 0 0-.916-.4zM14 1c.55 0 1 .45 1 1 0 .28-.11.53-.29.7L10 7.41v.897a3.2 3.2 0 0 0-.69.4 3.5 3.5 0 0 0-1.343 2.259c-.07.37-.107.836-.122 1.237a1.84 1.84 0 0 0-.339.926c-.046.458.09.84.195 1.06.053.178.138.376.27.56q.083.121.21.242v.143l.053.052L6.71 16.71A1.003 1.003 0 0 1 5 16V7.41L.29 2.71A1.003 1.003 0 0 1 1 1zM9.059 14.361c-.23-.044-.366-.296-.42-.535a1.05 1.05 0 0 1-.138-.598c.034-.35.179-.509.337-.57v-.056c0-.44.034-1.065.117-1.478q.021-.177.075-.343A2.5 2.5 0 0 1 10 9.44V13c0 .28-.11.53-.29.71z"] as readonly string[];

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