!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core"),require("@ngrx/effects"),require("@ngrx/store"),require("@angular/common/http"),require("rxjs/operators"),require("rxjs"),require("reflect-metadata"),require("@angular/forms"),require("lodash-es/defaultsDeep"),require("@angular/router"),require("@ngx-pwa/local-storage"),require("@ngx-translate/core"),require("lodash-es/sortBy"),require("@angular/material/dialog"),require("@angular/material/button"),require("immutable"),require("@angular/flex-layout"),require("@angular/material/badge"),require("@angular/material/divider"),require("@angular/material/expansion"),require("@angular/material/icon"),require("@angular/material/list"),require("@angular/material/tooltip"),require("pip-webui2-layouts"),require("pip-webui2-nav"),require("lodash-es/cloneDeep"),require("@angular/service-worker"),require("lodash-es/omit"),require("@angular/material/autocomplete"),require("@angular/material/button-toggle"),require("@angular/material/chips"),require("@angular/material/form-field"),require("@angular/material/input"),require("@angular/material/menu"),require("@angular/material/progress-bar"),require("@angular/material/select"),require("@angular/material/snack-bar"),require("@angular/platform-browser"),require("pip-webui2-themes")):"function"==typeof define&&define.amd?define("guru-admin-shell-angular",["exports","@angular/common","@angular/core","@ngrx/effects","@ngrx/store","@angular/common/http","rxjs/operators","rxjs","reflect-metadata","@angular/forms","lodash-es/defaultsDeep","@angular/router","@ngx-pwa/local-storage","@ngx-translate/core","lodash-es/sortBy","@angular/material/dialog","@angular/material/button","immutable","@angular/flex-layout","@angular/material/badge","@angular/material/divider","@angular/material/expansion","@angular/material/icon","@angular/material/list","@angular/material/tooltip","pip-webui2-layouts","pip-webui2-nav","lodash-es/cloneDeep","@angular/service-worker","lodash-es/omit","@angular/material/autocomplete","@angular/material/button-toggle","@angular/material/chips","@angular/material/form-field","@angular/material/input","@angular/material/menu","@angular/material/progress-bar","@angular/material/select","@angular/material/snack-bar","@angular/platform-browser","pip-webui2-themes"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["guru-admin-shell-angular"]={},t.ng.common,t.ng.core,t.ngrxEffects,t.ngrxStore,t.ng.common.http,t.rxjs.operators,t.rxjs,null,t.ng.forms,t.defaultsDeep,t.ng.router,t.ngxPwaLocalStorage,t.ngxTranslateCore,t.sortBy,t.ng.material.dialog,t.ng.material.button,t.immutable,t.ng.flexLayout,t.ng.material.badge,t.ng.material.divider,t.ng.material.expansion,t.ng.material.icon,t.ng.material.list,t.ng.material.tooltip,t.pipWebui2Layouts,t.pipWebui2Nav,t.cloneDeep,t.ng.serviceWorker,t.omit,t.ng.material.autocomplete,t.ng.material.buttonToggle,t.ng.material.chips,t.ng.material.formField,t.ng.material.input,t.ng.material.menu,t.ng.material.progressBar,t.ng.material.select,t.ng.material.snackBar,t.ng.platformBrowser,t.pipWebui2Themes)}(this,(function(t,e,n,i,r,o,a,s,c,p,u,l,d,f,g,h,v,m,y,S,b,A,w,O,I,x,C,j,P,M,T,U,E,F,k,R,N,$,L,D,_){"use strict";function G(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var B=G(u),q=G(g),V=G(j),H=G(M),J=function(t,e){return(J=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])})(t,e)};function W(t,e){function n(){this.constructor=t}J(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function K(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}Object.create;function z(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function Q(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Y(arguments[e]));return t}Object.create;function X(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}var Z,tt=function(t){var e,n;this.session=null!==(e=null==t?void 0:t.session)&&void 0!==e?e:"",this.serverUrl=null!==(n=null==t?void 0:t.serverUrl)&&void 0!==n?n:""},et=function(t){var e,n,i,r,o;this.enabled=null!==(e=null==t?void 0:t.enabled)&&void 0!==e&&e,this.autorizedUrl=null!==(n=null==t?void 0:t.autorizedUrl)&&void 0!==n?n:"",this.unautorizedUrl=null!==(i=null==t?void 0:t.unautorizedUrl)&&void 0!==i?i:"",this.serverUrl=null!==(r=null==t?void 0:t.serverUrl)&&void 0!==r?r:"",this.lsKeys=null!==(o=null==t?void 0:t.lsKeys)&&void 0!==o?o:new tt},nt=new n.InjectionToken("GA session config"),it=new et({enabled:!1,autorizedUrl:"/home/index.html",unautorizedUrl:"/signin/index.html",serverUrl:"",lsKeys:{session:"session",serverUrl:"serverUrl"}}),rt=function(){},ot=function(){};(Z=t.UserRole||(t.UserRole={})).Admin="admin",Z.Moderator="moder";var at,st=function(){},ct=function(){function t(){at.set(this,new et)}return Object.defineProperty(t.prototype,"config",{get:function(){return X(this,at)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){var t,e;return null!==(e=null===(t=X(this,at))||void 0===t?void 0:t.enabled)&&void 0!==e&&e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autorizedUrl",{get:function(){var t,e;return null!==(e=null===(t=X(this,at))||void 0===t?void 0:t.autorizedUrl)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unautorizedUrl",{get:function(){var t,e;return null!==(e=null===(t=X(this,at))||void 0===t?void 0:t.unautorizedUrl)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"serverUrl",{get:function(){var t,e;return null!==(e=null===(t=X(this,at))||void 0===t?void 0:t.serverUrl)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lsKeys",{get:function(){var t;return(null===(t=X(this,at))||void 0===t?void 0:t.lsKeys)||new tt},enumerable:!1,configurable:!0}),t.prototype.addConfig=function(t){var e,n,i,r;X(this,at).enabled=null!==(e=null==t?void 0:t.enabled)&&void 0!==e?e:this.enabled,X(this,at).autorizedUrl=null!==(n=null==t?void 0:t.autorizedUrl)&&void 0!==n?n:this.autorizedUrl,X(this,at).unautorizedUrl=null!==(i=null==t?void 0:t.unautorizedUrl)&&void 0!==i?i:this.unautorizedUrl,X(this,at).serverUrl=null!==(r=null==t?void 0:t.serverUrl)&&void 0!==r?r:this.serverUrl,X(this,at).lsKeys=Object.assign(Object.assign({},this.lsKeys),(null==t?void 0:t.lsKeys)||[])},t}();at=new WeakMap,ct.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new ct},token:ct,providedIn:"root"}),ct.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}];var pt=function(){function t(t,e){this.http=t,this.sessionConfigService=e}return Object.defineProperty(t.prototype,"resourse",{get:function(){return this.sessionConfigService.serverUrl+"/api/v1/users/"},enumerable:!1,configurable:!0}),t.prototype.getAccounts=function(){return this.http.get(this.resourse)},t.prototype.getAccountById=function(t){return this.http.get(this.resourse+t)},t.prototype.getCurrentAccount=function(){return this.getAccountById("current")},t.prototype.createAccount=function(t){return this.http.post(this.resourse,t)},t.prototype.updateAccount=function(t,e){return this.http.put(this.resourse+t,e)},t.prototype.deleteAccount=function(t){return this.http.delete(this.resourse+t)},t.prototype.verifyEmail=function(t,e){return this.http.post(this.resourse+"email/verify",{login:t,code:e})},t.prototype.resendEmailVerification=function(t){return this.http.post(this.resourse+"email/resend",{login:t})},t.prototype.getEmailSettings=function(t){return this.http.get(this.resourse+t+"/email")},t.prototype.setEmailSettings=function(t,e){return this.http.post(this.resourse+t+"/email",e)},t.prototype.verifySms=function(t,e){return this.http.post(this.resourse+"sms/verify",{login:t,code:e})},t.prototype.resendSmsVerification=function(t){return this.http.post(this.resourse+"sms/resend",{login:t})},t.prototype.getSmsSettings=function(t){return this.http.get(this.resourse+t+"/sms")},t.prototype.setSmsSettings=function(t,e){return this.http.post(this.resourse+t+"/sms",e)},t}();pt.decorators=[{type:n.Injectable}],pt.ctorParameters=function(){return[{type:o.HttpClient},{type:ct}]};var ut=function(t,e){return JSON.stringify(t)===JSON.stringify(e)},lt=function(){function t(t){this.stateSubject=new s.BehaviorSubject(t)}return t.prototype.getState=function(){return this.stateSubject.pipe(a.distinctUntilChanged())},t.prototype.getStateSnapshot=function(){return this.stateSubject.getValue()},t.prototype.select=function(t){return this.stateSubject.pipe(a.map((function(e){return e[t]})),a.distinctUntilChanged())},t.prototype.setState=function(t){var e=this.getStateSnapshot(),n=Object.assign({},e,t);this.stateSubject.next(n)},t}();function dt(t){return function(e){return e&&(e.hasOwnProperty(t)||null)&&e[t]}}function ft(){return function(t,e){Reflect.defineMetadata("subscription:name",e,t,"subscriber")}}var gt,ht=function(){},vt={account:null,state:"progress",error:null};(gt=t.AccountActionTypes||(t.AccountActionTypes={})).Read="[ACCOUNT] Read",gt.ReadSuccess="[ACCOUNT] Read Success",gt.ReadFailure="[ACCOUNT] Read Failure",gt.Update="[ACCOUNT] Update",gt.UpdateSuccess="[ACCOUNT] Update Success",gt.UpdateFailure="[ACCOUNT] Update Failure";var mt=r.createAction(t.AccountActionTypes.Read),yt=r.createAction(t.AccountActionTypes.ReadSuccess,r.props()),St=r.createAction(t.AccountActionTypes.ReadFailure,r.props()),bt=r.createAction(t.AccountActionTypes.Update,r.props()),At=r.createAction(t.AccountActionTypes.UpdateSuccess,r.props()),wt=r.createAction(t.AccountActionTypes.UpdateFailure,r.props()),Ot=r.createFeatureSelector("account"),It=function(t){return t.account},xt=r.createSelector(Ot,It),Ct=function(t){return t.state},jt=r.createSelector(Ot,Ct),Pt=function(t){return t.error},Mt=r.createSelector(Ot,Pt),Tt=function(t){var e;return null===(e=t.account)||void 0===e?void 0:e.custom_dat},Ut=r.createSelector(Ot,Tt),Et=function(t){return Object.assign(Object.assign({},t),{state:"progress",error:null})},Ft=function(t,e){var n=e.account;return Object.assign(Object.assign({},t),{account:n,state:"data",error:null})},kt=function(t,e){var n=e.error;return Object.assign(Object.assign({},t),{state:"error",error:n})},Rt=function(t){return Object.assign(Object.assign({},t),{state:"progress",error:null})},Nt=function(t,e){var n=e.account;return Object.assign(Object.assign({},t),{account:n,state:"data",error:null})},$t=function(t,e){var n=e.error;return Object.assign(Object.assign({},t),{state:"error",error:n})},Lt=r.createReducer(vt,r.on(mt,Et),r.on(yt,Ft),r.on(St,kt),r.on(bt,Rt),r.on(At,Nt),r.on(wt,$t));function Dt(t,e){return Lt(t,e)}var _t=function(){function t(t){this.store=t}return Object.defineProperty(t.prototype,"account$",{get:function(){return this.store.select(xt).pipe(a.distinctUntilChanged(ut))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state$",{get:function(){return this.store.select(jt)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"error$",{get:function(){return this.store.select(Mt)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"preferences$",{get:function(){return this.store.select(Ut).pipe(a.distinctUntilChanged(ut))},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.store.dispatch(bt({account:t}))},t.prototype.updatePreferences=function(t){this.store.dispatch(bt({account:{custom_dat:t}}))},t.prototype.setPreferenceByKey=function(t,e){var n;this.store.dispatch(bt({account:{custom_dat:(n={},n[t]=e,n)}}))},t.prototype.preferenceByKey$=function(t){return this.preferences$.pipe(a.map((function(e){return e&&e[t]})))},t}();_t.decorators=[{type:n.Injectable}],_t.ctorParameters=function(){return[{type:r.Store}]};var Gt=new n.InjectionToken("WindowToken"),Bt=function(){function t(){}return Object.defineProperty(t.prototype,"nativeWindow",{get:function(){throw new Error("Not implemented.")},enumerable:!1,configurable:!0}),t}(),qt=function(t){function e(){return t.call(this)||this}return W(e,t),Object.defineProperty(e.prototype,"nativeWindow",{get:function(){return window},enumerable:!1,configurable:!0}),e}(Bt),Vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return W(e,t),e}(Window);function Ht(t,n){return e.isPlatformBrowser(n)?t.nativeWindow:new Object}Vt.decorators=[{type:n.Injectable}];var Jt={provide:Bt,useClass:qt},Wt={provide:Gt,useFactory:Ht,deps:[Bt,n.PLATFORM_ID]},Kt=[Jt,Wt],zt=function(){function t(t,e){this.http=t,this.sessionConfig=e}return Object.defineProperty(t.prototype,"resourse",{get:function(){return this.sessionConfig.serverUrl+"/api/v1/users/"},enumerable:!1,configurable:!0}),t.prototype.signin=function(t,e){return this.http.post(this.resourse+"signin",{login:t,password:e})},t.prototype.signup=function(t){return this.http.post(this.resourse+"users",t)},t.prototype.signout=function(){return this.http.post(this.resourse+"signout",null)},t.prototype.recover=function(t){return this.http.post(this.resourse+"passwords/recover",{login:t})},t.prototype.reset=function(t,e,n){return this.http.post(this.resourse+"passwords/reset",{login:t,code:e,password:n})},t.prototype.changePassword=function(t,e,n){return this.http.post(this.resourse+t+"/passwords/change",{old_password:e,new_password:n})},t.prototype.getSessions=function(){return this.http.get(this.resourse+"sessions")},t.prototype.getCurrentSession=function(){return this.http.get(this.resourse+"sessions/current")},t.prototype.restoreSession=function(t){return this.http.post(this.resourse+"sessions/restore",{session_id:t})},t.prototype.closeSession=function(t){return this.http.delete(this.resourse+"sessions/"+t)},t}();zt.decorators=[{type:n.Injectable}],zt.ctorParameters=function(){return[{type:o.HttpClient},{type:ct}]};var Yt,Qt=function(){},Xt={sessionUser:null,state:"none",error:null};(Yt=t.SessionActionTypes||(t.SessionActionTypes={})).Restore="[SESSION] Restore",Yt.RestoreSuccess="[SESSION] Restore Success",Yt.RestoreFailure="[SESSION] Restore Failure",Yt.Signin="[SESSION] Signin",Yt.SigninAbort="[SESSION] Signin Abort",Yt.SigninSuccess="[SESSION] Signin Succes",Yt.SigninFailure="[SESSION] Signin Failure",Yt.Signup="[SESSION] Signup",Yt.SignupSuccess="[SESSION] Signup Succes",Yt.SignupFailure="[SESSION] Signup Failure",Yt.Signout="[SESSION] Signout",Yt.SignoutSuccess="[SESSION] Signout Succes",Yt.SignoutFailure="[SESSION] Signout Failure";var Zt=r.createAction(t.SessionActionTypes.Restore),te=r.createAction(t.SessionActionTypes.RestoreSuccess,r.props()),ee=r.createAction(t.SessionActionTypes.RestoreFailure,r.props()),ne=r.createAction(t.SessionActionTypes.Signin,r.props()),ie=r.createAction(t.SessionActionTypes.SigninAbort),re=r.createAction(t.SessionActionTypes.SigninSuccess,r.props()),oe=r.createAction(t.SessionActionTypes.SigninFailure,r.props()),ae=r.createAction(t.SessionActionTypes.Signup,r.props()),se=r.createAction(t.SessionActionTypes.SignupSuccess,r.props()),ce=r.createAction(t.SessionActionTypes.SignupFailure,r.props()),pe=r.createAction(t.SessionActionTypes.Signout),ue=r.createAction(t.SessionActionTypes.SignoutSuccess),le=r.createAction(t.SessionActionTypes.SigninFailure,r.props()),de=r.createFeatureSelector("auth"),fe=r.createSelector(de,(function(t){return t.sessionUser})),ge=r.createSelector(de,(function(t){return t.state})),he=r.createSelector(de,(function(t){return t.error})),ve=r.createSelector(de,(function(t){return"authenticated"===t.state})),me=r.createReducer(Xt,r.on(Zt,(function(t){return Object.assign(Object.assign({},t),{state:"progress",error:null})})),r.on(te,(function(t,e){var n=e.sessionUser;return Object.assign(Object.assign({},t),{sessionUser:n,state:"authenticated",error:null})})),r.on(ee,(function(t,e){var n=e.error;return Object.assign(Object.assign({},t),{state:"nonAuthenticated",error:n})})),r.on(ne,(function(t){return Object.assign(Object.assign({},t),{state:"progress",error:null})})),r.on(ie,(function(t){return Object.assign(Object.assign({},t),{state:"progress"===t.state?"nonAuthenticated":t.state})})),r.on(re,(function(t,e){var n=e.sessionUser;return Object.assign(Object.assign({},t),{state:"authenticated",sessionUser:n,error:null})})),r.on(oe,(function(t,e){var n=e.error;return Object.assign(Object.assign({},t),{state:"nonAuthenticated",sessionUser:null,error:n})})),r.on(ae,(function(t){return Object.assign(Object.assign({},t),{state:"progress",error:null})})),r.on(se,(function(t,e){var n=e.sessionUser;return Object.assign(Object.assign({},t),{state:"authenticated",sessionUser:n,error:null})})),r.on(ce,(function(t,e){var n=e.error;return Object.assign(Object.assign({},t),{sessionUser:null,error:n})})),r.on(pe,(function(t){return Object.assign(Object.assign({},t),{state:"progress",error:null})})),r.on(ue,(function(t){return Object.assign(Object.assign({},t),{state:"nonAuthenticated",sessionUser:null,error:null})})),r.on(le,(function(t,e){var n=e.error;return Object.assign(Object.assign({},t),{error:n})})));function ye(t,e){return me(t,e)}var Se=function(e,n,r,o,c,p,u){var l=this;this.actions$=e,this.route=n,this.router=r,this.sessionConfig=o,this.sessionsDataService=c,this.storage=p,this.window=u,this.restore$=i.createEffect((function(){return l.actions$.pipe(i.ofType(Zt,i.ROOT_EFFECTS_INIT),a.switchMap((function(t){return l.storage.get(l.sessionConfig.lsKeys.session).pipe(a.map((function(t){return t?te({sessionUser:t}):l.sessionConfig.enabled?ee({error:"Session missed"}):te({sessionUser:null})})))})))})),this.signin$=i.createEffect((function(){return l.actions$.pipe(i.ofType(ne,ie),a.switchMap((function(e){return e.type===t.SessionActionTypes.Signin?l.sessionsDataService.signin(e.login,e.password).pipe(a.map((function(t){return re({sessionUser:t})})),a.catchError((function(t){return s.of(oe({error:t}))}))):s.EMPTY})))})),this.signout$=i.createEffect((function(){return l.actions$.pipe(i.ofType(pe),a.switchMap((function(t){return l.sessionsDataService.signout().pipe(a.map((function(){return ue()})),a.catchError((function(t){return s.of(le({error:t}))})))})))})),this.authorizedRedirect$=i.createEffect((function(){return l.actions$.pipe(i.ofType(re,se),a.switchMap((function(t){return l.storage.set("session",t.sessionUser)})),a.tap((function(){var t=l.route.snapshot.queryParamMap.get("from");l.window.location.href=t?decodeURIComponent(t):l.window.location.origin+l.sessionConfig.autorizedUrl})))}),{dispatch:!1}),this.unauthorizedRedirect$=i.createEffect((function(){return l.actions$.pipe(i.ofType(ue,ee),a.switchMap((function(){return l.storage.delete("session")})),a.tap((function(){l.window.location.href=l.window.location.origin+l.sessionConfig.unautorizedUrl+"?from="+encodeURIComponent(l.router.url)})))}),{dispatch:!1})};Se.decorators=[{type:n.Injectable}],Se.ctorParameters=function(){return[{type:i.Actions},{type:l.ActivatedRoute},{type:l.Router},{type:ct},{type:zt},{type:d.StorageMap},{type:Vt,decorators:[{type:n.Inject,args:[Gt]}]}]};var be=function(){function t(t){this.store=t}return Object.defineProperty(t.prototype,"isAuthenticated",{get:function(){var t;return this.isAuthenticated$.pipe(a.take(1)).subscribe((function(e){return t=e})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state$",{get:function(){return this.store.select(ge)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionUser$",{get:function(){return this.store.select(fe)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"error$",{get:function(){return this.store.select(he)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAuthenticated$",{get:function(){return this.store.select(ve)},enumerable:!1,configurable:!0}),t.prototype.signin=function(t,e){this.store.dispatch(ne({login:t,password:e}))},t.prototype.signinAbort=function(){this.store.dispatch(ie())},t.prototype.signout=function(){this.store.dispatch(pe())},t.prototype.restore=function(){this.store.dispatch(Zt())},t}();be.decorators=[{type:n.Injectable}],be.ctorParameters=function(){return[{type:r.Store}]};var Ae=function(t,e,n,r){var o=this;this.accountsDs=t,this.actions$=e,this.sessionService=n,this.store=r,this.read$=i.createEffect((function(){return s.merge.apply(void 0,Q([o.actions$.pipe(i.ofType(mt)),o.sessionService.sessionUser$.pipe(a.filter((function(t){return!!t})))])).pipe(a.switchMap((function(){return o.accountsDs.getCurrentAccount().pipe(a.map((function(t){return yt({account:t})})),a.catchError((function(t){return s.of(St({error:t}))})))})))})),this.update$=i.createEffect((function(){return o.actions$.pipe(i.ofType(bt),a.withLatestFrom(o.store.select(xt)),a.switchMap((function(t){var e=Y(t,2),n=e[0],i=e[1];return o.accountsDs.updateAccount(i.id,B.default(n.account,i)).pipe(a.map((function(t){return At({account:t})})),a.catchError((function(t){return s.of(wt({error:t}))})))})))}))};Ae.decorators=[{type:n.Injectable}],Ae.ctorParameters=function(){return[{type:pt},{type:i.Actions},{type:be},{type:r.Store}]};var we=function(){};we.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,r.StoreModule.forFeature("account",Dt),i.EffectsModule.forFeature([Ae])],providers:[pt,_t]}]}];var Oe,Ie=function(){},xe=function(){},Ce=function(){function t(t,e){this.window=t,this.router=e}return t.prototype._check=function(t){if(!this.router.navigated&&(t.hasOwnProperty("url")&&""===t.url.replace(/\//g,"")||t.hasOwnProperty("segments")&&!t.segments.length)){var e=JSON.parse(this.window.sessionStorage.getItem("appChangeParams"));e&&e.state&&!this.router.isActive(this.router.createUrlTree([e.state],{queryParams:e.state_params}),!1)&&this.router.navigate([e.state],{queryParams:e.state_params})}return!0},t.prototype.canActivate=function(t,e){return this._check({url:e.url})},t.prototype.canLoad=function(t,e){return this._check({segments:e})},t}();Ce.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Ce(n.ɵɵinject(Gt),n.ɵɵinject(l.Router))},token:Ce,providedIn:"root"}),Ce.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],Ce.ctorParameters=function(){return[{type:Vt,decorators:[{type:n.Inject,args:[Gt]}]},{type:l.Router}]},(Oe=t.ApplicationUrlType||(t.ApplicationUrlType={})).Inner="inner",Oe.Outer="outer";var je=function(){},Pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return W(e,t),e}(je),Me=function(t){var e,n;this.productName=null!==(e=null==t?void 0:t.productName)&&void 0!==e?e:"",this.defaultFavoritesIds=null!==(n=null==t?void 0:t.defaultFavoritesIds)&&void 0!==n?n:[]},Te={productName:"Guru Admin",defaultFavoritesIds:[]},Ue=function(){},Ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return W(e,t),e}(Ue),Fe=function(){},ke=function(){function t(t,e){var n=this;this.data=t,this.dialogRef=e,this.keys=Object.keys(this.data.actions).filter((function(t){return n.data.actions.hasOwnProperty(t)})),this.keys.length&&(this.data.initFocusActionKey&&this.data.actions.hasOwnProperty(this.data.initFocusActionKey)?this.initFocusKey=this.data.initFocusActionKey:this.initFocusKey=this.keys[this.keys.length-1])}return t.prototype.onClose=function(t){this.dialogRef.close(this.data.actions[t].returnValue)},t}();ke.decorators=[{type:n.Component,args:[{selector:"ga-ask-dialog",template:'<h1 mat-dialog-title class="pip-header">{{ data.title | translate  }}</h1>\n<div mat-dialog-content class="pip-content">\n    <ng-container *ngIf="data?.html">\n        <p *ngFor="let text of data.content" [innerHtml]="text | translate"></p>\n    </ng-container>\n    <ng-container *ngIf="!data?.html">\n        <p *ngFor="let text of data.content">{{ text | translate }}</p>\n    </ng-container>\n</div>\n<div mat-dialog-actions align="end">\n    <ng-container *ngFor="let key of keys">\n        <button mat-button *ngIf="key !== initFocusKey" (click)="onClose(key)" [color]="data.actions[key]?.color">\n            {{ data.actions[key]?.text | translate }}\n        </button>\n        <button mat-button *ngIf="key === initFocusKey" (click)="onClose(key)" [color]="data.actions[key]?.color"\n            cdkFocusInitial>\n            {{ data.actions[key]?.text | translate }}\n        </button>\n    </ng-container>\n</div>',styles:[":host{font-family:Roboto,Helvetica Neue,sans-serif}:host [mat-dialog-actions] button{text-transform:uppercase}"]}]}],ke.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[h.MAT_DIALOG_DATA]}]},{type:h.MatDialogRef}]};var Re=function(){};Re.decorators=[{type:n.NgModule,args:[{declarations:[ke],entryComponents:[ke],exports:[ke],imports:[e.CommonModule,f.TranslateModule,v.MatButtonModule,h.MatDialogModule]}]}];var Ne=function(){};Ne.decorators=[{type:n.Component,args:[{selector:"ga-bottom-navigation",template:"<ng-content></ng-content>",styles:[":host{align-items:center;display:flex;margin:0 auto;max-width:768px;place-content:center}:host ::ng-deep button{flex:1;font-size:12px;font-weight:400;max-width:225px;padding:8px}:host ::ng-deep button .mat-button-wrapper{align-items:center;display:flex;flex-direction:column;text-transform:none}:host ::ng-deep button .mat-button-wrapper .pip-title{line-height:1.8em}"]}]}];var $e=function(){};$e.decorators=[{type:n.NgModule,args:[{declarations:[Ne],exports:[Ne],imports:[e.CommonModule]}]}];var Le,De=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.total=e,this.data=t},_e=function(){function t(t){var e=this;if(t){var n="string"==typeof t?this._stringToObject(t):t;Object.keys(n).forEach((function(t){Object.defineProperty(e,t,{enumerable:!0,value:n[t]})}))}}return t.prototype._stringToObject=function(t,e){var n,i;void 0===e&&(e=";");var r=t.split(e),o={};try{for(var a=z(r),s=a.next();!s.done;s=a.next()){var c=s.value,p=c.indexOf("=");if(!(p<=1)){var u=Y([c.slice(0,p),c.slice(p+1)],2),l=u[0],d=u[1],f=void 0;if(["true","false"].includes(d))f="true"===d;else if("null"===d)f=null;else if(d.includes(",")&&d.includes("="))f=this._stringToObject(d,",");else if(d.includes(","))f=d.split(",");else if(parseFloat(d)){f=/^[0-9A-Fa-f]+$/.test(d)&&parseFloat(d).toString(16)!==d.replace(/^[0]+/,"").toLowerCase()?d:parseFloat(d)}else f=Date.parse(d)?new Date(d):d;o[l]=f}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o},t.prototype.toString=function(t){var e,n;void 0===t&&(t=!0);var i=[],r=Object.keys(this);try{for(var o=z(r),a=o.next();!a.done;a=o.next()){var s=a.value;if(this.hasOwnProperty(s))switch(typeof this[s]){case"string":case"number":i.push(s+"="+(t?encodeURIComponent(this[s]):this[s]));break;case"boolean":i.push(s+"="+this[s].toString());break;case"object":null===this[s]?i.push(s+"=null"):this[s]instanceof Date?i.push(s+"="+this[s].toISOString()):Array.isArray(this[s])&&i.push(s+"="+this[s].join(","))}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i.join(";")},t}(),Ge=function(){},Be=function(){function t(){this.supportsPassive=this.detectPassiveSupport()}return t.prototype.addEventListener=function(t,e,n){var i=this.parseHigherOrderEventName(e);return this.setupEventBinding(t,i,n)},t.prototype.addGlobalEventListener=function(t,e,n){var i=this.parseHigherOrderElement(t),r=this.parseHigherOrderEventName(e);return this.setupEventBinding(i,r,n)},t.prototype.supports=function(t){return/^[a-z]+(?:\.(?:stop|prevent|capture|self|once|passive))+$/.test(t)},t.prototype.detectPassiveSupport=function(){var t=!1;try{var e=function(){},n={get passive(){return t=!0}};window.addEventListener("test",e,n),window.removeEventListener("test",e,n)}catch(t){}return t},t.prototype.parseHigherOrderElement=function(t){switch(t){case"window":return window;case"document":return document;case"body":return document.body;default:throw new Error("Element selector ["+t+"] not supported.")}},t.prototype.parseHigherOrderEventName=function(t){for(var e=t.split("."),n={name:e.shift(),isStop:!1,isPrevent:!1,isCapture:!1,isSelf:!1,isOnce:!1,isPassive:!1};e.length;)switch(e.shift()){case"stop":n.isStop=!0;break;case"prevent":n.isPrevent=!0;break;case"capture":n.isCapture=!0;break;case"self":n.isSelf=!0;break;case"once":n.isOnce=!0;break;case"passive":n.isPassive=!0;break;default:throw new Error("Event config ["+t+"] not supported.")}return n},t.prototype.setupEventBinding=function(t,e,n){var i=e.isCapture;return this.supportsPassive&&e.isPassive&&(i={passive:!0,capture:e.isCapture}),t.addEventListener(e.name,o,i),r;function r(){t.removeEventListener(e.name,o,i)}function o(i){e.isSelf&&i.target!==t||(e.isOnce&&r(),e.isStop&&i.stopPropagation(),e.isPrevent&&i.preventDefault(),n(i))}},t}(),qe={applications:[],activeIdx:-1,groups:[],state:"empty",activeState:"un_active",toggling:!1,error:null};(Le=t.ApplicationsActionType||(t.ApplicationsActionType={})).ApplicationsInit="[Applications] Init",Le.ApplicationsAbort="[Applications] Abort",Le.ApplicationsSuccess="[Applications] Success",Le.ApplicationsFailure="[Applications] Failure",Le.ApplicationsCreate="[Applications] Create",Le.ApplicationsCreateSuccess="[Applications] CreateSuccess",Le.ApplicationsCreateFailure="[Applications] CreateFailure",Le.ApplicationsUpdate="[Applications] Update",Le.ApplicationsUpdateSuccess="[Applications] UpdateSuccess",Le.ApplicationsUpdateFailure="[Applications] UpdateFailure",Le.ApplicationsDelete="[Applications] Delete",Le.ApplicationsDeleteSuccess="[Applications] DeleteSuccess",Le.ApplicationsDeleteFailure="[Applications] DeleteFailure",Le.ApplicationsFindActive="[Applications] FindActive",Le.ApplicationsSetActive="[Applications] SetActive";var Ve,He,Je=r.createAction(t.ApplicationsActionType.ApplicationsInit),We=r.createAction(t.ApplicationsActionType.ApplicationsAbort),Ke=r.createAction(t.ApplicationsActionType.ApplicationsSuccess,r.props()),ze=r.createAction(t.ApplicationsActionType.ApplicationsFailure,r.props()),Ye=r.createAction(t.ApplicationsActionType.ApplicationsCreate,r.props()),Qe=r.createAction(t.ApplicationsActionType.ApplicationsCreateSuccess,r.props()),Xe=r.createAction(t.ApplicationsActionType.ApplicationsCreateFailure,r.props()),Ze=r.createAction(t.ApplicationsActionType.ApplicationsUpdate,r.props()),tn=r.createAction(t.ApplicationsActionType.ApplicationsUpdateSuccess,r.props()),en=r.createAction(t.ApplicationsActionType.ApplicationsUpdateFailure,r.props()),nn=r.createAction(t.ApplicationsActionType.ApplicationsDelete,r.props()),rn=r.createAction(t.ApplicationsActionType.ApplicationsDeleteSuccess,r.props()),on=r.createAction(t.ApplicationsActionType.ApplicationsDeleteFailure,r.props()),an=r.createAction(t.ApplicationsActionType.ApplicationsFindActive,r.props()),sn=r.createAction(t.ApplicationsActionType.ApplicationsSetActive,r.props()),cn=r.createFeatureSelector("applications"),pn=r.createSelector(cn,(function(t){return t.applications})),un=r.createSelector(cn,(function(t){return t.activeIdx})),ln=r.createSelector(cn,(function(t){return t.activeIdx>=0&&t.applications&&t.activeIdx<t.applications.length?t.applications[t.activeIdx]:null})),dn=r.createSelector(cn,(function(t){return t.groups})),fn=r.createSelector(cn,(function(t){return t.state})),gn=r.createSelector(cn,(function(t){return t.toggling})),hn=r.createSelector(cn,(function(t){return t.error})),vn=r.createSelector(cn,(function(t){return t.activeState})),mn=function(t,e){var n=e.applications,i=e.groups,r=m.fromJS(t);r=(r=(r=r.set("error",null)).set("applications",n)).set("groups",i);var o=(null==n?void 0:n.length)>0?"data":"empty";return r=r.set("state",o),"empty"===o&&(r=r.set("activeState","not_found")),r.toJS()},yn=function(t,e){var n=e.error,i=m.fromJS(t);return(i=(i=i.set("state","error")).set("error",n)).toJS()},Sn=function(t,e){var n=e.application,i=m.fromJS(t),r=i.get("applications").toJS();return r.push(n),(i=(i=i.set("applications",r)).set("state","data")).toJS()},bn=function(t,e){var n=e.error,i=m.fromJS(t);return(i=i.set("error",n)).toJS()},An=function(t,e){var n=e.id,i=e.application,r=m.fromJS(t),o=r.get("applications").toJS(),a=o.findIndex((function(t){return t.id===n}));return a>=0&&o.splice(a,1),o.push(i),(r=(r=r.set("applications",o)).set("state","data")).toJS()},wn=function(t,e){var n=e.error,i=m.fromJS(t);return(i=i.set("error",n)).toJS()},On=function(t,e){var n=e.id,i=m.fromJS(t),r=i.get("applications").toJS(),o=r.findIndex((function(t){return t.id===n}));return o>=0&&r.splice(o,1),(i=(i=i.set("applications",r)).set("state","data")).toJS()},In=function(t,e){var n=e.error,i=m.fromJS(t);return(i=i.set("error",n)).toJS()},xn=function(t,e){var n=e.id,i=m.fromJS(t),r=n?t.applications.findIndex((function(t){return t.id===n})):-1;return(i=(i=i.set("activeIdx",r)).set("activeState",-1!==r?"active":"not_found")).toJS()},Cn=r.createReducer(qe,r.on(Je,(function(t){var e=m.fromJS(t);return(e=(e=e.set("activeState","progress")).set("error",null)).toJS()})),r.on(We,(function(t){var e=m.fromJS(t);switch(e=e.set("state",t.error?"error":t.applications&&t.applications.length?"data":"empty"),t.state){case"data":e=e.set("activeState",-1!==t.activeIdx?"active":"not_found");break;case"empty":e=e.set("activeState","not_found");break;case"error":e=e.set("activeState","error")}return e.toJS()})),r.on(Ke,mn),r.on(ze,yn),r.on(Qe,Sn),r.on(Xe,bn),r.on(tn,An),r.on(en,wn),r.on(rn,On),r.on(on,In),r.on(sn,xn));function jn(t,e){return Cn(t,e)}var Pn=function(){function t(){Ve.set(this,new Me),He.set(this,"favorites")}return Object.defineProperty(t.prototype,"config",{get:function(){return X(this,Ve)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"favoritesGroupName",{get:function(){return X(this,He)},enumerable:!1,configurable:!0}),t.prototype.addConfig=function(t){var e,n;X(this,Ve).productName=null!==(e=null==t?void 0:t.productName)&&void 0!==e?e:X(this,Ve).productName,X(this,Ve).defaultFavoritesIds=null!==(n=null==t?void 0:t.defaultFavoritesIds)&&void 0!==n?n:X(this,Ve).defaultFavoritesIds},t}();Ve=new WeakMap,He=new WeakMap,Pn.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new Pn},token:Pn,providedIn:"root"}),Pn.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}];var Mn=function(){function e(t,e,n,i,r,o){this.applicationsConfig=t,this.router=e,this.store=n,this.accountsService=i,this.translate=r,this.window=o}return Object.defineProperty(e.prototype,"applications$",{get:function(){return s.combineLatest([this.store.select(pn).pipe(a.distinctUntilChanged((function(t,e){return JSON.stringify(t)===JSON.stringify(e)}))),this.accountsService.preferenceByKey$("favorites")]).pipe(a.map((function(t){var e=Y(t,2),n=e[0],i=e[1];return n.map((function(t){return Object.assign(Object.assign({},t),{isFavorite:i&&i.includes(t.id)})}))})))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeApplicationIdx$",{get:function(){return this.store.select(un)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeApplicationState$",{get:function(){return this.store.select(vn)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeApplication$",{get:function(){return this.store.select(ln)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groups$",{get:function(){return s.combineLatest([this.store.select(dn).pipe(a.distinctUntilChanged((function(t,e){return JSON.stringify(t)===JSON.stringify(e)}))),this.applications$]).pipe(a.map((function(t){var e,n,i,r,o,a,s=Y(t,2),c=s[0],p=s[1],u={};try{for(var l=z(Object.entries(c)),d=l.next();!d.done;d=l.next()){var f=Y(d.value,2),g=f[0];u[f[1].id]=g,c[g].applications=[]}}catch(t){e={error:t}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}var h=Object.keys(u);try{for(var v=z(p),m=v.next();!m.done;m=v.next()){var y=m.value;if(y.group&&h.includes(y.group))c[u[y.group]].applications.push(y)}}catch(t){i={error:t}}finally{try{m&&!m.done&&(r=v.return)&&r.call(v)}finally{if(i)throw i.error}}c=q.default(c,["id"]);try{for(var S=z(c),b=S.next();!b.done;b=S.next()){var A=b.value;A.applications=q.default(A.applications,["id"])}}catch(t){o={error:t}}finally{try{b&&!b.done&&(a=S.return)&&a.call(S)}finally{if(o)throw o.error}}return c})))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"favorites$",{get:function(){var t=this;return s.combineLatest([this.applications$,this.accountsService.preferenceByKey$("favorites")]).pipe(a.map((function(e){var n=Y(e,2),i=n[0],r=n[1];return null!=r||(r=[]),r.length||r.push.apply(r,Q(t.applicationsConfig.config.defaultFavoritesIds)),i.filter((function(t){return r.includes(t.id)})).sort((function(t,e){var n=r.indexOf(t.id),i=r.indexOf(e.id);return n<i?-1:n>i?1:0}))})))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"favoritesGroup$",{get:function(){var t=this;return this.favorites$.pipe(a.map((function(e){return{id:t.applicationsConfig.favoritesGroupName,display_name:new Proxy({},{get:function(e,n){return t.translate.instant(t.applicationsConfig.favoritesGroupName)}}),applications:e,icon:"star_rate",iconView:{fontIcon:"star_rate"},params:{useComponentName:!0}}})))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state$",{get:function(){return this.store.select(fn)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toggling$",{get:function(){return this.store.select(gn)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"error$",{get:function(){return this.store.select(hn)},enumerable:!1,configurable:!0}),e.prototype.findByid=function(t,e){var n;return this.applications$.pipe(a.take(1)).subscribe((function(i){i&&i.length&&(n=i.find((function(n){return e?n.id===t:!!n.id.match(t)}))||null)})),n},e.prototype.findByName=function(t,e){var n;return this.applications$.pipe(a.take(1)).subscribe((function(i){i&&i.length&&(n=i.find((function(n){return Object.keys(n.name).some((function(i){return e?n.name[i]===t:-1!==n.name[i].indexOf(t)}))}))||null)})),n},e.prototype.toggleFavorite=function(t,e){var n=this;this.accountsService.preferenceByKey$("favorites").pipe(a.withLatestFrom(this.applications$),a.first()).subscribe((function(i){var r=Y(i,2),o=r[0];if(r[1].find((function(e){return e.id===t.id}))){var a=void 0===e?!t.isFavorite:e,s=n.applicationsConfig.favoritesGroupName,c=o.indexOf(t.id),p=c>=0;p!==a&&(p?o.splice(c,1):o.push(t.id),n.accountsService.setPreferenceByKey(s,o))}}))},e.prototype.setActiveApplication=function(t){var e=this;this.applications$.pipe(a.first()).subscribe((function(n){e.store.dispatch(sn({id:t.id}))}))},e.prototype.create=function(t){this.store.dispatch(Ye({application:t}))},e.prototype.update=function(t,e){this.store.dispatch(Ze({id:t,application:e}))},e.prototype.delete=function(t){this.store.dispatch(nn({id:t}))},e.prototype.navigateToApplication=function(e,n){var i=this;this.applications$.pipe(a.first(),a.withLatestFrom(this.activeApplication$)).subscribe((function(r){var o=Y(r,2),a=o[0],s=o[1],c="string"==typeof e?a.find((function(t){return!!t.id.match(e)})):e,p=n||{};if(c&&c.url)if(c.url.type===t.ApplicationUrlType.Outer){var u=c.url.params&&c.url.params.target||"_self";i.window.open(c.url.link,u)}else if(c.url.type===t.ApplicationUrlType.Inner){if(p.state=p.state||c.url.state,c.url.state_params&&(p.state_params=Object.assign({},c.url.state_params,p.state_params)),s&&(s.id===c.id||s.url.link===c.url.link))return i.setActiveApplication(c),void(p&&p.state?i.router.navigate([p.state],p.state_params):i.router.navigateByUrl("/"));var l="/"+(c.url.link.startsWith("/")?c.url.link.slice(1):c.url.link);i.window.sessionStorage.setItem("appChangeParams",JSON.stringify(p)),i.window.sessionStorage.setItem("activeApplicationId",c.id),i.window.location.href=window.location.origin+l}}))},e}();Mn.decorators=[{type:n.Injectable}],Mn.ctorParameters=function(){return[{type:Pn},{type:l.Router},{type:r.Store},{type:_t},{type:f.TranslateService},{type:Vt,decorators:[{type:n.Inject,args:[Gt]}]}]};var Tn=function(){function t(t,e,n){this.router=t,this.applicationsService=e,this.sessionService=n}return t.prototype.resolve=function(){return this.waitApplicationToLoad()},t.prototype.waitApplicationToLoad=function(){var t=this;return s.combineLatest([this.applicationsService.applications$,this.applicationsService.activeApplication$,this.applicationsService.activeApplicationState$,this.sessionService.sessionUser$]).pipe(a.map((function(t){var e=Y(t,4);return{applications:e[0],activeApplication:e[1],appState:e[2],sessionUser:e[3]}})),a.filter((function(e,n){var i,r;return"not_found"===e.appState||"error"===e.appState?(t.router.navigateByUrl("/404"),!1):null!==(r=null===(i=null==e?void 0:e.sessionUser)||void 0===i?void 0:i.id)&&void 0!==r&&r&&e.applications.length>0&&!!e.activeApplication})),a.map((function(t){return!!t})),a.first())},t}();Tn.decorators=[{type:n.Injectable}],Tn.ctorParameters=function(){return[{type:l.Router},{type:Mn},{type:be}]};var Un=function(){function t(t,e,n){this.applicationsConfig=t,this.sessionConfig=e,this.http=n,this.RESOURCE="/api/v1/admin/apps",this.RESOURSE_GROUPS="/api/v1/admin/apps_groups"}return t.prototype._updateIcons=function(t){var e,n;try{for(var i=z(t),r=i.next();!r.done;r=i.next()){var o=r.value;o.icon&&"string"==typeof o.icon&&(o.iconView=JSON.parse(o.icon))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return t},t.prototype.readApplicationsGroups=function(){var t=this,e=this.sessionConfig.serverUrl+this.RESOURSE_GROUPS;return this.http.get(e).pipe(a.map((function(t){return t.data})),a.map((function(e){return t._updateIcons(e)})))},t.prototype.readApplications=function(t){var e,n,i=this,r=this.sessionConfig.serverUrl+this.RESOURCE,s=new o.HttpParams({fromObject:{product:this.applicationsConfig.config.productName}});if(t)try{for(var c=z(Object.keys(t)),p=c.next();!p.done;p=c.next()){var u=p.value;s=s.set(u,t[u].toString())}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return this.http.get(r,{params:s}).pipe(a.map((function(t){return t.data})),a.map((function(t){return i._updateIcons(t)})))},t.prototype.updateApplication=function(t,e){var n=this.sessionConfig.serverUrl+this.RESOURCE+"/"+t,i=new o.HttpParams;return i=i.set("product",this.applicationsConfig.config.productName),this.http.put(n,e,{params:i})},t.prototype.createApplication=function(t){var e=this.sessionConfig.serverUrl+this.RESOURCE,n=new o.HttpParams;return n=n.set("product",this.applicationsConfig.config.productName),this.http.post(e,t,{params:n})},t.prototype.deleteApplication=function(t){var e="string"==typeof t?t:t.id,n=this.sessionConfig.serverUrl+this.RESOURCE+"/"+e,i=new o.HttpParams;return i=i.set("product",this.applicationsConfig.config.productName),this.http.delete(n,{params:i}).pipe(a.map((function(){return e})))},t}();Un.decorators=[{type:n.Injectable}],Un.ctorParameters=function(){return[{type:Pn},{type:ct},{type:o.HttpClient}]};var En=function(){function e(e,n,r,o,c){var p=this;this.actions$=e,this.applicationsDataService=n,this.route=r,this.sessionService=o,this.window=c,this.getBaseRegex=new RegExp(/\/?(\w+)\/?.*/),this.applications$=i.createEffect((function(){return s.merge.apply(void 0,Q([p.actions$.pipe(i.ofType(Je,We)),p.sessionService.sessionUser$.pipe(a.filter((function(t){return!!t})))])).pipe(a.switchMap((function(t){return t.hasOwnProperty("type")&&t.type===We.type?s.EMPTY:s.forkJoin([p.applicationsDataService.readApplicationsGroups(),p.applicationsDataService.readApplications({take:500})]).pipe(a.map((function(t){var e,n,i=Y(t,2),r=i[0],o=i[1];try{for(var a=z(o),s=a.next();!s.done;s=a.next()){var c=s.value;c.isHidden=c.params&&c.params.hidden}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return Ke({applications:o,groups:r})})),a.catchError((function(t){return s.of(ze({error:t}))})))})))})),this.applicationsSuccess$=i.createEffect((function(){return p.actions$.pipe(i.ofType(Ke),a.map((function(t){var e=t.applications;return an({applications:e})})))})),this.applicationsCreate$=i.createEffect((function(){return p.actions$.pipe(i.ofType(Ye),a.switchMap((function(t){var e=t.application;return p.applicationsDataService.createApplication(e).pipe(a.map((function(t){return Qe({application:t})})),a.catchError((function(t){return s.of(Xe({error:t}))})))})))})),this.applicationsUpdate$=i.createEffect((function(){return p.actions$.pipe(i.ofType(Ze),a.switchMap((function(t){var e=t.id,n=t.application;return p.applicationsDataService.updateApplication(e,n).pipe(a.map((function(t){return tn({id:t.id,application:t})})),a.catchError((function(t){return s.of(en({error:t}))})))})))})),this.applicationsDelete$=i.createEffect((function(){return p.actions$.pipe(i.ofType(nn),a.switchMap((function(t){var e=t.id;return p.applicationsDataService.deleteApplication(e).pipe(a.map((function(){return rn({id:e})})),a.catchError((function(t){return s.of(on({error:t}))})))})))})),this.applicationsFindActive$=i.createEffect((function(){return p.actions$.pipe(i.ofType(an),a.map((function(e){var n=e.applications,i=e.force,r=p.getBase(p.window.location.pathname);return[n.filter((function(e){return e.url&&e.url.type===t.ApplicationUrlType.Inner&&p.getBase(e.url.link)===r})),i,r]})),a.switchMap((function(t){var e,n,i=Y(t,3),r=i[0],o=i[1],a=i[2],c=p.window.sessionStorage.getItem("activeApplicationId");if(c&&!o&&((d=r.find((function(t){return t.id===c})))&&p.isAppActive(d,a,1)))return s.of(sn({id:d.id}));try{for(var u=z(r),l=u.next();!l.done;l=u.next()){var d=l.value;if(p.isAppActive(d,a,r.length))return s.of(sn({id:d.id}))}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return s.of(sn({id:null}))})))}))}return e.prototype.getBase=function(t){var e=t.match(this.getBaseRegex);return e&&e.length>1?e[1]:""},e.prototype.isAppActive=function(e,n,i){var r,o;if(!e.url||e.url.type!==t.ApplicationUrlType.Inner)return!1;if(this.getBase(e.url.link)===n){if(1===i)return!0;if(void 0===e.url.state)return!1;var a=this.route.snapshot.queryParamMap;if(a.keys.length>0&&e.url.state_params)try{for(var s=z(Object.keys(e.url.state_params)),c=s.next();!c.done;c=s.next()){var p=c.value;if(e.url.state_params[p]!==a.get(p))return!1}}catch(t){r={error:t}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return!0}return!1},e}();En.decorators=[{type:n.Injectable}],En.ctorParameters=function(){return[{type:i.Actions},{type:Un},{type:l.ActivatedRoute},{type:be},{type:Vt,decorators:[{type:n.Inject,args:[Gt]}]}]};var Fn=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[Tn]}},t}();Fn.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,r.StoreModule.forFeature("applications",jn),i.EffectsModule.forFeature([En]),we],declarations:[],providers:[Un,Mn]}]}];var kn=function(){function t(t,e,n,i){this.window=t,this.router=e,this.sessionConfig=n,this.sessionService=i}return t.prototype.canActivate=function(t,e){var n=this;return!this.sessionConfig.enabled||this.sessionService.state$.pipe(a.filter((function(t){return"progress"!==t})),a.switchMap((function(){return n.sessionService.sessionUser$})),a.take(1),a.map((function(t){return!(!t||!t.id)})))},t}();kn.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new kn(n.ɵɵinject(Gt),n.ɵɵinject(l.Router),n.ɵɵinject(ct),n.ɵɵinject(be))},token:kn,providedIn:"root"}),kn.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],kn.ctorParameters=function(){return[{type:Vt,decorators:[{type:n.Inject,args:[Gt]}]},{type:l.Router},{type:ct},{type:be}]};var Rn=function(){function t(t,e,n){this.sessionConfig=t,this.sessionService=e,this.window=n}return t.prototype.intercept=function(t,e){var n=this;return this.sessionConfig.enabled&&t.url.startsWith(this.sessionConfig.serverUrl)?this.sessionService.sessionUser$.pipe(a.take(1),a.map((function(e){var n=e?e.id:null,i=t.headers;return i.has("content-type")||t.body&&t.body.constructor&&"FormData"===t.body.constructor.name||(i=t.headers.set("content-type","application/json")),n&&!t.headers.get("x-session-id")&&(i=t.headers.set("x-session-id",n)),t.clone({headers:i})})),a.switchMap((function(t){return e.handle(t).pipe(a.catchError((function(t){return t&&401===t.status?(n.window.location.href=n.window.location.origin+n.sessionConfig.unautorizedUrl+"?from="+encodeURIComponent(n.window.location.href),s.of(null)):s.throwError(t)})))}))):e.handle(t)},t}();Rn.decorators=[{type:n.Injectable}],Rn.ctorParameters=function(){return[{type:ct},{type:be},{type:Vt,decorators:[{type:n.Inject,args:[Gt]}]}]};var Nn={provide:o.HTTP_INTERCEPTORS,useClass:Rn,multi:!0},$n=function(){function t(t,e){void 0===e&&(e=[]),e&&e.forEach((function(e){return t.addConfig(e)}))}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:nt,useValue:it,multi:!0},{provide:nt,useValue:e,multi:!0},kn,be,ct,zt,Nn]}},t}();$n.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,r.StoreModule.forFeature("auth",ye),i.EffectsModule.forFeature([Se])]}]}],$n.ctorParameters=function(){return[{type:ct},{type:Array,decorators:[{type:n.Optional},{type:n.Inject,args:[nt]}]}]};var Ln=function(){function e(e,n,i,r){var o=this;this.applicationsService=e,this.navService=n,this.sessionService=i,this.translate=r,this.defaultFixedApplications={home:{id:"pg-home",name:{en:"Home",ru:"Главная"},description:{en:"Home application",ru:"Главная страница"},product:"Guru Admin",group:null,url:{type:t.ApplicationUrlType.Inner,link:"/home/index.html#"},icon:'{"fontIcon": "home"}',iconView:{fontIcon:"home"},params:{basic:!0}}},this.fixedPrependApplicationsKeys=["home"],this.fixedAppendApplicationsKeys=[],this.trackById=dt("id"),this.subs=this.applicationsService.activeApplication$.subscribe((function(t){o.activeApplicationId=t&&t.id,o.activeGroupId=t&&t.group})),this.subs=this.translate.onLangChange.asObservable().pipe(a.startWith({lang:this.translate.currentLang})).subscribe((function(t){return o.language=t.lang})),this.fixedPrependApplications$=this.applicationsService.applications$.pipe(a.map(this.fixedApplicationsFn(this.fixedPrependApplicationsKeys))),this.fixedAppendApplications$=this.applicationsService.applications$.pipe(a.map(this.fixedApplicationsFn(this.fixedAppendApplicationsKeys))),this.favorites$=this.applicationsService.favorites$,this.groups$=this.applicationsService.groups$.pipe(a.map((function(t){return t.filter((function(t){return t.applications&&t.applications.length}))}))),this.ctx$=s.combineLatest([this.fixedPrependApplications$,this.fixedAppendApplications$,this.favorites$,this.groups$]).pipe(a.map((function(t){var e=Y(t,4);return{fixedPrependApplications:e[0],fixedAppendApplications:e[1],favorites:e[2],groups:e[3]}})))}return e.prototype.ngOnDestroy=function(){},e.prototype.ngOnChanges=function(t){var e=this;t.hasOwnProperty("header")&&setTimeout((function(){e.changeHeaders()}),0)},e.prototype.fixedApplicationsFn=function(t){var e=this;return function(n){var i,r,o=[],a=function(t){if(n&&n.length){var i=n.find((function(e){return!!e.id.match(t)}));if(i)return o.push(i),"continue"}e.defaultFixedApplications.hasOwnProperty(t)&&o.push(e.defaultFixedApplications[t])};try{for(var s=z(t),c=s.next();!c.done;c=s.next()){a(c.value)}}catch(t){i={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}},e.prototype.changeHeaders=function(){this.header&&this.navService.showNavHeader(V.default(this.header))},e.prototype.onClick=function(t){t.hasOwnProperty("click")?t.click():this.applicationsService.navigateToApplication(t)},e.prototype.signout=function(){this.sessionService.signout()},e}();Ln.decorators=[{type:n.Component,args:[{selector:"ga-sidenav",template:'<pip-nav-header></pip-nav-header>\n<pip-scrollable>\n    <pip-scrollable-content class="pip-nav-menu w-stretch" *ngIf="ctx$ | async as ctx">\n        <div fxFlex="grow" fxLayout="column" class="w-stretch">\n            <mat-nav-list dense class="w-stretch">\n                <ng-container *ngFor="let item of ctx.fixedPrependApplications; trackBy: trackById">\n                    <ng-container [ngTemplateOutlet]="menuItem"\n                        [ngTemplateOutletContext]="{item: item, activeApplicationId: activeApplicationId, language: language, click: onClick.bind(this)}">\n                    </ng-container>\n                </ng-container>\n                <mat-divider></mat-divider>\n                <ng-container *ngFor="let item of ctx.favorites; trackBy: trackById">\n                    <ng-container [ngTemplateOutlet]="menuItem"\n                        [ngTemplateOutletContext]="{item: item, activeApplicationId: activeApplicationId, language: language, click: onClick.bind(this)}">\n                    </ng-container>\n                </ng-container>\n                <mat-divider></mat-divider>\n                <mat-accordion displayMode="flat">\n                    <mat-expansion-panel class="w-stretch" *ngFor="let group of ctx.groups; trackBy: trackById"\n                        [ngClass]="{selected: activeGroupId && activeGroupId === group.id}">\n                        <mat-expansion-panel-header expandedHeight="48px">\n                            <mat-panel-title>\n                                <div fxLayout="row" fxLayoutAlign="start center" class="w-stretch">\n                                    <mat-icon matPrefix\n                                        *ngIf="group?.iconView?.fontIcon && !group?.iconView?.fontSet && !group?.iconView?.svgIcon">\n                                        {{ group?.iconView?.fontIcon || \'list\' }}\n                                    </mat-icon>\n                                    <mat-icon matPrefix\n                                        *ngIf="group?.iconView?.fontIcon && group?.iconView?.fontSet && !group?.iconView?.svgIcon"\n                                        [fontSet]="group?.iconView?.fontSet" [fontIcon]="group?.iconView?.fontIcon">\n                                    </mat-icon>\n                                    <mat-icon matPrefix *ngIf="group?.iconView?.svgIcon"\n                                        [svgIcon]="group?.iconView?.svgIcon">\n                                    </mat-icon>\n                                    <h3 mat-line class="pip-link-title">{{ group.display_name[language] }}</h3>\n                                </div>\n                            </mat-panel-title>\n                        </mat-expansion-panel-header>\n                        <ng-template matExpansionPanelContent>\n                            <ng-container *ngFor="let item of group.applications; trackBy: trackById"\n                                [ngTemplateOutlet]="menuItem"\n                                [ngTemplateOutletContext]="{item: item, activeApplicationId: activeApplicationId, language: language, click: onClick.bind(this), hideIcon: group?.iconView?.fontIcon || group?.iconView?.svgIcon}">\n                            </ng-container>\n                        </ng-template>\n                    </mat-expansion-panel>\n                </mat-accordion>\n                <mat-divider></mat-divider>\n                <ng-container *ngFor="let item of ctx.fixedAppendApplications; trackBy: trackById"\n                    [ngTemplateOutlet]="menuItem"\n                    [ngTemplateOutletContext]="{item: item, activeApplicationId: activeApplicationId, language: language, click: onClick.bind(this)}">\n                </ng-container>\n                <mat-list-item (click)="signout()" class="w-stretch">\n                    <div fxLayout="row" fxLayoutAlign="start center" class="w-stretch">\n                        <mat-icon matPrefix>exit_to_app</mat-icon>\n                        <h3 mat-line class="pip-link-title"\n                            [matTooltip]="\'FEATURES.SHELL.COMPONENT.SIDENAV.SIGNOUT\' | translate"\n                            matTooltipPosition="after">\n                            {{ \'FEATURES.SHELL.COMPONENT.SIDENAV.SIGNOUT\' | translate }}</h3>\n                    </div>\n                </mat-list-item>\n            </mat-nav-list>\n        </div>\n    </pip-scrollable-content>\n</pip-scrollable>\n\n<ng-template #menuItem let-item="item" let-aid="activeApplicationId" let-language="language" let-click="click"\n    let-hideIcon="hideIcon">\n    <mat-list-item (click)="click(item)" class="w-stretch"\n        [ngClass]="{selected: aid && aid === item.id, \'mat-no-icon\': hideIcon}">\n        <div fxLayout="row" fxLayoutAlign="start center" class="w-stretch"\n            [matBadge]="item.count > 99 ? \'!\' : item.count" [matBadgeColor]="item.color || \'warn\'"\n            [matBadgeHidden]="!item.count" matBadgeOverlap="false">\n            <mat-icon matPrefix\n                *ngIf="!hideIcon && item?.iconView?.fontIcon && !item?.iconView?.fontSet && !item?.iconView?.svgIcon">\n                {{ item?.iconView?.fontIcon || \'list\' }}\n            </mat-icon>\n            <mat-icon matPrefix\n                *ngIf="!hideIcon && item?.iconView?.fontIcon && item?.iconView?.fontSet && !item?.iconView?.svgIcon"\n                [fontSet]="item?.iconView?.fontSet" [fontIcon]="item?.iconView?.fontIcon">\n            </mat-icon>\n            <mat-icon matPrefix *ngIf="!hideIcon && item?.iconView?.svgIcon" [svgIcon]="item?.iconView?.svgIcon">\n            </mat-icon>\n            <h3 mat-line class="pip-link-title" [matTooltip]="item?.name && item?.name[language] || \'\'"\n                matTooltipPosition="after">\n                {{ item?.name && item?.name[language] || \'\' }}</h3>\n        </div>\n    </mat-list-item>\n</ng-template>',changeDetection:n.ChangeDetectionStrategy.OnPush,styles:["pip-scrollable{overflow:hidden}.w-stretch{max-width:100%;text-overflow:ellipsis}:host pip-nav-header ::ng-deep .mat-toolbar .pip-nav-content-wrapper{box-sizing:border-box;margin:0!important;max-width:100%;padding:16px 0 16px 12px}:host mat-list-item{height:48px!important}:host mat-list-item.mat-no-icon ::ng-deep h3{padding-left:48px}:host mat-list-item ::ng-deep .mat-list-item-content mat-icon[matprefix],:host mat-list-item ::ng-deep .mat-list-item-content mat-icon[matsuffix]{margin-right:24px}:host mat-list-item ::ng-deep .mat-list-item-content .pip-link-title{font-size:14px!important;font-style:normal!important;font-weight:500!important;overflow:hidden}mat-accordion mat-expansion-panel{border-radius:0}mat-accordion mat-expansion-panel,mat-accordion mat-expansion-panel h3{font-size:14px!important;font-style:normal!important;font-weight:500!important}mat-accordion mat-expansion-panel mat-expansion-panel-header mat-panel-title mat-icon[matprefix],mat-accordion mat-expansion-panel mat-expansion-panel-header mat-panel-title mat-icon[matsuffix]{margin-right:24px}mat-accordion mat-expansion-panel ::ng-deep .mat-expansion-panel-body{padding:0}"]}]}],Ln.ctorParameters=function(){return[{type:Mn},{type:C.PipNavService},{type:be},{type:f.TranslateService}]},Ln.propDecorators={header:[{type:n.Input}]},K([ft()],Ln.prototype,"subs",void 0);var Dn=function(){};Dn.decorators=[{type:n.NgModule,args:[{declarations:[Ln],exports:[Ln],imports:[e.CommonModule,f.TranslateModule,y.FlexLayoutModule,S.MatBadgeModule,b.MatDividerModule,A.MatExpansionModule,O.MatListModule,w.MatIconModule,I.MatTooltipModule,C.PipNavModule,C.PipNavHeaderModule,x.PipScrollableModule],schemas:[n.CUSTOM_ELEMENTS_SCHEMA]}]}];var _n=[Dn],Gn=function(){};Gn.decorators=[{type:n.NgModule,args:[{imports:Q([e.CommonModule],_n),exports:_n}]}];var Bn,qn,Vn,Hn=function(t){var e,n,i,r,o,a,s,c,p,u,l,d=null!==(e=navigator&&(navigator.language||navigator.userLanguage))&&void 0!==e?e:"en";this.application={languages:null!==(i=null===(n=null==t?void 0:t.application)||void 0===n?void 0:n.languages)&&void 0!==i?i:[d]},this.application.defaultLanguage=null!==(o=null===(r=null==t?void 0:t.application)||void 0===r?void 0:r.defaultLanguage)&&void 0!==o?o:d,this.content={languages:null!==(s=null===(a=null==t?void 0:t.content)||void 0===a?void 0:a.languages)&&void 0!==s?s:[d],requiredLanguages:null!==(p=null===(c=null==t?void 0:t.content)||void 0===c?void 0:c.requiredLanguages)&&void 0!==p?p:[]},this.content.defaultLanguage=null!==(l=null===(u=null==t?void 0:t.content)||void 0===u?void 0:u.defaultLanguage)&&void 0!==l?l:this.content.languages.includes(d)?d:"en"},Jn=new Hn({application:{languages:["en","ru"]}}),Wn=function(t){var e;this.shadows=null!==(e=null==t?void 0:t.shadows)&&void 0!==e?e:{}},Kn=new Wn({shadows:{left:!0,top:!0,right:!0}}),zn=function(){function t(t,e,n){this.applicationsConfigService=t,this.sessionConfigService=e,this.storage=n,Bn.set(this,new s.Subject),qn.set(this,new Hn),Vn.set(this,new Wn)}return Object.defineProperty(t.prototype,"applications",{get:function(){return this.applicationsConfigService.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"i18n",{get:function(){return X(this,qn)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session",{get:function(){return this.sessionConfigService.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shell",{get:function(){return X(this,Vn)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return Object.assign({i18n:X(this,qn),session:this.sessionConfigService.config,shell:X(this,Vn)},H.default(this,["#i18nConfig","#shellConfig"]))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config$",{get:function(){var t=this;return X(this,Bn).pipe(a.startWith(null),a.map((function(){return t.config})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){var t;return this.storage.get("language").subscribe((function(e){return t=e})),null!=t?t:this.i18n.application.defaultLanguage},enumerable:!1,configurable:!0}),t.prototype.addShellConfig=function(t){var e,n,i,r,o,a,s,c,p;X(this,Vn).shadows.left=null!==(o=null===(r=null==t?void 0:t.shadows)||void 0===r?void 0:r.left)&&void 0!==o?o:X(this,Vn).shadows.left,X(this,Vn).shadows.top=null!==(s=null===(a=null==t?void 0:t.shadows)||void 0===a?void 0:a.left)&&void 0!==s?s:X(this,Vn).shadows.top,X(this,Vn).shadows.right=null!==(p=null===(c=null==t?void 0:t.shadows)||void 0===c?void 0:c.left)&&void 0!==p?p:X(this,Vn).shadows.right;var u=H.default(t,["i18n","session","shell"]);try{for(var l=z(Object.keys(u)),d=l.next();!d.done;d=l.next()){var f=d.value;u.hasOwnProperty(f)&&(this.hasOwnProperty(f)?Array.isArray(this[f])?(i=this[f]).push.apply(i,Q(u[f])):"object"==typeof u[f]?this[f]=Object.assign(Object.assign({},this[f]),u[f]):this[f]=u[f]:Object.defineProperty(this,f,{value:u[f]}))}}catch(t){e={error:t}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}},t.prototype.addConfig=function(t){var e;this.applicationsConfigService.addConfig(null==t?void 0:t.applications),function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");e.set(t,n)}(this,qn,B.default(null!==(e=null==t?void 0:t.i18n)&&void 0!==e?e:{},X(this,qn))),this.sessionConfigService.addConfig(null==t?void 0:t.session),this.addShellConfig(null==t?void 0:t.shell),X(this,Bn).next()},t}();Bn=new WeakMap,qn=new WeakMap,Vn=new WeakMap,zn.decorators=[{type:n.Injectable}],zn.ctorParameters=function(){return[{type:Pn},{type:ct},{type:d.StorageMap}]};var Yn=function(){function t(t,e,n,i,r,o,c){var p=this;i.showNavIcon({fontIcon:"menu",action:function(){o.start.toggle()}}),r.restore(),this.config$=e.config$.pipe(a.map((function(t){return t.shell}))),this.header$=new s.BehaviorSubject({title:"Guru Admin",subtitle:"Unknow User",picture:"./assets/images/user.svg"}),this.isAuthenticated$=r.isAuthenticated$,this.ctx$=s.combineLatest([this.config$,this.isAuthenticated$]).pipe(a.map((function(t){var e=Y(t,2);return{config:e[0],isAuthenticated:e[1]}}))),this.subs=t.account$.pipe(a.distinct()).subscribe((function(t){if(t){var n=p.header$.getValue();p.header$.next({title:n.title,subtitle:t.name||n.subtitle,picture:e.session.serverUrl+"/api/v1/users/"+t.id+"/avatars"})}})),c&&(this.subs=c.available.subscribe((function(t){n.open(ke,{data:{title:"FEATURES.SHELL.CONTAINER.UPDATES.TITLE",content:["FEATURES.SHELL.CONTAINER.UPDATES.CONTENT_1","FEATURES.SHELL.CONTAINER.UPDATES.CONTENT_2"],actions:{no:{returnValue:!1,text:"COMMON.NO"},yes:{returnValue:!0,text:"COMMON.YES"}}}}).afterClosed().subscribe((function(t){t&&c.activateUpdate().then((function(){return document.location.reload()}))}))}))),i.showSecondaryActions({actions:[{name:"global.signout",title:"FEATURES.SHELL.LAYOUT.APPBAR.SIGNOUT",click:function(){r.signout()}}]})}return t.prototype.ngOnDestroy=function(){},t}();Yn.decorators=[{type:n.Component,args:[{selector:"app-root",template:'<pip-root-layout *ngIf="ctx$ | async as ctx">\n  <pip-sidenav-start fxLayout="column">\n    <ga-sidenav [header]="header$ | async" fxLayout="column" fxFlex="grow"></ga-sidenav>\n  </pip-sidenav-start>\n  <pip-sidenav-end fxLayout="column">\n    Rightnav<br />WIP\n  </pip-sidenav-end>\n  <pip-root-header>\n    <pip-appbar>\n      <pip-nav-icon> </pip-nav-icon>\n      <pip-breadcrumb> </pip-breadcrumb>\n      <div fxFlex></div>\n      <pip-primary-actions></pip-primary-actions>\n      <pip-secondary-actions></pip-secondary-actions>\n    </pip-appbar>\n  </pip-root-header>\n  <ng-container>\n    <pip-shadow [visible]="ctx.config?.shadows?.left" attachmentSide="left"></pip-shadow>\n    <pip-shadow [visible]="ctx.config?.shadows?.top" attachmentSide="top"></pip-shadow>\n    <pip-shadow [visible]="ctx.config?.shadows?.right" attachmentSide="right"></pip-shadow>\n    <router-outlet></router-outlet>\n  </ng-container>\n</pip-root-layout>',styles:[""]}]}],Yn.ctorParameters=function(){return[{type:_t},{type:zn},{type:h.MatDialog},{type:C.PipNavService},{type:be},{type:x.PipSidenavService},{type:P.SwUpdate,decorators:[{type:n.Optional}]}]},K([ft()],Yn.prototype,"subs",void 0);var Qn=function(){};Qn.decorators=[{type:n.NgModule,args:[{declarations:[Yn],exports:[Yn],imports:[e.CommonModule,y.FlexLayoutModule,T.MatAutocompleteModule,v.MatButtonModule,U.MatButtonToggleModule,E.MatChipsModule,h.MatDialogModule,F.MatFormFieldModule,w.MatIconModule,k.MatInputModule,R.MatMenuModule,N.MatProgressBarModule,$.MatSelectModule,L.MatSnackBarModule,p.ReactiveFormsModule,l.RouterModule,f.TranslateModule,x.PipAppbarModule,C.PipBreadcrumbModule,C.PipNavIconModule,C.PipNavModule,C.PipNavHeaderModule,C.PipNavMenuModule,C.PipPrimaryActionsModule,x.PipRootLayoutModule,x.PipShadowModule,C.PipSecondaryActionsModule,Dn],schemas:[n.CUSTOM_ELEMENTS_SCHEMA]}]}];var Xn=[Qn],Zn=function(){};Zn.decorators=[{type:n.NgModule,args:[{imports:[Xn],exports:[Xn]}]}];var ti,ei=function(t){var e,n,i,r;this.applications=null!==(e=null==t?void 0:t.applications)&&void 0!==e?e:new Me,this.i18n=null!==(n=null==t?void 0:t.i18n)&&void 0!==n?n:new Hn,this.session=null!==(i=null==t?void 0:t.session)&&void 0!==i?i:new et,this.shell=null!==(r=null==t?void 0:t.shell)&&void 0!==r?r:new Wn},ni=new n.InjectionToken("GA config"),ii=new n.InjectionToken('GA config from file. Can\'t be "multi"'),ri=new ei({applications:Te,i18n:Jn,session:it,shell:Kn}),oi=function(){};(ti=t.SidenavMenuMode||(t.SidenavMenuMode={})).Favorites="favorites",ti.All="all";var ai=function(t,e){if(e){var n=t.isStable.pipe(a.first((function(t){return!0===t}))),i=s.interval(216e5);s.concat(n,i).subscribe((function(){return e.checkForUpdate()}))}};ai.decorators=[{type:n.Injectable}],ai.ctorParameters=function(){return[{type:n.ApplicationRef},{type:P.SwUpdate,decorators:[{type:n.Optional}]}]};var si=function(){function t(t,e,n){var i=this;this.storage=e,this.translate=n,this.modules=[],this.httpClient=new o.HttpClient(t),this.translate.onLangChange.subscribe((function(){i.storage.set("language",i.translate.currentLang).subscribe(),i.modules.forEach((function(t){i.getTranslations("assets/i18n/"+t+"/"+i.translate.currentLang+".json")}))}))}return t.prototype.getTranslations=function(t){var e=this;this.httpClient.get(t).subscribe((function(t){e.translate.setTranslation(e.translate.currentLang,t,!0)}))},t.prototype.registerModule=function(t){this.modules.includes(t)||(this.modules.push(t),this.getTranslations("assets/i18n/"+t+"/"+this.translate.currentLang+".json"))},t}();si.decorators=[{type:n.Injectable}],si.ctorParameters=function(){return[{type:o.HttpBackend},{type:d.StorageMap},{type:f.TranslateService}]};var ci=function(){this.back=new n.EventEmitter};ci.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new ci},token:ci,providedIn:"root"}),ci.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}];var pi=function(){};pi.decorators=[{type:n.NgModule,args:[{imports:[l.RouterModule.forRoot([],{useHash:!0})],exports:[l.RouterModule]}]}];var ui=function(){function t(t,e,n,i,r){var o,a;e&&e.forEach((function(e){return t.addConfig(e)})),n&&t.addConfig(n),r.setDefaultLang(null!==(a=null===(o=t.i18n.application)||void 0===o?void 0:o.defaultLanguage)&&void 0!==a?a:t.language),r.use(t.language),i.registerModule("pg-shell")}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:ni,useValue:ri,multi:!0},{provide:ni,useValue:e,multi:!0},{provide:D.EVENT_MANAGER_PLUGINS,useClass:Be,multi:!0},ai,zn,si,Kt]}},t}();ui.decorators=[{type:n.NgModule,args:[{imports:[i.EffectsModule.forRoot([]),o.HttpClientModule,r.StoreModule.forRoot({}),d.StorageModule.forRoot({LSPrefix:"ga.",IDBDBName:"guru-admin"}),f.TranslateModule.forRoot(),x.PipAppbarModule.forRoot(),C.PipNavModule.forRoot(),x.PipMediaModule.forRoot(),x.PipSidenavModule.withConfig({start:{views:[{name:"tablet",alias:"lt-md",position:x.PipSidenavPosition.Root,mode:"side",collapsed:!0,opened:!0,active:!1},{name:"mobile",alias:"lt-sm",position:x.PipSidenavPosition.Root,mode:"over"}]},end:{views:[{name:"default",position:x.PipSidenavPosition.Root,mode:"side",width:350},{name:"mobile",alias:"lt-sm",position:x.PipSidenavPosition.Root,mode:"over"}]}}),_.PipThemesModule.withConfig({themes:[_.pipWebUI2Themes.Blue]}),pi,Gn,Zn,$n.forRoot(),we,Fn]}]}],ui.ctorParameters=function(){return[{type:zn},{type:Array,decorators:[{type:n.Optional},{type:n.Inject,args:[ni]}]},{type:ei,decorators:[{type:n.Optional},{type:n.Inject,args:[ii]}]},{type:si},{type:f.TranslateService}]},t.AccessResolver=Tn,t.AccountEffects=Ae,t.AccountState=ht,t.AccountsDataService=pt,t.AccountsModule=we,t.AccountsService=_t,t.Application=je,t.ApplicationGroup=Ue,t.ApplicationGroupTile=Ee,t.ApplicationTile=Pe,t.ApplicationsEffects=En,t.ApplicationsModule=Fn,t.AuthGuard=kn,t.BrowserWindowRef=qt,t.DataPage=De,t.EmailSettings=Ie,t.EventModifiersPlugin=Be,t.Filter=_e,t.GA_CONFIG=ni,t.GA_CONFIG_FROM_FILE=ii,t.GA_SESSION_CONFIG=nt,t.GaApplicationsConfig=Me,t.GaApplicationsConfigService=Pn,t.GaApplicationsService=Mn,t.GaAskDialogComponent=ke,t.GaAskDialogModule=Re,t.GaBottomNavigationComponent=Ne,t.GaBottomNavigationModule=$e,t.GaCheckUpdateService=ai,t.GaConfig=ei,t.GaConfigService=zn,t.GaI18nConfig=Hn,t.GaMainLayoutComponent=Yn,t.GaMainLayoutModule=Qn,t.GaSessionConfig=et,t.GaSessionConfigLsKeys=tt,t.GaSessionConfigService=ct,t.GaSessionDataService=zt,t.GaSessionModule=$n,t.GaSessionService=be,t.GaSessionState=Qt,t.GaShellComponentsModule=Gn,t.GaShellConfig=Wn,t.GaShellLayoutsModule=Zn,t.GaShellModule=ui,t.I18nService=si,t.MnApplicationsDataService=Un,t.MnRightnavService=ci,t.MultiString=Ge,t.RedirectGuard=Ce,t.SessionEffects=Se,t.SideNavHeaderConfig=oi,t.SignupData=ot,t.SimpleStore=lt,t.SmsSettings=xe,t.TileIcon=Fe,t.Unsubscriber=function(t){return function(e){t=Object.assign({destroyFunc:"ngOnDestroy",destroyTime:"after"},t);var n=new Map,i=Reflect.getMetadata("subscription:name",e.prototype,"subscriber");if(Object.defineProperty(e.prototype,i||"subscriber",{get:function(){return r(this),n.get(this).unsubscribe.bind(this)},set:function(t){r(this);var e=n.get(this);if(Array.isArray(t)){if(e.namedSubscriptions.has(t[0])){var i=e.namedSubscriptions.get(t[0]);i&&"function"==typeof i.unsubscribe&&i.unsubscribe()}e.namedSubscriptions.set(t[0],t[1])}else e.subscriptions.push(t)}}),"function"!=typeof e.prototype[t.destroyFunc])throw new Error(e.prototype.constructor.name+" must implement "+t.destroyFunc+"() lifecycle hook");function r(t){n.has(t)||n.set(t,{subscriptions:[],namedSubscriptions:new Map,unsubscribe:o.bind(t)})}function o(){r(this);var t=n.get(this);Q(t.subscriptions,Array.from(t.namedSubscriptions.values())).filter((function(t){return t&&"function"==typeof t.unsubscribe})).forEach((function(t){return t.unsubscribe()}))}return e.prototype[t.destroyFunc]=function(e){r(this);var i=n.get(this);return"before"===t.destroyTime?function(){return i.unsubscribe(),n.delete(this),e.apply(this,arguments)}:function(){var t=e.apply(this,arguments);return i.unsubscribe(),n.delete(this),t}}(e.prototype[t.destroyFunc]),e}},t.UnsubscriberHandler=ft,t.UserAccount=st,t.UserSession=rt,t.WINDOW=Gt,t.WINDOW_PROVIDERS=Kt,t.WindowRef=Bt,t.WindowWrapper=Vt,t.accountInitialState=vt,t.accountReadAction=mt,t.accountReadFailureAction=St,t.accountReadSuccessAction=yt,t.accountReducer=Dt,t.accountReducerFn=Lt,t.accountUpdateAction=bt,t.accountUpdateFailureAction=wt,t.accountUpdateSuccessAction=At,t.applicationsAbortAction=We,t.applicationsCreateAction=Ye,t.applicationsCreateFailureAction=Xe,t.applicationsCreateSuccessAction=Qe,t.applicationsDeleteAction=nn,t.applicationsDeleteFailureAction=on,t.applicationsDeleteSuccessAction=rn,t.applicationsFailureAction=ze,t.applicationsFindActiveAction=an,t.applicationsInitAction=Je,t.applicationsInitialState=qe,t.applicationsReducer=jn,t.applicationsReducerFn=Cn,t.applicationsSetActiveAction=sn,t.applicationsSuccessAction=Ke,t.applicationsUpdateAction=Ze,t.applicationsUpdateFailureAction=en,t.applicationsUpdateSuccessAction=tn,t.defaultGaApplicationsConfig=Te,t.defaultGaConfig=ri,t.defaultGaI18nConfig=Jn,t.defaultGaSessionConfig=it,t.defaultGaShellConfig=Kn,t.getAccountData=xt,t.getAccountError=Mt,t.getAccountPreferences=Ut,t.getAccountState=jt,t.getAccountStoreState=Ot,t.getApplicationsActiveApplication=ln,t.getApplicationsActiveIdx=un,t.getApplicationsActiveState=vn,t.getApplicationsData=pn,t.getApplicationsError=hn,t.getApplicationsGroups=dn,t.getApplicationsState=fn,t.getApplicationsStoreState=cn,t.getApplicationsToggling=gn,t.getSessionError=he,t.getSessionIsAuthenticated=ve,t.getSessionState=ge,t.getSessionStoreState=de,t.getSessionUser=fe,t.jsonDistinctFunction=ut,t.restoreAction=Zt,t.restoreFailureAction=ee,t.restoreSuccessAction=te,t.sessionInitialState=Xt,t.sessionReducer=ye,t.sessionReducerFn=me,t.signinAbortAction=ie,t.signinAction=ne,t.signinFailureAction=oe,t.signinSuccessAction=re,t.signoutAction=pe,t.signoutFailureAction=le,t.signoutSuccessAction=ue,t.signupAction=ae,t.signupFailureAction=ce,t.signupSuccessAction=se,t.trackBy=dt,t.validateAllFields=function(t){var e=this;Object.keys(t.controls).forEach((function(n){var i=t.get(n);i instanceof p.FormControl?i.markAsTouched({onlySelf:!0}):i instanceof p.FormGroup&&e.validateAllFields(i)}))},t.windowFactory=Ht,t.windowProvider=Wt,t.ɵ0=It,t.ɵ1=Ct,t.ɵ10=mn,t.ɵ11=yn,t.ɵ12=Sn,t.ɵ13=bn,t.ɵ14=An,t.ɵ15=wn,t.ɵ16=On,t.ɵ17=In,t.ɵ18=xn,t.ɵ2=Pt,t.ɵ3=Tt,t.ɵ4=Et,t.ɵ5=Ft,t.ɵ6=kt,t.ɵ7=Rt,t.ɵ8=Nt,t.ɵ9=$t,t.ɵa=Rn,t.ɵb=Nn,t.ɵc=Dn,t.ɵd=Ln,t.ɵe=pi,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=guru-admin-shell-angular.umd.min.js.map