/*
 * 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 = ["M3.62 3.056C4.102 2.25 5 2 6 2a1 1 0 0 1 0 2c-.44 0-.615.065-.67.097a.7.7 0 0 0-.03.17 5 5 0 0 0 .01.612l.008.118c.03.48.074 1.18-.112 1.854A3 3 0 0 1 4.61 8c.29.348.483.737.596 1.149.186.674.142 1.375.112 1.854l-.007.118a5 5 0 0 0-.01.613.7.7 0 0 0 .028.169c.056.032.23.097.671.097a1 1 0 1 1 0 2c-1 0-1.897-.25-2.38-1.056a2.4 2.4 0 0 1-.313-1.05 6.5 6.5 0 0 1 .007-.89l.002-.023c.033-.573.056-.96-.038-1.301-.072-.26-.224-.535-.725-.786a1 1 0 0 1 0-1.788c.501-.251.653-.526.725-.786.094-.34.071-.728.038-1.301l-.002-.023a6.5 6.5 0 0 1-.007-.89c.025-.313.097-.692.312-1.05m1.687 8.828.016.015q-.018-.014-.016-.015m0-7.768q-.002 0 .016-.015-.015.016-.016.015m7.074-1.06C11.898 2.25 11 2 10 2a1 1 0 0 0 0 2c.44 0 .615.065.67.097a.7.7 0 0 1 .03.17 5 5 0 0 1-.01.612l-.008.118c-.03.48-.074 1.18.112 1.854.113.412.305.801.595 1.149-.29.348-.482.737-.595 1.149-.186.674-.142 1.375-.112 1.854l.007.118c.016.27.023.46.01.613a.7.7 0 0 1-.028.169c-.056.032-.23.097-.671.097a1 1 0 1 0 0 2c1 0 1.897-.25 2.38-1.056.216-.358.288-.737.313-1.05.025-.31.008-.629-.007-.89l-.002-.023c-.033-.573-.056-.96.038-1.301.072-.26.224-.535.725-.786a1 1 0 0 0 0-1.788c-.501-.251-.653-.526-.725-.786-.094-.34-.071-.728-.038-1.301l.002-.023c.015-.261.032-.58.007-.89a2.4 2.4 0 0 0-.312-1.05m-1.687 8.828-.016.015q.018-.014.016-.015m0-7.768q.002 0-.016-.015.015.016.016.015"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M8 3c-1.292 0-2.303.369-2.832 1.305-.234.415-.32.859-.353 1.245a9 9 0 0 0-.001 1.12c.034.758.055 1.255-.08 1.644a.85.85 0 0 1-.253.385c-.124.108-.34.235-.724.33a1 1 0 0 0 0 1.941c.384.096.6.223.724.331a.85.85 0 0 1 .254.386c.134.388.113.885.079 1.643a9 9 0 0 0 .001 1.12c.033.386.119.83.353 1.245C5.697 16.63 6.708 17 8 17a1 1 0 1 0 0-2c-.933 0-1.066-.244-1.089-.286l-.001-.003c-.04-.069-.082-.196-.102-.43a7 7 0 0 1 .003-.86l.007-.145c.03-.613.073-1.475-.193-2.244A2.9 2.9 0 0 0 6.01 10c.293-.314.489-.668.615-1.032.266-.769.223-1.63.193-2.244l-.007-.144a7 7 0 0 1-.003-.86c.02-.235.063-.362.102-.432l.001-.002C6.934 5.244 7.067 5 8 5a1 1 0 0 0 0-2m4 0c1.293 0 2.303.369 2.832 1.305.234.415.32.859.353 1.245.032.384.017.781.002 1.12-.035.758-.056 1.255.078 1.644.056.16.134.282.254.385.124.108.34.235.723.33a1 1 0 0 1 0 1.941c-.383.096-.599.223-.723.331a.85.85 0 0 0-.254.386c-.134.388-.113.885-.079 1.643a9 9 0 0 1-.001 1.12c-.033.386-.119.83-.353 1.245C14.302 16.63 13.292 17 12 17a1 1 0 1 1 0-2c.933 0 1.066-.244 1.088-.286l.002-.003c.04-.069.082-.196.102-.43a7 7 0 0 0-.004-.86l-.006-.145c-.03-.613-.073-1.475.193-2.244A2.9 2.9 0 0 1 13.99 10a2.9 2.9 0 0 1-.615-1.032c-.266-.769-.223-1.63-.193-2.244l.006-.144a7 7 0 0 0 .004-.86c-.02-.235-.063-.362-.102-.432l-.002-.002C13.067 5.244 12.934 5 12 5a1 1 0 1 1 0-2"] as readonly string[];

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