/*
 * 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 = ["M10 2v1H5V2c0-.55.45-1 1-1h-.22c.34-.6.98-1 1.72-1s1.38.4 1.72 1H9c.55 0 1 .45 1 1m2 0c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h1v2h7V2zm-1.459 9.455-.225-.129c-.25.352-.434.567-.55.661a.5.5 0 0 1-.276.086c-.125 0-.25-.086-.376-.24-.208-.284-.492-1.048-.842-2.31.317-.557.575-.926.792-1.098a.77.77 0 0 1 .493-.189c.066 0 .183.026.358.069.167.051.326.068.45.068q.276.002.451-.188a.67.67 0 0 0 .184-.49c0-.214-.058-.386-.184-.506-.125-.129-.292-.189-.525-.189q-.3.002-.576.146c-.175.094-.409.309-.684.635-.209.24-.509.67-.918 1.27a5.9 5.9 0 0 0-.81-2.042l-2.16.377-.042.232c.159-.034.3-.051.41-.051.216 0 .391.094.533.283q.326.438.926 2.678c-.308.42-.525.695-.642.824-.192.206-.342.343-.467.403a.65.65 0 0 1-.326.078c-.092 0-.242-.052-.442-.155a1 1 0 0 0-.375-.094.7.7 0 0 0-.518.206.73.73 0 0 0-.2.523c0 .198.067.36.192.49.125.128.292.188.509.188q.31 0 .584-.128c.183-.086.409-.275.684-.558s.65-.739 1.135-1.365c.183.592.35 1.021.484 1.296.133.266.292.464.467.584s.392.18.659.18q.388 0 .776-.283c.334-.25.684-.661 1.051-1.262"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M12 1c.55 0 1 .45 1 1v2H6V2c0-.55.45-1 1-1h.78a1.98 1.98 0 0 1 3.44 0zm2 1h2c.55 0 1 .45 1 1v16c0 .55-.45 1-1 1H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h2v3h9zm-.069 12.492c-.387.531-.68.856-.857.983a.8.8 0 0 1-.44.118c-.199 0-.398-.118-.596-.364-.325-.412-.765-1.563-1.32-3.442.492-.836.9-1.387 1.246-1.643a1.25 1.25 0 0 1 .774-.285c.105 0 .293.039.555.108.272.069.502.108.712.108a.98.98 0 0 0 .711-.285q.283-.28.283-.738c0-.324-.094-.57-.283-.757s-.46-.285-.816-.285c-.314 0-.617.068-.9.216s-.638.463-1.068.954c-.324.364-.806 1.004-1.434 1.909A9.2 9.2 0 0 0 9.2 8l-3.389.58-.063.354a3.4 3.4 0 0 1 .638-.068 1.01 1.01 0 0 1 .838.423c.345.442.837 1.77 1.454 4.002-.492.63-.816 1.043-1.004 1.24-.293.315-.545.522-.733.61a1.05 1.05 0 0 1-.502.108c-.147 0-.377-.078-.702-.226a1.5 1.5 0 0 0-.596-.148 1.15 1.15 0 0 0-.817.315 1.04 1.04 0 0 0-.324.787.98.98 0 0 0 .293.738c.199.187.461.285.796.285a2.2 2.2 0 0 0 .91-.197c.283-.128.638-.413 1.067-.846.43-.432 1.026-1.111 1.78-2.045.293.885.543 1.534.753 1.937s.461.698.733.876q.41.265 1.036.265.597.001 1.225-.422c.565-.355 1.12-.984 1.685-1.88l-.346-.196"] as readonly string[];

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