import { Component, Injector } from '@angular/core';
import { Router } from '@angular/router';
import { ComponentContextService } from '../../../app-context/component-context.service';
import { ComponentBase } from '../../../classes/base/component-base';
import { AuthenService } from '../../../services/authen.service';
import { ModuleConfigService } from '../../../services/module-config.service';
import { UserService } from '../../../services/user.service';
export class AccessDeniedV1Component extends ComponentBase {
    constructor(injector, _moduleConfigService, _userService, _router, _authenService) {
        super(injector);
        this._moduleConfigService = _moduleConfigService;
        this._userService = _userService;
        this._router = _router;
        this._authenService = _authenService;
        this.defaultAvatar = '';
        this.currentDate = new Date();
        this.fileApi = '';
        this.daysInWeek = ['Chủ nhật', 'Thứ 2', 'Thứ 3', 'Thứ 4', 'Thứ 5', 'Thứ 6', 'Thứ 7'];
        this.environment = this._moduleConfigService.getConfig().environment;
        this.defaultAvatar = this.environment.appMetadata.main.defaultMaleAvatar;
        this.fileApi = `${this.environment.apiDomain.fileEndpoint}/${this.environment.apiVersion}/FileObject`;
        setInterval(() => {
            this.currentDate = new Date();
        }, 1000);
    }
    ngOnInit() {
        this.currentUser = this._userService.getCurrentUser();
    }
    logout() {
        if (!localStorage.getItem('currentUrl')) {
            localStorage.setItem('currentUrl', '/');
        }
        this._authenService.logout();
    }
    goToHome() {
        this._router.navigateByUrl('/');
    }
    getCurrentUserAvatar() {
        if (this.rootContext.data.currentUser && this.rootContext.data.currentUser.avatar) {
            return `${this.fileApi}/public/${this.rootContext.data.currentUser.avatar}/Download`;
        }
        else {
            return this.defaultAvatar;
        }
    }
    getNgayTrongTuan() {
        return this.daysInWeek[this.currentDate.getDay()];
    }
}
AccessDeniedV1Component.decorators = [
    { type: Component, args: [{
                selector: 'access-denied-v1',
                template: "<div class=\"modules\">\n    <div class=\"welcome-user\">\n        <div class=\"profile-image\">\n            <img src=\"/assets/layout/images/male.png\" alt=\"Avatar\" />\n        </div>\n\n        <div class=\"wrp-login\">\n            <h2>Xin ch\u00E0o!</h2>\n            <b>{{currentUser.fullName}}</b>\n            <div class=\"login\">\n                <a (click)=\"goToHome()\"><i class=\"far fa-folder-open\"></i>Trang ch\u1EE7</a>\n                <a style=\"background: #fabc01;\" (click)=\"logout()\"><i class=\"far fa-arrow-alt-circle-right\"></i>\u0110\u0103ng\n                    xu\u1EA5t</a>\n            </div>\n        </div>\n        <div class=\"clock-wrapper\">\n            <h1 class=\"clock\">\n                <!-- {{currentDate | date:'HH:mm:ss'}} -->\n            </h1>\n            <h4 class=\"data-time\">\n                <!-- {{getNgayTrongTuan()}}, ng\u00E0y {{currentDate | date:'dd/MM/yyyy'}} -->\n            </h4>\n        </div>\n    </div>\n\n    <div class=\"module-warning\">\n        <div class=\"img-title\">\n            <!-- <img src=\"/assets/images/logo.png\" alt=\"Tr\u01B0\u1EDDng \u0110\u1EA1i h\u1ECDc Giao th\u00F4ng v\u1EADn t\u1EA3i\"> -->\n            <div class=\"title\">\n                <h2>B\u1EA1n kh\u00F4ng c\u00F3 quy\u1EC1n truy c\u1EADp v\u00E0o trang n\u00E0y.</h2>\n                <h2>H\u00E3y li\u00EAn h\u1EC7 qu\u1EA3n tr\u1ECB h\u1EC7 th\u1ED1ng \u0111\u1EC3 \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3!</h2>\n            </div>\n        </div>\n    </div>\n</div>",
                providers: [ComponentContextService],
                styles: ["body{background-color:#fff}.modules{position:fixed;top:0;left:0;z-index:100;display:flex;justify-content:center;align-items:center;width:100vw;height:100vh;background-image:url(/assets/images/background-splash.png);background-repeat:no-repeat;background-position:50%;background-size:cover}.modules div>span{display:inline-block;min-width:100px;height:120px;width:120px;margin:10px;box-shadow:1px 2px 9px 1px #dadada;border-radius:5px;white-space:normal}.modules div>span>a{height:100%;position:relative;font-weight:700;cursor:pointer;border-radius:5px}.modules div>span>a,.modules div>span>a>span{width:100%;display:inline-block;color:#fff;text-decoration:unset;text-align:center}.modules div>span>a>span{position:absolute;bottom:10px;left:0}.modules div>span.implementing{background-color:#fff;box-shadow:none}.modules div>span>a>i{font-size:3.5em;position:absolute;top:20px;width:100%;left:0}::ng-deep .flexcolumn{max-width:calc(100vh - 20px)}.div1111-wrapper{overflow:auto;height:420px;margin:0 auto;max-width:700px}.div1111-wrapper .div1111{white-space:nowrap;width:100%;display:flex;flex-wrap:wrap}.div1111-wrapper .div1111 .bg-switcher{background:#fff;transition:.3s}.div1111-wrapper .div1111 .bg-switcher .app-switcher-item-icon{color:#52abff;transition:.3s}.div1111-wrapper .div1111 .bg-switcher span{color:#2f70ac;font-weight:500;text-shadow:none;transition:.3s}.div1111-wrapper .div1111 .bg-switcher:hover{background:#facb01;box-shadow:1px 2px 9px 1px rgba(39,23,86,.5215686274509804)}.div1111-wrapper .div1111 .bg-switcher:hover .app-switcher-item-icon,.div1111-wrapper .div1111 .bg-switcher:hover span{color:#2f70ac}.module-warning{text-align:center;color:#666;width:65%;align-self:stretch;background-color:rgba(249,244,244,.9215686274509803);display:flex;flex-direction:column;justify-content:center}.module-warning .title{padding:20px}.module-warning img{margin:150px auto}.module-warning h2{font-size:25px;color:#271756;margin-bottom:15px;margin-top:15px}.module-warning h1{color:#2f70ac;font-size:35px;margin-top:0;margin-bottom:0}.welcome-user{text-align:center;width:35%;align-self:stretch;background-color:rgba(47,112,172,.9215686274509803);display:flex;flex-direction:column}.welcome-user .wrp-login{margin:20px auto auto;color:#fff}.welcome-user .wrp-login h2{font-size:20px;margin-top:0;margin-bottom:5px;font-weight:500}.welcome-user .wrp-login b{font-size:25px;text-transform:uppercase;display:block}.welcome-user .wrp-login .login{display:grid;grid-template-columns:repeat(2,minmax(120px,1fr));grid-gap:10px;margin-top:30px}.welcome-user .wrp-login .login a{background:#fff;padding:6px;border-radius:5px;cursor:pointer;display:inline-block;color:#5d5d5d}.welcome-user .wrp-login .login a i{margin-right:10px}.welcome-user .profile-image{margin:auto auto 0}.welcome-user .profile-image img{border-radius:50%;height:200px;width:200px;-o-object-fit:contain;object-fit:contain;box-shadow:1px 1px 11px 6px #2a659b;background:#fff}.welcome-user .clock-wrapper{color:#fff;text-align:center;margin-top:auto;margin-bottom:auto}.welcome-user .clock-wrapper h4{font-size:18px;font-weight:500;margin-top:10px}.welcome-user .clock-wrapper h1{margin-bottom:0;font-size:40px}@media (max-width:1368px){.clock{margin:0 20px;font-size:1.5em}.data-time{margin:10px 0 20px;font-size:1em}}@media (max-width:768px){.modules{flex-direction:column}.welcome-user{width:100%;height:25%;flex-direction:row;align-items:center}.welcome-user .profile-image{margin-bottom:auto}.welcome-user .profile-image img{height:150px;width:150px}.welcome-user .wrp-login{margin-top:auto}.welcome-user .wrp-login .login{margin-top:20px}.welcome-user .clock-wrapper{display:none}.module-warning{width:100%;height:75%}.module-warning .img-title img{margin:50px auto}.module-warning .img-title .title{height:100%}}@media (max-width:640px){.welcome-user .wrp-login{width:50%;padding:0 20px 0 0;float:right}.welcome-user .wrp-login h2{margin-bottom:3px;font-size:14px}.welcome-user .wrp-login b{font-size:14px}.welcome-user .wrp-login .login{margin-top:10px;display:flex;flex-direction:column;padding:0 15px;text-align:left}.welcome-user .wrp-login .login a{font-size:14px}.welcome-user .profile-image{width:50%;float:left}.welcome-user .profile-image img{height:130px;width:130px;margin-left:35px;display:block}.welcome-user .clock-wrapper{clear:both;padding-top:10px;padding-right:0}.welcome-user .clock-wrapper h4{font-size:14px;margin-top:5px}.welcome-user .clock-wrapper h1{font-size:1.3em}.module-warning .img-title .title h1{font-size:16px}.module-warning .img-title .title h2{font-size:16px;margin-top:0}.module-warning .div1111-wrapper{max-width:360px;margin-top:0;height:360px}.module-warning .div1111-wrapper .div1111 .bg-switcher span{font-size:14px}.module-warning div>span{width:100px;height:100px}.module-warning div>span>a>i{font-size:2.5em;top:10px}}"]
            },] }
];
AccessDeniedV1Component.ctorParameters = () => [
    { type: Injector },
    { type: ModuleConfigService },
    { type: UserService },
    { type: Router },
    { type: AuthenService }
];
//# sourceMappingURL=data:application/json;base64, 