/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@next-level-integration/common@0.0.0-NG12hybrid-keycloak20-RC16/bundles/next-level-integration-common.umd.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/common/http"),require("@angular/core"),require("@angular/forms"),require("@angular/router"),require("@next-level-integration/menu"),require("@ngx-translate/core"),require("angular-auth-oidc-client"),require("ngx-webstorage"),require("rxjs/operators"),require("rxjs"),require("@auth0/angular-jwt"),require("@angular/material/icon"),require("@angular/platform-browser"),require("@angular/material/button"),require("@angular/material/input"),require("@angular/material/select"),require("@angular/material/progress-bar"),require("@angular/material/toolbar")):"function"==typeof define&&define.amd?define("@next-level-integration/common",["exports","@angular/common","@angular/common/http","@angular/core","@angular/forms","@angular/router","@next-level-integration/menu","@ngx-translate/core","angular-auth-oidc-client","ngx-webstorage","rxjs/operators","rxjs","@auth0/angular-jwt","@angular/material/icon","@angular/platform-browser","@angular/material/button","@angular/material/input","@angular/material/select","@angular/material/progress-bar","@angular/material/toolbar"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["next-level-integration"]=t["next-level-integration"]||{},t["next-level-integration"].common={}),t.ng.common,t.ng.common.http,t.ng.core,t.ng.forms,t.ng.router,t.menu,t.core,t.i2,t.ngxWebstorage,t.rxjs.operators,t.rxjs,t.angularJwt,t.ng.material.icon,t.ng.platformBrowser,t.ng.material.button,t.ng.material.input,t.ng.material.select,t.ng.material.progressBar,t.ng.material.toolbar)}(this,(function(t,e,n,r,i,o,a,s,c,l,u,p,h,g,m,d,f,v,y,b){"use strict";function S(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var k=S(n),_=S(r),C=S(o),w=S(c),I=function(t,e){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},I(t,e)};function E(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function T(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function x(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function N(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;var O=function(t){this.name=t},A=new r.InjectionToken("GLOBAL_CONFIG"),M=function(){function t(t,e){this.http=t,this.basePath="",this.keycloakserviceUrl="frontend/keycloak",e&&e.basePath&&(this.basePath=e.basePath),e&&e.keycloakSettings&&(this.keycloakSetting=e.keycloakSettings)}return t.prototype.getKeycloakSetting=function(){return this.keycloakSetting},t.prototype.loadKeycloakSetting=function(){if(this.keycloakSetting)return p.of(this.keycloakSetting);var t={headers:new n.HttpHeaders};return t.headers=t.headers.set("Content-Type","application/json;charset=UTF-8"),t.headers=t.headers.set("Accept","application/json;charset=UTF-8"),this.http.get(""+this.basePath+this.keycloakserviceUrl,t)},t.prototype.load=function(){var t=this;return this.loadKeycloakSetting().pipe(u.tap((function(e){t.keycloakSetting=e})),u.map((function(){return p.of(!0)})))},t}();M.ɵprov=_.ɵɵdefineInjectable({factory:function(){return new M(_.ɵɵinject(k.HttpClient),_.ɵɵinject(A,8))},token:M,providedIn:"root"}),M.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],M.ctorParameters=function(){return[{type:n.HttpClient},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[A]}]}]};var j=function(){};j.KEY_CLIENT_NAME="client_name",j.KEY_USER_NAME="username",j.KEY_SO_PAGE_INDEX="scenario_overview_page_index",j.KEY_SO_PAGE_SIZE="scenario_overview_page_size",j.KEY_SO_SORT_KEY="scenario_overview_sort_key",j.KEY_SO_SORT_ORDER="scenario_overview_sort_order",j.KEY_SO_SEARCH_TERM="scenario_overview_search_term",j.KEY_SCENARIO_NAME="scenario_name",j.KEY_SELECTED_DATE="date",j.KEY_SELECTED_LINK_TYPE="selected_link_type",j.KEY_CURRENT_SCENARIO_ID="current_scenario_id",j.KEY_CURRENT_EQUIPMENT_ID="current_equipment_id",j.KEY_METERING_LOCATION="current_metering_location",j.KEY_CURRENT_CLIENT_ID="current_client_id",j.KEY_CLIENT_COUNT="client_count",j.KEY_CURRENT_CLIENT_NAME="current_client_name",j.KEY_CURRENT_USER_NAME="current_user_name",j.KEY_SELECTED_STOCK_NAME="selected_stock_name",j.KEY_STOCK_LIST_SEARCH_NAME="stock_list_search_name",j.KEY_STOCK_LIST_SEARCH_STOCK_TYPE="stock_list_search_stock_type",j.KEY_STOCK_LIST_SEARCH_ADDRESS="stock_list_search_address",j.KEY_TOKEN="id_token";var L=function(){function t(t,e,n,r,i,o){this.http=t,this.oidcSecurityService=e,this.tokenHelperService=n,this.router=r,this.keycloakService=i,this.basePath="",this.redirectUrlOverride="",this.isLoggedIn$=new p.BehaviorSubject(!1),this.isAuthModuleSetup$=new p.BehaviorSubject(!1),this.jwtHelper=new h.JwtHelperService,o&&(this.basePath=o.basePath||this.basePath,this.redirectUrlOverride=o.redirectUrlOverride||this.redirectUrlOverride),this.keycloakSetting=i.getKeycloakSetting(),this.init()}return t.prototype.init=function(){return E(this,void 0,void 0,(function(){return T(this,(function(t){switch(t.label){case 0:return this.keycloakSetting&&this.keycloakSetting.enabled?(this.configureOAuth(),[3,3]):[3,1];case 1:return[4,this.isLoggedIn().toPromise()];case 2:t.sent()||this.router.navigate(["loginpage"]),t.label=3;case 3:return[2]}}))}))},t.prototype.configureOAuth=function(){var t=this;this.authCodeFlowConfig={stsServer:this.keycloakSetting.authServerUrl,client_id:this.keycloakSetting.resource,response_type:"code",redirect_url:(this.redirectUrlOverride||window.location.origin)+"/#/clients",post_logout_redirect_uri:(this.redirectUrlOverride||window.location.origin)+"/#/clients",scope:"openid roles profile email",silent_renew:!0,use_refresh_token:!0,ignore_nonce_after_refresh:!0,renewTimeBeforeTokenExpiresInSeconds:40,silent_renew_offset_in_seconds:0,log_console_debug_active:!1,isauthorizedrace_timeout_in_seconds:3},this.wellKnownEndpoints={issuer:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm,jwks_uri:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm+"/protocol/openid-connect/certs",authorization_endpoint:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm+"/protocol/openid-connect/auth",token_endpoint:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm+"/protocol/openid-connect/token",userinfo_endpoint:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm+"/protocol/openid-connect/userinfo",end_session_endpoint:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm+"/protocol/openid-connect/logout",check_session_iframe:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm+"/protocol/openid-connect/login-status-iframe.html",revocation_endpoint:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm+"/protocol/openid-connect/revoke",introspection_endpoint:this.authCodeFlowConfig.stsServer+"/realms/"+this.keycloakSetting.realm+"/protocol/openid-connect/token/introspect"},this.oidcSecurityService.setupModule(this.authCodeFlowConfig,this.wellKnownEndpoints),this.oidcSecurityService.getIsAuthorized().pipe(u.take(1)).subscribe((function(e){t.isLoggedIn$.next(e),e||t.oidcSecurityService.authorize()})),this.oidcSecurityService.moduleSetup?(this.isAuthModuleSetup$.next(!0),this.doCallbackLogicIfRequired()):this.oidcSecurityService.onModuleSetup.subscribe((function(){t.doCallbackLogicIfRequired(),t.isAuthModuleSetup$.next(!0)}))},t.prototype.doCallbackLogicIfRequired=function(){this.oidcSecurityService.authorizedCallbackWithCode(window.location.toString())},t.prototype.getClients=function(){var t=this.oidcSecurityService.getToken(),e=this.tokenHelperService.getPayloadFromToken(t,!1).CLIENTS;return p.of(e?e.split(","):[])},t.prototype.getAccessToken=function(){return this.keycloakSetting&&this.keycloakSetting.enabled?this.oidcSecurityService.getToken():localStorage.getItem(j.KEY_TOKEN)},t.prototype.logout=function(){if(this.keycloakSetting&&this.keycloakSetting.enabled){var t=this.oidcSecurityService.getIdToken();if(!(t&&"null"!==String(t)?t:void 0))throw new Error("No id_token found");var e=this.wellKnownEndpoints.end_session_endpoint+"?id_token_hint="+this.oidcSecurityService.getIdToken()+"&post_logout_redirect_uri="+this.authCodeFlowConfig.post_logout_redirect_uri;this.oidcSecurityService.logoff((function(){window.location.href=e}))}else this.logoutWithoutKeycloak()},t.prototype.isLoggedIn=function(){return this.keycloakSetting&&this.keycloakSetting.enabled?this.isLoggedIn$:this.isLoggedInWithoutKeycloak()},t.prototype.isAuthModuleSetup=function(){return this.keycloakSetting&&this.keycloakSetting.enabled?this.isAuthModuleSetup$:p.of(!0)},t.prototype.isKeycloakEnabled=function(){return this.keycloakSetting&&this.keycloakSetting.enabled},t.prototype.isLoggedInWithoutKeycloak=function(){var t=localStorage.getItem(j.KEY_TOKEN),e=null!=t&&!this.jwtHelper.isTokenExpired(t);return!1===e&&localStorage.removeItem(j.KEY_TOKEN),p.of(e)},t.prototype.logoutWithoutKeycloak=function(){localStorage.clear(),this.router.navigate(["loginpage"])},t.prototype.getCurrentUserName=function(){return this.keycloakSetting&&this.keycloakSetting.enabled?this.oidcSecurityService.getUserData().pipe(u.map((function(t){return t.preferred_username}))):p.of(localStorage.getItem(j.KEY_CURRENT_USER_NAME))},t.prototype.login=function(t,e){return this.http.post(this.basePath+"api/authentication",{username:t,password:e}).pipe(u.map((function(n){var r=n&&n.token;if(r){localStorage.setItem("currentUser",JSON.stringify({username:t,token:r})),localStorage.setItem(j.KEY_TOKEN,r),localStorage.setItem(j.KEY_CURRENT_USER_NAME,t);var i=btoa(t+":"+e);return localStorage.setItem("currentUser",JSON.stringify({username:t,token:r})),localStorage.setItem("userPass",i),!0}return!1})),u.catchError(this.handleError))},t.prototype.handleError=function(t){var e;if(t instanceof n.HttpErrorResponse)if(t.error){var r=t.error.errorCode+" "+t.error.errorMessage;e=t.status+" - "+(t.statusText||"")+" "+r}else e=401==t.status||403==t.status?"Benutzername oder Passwort ist falsch":500==t.status?"Interner Serverfehler":t.statusText;else e=t.message?t.message:t.toString();return p.throwError(e)},t}();L.ɵprov=_.ɵɵdefineInjectable({factory:function(){return new L(_.ɵɵinject(k.HttpClient),_.ɵɵinject(w.OidcSecurityService),_.ɵɵinject(w.TokenHelperService),_.ɵɵinject(C.Router),_.ɵɵinject(M),_.ɵɵinject(A,8))},token:L,providedIn:"root"}),L.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],L.ctorParameters=function(){return[{type:n.HttpClient},{type:c.OidcSecurityService},{type:c.TokenHelperService},{type:o.Router},{type:M},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[A]}]}]};var P=function(){function t(t,e,n){this.httpClient=t,this.authenticationService=e,this.basePath="",this.clientsUrl="api/clients",n&&n.basePath&&(this.basePath=n.basePath)}return t.prototype.getClients=function(){return this.getClientNames().pipe(u.map((function(t){return t})))},t.prototype.getClientsKeycloak=function(){return this.authenticationService.getClients()},t.prototype.getClientNames=function(){return this.httpClient.get(""+this.basePath+this.clientsUrl).pipe(u.map(this.extractData),u.catchError(this.handleError))},t.prototype.extractData=function(t){return t||{}},t.prototype.handleError=function(t){var e;return e=t.error instanceof Error?"An error occurred: "+t.error.message:"Backend returned code "+t.status+", body was: "+t.error,console.error(e),p.throwError(e)},t.prototype.logout=function(){this.authenticationService.logout(),this.removeClientName(),this.removeClientCount()},t.prototype.resetClient=function(t,e){this.setClientName(t.name+""),this.setClientCount(e)},t.prototype.getClientName=function(){return localStorage.getItem("current_client_name")},t.prototype.setClientName=function(t){localStorage.setItem("current_client_name",t)},t.prototype.removeClientName=function(){localStorage.removeItem("current_client_name")},t.prototype.getClientCount=function(){return+localStorage.getItem("client_count")},t.prototype.setClientCount=function(t){localStorage.setItem("client_count",""+t)},t.prototype.removeClientCount=function(){localStorage.removeItem("client_count")},t.prototype.isLoggedIn=function(){return this.authenticationService.isLoggedIn()},t}();P.decorators=[{type:r.Injectable}],P.ctorParameters=function(){return[{type:n.HttpClient},{type:L},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[A]}]}]};var R=function(){};R.ɵprov=_.ɵɵdefineInjectable({factory:function(){return new R},token:R,providedIn:"root"}),R.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}];var K=function(t){return String(t).replace(/[^a-zA-Z0-9]+/g,"").toLowerCase()},B=function(){function t(t,e,n,r,o){this.clientService=t,this.router=e,this.fb=n,this.authenticationService=r,this.moduleConfigurator=o,this.loading=!0,this.toId=K,this.clientForm=n.group({client:["",i.Validators.required]})}return Object.defineProperty(t.prototype,"authenticated",{get:function(){return this.clientService.isLoggedIn()},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.keycloakEnabled=this.authenticationService&&this.authenticationService.keycloakSetting&&this.authenticationService.keycloakSetting.enabled,this.client=new O(""),this.isEmpty=!0,this.authenticated.subscribe((function(e){e?t.postLoginHandler():t.keycloakEnabled||t.router.navigate(["/loginpage"])}))},t.prototype.postLoginHandler=function(){var t,e;(null===(e=null===(t=this.moduleConfigurator)||void 0===t?void 0:t.options)||void 0===e?void 0:e.skipClientSelection)?this.router.navigate(["/loggedIn"]):this.loadClients()},t.prototype.loadClients=function(){var t=this;this.authenticationService.getCurrentUserName().subscribe((function(e){t.username=e})),(this.keycloakEnabled?this.clientService.getClientsKeycloak():this.clientService.getClients()).pipe(u.map((function(t){return t.sort((function(t,e){return t.toString().toLowerCase().localeCompare(e.toString().toLowerCase())})).map((function(t){return{label:t.toString(),value:t.toString()}}))}))).subscribe((function(e){t.clients=e,t.loading=!1}))},t.prototype.gotoNextPage=function(){this.client=new O(this.clientForm.value.client),this.clientService.resetClient(this.client,1),this.router.navigate(["/loggedIn"])},t.prototype.logout=function(){this.clientService.logout(),this.router.navigate(["/loginpage"])},t}();B.decorators=[{type:r.Component,args:[{selector:"nli-client",template:'<div>\r\n  <div class="auth-header bg-accent"></div>\r\n\r\n  <div class="auth-box">\r\n    <mat-progress-bar\r\n      *ngIf="loading || !authenticated"\r\n      mode="indeterminate"\r\n      class="auth-loading-bar"\r\n    ></mat-progress-bar>\r\n\r\n    <div class="auth-form-container" *ngIf="!(authenticated | async) || !username">\r\n      <div class="auth-welcome-container">\r\n        <mat-icon class="icon-size-60">account_circle</mat-icon>\r\n        <h4 class="title">Sie werden zur Anmeldung weitergeleitet...</h4>\r\n      </div>\r\n    </div>\r\n\r\n    <div class="auth-form-container" *ngIf="(authenticated | async) && username">\r\n      <div class="auth-welcome-container">\r\n        <mat-icon class="icon-size-60">account_circle</mat-icon>\r\n        \x3c!-- {{\'client.welcome\' | translate}} --\x3e\r\n        <h4 class="title">Willkommen, {{ username }}!</h4>\r\n        \x3c!-- {{\'client.logout\' | translate}} --\x3e\r\n        <button mat-button (click)="logout()">Ausloggen</button>\r\n      </div>\r\n\r\n      <div class="btnContainer">\r\n        <form [formGroup]="clientForm" (ngSubmit)="gotoNextPage()">\r\n          \x3c!-- {{\'client.selectClient\' | translate}} --\x3e\r\n          <mat-form-field\r\n            appearance="standard"\r\n            floatLabel="always"\r\n            class="auth-input wizard-fields-common input-full-width"\r\n          >\r\n            <mat-label>Wählen Sie den Mandanten, auf dem Sie arbeiten möchten</mat-label>\r\n            <mat-select\r\n              id="aep-ndm-ui-common-clients-client-select"\r\n              name="client"\r\n              class="white-combo"\r\n              [formControl]="$any(clientForm).controls[\'client\']"\r\n            >\r\n              <mat-option\r\n                *ngFor="let client of clients"\r\n                [value]="client.value"\r\n                [id]="\'aep-ndm-common-clients-selectItem-\' + toId(client.value)"\r\n              >\r\n                {{ client.label }}\r\n              </mat-option>\r\n            </mat-select>\r\n          </mat-form-field>\r\n\r\n          <div class="auth-button-wrapper">\r\n            <button\r\n              mat-flat-button\r\n              class="auth-button dense"\r\n              color="primary"\r\n              type="submit"\r\n              id="aep-ndm-ui-common-clients-submit-button"\r\n              [disabled]="!clientForm.valid"\r\n            >\r\n              \x3c!-- {{\'client.next\' | translate}} --\x3e\r\n              Weiter\r\n            </button>\r\n          </div>\r\n        </form>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div class="copyright">\r\n    <span>\r\n      {{ \'copyright.companyName\' | translate }}\r\n    </span>\r\n    <span>\r\n      {{ \'copyright.companyDesc\' | translate }}\r\n    </span>\r\n  </div>\r\n</div>\r\n',styles:[".mat-input-underline{margin-top:0}:host .mat-input-underline{margin-top:0}\n"]}]}],B.ctorParameters=function(){return[{type:P},{type:o.Router},{type:i.FormBuilder},{type:L},{type:R,decorators:[{type:r.Optional}]}]};var F=function(){function t(t,e,n,r,o){var a=this;this.fb=t,this.router=e,this.authenticationService=n,this.clientService=r,this.translateService=o,this.loading=!1,this.authenticationService.isKeycloakEnabled()&&this.router.navigate(["/clients"]),this.authenticationService.isLoggedIn().subscribe((function(t){t&&(1===r.getClientCount()?a.router.navigate(["/loggedIn"]):a.router.navigate(["/clients"]))})),this.loginForm=t.group({username:["",i.Validators.required],password:["",i.Validators.required]})}return t.prototype.ngOnInit=function(){},t.prototype.submitForm=function(){var t=this;this.loading=!0,this.errorMessage="",this.authenticationService.login(this.loginForm.value.username,this.loginForm.value.password).subscribe((function(e){!0===e?(localStorage.setItem("username",t.loginForm.value.username),t.handleResponse(e)):t.translateService.get("Login.usernameOrPasswordIsWrong").subscribe((function(e){t.errorMessage=e})),t.loading=!1}),(function(e){e?t.errorMessage=e:t.translateService.get("App.serverError").subscribe((function(e){t.errorMessage=e})),t.loading=!1}))},t.prototype.handleResponse=function(t){1===t.length?(this.clientService.resetClient(t[0],1),this.router.navigate(["/loggedIn"])):this.router.navigate(["/clients"])},t}();F.decorators=[{type:r.Component,args:[{selector:"nli-login",template:'<div>\r\n  <div class="auth-header bg-accent"></div>\r\n  <div class="auth-box">\r\n    <mat-progress-bar *ngIf="loading" mode="indeterminate" class="auth-loading-bar"></mat-progress-bar>\r\n    <img src="/assets/logo-color.svg" class="auth-logo" />\r\n\r\n    <form [formGroup]="loginForm" (ngSubmit)="submitForm()">\r\n      <div class="auth-form-container">\r\n        <p class="errorMsg">{{ errorMessage }}</p>\r\n        <div>\r\n          <mat-form-field\r\n            floatLabel="always"\r\n            class="auth-input wizard-fields-common input-full-width"\r\n            appearance="standard"\r\n          >\r\n            <mat-label>{{ \'Login.username\' | translate }}</mat-label>\r\n            <input\r\n              id="aep-ndm-ui-common-login-username"\r\n              matInput\r\n              name="username"\r\n              [formControl]="$any(loginForm).controls[\'username\']"\r\n            />\r\n          </mat-form-field>\r\n          \x3c!-- {{ \'Login.errorMessage\' | translate }} --\x3e\r\n        </div>\r\n\r\n        <div>\r\n          <mat-form-field\r\n            floatLabel="always"\r\n            class="auth-input wizard-fields-common input-full-width"\r\n            appearance="standard"\r\n          >\r\n            <mat-label>{{ \'Login.password\' | translate }}</mat-label>\r\n            <input\r\n              id="aep-ndm-ui-common-login-password"\r\n              matInput\r\n              name="password"\r\n              type="password"\r\n              [formControl]="$any(loginForm).controls[\'password\']"\r\n            />\r\n          </mat-form-field>\r\n          \x3c!-- {{ \'Login.errorMessage\' | translate }} --\x3e\r\n        </div>\r\n        <div class="auth-button-wrapper">\r\n          <button\r\n            mat-flat-button\r\n            class="auth-button"\r\n            id="aep-ndm-ui-common-login-submit-button"\r\n            type="submit"\r\n            [disabled]="!loginForm.valid || loading"\r\n            color="primary"\r\n          >\r\n            {{ \'Login.login\' | translate }}\r\n          </button>\r\n        </div>\r\n      </div>\r\n    </form>\r\n  </div>\r\n  <div class="copyright">\r\n    <span>\r\n      {{ \'copyright.companyName\' | translate }}\r\n    </span>\r\n    <span>\r\n      {{ \'copyright.companyDesc\' | translate }}\r\n    </span>\r\n  </div>\r\n</div>\r\n',styles:[".mat-input-underline{margin-top:0}:host .mat-input-underline{margin-top:0}\n"]}]}],F.ctorParameters=function(){return[{type:i.FormBuilder},{type:o.Router},{type:L},{type:P},{type:s.TranslateService}]};var U=function(){function t(){this.mainTitle=[{title:""}],this.mainTitle$=new p.Subject,this.subTitle=[{title:""}],this.subTitle$=new p.Subject}return t.prototype.setTitles=function(t,e){(typeof t).toLowerCase().includes("string")?this.mainTitle=[{title:t}]:this.mainTitle=t,(typeof e).toLowerCase().includes("string")?this.subTitle=[{title:e}]:this.subTitle=e,this.mainTitle$.next(this.mainTitle),this.subTitle$.next(this.subTitle)},t}();U.decorators=[{type:r.Injectable}];var H=function(){function t(t){this.titleConfigService=t,this.mainTitle=[{title:""}],this.subTitle=[{title:""}]}return t.prototype.ngOnInit=function(){var t=this;this.mainTitle=this.titleConfigService.mainTitle,this.titleConfigService.mainTitle$.subscribe((function(e){t.mainTitle=e||t.mainTitle})),this.subTitle=this.titleConfigService.subTitle,this.titleConfigService.subTitle$.subscribe((function(e){t.subTitle=e||t.subTitle}))},t}();H.decorators=[{type:r.Component,args:[{selector:"nli-title-bar",template:'<div class="subTitle">\n  <span *ngFor="let subTitleItem of subTitle">\n    <span class="subTitleItem" *ngIf="!subTitleItem.url">{{ subTitleItem.title }}</span>\n    <span\n      class="subTitleItem clickable nli-primary"\n      *ngIf="subTitleItem.url"\n      routerLink="{{ subTitleItem.url }}"\n      routerLinkActive="active"\n    >\n      {{ subTitleItem.title }}\n    </span>\n  </span>\n</div>\n\n<div class="mainTitle">\n  <span *ngFor="let mainTitleItem of mainTitle">\n    <span class="mainTitleItem" *ngIf="!mainTitleItem.url">{{ mainTitleItem.title }}</span>\n    <span\n      class="mainTitleItem clickable nli-primary"\n      *ngIf="mainTitleItem.url"\n      routerLink="{{ mainTitleItem.url }}"\n      routerLinkActive="active"\n    >\n      {{ mainTitleItem.title }}\n    </span>\n  </span>\n</div>\n',styles:[".mainTitle{font-size:20px;font-weight:500}.subTitle{font-size:12px}.clickable{cursor:pointer}\n"]}]}],H.ctorParameters=function(){return[{type:U}]};var Y=function(){function t(t,e,n,i,o,a){var s=this;this.$sessionStorage=t,this.router=e,this.authService=n,this.clientService=i,this.iconRegistry=o,this.sanitizer=a,this.showBackBtn=!1,this.backBtnClick=new r.EventEmitter,this.showMenuBtn=!1,this.menuBtnClick=new r.EventEmitter,this.userName="--",this.clientName="--",this.iconsBaseUrl="/assets/img/icons/",this.icons=[{name:"nli_account-outline",icon:"account-outline.svg"},{name:"nli_lock_outline",icon:"lock-outline.svg"},{name:"nli_autorenew",icon:"autorenew.svg"},{name:"nli_logout",icon:"logout.svg"}],this.icons.forEach((function(t){return s.iconRegistry.addSvgIcon(t.name,s.sanitizer.bypassSecurityTrustResourceUrl(s.iconsBaseUrl+t.icon))}))}return t.prototype.ngOnInit=function(){var t=this;this.authService.getCurrentUserName().subscribe((function(e){t.userName=e})),this.clientName=this.clientService.getClientName()},t.prototype.onClickClient=function(){this.router.navigateByUrl("/clients")},t.prototype.onClickLogout=function(){this.authService.logout()},t.prototype.onClickPassword=function(){console.log("clicked password button")},t.prototype.onClickProfile=function(){console.log("clicked profile button")},t.prototype.onBackBtnClick=function(t){this.backBtnClick.emit(t)},t.prototype.onMenuBtnClick=function(t){this.menuBtnClick.emit(t)},t}();Y.decorators=[{type:r.Component,args:[{selector:"nli-toolbar",template:'<mat-toolbar class="toolbar" color="accent">\n  \x3c!-- <span *ngIf="showBackBtn===false"><mat-icon class="logo" svgSrc="/assets/logo.svg"></mat-icon></span> --\x3e\n  <span *ngIf="showBackBtn == true">\n    <button *ngIf="backBtnUrl" mat-icon-button [routerLink]="backBtnUrl">\n      <mat-icon>arrow_back</mat-icon>\n    </button>\n    <button *ngIf="!backBtnUrl" mat-icon-button (click)="onBackBtnClick($event)">\n      <mat-icon>arrow_back</mat-icon>\n    </button>\n  </span>\n  <span *ngIf="showMenuBtn == true">\n    <button mat-icon-button (click)="onMenuBtnClick($event)">\n      <mat-icon>menu</mat-icon>\n    </button>\n  </span>\n  <span class="title-container">\n    <nli-title-bar></nli-title-bar>\n  </span>\n  <span class="fill-remaining-space"></span>\n  <div>\n    <nli-menu [isToolBarMenu]="true" [firstLineText]="userName" [secoundLineText]="clientName">\n      \x3c!-- DO NOT DELETE. this is just a temporary comment out for first release. we will implement this in the future\n\n          <nli-menu-item [icon]="\'perm_identity\'" [text]="\'App.userMenu.profile\' | translate" (click)="onClickProfile()" iconPath="/assets/img/icons/account-outline.svg"></nli-menu-item>\n          <nli-menu-item [icon]="\'lock_outline\'" [text]="\'App.userMenu.password\' | translate" (click)="onClickPassword()" iconPath="/assets/img/icons/lock-outline.svg"></nli-menu-item>\n--\x3e\n      <nli-menu-item\n        [icon]="\'autorenew\'"\n        [text]="\'App.userMenu.client\' | translate"\n        (click)="onClickClient()"\n        iconPath="/assets/img/icons/autorenew.svg"\n      ></nli-menu-item>\n      <nli-menu-item\n        [icon]="\'exit_to_app\'"\n        [text]="\'App.userMenu.logout\' | translate"\n        (click)="onClickLogout()"\n        iconPath="/assets/img/icons/logout.svg"\n      ></nli-menu-item>\n    </nli-menu>\n  </div>\n</mat-toolbar>\n',styles:[".backIconBtn{margin-top:10px;margin-left:-6px;margin-right:14px}.material-icons{font-size:20px}.toolbar{vertical-align:center}.fill-remaining-space{flex:1 1 auto}.toolbar-menu-button{padding:5px 25px;height:-webkit-fill-available;height:-moz-available;height:stretch}.toolbar-menu-button-icon{float:left;margin-right:5px}.toolbar-menu-button-icon mat-icon{vertical-align:middle;height:40px!important;width:40px!important;font-size:40px!important}.toolbar-menu-item-icon{vertical-align:middle;height:24px!important;width:24px!important;font-size:24px!important;line-height:30px!important}.toolbar-menu-button-text{float:left;text-align:left;margin-top:2px}.toolbar-menu-button .menu-line{width:100%;display:block;line-height:20px}\n"]}]}],Y.ctorParameters=function(){return[{type:l.SessionStorageService},{type:o.Router},{type:L},{type:P},{type:g.MatIconRegistry},{type:m.DomSanitizer}]},Y.propDecorators={showBackBtn:[{type:r.Input}],backBtnUrl:[{type:r.Input}],backBtnClick:[{type:r.Output}],showMenuBtn:[{type:r.Input}],menuBtnClick:[{type:r.Output}]};var z=function(){function t(t,e){this.auth=t,this.router=e}return t.prototype.canActivate=function(){return this.auth.isAuthModuleSetup().pipe(u.tap((function(){return!0})))},t}();z.decorators=[{type:r.Injectable}],z.ctorParameters=function(){return[{type:L},{type:o.Router}]};var q=function(){function t(t,e){this.keyCloakService=t,this.injector=e,this.jwtHelperService=new h.JwtHelperService,this.clientHeaderName="client-name",this.configuration=this.injector.get(R),this.configuration.options&&(this.useBearer=this.configuration.options.useBearer&&!0===this.configuration.options.useBearer,this.clientHeaderName=this.configuration.options.clientHeaderName?this.configuration.options.clientHeaderName:this.clientHeaderName)}return t.prototype.getAuthService=function(){return null==this.authService&&(this.authService=this.injector.get(L)),this.authService},t.prototype.intercept=function(t,e){var n=this;return(this.keyCloakService.getKeycloakSetting()&&this.keyCloakService.getKeycloakSetting().enabled?this.getKeycloakHeaders(t.headers,t):this.getJwtHeaders(t.headers,t)).pipe(u.switchMap((function(r){var i=t.clone({headers:r});return e.handle(i).pipe(u.catchError((function(t){throw t&&401===t.status&&n.getAuthService().logout(),t})))})))},t.prototype.getHttpHeaders=function(t){if("*/*"!==t.get("Accept")){var e=t.set("Content-Type","application/json");return e=e.set("Accept","application/json"),t}return t},t.prototype.getJwtHeaders=function(t,e){var n=this.getHttpHeaders(t);if(this.checkUrl(e))return p.of(n);var r=localStorage.getItem("id_token"),i=localStorage.getItem("current_client_name"),o=localStorage.getItem("userPass"),a=null!=r&&!this.jwtHelperService.isTokenExpired(r);return i&&(n=t.set(this.clientHeaderName,i)),n=a?this.useBearer?n.append("Authorization","Bearer "+r):n.append("Authorization","Basic "+o):n.delete("Authorization"),p.of(n)},t.prototype.checkUrl=function(t){return-1!==t.url.indexOf("assets/i18n")||-1!==t.url.indexOf("realms")||-1!==t.url.indexOf("api/authentication")||-1!==t.url.indexOf("frontend/keycloak")},t.prototype.getKeycloakHeaders=function(t,e){var n=this,r=this.getHttpHeaders(t);return this.checkUrl(e)?p.of(r):this.getAuthService().isLoggedIn().pipe(u.map((function(t){var i=n.getAuthService().getAccessToken();if(t&&i)if(-1!=e.url.indexOf("api/clients"))r=r.append("Authorization","Bearer "+i);else{r=r.append("Authorization","Bearer "+i);var o=localStorage.getItem(j.KEY_CURRENT_CLIENT_NAME);o&&(r=r.append(n.clientHeaderName,o))}return r})))},t}();q.ɵprov=_.ɵɵdefineInjectable({factory:function(){return new q(_.ɵɵinject(M),_.ɵɵinject(_.INJECTOR))},token:q,providedIn:"root"}),q.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],q.ctorParameters=function(){return[{type:M},{type:r.Injector}]};var D=function(){function t(){var t=this;this.defaultPrimary="white",this.defaultAccent="white",this.defaultWarn="red",this.primary$=new p.Observable((function(e){e.next(t.defaultPrimary),t.setPrimary=function(t){return e.next(t)}})),this.accent$=new p.Observable((function(e){e.next(t.defaultAccent),t.setAccent=function(t){return e.next(t)}})),this.warn$=new p.Observable((function(e){e.next(t.defaultWarn),t.setWarn=function(t){return e.next(t)}}))}return t.prototype.setPrimary=function(t){this.defaultPrimary=t},t.prototype.setAccent=function(t){this.defaultAccent=t},t.prototype.setWarn=function(t){this.defaultWarn=t},t.prototype.ngAfterViewInit=function(){var t=getComputedStyle(this.primaryElement.nativeElement);this.setPrimary(t["background-color"]);var e=getComputedStyle(this.accentElement.nativeElement);this.setAccent(e["background-color"]);var n=getComputedStyle(this.warnElement.nativeElement);this.setWarn(n["background-color"])},t}();D.decorators=[{type:r.Component,args:[{selector:"colors-grabber",template:'\n    <button #primary mat-flat-button color="primary"></button>\n    <button #accent mat-flat-button color="accent"></button>\n    <button #warn mat-flat-button color="warn"></button>\n  ',styles:[":host { display: none; }"]}]}],D.propDecorators={primaryElement:[{type:r.ViewChild,args:["primary",{read:r.ElementRef,static:!0}]}],accentElement:[{type:r.ViewChild,args:["accent",{read:r.ElementRef,static:!0}]}],warnElement:[{type:r.ViewChild,args:["warn",{read:r.ElementRef,static:!0}]}]};var $=function(){};$.decorators=[{type:r.NgModule,args:[{exports:[d.MatButtonModule,g.MatIconModule,f.MatInputModule,v.MatSelectModule,y.MatProgressBarModule,b.MatToolbarModule]}]}];var W=new r.InjectionToken("forRoot() ConfigurationService"),G=function(){function t(){}return t.prototype.setState=function(t){var e=JSON.parse(localStorage.getItem("FilterSearchStateService_"+t.component));e=e||{},t.group?(e[t.group]=e[t.group]||{},e[t.group][t.key]=t.value):e[t.key]=t.value,localStorage.setItem("FilterSearchStateService_"+t.component,JSON.stringify(e))},t.prototype.getState=function(t,e,n){var r=JSON.parse(localStorage.getItem("FilterSearchStateService_"+t));return r?{key:e,component:t,value:(r[n]||r)[e]}:{key:e,component:t,value:null}},t}();G.decorators=[{type:r.Injectable}],G.ctorParameters=function(){return[]};var J=[B,F,H,Y],V=[{path:"clients",component:B,canActivate:[z]},{path:"loginpage",component:F,canActivate:[z]},{path:"",redirectTo:"clients",pathMatch:"full"}];function Z(t,n){return function(){return new Promise((function(r){n.get(e.LOCATION_INITIALIZED,Promise.resolve(null)).then((function(){t.load().subscribe((function(){return r(null)}))}))}))}}function Q(t){var e=new R;return e.options=t,e}var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.prepareExternalUrl=function(e){return window.location.search+t.prototype.prepareExternalUrl.call(this,e)},e}(e.HashLocationStrategy);X.decorators=[{type:r.Injectable}];var tt=function(){function t(){}return t.forRoot=function(i){return{ngModule:t,providers:[z,{provide:e.LocationStrategy,useClass:X},M,L,c.OidcSecurityService,{provide:r.APP_INITIALIZER,useFactory:Z,deps:[M,r.Injector],multi:!0},{provide:n.HTTP_INTERCEPTORS,useClass:q,deps:[M,r.Injector],multi:!0},P,U,G,{provide:W,useValue:i},{provide:R,useFactory:Q,deps:[W]}]}},t}();tt.decorators=[{type:r.NgModule,args:[{declarations:N(N([],x(J)),[D]),exports:J,providers:[{provide:r.LOCALE_ID,useValue:"de"}],imports:[e.CommonModule,$,n.HttpClientModule,s.TranslateModule.forRoot(),o.RouterModule,c.AuthModule.forRoot(),l.NgxWebstorageModule.forRoot(),i.FormsModule,i.ReactiveFormsModule,$,a.NliMenuModule]}]}];var et=function(){function t(t,e){this.auth=t,this.router=e}return t.prototype.canActivate=function(){var t=this;return this.auth.isLoggedIn().pipe(u.map((function(e){return!!e||(t.router.navigate(["loginpage"]),!1)})))},t}();et.decorators=[{type:r.Injectable}],et.ctorParameters=function(){return[{type:L},{type:o.Router}]},t.AuthGuard=et,t.AuthenticationService=L,t.ClientComponent=B,t.ClientService=P,t.FilterSearchStateService=G,t.GLOBAL_CONFIG=A,t.JwtInterceptor=q,t.KeycloakFactory=Z,t.KeycloakService=M,t.LocalStorageContext=j,t.LoginComponent=F,t.ModuleConfigurationFactory=Q,t.NliCommonModule=tt,t.NliTitleBarComponent=H,t.NliToolbarComponent=Y,t.ParameterHashLocationStrategy=X,t.SetupGuard=z,t.TitleConfigService=U,t.commonRoutes=V,t.ɵa=R,t.ɵb=D,t.ɵc=$,t.ɵd=W,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=/sm/e31ce00d07fab9609c86a3b6c8f27426796a9ebf0849ce9aa27c848c748bd51e.map