// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to
//  deal in the Software without restriction, including without limitation the
//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
//  sell copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
/** @ignore */
import { Component, ElementRef, Input, ViewChild, ViewEncapsulation, } from "@angular/core";
import hljs from "highlight.js";
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
/**
 * <example-url>./../examples/index.html#/code</example-url><br />
 */
/**
 * @ignore
 * Purpose of this component is to format and colorize your source code snippets.
 * Optionally you can
 * specify a programming language to be used for highlighting, otherwise an automated detection will be used. This
 * directive is encapsulating Highlight.js library.
 *
 * Consumer needs to set up languages which need to be supported. It must happen before CodeComponent is rendered.
 * The best place is parent page/component's onInit() or in app initializer
 * example:
 *
 * import hljs from "highlight.js";
 *
 * where "highlight.js" should be used as alias to regular "highlight.js/lib/core.js"
 * to avoid loading all languages. And then just load what you really need, e.g. typescript
 *
 * hljs.registerLanguage("typescript", require("highlight.js/lib/languages/typescript"));
 *
 * __Name:__
 *
 * NUI Code component.
 *
 * __Usage:__
 *
 * ```html
 * <nui-example-code>{{code}}<nui-example-code>
 * ```
 *
 */
export class ExampleCodeComponent {
    ngAfterViewInit() {
        // remove wrapping spaces. They might appear due to passing content via ng-content into element
        this.codeElement.nativeElement.innerHTML =
            this.codeElement.nativeElement.innerHTML.trim();
        hljs.highlightElement(this.codeElement.nativeElement);
    }
}
ExampleCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ExampleCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
ExampleCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ExampleCodeComponent, selector: "nui-example-code", inputs: { language: "language" }, viewQueries: [{ propertyName: "codeElement", first: true, predicate: ["code"], descendants: true }], ngImport: i0, template: "<div #code class=\"nui-example-code\" [ngClass]=\"language\">\n    <ng-content></ng-content>\n</div>\n", styles: [".nui-example-code{white-space:pre;font-family:Source Code Pro,monospace;padding:.5em}.nui-example-code--no-padding.hljs{padding:0}.nui-example-code--transparent-background.hljs,.nui-example-code--transparent-background>.hljs{background:none}.hljs{display:block;overflow-x:auto;color:#fff;background-color:#333}.hljs-name,.hljs-strong{font-weight:700}.hljs-code,.hljs-emphasis{font-style:italic}.hljs-tag{color:#62c8f3}.hljs-variable,.hljs-template-variable,.hljs-selector-id,.hljs-selector-class{color:#ade5fc}.hljs-string,.hljs-bullet{color:#a2fca2}.hljs-type,.hljs-title,.hljs-section,.hljs-attribute,.hljs-quote,.hljs-built_in,.hljs-builtin-name{color:#ffa}.hljs-number,.hljs-symbol,.hljs-bullet{color:#d36363}.hljs-keyword,.hljs-selector-tag,.hljs-literal{color:#fcc28c}.hljs-comment,.hljs-deletion,.hljs-code{color:#888}.hljs-regexp,.hljs-link{color:#c6b4f0}.hljs-meta{color:#fc9b9b}.hljs-deletion{background-color:#fc9b9b;color:#333}.hljs-addition{background-color:#a2fca2;color:#333}.hljs a{color:inherit}.hljs a:focus,.hljs a:hover{color:inherit;text-decoration:underline}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ExampleCodeComponent, decorators: [{
            type: Component,
            args: [{ selector: "nui-example-code", encapsulation: ViewEncapsulation.None, template: "<div #code class=\"nui-example-code\" [ngClass]=\"language\">\n    <ng-content></ng-content>\n</div>\n", styles: [".nui-example-code{white-space:pre;font-family:Source Code Pro,monospace;padding:.5em}.nui-example-code--no-padding.hljs{padding:0}.nui-example-code--transparent-background.hljs,.nui-example-code--transparent-background>.hljs{background:none}.hljs{display:block;overflow-x:auto;color:#fff;background-color:#333}.hljs-name,.hljs-strong{font-weight:700}.hljs-code,.hljs-emphasis{font-style:italic}.hljs-tag{color:#62c8f3}.hljs-variable,.hljs-template-variable,.hljs-selector-id,.hljs-selector-class{color:#ade5fc}.hljs-string,.hljs-bullet{color:#a2fca2}.hljs-type,.hljs-title,.hljs-section,.hljs-attribute,.hljs-quote,.hljs-built_in,.hljs-builtin-name{color:#ffa}.hljs-number,.hljs-symbol,.hljs-bullet{color:#d36363}.hljs-keyword,.hljs-selector-tag,.hljs-literal{color:#fcc28c}.hljs-comment,.hljs-deletion,.hljs-code{color:#888}.hljs-regexp,.hljs-link{color:#c6b4f0}.hljs-meta{color:#fc9b9b}.hljs-deletion{background-color:#fc9b9b;color:#333}.hljs-addition{background-color:#a2fca2;color:#333}.hljs a{color:inherit}.hljs a:focus,.hljs a:hover{color:inherit;text-decoration:underline}\n"] }]
        }], propDecorators: { language: [{
                type: Input
            }], codeElement: [{
                type: ViewChild,
                args: ["code"]
            }] } });
//# sourceMappingURL=data:application/json;base64, 