import { Component, ViewChild, Input } from '@angular/core';
import { ClaimAppEmpRequestModel } from '../../models/questionnaire/ClaimAppEmpRequestModel';
import { ClaimAppEmpResponseModel } from '../../models/questionnaire/ClaimAppEmpResponseModel';
import { BasePage } from '../../pages/BasePage';
import { FbConstants } from '../questionnaire/FbConstants';
import * as i0 from "@angular/core";
import * as i1 from "../../services/logger/logger.service";
import * as i2 from "../../services/questionnaire/validation.service";
import * as i3 from "../../services/login/login.service";
import * as i4 from "@angular/router";
import * as i5 from "@ionic/storage-angular";
import * as i6 from "@ionic/angular";
import * as i7 from "@angular/common";
import * as i8 from "primeng/api";
import * as i9 from "primeng/divider";
import * as i10 from "primeng/overlaypanel";
import * as i11 from "@fortawesome/angular-fontawesome";
const _c0 = ["op1"];
const _c1 = () => ["far", "sack-dollar"];
function MoneyExpectComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 2)(1, "div", 3)(2, "div", 4)(3, "ion-row")(4, "ion-col", 5);
    i0.ɵɵelement(5, "fa-icon", 6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "ion-col", 7)(7, "h2", 8);
    i0.ɵɵtext(8, "Maximum payments you can expect");
    i0.ɵɵelementEnd()()()()();
    i0.ɵɵelement(9, "p-divider");
    i0.ɵɵelementStart(10, "div", 3)(11, "div", 9);
    i0.ɵɵtext(12, " Maximum payment per week ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(13, "div", 10);
    i0.ɵɵtext(14);
    i0.ɵɵpipe(15, "currency");
    i0.ɵɵelementEnd()();
    i0.ɵɵelement(16, "br");
    i0.ɵɵelementStart(17, "div", 3)(18, "div", 9);
    i0.ɵɵtext(19);
    i0.ɵɵpipe(20, "date");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(21, "div", 10);
    i0.ɵɵtext(22);
    i0.ɵɵpipe(23, "currency");
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("icon", i0.ɵɵpureFunction0(13, _c1));
    i0.ɵɵadvance(9);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(15, 4, ctx_r2.moneyResponse.wba, "USD"), " ");
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate1(" Maximum Total thru ", i0.ɵɵpipeBind2(20, 7, ctx_r2.moneyResponse.byeDate, "fullDate"), " ");
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(23, 10, ctx_r2.moneyResponse.mba, "USD"), " ");
} }
function MoneyExpectComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div");
    i0.ɵɵtemplate(1, MoneyExpectComponent_div_0_div_1_Template, 24, 14, "div", 1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r0.moneyResponse.hideMonetaryEstimation);
} }
function MoneyExpectComponent_div_1_div_1_ng_template_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "div", 21);
    i0.ɵɵprojection(1);
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("innerHTML", ctx_r5.wbaText.wbaHelperText, i0.ɵɵsanitizeHtml);
} }
const _c2 = (a0, a1) => ({ "card-position-csr": a0, "card-position": a1 });
const _c3 = () => ({ "width": "510px" });
function MoneyExpectComponent_div_1_div_1_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 12)(1, "div", 3)(2, "div", 4)(3, "ion-row")(4, "ion-col", 5);
    i0.ɵɵelement(5, "fa-icon", 6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "ion-col", 13)(7, "h2", 8);
    i0.ɵɵtext(8, "Estimated payments");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(9, "ion-col", 5)(10, "p-overlayPanel", 14, 15);
    i0.ɵɵtemplate(12, MoneyExpectComponent_div_1_div_1_ng_template_12_Template, 2, 1, "ng-template", 16);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(13, "ion-button", 17);
    i0.ɵɵlistener("click", function MoneyExpectComponent_div_1_div_1_Template_ion_button_click_13_listener($event) { i0.ɵɵrestoreView(_r7); const _r4 = i0.ɵɵreference(11); return i0.ɵɵresetView(_r4.toggle($event)); });
    i0.ɵɵelement(14, "ion-icon", 18);
    i0.ɵɵelementEnd()()()()();
    i0.ɵɵelement(15, "p-divider");
    i0.ɵɵelementStart(16, "div", 3)(17, "div", 19);
    i0.ɵɵtext(18, " Maximum weekly amount ");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(19, "div", 20);
    i0.ɵɵtext(20);
    i0.ɵɵpipe(21, "currency");
    i0.ɵɵelementEnd()();
    i0.ɵɵelement(22, "br");
    i0.ɵɵelementStart(23, "div", 3)(24, "div", 19);
    i0.ɵɵtext(25);
    i0.ɵɵpipe(26, "date");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(27, "div", 20);
    i0.ɵɵtext(28);
    i0.ɵɵpipe(29, "currency");
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(17, _c2, ctx_r3.isCsr, !ctx_r3.isCsr));
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("icon", i0.ɵɵpureFunction0(20, _c1));
    i0.ɵɵadvance(5);
    i0.ɵɵstyleMap(i0.ɵɵpureFunction0(21, _c3));
    i0.ɵɵproperty("appendTo", "body");
    i0.ɵɵadvance(10);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(21, 8, ctx_r3.moneyResponse.wba, "USD"), " ");
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate1(" Maximum amount thru ", i0.ɵɵpipeBind2(26, 11, ctx_r3.moneyResponse.byeDate, "M/d/yyyy"), " ");
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(29, 14, ctx_r3.moneyResponse.mba, "USD"), " ");
} }
function MoneyExpectComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div");
    i0.ɵɵtemplate(1, MoneyExpectComponent_div_1_div_1_Template, 30, 22, "div", 11);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r1.moneyResponse.hideMonetaryEstimation);
} }
const _c4 = ["*"];
export class MoneyExpectComponent extends BasePage {
    constructor(logger, validationService, ls, activatedRoute, storage) {
        super();
        this.logger = logger;
        this.validationService = validationService;
        this.ls = ls;
        this.activatedRoute = activatedRoute;
        this.storage = storage;
        this.isCsr = false;
        this.uuid = null;
        this.moneyResponse = new ClaimAppEmpResponseModel();
    }
    async getIdentifier() {
        let uuid;
        let data = this.activatedRoute.snapshot.queryParamMap.get('identifier');
        this.logger.debug("data for identifier is : ", data);
        if (data) {
            uuid = data;
        }
        else {
            uuid = await this.storage.get(FbConstants.uuid);
        }
        return uuid;
    }
    async ngOnInit() {
        this.isCsr = this.ls.isCsr();
        if (this.isMS()) {
            const obj = JSON.parse(this.componentData);
            this.wbaText = obj;
        }
        this.uuid = await this.getIdentifier();
        let model = new ClaimAppEmpRequestModel();
        model.uuid = this.uuid;
        let url = "";
        if (this.ls.isClaimant() === true) {
            url = "/claims-service/claim/claimant/app/estimate";
        }
        else {
            url = "/claims-service/claim/app/estimate";
        }
        this.validationService.post(url, model).subscribe(res => {
            this.logger.debug('response for estimation = ', res);
            this.moneyResponse = res;
        }, err => {
            //do not do anything
        });
    }
    static { this.ɵfac = function MoneyExpectComponent_Factory(t) { return new (t || MoneyExpectComponent)(i0.ɵɵdirectiveInject(i1.LoggerService), i0.ɵɵdirectiveInject(i2.ValidationService), i0.ɵɵdirectiveInject(i3.LoginService), i0.ɵɵdirectiveInject(i4.ActivatedRoute), i0.ɵɵdirectiveInject(i5.Storage)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MoneyExpectComponent, selectors: [["money-expect"]], viewQuery: function MoneyExpectComponent_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(_c0, 5);
        } if (rf & 2) {
            let _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.op1 = _t.first);
        } }, inputs: { componentData: "componentData" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c4, decls: 2, vars: 2, consts: [[4, "ngIf"], ["class", "card-position", 4, "ngIf"], [1, "card-position"], [1, "grid", "p-nogutter"], [1, "col-12", "ion-text-left"], ["size", "1"], [1, "header-icon", 3, "icon"], ["size", "11", 1, "ion-text-right"], [1, "heading"], [1, "col-8", "money-text"], [1, "col-4", "money", 2, "text-align", "right"], [3, "ngClass", 4, "ngIf"], [3, "ngClass"], ["size", "10"], [3, "appendTo"], ["op1", ""], ["pTemplate", ""], ["fill", "outline", "size", "small", "shape", "round", "aria-label", "info button", 1, "small-button", 3, "click"], ["slot", "icon-only", "name", "information-outline", "aria-hidden", "true", 1, "button-icon"], [1, "col-7", "money-text"], [1, "col-5", "money", 2, "text-align", "right"], [1, "overlay-desc", 3, "innerHTML"]], template: function MoneyExpectComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵtemplate(0, MoneyExpectComponent_div_0_Template, 2, 1, "div", 0)(1, MoneyExpectComponent_div_1_Template, 2, 1, "div", 0);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", !ctx.isMS());
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.isMS());
        } }, dependencies: [i6.IonButton, i6.IonCol, i6.IonIcon, i6.IonRow, i7.NgClass, i7.NgIf, i8.PrimeTemplate, i9.Divider, i10.OverlayPanel, i11.FaIconComponent, i7.CurrencyPipe, i7.DatePipe], styles: [".money[_ngcontent-%COMP%]{text-align:right;color:var(--ion-color-medium-gray);opacity:1;font:normal normal 300 26px/36px var(--app-font-regular);letter-spacing:0px}.heading[_ngcontent-%COMP%]{font-size:24px;font-family:var(--app-font-light)}.header-icon[_ngcontent-%COMP%]{color:var(--ion-color-green);font-size:26px}.money-text[_ngcontent-%COMP%]{font-size:18px;text-align:left;color:var(--ion-color-medium-gray);font-family:var(--app-font-light)}.card-position[_ngcontent-%COMP%]{position:absolute}.card-position-csr[_ngcontent-%COMP%]{position:absolute;transform:translate(80%)}@media (max-width: 768px){.card-position[_ngcontent-%COMP%]{position:inherit}}.no-margin[_ngcontent-%COMP%]{margin:0}.p-button.p-button-icon-only[_ngcontent-%COMP%]{background-color:transparent!important}.p-button.p-button-icon-only.p-button-rounded[_ngcontent-%COMP%]{border-radius:50%;height:-moz-fit-content!important;height:fit-content!important}.small-button[_ngcontent-%COMP%]{--padding-start: 0px;--padding-end: 0px;--background: white;--border: none !important;margin-top:1px;--color: var(--ion-color-primary);--border-color: var(--ion-color-primary);--border-width: 2px }ion-button.small-button[_ngcontent-%COMP%]::part(native){padding:3px}.button-icon[_ngcontent-%COMP%]{font-size:18px;color:var(--ion-color-primary)}@media (max-width: 360px){.overlay-desc[_ngcontent-%COMP%]{width:335px!important;padding:24px 24px 12px;max-height:25vh;overflow-y:auto}}@media (min-width: 365px) and (max-width: 400px){.overlay-desc[_ngcontent-%COMP%]{width:355px!important;padding:24px 24px 12px;max-height:25vh;overflow-y:auto}}@media (min-width: 405px) and (max-width: 800px){.overlay-desc[_ngcontent-%COMP%]{width:390px!important;padding:24px 24px 12px;max-height:25vh;overflow-y:auto}}@media (min-width: 344px) and (max-width: 540px){.card-position-csr[_ngcontent-%COMP%]{position:relative;transform:translate(0)!important}}@media (min-width: 768px) and (max-width: 1280px){.card-position-csr[_ngcontent-%COMP%]{position:absolute;transform:translate(30%)}}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MoneyExpectComponent, [{
        type: Component,
        args: [{ selector: 'money-expect', template: "<div *ngIf=\"!isMS()\">\r\n  <div class=\"card-position\" *ngIf=\"!moneyResponse.hideMonetaryEstimation\">\r\n    <div class=\"grid p-nogutter \">\r\n      <div class=\"col-12 ion-text-left\">\r\n        <ion-row>\r\n          <ion-col size=\"1\">\r\n            <fa-icon [icon]=\"['far', 'sack-dollar']\" class=\"header-icon\"></fa-icon>\r\n          </ion-col>\r\n          <ion-col size=\"11\" class=\"ion-text-right\">\r\n            <h2 class=\"heading\">Maximum payments you can expect</h2>\r\n          </ion-col>\r\n        </ion-row>\r\n      </div>\r\n    </div>\r\n  \r\n    <p-divider></p-divider>\r\n  \r\n    <div class=\"grid p-nogutter\">\r\n      <div class=\"col-8 money-text\" >\r\n        Maximum payment per week\r\n      </div>\r\n      <div class=\"col-4 money\" style=\"text-align: right;\">\r\n        {{moneyResponse.wba | currency:'USD'}}\r\n      </div>\r\n    </div>\r\n  <br>\r\n    <div class=\"grid p-nogutter\">\r\n      <div class=\"col-8 money-text\">\r\n        Maximum Total thru {{moneyResponse.byeDate | date:'fullDate'}}\r\n      </div>\r\n      <div class=\"col-4 money\" style=\"text-align: right;\">\r\n        {{moneyResponse.mba | currency:'USD'}}\r\n      </div>\r\n    </div>\r\n  </div>\r\n</div>\r\n\r\n<div *ngIf=\"isMS()\">\r\n<div [ngClass]=\"{ 'card-position-csr': isCsr, 'card-position': !isCsr}\" *ngIf=\"!moneyResponse.hideMonetaryEstimation\">\r\n  <div class=\"grid p-nogutter \">\r\n    <div class=\"col-12 ion-text-left\">\r\n      <ion-row>\r\n        <ion-col size=\"1\">\r\n          <fa-icon [icon]=\"['far', 'sack-dollar']\" class=\"header-icon\"></fa-icon>\r\n        </ion-col>\r\n        <ion-col size=\"10\" >\r\n          <h2 class=\"heading\">Estimated payments</h2>\r\n        </ion-col>\r\n        <ion-col size=\"1\">\r\n          <p-overlayPanel #op1 [appendTo]=\"'body'\" [style]=\"{'width': '510px'}\">\r\n            <ng-template pTemplate>\r\n              <div [innerHTML]=\"wbaText.wbaHelperText\" class=\"overlay-desc\"></div>\r\n              <ng-content></ng-content>\r\n            </ng-template>\r\n          </p-overlayPanel>\r\n          <ion-button fill=\"outline\" size=\"small\" shape=\"round\" class=\"small-button\" aria-label=\"info button\" (click)=\"op1.toggle($event)\">\r\n            <ion-icon slot=\"icon-only\" name=\"information-outline\" class=\"button-icon\" aria-hidden=\"true\"></ion-icon>\r\n          </ion-button>\r\n        </ion-col>\r\n      </ion-row>\r\n    </div>\r\n  </div>\r\n\r\n  <p-divider></p-divider>\r\n\r\n  <div class=\"grid p-nogutter\">\r\n    <div class=\"col-7 money-text\" >\r\n      Maximum weekly amount\r\n    </div>\r\n    <div class=\"col-5 money\" style=\"text-align: right;\">\r\n      {{moneyResponse.wba | currency:'USD'}}\r\n    </div>\r\n  </div>\r\n<br>\r\n  <div class=\"grid p-nogutter\">\r\n    <div class=\"col-7 money-text\">\r\n      Maximum amount thru {{moneyResponse.byeDate | date:'M/d/yyyy'}}\r\n    </div>\r\n    <div class=\"col-5 money\" style=\"text-align: right;\">\r\n      {{moneyResponse.mba | currency:'USD'}}\r\n    </div>\r\n  </div>\r\n</div>\r\n</div>\r\n\r\n\r\n  \r\n", styles: [".money{text-align:right;color:var(--ion-color-medium-gray);opacity:1;font:normal normal 300 26px/36px var(--app-font-regular);letter-spacing:0px}.heading{font-size:24px;font-family:var(--app-font-light)}.header-icon{color:var(--ion-color-green);font-size:26px}.money-text{font-size:18px;text-align:left;color:var(--ion-color-medium-gray);font-family:var(--app-font-light)}.card-position{position:absolute}.card-position-csr{position:absolute;transform:translate(80%)}@media (max-width: 768px){.card-position{position:inherit}}.no-margin{margin:0}.p-button.p-button-icon-only{background-color:transparent!important}.p-button.p-button-icon-only.p-button-rounded{border-radius:50%;height:-moz-fit-content!important;height:fit-content!important}.small-button{--padding-start: 0px;--padding-end: 0px;--background: white;--border: none !important;margin-top:1px;--color: var(--ion-color-primary);--border-color: var(--ion-color-primary);--border-width: 2px }ion-button.small-button::part(native){padding:3px}.button-icon{font-size:18px;color:var(--ion-color-primary)}@media (max-width: 360px){.overlay-desc{width:335px!important;padding:24px 24px 12px;max-height:25vh;overflow-y:auto}}@media (min-width: 365px) and (max-width: 400px){.overlay-desc{width:355px!important;padding:24px 24px 12px;max-height:25vh;overflow-y:auto}}@media (min-width: 405px) and (max-width: 800px){.overlay-desc{width:390px!important;padding:24px 24px 12px;max-height:25vh;overflow-y:auto}}@media (min-width: 344px) and (max-width: 540px){.card-position-csr{position:relative;transform:translate(0)!important}}@media (min-width: 768px) and (max-width: 1280px){.card-position-csr{position:absolute;transform:translate(30%)}}\n"] }]
    }], () => [{ type: i1.LoggerService }, { type: i2.ValidationService }, { type: i3.LoginService }, { type: i4.ActivatedRoute }, { type: i5.Storage }], { op1: [{
            type: ViewChild,
            args: ['op1', { static: false }]
        }], componentData: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MoneyExpectComponent, { className: "MoneyExpectComponent", filePath: "lib\\components\\money-expect\\money-expect.component.ts", lineNumber: 21 }); })();
//# sourceMappingURL=data:application/json;base64, 