import { Component } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../../services/idle/idle.service";
import * as i2 from "../../services/login/login.service";
import * as i3 from "@angular/router";
import * as i4 from "@ionic/angular";
import * as i5 from "primeng/api";
import * as i6 from "primeng/dialog";
import * as i7 from "@ngx-translate/core";
function IdleDetectorComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h4", 9);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "Idle Session Warning!"));
} }
export class IdleDetectorComponent {
    constructor(is, ls, r) {
        this.is = is;
        this.ls = ls;
        this.r = r;
    }
    ngOnInit() {
        this.is.setupIdalTimeout();
        this.is.setupSessionTimeoutObserver();
    }
    logout() {
        this.ls.logout();
        this.r.navigateByUrl('login');
        this.is.reset();
    }
    static { this.ɵfac = function IdleDetectorComponent_Factory(t) { return new (t || IdleDetectorComponent)(i0.ɵɵdirectiveInject(i1.IdleService), i0.ɵɵdirectiveInject(i2.LoginService), i0.ɵɵdirectiveInject(i3.Router)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: IdleDetectorComponent, selectors: [["app-idle-detector"]], decls: 18, vars: 2, consts: [["modal", "true", "showHeader", "false", "closable", "false", "styleClass", "app-box", "appendTo", "body", "position", "top", 3, "visible"], ["pTemplate", "header"], [1, "ion-padding-top", "full-height"], [1, "ion-text-justify"], [1, "ion-text-center"], ["shape", "round", "type", "submit", "color", "success", 1, "ion-paddight-right", 3, "click"], ["slot", "start", "name", "log-in-outline"], ["shape", "round", "type", "reset", "color", "medium", 1, "ion-paddight-left", 3, "click"], ["slot", "start", "name", "log-out-outline"], [1, "heading", "ion-padding-left", 2, "padding-left", "18px"]], template: function IdleDetectorComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "p-dialog", 0);
            i0.ɵɵtemplate(1, IdleDetectorComponent_ng_template_1_Template, 3, 3, "ng-template", 1);
            i0.ɵɵelementStart(2, "div", 2)(3, "div", 3);
            i0.ɵɵtext(4, " No Recent Activity. ");
            i0.ɵɵelement(5, "br")(6, "br");
            i0.ɵɵtext(7);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(8, "p-footer")(9, "ion-row")(10, "ion-col", 4)(11, "ion-button", 5);
            i0.ɵɵlistener("click", function IdleDetectorComponent_Template_ion_button_click_11_listener() { return ctx.is.stay(); });
            i0.ɵɵelement(12, "ion-icon", 6);
            i0.ɵɵtext(13, " CONTINUE ");
            i0.ɵɵelementEnd();
            i0.ɵɵtext(14, " \u00A0 ");
            i0.ɵɵelementStart(15, "ion-button", 7);
            i0.ɵɵlistener("click", function IdleDetectorComponent_Template_ion_button_click_15_listener() { return ctx.logout(); });
            i0.ɵɵelement(16, "ion-icon", 8);
            i0.ɵɵtext(17, " Logout ");
            i0.ɵɵelementEnd()()()()();
        } if (rf & 2) {
            i0.ɵɵproperty("visible", ctx.is.showSessionTimeoutWarning.getValue());
            i0.ɵɵadvance(7);
            i0.ɵɵtextInterpolate1(" Select CONTINUE to remain active in the application or you will be logged out in ", ctx.is.counter.getValue(), " seconds. ");
        } }, dependencies: [i4.IonButton, i4.IonCol, i4.IonIcon, i4.IonRow, i5.Footer, i5.PrimeTemplate, i6.Dialog, i7.TranslatePipe], styles: [".heading[_ngcontent-%COMP%]{font-family:var(--app-font-light);color:var(--ion-color-medium-gray);font-size:23px}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IdleDetectorComponent, [{
        type: Component,
        args: [{ selector: 'app-idle-detector', template: "<p-dialog [visible]=\"is.showSessionTimeoutWarning.getValue()\" modal=\"true\"\r\n  showHeader=\"false\" closable=\"false\" styleClass=\"app-box\" appendTo=\"body\" position=\"top\">\r\n  \r\n  <ng-template pTemplate=\"header\">\r\n    <h4 class=\"heading ion-padding-left\" style=\"padding-left: 18px;\">{{'Idle Session Warning!' | translate}}</h4>\r\n  </ng-template>\r\n  \r\n  <div class=\"ion-padding-top full-height\">\r\n    <div class=\"ion-text-justify\">\r\n      No Recent Activity.\r\n      <br /> <br />\r\n      Select CONTINUE to remain active in the application or you will be logged out in {{is.counter.getValue()}} seconds.\r\n    </div>\r\n  </div>\r\n  <p-footer>\r\n    <ion-row>\r\n      <ion-col class=\"ion-text-center\">\r\n        <ion-button shape=\"round\" type=\"submit\" (click)=\"is.stay()\" color=\"success\" class=\"ion-paddight-right\">\r\n          <ion-icon slot=\"start\" name=\"log-in-outline\"></ion-icon>\r\n          CONTINUE\r\n        </ion-button>\r\n        &nbsp;\r\n        <ion-button shape=\"round\" type=\"reset\" (click)=\"logout()\" color=\"medium\"\r\n          class=\"ion-paddight-left\">\r\n          <ion-icon slot=\"start\" name=\"log-out-outline\"></ion-icon>\r\n          Logout\r\n        </ion-button>\r\n      </ion-col>\r\n    </ion-row>\r\n  </p-footer>\r\n</p-dialog>", styles: [".heading{font-family:var(--app-font-light);color:var(--ion-color-medium-gray);font-size:23px}\n"] }]
    }], () => [{ type: i1.IdleService }, { type: i2.LoginService }, { type: i3.Router }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(IdleDetectorComponent, { className: "IdleDetectorComponent", filePath: "lib\\components\\idle-detector\\idle-detector.component.ts", lineNumber: 11 }); })();
//# sourceMappingURL=data:application/json;base64, 