import { NgModule, Component, ElementRef, Input } from "@angular/core";
import { getAttributes } from "@carbon/icon-helpers";
var Code20 = /** @class */ (function () {
    function Code20(elementRef) {
        this.elementRef = elementRef;
    }
    Code20.prototype.ngAfterViewInit = function () {
        var svg = this.elementRef.nativeElement.querySelector("svg");
        var attributes = getAttributes({
            width: 20,
            height: 20,
            viewBox: "0 0 32 32",
            title: this.title,
            "aria-label": this.ariaLabel,
            "aria-labelledby": this.ariaLabelledby,
            "aria-hidden": this.ariaHidden,
            focusable: this.focusable
        });
        var attrKeys = Object.keys(attributes);
        for (var i = 0; i < attrKeys.length; i++) {
            var key = attrKeys[i];
            var value = attributes[key];
            if (key === "title") {
                continue;
            }
            if (value) {
                svg.setAttribute(key, value);
            }
        }
        if (attributes.title) {
            var title = document.createElement("title");
            title.textContent = attributes.title;
            Code20.titleIdCounter++;
            title.setAttribute("id", "code20-" + Code20.titleIdCounter);
            svg.appendChild(title);
            svg.setAttribute("aria-labelledby", "code20-" + Code20.titleIdCounter);
        }
    };
    Code20.titleIdCounter = 0;
    Code20.decorators = [
        { type: Component, args: [{
                    selector: "ibm-icon-code20",
                    template: "<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform;\" xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 32 32\" aria-hidden=\"true\"><path d=\"M31 16l-7 7-1.41-1.41L28.17 16l-5.58-5.59L24 9l7 7zM1 16l7-7 1.41 1.41L3.83 16l5.58 5.59L8 23l-7-7zm11.42 9.484L17.64 6l1.932.517L14.352 26z\"></path></svg>"
                },] },
    ];
    /** @nocollapse */
    Code20.ctorParameters = function () { return [
        { type: ElementRef }
    ]; };
    Code20.propDecorators = {
        ariaLabel: [{ type: Input }],
        ariaLabelledby: [{ type: Input }],
        ariaHidden: [{ type: Input }],
        title: [{ type: Input }],
        focusable: [{ type: Input }]
    };
    return Code20;
}());
export { Code20 };
var Code20Module = /** @class */ (function () {
    function Code20Module() {
    }
    Code20Module.decorators = [
        { type: NgModule, args: [{
                    declarations: [
                        Code20
                    ],
                    exports: [
                        Code20
                    ]
                },] },
    ];
    return Code20Module;
}());
export { Code20Module };
//# sourceMappingURL=20.js.map