import * as i0 from '@angular/core';
import { Component, Input, ViewChild, NgModule } from '@angular/core';
import * as i1 from '@mintplayer/ng-bootstrap/snackbar';
import { BsSnackbarModule } from '@mintplayer/ng-bootstrap/snackbar';
import * as i2 from '@mintplayer/ng-bootstrap/copy';
import { BsCopyModule } from '@mintplayer/ng-bootstrap/copy';
import * as i3 from 'ngx-highlightjs';
import { HighlightModule } from 'ngx-highlightjs';
import { CommonModule } from '@angular/common';

class BsCodeSnippetComponent {
    constructor(snackbarService) {
        this.snackbarService = snackbarService;
        this.htmlToCopy = '';
    }
    copiedHtml() {
        const snackbar = this.snackbarService.show(this.copiedTemplate);
        setTimeout(() => this.snackbarService.hide(snackbar), 3000);
    }
}
BsCodeSnippetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsCodeSnippetComponent, deps: [{ token: i1.BsSnackbarService }], target: i0.ɵɵFactoryTarget.Component });
BsCodeSnippetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: BsCodeSnippetComponent, selector: "bs-code-snippet", inputs: { htmlToCopy: "htmlToCopy" }, viewQueries: [{ propertyName: "copiedTemplate", first: true, predicate: ["copiedTemplate"], descendants: true }], ngImport: i0, template: "<div class=\"position-relative\">\n    <button #copyBtn [bsCopy]=\"htmlToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n        Copy html\n    </button>\n    <pre class=\"white-space-normal\">\n        <code class=\"d-block white-space-pre\" [highlight]=\"htmlToCopy\"></code>\n    </pre>\n    <ng-template #copiedTemplate>\n        <div class=\"p-3\">Copied!</div>\n    </ng-template>\n</div>", styles: [".copy-btn{right:0}\n"], dependencies: [{ kind: "directive", type: i2.BsCopyDirective, selector: "[bsCopy]", inputs: ["bsCopy"], outputs: ["bsCopied"] }, { kind: "directive", type: i3.Highlight, selector: "[highlight]", inputs: ["highlight", "languages", "lineNumbers"], outputs: ["highlighted"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsCodeSnippetComponent, decorators: [{
            type: Component,
            args: [{ selector: 'bs-code-snippet', template: "<div class=\"position-relative\">\n    <button #copyBtn [bsCopy]=\"htmlToCopy\" (bsCopied)=\"copiedHtml()\" class=\"btn btn-link rounded-0 text-light position-absolute copy-btn\">\n        Copy html\n    </button>\n    <pre class=\"white-space-normal\">\n        <code class=\"d-block white-space-pre\" [highlight]=\"htmlToCopy\"></code>\n    </pre>\n    <ng-template #copiedTemplate>\n        <div class=\"p-3\">Copied!</div>\n    </ng-template>\n</div>", styles: [".copy-btn{right:0}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.BsSnackbarService }]; }, propDecorators: { htmlToCopy: [{
                type: Input
            }], copiedTemplate: [{
                type: ViewChild,
                args: ['copiedTemplate']
            }] } });

class BsCodeSnippetModule {
}
BsCodeSnippetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsCodeSnippetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
BsCodeSnippetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BsCodeSnippetModule, declarations: [BsCodeSnippetComponent], imports: [CommonModule,
        BsCopyModule,
        BsSnackbarModule,
        HighlightModule], exports: [BsCodeSnippetComponent] });
BsCodeSnippetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsCodeSnippetModule, imports: [CommonModule,
        BsCopyModule,
        BsSnackbarModule,
        HighlightModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsCodeSnippetModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [
                        BsCodeSnippetComponent
                    ],
                    imports: [
                        CommonModule,
                        BsCopyModule,
                        BsSnackbarModule,
                        HighlightModule
                    ],
                    exports: [
                        BsCodeSnippetComponent
                    ]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { BsCodeSnippetComponent, BsCodeSnippetModule };
//# sourceMappingURL=mintplayer-ng-bootstrap-code-snippet.mjs.map
