import { Component, Input, ViewEncapsulation } from '@angular/core';
import { AxoUtils } from '../../../../axo-utils/axo-utils';
import { Signature } from '../../../../forms/page/widgets/signature';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/flex-layout/flex";
import * as i3 from "@angular/material/icon";
function SignatureWidgetViewComponent_ng_container_0_span_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 9);
    i0.ɵɵtext(3, ":");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.widget.prompt);
} }
function SignatureWidgetViewComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 2);
    i0.ɵɵelementStart(2, "div", 3);
    i0.ɵɵelementStart(3, "div", 4);
    i0.ɵɵelement(4, "mat-icon", 5);
    i0.ɵɵtemplate(5, SignatureWidgetViewComponent_ng_container_0_span_5_Template, 4, 1, "span", 6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "div", 7);
    i0.ɵɵelement(7, "img", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("ngIf", ctx_r0.section.showPrompt);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("src", ctx_r0.baseUrl + "/images/media/app_data/" + ctx_r0.widgetValue, i0.ɵɵsanitizeUrl);
} }
function SignatureWidgetViewComponent_ng_template_1_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 9);
    i0.ɵɵtext(3, ":");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r4.widget.prompt);
} }
function SignatureWidgetViewComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 10);
    i0.ɵɵelement(1, "mat-icon", 5);
    i0.ɵɵtemplate(2, SignatureWidgetViewComponent_ng_template_1_span_2_Template, 4, 1, "span", 6);
    i0.ɵɵelementStart(3, "span", 11);
    i0.ɵɵtext(4, "-");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r2.section.showPrompt);
} }
export class SignatureWidgetViewComponent {
    constructor() {
        this.widgetValue = null;
    }
    ngOnInit() {
        if (this.widget.value) {
            this.widgetValue = AxoUtils.removeSlashFromImageUrl(this.widget.value);
        }
    }
}
SignatureWidgetViewComponent.ɵfac = function SignatureWidgetViewComponent_Factory(t) { return new (t || SignatureWidgetViewComponent)(); };
SignatureWidgetViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SignatureWidgetViewComponent, selectors: [["lib-signature-widget-view"]], inputs: { widget: "widget", baseUrl: "baseUrl" }, decls: 3, vars: 2, consts: [[4, "ngIf", "ngIfElse"], ["isWidgetValueEmpty", ""], ["fxLayoutAlign", "end start", 1, "data-detail-info"], [1, "flex", "justify-between", "w-full", "gap-4"], [1, "flex", "gap-4"], ["svgIcon", "axo_signature", 1, "add-text"], [4, "ngIf"], [1, "capture-data-container", "text-center"], ["alt", "...", 1, "capture-image", "rounded", 3, "src"], [1, "colon"], [1, "data-detail-title", "m-0"], [1, "flex", "justify-start"]], template: function SignatureWidgetViewComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, SignatureWidgetViewComponent_ng_container_0_Template, 8, 2, "ng-container", 0);
        i0.ɵɵtemplate(1, SignatureWidgetViewComponent_ng_template_1_Template, 5, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
    } if (rf & 2) {
        const _r1 = i0.ɵɵreference(2);
        i0.ɵɵproperty("ngIf", ctx.widget.value)("ngIfElse", _r1);
    } }, directives: [i1.NgIf, i2.DefaultLayoutAlignDirective, i3.MatIcon], styles: ["lib-signature-widget-view .capture-data-container{max-width:10rem;width:10rem}lib-signature-widget-view .capture-image{display:block;height:auto;background:rgba(0,0,0,0);border:1px solid #8080807a}lib-signature-widget-view .image-overlay{display:flex;justify-content:center;align-items:center;position:absolute;column-gap:5px;top:18px;background:rgba(0,0,0,.5);transition:.5s ease;opacity:0;color:#fff;font-size:20px;height:8rem;width:8rem}lib-signature-widget-view .image-overlay a{border:1px solid #ffffff;border-radius:100%;width:28px;height:28px;line-height:28px}lib-signature-widget-view .image-overlay a mat-icon{color:#fff!important;height:12px;width:12px;min-width:12px;font-size:18px}lib-signature-widget-view .image-overlay:hover{opacity:1}\n"], encapsulation: 2 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SignatureWidgetViewComponent, [{
        type: Component,
        args: [{ selector: 'lib-signature-widget-view', encapsulation: ViewEncapsulation.None, template: "\n    <ng-container *ngIf=\"widget.value; else isWidgetValueEmpty\" >\n    <div class=\"data-detail-info\" fxLayoutAlign=\"end start\">\n      <div class=\"flex justify-between w-full gap-4\">\n        <div class=\"flex gap-4\">\n        <mat-icon class=\"add-text\" svgIcon=\"axo_signature\"></mat-icon> \n        <span *ngIf=\"section.showPrompt\">{{widget.prompt}}<span class=\"colon\">:</span></span>\n      </div>\n          <div class=\"capture-data-container text-center\" >\n            <img [src]=\"baseUrl + '/images/media/app_data/' +widgetValue\" class=\"capture-image rounded\" alt=\"...\" />\n          </div>\n      </div>\n  </div>\n\n</ng-container>\n            \n      \n<ng-template #isWidgetValueEmpty>\n  <div class=\"data-detail-title m-0\">\n      <mat-icon class=\"add-text\" svgIcon=\"axo_signature\"></mat-icon> \n      <span *ngIf=\"section.showPrompt\">{{widget.prompt}}<span class=\"colon\">:</span></span>\n      <span class=\"flex justify-start\">-</span>\n  </div>\n</ng-template>", styles: ["lib-signature-widget-view .capture-data-container{max-width:10rem;width:10rem}lib-signature-widget-view .capture-image{display:block;height:auto;background:rgba(0,0,0,0);border:1px solid #8080807a}lib-signature-widget-view .image-overlay{display:flex;justify-content:center;align-items:center;position:absolute;column-gap:5px;top:18px;background:rgba(0,0,0,.5);transition:.5s ease;opacity:0;color:#fff;font-size:20px;height:8rem;width:8rem}lib-signature-widget-view .image-overlay a{border:1px solid #ffffff;border-radius:100%;width:28px;height:28px;line-height:28px}lib-signature-widget-view .image-overlay a mat-icon{color:#fff!important;height:12px;width:12px;min-width:12px;font-size:18px}lib-signature-widget-view .image-overlay:hover{opacity:1}\n"] }]
    }], function () { return []; }, { widget: [{
            type: Input
        }], baseUrl: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 