import { AsyncPipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
import { TuiButton } from '@taiga-ui/core/components/button';
import { TUI_CLOSE_WORD, TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
import { injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
import * as i0 from "@angular/core";
import * as i1 from "@taiga-ui/cdk/directives/animated";
class TuiPdfViewerComponent {
    constructor() {
        this.closeWord$ = inject(TUI_CLOSE_WORD);
        this.icons = inject(TUI_COMMON_ICONS);
        this.context = injectContext();
    }
    onKeyDownEsc() {
        this.context.$implicit.complete();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPdfViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiPdfViewerComponent, isStandalone: true, selector: "tui-pdf-viewer", host: { listeners: { "document:keydown.esc": "onKeyDownEsc()" } }, hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "<header class=\"t-header\">\n    <h2\n        automation-id=\"tui-pdf-viewer__label\"\n        class=\"t-title\"\n    >\n        {{ context.label }}\n    </h2>\n    <div class=\"t-actions\">\n        <ng-container *polymorpheusOutlet=\"context.actions as text; context: context\">\n            {{ text }}\n        </ng-container>\n    </div>\n    <button\n        appearance=\"\"\n        size=\"s\"\n        tuiIconButton\n        type=\"button\"\n        class=\"t-close\"\n        [iconStart]=\"icons.close\"\n        [style.border-radius.%]=\"100\"\n        (click)=\"context.$implicit.complete()\"\n    >\n        {{ closeWord$ | async }}\n    </button>\n</header>\n<section class=\"t-content\">\n    <iframe\n        *polymorpheusOutlet=\"context.content as content; context: context\"\n        title=\"pdf\"\n        class=\"t-iframe\"\n        [src]=\"content\"\n    ></iframe>\n</section>\n", styles: [":host{display:block;inline-size:100%;block-size:100%;box-sizing:border-box;color:#fff;background:#333639;padding-block-start:env(safe-area-inset-top);padding-block-end:env(safe-area-inset-bottom)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}.t-header{display:flex;align-items:center;block-size:4rem;padding:0 1rem 0 1.5625rem;box-shadow:inset 0 -1px #535659}.t-title{margin:0;font:var(--tui-font-text-m);white-space:nowrap;text-overflow:ellipsis;padding-inline-end:.3125rem;overflow:hidden}.t-actions{display:flex;margin-inline-start:auto}.t-close{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-inline-start:.75rem;color:#fff;background:#ffffff52}.t-close:hover{background:#fff6}.t-content{block-size:calc(100% - 4rem);overflow:hidden}.t-iframe{inline-size:100%;block-size:100%}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
export { TuiPdfViewerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPdfViewerComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, selector: 'tui-pdf-viewer', imports: [AsyncPipe, PolymorpheusOutlet, TuiButton], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiAnimated], host: {
                        '(document:keydown.esc)': 'onKeyDownEsc()',
                    }, template: "<header class=\"t-header\">\n    <h2\n        automation-id=\"tui-pdf-viewer__label\"\n        class=\"t-title\"\n    >\n        {{ context.label }}\n    </h2>\n    <div class=\"t-actions\">\n        <ng-container *polymorpheusOutlet=\"context.actions as text; context: context\">\n            {{ text }}\n        </ng-container>\n    </div>\n    <button\n        appearance=\"\"\n        size=\"s\"\n        tuiIconButton\n        type=\"button\"\n        class=\"t-close\"\n        [iconStart]=\"icons.close\"\n        [style.border-radius.%]=\"100\"\n        (click)=\"context.$implicit.complete()\"\n    >\n        {{ closeWord$ | async }}\n    </button>\n</header>\n<section class=\"t-content\">\n    <iframe\n        *polymorpheusOutlet=\"context.content as content; context: context\"\n        title=\"pdf\"\n        class=\"t-iframe\"\n        [src]=\"content\"\n    ></iframe>\n</section>\n", styles: [":host{display:block;inline-size:100%;block-size:100%;box-sizing:border-box;color:#fff;background:#333639;padding-block-start:env(safe-area-inset-top);padding-block-end:env(safe-area-inset-bottom)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}.t-header{display:flex;align-items:center;block-size:4rem;padding:0 1rem 0 1.5625rem;box-shadow:inset 0 -1px #535659}.t-title{margin:0;font:var(--tui-font-text-m);white-space:nowrap;text-overflow:ellipsis;padding-inline-end:.3125rem;overflow:hidden}.t-actions{display:flex;margin-inline-start:auto}.t-close{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-inline-start:.75rem;color:#fff;background:#ffffff52}.t-close:hover{background:#fff6}.t-content{block-size:calc(100% - 4rem);overflow:hidden}.t-iframe{inline-size:100%;block-size:100%}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64, 